@agent-native/core 0.26.9 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/agent/run-ownership.d.ts +12 -0
  2. package/dist/agent/run-ownership.d.ts.map +1 -0
  3. package/dist/agent/run-ownership.js +39 -0
  4. package/dist/agent/run-ownership.js.map +1 -0
  5. package/dist/client/AgentPanel.d.ts.map +1 -1
  6. package/dist/client/AgentPanel.js +1 -0
  7. package/dist/client/AgentPanel.js.map +1 -1
  8. package/dist/client/AssistantChat.d.ts.map +1 -1
  9. package/dist/client/AssistantChat.js +9 -6
  10. package/dist/client/AssistantChat.js.map +1 -1
  11. package/dist/client/db-admin/DataGrid.d.ts +42 -0
  12. package/dist/client/db-admin/DataGrid.d.ts.map +1 -0
  13. package/dist/client/db-admin/DataGrid.js +204 -0
  14. package/dist/client/db-admin/DataGrid.js.map +1 -0
  15. package/dist/client/db-admin/DbAdminPage.d.ts +2 -0
  16. package/dist/client/db-admin/DbAdminPage.d.ts.map +1 -0
  17. package/dist/client/db-admin/DbAdminPage.js +72 -0
  18. package/dist/client/db-admin/DbAdminPage.js.map +1 -0
  19. package/dist/client/db-admin/DevDatabaseLink.d.ts +19 -0
  20. package/dist/client/db-admin/DevDatabaseLink.d.ts.map +1 -0
  21. package/dist/client/db-admin/DevDatabaseLink.js +25 -0
  22. package/dist/client/db-admin/DevDatabaseLink.js.map +1 -0
  23. package/dist/client/db-admin/EditableCell.d.ts +26 -0
  24. package/dist/client/db-admin/EditableCell.d.ts.map +1 -0
  25. package/dist/client/db-admin/EditableCell.js +150 -0
  26. package/dist/client/db-admin/EditableCell.js.map +1 -0
  27. package/dist/client/db-admin/FilterBar.d.ts +8 -0
  28. package/dist/client/db-admin/FilterBar.d.ts.map +1 -0
  29. package/dist/client/db-admin/FilterBar.js +68 -0
  30. package/dist/client/db-admin/FilterBar.js.map +1 -0
  31. package/dist/client/db-admin/ResultsGrid.d.ts +6 -0
  32. package/dist/client/db-admin/ResultsGrid.d.ts.map +1 -0
  33. package/dist/client/db-admin/ResultsGrid.js +41 -0
  34. package/dist/client/db-admin/ResultsGrid.js.map +1 -0
  35. package/dist/client/db-admin/RowSidePanel.d.ts +18 -0
  36. package/dist/client/db-admin/RowSidePanel.d.ts.map +1 -0
  37. package/dist/client/db-admin/RowSidePanel.js +104 -0
  38. package/dist/client/db-admin/RowSidePanel.js.map +1 -0
  39. package/dist/client/db-admin/SqlEditor.d.ts +8 -0
  40. package/dist/client/db-admin/SqlEditor.d.ts.map +1 -0
  41. package/dist/client/db-admin/SqlEditor.js +350 -0
  42. package/dist/client/db-admin/SqlEditor.js.map +1 -0
  43. package/dist/client/db-admin/TableBrowser.d.ts +10 -0
  44. package/dist/client/db-admin/TableBrowser.d.ts.map +1 -0
  45. package/dist/client/db-admin/TableBrowser.js +61 -0
  46. package/dist/client/db-admin/TableBrowser.js.map +1 -0
  47. package/dist/client/db-admin/TableEditor.d.ts +9 -0
  48. package/dist/client/db-admin/TableEditor.d.ts.map +1 -0
  49. package/dist/client/db-admin/TableEditor.js +254 -0
  50. package/dist/client/db-admin/TableEditor.js.map +1 -0
  51. package/dist/client/db-admin/cell-format.d.ts +55 -0
  52. package/dist/client/db-admin/cell-format.d.ts.map +1 -0
  53. package/dist/client/db-admin/cell-format.js +223 -0
  54. package/dist/client/db-admin/cell-format.js.map +1 -0
  55. package/dist/client/db-admin/changeset.d.ts +74 -0
  56. package/dist/client/db-admin/changeset.d.ts.map +1 -0
  57. package/dist/client/db-admin/changeset.js +169 -0
  58. package/dist/client/db-admin/changeset.js.map +1 -0
  59. package/dist/client/db-admin/export-utils.d.ts +15 -0
  60. package/dist/client/db-admin/export-utils.d.ts.map +1 -0
  61. package/dist/client/db-admin/export-utils.js +62 -0
  62. package/dist/client/db-admin/export-utils.js.map +1 -0
  63. package/dist/client/db-admin/index.d.ts +7 -0
  64. package/dist/client/db-admin/index.d.ts.map +1 -0
  65. package/dist/client/db-admin/index.js +8 -0
  66. package/dist/client/db-admin/index.js.map +1 -0
  67. package/dist/client/db-admin/sql-storage.d.ts +35 -0
  68. package/dist/client/db-admin/sql-storage.d.ts.map +1 -0
  69. package/dist/client/db-admin/sql-storage.js +117 -0
  70. package/dist/client/db-admin/sql-storage.js.map +1 -0
  71. package/dist/client/db-admin/storage.d.ts +24 -0
  72. package/dist/client/db-admin/storage.d.ts.map +1 -0
  73. package/dist/client/db-admin/storage.js +50 -0
  74. package/dist/client/db-admin/storage.js.map +1 -0
  75. package/dist/client/db-admin/useAgentSync.d.ts +22 -0
  76. package/dist/client/db-admin/useAgentSync.d.ts.map +1 -0
  77. package/dist/client/db-admin/useAgentSync.js +120 -0
  78. package/dist/client/db-admin/useAgentSync.js.map +1 -0
  79. package/dist/client/db-admin/useDbAdmin.d.ts +20 -0
  80. package/dist/client/db-admin/useDbAdmin.d.ts.map +1 -0
  81. package/dist/client/db-admin/useDbAdmin.js +154 -0
  82. package/dist/client/db-admin/useDbAdmin.js.map +1 -0
  83. package/dist/client/index.d.ts +2 -1
  84. package/dist/client/index.d.ts.map +1 -1
  85. package/dist/client/index.js +2 -1
  86. package/dist/client/index.js.map +1 -1
  87. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  88. package/dist/client/settings/SettingsPanel.js +8 -4
  89. package/dist/client/settings/SettingsPanel.js.map +1 -1
  90. package/dist/client/use-dev-mode.d.ts +20 -2
  91. package/dist/client/use-dev-mode.d.ts.map +1 -1
  92. package/dist/client/use-dev-mode.js +49 -14
  93. package/dist/client/use-dev-mode.js.map +1 -1
  94. package/dist/credentials/index.d.ts.map +1 -1
  95. package/dist/credentials/index.js +25 -5
  96. package/dist/credentials/index.js.map +1 -1
  97. package/dist/db-admin/agent-tools.d.ts +15 -0
  98. package/dist/db-admin/agent-tools.d.ts.map +1 -0
  99. package/dist/db-admin/agent-tools.js +147 -0
  100. package/dist/db-admin/agent-tools.js.map +1 -0
  101. package/dist/db-admin/operations.d.ts +17 -0
  102. package/dist/db-admin/operations.d.ts.map +1 -0
  103. package/dist/db-admin/operations.js +541 -0
  104. package/dist/db-admin/operations.js.map +1 -0
  105. package/dist/db-admin/routes.d.ts +5 -0
  106. package/dist/db-admin/routes.d.ts.map +1 -0
  107. package/dist/db-admin/routes.js +134 -0
  108. package/dist/db-admin/routes.js.map +1 -0
  109. package/dist/db-admin/types.d.ts +85 -0
  110. package/dist/db-admin/types.d.ts.map +1 -0
  111. package/dist/db-admin/types.js +9 -0
  112. package/dist/db-admin/types.js.map +1 -0
  113. package/dist/extensions/url-safety.d.ts +20 -0
  114. package/dist/extensions/url-safety.d.ts.map +1 -1
  115. package/dist/extensions/url-safety.js +43 -0
  116. package/dist/extensions/url-safety.js.map +1 -1
  117. package/dist/file-upload/actions/upload-image.d.ts.map +1 -1
  118. package/dist/file-upload/actions/upload-image.js +6 -1
  119. package/dist/file-upload/actions/upload-image.js.map +1 -1
  120. package/dist/integrations/adapters/email.d.ts.map +1 -1
  121. package/dist/integrations/adapters/email.js +112 -0
  122. package/dist/integrations/adapters/email.js.map +1 -1
  123. package/dist/integrations/types.d.ts +11 -0
  124. package/dist/integrations/types.d.ts.map +1 -1
  125. package/dist/integrations/types.js.map +1 -1
  126. package/dist/scripts/db/exec.d.ts.map +1 -1
  127. package/dist/scripts/db/exec.js +2 -1
  128. package/dist/scripts/db/exec.js.map +1 -1
  129. package/dist/scripts/db/index.d.ts.map +1 -1
  130. package/dist/scripts/db/index.js +1 -0
  131. package/dist/scripts/db/index.js.map +1 -1
  132. package/dist/scripts/db/migrate-encrypt-credentials.d.ts +28 -0
  133. package/dist/scripts/db/migrate-encrypt-credentials.d.ts.map +1 -0
  134. package/dist/scripts/db/migrate-encrypt-credentials.js +190 -0
  135. package/dist/scripts/db/migrate-encrypt-credentials.js.map +1 -0
  136. package/dist/scripts/db/query.d.ts.map +1 -1
  137. package/dist/scripts/db/query.js +2 -1
  138. package/dist/scripts/db/query.js.map +1 -1
  139. package/dist/scripts/db/safety.d.ts +1 -0
  140. package/dist/scripts/db/safety.d.ts.map +1 -1
  141. package/dist/scripts/db/safety.js +32 -0
  142. package/dist/scripts/db/safety.js.map +1 -1
  143. package/dist/scripts/db/scoping.d.ts.map +1 -1
  144. package/dist/scripts/db/scoping.js +11 -1
  145. package/dist/scripts/db/scoping.js.map +1 -1
  146. package/dist/secrets/crypto.d.ts +28 -0
  147. package/dist/secrets/crypto.d.ts.map +1 -0
  148. package/dist/secrets/crypto.js +81 -0
  149. package/dist/secrets/crypto.js.map +1 -0
  150. package/dist/secrets/storage.d.ts.map +1 -1
  151. package/dist/secrets/storage.js +3 -61
  152. package/dist/secrets/storage.js.map +1 -1
  153. package/dist/server/action-discovery.d.ts.map +1 -1
  154. package/dist/server/action-discovery.js +5 -2
  155. package/dist/server/action-discovery.js.map +1 -1
  156. package/dist/server/action-routes.d.ts.map +1 -1
  157. package/dist/server/action-routes.js +24 -7
  158. package/dist/server/action-routes.js.map +1 -1
  159. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  160. package/dist/server/agent-chat-plugin.js +49 -2
  161. package/dist/server/agent-chat-plugin.js.map +1 -1
  162. package/dist/server/auth.d.ts +1 -1
  163. package/dist/server/auth.d.ts.map +1 -1
  164. package/dist/server/auth.js.map +1 -1
  165. package/dist/server/better-auth-instance.js +3 -3
  166. package/dist/server/better-auth-instance.js.map +1 -1
  167. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  168. package/dist/server/core-routes-plugin.js +5 -0
  169. package/dist/server/core-routes-plugin.js.map +1 -1
  170. package/dist/server/csrf.d.ts.map +1 -1
  171. package/dist/server/csrf.js +9 -1
  172. package/dist/server/csrf.js.map +1 -1
  173. package/dist/server/design-token-utils.d.ts +8 -1
  174. package/dist/server/design-token-utils.d.ts.map +1 -1
  175. package/dist/server/design-token-utils.js +12 -4
  176. package/dist/server/design-token-utils.js.map +1 -1
  177. package/dist/templates/default/AGENTS.md +4 -4
  178. package/dist/templates/default/app/routes/database.tsx +13 -0
  179. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +9 -2
  180. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +7 -1
  181. package/dist/vite/client.d.ts.map +1 -1
  182. package/dist/vite/client.js +4 -0
  183. package/dist/vite/client.js.map +1 -1
  184. package/docs/content/a2a-protocol.md +2 -2
  185. package/docs/content/actions.md +2 -54
  186. package/docs/content/agent-mentions.md +1 -1
  187. package/docs/content/agent-teams.md +1 -1
  188. package/docs/content/authentication.md +2 -2
  189. package/docs/content/cli-adapters.md +33 -17
  190. package/docs/content/client.md +11 -20
  191. package/docs/content/code-agents-ui.md +19 -6
  192. package/docs/content/context-awareness.md +36 -20
  193. package/docs/content/database.md +3 -3
  194. package/docs/content/deployment.md +8 -8
  195. package/docs/content/dispatch.md +1 -1
  196. package/docs/content/external-agents.md +5 -1
  197. package/docs/content/faq.md +1 -0
  198. package/docs/content/frames.md +116 -30
  199. package/docs/content/getting-started.md +15 -14
  200. package/docs/content/mcp-clients.md +1 -1
  201. package/docs/content/mcp-protocol.md +11 -88
  202. package/docs/content/messaging.md +1 -1
  203. package/docs/content/migration-workbench.md +13 -87
  204. package/docs/content/multi-app-workspace.md +2 -38
  205. package/docs/content/multi-tenancy.md +3 -26
  206. package/docs/content/onboarding.md +10 -3
  207. package/docs/content/recurring-jobs.md +2 -2
  208. package/docs/content/security.md +33 -1
  209. package/docs/content/server.md +1 -1
  210. package/docs/content/template-assets.md +9 -9
  211. package/docs/content/template-brain.md +114 -388
  212. package/docs/content/template-clips.md +42 -2
  213. package/docs/content/template-content.md +1 -1
  214. package/docs/content/template-design.md +27 -0
  215. package/docs/content/template-dispatch.md +3 -3
  216. package/docs/content/template-forms.md +6 -6
  217. package/docs/content/template-starter.md +2 -2
  218. package/docs/content/using-your-agent.md +56 -0
  219. package/docs/content/workspace-management.md +6 -6
  220. package/docs/content/workspace.md +28 -9
  221. package/package.json +10 -3
  222. package/src/templates/default/AGENTS.md +4 -4
  223. package/src/templates/default/app/routes/database.tsx +13 -0
  224. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +9 -2
  225. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +7 -1
