@agent-native/core 0.16.1 → 0.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +21 -5
  2. package/dist/cli/code-agent-executor.js +1 -1
  3. package/dist/cli/code-agent-executor.js.map +1 -1
  4. package/dist/cli/code.d.ts.map +1 -1
  5. package/dist/cli/code.js +29 -4
  6. package/dist/cli/code.js.map +1 -1
  7. package/dist/client/AgentPanel.d.ts.map +1 -1
  8. package/dist/client/AgentPanel.js +9 -1
  9. package/dist/client/AgentPanel.js.map +1 -1
  10. package/dist/client/AssistantChat.js +2 -2
  11. package/dist/client/AssistantChat.js.map +1 -1
  12. package/dist/client/ConnectBuilderCard.js +1 -1
  13. package/dist/client/ConnectBuilderCard.js.map +1 -1
  14. package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
  15. package/dist/client/components/CodeRequiredDialog.js +3 -1
  16. package/dist/client/components/CodeRequiredDialog.js.map +1 -1
  17. package/dist/client/composer/AgentComposerFrame.d.ts +3 -1
  18. package/dist/client/composer/AgentComposerFrame.d.ts.map +1 -1
  19. package/dist/client/composer/AgentComposerFrame.js +3 -3
  20. package/dist/client/composer/AgentComposerFrame.js.map +1 -1
  21. package/dist/client/composer/ComposerPlusMenu.d.ts.map +1 -1
  22. package/dist/client/composer/ComposerPlusMenu.js +2 -7
  23. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  24. package/dist/client/composer/PromptComposer.d.ts +4 -1
  25. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  26. package/dist/client/composer/PromptComposer.js +3 -3
  27. package/dist/client/composer/PromptComposer.js.map +1 -1
  28. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  29. package/dist/client/composer/TiptapComposer.js +13 -3
  30. package/dist/client/composer/TiptapComposer.js.map +1 -1
  31. package/dist/client/composer/useVoiceDictation.d.ts.map +1 -1
  32. package/dist/client/composer/useVoiceDictation.js +16 -10
  33. package/dist/client/composer/useVoiceDictation.js.map +1 -1
  34. package/dist/client/onboarding/OnboardingPanel.js +1 -1
  35. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  36. package/dist/client/settings/BackgroundAgentSection.d.ts.map +1 -1
  37. package/dist/client/settings/BackgroundAgentSection.js +9 -2
  38. package/dist/client/settings/BackgroundAgentSection.js.map +1 -1
  39. package/dist/client/settings/BrowserSection.d.ts.map +1 -1
  40. package/dist/client/settings/BrowserSection.js +17 -3
  41. package/dist/client/settings/BrowserSection.js.map +1 -1
  42. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  43. package/dist/client/settings/SettingsPanel.js +5 -5
  44. package/dist/client/settings/SettingsPanel.js.map +1 -1
  45. package/dist/client/settings/useBuilderStatus.d.ts +15 -2
  46. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  47. package/dist/client/settings/useBuilderStatus.js +99 -11
  48. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  49. package/dist/client/settings/useBuilderStatus.spec.js +12 -6
  50. package/dist/client/settings/useBuilderStatus.spec.js.map +1 -1
  51. package/dist/code-agents/background-controller.d.ts +39 -0
  52. package/dist/code-agents/background-controller.d.ts.map +1 -0
  53. package/dist/code-agents/background-controller.js +249 -0
  54. package/dist/code-agents/background-controller.js.map +1 -0
  55. package/dist/code-agents/background-run.d.ts +58 -0
  56. package/dist/code-agents/background-run.d.ts.map +1 -0
  57. package/dist/code-agents/background-run.js +58 -0
  58. package/dist/code-agents/background-run.js.map +1 -0
  59. package/dist/code-agents/index.d.ts +2 -0
  60. package/dist/code-agents/index.d.ts.map +1 -1
  61. package/dist/code-agents/index.js +2 -0
  62. package/dist/code-agents/index.js.map +1 -1
  63. package/dist/connections/index.d.ts +1 -0
  64. package/dist/connections/index.d.ts.map +1 -1
  65. package/dist/connections/index.js +1 -0
  66. package/dist/connections/index.js.map +1 -1
  67. package/dist/connections/reader.d.ts +248 -0
  68. package/dist/connections/reader.d.ts.map +1 -0
  69. package/dist/connections/reader.js +461 -0
  70. package/dist/connections/reader.js.map +1 -0
  71. package/dist/credentials/index.d.ts +11 -0
  72. package/dist/credentials/index.d.ts.map +1 -1
  73. package/dist/credentials/index.js +40 -15
  74. package/dist/credentials/index.js.map +1 -1
  75. package/dist/index.d.ts +2 -2
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +2 -2
  78. package/dist/index.js.map +1 -1
  79. package/dist/server/agent-chat-plugin.d.ts +18 -0
  80. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  81. package/dist/server/agent-chat-plugin.js +57 -9
  82. package/dist/server/agent-chat-plugin.js.map +1 -1
  83. package/dist/server/agent-teams.d.ts +66 -1
  84. package/dist/server/agent-teams.d.ts.map +1 -1
  85. package/dist/server/agent-teams.js +433 -16
  86. package/dist/server/agent-teams.js.map +1 -1
  87. package/dist/server/builder-browser.d.ts +11 -0
  88. package/dist/server/builder-browser.d.ts.map +1 -1
  89. package/dist/server/builder-browser.js +45 -0
  90. package/dist/server/builder-browser.js.map +1 -1
  91. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  92. package/dist/server/core-routes-plugin.js +25 -2
  93. package/dist/server/core-routes-plugin.js.map +1 -1
  94. package/dist/templates/workspace-root/AGENTS.md +5 -5
  95. package/dist/templates/workspace-root/README.md +1 -1
  96. package/dist/workspace-connections/credentials.d.ts +64 -0
  97. package/dist/workspace-connections/credentials.d.ts.map +1 -0
  98. package/dist/workspace-connections/credentials.js +378 -0
  99. package/dist/workspace-connections/credentials.js.map +1 -0
  100. package/dist/workspace-connections/index.d.ts +2 -1
  101. package/dist/workspace-connections/index.d.ts.map +1 -1
  102. package/dist/workspace-connections/index.js +2 -1
  103. package/dist/workspace-connections/index.js.map +1 -1
  104. package/dist/workspace-connections/store.d.ts +16 -0
  105. package/dist/workspace-connections/store.d.ts.map +1 -1
  106. package/dist/workspace-connections/store.js +57 -1
  107. package/dist/workspace-connections/store.js.map +1 -1
  108. package/docs/content/agent-teams.md +22 -5
  109. package/docs/content/cloneable-saas.md +2 -2
  110. package/docs/content/code-agents-ui.md +103 -3
  111. package/docs/content/creating-templates.md +16 -0
  112. package/docs/content/getting-started.md +40 -14
  113. package/docs/content/migration-workbench.md +25 -2
  114. package/docs/content/multi-app-workspace.md +1 -1
  115. package/docs/content/template-analytics.md +17 -1
  116. package/docs/content/template-brain.md +57 -28
  117. package/docs/content/template-dispatch.md +9 -2
  118. package/docs/content/workspace-connections.md +63 -14
  119. package/docs/content/workspace-management.md +9 -2
  120. package/docs/content/workspace.md +12 -5
  121. package/package.json +1 -1
  122. package/src/templates/workspace-root/AGENTS.md +5 -5
  123. package/src/templates/workspace-root/README.md +1 -1
