@agent-native/core 0.63.3 → 0.63.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +33 -97
  2. package/dist/cli/index.js +7 -7
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
  5. package/dist/client/blocks/library/AnnotatedCodeBlock.js +23 -19
  6. package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
  7. package/dist/client/blocks/library/diagram.d.ts.map +1 -1
  8. package/dist/client/blocks/library/diagram.js +10 -11
  9. package/dist/client/blocks/library/diagram.js.map +1 -1
  10. package/dist/client/blocks/library/wireframe.d.ts.map +1 -1
  11. package/dist/client/blocks/library/wireframe.js +2 -1
  12. package/dist/client/blocks/library/wireframe.js.map +1 -1
  13. package/dist/server/auth.d.ts.map +1 -1
  14. package/dist/server/auth.js +5 -1
  15. package/dist/server/auth.js.map +1 -1
  16. package/dist/server/onboarding-html.d.ts.map +1 -1
  17. package/dist/server/onboarding-html.js +50 -5
  18. package/dist/server/onboarding-html.js.map +1 -1
  19. package/dist/tracking/providers.d.ts.map +1 -1
  20. package/dist/tracking/providers.js +4 -1
  21. package/dist/tracking/providers.js.map +1 -1
  22. package/docs/content/creating-templates.md +1 -1
  23. package/docs/content/template-analytics.md +11 -41
  24. package/docs/content/template-assets.md +8 -3
  25. package/docs/content/template-brain.md +6 -1
  26. package/docs/content/template-calendar.md +13 -59
  27. package/docs/content/template-chat.md +6 -9
  28. package/docs/content/template-clips.md +11 -16
  29. package/docs/content/template-content.md +14 -48
  30. package/docs/content/template-design.md +7 -2
  31. package/docs/content/template-dispatch.md +6 -9
  32. package/docs/content/template-forms.md +10 -13
  33. package/docs/content/template-mail.md +12 -27
  34. package/docs/content/template-plan.md +6 -1
  35. package/docs/content/template-slides.md +14 -75
  36. package/docs/content/template-videos.md +11 -52
  37. package/package.json +1 -1
package/README.md CHANGED
@@ -1,33 +1,8 @@
1
1
  # Agent-Native
2
2
 
