{"_id":"@code-first-agents/tool","_rev":"9-c3caf499096d9770ecbc8d1a042b5ede","name":"@code-first-agents/tool","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"@code-first-agents/tool","version":"0.1.0","license":"MIT","_id":"@code-first-agents/tool@0.1.0","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"76076f2fa95db8d6bb5dbe8504bce4addae22571","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.1.0.tgz","fileCount":22,"integrity":"sha512-ODs009RRY3kh3oY65nmy3Zv1StNuo7O7H/8nWISgp6PMu2TeojcClRDUR/pS9xCfZM5zr0e2zO8B5RAv2N4efg==","signatures":[{"sig":"MEUCIDlDaSccKtOM8/KvRY1PV61Mq3Xgj2w1T9rg/5gWcDR/AiEAylY+WO7XLEllk5Zv8RfXRKobaecVvwd3Zc1xROQESbw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49745},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7ef0a4e69970fca3093c1a1bb38a0c776339439e","scripts":{"dev":"bun run --watch src/index.ts","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && tsc -p tsconfig.build.json","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build"},"_npmUser":{"name":"beogip","email":"beogip@gmail.com"},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"10.9.3","description":"Code-first agent tool definitions with Zod schemas","directories":{},"_nodeVersion":"22.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"latest","bun-types":"latest","typescript":"latest","@biomejs/biome":"latest","semantic-release":"latest","@semantic-release/git":"latest","@semantic-release/npm":"latest","@semantic-release/github":"latest","@semantic-release/changelog":"latest"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.1.0_1779627491856_0.8149165747303202","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@code-first-agents/tool","version":"0.1.1","license":"MIT","_id":"@code-first-agents/tool@0.1.1","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"f44b611f2725ce05cbb297cd90a5694be760cfe6","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.1.1.tgz","fileCount":22,"integrity":"sha512-xxi1ybV+9VEpWMc6wv9I8Gp/76dj019Lb1hwWqoHznaaVl2Hl52R5lwZlCyiMhaPSdCBN0XbmpII1rA0sx4CbQ==","signatures":[{"sig":"MEUCIAFDfjfnI10lAUc1qkcFHFGz8F8Sp80Vce8NUGC7A+YDAiEAxauEeqETkhysOYVNs5VFJJX+tZN0vOfqNfS3EgPHFKM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49746},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5ce163c8b438e16d272099e3dcf1c29eb63d11df","scripts":{"dev":"bun run --watch src/index.ts","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && tsc -p tsconfig.build.json","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"11.12.1","description":"Code-first agent tool definitions with Zod schemas","directories":{},"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"latest","bun-types":"latest","typescript":"latest","@biomejs/biome":"latest","semantic-release":"latest","@semantic-release/git":"latest","@semantic-release/npm":"latest","@semantic-release/github":"latest","@semantic-release/changelog":"latest"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.1.1_1779629016061_0.8626208957502899","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@code-first-agents/tool","version":"0.1.2","license":"MIT","_id":"@code-first-agents/tool@0.1.2","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"32c47a99401fdded818af38eae696c96def9f8ae","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.1.2.tgz","fileCount":22,"integrity":"sha512-Z+FJQBghfEhZs/TO76IbODpqcLa6Q98J5WNid+qjuaFLGhJlMSDeHmZTL9cFS6xdfDHMl2u52l/dYHr1OQUK9g==","signatures":[{"sig":"MEQCIAqf8ynj4CfH9bx+E20Tsvy6R8S1TOVNcysEOT9u1EmWAiBfUq9wTGySw+6SW1Nq2XKLKAAKDYx1RPdK71es0a1pTw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54205},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"65b134b5938ce325aa85638bb81d2dc3a2f429c8","scripts":{"dev":"bun run --watch src/index.ts","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && tsc -p tsconfig.build.json","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"11.12.1","description":"Code-first agent tool definitions with Zod schemas","directories":{},"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"latest","bun-types":"latest","typescript":"latest","@biomejs/biome":"latest","semantic-release":"latest","@semantic-release/git":"latest","@semantic-release/npm":"latest","@semantic-release/github":"latest","@semantic-release/changelog":"latest"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.1.2_1780847513099_0.4170689147177715","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@code-first-agents/tool","version":"0.1.3","license":"MIT","_id":"@code-first-agents/tool@0.1.3","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"b6e8e4a7be4277cc93612cf6c8bd61c223573ad1","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.1.3.tgz","fileCount":22,"integrity":"sha512-xDE72Wqj1BoKvgN3nHDo0XB8Vq2T9M+w044k9oZZehjxHL1ow1xRYPYeJATGbx24rXczqGPJ89MJ46NNz1ju+w==","signatures":[{"sig":"MEYCIQCKy4FBU8rCYP2SM5t64PkMBklhQbX3hMlOb2/ImgZmBAIhAOZpmLDWRqQyNajDByR/E3taZIAam4DPOdn7ZfTfxGXf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54205},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7a6e3fc7975ecc6a06e05ebc2cb86e05c991c9ad","scripts":{"dev":"bun run --watch src/index.ts","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && tsc -p tsconfig.build.json","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"11.12.1","description":"Code-first agent tool definitions with Zod schemas","directories":{},"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"latest","bun-types":"latest","typescript":"latest","@biomejs/biome":"latest","semantic-release":"latest","@semantic-release/git":"latest","@semantic-release/npm":"latest","@semantic-release/github":"latest","@semantic-release/changelog":"latest"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.1.3_1780848048030_0.3555319185176933","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@code-first-agents/tool","version":"0.1.4","keywords":["ai-agents","llm-tools","tool-use","zod","cli-tools","structured-output","deterministic-tools","code-first-agents"],"license":"MIT","_id":"@code-first-agents/tool@0.1.4","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"c429250d78e53bba8803f2e2cd955e100fbed06d","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.1.4.tgz","fileCount":22,"integrity":"sha512-nSKsvoxjVgYrfDKGu6t8Tp0bMZRI224XjNJVvIe+gUpopHdToPxU6rG1exYQcxYvRVw/ME/axfn9QvtOqMVT5g==","signatures":[{"sig":"MEUCIA78mOzWBGn99FupulELhzi9Dmq5TIzxs8x572lOJ7AUAiEAnl3JvC1eNhGmTk0OQXoLsUewLRwrSssUk1Vr8oLX9wI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54636},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ee519c6c49504c4f6c307f6b7b7cdd22d559d194","scripts":{"dev":"bun run --watch src/index.ts","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && tsc -p tsconfig.build.json","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"11.12.1","description":"A code-first-agents framework for building deterministic CLI tools that LLM agents can discover, validate, and invoke with zero guesswork. Powered by Zod schemas and structured output contracts.","directories":{},"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"latest","bun-types":"latest","typescript":"latest","@biomejs/biome":"latest","semantic-release":"latest","@semantic-release/git":"latest","@semantic-release/npm":"latest","@semantic-release/github":"latest","@semantic-release/changelog":"latest"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.1.4_1780849786749_0.4142824519907937","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@code-first-agents/tool","version":"0.1.5","keywords":["ai-agents","llm-tools","tool-use","zod","cli-tools","structured-output","deterministic-tools","code-first-agents"],"license":"MIT","_id":"@code-first-agents/tool@0.1.5","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"0dd8de6aed2d11d2efc1d2302a893b1be8bd20e9","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.1.5.tgz","fileCount":5,"integrity":"sha512-6pCGFqJlxrLdVqRubxfWvaDxmaJhcJuA3Ya7La012SWeZa7N0qTErHkB0jXlVMmp3txg7tnXXaf8iPHkbav+uQ==","signatures":[{"sig":"MEUCIQCKRIYG7j5+y/eSE1xnmfMiocZQUKwpC/KfPbZjk409DQIgCD93d1jBPp1BlGFGBI6ncIGKPYRfCWsOWzOt9nQV7JM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":38091},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"24ce25614eeb0e2b0bc47aacab7dd032ac557561","scripts":{"dev":"bun run --watch src/index.ts","attw":"attw --pack --ignore-rules cjs-resolves-to-esm","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && dts-bundle-generator --project tsconfig.json -o dist/index.d.ts src/index.ts","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build && bun run attw"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"11.12.1","description":"A code-first-agents framework for building deterministic CLI tools that LLM agents can discover, validate, and invoke with zero guesswork. Powered by Zod schemas and structured output contracts.","directories":{},"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"latest","bun-types":"latest","typescript":"latest","@biomejs/biome":"latest","semantic-release":"latest","dts-bundle-generator":"latest","@arethetypeswrong/cli":"latest","@semantic-release/git":"latest","@semantic-release/npm":"latest","@semantic-release/github":"latest","@semantic-release/changelog":"latest"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.1.5_1780889391000_0.3942596011899009","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@code-first-agents/tool","version":"0.2.0","keywords":["ai-agents","llm-tools","tool-use","zod","cli-tools","structured-output","deterministic-tools","code-first-agents"],"license":"MIT","_id":"@code-first-agents/tool@0.2.0","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"31fe554f2c1b2728e0c270146b3e5b8d3cfd472a","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.2.0.tgz","fileCount":5,"integrity":"sha512-XR7aK3DNZGSQg78dYi2BvB5yPozorNSNL0xhh+OM9UVhHixBaQahO/Fkk3fi0RJZfDuNU9PIGSd+SEv51K2VRw==","signatures":[{"sig":"MEYCIQD2wYLciLW9Q7EXjF0oF873mNEelrPErcbl5ti61wrYMgIhAJizreaJXcMxglW6S1aWJo5Jl+k0t2TQRfN0bYvyNs8o","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":40162},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"989d9c65f6737f7383675ed4541289b86b310bf7","scripts":{"dev":"bun run --watch src/index.ts","attw":"attw --pack --ignore-rules cjs-resolves-to-esm","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && dts-bundle-generator --project tsconfig.json -o dist/index.d.ts src/index.ts","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build && bun run attw"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"11.12.1","description":"A code-first-agents framework for building deterministic CLI tools that LLM agents can discover, validate, and invoke with zero guesswork. Powered by Zod schemas and structured output contracts.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"^2.1.4","bun-types":"^1.3.11","typescript":"^7.0.2","@biomejs/biome":"^2.4.10","semantic-release":"^25.0.3","dts-bundle-generator":"^9.5.1","@arethetypeswrong/cli":"^0.18.3","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.5","@semantic-release/github":"^12.0.8","@semantic-release/changelog":"^6.0.3"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.2.0_1785282751937_0.5836547872325413","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@code-first-agents/tool","version":"0.3.0","keywords":["ai-agents","llm-tools","tool-use","zod","cli-tools","structured-output","deterministic-tools","code-first-agents"],"license":"MIT","_id":"@code-first-agents/tool@0.3.0","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"homepage":"https://github.com/beogip/code-first-agents-tool#readme","bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"dist":{"shasum":"f48892eec4e3b04af029db819a9131df76cea0c5","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.3.0.tgz","fileCount":5,"integrity":"sha512-qOzk66x2hsl+DfekwHdNYlligbEju5emOIrEIADTLOO1mZRuK7YmX4zdTtYgrOWVqFq7DbCoEGbukkdEyoUt3A==","signatures":[{"sig":"MEYCIQC8d74KemSsoZgqFYWu9Wop7KyZDKvSe3lWfdrEPRNnWwIhAM7w99Gen18pA4leGWhhotQG6oM3vMr3HH115y1nTSQ7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49609},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d383d8709252e4925c9e9337fed10167dcebc322","scripts":{"dev":"bun run --watch src/index.ts","attw":"attw --pack --ignore-rules cjs-resolves-to-esm","lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && dts-bundle-generator --project tsconfig.json -o dist/index.d.ts src/index.ts","check":"biome check --write .","format":"biome format --write .","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build && bun run attw"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"repository":{"url":"git+https://github.com/beogip/code-first-agents-tool.git","type":"git"},"_npmVersion":"11.12.1","description":"A code-first-agents framework for building deterministic CLI tools that LLM agents can discover, validate, and invoke with zero guesswork. Powered by Zod schemas and structured output contracts.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","lefthook":"^2.1.4","bun-types":"^1.3.11","typescript":"^7.0.2","@biomejs/biome":"^2.4.10","semantic-release":"^25.0.3","dts-bundle-generator":"^9.5.1","@arethetypeswrong/cli":"^0.18.3","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.5","@semantic-release/github":"^12.0.8","@semantic-release/changelog":"^6.0.3"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tool_0.3.0_1785346105848_0.95503619819361","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@code-first-agents/tool","version":"0.3.1","description":"A code-first-agents framework for building deterministic CLI tools that LLM agents can discover, validate, and invoke with zero guesswork. Powered by Zod schemas and structured output contracts.","keywords":["ai-agents","llm-tools","tool-use","zod","cli-tools","structured-output","deterministic-tools","code-first-agents"],"bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"license":"MIT","homepage":"https://github.com/beogip/code-first-agents-tool#readme","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/beogip/code-first-agents-tool.git"},"scripts":{"dev":"bun run --watch src/index.ts","build":"rm -rf dist && bun build src/index.ts --outdir dist --format esm --target node --packages external && dts-bundle-generator --project tsconfig.json -o dist/index.d.ts src/index.ts","test":"bun test","lint":"biome lint .","format":"biome format --write .","check":"biome check --write .","attw":"attw --pack --ignore-rules cjs-resolves-to-esm","prepare":"test -d .git && lefthook install || true","prepublishOnly":"bun run build && bun run attw"},"peerDependencies":{"zod":"^4.0.0"},"devDependencies":{"zod":"^4.0.0","@arethetypeswrong/cli":"^0.18.3","@biomejs/biome":"^2.4.10","bun-types":"^1.3.11","dts-bundle-generator":"^9.5.1","lefthook":"^2.1.4","semantic-release":"^25.0.3","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.8","@semantic-release/npm":"^13.1.5","typescript":"^7.0.2"},"gitHead":"d9fbc94a2198a2e3c61b5d6f297bd5fe4c0c0b47","_id":"@code-first-agents/tool@0.3.1","_nodeVersion":"22.23.1","_npmVersion":"11.12.1","dist":{"integrity":"sha512-ZaBcT5kVm5i9lLu8IbqrY3hR9xMCOV47PPWwUExLL80JZJxiCXkg4s85S/fLikql0vUPWZru8UW7MfTRu+GOuQ==","shasum":"4ab8b078655a605387218f25fcd970f4b1f8c5e8","tarball":"https://registry.npmjs.org/@code-first-agents/tool/-/tool-0.3.1.tgz","fileCount":5,"unpackedSize":54873,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@code-first-agents%2ftool@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCIAlvFvDZ2Av+o/aFiAnJgq9JPcs7Fro1PBtswVlNuHwIgbKrHbWFtMYVMe10NS9MT52DsIzEEA2UVzvuiEJrYeWk="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1dbd4a53-56a7-43e7-b105-2170fff4ae89"}},"directories":{},"maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tool_0.3.1_1785365076785_0.2237665357287668"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-24T12:58:11.754Z","modified":"2026-07-29T22:44:37.306Z","0.1.0":"2026-05-24T12:58:11.990Z","0.1.1":"2026-05-24T13:23:36.539Z","0.1.2":"2026-06-07T15:51:53.242Z","0.1.3":"2026-06-07T16:00:48.161Z","0.1.4":"2026-06-07T16:29:46.883Z","0.1.5":"2026-06-08T03:29:51.120Z","0.2.0":"2026-07-28T23:52:32.085Z","0.3.0":"2026-07-29T17:28:26.014Z","0.3.1":"2026-07-29T22:44:36.974Z"},"bugs":{"url":"https://github.com/beogip/code-first-agents-tool/issues"},"license":"MIT","homepage":"https://github.com/beogip/code-first-agents-tool#readme","keywords":["ai-agents","llm-tools","tool-use","zod","cli-tools","structured-output","deterministic-tools","code-first-agents"],"repository":{"type":"git","url":"git+https://github.com/beogip/code-first-agents-tool.git"},"description":"A code-first-agents framework for building deterministic CLI tools that LLM agents can discover, validate, and invoke with zero guesswork. Powered by Zod schemas and structured output contracts.","maintainers":[{"name":"beogip","email":"beogip@gmail.com"}],"readme":"# @code-first-agents/tool\n\n![CI](https://github.com/beogip/code-first-agents-tool/actions/workflows/ci.yml/badge.svg)\n[![npm](https://img.shields.io/npm/v/@code-first-agents/tool)](https://www.npmjs.com/package/@code-first-agents/tool)\n\nTypeScript implementation of the [Code-First Agents](https://code-first-agents.com/patterns/deterministic-tools.html) pattern. Provides a `Tool` base class that enforces the tool contract: deterministic CLI tools with Zod input/output schemas, JSON envelope output, self-describing introspection (`--schema`, `--help`), and always-exit-0 semantics.\n\n**Key idea:** deterministic work lives in code (Tools), the LLM orchestrates judgment (Skills). This library is the Tool side.\n\n> ℹ️ This project is maintained in spare time. Issues and pull requests are very\n> welcome — please bear with best-effort response times.\n\n## Installation\n\n```bash\nbun add @code-first-agents/tool zod@^4\n# or\nnpm install @code-first-agents/tool zod@^4\n```\n\nPeer dependency: **Zod v4** (`^4.0.0`).\n\n## Usage\n\nA `Tool` registers subcommands — each with a Zod input schema, an output schema, and a handler — then dispatches via CLI args or programmatic invocation.\n\n### Minimal example\n\n```ts\n#!/usr/bin/env bun\nimport { z } from \"zod\";\nimport { Tool } from \"@code-first-agents/tool\";\n\nconst tool = new Tool({\n  name: \"math\",\n  description: \"Basic math operations\",\n});\n\ntool.dataSubcommand({\n  name: \"multiply\",\n  description: \"Multiply two numbers\",\n  input: z.object({\n    a: z.coerce.number(),\n    b: z.coerce.number(),\n  }).strict(),\n  output: { product: z.number() },\n  handler: ({ a, b }) => ({\n    message: \"multiplied\",\n    product: a * b,\n  }),\n});\n\ntool.run(process.argv.slice(2));\n```\n\nRun it from the CLI:\n\n```bash\nbun run math.ts multiply --a 6 --b 7\n# → {\"ok\":true,\"message\":\"multiplied\",\"product\":42}\n```\n\n### Output types\n\nEvery tool output is one of the three tool types the spec defines, so there is one registration method per type. In each of them, `output` declares **only the fields your tool returns** — the `{ ok, message }` envelope is composed for you, and TypeScript infers the handler's return type from it.\n\n**Data** (raw facts for the LLM to interpret):\n\n```ts\ntool.dataSubcommand({\n  name: \"greet\",\n  description: \"Greet someone by name\",\n  input: z.object({ name: z.string() }).strict(),\n  output: { greeting: z.string() },\n  handler: ({ name }) => ({\n    message: `greeted ${name}`,\n    greeting: `hello ${name}`,\n  }),\n});\n```\n\n**Classification** (a discrete category the skill can branch on):\n\n```ts\ntool.classificationSubcommand({\n  name: \"report\",\n  description: \"Emit a report classified by log level\",\n  input: z.object({\n    level: z.enum([\"info\", \"debug\"]).default(\"info\"),\n  }).strict(),\n  output: { classification: z.enum([\"info\", \"debug\"]) },\n  handler: ({ level }) => ({\n    message: `report generated (level=${level})`,\n    classification: level,\n  }),\n});\n```\n\n`output` **must** declare a `classification` key — the enum is yours to choose, so omitting it is a compile error. Extra fields sit alongside it.\n\n**Procedure** (a verbatim procedure for the LLM to execute):\n\n```ts\ntool.procedureSubcommand({\n  name: \"instruct\",\n  description: \"Emit a verbatim instruction set\",\n  input: z.object({}).strict(),\n  output: { topic: z.string() },\n  handler: () => ({\n    message: \"instructions generated\",\n    instructions: \"## Step 1\\nDo the thing.\",\n    topic: \"setup\",\n  }),\n});\n```\n\n`instructions` is always a required string, so it is composed for you rather than declared — pass `output` only for extras, and omit it entirely when there are none.\n\n### Handler contract\n\n- Handlers return the output shape **without `ok`** — the framework stamps `ok: true` automatically.\n- Handlers always return a `message: string` describing what happened.\n- The fields fixed by the tool type (`ok`, `message`, `instructions`) are never declared in `output`; the ones you choose (`classification`, your own data) always are.\n- Input schemas should use `.strict()` to reject unknown flags.\n- Handlers can be sync or async.\n\n### Error handling\n\nAll errors exit with code 0 and return `{ ok: false, error: \"...\", ... }`. Throw `ToolError` for domain-specific errors:\n\n```ts\nimport { ToolError } from \"@code-first-agents/tool\";\n\ntool.dataSubcommand({\n  name: \"validate\",\n  description: \"Validate a config file\",\n  input: z.object({ path: z.string() }).strict(),\n  output: {},\n  handler: ({ path }) => {\n    throw new ToolError(\"validation_failed\", `Config at '${path}' is invalid`);\n  },\n});\n```\n\nThe framework also handles: `unknown_subcommand`, `input_validation_error`, `schema_violation`, `non_object_return`, and `unexpected_error`.\n\n### Built-in subcommands\n\nEvery tool gets `schema` and `help` for free:\n\n```bash\nbun run math.ts schema   # JSON Schema for all subcommands\nbun run math.ts help     # Human-readable subcommand listing\n```\n\nThese are auto-registered — you cannot override them.\n\n### Programmatic invocation\n\nUse `.invoke()` to call a subcommand in-process (useful in tests):\n\n```ts\nconst result = await tool.invoke(\"multiply\", { a: 6, b: 7 });\n// → { ok: true, message: \"multiplied\", product: 42 }\n```\n\n## Examples\n\nA complete, clonable tool lives in [`examples/`](examples/) — run it and compare the JSON, no build step required:\n\n```bash\nbun run examples/changeset.ts size --files 12 --additions 340 --deletions 50\n# → {\"ok\":true,\"message\":\"changeset classified as large\",\"classification\":\"large\",\"total_lines\":390}\n```\n\n`examples/changeset.ts` is one tool that demonstrates all three tool types (data, classification, procedure). See [`examples/README.md`](examples/README.md) for the full walkthrough.\n\n## API Reference\n\nAll exports come from the package root (`@code-first-agents/tool`). See the\n[spec](https://code-first-agents.com/patterns/deterministic-tools.html) for the\ncontract these implement.\n\n| Export                       | Kind     | Purpose                                                                                  |\n| ---------------------------- | -------- | ---------------------------------------------------------------------------------------- |\n| `Tool`                       | class    | The orchestrator. Construct with `{ name, description }`, register subcommands, dispatch. |\n| `tool.dataSubcommand(spec)` | method | Register a **data** subcommand — raw signals for the LLM to interpret. `output` is a Zod shape of your own fields; pass `{}` for envelope-only output. Declaring `ok` or `message` is rejected. |\n| `tool.classificationSubcommand(spec)` | method | Register a **classification** subcommand — a discrete category to branch on. `output` must declare a `classification` key (commonly `z.enum(...)`), plus any extras. Declaring `ok` or `message` is rejected. |\n| `tool.procedureSubcommand(spec)` | method | Register a **procedure** subcommand — a verbatim procedure for the LLM. `instructions` is composed for you; `output` is optional and carries extras only. Declaring `ok`, `message` or `instructions` is rejected. |\n| `tool.run(argv)`             | method   | Parse CLI args, dispatch, print the JSON envelope, and `process.exit(0)`.                 |\n| `tool.invoke(name, args)`    | method   | Call a subcommand in-process; returns the envelope object (useful in tests).             |\n| `ToolError`                  | class    | Throw inside a handler for domain-specific errors: `new ToolError(code, message, detail?)`. Optional `detail` (string or object) is included in the error envelope's `detail` field. |\n| `schema` (builtin)           | command  | Auto-registered. Emits JSON Schema for every subcommand. Not user-overridable.           |\n| `help` (builtin)             | command  | Auto-registered. Emits a human-readable subcommand listing. Not user-overridable.        |\n\nEach registration method takes a spec of `{ name, description, input, output, handler }`.\nThe matching spec types (`DataTypeSubcommandSpec`, `ClassificationTypeSubcommandSpec`,\n`ProcedureTypeSubcommandSpec`) and composed-schema types (`DataTypeSchema`,\n`ClassificationTypeSchema`, `ProcedureTypeSchema`, `ClassificationShape`) are exported for\nconsumers who need to name them.\n\nEvery successful result is the envelope `{ ok: true, message, ... }`; every error is\n`{ ok: false, error, ... }` with exit code `0`.\n\n### Reserved envelope fields\n\n`output` carries your own fields only — the envelope keys are composed for you, and\nredeclaring one is rejected instead of merged.\n\n| Call surface                                        | Reserved keys                       |\n| --------------------------------------------------- | ----------------------------------- |\n| `tool.dataSubcommand` / `dataTypeOutput`             | `ok`, `message`                     |\n| `tool.classificationSubcommand`                     | `ok`, `message`                     |\n| `classificationTypeOutput(enum, extras)`            | `ok`, `message`, `classification`   |\n| `tool.procedureSubcommand` / `procedureTypeOutput`  | `ok`, `message`, `instructions`     |\n\n`classification` is legal in `classificationSubcommand`'s `output` — the enum is yours\nto declare, and the method routes it into place for you. On the standalone\n`classificationTypeOutput` it **is** reserved, because there the enum is already the\nfirst argument, so a `classification` among the extras would override it.\n\nWithout this, your field would win the spread and silently replace the envelope\ncontract with a weaker Zod type, so the tool could emit `ok: true` with the field\nmissing. Instead it fails loudly, at registration time:\n\n```ts\ntool.procedureSubcommand({\n  name: \"review\",\n  description: \"Emit a review procedure\",\n  input: z.object({}).strict(),\n  output: { instructions: z.string().optional() },\n  handler: () => ({ message: \"generated\", instructions: \"## Step 1\\nDo it.\" }),\n});\n// RangeError: output shape redeclares reserved envelope field(s): instructions —\n// the output helper composes these, so declaring them would silently override\n// the envelope contract\n```\n\nTypeScript rejects the same shape before it ever runs, on both the registration\nmethods and the standalone output helpers. One gap worth knowing: a shape widened to\nan index signature (`const shape: z.ZodRawShape = { ... }`) has no per-key type left\nfor the compile-time check to see, so it compiles — the runtime guard still throws.\n\n## Development\n\n**Prerequisites:** [Bun](https://bun.sh) >= 1.0\n\n```bash\ngit clone https://github.com/beogip/code-first-agents-tool.git\ncd code-first-agents-tool\nbun install\n```\n\n| Command          | Description                     |\n| ---------------- | ------------------------------- |\n| `bun run dev`    | Re-run `src/index.ts` on change (watch) |\n| `bun run build`  | Compile to `dist/` (bun + tsc)  |\n| `bun test`       | Run tests                       |\n| `bun run check`  | Lint + format (Biome, auto-fix) |\n| `bun run lint`   | Lint only                       |\n| `bun run format` | Format only                     |\n\n## Project Structure\n\n```\nsrc/          # Source code\ntests/        # Test files (*.test.ts)\ndist/         # Build output (git-ignored)\n```\n\n## Git Hooks\n\n[Lefthook](https://github.com/evilmartians/lefthook) runs automatically after `bun install` (via the `prepare` script):\n\n- **pre-commit** — Biome checks and auto-fixes staged files\n- **commit-msg** — Validates [Conventional Commits](https://www.conventionalcommits.org/) format\n\n## Releases\n\nReleases are automated via [semantic-release](https://semantic-release.gitbook.io/) on every push to `main`:\n\n- `feat:` → minor release\n- `fix:` → patch release\n- `feat!:` or `BREAKING CHANGE:` → major release\n\nThe CI workflow handles changelog generation, npm publishing, GitHub releases, and version bumping automatically.\n\n## The Code-First Agents Pattern\n\nThis library implements the tool contract from the [Code-First Agents spec](https://code-first-agents.com/patterns/deterministic-tools.html). The spec defines a separation principle:\n\n- **Tools** (this library) — deterministic, no LLM calls, Zod-validated I/O, JSON envelope output.\n- **Skills** — LLM-powered orchestrators that call tools and apply judgment.\n\nIf you're new to the pattern, start with the [spec repo](https://github.com/beogip/code-first-agents) for the full picture of how tools, skills, and agents compose together.\n\n## Contributing\n\nContributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the\nissue-first workflow, development setup, and commit conventions, and please review\nthe [Code of Conduct](CODE_OF_CONDUCT.md) before participating.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for the release history, generated automatically\nby semantic-release.\n\n## License\n\n[MIT](LICENSE)\n\n","readmeFilename":"README.md"}