@@ -5,14 +5,22 @@ description: "Build and customize Agent-Native Code surfaces with the shared UI
5
5
 
6
6
  # Agent-Native Code UI
7
7
 
8
- Agent-Native Code is the Agent-Native coding surface: a local Claude Code/Codex-style workspace for coding sessions, slash commands, migrations, audits, transcripts, and follow-ups.
8
+ Agent-Native Code is the Agent-Native coding surface: a local Claude Code/Codex-style workspace for coding sessions, slash commands, migrations, audits, transcripts, run controls, and follow-ups. A bare `npx @agent-native/core@latest` or installed `agent-native` command opens this workspace; `agent-native code` is the explicit subcommand for the same experience.
9
9
 
10
10
  There are three layers:
11
11
 
12
- - **CLI**: `npx @agent-native/core@latest code` starts and resumes runs.
13
- - **Desktop**: the left-sidebar Code surface adds native terminal launch, app webviews, and desktop deep links.
12
+ - **CLI**: `npx @agent-native/core@latest`, `agent-native`, and `agent-native code` start, resume, inspect, and stop runs.
13
+ - **Desktop**: the left-sidebar Code tab adds native terminal launch, app webviews, and desktop deep links while using the same run model.
14
14
  - **Shared UI**: `@agent-native/code-agents-ui` renders the reusable React surface.
15
15
 
16
+ The current split is intentionally converging: the standard agent sidebar and
17
+ Agent Teams run on the core `run-manager` lifecycle, while Agent-Native Code
18
+ uses local long-running sessions backed by the file-based Code run store and the
19
+ shared background-run controller vocabulary. New surfaces should build on the
20
+ shared background-run adapter/foundation instead of inventing another
21
+ lifecycle, so CLI, Desktop, background sessions, and sub-agents keep moving
22
+ toward one run model.
23
+
16
24
  The shared UI is host-driven. It does not know whether it is running in Electron, a browser template, or a future hosted shell. Hosts provide a `CodeAgentsHost` implementation.
17
25
 
18
26
  ```ts
@@ -37,6 +45,13 @@ export function CodeSurface() {
37
45
  }
38
46
  ```
39
47
 
48
+ Hosts can mix run sources in the same list. Local Agent-Native Code sessions
49
+ can appear next to Agent Teams or other background-run adapters as long as each
50
+ entry normalizes to `CodeAgentRun`. When a host supplies `sourceLabel`,
51
+ `source`, or `kind`, the hub renders a small source label such as "Local Code"
52
+ or "Agent Teams" in the run list and selected-session header. Omit those fields
53
+ for a single-source surface; the empty state and base layout stay unchanged.
54
+
40
55
  ## Desktop Host
41
56
 
42
57
  Desktop uses the shared UI but keeps privileged capabilities in Electron:
@@ -82,6 +97,79 @@ The template wraps the local run store through normal actions:
82
97
 
83
98
  It uses `@agent-native/core/code-agents`, which exposes the same file-backed run store and executor used by the CLI.
84
99
 
