@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.
- package/dist/a2a/artifact-response.d.ts.map +1 -1
- package/dist/a2a/artifact-response.js +109 -5
- package/dist/a2a/artifact-response.js.map +1 -1
- package/dist/a2a/server.d.ts.map +1 -1
- package/dist/a2a/server.js +11 -0
- package/dist/a2a/server.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +1 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +54 -13
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/deploy/workspace-deploy.js +32 -3
- package/dist/deploy/workspace-deploy.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +2 -1
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +10 -0
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/onboarding/plugin.d.ts.map +1 -1
- package/dist/onboarding/plugin.js +2 -1
- package/dist/onboarding/plugin.js.map +1 -1
- package/dist/org/plugin.d.ts.map +1 -1
- package/dist/org/plugin.js +2 -1
- package/dist/org/plugin.js.map +1 -1
- package/dist/scripts/call-agent.js +2 -2
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +5 -11
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +2 -1
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth-plugin.d.ts.map +1 -1
- package/dist/server/auth-plugin.js +2 -1
- package/dist/server/auth-plugin.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +7 -12
- package/dist/server/auth.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +9 -29
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/cors-origins.d.ts +10 -0
- package/dist/server/cors-origins.d.ts.map +1 -0
- package/dist/server/cors-origins.js +34 -0
- package/dist/server/cors-origins.js.map +1 -0
- package/dist/server/create-server.d.ts.map +1 -1
- package/dist/server/create-server.js +10 -29
- package/dist/server/create-server.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts +11 -0
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +24 -1
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/resources-plugin.d.ts.map +1 -1
- package/dist/server/resources-plugin.js +2 -1
- package/dist/server/resources-plugin.js.map +1 -1
- package/dist/terminal/terminal-plugin.d.ts.map +1 -1
- package/dist/terminal/terminal-plugin.js +2 -1
- package/dist/terminal/terminal-plugin.js.map +1 -1
- package/docs/content/a2a-protocol.md +93 -14
- package/docs/content/agent-mentions.md +2 -2
- package/docs/content/agent-teams.md +2 -2
- package/docs/content/client.md +1 -1
- package/docs/content/cloneable-saas.md +13 -13
- package/docs/content/creating-templates.md +253 -211
- package/docs/content/dispatch.md +94 -0
- package/docs/content/faq.md +2 -2
- package/docs/content/frames.md +1 -1
- package/docs/content/getting-started.md +9 -1
- package/docs/content/key-concepts.md +17 -1
- package/docs/content/messaging.md +56 -19
- package/docs/content/multi-app-workspace.md +10 -2
- package/docs/content/notifications.md +1 -1
- package/docs/content/observability.md +184 -0
- package/docs/content/onboarding.md +7 -2
- package/docs/content/server.md +117 -133
- package/docs/content/skills-guide.md +3 -3
- package/docs/content/template-analytics.md +8 -6
- package/docs/content/template-design.md +25 -27
- package/docs/content/template-dispatch.md +3 -1
- package/docs/content/template-forms.md +26 -21
- package/docs/content/template-mail.md +4 -0
- package/docs/content/template-video.md +4 -4
- package/docs/content/tools.md +95 -1
- package/docs/content/tracking.md +1 -1
- package/docs/content/what-is-agent-native.md +4 -2
- package/docs/content/workspace-management.md +5 -5
- package/docs/content/workspace.md +39 -30
- package/package.json +1 -1
package/docs/content/server.md
CHANGED
|
@@ -1,200 +1,184 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Server"
|
|
3
|
-
description: "Nitro server
|
|
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
|
|
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
|
|
10
|
+
## File-Based Routes {#file-based-routes}
|
|
11
11
|
|
|
12
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
24
|
+
Each route exports a `defineEventHandler`:
|
|
28
25
|
|
|
29
26
|
```ts
|
|
30
|
-
// server/routes/api/
|
|
27
|
+
// server/routes/api/health.get.ts
|
|
31
28
|
import { defineEventHandler } from "h3";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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
|
-
|
|
47
|
+
## Prefer Actions For App Operations {#actions-first}
|
|
59
48
|
|
|
60
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
57
|
+
Use custom `/api/*` routes only when you need a route-shaped protocol or binary/streaming behavior. See [Actions](/docs/actions).
|
|
72
58
|
|
|
73
|
-
|
|
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
|
-
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
89
|
+
Do not run unscoped `db.select().from(ownableTable)` in custom routes.
|
|
90
|
+
|
|
91
|
+
## Server Plugins {#server-plugins}
|
|
89
92
|
|
|
90
|
-
|
|
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/
|
|
94
|
-
import {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
113
|
+
Migrations must be additive. Never put destructive SQL in startup plugins.
|
|
111
114
|
|
|
112
|
-
##
|
|
115
|
+
## Framework-Mounted Routes {#framework-routes}
|
|
113
116
|
|
|
114
|
-
|
|
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
|
-
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
151
|
+
Do not rely on unawaited promises after returning a response. See [Messaging](/docs/messaging) for the canonical integration queue.
|
|
148
152
|
|
|
149
|
-
|
|
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
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
163
|
+
router.get(
|
|
164
|
+
"/api/health",
|
|
165
|
+
defineEventHandler(() => ({ ok: true })),
|
|
166
|
+
);
|
|
174
167
|
```
|
|
175
168
|
|
|
176
|
-
|
|
169
|
+
Most templates do not need this helper because Nitro file routes and framework plugins handle the app server.
|
|
177
170
|
|
|
178
|
-
##
|
|
171
|
+
## Production Agent Handler {#agent-handler}
|
|
179
172
|
|
|
180
|
-
|
|
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
|
|
178
|
+
const handler = createProductionAgentHandler({
|
|
188
179
|
scripts,
|
|
189
|
-
systemPrompt:
|
|
180
|
+
systemPrompt: "You are the app agent...",
|
|
190
181
|
});
|
|
191
182
|
```
|
|
192
183
|
|
|
193
|
-
|
|
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
|
|
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 (`
|
|
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 `
|
|
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,
|
|
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
|
|
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
|
-
|
|
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
|
|
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` / `
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
12
|
+
## What You Can Do With It
|
|
13
13
|
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
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
|
|
21
|
+
## Why It's Interesting
|
|
22
22
|
|
|
23
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
37
|
+
### Customize It
|
|
40
38
|
|
|
41
|
-
Design is a
|
|
39
|
+
Design is a cloneable SaaS template. Some practical extension ideas:
|
|
42
40
|
|
|
43
|
-
- "Add a
|
|
44
|
-
- "
|
|
45
|
-
- "
|
|
46
|
-
- "
|
|
47
|
-
- "
|
|
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,
|
|
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
|
|
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
|
|
55
|
-
- [**
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **Publish
|
|
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
|
|
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
|
-
|
|
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
|
|
35
|
+
For a workspace with Forms alongside other apps:
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
|
-
pnpm dlx @agent-native/core create my-platform
|
|
38
|
+
pnpm dlx @agent-native/core create my-platform
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
Pick Forms and any other templates you want during the workspace setup.
|
|
42
|
+
|
|
43
|
+
### Customize It
|
|
40
44
|
|
|
41
|
-
Ask the agent for
|
|
45
|
+
Ask the agent for shipped behavior first:
|
|
42
46
|
|
|
43
|
-
- "Add a
|
|
44
|
-
- "
|
|
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
|
-
|
|
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
|
|
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
|
-
- [**
|
|
59
|
+
- [**Messaging**](/docs/messaging) — Slack and other submission destinations
|