@agent-native/core 0.121.2 → 0.122.1

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 (588) hide show
  1. package/README.md +4 -12
  2. package/corpus/README.md +2 -2
  3. package/corpus/core/CHANGELOG.md +148 -0
  4. package/corpus/core/docs/content/actions.mdx +2 -2
  5. package/corpus/core/docs/content/agent-surfaces.mdx +1 -1
  6. package/corpus/core/docs/content/authentication.mdx +2 -0
  7. package/corpus/core/docs/content/deployment.mdx +36 -0
  8. package/corpus/core/docs/content/http-api.mdx +266 -0
  9. package/corpus/core/docs/content/syncing-template-changes.mdx +159 -0
  10. package/corpus/core/package.json +2 -1
  11. package/corpus/core/src/a2a/activity.ts +38 -27
  12. package/corpus/core/src/a2a/client.ts +57 -4
  13. package/corpus/core/src/agent/engine/builder-engine.ts +35 -4
  14. package/corpus/core/src/agent/run-manager.ts +20 -1
  15. package/corpus/core/src/agent/run-store.ts +4 -1
  16. package/corpus/core/src/agent/types.ts +28 -8
  17. package/corpus/core/src/chat-threads/store.ts +45 -0
  18. package/corpus/core/src/checkpoints/index.ts +2 -0
  19. package/corpus/core/src/checkpoints/route-match.ts +13 -0
  20. package/corpus/core/src/cli/create.ts +105 -17
  21. package/corpus/core/src/cli/index.ts +20 -0
  22. package/corpus/core/src/cli/template-baseline.ts +410 -0
  23. package/corpus/core/src/cli/template-sync.ts +1004 -0
  24. package/corpus/core/src/cli/templates-meta.ts +1 -0
  25. package/corpus/core/src/client/AssistantChat.tsx +38 -12
  26. package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +75 -10
  27. package/corpus/core/src/client/chat/message-components.tsx +127 -66
  28. package/corpus/core/src/client/chat/tool-call-display.tsx +29 -5
  29. package/corpus/core/src/client/error-format.ts +18 -0
  30. package/corpus/core/src/client/org/OrgSwitcher.tsx +30 -8
  31. package/corpus/core/src/client/org/TeamPage.tsx +7 -6
  32. package/corpus/core/src/client/settings/SettingsPanel.tsx +9 -9
  33. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +12 -2
  34. package/corpus/core/src/client/sse-event-processor.ts +3 -0
  35. package/corpus/core/src/data-widgets/index.ts +41 -0
  36. package/corpus/core/src/deploy/build.ts +11 -9
  37. package/corpus/core/src/extensions/url-safety.ts +67 -4
  38. package/corpus/core/src/integrations/webhook-handler.ts +63 -9
  39. package/corpus/core/src/org/auto-join-domain.ts +4 -3
  40. package/corpus/core/src/org/context.ts +108 -39
  41. package/corpus/core/src/org/index.ts +5 -0
  42. package/corpus/core/src/org/service-identity.ts +60 -0
  43. package/corpus/core/src/provider-api/index.ts +22 -1
  44. package/corpus/core/src/scripts/docs/search.ts +12 -1
  45. package/corpus/core/src/server/agent-chat/context-tools.ts +9 -4
  46. package/corpus/core/src/server/agent-chat/framework-prompts.ts +38 -66
  47. package/corpus/core/src/server/agent-chat-plugin.ts +17 -10
  48. package/corpus/core/src/server/agents-bundle.ts +84 -5
  49. package/corpus/core/src/server/auth.ts +4 -3
  50. package/corpus/core/src/server/builder-browser.ts +47 -19
  51. package/corpus/core/src/server/core-routes-plugin.ts +2 -2
  52. package/corpus/core/src/server/credential-provider.ts +209 -68
  53. package/corpus/core/src/server/index.ts +3 -0
  54. package/corpus/core/src/server/prompts/framework-core-compact.ts +6 -13
  55. package/corpus/core/src/server/prompts/framework-core.ts +9 -21
  56. package/corpus/core/src/server/prompts/index.ts +0 -1
  57. package/corpus/core/src/server/prompts/shared-rules.ts +19 -11
  58. package/corpus/core/src/server/ssr-handler.ts +13 -2
  59. package/corpus/core/src/settings/user-settings.ts +13 -1
  60. package/corpus/core/src/shared/cache-control.ts +141 -0
  61. package/corpus/core/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  62. package/corpus/core/src/templates/chat/_gitignore +1 -0
  63. package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  64. package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  65. package/corpus/core/src/templates/default/app/root.tsx +1 -1
  66. package/corpus/core/src/templates/default/public/manifest.json +2 -2
  67. package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  68. package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  69. package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  70. package/corpus/core/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  71. package/corpus/core/src/vite/agents-bundle-plugin.ts +7 -6
  72. package/corpus/core/src/vite/client.ts +69 -3
  73. package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +4 -5
  74. package/corpus/templates/analytics/.agents/skills/admin-surfaces/SKILL.md +55 -0
  75. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +10 -0
  76. package/corpus/templates/analytics/.agents/skills/dashboard-management/references/template-catalog-and-demo.md +62 -0
  77. package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +85 -0
  78. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +27 -2
  79. package/corpus/templates/analytics/.agents/skills/data-querying/references/inline-chart-embeds.md +139 -0
  80. package/corpus/templates/analytics/.agents/skills/monitoring/SKILL.md +77 -0
  81. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  82. package/corpus/templates/analytics/AGENTS.md +91 -563
  83. package/corpus/templates/analytics/_gitignore +1 -0
  84. package/corpus/templates/analytics/actions/bigquery.ts +12 -4
  85. package/corpus/templates/analytics/actions/generate-chart.ts +5 -5
  86. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -1
  87. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +1 -23
  88. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -0
  89. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
  90. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +1 -0
  91. package/corpus/templates/analytics/app/routes/_index.tsx +1 -1
  92. package/corpus/templates/analytics/changelog/2026-07-24-analytics-finds-saved-dashboards-and-queries-far-more-reliab.md +6 -0
  93. package/corpus/templates/analytics/changelog/2026-07-24-notion-access-errors-now-explain-that-a-page-needs-sharing-w.md +6 -0
  94. package/corpus/templates/analytics/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  95. package/corpus/templates/analytics/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  96. package/corpus/templates/analytics/package.json +1 -1
  97. package/corpus/templates/analytics/public/manifest.json +1 -1
  98. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +7 -0
  99. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +191 -30
  100. package/corpus/templates/analytics/server/lib/bigquery.ts +11 -1
  101. package/corpus/templates/analytics/server/lib/notion.ts +15 -4
  102. package/corpus/templates/analytics/server/plugins/agent-chat.ts +10 -0
  103. package/corpus/templates/analytics/server/plugins/auth.ts +1 -1
  104. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  105. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +0 -2
  106. package/corpus/templates/assets/app/routes/_index.tsx +1 -1
  107. package/corpus/templates/assets/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  108. package/corpus/templates/assets/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  109. package/corpus/templates/assets/server/plugins/auth.ts +1 -1
  110. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  111. package/corpus/templates/brain/_gitignore +1 -0
  112. package/corpus/templates/brain/app/lib/brain.ts +0 -7
  113. package/corpus/templates/brain/app/routes/_index.tsx +1 -2
  114. package/corpus/templates/brain/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  115. package/corpus/templates/brain/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  116. package/corpus/templates/brain/package.json +1 -1
  117. package/corpus/templates/brain/public/manifest.json +1 -1
  118. package/corpus/templates/brain/server/plugins/auth.ts +1 -1
  119. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  120. package/corpus/templates/calendar/_gitignore +1 -0
  121. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +0 -6
  122. package/corpus/templates/calendar/app/routes/_app._index.tsx +1 -1
  123. package/corpus/templates/calendar/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  124. package/corpus/templates/calendar/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  125. package/corpus/templates/calendar/package.json +1 -1
  126. package/corpus/templates/calendar/public/manifest.json +1 -1
  127. package/corpus/templates/calendar/server/plugins/auth.ts +1 -1
  128. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  129. package/corpus/templates/chat/_gitignore +1 -0
  130. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  131. package/corpus/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  132. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  133. package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +34 -0
  134. package/corpus/templates/clips/AGENTS.md +5 -4
  135. package/corpus/templates/clips/_gitignore +1 -0
  136. package/corpus/templates/clips/actions/cleanup-transcript.ts +5 -0
  137. package/corpus/templates/clips/actions/get-recording-insights.ts +44 -8
  138. package/corpus/templates/clips/actions/get-recording-player-data.ts +39 -70
  139. package/corpus/templates/clips/actions/import-loom-recording.ts +53 -98
  140. package/corpus/templates/clips/actions/lib/loom-import-job.ts +260 -0
  141. package/corpus/templates/clips/actions/list-clip-views.ts +2 -4
  142. package/corpus/templates/clips/actions/list-recordings.ts +69 -19
  143. package/corpus/templates/clips/actions/list-viewers.ts +5 -2
  144. package/corpus/templates/clips/actions/regenerate-summary.ts +5 -1
  145. package/corpus/templates/clips/actions/request-transcript.ts +28 -1
  146. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +21 -1
  147. package/corpus/templates/clips/app/components/library/library-layout.tsx +0 -7
  148. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +14 -1
  149. package/corpus/templates/clips/app/components/player/insights-panel.tsx +8 -20
  150. package/corpus/templates/clips/app/components/player/recording-views-badge.tsx +335 -0
  151. package/corpus/templates/clips/app/components/player/video-player.tsx +13 -8
  152. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -1
  153. package/corpus/templates/clips/app/i18n/en-US.ts +13 -2
  154. package/corpus/templates/clips/app/lib/capture-permissions.ts +110 -0
  155. package/corpus/templates/clips/app/lib/recording-link.ts +32 -0
  156. package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
  157. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +27 -0
  158. package/corpus/templates/clips/app/routes/_index.tsx +1 -1
  159. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +52 -15
  160. package/corpus/templates/clips/app/routes/record.tsx +82 -31
  161. package/corpus/templates/clips/app/routes/share.$shareId.tsx +42 -31
  162. package/corpus/templates/clips/changelog/2026-07-24-clip-pages-now-show-a-view-count-with-viewer-avatars-next-to.md +6 -0
  163. package/corpus/templates/clips/changelog/2026-07-24-clip-summaries-read-like-a-description-you-d-write-yourself-.md +6 -0
  164. package/corpus/templates/clips/changelog/2026-07-24-clip-view-counts-now-separate-human-views-from-agent-views-s.md +6 -0
  165. package/corpus/templates/clips/changelog/2026-07-24-clips-actions-can-now-be-called-by-org-service-tokens-so-ext.md +6 -0
  166. package/corpus/templates/clips/changelog/2026-07-24-clips-no-longer-briefly-shows-a-dock-icon-while-launching.md +6 -0
  167. package/corpus/templates/clips/changelog/2026-07-24-fixed-owner-and-editor-share-links-redirecting-to-the-record.md +6 -0
  168. package/corpus/templates/clips/changelog/2026-07-24-meeting-and-note-recordings-now-start-as-a-compact-pill-on-t.md +6 -0
  169. package/corpus/templates/clips/changelog/2026-07-24-new-clips-now-copy-a-shareable-link-instead-of-the-owner-onl.md +6 -0
  170. package/corpus/templates/clips/changelog/2026-07-24-opening-a-share-link-as-the-clip-s-owner-now-goes-straight-t.md +6 -0
  171. package/corpus/templates/clips/changelog/2026-07-24-permissions-and-rewind-controls-now-use-compact-consistent-h.md +6 -0
  172. package/corpus/templates/clips/changelog/2026-07-24-quitting-the-desktop-app-no-longer-shows-a-false-macos-crash.md +6 -0
  173. package/corpus/templates/clips/changelog/2026-07-24-screen-recording-permission-errors-now-name-the-exact-app-to.md +6 -0
  174. package/corpus/templates/clips/changelog/2026-07-24-the-desktop-app-now-copies-a-new-clip-s-share-link-to-your-c.md +6 -0
  175. package/corpus/templates/clips/changelog/2026-07-24-the-recording-toolbar-now-stays-above-other-apps-including-o.md +6 -0
  176. package/corpus/templates/clips/changelog/2026-07-24-transcript-captions-now-use-real-speech-timings-instead-of-a.md +6 -0
  177. package/corpus/templates/clips/changelog/2026-07-24-video-playback-no-longer-stutters-and-replays-the-last-momen.md +6 -0
  178. package/corpus/templates/clips/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  179. package/corpus/templates/clips/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  180. package/corpus/templates/clips/chrome-extension/src/background.ts +17 -1
  181. package/corpus/templates/clips/desktop/package.json +2 -0
  182. package/corpus/templates/clips/desktop/src/app.tsx +89 -0
  183. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +9 -3
  184. package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +51 -0
  185. package/corpus/templates/clips/desktop/src/lib/native-notification.ts +44 -0
  186. package/corpus/templates/clips/desktop/src/lib/recording-link.ts +67 -0
  187. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +35 -35
  188. package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +3 -2
  189. package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +47 -46
  190. package/corpus/templates/clips/desktop/src/styles.css +127 -78
  191. package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +7 -0
  192. package/corpus/templates/clips/desktop/src-tauri/Info.plist +6 -0
  193. package/corpus/templates/clips/desktop/src-tauri/capabilities/default.json +1 -0
  194. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +7 -3
  195. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +4 -1
  196. package/corpus/templates/clips/desktop/src-tauri/src/main.rs +8 -0
  197. package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +21 -10
  198. package/corpus/templates/clips/desktop/src-tauri/src/util.rs +40 -0
  199. package/corpus/templates/clips/server/db/schema.ts +27 -0
  200. package/corpus/templates/clips/server/lib/agent-views.ts +145 -0
  201. package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +2 -1
  202. package/corpus/templates/clips/server/lib/public-agent-context.ts +7 -0
  203. package/corpus/templates/clips/server/lib/recording-share-grant.ts +79 -0
  204. package/corpus/templates/clips/server/lib/recordings.ts +51 -3
  205. package/corpus/templates/clips/server/plugins/auth.ts +1 -1
  206. package/corpus/templates/clips/server/plugins/db.ts +31 -0
  207. package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +56 -3
  208. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +49 -17
  209. package/corpus/templates/clips/shared/recording-link.ts +43 -0
  210. package/corpus/templates/clips/shared/share-attribution.ts +4 -0
  211. package/corpus/templates/clips/shared/share-dashboard-redirect.ts +42 -0
  212. package/corpus/templates/clips/shared/view-analytics.ts +26 -0
  213. package/corpus/templates/content/.agents/skills/content/SKILL.md +5 -0
  214. package/corpus/templates/content/.agents/skills/content/references/local-file-mode.md +135 -0
  215. package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +12 -0
  216. package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +238 -0
  217. package/corpus/templates/content/.agents/skills/document-editing/references/document-behavior.md +91 -0
  218. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  219. package/corpus/templates/content/AGENTS.md +62 -583
  220. package/corpus/templates/content/_gitignore +1 -0
  221. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -39
  222. package/corpus/templates/content/app/routes/_app._index.tsx +1 -2
  223. package/corpus/templates/content/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  224. package/corpus/templates/content/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  225. package/corpus/templates/content/package.json +1 -1
  226. package/corpus/templates/content/public/manifest.json +1 -1
  227. package/corpus/templates/content/server/plugins/auth.ts +1 -1
  228. package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +11 -0
  229. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +50 -8
  230. package/corpus/templates/design/.agents/skills/design-generation/references/code-layers.md +81 -0
  231. package/corpus/templates/design/.agents/skills/design-generation/references/code-workspace.md +42 -0
  232. package/corpus/templates/design/.agents/skills/design-generation/references/editor-extensions.md +34 -0
  233. package/corpus/templates/design/.agents/skills/responsive-breakpoints/SKILL.md +4 -1
  234. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  235. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +17 -0
  236. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +8196 -0
  237. package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +265 -0
  238. package/corpus/templates/design/.generated/bridge/hit-test.generated.ts +642 -0
  239. package/corpus/templates/design/.generated/bridge/motion-preview.generated.ts +571 -0
  240. package/corpus/templates/design/.generated/bridge/nav.generated.ts +91 -0
  241. package/corpus/templates/design/.generated/bridge/sample.generated.ts +23 -0
  242. package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +263 -0
  243. package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +518 -0
  244. package/corpus/templates/design/.generated/bridge/tweak.generated.ts +20 -0
  245. package/corpus/templates/design/.generated/bridge/zoom.generated.ts +32 -0
  246. package/corpus/templates/design/AGENTS.md +88 -503
  247. package/corpus/templates/design/_gitignore +1 -0
  248. package/corpus/templates/design/app/components/layout/Sidebar.tsx +0 -2
  249. package/corpus/templates/design/app/routes/_index.tsx +1 -1
  250. package/corpus/templates/design/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  251. package/corpus/templates/design/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  252. package/corpus/templates/design/server/plugins/auth.ts +1 -1
  253. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  254. package/corpus/templates/dispatch/_gitignore +1 -0
  255. package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -10
  256. package/corpus/templates/dispatch/app/routes/overview.tsx +1 -1
  257. package/corpus/templates/dispatch/changelog/2026-07-24-signing-in-now-puts-you-in-your-companys-workspace.md +6 -0
  258. package/corpus/templates/dispatch/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  259. package/corpus/templates/dispatch/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  260. package/corpus/templates/dispatch/package.json +1 -1
  261. package/corpus/templates/dispatch/public/manifest.json +1 -1
  262. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  263. package/corpus/templates/forms/_gitignore +1 -0
  264. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +0 -35
  265. package/corpus/templates/forms/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  266. package/corpus/templates/forms/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  267. package/corpus/templates/forms/package.json +1 -1
  268. package/corpus/templates/forms/public/manifest.json +1 -1
  269. package/corpus/templates/forms/server/lib/public-form-ssr.ts +2 -2
  270. package/corpus/templates/forms/server/plugins/auth.ts +1 -1
  271. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  272. package/corpus/templates/macros/_gitignore +1 -0
  273. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -2
  274. package/corpus/templates/macros/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  275. package/corpus/templates/macros/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  276. package/corpus/templates/macros/package.json +1 -1
  277. package/corpus/templates/macros/server/plugins/auth.ts +2 -2
  278. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  279. package/corpus/templates/mail/_gitignore +1 -0
  280. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -39
  281. package/corpus/templates/mail/app/routes/$view.$threadId.tsx +1 -1
  282. package/corpus/templates/mail/app/routes/$view.tsx +1 -1
  283. package/corpus/templates/mail/app/routes/_index.tsx +1 -1
  284. package/corpus/templates/mail/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  285. package/corpus/templates/mail/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  286. package/corpus/templates/mail/package.json +1 -1
  287. package/corpus/templates/mail/public/manifest.json +1 -1
  288. package/corpus/templates/mail/server/plugins/auth.ts +1 -1
  289. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  290. package/corpus/templates/plan/_gitignore +1 -0
  291. package/corpus/templates/plan/agent-native.app-skill.json +1 -1
  292. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +4 -9
  293. package/corpus/templates/plan/app/lib/app-config.ts +1 -1
  294. package/corpus/templates/plan/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  295. package/corpus/templates/plan/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  296. package/corpus/templates/plan/package.json +1 -1
  297. package/corpus/templates/plan/public/manifest.json +1 -1
  298. package/corpus/templates/plan/server/plugins/auth.ts +1 -1
  299. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  300. package/corpus/templates/slides/_gitignore +1 -0
  301. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +0 -2
  302. package/corpus/templates/slides/app/routes/_index.tsx +1 -1
  303. package/corpus/templates/slides/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  304. package/corpus/templates/slides/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  305. package/corpus/templates/slides/package.json +1 -1
  306. package/corpus/templates/slides/public/manifest.json +1 -1
  307. package/corpus/templates/slides/server/plugins/auth.ts +1 -1
  308. package/corpus/templates/slides/server/plugins/db.ts +4 -0
  309. package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  310. package/corpus/templates/tasks/AGENTS.md +1 -1
  311. package/corpus/templates/tasks/_gitignore +1 -0
  312. package/dist/a2a/activity.d.ts +4 -1
  313. package/dist/a2a/activity.d.ts.map +1 -1
  314. package/dist/a2a/activity.js +27 -16
  315. package/dist/a2a/activity.js.map +1 -1
  316. package/dist/a2a/client.d.ts.map +1 -1
  317. package/dist/a2a/client.js +58 -4
  318. package/dist/a2a/client.js.map +1 -1
  319. package/dist/agent/engine/builder-engine.d.ts +1 -0
  320. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  321. package/dist/agent/engine/builder-engine.js +31 -4
  322. package/dist/agent/engine/builder-engine.js.map +1 -1
  323. package/dist/agent/run-manager.d.ts.map +1 -1
  324. package/dist/agent/run-manager.js +18 -1
  325. package/dist/agent/run-manager.js.map +1 -1
  326. package/dist/agent/run-store.d.ts +1 -0
  327. package/dist/agent/run-store.d.ts.map +1 -1
  328. package/dist/agent/run-store.js +2 -1
  329. package/dist/agent/run-store.js.map +1 -1
  330. package/dist/agent/types.d.ts +12 -1
  331. package/dist/agent/types.d.ts.map +1 -1
  332. package/dist/agent/types.js +21 -1
  333. package/dist/agent/types.js.map +1 -1
  334. package/dist/chat-threads/store.d.ts +10 -0
  335. package/dist/chat-threads/store.d.ts.map +1 -1
  336. package/dist/chat-threads/store.js +41 -0
  337. package/dist/chat-threads/store.js.map +1 -1
  338. package/dist/checkpoints/index.d.ts +1 -0
  339. package/dist/checkpoints/index.d.ts.map +1 -1
  340. package/dist/checkpoints/index.js +1 -0
  341. package/dist/checkpoints/index.js.map +1 -1
  342. package/dist/checkpoints/route-match.d.ts +8 -0
  343. package/dist/checkpoints/route-match.d.ts.map +1 -0
  344. package/dist/checkpoints/route-match.js +13 -0
  345. package/dist/checkpoints/route-match.js.map +1 -0
  346. package/dist/cli/create.d.ts +35 -4
  347. package/dist/cli/create.d.ts.map +1 -1
  348. package/dist/cli/create.js +69 -19
  349. package/dist/cli/create.js.map +1 -1
  350. package/dist/cli/index.js +19 -0
  351. package/dist/cli/index.js.map +1 -1
  352. package/dist/cli/template-baseline.d.ts +54 -0
  353. package/dist/cli/template-baseline.d.ts.map +1 -0
  354. package/dist/cli/template-baseline.js +334 -0
  355. package/dist/cli/template-baseline.js.map +1 -0
  356. package/dist/cli/template-sync.d.ts +57 -0
  357. package/dist/cli/template-sync.d.ts.map +1 -0
  358. package/dist/cli/template-sync.js +787 -0
  359. package/dist/cli/template-sync.js.map +1 -0
  360. package/dist/cli/templates-meta.d.ts.map +1 -1
  361. package/dist/cli/templates-meta.js +1 -0
  362. package/dist/cli/templates-meta.js.map +1 -1
  363. package/dist/client/AssistantChat.d.ts +2 -1
  364. package/dist/client/AssistantChat.d.ts.map +1 -1
  365. package/dist/client/AssistantChat.js +38 -10
  366. package/dist/client/AssistantChat.js.map +1 -1
  367. package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
  368. package/dist/client/NewWorkspaceAppFlow.js +32 -2
  369. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  370. package/dist/client/chat/message-components.d.ts +20 -0
  371. package/dist/client/chat/message-components.d.ts.map +1 -1
  372. package/dist/client/chat/message-components.js +81 -46
  373. package/dist/client/chat/message-components.js.map +1 -1
  374. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  375. package/dist/client/chat/tool-call-display.js +14 -6
  376. package/dist/client/chat/tool-call-display.js.map +1 -1
  377. package/dist/client/error-format.d.ts.map +1 -1
  378. package/dist/client/error-format.js +13 -0
  379. package/dist/client/error-format.js.map +1 -1
  380. package/dist/client/org/OrgSwitcher.d.ts +8 -1
  381. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  382. package/dist/client/org/OrgSwitcher.js +3 -2
  383. package/dist/client/org/OrgSwitcher.js.map +1 -1
  384. package/dist/client/org/TeamPage.d.ts.map +1 -1
  385. package/dist/client/org/TeamPage.js +1 -1
  386. package/dist/client/org/TeamPage.js.map +1 -1
  387. package/dist/client/settings/SettingsPanel.js +9 -9
  388. package/dist/client/settings/SettingsPanel.js.map +1 -1
  389. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  390. package/dist/client/settings/SettingsTabsPage.js +7 -4
  391. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  392. package/dist/client/sse-event-processor.d.ts.map +1 -1
  393. package/dist/client/sse-event-processor.js +3 -0
  394. package/dist/client/sse-event-processor.js.map +1 -1
  395. package/dist/collab/awareness.d.ts +2 -2
  396. package/dist/collab/awareness.d.ts.map +1 -1
  397. package/dist/collab/struct-routes.d.ts +1 -1
  398. package/dist/data-widgets/index.d.ts +3 -0
  399. package/dist/data-widgets/index.d.ts.map +1 -1
  400. package/dist/data-widgets/index.js +33 -0
  401. package/dist/data-widgets/index.js.map +1 -1
  402. package/dist/deploy/build.d.ts.map +1 -1
  403. package/dist/deploy/build.js +11 -7
  404. package/dist/deploy/build.js.map +1 -1
  405. package/dist/eject/provider-api-definitions.d.ts +1 -0
  406. package/dist/eject/provider-api-definitions.d.ts.map +1 -1
  407. package/dist/extensions/url-safety.d.ts +9 -16
  408. package/dist/extensions/url-safety.d.ts.map +1 -1
  409. package/dist/extensions/url-safety.js +48 -4
  410. package/dist/extensions/url-safety.js.map +1 -1
  411. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  412. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  413. package/dist/integrations/webhook-handler.js +46 -9
  414. package/dist/integrations/webhook-handler.js.map +1 -1
  415. package/dist/notifications/routes.d.ts +2 -2
  416. package/dist/observability/routes.d.ts +3 -3
  417. package/dist/org/auto-join-domain.d.ts +3 -2
  418. package/dist/org/auto-join-domain.d.ts.map +1 -1
  419. package/dist/org/auto-join-domain.js +1 -1
  420. package/dist/org/auto-join-domain.js.map +1 -1
  421. package/dist/org/context.d.ts.map +1 -1
  422. package/dist/org/context.js +84 -28
  423. package/dist/org/context.js.map +1 -1
  424. package/dist/org/index.d.ts +1 -0
  425. package/dist/org/index.d.ts.map +1 -1
  426. package/dist/org/index.js +1 -0
  427. package/dist/org/index.js.map +1 -1
  428. package/dist/org/service-identity.d.ts +43 -0
  429. package/dist/org/service-identity.d.ts.map +1 -0
  430. package/dist/org/service-identity.js +34 -0
  431. package/dist/org/service-identity.js.map +1 -0
  432. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  433. package/dist/provider-api/actions/provider-api.d.ts +13 -11
  434. package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
  435. package/dist/provider-api/index.d.ts +4 -0
  436. package/dist/provider-api/index.d.ts.map +1 -1
  437. package/dist/provider-api/index.js +17 -1
  438. package/dist/provider-api/index.js.map +1 -1
  439. package/dist/scripts/docs/search.d.ts.map +1 -1
  440. package/dist/scripts/docs/search.js +12 -1
  441. package/dist/scripts/docs/search.js.map +1 -1
  442. package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
  443. package/dist/server/agent-chat/context-tools.js +3 -3
  444. package/dist/server/agent-chat/context-tools.js.map +1 -1
  445. package/dist/server/agent-chat/framework-prompts.d.ts +8 -3
  446. package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
  447. package/dist/server/agent-chat/framework-prompts.js +33 -62
  448. package/dist/server/agent-chat/framework-prompts.js.map +1 -1
  449. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  450. package/dist/server/agent-chat-plugin.js +16 -10
  451. package/dist/server/agent-chat-plugin.js.map +1 -1
  452. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  453. package/dist/server/agents-bundle.d.ts +18 -0
  454. package/dist/server/agents-bundle.d.ts.map +1 -1
  455. package/dist/server/agents-bundle.js +70 -4
  456. package/dist/server/agents-bundle.js.map +1 -1
  457. package/dist/server/auth.d.ts.map +1 -1
  458. package/dist/server/auth.js +4 -3
  459. package/dist/server/auth.js.map +1 -1
  460. package/dist/server/builder-browser.d.ts.map +1 -1
  461. package/dist/server/builder-browser.js +43 -19
  462. package/dist/server/builder-browser.js.map +1 -1
  463. package/dist/server/core-routes-plugin.js +2 -2
  464. package/dist/server/core-routes-plugin.js.map +1 -1
  465. package/dist/server/credential-provider.d.ts +38 -2
  466. package/dist/server/credential-provider.d.ts.map +1 -1
  467. package/dist/server/credential-provider.js +142 -64
  468. package/dist/server/credential-provider.js.map +1 -1
  469. package/dist/server/index.d.ts +1 -1
  470. package/dist/server/index.d.ts.map +1 -1
  471. package/dist/server/index.js +1 -1
  472. package/dist/server/index.js.map +1 -1
  473. package/dist/server/prompts/framework-core-compact.d.ts +1 -1
  474. package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
  475. package/dist/server/prompts/framework-core-compact.js +7 -13
  476. package/dist/server/prompts/framework-core-compact.js.map +1 -1
  477. package/dist/server/prompts/framework-core.d.ts +1 -1
  478. package/dist/server/prompts/framework-core.d.ts.map +1 -1
  479. package/dist/server/prompts/framework-core.js +10 -21
  480. package/dist/server/prompts/framework-core.js.map +1 -1
  481. package/dist/server/prompts/index.d.ts +1 -1
  482. package/dist/server/prompts/index.d.ts.map +1 -1
  483. package/dist/server/prompts/index.js +1 -1
  484. package/dist/server/prompts/index.js.map +1 -1
  485. package/dist/server/prompts/shared-rules.d.ts +16 -10
  486. package/dist/server/prompts/shared-rules.d.ts.map +1 -1
  487. package/dist/server/prompts/shared-rules.js +19 -10
  488. package/dist/server/prompts/shared-rules.js.map +1 -1
  489. package/dist/server/ssr-handler.d.ts +1 -1
  490. package/dist/server/ssr-handler.d.ts.map +1 -1
  491. package/dist/server/ssr-handler.js +10 -3
  492. package/dist/server/ssr-handler.js.map +1 -1
  493. package/dist/server/transcribe-voice.d.ts +1 -1
  494. package/dist/settings/user-settings.d.ts.map +1 -1
  495. package/dist/settings/user-settings.js +13 -1
  496. package/dist/settings/user-settings.js.map +1 -1
  497. package/dist/shared/cache-control.d.ts +52 -0
  498. package/dist/shared/cache-control.d.ts.map +1 -1
  499. package/dist/shared/cache-control.js +107 -0
  500. package/dist/shared/cache-control.js.map +1 -1
  501. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  502. package/dist/templates/chat/_gitignore +1 -0
  503. package/dist/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  504. package/dist/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  505. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  506. package/dist/templates/default/app/root.tsx +1 -1
  507. package/dist/templates/default/public/manifest.json +2 -2
  508. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  509. package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  510. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  511. package/dist/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  512. package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
  513. package/dist/vite/agents-bundle-plugin.js +8 -7
  514. package/dist/vite/agents-bundle-plugin.js.map +1 -1
  515. package/dist/vite/client.d.ts.map +1 -1
  516. package/dist/vite/client.js +66 -1
  517. package/dist/vite/client.js.map +1 -1
  518. package/docs/content/actions.mdx +2 -2
  519. package/docs/content/agent-surfaces.mdx +1 -1
  520. package/docs/content/authentication.mdx +2 -0
  521. package/docs/content/deployment.mdx +36 -0
  522. package/docs/content/http-api.mdx +266 -0
  523. package/docs/content/syncing-template-changes.mdx +159 -0
  524. package/package.json +4 -3
  525. package/src/a2a/activity.ts +38 -27
  526. package/src/a2a/client.ts +57 -4
  527. package/src/agent/engine/builder-engine.ts +35 -4
  528. package/src/agent/run-manager.ts +20 -1
  529. package/src/agent/run-store.ts +4 -1
  530. package/src/agent/types.ts +28 -8
  531. package/src/chat-threads/store.ts +45 -0
  532. package/src/checkpoints/index.ts +2 -0
  533. package/src/checkpoints/route-match.ts +13 -0
  534. package/src/cli/create.ts +105 -17
  535. package/src/cli/index.ts +20 -0
  536. package/src/cli/template-baseline.ts +410 -0
  537. package/src/cli/template-sync.ts +1004 -0
  538. package/src/cli/templates-meta.ts +1 -0
  539. package/src/client/AssistantChat.tsx +38 -12
  540. package/src/client/NewWorkspaceAppFlow.tsx +75 -10
  541. package/src/client/chat/message-components.tsx +127 -66
  542. package/src/client/chat/tool-call-display.tsx +29 -5
  543. package/src/client/error-format.ts +18 -0
  544. package/src/client/org/OrgSwitcher.tsx +30 -8
  545. package/src/client/org/TeamPage.tsx +7 -6
  546. package/src/client/settings/SettingsPanel.tsx +9 -9
  547. package/src/client/settings/SettingsTabsPage.tsx +12 -2
  548. package/src/client/sse-event-processor.ts +3 -0
  549. package/src/data-widgets/index.ts +41 -0
  550. package/src/deploy/build.ts +11 -9
  551. package/src/extensions/url-safety.ts +67 -4
  552. package/src/integrations/webhook-handler.ts +63 -9
  553. package/src/org/auto-join-domain.ts +4 -3
  554. package/src/org/context.ts +108 -39
  555. package/src/org/index.ts +5 -0
  556. package/src/org/service-identity.ts +60 -0
  557. package/src/provider-api/index.ts +22 -1
  558. package/src/scripts/docs/search.ts +12 -1
  559. package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +25 -36
  560. package/src/server/agent-chat/context-tools.ts +9 -4
  561. package/src/server/agent-chat/framework-prompts.ts +38 -66
  562. package/src/server/agent-chat-plugin.ts +17 -10
  563. package/src/server/agents-bundle.ts +84 -5
  564. package/src/server/auth.ts +4 -3
  565. package/src/server/builder-browser.ts +47 -19
  566. package/src/server/core-routes-plugin.ts +2 -2
  567. package/src/server/credential-provider.ts +209 -68
  568. package/src/server/index.ts +3 -0
  569. package/src/server/prompts/framework-core-compact.ts +6 -13
  570. package/src/server/prompts/framework-core.ts +9 -21
  571. package/src/server/prompts/index.ts +0 -1
  572. package/src/server/prompts/shared-rules.ts +19 -11
  573. package/src/server/ssr-handler.ts +13 -2
  574. package/src/settings/user-settings.ts +13 -1
  575. package/src/shared/cache-control.ts +141 -0
  576. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  577. package/src/templates/chat/_gitignore +1 -0
  578. package/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  579. package/src/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  580. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  581. package/src/templates/default/app/root.tsx +1 -1
  582. package/src/templates/default/public/manifest.json +2 -2
  583. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  584. package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  585. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  586. package/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  587. package/src/vite/agents-bundle-plugin.ts +7 -6
  588. package/src/vite/client.ts +69 -3
