@agent-native/core 0.121.1 → 0.122.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (465) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +145 -0
  3. package/corpus/core/docs/content/actions.mdx +2 -2
  4. package/corpus/core/docs/content/agent-surfaces.mdx +1 -1
  5. package/corpus/core/docs/content/authentication.mdx +2 -0
  6. package/corpus/core/docs/content/deployment.mdx +36 -0
  7. package/corpus/core/docs/content/getting-started.mdx +477 -115
  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/agent/engine/builder-engine.ts +35 -4
  13. package/corpus/core/src/agent/run-manager.ts +20 -1
  14. package/corpus/core/src/agent/run-store.ts +4 -1
  15. package/corpus/core/src/agent/types.ts +28 -8
  16. package/corpus/core/src/chat-threads/store.ts +45 -0
  17. package/corpus/core/src/checkpoints/index.ts +2 -0
  18. package/corpus/core/src/checkpoints/route-match.ts +13 -0
  19. package/corpus/core/src/cli/create.ts +105 -17
  20. package/corpus/core/src/cli/index.ts +20 -0
  21. package/corpus/core/src/cli/template-baseline.ts +410 -0
  22. package/corpus/core/src/cli/template-sync.ts +1004 -0
  23. package/corpus/core/src/cli/templates-meta.ts +1 -0
  24. package/corpus/core/src/client/AssistantChat.tsx +38 -12
  25. package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +75 -10
  26. package/corpus/core/src/client/chat/message-components.tsx +127 -66
  27. package/corpus/core/src/client/chat/tool-call-display.tsx +29 -5
  28. package/corpus/core/src/client/error-format.ts +18 -0
  29. package/corpus/core/src/client/org/OrgSwitcher.tsx +30 -8
  30. package/corpus/core/src/client/org/TeamPage.tsx +7 -6
  31. package/corpus/core/src/client/sse-event-processor.ts +3 -0
  32. package/corpus/core/src/data-widgets/index.ts +41 -0
  33. package/corpus/core/src/deploy/build.ts +11 -9
  34. package/corpus/core/src/integrations/webhook-handler.ts +63 -9
  35. package/corpus/core/src/org/auto-join-domain.ts +4 -3
  36. package/corpus/core/src/org/context.ts +108 -39
  37. package/corpus/core/src/org/index.ts +5 -0
  38. package/corpus/core/src/org/service-identity.ts +60 -0
  39. package/corpus/core/src/provider-api/index.ts +22 -1
  40. package/corpus/core/src/scripts/docs/search.ts +12 -1
  41. package/corpus/core/src/server/agent-chat/context-tools.ts +9 -4
  42. package/corpus/core/src/server/agent-chat/framework-prompts.ts +38 -66
  43. package/corpus/core/src/server/agent-chat-plugin.ts +17 -10
  44. package/corpus/core/src/server/agents-bundle.ts +84 -5
  45. package/corpus/core/src/server/auth.ts +4 -3
  46. package/corpus/core/src/server/builder-browser.ts +47 -19
  47. package/corpus/core/src/server/core-routes-plugin.ts +2 -2
  48. package/corpus/core/src/server/credential-provider.ts +209 -68
  49. package/corpus/core/src/server/index.ts +3 -0
  50. package/corpus/core/src/server/prompts/framework-core-compact.ts +6 -13
  51. package/corpus/core/src/server/prompts/framework-core.ts +9 -21
  52. package/corpus/core/src/server/prompts/index.ts +0 -1
  53. package/corpus/core/src/server/prompts/shared-rules.ts +19 -11
  54. package/corpus/core/src/server/ssr-handler.ts +13 -2
  55. package/corpus/core/src/settings/user-settings.ts +13 -1
  56. package/corpus/core/src/shared/cache-control.ts +141 -0
  57. package/corpus/core/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  58. package/corpus/core/src/templates/chat/_gitignore +1 -0
  59. package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  60. package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  61. package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  62. package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  63. package/corpus/core/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  64. package/corpus/core/src/vite/agents-bundle-plugin.ts +7 -6
  65. package/corpus/core/src/vite/client.ts +5 -0
  66. package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +4 -5
  67. package/corpus/templates/analytics/.agents/skills/admin-surfaces/SKILL.md +55 -0
  68. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +10 -0
  69. package/corpus/templates/analytics/.agents/skills/dashboard-management/references/template-catalog-and-demo.md +62 -0
  70. package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +85 -0
  71. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +27 -2
  72. package/corpus/templates/analytics/.agents/skills/data-querying/references/inline-chart-embeds.md +139 -0
  73. package/corpus/templates/analytics/.agents/skills/monitoring/SKILL.md +77 -0
  74. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  75. package/corpus/templates/analytics/AGENTS.md +91 -563
  76. package/corpus/templates/analytics/_gitignore +1 -0
  77. package/corpus/templates/analytics/actions/bigquery.ts +12 -4
  78. package/corpus/templates/analytics/actions/generate-chart.ts +5 -5
  79. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -1
  80. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -0
  81. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
  82. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +1 -0
  83. package/corpus/templates/analytics/changelog/2026-07-24-analytics-finds-saved-dashboards-and-queries-far-more-reliab.md +6 -0
  84. package/corpus/templates/analytics/changelog/2026-07-24-notion-access-errors-now-explain-that-a-page-needs-sharing-w.md +6 -0
  85. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +7 -0
  86. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +191 -30
  87. package/corpus/templates/analytics/server/lib/bigquery.ts +11 -1
  88. package/corpus/templates/analytics/server/lib/notion.ts +15 -4
  89. package/corpus/templates/analytics/server/plugins/agent-chat.ts +10 -0
  90. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  91. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  92. package/corpus/templates/brain/_gitignore +1 -0
  93. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  94. package/corpus/templates/calendar/_gitignore +1 -0
  95. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  96. package/corpus/templates/chat/_gitignore +1 -0
  97. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  98. package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +34 -0
  99. package/corpus/templates/clips/AGENTS.md +5 -4
  100. package/corpus/templates/clips/_gitignore +1 -0
  101. package/corpus/templates/clips/actions/cleanup-transcript.ts +5 -0
  102. package/corpus/templates/clips/actions/get-recording-insights.ts +44 -8
  103. package/corpus/templates/clips/actions/get-recording-player-data.ts +39 -70
  104. package/corpus/templates/clips/actions/list-clip-views.ts +2 -4
  105. package/corpus/templates/clips/actions/list-recordings.ts +69 -19
  106. package/corpus/templates/clips/actions/list-viewers.ts +5 -2
  107. package/corpus/templates/clips/actions/regenerate-summary.ts +5 -1
  108. package/corpus/templates/clips/actions/request-transcript.ts +28 -1
  109. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +21 -1
  110. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +14 -1
  111. package/corpus/templates/clips/app/components/player/insights-panel.tsx +8 -20
  112. package/corpus/templates/clips/app/components/player/recording-views-badge.tsx +335 -0
  113. package/corpus/templates/clips/app/components/player/video-player.tsx +13 -8
  114. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -1
  115. package/corpus/templates/clips/app/i18n/en-US.ts +13 -2
  116. package/corpus/templates/clips/app/lib/capture-permissions.ts +110 -0
  117. package/corpus/templates/clips/app/lib/recording-link.ts +32 -0
  118. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +27 -0
  119. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +46 -15
  120. package/corpus/templates/clips/app/routes/record.tsx +77 -31
  121. package/corpus/templates/clips/app/routes/share.$shareId.tsx +42 -31
  122. package/corpus/templates/clips/changelog/2026-07-24-clip-pages-now-show-a-view-count-with-viewer-avatars-next-to.md +6 -0
  123. package/corpus/templates/clips/changelog/2026-07-24-clip-summaries-read-like-a-description-you-d-write-yourself-.md +6 -0
  124. package/corpus/templates/clips/changelog/2026-07-24-clip-view-counts-now-separate-human-views-from-agent-views-s.md +6 -0
  125. package/corpus/templates/clips/changelog/2026-07-24-clips-actions-can-now-be-called-by-org-service-tokens-so-ext.md +6 -0
  126. package/corpus/templates/clips/changelog/2026-07-24-clips-no-longer-briefly-shows-a-dock-icon-while-launching.md +6 -0
  127. package/corpus/templates/clips/changelog/2026-07-24-fixed-owner-and-editor-share-links-redirecting-to-the-record.md +6 -0
  128. package/corpus/templates/clips/changelog/2026-07-24-meeting-and-note-recordings-now-start-as-a-compact-pill-on-t.md +6 -0
  129. package/corpus/templates/clips/changelog/2026-07-24-new-clips-now-copy-a-shareable-link-instead-of-the-owner-onl.md +6 -0
  130. package/corpus/templates/clips/changelog/2026-07-24-opening-a-share-link-as-the-clip-s-owner-now-goes-straight-t.md +6 -0
  131. package/corpus/templates/clips/changelog/2026-07-24-permissions-and-rewind-controls-now-use-compact-consistent-h.md +6 -0
  132. package/corpus/templates/clips/changelog/2026-07-24-quitting-the-desktop-app-no-longer-shows-a-false-macos-crash.md +6 -0
  133. package/corpus/templates/clips/changelog/2026-07-24-screen-recording-permission-errors-now-name-the-exact-app-to.md +6 -0
  134. 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
  135. package/corpus/templates/clips/changelog/2026-07-24-the-recording-toolbar-now-stays-above-other-apps-including-o.md +6 -0
  136. package/corpus/templates/clips/changelog/2026-07-24-transcript-captions-now-use-real-speech-timings-instead-of-a.md +6 -0
  137. package/corpus/templates/clips/changelog/2026-07-24-video-playback-no-longer-stutters-and-replays-the-last-momen.md +6 -0
  138. package/corpus/templates/clips/chrome-extension/src/background.ts +17 -1
  139. package/corpus/templates/clips/desktop/package.json +2 -0
  140. package/corpus/templates/clips/desktop/src/app.tsx +89 -0
  141. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +9 -3
  142. package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +51 -0
  143. package/corpus/templates/clips/desktop/src/lib/native-notification.ts +44 -0
  144. package/corpus/templates/clips/desktop/src/lib/recording-link.ts +67 -0
  145. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +35 -35
  146. package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +3 -2
  147. package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +47 -46
  148. package/corpus/templates/clips/desktop/src/styles.css +127 -78
  149. package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +7 -0
  150. package/corpus/templates/clips/desktop/src-tauri/Info.plist +6 -0
  151. package/corpus/templates/clips/desktop/src-tauri/capabilities/default.json +1 -0
  152. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +7 -3
  153. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +4 -1
  154. package/corpus/templates/clips/desktop/src-tauri/src/main.rs +8 -0
  155. package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +21 -10
  156. package/corpus/templates/clips/desktop/src-tauri/src/util.rs +40 -0
  157. package/corpus/templates/clips/server/db/schema.ts +25 -0
  158. package/corpus/templates/clips/server/lib/agent-views.ts +145 -0
  159. package/corpus/templates/clips/server/lib/public-agent-context.ts +7 -0
  160. package/corpus/templates/clips/server/lib/recording-share-grant.ts +79 -0
  161. package/corpus/templates/clips/server/lib/recordings.ts +51 -3
  162. package/corpus/templates/clips/server/plugins/db.ts +23 -0
  163. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +49 -17
  164. package/corpus/templates/clips/shared/recording-link.ts +43 -0
  165. package/corpus/templates/clips/shared/share-attribution.ts +4 -0
  166. package/corpus/templates/clips/shared/share-dashboard-redirect.ts +42 -0
  167. package/corpus/templates/clips/shared/view-analytics.ts +26 -0
  168. package/corpus/templates/content/.agents/skills/content/SKILL.md +5 -0
  169. package/corpus/templates/content/.agents/skills/content/references/local-file-mode.md +135 -0
  170. package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +12 -0
  171. package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +238 -0
  172. package/corpus/templates/content/.agents/skills/document-editing/references/document-behavior.md +91 -0
  173. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  174. package/corpus/templates/content/AGENTS.md +62 -583
  175. package/corpus/templates/content/_gitignore +1 -0
  176. package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +11 -0
  177. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +50 -8
  178. package/corpus/templates/design/.agents/skills/design-generation/references/code-layers.md +81 -0
  179. package/corpus/templates/design/.agents/skills/design-generation/references/code-workspace.md +42 -0
  180. package/corpus/templates/design/.agents/skills/design-generation/references/editor-extensions.md +34 -0
  181. package/corpus/templates/design/.agents/skills/responsive-breakpoints/SKILL.md +4 -1
  182. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  183. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +17 -0
  184. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +8196 -0
  185. package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +265 -0
  186. package/corpus/templates/design/.generated/bridge/hit-test.generated.ts +642 -0
  187. package/corpus/templates/design/.generated/bridge/motion-preview.generated.ts +571 -0
  188. package/corpus/templates/design/.generated/bridge/nav.generated.ts +91 -0
  189. package/corpus/templates/design/.generated/bridge/sample.generated.ts +23 -0
  190. package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +263 -0
  191. package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +518 -0
  192. package/corpus/templates/design/.generated/bridge/tweak.generated.ts +20 -0
  193. package/corpus/templates/design/.generated/bridge/zoom.generated.ts +32 -0
  194. package/corpus/templates/design/AGENTS.md +88 -503
  195. package/corpus/templates/design/_gitignore +1 -0
  196. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  197. package/corpus/templates/dispatch/_gitignore +1 -0
  198. package/corpus/templates/dispatch/changelog/2026-07-24-signing-in-now-puts-you-in-your-companys-workspace.md +6 -0
  199. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  200. package/corpus/templates/forms/_gitignore +1 -0
  201. package/corpus/templates/forms/server/lib/public-form-ssr.ts +2 -2
  202. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  203. package/corpus/templates/macros/_gitignore +1 -0
  204. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  205. package/corpus/templates/mail/_gitignore +1 -0
  206. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  207. package/corpus/templates/plan/_gitignore +1 -0
  208. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  209. package/corpus/templates/slides/_gitignore +1 -0
  210. package/corpus/templates/slides/server/plugins/db.ts +4 -0
  211. package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  212. package/corpus/templates/tasks/AGENTS.md +1 -1
  213. package/corpus/templates/tasks/_gitignore +1 -0
  214. package/dist/a2a/activity.d.ts +4 -1
  215. package/dist/a2a/activity.d.ts.map +1 -1
  216. package/dist/a2a/activity.js +27 -16
  217. package/dist/a2a/activity.js.map +1 -1
  218. package/dist/agent/engine/builder-engine.d.ts +1 -0
  219. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  220. package/dist/agent/engine/builder-engine.js +31 -4
  221. package/dist/agent/engine/builder-engine.js.map +1 -1
  222. package/dist/agent/run-manager.d.ts.map +1 -1
  223. package/dist/agent/run-manager.js +18 -1
  224. package/dist/agent/run-manager.js.map +1 -1
  225. package/dist/agent/run-store.d.ts +1 -0
  226. package/dist/agent/run-store.d.ts.map +1 -1
  227. package/dist/agent/run-store.js +2 -1
  228. package/dist/agent/run-store.js.map +1 -1
  229. package/dist/agent/types.d.ts +12 -1
  230. package/dist/agent/types.d.ts.map +1 -1
  231. package/dist/agent/types.js +21 -1
  232. package/dist/agent/types.js.map +1 -1
  233. package/dist/chat-threads/store.d.ts +10 -0
  234. package/dist/chat-threads/store.d.ts.map +1 -1
  235. package/dist/chat-threads/store.js +41 -0
  236. package/dist/chat-threads/store.js.map +1 -1
  237. package/dist/checkpoints/index.d.ts +1 -0
  238. package/dist/checkpoints/index.d.ts.map +1 -1
  239. package/dist/checkpoints/index.js +1 -0
  240. package/dist/checkpoints/index.js.map +1 -1
  241. package/dist/checkpoints/route-match.d.ts +8 -0
  242. package/dist/checkpoints/route-match.d.ts.map +1 -0
  243. package/dist/checkpoints/route-match.js +13 -0
  244. package/dist/checkpoints/route-match.js.map +1 -0
  245. package/dist/cli/create.d.ts +35 -4
  246. package/dist/cli/create.d.ts.map +1 -1
  247. package/dist/cli/create.js +69 -19
  248. package/dist/cli/create.js.map +1 -1
  249. package/dist/cli/index.js +19 -0
  250. package/dist/cli/index.js.map +1 -1
  251. package/dist/cli/template-baseline.d.ts +54 -0
  252. package/dist/cli/template-baseline.d.ts.map +1 -0
  253. package/dist/cli/template-baseline.js +334 -0
  254. package/dist/cli/template-baseline.js.map +1 -0
  255. package/dist/cli/template-sync.d.ts +57 -0
  256. package/dist/cli/template-sync.d.ts.map +1 -0
  257. package/dist/cli/template-sync.js +787 -0
  258. package/dist/cli/template-sync.js.map +1 -0
  259. package/dist/cli/templates-meta.d.ts.map +1 -1
  260. package/dist/cli/templates-meta.js +1 -0
  261. package/dist/cli/templates-meta.js.map +1 -1
  262. package/dist/client/AssistantChat.d.ts +2 -1
  263. package/dist/client/AssistantChat.d.ts.map +1 -1
  264. package/dist/client/AssistantChat.js +38 -10
  265. package/dist/client/AssistantChat.js.map +1 -1
  266. package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
  267. package/dist/client/NewWorkspaceAppFlow.js +32 -2
  268. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  269. package/dist/client/chat/message-components.d.ts +20 -0
  270. package/dist/client/chat/message-components.d.ts.map +1 -1
  271. package/dist/client/chat/message-components.js +81 -46
  272. package/dist/client/chat/message-components.js.map +1 -1
  273. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  274. package/dist/client/chat/tool-call-display.js +14 -6
  275. package/dist/client/chat/tool-call-display.js.map +1 -1
  276. package/dist/client/error-format.d.ts.map +1 -1
  277. package/dist/client/error-format.js +13 -0
  278. package/dist/client/error-format.js.map +1 -1
  279. package/dist/client/org/OrgSwitcher.d.ts +8 -1
  280. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  281. package/dist/client/org/OrgSwitcher.js +3 -2
  282. package/dist/client/org/OrgSwitcher.js.map +1 -1
  283. package/dist/client/org/TeamPage.d.ts.map +1 -1
  284. package/dist/client/org/TeamPage.js +1 -1
  285. package/dist/client/org/TeamPage.js.map +1 -1
  286. package/dist/client/sse-event-processor.d.ts.map +1 -1
  287. package/dist/client/sse-event-processor.js +3 -0
  288. package/dist/client/sse-event-processor.js.map +1 -1
  289. package/dist/collab/awareness.d.ts +2 -2
  290. package/dist/collab/awareness.d.ts.map +1 -1
  291. package/dist/data-widgets/index.d.ts +3 -0
  292. package/dist/data-widgets/index.d.ts.map +1 -1
  293. package/dist/data-widgets/index.js +33 -0
  294. package/dist/data-widgets/index.js.map +1 -1
  295. package/dist/deploy/build.d.ts.map +1 -1
  296. package/dist/deploy/build.js +11 -7
  297. package/dist/deploy/build.js.map +1 -1
  298. package/dist/eject/provider-api-definitions.d.ts +1 -0
  299. package/dist/eject/provider-api-definitions.d.ts.map +1 -1
  300. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  301. package/dist/integrations/webhook-handler.js +46 -9
  302. package/dist/integrations/webhook-handler.js.map +1 -1
  303. package/dist/notifications/routes.d.ts +3 -3
  304. package/dist/observability/routes.d.ts +3 -3
  305. package/dist/org/auto-join-domain.d.ts +3 -2
  306. package/dist/org/auto-join-domain.d.ts.map +1 -1
  307. package/dist/org/auto-join-domain.js +1 -1
  308. package/dist/org/auto-join-domain.js.map +1 -1
  309. package/dist/org/context.d.ts.map +1 -1
  310. package/dist/org/context.js +84 -28
  311. package/dist/org/context.js.map +1 -1
  312. package/dist/org/index.d.ts +1 -0
  313. package/dist/org/index.d.ts.map +1 -1
  314. package/dist/org/index.js +1 -0
  315. package/dist/org/index.js.map +1 -1
  316. package/dist/org/service-identity.d.ts +43 -0
  317. package/dist/org/service-identity.d.ts.map +1 -0
  318. package/dist/org/service-identity.js +34 -0
  319. package/dist/org/service-identity.js.map +1 -0
  320. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  321. package/dist/provider-api/actions/provider-api.d.ts +13 -11
  322. package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
  323. package/dist/provider-api/index.d.ts +4 -0
  324. package/dist/provider-api/index.d.ts.map +1 -1
  325. package/dist/provider-api/index.js +17 -1
  326. package/dist/provider-api/index.js.map +1 -1
  327. package/dist/resources/handlers.d.ts +1 -1
  328. package/dist/scripts/docs/search.d.ts.map +1 -1
  329. package/dist/scripts/docs/search.js +12 -1
  330. package/dist/scripts/docs/search.js.map +1 -1
  331. package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
  332. package/dist/server/agent-chat/context-tools.js +3 -3
  333. package/dist/server/agent-chat/context-tools.js.map +1 -1
  334. package/dist/server/agent-chat/framework-prompts.d.ts +8 -3
  335. package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
  336. package/dist/server/agent-chat/framework-prompts.js +33 -62
  337. package/dist/server/agent-chat/framework-prompts.js.map +1 -1
  338. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  339. package/dist/server/agent-chat-plugin.js +16 -10
  340. package/dist/server/agent-chat-plugin.js.map +1 -1
  341. package/dist/server/agents-bundle.d.ts +18 -0
  342. package/dist/server/agents-bundle.d.ts.map +1 -1
  343. package/dist/server/agents-bundle.js +70 -4
  344. package/dist/server/agents-bundle.js.map +1 -1
  345. package/dist/server/auth.d.ts.map +1 -1
  346. package/dist/server/auth.js +4 -3
  347. package/dist/server/auth.js.map +1 -1
  348. package/dist/server/builder-browser.d.ts.map +1 -1
  349. package/dist/server/builder-browser.js +43 -19
  350. package/dist/server/builder-browser.js.map +1 -1
  351. package/dist/server/core-routes-plugin.js +2 -2
  352. package/dist/server/core-routes-plugin.js.map +1 -1
  353. package/dist/server/credential-provider.d.ts +38 -2
  354. package/dist/server/credential-provider.d.ts.map +1 -1
  355. package/dist/server/credential-provider.js +142 -64
  356. package/dist/server/credential-provider.js.map +1 -1
  357. package/dist/server/index.d.ts +1 -1
  358. package/dist/server/index.d.ts.map +1 -1
  359. package/dist/server/index.js +1 -1
  360. package/dist/server/index.js.map +1 -1
  361. package/dist/server/prompts/framework-core-compact.d.ts +1 -1
  362. package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
  363. package/dist/server/prompts/framework-core-compact.js +7 -13
  364. package/dist/server/prompts/framework-core-compact.js.map +1 -1
  365. package/dist/server/prompts/framework-core.d.ts +1 -1
  366. package/dist/server/prompts/framework-core.d.ts.map +1 -1
  367. package/dist/server/prompts/framework-core.js +10 -21
  368. package/dist/server/prompts/framework-core.js.map +1 -1
  369. package/dist/server/prompts/index.d.ts +1 -1
  370. package/dist/server/prompts/index.d.ts.map +1 -1
  371. package/dist/server/prompts/index.js +1 -1
  372. package/dist/server/prompts/index.js.map +1 -1
  373. package/dist/server/prompts/shared-rules.d.ts +16 -10
  374. package/dist/server/prompts/shared-rules.d.ts.map +1 -1
  375. package/dist/server/prompts/shared-rules.js +19 -10
  376. package/dist/server/prompts/shared-rules.js.map +1 -1
  377. package/dist/server/ssr-handler.d.ts +1 -1
  378. package/dist/server/ssr-handler.d.ts.map +1 -1
  379. package/dist/server/ssr-handler.js +10 -3
  380. package/dist/server/ssr-handler.js.map +1 -1
  381. package/dist/server/transcribe-voice.d.ts +1 -1
  382. package/dist/settings/user-settings.d.ts.map +1 -1
  383. package/dist/settings/user-settings.js +13 -1
  384. package/dist/settings/user-settings.js.map +1 -1
  385. package/dist/shared/cache-control.d.ts +52 -0
  386. package/dist/shared/cache-control.d.ts.map +1 -1
  387. package/dist/shared/cache-control.js +107 -0
  388. package/dist/shared/cache-control.js.map +1 -1
  389. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  390. package/dist/templates/chat/_gitignore +1 -0
  391. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  392. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  393. package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  394. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  395. package/dist/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  396. package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
  397. package/dist/vite/agents-bundle-plugin.js +8 -7
  398. package/dist/vite/agents-bundle-plugin.js.map +1 -1
  399. package/dist/vite/client.d.ts.map +1 -1
  400. package/dist/vite/client.js +2 -0
  401. package/dist/vite/client.js.map +1 -1
  402. package/docs/content/actions.mdx +2 -2
  403. package/docs/content/agent-surfaces.mdx +1 -1
  404. package/docs/content/authentication.mdx +2 -0
  405. package/docs/content/deployment.mdx +36 -0
  406. package/docs/content/getting-started.mdx +477 -115
  407. package/docs/content/http-api.mdx +266 -0
  408. package/docs/content/syncing-template-changes.mdx +159 -0
  409. package/package.json +4 -3
  410. package/src/a2a/activity.ts +38 -27
  411. package/src/agent/engine/builder-engine.ts +35 -4
  412. package/src/agent/run-manager.ts +20 -1
  413. package/src/agent/run-store.ts +4 -1
  414. package/src/agent/types.ts +28 -8
  415. package/src/chat-threads/store.ts +45 -0
  416. package/src/checkpoints/index.ts +2 -0
  417. package/src/checkpoints/route-match.ts +13 -0
  418. package/src/cli/create.ts +105 -17
  419. package/src/cli/index.ts +20 -0
  420. package/src/cli/template-baseline.ts +410 -0
  421. package/src/cli/template-sync.ts +1004 -0
  422. package/src/cli/templates-meta.ts +1 -0
  423. package/src/client/AssistantChat.tsx +38 -12
  424. package/src/client/NewWorkspaceAppFlow.tsx +75 -10
  425. package/src/client/chat/message-components.tsx +127 -66
  426. package/src/client/chat/tool-call-display.tsx +29 -5
  427. package/src/client/error-format.ts +18 -0
  428. package/src/client/org/OrgSwitcher.tsx +30 -8
  429. package/src/client/org/TeamPage.tsx +7 -6
  430. package/src/client/sse-event-processor.ts +3 -0
  431. package/src/data-widgets/index.ts +41 -0
  432. package/src/deploy/build.ts +11 -9
  433. package/src/integrations/webhook-handler.ts +63 -9
  434. package/src/org/auto-join-domain.ts +4 -3
  435. package/src/org/context.ts +108 -39
  436. package/src/org/index.ts +5 -0
  437. package/src/org/service-identity.ts +60 -0
  438. package/src/provider-api/index.ts +22 -1
  439. package/src/scripts/docs/search.ts +12 -1
  440. package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +25 -36
  441. package/src/server/agent-chat/context-tools.ts +9 -4
  442. package/src/server/agent-chat/framework-prompts.ts +38 -66
  443. package/src/server/agent-chat-plugin.ts +17 -10
  444. package/src/server/agents-bundle.ts +84 -5
  445. package/src/server/auth.ts +4 -3
  446. package/src/server/builder-browser.ts +47 -19
  447. package/src/server/core-routes-plugin.ts +2 -2
  448. package/src/server/credential-provider.ts +209 -68
  449. package/src/server/index.ts +3 -0
  450. package/src/server/prompts/framework-core-compact.ts +6 -13
  451. package/src/server/prompts/framework-core.ts +9 -21
  452. package/src/server/prompts/index.ts +0 -1
  453. package/src/server/prompts/shared-rules.ts +19 -11
  454. package/src/server/ssr-handler.ts +13 -2
  455. package/src/settings/user-settings.ts +13 -1
  456. package/src/shared/cache-control.ts +141 -0
  457. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  458. package/src/templates/chat/_gitignore +1 -0
  459. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  460. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  461. package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  462. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  463. package/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  464. package/src/vite/agents-bundle-plugin.ts +7 -6
  465. package/src/vite/client.ts +5 -0
