@agent-native/core 0.32.2 → 0.32.18
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/README.md +3 -1
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +48 -10
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +12 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +104 -6
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/cli/app-skill.js +2 -2
- package/dist/cli/app-skill.js.map +1 -1
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +6 -1
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-output-smoother.d.ts +7 -0
- package/dist/cli/code-agent-output-smoother.d.ts.map +1 -0
- package/dist/cli/code-agent-output-smoother.js +111 -0
- package/dist/cli/code-agent-output-smoother.js.map +1 -0
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +5 -0
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/migrate.d.ts.map +1 -1
- package/dist/cli/migrate.js +17 -42
- package/dist/cli/migrate.js.map +1 -1
- package/dist/cli/skills.d.ts +23 -2
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +405 -41
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +7 -105
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +41 -7
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AgentTaskCard.d.ts.map +1 -1
- package/dist/client/AgentTaskCard.js +0 -28
- package/dist/client/AgentTaskCard.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +8 -23
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +359 -205
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +254 -14
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +14 -9
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-chat.d.ts +24 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +73 -0
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/assistant-ui-recovery.d.ts +34 -0
- package/dist/client/assistant-ui-recovery.d.ts.map +1 -0
- package/dist/client/assistant-ui-recovery.js +122 -0
- package/dist/client/assistant-ui-recovery.js.map +1 -0
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +7 -1
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +7 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +22 -2
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/frame-protocol.d.ts +6 -2
- package/dist/client/frame-protocol.d.ts.map +1 -1
- package/dist/client/frame-protocol.js.map +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +2 -1
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts +13 -3
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +105 -36
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/route-warmup.d.ts +61 -0
- package/dist/client/route-warmup.d.ts.map +1 -0
- package/dist/client/route-warmup.js +456 -0
- package/dist/client/route-warmup.js.map +1 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +2 -1
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +5 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +10 -4
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/use-action.d.ts +1 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +22 -4
- package/dist/client/use-action.js.map +1 -1
- package/dist/code-agents/background-run.d.ts +2 -0
- package/dist/code-agents/background-run.d.ts.map +1 -1
- package/dist/code-agents/background-run.js.map +1 -1
- package/dist/db/client.d.ts +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +25 -1
- package/dist/db/client.js.map +1 -1
- package/dist/deploy/build.d.ts +4 -0
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +171 -14
- package/dist/deploy/build.js.map +1 -1
- package/dist/deploy/immutable-assets.d.ts +1 -0
- package/dist/deploy/immutable-assets.d.ts.map +1 -1
- package/dist/deploy/immutable-assets.js +1 -0
- package/dist/deploy/immutable-assets.js.map +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/connect-route.d.ts.map +1 -1
- package/dist/mcp/connect-route.js +118 -82
- package/dist/mcp/connect-route.js.map +1 -1
- package/dist/progress/routes.d.ts.map +1 -1
- package/dist/progress/routes.js +1 -0
- package/dist/progress/routes.js.map +1 -1
- package/dist/progress/store.d.ts +13 -0
- package/dist/progress/store.d.ts.map +1 -1
- package/dist/progress/store.js +18 -0
- package/dist/progress/store.js.map +1 -1
- package/dist/progress/types.d.ts +2 -0
- package/dist/progress/types.d.ts.map +1 -1
- package/dist/progress/types.js.map +1 -1
- package/dist/scripts/db/wipe-leaked-builder-keys.d.ts +2 -2
- package/dist/scripts/db/wipe-leaked-builder-keys.d.ts.map +1 -1
- package/dist/scripts/db/wipe-leaked-builder-keys.js +14 -3
- package/dist/scripts/db/wipe-leaked-builder-keys.js.map +1 -1
- package/dist/server/action-routes.d.ts +1 -0
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +36 -2
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +5 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +131 -26
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-discovery.d.ts.map +1 -1
- package/dist/server/agent-discovery.js +14 -1
- package/dist/server/agent-discovery.js.map +1 -1
- package/dist/server/agent-teams-run-queue.d.ts +80 -0
- package/dist/server/agent-teams-run-queue.d.ts.map +1 -0
- package/dist/server/agent-teams-run-queue.js +208 -0
- package/dist/server/agent-teams-run-queue.js.map +1 -0
- package/dist/server/agent-teams.d.ts +67 -0
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +607 -180
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/auth-marketing.d.ts.map +1 -1
- package/dist/server/auth-marketing.js +0 -64
- package/dist/server/auth-marketing.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +67 -14
- package/dist/server/auth.js.map +1 -1
- package/dist/server/builder-browser.d.ts +12 -2
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +24 -0
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +66 -5
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +10 -0
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +82 -3
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +3 -0
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/onboarding-html.d.ts +1 -0
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +14 -1
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/self-dispatch.d.ts +44 -0
- package/dist/server/self-dispatch.d.ts.map +1 -0
- package/dist/server/self-dispatch.js +113 -0
- package/dist/server/self-dispatch.js.map +1 -0
- package/dist/server/social-og-image.d.ts +14 -0
- package/dist/server/social-og-image.d.ts.map +1 -0
- package/dist/server/social-og-image.js +251 -0
- package/dist/server/social-og-image.js.map +1 -0
- package/dist/server/ssr-handler.d.ts +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +27 -11
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/shared/cache-control.d.ts +7 -0
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +7 -0
- package/dist/shared/cache-control.js.map +1 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/route-warmup-config.d.ts +28 -0
- package/dist/shared/route-warmup-config.d.ts.map +1 -0
- package/dist/shared/route-warmup-config.js +58 -0
- package/dist/shared/route-warmup-config.js.map +1 -0
- package/dist/shared/social-meta.d.ts +5 -0
- package/dist/shared/social-meta.d.ts.map +1 -1
- package/dist/shared/social-meta.js +36 -2
- package/dist/shared/social-meta.js.map +1 -1
- package/dist/shared/streaming-text-smoothing.d.ts +12 -0
- package/dist/shared/streaming-text-smoothing.d.ts.map +1 -0
- package/dist/shared/streaming-text-smoothing.js +52 -0
- package/dist/shared/streaming-text-smoothing.js.map +1 -0
- package/dist/styles/agent-native.css +4 -4
- package/dist/templates/default/AGENTS.md +9 -4
- package/dist/templates/default/DEVELOPING.md +15 -1
- package/dist/templates/workspace-core/AGENTS.md +7 -3
- package/dist/templates/workspace-root/AGENTS.md +7 -3
- package/dist/vite/client.d.ts +13 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +26 -0
- package/dist/vite/client.js.map +1 -1
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js.map +1 -1
- package/docs/content/client.md +62 -1
- package/docs/content/code-agents-ui.md +6 -13
- package/docs/content/context-awareness.md +186 -21
- package/docs/content/deployment.md +8 -11
- package/docs/content/dispatch.md +1 -1
- package/docs/content/external-agents.md +32 -2
- package/docs/content/migration-workbench.md +4 -21
- package/docs/content/multi-app-workspace.md +1 -1
- package/docs/content/recurring-jobs.md +1 -1
- package/docs/content/security.md +0 -1
- package/docs/content/sharing.md +1 -3
- package/docs/content/skills-guide.md +12 -10
- package/docs/content/template-assets.md +21 -1
- package/docs/content/template-design.md +23 -5
- package/docs/content/template-dispatch.md +1 -1
- package/package.json +2 -1
- package/src/templates/default/AGENTS.md +9 -4
- package/src/templates/default/DEVELOPING.md +15 -1
- package/src/templates/workspace-core/AGENTS.md +7 -3
- package/src/templates/workspace-root/AGENTS.md +7 -3
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Context Awareness"
|
|
3
|
-
description: "How the agent knows what the user is looking at: navigation state, view-screen, navigate commands, and jitter prevention."
|
|
3
|
+
description: "How the agent knows what the user is looking at: navigation state, selection context, view-screen, sendToAgentChat handoffs, navigate commands, and jitter prevention."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Context Awareness
|
|
7
7
|
|
|
8
|
-
How the agent knows what the user is looking at
|
|
8
|
+
How the agent knows what the user is looking at -- and how the agent can control what the user sees.
|
|
9
9
|
|
|
10
10
|
## Overview {#overview}
|
|
11
11
|
|
|
12
|
-
Without context awareness, the agent is blind. It asks "which email?" when the user is staring at one. It cannot act on the current selection, cannot provide relevant suggestions, and cannot modify what the user sees.
|
|
12
|
+
Without context awareness, the agent is blind. It asks "which email?" when the user is staring at one. It cannot act on the current selection, cannot provide relevant suggestions, and cannot modify what the user sees. With context awareness, the user can click a row, highlight a paragraph, select a slide element, or press Cmd+I, then say "summarize this" and the agent already knows what "this" means.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Five patterns solve this:
|
|
15
15
|
|
|
16
|
-
1. **Navigation state**
|
|
17
|
-
2.
|
|
18
|
-
3. **`
|
|
16
|
+
1. **Navigation state** -- the UI writes a `navigation` key to application-state on every route change
|
|
17
|
+
2. **Selection state** -- the UI writes a `selection` key when the user focuses, selects, or multi-selects something meaningful
|
|
18
|
+
3. **`view-screen`** -- an action that reads application state, fetches contextual data, and returns a snapshot of what the user sees
|
|
19
|
+
4. **Prompt handoff** -- UI controls call `sendToAgentChat()` when a click should become an agent turn
|
|
20
|
+
5. **`navigate`** -- a one-shot command from the agent that tells the UI where to go
|
|
21
|
+
|
|
22
|
+
## Context layers {#context-layers}
|
|
23
|
+
|
|
24
|
+
Use different context channels for different jobs:
|
|
25
|
+
|
|
26
|
+
| Layer | Owner | Use it for |
|
|
27
|
+
| ----------------------------------------- | ----------------- | -------------------------------------------------------------------------- |
|
|
28
|
+
| `navigation` app-state key | UI | Current route, view, open record, filters, active tab |
|
|
29
|
+
| `selection` app-state key | UI | Durable semantic selection: rows, blocks, shapes, assets, messages |
|
|
30
|
+
| `pending-selection-context` app-state key | UI / `AgentPanel` | One-shot selected text attached to the next chat turn, usually from Cmd+I |
|
|
31
|
+
| `view-screen` action | Agent | Hydrating the app-state keys into real records and screen summaries |
|
|
32
|
+
| `sendToAgentChat()` | UI | Turning a click, command, comment pin, or selected item into a chat prompt |
|
|
33
|
+
| `navigate` app-state key | Agent | Asking the UI to move to another route or focus another object |
|
|
34
|
+
|
|
35
|
+
The short version: app state tells the agent what the user is looking at, `view-screen` turns that state into useful data, and `sendToAgentChat()` turns UI intent into a chat message when the user clicks a command.
|
|
19
36
|
|
|
20
37
|
## Navigation state {#navigation-state}
|
|
21
38
|
|
|
22
|
-
The UI writes a `navigation` key to application-state on every route change. This tells the agent what view the user is on
|
|
39
|
+
The UI writes a `navigation` key to application-state on every route change. This tells the agent what view the user is on, what item is open, and which filters shape the visible list.
|
|
23
40
|
|
|
24
41
|
```json
|
|
25
42
|
{
|
|
@@ -33,10 +50,12 @@ The UI writes a `navigation` key to application-state on every route change. Thi
|
|
|
33
50
|
|
|
34
51
|
What to include in navigation state:
|
|
35
52
|
|
|
36
|
-
- `view`
|
|
37
|
-
- Item IDs
|
|
38
|
-
- Filter state
|
|
39
|
-
-
|
|
53
|
+
- `view` -- the current page/section, such as "inbox", "form-builder", or "dashboard"
|
|
54
|
+
- Item IDs -- the selected/open item, such as `threadId` or `formId`
|
|
55
|
+
- Filter state -- active search, label, or category filters
|
|
56
|
+
- Light focus state -- focused row, active tab, current panel
|
|
57
|
+
|
|
58
|
+
Keep `navigation` small and URL-like. It should identify the current screen, not duplicate whole records. Fetch records in `view-screen` so the agent always gets fresh data.
|
|
40
59
|
|
|
41
60
|
The agent reads this before acting:
|
|
42
61
|
|
|
@@ -47,27 +66,113 @@ const navigation = await readAppState("navigation");
|
|
|
47
66
|
// { view: "inbox", threadId: "thread-123", label: "important" }
|
|
48
67
|
```
|
|
49
68
|
|
|
69
|
+
## Selection state {#selection-state}
|
|
70
|
+
|
|
71
|
+
Selection is semantic UI state. It is how "the chart I clicked", "these three rows", "this slide title", or "the current email draft range" becomes model-visible context.
|
|
72
|
+
|
|
73
|
+
Use the `selection` app-state key for durable selection that should survive a moment of navigation, empty-chat suggestions, or a later `view-screen` call:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"kind": "slide.elements",
|
|
78
|
+
"deckId": "deck-123",
|
|
79
|
+
"slideId": "slide-4",
|
|
80
|
+
"items": [
|
|
81
|
+
{
|
|
82
|
+
"id": "hero-title",
|
|
83
|
+
"selector": "[data-block-id='hero-title']",
|
|
84
|
+
"label": "Hero title",
|
|
85
|
+
"text": "Q3 launch plan"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"capturedAt": 1780332977027
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Write it from the UI when the user selects, focuses, or multi-selects meaningful objects:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import { agentNativePath } from "@agent-native/core/client";
|
|
96
|
+
|
|
97
|
+
async function syncSelection(selection: unknown | null) {
|
|
98
|
+
const url = agentNativePath("/_agent-native/application-state/selection");
|
|
99
|
+
|
|
100
|
+
if (!selection) {
|
|
101
|
+
await fetch(url, { method: "DELETE", keepalive: true });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
await fetch(url, {
|
|
106
|
+
method: "PUT",
|
|
107
|
+
keepalive: true,
|
|
108
|
+
headers: { "Content-Type": "application/json" },
|
|
109
|
+
body: JSON.stringify(selection),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Good selection state includes:
|
|
115
|
+
|
|
116
|
+
- Stable IDs the agent can use in actions, such as `threadId`, `slideId`, or `assetId`
|
|
117
|
+
- A short human label so prompts and suggestions are readable
|
|
118
|
+
- Enough text or metadata to disambiguate the object
|
|
119
|
+
- Optional UI locators such as selectors or coordinates when the agent needs to refer back to a visual element
|
|
120
|
+
- `capturedAt` when stale selection would be harmful
|
|
121
|
+
|
|
122
|
+
Avoid storing secrets, full documents, large binary payloads, or whole API responses in `selection`. Store IDs plus short excerpts, then let `view-screen` fetch the current source of truth.
|
|
123
|
+
|
|
124
|
+
### One-shot selected text {#pending-selection-context}
|
|
125
|
+
|
|
126
|
+
`AgentPanel` already handles the common text-selection flow. When the user presses Cmd+I (or Ctrl+I) with text selected on the page, it:
|
|
127
|
+
|
|
128
|
+
1. Reads `window.getSelection()`
|
|
129
|
+
2. Writes `{ text, capturedAt }` to `pending-selection-context`
|
|
130
|
+
3. Focuses the agent chat
|
|
131
|
+
|
|
132
|
+
The production agent injects that key into the next turn as immediate selection context and ignores it once it is stale. This is the path that makes "select text, press Cmd+I, ask 'make this punchier'" work without the user copying the selection into the prompt.
|
|
133
|
+
|
|
134
|
+
Custom editors can write the same key when their selection is not represented by native browser selection:
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
await fetch(
|
|
138
|
+
agentNativePath("/_agent-native/application-state/pending-selection-context"),
|
|
139
|
+
{
|
|
140
|
+
method: "PUT",
|
|
141
|
+
keepalive: true,
|
|
142
|
+
headers: { "Content-Type": "application/json" },
|
|
143
|
+
body: JSON.stringify({
|
|
144
|
+
text: selectedMarkdown,
|
|
145
|
+
capturedAt: Date.now(),
|
|
146
|
+
}),
|
|
147
|
+
},
|
|
148
|
+
);
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Use `pending-selection-context` for one-shot "act on this exact highlighted text" flows. Use `selection` for durable object selection that `view-screen` and dynamic suggestions should keep seeing.
|
|
152
|
+
|
|
50
153
|
## The view-screen action {#view-screen-action}
|
|
51
154
|
|
|
52
|
-
Every template should have a `view-screen` action. It reads navigation state, fetches the relevant data, and returns a snapshot of what the user sees. This is the agent's eyes.
|
|
155
|
+
Every template should have a `view-screen` action. It reads navigation and selection state, fetches the relevant data, and returns a snapshot of what the user sees. This is the agent's eyes.
|
|
53
156
|
|
|
54
157
|
```ts
|
|
55
158
|
// actions/view-screen.ts
|
|
56
159
|
import { defineAction } from "@agent-native/core";
|
|
57
160
|
import { readAppState } from "@agent-native/core/application-state";
|
|
58
|
-
import { eq } from "drizzle-orm";
|
|
161
|
+
import { eq, inArray } from "drizzle-orm";
|
|
59
162
|
import { z } from "zod";
|
|
60
163
|
import { getDb, schema } from "../server/db/index.js";
|
|
61
164
|
|
|
62
165
|
export default defineAction({
|
|
63
166
|
description:
|
|
64
|
-
"See what the user is currently looking at on screen. Reads navigation state and fetches matching data.",
|
|
167
|
+
"See what the user is currently looking at on screen. Reads navigation and selection state and fetches matching data.",
|
|
65
168
|
schema: z.object({}),
|
|
66
169
|
http: false,
|
|
67
170
|
run: async () => {
|
|
68
171
|
const navigation = (await readAppState("navigation")) as any;
|
|
172
|
+
const selection = (await readAppState("selection")) as any;
|
|
69
173
|
const screen: Record<string, unknown> = {};
|
|
70
174
|
if (navigation) screen.navigation = navigation;
|
|
175
|
+
if (selection) screen.selection = selection;
|
|
71
176
|
|
|
72
177
|
const db = getDb();
|
|
73
178
|
|
|
@@ -84,6 +189,12 @@ export default defineAction({
|
|
|
84
189
|
.from(schema.threads)
|
|
85
190
|
.where(eq(schema.threads.id, navigation.threadId));
|
|
86
191
|
}
|
|
192
|
+
if (selection?.kind === "email.messages") {
|
|
193
|
+
screen.selectedMessages = await db
|
|
194
|
+
.select()
|
|
195
|
+
.from(schema.emails)
|
|
196
|
+
.where(inArray(schema.emails.id, selection.messageIds));
|
|
197
|
+
}
|
|
87
198
|
|
|
88
199
|
if (Object.keys(screen).length === 0) {
|
|
89
200
|
return "No application state found. Is the app running?";
|
|
@@ -93,14 +204,68 @@ export default defineAction({
|
|
|
93
204
|
});
|
|
94
205
|
```
|
|
95
206
|
|
|
96
|
-
The agent should
|
|
207
|
+
The agent should call `pnpm action view-screen` before acting on the current UI. This is a hard convention across all templates. When adding new features, update `view-screen` to return data for the new view and any new selection shape.
|
|
208
|
+
|
|
209
|
+
## Prompt handoff with `sendToAgentChat()` {#send-to-agent-chat}
|
|
210
|
+
|
|
211
|
+
Sometimes context should not just sit in app state. A user clicks a button, drops a comment pin, selects an item and chooses "Ask agent", or presses an AI command in a toolbar. That click is an instruction. In browser UI, hand it to the agent with `sendToAgentChat()`.
|
|
212
|
+
|
|
213
|
+
```tsx
|
|
214
|
+
import { sendToAgentChat } from "@agent-native/core/client";
|
|
215
|
+
|
|
216
|
+
function askAgentAboutSelection(selection: {
|
|
217
|
+
documentId: string;
|
|
218
|
+
blockId: string;
|
|
219
|
+
label: string;
|
|
220
|
+
text: string;
|
|
221
|
+
}) {
|
|
222
|
+
sendToAgentChat({
|
|
223
|
+
message: `Improve the selected block: ${selection.label}`,
|
|
224
|
+
context: [
|
|
225
|
+
`Document id: ${selection.documentId}`,
|
|
226
|
+
`Block id: ${selection.blockId}`,
|
|
227
|
+
"Current selected text:",
|
|
228
|
+
selection.text,
|
|
229
|
+
].join("\n"),
|
|
230
|
+
submit: false,
|
|
231
|
+
openSidebar: true,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Use the fields deliberately:
|
|
237
|
+
|
|
238
|
+
| Field | Meaning |
|
|
239
|
+
| ------------------- | -------------------------------------------------------------------------------- |
|
|
240
|
+
| `message` | Visible prompt text shown in chat |
|
|
241
|
+
| `context` | Hidden model-visible context, not shown as user-facing chat text |
|
|
242
|
+
| `submit: true` | Send immediately; good for explicit command buttons such as "Fix layout" |
|
|
243
|
+
| `submit: false` | Prefill for user review; good for "Ask agent about this" or ambiguous selections |
|
|
244
|
+
| `openSidebar: true` | Make the agent response visible even if the panel was collapsed |
|
|
245
|
+
| `newTab: true` | Start a separate chat thread for a larger creation task |
|
|
246
|
+
| `type: "code"` | Route to the code-editing frame when the request is about changing app source |
|
|
247
|
+
|
|
248
|
+
`sendToAgentChat()` is the supported browser wrapper for the submitted-chat path sometimes seen internally as `agentNative.submitChat`. App UI should call the wrapper instead of posting `agentNative.submitChat` directly because the wrapper handles local sidebars, Builder/Frame routing, MCP App host routing, tab IDs, and code-request routing.
|
|
249
|
+
|
|
250
|
+
Use `agentChat.submit()` or `agentChat.prefill()` for Node/script contexts where there is no browser sidebar. Server actions generally should not call browser-only `sendToAgentChat()`; if an action needs the open UI to ask the agent something, write a small request into `application_state` and let a UI bridge send it from the browser.
|
|
251
|
+
|
|
252
|
+
### Clicked items in the prompt {#clicked-items-in-prompt}
|
|
253
|
+
|
|
254
|
+
For the "click items in the UI and they become part of the prompt" experience, combine selection state with prompt handoff:
|
|
255
|
+
|
|
256
|
+
1. On click or multi-select, write semantic `selection` state so `view-screen`, dynamic suggestions, and future turns can see it.
|
|
257
|
+
2. If the click is also a command, call `sendToAgentChat()` with a concise visible `message` and richer hidden `context`.
|
|
258
|
+
3. In `view-screen`, hydrate the selected IDs into current records so the agent can verify the object before mutating it.
|
|
259
|
+
4. Clear `selection` when the object is no longer selected, deleted, or no longer relevant.
|
|
260
|
+
|
|
261
|
+
That gives the user the magic "this is what I meant" behavior without stuffing every prompt with bulky visible context.
|
|
97
262
|
|
|
98
263
|
## The navigate action {#navigate-action}
|
|
99
264
|
|
|
100
265
|
The agent writes a one-shot `navigate` command to application-state. The UI reads it, performs the navigation, and deletes the entry.
|
|
101
266
|
|
|
102
267
|
```ts
|
|
103
|
-
// Agent side
|
|
268
|
+
// Agent side -- write a navigate command
|
|
104
269
|
import { writeAppState } from "@agent-native/core/application-state";
|
|
105
270
|
|
|
106
271
|
await writeAppState("navigate", { view: "inbox", threadId: "thread-123" });
|
|
@@ -109,7 +274,7 @@ await writeAppState("navigate", { view: "inbox", threadId: "thread-123" });
|
|
|
109
274
|
The UI polls for this command and navigates when it appears:
|
|
110
275
|
|
|
111
276
|
```ts
|
|
112
|
-
// UI side
|
|
277
|
+
// UI side -- poll for navigate commands
|
|
113
278
|
const { data: navCommand } = useQuery({
|
|
114
279
|
queryKey: ["navigate-command"],
|
|
115
280
|
queryFn: async () => {
|
|
@@ -133,7 +298,7 @@ useEffect(() => {
|
|
|
133
298
|
}, [navCommand]);
|
|
134
299
|
```
|
|
135
300
|
|
|
136
|
-
The `navigation` key belongs to the UI
|
|
301
|
+
The `navigation` key belongs to the UI -- the agent should never write to it directly. Instead, the agent writes to `navigate`, and the UI performs the actual navigation, which then updates `navigation`.
|
|
137
302
|
|
|
138
303
|
## useNavigationState hook {#use-navigation-state}
|
|
139
304
|
|
|
@@ -158,7 +323,7 @@ export function useNavigationState() {
|
|
|
158
323
|
}
|
|
159
324
|
```
|
|
160
325
|
|
|
161
|
-
The `deriveNavigationState()` function is template-specific
|
|
326
|
+
The `deriveNavigationState()` function is template-specific -- it parses the URL path and extracts the view, item IDs, and filters relevant to your app.
|
|
162
327
|
|
|
163
328
|
## Jitter prevention {#jitter-prevention}
|
|
164
329
|
|
|
@@ -179,5 +344,5 @@ How it works:
|
|
|
179
344
|
- Agent writes are tagged with `requestSource: "agent"` (the action helpers do this automatically)
|
|
180
345
|
- UI writes include the tab's unique ID via `X-Request-Source` header
|
|
181
346
|
- The server stores the source on each event
|
|
182
|
-
- When processing sync events, the UI filters out events matching its own `ignoreSource` value
|
|
347
|
+
- When processing sync events, the UI filters out events matching its own `ignoreSource` value -- so it doesn't refetch data it just wrote
|
|
183
348
|
- Events from agents, other tabs, and actions still come through normally
|
|
@@ -252,9 +252,6 @@ Inbound webhook handlers refuse forged requests when their signing secret is mis
|
|
|
252
252
|
| `WHATSAPP_APP_SECRET` | WhatsApp Business integration is enabled. |
|
|
253
253
|
| `WHATSAPP_VERIFY_TOKEN` | WhatsApp webhook verification handshake (set in your Meta app dashboard too). |
|
|
254
254
|
| `SLACK_SIGNING_SECRET` | Slack integration is enabled. Verifies Slack request signatures. |
|
|
255
|
-
| `RECALL_WEBHOOK_SECRET` | Calls / Recall.ai integration is enabled. |
|
|
256
|
-
| `DEEPGRAM_WEBHOOK_SECRET` | Calls / Deepgram transcription webhook is enabled. |
|
|
257
|
-
| `ZOOM_WEBHOOK_SECRET` | Calls / Zoom integration is enabled. |
|
|
258
255
|
| `GOOGLE_DOCS_PUSH_AUDIENCE` | Google Docs Pub/Sub push integration is enabled. Set to the public URL of your push endpoint. |
|
|
259
256
|
| `GOOGLE_DOCS_PUSH_SIGNER_EMAIL` | Google Docs Pub/Sub push integration is enabled. Set to the Pub/Sub service account email. |
|
|
260
257
|
| `GMAIL_WATCH_TOPIC` | Gmail Pub/Sub push (mail template). Optional — disables push if unset and falls back to history-delta polling. |
|
|
@@ -267,14 +264,14 @@ For local development of any of these integrations, set `AGENT_NATIVE_ALLOW_UNVE
|
|
|
267
264
|
|
|
268
265
|
Defaults are strict; these flags relax behavior. Don't set them unless you specifically want the relaxed path.
|
|
269
266
|
|
|
270
|
-
| Variable | Effect
|
|
271
|
-
| ---------------------------------------- |
|
|
272
|
-
| `AGENT_NATIVE_DEBUG_ERRORS` | `=1` to include stack traces in 500 JSON responses. Useful on previews; do **not** set in real prod (was previously gated by `NODE_ENV !== "production"`, which leaked stacks on misconfigured deploys).
|
|
273
|
-
| `AGENT_NATIVE_ALLOW_UNVERIFIED_WEBHOOKS` | `=1` to accept webhooks without their signing secret (local dev only). Defaults to fail-closed in production.
|
|
274
|
-
| `AGENT_NATIVE_KEYS_WORKSPACE_FALLBACK` | `=1` to let `${keys.NAME}` resolution in tools/automations fall through user-scope → workspace-scope. Default off (user-scope only) — a malicious org member could otherwise plant a workspace `OPENAI_API_KEY` and harvest other members'
|
|
275
|
-
| `AGENT_NATIVE_MCP_HUB_MULTI_ORG` | `=1` to allow `AGENT_NATIVE_MCP_HUB_TOKEN` to serve multiple orgs from a single hub deployment. Default refuses to serve when more than one org exists in a hub deploy. Only relevant if you operate the workspace MCP hub.
|
|
276
|
-
| `AGENT_NATIVE_ALLOW_ENV_VAR_WRITES` | `=1` to let runtime code mutate `process.env` from the env-var write API. Off by default — required to be explicitly enabled outside dev SQLite.
|
|
277
|
-
| `AUTH_SKIP_EMAIL_VERIFICATION` | `=1` to skip email verification for password signups. Local dev/test skips by default; hosted deploys should use this only for QA — see Auth section above.
|
|
267
|
+
| Variable | Effect |
|
|
268
|
+
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
269
|
+
| `AGENT_NATIVE_DEBUG_ERRORS` | `=1` to include stack traces in 500 JSON responses. Useful on previews; do **not** set in real prod (was previously gated by `NODE_ENV !== "production"`, which leaked stacks on misconfigured deploys). |
|
|
270
|
+
| `AGENT_NATIVE_ALLOW_UNVERIFIED_WEBHOOKS` | `=1` to accept webhooks without their signing secret (local dev only). Defaults to fail-closed in production. |
|
|
271
|
+
| `AGENT_NATIVE_KEYS_WORKSPACE_FALLBACK` | `=1` to let `${keys.NAME}` resolution in tools/automations fall through user-scope → workspace-scope. Default off (user-scope only) — a malicious org member could otherwise plant a workspace `OPENAI_API_KEY` and harvest other members' requests. Turn on only if your org genuinely shares workspace-wide keys. |
|
|
272
|
+
| `AGENT_NATIVE_MCP_HUB_MULTI_ORG` | `=1` to allow `AGENT_NATIVE_MCP_HUB_TOKEN` to serve multiple orgs from a single hub deployment. Default refuses to serve when more than one org exists in a hub deploy. Only relevant if you operate the workspace MCP hub. |
|
|
273
|
+
| `AGENT_NATIVE_ALLOW_ENV_VAR_WRITES` | `=1` to let runtime code mutate `process.env` from the env-var write API. Off by default — required to be explicitly enabled outside dev SQLite. |
|
|
274
|
+
| `AUTH_SKIP_EMAIL_VERIFICATION` | `=1` to skip email verification for password signups. Local dev/test skips by default; hosted deploys should use this only for QA — see Auth section above. |
|
|
278
275
|
|
|
279
276
|
### Workspace .env Inheritance {#env-inheritance}
|
|
280
277
|
|
package/docs/content/dispatch.md
CHANGED
|
@@ -15,7 +15,7 @@ Without Dispatch, every app in a multi-app workspace ends up re-implementing the
|
|
|
15
15
|
|
|
16
16
|
Reach for Dispatch when any of these are true:
|
|
17
17
|
|
|
18
|
-
- You're running a [multi-app workspace](/docs/multi-app-workspace) — mail, calendar, analytics, content
|
|
18
|
+
- You're running a [multi-app workspace](/docs/multi-app-workspace) — mail, calendar, analytics, content — and you don't want one Slack bot per app.
|
|
19
19
|
- You want **one inbox for "the agent"** so users DM a single bot and the right specialist app picks up the work behind the scenes.
|
|
20
20
|
- You have **workspace-wide secrets** (Stripe key, OpenAI key, third-party API tokens) that several apps need and you want one vault instead of copying values into every `.env`.
|
|
21
21
|
- You want a **runtime approval flow** in front of sensitive changes (saved destinations, policy edits) so non-admins can request and admins can sign off without a code deploy.
|
|
@@ -101,6 +101,10 @@ The command asks which local agent clients should receive MCP config. All client
|
|
|
101
101
|
|
|
102
102
|
For Claude Code and Claude Code CLI, `connect` writes a standard remote HTTP MCP entry with no static headers. Restart Claude Code, run `/mcp`, and choose **Authenticate**; Claude completes the OAuth flow and stores its own tokens. For Codex and Claude Cowork, `connect` uses the compatibility device-code flow: it opens your browser at the app, you click **Authorize** once, and the command writes a scoped bearer-token entry. If you choose a mix of clients, it does both.
|
|
103
103
|
|
|
104
|
+
Keep the `connect` command running until the browser approval completes. If the
|
|
105
|
+
waiting process is stopped early, the approval can succeed in the browser but
|
|
106
|
+
the local client config will not receive the token.
|
|
107
|
+
|
|
104
108
|
If you previously connected Claude Code through the old bearer-token flow, just run the same `agent-native connect ... --client claude-code` command again. The CLI replaces the legacy `Authorization` headers with the URL-only OAuth entry and tells you to re-authenticate from `/mcp`.
|
|
105
109
|
|
|
106
110
|
| Local client | Config written by `connect` | Auth flow |
|
|
@@ -111,15 +115,32 @@ If you previously connected Claude Code through the old bearer-token flow, just
|
|
|
111
115
|
|
|
112
116
|
Restart the agent client after connecting so it picks up the new MCP server; OAuth-native clients may then prompt you to authenticate from their MCP UI.
|
|
113
117
|
|
|
118
|
+
When troubleshooting local MCP config, redact `Authorization`, `http_headers`,
|
|
119
|
+
and token values before sharing logs. Do not use raw curl as a substitute for a
|
|
120
|
+
host MCP session; after connecting, use the host-exposed tools or restart the
|
|
121
|
+
client if the new server is not visible yet.
|
|
122
|
+
|
|
114
123
|
Use `--client codex` (or `--client claude-code`, `--client claude-code-cli`, `--client cowork`, `--client all`) to skip the picker for scripts or one-off installs.
|
|
115
124
|
|
|
116
|
-
First-party app skills install the instructions and the hosted MCP connector together with
|
|
125
|
+
First-party app skills install the instructions and the hosted MCP connector together with the Agent Native CLI:
|
|
117
126
|
|
|
118
127
|
```bash
|
|
119
128
|
npx @agent-native/core@latest skills add assets # aliases: images, image-generation
|
|
120
129
|
npx @agent-native/core@latest skills add design-exploration # aliases: design, ux-exploration
|
|
121
130
|
```
|
|
122
131
|
|
|
132
|
+
The Vercel/open Skills CLI path is also available when you only want portable
|
|
133
|
+
instructions:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npx skills add BuilderIO/agent-native --skill assets
|
|
137
|
+
npx skills add BuilderIO/agent-native --skill design-exploration
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The raw `skills` CLI installs `SKILL.md` files only; local MCP clients still
|
|
141
|
+
need a connector such as `npx @agent-native/core@latest connect
|
|
142
|
+
https://assets.agent-native.com`.
|
|
143
|
+
|
|
123
144
|
| Skill | Alias | For |
|
|
124
145
|
| -------------------- | -------- | ---------------------- |
|
|
125
146
|
| `assets` | `images` | image/video generation |
|
|
@@ -228,7 +249,16 @@ only when it truly needs to stay visible in chat-host discovery.
|
|
|
228
249
|
|
|
229
250
|
That makes the same app surface available to every compatible host rather than building per-client shims. The current official MCP Apps client list includes Claude, Claude Desktop, VS Code GitHub Copilot, Goose, Postman, MCPJam, ChatGPT, and Cursor; host support still varies by plan, release channel, and client version, so check the [MCP extension support matrix](https://modelcontextprotocol.io/extensions/client-matrix). ChatGPT custom MCP apps are available through developer mode for Business and Enterprise/Edu workspaces on ChatGPT web; see OpenAI's [developer mode and MCP apps](https://help.openai.com/en/articles/12584461-developer-mode-and-full-mcp-apps-in-chatgpt-beta) notes.
|
|
230
251
|
|
|
231
|
-
Claude Code and other CLI-
|
|
252
|
+
Claude Code, Codex, and other CLI/code-editor clients still receive the same
|
|
253
|
+
resources and metadata when they support MCP Apps, but treat them as link-out
|
|
254
|
+
hosts unless you have verified inline iframe rendering in that exact surface.
|
|
255
|
+
The deep link remains the reliable fallback when a host chooses not to render an
|
|
256
|
+
iframe. In practice, every agent-native app should be authored with both: MCP
|
|
257
|
+
Apps for inline review/edit in capable hosts, and `link` for universal
|
|
258
|
+
round-tripping back to the full app. Human-selection tools can add a paste-back
|
|
259
|
+
step to that fallback: for example, the Assets picker opens from the fallback
|
|
260
|
+
link, lets the user choose media in the browser, then copies a handoff summary
|
|
261
|
+
that the user pastes back into the chat.
|
|
232
262
|
|
|
233
263
|
Claude and ChatGPT can cache tool and resource metadata for an existing custom
|
|
234
264
|
connector. After changing MCP App metadata, verify with a fresh tool call; if
|
|
@@ -20,7 +20,7 @@ npx @agent-native/core@latest code /migrate ./my-next-app --out ../migrated-app
|
|
|
20
20
|
|
|
21
21
|
See [Agent-Native Code UI](/docs/code-agents-ui) for the shared CLI run controls (`list`/`attach`/`logs`/`resume`/`status`/`stop`/`ui`) and the file-backed, long-running background-run model that `/migrate` sessions use.
|
|
22
22
|
|
|
23
|
-
By default `/migrate` creates a generic Agent-Native Code session plus a portable migration dossier. Migration is a slash command in the Code workspace, not a normal template to scaffold. The hidden `migration` app
|
|
23
|
+
By default `/migrate` creates a generic Agent-Native Code session plus a portable migration dossier. Migration is a slash command in the Code workspace, not a normal template to scaffold. The legacy hidden `migration` detail app has been removed; use the Code workspace, Desktop Code tab, or emitted dossier as the supported surfaces.
|
|
24
24
|
|
|
25
25
|
The direct `migrate` command remains a shortcut into the same goal:
|
|
26
26
|
|
|
@@ -104,26 +104,9 @@ npx @agent-native/core@latest code /migrate --describe "A Rails admin app with r
|
|
|
104
104
|
|
|
105
105
|
For local paths, the source is read-only. Generated output must live outside the source tree.
|
|
106
106
|
|
|
107
|
-
## Internal Run
|
|
107
|
+
## Internal Run Flow
|
|
108
108
|
|
|
109
|
-
The normal command creates a generic Agent-Native Code session and writes artifacts under the Agent-Native Code run store. It does **not** scaffold an app/template.
|
|
110
|
-
|
|
111
|
-
Open the legacy hidden `migration` detail surface only when you explicitly want that richer dashboard:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
npx @agent-native/core@latest code /migrate ./my-next-app --app-surface
|
|
115
|
-
cd migration
|
|
116
|
-
pnpm install
|
|
117
|
-
pnpm dev
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
The local dev URL is printed by Vite. In first-party dev setups it is usually:
|
|
121
|
-
|
|
122
|
-
```text
|
|
123
|
-
http://localhost:8101/
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Inside that optional internal surface, the flow is:
|
|
109
|
+
The normal command creates a generic Agent-Native Code session and writes artifacts under the Agent-Native Code run store. It does **not** scaffold an app/template. The flow is:
|
|
127
110
|
|
|
128
111
|
1. **Discover** reads the source and creates `01-assessment.md`.
|
|
129
112
|
2. **Plan** creates recipe tasks and writes `02-plan.md` plus `03-tasks.md`.
|
|
@@ -131,7 +114,7 @@ Inside that optional internal surface, the flow is:
|
|
|
131
114
|
4. **Sweep** runs migration tasks against the generated output project.
|
|
132
115
|
5. **Verify** runs deterministic checks and writes `04-report.md`.
|
|
133
116
|
|
|
134
|
-
Drive
|
|
117
|
+
Drive the session with the standard run controls (`status`/`list`/`attach`/`logs`/`approve`/`resume`/`ui`/`stop`, plus `--continue "prompt"` to record and run a follow-up). See [Agent-Native Code UI](/docs/code-agents-ui) for what each control does and how stop/approve behave.
|
|
135
118
|
|
|
136
119
|
## Long-Running Goals
|
|
137
120
|
|
|
@@ -7,7 +7,7 @@ description: "Host many agent-native apps in one monorepo with shared auth, RBAC
|
|
|
7
7
|
|
|
8
8
|
> For what a workspace _is_ — the customization layer, `AGENTS.md`, `LEARNINGS.md`, personal memory, skills, and custom agents — see [Workspace](/docs/workspace). This page is about the **deployment shape**: hosting many agent-native apps in one monorepo with shared auth, components, and a unified deploy.
|
|
9
9
|
|
|
10
|
-
When vibe-coding an internal tool takes an afternoon, you don't stop at one. A team ends up with a CRM, a support inbox, a dashboard,
|
|
10
|
+
When vibe-coding an internal tool takes an afternoon, you don't stop at one. A team ends up with a CRM, a support inbox, a dashboard, an ops console — ten small apps, each scaffolded independently. That's great until you need to change something in all of them.
|
|
11
11
|
|
|
12
12
|
At that point every app has its own `AGENTS.md`, its own auth plugin, its own copy-pasted layout component, its own hard-coded Slack token, its own idea of what an "organization" is. A compliance rule change means ten PRs. Rotating an API key means ten redeployments. A brand refresh means ten different headers drifting out of sync. The thing that made it easy to build them is now making it hard to manage them.
|
|
13
13
|
|
|
@@ -112,7 +112,7 @@ If the runtime is serverless/edge, trigger the tick from an external cron (Cloud
|
|
|
112
112
|
Don't confuse recurring jobs with `@agent-native/scheduling`:
|
|
113
113
|
|
|
114
114
|
- **Recurring jobs (this page)** — cron-scheduled _prompts_ the agent runs in the background. Framework-level. Lives in the workspace. Runs on any agent-native app.
|
|
115
|
-
- **`@agent-native/scheduling`** — a reusable domain package for building calendar/booking features (event types, availability windows, bookings). Powers the `calendar` and
|
|
115
|
+
- **`@agent-native/scheduling`** — a reusable domain package for building calendar/booking features (event types, availability windows, bookings). Powers the `calendar` template and custom scheduling surfaces.
|
|
116
116
|
|
|
117
117
|
Recurring jobs are "how do I make the agent act on its own?" The scheduling package is "how do I build a calendar app?" Different concerns.
|
|
118
118
|
|
package/docs/content/security.md
CHANGED
|
@@ -239,7 +239,6 @@ Workspace-scope secret writes still require org owner/admin role regardless of t
|
|
|
239
239
|
- [ ] `EMAIL_INBOUND_WEBHOOK_SECRET` if Resend / SendGrid inbound is enabled
|
|
240
240
|
- [ ] `SLACK_SIGNING_SECRET` if Slack is enabled
|
|
241
241
|
- [ ] `TELEGRAM_WEBHOOK_SECRET` / `WHATSAPP_APP_SECRET` for those integrations
|
|
242
|
-
- [ ] `RECALL_WEBHOOK_SECRET`, `DEEPGRAM_WEBHOOK_SECRET`, `ZOOM_WEBHOOK_SECRET` for calls
|
|
243
242
|
- [ ] `AGENT_NATIVE_ALLOW_UNVERIFIED_WEBHOOKS` is **not** set in prod
|
|
244
243
|
|
|
245
244
|
### Schema
|
package/docs/content/sharing.md
CHANGED
|
@@ -46,8 +46,6 @@ Every template that stores user-authored work uses this model. Concretely:
|
|
|
46
46
|
- **Design** — designs and assets
|
|
47
47
|
- **Video** — compositions
|
|
48
48
|
- **Clips** — screen recordings (Loom-style)
|
|
49
|
-
- **Calls** — meeting recordings and transcripts (Granola-style)
|
|
50
|
-
- **Meeting Notes** — transcripts and summaries
|
|
51
49
|
- **Forms** — form definitions
|
|
52
50
|
- **Calendar** — events and booking links
|
|
53
51
|
- **Analytics** — dashboards (rolling out — see the analytics template's `AGENTS.md`)
|
|
@@ -60,7 +58,7 @@ Every one of these uses the same `ownableColumns()` schema helper, the same `sha
|
|
|
60
58
|
A few areas are intentionally outside the sharing system:
|
|
61
59
|
|
|
62
60
|
- **Personal-data apps** (Mail, Macros) — user-scoped by design. There's no "share my inbox" concept.
|
|
63
|
-
- **External source-of-truth apps**
|
|
61
|
+
- **External source-of-truth apps** — access control lives in the upstream system, not the agent-native app.
|
|
64
62
|
- **Anonymous public URLs** — form publish slugs and booking-link slugs that expose a URL to logged-out users are a separate axis. They live alongside the sharing system, not on top of it.
|
|
65
63
|
|
|
66
64
|
## The share UI {#share-ui}
|
|
@@ -81,15 +81,15 @@ Hosted is the default install path. Local launch is explicit for customization,
|
|
|
81
81
|
offline work, or privacy-sensitive use.
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
-
#
|
|
84
|
+
# Happy path: exported instructions plus hosted MCP connector.
|
|
85
85
|
npx @agent-native/core@latest skills add assets
|
|
86
|
-
|
|
87
|
-
# Same install, using the image-generation alias for demos and tutorials.
|
|
88
86
|
npx @agent-native/core@latest skills add images
|
|
89
|
-
|
|
90
|
-
# One-command hosted install for Design exploration plus MCP connector.
|
|
91
87
|
npx @agent-native/core@latest skills add design-exploration
|
|
92
88
|
|
|
89
|
+
# Vercel/open Skills CLI: exported instructions only, no MCP config.
|
|
90
|
+
npx skills add BuilderIO/agent-native --skill assets
|
|
91
|
+
npx skills add BuilderIO/agent-native --skill design-exploration
|
|
92
|
+
|
|
93
93
|
# Register a hosted MCP connector for local agent clients.
|
|
94
94
|
agent-native app-skill ensure --manifest templates/assets/agent-native.app-skill.json
|
|
95
95
|
|
|
@@ -100,7 +100,7 @@ agent-native app-skill launch --manifest templates/assets/agent-native.app-skill
|
|
|
100
100
|
# plain/Claude skills, and MCP configs.
|
|
101
101
|
agent-native app-skill pack --manifest templates/assets/agent-native.app-skill.json --out ./dist/assets-skill
|
|
102
102
|
|
|
103
|
-
# Install
|
|
103
|
+
# Install a local exported bundle with the Vercel/open Skills CLI.
|
|
104
104
|
npx skills add ./dist/assets-skill --skill assets -a codex -y
|
|
105
105
|
|
|
106
106
|
# Add the generated Claude Code marketplace, then install its Assets plugin.
|
|
@@ -113,10 +113,12 @@ metadata; OAuth/device setup happens in the MCP host or through the app's normal
|
|
|
113
113
|
settings flow.
|
|
114
114
|
|
|
115
115
|
The Vercel Labs `skills` adapter is a portable `skills/<name>/SKILL.md` bundle
|
|
116
|
-
for `npx skills add
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
for `npx skills add ...`, but the raw `skills` CLI installs instructions only.
|
|
117
|
+
It does not run repo-defined postinstall scripts or register MCP connectors.
|
|
118
|
+
Keep the Agent Native CLI as the default docs path for local agents because it
|
|
119
|
+
also registers the MCP connector. `BuilderIO/agent-native` is a real GitHub
|
|
120
|
+
repository source for the Vercel/open Skills CLI; `skills.sh` is a discovery and
|
|
121
|
+
leaderboard directory, not an npm-style package namespace.
|
|
120
122
|
|
|
121
123
|
The Claude Code marketplace adapter writes
|
|
122
124
|
`adapters/claude-marketplace/.claude-plugin/marketplace.json` plus a nested
|
|
@@ -54,6 +54,16 @@ Generate and pick brand media without leaving Codex, Claude Code, Claude, or Cha
|
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Default client is `codex`; add `--client claude-code` or `--client all` for others.
|
|
57
|
+
If you only want the portable skill instructions through the Vercel/open
|
|
58
|
+
Skills CLI, use:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx skills add BuilderIO/agent-native --skill assets
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The Vercel/open Skills CLI installs the instruction file only; it does not
|
|
65
|
+
run MCP connector setup. Use the Agent Native CLI path above when you want
|
|
66
|
+
the one-command setup.
|
|
57
67
|
|
|
58
68
|
2. **Ask for images.** In your agent's chat: "Generate three blog hero options from the Acme product shots." The agent opens the picker with candidate images you can regenerate, retune (prompt, aspect, count), and choose from.
|
|
59
69
|
3. **Pick.** In inline hosts (ChatGPT, Claude.ai, Claude Desktop main chat) the picker renders right in the chat — click a candidate and the choice flows back automatically. On CLI/link-only hosts (Codex, Claude Code, Claude Desktop "Code" tab) you get an **"Open in Assets →"** link; open it, pick in the browser, then paste the copied handoff summary back into your chat — or just say "use image A".
|
|
@@ -128,6 +138,13 @@ copies a handoff summary and shows a copyable context block; paste that summary
|
|
|
128
138
|
back into the chat so the external agent can use the selected media URL and
|
|
129
139
|
asset metadata.
|
|
130
140
|
|
|
141
|
+
Codex, Claude Code, and Claude Desktop Code should be treated as link-out hosts
|
|
142
|
+
for this flow. They may not render MCP Apps inline, and remote CDN markdown
|
|
143
|
+
images may not display reliably in the chat transcript. Agents should keep the
|
|
144
|
+
asset link as the source of truth; when a visible inline preview is needed in a
|
|
145
|
+
code-editor chat, download the selected `previewUrl`/`downloadUrl` to a local
|
|
146
|
+
image file and embed that absolute local path.
|
|
147
|
+
|
|
131
148
|
For generate-and-choose flows, call `open-asset-picker` with `prompt`,
|
|
132
149
|
`autoGenerate: true`, and `count: 3` (customizable from 1-6). The picker opens
|
|
133
150
|
with candidate images and lets the user adjust count, aspect ratio, or a
|
|
@@ -148,6 +165,9 @@ npx @agent-native/core@latest skills add assets
|
|
|
148
165
|
# Image-generation alias for demos and tutorials.
|
|
149
166
|
npx @agent-native/core@latest skills add images
|
|
150
167
|
|
|
168
|
+
# Vercel/open Skills CLI install: exported instructions only, no MCP config.
|
|
169
|
+
npx skills add BuilderIO/agent-native --skill assets
|
|
170
|
+
|
|
151
171
|
# Hosted install: URL-only MCP connector, no shared secrets in skill files.
|
|
152
172
|
agent-native app-skill ensure --manifest templates/assets/agent-native.app-skill.json
|
|
153
173
|
|
|
@@ -157,7 +177,7 @@ agent-native app-skill launch --manifest templates/assets/agent-native.app-skill
|
|
|
157
177
|
# Marketplace package, including Claude Code marketplace and Vercel Labs skills adapters.
|
|
158
178
|
agent-native app-skill pack --manifest templates/assets/agent-native.app-skill.json --out ./dist/assets-skill
|
|
159
179
|
|
|
160
|
-
# Install
|
|
180
|
+
# Install a local exported Assets bundle with the open skills CLI.
|
|
161
181
|
npx skills add ./dist/assets-skill --skill assets -a codex -y
|
|
162
182
|
|
|
163
183
|
# Install from the generated Claude Code marketplace adapter.
|