@agent-native/core 0.59.0 → 0.60.0

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 (220) hide show
  1. package/dist/a2a/index.d.ts +2 -0
  2. package/dist/a2a/index.d.ts.map +1 -1
  3. package/dist/a2a/index.js +1 -0
  4. package/dist/a2a/index.js.map +1 -1
  5. package/dist/a2a/invoke.d.ts +63 -0
  6. package/dist/a2a/invoke.d.ts.map +1 -0
  7. package/dist/a2a/invoke.js +157 -0
  8. package/dist/a2a/invoke.js.map +1 -0
  9. package/dist/agent/run-store.d.ts +15 -0
  10. package/dist/agent/run-store.d.ts.map +1 -1
  11. package/dist/agent/run-store.js +28 -0
  12. package/dist/agent/run-store.js.map +1 -1
  13. package/dist/chat-threads/store.d.ts +21 -0
  14. package/dist/chat-threads/store.d.ts.map +1 -1
  15. package/dist/chat-threads/store.js +128 -0
  16. package/dist/chat-threads/store.js.map +1 -1
  17. package/dist/cli/agent.d.ts +23 -0
  18. package/dist/cli/agent.d.ts.map +1 -0
  19. package/dist/cli/agent.js +300 -0
  20. package/dist/cli/agent.js.map +1 -0
  21. package/dist/cli/agents.d.ts +14 -0
  22. package/dist/cli/agents.d.ts.map +1 -0
  23. package/dist/cli/agents.js +95 -0
  24. package/dist/cli/agents.js.map +1 -0
  25. package/dist/cli/code-agent-executor.d.ts.map +1 -1
  26. package/dist/cli/code-agent-executor.js +264 -2
  27. package/dist/cli/code-agent-executor.js.map +1 -1
  28. package/dist/cli/create.d.ts +3 -2
  29. package/dist/cli/create.d.ts.map +1 -1
  30. package/dist/cli/create.js +154 -83
  31. package/dist/cli/create.js.map +1 -1
  32. package/dist/cli/index.js +50 -2
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/cli/invoke.d.ts +26 -0
  35. package/dist/cli/invoke.d.ts.map +1 -0
  36. package/dist/cli/invoke.js +227 -0
  37. package/dist/cli/invoke.js.map +1 -0
  38. package/dist/cli/templates-meta.d.ts +1 -1
  39. package/dist/cli/templates-meta.d.ts.map +1 -1
  40. package/dist/cli/templates-meta.js +9 -8
  41. package/dist/cli/templates-meta.js.map +1 -1
  42. package/dist/cli/workspacify.d.ts +1 -1
  43. package/dist/cli/workspacify.d.ts.map +1 -1
  44. package/dist/cli/workspacify.js +6 -6
  45. package/dist/cli/workspacify.js.map +1 -1
  46. package/dist/client/AgentPanel.js +1 -1
  47. package/dist/client/AgentPanel.js.map +1 -1
  48. package/dist/client/AssistantChat.d.ts.map +1 -1
  49. package/dist/client/AssistantChat.js +8 -2
  50. package/dist/client/AssistantChat.js.map +1 -1
  51. package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
  52. package/dist/client/NewWorkspaceAppFlow.js +5 -4
  53. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  54. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  55. package/dist/client/agent-chat-adapter.js +65 -12
  56. package/dist/client/agent-chat-adapter.js.map +1 -1
  57. package/dist/client/blocks/library/diagram.d.ts.map +1 -1
  58. package/dist/client/blocks/library/diagram.js +23 -17
  59. package/dist/client/blocks/library/diagram.js.map +1 -1
  60. package/dist/client/blocks/types.d.ts +2 -0
  61. package/dist/client/blocks/types.d.ts.map +1 -1
  62. package/dist/client/blocks/types.js.map +1 -1
  63. package/dist/client/chat/index.d.ts +1 -1
  64. package/dist/client/chat/index.d.ts.map +1 -1
  65. package/dist/client/chat/index.js.map +1 -1
  66. package/dist/client/extensions/ExtensionViewer.js +1 -1
  67. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  68. package/dist/client/index.d.ts +1 -1
  69. package/dist/client/index.d.ts.map +1 -1
  70. package/dist/client/index.js.map +1 -1
  71. package/dist/client/notifications/NotificationsBell.d.ts +3 -1
  72. package/dist/client/notifications/NotificationsBell.d.ts.map +1 -1
  73. package/dist/client/notifications/NotificationsBell.js +7 -3
  74. package/dist/client/notifications/NotificationsBell.js.map +1 -1
  75. package/dist/client/use-chat-threads.d.ts +13 -0
  76. package/dist/client/use-chat-threads.d.ts.map +1 -1
  77. package/dist/client/use-chat-threads.js +41 -0
  78. package/dist/client/use-chat-threads.js.map +1 -1
  79. package/dist/integrations/plugin.d.ts.map +1 -1
  80. package/dist/integrations/plugin.js +2 -2
  81. package/dist/integrations/plugin.js.map +1 -1
  82. package/dist/onboarding/default-steps.d.ts.map +1 -1
  83. package/dist/onboarding/default-steps.js +102 -0
  84. package/dist/onboarding/default-steps.js.map +1 -1
  85. package/dist/org/auto-join-domain.d.ts +11 -3
  86. package/dist/org/auto-join-domain.d.ts.map +1 -1
  87. package/dist/org/auto-join-domain.js +7 -6
  88. package/dist/org/auto-join-domain.js.map +1 -1
  89. package/dist/org/context.d.ts.map +1 -1
  90. package/dist/org/context.js +68 -32
  91. package/dist/org/context.js.map +1 -1
  92. package/dist/org/migrations.d.ts.map +1 -1
  93. package/dist/org/migrations.js +6 -0
  94. package/dist/org/migrations.js.map +1 -1
  95. package/dist/provider-api/actions/github-repo-files.d.ts +84 -0
  96. package/dist/provider-api/actions/github-repo-files.d.ts.map +1 -0
  97. package/dist/provider-api/actions/github-repo-files.js +213 -0
  98. package/dist/provider-api/actions/github-repo-files.js.map +1 -0
  99. package/dist/provider-api/github-repo.d.ts +11 -0
  100. package/dist/provider-api/github-repo.d.ts.map +1 -0
  101. package/dist/provider-api/github-repo.js +553 -0
  102. package/dist/provider-api/github-repo.js.map +1 -0
  103. package/dist/provider-api/index.d.ts +184 -11
  104. package/dist/provider-api/index.d.ts.map +1 -1
  105. package/dist/provider-api/index.js +519 -0
  106. package/dist/provider-api/index.js.map +1 -1
  107. package/dist/scripts/docs/search.d.ts.map +1 -1
  108. package/dist/scripts/docs/search.js +38 -13
  109. package/dist/scripts/docs/search.js.map +1 -1
  110. package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
  111. package/dist/secrets/register-framework-secrets.js +11 -0
  112. package/dist/secrets/register-framework-secrets.js.map +1 -1
  113. package/dist/server/agent-chat-plugin.d.ts +32 -0
  114. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  115. package/dist/server/agent-chat-plugin.js +297 -2
  116. package/dist/server/agent-chat-plugin.js.map +1 -1
  117. package/dist/server/auth-marketing.d.ts.map +1 -1
  118. package/dist/server/auth-marketing.js +17 -7
  119. package/dist/server/auth-marketing.js.map +1 -1
  120. package/dist/server/auth.d.ts.map +1 -1
  121. package/dist/server/auth.js +6 -0
  122. package/dist/server/auth.js.map +1 -1
  123. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  124. package/dist/server/core-routes-plugin.js +18 -98
  125. package/dist/server/core-routes-plugin.js.map +1 -1
  126. package/dist/styles/blocks.css +30 -8
  127. package/dist/styles/rich-markdown-editor.css +10 -4
  128. package/dist/templates/{starter-shell-sync.spec.ts → chat-shell-sync.spec.ts} +21 -21
  129. package/dist/templates/default/.agents/skills/actions/SKILL.md +5 -5
  130. package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +63 -0
  131. package/dist/templates/default/AGENTS.md +22 -1
  132. package/dist/templates/default/actions/hello.ts +1 -1
  133. package/dist/templates/default/actions/navigate.ts +1 -1
  134. package/dist/templates/default/actions/view-screen.ts +1 -1
  135. package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +63 -0
  136. package/dist/templates/headless/.env.example +4 -0
  137. package/dist/templates/headless/.prettierrc +5 -0
  138. package/dist/templates/headless/AGENTS.md +58 -0
  139. package/dist/templates/headless/DEVELOPING.md +22 -0
  140. package/dist/templates/headless/_gitignore +36 -0
  141. package/dist/templates/headless/actions/hello.ts +14 -0
  142. package/dist/templates/headless/actions/run.ts +3 -0
  143. package/dist/templates/headless/package.json +22 -0
  144. package/dist/templates/headless/tsconfig.json +7 -0
  145. package/dist/templates/ui-primitives-sync.spec.ts +2 -2
  146. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +5 -5
  147. package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +63 -0
  148. package/dist/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +9 -0
  149. package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +93 -0
  150. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +11 -1
  151. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +1 -1
  152. package/dist/templates/workspace-core/AGENTS.md +20 -3
  153. package/dist/templates/workspace-core/src/server/index.ts +1 -1
  154. package/dist/templates/workspace-root/AGENTS.md +25 -5
  155. package/dist/templates/workspace-root/README.md +7 -7
  156. package/dist/triggers/dispatcher.d.ts +2 -3
  157. package/dist/triggers/dispatcher.d.ts.map +1 -1
  158. package/dist/triggers/dispatcher.js +2 -3
  159. package/dist/triggers/dispatcher.js.map +1 -1
  160. package/dist/triggers/routes.d.ts +38 -0
  161. package/dist/triggers/routes.d.ts.map +1 -0
  162. package/dist/triggers/routes.js +202 -0
  163. package/dist/triggers/routes.js.map +1 -0
  164. package/dist/vite/client.d.ts +2 -1
  165. package/dist/vite/client.d.ts.map +1 -1
  166. package/dist/vite/client.js +121 -2
  167. package/dist/vite/client.js.map +1 -1
  168. package/docs/AGENTS.md +57 -0
  169. package/docs/SKILL.md +40 -0
  170. package/docs/content/a2a-protocol.md +1 -1
  171. package/docs/content/actions.md +48 -8
  172. package/docs/content/agent-surfaces.md +76 -14
  173. package/docs/content/cli-adapters.md +1 -1
  174. package/docs/content/cloneable-saas.md +5 -4
  175. package/docs/content/code-agents-ui.md +1 -1
  176. package/docs/content/components.md +1 -1
  177. package/docs/content/context-awareness.md +15 -3
  178. package/docs/content/creating-templates.md +15 -7
  179. package/docs/content/drop-in-agent.md +1 -1
  180. package/docs/content/faq.md +6 -4
  181. package/docs/content/getting-started.md +63 -73
  182. package/docs/content/key-concepts.md +24 -24
  183. package/docs/content/native-chat-ui.md +4 -4
  184. package/docs/content/pure-agent-apps.md +34 -10
  185. package/docs/content/security.md +1 -1
  186. package/docs/content/server.md +1 -1
  187. package/docs/content/template-chat.md +85 -0
  188. package/docs/content/template-dispatch.md +1 -1
  189. package/docs/content/tracking.md +1 -1
  190. package/docs/content/what-is-agent-native.md +7 -6
  191. package/package.json +10 -1
  192. package/src/templates/{starter-shell-sync.spec.ts → chat-shell-sync.spec.ts} +21 -21
  193. package/src/templates/default/.agents/skills/actions/SKILL.md +5 -5
  194. package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +63 -0
  195. package/src/templates/default/AGENTS.md +22 -1
  196. package/src/templates/default/actions/hello.ts +1 -1
  197. package/src/templates/default/actions/navigate.ts +1 -1
  198. package/src/templates/default/actions/view-screen.ts +1 -1
  199. package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +63 -0
  200. package/src/templates/headless/.env.example +4 -0
  201. package/src/templates/headless/.prettierrc +5 -0
  202. package/src/templates/headless/AGENTS.md +58 -0
  203. package/src/templates/headless/DEVELOPING.md +22 -0
  204. package/src/templates/headless/_gitignore +36 -0
  205. package/src/templates/headless/actions/hello.ts +14 -0
  206. package/src/templates/headless/actions/run.ts +3 -0
  207. package/src/templates/headless/package.json +22 -0
  208. package/src/templates/headless/tsconfig.json +7 -0
  209. package/src/templates/ui-primitives-sync.spec.ts +2 -2
  210. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +5 -5
  211. package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +63 -0
  212. package/src/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +9 -0
  213. package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +93 -0
  214. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +11 -1
  215. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +1 -1
  216. package/src/templates/workspace-core/AGENTS.md +20 -3
  217. package/src/templates/workspace-core/src/server/index.ts +1 -1
  218. package/src/templates/workspace-root/AGENTS.md +25 -5
  219. package/src/templates/workspace-root/README.md +7 -7
  220. package/docs/content/template-starter.md +0 -78
