{"_id":"@act-spec/adapter-programmatic","name":"@act-spec/adapter-programmatic","dist-tags":{"rc":"0.2.0-rc.1","latest":"0.2.0-rc.1"},"versions":{"0.2.0-rc.1":{"name":"@act-spec/adapter-programmatic","version":"0.2.0-rc.1","description":"PRD-208 programmatic adapter (escape hatch) for the ACT (Agent Content Tree) v0.1 reference implementation. A factory that wraps user-supplied enumerate/transform into a fully PRD-200-conformant adapter, with pre-emit PRD-100 + PRD-102 schema validation, ","license":"Apache-2.0","author":{"name":"Jeremy Forsythe","email":"jeremy@act-spec.org"},"homepage":"https://act-spec.org","bugs":{"url":"https://github.com/act-spec/act/issues"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/act-spec/act.git","directory":"packages/adapter-programmatic"},"dependencies":{"ajv":"^8.17.1","ajv-formats":"^3.0.1","@act-spec/adapter-framework":"0.2.0-rc.1","@act-spec/core":"0.2.0-rc.1","@act-spec/validator":"0.2.0-rc.1"},"devDependencies":{"@vitest/coverage-v8":"^2.1.9","tsx":"^4.19.2","typescript":"^5.6.3","vitest":"^2.1.4"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","lint":"eslint src","typecheck":"tsc -p tsconfig.json --noEmit","conformance":"tsx conformance.ts"},"_id":"@act-spec/adapter-programmatic@0.2.0-rc.1","_integrity":"sha512-PfRxwEcpXUHftba4V7lffZ2yIvvAHgVS7Yxu0yXMSBLLOCTAD+ltZ+j+3EOKindkndqt438gGqGwHWJLrRpjkw==","_resolved":"/private/var/folders/yp/y7frhcvj70jgr6b8g633lghr0000gn/T/7167218f4f5cdbe288d51e0b8b1b4031/act-spec-adapter-programmatic-0.2.0-rc.1.tgz","_from":"file:act-spec-adapter-programmatic-0.2.0-rc.1.tgz","_nodeVersion":"22.19.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-PfRxwEcpXUHftba4V7lffZ2yIvvAHgVS7Yxu0yXMSBLLOCTAD+ltZ+j+3EOKindkndqt438gGqGwHWJLrRpjkw==","shasum":"0625ee110be2eb2fc3f4e5305e4151b3391d8063","tarball":"https://registry.npmjs.org/@act-spec/adapter-programmatic/-/adapter-programmatic-0.2.0-rc.1.tgz","fileCount":15,"unpackedSize":174639,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCsPr/MQIGIH+W5ivI64u5q/ZyNFG9/5Fn209hQmf98nAIgL6sEoXxsFx5UoEhSGciatpuaw9NZqoWSuiu0S70dUQM="}]},"_npmUser":{"name":"jdforsythe","email":"jdforsythe@gmail.com"},"directories":{},"maintainers":[{"name":"jdforsythe","email":"jdforsythe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapter-programmatic_0.2.0-rc.1_1777915290877_0.976531171792911"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-04T17:21:30.738Z","0.2.0-rc.1":"2026-05-04T17:21:31.038Z","modified":"2026-05-04T17:21:31.242Z"},"maintainers":[{"name":"jdforsythe","email":"jdforsythe@gmail.com"}],"description":"PRD-208 programmatic adapter (escape hatch) for the ACT (Agent Content Tree) v0.1 reference implementation. A factory that wraps user-supplied enumerate/transform into a fully PRD-200-conformant adapter, with pre-emit PRD-100 + PRD-102 schema validation, ","homepage":"https://act-spec.org","repository":{"type":"git","url":"git+https://github.com/act-spec/act.git","directory":"packages/adapter-programmatic"},"author":{"name":"Jeremy Forsythe","email":"jeremy@act-spec.org"},"bugs":{"url":"https://github.com/act-spec/act/issues"},"license":"Apache-2.0","readme":"# @act-spec/adapter-programmatic\n\nProgrammatic adapter for ACT (Agent Content Tree) — the escape hatch for\ncontent sources without a dedicated ACT adapter. A factory\n(`defineProgrammaticAdapter`) wraps user-supplied `enumerate` and\n`transform` functions into a fully conformant `Adapter`. The factory\nadds:\n\n- Pre-emit validation against `schemas/100/node.schema.json` and the applicable\n  `schemas/102/block-*.schema.json` per content block.\n- `Object.freeze` on `ctx.config` to prevent accidental mutation.\n- Source attribution: `metadata.source.adapter` defaults to `spec.name`.\n- Capability sampling probe: every Nth emission is checked against the declared\n  level.\n- Strict / recoverable failure policies for user-thrown errors.\n- Idempotent `dispose` wrapper.\n- Tolerates `Iterable | AsyncIterable | Array` returns from `enumerate`.\n\n## Status\n\nACT v0.1 internal hand-test candidate. Public release lands at v0.2.\n\n## Install\n\nUnpublished in v0.1. Consume via the workspace:\n\n```jsonc\n// package.json\n{ \"dependencies\": { \"@act-spec/adapter-programmatic\": \"workspace:*\" } }\n```\n\n## Quickstart\n\n```ts\nimport { defineProgrammaticAdapter } from '@act-spec/adapter-programmatic';\n\nexport default defineProgrammaticAdapter({\n  name: 'fixture-source',\n  enumerate: () => [\n    { id: 'intro', title: 'Introduction', body: 'Hello, ACT.' },\n  ],\n  transform: (item) => ({\n    act_version: '0.1',\n    id: item.id,\n    type: 'article',\n    title: item.title,\n    etag: 's256:AAAAAAAAAAAAAAAAAAAAAA',\n    summary: item.body.slice(0, 60),\n    content: [{ type: 'markdown', text: item.body }],\n    tokens: { summary: 4 },\n  }),\n});\n```\n\n## Convenience: `defineSimpleAdapter`\n\nFor the static-array case:\n\n```ts\nimport { defineSimpleAdapter } from '@act-spec/adapter-programmatic';\n\nexport default defineSimpleAdapter({\n  name: 'inline',\n  items: [{ id: 'a', title: 'A' }],\n  transform: (item) => ({ /* … */ }),\n});\n```\n\n## Conformance / what's tested\n\nEvery public API has a citing test in `src/programmatic.test.ts`. The\nconformance gate runs `@act-spec/validator` against the bundled fixture\ncorpus under `test-fixtures/` and exits non-zero on any gap.\n\n```bash\npnpm -F @act-spec/adapter-programmatic conformance\n```\n\n## Links\n\n- Adapter framework: [`@act-spec/adapter-framework`](../adapter-framework)\n- Repository: <https://github.com/act-spec/act>\n","readmeFilename":"README.md","_rev":"1-0be6e27704a6ea2f757a298b6faa0fcb"}