@agent-native/core 0.7.51 → 0.7.53

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 (90) hide show
  1. package/dist/a2a/artifact-response.d.ts.map +1 -1
  2. package/dist/a2a/artifact-response.js +109 -5
  3. package/dist/a2a/artifact-response.js.map +1 -1
  4. package/dist/a2a/server.d.ts.map +1 -1
  5. package/dist/a2a/server.js +11 -0
  6. package/dist/a2a/server.js.map +1 -1
  7. package/dist/cli/templates-meta.d.ts.map +1 -1
  8. package/dist/cli/templates-meta.js +1 -0
  9. package/dist/cli/templates-meta.js.map +1 -1
  10. package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
  11. package/dist/client/settings/VoiceTranscriptionSection.js +54 -13
  12. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  13. package/dist/deploy/workspace-deploy.js +32 -3
  14. package/dist/deploy/workspace-deploy.js.map +1 -1
  15. package/dist/integrations/plugin.d.ts.map +1 -1
  16. package/dist/integrations/plugin.js +2 -1
  17. package/dist/integrations/plugin.js.map +1 -1
  18. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  19. package/dist/integrations/webhook-handler.js +10 -0
  20. package/dist/integrations/webhook-handler.js.map +1 -1
  21. package/dist/onboarding/plugin.d.ts.map +1 -1
  22. package/dist/onboarding/plugin.js +2 -1
  23. package/dist/onboarding/plugin.js.map +1 -1
  24. package/dist/org/plugin.d.ts.map +1 -1
  25. package/dist/org/plugin.js +2 -1
  26. package/dist/org/plugin.js.map +1 -1
  27. package/dist/scripts/call-agent.js +2 -2
  28. package/dist/scripts/call-agent.js.map +1 -1
  29. package/dist/server/action-routes.d.ts.map +1 -1
  30. package/dist/server/action-routes.js +5 -11
  31. package/dist/server/action-routes.js.map +1 -1
  32. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  33. package/dist/server/agent-chat-plugin.js +2 -1
  34. package/dist/server/agent-chat-plugin.js.map +1 -1
  35. package/dist/server/auth-plugin.d.ts.map +1 -1
  36. package/dist/server/auth-plugin.js +2 -1
  37. package/dist/server/auth-plugin.js.map +1 -1
  38. package/dist/server/auth.d.ts.map +1 -1
  39. package/dist/server/auth.js +7 -12
  40. package/dist/server/auth.js.map +1 -1
  41. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  42. package/dist/server/core-routes-plugin.js +9 -29
  43. package/dist/server/core-routes-plugin.js.map +1 -1
  44. package/dist/server/cors-origins.d.ts +10 -0
  45. package/dist/server/cors-origins.d.ts.map +1 -0
  46. package/dist/server/cors-origins.js +34 -0
  47. package/dist/server/cors-origins.js.map +1 -0
  48. package/dist/server/create-server.d.ts.map +1 -1
  49. package/dist/server/create-server.js +10 -29
  50. package/dist/server/create-server.js.map +1 -1
  51. package/dist/server/framework-request-handler.d.ts +11 -0
  52. package/dist/server/framework-request-handler.d.ts.map +1 -1
  53. package/dist/server/framework-request-handler.js +24 -1
  54. package/dist/server/framework-request-handler.js.map +1 -1
  55. package/dist/server/resources-plugin.d.ts.map +1 -1
  56. package/dist/server/resources-plugin.js +2 -1
  57. package/dist/server/resources-plugin.js.map +1 -1
  58. package/dist/terminal/terminal-plugin.d.ts.map +1 -1
  59. package/dist/terminal/terminal-plugin.js +2 -1
  60. package/dist/terminal/terminal-plugin.js.map +1 -1
  61. package/docs/content/a2a-protocol.md +93 -14
  62. package/docs/content/agent-mentions.md +2 -2
  63. package/docs/content/agent-teams.md +2 -2
  64. package/docs/content/client.md +1 -1
  65. package/docs/content/cloneable-saas.md +13 -13
  66. package/docs/content/creating-templates.md +253 -211
  67. package/docs/content/dispatch.md +94 -0
  68. package/docs/content/faq.md +2 -2
  69. package/docs/content/frames.md +1 -1
  70. package/docs/content/getting-started.md +9 -1
  71. package/docs/content/key-concepts.md +17 -1
  72. package/docs/content/messaging.md +56 -19
  73. package/docs/content/multi-app-workspace.md +10 -2
  74. package/docs/content/notifications.md +1 -1
  75. package/docs/content/observability.md +184 -0
  76. package/docs/content/onboarding.md +7 -2
  77. package/docs/content/server.md +117 -133
  78. package/docs/content/skills-guide.md +3 -3
  79. package/docs/content/template-analytics.md +8 -6
  80. package/docs/content/template-design.md +25 -27
  81. package/docs/content/template-dispatch.md +3 -1
  82. package/docs/content/template-forms.md +26 -21
  83. package/docs/content/template-mail.md +4 -0
  84. package/docs/content/template-video.md +4 -4
  85. package/docs/content/tools.md +95 -1
  86. package/docs/content/tracking.md +1 -1
  87. package/docs/content/what-is-agent-native.md +4 -2
  88. package/docs/content/workspace-management.md +5 -5
  89. package/docs/content/workspace.md +39 -30
  90. package/package.json +1 -1