@@ -34,12 +34,19 @@ ladder.
34
34
  results with `stageAs` and analyze them with `query-staged-dataset`.
35
35
  - Preserve user-authored content. Prefer targeted edits over wholesale rewrites
36
36
  unless requested.
37
- - For cross-app or Slack artifact requests, create/update the document artifact
38
- through the app action path so it remains visible and shareable.
39
- - Use `view-screen` when the active document, selected block, comment, or Notion
40
- context is unclear.
41
- - Use framework sharing actions for document visibility and grants.
37
+ - Screen context is auto-included as a `<current-screen>` block on every
38
+ message check it before acting instead of calling `view-screen` by
39
+ default. Call `view-screen` explicitly only when that snapshot is truncated
40
+ or doesn't yet reflect something that changed earlier in the same turn (for
41
+ example, right after `create-document` or `navigate`).
42
42
  - Keep public/exported content server-renderable where relevant.
43
+ - The editor uses live Yjs collaboration — raw SQL writes to `documents` won't
44
+ appear in an open editor. Always use `edit-document` or `update-document`,
45
+ and prefer `edit-document` for small changes (it sends only the changed
46
+ text and syncs live via CRDT instead of regenerating the whole document).
47
+ - `create-document`, `update-document`, and `delete-document` already signal
48
+ a UI refresh; only call `refresh-list` directly if you mutate documents
49
+ another way and the UI doesn't update.
43
50
 