100
+ ## CLI Run Controls
101
+
102
+ The top-level CLI behaves like Claude Code or Codex:
103
+
104
+ ```bash
105
+ npx @agent-native/core@latest
106
+ agent-native
107
+ agent-native "fix the failing auth tests"
108
+ agent-native code
109
+ ```
110
+
111
+ Inside the framework checkout, use `pnpm dev:cli ...` to exercise the source
112
+ CLI before a build, for example `pnpm dev:cli --help` or
113
+ `pnpm dev:cli code goals`.
114
+
115
+ Use `agent-native code` when you want the explicit namespace. Built-in slash
116
+ goals and project commands can run inside the interactive workspace or directly
117
+ from the shell:
118
+
119
+ ```bash
120
+ agent-native code /migrate ./legacy-app --emit ./migration-dossier
121
+ agent-native code /audit --url https://example.com
122
+ agent-native code /release-check
123
+ ```
124
+
125
+ Project commands come from `.agents/commands/*.md`; project skills come from
126
+ `.agents/skills/*/SKILL.md`. The control commands operate on the same run
127
+ records that the Desktop Code tab and shared UI display:
128
+
129
+ ```bash
130
+ agent-native code list
131
+ agent-native code status --last
132
+ agent-native code attach --last
133
+ agent-native code logs --last
134
+ agent-native code resume --last
135
+ agent-native code stop --last
136
+ agent-native code ui
137
+ ```
138
+
139
+ `resume` appends context and continues a run, `status` reports the latest run
140
+ state, `stop` asks the active controller to halt work, and `ui` opens the local
141
+ Code surface. These are run controls, not a separate implementation path.
142
+
143
+ For cross-surface lists, dashboards, or monitoring panes, prefer the shared
144
+ background-run exports from `@agent-native/core/code-agents` over reading Code
145
+ run files directly. They normalize local Code sessions into the same vocabulary
146
+ used by hosted background work: run id, status, cwd, needs-input,
147
+ needs-approval, transcript events, and artifact root.
148
+
149
+ Hosted Agent Teams are also exposed from the agent chat route for browser
150
+ hosts that need a Code hub-compatible list without direct server imports:
151
+ `GET /_agent-native/agent-chat/runs/list?goalId=agent-team` returns
152
+ `{ status: "ok", goalId, runs }`, where each run includes `kind`,
153
+ `source`, `sourceLabel`, `status`, `title`, timestamps, and task metadata.
154
+ `GET /_agent-native/agent-chat/runs/:id/background-events` returns the
155
+ shared background transcript events for an Agent Teams run.
156
+
157
+ Adapter-backed hosts may also attach source metadata:
158
+
159
+ ```ts
160
+ {
161
+ id: run.id,
162
+ goalId: "task",
163
+ title: run.title,
164
+ source: "agent-teams",
165
+ sourceLabel: "Agent Teams",
166
+ kind: "background-run",
167
+ status: run.status,
168
+ createdAt: run.createdAt,
169
+ updatedAt: run.updatedAt,
170
+ }
171
+ ```
172
+
85
173
  ## Run Store
86
174
 
87
175
  Local Agent-Native Code runs are stored at:
@@ -170,6 +258,8 @@ Background coding-agent work should reuse the same harness as the rest of
170
258
  Agent-Native:
171
259
 
172
260
  - Use the Code run store/executor for local Code sessions.
261
+ - Use the shared background-run adapter/foundation when a surface needs to list,
262
+ inspect, or bridge local Code sessions alongside other background work.
173
263
  - Use core `run-manager` for hosted agent runs so streams, aborts, heartbeats,
174
264
  resumability, soft timeouts, and stuck-run cleanup behave consistently.
175
265
  - Use `agent-teams` / `spawnTask()` when the UI is delegating work to a
@@ -179,6 +269,11 @@ Do not add a parallel background-agent runner just because a new surface needs a
179
269
  different layout. Build a host adapter or UI slot on top of the shared harness
180
270
  instead.
181
271
 
272
+ Regression rule for new prompt or background surfaces: Code, Brain, and the
273
+ standard sidebar must keep using `PromptComposer` through the shared composer
274
+ stack, and background work must use the Code run store, the background-run
275
+ adapter, `run-manager`, or `agent-teams` rather than a bespoke queue/runner.
276
+
182
277
  ## Follow-Ups
183
278
 
184
279
  Follow-ups on active runs support two delivery modes:
@@ -188,6 +283,11 @@ Follow-ups on active runs support two delivery modes:
188
283
 
189
284
  Inactive runs keep the compatible behavior: the follow-up is appended and the run resumes immediately.
190
285
 
286
+ That gives Code the same user-facing two-way messaging shape as Agent Teams:
287
+ the user can keep talking to active work, but execution only consumes that
288
+ message at a safe continuation point. If a runner cannot steer immediately, it
289
+ must persist the follow-up as queued work rather than dropping or racing it.
290
+
191
291
  ## Remote Dispatch
192
292
 
193
293
  Desktop can expose the local Code Agent runner to a deployed Dispatch relay so a
@@ -364,3 +364,19 @@ Community templates can be created from a GitHub repo:
364
364
  ```bash
365
365
  pnpm dlx @agent-native/core create my-app --template github:user/repo
366
366
  ```
367
+
368
+ ## Test Unpublished Framework Changes {#test-unpublished-framework-changes}
369
+
370
+ When you are working inside the framework monorepo and need a generated
371
+ workspace to use unpublished package or template changes, run create with the
372
+ local-package flag:
373
+
374
+ ```bash
375
+ AGENT_NATIVE_CREATE_USE_LOCAL_CORE=1 pnpm --filter @agent-native/core create my-platform
376
+ ```
377
+
378
+ The generated workspace links the local `@agent-native/core` and
379
+ `@agent-native/dispatch` packages, so changes to Core APIs, Dispatch workspace
380
+ behavior, or first-party templates can be tested before publishing. The package
381
+ `prepack` scripts build `dist` before linking, which keeps the generated
382
+ workspace pointed at current build output.
@@ -30,6 +30,29 @@ The `create` command defaults to a workspace monorepo. It shows a multi-select p
30
30
 
31
31
  Open the URL the dev server prints. Workspace apps use app-specific ports, often `http://localhost:8080` or another 808x port; standalone apps usually use `http://localhost:3000`.
32
32
 
