{"_id":"@avee1234/truecall","name":"@avee1234/truecall","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@avee1234/truecall","version":"0.1.0","description":"Deterministic runtime post-condition verification for AI agent tool calls.","license":"MIT","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"repository":{"type":"git","url":"git+https://github.com/abhid1234/truecall.git","directory":"packages/core"},"homepage":"https://github.com/abhid1234/truecall#readme","bugs":{"url":"https://github.com/abhid1234/truecall/issues"},"keywords":["ai","agent","tool-use","verification","post-condition","llm","reliability","mcp","claude-code","codex"],"scripts":{"typecheck":"tsc --noEmit","test":"tsx --test \"src/**/*.test.ts\"","build":"rm -rf dist && tsc -p tsconfig.build.json","prepublishOnly":"npm run build"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"gitHead":"6e04897e64aa617109008b5d29c2fd554b6db4ba","_id":"@avee1234/truecall@0.1.0","_nodeVersion":"22.22.2","_npmVersion":"11.10.0","dist":{"integrity":"sha512-9dsVQZbyupxLsRSmOR1WcsTDn1TNcc/eEFYwWcJzPPX7f0O9OJ+KP0PKCzeqWbTDg0NERY5BFTyD8HfGrpzgBQ==","shasum":"1b34de755d6d17af784bd54316062c9a8346afed","tarball":"https://registry.npmjs.org/@avee1234/truecall/-/truecall-0.1.0.tgz","fileCount":21,"unpackedSize":26107,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAXW48LXoz0EwT23djOQTHDjYYE2uBU5plXq3nOOoJdqAiEAqfOMnzM6ucf+A4fTiIF0o8wNcLzCq7RkNiHRGzOC24o="}]},"_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/truecall_0.1.0_1782180771764_0.1633774556144345"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T02:12:51.629Z","0.1.0":"2026-06-23T02:12:51.901Z","modified":"2026-06-23T02:12:52.061Z"},"maintainers":[{"name":"avee1234","email":"das.abhijit34@gmail.com"}],"description":"Deterministic runtime post-condition verification for AI agent tool calls.","homepage":"https://github.com/abhid1234/truecall#readme","keywords":["ai","agent","tool-use","verification","post-condition","llm","reliability","mcp","claude-code","codex"],"repository":{"type":"git","url":"git+https://github.com/abhid1234/truecall.git","directory":"packages/core"},"bugs":{"url":"https://github.com/abhid1234/truecall/issues"},"license":"MIT","readme":"# truecall\n\n**Deterministic runtime post-condition verification for AI agent tool calls.**\n\nWhen an agent's tool returns `success` but didn't actually change the world (the file wasn't written, the\nrecord wasn't saved), TrueCall catches it with a cheap deterministic check and hands the agent a structured\ncorrection — instead of letting a silent failure ship.\n\nThis is the zero-dependency core: the contract format and the verifier. For harness integration (Claude\nCode, Codex), see the adapters in the [monorepo](https://github.com/abhid1234/truecall).\n\n## Install\n\n```bash\nnpm install @avee1234/truecall\n```\n\nZero runtime dependencies. Ships compiled ESM + type declarations; runs on Node 18+.\n\n## Use\n\nDeclare a **contract** — a cheap post-condition that confirms intent — and wrap your tool with it:\n\n```ts\nimport { contract, wrapTool } from \"@avee1234/truecall\";\n\nconst createFile = wrapTool(\n  contract({\n    tool: \"create_file\",\n    description: \"a non-empty file exists at the requested path\",\n    post: { check: \"file_exists\", path: \"{{args.path}}\", minSize: 1 },\n  }),\n  realCreateFile, // your tool implementation\n);\n\nconst r = await createFile({ path: \"/tmp/out.txt\", contents: \"hi\" });\nif (!r.ok) {\n  // r.signal: { expected, actual, message, remediation? } — feed it back to the agent\n}\n```\n\nIf `realCreateFile` returns `{ status: \"success\" }` but never writes the file, `r.ok` is `false` and\n`r.signal` explains the silent failure.\n\n### Built-in checks (plus a custom escape hatch)\n\n- `file_exists` — a file/dir exists, optional `minSize` / `contains`\n- `http` — re-fetch a resource and assert status / a JSON field\n- `shell` — run a read-only probe, assert exit code / stdout\n- `result` — assert on the tool's own returned payload\n- `verify` — a custom async predicate for anything else\n\nVerification is **deterministic** — there is no LLM-judge check type. If a verifier can't produce a verdict\n(throws, missing template path, timeout), TrueCall is **fail-closed**: it reports \"could not verify,\" never a\nsilent pass.\n\n## API\n\n- `contract(def)` — validate and build a contract (throws on an invalid definition).\n- `validateContract(def): string[]` — return validation errors (empty = valid).\n- `runContract(contract, ctx): Promise<VerifyResult>` — run a contract against `{ tool, args, result }`.\n- `runCheck(check, ctx)` — run a single check.\n- `wrapTool(contract, toolFn)` — wrap a tool so its success is gated by the post-condition.\n\nFull contract format: [`docs/spec.md`](https://github.com/abhid1234/truecall/blob/main/docs/spec.md).\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md","_rev":"1-fe081e4228d16033504a77536677d5c7"}