44
51
  ## Application State
45
52
 
@@ -86,594 +93,66 @@ Views: `list` (document tree), `editor` (viewing/editing a document).
86
93
 
87
94
  ## Actions
88
95
 
89
- **Always use `pnpm action <name>` for all operations.** Never use `curl`, raw HTTP requests, or `db-exec` with raw SQL for document operations.
96
+ In dev, call actions with `pnpm action <name>`; in production, call native
97
+ tools. Never use `curl`, raw HTTP requests, or `db-exec` with raw SQL for
98
+ document operations. `.env` is loaded automatically — never manually set
99
+ `DATABASE_URL` or other env vars.
90
100
 
91
- ### Cross-App A2A / Slack Artifact Rule
92
-
93
- When a request arrives from Slack, Dispatch, or another app via A2A, the caller cannot see Content's local UI or navigation state. After creating or updating a document, reply with the concrete document ID and URL/path only after the action succeeds. Use `/page/<id>` for private app documents (or `/p/<id>` only for documents you explicitly made public). Never say a document is ready without including the exact ID or URL/path returned by the action.
94
-
95
- **Running actions from the frame:** The terminal cwd is the framework root. Always `cd` to this template's root before running any action:
96
-
97
- ```bash
98
- cd templates/content && pnpm action <name> [args]
99
- ```
100
-
101
- `.env` is loaded automatically — **never manually set `DATABASE_URL` or other env vars**.
102
-
103
- ### Context & Navigation
104
-
105
- | Action | Args | Purpose |
106
- | -------------- | --------------------------------- | -------------------------- |
107
- | `view-screen` | | See what the user sees now |
108
- | `navigate` | `--path <path>` or `--documentId` | Navigate the UI |
109
- | `refresh-list` | | Trigger UI refresh |
110
-
111
- ### Document Operations
112
-
113
- | Action | Args | Purpose |
114
- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
115
- | `list-documents` | `[--format json]` | List document metadata/tree; no full bodies |
116
- | `export-content-source` | `[--format json]` | Export editable docs as `content/*.mdx` source files |
117
- | `import-content-source` | `--files <json> [--dryRun true\|false]` | Import `.md`/`.mdx` source files into editable docs |
118
- | `connect-local-folder-source` | `--connectionId <opaque-id> --label <name> [--spaceId <id>\|--databaseId <id>\|--createSourceBackedSpace true] [--truthPolicy database_primary\|source_primary\|reviewed_bidirectional]` | Connect a trusted browser/Desktop folder registry entry to canonical Files without storing its path or handle in SQL |
119
- | `sync-local-folder-source` | `--sourceId <id> --files <json> [--dryRun true\|false]` | Materialize a connected folder through Files source rows and record concurrent changes for review |
120
- | `sync-manifest-local-folder-source` | `--connectionId <opaque-id> [--file <relative-path>] [--spaceId <id>] [--dryRun true\|false]` | Use the trusted local server bridge to materialize a manifest-declared folder into normal SQL-backed Content |
121
- | `resolve-local-folder-conflict` | `--changeSetId <id> --decision keep_content\|accept_source [--sourceContent <text>]` | Resolve a reviewed folder conflict; accepting requires the exact hashed folder revision |
122
- | `disconnect-local-folder-source` | `--sourceId <id>` | Disconnect a folder adapter without deleting local files or its SQL-backed Content pages |
123
- | `list-builder-docs` | `[--model docs-content\|blog-article] [--limit <n>]` | List Builder docs/blog entries available for `.builder.mdx` pull |
124
- | `pull-builder-doc` | `--model <model> --entryId <builder-entry-id> [--dryRun true\|false]` | Pull one Builder entry into Content and return `.builder.mdx` plus `content/builder/.raw` sidecar files |
125
- | `check-builder-doc` | `--files <json> [--path <file.builder.mdx>]` or `--documentId <id>` | Validate Builder MDX round-trip, sidecar hashes, and remote conflict status before push |
126
- | `push-builder-doc` | `--files <json> [--path <file.builder.mdx>] [--dryRun true\|false]` | Guarded Builder autosave PATCH for the safe Builder test model; never publishes |
127
- | `navigate` | `--path <path>` or `--documentId <id>` or `--databaseId <id>` | Open a route, document page, or database page in the UI |
128
- | `search-documents` | `--query <text> [--format json]` | Search by title/content and return snippets |
129
- | `get-document` | `--id <id> [--format json]` | Get a document with content, stable description, properties, and computed ancestry context |
130
- | `pull-document` | `--id <id> [--format markdown\|text]` | Collab-aware "ingest the final" read |
131
- | `create-document` | `--title <text> [--content] [--description] [--parentId] [--icon]` | Create a document with optional stable guidance about why it exists and what belongs there |
132
- | `edit-document` | `--id <id> --find <text> --replace <text>` | Surgical text edit (preferred for modifications) |
133
- | `edit-document` | `--id <id> --edits <json>` | Batch surgical text edits |
134
- | `update-document` | `--id <id> [--title] [--content] [--description] [--icon]` | Update document fields; descriptions are stable guidance, not summaries of current content |
135
- | `share-local-file-document` | `--id <local-file-document-id>` | Create or refresh a DB-backed shareable copy of a local file document |
136
- | `remove-local-file-source` | `[--sourceRootPath <path>]` | Unlink local-file sources from Content without deleting local Markdown/MDX files |
137
- | `list-local-component-files` | | List registered local MDX component source files |
138
- | `write-local-component-file` | `--workspaceId <id> --path <relative-component-path> --content <source>` | Create or update a file in a registered local `components/` folder |
139
- | `ensure-content-spaces` | | Idempotently provision the signed-in user's personal and current organization Content spaces, system databases, and catalog references |
140
- | `backfill-content-files` | | Assign legacy pages to Content spaces and reconcile exactly one canonical Files database membership per non-system page |
141
- | `list-content-spaces` | | List already-provisioned Content spaces authorized by the signed-in user's current ownership or organization memberships |
142
- | `create-content-space` | `--name <name> --requestId <opaque-id>` | Idempotently create a private named Content workspace with its own canonical Files database |
143
- | `delete-content-space` | `--spaceId <id>` | Permanently delete a user-created Content workspace and all of its content; Personal and organization workspaces are protected |
144
- | `create-content-database` | `[--documentId <id>] [--spaceId <id>] [--parentId <id>] [--title <text>] [--description <text>]` | Create a described database page in a Content space or convert an existing page into a database |
145
- | `create-inline-content-database` | `--hostDocumentId <id> [--title <text>] [--description <text>]` | Create a described database owned by an inline database block in the host document |
146
- | `get-content-database` | `--databaseId <id>` or `--documentId <id>` | Get a database with its description, property/option schema guidance, item pages, and computed ancestry context |
147
- | `list-trashed-content-databases` | | List soft-deleted databases visible in the sidebar Trash surface |
148
- | `restore-content-database` | `--databaseId <id>` | Restore a soft-deleted database from the sidebar Trash surface |
149
- | `list-trashed-documents` | | List access-filtered page roots visible in the sidebar Trash surface |
150
- | `restore-document` | `--id <id>` | Restore a page and the subtree moved to Trash with it |
151
- | `permanently-delete-document` | `--id <id>` | Permanently destroy a document subtree already in Trash |
152
- | `get-content-database-source` | `--databaseId <id>` or `--documentId <id>` | Inspect local/no-source or source-backed status, mappings, row identity, freshness, and change sets |
153
- | `attach-content-database-source` | `--databaseId <id>` or `--documentId <id> [--sourceType mock-local\|builder-cms\|local-table\|notion-database] [--sourceName] [--sourceTable] [--relationshipMode items\|details] [--join <json>]` | Attach a source binding; use `items` to add more Builder rows and `details` to match a read-only local/Notion source onto existing rows |
154
- | `list-notion-database-sources` | `[--query <text>] [--limit <1-100>]` | List Notion data sources visible through the current user's OAuth connection; returns IDs/names only, never tokens |
155
- | `change-content-database-source-role` | `--databaseId <id>` or `--documentId <id> --sourceId <id> --relationshipMode items\|details [--join <json>]` | Change an attached source between adding rows and adding matched detail columns without removing the source |
156
- | `refresh-content-database-source` | `--databaseId <id>` or `--documentId <id>` | Refresh the read-only source status envelope; large Builder CMS sources may return a partial fetch, and another refresh continues loading remaining rows |
157
- | `process-builder-body-hydration` | `--sourceId <id> [--documentId <id>] [--limit <n>]` | Hydrate queued Builder article bodies into readable Content markdown with preserved source-component markers |
158
- | `set-content-database-source-write-mode` | `--databaseId <id>` or `--documentId <id> [--sourceId <id>] --writeMode read_only\|stage_only\|publish_updates [--allowPublicationTransitions true\|false]` | Set the per-source Builder write tier; requires page admin access and remains read-only by default |
159
- | `stage-builder-revision` | `--databaseId <id>` or `--documentId <id>` | Stage pending local Builder CMS changes as a local-only save-revision record; never calls Builder |
160
- | `review-content-database-source-change-set` | `--databaseId <id>` or `--documentId <id> --changeSetId <id> --decision approve\|reject [--note]` | Approve or reject a local source change-set review record without provider writes |
161
- | `stage-builder-source-bulk-update` | `--databaseId <id>` or `--documentId <id> --itemIds <json-array>` or `--documentIds <json-array> --field <json> [--sourceId <id>] [--dryRun true\|false]` | Preview or stage one bounded field update across selected source-backed Builder rows; apply still goes through Builder review/execution |
162
- | `prepare-builder-source-execution` | `--databaseId <id>` or `--documentId <id> --changeSetId <id> [--pushModeConfirmation autosave\|draft\|publish]` | Prepare a dry-run Builder execution gate for approved field/body changes with request semantics/idempotency key; never calls Builder |
163
- | `validate-builder-source-execution` | `--databaseId <id>` or `--documentId <id> --changeSetId <id> [--idempotencyKey <key>]` | Validate/replay a prepared Builder execution gate locally as a dry run; never calls Builder |
164
- | `execute-builder-source-execution` | `--databaseId <id>` or `--documentId <id> --changeSetId <id> [--idempotencyKey <key>] [--pushModeConfirmation autosave\|draft\|publish]` | Execute a guarded live Builder write only when approved, validated, enabled for that source, and idempotent |
165
- | `cancel-prepared-builder-source-update` | `--databaseId <id>` or `--documentId <id> --sourceId <id> --changeSetId <id> [--note <text>]` | Cancel an exact prepared Builder update only when every associated execution is provably pre-dispatch; preserves review and execution history and never calls Builder |
166
- | `add-database-item` | `--databaseId <id> [--title <text>] [--propertyValues <json>]` | Add a page row to a database, optionally seeding property values |
167
- | `submit-content-database-form` | `--databaseId <id> [--viewId <form-view-id>] [--title <text>] [--propertyValues <json>]` | Submit one form response atomically; validates required questions, resolves option labels/IDs, writes Blocks correctly, verifies persistence, and returns the exact row page link |
168
- | `duplicate-database-item` | `--itemId <id>` or `--documentId <id> [--title <text>]` | Duplicate exactly one database row page and its stored property values; for two or more rows, use `duplicate-database-items` once |
169
- | `duplicate-database-items` | `--databaseId <id>` or `--documentId <databaseDocumentId> --itemIds <json-array>` or `--documentIds <json-array>` | Preferred multi-row duplicate action; duplicate multiple database row pages atomically and return ordered duplicate item/document IDs |
170
- | `delete-database-items` | `--databaseId <id>` or `--documentId <databaseDocumentId> --itemIds <json-array>` or `--documentIds <json-array>` | Preferred multi-row delete action; delete multiple database row pages atomically while preserving `delete-document` admin semantics |
171
- | `move-database-item` | `--itemId <id>` or `--documentId <id> --position <number>` | Move a database row page to a new zero-based table position |
172
- | `update-content-database-view` | `--databaseId <id> --viewConfig <json>` | Persist database views, sorts, filters, hidden properties, and view settings |
173
- | `list-document-properties` | `--documentId <id> [--format json]` | List Notion-style property definitions and values for a document |
174
- | `configure-document-property` | `--documentId <id> [--id <propertyId>] --name <name> --type <type> [--description <text>] [--visibility always_show\|hide_when_empty\|always_hide] [--options <json>]` | Create or update a property definition and its option-level guidance |
175
- | `duplicate-document-property` | `--documentId <id> --propertyId <propertyId>` | Duplicate a property definition and its stored values |
176
- | `delete-document-property` | `--documentId <id> --propertyId <propertyId>` | Delete a property definition and its stored values |
177
- | `set-document-property` | `--documentId <id> --propertyId <propertyId> --value <json>` | Set a document property value (for a `blocks` field, the value is its markdown content) |
178
- | `reorder-document-property` | `--documentId <id> --propertyId <propertyId> --targetPropertyId <id> [--position before\|after]` | Reorder a property definition within its database (used to reorder Blocks fields on the page) |
179
- | `set-document-discoverability` | `--id <id> --hideFromSearch true\|false [--includeChildren true\|false]` | Hide/show an org-accessible document in Organization/search while keeping link access |
180
- | `move-document` | `--id <id> [--parentId] [--position]` | Move or reorder a document in the page tree |
181
- | `delete-document` | `--id <id>` | Move a document and its recursive children to Trash |
182
-
183
- Database views follow Notion-style tab labels. When creating or duplicating
184
- views in `viewConfig`, use unique default names (`Table 2`, `SEO copy 2`, etc.)
185
- instead of appending several tabs with the same label.
186
-
187
- ### Self-Documenting Descriptions
188
-
189
- Descriptions are stable semantic guidance, not generated summaries of current
190
- content. Preserve this distinction when reading or writing them:
191
-
192
- - A page description explains why the page exists and what belongs there.
193
- - A database description explains the collection's purpose and inclusion
194
- boundary. Inline and full-page views of one database share the same
195
- description.
196
- - A property description explains what the field means and what value belongs
197
- there.
198
- - A select, status, or multi-select option description explains when to choose
199
- that option.
200
-
201
- Descriptions are owned; context is inherited. Never copy an ancestor's prose
202
- into a child description. Focused reads expose a root-to-parent `contextPath`
203
- so the agent can use ancestor guidance without creating stale duplicates. Read
204
- the returned descriptions before placing content or setting property values.
205
- Update a description only when the object's meaning changes, not whenever its
206
- current content changes.
207
-
208
- **`pull-document` is the collab-aware "ingest the final" read** — prefer it over
209
- `get-document` for external ingest (another app, an external coding agent over
210
- MCP/A2A, an A2A peer). `get-document` returns whatever is in the
211
- `documents.content` SQL column, which can lag behind a live editing session: the
212
- open editor holds the authoritative Y.Doc in memory and only debounces it back
213
- to SQL. `pull-document` closes that gap with a flush handshake — if a live Yjs
214
- collab session exists for the document it writes a one-shot `flush-request-<id>`
215
- application-state key (scoped to the browser session, just like `navigate`); the
216
- open editor sees that key, serializes its current document to markdown through
217
- its own existing serializer, calls `update-document`, and writes an explicit
218
- request-id-matched success/error acknowledgement. `pull-document` waits for that
219
- acknowledgement and fails closed if the open editor cannot save; when no active
220
- human editor is present, the SQL column is authoritative and the handshake is
221
- skipped. It is GET + read-only + public-agent exposed (`requiresAuth: true`),
222
- returns `{ id, title, content, format, deepLink }`, and surfaces an "Open
223
- document" deep link for external agents. Use `--format text` for a plain-text
224
- strip of the markdown.
225
-
226
- ### Local Source Files
227
-
228
- Content has one database-backed document model with optional folder sources:
229
-
230
- - **Local folder sources:** the `/local-files` view links one or more
231
- browser or Agent Native Desktop folders to SQL-backed documents. The UI uses
232
- folder rows: **Pull** calls `sync-local-folder-source`, **Check** runs the
233
- same action with `dryRun: true`, and **Push** uses the source-scoped
234
- `export-content-source`. Imported files become ordinary SQL documents in the
235
- target space's canonical Files database. Preserve frontmatter `id` across
236
- renames; missing files and concurrent changes become reviewable incoming
237
- change sets instead of silently deleting or overwriting a page. SQL stores
238
- only opaque connection identity, relative paths, and hashes. Disconnecting a
239
- folder keeps both the Content pages and disk files.
240
- - **Manifest/CLI bridge:** `agent-native content local-files <target>` remains
241
- as a compatibility spelling, but it launches normal database-backed Content.
242
- `agent-native.json` declares `source.type: "local-folder"` and an opaque
243
- `connectionId`; it does not select a separate application mode. The trusted
244
- local server bridge materializes that source through
245
- `sync-manifest-local-folder-source`.
246
- - **Local MDX components:** local file workspaces can expose React components
247
- from the configured `components` folder. Export PascalCase components such as
248
- `ImpactCounter` from `.tsx` files, then use `<ImpactCounter />` in MDX or pick
249
- it from the editor slash menu under Local components. Simple string props are
250
- previewed. Components can export editable input metadata such as
251
- `ImpactCounterInputs` with `string`, `textarea`, `number`, `boolean`, and
252
- `select` fields; selecting the component in the editor shows a corner edit
253
- button that rewrites the MDX props. JSX expression props are preserved in
254
- source but shown as an unsupported preview.
255
- - **Reusable MDX references:** local-file MDX can embed another local document
256
- with `<ContentReference sourcePath="./shared/example.mdx" />`. The editor
257
- resolves `sourcePath` relative to the current file, previews the referenced
258
- MDX read-only in place, and preserves the original tag in source. Use this for
259
- reusable docs fragments instead of copy/pasting shared content.
260
- - **Builder Symbols:** Builder MDX pulls preserve Symbol blocks as
261
- `<BuilderSymbol ... />`. When Builder returns enriched symbol content, the
262
- pull also writes a referenced `.builder.mdx` file under
263
- `content/builder/symbols/` and sets the Symbol block's `source` attribute.
264
- Edit reusable symbol content in that emitted source file; do not retarget
265
- `entry`, `model`, or `source` in the parent MDX unless a dedicated Builder
266
- retargeting workflow is added.
267
- - **Builder source components:** Builder CMS database body hydration renders
268
- unsupported provider-native body blocks as `<SourceComponent ... />` markers.
269
- These markers include `mappingStatus` and `sourceEditState`: `mapped` /
270
- `safe-to-edit` content has an explicit Markdown/NFM mapper, `preserved` /
271
- `needs-review` content keeps a known Builder/source component intact for
272
- review, and `unknown` / `preserved-only` content is an unmapped provider block
273
- that must round-trip as-is. Treat source-component markers as read-only
274
- preservation anchors, not editable local blocks. Agents may edit surrounding
275
- prose, but must not delete, duplicate, move, or rewrite `rawRef`, `rawHash`,
276
- mapping metadata, or marker ids unless a dedicated provider conversion
277
- workflow exists. Guarded Builder write-back refuses missing, tampered, or
278
- structurally moved markers so source-native components are not lost.
279
- Readable bodies hydrated before source-component mapping may need a fresh
280
- Builder body hydration pass before guarded push, because newly preserved
281
- markers are intentionally treated as structure changes.
282
- - **Picked folders and components:** browser-picked folders can be the
283
- source of truth for `.md`/`.mdx` files, but the browser does not expose an
284
- absolute path that Vite can compile. Component previews from a picked
285
- `components/` folder require Agent Native Desktop or a local Content dev
286
- server. Desktop-selected folders register their workspace path with the local
287
- dev server so Vite can import and hot reload `components/*.tsx`.
288
- - **Agent component edits:** use `list-local-component-files` to find the
289
- registered workspace id, then `write-local-component-file` to add or edit
290
- `.tsx`, `.jsx`, `.ts`, or `.js` files under that workspace's `components/`
291
- folder. The Vite component registry reloads after file additions/removals;
292
- edits to already-loaded files hot reload through Vite.
293
-
294
- Minimal `agent-native.json`:
295
-
296
- ```json
297
- {
298
- "version": 1,
299
- "apps": {
300
- "content": {
301
- "mode": "local-files",
302
- "profile": "docs/no-bookkeeping",
303
- "roots": [
304
- {
305
- "name": "Docs",
306
- "path": "docs",
307
- "profile": "docs/no-bookkeeping",
308
- "extensions": [".md", ".mdx"]
309
- },
310
- { "name": "Blog", "path": "blog", "extensions": [".md", ".mdx"] },
311
- {
312
- "name": "Resources",
313
- "path": "resources",
314
- "extensions": [".md", ".mdx"]
315
- }
316
- ],
317
- "components": "components"
318
- }
319
- }
320
- }
321
- ```
322
-
323
- Launch Content directly against a local folder or file with:
324
-
325
- ```bash
326
- agent-native content local-files docs --profile docs/no-bookkeeping
327
- agent-native content local-files docs/guide.mdx --profile docs/no-bookkeeping
328
- ```
101
+ `view-screen`, `navigate`, and `refresh-list` handle context and UI control.
102
+ `list-documents`, `search-documents`, `get-document`, `pull-document`,
103
+ `create-document`, `edit-document`, `update-document`, and `delete-document`
104
+ cover the core document workflow. Every action carries its own schema. Other
105
+ app-specific tools, including `remove-local-file-source`, are registered; use
106
+ `tool-search` instead of scanning a table here.
329
107
 
