{"_id":"@avee1234/capture","name":"@avee1234/capture","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@avee1234/capture","version":"0.1.0","description":"Zero-dependency OpenTrajectory capture SDK + CLI — capture AI agent runs (Claude Code, Codex) into one open, vendor-neutral .ot.json format; validate, diagnose, and judge them.","type":"module","bin":{"ot":"dist/cli.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.json","test":"node --import tsx test/run.ts","validate-example":"node --import tsx src/cli.ts validate ../../examples/hello.ot.json","prepublishOnly":"npm run build && npm test"},"keywords":["opentrajectory","agent","trajectory","ai-agent","llm","evals","observability","claude-code","codex","trace","open-standard"],"homepage":"https://github.com/abhid1234/opentrajectory#readme","repository":{"type":"git","url":"git+https://github.com/abhid1234/opentrajectory.git","directory":"packages/capture"},"bugs":{"url":"https://github.com/abhid1234/opentrajectory/issues"},"license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=18"},"comment":"dependencies is intentionally empty — the shipped SDK uses only Node built-ins (corp-airlock constraint). devDependencies are build/test tooling only.","dependencies":{},"devDependencies":{"tsx":"*","typescript":"*"},"gitHead":"624ebfa4708644d76417a1089a7c7a7a76e9b27d","_id":"@avee1234/capture@0.1.0","_nodeVersion":"22.22.2","_npmVersion":"11.10.0","dist":{"integrity":"sha512-7vCc+PxoINCvv4BJtcsL+3Fs9TkQvYdELRc86//GzKqa9MUjn1e9gRDIAjlEDb80wEnWJa664QqLW4KowhJPTQ==","shasum":"9bdea5668e0b395b8a54139658014182aa7faed8","tarball":"https://registry.npmjs.org/@avee1234/capture/-/capture-0.1.0.tgz","fileCount":46,"unpackedSize":153114,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD1JPAt/DmXC2JS+yFLyrGlwC+GGsGCZy3uPoXGeQXHEwIhAIf33IElbawrJumuwjsjJNFiDfzzF5v/mo37LgGIZdsL"}]},"_npmUser":{"name":"avee1234","email":"das.abhijit34@gmail.com"},"directories":{},"maintainers":[{"name":"avee1234","email":"das.abhijit34@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capture_0.1.0_1782610445188_0.6735216437796565"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-28T01:34:05.074Z","0.1.0":"2026-06-28T01:34:05.339Z","modified":"2026-06-28T01:34:05.511Z"},"maintainers":[{"name":"avee1234","email":"das.abhijit34@gmail.com"}],"description":"Zero-dependency OpenTrajectory capture SDK + CLI — capture AI agent runs (Claude Code, Codex) into one open, vendor-neutral .ot.json format; validate, diagnose, and judge them.","homepage":"https://github.com/abhid1234/opentrajectory#readme","keywords":["opentrajectory","agent","trajectory","ai-agent","llm","evals","observability","claude-code","codex","trace","open-standard"],"repository":{"type":"git","url":"git+https://github.com/abhid1234/opentrajectory.git","directory":"packages/capture"},"bugs":{"url":"https://github.com/abhid1234/opentrajectory/issues"},"license":"MIT","readme":"# @opentrajectory/capture\n\n**Capture an AI agent run into one open, vendor-neutral `.ot.json` — then validate, diagnose, and judge it.** Zero runtime dependencies (Node built-ins only).\n\nPart of [OpenTrajectory](https://github.com/abhid1234/opentrajectory): the open format every agent can emit, and the reference tools that read it.\n\n```bash\nnpm i -D @opentrajectory/capture\n```\n\n## CLI (`ot`)\n\n```\not capture <file> [-o out] [--harness claude-code|codex|antigravity]   capture a run (auto-detected)\not validate <file.ot.json|.ot.jsonl>                              conformance check (spec §7)\not diagnose <file.ot.json>                                        offline heuristic diagnosis (no key)\not judge <file.ot.json> [--dry-run]                               fill outcome.verdict via Gemini\not to-messages <file.ot.json>                                     OpenAI-style messages\not to-otel <file.ot.json>                                         OpenTelemetry GenAI spans (OTLP/JSON)\not hook                                                           live PostToolUse hook (reads stdin)\n```\n\n```bash\n# capture a real Claude Code session, then see why it failed — no API key\nnpx ot capture ~/.claude/projects/<slug>/<session>.jsonl -o run.ot.json\nnpx ot diagnose run.ot.json\n```\n\nCapture adapters are verified first-hand against real on-disk sessions for **Claude Code**, **Codex CLI**, and **Antigravity CLI**; `ot capture` auto-detects which.\n\n## SDK\n\n```ts\nimport {\n  captureFromTranscript,   // Claude Code transcript -> Trajectory\n  captureFromRollout,      // Codex rollout -> Trajectory\n  captureFromGeminiSession,// Gemini session -> Trajectory\n  validate,                // conformance (spec §7)\n  diagnoseHeuristic,       // offline diagnosis (no key)\n  judgeTrajectory,         // LLM judge -> verdict (Gemini)\n  toMessages, toOtel,      // interop: OpenAI messages / OTel spans\n} from \"@opentrajectory/capture\";\n\nconst traj = captureFromTranscript(transcriptJsonl);\nif (validate(traj).valid) console.log(diagnoseHeuristic(traj).diagnosis); // HARNESS | TRAINING | PRODUCT | CLEAN\n```\n\nAll capture/validate/diagnose/convert runs are **zero-dependency and offline**. `judgeTrajectory` is the one paid path — it calls Gemini (`GEMINI_API_KEY`), and the trajectory is redacted of secrets at capture time.\n\n## Format\n\nA trajectory is one self-contained JSON file: ordered `steps` (each a `message`, a `tool_call` with `name`/`args`/`result`/`success`, or a `decision`), a top-level `outcome` (`status` + optional evaluator `verdict`), and `harness`/`task`/`cost`/`metadata`. Full spec + JSON Schema: https://github.com/abhid1234/opentrajectory\n\n## License\n\nMIT (code) · CC0 (the format spec). See [LICENSE](./LICENSE).\n","readmeFilename":"README.md","_rev":"1-a71425a9a6d200075daee8cb9e1c8f82"}