33
+ ### Testing local framework changes {#testing-local-framework-changes}
34
+
35
+ Framework contributors can scaffold against the current checkout instead of the
36
+ published packages:
37
+
38
+ ```bash
39
+ AGENT_NATIVE_CREATE_USE_LOCAL_CORE=1 pnpm --filter @agent-native/core create my-platform
40
+ ```
41
+
42
+ With that flag, generated workspaces link both the local `@agent-native/core`
43
+ and local `@agent-native/dispatch` packages. Use it when you need to verify
44
+ unpublished template or package changes end-to-end in a freshly generated
45
+ workspace. The packages run their `prepack` build first, so the linked packages
46
+ serve fresh `dist` output instead of stale build artifacts.
47
+
48
+ To exercise the repo-local CLI itself without building first, run it through
49
+ the root script:
50
+
51
+ ```bash
52
+ pnpm dev:cli --help
53
+ pnpm dev:cli code goals
54
+ ```
55
+
33
56
  ## Creating vs adding apps {#creating-vs-adding-apps}
34
57
 
35
58
  Run `create` from the folder where you want a brand-new workspace:
@@ -68,15 +91,18 @@ That parity between agent and UI is the whole point — see [What Is Agent-Nativ
68
91
 
69
92
  ## Try one concrete next step {#first-next-step}
70
93
 
71
- From here, use any AI coding tool (Claude Code, Cursor, Windsurf, Builder.io) to customize the app. The agent instructions in `AGENTS.md` are already set up so any tool understands the codebase.
94
+ From here, use any AI coding tool (Agent-Native Code, Claude Code, Cursor, Windsurf, Builder.io) to customize the app. The agent instructions in `AGENTS.md` are already set up so any tool understands the codebase.
72
95
 
73
96
  Good first moves:
74
97
 
98
+ - **Open Agent-Native Code** — run `npx @agent-native/core@latest` or `npx @agent-native/core@latest code` from the project. A bare command opens the local Claude Code/Codex-like workspace; a bare prompt such as `npx @agent-native/core@latest "rename the app"` starts a Code task directly.
75
99
  - **Ask the built-in agent what it sees** — open the agent panel and type "what app am I looking at, and what can you do here?" This verifies the app, UI state, and agent loop are all talking to each other.
76
100
  - **Make a tiny customization** — ask your coding tool to rename the app, change the first screen copy, or add one field to a form. It will read `AGENTS.md` for the framework conventions.
77
101
  - **Add another app to the same workspace** — use `npx @agent-native/core add-app` from inside the workspace folder. The command starts at `npx`.
78
102
  - **Single app instead of a monorepo?** Pass `--standalone` when creating: `npx @agent-native/core create my-app --standalone --template mail`.
79
103
 
104
+ Agent-Native Code understands built-in slash goals such as `/migrate` and `/audit`, plus project commands in `.agents/commands/*.md`. Use `agent-native code list`, `status`, `resume`, `stop`, or `ui` to inspect and control the same run from the CLI, the local UI, or the Desktop Code tab.
105
+
80
106
  ## Next docs to read {#next-docs}
81
107
 
82
108
  Once your app is running, the most useful follow-ups are:
@@ -91,19 +117,19 @@ Once your app is running, the most useful follow-ups are:
91
117
 
92
118
  Each template is a complete app with UI, agent actions, database schema, and AI instructions ready to go:
93
119
 
94
- | Template | Replaces |
95
- | ----------------------------------- | ------------------------------------------------ |
96
- | [Calendar](/templates/calendar) | Google Calendar, Calendly |
97
- | [Content](/templates/content) | Notion, Google Docs |
98
- | [Brain](/templates/brain) | Company chat, cited memory, and review queue |
99
- | [Slides](/templates/slides) | Google Slides, Pitch |
100
- | [Analytics](/templates/analytics) | Amplitude, Mixpanel, Looker |
101
- | [Mail](/templates/mail) | Superhuman, Gmail |
102
- | [Clips](/templates/clips) | Replaces Loom — screen + camera recording |
103
- | [Design](/templates/design) | HTML prototyping studios |
104
- | [Forms](/docs/template-forms) | Typeform |
105
- | [Dispatch](/docs/template-dispatch) | Workspace control plane — secrets, routing, jobs |
106
- | [Starter](/docs/template-starter) | Minimal scaffold — build from scratch |
120
+ | Template | Replaces |
121
+ | ----------------------------------- | ----------------------------------------------- |
122
+ | [Calendar](/templates/calendar) | Google Calendar, Calendly |
123
+ | [Content](/templates/content) | Notion, Google Docs |
124
+ | [Brain](/templates/brain) | Company chat with cited institutional memory |
125
+ | [Slides](/templates/slides) | Google Slides, Pitch |
126
+ | [Analytics](/templates/analytics) | Amplitude, Mixpanel, Looker |
127
+ | [Mail](/templates/mail) | Superhuman, Gmail |
128
+ | [Clips](/templates/clips) | Replaces Loom — screen + camera recording |
129
+ | [Design](/templates/design) | HTML prototyping studios |
130
+ | [Forms](/docs/template-forms) | Typeform |
131
+ | [Dispatch](/docs/template-dispatch) | Workspace control plane — integrations, routing |
132
+ | [Starter](/docs/template-starter) | Minimal scaffold — build from scratch |
107
133
 
108
134
  Browse the [template gallery](/templates) for live demos, or see [Templates](/docs/cloneable-saas) for the full list and the clone → customize → deploy flow.
109
135
 
@@ -18,6 +18,12 @@ npx @agent-native/core@latest code /migrate ./my-next-app --out ../migrated-app
18
18
 
19
19
  **Agent-Native Code** is the open-source Claude Code/Codex-like workspace for coding work in Agent-Native. `agent-native` or `agent-native code` launches it with no prompt required, and a bare prompt starts a generic coding task directly. `/migrate` is one built-in capability for moving an existing app, URL, or described product into agent-native. It uses the same session store, transcript, and desktop hub as the CLI `code` command, so migration behaves like a goal you can resume, attach to, inspect, and stop rather than a separate one-off product.
20
20
 
21
+ That session store is local and long-running by design. It is separate from the
22
+ hosted agent sidebar and Agent Teams `run-manager` lifecycle today, but new
23
+ surfaces should bridge through the shared background-run foundation so Code,
24
+ sidebar, Brain, and Agent Teams continue converging on one lifecycle instead of
25
+ growing parallel runners.
26
+
21
27
  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 is now a legacy/internal detail surface, available with `--app-surface` when a run needs a richer assessment/approval/task/verifier dashboard.
22
28
 
23
29
  The direct `migrate` command remains a shortcut into the same goal:
@@ -68,11 +74,11 @@ npx @agent-native/core@latest code /audit --url https://example.com
68
74
 
69
75
  Run `agent-native code goals` to see the goals registered in your checkout. A bare prompt starts a local coding-agent session for open-ended code work, streams the run, records transcript/status/tool events, and accepts follow-up prompts through the same run record.
70
76
 
71
- Bare `agent-native` launches the Agent-Native Code workspace in this branch, and `agent-native "prompt"` starts a generic Agent-Native Code task directly, matching the Codex/Claude Code habit of treating unknown text as a coding prompt. If an installed version does not include that top-level entrypoint yet, run `agent-native code` directly.
77
+ Installed `agent-native` with no arguments launches the Agent-Native Code workspace, and `agent-native "prompt"` starts a generic Agent-Native Code task directly. Use `agent-native create` when you want to scaffold apps or workspaces.
72
78
 
73
79
  ## Sessions and Modes
74
80
 
75
- The next Agent-Native Code follow-up features make the workspace feel like a local Codex/Claude Code session manager instead of a one-shot command. The CLI and Desktop hub share the same run store, so you can start work in one place and continue it in the other:
81
+ Agent-Native Code makes migration feel like a local Codex/Claude Code session instead of a one-shot command. The CLI and Desktop hub share the same run store, so you can start work in one place and continue it in the other:
76
82
 
77
83
  ```bash
78
84
  npx @agent-native/core@latest code list
@@ -85,6 +91,18 @@ npx @agent-native/core@latest code resume --last "check the auth edge cases next
85
91
 
86
92
  `list` shows previous and active sessions for the current workspace. `attach` follows a live transcript. `logs` prints the transcript once. `resume` reopens a session with its prior context, and a quoted resume prompt records the next instruction against that same run. If a high-risk command pauses for approval, `approve --last` runs that one pending command and then points you back to resume the session. Desktop adds the visual session picker on top of the same data: choose a run, inspect status and tool events, then attach, resume, stop, or open the run workspace.
87
93
 
94
+ The same hub can display mixed background-run sources. Local Agent-Native Code
95
+ runs are available today through the file-backed Code run store, and Agent Teams
96
+ or other hosted background work can appear through adapters that normalize their
97
+ runs to the Code hub contract. Adapters should provide a subtle `sourceLabel`,
98
+ `source`, or `kind` when the list mixes sources, so users can distinguish "Local
99
+ Code" from "Agent Teams" without turning the session picker into a dashboard.
100
+
101
+ Follow-up prompts have two-way messaging semantics. Active runs can receive
102
+ steering prompts at the next safe continuation point, while queued follow-ups
103
+ run after the current turn completes. If a host cannot apply a message
104
+ immediately, it should persist it as queued work and continue safely.
105
+
88
106
  Run modes make editing policy explicit per session:
89
107
 
90
108
  | Mode | CLI flag | Behavior |
@@ -211,6 +229,11 @@ npx @agent-native/core@latest code /audit --url https://example.com
211
229
 
212
230
  The hub exposes the same generic run controls the CLI does: the session picker opens past runs, `resume` opens the goal surface or reattaches to the run, a quoted resume prompt records and executes follow-up feedback for executable goals, status refreshes the run list, and stop reports or stops the owning process when one is known. Browser/Desktop approval remains the trust gate for generated output writes. Future coding goals can reuse the same CLI and desktop shell by registering another slash goal or a project command under `.agents/commands/*.md`.
213
231
 
232
+ Implementation note: any prompt entry for Code, Brain, or the standard agent
233
+ sidebar should use the shared `PromptComposer` stack. Any background coding or
234
+ sub-agent work should use the Code run store, shared background-run adapter,
235
+ `run-manager`, or Agent Teams primitives rather than a template-specific runner.
236
+
214
237
  ## Emit Mode
215
238
 
216
239
  Use `--emit` when you want Codex, Claude Code, another code agent, or Agent-Native Desktop to do the next phase without opening the internal run surface:
@@ -31,7 +31,7 @@ Anything every app in your org should agree on can live in `packages/shared`:
31
31
 
32
32
  Each individual app becomes _just a set of screens_ — routes, dashboards, views, domain-specific actions. Framework defaults cover the rest until you add a real workspace customization.
33
33
 
34
- That same boundary applies when your app wants to use another first-party app. A new workspace dashboard that needs email, calendar, and analytics context should use the existing Mail, Calendar, and Analytics apps as connected neighbors over links or A2A. It should not clone those templates, create a wrapper app that nests them, or scaffold child apps inside itself just to get access to their data or agents. For example, the hosted first-party apps already live at [mail.agent-native.com](https://mail.agent-native.com), [calendar.agent-native.com](https://calendar.agent-native.com), and [analytics.agent-native.com](https://analytics.agent-native.com). Fork or scaffold a copy only when you explicitly want to customize that app; otherwise, using the hosted/shared app keeps base template improvements flowing automatically.
34
+ That same boundary applies when your app wants to use another first-party app. A new workspace dashboard that needs email, calendar, analytics, and company-memory context should use the existing Mail, Calendar, Analytics, and Brain apps as connected neighbors over links or A2A. It should not clone those templates, create a wrapper app that nests them, or scaffold child apps inside itself just to get access to their data or agents. For example, the hosted first-party apps already live at [mail.agent-native.com](https://mail.agent-native.com), [calendar.agent-native.com](https://calendar.agent-native.com), [analytics.agent-native.com](https://analytics.agent-native.com), and [brain.agent-native.com](https://brain.agent-native.com). Fork or scaffold a copy only when you explicitly want to customize that app; otherwise, using the hosted/shared app keeps base template improvements flowing automatically.
35
35
 
36
36
  ## Getting started {#getting-started}
37
37
 
@@ -27,6 +27,10 @@ It's an open-source replacement for Amplitude, Mixpanel, and Looker — for team
27
27
  - **Maintain a living data dictionary** of metrics, tables, and SQL recipes so the agent uses the right column names every time (no more guessed `is_closed` when it's actually `hs_is_closed`).
28
28
  - **Share dashboards** with your team — private by default, shareable per-user or per-org with viewer / editor / admin roles.
29
29
  - **Connect to many sources** out of the box: BigQuery, GA4, Mixpanel, Amplitude, PostHog, HubSpot, Jira, Apollo, Pylon, Gong, Common Room, Twitter, plus app-specific SEO sources.
30
+ - **Reuse workspace integrations** when a workspace has already connected and
31
+ granted a provider to Analytics. The shared integration stores provider
32
+ identity and credential refs; Analytics keeps app-specific source selection,
33
+ data dictionary entries, dashboard SQL, and analysis history.
30
34
 
31
35
  ## Getting started
32
36
 
@@ -143,7 +147,19 @@ Every BigQuery panel's SQL is dry-run against the warehouse before the dashboard
143
147
 
144
148
  ### Connecting data sources
145
149
 
146
- Open the **Data Sources** page (`/data-sources`) to connect providers. Each source exposes an env-key list, a walkthrough, and a **Test Connection** button. The page calls `/api/credential-status`, `/api/credentials`, and `/api/test-connection`.
150
+ Open the **Data Sources** page (`/data-sources`) to connect providers. Each
151
+ source exposes an env-key list, a walkthrough, and a **Test Connection** button.
152
+ When Analytics is running in a workspace, `data-source-status` also reports
153
+ granted reusable workspace connections for `appId=analytics` so the agent can
154
+ ask for an app grant instead of another copy of the same provider key.
155
+ For reusable providers such as Slack, HubSpot, Notion, and GitHub, the Data
156
+ Sources UI shows the shared integration state directly: ready via workspace,
157
+ needs grant, needs credentials, or local credentials.
158
+
159
+ Reusable workspace integrations are the runtime direction for shared providers:
160
+ the framework stores provider identity, account metadata, credential refs, and
161
+ per-app grants once; Analytics stores data-source interpretation, source of
162
+ truth choices, metric definitions, dashboards, and analyses.
147
163
 
148
164
  Credentials are stored via the framework's settings/env layer — no secrets in git. Production requires:
149
165
 
@@ -1,46 +1,50 @@
1
1
  ---
2
2
  title: "Brain"
3
- description: "A public first-party template for cited company memory, reviewable source ingestion, and the path toward universal workspace search."
3
+ description: "Clean company chat backed by cited institutional memory, reviewable source ingestion, and reusable workspace integrations."
4
4
  ---
5
5
 
6
6
  # Brain
7
7
 
8
- Brain is a public first-party template for Company Brain: cited institutional
9
- memory that agents and humans can search without pretending raw workplace data
10
- is already clean, complete, or safe to publish. The first-run surface is a
11
- full-page company chat with demo and eval controls, source health, review
12
- counts, and cited answers from approved company knowledge.
8
+ Brain is clean company chat backed by cited institutional memory. People ask
9
+ plain-English questions; Brain answers from approved company knowledge with
10
+ links back to the Slack thread, meeting, transcript, issue, or webhook capture
11
+ that supports the answer.
13
12
 
14
13
  Brain ingests approved Slack channels, Clips recordings, Granola Team-space
15
14
  notes, GitHub issues/PRs, and generic transcript/webhook payloads. It stores raw
16
15
  captures, distills durable facts/decisions/processes, and routes sensitive or
17
16
  low-confidence memories through review before they become company knowledge.
18
17
 
18
+ The product surface stays simple on purpose: **Ask** is the primary chat
19
+ experience, while **Sources**, **Review**, and **Knowledge** are admin/support
20
+ surfaces for connecting data, approving proposals, and inspecting cited memory.
21
+
19
22
  Use Brain when your team wants agents to answer questions like "why did we make
20
23
  this product decision?", "how does this in-development feature work?", or "what
21
24
  changed in this process?" with links back to the source conversation, meeting,
22
25
  or issue.
23
26
 
24
27
  Brain is intentionally on an open-source, Glean-shaped path, but it is not a
25
- complete Glean replacement today. V1 is cited company memory over reviewed
26
- knowledge. V1.5 adds universal Brain search across knowledge, captures, and
27
- sources, plus reusable workspace connections for source credentials. V2 points
28
- toward federated app/source search, permission-aware result filtering, ranking,
29
- and an expertise graph as a future platform layer.
28
+ complete Glean replacement today. V1 is company chat plus cited memory over
29
+ reviewed knowledge. V1.5 adds Brain-wide search across knowledge,
30
+ captures, and sources, plus reusable workspace connections for source
31
+ credentials. V2 points toward federated app/source search, permission-aware
32
+ result filtering, ranking, and an expertise graph as a future platform layer.
30
33
 
31
34
  ## What It Includes
32
35
 
33
- - **Full-page company chat.** The Ask route is the main product surface. It
34
- shows a compact demo CTA, source health, review count, and suggested
35
- company-memory questions. It uses `AgentChatSurface`, so the Brain composer
36
- stays on the same shared chat input stack as the agent sidebar and
36
+ - **Full-page company chat.** The Ask route is the main product surface: a
37
+ clean chat over cited company memory with source health, review count, and
38
+ suggested questions kept secondary. It uses `AgentChatSurface`, so the Brain
39
+ composer stays on the same shared chat input stack as the agent sidebar and
37
40
  Agent-Native Code.
38
41
  - **Repeatable demo flow.** Load a product-decision corpus, run the demo eval,
39
42
  ask a cited question immediately, then continue into Review or Knowledge so a
40
43
  new workspace can see the trust loop before connecting real sources.
41
44
  - **Approved sources.** Configure manual, generic webhook, Clips, Slack,
42
- Granola, and GitHub source records. Slack is channel-oriented by design; DMs
43
- and MPIMs are not scan targets.
45
+ Granola, and GitHub source records. Sources are org-shared by default so the
46
+ company memory is useful to the whole workspace. Slack is channel-oriented by
47
+ design; DMs and MPIMs are not scan targets.
44
48
  - **Raw captures.** Store transcripts, channel exports, notes, and webhook imports in portable SQL with dedupe keys and source metadata.
45
49
  - **Distilled knowledge.** Write atomic entries with kind, topic, entities, confidence, exact evidence quotes, and supersede links.
46
50
  - **Review queue.** Proposed company memories have a first-class Review route
@@ -54,8 +58,12 @@ and an expertise graph as a future platform layer.
54
58
  records together, then drilling into `get-knowledge` / `get-capture`.
55
59
  - **Pilot and Ops controls.** Slack pilots stay bounded by default, `get-pilot-report` summarizes source quality without raw bodies, and the Ops route tracks stale or failed distillation queue items with safe retry controls.
56
60
  - **Shared integrations.** The Sources page shows Brain source records beside
57
- reusable workspace connection grants and provider readiness, so Brain can use
58
- Dispatch/workspace-managed credentials when a grant exists.
61
+ reusable workspace connection grants and provider readiness. Reusable
62
+ integrations own provider identity, credential references, and app grants;
63
+ Brain sources own app-specific choices such as channels, repositories,
64
+ cursors, review posture, and distillation state. The provider-reader runtime
65
+ gives shared provider search/get contracts; live provider API calls stay
66
+ template-owned unless a reader is explicitly promoted to shared.
59
67
  - **Ambient context.** Canonical approved entries can mirror into workspace
60
68
  resources under `context/company-brain/...` for cross-app context. The Review
61
69
  route exposes this as a per-proposal switch; the Knowledge route can publish
@@ -65,9 +73,10 @@ and an expertise graph as a future platform layer.
65
73
 
66
74
  Brain intentionally uses SQL text search and agentic query expansion for v1.
67
75
  There is no vector database requirement, so the template stays portable across
68
- SQLite, Postgres, Neon, D1, Turso, and similar hosts. Raw capture content is
69
- redacted by default in review/search surfaces; editor-authorized distillation
70
- can request exact raw text for quote validation.
76
+ SQLite, Postgres, Neon, D1, Turso, and similar hosts. Privacy is handled with
77
+ source allow-lists, personal-source exclusions, redaction, and review gates.
78
+ Raw capture content is redacted by default in review/search surfaces;
79
+ editor-authorized distillation can request exact raw text for quote validation.
71
80
 
72
81
  ## Search Model
73
82
 
@@ -76,17 +85,28 @@ Brain search has three layers:
76
85
  - **V1 Company Brain search:** answer from reviewed, distilled knowledge first.
77
86
  This is the trust layer for decisions, policies, product facts, processes,
78
87
  and durable summaries.
79
- - **V1.5 universal Brain search:** use `search-everything` as the broad first
88
+ - **V1.5 Brain-wide search:** use `search-everything` as the broad first
80
89
  pass across knowledge, raw captures, and sources. Then call `get-knowledge`
81
90
  for reviewed entries or `get-capture` for exact source context and links.
91
+ The action also returns `federatedCoverage`: Brain source/provider coverage,
92
+ reusable workspace connection readiness, compact discovered agent metadata
93
+ when available, and deterministic hints for which specialist app the agent
94
+ should ask next.
82
95
  - **V2 federated workspace search:** reuse workspace connections and search
83
96
  across apps/sources with permission-aware result filtering and ranking. The
84
- expertise graph belongs to this future/platform layer.
97
+ expertise graph belongs to this future/platform layer. V1.5 does not directly
98
+ read sibling app databases; cross-app work is delegated from the agent loop
99
+ with `call-agent`.
85
100
 
86
101
  Agents should cite evidence links or source URLs whenever available. If Brain
87
102
  does not return support for a question, the agent should report that honestly
88
103
  instead of implying the company memory contains an answer.
89
104
 
105
+ Use `federatedCoverage.delegationHints` as routing guidance, not as retrieved
106
+ evidence: Analytics owns dashboards/metrics, Mail/Gmail owns mailbox-native
107
+ search, and Dispatch owns workspace resources, provider grants, approvals,
108
+ secrets, recurring jobs, and cross-app routing.
109
+
90
110
  ## Brain vs Dispatch
91
111
 
92
112
  Brain and Dispatch are complementary, but they do different jobs:
@@ -95,12 +115,19 @@ Brain and Dispatch are complementary, but they do different jobs:
95
115
  distills durable facts/decisions/processes, answers from cited evidence, and
96
116
  exposes approved knowledge to agents.
97
117
  - **Dispatch owns the workspace control plane.** It centralizes messaging,
98
- secrets, recurring jobs, approvals, A2A orchestration, and workspace-wide
99
- resources.
118
+ secrets, recurring jobs, approvals, A2A orchestration, and the distribution
119
+ and approval of workspace-wide resources.
100
120
 
101
121
  In a multi-app workspace, Dispatch can route a question to Brain over A2A and
102
122
  can grant Brain shared provider credentials. Brain remains the specialist for
103
123
  approved source ingestion, review, retrieval, and cited Company Brain answers.
124
+ Brain exposes read-only, citation-backed retrieval as its public A2A capability
125
+ so Dispatch and sibling apps can ask company-memory questions. That is not
126
+ anonymous data access: the A2A agent card is public discovery metadata, while
127
+ retrieval still happens inside Brain's authenticated action surface. Callers
128
+ ask over A2A, then Brain uses `ask-brain`, `search-everything`,
129
+ `get-knowledge`, and `get-capture` with its normal review, redaction, citation,
130
+ and source-access rules.
104
131
 
105
132
  ## Scaffolding
106
133
 
@@ -327,8 +354,10 @@ Brain access instead of copying the same secret into a Brain-specific setting.
327
354
 
328
355
  Keep the ownership model simple:
329
356
 
330
- - Dispatch or the workspace layer owns provider account metadata, credential
331
- ref names, and app grants.
357
+ - Reusable workspace integrations own provider identity, account metadata,
358
+ credential ref names, and app grants.
359
+ - Dispatch is the workspace control plane where admins usually connect, repair,
360
+ and grant those integrations.
332
361
  - The vault owns the secret values.
333
362
  - Brain owns source-local choices such as Slack channels, GitHub repositories,
334
363
  Granola polling windows, cursors, review posture, and distillation status.
@@ -7,7 +7,7 @@ description: "Dispatch is the workspace control plane — central inbox, cross-a
7
7
 
8
8
  > **See also:** for the conceptual overview of what Dispatch does and when you want it, see [Dispatch](/docs/dispatch). This page is the template-specific reference.
9
9
 
10
- Dispatch is the **workspace control plane**. Where other templates are domain apps (Mail, Calendar, Analytics), Dispatch is the app you run _alongside_ them to coordinate everything: a central inbox, a secrets vault, scheduled jobs, Slack/Telegram integration, and an orchestrator agent that delegates domain work to the right specialist app over [A2A](/docs/a2a-protocol).
10
+ Dispatch is the **workspace control plane**. Where other templates are domain apps (Mail, Calendar, Analytics, Brain), Dispatch is the app you run _alongside_ them to coordinate everything: a central inbox, a secrets vault, scheduled jobs, Slack/Telegram integration, and an orchestrator agent that delegates domain work to the right specialist app over [A2A](/docs/a2a-protocol).
11
11
 
12
12
  <!-- screenshot:
13
13
  app: dispatch
@@ -27,7 +27,10 @@ If you're running an [multi-app workspace](/docs/multi-app-workspace) with many
27
27
  - **Orchestrator, not specialist.** Dispatch does _not_ try to be the email app or the analytics app. When someone asks "summarize last week's signups," Dispatch calls the analytics agent over A2A and returns the answer. When someone asks "draft a reply to Alice," Dispatch calls the mail agent.
28
28
  - **Secrets vault.** A central store for API keys, OAuth tokens, and shared credentials. Apps in the workspace resolve secrets from Dispatch instead of duplicating them in every `.env`. Requests + approvals for sensitive access.
29
29
  - **Workspace resources.** Global skills, guardrail instructions, custom agent profiles, and reference resources can be created once in Dispatch. All-app resources are inherited at runtime by every app with no copy or manual sync step; selected grants are for app-specific exceptions.
30
- - **Integrations catalog.** One page showing every third-party integration — Slack, Telegram, SendGrid, Apollo, etc. — with a "configured / not configured / pending approval" status per app.
30
+ - **Reusable integrations.** One place to connect provider accounts, track
31
+ credential refs, and grant apps access. Dispatch owns provider identity and
32
+ app grants; domain apps still own app-specific source choices such as Brain's
33
+ Slack channel allow-list or Analytics' metric/dashboard configuration.
31
34
  - **Scheduled jobs hub.** Cross-app [recurring jobs](/docs/recurring-jobs) live here: "every weekday at 7, pull yesterday's key metrics from analytics and draft a morning summary email."
32
35
  - **Dreams.** Dispatch can review recent agent runs, failures, feedback, and successful patterns to propose memory, skill, job, and instruction improvements before anything durable is applied.
33
36
  - **Approval flow.** Destructive or external actions (sending money, shipping an outbound email, posting to Slack at scale) can require an admin OK before they fire. Dispatch owns the queue.
@@ -49,6 +52,10 @@ Day-to-day, Dispatch is the place admins and ops folks open to keep the workspac
49
52
 
50
53
  - **Connect Slack, email, and Telegram** so people can message your agent from wherever they already work. See [Messaging](/docs/messaging) for the wiring steps.
51
54
  - **Save shared secrets once.** API keys, OAuth tokens, and service credentials live in the vault and the other apps in your workspace pull from there instead of every team member juggling their own `.env`.
55
+ - **Connect providers once.** Reusable integrations store safe account metadata
56
+ and credential references, then grant apps such as Brain, Analytics, Mail, or
57
+ Dispatch access without copying raw secrets. App-specific source
58
+ configuration stays in the app that uses the provider.
52
59
  - **Keep company context global.** Put personas, positioning, messaging, company facts, brand guidelines, and guardrails in Dispatch Resources once, then preview the effective workspace -> app/org -> personal stack for any app/user or inspect the stack from an app card's Context view.
53
60
  - **Set up recurring jobs.** "Every Monday at 7am, ask the analytics agent for last week's signups and email me a summary." See [Recurring Jobs](/docs/recurring-jobs).
54
61
  - **Review dream proposals.** Dispatch Dreams inspect prior agent runs and create source-backed proposals for what the workspace should remember, which stale notes should be cleaned up, and which repeated lessons should become skills or jobs.