330
- In Local File Mode, use the normal document actions (`list-documents`,
331
- `get-document`, `create-document`, `update-document`, `delete-document`) instead
332
- of raw filesystem writes when operating through the app. To share a local file,
333
- call `share-local-file-document --id <local-file-document-id>` first; it creates
334
- or refreshes a database-backed copy and returns the shareable document id.
335
- Provider sync such as Builder.io pull/push should remain a Content-specific
336
- explicit sync action.
337
-
338
- ### Notion Integration
339
-
340
- | Action | Args | Purpose |
341
- | ------------------------------ | ---------------------------------------- | --------------------------------------------------------------------- |
342
- | `connect-notion-status` | | Check Notion connection |
343
- | `link-notion-page` | `--documentId <id> --pageId <id-or-url>` | Link doc to Notion page |
344
- | `list-notion-links` | | List linked documents |
345
- | `pull-notion-page` | `--documentId <id>` | Pull content from Notion |
346
- | `push-notion-page` | `--documentId <id>` | Push content to Notion |
347
- | `sync-notion-comments` | `--documentId <id>` | Sync comments with Notion (bidirectional) |
348
- | `list-notion-database-sources` | `[--query <text>] [--limit <n>]` | List Notion databases available as read-only Content database sources |
349
-
350
- Use `provider-api-catalog`, `provider-api-docs`, and `provider-api-request`
351
- for Notion endpoints, filters, pagination modes, payload shapes, or API
352
- versions that these workflow actions do not model. Use `stageAs` plus
353
- `query-staged-dataset` for large Notion searches or database queries.
354
-
355
- Notion database sources are a bounded read-only pilot. Call
356
- `list-notion-database-sources`, choose the returned data-source ID, use
357
- `suggest-source-join-key`, then call `attach-content-database-source` with
358
- `sourceType: "notion-database"`, `relationshipMode: "details"`, and the
359
- confirmed canonical-key join. Refresh with `refresh-content-database-source`.
360
- Do not promise or attempt Notion database write-back; unsupported property
361
- types remain visible as read-only preservation markers.
362
-
363
- ### Comments
364
-
365
- Comments are Notion/Google-Docs-style **inline comments**. Selecting text and
366
- commenting leaves the passage **highlighted inline** in the editor via a
367
- ProseMirror decoration overlay — nothing is written into the markdown body, so
368
- the NFM/Notion round-trip is unchanged. Each thread stores the quoted text plus
369
- surrounding context (`anchorPrefix`/`anchorSuffix`) and an approximate
370
- `anchorStartOffset`, so the highlight follows the text as the document is
371
- edited, disambiguates repeated text, and degrades gracefully (the thread stays
372
- in the sidebar) when its text is deleted. Resolving a thread clears its
373
- highlight and moves it to a collapsible **"Resolved (n)"** sidebar section where
374
- it can be **reopened** with `update-comment --resolved false`. Comments support
375
- **@mentions** of org members, stored as a `mentions` array of `{email, name}`.
376
-
377
- | Action | Args | Purpose |
378
- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
379
- | `list-comments` | `--documentId <id>` | List threads with anchor fields + parsed mentions |
380
- | `add-comment` | `--documentId <id> --content <text> [--threadId] [--parentId] [--quotedText] [--anchorPrefix] [--anchorSuffix] [--anchorStartOffset] [--authorName] [--mentions <json>]` | Add a comment or reply, optionally anchored inline |
381
- | `update-comment` | `--id <id> [--content <text>] [--resolved true\|false]` | Edit a comment, or resolve/reopen its thread |
382
- | `delete-comment` | `--id <id>` | Delete a comment |
383
-
384
- `add-comment` anchors a thread inline when passed `--quotedText` plus the
385
- surrounding `--anchorPrefix`/`--anchorSuffix` and `--anchorStartOffset`.
386
- `--mentions` is a JSON array of `{email, name}`, e.g.
387
- `'[{"email":"a@x.com","name":"A"}]'`. `--authorName` sets the display name and
388
- defaults to a name derived from the author's email. `--resolved true` resolves a
389
- whole thread; `--resolved false` reopens it.
390
-
391
- ### Versions
392
-
393
- | Action | Args | Purpose |
394
- | -------------------------- | ----------------------------------------- | ---------------------------------- |
395
- | `list-document-versions` | `--documentId <id>` | List saved versions for a document |
396
- | `restore-document-version` | `--documentId <id> --versionId <version>` | Restore a saved document version |
397
-
398
- ### Image Blocks
399
-
400
- Documents support image blocks as markdown images: `![alt text](https://...)`.
401
- The UI uploads local image files through the framework
402
- `/_agent-native/file-upload` endpoint, with Builder.io as the recommended
403
- storage path. If image upload fails because storage is not configured, tell the
404
- user to connect Builder.io in Settings -> File uploads. Agents can add images
405
- that already have a hosted URL by using `edit-document` or `update-document` to
406
- insert markdown image syntax. Do not embed base64 image data in document
407
- content.
408
-
409
- ### Sharing
410
-
411
- Documents are **private by default** — only the creator can see them. To grant access to others, change the visibility or add explicit share grants. These actions are auto-mounted framework-wide:
108
+ ### Cross-App A2A / Slack Artifact Rule
412
109
 
