@agent-native/core 0.59.1 → 0.61.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.
- package/dist/a2a/index.d.ts +2 -0
- package/dist/a2a/index.d.ts.map +1 -1
- package/dist/a2a/index.js +1 -0
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/invoke.d.ts +63 -0
- package/dist/a2a/invoke.d.ts.map +1 -0
- package/dist/a2a/invoke.js +157 -0
- package/dist/a2a/invoke.js.map +1 -0
- package/dist/agent/run-store.d.ts +15 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +28 -0
- package/dist/agent/run-store.js.map +1 -1
- package/dist/chat-threads/store.d.ts +21 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +128 -0
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/agent.d.ts +23 -0
- package/dist/cli/agent.d.ts.map +1 -0
- package/dist/cli/agent.js +300 -0
- package/dist/cli/agent.js.map +1 -0
- package/dist/cli/agents.d.ts +14 -0
- package/dist/cli/agents.d.ts.map +1 -0
- package/dist/cli/agents.js +95 -0
- package/dist/cli/agents.js.map +1 -0
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +264 -2
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/create.d.ts +3 -2
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +154 -83
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +50 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/invoke.d.ts +26 -0
- package/dist/cli/invoke.d.ts.map +1 -0
- package/dist/cli/invoke.js +227 -0
- package/dist/cli/invoke.js.map +1 -0
- package/dist/cli/templates-meta.d.ts +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +9 -8
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/cli/workspacify.d.ts +1 -1
- package/dist/cli/workspacify.d.ts.map +1 -1
- package/dist/cli/workspacify.js +6 -6
- package/dist/cli/workspacify.js.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.js +5 -4
- package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
- package/dist/client/blocks/library/diagram.d.ts.map +1 -1
- package/dist/client/blocks/library/diagram.js +23 -17
- package/dist/client/blocks/library/diagram.js.map +1 -1
- package/dist/client/blocks/types.d.ts +2 -0
- package/dist/client/blocks/types.d.ts.map +1 -1
- package/dist/client/blocks/types.js.map +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +10 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts +13 -0
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +41 -0
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +2 -2
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/onboarding/default-steps.d.ts.map +1 -1
- package/dist/onboarding/default-steps.js +102 -0
- package/dist/onboarding/default-steps.js.map +1 -1
- package/dist/provider-api/actions/github-repo-files.d.ts +84 -0
- package/dist/provider-api/actions/github-repo-files.d.ts.map +1 -0
- package/dist/provider-api/actions/github-repo-files.js +213 -0
- package/dist/provider-api/actions/github-repo-files.js.map +1 -0
- package/dist/provider-api/github-repo.d.ts +11 -0
- package/dist/provider-api/github-repo.d.ts.map +1 -0
- package/dist/provider-api/github-repo.js +553 -0
- package/dist/provider-api/github-repo.js.map +1 -0
- package/dist/provider-api/index.d.ts +184 -11
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +519 -0
- package/dist/provider-api/index.js.map +1 -1
- package/dist/scripts/docs/search.d.ts.map +1 -1
- package/dist/scripts/docs/search.js +38 -13
- package/dist/scripts/docs/search.js.map +1 -1
- package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
- package/dist/secrets/register-framework-secrets.js +11 -0
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +32 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +297 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth-marketing.d.ts.map +1 -1
- package/dist/server/auth-marketing.js +17 -7
- package/dist/server/auth-marketing.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +6 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/builder-browser.d.ts +11 -0
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/builder-space.d.ts +47 -0
- package/dist/server/builder-space.d.ts.map +1 -0
- package/dist/server/builder-space.js +142 -0
- package/dist/server/builder-space.js.map +1 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +39 -98
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +29 -6
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/styles/blocks.css +30 -8
- package/dist/styles/rich-markdown-editor.css +10 -4
- package/dist/templates/{starter-shell-sync.spec.ts → chat-shell-sync.spec.ts} +21 -21
- package/dist/templates/default/.agents/skills/actions/SKILL.md +5 -5
- package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +63 -0
- package/dist/templates/default/AGENTS.md +22 -1
- package/dist/templates/default/actions/hello.ts +1 -1
- package/dist/templates/default/actions/navigate.ts +1 -1
- package/dist/templates/default/actions/view-screen.ts +1 -1
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +63 -0
- package/dist/templates/headless/.env.example +4 -0
- package/dist/templates/headless/.prettierrc +5 -0
- package/dist/templates/headless/AGENTS.md +58 -0
- package/dist/templates/headless/DEVELOPING.md +22 -0
- package/dist/templates/headless/_gitignore +36 -0
- package/dist/templates/headless/actions/hello.ts +14 -0
- package/dist/templates/headless/actions/run.ts +3 -0
- package/dist/templates/headless/package.json +22 -0
- package/dist/templates/headless/tsconfig.json +7 -0
- package/dist/templates/ui-primitives-sync.spec.ts +2 -2
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +5 -5
- package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +63 -0
- package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +93 -0
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +1 -1
- package/dist/templates/workspace-core/AGENTS.md +20 -3
- package/dist/templates/workspace-core/src/server/index.ts +1 -1
- package/dist/templates/workspace-root/AGENTS.md +25 -5
- package/dist/templates/workspace-root/README.md +7 -7
- package/dist/triggers/dispatcher.d.ts +2 -3
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +2 -3
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/triggers/routes.d.ts +38 -0
- package/dist/triggers/routes.d.ts.map +1 -0
- package/dist/triggers/routes.js +202 -0
- package/dist/triggers/routes.js.map +1 -0
- package/docs/AGENTS.md +57 -0
- package/docs/SKILL.md +40 -0
- package/docs/content/a2a-protocol.md +1 -1
- package/docs/content/actions.md +48 -8
- package/docs/content/agent-surfaces.md +76 -14
- package/docs/content/cli-adapters.md +1 -1
- package/docs/content/cloneable-saas.md +5 -4
- package/docs/content/code-agents-ui.md +1 -1
- package/docs/content/components.md +1 -1
- package/docs/content/context-awareness.md +1 -1
- package/docs/content/creating-templates.md +9 -7
- package/docs/content/drop-in-agent.md +1 -1
- package/docs/content/faq.md +6 -4
- package/docs/content/getting-started.md +63 -73
- package/docs/content/key-concepts.md +24 -24
- package/docs/content/native-chat-ui.md +4 -4
- package/docs/content/pure-agent-apps.md +34 -10
- package/docs/content/security.md +1 -1
- package/docs/content/server.md +1 -1
- package/docs/content/template-chat.md +85 -0
- package/docs/content/template-dispatch.md +1 -1
- package/docs/content/tracking.md +1 -1
- package/docs/content/what-is-agent-native.md +7 -6
- package/package.json +10 -1
- package/src/templates/{starter-shell-sync.spec.ts → chat-shell-sync.spec.ts} +21 -21
- package/src/templates/default/.agents/skills/actions/SKILL.md +5 -5
- package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +63 -0
- package/src/templates/default/AGENTS.md +22 -1
- package/src/templates/default/actions/hello.ts +1 -1
- package/src/templates/default/actions/navigate.ts +1 -1
- package/src/templates/default/actions/view-screen.ts +1 -1
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +63 -0
- package/src/templates/headless/.env.example +4 -0
- package/src/templates/headless/.prettierrc +5 -0
- package/src/templates/headless/AGENTS.md +58 -0
- package/src/templates/headless/DEVELOPING.md +22 -0
- package/src/templates/headless/_gitignore +36 -0
- package/src/templates/headless/actions/hello.ts +14 -0
- package/src/templates/headless/actions/run.ts +3 -0
- package/src/templates/headless/package.json +22 -0
- package/src/templates/headless/tsconfig.json +7 -0
- package/src/templates/ui-primitives-sync.spec.ts +2 -2
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +5 -5
- package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +63 -0
- package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +93 -0
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +1 -1
- package/src/templates/workspace-core/AGENTS.md +20 -3
- package/src/templates/workspace-core/src/server/index.ts +1 -1
- package/src/templates/workspace-root/AGENTS.md +25 -5
- package/src/templates/workspace-root/README.md +7 -7
- package/docs/content/template-starter.md +0 -78
package/docs/AGENTS.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Agent Native Docs For Agents
|
|
2
|
+
|
|
3
|
+
These docs are bundled with `@agent-native/core` and installed at:
|
|
4
|
+
|
|
5
|
+
```txt
|
|
6
|
+
node_modules/@agent-native/core/docs
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Use these version-matched markdown docs before coding against Agent Native
|
|
10
|
+
framework APIs or advanced features. Public docs are useful for browsing, but
|
|
11
|
+
the package docs match the exact framework version installed in the app.
|
|
12
|
+
|
|
13
|
+
## Fast Lookup
|
|
14
|
+
|
|
15
|
+
From a generated app root:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm action docs-search --list
|
|
19
|
+
pnpm action docs-search --query "actions"
|
|
20
|
+
pnpm action docs-search --slug actions
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The built-in app agent also has a read-only `docs-search` tool with the same
|
|
24
|
+
`list`, `query`, and `slug` options.
|
|
25
|
+
|
|
26
|
+
If the action runner is unavailable, search the markdown files directly:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
rg -n "actions|automations|a2a|sharing" node_modules/@agent-native/core/docs
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then read the matching files under `node_modules/@agent-native/core/docs/content/`.
|
|
33
|
+
|
|
34
|
+
## What To Read First
|
|
35
|
+
|
|
36
|
+
| Task | Start with |
|
|
37
|
+
| ------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| Define or call app operations | `content/actions.md`, `content/client.md` |
|
|
39
|
+
| Add SQL data, schema, or access rules | `content/database.md`, `content/security.md`, `content/sharing.md` |
|
|
40
|
+
| Keep the UI and agent in sync | `content/context-awareness.md`, `content/client.md` |
|
|
41
|
+
| Build headless or chat-first apps | `content/pure-agent-apps.md`, `content/agent-surfaces.md`, `content/using-your-agent.md` |
|
|
42
|
+
| Add automations or scheduled work | `content/automations.md`, `content/recurring-jobs.md` |
|
|
43
|
+
| Compose apps or call sibling agents | `content/a2a-protocol.md`, `content/multi-app-workspace.md`, `content/workspace.md` |
|
|
44
|
+
| Expose tools to external agents | `content/external-agents.md`, `content/mcp-protocol.md`, `content/mcp-apps.md`, `content/mcp-clients.md` |
|
|
45
|
+
| Add integrations, setup, or secrets | `content/onboarding.md`, `content/workspace-connections.md`, `content/security.md` |
|
|
46
|
+
| Build extensions or custom widgets | `content/extensions.md`, `content/agent-web-surfaces.md` |
|
|
47
|
+
| Deploy or configure hosting | `content/deployment.md`, `content/server.md` |
|
|
48
|
+
| Write agent instructions or skills | `content/skills-guide.md`, `content/writing-agent-instructions.md` |
|
|
49
|
+
|
|
50
|
+
## Rules
|
|
51
|
+
|
|
52
|
+
- Prefer the app's own `AGENTS.md` and `.agents/skills/` for app-specific
|
|
53
|
+
behavior. Use this package docs tree for framework APIs and patterns.
|
|
54
|
+
- If local instructions and package docs conflict, local app instructions win
|
|
55
|
+
for that app, but verify the framework API shape in package docs or types.
|
|
56
|
+
- Do not invent Agent Native APIs. Search these docs and installed type
|
|
57
|
+
definitions before adding imports, routes, actions, or framework config.
|
package/docs/SKILL.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-native-docs
|
|
3
|
+
description: "How to look up version-matched Agent Native framework docs in node_modules. Use before coding against @agent-native/core APIs or advanced features."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Native Docs Lookup
|
|
7
|
+
|
|
8
|
+
## Rule
|
|
9
|
+
|
|
10
|
+
Before implementing non-trivial Agent Native functionality, read the
|
|
11
|
+
version-matched docs installed with `@agent-native/core`.
|
|
12
|
+
|
|
13
|
+
## How
|
|
14
|
+
|
|
15
|
+
1. Start from the generated app root.
|
|
16
|
+
2. Search with `pnpm action docs-search --query "<feature>"`.
|
|
17
|
+
3. Read a specific page with `pnpm action docs-search --slug <slug>`.
|
|
18
|
+
4. If the action runner is unavailable, search
|
|
19
|
+
`node_modules/@agent-native/core/docs` directly with `rg`.
|
|
20
|
+
5. For app-specific rules, also read the app's own `AGENTS.md` and any relevant
|
|
21
|
+
`.agents/skills/<name>/SKILL.md`.
|
|
22
|
+
|
|
23
|
+
## Useful Slugs
|
|
24
|
+
|
|
25
|
+
| Need | Slugs |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| Actions and typed client calls | `actions`, `client` |
|
|
28
|
+
| SQL, auth, access, sharing | `database`, `authentication`, `security`, `sharing` |
|
|
29
|
+
| UI state visible to the agent | `context-awareness` |
|
|
30
|
+
| Headless and chat-first apps | `pure-agent-apps`, `agent-surfaces`, `using-your-agent` |
|
|
31
|
+
| Automations and schedules | `automations`, `recurring-jobs` |
|
|
32
|
+
| Cross-app and external agents | `a2a-protocol`, `external-agents`, `mcp-protocol`, `mcp-apps` |
|
|
33
|
+
| Skills and instructions | `skills-guide`, `writing-agent-instructions` |
|
|
34
|
+
|
|
35
|
+
## Don't
|
|
36
|
+
|
|
37
|
+
- Do not rely on memory for framework APIs when local package docs are present.
|
|
38
|
+
- Do not add custom REST wrappers for normal app data before reading `actions`.
|
|
39
|
+
- Do not add inline LLM calls before reading `using-your-agent` and
|
|
40
|
+
`agent-surfaces`.
|
|
@@ -305,7 +305,7 @@ A mail agent needs analytics data. The analytics agent exposes a "run-query" ski
|
|
|
305
305
|
|
|
306
306
|
```ts
|
|
307
307
|
// In the mail agent's actions/get-analytics.ts
|
|
308
|
-
import { defineAction } from "@agent-native/core/
|
|
308
|
+
import { defineAction } from "@agent-native/core/action";
|
|
309
309
|
import { callAgent } from "@agent-native/core/a2a";
|
|
310
310
|
import { z } from "zod";
|
|
311
311
|
|
package/docs/content/actions.md
CHANGED
|
@@ -19,11 +19,51 @@ One definition, seven consumers. This is rung 3 of the [ladder](/docs/what-is-ag
|
|
|
19
19
|
If you are deciding whether to expose an operation headlessly, in chat, in an
|
|
20
20
|
embedded sidecar, or as a full app screen, see [Agent Surfaces](/docs/agent-surfaces).
|
|
21
21
|
|
|
22
|
+
## Start with one action {#hello-action}
|
|
23
|
+
|
|
24
|
+
The primitive-first on-ramp is one action, not a template. In a headless
|
|
25
|
+
scaffold such as `agent-native create my-agent --headless`, this can be the
|
|
26
|
+
whole first app:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
// actions/hello.ts
|
|
30
|
+
import { defineAction } from "@agent-native/core/action";
|
|
31
|
+
import { z } from "zod";
|
|
32
|
+
|
|
33
|
+
export default defineAction({
|
|
34
|
+
description: "Say hello from the local agent.",
|
|
35
|
+
schema: z.object({
|
|
36
|
+
name: z.string().default("world"),
|
|
37
|
+
}),
|
|
38
|
+
http: { method: "GET" },
|
|
39
|
+
readOnly: true,
|
|
40
|
+
run: async ({ name }) => {
|
|
41
|
+
return { message: `Hello, ${name}!` };
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Run it from the same folder:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm action hello --name Steve
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Then run the app-agent loop against the folder:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pnpm agent "Call hello for Steve and explain the result"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
That is the same app-agent loop your scheduled jobs, chat UI, external MCP
|
|
59
|
+
tools, and future screens will use. Chat and domain templates are for adding UI
|
|
60
|
+
around actions, not a required prerequisite for the action itself.
|
|
61
|
+
|
|
22
62
|
## Defining an action {#defining}
|
|
23
63
|
|
|
24
64
|
```ts
|
|
25
65
|
// actions/reply-to-email.ts
|
|
26
|
-
import { defineAction } from "@agent-native/core";
|
|
66
|
+
import { defineAction } from "@agent-native/core/action";
|
|
27
67
|
import { z } from "zod";
|
|
28
68
|
|
|
29
69
|
export default defineAction({
|
|
@@ -229,7 +269,7 @@ User-owned tables must scope reads through `accessFilter` and writes through `as
|
|
|
229
269
|
|
|
230
270
|
```ts
|
|
231
271
|
// actions/create-lead.ts
|
|
232
|
-
import { defineAction } from "@agent-native/core";
|
|
272
|
+
import { defineAction } from "@agent-native/core/action";
|
|
233
273
|
import { z } from "zod";
|
|
234
274
|
import { getDb } from "../server/db/index.js";
|
|
235
275
|
import * as schema from "../server/db/schema.js";
|
|
@@ -315,12 +355,12 @@ summaries, and insight cards; use [MCP Apps](/docs/mcp-apps) for inline UI in
|
|
|
315
355
|
external MCP hosts.
|
|
316
356
|
|
|
317
357
|
```ts
|
|
358
|
+
import { defineAction } from "@agent-native/core/action";
|
|
359
|
+
import { ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER } from "@agent-native/core/action-ui";
|
|
318
360
|
import {
|
|
319
|
-
|
|
361
|
+
createDataInsightsWidgetResult,
|
|
320
362
|
dataInsightsWidgetResultSchema,
|
|
321
|
-
|
|
322
|
-
} from "@agent-native/core";
|
|
323
|
-
import { createDataInsightsWidgetResult } from "@agent-native/core/data-widgets";
|
|
363
|
+
} from "@agent-native/core/data-widgets";
|
|
324
364
|
|
|
325
365
|
export default defineAction({
|
|
326
366
|
description: "Summarize response trends.",
|
|
@@ -411,7 +451,7 @@ Reads the current navigation state, fetches contextual data, and returns a snaps
|
|
|
411
451
|
|
|
412
452
|
```ts
|
|
413
453
|
// actions/view-screen.ts
|
|
414
|
-
import { defineAction } from "@agent-native/core";
|
|
454
|
+
import { defineAction } from "@agent-native/core/action";
|
|
415
455
|
import { readAppState } from "@agent-native/core/application-state";
|
|
416
456
|
import { z } from "zod";
|
|
417
457
|
|
|
@@ -438,7 +478,7 @@ Writes a one-shot navigation command to application state. The UI reads it, navi
|
|
|
438
478
|
|
|
439
479
|
```ts
|
|
440
480
|
// actions/navigate.ts
|
|
441
|
-
import { defineAction } from "@agent-native/core";
|
|
481
|
+
import { defineAction } from "@agent-native/core/action";
|
|
442
482
|
import { writeAppState } from "@agent-native/core/application-state";
|
|
443
483
|
import { z } from "zod";
|
|
444
484
|
|
|
@@ -13,13 +13,13 @@ application.
|
|
|
13
13
|
The useful way to choose is not by protocol first. Choose the product surface
|
|
14
14
|
you want, then use the matching primitive.
|
|
15
15
|
|
|
16
|
-
| Surface | Use it when | Start with
|
|
17
|
-
| ----------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
18
|
-
| **Headless agent/actions** | Code, jobs, scripts, another app, or another agent should call the work directly. | `defineAction`, HTTP, CLI, MCP, A2A
|
|
19
|
-
| **Rich chat on Agent-Native** | You want a standalone or embedded chat backed by the built-in agent loop. | `<AgentChatSurface>`, `<AssistantChat
|
|
20
|
-
| **Rich chat on your agent** | You built the agent elsewhere and want Agent-Native's composer, transcript, tool cards, and native widgets. | `AgentChatRuntime`, `<AssistantChat runtime={runtime}>`
|
|
21
|
-
| **Embedded sidecar** | You already have a SaaS app and want an agent beside it with page context and host commands. | `createAgentNativeEmbeddedPlugin()`, `AgentNativeEmbedded`
|
|
22
|
-
| **Full application** | Humans and agents should share durable screens, data, navigation, and collaboration. | Templates, actions, SQL state, context awareness
|
|
16
|
+
| Surface | Use it when | Start with |
|
|
17
|
+
| ----------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
18
|
+
| **Headless agent/actions** | Code, jobs, scripts, another app, or another agent should call the work directly. | `agent-native create --headless`, `defineAction`, `agent-native agent`, HTTP, CLI, MCP, A2A |
|
|
19
|
+
| **Rich chat on Agent-Native** | You want a standalone or embedded chat backed by the built-in agent loop. | [Chat template](/docs/template-chat), `<AgentChatSurface>`, `<AssistantChat>` |
|
|
20
|
+
| **Rich chat on your agent** | You built the agent elsewhere and want Agent-Native's composer, transcript, tool cards, and native widgets. | `AgentChatRuntime`, `<AssistantChat runtime={runtime}>` |
|
|
21
|
+
| **Embedded sidecar** | You already have a SaaS app and want an agent beside it with page context and host commands. | `createAgentNativeEmbeddedPlugin()`, `AgentNativeEmbedded` |
|
|
22
|
+
| **Full application** | Humans and agents should share durable screens, data, navigation, and collaboration. | Templates, actions, SQL state, context awareness |
|
|
23
23
|
|
|
24
24
|
Those are stages, not separate products. A workflow can start as a headless
|
|
25
25
|
action, appear in chat as a table or chart, and later become a full screen in an
|
|
@@ -31,11 +31,19 @@ Use the headless path when no one needs to stare at a custom app screen while
|
|
|
31
31
|
the work runs: scheduled jobs, integrations, backend workflows, CLI loops,
|
|
32
32
|
another agent, or an existing product calling into Agent-Native.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
The smallest local path is a headless scaffold plus one action:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @agent-native/core@latest create my-agent --headless
|
|
38
|
+
cd my-agent
|
|
39
|
+
pnpm install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then define the durable operation:
|
|
35
43
|
|
|
36
44
|
```ts
|
|
37
45
|
// actions/summarize-week.ts
|
|
38
|
-
import { defineAction } from "@agent-native/core";
|
|
46
|
+
import { defineAction } from "@agent-native/core/action";
|
|
39
47
|
import { z } from "zod";
|
|
40
48
|
|
|
41
49
|
export default defineAction({
|
|
@@ -52,14 +60,26 @@ One action is then callable as:
|
|
|
52
60
|
|
|
53
61
|
- **HTTP** — `POST /_agent-native/actions/summarize-week`
|
|
54
62
|
- **CLI** — `pnpm action summarize-week --formId form_123`
|
|
63
|
+
- **App-agent CLI** — `pnpm agent "Summarize form_123"`
|
|
55
64
|
- **MCP** — from Claude, ChatGPT, Codex, Cursor, OpenCode, Copilot, and other MCP hosts
|
|
56
65
|
- **A2A** — from another agent-native app or agent peer
|
|
57
66
|
- **UI** — through `useActionQuery`, `useActionMutation`, or `callAction`
|
|
58
67
|
- **Agent tool** — from the built-in chat loop
|
|
59
68
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
This is not a no-database or stateless mode. The app-agent loop stores sessions,
|
|
70
|
+
threads, runs, settings, credentials, application state, and share records in
|
|
71
|
+
SQL. Local development defaults to SQLite; hosted headless apps should use a
|
|
72
|
+
persistent SQL database.
|
|
73
|
+
|
|
74
|
+
If you need the whole agent loop headlessly from the project folder, use:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pnpm agent "Summarize this week's forms."
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Workers, jobs, integration webhooks, and custom hosts can use the server API
|
|
81
|
+
directly. This is lower-level than actions: you provide the engine, model,
|
|
82
|
+
messages, actions, and event sink yourself.
|
|
63
83
|
|
|
64
84
|
```ts
|
|
65
85
|
import {
|
|
@@ -97,11 +117,49 @@ For most apps, scheduled prompts and integration webhooks already call this loop
|
|
|
97
117
|
for you. Reach for direct `runAgentLoop()` when you are building a custom
|
|
98
118
|
headless host, eval runner, or server-side orchestration surface.
|
|
99
119
|
|
|
120
|
+
### Running against a folder {#folder-loop}
|
|
121
|
+
|
|
122
|
+
If your goal is "run an agent against this folder," start with the app-agent
|
|
123
|
+
loop in that folder: scaffold the headless app, add actions/instructions, run
|
|
124
|
+
`pnpm agent "..."`. That keeps the work inside the same action/runtime/state
|
|
125
|
+
contract the app will use in production.
|
|
126
|
+
|
|
127
|
+
External coding harnesses are a separate product surface for embedding Claude
|
|
128
|
+
Code, Codex, Pi, Cursor, Mastra, or similar runtimes inside an Agent-Native app.
|
|
129
|
+
Use them when you are building a coding-agent product, not as the default way to
|
|
130
|
+
start a local agent-native workflow.
|
|
131
|
+
|
|
132
|
+
### Cloud repo access {#cloud-repo-access}
|
|
133
|
+
|
|
134
|
+
For cloud headless apps that need repository access, the planned model is a
|
|
135
|
+
GitHub connector plus token CRUD: list repositories, search files, read files,
|
|
136
|
+
create or edit files, delete files, and revoke access through provider-scoped
|
|
137
|
+
credentials.
|
|
138
|
+
|
|
139
|
+
Do not treat a VM clone or long-lived sandbox checkout as the primary cloud
|
|
140
|
+
repo-access model. Sandboxes still matter for isolated code execution, but
|
|
141
|
+
repository access should be explicit, permissioned, auditable, and revocable
|
|
142
|
+
through the connector layer.
|
|
143
|
+
|
|
144
|
+
### Sharing sessions and runs {#sharing-runs}
|
|
145
|
+
|
|
146
|
+
Headless sessions and runs are durable objects. Shareability should be phased:
|
|
147
|
+
read/share links first, so teammates can inspect sanitized prompts, outputs,
|
|
148
|
+
and run status; permissioned writable collaboration later, so continuing a run,
|
|
149
|
+
approving actions, editing schedules, or changing configuration goes through
|
|
150
|
+
explicit access checks.
|
|
151
|
+
|
|
100
152
|
## Rich chat on Agent-Native {#rich-chat}
|
|
101
153
|
|
|
102
154
|
Use the built-in chat when the user should talk to the agent, see tool calls,
|
|
103
155
|
approve work, inspect native results, and keep a durable thread history.
|
|
104
156
|
|
|
157
|
+
For a full app starting point, use the [Chat template](/docs/template-chat):
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npx @agent-native/core@latest create my-chat-app --template chat
|
|
161
|
+
```
|
|
162
|
+
|
|
105
163
|
The simplest full-page chat:
|
|
106
164
|
|
|
107
165
|
```tsx
|
|
@@ -131,6 +189,9 @@ components in the chat, without iframes. See [Native Chat UI](/docs/native-chat-
|
|
|
131
189
|
Use this path when your agent is already built with another framework or
|
|
132
190
|
runtime and you want Agent-Native's chat UI around it.
|
|
133
191
|
|
|
192
|
+
The [Chat template](/docs/template-chat) is still useful here: keep its app
|
|
193
|
+
shell and thread UI, then swap the runtime behind the chat plugin or route.
|
|
194
|
+
|
|
134
195
|
`AgentChatRuntime` is the boundary. Your runtime streams normalized events;
|
|
135
196
|
Agent-Native renders the composer, transcript, tool calls, approvals, native
|
|
136
197
|
widgets, and app layout.
|
|
@@ -245,8 +306,9 @@ Full apps add product UI around the same action and agent contract:
|
|
|
245
306
|
- **Deep links** — action results can open the right app view.
|
|
246
307
|
- **Native chat widgets** — tables, charts, cards, approvals, and typed results appear inline.
|
|
247
308
|
|
|
248
|
-
Start from
|
|
249
|
-
from [
|
|
309
|
+
Start from the [Chat template](/docs/template-chat) when you want a minimal app
|
|
310
|
+
around your actions, or from a domain [template](/docs/cloneable-saas) when you
|
|
311
|
+
want a complete product shape.
|
|
250
312
|
|
|
251
313
|
## How to choose {#how-to-choose}
|
|
252
314
|
|
|
@@ -228,7 +228,7 @@ Actions can use CLI adapters directly for structured access:
|
|
|
228
228
|
|
|
229
229
|
```ts
|
|
230
230
|
// actions/list-prs.ts
|
|
231
|
-
import { defineAction } from "@agent-native/core/
|
|
231
|
+
import { defineAction } from "@agent-native/core/action";
|
|
232
232
|
import { ShellCliAdapter } from "@agent-native/core/adapters/cli";
|
|
233
233
|
import { z } from "zod";
|
|
234
234
|
|
|
@@ -15,6 +15,7 @@ Each one is a real app you could use today, and the launching pad for your own v
|
|
|
15
15
|
|
|
16
16
|
| Template | What it is |
|
|
17
17
|
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| [**Chat**](/docs/template-chat) | Minimal chat-first app with durable threads, actions, auth, and a clean path to custom UI or your own backend. |
|
|
18
19
|
| [**Mail**](/docs/template-mail) | An agent-native Superhuman. Inbox, labels, AI triage, keyboard-first, drafts and sends through the agent. |
|
|
19
20
|
| [**Calendar**](/docs/template-calendar) | An agent-native Google Calendar. Events, sync, public booking links, agent-driven scheduling. |
|
|
20
21
|
| [**Content**](/docs/template-content) | Open-source Obsidian for MDX. Local Markdown/MDX, Tiptap editor, Notion sync, real-time multi-user collab. |
|
|
@@ -29,7 +30,7 @@ Each one is a real app you could use today, and the launching pad for your own v
|
|
|
29
30
|
| [**Plan**](/docs/template-plan) | Visual plans and PR recaps with diagrams, wireframes, and annotations. |
|
|
30
31
|
| [**Dispatch**](/docs/template-dispatch) | The workspace control plane: shared secrets, reusable integrations, Slack/Telegram, scheduled jobs. |
|
|
31
32
|
|
|
32
|
-
Don't want a domain template?
|
|
33
|
+
Don't want a domain template? Use [Chat](/docs/template-chat) when you want a basic app users can talk to immediately, or start action-first with [Pure-Agent Apps](/docs/pure-agent-apps).
|
|
33
34
|
|
|
34
35
|
See the full catalog under [Templates](/templates), or jump straight to one — for example, [Dispatch](/docs/template-dispatch) is a great place to start if you want a workspace-style app.
|
|
35
36
|
|
|
@@ -72,11 +73,11 @@ You don't have to. Every template is also available as a hosted app on `agent-na
|
|
|
72
73
|
|
|
73
74
|
## Try it with a skill {#try-with-a-skill}
|
|
74
75
|
|
|
75
|
-
Not ready to scaffold? You can add agent-native superpowers to a coding agent you already use with a single command — no app needed. See [
|
|
76
|
+
Not ready to scaffold? You can add agent-native superpowers to a coding agent you already use with a single command — no app needed. See the [Skills Guide](/docs/skills-guide#app-backed-skills).
|
|
76
77
|
|
|
77
78
|
## Building on this
|
|
78
79
|
|
|
79
|
-
- [**Getting Started**](/docs/getting-started) —
|
|
80
|
+
- [**Getting Started**](/docs/getting-started) — create a minimal chat app or headless action
|
|
80
81
|
- [**Messaging the agent**](/docs/messaging) — how users (and you) talk to the agent that ships with each template
|
|
81
82
|
- [**Multi-App Workspace**](/docs/multi-app-workspace) — bundle several templates into one workspace that shares auth, brand, and agent
|
|
82
83
|
- [**Dispatch**](/docs/template-dispatch) — the workspace control plane template
|
|
@@ -90,7 +91,7 @@ If you're scaffolding now, the CLI command is:
|
|
|
90
91
|
npx @agent-native/core@latest create my-platform
|
|
91
92
|
```
|
|
92
93
|
|
|
93
|
-
You'll get a multi-select picker. Pick one app (standalone) or several (workspace — apps share auth, brand, agent config, and database). Each picked template is scaffolded into `apps/<name>/` with every file you need.
|
|
94
|
+
You'll get a multi-select picker. Pick one app (standalone) or several (workspace — apps share auth, brand, agent config, and database). Each picked template is scaffolded into `apps/<name>/` with every file you need. For an action-only app instead of a template UI, use `npx @agent-native/core@latest create my-agent --headless`.
|
|
94
95
|
|
|
95
96
|
Fill in `.env` (mostly `ANTHROPIC_API_KEY` and `DATABASE_URL`), `pnpm install`, `pnpm dev`, and it works. No "TODO: implement login," no placeholder routes.
|
|
96
97
|
|
|
@@ -67,7 +67,7 @@ That separation matters. The UI can be reused by templates, but native process c
|
|
|
67
67
|
The old hidden `code` template has been removed. To build a browser-hosted Code surface, create a normal app and mount the shared UI package with a host implementation:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
npx @agent-native/core@latest create my-code-ui --template
|
|
70
|
+
npx @agent-native/core@latest create my-code-ui --template chat
|
|
71
71
|
cd my-code-ui
|
|
72
72
|
pnpm add @agent-native/code-agents-ui
|
|
73
73
|
pnpm install
|
|
@@ -338,7 +338,7 @@ If you truly need raw text-in/text-out, keep it server-side and use
|
|
|
338
338
|
action so the UI and agent share the same capability.
|
|
339
339
|
|
|
340
340
|
```ts
|
|
341
|
-
import { defineAction } from "@agent-native/core";
|
|
341
|
+
import { defineAction } from "@agent-native/core/action";
|
|
342
342
|
import { completeText } from "@agent-native/core/server";
|
|
343
343
|
|
|
344
344
|
export default defineAction({
|
|
@@ -186,7 +186,7 @@ Every template should have a `view-screen` action. It reads navigation and selec
|
|
|
186
186
|
|
|
187
187
|
```ts
|
|
188
188
|
// actions/view-screen.ts
|
|
189
|
-
import { defineAction } from "@agent-native/core";
|
|
189
|
+
import { defineAction } from "@agent-native/core/action";
|
|
190
190
|
import { readAppState } from "@agent-native/core/application-state";
|
|
191
191
|
import { eq, inArray } from "drizzle-orm";
|
|
192
192
|
import { z } from "zod";
|
|
@@ -17,21 +17,23 @@ A good template:
|
|
|
17
17
|
- Registers onboarding steps for required providers and secrets.
|
|
18
18
|
- Works as a standalone app and as part of a multi-app workspace.
|
|
19
19
|
|
|
20
|
-
## Start from
|
|
20
|
+
## Start from Chat {#start-from-chat}
|
|
21
21
|
|
|
22
|
-
Use the
|
|
22
|
+
Use the Chat template when you want a minimal app with the framework wiring already in place:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npx @agent-native/core@latest create my-template --template
|
|
25
|
+
npx @agent-native/core@latest create my-template --template chat --standalone
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
For a workspace with multiple apps, run the picker and include
|
|
28
|
+
For a workspace with multiple apps, run the picker and include Chat with any domain templates you want:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
npx @agent-native/core@latest create my-platform
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Chat gives you auth, durable chat threads, SQL-backed resources, tools, application state, actions, and polling sync. You add the domain model and product UI.
|
|
35
|
+
|
|
36
|
+
If you are not building a reusable UI template yet, use the headless on-ramp in [Getting Started](/docs/getting-started#create-your-agent): define one action, run it with `pnpm agent`, and add UI later when the workflow needs a durable surface.
|
|
35
37
|
|
|
36
38
|
## Project Structure {#project-structure}
|
|
37
39
|
|
|
@@ -137,7 +139,7 @@ Actions are the single source of truth for app behavior. The agent calls them as
|
|
|
137
139
|
|
|
138
140
|
```ts
|
|
139
141
|
// actions/create-project.ts
|
|
140
|
-
import { defineAction } from "@agent-native/core";
|
|
142
|
+
import { defineAction } from "@agent-native/core/action";
|
|
141
143
|
import { getDb } from "../server/db/index.js"; // getDb is created per app via createGetDb(schema) in server/db/index.ts
|
|
142
144
|
import { nanoid } from "nanoid";
|
|
143
145
|
import { z } from "zod";
|
|
@@ -247,7 +249,7 @@ that key is reserved for the framework URL tools and URL-only filter changes.
|
|
|
247
249
|
|
|
248
250
|
```ts
|
|
249
251
|
// actions/navigate.ts
|
|
250
|
-
import { defineAction } from "@agent-native/core";
|
|
252
|
+
import { defineAction } from "@agent-native/core/action";
|
|
251
253
|
import { writeAppState } from "@agent-native/core/application-state";
|
|
252
254
|
import { z } from "zod";
|
|
253
255
|
|
|
@@ -255,7 +255,7 @@ history, run state, or user steering, use `completeText()` from
|
|
|
255
255
|
an action so the UI and agent share the same operation.
|
|
256
256
|
|
|
257
257
|
```ts
|
|
258
|
-
import { defineAction } from "@agent-native/core";
|
|
258
|
+
import { defineAction } from "@agent-native/core/action";
|
|
259
259
|
import { completeText } from "@agent-native/core/server";
|
|
260
260
|
|
|
261
261
|
export default defineAction({
|
package/docs/content/faq.md
CHANGED
|
@@ -11,13 +11,15 @@ Common questions about agent-native, organized from "I'm just looking" to "I'm w
|
|
|
11
11
|
|
|
12
12
|
### What is agent-native? {#what-is-agent-native}
|
|
13
13
|
|
|
14
|
-
Agent-native is a framework for building apps where the AI agent and the
|
|
14
|
+
Agent-native is a framework for building apps where the AI agent and the product surface around it are equal partners. That surface can start as one headless action, grow into rich chat, or become a full UI. The invariant is that agents and humans share the same actions, database, and state. See [What Is Agent-Native?](/docs/what-is-agent-native) for the full explanation.
|
|
15
15
|
|
|
16
16
|
### Who is this for? {#who-is-this-for}
|
|
17
17
|
|
|
18
18
|
Agent-native is for people who want a real app and an AI agent to work from the same data and actions. The common paths are:
|
|
19
19
|
|
|
20
20
|
- **Use a hosted app** if you want Mail, Calendar, Forms, Plan, or another finished template with no setup — start at the [template gallery](/templates).
|
|
21
|
+
- **Start with Chat** if you want a basic app users can talk to immediately, then extend with actions and screens — start with [Getting Started](/docs/getting-started) or [Chat](/docs/template-chat).
|
|
22
|
+
- **Start primitive-first** if you want one action and a headless app-agent loop before committing to UI — start with [Getting Started](/docs/getting-started).
|
|
21
23
|
- **Fork and customize a template** if you want your own SaaS product with auth, database, UI, and agent actions already wired — see [Templates](/docs/cloneable-saas).
|
|
22
24
|
- **Build from scratch** if you want the framework primitives for a new agent-driven product — start with [Getting Started](/docs/getting-started).
|
|
23
25
|
- **Connect another agent or code tool** if you want Claude, ChatGPT, Codex, Cursor, or GitHub Copilot / VS Code to use an agent-native app — see [External Agents](/docs/external-agents) and [Skills Guide](/docs/skills-guide).
|
|
@@ -59,7 +61,7 @@ You can, but agent-native works best when built from the ground up. The architec
|
|
|
59
61
|
|
|
60
62
|
### What templates are available? {#what-templates-are-available}
|
|
61
63
|
|
|
62
|
-
The framework ships with production-ready templates including [Mail](/docs/template-mail), [Calendar](/docs/template-calendar), [Forms](/docs/template-forms), [Plan](/docs/template-plan) (visual plans and PR recaps), [Analytics](/docs/template-analytics), [Dispatch](/docs/template-dispatch), and more. Each is a complete app with UI, agent actions, database schema, and AI instructions ready to go. See [Templates](/docs/cloneable-saas) for the full catalog.
|
|
64
|
+
The framework ships with production-ready templates including [Chat](/docs/template-chat), [Mail](/docs/template-mail), [Calendar](/docs/template-calendar), [Forms](/docs/template-forms), [Plan](/docs/template-plan) (visual plans and PR recaps), [Analytics](/docs/template-analytics), [Dispatch](/docs/template-dispatch), and more. Each is a complete app with UI, agent actions, database schema, and AI instructions ready to go. See [Templates](/docs/cloneable-saas) for the full catalog.
|
|
63
65
|
|
|
64
66
|
### Can I customize templates? {#can-i-customize-templates}
|
|
65
67
|
|
|
@@ -67,11 +69,11 @@ That's the whole point. Fork a template and customize it by asking the agent. "A
|
|
|
67
69
|
|
|
68
70
|
### Can I build something the templates don't cover? {#build-from-scratch}
|
|
69
71
|
|
|
70
|
-
Yes.
|
|
72
|
+
Yes. If you want a basic chat app, run `npx @agent-native/core@latest create my-chat-app --template chat`; you get durable chat threads, actions, auth, SQL-backed runtime state, and room to add your own screens. If you want the smallest action-first app with no UI, run `npx @agent-native/core@latest create my-agent --headless`. See [Getting Started](/docs/getting-started), [Pure-Agent Apps](/docs/pure-agent-apps), and [Chat](/docs/template-chat).
|
|
71
73
|
|
|
72
74
|
### Can I try it without forking a template? {#try-with-a-skill}
|
|
73
75
|
|
|
74
|
-
Yes — install a skill into a coding agent you already use with one command and no scaffold required. See [
|
|
76
|
+
Yes — install a skill into a coding agent you already use with one command and no scaffold required. See the [Skills Guide](/docs/skills-guide#app-backed-skills) for the walkthrough.
|
|
75
77
|
|
|
76
78
|
## Agent capabilities {#agent-capabilities}
|
|
77
79
|
|