@@ -66,6 +66,33 @@ The rest of this doc is for anyone forking the Design template or extending it.
66
66
  pnpm dlx @agent-native/core create my-design --template design --standalone
67
67
  ```
68
68
 
69
+ ### Data Model
70
+
71
+ All data lives in SQL via Drizzle ORM. Schema: `templates/design/server/db/schema.ts`. Designs and design systems carry the standard `ownableColumns` and a matching framework shares table, so they slot into the per-user / per-org sharing model.
72
+
73
+ | Table | What it holds |
74
+ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
75
+ | `designs` | A design project — `title`, `description`, `project_type` (`prototype` / `other`), the `data` JSON blob, and an optional `design_system_id` link |
76
+ | `design_files` | Individual files belonging to a design (`filename`, `content`, `file_type` defaulting to `html`) |
77
+ | `design_versions` | Point-in-time `snapshot`s of a design with an optional `label`, for history and rollback |
78
+ | `design_systems` | Reusable brand tokens — `data` (colors/typography/spacing), `assets`, `custom_instructions`, and an `is_default` flag |
79
+ | `design_shares` / `design_system_shares` | Framework shares tables mapping principals (users or orgs) to roles (viewer, editor, admin) |
80
+
81
+ A design project is a shell until it has content: `create-design` makes an empty row (`data: "{}"`), then `generate-design` writes the actual standalone HTML/JSX files. The generated artifact, the editable source, and every export all come from the same HTML, so there is no separate "AI mockup" format to translate. A linked design system supplies tokens and `custom_instructions` that the agent honors on every generation pass.
82
+
83
+ Routes in the UI live under `templates/design/app/routes/`: `_index.tsx` (list), `design.$id.tsx` (editor), `present.$id.tsx` (presentation), `design-systems.tsx` and `design-systems_.setup.tsx`, `templates.tsx`, `examples.tsx`, plus `settings.tsx` and `team.tsx`.
84
+
85
+ ### Key Actions
86
+
87
+ Every agent-callable operation is a TypeScript file in `templates/design/actions/`, auto-mounted at `POST /_agent-native/actions/:name` and runnable from the CLI as `pnpm action <name>`. The groupings:
88
+
89
+ - **Designs** — `create-design` (empty shell), `generate-design` (write generated HTML/JSX content), `update-design`, `get-design`, `list-designs`, `duplicate-design`, `delete-design`, and `apply-tweaks` for persisting live tweak-knob values (accent color, density, etc.).
90
+ - **Files** — `create-file`, `update-file`, `list-files`, `delete-file` for the files inside a design project.
91
+ - **Design systems** — `create-design-system`, `update-design-system`, `get-design-system`, `list-design-systems`, `delete-design-system`, `set-default-design-system`, and `analyze-brand-assets` for gathering brand data ahead of analysis.
92
+ - **Import** — `import-code`, `import-figma`, `import-github`, `import-from-url`, `import-document` (DOCX/PPTX/PDF/XLSX), and `import-design-project` to lift a design system out of an existing project.
93
+ - **Export & handoff** — `export-html`, `export-pdf`, `export-svg`, `export-zip`, and `export-coding-handoff` to turn a design into a coding-tool handoff.
94
+ - **Context & navigation** — `view-screen` (current design, open file, view, pending question or variant grid), `get-design-snapshot` (current state for an external agent to continue from), and `navigate`.
95
+
69
96
  ### Customize It
70
97
 
71
98
  Design is a complete, cloneable template. Some practical extension ideas:
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Dispatch Template"
2
+ title: "Dispatch"
3
3
  description: "Dispatch is the workspace control plane — central inbox, cross-app orchestration, secrets vault, Slack/Telegram integration, and scheduled jobs."
4
4
  ---
5
5
 
@@ -73,7 +73,7 @@ Day-to-day, Dispatch is the place admins and ops folks open to keep the workspac
73
73
  _How it works under the hood (for developers)._
74
74
 
75
75
  - **Orchestrator agent.** The chat is set up as a router: it reads `AGENTS.md`, `LEARNINGS.md`, and routes to specialist sub-agents or remote A2A agents.
76
- - **Remote agent registry.** A2A manifests live in `remote-agents/*.json` one per app. Dispatch calls them using the `call-agent` action. In a multi-app workspace, sibling apps under `apps/` are auto-discovered as A2A peers — no manual registration needed.
76
+ - **Remote agent registry.** A2A agent manifests are workspace-runtime entries (not a checked-in template source folder): in a multi-app workspace, sibling apps under `apps/` are auto-discovered as A2A peers — no manual registration needed. Dispatch calls them using the `call-agent` action.
77
77
  - **Vault schema.** Drizzle tables for secrets, grants, requests, approvals, and audit logs. See `server/db/schema.ts` in the template.
78
78
  - **Slack / Telegram plugins.** Server plugins that register webhooks and forward incoming messages to the orchestrator agent.
79
79
  - **Workspace MCP resources.** Add HTTP MCP server definitions under `mcp-servers/*.json` in Resources, then scope them to All apps or selected app grants just like skills and context.
@@ -89,7 +89,7 @@ When Dispatch approval policy is enabled, applying a shared or team-wide dream p
89
89
 
90
90
  Use Dreams when you want to answer questions like "what did agents keep getting wrong this week?", "what should we remember?", or "which repeated lesson deserves a skill?" Inbound Slack, email, Telegram, WhatsApp, and web-derived evidence is treated as untrusted input, so proposals from those sources require review and provenance before they affect shared memory. Workspace-instruction proposals require durable evidence spanning at least two threads or two source apps; eval-only noise, account setup issues, quota limits, and single-app UI wording corrections stay out of global instructions.
91
91
 
92
- ### Dream Input Validation Boundaries
92
+ ### Dream input validation boundaries
93
93
 
94
94
  Because evidence is collected from external, untrusted sources (such as chat transcripts, webhooks, and third-party integrations), the Dream processor enforces strict input validation boundaries to prevent prompt injection and payload-size attacks:
95
95
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Forms Template"
2
+ title: "Forms"
3
3
  description: "Agent-native form builder — create, edit, publish, and route form submissions through natural language plus a visual editor."
4
4
  ---
5
5
 
@@ -28,7 +28,7 @@ When you open the app, you see your forms, the current editor, and a live previe
28
28
  - **Route submissions.** Send submission payloads to webhooks, Slack, Discord, or Google Sheets using the built-in integrations.
29
29
  - **Publish public forms.** Share a public form URL and show a thank-you message after submission.
30
30
 
31
- ## Start Here
31
+ ## Getting started
32
32
 
33
33
  1. **Create a form from a prompt.** Ask for the form you want, including the
34
34
  audience and what should happen after submission.
@@ -39,7 +39,7 @@ When you open the app, you see your forms, the current editor, and a live previe
39
39
  4. **Connect destinations.** Route new submissions to Slack, Discord, Google
40
40
  Sheets, webhooks, or your own extension point.
41
41
 
42
- ## Useful Prompts
42
+ ## Useful prompts
43
43
 
44
44
  - "Create a beta signup form with role, team size, and priority use case."
45
45
  - "Add a required NPS question and a free-text follow-up."
@@ -53,7 +53,7 @@ The useful part of an agent-native form builder is that setup and iteration happ
53
53
 
54
54
  See [What is agent-native?](/docs/what-is-agent-native) for the broader framework model.
55
55
 
56
- ## For Developers
56
+ ## For developers
57
57
 
58
58
  ### Scaffolding
59
59
 
@@ -69,7 +69,7 @@ pnpm dlx @agent-native/core create my-platform
69
69
 
70
70
  Pick Forms and any other templates you want during the workspace setup.
71
71
 
72
- ### Customize It
72
+ ### Customizing it
73
73
 
74
74
  Ask the agent for shipped behavior first:
75
75
 
@@ -81,7 +81,7 @@ Ask the agent for shipped behavior first:
81
81
 
82
82
  If you need new capabilities such as file uploads, signatures, or custom field widgets, treat them as template extensions: add the SQL shape, actions, UI editor controls, public renderer support, and agent instructions together. See [Creating Templates](/docs/creating-templates) for the current build pattern.
83
83
 
84
- ## What's Next
84
+ ## What's next
85
85
 
86
86
  - [**Templates**](/docs/cloneable-saas) — the clone-and-own model
87
87
  - [**Actions**](/docs/actions) — the action system powering the builder
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Starter Template"
2
+ title: "Starter"
3
3
  description: "The minimal agent-native scaffold — agent chat, actions, application state, live sync, auth — wired up, with no domain code. Build from scratch."
4
4
  ---
5
5
 
@@ -24,7 +24,7 @@ Pick Starter when you're not sure which domain template fits, or when you want t
24
24
  - **Agent sidebar** (`<AgentSidebar>`) wired into `app/root.tsx`. Chat, CLI, workspace tabs all present.
25
25
  - **Agent chat plugin** pre-configured so the chat actually talks to Claude (once `ANTHROPIC_API_KEY` is set).
26
26
  - **Auth** via Better Auth — login, signup, sessions, organizations. The same flow runs locally and in production; in development email verification is skipped so signup is just an email + password.
27
- - **Actions directory** with one example (`actions/hello-world.ts`) and the `view-screen` / `navigate` standard actions wired up.
27
+ - **Actions directory** with one example (`actions/hello.ts`) and the `view-screen` / `navigate` standard actions wired up.
28
28
  - **Drizzle schema** with the framework's core tables (application_state, settings, oauth_tokens, sessions, resources).
29
29
  - **Live sync** (`useDbSync`) already wired so UI auto-refreshes when the agent writes to the database.
30
30
  - **AGENTS.md** with the framework-wide rules the agent reads on every turn.
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: "Using Your Agent"
3
+ description: "The day-to-day loop of working with the agent: it sees what you're looking at, you direct it, embed it, go UI-light, and co-edit alongside it."
4
+ ---
5
+
6
+ # Using Your Agent
7
+
8
+ The defining idea behind agent-native is that the agent and the UI are **equal partners** — see [What Is Agent-Native?](/docs/what-is-agent-native) for the why. This section is about the other half of that promise: what it feels like to actually work with the agent once it's docked next to your app.
9
+
10
+ There's a simple through-line. The agent **sees** what you're looking at, you **direct** it toward what you want, you can **embed** it anywhere, you can go fully **UI-light** when that's the better fit, and you can **co-edit** the same documents at the same time. Each of those is a page in this section.
11
+
12
+ ## It sees what you're looking at {#it-sees}
13
+
14
+ The agent isn't blind to your screen. Open an email and it knows which thread. Select a chart and it knows which chart. Highlight a paragraph and it can act on just that range. That shared awareness is what lets you say "reply to this" or "summarize the selection" without spelling out the context every time.
15
+
16
+ This works because the current navigation and selection live in `application_state` SQL, which the agent reads as part of its context. The agent can also drive that same state back — opening a view, selecting a row — so you watch it work in the real UI rather than in a transcript.
17
+
18
+ → [**Context Awareness**](/docs/context-awareness) — navigation state, view-screen, navigate commands, and how the agent stays in sync with your screen.
19
+
20
+ ## You direct it {#you-direct-it}
21
+
22
+ Most of the time you steer the agent by typing into the chat. Two things make that faster.
23
+
24
+ **Mentions.** Tag a custom agent, a connected agent, or a file with `@` to pull it into the conversation — "let `@analytics` pull last week's numbers, then draft the summary." Mentions are how you reach the right specialist or attach the right context without leaving the composer.
25
+
26
+ **Voice.** The composer has a microphone. Dictate a request instead of typing it, with provider options ranging from Builder's hosted transcription to bring-your-own-key to a browser fallback.
27
+
28
+ → [**Agent Mentions**](/docs/agent-mentions) — `@`-mention custom agents, connected agents, and files in chat.
29
+ → [**Voice Input**](/docs/voice-input) — dictation in the chat composer and how transcription is routed.
30
+
31
+ ## You embed it {#you-embed-it}
32
+
33
+ The agent isn't a separate app you tab over to. It ships as a handful of React components — a sidebar, a raw panel, and a `sendToAgentChat()` call — that you drop into any app. Render `<AgentSidebar>` to give every screen a toggleable agent, or wire a button to hand a specific task off to the chat instead of running a one-shot LLM call.
34
+
35
+ → [**Drop-in Agent**](/docs/drop-in-agent) — mount `<AgentPanel>`, `<AgentSidebar>`, and `sendToAgentChat()` into any React app.
36
+
37
+ ## You can go UI-light {#ui-light}
38
+
39
+ Not every app needs a full dashboard. When the agent _is_ the product, you can skip most of the custom UI: open the app, ask for what you want, and let the agent do the rest. The agent still has its management surface — history, workspace, settings — but the primary interaction is conversation rather than clicks.
40
+
41
+ → [**Pure-Agent Apps**](/docs/pure-agent-apps) — apps where the agent is the whole product.
42
+
43
+ ## You co-edit with it {#you-co-edit}
44
+
45
+ When you and the agent are working on the same document, you don't take turns. With real-time collaboration, the agent's edits stream in alongside yours — live cursors, no overwrites — the same way a teammate's would. You can keep typing while it works, and it sees your changes as they happen.
46
+
47
+ → [**Real-Time Collaboration**](/docs/real-time-collaboration) — multi-user collaborative editing with live cursors and agent edits in the same document.
48
+
49
+ ## What's next {#whats-next}
50
+
51
+ - [**Context Awareness**](/docs/context-awareness) — the agent knows what you're looking at
52
+ - [**Agent Mentions**](/docs/agent-mentions) — direct it with `@`-mentions
53
+ - [**Voice Input**](/docs/voice-input) — direct it by speaking
54
+ - [**Drop-in Agent**](/docs/drop-in-agent) — embed it in any React app
55
+ - [**Pure-Agent Apps**](/docs/pure-agent-apps) — go UI-light when the agent is the product
56
+ - [**Real-Time Collaboration**](/docs/real-time-collaboration) — co-edit the same document together
@@ -25,7 +25,7 @@ main ← production
25
25
 
26
26
  **Naming conventions:**
27
27
 
28
- - **Single-app changes:** `feat/<app>-<description>` or `fix/<app>-<description>` — e.g. `feat/mail-thread-search`, `fix/recruiting-resume-parse`
28
+ - **Single-app changes:** `feat/<app>-<description>` or `fix/<app>-<description>` — e.g. `feat/mail-thread-search`, `fix/calendar-recurrence-parse`
29
29
  - **Framework changes:** `feat/core-<description>` or `fix/core-<description>` — e.g. `feat/core-polling-v2`
30
30
  - **Dispatch changes:** `feat/dispatch-<description>` — e.g. `feat/dispatch-vault-policies`
31
31
  - **Cross-app changes:** if a framework change requires template updates, do both in one branch so they ship atomically
@@ -69,9 +69,9 @@ templates/mail/ @your-org/mail-team
69
69
  templates/analytics/ @your-org/analytics-team
70
70
  templates/calendar/ @your-org/calendar-team
71
71
  templates/content/ @your-org/content-team
72
- templates/recruiting/ @your-org/recruiting-team
72
+ templates/design/ @your-org/design-team
73
73
  templates/forms/ @your-org/forms-team
74
- templates/issues/ @your-org/issues-team
74
+ templates/clips/ @your-org/clips-team
75
75
  templates/slides/ @your-org/slides-team
76
76
  templates/videos/ @your-org/videos-team
77
77
 
@@ -119,9 +119,9 @@ app:calendar:
119
119
  - changed-files:
120
120
  - any-glob-to-any-file: templates/calendar/**
121
121
 
122
- app:recruiting:
122
+ app:design:
123
123
  - changed-files:
124
- - any-glob-to-any-file: templates/recruiting/**
124
+ - any-glob-to-any-file: templates/design/**
125
125
 
126
126
  dispatch:
127
127
  - changed-files:
@@ -260,7 +260,7 @@ For a new workspace, after running `agent-native create`:
260
260
  - [ ] Register reusable workspace connections for shared provider accounts, then
261
261
  grant apps such as Brain, Analytics, Mail, or Dispatch only when they need
262
262
  that account
263
- - [ ] Add workspace-wide skills, guardrail instructions, and brand/company reference resources via the Resources page: `context/company.md`, `context/brand.md`, `context/messaging.md`, `instructions/guardrails.md`, and `skills/company-voice/SKILL.md`
263
+ - [ ] Add workspace-wide skills, guardrail instructions, and brand/company reference resources via the Resources page. See [Workspace](/docs/workspace#global-resources) for the full resource-model table and the recommended starter pack.
264
264
  - [ ] Configure the approval policy and approver emails
265
265
  - [ ] Set up SendGrid (`SENDGRID_API_KEY`, `SENDGRID_FROM_EMAIL`) for admin notifications
266
266
  - [ ] Connect Slack or Telegram for workspace messaging
@@ -63,6 +63,25 @@ Resources have three runtime scopes:
63
63
 
64
64
  The in-app Workspace panel shows all three scopes. Personal and shared/organization resources are editable there. Workspace-scope resources are read-only in app panels and edited centrally from Dispatch, so every app sees the same canonical files without a sync step.
65
65
 
66
+ ### Global resources and canonical paths {#global-resources}
67
+
68
+ Workspace-scope resources are managed from Dispatch's **Resources** page and inherited by apps at runtime — no copy or sync step. Dispatch supports two grant scopes:
69
+
70
+ - **All apps** — global resources every app in the workspace inherits. Most company, brand, persona, positioning, messaging, and guardrail context should be **All apps**.
71
+ - **Selected apps** — resources granted to specific apps for app-specific context or tools. Use these sparingly.
72
+
73
+ The path determines how the agent uses a resource. These canonical paths apply across all three scopes (workspace, organization/app, personal):
74
+
75
+ | Runtime resource | Path | How agents use it |
76
+ | ----------------------- | --------------------------------------- | ----------------------------------------------- |
77
+ | Guardrail instructions | `AGENTS.md` or `instructions/<slug>.md` | Loaded every turn in every app that receives it |
78
+ | Global skills | `skills/<slug>/SKILL.md` | Listed as workspace skills and read on demand |
79
+ | Brand/company resources | `context/<slug>.md` | Indexed every turn, read when relevant |
80
+ | Custom agent profiles | `agents/<slug>.md` | Available as reusable local agent profiles |
81
+ | Shared HTTP MCP servers | `mcp-servers/<slug>.json` | Loaded into granted apps' MCP tool registry |
82
+
83
+ This is the right home for core personas, positioning, messaging, company facts, brand guidelines, support policies, shared skills, or shared HTTP MCP tools that many apps should benefit from.
84
+
66
85
  ## Workspace Panel {#workspace-panel}
67
86
 
68
87
  The agent panel includes a **Workspace** tab alongside Chat and CLI. This panel lets users browse workspace resources, create/edit/delete personal or organization resources, and view inherited workspace defaults. It displays a tree view of all resources organized by folder path.
@@ -120,7 +139,7 @@ Change how the agent behaves, in 60 seconds.
120
139
 
121
140
  ## How the Agent Uses Resources {#how-the-agent-uses-resources}
122
141
 
123
- The agent has built-in tools for managing resources: `resource-list`, `resource-read`, `resource-effective`, `resource-write`, and `resource-delete`. These are available in both dev and production modes.
142
+ The agent has built-in tools for managing resources: `resource-list`, `resource-read`, `resource-effective`, `resource-write`, and `resource-delete`. These are available in both Code mode and App mode.
124
143
 
125
144
  At the start of every conversation, the agent automatically reads:
126
145
 
@@ -318,8 +337,8 @@ When the agent encounters a task that matches a skill, it reads the skill file a
318
337
 
319
338
  There are two ways to add skills:
320
339
 
321
- 1. **Via Workspace tab** — Create a new resource with a path like `skills/my-skill/SKILL.md`. This works in both dev and production.
322
- 2. **Via code (dev only)** — Add a Markdown file to `.agents/skills/` in your project. These are available when the app runs in dev mode.
340
+ 1. **Via Workspace tab** — Create a new resource with a path like `skills/my-skill/SKILL.md`. This works in both Code mode and App mode.
341
+ 2. **Via code (Code mode only)** — Add a Markdown file to `.agents/skills/` in your project. These are available when the app runs in Code mode.
323
342
 
324
343
  ## Custom Agents {#custom-agents}
325
344
 
@@ -416,8 +435,8 @@ When you send a message:
416
435
 
417
436
  What shows up depends on the mode:
418
437
 
419
- - **Dev mode** — Codebase files, workspace resources, custom agents, and connected agents
420
- - **Production mode** — Workspace resources, custom agents, and connected agents
438
+ - **Code mode** — Codebase files, workspace resources, custom agents, and connected agents
439
+ - **App mode** — Workspace resources, custom agents, and connected agents
421
440
 
422
441
  ## / Slash Commands {#slash-commands}
423
442
 
@@ -425,16 +444,16 @@ Type `/` at the start of a line to invoke a skill. A dropdown shows available sk
425
444
 
426
445
  What shows up depends on the mode:
427
446
 
428
- - **Dev mode** — Skills from `.agents/skills/` (codebase) and skills from resources
429
- - **Production mode** — Skills from resources only
447
+ - **Code mode** — Skills from `.agents/skills/` (codebase) and skills from resources
448
+ - **App mode** — Skills from resources only
430
449
 
431
450
  If no skills are configured, the dropdown shows a hint with a link to these docs.
432
451
 
433
- ## Dev vs Production Mode {#dev-vs-prod}
452
+ ## Code vs App Mode {#dev-vs-prod}
434
453
 
435
454
  The resource system works identically in both modes. The difference is what additional sources are available for `@` tagging and `/` commands:
436
455
 
437
- | Feature | Dev Mode | Production |
456
+ | Feature | Code Mode | App Mode |
438
457
  | ------------------ | ----------------------------------------------------------------------- | ------------------------------------------------------ |
439
458
  | @ tagging | Codebase files + workspace resources + custom agents + connected agents | Workspace resources + custom agents + connected agents |
440
459
  | / slash commands | .agents/skills/ + resource skills | Resource skills only |
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.26.9",
3
+ "version": "0.28.0",
4
4
  "type": "module",
5
+ "engines": {
6
+ "node": ">=22"
7
+ },
5
8
  "description": "Framework for agent-native application development — where AI agents and UI share state via files",
6
9
  "license": "MIT",
7
10
  "repository": {
@@ -57,6 +60,7 @@
57
60
  "./secrets": "./dist/secrets/index.js",
58
61
  "./org": "./dist/org/index.js",
59
62
  "./client/org": "./dist/client/org/index.js",
63
+ "./client/db-admin": "./dist/client/db-admin/index.js",
60
64
  "./sharing": "./dist/sharing/index.js",
61
65
  "./sharing/actions/share-resource": "./dist/sharing/actions/share-resource.js",
62
66
  "./sharing/actions/unshare-resource": "./dist/sharing/actions/unshare-resource.js",
@@ -104,8 +108,7 @@
104
108
  "typecheck": "tsc --noEmit",
105
109
  "test": "vitest --run src",
106
110
  "prepack": "npm run build && cp ../../README.md ./README.md",
107
- "prepublishOnly": "npm run build",
108
- "release": "npm version patch && npm publish --access public"
111
+ "prepublishOnly": "npm run build"
109
112
  },
110
113
  "dependencies": {
111
114
  "@amplitude/analytics-browser": "^2.41.1",
@@ -113,6 +116,8 @@
113
116
  "@assistant-ui/react": "^0.12.19",
114
117
  "@assistant-ui/react-markdown": "^0.12.6",
115
118
  "@clack/prompts": "^1.4.0",
119
+ "@codemirror/lang-sql": "^6.10.0",
120
+ "@codemirror/theme-one-dark": "^6.1.3",
116
121
  "@libsql/client": "^0.15.0",
117
122
  "@modelcontextprotocol/ext-apps": "1.7.2",
118
123
  "@modelcontextprotocol/sdk": "^1.29.0",
@@ -129,12 +134,14 @@
129
134
  "@standard-schema/spec": "^1.1.0",
130
135
  "@tabler/icons-react": "^3",
131
136
  "@tailwindcss/typography": "^0.5.19",
137
+ "@tanstack/react-table": "^8.21.3",
132
138
  "@tiptap/core": "^3.22.2",
133
139
  "@tiptap/extension-link": "^3.22.2",
134
140
  "@tiptap/extension-placeholder": "^3.22.2",
135
141
  "@tiptap/pm": "^3.22.2",
136
142
  "@tiptap/react": "^3.22.2",
137
143
  "@tiptap/starter-kit": "^3.22.2",
144
+ "@uiw/react-codemirror": "^4.25.10",
138
145
  "better-auth": "1.6.0",
139
146
  "better-sqlite3": "^12.8.0",
140
147
  "clsx": "^2.1.1",
@@ -21,12 +21,12 @@ This is an **@agent-native/core** application -- the AI agent and UI share state
21
21
 
22
22
  ### Authentication
23
23
 
24
- Auth is automatic and environment-driven:
24
+ Auth is real Better Auth in every environment — there is **no dev bypass**:
25
25
 
26
- - **Dev mode**: Auth is bypassed. `getSession()` returns `{ email: "local@localhost" }`.
27
- - **Production** (`ACCESS_TOKEN` set): Auth middleware auto-mounts.
26
+ - **Development**: the same Better Auth flow as production. On first run the framework auto-creates a throwaway dev account and signs you in (so you are not stuck at a login wall). `getSession()` returns the signed-in user or `null` it never returns a `local@localhost` sentinel.
27
+ - **Production**: Better Auth with email/password + social providers; organizations built in.
28
28
 
29
- Use `getSession(event)` server-side and `useSession()` client-side.
29
+ Use `getSession(event)` server-side and `useSession()` client-side. When there is no session, **throw or return 401** — never fall back to `local@localhost` (that pools every unauthenticated request into one shared tenant).
30
30
 
31
31
  ## Resources
32
32
 
@@ -0,0 +1,13 @@
1
+ import { DbAdminPage } from "@agent-native/core/client/db-admin";
2
+
3
+ export function meta() {
4
+ return [{ title: "Database" }];
5
+ }
6
+
7
+ export default function DatabasePage() {
8
+ return (
9
+ <div className="p-6">
10
+ <DbAdminPage />
11
+ </div>
12
+ );
13
+ }
@@ -16,14 +16,21 @@ Auth is powered by **Better Auth** with account-first design. Every new user cre
16
16
 
17
17
  | Mode | Behavior |
18
18
  | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
19
- | **Development (default)** | Auth is automatically bypassed. `getSession()` falls back to `{ email: "local@localhost" }` when nothing else succeeds. No config. |
19
+ | **Development (default)** | Real Better Auth — same flow as production. There is **no auth bypass**. On first run the framework auto-creates a throwaway dev account and signs you in (credentials printed once to the console; disable with `AGENT_NATIVE_DISABLE_AUTO_DEV_ACCOUNT=1`), so you are not stuck at a login wall. `getSession()` returns the signed-in user or `null` it never falls back to a sentinel identity. |
20
20
  | **Production (default)** | Better Auth with email/password + social providers (Google, GitHub). Organizations built in. |
21
- | **`AUTH_MODE=local`** | Explicit escape hatch. `getSession()` always returns `{ email: "local@localhost" }`. Set via `.env` or the onboarding page's "Use locally" button. |
21
+ | **`AUTH_MODE=local`** | **Not** a browser auth bypass, and never returns `local@localhost`. It only affects CLI/agent identity: it lets `pnpm action` / the local agent loop auto-bind to the single real signed-in dev user from the `sessions` table (see `scripts/dev-session.ts`). Browser login is unchanged. |
22
22
  | **`AUTH_SKIP_EMAIL_VERIFICATION=1`** | QA/preview escape hatch for real email/password accounts. Signup skips email verification and does not send the signup verification email. Local dev/test skips verification by default; set `AUTH_SKIP_EMAIL_VERIFICATION=0` only when testing verification itself. Use `+qa` emails for test accounts. |
23
23
  | **`ACCESS_TOKEN` / `ACCESS_TOKENS`** | Simple token-based auth for production deployments. |
24
24
  | **`AUTH_DISABLED=true`** | Skip auth entirely (for apps behind infrastructure-level auth like Cloudflare Access). |
25
25
  | **Custom** | Pass your own `getSession` to `autoMountAuth(app, { getSession })`. |
26
26
 
27
+ > **Never** use `local@localhost` as a fallback identity in app code
28
+ > (`getRequestUserEmail() ?? "local@localhost"`, `session?.email ?? "local@localhost"`,
29
+ > etc.). There is no dev auth shim. That pattern pools every unauthenticated
30
+ > request into one shared tenant and caused the 2026-04-29 credentials leak.
31
+ > When there is no session, **throw or return 401** — never substitute a
32
+ > sentinel. Enforced by `scripts/guard-no-localhost-fallback.mjs`.
33
+
27
34
  ## Local → Real Account Migration
28
35
 
29
36
  Upgrading from `local@localhost` to a real account preserves SQL-backed workspace data. The built-in migration moves `application_state`, user-scoped `settings`, `oauth_tokens`, and any template table that uses `owner_email`.
@@ -144,11 +144,17 @@ import {
144
144
  getRequestOrgId,
145
145
  } from "@agent-native/core/server/request-context";
146
146
 
147
+ const ownerEmail = getRequestUserEmail();
148
+ // Never fall back to a sentinel like "local@localhost" — that pools every
149
+ // unauthenticated write into one shared tenant (see the 2026-04-29 leak and
150
+ // guard-no-localhost-fallback). Throw / 401 when there is no session instead.
151
+ if (!ownerEmail) throw new Error("Not authenticated");
152
+
147
153
  await db.insert(schema.decks).values({
148
154
  id: nanoid(),
149
155
  title,
150
156
  data,
151
- ownerEmail: getRequestUserEmail() ?? "local@localhost",
157
+ ownerEmail,
152
158
  orgId: getRequestOrgId(),
153
159
  // visibility defaults to 'private'
154
160
  // ...