413
- | Action | Args | Purpose |
414
- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
415
- | `share-resource` | `--resourceType document --resourceId <id> --principalType user\|org --principalId <email-or-orgId> --role viewer\|editor\|admin --notify true\|false --resourceUrl /page/<id>` | Grant a user or org access to a document |
416
- | `unshare-resource` | `--resourceType document --resourceId <id> --principalType user\|org --principalId <email-or-orgId>` | Revoke a share grant |
417
- | `list-resource-shares` | `--resourceType document --resourceId <id>` | Show current visibility + all grants |
418
- | `set-resource-visibility` | `--resourceType document --resourceId <id> --visibility private\|org\|public` | Change coarse visibility |
110
+ Create or update the document through the normal action path (never a bespoke route) so the artifact stays visible and shareable. When a request arrives from Slack, Dispatch, or another app via A2A, the caller cannot see Content's local UI or navigation state: reply with the concrete document ID and URL/path only after the action succeeds. Use `/page/<id>` for private app documents (or `/p/<id>` only for documents you explicitly made public). Never say a document is ready without including the exact ID or URL/path returned by the action.
419
111
 
420
- Read (`get-document`, `list-documents`, `search-documents`) admits rows the current user owns, has been shared on, or that match the resource's visibility. Write (`update-document`, `edit-document`) requires `editor` role or above; `delete-document` requires `admin` (owners always satisfy). See the `sharing` skill for the full model.
112
+ ### Deeper Behavior (Read On Demand)
421
113
 