@@ -0,0 +1,135 @@
1
+ # Local File Mode Reference
2
+
3
+ Content has one database-backed document model with optional folder sources.
4
+ This file covers the folder-source workflow, the manifest/CLI bridge, and
5
+ local MDX components in full; the `content` skill's "Local Folder Sources"
6
+ section is the short version.
7
+
8
+ ## Local folder sources
9
+
10
+ The `/local-files` view links one or more browser or Agent Native Desktop
11
+ folders to SQL-backed documents. The UI uses folder rows: **Pull** calls
12
+ `sync-local-folder-source`, **Check** runs the same action with
13
+ `dryRun: true`, and **Push** uses the source-scoped `export-content-source`.
14
+ Imported files become ordinary SQL documents in the target space's canonical
15
+ Files database. Preserve frontmatter `id` across renames; missing files and
16
+ concurrent changes become reviewable incoming change sets instead of
17
+ silently deleting or overwriting a page. SQL stores only opaque connection
18
+ identity, relative paths, and hashes. Disconnecting a folder keeps both the
19
+ Content pages and disk files.
20
+
21
+ ## Manifest/CLI bridge
22
+
23
+ `agent-native content local-files <target>` remains as a compatibility
24
+ spelling, but it launches normal database-backed Content. `agent-native.json`
25
+ declares `source.type: "local-folder"` and an opaque `connectionId`; it does
26
+ not select a separate application mode. The trusted local server bridge
27
+ materializes that source through `sync-manifest-local-folder-source`.
28
+
29
+ Launch Content directly against a local folder or file with:
30
+
31
+ ```bash
32
+ agent-native content local-files docs --profile docs/no-bookkeeping
33
+ agent-native content local-files docs/guide.mdx --profile docs/no-bookkeeping
34
+ ```
35
+
36
+ Minimal `agent-native.json`:
37
+
38
+ ```json
39
+ {
40
+ "version": 1,
41
+ "apps": {
42
+ "content": {
43
+ "mode": "local-files",
44
+ "profile": "docs/no-bookkeeping",
45
+ "roots": [
46
+ {
47
+ "name": "Docs",
48
+ "path": "docs",
49
+ "profile": "docs/no-bookkeeping",
50
+ "extensions": [".md", ".mdx"]
51
+ },
52
+ { "name": "Blog", "path": "blog", "extensions": [".md", ".mdx"] },
53
+ {
54
+ "name": "Resources",
55
+ "path": "resources",
56
+ "extensions": [".md", ".mdx"]
57
+ }
58
+ ],
59
+ "components": "components"
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ In Local File Mode, use the normal document actions (`list-documents`,
66
+ `get-document`, `create-document`, `update-document`, `delete-document`)
67
+ instead of raw filesystem writes when operating through the app. To share a
68
+ local file, call `share-local-file-document --id <local-file-document-id>`
69
+ first; it creates or refreshes a database-backed copy and returns the
70
+ shareable document id. Provider sync such as Builder.io pull/push should
71
+ remain a Content-specific explicit sync action.
72
+
73
+ ## Local MDX components
74
+
75
+ Local file workspaces can expose React components from the configured
76
+ `components` folder. Export PascalCase components such as `ImpactCounter`
77
+ from `.tsx` files, then use `<ImpactCounter />` in MDX or pick it from the
78
+ editor slash menu under Local components. Simple string props are previewed.
79
+ Components can export editable input metadata such as `ImpactCounterInputs`
80
+ with `string`, `textarea`, `number`, `boolean`, and `select` fields;
81
+ selecting the component in the editor shows a corner edit button that
82
+ rewrites the MDX props. JSX expression props are preserved in source but
83
+ shown as an unsupported preview.
84
+
85
+ ## Reusable MDX references
86
+
87
+ Local-file MDX can embed another local document with
88
+ `<ContentReference sourcePath="./shared/example.mdx" />`. The editor resolves
89
+ `sourcePath` relative to the current file, previews the referenced MDX
90
+ read-only in place, and preserves the original tag in source. Use this for
91
+ reusable docs fragments instead of copy/pasting shared content.
92
+
93
+ ## Builder Symbols
94
+
95
+ Builder MDX pulls preserve Symbol blocks as `<BuilderSymbol ... />`. When
96
+ Builder returns enriched symbol content, the pull also writes a referenced
97
+ `.builder.mdx` file under `content/builder/symbols/` and sets the Symbol
98
+ block's `source` attribute. Edit reusable symbol content in that emitted
99
+ source file; do not retarget `entry`, `model`, or `source` in the parent MDX
100
+ unless a dedicated Builder retargeting workflow is added.
101
+
102
+ ## Builder source components
103
+
104
+ Builder CMS database body hydration renders unsupported provider-native body
105
+ blocks as `<SourceComponent ... />` markers. These markers include
106
+ `mappingStatus` and `sourceEditState`: `mapped` / `safe-to-edit` content has
107
+ an explicit Markdown/NFM mapper, `preserved` / `needs-review` content keeps a
108
+ known Builder/source component intact for review, and `unknown` /
109
+ `preserved-only` content is an unmapped provider block that must round-trip
110
+ as-is. Treat source-component markers as read-only preservation anchors, not
111
+ editable local blocks. Agents may edit surrounding prose, but must not
112
+ delete, duplicate, move, or rewrite `rawRef`, `rawHash`, mapping metadata, or
113
+ marker ids unless a dedicated provider conversion workflow exists. Guarded
114
+ Builder write-back refuses missing, tampered, or structurally moved markers
115
+ so source-native components are not lost. Readable bodies hydrated before
116
+ source-component mapping may need a fresh Builder body hydration pass before
117
+ guarded push, because newly preserved markers are intentionally treated as
118
+ structure changes.
119
+
120
+ ## Picked folders and components
121
+
122
+ Browser-picked folders can be the source of truth for `.md`/`.mdx` files, but
123
+ the browser does not expose an absolute path that Vite can compile. Component
124
+ previews from a picked `components/` folder require Agent Native Desktop or a
125
+ local Content dev server. Desktop-selected folders register their workspace
126
+ path with the local dev server so Vite can import and hot reload
127
+ `components/*.tsx`.
128
+
129
+ ## Agent component edits
130
+
131
+ Use `list-local-component-files` to find the registered workspace id, then
132
+ `write-local-component-file` to add or edit `.tsx`, `.jsx`, `.ts`, or `.js`
133
+ files under that workspace's `components/` folder. The Vite component
134
+ registry reloads after file additions/removals; edits to already-loaded files
135
+ hot reload through Vite.
@@ -205,3 +205,15 @@ descriptions narrow the guidance further when working with structured values.
205
205
  | "Show me the document tree" | `list-documents` |
206
206
 
207
207
  Always run `refresh-list` after any create, update, or delete operation.
208
+
209
+ ## Reference Files
210
+
211
+ - **`references/document-behavior.md`** — self-documenting descriptions,
212
+ `pull-document`'s collab-flush handshake vs `get-document`, versions, image
213
+ blocks, and the sharing/visibility model (`/page/<id>` vs `/p/<id>`,
214
+ discoverability, the read-only public chat). Read it before touching
215
+ descriptions, external ingest, or a document's visibility.
216
+ - **`references/databases.md`** — full behavioral reference for Content
217
+ databases: property types, Blocks fields, and every view type (table,
218
+ list, gallery, board, calendar, timeline, form). Read it before building or
219
+ modifying database views, properties, or forms.
@@ -0,0 +1,238 @@
1
+ # Content Databases — Behavioral Reference
2
+
3
+ Notion-style databases layered on top of the normal document model. The SQL
4
+ column shapes are injected separately by the framework schema block — this
5
+ file covers behavior the schema can't convey: what each property type means,
6
+ how views work, and which actions own which mutation.
7
+
8
+ ## Databases are document-backed page-level objects
9
+
10
+ A normal document has no properties by default. A row in a database is also a
11
+ document, linked through `content_database_items`; when that row document
12
+ opens, it shows the database's properties. The database page itself renders as
13
+ a table and owns the schema in `document_property_definitions.database_id`.
14
+ Database row documents and their descendants stay contained by the database
15
+ and are omitted from the ordinary sidebar page tree; users open them from the
16
+ database view or an explicit link. When a row document is open, the editor
17
+ shows a small parent-database breadcrumb above the title so the user can
18
+ return to the containing database without relying on the sidebar. The
19
+ `view-screen` document tree follows the same rule: database row pages are
20
+ omitted from the ordinary tree and counted separately as contained database
21
+ items.
22
+
23
+ When a database row is open in the side preview, navigation state includes
24
+ `databasePreviewDocumentId`, and `view-screen` returns that row as
25
+ `databasePreview` with its content and properties. Database navigation state
26
+ also includes the active view type, search query, sort count, the saved
27
+ database view list, active sort/filter definitions, filter match mode, saved
28
+ column calculations, table cell wrapping state, table row density, collapsed
29
+ group IDs, calendar or timeline date property IDs/names, the visible date
30
+ range for calendar/timeline views, empty-group visibility state, visible
31
+ source summary when attached, and database row preview state. Source-aware
32
+ metadata lives alongside the database model in `content_database_sources`,
33
+ `content_database_source_fields`, `content_database_source_rows`, and
34
+ `content_database_source_change_sets`; those tables store binding status,
35
+ field mappings, source-qualified row identity/provenance, freshness
36
+ timestamps, and proposed local-only diff records without changing the normal
37
+ table view.
38
+
39
+ Navigation state includes a capped `databaseVisibleItems` summary with row
40
+ item IDs, document IDs, titles, positions, and visible property value
41
+ summaries for the visible rows, plus row count and total row count, so agents
42
+ can tell whether the user is looking at the full database or a constrained
43
+ slice and can refer to the same rows and cells the user can currently scan;
44
+ for calendar and timeline views this summary is limited to rows in the
45
+ current visible date window plus rows shown in the "No date" section. When
46
+ footer calculations are active, navigation state also includes
47
+ `databaseCalculationResults` with the visible result text for each calculated
48
+ column. When table rows are selected, navigation state also includes
49
+ `databaseSelectedItemCount` and `databaseSelectedItems`, and
50
+ `view-screen.databaseCurrentView` mirrors that selected row summary.
51
+ `view-screen` exposes the same slice as `databaseCurrentView` alongside the
52
+ full database payload. Its row property summaries should mirror the active
53
+ database view's property order, hidden-property list, and empty-property
54
+ visibility rules. It also marks database page entries in
55
+ `documentTree.items[].database`, matching the sidebar's database icon
56
+ fallback so agents can distinguish database pages from ordinary pages.
57
+
58
+ Database views render the row page's custom icon anywhere a row title
59
+ appears, falling back to the default page icon when the row has no icon. The
60
+ database side preview exposes the same icon picker affordance as a normal
61
+ page, so users can set or remove a row page icon without leaving the
62
+ database. The preview is an overlay-free, non-modal side peek so the database
63
+ context stays visible while the row page is open. Background database
64
+ interactions should not dismiss it; use the explicit close control to close
65
+ the preview. Keep it narrow enough on desktop that the underlying database
66
+ still reads as the active context. In table views, clicking a row title opens
67
+ that side preview; inline title editing lives behind the hover pencil
68
+ affordance.
69
+
70
+ ## Property types
71
+
72
+ Document properties are SQL-backed, Notion-style structured metadata rather
73
+ than YAML embedded in the markdown body. Database property definitions
74
+ support `text`, `number`, `select`, `multi_select`, `status`, `date`,
75
+ `person`, `place`, `files_media` (`Files & media`), `checkbox`, `url`,
76
+ `email`, `phone`, `blocks` (Capacities-style rich-text body field), plus
77
+ computed `formula`, `id`, `created_time`, `created_by`, and
78
+ `last_edited_time`, `last_edited_by`, plus property visibility
79
+ (`always_show`, `hide_when_empty`, `always_hide`). The value table stores
80
+ per-row-document JSON values.
81
+
82
+ ### Blocks fields
83
+
84
+ A `blocks` field is independent rich-text content per row — NOT YAML and NOT
85
+ a pointer to the body. Every database is seeded with one primary "Content"
86
+ Blocks field whose content is backed by `documents.content` (so it reuses the
87
+ collaborative TipTap/Yjs body editor and existing data migrates for free).
88
+ Each additional Blocks field stores its own content in
89
+ `document_block_field_contents`, keyed by `(document_id, property_id)`, so no
90
+ two Blocks fields ever share content — adding a second Blocks field creates a
91
+ new, empty, independent field. On the page: one Blocks field renders
92
+ chromeless (no header, just the body); two or more each show their name as a
93
+ header and are collapsible and reorderable (the surviving lone field keeps
94
+ its stored name). In table views a Blocks column shows a word count (e.g.
95
+ "412 words"), not the body. A Blocks field can only be deleted from the
96
+ database view's column menu (not from the page body); deleting the last
97
+ Blocks field warns that it removes the body for every object of the type.
98
+
99
+ Formula properties store their expression in property options and support
100
+ `{Property name}` substitution plus simple numeric math such as `{MSV} * 2`.
101
+
102
+ ## Views
103
+
104
+ Database views support multiple named table, list, gallery, board, calendar,
105
+ timeline, and form views saved in `content_databases.view_config_json`. Each
106
+ view has its own stacked sorts, type-aware filters with an all/any match
107
+ mode, per-view hidden property IDs, column widths, and (for table, list,
108
+ gallery, and board views) grouping property or (for calendar/timeline views)
109
+ date property: text-like fields can use contains/exact/empty filters, numbers
110
+ support comparisons, dates support before/after, and checkboxes support
111
+ checked/unchecked. Users can reorder stacked sort and filter conditions from
112
+ the database toolbar menus, and sort priority follows the same top-to-bottom
113
+ order shown in the menu.
114
+
115
+ New rows created from a filtered UI view inherit simple editable equality and
116
+ checkbox filters as initial property values, resolving option labels back to
117
+ stable option IDs for select, status, and multi-select filters, so a row
118
+ created under "Status is Published" remains visible instead of immediately
119
+ disappearing. Agents can mirror that behavior by passing
120
+ `--propertyValues '{"propertyId":"value"}'` to `add-database-item`. Filter
121
+ controls are type-aware: option properties choose from their configured
122
+ options, option value editors can search existing options or create a new
123
+ option from the typed query, and property settings can rename option labels
124
+ or change option colors while preserving stable option IDs. Option-backed
125
+ filter value pickers are searchable, can create a new option from the typed
126
+ query, and can be cleared without removing the whole filter row. Date
127
+ properties use date inputs, and number properties use numeric inputs.
128
+
129
+ Column header menus can add or clear column sorts, add or replace type-aware
130
+ quick filters (including checked/unchecked for checkbox fields), clear
131
+ filters for that column, hide property columns in the current view without
132
+ changing other views, and resize column widths. Column headers show compact
133
+ sort/filter indicators when that column has active view constraints. Table
134
+ rows can be selected with row checkboxes, and the table shows a compact
135
+ selected-row bar with clear, duplicate, confirmed delete, and bulk property
136
+ set actions for editable non-computed fields. Empty table cells stay
137
+ visually blank while remaining clickable for editing, and checkbox table
138
+ cells render as compact checkbox glyphs instead of "Checked"/"Unchecked"
139
+ text; clicking a checkbox cell toggles it directly via
140
+ `set-document-property`, matching Notion's quieter table surface. Table
141
+ views can toggle wrapped cells and row density per view for longer
142
+ text-heavy tables or more compact scanning.
143
+
144
+ Table, list, and gallery views can group rows by status, select,
145
+ multi-select, or checkbox properties; creating a page inside a group seeds
146
+ the grouped property so the new page stays in that group. Grouped table,
147
+ list, and gallery sections can be collapsed individually or all at once per
148
+ view, and views can hide empty groups to reduce option-backed clutter. Active
149
+ search, sort, and filter constraints show as removable chips below the
150
+ toolbar with a clear-all control, and every database view shows a
151
+ Notion-style page count footer that switches to "count of total" when search
152
+ or filters reduce the result set. Table views can also save per-column
153
+ footer calculations such as count values, count empty, percent empty, sum,
154
+ average, count all rows, count unique values, percent filled, checkbox
155
+ checked/unchecked summaries, percent checked/unchecked, min/max/median/range
156
+ numbers, and earliest/latest/date-range dates in the active view config.
157
+ Empty constrained views show a clear search/filter recovery action in the
158
+ view body. The database Properties menu can search fields and show or hide
159
+ all fields for the current view, and it includes a New property control for
160
+ adding fields without returning to the table header. The New property picker
161
+ supports searching property types by label or machine name.
162
+
163
+ In unconstrained table views, row drag handles can reorder database item
164
+ pages through `move-database-item`; clear search, sort, and filters before
165
+ manual reordering. Creating a database row returns the created item IDs and
166
+ opens the new row page in the side preview. Duplicating a database row
167
+ returns the duplicate item IDs and opens the copied row in the side preview
168
+ so users can continue editing the new page immediately, including from
169
+ table, list, and gallery row action menus. Board, calendar, and timeline
170
+ cards expose the same row action menu without showing table-only manual
171
+ reorder actions. Deleting the currently previewed row from any row action
172
+ menu or from the side preview header advances to the next row, falls back to
173
+ the previous row, or closes the preview when no rows remain.
174
+
175
+ List views render the same row pages as a compact page list with visible
176
+ property metadata. Gallery views render row pages as cards with a preview
177
+ area and visible property metadata.
178
+
179
+ Calendar views render row pages on a month grid using a `date`,
180
+ `created_time`, or `last_edited_time` property; when the selected date
181
+ property is editable, creating a page from a day sets that page's date
182
+ property to the day. Calendar and timeline views keep rows without the
183
+ selected date value reachable in a compact "No date" section instead of
184
+ treating them as missing search results. If a calendar or timeline view has
185
+ not saved a date property yet, the UI and `view-screen` both use the same
186
+ first available date-like property fallback. Timeline views render the same
187
+ date-backed row pages in a horizontally scrollable six-week range, using a
188
+ per-view start date property and optional end date property so cards can
189
+ span multiple days.
190
+
191
+ Form views render database properties as ordered questions. Each form view
192
+ owns its enabled-question order and required flags, so two forms on the same
193
+ database can collect different information. Use `submit-content-database-form`
194
+ for agent, Slack, MCP, and UI submissions instead of composing
195
+ `add-database-item` plus several property writes. The action accepts
196
+ property definition IDs or exact property names, accepts select/status
197
+ option IDs or labels, rejects unknown options, writes primary and additional
198
+ Blocks fields to their correct stores in one transaction, verifies the saved
199
+ row, and returns `createdItemId`, `createdDocumentId`, `urlPath`, and
200
+ `deepLink`.
201
+
202
+ The active view menu can rename, duplicate, delete, or switch an existing
203
+ view's layout between table, list, gallery, calendar, timeline, board, and
204
+ form while preserving its sorts, filters, hidden properties, and
205
+ layout-specific settings.
206
+
207
+ Board views group pages by status, select, multi-select, or checkbox
208
+ properties, and board columns can be collapsed per view using the same
209
+ `collapsedGroupIds` state as grouped table/list/gallery sections, including
210
+ collapse-all and expand-all group commands. Board views also honor the
211
+ per-view empty-group visibility setting. Changing the group-by property
212
+ clears stale collapsed group IDs for that view. Board card metadata follows
213
+ the same active-view hidden-property and empty-property visibility rules as
214
+ table/list/gallery metadata. Dragging a board card between columns updates
215
+ that row page's grouping property through `set-document-property`. When a
216
+ board is grouped by status, select, or multi-select, users can add a new
217
+ board group from the board itself; this appends a new option to the grouped
218
+ property definition.
219
+
220
+ ## Actions
221
+
222
+ Use `create-content-database`, `create-inline-content-database`,
223
+ `get-content-database`, `list-trashed-content-databases`,
224
+ `restore-content-database`, `add-database-item`, `duplicate-database-item`,
225
+ `duplicate-database-items`, `delete-database-items`, `move-database-item`,
226
+ `update-content-database-view`, `list-document-properties`,
227
+ `configure-document-property`, `set-document-property`,
228
+ `duplicate-document-property`, and `delete-document-property`; do not edit
229
+ property rows or view config via raw SQL when an action can do it.
230
+
231
+ When targeting more than one database row, call `duplicate-database-items` or
232
+ `delete-database-items` once with a native JSON array of `itemIds` or
233
+ `documentIds`. Do not loop `duplicate-database-item` or `delete-document` for
234
+ multi-row duplicate/delete requests.
235
+
236
+ Database views follow Notion-style tab labels. When creating or duplicating
237
+ views in `viewConfig`, use unique default names (`Table 2`, `SEO copy 2`,
238
+ etc.) instead of appending several tabs with the same label.
@@ -0,0 +1,91 @@
1
+ # Document Behavior Reference
2
+
3
+ Non-obvious semantics for reading, describing, versioning, illustrating, and
4
+ sharing documents. Read this before doing focused work in one of these areas.
5
+
6
+ ## Self-documenting descriptions
7
+
8
+ Descriptions are stable semantic guidance, not generated summaries of current
9
+ content. Preserve this distinction when reading or writing them:
10
+
11
+ - A page description explains why the page exists and what belongs there.
12
+ - A database description explains the collection's purpose and inclusion
13
+ boundary. Inline and full-page views of one database share the same
14
+ description.
15
+ - A property description explains what the field means and what value
16
+ belongs there.
17
+ - A select, status, or multi-select option description explains when to
18
+ choose that option.
19
+
20
+ Descriptions are owned; context is inherited. Never copy an ancestor's prose
21
+ into a child description. Focused reads expose a root-to-parent `contextPath`
22
+ so the agent can use ancestor guidance without creating stale duplicates.
23
+ Read the returned descriptions before placing content or setting property
24
+ values. Update a description only when the object's meaning changes, not
25
+ whenever its current content changes.
26
+
27
+ ## `pull-document` vs `get-document`
28
+
29
+ **`pull-document` is the collab-aware "ingest the final" read** — prefer it
30
+ over `get-document` for external ingest (another app, an external coding
31
+ agent over MCP/A2A, an A2A peer). `get-document` returns whatever is in the
32
+ `documents.content` SQL column, which can lag behind a live editing session:
33
+ the open editor holds the authoritative Y.Doc in memory and only debounces it
34
+ back to SQL. `pull-document` closes that gap with a flush handshake — if a
35
+ live Yjs collab session exists for the document it writes a one-shot
36
+ `flush-request-<id>` application-state key (scoped to the browser session,
37
+ just like `navigate`); the open editor sees that key, serializes its current
38
+ document to markdown through its own existing serializer, calls
39
+ `update-document`, and writes an explicit request-id-matched success/error
40
+ acknowledgement. `pull-document` waits for that acknowledgement and fails
41
+ closed if the open editor cannot save; when no active human editor is
42
+ present, the SQL column is authoritative and the handshake is skipped. It is
43
+ GET + read-only + public-agent exposed (`requiresAuth: true`), returns
44
+ `{ id, title, content, format, deepLink }`, and surfaces an "Open document"
45
+ deep link for external agents. Use `--format text` for a plain-text strip of
46
+ the markdown.
47
+
48
+ ## Versions
49
+
50
+ `list-document-versions` / `restore-document-version` operate on saved
51
+ document versions. There is no diff view — restoring replaces the current
52
+ content with the selected version's content wholesale.
53
+
54
+ ## Image blocks
55
+
56
+ Documents support image blocks as markdown images: `![alt text](https://...)`.
57
+ The UI uploads local image files through the framework
58
+ `/_agent-native/file-upload` endpoint, with Builder.io as the recommended
59
+ storage path. If image upload fails because storage is not configured, tell
60
+ the user to connect Builder.io in Settings -> File uploads. Agents can add
61
+ images that already have a hosted URL by using `edit-document` or
62
+ `update-document` to insert markdown image syntax. Do not embed base64 image
63
+ data in document content.
64
+
65
+ ## Sharing and visibility
66
+
67
+ Documents are **private by default** — only the creator can see them. To
68
+ grant access to others, change the visibility or add explicit share grants
69
+ using the framework-wide `share-resource` / `unshare-resource` /
70
+ `list-resource-shares` / `set-resource-visibility` actions (`resourceType`
71
+ `document`). See the `sharing` skill for the general access model.
72
+
73
+ Read (`get-document`, `list-documents`, `search-documents`) admits rows the
74
+ current user owns, has been shared on, or that match the resource's
75
+ visibility. Write (`update-document`, `edit-document`) requires `editor` role
76
+ or above; `delete-document` requires `admin` (owners always satisfy).
77
+
78
+ For Notion-style "workspace access but don't list it everywhere," set
79
+ `visibility` to `org` and then run `set-document-discoverability --id <id>
80
+ --hideFromSearch true`. Organization members can still open the document
81
+ with the link, but it is omitted from their Organization sidebar and
82
+ document search unless they own it or have an explicit share grant. Use
83
+ `--includeChildren true` (default) when hiding a page with sub-pages so
84
+ descendants do not leak into the org list.
85
+
86
+ Public documents are reachable at `/p/<id>` once visibility is `public`.
87
+ Anyone with the link can read the page. The public page mounts a read-only
88
+ agent chat with the document injected as context; public viewers must not
89
+ create, edit, comment on, delete, or share documents through that chat.
90
+ Private app documents (any visibility other than a deliberately public link)
91
+ are reached at `/page/<id>`.
@@ -56,7 +56,29 @@ install → refresh scaffold skills → verify, then fix **app** code only.
56
56
  - Runs `skills update scaffold --project`
57
57
  - Runs `typecheck` when the project has that script
58
58
 
59
- 3. **If upgrade or typecheck fails**
59
+ 3. **Pull upstream template changes (optional, separate from the bump)**
60
+
61
+ `agent-native upgrade` moves package versions. It never touches files that
62
+ were copied out of a template at scaffold time, so template fixes and
63
+ improvements do not arrive with a bump.
64
+
65
+ ```bash
66
+ agent-native template status # recorded ref vs latest, drift counts
67
+ agent-native template diff # what upstream changed, read-only
68
+ agent-native template sync # 3-way merge it into the app
69
+ ```
70
+
71
+ `sync` defaults to the ref matching the installed `@agent-native/core`, so
72
+ run it after `upgrade`. It merges per file against a pristine baseline
73
+ stored in `refs/agent-native/template-baseline/<app-path>`; files upstream
74
+ did not touch are left alone, and real collisions get conflict markers.
75
+ After resolving markers, run `agent-native template accept` — the baseline
76
+ deliberately does not advance past an unresolved merge.
77
+
78
+ Apps scaffolded before provenance existed have no baseline. Create one
79
+ with `agent-native template baseline` before the first sync.
80
+
81
+ 4. **If upgrade or typecheck fails**
60
82
 
61
83
  - Read the concrete error
62
84
  - Fix **app** source, actions, config, or env — not framework packages
@@ -68,7 +90,7 @@ install → refresh scaffold skills → verify, then fix **app** code only.
68
90
  copied component; do not use that path to reproduce framework runtime
69
91
  behavior or hide version skew.
70
92
 
71
- 4. **Dry-run / partial runs**
93
+ 5. **Dry-run / partial runs**
72
94
 
73
95
  ```bash
74
96
  agent-native upgrade --dry-run