3
- ### Open-source framework for agentic applications you own.
4
-
5
- Don't choose between rich user interfaces and autonomous agents. Every Agent-Native app is both.
6
-
7
- ## Agents and UIs — Fully Connected
8
-
9
- The agent and the UI are equal citizens of the same system. Every action works both ways — click it or ask for it.
10
-
11
- ![Agents and UIs fully connected](https://cdn.builder.io/api/v1/file/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fadc1e9e9368e4a8cb1b4dbb5aae5aaa2)
12
-
13
- - **Everything syncs** — Agent and UI share one database and one state. Changes from either side show up instantly on the other.
14
- - **Real-time multiplayer** — Humans and agents collaborate in the same document simultaneously: CRDT merging, live presence (cursors, selection rings, who's on which slide), and the agent as a first-class peer editor. Works on any SQL database and any host, including serverless.
15
- - **Context-aware** — The agent knows what you're looking at. Select text, hit Cmd+I, and tell it what to do.
16
- - **Per-user workspace** — Skills, memory, instructions, sub-agents, and MCP servers — SQL-backed, customizable per user. Claude-Code-level flexibility, SaaS-grade economics.
17
- - **Agents call agents** — Tag another agent from any app. They discover each other over A2A and take action across your stack.
18
- - **Reusable integrations** — Connect a provider once in Dispatch, keep secret values in the vault, then grant apps like Brain, Analytics, Mail, and Dispatch access to the shared account metadata and credential refs.
19
- - **Three shapes** — Build the same agent as a headless API, a rich chat experience, or a full application where agent and UI stay in sync.
20
- - **Apps that improve themselves** — Your apps get better on their own. The agent can add features, fix bugs, and refine the UI over time.
21
- - **Any database, any host** — Any SQL database Drizzle supports. Any hosting target Nitro supports. No lock-in.
22
- - **Bring the agent surface you need** — MCP-compatible hosts can call your apps, coding agents can install skills, native chat renders reusable app outputs, and BYO agent runtimes can stream into the Agent-Native chat shell.
23
-
24
3
  ## The framework for agent-native apps
25
4
 
26
- Agent-Native is an open-source framework for building robust agents that can act inside real apps, not just chat next to them.
27
-
28
- It gives you primitives for product-grade agentic software: shared actions, SQL-backed state, identity, tools, skills, jobs, observability, and UI surfaces that all work together.
29
-
30
- Backend agnostic: bring your own database, hosting provider, model stack, and app code.
5
+ Agent-Native is an open-source framework for building robust agents that act inside real apps, not just chat next to them. It gives you primitives for product-grade agentic software: shared actions, SQL-backed state, identity, tools, skills, jobs, observability, and UI surfaces that all work together. Bring your own database, hosting provider, model stack, and app code.
31
6
 
32
7
  ```ts
33
8
  // One action powers UI, agent, HTTP, MCP, A2A, and CLI.
@@ -42,44 +17,25 @@ export default defineAction({
42
17
  });
43
18
  ```
44
19
 
45
- - **Actions** Define work once. Use it from UI, agent, API, MCP, A2A, and CLI.
46
- - **Agent runtime** Chat, tools, skills, memory, jobs, observability, and handoffs ship together.
47
- - **Backend agnostic** Plug in any Drizzle-supported SQL database and Nitro-compatible host.
48
-
49
- ## One agent, three product shapes
50
-
51
- Agent-Native primitives let you choose how much UI to put around an agent without rebuilding the agent contract:
52
-
53
- | Shape | What you ship | Same primitives underneath |
54
- | ------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
55
- | **Headless** | Call the agent and actions from code, CLI, HTTP, MCP, or A2A. | `defineAction`, auth, skills, memory, jobs, observability |
56
- | **Rich chat** | A standalone or embedded chat with native tables, charts, approvals, setup flows, and tool results. | Shared chat runtime, BYO runtime adapters, action-declared native renderers |
57
- | **Whole app** | A full SaaS/product UI where chat can start central, move to the sidebar, and stay synced with app state. | SQL state, actions, context awareness, deep links, live sync |
20
+ - **Actions**: Define work once. Use it from UI, agent, API, MCP, A2A, and CLI.
21
+ - **Agent runtime**: Chat, tools, skills, memory, jobs, observability, and handoffs ship together.
22
+ - **Backend agnostic**: Plug in any Drizzle-supported SQL database and Nitro-compatible host.
58
23
 
59
- Protocols come with the framework instead of becoming separate integrations per feature. Today that means A2A, MCP, MCP Apps, standard remote MCP OAuth, MCP clients, HTTP/CLI action calls, native chat widgets, `AgentChatRuntime` adapters, standard OpenAI, AG-UI, Claude Agent SDK, and Vercel AI SDK chat runtime connectors, and deep links all hang off the same action surface. ACP is best understood as the coding-agent/editor interoperability protocol, not the general BYO app-chat runtime.
24
+ ## Agents and UIs, Fully Connected
60
25
 
61
- For the full decision guide headless, rich chat on the built-in agent, rich chat on your own agent, embedded sidecar, or full app — see [Agent Surfaces](https://agent-native.com/docs/agent-surfaces).
26
+ The agent and the UI are equal citizens of one system. Every action works both ways: click it or ask for it.
62
27
 
63
- To connect Claude, ChatGPT, Codex, Cursor, OpenCode, GitHub Copilot / VS Code, or another MCP host to your hosted app, see the [External Agents guide](https://agent-native.com/docs/external-agents).
64
-
65
- ## Try it with a skill
66
-
67
- Don't want to scaffold a whole app yet? Add visual planning and PR recaps to Claude Code, Codex, Cursor, Pi, OpenCode, GitHub Copilot / VS Code, and similar agents with one command:
68
-
69
- ```bash
70
- npx @agent-native/core@latest skills add visual-plan
71
- ```
72
-
73
- You get two slash commands that upgrade how your agent plans and reports its work:
74
-
75
- - **`/visual-plan`** — before the agent writes code, it opens a structured, reviewable plan document instead of a wall of text: inline diagrams, UI wireframes and prototypes, file-by-file implementation maps, and annotations you can comment on and approve.
76
- - **`/visual-recap`** — after changes land, it turns a PR or git diff into a high-altitude visual recap: schema, API, and file changes rendered as grounded before/after blocks with a shareable review link, instead of scrolling a raw diff.
28
+ ![Agents and UIs fully connected](https://cdn.builder.io/api/v1/file/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fadc1e9e9368e4a8cb1b4dbb5aae5aaa2)
77
29
 
78
- See the **[Skills Guide](https://agent-native.com/docs/skills-guide#app-backed-skills)** for more skills and local installs.
30
+ - **Everything syncs**: One database, one state. Changes from either side show up instantly on the other.
31
+ - **Real-time multiplayer**: Humans and agents edit the same document together, with the agent as a first-class peer.
32
+ - **Context-aware**: The agent knows what you're looking at. Select text, hit Cmd+I, and tell it what to do.
33
+ - **Agents call agents**: Tag another agent from any app and they coordinate over A2A.
34
+ - **Self-improving**: The agent can add features, fix bugs, and refine the UI over time.
79
35
 
80
36
  ## Templates
81
37
 
82
- Start with a full featured template. Each one is a complete, 100% free and open-source SaaS app cloneable, not scaffolded except you own the code and can customize everything.
38
+ Start with a full featured template. Each one is a complete, 100% free and open-source SaaS app: cloneable, not scaffolded, except you own the code and can customize everything.
83
39
 
84
40
  <table>
85
41
  <tr>
@@ -113,7 +69,7 @@ Edit local Markdown/MDX files, generate rich interactive custom blocks, and draf
113
69
 
114
70
  **Visual plan mode for coding agents**
115
71
 
116
- Install `/visual-plan` and `/visual-recap` so your coding agent can plan before it builds and recap changes after they land — high-level code reviews with diagrams, wireframes, annotations, and review links.
72
+ Install `/visual-plan` and `/visual-recap` so your coding agent can plan before it builds and recap changes after they land. High-level code reviews with diagrams, wireframes, annotations, and review links.
117
73
 
118
74
  </td>
119
75
  </tr>
@@ -137,7 +93,7 @@ Generate and edit React-based presentations via prompt or point-and-click.
137
93
 
138
94
  **Agent-Native Amplitude, Mixpanel**
139
95
 
140
- Connect analytics data sources, prompt for real charts, and build reusable dashboards. Shared workspace connections can provide provider credentials, while Analytics still owns metrics, source-of-truth choices, and saved analyses.
96
+ Connect analytics data sources, prompt for real charts, and build reusable dashboards.
141
97
 
142
98
  </td>
143
99
  <td width="33%" align="center" valign="top">
@@ -154,62 +110,42 @@ Record your screen with auto-transcripts, shareable links, and an agent that sum
154
110
  </tr>
155
111
  </table>
156
112
 
157
- Every template is a complete cloneable SaaS — fork it, customize it with the agent, own it. Try them with example data before connecting your own sources.
158
-
159
113
  View the full template gallery at **[agent-native.com/templates](https://agent-native.com/templates)**.
160
114
 
161
- ## Quick Start
115
+ ## Try it with a skill
162
116
 
163
- One command to fork a template and start building locally.
117
+ Don't want to scaffold a whole app yet? Add visual planning and PR recaps to Claude Code, Codex, Cursor, Pi, OpenCode, GitHub Copilot / VS Code, and similar agents with one command:
164
118
 
165
119
  ```bash
166
- npx @agent-native/core@latest create my-platform
167
- cd my-platform
168
- pnpm install
169
- pnpm dev
120
+ npx @agent-native/core@latest skills add visual-plan
170
121
  ```
171
122
 
172
- The CLI shows a multi-select picker so you can include as many templates as you want in one workspace. Pick Mail + Calendar + Forms and you get all three apps wired up and sharing auth in one go. Or browse the **[template gallery](https://agent-native.com/templates)** for live demos.
123
+ ![Visual plan and recap in action](https://raw.githubusercontent.com/builderio/skills/main/media/visual-recap.gif)
173
124
 
174
- Want a single app, no monorepo? Use `--standalone`:
125
+ You get two slash commands:
175
126
 
176
- ```bash
177
- npx @agent-native/core@latest create my-app --standalone --template mail
178
- ```
127
+ - **`/visual-plan`**: before the agent writes code, it opens a structured, reviewable plan with inline diagrams, UI wireframes, file-by-file implementation maps, and annotations you can comment on and approve.
128
+ - **`/visual-recap`**: after changes land, it turns a PR or git diff into a high-altitude visual recap with a shareable review link instead of a raw diff.
179
129
 
180
- ## Workspaces (Monorepo)
130
+ See the **[Skills Guide](https://agent-native.com/docs/skills-guide#app-backed-skills)** for more.
181
131
 
182
- A workspace is the default shape of an agent-native project. Every app sits under `apps/`, and `packages/shared/` is available for the small amount of code, instructions, skills, or branding that should truly apply to every app.
183
-
184
- ```
185
- my-platform/
186
- ├── package.json # declares `agent-native.workspaceCore`
187
- ├── pnpm-workspace.yaml
188
- ├── .env # shared secrets: ANTHROPIC_API_KEY, BUILDER_PRIVATE_KEY, A2A_SECRET, ...
189
- ├── packages/
190
- │ └── shared/ # optional shared custom code
191
- └── apps/
192
- ├── mail/
193
- ├── calendar/
194
- └── forms/
195
- ```
132
+ ## Quick Start
196
133
 
197
- Add another app later:
134
+ One command to fork a template and start building locally.
198
135
 
199
136
  ```bash
200
- npx @agent-native/core@latest add-app notes --template content
137
+ npx @agent-native/core@latest create my-platform
138
+ cd my-platform
139
+ pnpm install
140
+ pnpm dev
201
141
  ```
202
142
 
203
- Deploy every app behind one origin:
143
+ `create` scaffolds a workspace with a multi-select picker, so you can include as many apps as you want in one place. Pick Mail + Calendar + Forms and you get all three wired up and sharing auth.
204
144
 
205
- ```bash
206
- npx @agent-native/core@latest deploy
207
- # https://your-agents.com/mail/* → mail
208
- # https://your-agents.com/calendar/* → calendar
209
- # https://your-agents.com/forms/* → forms
210
- ```
145
+ Want a single app instead of a monorepo? Add `--standalone`. The picker leads with two on-ramps:
211
146
 
212
- Same-origin deploy means a **shared login session** across every app and **zero-config cross-app A2A** tag `@mail` from the calendar's agent chat and it just works (no JWT signing, no CORS). Full details at **[agent-native.com/docs/multi-app-workspace](https://agent-native.com/docs/multi-app-workspace)**.
147
+ - **Headless**: an action-first app with one primitive and no UI shell. The CLI walks you through calling your first action and agent, and you can add a UI later.
148
+ - **Chat**: a minimal chat UI with the browser shell already wired, the simplest starting point when you want a UI.
213
149
 
214
150
  ## The Best of Both Worlds
215
151
 
package/dist/cli/index.js CHANGED
@@ -541,8 +541,7 @@ switch (command) {
541
541
  import("./invoke.js")
542
542
  .then(async (m) => {
543
543
  const code = await m.runInvoke(args);
544
- if (code !== 0)
545
- process.exit(code);
544
+ process.exit(code);
546
545
  })
547
546
  .catch((err) => {
548
547
  console.error(err?.message ?? err);
@@ -554,8 +553,7 @@ switch (command) {
554
553
  import("./agents.js")
555
554
  .then(async (m) => {
556
555
  const code = await m.runAgents(args);
557
- if (code !== 0)
558
- process.exit(code);
556
+ process.exit(code);
559
557
  })
560
558
  .catch((err) => {
561
559
  console.error(err?.message ?? err);
@@ -592,7 +590,10 @@ switch (command) {
592
590
  // browser device-code flow (no token copying). `--all` connects every
593
591
  // first-party hosted app; `--token` is the no-browser fallback.
594
592
  import("./connect.js")
595
- .then((m) => m.runConnect(args))
593
+ .then(async (m) => {
594
+ await m.runConnect(args);
595
+ process.exit(process.exitCode ?? 0);
596
+ })
596
597
  .catch((err) => {
597
598
  console.error(err?.message ?? err);
598
599
  process.exit(1);
@@ -700,8 +701,7 @@ switch (command) {
700
701
  import("./add.js")
701
702
  .then((m) => {
702
703
  const code = m.runAdd(args);
703
- if (code !== 0)
704
- process.exit(code);
704
+ process.exit(code);
705
705
  })
706
706
  .catch((err) => {
707
707
  console.error(err?.message ?? err);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAA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BAClD,qCAAqC;gBACrC,wCAAwC,CAC3C,CAAC;YACF,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { execSync, spawn } from \"child_process\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { fileURLToPath } from \"url\";\nimport * as Sentry from \"@sentry/node\";\n\n// Resolve version once at module scope — used by both --version and --help\nlet _version = \"unknown\";\ntry {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n // dist/cli/index.js → ../../package.json\n const pkg = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, \"../../package.json\"), \"utf-8\"),\n );\n _version = pkg.version;\n} catch {}\n\n// Fail fast on unsupported Node versions. `engines.node: \">=22\"` is only\n// advisory — npx/pnpm merely warn — so without this an older Node (18/20)\n// first fails deep inside a scaffold dynamic import with a cryptic\n// ERR_MODULE / syntax error that `handleScaffoldImportError` misreports as a\n// corrupt npx cache. A clear up-front message saves that whole detour.\nconst REQUIRED_NODE_MAJOR = 22;\nconst _nodeMajor = Number(process.versions.node.split(\".\")[0]);\nif (Number.isFinite(_nodeMajor) && _nodeMajor < REQUIRED_NODE_MAJOR) {\n console.error(\n `agent-native requires Node.js ${REQUIRED_NODE_MAJOR} or newer, but you're on Node ${process.versions.node}.\\n` +\n `Upgrade Node (https://nodejs.org) and re-run. With nvm: \\`nvm install ${REQUIRED_NODE_MAJOR}\\`.`,\n );\n process.exit(1);\n}\n\n/**\n * Build a redacted \"command\" tag from process.argv. Strips the value that\n * follows any --token / --key / --secret / --password / --api-key flag so\n * we don't ship developer secrets to Sentry alongside the crash.\n *\n * Supports both `--token foo` (separate argv item) and `--token=foo`\n * (combined argv item) forms.\n */\nconst SECRET_FLAG_RE = /^--?(token|key|secret|password|api[_-]?key)$/i;\nconst SECRET_FLAG_EQ_RE =\n /^(--?(token|key|secret|password|api[_-]?key))=(.*)$/i;\nfunction buildRedactedCommandTag(argv: string[]): string {\n const out: string[] = [];\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n if (SECRET_FLAG_RE.test(a)) {\n out.push(a);\n // Consume the next argv item as the secret value\n if (i + 1 < argv.length) {\n out.push(\"<redacted>\");\n i++;\n }\n continue;\n }\n const m = a.match(SECRET_FLAG_EQ_RE);\n if (m) {\n out.push(`${m[1]}=<redacted>`);\n continue;\n }\n out.push(a);\n }\n return out.join(\" \");\n}\n\nSentry.init({\n dsn: \"https://0d384e9eff2f6542af468b92769f2f5b@o117565.ingest.us.sentry.io/4511270386466816\",\n release: `agent-native-cli@${_version}`,\n // Sentry's Http integration wraps outgoing fetch in a way that breaks the\n // hosted Plan MCP route negotiation used by recap CI smoke checks.\n integrations: (integrations) =>\n integrations.filter((integration) => integration.name !== \"Http\"),\n // sendDefaultPii MUST stay false — the CLI runs in third-party developer\n // environments and we never want to ship request headers, IPs, cookies,\n // or process env contents to Sentry without explicit consent.\n sendDefaultPii: false,\n beforeSend(event) {\n // Drop expected user-input rejections (validateRepoName, etc.) so they\n // don't pollute Sentry with non-bug noise.\n const exceptionType = event.exception?.values?.[0]?.type;\n if (\n exceptionType === \"ValidationError\" ||\n event.tags?.handled === \"validation\"\n ) {\n return null;\n }\n\n // Defense in depth: strip any sensitive fields that may have been\n // attached to the event despite sendDefaultPii: false (e.g. integrations\n // that capture request metadata).\n if (event.request) {\n if (event.request.headers) {\n const headers = event.request.headers as Record<string, string>;\n for (const k of Object.keys(headers)) {\n const lk = k.toLowerCase();\n if (\n lk === \"cookie\" ||\n lk === \"authorization\" ||\n lk === \"set-cookie\" ||\n lk === \"proxy-authorization\"\n ) {\n delete headers[k];\n }\n }\n }\n // Cookies are also exposed via event.request.cookies as a separate field\n delete (event.request as Record<string, unknown>).cookies;\n }\n // Keep user info that was explicitly set via Sentry.setUser (id/email)\n // so we can attribute crashes back to the operator. Always strip\n // ip_address — the CLI runs on third-party machines and the IP is auto-\n // collected without consent. If only auto-collected fields remain,\n // drop the user object entirely.\n if (event.user) {\n const user = event.user as Record<string, unknown>;\n delete user.ip_address;\n const hasIdentity =\n typeof user.id === \"string\" ||\n typeof user.email === \"string\" ||\n typeof user.username === \"string\";\n if (!hasIdentity) {\n delete event.user;\n }\n }\n // Sentry's contexts can carry process.env snapshots — strip env-shaped\n // contexts so we don't leak deployment secrets.\n if (event.contexts && typeof event.contexts === \"object\") {\n delete (event.contexts as Record<string, unknown>).runtime_env;\n }\n\n event.tags = {\n ...event.tags,\n // Build the command tag from process.argv with secrets redacted so\n // `agent-native ... --token foo` doesn't leak `foo` to Sentry.\n command: buildRedactedCommandTag(process.argv.slice(2)),\n subcommand: process.argv[2] ?? \"none\",\n nodeVersion: process.version,\n platform: process.platform,\n };\n return event;\n },\n});\n\n// Identify the operator so future CLI errors carry spaceId / builderUserId\n// that we can map back to a real Builder user. The CLI doesn't have a real\n// email today — only the env-managed identifiers from the workspace's .env.\n{\n const builderUserId = process.env.BUILDER_USER_ID;\n const builderPublicKey = process.env.BUILDER_PUBLIC_KEY;\n if (builderUserId) {\n Sentry.setUser({ id: builderUserId });\n Sentry.setTag(\"builderUserId\", builderUserId);\n }\n if (builderPublicKey) {\n Sentry.setTag(\"spaceId\", builderPublicKey);\n }\n}\n\nconst FEEDBACK_URL =\n \"https://forms.agent-native.com/f/agent-native-feedback/_16ewV?source=cli\";\nconst BUGS_URL = \"https://github.com/BuilderIO/agent-native/issues\";\n\nconst command = process.argv[2];\n// Filter out bare \"--\" separators that pnpm inserts between its args and script args\nconst args = process.argv.slice(3).filter((a) => a !== \"--\");\n\nfunction parseScaffoldArgs(argv: string[]): {\n name?: string;\n template?: string;\n standalone: boolean;\n headless: boolean;\n} {\n let name: string | undefined;\n let template: string | undefined;\n let standalone = false;\n let headless = false;\n\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n if (arg === \"--template\" && argv[i + 1]) {\n template = argv[++i];\n } else if (arg.startsWith(\"--template=\")) {\n template = arg.slice(\"--template=\".length);\n } else if (arg === \"--standalone\") {\n standalone = true;\n } else if (arg === \"--headless\") {\n headless = true;\n } else if (!arg.startsWith(\"-\") && !name) {\n name = arg;\n }\n }\n\n return { name, template, standalone, headless };\n}\n\n// Track CLI usage (best-effort, non-blocking)\nfunction trackCli(event: string, props?: Record<string, unknown>): void {\n try {\n import(\"../tracking/registry.js\").then((m) => {\n m.track(event, { command, ...props });\n });\n import(\"../tracking/providers.js\").then((m) =>\n m.registerBuiltinProviders(),\n );\n } catch {}\n}\n\n// Global error handler — show feedback link on unhandled crashes\nprocess.on(\"uncaughtException\", (err) => {\n console.error(`\\n Unexpected error: ${err.message}\\n`);\n console.error(` Report this bug: ${BUGS_URL}`);\n console.error(` Send feedback: ${FEEDBACK_URL}\\n`);\n trackCli(\"cli.crash\", { error: err.message });\n Sentry.captureException(err);\n Sentry.flush(2000).finally(() => process.exit(1));\n});\n\nprocess.on(\"unhandledRejection\", (reason: any) => {\n console.error(`\\n Unhandled error: ${reason?.message ?? reason}\\n`);\n console.error(` Report this bug: ${BUGS_URL}`);\n console.error(` Send feedback: ${FEEDBACK_URL}\\n`);\n trackCli(\"cli.crash\", { error: reason?.message ?? String(reason) });\n Sentry.captureException(reason);\n Sentry.flush(2000).finally(() => process.exit(1));\n});\n\n// Surface a self-heal hint when an interrupted `npx @agent-native/core@latest ...`\n// leaves a half-extracted package in the npx cache and a follow-up run fails\n// to load one of our own sub-modules.\nfunction handleScaffoldImportError(err: any): never {\n const msg = err?.message ?? String(err);\n const looksLikeCorruptCache =\n err?.code === \"ERR_MODULE_NOT_FOUND\" ||\n err?.code === \"MODULE_NOT_FOUND\" ||\n err?.code === \"ENOENT\" ||\n /Cannot find module|tarball|integrity|EINTEGRITY|corrupt|truncated/i.test(\n msg,\n );\n if (looksLikeCorruptCache) {\n console.error(\n `\\n Failed to load the scaffolder. This usually means an earlier\\n \\`npx\\` run was interrupted and left a corrupt cache.\\n\\n Clear the npx cache and try again:\\n rm -rf ~/.npm/_npx\\n npx @agent-native/core@latest create\\n\\n Original error: ${msg}\\n`,\n );\n } else {\n console.error(`\\n Failed to load the scaffolder: ${msg}\\n`);\n }\n trackCli(\"cli.scaffold.import_error\", { error: msg });\n Sentry.captureException(err);\n Sentry.flush(2000).finally(() => process.exit(1));\n throw err;\n}\n\nfunction findViteBin(): string {\n // Look for vite in node_modules/.bin\n const localVite = path.resolve(\"node_modules/.bin/vite\");\n if (fs.existsSync(localVite)) return localVite;\n return \"vite\"; // fallback to PATH\n}\n\nfunction findTsxBin(): string {\n const localTsx = path.resolve(\"node_modules/.bin/tsx\");\n if (fs.existsSync(localTsx)) return localTsx;\n return \"tsx\";\n}\n\nfunction findReactRouterBin(): string {\n const localBin = path.resolve(\"node_modules/.bin/react-router\");\n if (fs.existsSync(localBin)) return localBin;\n return \"react-router\";\n}\n\n/** Check if the project uses React Router framework mode (has react-router.config.ts) */\nfunction isReactRouterFramework(): boolean {\n return (\n fs.existsSync(path.resolve(\"react-router.config.ts\")) ||\n fs.existsSync(path.resolve(\"react-router.config.js\"))\n );\n}\n\nfunction isWorkspaceRoot(): boolean {\n const pkgPath = path.resolve(\"package.json\");\n if (!fs.existsSync(pkgPath)) return false;\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n return (\n typeof pkg?.[\"agent-native\"]?.workspaceCore === \"string\" &&\n fs.existsSync(path.resolve(\"apps\"))\n );\n } catch {\n return false;\n }\n}\n\nfunction run(\n cmd: string,\n cmdArgs: string[],\n opts?: { stdio?: \"inherit\" | \"pipe\" },\n) {\n const child = spawn(cmd, cmdArgs, {\n stdio: opts?.stdio ?? \"inherit\",\n shell: process.platform === \"win32\",\n env: process.env,\n });\n child.on(\"exit\", (code) => process.exit(code ?? 0));\n // Forward signals to child so Cmd+C doesn't leave zombie processes holding ports\n for (const sig of [\"SIGINT\", \"SIGTERM\", \"SIGHUP\"] as const) {\n process.on(sig, () => {\n child.kill(sig);\n setTimeout(() => {\n try {\n child.kill(\"SIGKILL\");\n } catch {}\n process.exit(1);\n }, 5000).unref();\n });\n }\n return child;\n}\n\n/**\n * Walk up from `cwd` and try to figure out which template / app this build\n * is running for. We look for two patterns:\n *\n * - `templates/<name>/...` — building inside the framework monorepo\n * - `apps/<name>/...` — building inside a scaffolded workspace\n *\n * Both, neither, or one may match. Used purely as Sentry tags so we can\n * filter the noisy \"Command failed: react-router build\" issues by template.\n */\nfunction inferBuildContext(cwd: string): {\n template?: string;\n app?: string;\n} {\n const segs = cwd.split(path.sep);\n let template: string | undefined;\n let app: string | undefined;\n for (let i = 0; i < segs.length - 1; i++) {\n if (segs[i] === \"templates\" && segs[i + 1] && !segs[i + 1].startsWith(\".\"))\n template = segs[i + 1];\n if (segs[i] === \"apps\" && segs[i + 1] && !segs[i + 1].startsWith(\".\"))\n app = segs[i + 1];\n }\n return { template, app };\n}\n\n/**\n * Run a build subcommand, streaming its stdout/stderr to the user's terminal\n * in real time while also capturing bounded tails for Sentry. On non-zero\n * exit we report a structured event (template, app, exit code, stderr/stdout\n * tails) and exit with the child's code. We deliberately do NOT throw — the\n * global uncaughtException handler would re-capture with a generic\n * \"Error: Command failed\" title, collapsing every template's failure into\n * one issue (which is exactly what we're trying to fix here).\n */\nfunction runBuildStep(\n cmd: string,\n cmdArgs: string[],\n opts: { label: string; env?: NodeJS.ProcessEnv },\n): Promise<void> {\n return new Promise<void>((resolve) => {\n const STDERR_TAIL_BYTES = 8000;\n const STDOUT_TAIL_BYTES = 4000;\n let stderrBuf = \"\";\n let stdoutBuf = \"\";\n\n const child = spawn(cmd, cmdArgs, {\n stdio: [\"inherit\", \"pipe\", \"pipe\"],\n shell: process.platform === \"win32\",\n env: opts.env ?? process.env,\n });\n\n child.stdout?.on(\"data\", (chunk: Buffer) => {\n process.stdout.write(chunk);\n const next = stdoutBuf + chunk.toString(\"utf-8\");\n stdoutBuf =\n next.length > STDOUT_TAIL_BYTES ? next.slice(-STDOUT_TAIL_BYTES) : next;\n });\n child.stderr?.on(\"data\", (chunk: Buffer) => {\n process.stderr.write(chunk);\n const next = stderrBuf + chunk.toString(\"utf-8\");\n stderrBuf =\n next.length > STDERR_TAIL_BYTES ? next.slice(-STDERR_TAIL_BYTES) : next;\n });\n\n child.on(\"error\", (err) => {\n // Failure to spawn (ENOENT, etc.).\n const cwd = process.cwd();\n const { template, app } = inferBuildContext(cwd);\n Sentry.captureException(err, {\n tags: {\n buildStep: opts.label,\n ...(template ? { template } : {}),\n ...(app ? { app } : {}),\n },\n extra: {\n command: `${cmd} ${cmdArgs.join(\" \")}`,\n cwd,\n stage: \"spawn\",\n },\n });\n Sentry.flush(2000).finally(() => process.exit(1));\n });\n\n child.on(\"exit\", (code, signal) => {\n const exitCode = code ?? (signal ? 1 : 0);\n if (exitCode === 0) {\n resolve();\n return;\n }\n const cwd = process.cwd();\n const { template, app } = inferBuildContext(cwd);\n const childCommand = `${cmd} ${cmdArgs.join(\" \")}`;\n const err = new Error(\n `Build step \"${opts.label}\" failed with exit code ${exitCode}` +\n (template ? ` (template=${template})` : \"\") +\n (app ? ` (app=${app})` : \"\"),\n );\n Sentry.captureException(err, {\n tags: {\n buildStep: opts.label,\n ...(template ? { template } : {}),\n ...(app ? { app } : {}),\n },\n extra: {\n command: childCommand,\n cwd,\n exitCode,\n signal: signal ?? null,\n stderrTail: stderrBuf,\n stdoutTail: stdoutBuf,\n },\n });\n // Don't throw — see comment on runBuildStep above.\n Sentry.flush(2000).finally(() => process.exit(exitCode));\n });\n });\n}\n\ntrackCli(\"cli.run\");\n\nswitch (command) {\n case \"dev\": {\n if (isWorkspaceRoot()) {\n import(\"./workspace-dev.js\")\n .then((m) => m.runWorkspaceDev({ args }))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n const vite = findViteBin();\n run(vite, args);\n break;\n }\n\n case \"workspace-dev\": {\n import(\"./workspace-dev.js\")\n .then((m) => m.runWorkspaceDev({ args }))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"build\": {\n // React Router framework mode uses `react-router build` which\n // internally runs `vite build` with proper environment orchestration.\n // Legacy SPA mode uses `vite build` directly.\n //\n // Each step uses runBuildStep so that on failure we get a Sentry event\n // tagged with template/app and including stderr/stdout tails. If the\n // child exits non-zero, runBuildStep calls process.exit itself; the\n // continuation only runs on success.\n (async () => {\n if (isReactRouterFramework()) {\n const rr = findReactRouterBin();\n console.log(\"Building (React Router framework mode)...\");\n await runBuildStep(rr, [\"build\"], { label: \"react-router-build\" });\n } else {\n const vite = findViteBin();\n console.log(\"Building...\");\n await runBuildStep(vite, [\"build\"], { label: \"vite-build\" });\n }\n\n // Post-build: framework-mode apps also need a Nitro server bundle for\n // `agent-native start` and for serverless presets.\n if (isReactRouterFramework()) {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n const deployBuild = path.resolve(__dirname, \"../deploy/build.js\");\n if (fs.existsSync(deployBuild)) {\n await runBuildStep(\"node\", [deployBuild], {\n label: \"deploy-build\",\n env: process.env,\n });\n } else {\n console.warn(\n `[build] Deploy build script not found at ${deployBuild}. Skipping post-build step.`,\n );\n }\n }\n\n console.log(\"\\nBuild complete.\");\n })().catch((err) => {\n // runBuildStep handles its own failures and exits, so reaching here\n // implies a programming error in the orchestration above. Capture\n // and exit so the global unhandledRejection handler doesn't double-\n // report with a generic title.\n Sentry.captureException(err);\n Sentry.flush(2000).finally(() => process.exit(1));\n });\n break;\n }\n\n case \"start\": {\n // Like `next start` — runs Nitro production server\n const serverEntry = path.resolve(\".output/server/index.mjs\");\n if (!fs.existsSync(serverEntry)) {\n console.error(\n 'No production build found. Run \"agent-native build\" first.',\n );\n process.exit(1);\n }\n run(\"node\", [serverEntry, ...args]);\n break;\n }\n\n case \"action\": {\n // Run an action from actions/ (or scripts/ for backwards compat)\n const actionName = args[0];\n if (!actionName) {\n console.error(\"Usage: agent-native action <name> [--args]\");\n process.exit(1);\n }\n const tsxAction = findTsxBin();\n // Try actions/run.ts first, fall back to scripts/run.ts\n const actionsRun = path.resolve(\"actions/run.ts\");\n const scriptsRun = path.resolve(\"scripts/run.ts\");\n const runFile = fs.existsSync(actionsRun) ? actionsRun : scriptsRun;\n run(tsxAction, [runFile, ...args]);\n break;\n }\n\n case \"agent\": {\n import(\"./agent.js\")\n .then(async (m) => {\n const code = await m.runAgent(args);\n if (code !== 0) process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"script\": {\n // @deprecated — use `agent-native action` instead\n const scriptName = args[0];\n if (!scriptName) {\n console.error(\"Usage: agent-native script <name> [--args]\");\n process.exit(1);\n }\n const tsx = findTsxBin();\n // Try actions/run.ts first, fall back to scripts/run.ts\n const actionsRunScript = path.resolve(\"actions/run.ts\");\n const scriptsRunScript = path.resolve(\"scripts/run.ts\");\n const runFileScript = fs.existsSync(actionsRunScript)\n ? actionsRunScript\n : scriptsRunScript;\n run(tsx, [runFileScript, ...args]);\n break;\n }\n\n case \"typecheck\": {\n // Run TypeScript type checking\n // React Router framework mode generates route types first\n if (isReactRouterFramework()) {\n const rr = findReactRouterBin();\n try {\n execSync(`${rr} typegen`, { stdio: \"inherit\" });\n } catch {\n // typegen may fail if routes aren't set up yet — continue to tsc\n }\n }\n const tsc = path.resolve(\"node_modules/.bin/tsc\");\n const tscBin = fs.existsSync(tsc) ? tsc : \"tsc\";\n run(tscBin, [\"--noEmit\", ...args]);\n break;\n }\n\n case \"create\": {\n // Defaults to creating a workspace with a multi-select template picker.\n // Use --standalone for the old single-app flow.\n // --template foo,bar Pre-select multiple templates in the picker\n // --standalone Scaffold a single standalone app\n const parsed = parseScaffoldArgs(args);\n import(\"./create.js\")\n .then((m) =>\n m.createApp(parsed.name, {\n template: parsed.headless ? \"headless\" : parsed.template,\n standalone: parsed.standalone,\n }),\n )\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"invoke\": {\n import(\"./invoke.js\")\n .then(async (m) => {\n const code = await m.runInvoke(args);\n if (code !== 0) process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"agents\": {\n import(\"./agents.js\")\n .then(async (m) => {\n const code = await m.runAgents(args);\n if (code !== 0) process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"migrate\": {\n import(\"./migrate.js\")\n .then((m) => m.runMigrate(args))\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"code\": {\n import(\"./code.js\")\n .then((m) => m.runCode(args))\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"mcp\": {\n // Connect external coding agents (Claude Code, Cowork, Codex) over MCP.\n // `mcp serve` runs the stdio transport; install/uninstall/status/token\n // manage client configs + the local token.\n import(\"./mcp.js\")\n .then((m) => m.runMcp(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"connect\": {\n // Wire your local coding agent to a DEPLOYED agent-native app via a\n // browser device-code flow (no token copying). `--all` connects every\n // first-party hosted app; `--token` is the no-browser fallback.\n import(\"./connect.js\")\n .then((m) => m.runConnect(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"reconnect\":\n case \"reauth\": {\n // Refresh an existing remote MCP auth/config entry without reinstalling\n // app skills or running the broader connector setup path.\n import(\"./connect.js\")\n .then((m) => m.runConnect([\"reconnect\", ...args]))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"app-skill\": {\n // Package or install an agent-native app as a skill-backed MCP/app bundle.\n import(\"./app-skill.js\")\n .then((m) => m.runAppSkill(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"skills\": {\n // Friendly skill install surface. Wraps open skills installation plus MCP.\n import(\"./skills.js\")\n .then((m) => m.runSkills(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"recap\": {\n // PR visual recap helpers used by the GitHub Action. Promoted to the CLI\n // so an installed repo's workflow can call `agent-native recap …` instead\n // of copying helper scripts. Run `agent-native recap help` for the full\n // subcommand list.\n import(\"./recap.js\")\n .then((m) => m.runRecap(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"plan\": {\n // Plan authoring helpers: local MDX preview plus a no-auth block catalog\n // fetcher for text-only/local installs.\n import(\"./plan-local.js\")\n .then((m) => m.runPlan(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"create-workspace\": {\n // Deprecated alias for `create` (since workspace is now the default).\n const parsed = parseScaffoldArgs(args);\n import(\"./create-workspace.js\")\n .then((m) =>\n m.createWorkspace({ name: parsed.name, template: parsed.template }),\n )\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"add-app\": {\n // Add one or more apps to the current workspace.\n const parsed = parseScaffoldArgs(args);\n import(\"./create.js\")\n .then((m) =>\n m.addAppToWorkspace(parsed.name, { template: parsed.template }),\n )\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"deploy\": {\n // Build and deploy the entire workspace as one unit. Each app is served\n // at /<app>/* under the same origin.\n import(\"../deploy/workspace-deploy.js\")\n .then((m) => m.runWorkspaceDeploy({ args }))\n .catch((err) => {\n console.error(\"Deploy failed:\", err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"setup-agents\": {\n import(\"./setup-agents.js\").then((m) => m.runSetupAgents());\n break;\n }\n\n case \"info\": {\n // Print read-only info about an installable package (e.g. @agent-native/scheduling).\n // Lists subpath exports, source paths in node_modules, and docs pointers.\n import(\"./info.js\").then((m) => m.runInfo(args[0]));\n break;\n }\n\n case \"add\": {\n // Blueprint installer (à la Flue's `flue add`): instead of scaffolding\n // files, emit a curated Markdown integration blueprint to stdout so it can\n // be piped into a coding agent — `agent-native add provider stripe | claude`.\n // A URL instead of a name yields a generic research-and-integrate blueprint.\n import(\"./add.js\")\n .then((m) => {\n const code = m.runAdd(args);\n if (code !== 0) process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"audit-agent-web\": {\n import(\"./audit-agent-web.js\")\n .then((m) => m.runAuditAgentWeb(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"eval\": {\n // Discover and run the app's evals (**/*.eval.ts, evals/*.ts), score the\n // agent's output, and exit non-zero if any eval falls below its threshold.\n // Doubles as a CI deploy gate. `--json` emits a machine-readable report.\n import(\"./eval.js\")\n .then((m) => m.runEval(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"--version\":\n case \"-v\": {\n console.log(_version);\n break;\n }\n\n case undefined:\n import(\"./code.js\")\n .then((m) => m.runCode([]))\n .catch(handleScaffoldImportError);\n break;\n\n case \"--help\":\n case \"-h\":\n console.log(`agent-native v${_version}\n\nUsage:\n agent-native Launch Agent-Native Code workspace\n agent-native \"fix tests\" Start an Agent-Native Code coding session\n agent-native dev Start development server\n (or the workspace gateway at a workspace root)\n agent-native build Build for production (client + server)\n agent-native start Start production server\n agent-native action <name> Run an action from actions/\n agent-native agent \"prompt\" Run the app-agent loop once against local actions\n agent-native agents list List connected/discoverable agents\n agent-native invoke <app> \"prompt\"\n Call another agent-native app over A2A\n agent-native script <name> Run an action (deprecated alias for 'action')\n agent-native typecheck Run TypeScript type checking\n agent-native create [name] Scaffold a new agent-native workspace with a\n multi-select template picker. Use --standalone\n for a single-app scaffold.\n agent-native code Launch Agent-Native Code workspace. Type a task or\n use goals like /migrate and /audit.\n agent-native code serve Run the Agent-Native Code remote connector.\n agent-native mcp <cmd> Connect external coding agents over MCP.\n cmds: serve | install | uninstall | status |\n token (--client claude-code|codex|cowork|\n cursor|opencode|github-copilot)\n agent-native connect <url> Authenticate your coding agent to a DEPLOYED app.\n OAuth-capable clients (Claude Code) get a /mcp\n authenticate prompt; Codex / Cowork use the\n browser device-code flow. --all connects every\n first-party app; --token is the no-browser\n fallback. Usually run for you by 'skills add'.\n agent-native reconnect [url] Re-authenticate an existing MCP entry without\n reinstalling app skills/connectors.\n agent-native app-skill <cmd> Install, launch, or package app-backed skills.\n cmds: ensure | launch | pack\n agent-native skills add assets|design-exploration|visual-plan|visual-recap|context-xray\n Install the skill instructions, register the MCP\n connector, AND authenticate it in one step.\n --no-connect skips auth (run 'connect' later);\n non-interactive shells print the connect command.\n --with-github-action also writes the PR Visual\n Recap workflow into .github/workflows/.\n agent-native recap <cmd> PR visual recap setup and GitHub Action helpers.\n Run 'agent-native recap help' for subcommands.\n agent-native plan <cmd> Plan helpers for block catalogs and local files.\n cmds: blocks | local init | local check |\n local serve | local verify | local preview\n agent-native migrate <source> Create an Agent-Native Code /migrate session, or use\n --emit for a portable own-agent dossier.\n agent-native add-app [name] Add one or more apps to the current workspace\n agent-native workspace-dev Start the multi-app workspace gateway\n agent-native deploy Build & deploy every app in the workspace to\n a single origin (your-agents.com/<app>/*)\n agent-native setup-agents Create symlinks for all agent tools\n agent-native info <pkg> Print info about an installed package:\n exports, source paths, and docs links.\n agent-native add <kind> <name|url>\n Emit an integration blueprint to stdout for your\n coding agent to apply. Pipe it in:\n 'agent-native add provider stripe | claude'.\n kinds: provider | channel | sandbox | action.\n Pass a URL instead of a name for a generic\n research-and-integrate blueprint. --list to\n browse available blueprints.\n agent-native audit-agent-web Audit a public URL for agent-readable surfaces\n agent-native eval [pattern] Run the app's evals (**/*.eval.ts, evals/*.ts)\n and exit non-zero if any scores below its\n threshold. A CI deploy gate. --json for CI,\n --threshold N to override all thresholds.\n\nOptions:\n -h, --help Show this help message\n -v, --version Show version number\n --template <names> Comma-separated templates to pre-select\n (mail,calendar,analytics,...) — or\n github:user/repo for community templates\n --headless Create the primitive-first action-only scaffold\n --standalone Scaffold a single standalone app (no workspace)\n --emit [dir] With migrate, emit an own-agent dossier\n --describe <text> With migrate, describe URL/prose-only sources\n --preset <name> Workspace deploy preset:\n cloudflare_pages (default), netlify, or vercel\n --build-only Build workspace deploy artifacts without publishing\n --eager With workspace dev, start every app immediately\n --url <url> URL to audit with audit-agent-web\n\nFeedback: ${FEEDBACK_URL}\nBugs: ${BUGS_URL}`);\n break;\n\n default:\n if (command && !command.startsWith(\"-\")) {\n // A bare, single command-like token with no further args is almost\n // always a mistyped subcommand (e.g. `agent-native destory`). Silently\n // forwarding it to the coding agent would run an LLM with file-write\n // powers on a typo — a real footgun on a code-modifying tool. Refuse it\n // and point at the explicit forms. Intentional natural-language tasks\n // are still dispatched: a quoted phrase (`agent-native \"fix tests\"`,\n // which arrives as one argv token containing a space) or multi-word\n // input (`agent-native fix the tests`, which has trailing args).\n const looksLikeMistypedSubcommand =\n args.length === 0 && /^[a-z][a-z0-9-]*$/i.test(command);\n if (!looksLikeMistypedSubcommand) {\n import(\"./code.js\")\n .then((m) => m.runCode([command, ...args]))\n .catch(handleScaffoldImportError);\n break;\n }\n console.error(`Unknown command: ${command}`);\n console.error(\n `If you meant to start a coding session with this as the task, run:\\n` +\n ` agent-native code ${JSON.stringify(command)}\\n` +\n `or quote a natural-language task:\\n` +\n ` agent-native \"fix the failing tests\"`,\n );\n console.error('Run \"agent-native --help\" for usage.');\n console.error(`Bugs: ${BUGS_URL}`);\n process.exit(1);\n }\n console.error(`Unknown command: ${command}`);\n console.error('Run \"agent-native --help\" for usage.');\n console.error(`Bugs: ${BUGS_URL}`);\n process.exit(1);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources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AuB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI;gBAClD,qCAAqC;gBACrC,wCAAwC,CAC3C,CAAC;YACF,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { execSync, spawn } from \"child_process\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { fileURLToPath } from \"url\";\nimport * as Sentry from \"@sentry/node\";\n\n// Resolve version once at module scope — used by both --version and --help\nlet _version = \"unknown\";\ntry {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n // dist/cli/index.js → ../../package.json\n const pkg = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, \"../../package.json\"), \"utf-8\"),\n );\n _version = pkg.version;\n} catch {}\n\n// Fail fast on unsupported Node versions. `engines.node: \">=22\"` is only\n// advisory — npx/pnpm merely warn — so without this an older Node (18/20)\n// first fails deep inside a scaffold dynamic import with a cryptic\n// ERR_MODULE / syntax error that `handleScaffoldImportError` misreports as a\n// corrupt npx cache. A clear up-front message saves that whole detour.\nconst REQUIRED_NODE_MAJOR = 22;\nconst _nodeMajor = Number(process.versions.node.split(\".\")[0]);\nif (Number.isFinite(_nodeMajor) && _nodeMajor < REQUIRED_NODE_MAJOR) {\n console.error(\n `agent-native requires Node.js ${REQUIRED_NODE_MAJOR} or newer, but you're on Node ${process.versions.node}.\\n` +\n `Upgrade Node (https://nodejs.org) and re-run. With nvm: \\`nvm install ${REQUIRED_NODE_MAJOR}\\`.`,\n );\n process.exit(1);\n}\n\n/**\n * Build a redacted \"command\" tag from process.argv. Strips the value that\n * follows any --token / --key / --secret / --password / --api-key flag so\n * we don't ship developer secrets to Sentry alongside the crash.\n *\n * Supports both `--token foo` (separate argv item) and `--token=foo`\n * (combined argv item) forms.\n */\nconst SECRET_FLAG_RE = /^--?(token|key|secret|password|api[_-]?key)$/i;\nconst SECRET_FLAG_EQ_RE =\n /^(--?(token|key|secret|password|api[_-]?key))=(.*)$/i;\nfunction buildRedactedCommandTag(argv: string[]): string {\n const out: string[] = [];\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n if (SECRET_FLAG_RE.test(a)) {\n out.push(a);\n // Consume the next argv item as the secret value\n if (i + 1 < argv.length) {\n out.push(\"<redacted>\");\n i++;\n }\n continue;\n }\n const m = a.match(SECRET_FLAG_EQ_RE);\n if (m) {\n out.push(`${m[1]}=<redacted>`);\n continue;\n }\n out.push(a);\n }\n return out.join(\" \");\n}\n\nSentry.init({\n dsn: \"https://0d384e9eff2f6542af468b92769f2f5b@o117565.ingest.us.sentry.io/4511270386466816\",\n release: `agent-native-cli@${_version}`,\n // Sentry's Http integration wraps outgoing fetch in a way that breaks the\n // hosted Plan MCP route negotiation used by recap CI smoke checks.\n integrations: (integrations) =>\n integrations.filter((integration) => integration.name !== \"Http\"),\n // sendDefaultPii MUST stay false — the CLI runs in third-party developer\n // environments and we never want to ship request headers, IPs, cookies,\n // or process env contents to Sentry without explicit consent.\n sendDefaultPii: false,\n beforeSend(event) {\n // Drop expected user-input rejections (validateRepoName, etc.) so they\n // don't pollute Sentry with non-bug noise.\n const exceptionType = event.exception?.values?.[0]?.type;\n if (\n exceptionType === \"ValidationError\" ||\n event.tags?.handled === \"validation\"\n ) {\n return null;\n }\n\n // Defense in depth: strip any sensitive fields that may have been\n // attached to the event despite sendDefaultPii: false (e.g. integrations\n // that capture request metadata).\n if (event.request) {\n if (event.request.headers) {\n const headers = event.request.headers as Record<string, string>;\n for (const k of Object.keys(headers)) {\n const lk = k.toLowerCase();\n if (\n lk === \"cookie\" ||\n lk === \"authorization\" ||\n lk === \"set-cookie\" ||\n lk === \"proxy-authorization\"\n ) {\n delete headers[k];\n }\n }\n }\n // Cookies are also exposed via event.request.cookies as a separate field\n delete (event.request as Record<string, unknown>).cookies;\n }\n // Keep user info that was explicitly set via Sentry.setUser (id/email)\n // so we can attribute crashes back to the operator. Always strip\n // ip_address — the CLI runs on third-party machines and the IP is auto-\n // collected without consent. If only auto-collected fields remain,\n // drop the user object entirely.\n if (event.user) {\n const user = event.user as Record<string, unknown>;\n delete user.ip_address;\n const hasIdentity =\n typeof user.id === \"string\" ||\n typeof user.email === \"string\" ||\n typeof user.username === \"string\";\n if (!hasIdentity) {\n delete event.user;\n }\n }\n // Sentry's contexts can carry process.env snapshots — strip env-shaped\n // contexts so we don't leak deployment secrets.\n if (event.contexts && typeof event.contexts === \"object\") {\n delete (event.contexts as Record<string, unknown>).runtime_env;\n }\n\n event.tags = {\n ...event.tags,\n // Build the command tag from process.argv with secrets redacted so\n // `agent-native ... --token foo` doesn't leak `foo` to Sentry.\n command: buildRedactedCommandTag(process.argv.slice(2)),\n subcommand: process.argv[2] ?? \"none\",\n nodeVersion: process.version,\n platform: process.platform,\n };\n return event;\n },\n});\n\n// Identify the operator so future CLI errors carry spaceId / builderUserId\n// that we can map back to a real Builder user. The CLI doesn't have a real\n// email today — only the env-managed identifiers from the workspace's .env.\n{\n const builderUserId = process.env.BUILDER_USER_ID;\n const builderPublicKey = process.env.BUILDER_PUBLIC_KEY;\n if (builderUserId) {\n Sentry.setUser({ id: builderUserId });\n Sentry.setTag(\"builderUserId\", builderUserId);\n }\n if (builderPublicKey) {\n Sentry.setTag(\"spaceId\", builderPublicKey);\n }\n}\n\nconst FEEDBACK_URL =\n \"https://forms.agent-native.com/f/agent-native-feedback/_16ewV?source=cli\";\nconst BUGS_URL = \"https://github.com/BuilderIO/agent-native/issues\";\n\nconst command = process.argv[2];\n// Filter out bare \"--\" separators that pnpm inserts between its args and script args\nconst args = process.argv.slice(3).filter((a) => a !== \"--\");\n\nfunction parseScaffoldArgs(argv: string[]): {\n name?: string;\n template?: string;\n standalone: boolean;\n headless: boolean;\n} {\n let name: string | undefined;\n let template: string | undefined;\n let standalone = false;\n let headless = false;\n\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n if (arg === \"--template\" && argv[i + 1]) {\n template = argv[++i];\n } else if (arg.startsWith(\"--template=\")) {\n template = arg.slice(\"--template=\".length);\n } else if (arg === \"--standalone\") {\n standalone = true;\n } else if (arg === \"--headless\") {\n headless = true;\n } else if (!arg.startsWith(\"-\") && !name) {\n name = arg;\n }\n }\n\n return { name, template, standalone, headless };\n}\n\n// Track CLI usage (best-effort, non-blocking)\nfunction trackCli(event: string, props?: Record<string, unknown>): void {\n try {\n import(\"../tracking/registry.js\").then((m) => {\n m.track(event, { command, ...props });\n });\n import(\"../tracking/providers.js\").then((m) =>\n m.registerBuiltinProviders(),\n );\n } catch {}\n}\n\n// Global error handler — show feedback link on unhandled crashes\nprocess.on(\"uncaughtException\", (err) => {\n console.error(`\\n Unexpected error: ${err.message}\\n`);\n console.error(` Report this bug: ${BUGS_URL}`);\n console.error(` Send feedback: ${FEEDBACK_URL}\\n`);\n trackCli(\"cli.crash\", { error: err.message });\n Sentry.captureException(err);\n Sentry.flush(2000).finally(() => process.exit(1));\n});\n\nprocess.on(\"unhandledRejection\", (reason: any) => {\n console.error(`\\n Unhandled error: ${reason?.message ?? reason}\\n`);\n console.error(` Report this bug: ${BUGS_URL}`);\n console.error(` Send feedback: ${FEEDBACK_URL}\\n`);\n trackCli(\"cli.crash\", { error: reason?.message ?? String(reason) });\n Sentry.captureException(reason);\n Sentry.flush(2000).finally(() => process.exit(1));\n});\n\n// Surface a self-heal hint when an interrupted `npx @agent-native/core@latest ...`\n// leaves a half-extracted package in the npx cache and a follow-up run fails\n// to load one of our own sub-modules.\nfunction handleScaffoldImportError(err: any): never {\n const msg = err?.message ?? String(err);\n const looksLikeCorruptCache =\n err?.code === \"ERR_MODULE_NOT_FOUND\" ||\n err?.code === \"MODULE_NOT_FOUND\" ||\n err?.code === \"ENOENT\" ||\n /Cannot find module|tarball|integrity|EINTEGRITY|corrupt|truncated/i.test(\n msg,\n );\n if (looksLikeCorruptCache) {\n console.error(\n `\\n Failed to load the scaffolder. This usually means an earlier\\n \\`npx\\` run was interrupted and left a corrupt cache.\\n\\n Clear the npx cache and try again:\\n rm -rf ~/.npm/_npx\\n npx @agent-native/core@latest create\\n\\n Original error: ${msg}\\n`,\n );\n } else {\n console.error(`\\n Failed to load the scaffolder: ${msg}\\n`);\n }\n trackCli(\"cli.scaffold.import_error\", { error: msg });\n Sentry.captureException(err);\n Sentry.flush(2000).finally(() => process.exit(1));\n throw err;\n}\n\nfunction findViteBin(): string {\n // Look for vite in node_modules/.bin\n const localVite = path.resolve(\"node_modules/.bin/vite\");\n if (fs.existsSync(localVite)) return localVite;\n return \"vite\"; // fallback to PATH\n}\n\nfunction findTsxBin(): string {\n const localTsx = path.resolve(\"node_modules/.bin/tsx\");\n if (fs.existsSync(localTsx)) return localTsx;\n return \"tsx\";\n}\n\nfunction findReactRouterBin(): string {\n const localBin = path.resolve(\"node_modules/.bin/react-router\");\n if (fs.existsSync(localBin)) return localBin;\n return \"react-router\";\n}\n\n/** Check if the project uses React Router framework mode (has react-router.config.ts) */\nfunction isReactRouterFramework(): boolean {\n return (\n fs.existsSync(path.resolve(\"react-router.config.ts\")) ||\n fs.existsSync(path.resolve(\"react-router.config.js\"))\n );\n}\n\nfunction isWorkspaceRoot(): boolean {\n const pkgPath = path.resolve(\"package.json\");\n if (!fs.existsSync(pkgPath)) return false;\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n return (\n typeof pkg?.[\"agent-native\"]?.workspaceCore === \"string\" &&\n fs.existsSync(path.resolve(\"apps\"))\n );\n } catch {\n return false;\n }\n}\n\nfunction run(\n cmd: string,\n cmdArgs: string[],\n opts?: { stdio?: \"inherit\" | \"pipe\" },\n) {\n const child = spawn(cmd, cmdArgs, {\n stdio: opts?.stdio ?? \"inherit\",\n shell: process.platform === \"win32\",\n env: process.env,\n });\n child.on(\"exit\", (code) => process.exit(code ?? 0));\n // Forward signals to child so Cmd+C doesn't leave zombie processes holding ports\n for (const sig of [\"SIGINT\", \"SIGTERM\", \"SIGHUP\"] as const) {\n process.on(sig, () => {\n child.kill(sig);\n setTimeout(() => {\n try {\n child.kill(\"SIGKILL\");\n } catch {}\n process.exit(1);\n }, 5000).unref();\n });\n }\n return child;\n}\n\n/**\n * Walk up from `cwd` and try to figure out which template / app this build\n * is running for. We look for two patterns:\n *\n * - `templates/<name>/...` — building inside the framework monorepo\n * - `apps/<name>/...` — building inside a scaffolded workspace\n *\n * Both, neither, or one may match. Used purely as Sentry tags so we can\n * filter the noisy \"Command failed: react-router build\" issues by template.\n */\nfunction inferBuildContext(cwd: string): {\n template?: string;\n app?: string;\n} {\n const segs = cwd.split(path.sep);\n let template: string | undefined;\n let app: string | undefined;\n for (let i = 0; i < segs.length - 1; i++) {\n if (segs[i] === \"templates\" && segs[i + 1] && !segs[i + 1].startsWith(\".\"))\n template = segs[i + 1];\n if (segs[i] === \"apps\" && segs[i + 1] && !segs[i + 1].startsWith(\".\"))\n app = segs[i + 1];\n }\n return { template, app };\n}\n\n/**\n * Run a build subcommand, streaming its stdout/stderr to the user's terminal\n * in real time while also capturing bounded tails for Sentry. On non-zero\n * exit we report a structured event (template, app, exit code, stderr/stdout\n * tails) and exit with the child's code. We deliberately do NOT throw — the\n * global uncaughtException handler would re-capture with a generic\n * \"Error: Command failed\" title, collapsing every template's failure into\n * one issue (which is exactly what we're trying to fix here).\n */\nfunction runBuildStep(\n cmd: string,\n cmdArgs: string[],\n opts: { label: string; env?: NodeJS.ProcessEnv },\n): Promise<void> {\n return new Promise<void>((resolve) => {\n const STDERR_TAIL_BYTES = 8000;\n const STDOUT_TAIL_BYTES = 4000;\n let stderrBuf = \"\";\n let stdoutBuf = \"\";\n\n const child = spawn(cmd, cmdArgs, {\n stdio: [\"inherit\", \"pipe\", \"pipe\"],\n shell: process.platform === \"win32\",\n env: opts.env ?? process.env,\n });\n\n child.stdout?.on(\"data\", (chunk: Buffer) => {\n process.stdout.write(chunk);\n const next = stdoutBuf + chunk.toString(\"utf-8\");\n stdoutBuf =\n next.length > STDOUT_TAIL_BYTES ? next.slice(-STDOUT_TAIL_BYTES) : next;\n });\n child.stderr?.on(\"data\", (chunk: Buffer) => {\n process.stderr.write(chunk);\n const next = stderrBuf + chunk.toString(\"utf-8\");\n stderrBuf =\n next.length > STDERR_TAIL_BYTES ? next.slice(-STDERR_TAIL_BYTES) : next;\n });\n\n child.on(\"error\", (err) => {\n // Failure to spawn (ENOENT, etc.).\n const cwd = process.cwd();\n const { template, app } = inferBuildContext(cwd);\n Sentry.captureException(err, {\n tags: {\n buildStep: opts.label,\n ...(template ? { template } : {}),\n ...(app ? { app } : {}),\n },\n extra: {\n command: `${cmd} ${cmdArgs.join(\" \")}`,\n cwd,\n stage: \"spawn\",\n },\n });\n Sentry.flush(2000).finally(() => process.exit(1));\n });\n\n child.on(\"exit\", (code, signal) => {\n const exitCode = code ?? (signal ? 1 : 0);\n if (exitCode === 0) {\n resolve();\n return;\n }\n const cwd = process.cwd();\n const { template, app } = inferBuildContext(cwd);\n const childCommand = `${cmd} ${cmdArgs.join(\" \")}`;\n const err = new Error(\n `Build step \"${opts.label}\" failed with exit code ${exitCode}` +\n (template ? ` (template=${template})` : \"\") +\n (app ? ` (app=${app})` : \"\"),\n );\n Sentry.captureException(err, {\n tags: {\n buildStep: opts.label,\n ...(template ? { template } : {}),\n ...(app ? { app } : {}),\n },\n extra: {\n command: childCommand,\n cwd,\n exitCode,\n signal: signal ?? null,\n stderrTail: stderrBuf,\n stdoutTail: stdoutBuf,\n },\n });\n // Don't throw — see comment on runBuildStep above.\n Sentry.flush(2000).finally(() => process.exit(exitCode));\n });\n });\n}\n\ntrackCli(\"cli.run\");\n\nswitch (command) {\n case \"dev\": {\n if (isWorkspaceRoot()) {\n import(\"./workspace-dev.js\")\n .then((m) => m.runWorkspaceDev({ args }))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n const vite = findViteBin();\n run(vite, args);\n break;\n }\n\n case \"workspace-dev\": {\n import(\"./workspace-dev.js\")\n .then((m) => m.runWorkspaceDev({ args }))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"build\": {\n // React Router framework mode uses `react-router build` which\n // internally runs `vite build` with proper environment orchestration.\n // Legacy SPA mode uses `vite build` directly.\n //\n // Each step uses runBuildStep so that on failure we get a Sentry event\n // tagged with template/app and including stderr/stdout tails. If the\n // child exits non-zero, runBuildStep calls process.exit itself; the\n // continuation only runs on success.\n (async () => {\n if (isReactRouterFramework()) {\n const rr = findReactRouterBin();\n console.log(\"Building (React Router framework mode)...\");\n await runBuildStep(rr, [\"build\"], { label: \"react-router-build\" });\n } else {\n const vite = findViteBin();\n console.log(\"Building...\");\n await runBuildStep(vite, [\"build\"], { label: \"vite-build\" });\n }\n\n // Post-build: framework-mode apps also need a Nitro server bundle for\n // `agent-native start` and for serverless presets.\n if (isReactRouterFramework()) {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n const deployBuild = path.resolve(__dirname, \"../deploy/build.js\");\n if (fs.existsSync(deployBuild)) {\n await runBuildStep(\"node\", [deployBuild], {\n label: \"deploy-build\",\n env: process.env,\n });\n } else {\n console.warn(\n `[build] Deploy build script not found at ${deployBuild}. Skipping post-build step.`,\n );\n }\n }\n\n console.log(\"\\nBuild complete.\");\n })().catch((err) => {\n // runBuildStep handles its own failures and exits, so reaching here\n // implies a programming error in the orchestration above. Capture\n // and exit so the global unhandledRejection handler doesn't double-\n // report with a generic title.\n Sentry.captureException(err);\n Sentry.flush(2000).finally(() => process.exit(1));\n });\n break;\n }\n\n case \"start\": {\n // Like `next start` — runs Nitro production server\n const serverEntry = path.resolve(\".output/server/index.mjs\");\n if (!fs.existsSync(serverEntry)) {\n console.error(\n 'No production build found. Run \"agent-native build\" first.',\n );\n process.exit(1);\n }\n run(\"node\", [serverEntry, ...args]);\n break;\n }\n\n case \"action\": {\n // Run an action from actions/ (or scripts/ for backwards compat)\n const actionName = args[0];\n if (!actionName) {\n console.error(\"Usage: agent-native action <name> [--args]\");\n process.exit(1);\n }\n const tsxAction = findTsxBin();\n // Try actions/run.ts first, fall back to scripts/run.ts\n const actionsRun = path.resolve(\"actions/run.ts\");\n const scriptsRun = path.resolve(\"scripts/run.ts\");\n const runFile = fs.existsSync(actionsRun) ? actionsRun : scriptsRun;\n run(tsxAction, [runFile, ...args]);\n break;\n }\n\n case \"agent\": {\n import(\"./agent.js\")\n .then(async (m) => {\n const code = await m.runAgent(args);\n if (code !== 0) process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"script\": {\n // @deprecated — use `agent-native action` instead\n const scriptName = args[0];\n if (!scriptName) {\n console.error(\"Usage: agent-native script <name> [--args]\");\n process.exit(1);\n }\n const tsx = findTsxBin();\n // Try actions/run.ts first, fall back to scripts/run.ts\n const actionsRunScript = path.resolve(\"actions/run.ts\");\n const scriptsRunScript = path.resolve(\"scripts/run.ts\");\n const runFileScript = fs.existsSync(actionsRunScript)\n ? actionsRunScript\n : scriptsRunScript;\n run(tsx, [runFileScript, ...args]);\n break;\n }\n\n case \"typecheck\": {\n // Run TypeScript type checking\n // React Router framework mode generates route types first\n if (isReactRouterFramework()) {\n const rr = findReactRouterBin();\n try {\n execSync(`${rr} typegen`, { stdio: \"inherit\" });\n } catch {\n // typegen may fail if routes aren't set up yet — continue to tsc\n }\n }\n const tsc = path.resolve(\"node_modules/.bin/tsc\");\n const tscBin = fs.existsSync(tsc) ? tsc : \"tsc\";\n run(tscBin, [\"--noEmit\", ...args]);\n break;\n }\n\n case \"create\": {\n // Defaults to creating a workspace with a multi-select template picker.\n // Use --standalone for the old single-app flow.\n // --template foo,bar Pre-select multiple templates in the picker\n // --standalone Scaffold a single standalone app\n const parsed = parseScaffoldArgs(args);\n import(\"./create.js\")\n .then((m) =>\n m.createApp(parsed.name, {\n template: parsed.headless ? \"headless\" : parsed.template,\n standalone: parsed.standalone,\n }),\n )\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"invoke\": {\n import(\"./invoke.js\")\n .then(async (m) => {\n const code = await m.runInvoke(args);\n process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"agents\": {\n import(\"./agents.js\")\n .then(async (m) => {\n const code = await m.runAgents(args);\n process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"migrate\": {\n import(\"./migrate.js\")\n .then((m) => m.runMigrate(args))\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"code\": {\n import(\"./code.js\")\n .then((m) => m.runCode(args))\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"mcp\": {\n // Connect external coding agents (Claude Code, Cowork, Codex) over MCP.\n // `mcp serve` runs the stdio transport; install/uninstall/status/token\n // manage client configs + the local token.\n import(\"./mcp.js\")\n .then((m) => m.runMcp(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"connect\": {\n // Wire your local coding agent to a DEPLOYED agent-native app via a\n // browser device-code flow (no token copying). `--all` connects every\n // first-party hosted app; `--token` is the no-browser fallback.\n import(\"./connect.js\")\n .then(async (m) => {\n await m.runConnect(args);\n process.exit(process.exitCode ?? 0);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"reconnect\":\n case \"reauth\": {\n // Refresh an existing remote MCP auth/config entry without reinstalling\n // app skills or running the broader connector setup path.\n import(\"./connect.js\")\n .then((m) => m.runConnect([\"reconnect\", ...args]))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"app-skill\": {\n // Package or install an agent-native app as a skill-backed MCP/app bundle.\n import(\"./app-skill.js\")\n .then((m) => m.runAppSkill(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"skills\": {\n // Friendly skill install surface. Wraps open skills installation plus MCP.\n import(\"./skills.js\")\n .then((m) => m.runSkills(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"recap\": {\n // PR visual recap helpers used by the GitHub Action. Promoted to the CLI\n // so an installed repo's workflow can call `agent-native recap …` instead\n // of copying helper scripts. Run `agent-native recap help` for the full\n // subcommand list.\n import(\"./recap.js\")\n .then((m) => m.runRecap(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"plan\": {\n // Plan authoring helpers: local MDX preview plus a no-auth block catalog\n // fetcher for text-only/local installs.\n import(\"./plan-local.js\")\n .then((m) => m.runPlan(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"create-workspace\": {\n // Deprecated alias for `create` (since workspace is now the default).\n const parsed = parseScaffoldArgs(args);\n import(\"./create-workspace.js\")\n .then((m) =>\n m.createWorkspace({ name: parsed.name, template: parsed.template }),\n )\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"add-app\": {\n // Add one or more apps to the current workspace.\n const parsed = parseScaffoldArgs(args);\n import(\"./create.js\")\n .then((m) =>\n m.addAppToWorkspace(parsed.name, { template: parsed.template }),\n )\n .catch(handleScaffoldImportError);\n break;\n }\n\n case \"deploy\": {\n // Build and deploy the entire workspace as one unit. Each app is served\n // at /<app>/* under the same origin.\n import(\"../deploy/workspace-deploy.js\")\n .then((m) => m.runWorkspaceDeploy({ args }))\n .catch((err) => {\n console.error(\"Deploy failed:\", err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"setup-agents\": {\n import(\"./setup-agents.js\").then((m) => m.runSetupAgents());\n break;\n }\n\n case \"info\": {\n // Print read-only info about an installable package (e.g. @agent-native/scheduling).\n // Lists subpath exports, source paths in node_modules, and docs pointers.\n import(\"./info.js\").then((m) => m.runInfo(args[0]));\n break;\n }\n\n case \"add\": {\n // Blueprint installer (à la Flue's `flue add`): instead of scaffolding\n // files, emit a curated Markdown integration blueprint to stdout so it can\n // be piped into a coding agent — `agent-native add provider stripe | claude`.\n // A URL instead of a name yields a generic research-and-integrate blueprint.\n import(\"./add.js\")\n .then((m) => {\n const code = m.runAdd(args);\n process.exit(code);\n })\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"audit-agent-web\": {\n import(\"./audit-agent-web.js\")\n .then((m) => m.runAuditAgentWeb(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"eval\": {\n // Discover and run the app's evals (**/*.eval.ts, evals/*.ts), score the\n // agent's output, and exit non-zero if any eval falls below its threshold.\n // Doubles as a CI deploy gate. `--json` emits a machine-readable report.\n import(\"./eval.js\")\n .then((m) => m.runEval(args))\n .catch((err) => {\n console.error(err?.message ?? err);\n process.exit(1);\n });\n break;\n }\n\n case \"--version\":\n case \"-v\": {\n console.log(_version);\n break;\n }\n\n case undefined:\n import(\"./code.js\")\n .then((m) => m.runCode([]))\n .catch(handleScaffoldImportError);\n break;\n\n case \"--help\":\n case \"-h\":\n console.log(`agent-native v${_version}\n\nUsage:\n agent-native Launch Agent-Native Code workspace\n agent-native \"fix tests\" Start an Agent-Native Code coding session\n agent-native dev Start development server\n (or the workspace gateway at a workspace root)\n agent-native build Build for production (client + server)\n agent-native start Start production server\n agent-native action <name> Run an action from actions/\n agent-native agent \"prompt\" Run the app-agent loop once against local actions\n agent-native agents list List connected/discoverable agents\n agent-native invoke <app> \"prompt\"\n Call another agent-native app over A2A\n agent-native script <name> Run an action (deprecated alias for 'action')\n agent-native typecheck Run TypeScript type checking\n agent-native create [name] Scaffold a new agent-native workspace with a\n multi-select template picker. Use --standalone\n for a single-app scaffold.\n agent-native code Launch Agent-Native Code workspace. Type a task or\n use goals like /migrate and /audit.\n agent-native code serve Run the Agent-Native Code remote connector.\n agent-native mcp <cmd> Connect external coding agents over MCP.\n cmds: serve | install | uninstall | status |\n token (--client claude-code|codex|cowork|\n cursor|opencode|github-copilot)\n agent-native connect <url> Authenticate your coding agent to a DEPLOYED app.\n OAuth-capable clients (Claude Code) get a /mcp\n authenticate prompt; Codex / Cowork use the\n browser device-code flow. --all connects every\n first-party app; --token is the no-browser\n fallback. Usually run for you by 'skills add'.\n agent-native reconnect [url] Re-authenticate an existing MCP entry without\n reinstalling app skills/connectors.\n agent-native app-skill <cmd> Install, launch, or package app-backed skills.\n cmds: ensure | launch | pack\n agent-native skills add assets|design-exploration|visual-plan|visual-recap|context-xray\n Install the skill instructions, register the MCP\n connector, AND authenticate it in one step.\n --no-connect skips auth (run 'connect' later);\n non-interactive shells print the connect command.\n --with-github-action also writes the PR Visual\n Recap workflow into .github/workflows/.\n agent-native recap <cmd> PR visual recap setup and GitHub Action helpers.\n Run 'agent-native recap help' for subcommands.\n agent-native plan <cmd> Plan helpers for block catalogs and local files.\n cmds: blocks | local init | local check |\n local serve | local verify | local preview\n agent-native migrate <source> Create an Agent-Native Code /migrate session, or use\n --emit for a portable own-agent dossier.\n agent-native add-app [name] Add one or more apps to the current workspace\n agent-native workspace-dev Start the multi-app workspace gateway\n agent-native deploy Build & deploy every app in the workspace to\n a single origin (your-agents.com/<app>/*)\n agent-native setup-agents Create symlinks for all agent tools\n agent-native info <pkg> Print info about an installed package:\n exports, source paths, and docs links.\n agent-native add <kind> <name|url>\n Emit an integration blueprint to stdout for your\n coding agent to apply. Pipe it in:\n 'agent-native add provider stripe | claude'.\n kinds: provider | channel | sandbox | action.\n Pass a URL instead of a name for a generic\n research-and-integrate blueprint. --list to\n browse available blueprints.\n agent-native audit-agent-web Audit a public URL for agent-readable surfaces\n agent-native eval [pattern] Run the app's evals (**/*.eval.ts, evals/*.ts)\n and exit non-zero if any scores below its\n threshold. A CI deploy gate. --json for CI,\n --threshold N to override all thresholds.\n\nOptions:\n -h, --help Show this help message\n -v, --version Show version number\n --template <names> Comma-separated templates to pre-select\n (mail,calendar,analytics,...) — or\n github:user/repo for community templates\n --headless Create the primitive-first action-only scaffold\n --standalone Scaffold a single standalone app (no workspace)\n --emit [dir] With migrate, emit an own-agent dossier\n --describe <text> With migrate, describe URL/prose-only sources\n --preset <name> Workspace deploy preset:\n cloudflare_pages (default), netlify, or vercel\n --build-only Build workspace deploy artifacts without publishing\n --eager With workspace dev, start every app immediately\n --url <url> URL to audit with audit-agent-web\n\nFeedback: ${FEEDBACK_URL}\nBugs: ${BUGS_URL}`);\n break;\n\n default:\n if (command && !command.startsWith(\"-\")) {\n // A bare, single command-like token with no further args is almost\n // always a mistyped subcommand (e.g. `agent-native destory`). Silently\n // forwarding it to the coding agent would run an LLM with file-write\n // powers on a typo — a real footgun on a code-modifying tool. Refuse it\n // and point at the explicit forms. Intentional natural-language tasks\n // are still dispatched: a quoted phrase (`agent-native \"fix tests\"`,\n // which arrives as one argv token containing a space) or multi-word\n // input (`agent-native fix the tests`, which has trailing args).\n const looksLikeMistypedSubcommand =\n args.length === 0 && /^[a-z][a-z0-9-]*$/i.test(command);\n if (!looksLikeMistypedSubcommand) {\n import(\"./code.js\")\n .then((m) => m.runCode([command, ...args]))\n .catch(handleScaffoldImportError);\n break;\n }\n console.error(`Unknown command: ${command}`);\n console.error(\n `If you meant to start a coding session with this as the task, run:\\n` +\n ` agent-native code ${JSON.stringify(command)}\\n` +\n `or quote a natural-language task:\\n` +\n ` agent-native \"fix the failing tests\"`,\n );\n console.error('Run \"agent-native --help\" for usage.');\n console.error(`Bugs: ${BUGS_URL}`);\n process.exit(1);\n }\n console.error(`Unknown command: ${command}`);\n console.error('Run \"agent-native --help\" for usage.');\n console.error(`Bugs: ${BUGS_URL}`);\n process.exit(1);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotatedCodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/AnnotatedCodeBlock.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AA6IpC,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAO,EACP,GAAG,GACJ,EAAE,cAAc,CAAC,iBAAiB,CAAC,2CAwUnC;AAOD,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,CAAC,iBAAiB,CAAC,2CAiJnC;AAED,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"AnnotatedCodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/AnnotatedCodeBlock.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAgJpC,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAO,EACP,GAAG,GACJ,EAAE,cAAc,CAAC,iBAAiB,CAAC,2CAgXnC;AAOD,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,CAAC,iBAAiB,CAAC,2CAiJnC;AAED,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"}