422
- For Notion-style "workspace access but don't list it everywhere," set `visibility` to `org` and then run `set-document-discoverability --id <id> --hideFromSearch true`. Organization members can still open the document with the link, but it is omitted from their Organization sidebar and document search unless they own it or have an explicit share grant. Use `--includeChildren true` (default) when hiding a page with sub-pages so descendants do not leak into the org list.
114
+ - `references/document-behavior.md` (`document-editing` skill) description
115
+ ownership, `pull-document`'s collab-flush handshake vs `get-document`,
116
+ versions, image blocks, sharing/visibility (`/page/<id>` vs `/p/<id>`,
117
+ discoverability, the read-only public chat).
118
+ - `references/local-file-mode.md` (`content` skill) — local folder sources,
119
+ Builder Symbol/source-component preservation, local MDX components.
120
+ - `notion-integration` skill — connecting, sync, conflicts, the read-only
121
+ database-source pilot.
122
+ - `document-editing` skill's Comments section — inline anchor-tracked
123
+ threads, @mentions, resolve/reopen.
423
124
 
424
- Public documents are reachable at `/p/<id>` once visibility is `public`. Anyone with the link can read the page. The public page mounts a read-only agent chat with the document injected as context; public viewers must not create, edit, comment on, delete, or share documents through that chat.
125
+ Documents are **private by default**; use `share-resource` /
126
+ `set-resource-visibility` (`resourceType document`) to change access.
425
127
 
