{"_id":"@atelier-oss/agent","_rev":"5-daf13cc93c9c4d2f395ce400569c3613","name":"@atelier-oss/agent","dist-tags":{"latest":"0.4.0"},"versions":{"0.0.1":{"name":"@atelier-oss/agent","version":"0.0.1","license":"MIT","_id":"@atelier-oss/agent@0.0.1","maintainers":[{"name":"prettyfly","email":"alex@prettyflyforai.com"}],"homepage":"https://github.com/atelier-oss/atelier#readme","bugs":{"url":"https://github.com/atelier-oss/atelier/issues"},"dist":{"shasum":"7ee2d71436c1e1e2b6525ea3763b269b2f8cdc97","tarball":"https://registry.npmjs.org/@atelier-oss/agent/-/agent-0.0.1.tgz","fileCount":11,"integrity":"sha512-hkH/2VBetgRjMBS9LQUqFH5GUinkSdGCm7ynrhU1APXvGn+zvNMUh+fHKQ2DhjCYC5RQ8sOwFeKTn1Yidv1V+A==","signatures":[{"sig":"MEUCIQDyiG9v6Dkaz5QAb6+dDCOn/NS9KB2H9s204mzOzriqFAIgCsBIfOQ5/U9fLOIiN/py8+NcyASAn0htqdTHZ2L8rlo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atelier-oss%2fagent@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23543},"main":"./dist/index.js","type":"module","_from":"file:atelier-oss-agent-0.0.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"eval":"tsx eval/runner.ts","test":"vitest run","build":"tsup src/index.ts --format esm --dts --clean --target node20","typecheck":"tsc --noEmit"},"_npmUser":{"name":"prettyfly","email":"alex@prettyflyforai.com"},"_resolved":"/tmp/983cd17214ec7915144b2128c1d9d3c8/atelier-oss-agent-0.0.1.tgz","_integrity":"sha512-hkH/2VBetgRjMBS9LQUqFH5GUinkSdGCm7ynrhU1APXvGn+zvNMUh+fHKQ2DhjCYC5RQ8sOwFeKTn1Yidv1V+A==","repository":{"url":"git+https://github.com/atelier-oss/atelier.git","type":"git","directory":"packages/agent"},"_npmVersion":"10.8.2","description":"Atelier Design Agent — text-brief-to-token-conformant React/Tailwind code via Sonnet + atelier_classify. Phase 0 skeleton.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@anthropic-ai/sdk":"^0.32.1","@atelier-oss/classify":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.0","vitest":"^2.1.5","typescript":"^5.6.3","@types/node":"^20.17.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.0.1_1778252706214_0.3305076643915472","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@atelier-oss/agent","version":"0.1.0","license":"MIT","_id":"@atelier-oss/agent@0.1.0","maintainers":[{"name":"prettyfly","email":"alex@prettyflyforai.com"}],"homepage":"https://github.com/atelier-oss/atelier#readme","bugs":{"url":"https://github.com/atelier-oss/atelier/issues"},"dist":{"shasum":"f983b8894f5e41e1280d9b0f932661dd68f56165","tarball":"https://registry.npmjs.org/@atelier-oss/agent/-/agent-0.1.0.tgz","fileCount":22,"integrity":"sha512-WP+4OuPuJzHrQhgjq3nEiJoHc1p1Ly1xSV5TnbU5GDbr3b2l9lzPtBijclWJ4cLnkEyR0p7Fq8nryDEUJxWfPQ==","signatures":[{"sig":"MEYCIQC4snCB34+7k9Gif2fFJ6ONAKxecb0HuM9dA/abeoDGfAIhAJWAhPm5RLqCm8AvSAeHHUevjGJHQISsSglTiuTj6Aef","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atelier-oss%2fagent@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":45801},"main":"./dist/index.js","type":"module","_from":"file:atelier-oss-agent-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"eval":"tsx eval/runner.ts","test":"vitest run","build":"tsup src/index.ts --format esm --dts --clean --target node20","typecheck":"tsc --noEmit"},"_npmUser":{"name":"prettyfly","email":"alex@prettyflyforai.com"},"_resolved":"/tmp/90af0dba1073a6e9c131567fc387ff8b/atelier-oss-agent-0.1.0.tgz","_integrity":"sha512-WP+4OuPuJzHrQhgjq3nEiJoHc1p1Ly1xSV5TnbU5GDbr3b2l9lzPtBijclWJ4cLnkEyR0p7Fq8nryDEUJxWfPQ==","repository":{"url":"git+https://github.com/atelier-oss/atelier.git","type":"git","directory":"packages/agent"},"_npmVersion":"10.8.2","description":"Atelier Design Agent — text-brief-to-token-conformant React/Tailwind code via Sonnet + atelier_classify. Phase 1 ships the closed-loop iteration that lifts soft-color-language briefs.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@anthropic-ai/sdk":"^0.32.1","@atelier-oss/classify":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.0","vitest":"^2.1.5","typescript":"^5.6.3","@types/node":"^20.17.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.0_1778255587089_0.5948998774656549","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@atelier-oss/agent","version":"0.2.0","license":"MIT","_id":"@atelier-oss/agent@0.2.0","maintainers":[{"name":"prettyfly","email":"alex@prettyflyforai.com"}],"homepage":"https://github.com/atelier-oss/atelier#readme","bugs":{"url":"https://github.com/atelier-oss/atelier/issues"},"dist":{"shasum":"d71c9d622dc2ffd97e81e044a4ce7552dffb6c2e","tarball":"https://registry.npmjs.org/@atelier-oss/agent/-/agent-0.2.0.tgz","fileCount":22,"integrity":"sha512-GEKcTObqR0wkgPzn4Z1aMIOOtFaP4HqRCTUwh+bAEg/347iQ9UYOf/+zAx14U54XmqfdX4jqHeCZTGyBADOM7A==","signatures":[{"sig":"MEUCIQCeVAqzTgWmjBf2RgB3oeFY9efB2P2lqI/hjHmm45+zswIgZ18By9mPV3n1OPgww6OewlK8YRK+VJbOphvrqgJ+2Fc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atelier-oss%2fagent@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":55029},"main":"./dist/index.js","type":"module","_from":"file:atelier-oss-agent-0.2.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"eval":"tsx eval/runner.ts","test":"vitest run","build":"tsup src/index.ts --format esm --dts --clean --target node20","typecheck":"tsc --noEmit"},"_npmUser":{"name":"prettyfly","email":"alex@prettyflyforai.com"},"_resolved":"/tmp/45253488d78dbf383a60eccdc91be10f/atelier-oss-agent-0.2.0.tgz","_integrity":"sha512-GEKcTObqR0wkgPzn4Z1aMIOOtFaP4HqRCTUwh+bAEg/347iQ9UYOf/+zAx14U54XmqfdX4jqHeCZTGyBADOM7A==","repository":{"url":"git+https://github.com/atelier-oss/atelier.git","type":"git","directory":"packages/agent"},"_npmVersion":"10.8.2","description":"Atelier Design Agent — text-brief-to-token-conformant React/Tailwind code via Sonnet + atelier_classify. Phase 2 adds screenshot vision input and atlas fingerprint project-context augmentation.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@anthropic-ai/sdk":"^0.32.1","@atelier-oss/atlas":"0.1.0","@atelier-oss/classify":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.0","vitest":"^2.1.5","typescript":"^5.6.3","@types/node":"^20.17.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.2.0_1778256725975_0.01825629519940164","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@atelier-oss/agent","version":"0.3.0","license":"MIT","_id":"@atelier-oss/agent@0.3.0","maintainers":[{"name":"prettyfly","email":"alex@prettyflyforai.com"}],"homepage":"https://github.com/atelier-oss/atelier#readme","bugs":{"url":"https://github.com/atelier-oss/atelier/issues"},"dist":{"shasum":"795cb589d13d44894a55e0ecdf243cd661f6e236","tarball":"https://registry.npmjs.org/@atelier-oss/agent/-/agent-0.3.0.tgz","fileCount":22,"integrity":"sha512-McUsEavW7eiZvloUQXV+5+TH2ZG/xKe/+CZev9DTBsqZd5shqD61Jxo+DAlqZ3qqmCkz4fc7g7kdoMtRg0e9hw==","signatures":[{"sig":"MEUCIDQia2aSelkt45ncVUNIi81fnWo1dggOtiPMC74NUuPFAiEAqQcjgFMqqdetEEA/gZ9y90dBr4kDI/0OLd0j01eksMg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atelier-oss%2fagent@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":64629},"main":"./dist/index.js","type":"module","_from":"file:atelier-oss-agent-0.3.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"eval":"tsx eval/runner.ts","test":"vitest run","build":"tsup src/index.ts --format esm --dts --clean --target node20","typecheck":"tsc --noEmit"},"_npmUser":{"name":"prettyfly","email":"alex@prettyflyforai.com"},"_resolved":"/tmp/f9e44a168625a8b921ffa7fc86c5c551/atelier-oss-agent-0.3.0.tgz","_integrity":"sha512-McUsEavW7eiZvloUQXV+5+TH2ZG/xKe/+CZev9DTBsqZd5shqD61Jxo+DAlqZ3qqmCkz4fc7g7kdoMtRg0e9hw==","repository":{"url":"git+https://github.com/atelier-oss/atelier.git","type":"git","directory":"packages/agent"},"_npmVersion":"10.8.2","description":"Atelier Design Agent — text-brief-to-token-conformant React/Tailwind code via Sonnet 4.6 + @atelier-oss/classify. Phase 3a adds Figma REST integration with variable role-mapping preamble.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@anthropic-ai/sdk":"^0.32.1","@atelier-oss/atlas":"0.1.0","@atelier-oss/classify":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.0","vitest":"^2.1.5","typescript":"^5.6.3","@types/node":"^20.17.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.3.0_1778257857042_0.8009728797109088","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@atelier-oss/agent","version":"0.4.0","description":"Atelier Design Agent — text-brief-to-token-conformant React/Tailwind code via Sonnet 4.6 + @atelier-oss/classify. Phase 2.x adds the DESIGN.md scaffolder (atlas + figma → disk).","license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"engines":{"node":">=20"},"publishConfig":{"access":"public"},"dependencies":{"@anthropic-ai/sdk":"^0.32.1","@atelier-oss/atlas":"0.1.0","@atelier-oss/classify":"0.1.0"},"devDependencies":{"@types/node":"^20.17.0","tsup":"^8.3.0","tsx":"^4.19.2","typescript":"^5.6.3","vitest":"^2.1.5"},"repository":{"type":"git","url":"git+https://github.com/atelier-oss/atelier.git","directory":"packages/agent"},"homepage":"https://github.com/atelier-oss/atelier#readme","bugs":{"url":"https://github.com/atelier-oss/atelier/issues"},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean --target node20","test":"vitest run","typecheck":"tsc --noEmit","eval":"tsx eval/runner.ts"},"_id":"@atelier-oss/agent@0.4.0","_integrity":"sha512-TNMd2uG27+pBuIc6lPcfmoDuLpcaZgc3wmX5YMXjoUTOTqG1GOI1Lmv7v5an+rLlHWKkDtGy9p+1Mt0qycTVng==","_resolved":"/tmp/92b3e60b856b2649e38941b511ff9bd8/atelier-oss-agent-0.4.0.tgz","_from":"file:atelier-oss-agent-0.4.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-TNMd2uG27+pBuIc6lPcfmoDuLpcaZgc3wmX5YMXjoUTOTqG1GOI1Lmv7v5an+rLlHWKkDtGy9p+1Mt0qycTVng==","shasum":"b9c91611b821583c778a142b4aa00d012cbab350","tarball":"https://registry.npmjs.org/@atelier-oss/agent/-/agent-0.4.0.tgz","fileCount":22,"unpackedSize":76813,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atelier-oss%2fagent@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD35k9FOIhgyaLfku9Ci+Ao0HdVEGX+2YL0E4obgRV9XAIhAObXy3hE2Xi7OzG87ObtZzwMPHJg4WjJEseX8I6cKb/5"}]},"_npmUser":{"name":"prettyfly","email":"alex@prettyflyforai.com"},"directories":{},"maintainers":[{"name":"prettyfly","email":"alex@prettyflyforai.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent_0.4.0_1778264790909_0.6994438902515121"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-08T15:05:06.117Z","modified":"2026-05-08T18:26:31.422Z","0.0.1":"2026-05-08T15:05:06.372Z","0.1.0":"2026-05-08T15:53:07.224Z","0.2.0":"2026-05-08T16:12:06.192Z","0.3.0":"2026-05-08T16:30:57.200Z","0.4.0":"2026-05-08T18:26:31.110Z"},"bugs":{"url":"https://github.com/atelier-oss/atelier/issues"},"license":"MIT","homepage":"https://github.com/atelier-oss/atelier#readme","repository":{"type":"git","url":"git+https://github.com/atelier-oss/atelier.git","directory":"packages/agent"},"description":"Atelier Design Agent — text-brief-to-token-conformant React/Tailwind code via Sonnet 4.6 + @atelier-oss/classify. Phase 2.x adds the DESIGN.md scaffolder (atlas + figma → disk).","maintainers":[{"name":"prettyfly","email":"alex@prettyflyforai.com"}],"readme":"# @atelier-oss/agent\n\n> The Atelier Design Agent — text brief in, token-conformant React+Tailwind out, conformance score reported.\n\n## Status\n\n**Phase 3a — Figma REST integration.**\n\nPass a Figma file URL or key. The agent fetches Variables + Styles + file metadata via the Figma REST API, infers role mappings (Figma variable name → atelier canonical role like `primary` / `background` / `foreground` / `muted`), and injects the role table into the system prompt. The model uses role tokens (`bg-primary`) instead of inlining hex (`#F47B20`) when the brief references colors the file declares.\n\n```ts\nconst result = await agent.run({\n  brief: 'pricing tier card using the brand orange CTA',\n  figma: 'https://www.figma.com/file/ABC123/Acme-Brand',\n  // figmaToken falls back to FIGMA_TOKEN env var\n});\n```\n\nNotes:\n\n- Requires a Figma personal access token. Set `FIGMA_TOKEN` env var or pass `figmaToken` on `AgentOptions`.\n- The Variables API (`/v1/files/{key}/variables/local`) is **Enterprise-gated**. On non-Enterprise files the endpoint may 404; the adapter handles this gracefully (treats it as \"no variables\") so Styles and file metadata still load.\n- Role inference uses keyword heuristics on variable names (`color/primary` → `primary`, `color/text-muted` → `muted`, etc.). Variables that don't match any role are listed under \"unmapped\" — the LLM still sees them.\n- Iterate phase is unchanged: rewrite uses prior code as the reference, not the Figma context.\n\n---\n\n**Phase 2 — screenshot input + atlas fingerprint context** (shipped).\n\nPhase 2 ships two capabilities on top of the Phase 1 closed-loop rewrite loop:\n\n### Screenshot input via Claude vision\n\nPass a path to a PNG/JPEG/GIF/WEBP reference screenshot. The agent loads it as a base64 image content block and includes it in the initial generate call so the model can see the layout reference directly.\n\n```ts\nconst result = await agent.run({\n  brief: 'header nav with logo and CTA',\n  screenshot: './screenshots/header-reference.png',\n});\n```\n\nThe image is passed on the initial generate call only. Rewrite iterations (the closed-loop) are pure-text — by that stage the prior code is the reference.\n\n### Atlas fingerprint project context\n\nPass a `cwd` path to your project root. The agent fingerprints the project via `@atelier-oss/atlas`, resolves a build category (e.g. `saas-dashboard`, `marketing-landing`), and injects a token-preference preamble into the system prompt. This biases token choices toward the category's expected palette without overriding explicit token rules.\n\n```ts\nconst result = await agent.run({\n  brief: 'data table with sortable columns',\n  cwd: process.cwd(), // e.g. resolves to 'saas-dashboard'\n});\n```\n\nWhen atlas cannot resolve a category (null), the run proceeds without augmentation — graceful fallback, no error.\n\n---\n\n**Phase 1 — closed-loop iteration** (shipped, still active).\n\n- `claude-sonnet-4-6` initial generate.\n- `@atelier-oss/classify` scores token-vs-raw conformance.\n- If score < threshold, the rewrite loop kicks in: feeds prior code + score back to model, asks for a token-only rewrite. Re-classify. Up to N iterations. Best emission seen wins.\n- `Agent.run()` returns `{ code, scores, trace, cost, iterations }`.\n\nEmpirical findings from Phase 0 ([`eval/PHASE-0-FINDINGS.md`](./eval/PHASE-0-FINDINGS.md)) showed the failure mode: soft poetic color language (\"warm coral\", \"dusty teal\") tempts the model to inline `bg-amber-300` / `bg-teal-400` directly. The Phase 1 rewrite prompt explicitly maps color metaphors to canonical roles.\n\nNot in this phase (all on the roadmap):\n\n- No DESIGN.md emission to disk from atlas/Figma results (Phase 2.x / 3b)\n- No Anthropic Figma Plugin MCP path — that ships as a Claude Code skill in Phase 5\n- No generative benchmark v3 (Phase 4)\n- No Claude Code skill bundle / MCP tool / CLI subcommand (Phase 5)\n\nThe full plan lives at `~/Projects/memory-vault/planning/2026-05-08-atelier-design-agent.md`.\n\n## Phase 2 Gate\n\n5 fresh repos with no `DESIGN.md`, screenshot ref provided → ≥ 75% conformance on first iteration. Fixture screenshots to be prepared separately; gate to be run via the eval harness.\n\n## Programmatic use\n\n```ts\nimport { Agent } from '@atelier-oss/agent';\n\n// Text-only (Phase 0/1 compat):\nconst agent = new Agent();\nconst result = await agent.run({\n  brief: 'pricing card with a warm coral primary CTA on a soft cream canvas',\n});\n\n// With screenshot reference (Phase 2):\nconst result2 = await agent.run({\n  brief: 'pricing card',\n  screenshot: './refs/pricing-ref.png',\n});\n\n// With atlas context (Phase 2):\nconst result3 = await agent.run({\n  brief: 'data table with sortable columns',\n  cwd: process.cwd(),\n});\n\n// With Figma file (Phase 3a):\nconst result4 = await agent.run({\n  brief: 'pricing card using the brand orange CTA',\n  figma: 'https://www.figma.com/file/ABC123/Acme-Brand',\n});\n\n// All four combined:\nconst result5 = await agent.run({\n  brief: 'sidebar nav',\n  screenshot: './refs/nav-ref.png',\n  cwd: process.cwd(),\n  figma: 'ABC123',\n});\n\nconsole.log(result.scores.classify);  // { tokens, raw, conformance }\nconsole.log(result.code);              // [{ path, content }]\nconsole.log(result.trace);             // ordered phase log (intake notes: screenshot, atlasCategory)\nconsole.log(result.cost);              // { input_tokens, output_tokens, usd }\nconsole.log(result.iterations);        // [{ n, conformance, raw, tokens, durationMs }]\n```\n\n## Configuration\n\n```ts\nnew Agent({\n  models: {\n    codegen: 'claude-sonnet-4-6', // default\n  },\n  maxOutputTokens: 16384,         // default — component-level output fits well under\n  iterate: 3,                     // default — max rewrite passes after initial generate\n  threshold: 0.95,                // default — bail out when conformance >= threshold\n  figmaToken: process.env.FIGMA_TOKEN, // default — only required when input.figma is set\n});\n\n// Phase 0 mode (no iteration):\nnew Agent({ iterate: 0 });\n```\n\nModels are pinned by ID (`claude-sonnet-4-6`, `claude-opus-4-7`, `claude-haiku-4-5`) per the project's CARL `[OPUS-4-7]` model policy. No aliases.\n\n## License\n\nMIT. Builds on [`@atelier-oss/classify`](../classify) (MIT), [`@atelier-oss/atlas`](../atlas) (MIT), and [`@anthropic-ai/sdk`](https://github.com/anthropics/anthropic-sdk-typescript) (MIT).\n","readmeFilename":"README.md"}