@@ -1,123 +1,113 @@
1
1
  ---
2
2
  title: "Getting Started"
3
- description: "Choose the right path: hosted apps, local setup, agent-native skills, or external-agent connections."
3
+ description: "Create a chat-first agent-native app, or start headless with one action and add UI later."
4
4
  ---
5
5
 
6
6
  # Getting Started
7
7
 
8
- Agent-Native is for apps where a real UI and an AI agent share the same actions, data, and state. This page helps you choose the right starting point, then walks through the local setup path.
8
+ Agent-Native is for apps where an AI agent and any UI around it share the same actions, data, and state. The default starting point is the [Chat template](/docs/template-chat): a minimal chat app with durable threads, a left sidebar, auth, live sync, and actions ready to extend.
9
9
 
10
- ## Pick your path {#who-is-this-for}
10
+ Start with Chat when you want a browser app users can talk to immediately. Start headless when you only want actions and the local app-agent loop for now.
11
11
 
12
- Start with the path that matches what you want to do next:
12
+ If you already know you want a finished domain app, go to [Templates](/docs/cloneable-saas). If you are choosing between headless, chat, embedded, or full app, go to [Agent Surfaces](/docs/agent-surfaces). Otherwise, keep going.
13
13
 
14
- - **Use a starter app.** Browse the [template gallery](/templates). Hosted apps already include sign-in, data, and the agent sidebar. No install required.
15
- - **Build or customize your own app.** Continue with [Create a local app](#create-your-app). You'll scaffold a template, run it locally, then change the code, brand, data model, and integrations.
16
- - **Choose headless, chat, embedded, or full app.** Use [Agent Surfaces](/docs/agent-surfaces) when you know the workflow but not how much UI belongs around it.
17
- - **Add agent-native skills to a code tool.** Jump to [Try it with a skill](#try-with-a-skill) to add Plans or PR Recaps to Claude Code, Codex, or Cursor without scaffolding an app.
18
- - **Connect an external agent to an app.** Use [External Agents](/docs/external-agents) to connect Claude, ChatGPT, Codex, Cursor, OpenCode, GitHub Copilot / VS Code, or another MCP host to an existing app.
19
-
20
- If you're not sure, use the hosted app when you want to use software now. Use the local path when you want to own and change the software.
21
-
22
- ## Create a local app {#create-your-app}
14
+ ## Create a chat app {#create-your-agent}
23
15
 
24
16
  You'll need [Node.js 22 or newer](https://nodejs.org) and [pnpm](https://pnpm.io) installed. Then run:
25
17
 
26
18
  ```bash
27
- npx @agent-native/core@latest create my-platform
28
- cd my-platform
29
- pnpm install && pnpm dev
19
+ npx @agent-native/core@latest create my-chat-app --template chat
20
+ cd my-chat-app
21
+ pnpm install
22
+ pnpm dev
30
23
  ```
31
24
 
32
- The `create` command opens a template picker. Pick one template for a single app, or pick several templates to create a workspace where the apps share auth, brand, and agent configuration. If you want one app directory instead of a workspace, pass `--standalone`.
33
-
34
- Open the URL the dev server prints. The workspace gateway always starts on port 8080 and serves every app through it; individual apps run on their own ports that are printed at startup. Standalone apps default to `http://localhost:3000`.
35
-
36
- ### Agent credentials {#agent-credentials}
37
-
38
- In local development the embedded agent panel picks up your existing Claude Code or Codex CLI login automatically, or reads `ANTHROPIC_API_KEY` from a `.env` file in the project root. The database defaults to SQLite (stored at `data/app.db`) when `DATABASE_URL` is not set, so you can run the full stack with no external services. For production deployments — where you'll want Postgres, a persistent secret, and bring-your-own-key per user — see [Deployment](/docs/deployment).
39
-
40
- ## What just happened? {#what-just-happened}
41
-
42
- You now have a real app running on your machine with an agent built into it:
43
-
44
- - The UI works like a normal SaaS product: routes, forms, tables, settings, and keyboard flows.
45
- - The agent panel can read the current screen and run the same actions the UI runs.
46
- - Changes stay in sync because the UI and agent share the same database and application state.
25
+ This creates the minimal Chat app: a full-page chat route, durable chat threads, the standard left sidebar, an `actions/` folder, the framework runtime, and a SQLite database at `data/app.db` unless you set `DATABASE_URL`.
26
+
27
+ Open the local URL, then ask the chat what actions are available. The scaffold includes one example action:
28
+
29
+ ```ts
30
+ // actions/hello.ts
31
+ import { defineAction } from "@agent-native/core/action";
32
+ import { z } from "zod";
33
+
34
+ export default defineAction({
35
+ description: "Say hello from the local agent.",
36
+ schema: z.object({
37
+ name: z.string().default("world"),
38
+ }),
39
+ http: { method: "GET" },
40
+ readOnly: true,
41
+ run: async ({ name }) => {
42
+ return { message: `Hello, ${name}!` };
43
+ },
44
+ });
45
+ ```
47
46
 
48
- That parity between agent and UI is the whole point — see [What Is Agent-Native?](/docs/what-is-agent-native) for the bigger picture.
47
+ Run that action directly:
49
48
 
50
- ## Pick a template {#templates}
49
+ ```bash
50
+ pnpm action hello --name Steve
51
+ ```
51
52
 
52
- Templates are complete apps, not blank starters. Choose one when you want a familiar product to customize:
53
+ Then run the same app-agent loop from the terminal:
53
54
 
54
- - **Productivity apps** — [Mail](/docs/template-mail), [Calendar](/docs/template-calendar), [Forms](/docs/template-forms), [Content](/docs/template-content), [Slides](/docs/template-slides), [Design](/docs/template-design), [Clips](/docs/template-clips), and [Video](/docs/template-videos)
55
- - **Team and data apps** [Analytics](/docs/template-analytics), [Brain](/docs/template-brain), [Dispatch](/docs/template-dispatch), [Assets](/docs/template-assets), and [Plan](/docs/template-plan)
56
- - **Bare starting point** — [Starter](/docs/template-starter), a minimal app with the framework wiring and no domain model
55
+ ```bash
56
+ pnpm agent "Call the hello action for Steve and explain what happened."
57
+ ```
57
58
 
58
- Browse the [template gallery](/templates) for live hosted apps. See [Templates](/docs/cloneable-saas) for the full catalog and the clone customize deploy flow.
59
+ That is the local app-agent loop. The chat UI, CLI, HTTP, MCP, A2A, jobs, and future screens can all call the same action surface.
59
60
 
60
- ## Add more apps to a workspace {#creating-vs-adding-apps}
61
+ ## Start headless instead {#headless}
61
62
 
62
- `create` (above) makes a brand-new workspace. Once you have one, add more apps to it with `add-app`, run from the workspace root:
63
+ Use headless mode when you want no browser app yet:
63
64
 
64
65
  ```bash
65
- cd my-platform
66
- npx @agent-native/core@latest add-app
66
+ npx @agent-native/core@latest create my-agent --headless
67
+ cd my-agent
67
68
  pnpm install
68
- pnpm dev
69
+ pnpm action hello --name Steve
70
+ pnpm agent "Call the hello action for Steve and explain what happened."
69
71
  ```
70
72
 
71
- If your terminal is inside `apps/content` or another app folder, the CLI still detects the workspace and adds the new app as a sibling under `apps/`. Go back to the workspace root before running `pnpm install` or `pnpm dev`.
73
+ This creates the smallest local Agent-Native runtime: an `actions/` folder, instructions, the framework runtime, and SQL state. Later, add chat by starting from the [Chat template](/docs/template-chat) and moving your actions in, or by copying the Chat template's route/sidebar pattern into the headless app.
72
74
 
73
- To add another app from a specific template, pass a name and `--template`:
75
+ ### Agent credentials {#agent-credentials}
74
76
 
75
- ```bash
76
- npx @agent-native/core@latest add-app design-lab --template design
77
- ```
77
+ In local development the agent command reads provider credentials from your environment, such as `ANTHROPIC_API_KEY` in a `.env` file in the project root. Browser chat surfaces can also use configured agent credentials. The full loop is not stateless: actions, auth/session data, application state, threads, and run history use SQL. Locally that defaults to SQLite; in production you will usually point `DATABASE_URL` at Postgres or another persistent SQL database. See [Deployment](/docs/deployment).
78
78
 
79
- ## Try it with a skill {#try-with-a-skill}
79
+ ## What just happened? {#what-just-happened}
80
80
 
81
- Don't want to scaffold an app? Add agent-native capabilities to a coding agent you already use. Installing the **Plans** skill turns the plans your agent writes into structured, reviewable docs with diagrams, wireframes, and inline comments:
81
+ You now have a real app-agent loop:
82
82
 
83
- ```bash
84
- npx @agent-native/core@latest skills add visual-plan
85
- ```
83
+ - `hello` is one action definition, available to the agent, CLI, HTTP, MCP, A2A, and any future UI.
84
+ - `pnpm agent` calls the same production app-agent loop used by chat, jobs, webhooks, and hosted runtimes.
85
+ - Changes and history stay in sync because the local runtime uses SQL-backed state, even when you have no custom UI yet.
86
86
 
87
- That one command installs the skill instructions, registers the hosted MCP connector, and signs you in — no marketplace browsing, no manual OAuth. Then run `/visual-plan` in your agent. See the [Skills Guide](/docs/skills-guide#app-backed-skills) for more skills, local/offline installs, and how app-backed skills work.
88
-
89
- Need the opposite direction, where Claude, ChatGPT, Codex, Cursor, OpenCode, GitHub Copilot / VS Code, or another MCP host calls an agent-native app? Use [External Agents](/docs/external-agents).
87
+ That parity between agent and UI is the whole point. See [What Is Agent-Native?](/docs/what-is-agent-native) for the bigger picture.
90
88
 
91
89
  ## Project structure {#project-structure}
92
90
 
93
- Every agent-native app — whether from a template or from scratch — follows the same structure:
91
+ Every agent-native app follows the same structure:
94
92
 
95
93
  ```text
96
94
  my-app/
97
- app/ # React frontend (routes, components, hooks)
98
- server/ # Nitro API server (routes, plugins)
99
95
  actions/ # Agent-callable actions
96
+ app/ # React frontend in UI templates; omitted in headless apps
97
+ server/ # Nitro API server (routes, plugins)
100
98
  .agents/ # Agent instructions and skills
99
+ data/app.db # Local SQLite runtime state when DATABASE_URL is unset
101
100
  ```
102
101
 
103
- Templates add domain-specific code on top: database schemas in `server/db/`, API routes in `server/routes/api/`, and actions in `actions/`. Building from scratch? See [Creating Templates](/docs/creating-templates) for `vite.config.ts`, `tsconfig.json`, and Tailwind setup.
104
-
105
- ## Architecture principles {#architecture-principles}
106
-
107
- The three principles that apply to every agent-native app:
108
-
109
- - **Agent + UI are equal partners** — everything the UI can do, the agent can do, and vice versa; they share the same database.
110
- - **Everything is an action** — agent tools, UI mutations, HTTP endpoints, MCP tools, and CLI commands are all the same `defineAction()` definition.
111
- - **All state in SQL** — app state, navigation, drafts, and settings live in the database so both agent and UI always see the same picture.
112
-
113
- The definitive six rules are in [Key Concepts](/docs/key-concepts).
102
+ Templates add domain-specific code on top: database schemas in `server/db/`, API routes in `server/routes/api/`, and actions in `actions/`. See [Creating Templates](/docs/creating-templates) when you are ready to build or publish a reusable template.
114
103
 
115
104
  ## Common next moves {#next-docs}
116
105
 
117
- Once your app is running, the usual next step is small and concrete:
106
+ Once your agent is running, the usual next step is small and concrete:
118
107
 
119
- - **Ask the built-in agent what it sees** — open the agent panel and type "what app am I looking at, and what can you do here?" This verifies that the app, UI state, and agent loop are connected.
120
- - **Make one customization** — rename the app, change the first screen copy, or add a field to a form. The project `AGENTS.md` already tells coding agents how this repo is organized.
108
+ - **Ask the built-in agent what it can do** — open Chat and type "what actions do you have, and what can you do here?" This verifies that the app-agent loop is connected.
109
+ - **Add one real action** — replace `hello` with the smallest useful operation in your domain.
110
+ - **Add UI only when it clarifies the work** — use [Agent Surfaces](/docs/agent-surfaces) to choose between headless, chat, embedded, and full-app surfaces.
121
111
  - **Deploy it** — see [Deployment](/docs/deployment) when you're ready to put the app on your own domain.
122
112
 
123
113
  Useful follow-up docs:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: "Key Concepts"
3
- description: "How agent-native apps work: the four-area checklist, SQL database, agent chat bridge, polling sync, actions, external-agent entry points, context awareness, and portability."
3
+ description: "How agent-native apps work: actions first, SQL database, app-agent loop, optional UI, polling sync, external-agent entry points, context awareness, and portability."
4
4
  ---
5
5
 
6
6
  # Key Concepts
@@ -16,7 +16,7 @@ Teams today have four options for AI-powered work, and none of them are ideal:
16
16
  3. **Custom AI apps** — limited. The AI can't see what you see, can't react to what you click, and can't update the app itself. No conversation history, no rollback, no skills.
17
17
  4. **Existing SaaS** (Amplitude, HubSpot, Google Slides) — bolting AI onto architectures that weren't designed for it. You can feel the seams.
18
18
 
19
- Agent-native apps solve this by making the agent and the UI equal citizens of the same system. Think of it as Claude Code, but with buttons and visual interfaces. The agent can do anything the UI can do (via natural language), and the UI can trigger anything the agent can do (via buttons).
19
+ Agent-native apps solve this by making the agent and any UI equal citizens of the same system. Think of it as Claude Code, but with durable actions, SQL state, and visual interfaces when the workflow needs them. A workflow can start as one callable action, then grow into chat, screens, schedules, or a full app without rewriting the operation.
20
20
 
21
21
  See [What Is Agent-Native?](/docs/what-is-agent-native) for the full vision and philosophy.
22
22
 
@@ -26,11 +26,11 @@ Every agent-native app is three things working together:
26
26
 
27
27
  > **Agent** — Autonomous AI that reads data, writes data, runs actions, and modifies code. Customizable with skills and instructions.
28
28
  >
29
- > **Application** — Full React UI with dashboards, flows, and visualizations. Guided experiences your team can use.
29
+ > **Application** — The product surface around the agent. This may be action-only at first, rich chat, a small control plane, or a full React UI with dashboards, flows, and visualizations.
30
30
  >
31
31
  > **Computer** — Database, browser, code execution. Agents work directly with SQL and built-in tools; MCP servers are optional add-ons, not the foundation.
32
32
 
33
- Every app includes an embedded agent panel with chat and optional CLI terminal. Locally, you run `pnpm dev` and the agent is right there. In the cloud, Builder.io provides a managed frame — the environment that hosts the agent next to your app — with collaboration, visual editing, and managed infrastructure for teams.
33
+ Headless apps can run the same production app-agent loop from the folder with `pnpm agent`, while UI apps mount the embedded agent panel and run locally with `pnpm dev`. In the cloud, Builder.io provides a managed frame — the environment that hosts the agent next to your app — with collaboration, visual editing, and managed infrastructure for teams.
34
34
 
35
35
  Six rules govern the architecture:
36
36
 
@@ -43,7 +43,7 @@ Six rules govern the architecture:
43
43
 
44
44
  ## The four-area checklist {#four-area-checklist}
45
45
 
46
- Every new feature must update all four areas. Skipping any one breaks the agent-native contract.
46
+ Every user-facing feature should update all applicable areas. Skipping an applicable area breaks the agent-native contract; forcing a UI onto an action-only primitive is also a smell.
47
47
 
48
48
  | Area | Description |
49
49
  | ---------------- | -------------------------------------------------------------- |
@@ -52,7 +52,7 @@ Every new feature must update all four areas. Skipping any one breaks the agent-
52
52
  | **3. Skills** | Update AGENTS.md and/or create a skill documenting the pattern |
53
53
  | **4. App-State** | Navigation state, view-screen data, and navigate commands |
54
54
 
55
- A feature with only UI is invisible to the agent. A feature with only actions is invisible to the user. A feature without app-state means the agent is blind to what the user is doing.
55
+ A feature with only UI is invisible to the agent. A full UI feature with only actions is invisible to the user. A feature without app-state means the agent is blind to what the user is doing. A headless operation can legitimately start with action + instructions and add UI/app-state later when humans need to browse, approve, configure, or share it.
56
56
 
57
57
  ## Data in SQL {#data-in-sql}
58
58
 
@@ -116,7 +116,7 @@ When the agent needs to do something complex — call an API, process data, quer
116
116
 
117
117
  ```ts
118
118
  // actions/fetch-data.ts
119
- import { defineAction } from "@agent-native/core";
119
+ import { defineAction } from "@agent-native/core/action";
120
120
  import { z } from "zod";
121
121
 
122
122
  export default defineAction({
@@ -190,23 +190,23 @@ See [Context Awareness](/docs/context-awareness) for the full pattern: navigatio
190
190
 
191
191
  Agent-native supports a lot of agent-facing protocols because different hosts standardize different pieces of the same workflow. App authors should not have to choose among them or rebuild the same operation for each client. The center of gravity stays the action system.
192
192
 
193
- | Surface | Status | What agent-native provides | What you write |
194
- | --------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
195
- | Agent tool calling | Shipping | The in-app agent sees actions as function tools with zod-derived JSON Schema. | `defineAction()` |
196
- | UI actions | Shipping | React calls the same action through `useActionMutation()` / `useActionQuery()`. | The same action |
197
- | Native chat widgets | Shipping | Tool results with explicit widget discriminants can render native tables, charts, and typed app results in chat. | Structured action results |
198
- | AgentChatRuntime connectors | Shipping | The chat shell can sit on top of OpenAI Agents, OpenAI Responses, Claude Agent SDK, Vercel AI SDK, AG-UI, or normalized HTTP streams. | Pick a runtime helper or stream normalized events |
199
- | HTTP and CLI | Shipping | Actions auto-mount at `/_agent-native/actions/:name` and run via `pnpm action <name>`. | The same action |
200
- | MCP server | Shipping | External MCP hosts get Streamable HTTP tools, the `ask-agent` meta-tool, and optional MCP Apps resources. | The same action, plus optional `mcpApp` |
201
- | MCP OAuth | Shipping | Standard remote MCP OAuth, PKCE, dynamic client registration, refresh tokens, and `mcp:read` / `mcp:write` / `mcp:apps` scopes. | Nothing per action |
202
- | MCP Apps | Shipping | External hosts that support app resources can render iframe/native-host widgets, with deep-link fallback elsewhere. | Optional `mcpApp` metadata |
203
- | A2A | Shipping | Other agents discover the agent card and call the app over JSON-RPC tasks. | The same actions and agent config |
204
- | Deep links | Shipping | Action results can round-trip users into the running UI through `/_agent-native/open` and `agentnative://open`. | Optional `link` metadata |
205
- | MCP clients | Shipping | The app can also consume local, remote, or hub-shared MCP servers as `mcp__...` tools. | `mcp.config.json` or settings |
206
- | Instructions and skills | Shipping | `AGENTS.md`, skills, memory, slash commands, sub-agents, jobs, and automations live in the SQL-backed workspace. | Workspace resources, not protocol glue |
207
- | Agent Web | Shipping | Public pages can publish `robots.txt`, `sitemap.xml`, `llms.txt`, markdown mirrors, and structured metadata. | Route access plus `agentWeb` config |
208
- | Extensions | Shipping | Sandboxed mini-apps call app actions, persist extension data, and use proxied fetch helpers. | Extension HTML using `appAction()` |
209
- | ACP | Coding-agent/editor | Useful for coding agents inside editors/IDEs; not the general BYO app-chat runtime contract. | Editor/agent adapter work |
193
+ | Surface | Status | What agent-native provides | What you write |
194
+ | --------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
195
+ | Agent tool calling | Shipping | The in-app agent sees actions as function tools with zod-derived JSON Schema. | `defineAction()` |
196
+ | UI actions | Shipping | React calls the same action through `useActionMutation()` / `useActionQuery()`. | The same action |
197
+ | Native chat widgets | Shipping | Tool results with explicit widget discriminants can render native tables, charts, and typed app results in chat. | Structured action results |
198
+ | AgentChatRuntime connectors | Shipping | The chat shell can sit on top of OpenAI Agents, OpenAI Responses, Claude Agent SDK, Vercel AI SDK, AG-UI, or normalized HTTP streams. | Pick a runtime helper or stream normalized events |
199
+ | HTTP and CLI | Shipping | Actions auto-mount at `/_agent-native/actions/:name`, run via `pnpm action <name>`, and can be driven by the headless app-agent loop with `pnpm agent`. | The same action |
200
+ | MCP server | Shipping | External MCP hosts get Streamable HTTP tools, the `ask-agent` meta-tool, and optional MCP Apps resources. | The same action, plus optional `mcpApp` |
201
+ | MCP OAuth | Shipping | Standard remote MCP OAuth, PKCE, dynamic client registration, refresh tokens, and `mcp:read` / `mcp:write` / `mcp:apps` scopes. | Nothing per action |
202
+ | MCP Apps | Shipping | External hosts that support app resources can render iframe/native-host widgets, with deep-link fallback elsewhere. | Optional `mcpApp` metadata |
203
+ | A2A | Shipping | Other agents discover the agent card and call the app over JSON-RPC tasks. | The same actions and agent config |
204
+ | Deep links | Shipping | Action results can round-trip users into the running UI through `/_agent-native/open` and `agentnative://open`. | Optional `link` metadata |
205
+ | MCP clients | Shipping | The app can also consume local, remote, or hub-shared MCP servers as `mcp__...` tools. | `mcp.config.json` or settings |
206
+ | Instructions and skills | Shipping | `AGENTS.md`, skills, memory, slash commands, sub-agents, jobs, and automations live in the SQL-backed workspace. | Workspace resources, not protocol glue |
207
+ | Agent Web | Shipping | Public pages can publish `robots.txt`, `sitemap.xml`, `llms.txt`, markdown mirrors, and structured metadata. | Route access plus `agentWeb` config |
208
+ | Extensions | Shipping | Sandboxed mini-apps call app actions, persist extension data, and use proxied fetch helpers. | Extension HTML using `appAction()` |
209
+ | ACP | Coding-agent/editor | Useful for coding agents inside editors/IDEs; not the general BYO app-chat runtime contract. | Editor/agent adapter work |
210
210
 
211
211
  The practical rule is simple: implement domain operations as actions, add `readOnly`, `publicAgent`, `link`, `mcpApp`, or an explicit native widget result only when a surface needs it, and use skills/instructions for behavior. MCP, A2A, MCP Apps, MCP OAuth, UI mutations, native chat widgets, AgentChatRuntime connectors, CLI commands, and deep-link handoffs are adapters around that same core.
212
212
 
@@ -38,12 +38,12 @@ Server actions should import the server-safe helpers and schemas from
38
38
  `@agent-native/core/client/chat` or `@agent-native/core/client`.
39
39
 
40
40
  ```ts
41
+ import { defineAction } from "@agent-native/core/action";
42
+ import { ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER } from "@agent-native/core/action-ui";
41
43
  import {
42
- ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER,
44
+ createDataInsightsWidgetResult,
43
45
  dataInsightsWidgetResultSchema,
44
- defineAction,
45
- } from "@agent-native/core";
46
- import { createDataInsightsWidgetResult } from "@agent-native/core/data-widgets";
46
+ } from "@agent-native/core/data-widgets";
47
47
 
48
48
  export default defineAction({
49
49
  description: "Analyze form responses.",
@@ -1,16 +1,18 @@
1
1
  ---
2
2
  title: "Pure-Agent Apps"
3
- description: "Apps where the agent is the whole product open it, ask for what you want, and the agent does the rest."
3
+ description: "Apps where the first product surface is the app-agent loop: define actions, run them locally, and add UI only when users need it."
4
4
  ---
5
5
 
6
6
  # Pure-Agent Apps
7
7
 
8
- This is the minimal end of agent-native for the full-UI end, start from a [template](/docs/cloneable-saas). If you are choosing between headless, chat-first, embedded, and full-app shapes, start with [Agent Surfaces](/docs/agent-surfaces).
8
+ This is the minimal end of agent-native: an app whose first user-facing surface is the agent loop, not a dashboard. For the full-UI end, start from a [template](/docs/cloneable-saas). If you are choosing between headless, chat-first, embedded, and full-app shapes, start with [Agent Surfaces](/docs/agent-surfaces).
9
9
 
10
- Imagine opening an app and seeing just a chat. No dashboard. No sidebar full of menus. No forms. You ask for what you want "summarize my unread emails," "post the daily metrics to Slack," "find the candidates who replied last week" and the agent goes off and does it. The output shows up in chat, in Slack, in your inbox, wherever it belongs.
10
+ Imagine opening an app and seeing just a chat. No dashboard. No sidebar full of menus. No forms. You ask for what you want - "summarize my unread emails," "post the daily metrics to Slack," "find the candidates who replied last week" - and the agent goes off and does it. The output shows up in chat, in Slack, in your inbox, wherever it belongs.
11
11
 
12
12
  That's a pure-agent app. The agent _is_ the product.
13
13
 
14
+ It is still an app, not a stateless prompt. Actions, auth sessions, app state, thread history, run history, settings, credentials, and share records live in SQL. Locally that defaults to SQLite; hosted deployments should use a persistent SQL database.
15
+
14
16
  ## What it feels like to use one {#user-experience}
15
17
 
16
18
  Most apps are built around a UI: a database table you browse, a form you fill, a chart you read. The agent is a sidekick.
@@ -35,7 +37,7 @@ Pick the pure-agent pattern when:
35
37
  - **The domain is one-shot.** Research bot, summary generator, report writer. There's no persistent object that needs a list view.
36
38
  - **You're prototyping.** Ship the agent now; add a richer UI later if it turns out users actually want one.
37
39
 
38
- If your product is built around persistent objects users browse, pivot, and share emails, events, documents, charts pick a [template](/docs/cloneable-saas) instead. Those have full UIs _plus_ the agent.
40
+ If your product is built around persistent objects users browse, pivot, and share - emails, events, documents, charts - pick a [template](/docs/cloneable-saas) instead. Those have full UIs _plus_ the agent.
39
41
 
40
42
  ## What ships in the box {#minimum-ui}
41
43
 
@@ -62,15 +64,17 @@ The trade-off: pure-agent apps don't give users a "browse-everything-at-a-glance
62
64
 
63
65
  If you're not a developer, you can usually start with the [Dispatch template](/docs/template-dispatch) — it's a workspace-style pure-agent app with Slack/Telegram, scheduled jobs, and shared secrets out of the box.
64
66
 
65
- For developers who want the absolute minimum, start from the **Starter** template:
67
+ For developers who want the absolute minimum, start from a headless scaffold:
66
68
 
67
69
  ```bash
68
- npx @agent-native/core@latest create my-agent --template starter
70
+ npx @agent-native/core@latest create my-agent --headless
69
71
  ```
70
72
 
71
- Starter gives you the architecture, the agent panel, the workspace, auth, polling, and one example action and nothing else. Add your own actions in `actions/`, connect any MCP servers you need, write the relevant skills into the workspace, and you're done.
73
+ This gives you the framework runtime, SQL-backed state, an `actions/` directory, and `pnpm agent` for running the local app-agent loop. Add one useful `defineAction()` and you have a real agent-native app. The same action can later render in chat, appear behind a button, expose an MCP tool, or move into a full UI without changing the core operation.
74
+
75
+ Use [**Chat**](/docs/template-chat) when you are ready to add a browser UI but do not want a domain template. Chat is the add-UI scaffold path, not the required default for a pure-agent app.
72
76
 
73
- If you really want _zero_ UI except the agent, `app/routes/index.tsx` can render `<AgentPanel defaultMode="chat" />` fullscreen. The only thing the user sees is the chat. Everything else job history, workspace, settings is one click away in the panel's tabs.
77
+ If you really want _zero_ custom UI except the agent, keep the app route focused on the built-in chat surface. The only thing the user sees is the chat. Everything else - job history, workspace, settings - is one click away in the panel's tabs.
74
78
 
75
79
  ### What you still get for free {#still-free}
76
80
 
@@ -80,16 +84,36 @@ Even with no custom UI, you still inherit every framework benefit:
80
84
  - **Recurring jobs** for scheduled work — "every morning at 7, summarize my unread emails and post to Slack."
81
85
  - **The workspace** for per-user customization, skills, memory, MCP connections.
82
86
  - **Sub-agent delegation** via [agent teams](/docs/agent-teams).
83
- - **Portability** — deploys to any serverless host, any SQL database.
87
+ - **Portability** — deploys to any serverless host with any supported SQL database.
84
88
  - **Multi-tenant by default** — each user gets their own workspace without a dev-box.
85
89
 
86
90
  ### Adding a tiny bit of UI {#tiny-ui}
87
91
 
88
92
  Most pure-agent apps eventually want a little custom UI — not a dashboard, but maybe a status page, a job history, or a config screen. The [drop-in agent](/docs/drop-in-agent) components coexist with anything else you render. Add a single `/status` route that lists recent runs; keep everything else in the chat. That's usually enough.
89
93
 
94
+ Future UI-grafting tooling should use a distinct verb or namespace. `agent-native add` already means integration blueprints such as providers, channels, and sandbox adapters, so it should not also mean "add UI to this headless app."
95
+
96
+ ## Repo access for cloud headless {#repo-access}
97
+
98
+ Local headless apps run against the folder on your machine. For cloud headless
99
+ apps that need repository access, the intended model is connector-scoped access:
100
+ a GitHub connector and token CRUD that can list repositories, search files, read
101
+ files, create or edit files, and delete files with the user's permission.
102
+
103
+ Do not design this as "clone the user's repo into our VM" or "give the agent a long-lived sandbox copy of the repo" as the primary model. Sandboxes are useful for isolated code execution, but repo access should be a provider integration with explicit tokens, scoped permissions, auditability, and revocation.
104
+
105
+ ## Sharing sessions and runs {#sharing-runs}
106
+
107
+ Pure-agent work produces durable sessions and runs. Shareability should roll out in phases:
108
+
109
+ - **First:** read-only share links so a teammate can open a thread or run, inspect the sanitized transcript, outputs, and status, and follow along without taking control.
110
+ - **Later:** permissioned writable collaboration, such as continuing a run, editing schedules, approving actions, or changing configuration with explicit access checks.
111
+
112
+ That staged model keeps the first sharing surface useful without pretending collaborative control is solved before the permission model is ready.
113
+
90
114
  ## What's next
91
115
 
92
- - [**Getting Started**](/docs/getting-started) — clone the Starter template
116
+ - [**Getting Started**](/docs/getting-started) — create a chat app or headless action first
93
117
  - [**Agent Surfaces**](/docs/agent-surfaces) — choose headless, rich chat, embedded sidecar, or full app
94
118
  - [**Messaging the agent**](/docs/messaging) — how users talk to the agent across web, Slack, Telegram, email
95
119
  - [**Recurring Jobs**](/docs/recurring-jobs) — scheduled prompts the agent runs on its own
@@ -28,7 +28,7 @@ Use `defineAction` with a Zod `schema:` for every action. The framework validate
28
28
 
29
29
  ```typescript
30
30
  import { z } from "zod";
31
- import { defineAction } from "@agent-native/core";
31
+ import { defineAction } from "@agent-native/core/action";
32
32
 
33
33
  export default defineAction({
34
34
  description: "Create a note",
@@ -65,7 +65,7 @@ hatch.
65
65
 
66
66
  ```ts
67
67
  // actions/classify-message.ts
68
- import { defineAction } from "@agent-native/core";
68
+ import { defineAction } from "@agent-native/core/action";
69
69
  import { completeText } from "@agent-native/core/server";
70
70
  import { z } from "zod";
71
71
 
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: "Chat Template"
3
+ description: "A minimal chat-first agent-native app: durable chat threads, actions, application state, live sync, auth, and room to add your own UI."
4
+ ---
5
+
6
+ # Chat Template
7
+
8
+ Chat is the basic agent-native app starting point. It gives you a clean ChatGPT-style shell with chat at the center, a threads list on the left, standard app navigation, auth, live sync, actions, and one example action. Start here when you want a real browser app you can build on without committing to a domain template.
9
+
10
+ If you want the smallest action-only runtime with no browser UI, start with [Pure-Agent Apps](/docs/pure-agent-apps). If you want a finished domain product shape, start from [Calendar](/docs/template-calendar), [Mail](/docs/template-mail), [Content](/docs/template-content), [Forms](/docs/template-forms), [Analytics](/docs/template-analytics), or another domain template.
11
+
12
+ <!-- screenshot:
13
+ app: chat
14
+ view: /
15
+ shows: Full-page chat app with standard left sidebar, chat threads on the left, centered composer, suggested prompts, and no domain data
16
+ account: screenshot-account (no domain data needed — chat ships with no seed schema)
17
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
18
+ -->
19
+
20
+ ![Chat template with a full-page agent chat surface and thread sidebar](/screenshots/chat.png)
21
+
22
+ ## What's in it {#whats-in-it}
23
+
24
+ - **Full-page chat** on `/` using the framework chat surface and durable chat threads.
25
+ - **Thread list in the app sidebar** so users can create, reopen, rename, pin, and archive chats.
26
+ - **Agent chat plugin** pre-configured so the chat talks to the built-in app-agent loop once your agent credentials are set.
27
+ - **Auth** via Better Auth — login, signup, sessions, organizations. The same flow runs locally and in production; in development email verification is skipped.
28
+ - **Actions directory** with one example (`actions/hello.ts`) plus the standard `view-screen` and `navigate` actions.
29
+ - **The framework's core tables** for application state, settings, sessions, resources, chat threads, run history, and other runtime state.
30
+ - **Live sync** (`useDbSync`) already wired so UI auto-refreshes when the agent writes to SQL.
31
+ - **AGENTS.md** with chat-first guidance for adding actions, routes, skills, and application state.
32
+
33
+ ## What's _not_ in it {#not-in-it}
34
+
35
+ - No domain tables or seed data.
36
+ - No dashboards, lists, charts, forms, or provider integrations.
37
+ - No domain-specific actions beyond the example stub.
38
+
39
+ That's the point. Chat is a thin, useful default shell for your own agent, not a domain product pretending to be generic.
40
+
41
+ ## When to pick it {#when-to-pick}
42
+
43
+ - **You want a basic app users can talk to immediately** and then extend with actions and UI.
44
+ - **You have a headless app that needs chat** as the first browser surface.
45
+ - **You want to plug your own agent backend into a familiar chat UI** while keeping Agent-Native's actions, state, auth, and deployment shape.
46
+ - **You are prototyping a custom internal tool** that does not match a domain template.
47
+
48
+ ## Scaffolding {#scaffolding}
49
+
50
+ ```bash
51
+ npx @agent-native/core@latest create my-chat-app --template chat
52
+ cd my-chat-app
53
+ pnpm install
54
+ pnpm dev
55
+ ```
56
+
57
+ Or start with no UI and add a chat surface later:
58
+
59
+ ```bash
60
+ npx @agent-native/core@latest create my-agent --headless
61
+ ```
62
+
63
+ From there, copy the Chat template's `/` route and sidebar thread list into your app, or scaffold a Chat app and move your headless actions into its `actions/` directory. The key invariant stays the same: actions are the shared surface for chat, UI, HTTP, MCP, A2A, and CLI.
64
+
65
+ ## Use your own agent backend {#own-agent-backend}
66
+
67
+ The template uses the built-in app-agent loop by default. To connect a custom backend, swap the chat runtime behind the agent chat plugin instead of rewriting the UI. The Chat route should stay a thin renderer around the shared chat surface; the backend choice belongs in the server plugin/runtime adapter.
68
+
69
+ Use this when your model orchestration already lives elsewhere, but you still want an app with auth, threads, actions, UI state, and deployable pages.
70
+
71
+ ## First edits {#first-edits}
72
+
73
+ After scaffolding, ask the agent:
74
+
75
+ > Add a data model for `notes`. A note has an id, title, body, and owner. Render a notes page at `/notes`, add create/list actions, and keep chat able to create notes.
76
+
77
+ The agent should add a Drizzle schema, actions, route, navigation, and instructions. Then you can use the notes feature from either the UI or chat.
78
+
79
+ ## What's next
80
+
81
+ - [**Getting Started**](/docs) — choose between headless, chat, and domain templates
82
+ - [**Agent Surfaces**](/docs/agent-surfaces) — headless, chat, embedded, and full-app patterns
83
+ - [**Actions**](/docs/actions) — the action system chat and UI both call
84
+ - [**Native Chat UI**](/docs/native-chat-ui) — chat surface primitives and runtime options
85
+ - [**Pure-Agent Apps**](/docs/pure-agent-apps) — action-only apps that can grow into Chat later
@@ -44,7 +44,7 @@ Use Dispatch when:
44
44
  - You want a **messaging hub** that routes Slack or Telegram into the right domain agent.
45
45
  - You want **scheduled jobs** that pull data from several apps.
46
46
 
47
- Skip it for a single-app scaffold — use the [Starter template](/docs/template-starter) or any of the domain templates directly.
47
+ Skip it for a single-app scaffold — use the [Chat template](/docs/template-chat) or any of the domain templates directly.
48
48
 
49
49
  Live demo: [dispatch.agent-native.com](https://dispatch.agent-native.com).
50
50
 
@@ -138,7 +138,7 @@ Call `track()` from action handlers to record user or agent activity:
138
138
 
139
139
  ```ts
140
140
  // actions/create-project.ts
141
- import { defineAction } from "@agent-native/core";
141
+ import { defineAction } from "@agent-native/core/action";
142
142
  import { track } from "@agent-native/core/tracking";
143
143
  import { z } from "zod";
144
144
 
@@ -5,15 +5,16 @@ description: "Why most AI apps feel half-built, what makes an app truly agent-na
5
5
 
6
6
  # What Is Agent-Native?
7
7
 
8
- Agent-native is a way of building software where the AI agent and the UI are **equal partners**. Everything the agent can do, the UI can do. Everything the UI can do, the agent can do. They share the same database, the same state, and they stay in sync.
8
+ Agent-native is a way of building software where the AI agent and the product surface around it are **equal partners**. That surface can be one headless action, a rich chat, or a full UI. The important part is that agents and humans share the same actions, database, and state.
9
9
 
10
10
  If you only remember one thing from this page, remember this: most AI apps today stop one step short of being useful, and that gap is the biggest mistake in the space right now.
11
11
 
12
12
  ## What it looks like as a user {#what-it-looks-like}
13
13
 
14
- Picture your inbox, calendar, form builder, or analytics dashboard. Sometimes the first screen is chat: you ask what you want, the agent guides setup, shows a table or chart, and opens the right app view. Sometimes chat is docked on the right side of a full application. In both cases, you can:
14
+ Picture a background worker, inbox, calendar, form builder, or analytics dashboard. Sometimes there is no custom screen yet: you run one action or one headless app-agent prompt. Sometimes the first screen is chat: you ask what you want, the agent guides setup, shows a table or chart, and opens the right app view. Sometimes chat is docked on the right side of a full application. Across those shapes, you can:
15
15
 
16
- - **Click anything you'd normally click.** All the buttons, lists, dashboards, keyboard shortcuts they all still work. This is a real app, not a chat window pretending to be one.
16
+ - **Start with the real operation.** One durable action can run from the CLI, HTTP, MCP, A2A, the app-agent loop, and later a UI.
17
+ - **Click anything you'd normally click when there is a UI.** All the buttons, lists, dashboards, keyboard shortcuts — they all call the same operations the agent can call.
17
18
  - **Or just ask.** Type "reply to the email from Sara saying I'll be there by 3" into the agent. It opens the right thread, drafts the reply, and shows it to you for approval — exactly as if you'd done it by hand.
18
19
  - **See what it sees.** Open an email, and the agent knows which one. Select a chart, and the agent knows which chart. Highlight a paragraph and hit Cmd+I, and the agent acts on just that paragraph.
19
20
  - **Watch it work.** As the agent does things — opens views, edits drafts, runs reports — the UI updates in real time. You can stop it, redirect it, or take over with the mouse at any moment.
@@ -138,7 +139,7 @@ Agent-native apps follow a fork-and-customize model. You start from a **template
138
139
 
139
140
  Because it's _your_ app, not shared infrastructure, the agent can safely evolve the code. Your app keeps improving as you use it. See [Templates](/docs/cloneable-saas) for the full story.
140
141
 
141
- Not ready to fork a whole template? You can also try agent-native by adding a **skill** to a coding agent you already use — install the Plans skill with `npx @agent-native/core@latest skills add visual-plan`. See [Try it with a skill](/docs/getting-started#try-with-a-skill).
142
+ Not ready to fork a whole template? You can also try agent-native by adding a **skill** to a coding agent you already use — install the Plans skill with `npx @agent-native/core@latest skills add visual-plan`. See the [Skills Guide](/docs/skills-guide#app-backed-skills).
142
143
 
143
144
  ## Composable agents {#composable-agents}
144
145
 
@@ -152,7 +153,7 @@ If you're building or extending an agent-native app, here's the central pattern:
152
153
 
153
154
  ```ts
154
155
  // actions/reply-to-email.ts
155
- import { defineAction } from "@agent-native/core";
156
+ import { defineAction } from "@agent-native/core/action";
156
157
  import { z } from "zod";
157
158
 
158
159
  export default defineAction({
@@ -185,7 +186,7 @@ One action, many surfaces: the agent calls it as a tool, the UI calls it as a ty
185
186
 
186
187
  ## What's next {#whats-next}
187
188
 
188
- - [**Getting Started**](/docs) — pick a template and run it
189
+ - [**Getting Started**](/docs) — start with one action, pick a template, or install a skill
189
190
  - [**Agent Surfaces**](/docs/agent-surfaces) — choose headless, rich chat, embedded sidecar, or full app
190
191
  - [**Key Concepts**](/docs/key-concepts) — the architecture: SQL, actions, polling sync, context awareness, portability
191
192
  - [**Templates**](/docs/cloneable-saas) — templates as complete products you own