426
128
  ## Common Tasks
427
129
 
428
- | User request | What to do |
429
- | ------------------------------ | ------------------------------------------------------------------------------ |
430
- | "What am I looking at?" | `view-screen` |
431
- | "Create a page about X" | `create-document --title "X" --content "# X\n\n..."` |
432
- | "Explain what belongs here" | `view-screen` to get ID, `update-document --id ... --description "..."` |
433
- | "Find my meeting notes" | `search-documents --query "meeting notes"` |
434
- | "Update the title of this doc" | `view-screen` to get ID, `update-document --id ... --title "New"` |
435
- | "Fix a typo / small edit" | `view-screen` to get ID, `edit-document --id ... --find "old" --replace "new"` |
436
- | "Write new content here" | `view-screen` to get ID, `update-document --id ... --content "..."` |
437
- | "Delete this page" | `view-screen` to get ID, `delete-document --id ...` |
438
- | "Add a sub-page" | `view-screen` to get parent ID, `create-document --title ... --parentId ...` |
439
- | "Move this page" | `view-screen` to get ID, `move-document --id ... --position ...` |
440
- | "Show me the document list" | `list-documents` |
441
- | "Open document X" | `navigate --documentId=<id>` |
442
- | "Go to the list view" | `navigate --path=/` |
443
- | "Pull from Notion" | `view-screen` to get ID, `pull-notion-page --documentId ...` |
444
- | "Push to Notion" | `view-screen` to get ID, `push-notion-page --documentId ...` |
130
+ | User request | What to do |
131
+ | ------------------------- | --------------------------------------------------------------------------------- |
132
+ | "What am I looking at?" | Answer from `<current-screen>` (call `view-screen` only if truncated) |
133
+ | "Create a page about X" | `create-document --title "X" --content "# X\n\n..."` |
134
+ | "Fix a typo / small edit" | ID from `<current-screen>`, `edit-document --id ... --find "old" --replace "new"` |
135
+ | "Delete this page" | ID from `<current-screen>`, `delete-document --id ...` |
445
136
 
446
- After any create, update, or delete operation, the scripts automatically trigger a UI refresh.
137
+ IDs for edits always come from `<current-screen>` or a prior action result
138
+ never guessed.
447
139
 
448
140
  ## Data Model
449
141
 
