{"_id":"@botfather/units-agent-plugin","_rev":"2-101573d07db4860f20edb7edcfa89c90","name":"@botfather/units-agent-plugin","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.1":{"name":"@botfather/units-agent-plugin","version":"0.1.1","license":"MIT","_id":"@botfather/units-agent-plugin@0.1.1","maintainers":[{"name":"botfather","email":"mohan.tushar.11@gmail.com"}],"homepage":"https://github.com/Botfather/units/tree/main/packages/units-agent-plugin","bugs":{"url":"https://github.com/Botfather/units/issues"},"dist":{"shasum":"2fe1cf2eb1bd7ee81b9976af771501cec3efdfb6","tarball":"https://registry.npmjs.org/@botfather/units-agent-plugin/-/units-agent-plugin-0.1.1.tgz","fileCount":5,"integrity":"sha512-n/FEv+ChTj/ykjorXK878FfMlLHRqttFbo6WG4+oiwX11/JQedrUpaTuUqm2JVV8LFZwQGLmZMJ1tOG07jAR8w==","signatures":[{"sig":"MEUCIDQDI5gJJ5qQYTIlsTnnnYhe+UAbW/3x+JFdi5s0aumGAiEA2sz8V+8KVYGwijugDCwdgZXNfdDC8th0XD8Awd5ARLA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@botfather%2funits-agent-plugin@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11449},"main":"./index.js","type":"module","_from":"file:botfather-units-agent-plugin-0.1.1.tgz","types":"./index.d.ts","_npmUser":{"name":"botfather","email":"mohan.tushar.11@gmail.com"},"_resolved":"/tmp/fa87615b5fb2cdac94bca2df7163bbac/botfather-units-agent-plugin-0.1.1.tgz","_integrity":"sha512-n/FEv+ChTj/ykjorXK878FfMlLHRqttFbo6WG4+oiwX11/JQedrUpaTuUqm2JVV8LFZwQGLmZMJ1tOG07jAR8w==","repository":{"url":"git+https://github.com/Botfather/units.git","type":"git","directory":"packages/units-agent-plugin"},"_npmVersion":"11.17.0","description":"Agent-facing UI compression plugin for Units DSL context generation.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@botfather/units-compiler":"0.1.1","@botfather/units-react-adapter":"0.1.1","@botfather/units-agent-middleware":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/units-agent-plugin_0.1.1_1782196782377_0.7611565833318572","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@botfather/units-agent-plugin","version":"0.1.2","description":"Agent-facing UI compression plugin for Units DSL context generation.","license":"MIT","type":"module","repository":{"type":"git","url":"git+https://github.com/Botfather/units.git","directory":"packages/units-agent-plugin"},"homepage":"https://github.com/Botfather/units/tree/main/packages/units-agent-plugin","bugs":{"url":"https://github.com/Botfather/units/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@botfather/units-agent-middleware":"0.1.2","@botfather/units-compiler":"0.1.2","@botfather/units-react-adapter":"0.1.1"},"publishConfig":{"access":"public"},"_id":"@botfather/units-agent-plugin@0.1.2","_integrity":"sha512-qwroNy4PKb/uyPQelqxSG7HHjzK9wLT6dJiVIGdDQDvOroE4BsHGVEY1XEYjKKgso/rsvEGMzLXju72og5rpYQ==","_resolved":"/tmp/ed02423e8bef8921420957031447ec0b/botfather-units-agent-plugin-0.1.2.tgz","_from":"file:botfather-units-agent-plugin-0.1.2.tgz","_nodeVersion":"24.16.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-qwroNy4PKb/uyPQelqxSG7HHjzK9wLT6dJiVIGdDQDvOroE4BsHGVEY1XEYjKKgso/rsvEGMzLXju72og5rpYQ==","shasum":"51ec537cd7198e168539cce8362fefd4ab2f9e3c","tarball":"https://registry.npmjs.org/@botfather/units-agent-plugin/-/units-agent-plugin-0.1.2.tgz","fileCount":5,"unpackedSize":11449,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@botfather%2funits-agent-plugin@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGpsZ0hFyjAXlVHr8SFa282p9TsAISF0z0wPflNNriCuAiBUZkP46R2kOSMRtnd4l5ijRcE6pHdulz0JcjGcqVAF1Q=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dc0e1210-967c-4c4f-aeac-3acf0742e6b7"}},"directories":{},"maintainers":[{"name":"botfather","email":"mohan.tushar.11@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/units-agent-plugin_0.1.2_1782219357106_0.2572623088876116"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T06:39:42.221Z","modified":"2026-06-23T12:55:57.608Z","0.1.1":"2026-06-23T06:39:42.491Z","0.1.2":"2026-06-23T12:55:57.246Z"},"bugs":{"url":"https://github.com/Botfather/units/issues"},"license":"MIT","homepage":"https://github.com/Botfather/units/tree/main/packages/units-agent-plugin","repository":{"type":"git","url":"git+https://github.com/Botfather/units.git","directory":"packages/units-agent-plugin"},"description":"Agent-facing UI compression plugin for Units DSL context generation.","maintainers":[{"name":"botfather","email":"mohan.tushar.11@gmail.com"}],"readme":"# @botfather/units-agent-plugin\n\nAgent-facing compression plugin that turns raw UI trees into compact Units DSL context.\n\n## Install\n\n```sh\nnpm install @botfather/units-agent-plugin\n```\n\n## Usage\n\n```js\nimport { compressUiForAgent } from \"@botfather/units-agent-plugin\";\n\nconst result = await compressUiForAgent(uiTree, {\n  sourceType: \"dom\", // also supports \"a11y\", \"ir\", \"react\", and \"slack\"\n  target: \"planner\",\n  maxTokens: 600,\n  pluginConfig: {\n    libraryDir: \".units/library\",\n  },\n});\n\nconsole.log(result.dsl);\nconsole.log(result.unitsAst);\nconsole.log(result.programId);\n```\n\nFor Slack Block Kit, pass the message payload or `blocks` array with `sourceType: \"slack\"` (aliases: `block-kit`, `blockkit`, `mrkdwn`). Slack `mrkdwn` is normalized before transform and compile.\n\nCompiler output is token-optimized by default (implicit role actions and redundant leaf `name`/text duplicates are omitted unless explicitly requested in compiler options). The middleware `agent_tree` payload also deduplicates redundant `name`/`text` pairs, omits role-implicit actions, prunes empty text leaves, and omits text-node ids by default.\n\nReturns:\n- `dsl`: compressed Units source text\n- `unitsAst`: parsed Units AST\n- `programId`: selected transform program id (or `null`)\n- `tokenEstimate`: rough token estimate for the generated DSL\n- `rewrite` and `compile`: full debug payloads from middleware + compiler\n\n## Exports\n\n- `createUnitsAgentPlugin(config)`\n- `compressUiForAgent(uiTree, options)`\n","readmeFilename":"README.md"}