@@ -1,200 +1,184 @@
1
1
  ---
2
2
  title: "Server"
3
- description: "Nitro server layer with file-based routing, server plugins, SSE handlers, and production agent configuration."
3
+ description: "Nitro server routes, plugins, framework-mounted routes, request context, and SQL-backed sync."
4
4
  ---
5
5
 
6
6
  # Server
7
7
 
8
- Agent-native apps use [Nitro](https://nitro.build) for the server layer. Nitro is included automatically via the `defineConfig()` Vite plugin you get file-based API routing, server plugins, and deploy-anywhere presets out of the box.
8
+ Agent-native apps use [Nitro](https://nitro.build) for server routes and plugins. Most product behavior should live in [Actions](/docs/actions); custom routes are for protocol surfaces that actions do not fit: uploads, streaming, public pages, webhooks, OAuth callbacks, and provider-specific APIs.
9
9
 
10
- ## File-Based Routing {#file-based-routing}
10
+ ## File-Based Routes {#file-based-routes}
11
11
 
12
- API routes live in `server/routes/`. Nitro auto-discovers them based on file name and path:
12
+ Routes live in `server/routes/` and Nitro maps filenames to methods and paths:
13
13
 
14
14
  ```text
15
15
  server/routes/
16
16
  api/
17
- hello.get.ts GET /api/hello
18
- items/
19
- index.get.ts → GET /api/items
20
- index.post.ts POST /api/items
21
- [id].get.ts GET /api/items/:id
22
- [id].delete.ts → DELETE /api/items/:id
23
- [id]/
24
- archive.patch.ts → PATCH /api/items/:id/archive
17
+ health.get.ts -> GET /api/health
18
+ uploads.post.ts -> POST /api/uploads
19
+ webhooks/
20
+ stripe.post.ts -> POST /api/webhooks/stripe
21
+ [...page].get.ts -> SSR catch-all for public pages
25
22
  ```
26
23
 
27
- Each route file exports a default `defineEventHandler`:
24
+ Each route exports a `defineEventHandler`:
28
25
 
29
26
  ```ts
30
- // server/routes/api/items/index.get.ts
27
+ // server/routes/api/health.get.ts
31
28
  import { defineEventHandler } from "h3";
32
- import fs from "fs/promises";
33
-
34
- export default defineEventHandler(async () => {
35
- const files = await fs.readdir("./data/items");
36
- const items = await Promise.all(
37
- files
38
- .filter((f) => f.endsWith(".json"))
39
- .map(async (f) =>
40
- JSON.parse(await fs.readFile(`./data/items/${f}`, "utf-8")),
41
- ),
42
- );
43
- return items;
44
- });
29
+
30
+ export default defineEventHandler(() => ({
31
+ ok: true,
32
+ service: "my-template",
33
+ }));
45
34
  ```
46
35
 
47
36
  ### Route naming conventions {#route-naming-conventions}
48
37
 
49
- | File name pattern | HTTP method | Example path |
50
- | ------------------ | ----------- | -------------------------- |
51
- | `index.get.ts` | GET | `/api/items` |
52
- | `index.post.ts` | POST | `/api/items` |
53
- | `[id].get.ts` | GET | `/api/items/:id` |
54
- | `[id].patch.ts` | PATCH | `/api/items/:id` |
55
- | `[id].delete.ts` | DELETE | `/api/items/:id` |
56
- | `[...slug].get.ts` | GET | `/api/items/* (catch-all)` |
38
+ | File name pattern | HTTP method | Example path |
39
+ | ------------------ | ----------- | --------------------------- |
40
+ | `index.get.ts` | GET | `/api/items` |
41
+ | `index.post.ts` | POST | `/api/items` |
42
+ | `[id].get.ts` | GET | `/api/items/:id` |
43
+ | `[id].patch.ts` | PATCH | `/api/items/:id` |
44
+ | `[id].delete.ts` | DELETE | `/api/items/:id` |
45
+ | `[...slug].get.ts` | GET | `/api/items/*` or catch-all |
57
46
 
58
- ### Accessing route parameters {#accessing-route-parameters}
47
+ ## Prefer Actions For App Operations {#actions-first}
59
48
 
60
- ```ts
61
- import { defineEventHandler, getRouterParam, readBody, getQuery } from "h3";
49
+ If the UI and agent both need to do something, define an action instead of a custom API route. Actions automatically become:
62
50
 
63
- // GET /api/items/:id
64
- export default defineEventHandler(async (event) => {
65
- const id = getRouterParam(event, "id");
66
- const { filter } = getQuery(event);
67
- // ...
68
- });
69
- ```
51
+ - Agent tools.
52
+ - Typed frontend hooks.
53
+ - HTTP endpoints under `/_agent-native/actions/:name`.
54
+ - MCP and A2A-callable tools.
55
+ - CLI commands for development.
70
56
 
71
- ## Server Plugins {#server-plugins}
57
+ Use custom `/api/*` routes only when you need a route-shaped protocol or binary/streaming behavior. See [Actions](/docs/actions).
72
58
 
73
- Cross-cutting concerns file watchers, file sync, scheduled jobs, auth — go in `server/plugins/`. Nitro runs these at startup before serving requests:
59
+ ## Request Context And Access {#request-context}
60
+
61
+ Actions mounted by the framework automatically run with request context. Custom routes do not. If a custom route reads or writes ownable resources, load the session and wrap the work:
74
62
 
75
63
  ```ts
76
- // server/plugins/file-sync.ts
77
- import { defineNitroPlugin } from "@agent-native/core";
78
- import { createFileSync } from "@agent-native/core/adapters/sync";
79
-
80
- export default defineNitroPlugin(async () => {
81
- const result = await createFileSync({ contentRoot: "./data" });
82
- if (result.status === "error") {
83
- console.warn(`[app] File sync failed: ${result.reason}`);
64
+ import { defineEventHandler } from "h3";
65
+ import { getSession, runWithRequestContext } from "@agent-native/core/server";
66
+ import { getDb } from "@agent-native/core/db";
67
+ import { accessFilter } from "@agent-native/core/access";
68
+ import * as schema from "../../db/schema";
69
+
70
+ export default defineEventHandler(async (event) => {
71
+ const session = await getSession(event);
72
+ if (!session?.user?.email) {
73
+ throw new Response("Unauthorized", { status: 401 });
84
74
  }
75
+
76
+ return runWithRequestContext(
77
+ { userEmail: session.user.email, orgId: session.orgId },
78
+ async () => {
79
+ const db = getDb();
80
+ return db
81
+ .select()
82
+ .from(schema.projects)
83
+ .where(accessFilter(schema.projects, schema.projectShares));
84
+ },
85
+ );
85
86
  });
86
87
  ```
87
88
 
88
- ## Shared State Between Plugins and Routes {#shared-state}
89
+ Do not run unscoped `db.select().from(ownableTable)` in custom routes.
90
+
91
+ ## Server Plugins {#server-plugins}
89
92
 
90
- Use a shared module in `server/lib/` to pass state from plugins to route handlers:
93
+ Plugins live in `server/plugins/` and run at startup. Use them for migrations, provider setup, recurring jobs, integration adapters, and framework plugin configuration.
91
94
 
92
95
  ```ts
93
- // server/lib/watcher.ts
94
- import { createFileWatcher } from "@agent-native/core";
95
- import type { SSEHandlerOptions } from "@agent-native/core";
96
-
97
- export const watcher = createFileWatcher("./data");
98
- export const sseExtraEmitters: NonNullable<SSEHandlerOptions["extraEmitters"]> =
99
- [];
100
-
101
- export let syncResult: any = { status: "disabled" };
102
- export function setSyncResult(result: any) {
103
- syncResult = result;
104
- if (result.status === "ready" && result.sseEmitter) {
105
- sseExtraEmitters.push(result.sseEmitter);
106
- }
107
- }
96
+ // server/plugins/db.ts
97
+ import { runMigrations } from "@agent-native/core/db/migrations";
98
+
99
+ export default runMigrations([
100
+ {
101
+ id: "001_create_projects",
102
+ sql: `CREATE TABLE IF NOT EXISTS projects (
103
+ id TEXT PRIMARY KEY,
104
+ title TEXT NOT NULL,
105
+ owner_email TEXT NOT NULL,
106
+ org_id TEXT,
107
+ created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
108
+ )`,
109
+ },
110
+ ]);
108
111
  ```
109
112
 
110
- The plugin populates the state at startup; route handlers read it at request time.
113
+ Migrations must be additive. Never put destructive SQL in startup plugins.
111
114
 
112
- ## createFileWatcher(dir, options?) {#createfilewatcher}
115
+ ## Framework-Mounted Routes {#framework-routes}
113
116
 
114
- Creates a chokidar file watcher for real-time file change detection:
115
-
116
- ```ts
117
- import { createFileWatcher } from "@agent-native/core";
117
+ The framework mounts its own routes under `/_agent-native/`. Treat that namespace as reserved.
118
118
 
119
- const watcher = createFileWatcher("./data");
120
- // watcher emits "all" events: (eventName, filePath)
121
- ```
119
+ | Route prefix | Purpose |
120
+ | -------------------------------- | ------------------------------------ |
121
+ | `/_agent-native/actions/:name` | Action HTTP endpoints |
122
+ | `/_agent-native/agent-chat` | Agent chat loop |
123
+ | `/_agent-native/poll` | SQL-backed UI sync |
124
+ | `/_agent-native/resources/*` | Workspace resources |
125
+ | `/_agent-native/tools/*` | Runtime tools and tool proxy |
126
+ | `/_agent-native/integrations/*` | Messaging/webhook integrations |
127
+ | `/_agent-native/a2a` | Agent-to-agent JSON-RPC |
128
+ | `/_agent-native/mcp` | MCP endpoint |
129
+ | `/_agent-native/onboarding/*` | Setup checklist |
130
+ | `/_agent-native/observability/*` | Traces, feedback, evals, experiments |
131
+ | `/_agent-native/file-upload` | File upload provider endpoint |
122
132
 
123
- ### Options {#filewatcher-options}
133
+ Custom app routes should use `/api/*`, public app paths, or provider-specific callback paths that do not collide with `/_agent-native/`.
124
134
 
125
- | Option | Type | Description |
126
- | ------------- | ------- | ------------------------------------------------- |
127
- | `ignored` | any | Glob patterns or regex to ignore |
128
- | `emitInitial` | boolean | Emit events for initial file scan. Default: false |
135
+ ## SQL-Backed Sync {#sync}
129
136
 
130
- ## createSSEHandler(watcher, options?) {#createssehandler}
137
+ Agent-native does not rely on filesystem watchers or sticky in-memory state. When actions or framework helpers mutate data, the database sync version increments. The client `useDbSync()` hook polls `/_agent-native/poll` and invalidates React Query caches.
131
138
 
132
- Creates an H3 event handler that streams file changes as Server-Sent Events:
139
+ This works across serverless and multi-instance deployments because the database is the coordination point. If you write custom mutations outside actions, use framework helpers or emit the appropriate sync invalidation so open UIs refresh.
133
140
 
134
- ```ts
135
- // server/routes/_agent-native/events.get.ts
136
- import { createSSEHandler } from "@agent-native/core";
137
- import { watcher, sseExtraEmitters } from "../../lib/watcher.js";
141
+ ## Webhooks {#webhooks}
138
142
 
139
- export default createSSEHandler(watcher, {
140
- extraEmitters: sseExtraEmitters,
141
- contentRoot: "./data",
142
- });
143
- ```
143
+ Inbound webhooks should verify, persist, and return quickly. Long-running agent work should use the integration queue pattern:
144
144
 
145
- Each SSE message is JSON: `{ "type": "change", "path": "data/file.json" }`
145
+ 1. Verify the platform signature or challenge.
146
+ 2. Insert durable work into SQL.
147
+ 3. Self-fire a signed processor route.
148
+ 4. Return 200 immediately.
149
+ 5. Let the fresh processor execution run the agent loop and post the result.
146
150
 
147
- ### Options {#ssehandler-options}
151
+ Do not rely on unawaited promises after returning a response. See [Messaging](/docs/messaging) for the canonical integration queue.
148
152
 
149
- | Option | Type | Description |
150
- | ------------- | --------------------------- | ------------------------------------------------- |
151
- | extraEmitters | `Array<{ emitter, event }>` | Additional EventEmitters to stream |
152
- | contentRoot | string | Root directory used to relativize paths in events |
153
+ ## Programmatic H3 Servers {#create-server}
153
154
 
154
- ## createServer(options?) {#createserver}
155
-
156
- Optional helper that creates a pre-configured H3 app with CORS middleware and a health-check route. Returns `{ app, router }`. Useful for programmatic route registration when file-based routing doesn't fit:
155
+ For custom packages or tests that need an H3 app directly, `createServer()` returns a preconfigured app and router:
157
156
 
158
157
  ```ts
159
- import { createServer } from "@agent-native/core";
158
+ import { createServer } from "@agent-native/core/server";
160
159
  import { defineEventHandler } from "h3";
161
160
 
162
161
  const { app, router } = createServer();
163
- router.get("/api/items", defineEventHandler(listItems));
164
- ```
165
-
166
- ## mountAuthMiddleware(app, accessToken) {#mountauthmiddleware}
167
-
168
- Mounts session-cookie authentication onto an H3 app. Serves a login page for unauthenticated browser requests and returns 401 for unauthenticated API requests.
169
162
 
170
- ```ts
171
- import { mountAuthMiddleware } from "@agent-native/core";
172
-
173
- mountAuthMiddleware(app, process.env.ACCESS_TOKEN!);
163
+ router.get(
164
+ "/api/health",
165
+ defineEventHandler(() => ({ ok: true })),
166
+ );
174
167
  ```
175
168
 
176
- Adds two routes automatically: `POST /api/auth/login` and `POST /api/auth/logout`.
169
+ Most templates do not need this helper because Nitro file routes and framework plugins handle the app server.
177
170
 
178
- ## createProductionAgentHandler(options) {#createproductionagenthandler}
171
+ ## Production Agent Handler {#agent-handler}
179
172
 
180
- Creates an H3 SSE handler at `POST /_agent-native/agent-chat` that runs an agentic tool loop using Claude. Each script's `run()` function is registered as a tool the agent can invoke.
173
+ The framework's agent chat plugin mounts the production agent handler for templates. Only call `createProductionAgentHandler()` directly when building a custom server integration outside the standard template plugin stack.
181
174
 
182
175
  ```ts
183
- import { createProductionAgentHandler } from "@agent-native/core";
184
- import { scripts } from "./scripts/registry.js";
185
- import { readFileSync } from "fs";
176
+ import { createProductionAgentHandler } from "@agent-native/core/server";
186
177
 
187
- const agent = createProductionAgentHandler({
178
+ const handler = createProductionAgentHandler({
188
179
  scripts,
189
- systemPrompt: readFileSync("agents/system-prompt.md", "utf-8"),
180
+ systemPrompt: "You are the app agent...",
190
181
  });
191
182
  ```
192
183
 
193
- ### Options {#agent-handler-options}
194
-
195
- | Option | Type | Description |
196
- | -------------- | ----------------------------- | ------------------------------------------------- |
197
- | `scripts` | `Record<string, ScriptEntry>` | Map of script name → { tool, run } entries |
198
- | `systemPrompt` | string | System prompt for the embedded agent |
199
- | `apiKey` | string | Anthropic API key. Default: ANTHROPIC_API_KEY env |
200
- | `model` | string | Model to use. Default: claude-sonnet-4-6 |
184
+ Standard templates should customize the agent through `AGENTS.md`, skills, actions, and the agent chat plugin rather than hand-mounting this route.
@@ -53,7 +53,7 @@ Create a skill when:
53
53
  Don't create a skill when:
54
54
 
55
55
  - The guidance already exists in another skill — extend it instead
56
- - The guidance is a one-off — put it in `AGENTS.md` or `learnings.md` instead
56
+ - The guidance is a one-off — put it in `AGENTS.md` or workspace memory instead
57
57
 
58
58
  ## Skill format {#skill-format}
59
59
 
@@ -110,6 +110,6 @@ Save the file at `.agents/skills/my-skill/SKILL.md`. The directory name should m
110
110
 
111
111
  > **Skills** — Authored, reusable how-to guides. Apply to every user, invoked on demand when the task matches.
112
112
  >
113
- > **Memory (`learnings.md`)** — Per-user notes the agent writes automatically from corrections and preferences. Loaded every turn.
113
+ > **Memory (`LEARNINGS.md` / `memory/MEMORY.md`)** — Shared project learnings and personal structured memory loaded every turn.
114
114
 
115
- If the knowledge applies to _everyone_ working in the app ("always prefer CTEs over subqueries"), it's a skill. If it's about _this particular user_ ("Steve likes concise answers"), it belongs in `learnings.md` — and the agent will put it there itself the next time you correct it. See [Agent Memory (`learnings.md`)](./resources.md#learnings-md) for the full treatment.
115
+ If the knowledge applies to _everyone_ working in the app ("always prefer CTEs over subqueries"), it's a skill or shared `LEARNINGS.md`. If it's about _this particular user_ ("Steve likes concise answers"), it belongs in `memory/MEMORY.md`. See [Workspace Memory](/docs/workspace#memory) for the full treatment.
@@ -5,7 +5,7 @@ description: "Ask analytics questions in plain English, get charts and dashboard
5
5
 
6
6
  # Analytics
7
7
 
8
- Ask analytics questions in plain English, get charts and dashboards back. The agent connects to BigQuery, GA4, your app database, HubSpot, Jira, and a dozen other sources, writes the SQL for you, validates it, and renders the answer as a chart, table, or saved dashboard panel.
8
+ Ask analytics questions in plain English, get charts and dashboards back. The agent connects to BigQuery, GA4, Amplitude, the built-in first-party event collector, HubSpot, Jira, and a dozen other sources, writes the query for you, validates it, and renders the answer as a chart, table, or saved dashboard panel.
9
9
 
10
10
  It's an open-source replacement for Amplitude, Mixpanel, and Looker — for teams that want to own the code, the queries, and the data.
11
11
 
@@ -26,7 +26,7 @@ When you first open the app:
26
26
 
27
27
  1. Sign in with Google.
28
28
  2. Open the **Data Sources** page from the sidebar.
29
- 3. Each source has a walkthrough — connect the ones you need (start with one, like BigQuery or your app DB).
29
+ 3. Each source has a walkthrough — connect the ones you need (start with one, like BigQuery, GA4, Amplitude, or first-party tracking).
30
30
  4. Open a new chat with the agent and ask a question: "How many signups did we get last week?"
31
31
 
32
32
  The first question is enough to confirm the connection works. From there, ask the agent to "save this as a dashboard" or "build a 4-panel overview dashboard for our key metrics."
@@ -62,7 +62,7 @@ The rest of this doc is for anyone forking the Analytics template or extending i
62
62
  Create a new Analytics app from the CLI:
63
63
 
64
64
  ```bash
65
- npx @agent-native/cli create analytics
65
+ pnpm dlx @agent-native/core create my-analytics --template analytics --standalone
66
66
  ```
67
67
 
68
68
  Local dev:
@@ -73,13 +73,13 @@ pnpm install
73
73
  pnpm dev
74
74
  ```
75
75
 
76
- The app runs at `http://localhost:3000`. Sign in with Google, then open the **Data Sources** page to connect BigQuery, HubSpot, Jira, and the rest.
76
+ The CLI prints the local dev URL. Sign in with Google, then open the **Data Sources** page to connect BigQuery, GA4, first-party tracking, HubSpot, Jira, and the rest.
77
77
 
78
78
  ### Key features (technical)
79
79
 
80
80
  **Natural-language chart generation.** Ask the agent in plain English. It picks the right data source, writes the SQL, validates it against the warehouse, and renders the chart inline in chat or as a saved panel. Chart types: `line`, `area`, `bar`, `metric`, `table`, `pie`.
81
81
 
82
- **Reusable SQL dashboards.** Dashboards are a named config with an array of panels. Each panel has an `id`, `title`, `sql`, `source` (`bigquery` / `app-db` / `ga4`), `chartType`, and `width` (1 or 2 columns). See the full shape in `templates/analytics/app/pages/adhoc/sql-dashboard/types.ts`.
82
+ **Reusable SQL dashboards.** Dashboards are a named config with an array of panels. Each panel has an `id`, `title`, `sql`, `source` (`bigquery` / `ga4` / `amplitude` / `first-party`), `chartType`, and `width` (1 or 2 columns). See the full shape in `templates/analytics/app/pages/adhoc/sql-dashboard/types.ts`.
83
83
 
84
84
  Dashboards support:
85
85
 
@@ -92,7 +92,9 @@ Dashboards support:
92
92
 
93
93
  **Living data dictionary.** Canonical catalog of metrics — metric name, definition, table, columns, SQL template, known gotchas, owner, and data lag. The agent reads it before writing any SQL, so it uses the real warehouse column names (`hs_is_closed`, not guessed `is_closed`) and knows about caveats like "excludes internal emails". Seeded by asking the agent to import definitions from an existing source (dbt descriptions, a Notion page, a team wiki).
94
94
 
95
- **SQL query explorer.** Direct SQL against BigQuery or the app DB from the **Ad-hoc** view. Useful for iterating on a query before saving it as a dashboard panel.
95
+ **SQL query explorer.** Direct queries against BigQuery and supported analytics backends from the **Ad-hoc** view. Useful for iterating before saving a dashboard panel.
96
+
97
+ **First-party analytics collector.** Hosted apps can send product and template events to `/track` with a public write key. Query those events through `query-agent-native-analytics` or dashboard panels with `source: "first-party"`.
96
98
 
97
99
  **Multiple data connectors.** Built-in actions for common sources:
98
100
 
@@ -1,32 +1,30 @@
1
1
  ---
2
2
  title: "Design"
3
- description: "An Agent-native design toolsketch a UI, brand kit, or marketing visual by prompt or by hand, with the agent as your co-designer."
3
+ description: "An agent-native HTML prototyping studio generate, refine, preview, and export interactive Alpine/Tailwind designs with an agent."
4
4
  ---
5
5
 
6
6
  # Design
7
7
 
8
- A design tool where the agent is a real collaborator. Sketch a UI, a brand kit, or a marketing visual by prompt or by hand, and the agent generates layouts, suggests color systems, swaps fonts, and adjusts spacing alongside you on the same canvas.
8
+ Design is an agent-native HTML prototyping studio. Instead of a layered drawing canvas, the agent generates complete self-contained Alpine/Tailwind HTML prototypes, renders them in an iframe, and lets you refine the result with prompts and tweak controls.
9
9
 
10
- Think along the lines of Figma or Canva, but the agent has full edit rights — it can move shapes, restyle layers, and generate new artwork from a description, all in the same canvas you're working in.
10
+ Use it when you want a polished landing page concept, product UI direction, brand exploration, or interactive prototype that can leave the tool as real HTML.
11
11
 
12
- ## What you can do with it
12
+ ## What You Can Do With It
13
13
 
14
- - **Prompt-driven design.** Describe what you want "a hero section for a B2B fintech SaaS, dark mode, brand color #14B8A6" and the agent drafts it on the canvas.
15
- - **Edit by hand or by chat.** Drag, resize, recolor with the toolbar; or ask the agent to "tighten the spacing", "swap the headline font for something more editorial", "make every CTA the brand teal".
16
- - **AI image generation built in.** Generate background art, illustrations, or icons inline. Re-run with refined prompts without leaving the canvas.
17
- - **Brand-aware.** Save a brand kit (colors, fonts, voice). The agent applies it consistently across new artwork.
18
- - **Components and frames.** Reusable components, multi-page documents, and export to PNG/SVG/PDF.
19
- - **Agent context awareness.** When a layer is selected, the agent knows what you've selected and can act on just that piece.
14
+ - **Generate complete prototypes.** Describe the screen or page you need and the agent creates a working HTML document with Tailwind styling and Alpine interactions.
15
+ - **Compare variants.** Start with multiple directions, pick the strongest one, then continue refining.
16
+ - **Tweak visually.** Use the built-in tweak controls for common changes, or ask the agent for copy, layout, color, spacing, and interaction updates.
17
+ - **Apply design systems.** Save and reuse design-system preferences so generated work stays closer to your brand.
18
+ - **Import references.** Bring in existing HTML or reference material as context for a new design pass.
19
+ - **Export real files.** Export HTML, ZIP, or PDF from the generated prototype.
20
20
 
21
- ## Why it's interesting
21
+ ## Why It's Interesting
22
22
 
23
- Three things make Design a good showcase of what agent-native enables:
23
+ Design is useful because the agent edits an artifact that is already close to shippable web UI. There is no separate "AI mockup" format to translate later: the preview, the editable source, and the exported artifact all come from the same HTML.
24
24
 
25
- 1. **The agent edits the canvas directly.** Layers, frames, styles the agent calls the same actions the toolbar does. There's no "AI mode" separate from the design tool; they're the same tool.
26
- 2. **Selection-aware editing.** Select a button and ask "make this the brand teal across all pages" — the agent knows which element you mean and propagates the change.
27
- 3. **Designs you own.** The files live in your SQL, the artwork lives in your storage, the agent is yours. Fork the template, plug in a different image-generation provider, integrate your team's component library — it's your code.
25
+ The template is also a good example of agent-native ownership. The app stores designs in SQL, exposes template operations as actions, and lets you fork the whole workflow when your team needs a different renderer, exporter, or design-system model.
28
26
 
29
- ## For developers
27
+ ## For Developers
30
28
 
31
29
  The rest of this doc is for anyone forking the Design template or extending it.
32
30
 
@@ -36,20 +34,20 @@ The rest of this doc is for anyone forking the Design template or extending it.
36
34
  pnpm dlx @agent-native/core create my-design --template design --standalone
37
35
  ```
38
36
 
39
- ### Customize it
37
+ ### Customize It
40
38
 
41
- Design is a full cloneable SaaS fork it and ask the agent to extend it. Some examples:
39
+ Design is a cloneable SaaS template. Some practical extension ideas:
42
40
 
43
- - "Add a 'Generate variations' button that produces five color-swap alternatives for the selected frame."
44
- - "Wire the brand kit to read from our marketing-site repo so colors stay in sync."
45
- - "Add a comments layer with @-mentions and email notifications."
46
- - "Auto-export every published frame as a 1200×630 OG image and upload to our CDN."
47
- - "Let me drop a Figma link in chat and have the agent re-create it as native components here."
41
+ - "Add a reusable ecommerce design system with our tokens and sample components."
42
+ - "Add an export step that uploads the ZIP to our internal review system."
43
+ - "Let me paste existing landing-page HTML and ask the agent for three stronger versions."
44
+ - "Add a saved prompt library for product-page, dashboard, and onboarding-screen briefs."
45
+ - "Add a custom PDF export preset for stakeholder review."
48
46
 
49
- The agent edits routes, components, canvas actions, and the schema as needed. See [Cloneable SaaS](/docs/cloneable-saas) for the full clone, customize, deploy flow, and [Getting Started](/docs/getting-started) if this is your first agent-native template.
47
+ The agent edits routes, components, actions, and SQL-backed models as needed. See [Cloneable SaaS](/docs/cloneable-saas) for the full clone, customize, deploy flow, and [Getting Started](/docs/getting-started) if this is your first agent-native template.
50
48
 
51
- ## What's next
49
+ ## What's Next
52
50
 
53
51
  - [**Cloneable SaaS**](/docs/cloneable-saas) — the clone-and-own model
54
- - [**Context Awareness**](/docs/context-awareness) — how the agent knows the selected layer
55
- - [**Tools**](/docs/tools) — generate one-off image-creation utilities alongside the canvas
52
+ - [**Context Awareness**](/docs/context-awareness) — how the agent knows what the user is viewing
53
+ - [**Creating Templates**](/docs/creating-templates) — current build patterns for agent-native templates
@@ -5,6 +5,8 @@ description: "Dispatch is the workspace control plane — central inbox, cross-a
5
5
 
6
6
  # Dispatch
7
7
 
8
+ > **See also:** for the conceptual overview of what Dispatch does and when you want it, see [Dispatch](/docs/dispatch). This page is the template-specific reference.
9
+
8
10
  Dispatch is the **workspace control plane**. Where other templates are domain apps (Mail, Calendar, Analytics), Dispatch is the app you run _alongside_ them to coordinate everything: a central inbox, a secrets vault, scheduled jobs, Slack/Telegram integration, and an orchestrator agent that delegates domain work to the right specialist app over [A2A](/docs/a2a-protocol).
9
11
 
10
12
  If you're running an [multi-app workspace](/docs/multi-app-workspace) with many apps, Dispatch is the glue.
@@ -45,7 +47,7 @@ Day-to-day, Dispatch is the place admins and ops folks open to keep the workspac
45
47
  _How it works under the hood (for developers)._
46
48
 
47
49
  - **Orchestrator agent.** The chat is set up as a router: it reads `AGENTS.md`, `LEARNINGS.md`, and routes to specialist sub-agents or remote A2A agents.
48
- - **Remote agent registry.** A2A manifests live in `remote-agents/*.json` — one per app. Dispatch calls them using the `call-agent` action.
50
+ - **Remote agent registry.** A2A manifests live in `remote-agents/*.json` — one per app. Dispatch calls them using the `call-agent` action. In a multi-app workspace, sibling apps under `apps/` are auto-discovered as A2A peers — no manual registration needed.
49
51
  - **Vault schema.** Drizzle tables for secrets, grants, requests, approvals, and audit logs. See `server/db/schema.ts` in the template.
50
52
  - **Slack / Telegram plugins.** Server plugins that register webhooks and forward incoming messages to the orchestrator agent.
51
53
  - **MCP hub mode.** Dispatch can act as the workspace's [MCP hub](/docs/mcp-clients#hub) so every other app in the workspace pulls the same org-scope MCP server list.
@@ -1,28 +1,30 @@
1
1
  ---
2
2
  title: "Forms Template"
3
- description: "Agent-native form builder — create, edit, and analyze forms through natural language, with a live preview and click-to-edit GUI."
3
+ description: "Agent-native form builder — create, edit, publish, and route form submissions through natural language plus a visual editor."
4
4
  ---
5
5
 
6
6
  # Forms
7
7
 
8
- A form builder where the form builder _is_ the agent. Drag fields around in the editor, or just say "add a 'how did you hear about us' dropdown with five options and make it required" — same result, same underlying data. Think Typeform, but you can build, edit, and analyze forms by talking to the agent.
8
+ Forms is an agent-native form builder. Describe the form you want, refine it in the editor, and publish a public form that stores submissions in your own SQL database.
9
9
 
10
- When you open the app, you'll see a list of your forms on the left and the editor in the middle. Open a form and you can click any field to fine-tune it, or ask the agent to make changes for you.
10
+ When you open the app, you see your forms, the current editor, and a live preview. The agent can create a form from a prompt, update field labels and options, change validation, and connect submission destinations using the same actions the UI uses.
11
11
 
12
12
  ## What you can do with it
13
13
 
14
- - **Build forms conversationally.** "Create a contact form," "add an NPS score question," "make the email field required." The agent updates the schema and the preview updates live.
15
- - **Click-to-edit fine-tuning.** Every field in the preview is editable in place label, placeholder, validation, conditional logic with the usual GUI controls.
16
- - **Field types out of the box:** short text, long text, email, phone, URL, number, date, single-select, multi-select, rating, file upload, section header, conditional branch.
17
- - **Responses dashboard.** Per-response view plus an aggregate dashboard the agent can pivot on request: "show me signups from the last 30 days grouped by source."
18
- - **Agent-driven analysis.** Ask the agent to cluster free-text responses, extract sentiments, or draft a reply to everyone who scored the NPS below 7.
19
- - **Publish anywhere.** Public share link, embed snippet, branded thank-you page, webhook on submit.
14
+ - **Build forms conversationally.** "Create a contact form," "add an NPS score question," "make the email field required." The agent updates the form schema and the preview updates from SQL-backed state.
15
+ - **Fine-tune visually.** Edit labels, placeholders, required state, options, and field order from the builder UI when you want direct control.
16
+ - **Use the shipped field types.** Text, email, number, long text, select, multi-select, checkbox, radio, date, rating, and scale fields are supported out of the box.
17
+ - **Collect responses.** Each submission is stored in SQL with a per-response detail view and a dashboard for reviewing entries.
18
+ - **Route submissions.** Send submission payloads to webhooks, Slack, Discord, or Google Sheets using the built-in integrations.
19
+ - **Publish public forms.** Share a public form URL and show a thank-you message after submission.
20
20
 
21
21
  ## Why it's interesting
22
22
 
23
- The hard part of a form builder isn't the editor UI it's everything around it: changing the questions after responses are already in, analyzing what people said, adding conditional logic, publishing, notifications, hooking it into Slack or your CRM. Most of that is just asking the agent. See [What is agent-native?](/docs/what-is-agent-native) for the bigger picture.
23
+ The useful part of an agent-native form builder is that setup and iteration happen in the same place. You can ask the agent to add fields, adjust copy, connect Slack notifications, or inspect the submission data, while the UI remains the direct editor for the same SQL records.
24
24
 
25
- ## For developers
25
+ See [What is agent-native?](/docs/what-is-agent-native) for the broader framework model.
26
+
27
+ ## For Developers
26
28
 
27
29
  ### Scaffolding
28
30
 
@@ -30,25 +32,28 @@ The hard part of a form builder isn't the editor UI — it's everything around i
30
32
  pnpm dlx @agent-native/core create my-forms --template forms --standalone
31
33
  ```
32
34
 
33
- For a workspace with forms alongside other apps:
35
+ For a workspace with Forms alongside other apps:
34
36
 
35
37
  ```bash
36
- pnpm dlx @agent-native/core create my-platform # pick Forms + other templates
38
+ pnpm dlx @agent-native/core create my-platform
37
39
  ```
38
40
 
39
- ### Customize it
41
+ Pick Forms and any other templates you want during the workspace setup.
42
+
43
+ ### Customize It
40
44
 
41
- Ask the agent for the outcome you want:
45
+ Ask the agent for shipped behavior first:
42
46
 
43
- - "Add a signature field where people can draw their name."
44
- - "When someone submits this form, post it in our #signups Slack channel." (Connect Slack first via [Messaging](/docs/messaging).)
47
+ - "Add a required radio field for preferred contact method."
48
+ - "Post every new submission to Slack." Connect Slack first via [Messaging](/docs/messaging).
49
+ - "Add a webhook destination for our CRM."
50
+ - "Create a customer feedback form with a 1-10 scale and a long-text follow-up."
45
51
  - "Make some forms public and others login-only."
46
- - "Send everyone who scored below 5 a follow-up email asking what we could do better."
47
52
 
48
- The agent figures out the schema changes, components, and storage on its own you just describe the result you want. See [Cloneable SaaS](/docs/cloneable-saas) for the full clone, customize, deploy flow.
53
+ If you need new capabilities such as file uploads, signatures, or custom field widgets, treat them as template extensions: add the SQL shape, actions, UI editor controls, public renderer support, and agent instructions together. See [Creating Templates](/docs/creating-templates) for the current build pattern.
49
54
 
50
- ## What's next
55
+ ## What's Next
51
56
 
52
57
  - [**Cloneable SaaS**](/docs/cloneable-saas) — the clone-and-own model
53
58
  - [**Actions**](/docs/actions) — the action system powering the builder
54
- - [**Real-Time Sync**](/docs/real-time-collaboration) — how the preview stays in sync with agent edits
59
+ - [**Messaging**](/docs/messaging) — Slack and other submission destinations