450
- Documents are stored in the SQL `documents` table via Drizzle ORM:
451
-
452
- | Column | Type | Description |
453
- | ------------------ | ------- | -------------------------------------------------------------------------------- |
454
- | `id` | text | Primary key (12-char hex) |
455
- | `owner_email` | text | Per-user owner; local mode starts as `local@localhost` |
456
- | `org_id` | text | Owner's active org at creation time (nullable) |
457
- | `visibility` | text | `'private' \| 'org' \| 'public'` coarse default (private) |
458
- | `hide_from_search` | integer | `1` hides org-accessible docs from Organization/search while keeping link access |
459
- | `parent_id` | text | Parent document ID (null for root) |
460
- | `title` | text | Document title |
461
- | `content` | text | Markdown content |
462
- | `icon` | text | Emoji icon |
463
- | `position` | integer | Sort order within parent |
464
- | `is_favorite` | integer | Whether favorited (0 or 1) |
465
- | `created_at` | text | ISO timestamp |
466
- | `updated_at` | text | ISO timestamp |
467
-
468
- A companion `document_shares` table holds per-user or per-org grants with a `role` (`viewer | editor | admin`). See the Sharing section above for the share actions.
469
-
470
- Documents form a tree via `parent_id`. Content is stored as markdown.
471
-
472
- Related tables (`document_versions`, `document_comments`, `document_sync_links`) also carry `owner_email` so a workspace can be upgraded cleanly from local mode to a real account without losing document history, comments, or Notion links.
473
-
474
- Databases are document-backed page-level objects. A normal document has no
475
- properties by default. A row in a database is also a document, linked through
476
- `content_database_items`; when that row document opens, it shows the database's
477
- properties. The database page itself renders as a table and owns the schema in
478
- `document_property_definitions.database_id`. Database row documents and their
479
- descendants stay contained by the database and are omitted from the ordinary
480
- sidebar page tree; users open them from the database view or an explicit link.
481
- When a row document is open, the editor shows a small parent-database breadcrumb
482
- above the title so the user can return to the containing database without
483
- relying on the sidebar. The `view-screen` document tree follows the same rule:
484
- database row pages are omitted from the ordinary tree and counted separately as
485
- contained database items. When a database row is open in the side preview,
486
- navigation state includes `databasePreviewDocumentId`, and `view-screen` returns
487
- that row as `databasePreview` with its content and properties. Database
488
- navigation state also includes the active view type, search query, sort count,
489
- the saved database view list, active sort/filter definitions, filter match
490
- mode, saved column calculations, table cell wrapping state, table row density,
491
- collapsed group IDs, calendar or timeline date property IDs/names, the visible
492
- date range for calendar/timeline views, empty-group visibility state, visible
493
- source summary when attached, and database row preview state. Source-aware
494
- metadata lives alongside the database model in `content_database_sources`,
495
- `content_database_source_fields`, `content_database_source_rows`, and
496
- `content_database_source_change_sets`; those tables store binding status, field
497
- mappings, source-qualified row identity/provenance, freshness timestamps, and
498
- proposed local-only diff records without changing the normal table view.
499
- row count, and total row count so agents can tell whether the user is looking
500
- at the full database or a constrained slice. It also includes a capped
501
- `databaseVisibleItems` summary
502
- with row item IDs, document IDs, titles, positions, and visible property value
503
- summaries for the visible rows, so agents can refer to the same rows and cells
504
- the user can currently scan; for calendar and timeline views this summary is
505
- limited to rows in the current visible date window plus rows shown in the
506
- "No date" section. When footer calculations are active, navigation
507
- state also includes `databaseCalculationResults` with the visible result text
508
- for each calculated column. When table rows are selected, navigation state also
509
- includes `databaseSelectedItemCount` and `databaseSelectedItems`, and
510
- `view-screen.databaseCurrentView` mirrors that selected row summary.
511
- `view-screen` exposes the same slice as `databaseCurrentView` alongside the full
512
- database payload. Its row property summaries should mirror the active database
513
- view's property order, hidden-property list, and empty-property visibility
514
- rules. It also marks database page entries in
515
- `documentTree.items[].database`, matching the sidebar's database icon fallback
516
- so agents can distinguish database pages from ordinary pages.
517
- Database views render the row page's custom icon anywhere a row title appears,
518
- falling back to the default page icon when the row has no icon. The database
519
- side preview exposes the same icon picker affordance as a normal page, so users
520
- can set or remove a row page icon without leaving the database. The preview is
521
- an overlay-free, non-modal side peek so the database context stays visible while
522
- the row page is open. Background database interactions should not dismiss it;
523
- use the explicit close control to close the preview. Keep it narrow enough on
524
- desktop that the underlying database still reads as the active context. In table
525
- views, clicking a row title opens that side preview; inline title editing lives
526
- behind the hover pencil affordance.
527
-
528
- Document properties are SQL-backed, Notion-style structured metadata rather
529
- than YAML embedded in the markdown body. Database property definitions support
530
- `text`, `number`, `select`, `multi_select`, `status`, `date`, `person`,
531
- `place`, `files_media` (`Files & media`), `checkbox`, `url`, `email`,
532
- `phone`, `blocks` (Capacities-style rich-text body field), plus computed
533
- `formula`, `id`, `created_time`, `created_by`, and
534
- `last_edited_time`, `last_edited_by`, plus property visibility (`always_show`,
535
- `hide_when_empty`, `always_hide`). The value table stores per-row-document JSON
536
- values.
537
-
538
- **Blocks fields.** A `blocks` field is independent rich-text content per row —
539
- NOT YAML and NOT a pointer to the body. Every database is seeded with one
540
- primary "Content" Blocks field whose content is backed by `documents.content`
541
- (so it reuses the collaborative TipTap/Yjs body editor and existing data
542
- migrates for free). Each additional Blocks field stores its own content in
543
- `document_block_field_contents`, keyed by `(document_id, property_id)`, so no
544
- two Blocks fields ever share content — adding a second Blocks field creates a
545
- new, empty, independent field. On the page: one Blocks field renders chromeless
546
- (no header, just the body); two or more each show their name as a header and are
547
- collapsible and reorderable (the surviving lone field keeps its stored name).
548
- In table views a Blocks column shows a word count (e.g. "412 words"), not the
549
- body. A Blocks field can only be deleted from the database view's column menu
550
- (not from the page body); deleting the last Blocks field warns that it removes
551
- the body for every object of the type. Formula properties store their expression in property options and support
552
- `{Property name}` substitution plus simple numeric math such as `{MSV} * 2`.
553
- Database views support multiple named table, list, gallery, board, calendar, timeline, and form views saved in
554
- `content_databases.view_config_json`. Each view has its own stacked sorts,
555
- type-aware filters with an all/any match mode, per-view hidden property IDs,
556
- column widths, and (for table, list, gallery, and board views) grouping property
557
- or (for calendar/timeline views) date property: text-like fields can use contains/exact/empty
558
- filters, numbers support comparisons, dates support before/after, and
559
- checkboxes support checked/unchecked. Users can reorder stacked sort and filter
560
- conditions from the database toolbar menus, and sort priority follows the same
561
- top-to-bottom order shown in the menu. New rows created from a filtered UI view
562
- inherit simple editable equality and checkbox filters as initial property
563
- values, resolving option labels back to stable option IDs for select, status,
564
- and multi-select filters, so a row created under "Status is Published" remains
565
- visible instead of immediately disappearing. Agents can mirror that behavior by passing
566
- `--propertyValues '{"propertyId":"value"}'` to `add-database-item`. Filter
567
- controls are type-aware: option properties choose from their configured options,
568
- option value editors can search existing options or create a new option from
569
- the typed query, and property settings can rename option labels or change option
570
- colors while preserving stable option IDs. Option-backed filter value pickers
571
- are searchable, can create a new option from the typed query, and can be
572
- cleared without removing the whole filter row. Date properties use date inputs,
573
- and number properties use numeric inputs.
574
- Column header menus can add or clear column sorts, add or replace
575
- type-aware quick filters (including checked/unchecked for checkbox fields),
576
- clear filters for that column, hide property
577
- columns in the current view without changing other views, and resize column
578
- widths. Column headers show compact sort/filter indicators when that column
579
- has active view constraints. Table rows can be selected with row checkboxes, and
580
- the table shows a compact selected-row bar with clear, duplicate, confirmed
581
- delete, and bulk property set actions for editable non-computed fields. Empty table cells stay visually blank while remaining clickable
582
- for editing, and checkbox table cells render as compact checkbox glyphs instead
583
- of "Checked"/"Unchecked" text; clicking a checkbox cell toggles it directly via
584
- `set-document-property`, matching Notion's quieter table surface. Table views
585
- can toggle wrapped cells and row density per view for longer text-heavy tables
586
- or more compact scanning. Table, list, and gallery views can group rows by
587
- status, select, multi-select, or checkbox properties; creating a page inside a
588
- group seeds the grouped property so the new page stays in that group. Grouped
589
- table, list, and gallery sections can be collapsed individually or all at once
590
- per view, and views can hide empty groups to reduce option-backed clutter. Active search, sort, and filter
591
- constraints show as removable chips below the toolbar with a clear-all control,
592
- and every database view shows a Notion-style page count footer that switches to
593
- "count of total" when search or filters reduce the result set. Table views can also save per-column footer
594
- calculations such as count values, count empty, percent empty, sum, average,
595
- count all rows, count unique values, percent filled, checkbox checked/unchecked
596
- summaries, percent checked/unchecked, min/max/median/range numbers, and
597
- earliest/latest/date-range dates in the active view config. Empty constrained views show a clear
598
- search/filter recovery action in the view body. The database Properties menu can
599
- search fields and show or hide all fields for the current view, and it includes
600
- a New property control for adding fields without returning to the table header.
601
- The New property picker supports searching property types by label or machine
602
- name. In unconstrained table views, row drag handles can reorder database item
603
- pages through `move-database-item`; clear search, sort, and filters before
604
- manual reordering. Creating a database row returns the created item IDs and
605
- opens the new row page in the side preview. Duplicating a database row returns
606
- the duplicate item IDs and opens the copied row in the side preview so users can
607
- continue editing the new page immediately, including from table, list, and
608
- gallery row action menus. Board, calendar, and timeline cards expose the same
609
- row action menu without showing table-only manual reorder actions. Deleting the
610
- currently previewed row from any row action menu or from the side preview header
611
- advances to the next row, falls back to the previous row, or closes the preview
612
- when no rows remain. List views render the same row pages as a compact page list
613
- with visible property metadata. Gallery views
614
- render row pages as cards with a preview area and visible property metadata.
615
- Calendar views render row pages on a month grid using a `date`, `created_time`,
616
- or `last_edited_time` property; when the selected date property is editable,
617
- creating a page from a day sets that page's date property to the day. Calendar
618
- and timeline views keep rows without the selected date value reachable in a
619
- compact "No date" section instead of treating them as missing search results.
620
- If a calendar or timeline view has not saved a date property yet, the UI and
621
- `view-screen` both use the same first available date-like property fallback.
622
- Timeline views render the same date-backed row pages in a horizontally
623
- scrollable six-week range, using a per-view start date property and optional
624
- end date property so cards can span multiple days.
625
- Form views render database properties as ordered questions. Each form view owns
626
- its enabled-question order and required flags, so two forms on the same database
627
- can collect different information. Use `submit-content-database-form` for agent,
628
- Slack, MCP, and UI submissions instead of composing `add-database-item` plus
629
- several property writes. The action accepts property definition IDs or exact
630
- property names, accepts select/status option IDs or labels, rejects unknown
631
- options, writes primary and additional Blocks fields to their correct stores in
632
- one transaction, verifies the saved row, and returns `createdItemId`,
633
- `createdDocumentId`, `urlPath`, and `deepLink`.
634
- The active view menu can rename, duplicate, delete, or switch an existing
635
- view's layout between table, list, gallery, calendar, timeline, board, and form while
636
- preserving its sorts, filters, hidden properties, and layout-specific settings.
637
- Board views group
638
- pages by status, select, multi-select, or checkbox
639
- properties, and board columns can be collapsed per view using the same
640
- `collapsedGroupIds` state as grouped table/list/gallery sections, including
641
- collapse-all and expand-all group commands. Board views also honor the per-view
642
- empty-group visibility setting. Changing the group-by property clears stale
643
- collapsed group IDs for that view. Board card
644
- metadata follows the same active-view hidden-property and empty-property
645
- visibility rules as table/list/gallery metadata. Dragging a board card between
646
- columns updates that row page's grouping property through
647
- `set-document-property`. When a board is grouped by status, select, or
648
- multi-select, users can add a new board group from the board itself; this
649
- appends a new option to the grouped property definition.
650
- Use
651
- `create-content-database`, `create-inline-content-database`,
652
- `get-content-database`, `list-trashed-content-databases`,
653
- `restore-content-database`, `add-database-item`, `duplicate-database-item`,
654
- `duplicate-database-items`, `delete-database-items`, `move-database-item`,
655
- `update-content-database-view`, `list-document-properties`,
656
- `configure-document-property`, `set-document-property`,
657
- `duplicate-document-property`, and `delete-document-property`; do not edit
658
- property rows or view config via raw SQL when an action can do it.
659
- When targeting more than one database row, call `duplicate-database-items` or
660
- `delete-database-items` once with a native JSON array of `itemIds` or
661
- `documentIds`. Do not loop `duplicate-database-item` or `delete-document` for
662
- multi-row duplicate/delete requests.
663
-
664
- ## UI Components
665
-
666
- **Always use shadcn/ui components** from `app/components/ui/` for all standard UI patterns (dialogs, popovers, dropdowns, tooltips, buttons, etc). Never build custom modals or dropdowns with absolute/fixed positioning — use the shadcn primitives instead.
667
-
668
- **Always use Tabler Icons** (`@tabler/icons-react`) for all icons. Never use other icon libraries.
669
-
670
- **Never use browser dialogs** (`window.confirm`, `window.alert`, `window.prompt`) — use shadcn AlertDialog instead.
671
-
672
- ## Rules
673
-
674
- 1. **Use scripts for document operations** — NEVER use raw `db-exec` SQL for documents. Always use `edit-document` or `update-document`. The editor uses real-time Yjs collaboration — raw SQL changes won't appear in the user's editor.
675
- 2. **Prefer `edit-document` for changes** — use `edit-document --find "old" --replace "new"` for modifications. It's faster (no full regeneration) and syncs live to the editor via Yjs CRDT.
676
- 3. **Screen context is auto-included** — check `<current-screen>` in the user's message before acting
677
- 4. **Use markdown for content** — documents store content as markdown
678
- 5. **All AI goes through agent chat** — never call an LLM directly from code
679
- 6. **Run `refresh-list` after changes** — the create/update/delete scripts do this automatically
142
+ Documents live in the SQL `documents` table via Drizzle; the framework
143
+ injects the live column schema separately, so this section only covers
144
+ semantics the schema can't convey:
145
+
146
+ - `document_shares` holds per-user/per-org grants with a `viewer`, `editor`,
147
+ or `admin` role.
148
+ - `document_versions`, `document_comments`, and `document_sync_links` all
149
+ carry `owner_email` so a workspace can upgrade from local mode to a real
150
+ account without losing history, comments, or Notion links.
151
+ - A database is a normal document (`content_databases` +
152
+ `document_property_definitions`) whose rows are also documents, linked
153
+ through `content_database_items`. Row pages are omitted from the ordinary
154
+ sidebar tree they're reached through the database view.
155
+
156
+ See `references/databases.md` in the `document-editing` skill for the full
157
+ database behavior reference: property types, Blocks fields, and every view
158
+ type (table, list, gallery, board, calendar, timeline, form).