@agent-native/core 0.14.8 → 0.15.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 (544) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  3. package/dist/agent/engine/builder-engine.js +30 -9
  4. package/dist/agent/engine/builder-engine.js.map +1 -1
  5. package/dist/agent/engine/registry.d.ts.map +1 -1
  6. package/dist/agent/engine/registry.js +14 -4
  7. package/dist/agent/engine/registry.js.map +1 -1
  8. package/dist/agent/production-agent.d.ts.map +1 -1
  9. package/dist/agent/production-agent.js +71 -4
  10. package/dist/agent/production-agent.js.map +1 -1
  11. package/dist/agent/types.d.ts +9 -0
  12. package/dist/agent/types.d.ts.map +1 -1
  13. package/dist/agent/types.js.map +1 -1
  14. package/dist/appearance/actions/change-appearance.d.ts +3 -0
  15. package/dist/appearance/actions/change-appearance.d.ts.map +1 -0
  16. package/dist/appearance/actions/change-appearance.js +29 -0
  17. package/dist/appearance/actions/change-appearance.js.map +1 -0
  18. package/dist/chat-threads/store.d.ts +53 -2
  19. package/dist/chat-threads/store.d.ts.map +1 -1
  20. package/dist/chat-threads/store.js +172 -12
  21. package/dist/chat-threads/store.js.map +1 -1
  22. package/dist/cli/create.d.ts.map +1 -1
  23. package/dist/cli/create.js +114 -37
  24. package/dist/cli/create.js.map +1 -1
  25. package/dist/cli/index.js +30 -4
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/cli/workspace-dev.d.ts +25 -1
  28. package/dist/cli/workspace-dev.d.ts.map +1 -1
  29. package/dist/cli/workspace-dev.js +275 -49
  30. package/dist/cli/workspace-dev.js.map +1 -1
  31. package/dist/client/AgentPanel.d.ts +23 -4
  32. package/dist/client/AgentPanel.d.ts.map +1 -1
  33. package/dist/client/AgentPanel.js +276 -53
  34. package/dist/client/AgentPanel.js.map +1 -1
  35. package/dist/client/AppearancePicker.d.ts +11 -0
  36. package/dist/client/AppearancePicker.d.ts.map +1 -0
  37. package/dist/client/AppearancePicker.js +16 -0
  38. package/dist/client/AppearancePicker.js.map +1 -0
  39. package/dist/client/AssistantChat.d.ts +35 -0
  40. package/dist/client/AssistantChat.d.ts.map +1 -1
  41. package/dist/client/AssistantChat.js +315 -32
  42. package/dist/client/AssistantChat.js.map +1 -1
  43. package/dist/client/ConnectBuilderCard.d.ts.map +1 -1
  44. package/dist/client/ConnectBuilderCard.js +5 -2
  45. package/dist/client/ConnectBuilderCard.js.map +1 -1
  46. package/dist/client/ErrorBoundary.d.ts.map +1 -1
  47. package/dist/client/ErrorBoundary.js +8 -10
  48. package/dist/client/ErrorBoundary.js.map +1 -1
  49. package/dist/client/FeedbackButton.d.ts.map +1 -1
  50. package/dist/client/FeedbackButton.js +1 -1
  51. package/dist/client/FeedbackButton.js.map +1 -1
  52. package/dist/client/MultiTabAssistantChat.d.ts +13 -1
  53. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  54. package/dist/client/MultiTabAssistantChat.js +217 -38
  55. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  56. package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
  57. package/dist/client/NewWorkspaceAppFlow.js +37 -14
  58. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  59. package/dist/client/agent-chat-adapter.d.ts +5 -0
  60. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  61. package/dist/client/agent-chat-adapter.js +4 -0
  62. package/dist/client/agent-chat-adapter.js.map +1 -1
  63. package/dist/client/agent-sidebar-state.d.ts +12 -0
  64. package/dist/client/agent-sidebar-state.d.ts.map +1 -1
  65. package/dist/client/agent-sidebar-state.js +8 -0
  66. package/dist/client/agent-sidebar-state.js.map +1 -1
  67. package/dist/client/analytics.d.ts.map +1 -1
  68. package/dist/client/analytics.js +175 -3
  69. package/dist/client/analytics.js.map +1 -1
  70. package/dist/client/appearance.d.ts +40 -0
  71. package/dist/client/appearance.d.ts.map +1 -0
  72. package/dist/client/appearance.js +114 -0
  73. package/dist/client/appearance.js.map +1 -0
  74. package/dist/client/builder-frame.d.ts +1 -0
  75. package/dist/client/builder-frame.d.ts.map +1 -1
  76. package/dist/client/builder-frame.js +19 -9
  77. package/dist/client/builder-frame.js.map +1 -1
  78. package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
  79. package/dist/client/components/CodeRequiredDialog.js +10 -2
  80. package/dist/client/components/CodeRequiredDialog.js.map +1 -1
  81. package/dist/client/components/ui/dropdown-menu.js +2 -2
  82. package/dist/client/components/ui/dropdown-menu.js.map +1 -1
  83. package/dist/client/components/ui/hover-card.js +1 -1
  84. package/dist/client/components/ui/hover-card.js.map +1 -1
  85. package/dist/client/components/ui/popover.js +1 -1
  86. package/dist/client/components/ui/popover.js.map +1 -1
  87. package/dist/client/composer/PromptComposer.d.ts +7 -0
  88. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  89. package/dist/client/composer/PromptComposer.js +63 -32
  90. package/dist/client/composer/PromptComposer.js.map +1 -1
  91. package/dist/client/composer/TiptapComposer.d.ts +5 -0
  92. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  93. package/dist/client/composer/TiptapComposer.js +36 -6
  94. package/dist/client/composer/TiptapComposer.js.map +1 -1
  95. package/dist/client/composer/useVoiceDictation.d.ts.map +1 -1
  96. package/dist/client/composer/useVoiceDictation.js +13 -1
  97. package/dist/client/composer/useVoiceDictation.js.map +1 -1
  98. package/dist/client/dev-mode.d.ts +14 -0
  99. package/dist/client/dev-mode.d.ts.map +1 -0
  100. package/dist/client/dev-mode.js +14 -0
  101. package/dist/client/dev-mode.js.map +1 -0
  102. package/dist/client/error-format.d.ts +3 -2
  103. package/dist/client/error-format.d.ts.map +1 -1
  104. package/dist/client/error-format.js +9 -2
  105. package/dist/client/error-format.js.map +1 -1
  106. package/dist/client/extensions/EmbeddedTool.d.ts +20 -0
  107. package/dist/client/extensions/EmbeddedTool.d.ts.map +1 -0
  108. package/dist/client/extensions/EmbeddedTool.js +199 -0
  109. package/dist/client/extensions/EmbeddedTool.js.map +1 -0
  110. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  111. package/dist/client/extensions/ExtensionViewer.js +24 -2
  112. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  113. package/dist/client/extensions/ToolEditor.d.ts +5 -0
  114. package/dist/client/extensions/ToolEditor.d.ts.map +1 -0
  115. package/dist/client/extensions/ToolEditor.js +129 -0
  116. package/dist/client/extensions/ToolEditor.js.map +1 -0
  117. package/dist/client/extensions/ToolViewer.d.ts +5 -0
  118. package/dist/client/extensions/ToolViewer.d.ts.map +1 -0
  119. package/dist/client/extensions/ToolViewer.js +400 -0
  120. package/dist/client/extensions/ToolViewer.js.map +1 -0
  121. package/dist/client/extensions/ToolViewerPage.d.ts +2 -0
  122. package/dist/client/extensions/ToolViewerPage.d.ts.map +1 -0
  123. package/dist/client/extensions/ToolViewerPage.js +24 -0
  124. package/dist/client/extensions/ToolViewerPage.js.map +1 -0
  125. package/dist/client/extensions/ToolsListPage.d.ts +2 -0
  126. package/dist/client/extensions/ToolsListPage.d.ts.map +1 -0
  127. package/dist/client/extensions/ToolsListPage.js +67 -0
  128. package/dist/client/extensions/ToolsListPage.js.map +1 -0
  129. package/dist/client/extensions/ToolsSidebarSection.d.ts +2 -0
  130. package/dist/client/extensions/ToolsSidebarSection.d.ts.map +1 -0
  131. package/dist/client/extensions/ToolsSidebarSection.js +236 -0
  132. package/dist/client/extensions/ToolsSidebarSection.js.map +1 -0
  133. package/dist/client/extensions/tool-order.d.ts +7 -0
  134. package/dist/client/extensions/tool-order.d.ts.map +1 -0
  135. package/dist/client/extensions/tool-order.js +47 -0
  136. package/dist/client/extensions/tool-order.js.map +1 -0
  137. package/dist/client/index.d.ts +8 -1
  138. package/dist/client/index.d.ts.map +1 -1
  139. package/dist/client/index.js +7 -0
  140. package/dist/client/index.js.map +1 -1
  141. package/dist/client/onboarding/OnboardingPanel.js +1 -0
  142. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  143. package/dist/client/org/InvitationBanner.d.ts.map +1 -1
  144. package/dist/client/org/InvitationBanner.js +23 -2
  145. package/dist/client/org/InvitationBanner.js.map +1 -1
  146. package/dist/client/org/OrgSwitcher.d.ts +5 -4
  147. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  148. package/dist/client/org/OrgSwitcher.js +57 -9
  149. package/dist/client/org/OrgSwitcher.js.map +1 -1
  150. package/dist/client/org/hooks.d.ts.map +1 -1
  151. package/dist/client/org/hooks.js +10 -6
  152. package/dist/client/org/hooks.js.map +1 -1
  153. package/dist/client/org/workspace-app-links.d.ts +31 -0
  154. package/dist/client/org/workspace-app-links.d.ts.map +1 -0
  155. package/dist/client/org/workspace-app-links.js +268 -0
  156. package/dist/client/org/workspace-app-links.js.map +1 -0
  157. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  158. package/dist/client/resources/ResourcesPanel.js +18 -5
  159. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  160. package/dist/client/resources/use-resources.d.ts +18 -13
  161. package/dist/client/resources/use-resources.d.ts.map +1 -1
  162. package/dist/client/resources/use-resources.js +24 -6
  163. package/dist/client/resources/use-resources.js.map +1 -1
  164. package/dist/client/settings/BackgroundAgentSection.d.ts.map +1 -1
  165. package/dist/client/settings/BackgroundAgentSection.js +9 -1
  166. package/dist/client/settings/BackgroundAgentSection.js.map +1 -1
  167. package/dist/client/settings/BrowserSection.d.ts.map +1 -1
  168. package/dist/client/settings/BrowserSection.js +16 -1
  169. package/dist/client/settings/BrowserSection.js.map +1 -1
  170. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  171. package/dist/client/settings/SettingsPanel.js +4 -1
  172. package/dist/client/settings/SettingsPanel.js.map +1 -1
  173. package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
  174. package/dist/client/settings/VoiceTranscriptionSection.js +5 -5
  175. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  176. package/dist/client/settings/useBuilderStatus.d.ts +8 -0
  177. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  178. package/dist/client/settings/useBuilderStatus.js +50 -13
  179. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  180. package/dist/client/settings/useBuilderStatus.spec.d.ts +2 -0
  181. package/dist/client/settings/useBuilderStatus.spec.d.ts.map +1 -0
  182. package/dist/client/settings/useBuilderStatus.spec.js +64 -0
  183. package/dist/client/settings/useBuilderStatus.spec.js.map +1 -0
  184. package/dist/client/sharing/ShareButton.d.ts +5 -0
  185. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  186. package/dist/client/sharing/ShareButton.js +60 -6
  187. package/dist/client/sharing/ShareButton.js.map +1 -1
  188. package/dist/client/theme.js +1 -1
  189. package/dist/client/theme.js.map +1 -1
  190. package/dist/client/tools/EmbeddedTool.d.ts +20 -0
  191. package/dist/client/tools/EmbeddedTool.d.ts.map +1 -0
  192. package/dist/client/tools/EmbeddedTool.js +199 -0
  193. package/dist/client/tools/EmbeddedTool.js.map +1 -0
  194. package/dist/client/tools/ExtensionSlot.d.ts +27 -0
  195. package/dist/client/tools/ExtensionSlot.d.ts.map +1 -0
  196. package/dist/client/tools/ExtensionSlot.js +96 -0
  197. package/dist/client/tools/ExtensionSlot.js.map +1 -0
  198. package/dist/client/tools/ToolEditor.d.ts +5 -0
  199. package/dist/client/tools/ToolEditor.d.ts.map +1 -0
  200. package/dist/client/tools/ToolEditor.js +129 -0
  201. package/dist/client/tools/ToolEditor.js.map +1 -0
  202. package/dist/client/tools/ToolViewer.d.ts +5 -0
  203. package/dist/client/tools/ToolViewer.d.ts.map +1 -0
  204. package/dist/client/tools/ToolViewer.js +400 -0
  205. package/dist/client/tools/ToolViewer.js.map +1 -0
  206. package/dist/client/tools/ToolViewerPage.d.ts +2 -0
  207. package/dist/client/tools/ToolViewerPage.d.ts.map +1 -0
  208. package/dist/client/tools/ToolViewerPage.js +24 -0
  209. package/dist/client/tools/ToolViewerPage.js.map +1 -0
  210. package/dist/client/tools/ToolsListPage.d.ts +2 -0
  211. package/dist/client/tools/ToolsListPage.d.ts.map +1 -0
  212. package/dist/client/tools/ToolsListPage.js +67 -0
  213. package/dist/client/tools/ToolsListPage.js.map +1 -0
  214. package/dist/client/tools/ToolsSidebarSection.d.ts +2 -0
  215. package/dist/client/tools/ToolsSidebarSection.d.ts.map +1 -0
  216. package/dist/client/tools/ToolsSidebarSection.js +236 -0
  217. package/dist/client/tools/ToolsSidebarSection.js.map +1 -0
  218. package/dist/client/tools/iframe-bridge.d.ts +38 -0
  219. package/dist/client/tools/iframe-bridge.d.ts.map +1 -0
  220. package/dist/client/tools/iframe-bridge.js +207 -0
  221. package/dist/client/tools/iframe-bridge.js.map +1 -0
  222. package/dist/client/tools/index.d.ts +8 -0
  223. package/dist/client/tools/index.d.ts.map +1 -0
  224. package/dist/client/tools/index.js +8 -0
  225. package/dist/client/tools/index.js.map +1 -0
  226. package/dist/client/tools/tool-order.d.ts +7 -0
  227. package/dist/client/tools/tool-order.d.ts.map +1 -0
  228. package/dist/client/tools/tool-order.js +47 -0
  229. package/dist/client/tools/tool-order.js.map +1 -0
  230. package/dist/client/transcription/BuilderTranscriptionCta.d.ts.map +1 -1
  231. package/dist/client/transcription/BuilderTranscriptionCta.js +2 -3
  232. package/dist/client/transcription/BuilderTranscriptionCta.js.map +1 -1
  233. package/dist/client/use-change-version.d.ts +46 -0
  234. package/dist/client/use-change-version.d.ts.map +1 -0
  235. package/dist/client/use-change-version.js +135 -0
  236. package/dist/client/use-change-version.js.map +1 -0
  237. package/dist/client/use-chat-threads.d.ts +16 -2
  238. package/dist/client/use-chat-threads.d.ts.map +1 -1
  239. package/dist/client/use-chat-threads.js +87 -12
  240. package/dist/client/use-chat-threads.js.map +1 -1
  241. package/dist/client/use-chat-threads.spec.d.ts +2 -0
  242. package/dist/client/use-chat-threads.spec.d.ts.map +1 -0
  243. package/dist/client/use-chat-threads.spec.js +85 -0
  244. package/dist/client/use-chat-threads.spec.js.map +1 -0
  245. package/dist/client/use-db-sync.d.ts +5 -2
  246. package/dist/client/use-db-sync.d.ts.map +1 -1
  247. package/dist/client/use-db-sync.js +41 -16
  248. package/dist/client/use-db-sync.js.map +1 -1
  249. package/dist/client/use-pinch-zoom.d.ts +35 -0
  250. package/dist/client/use-pinch-zoom.d.ts.map +1 -0
  251. package/dist/client/use-pinch-zoom.js +105 -0
  252. package/dist/client/use-pinch-zoom.js.map +1 -0
  253. package/dist/deploy/workspace-deploy.d.ts.map +1 -1
  254. package/dist/deploy/workspace-deploy.js +99 -5
  255. package/dist/deploy/workspace-deploy.js.map +1 -1
  256. package/dist/extensions/actions.d.ts.map +1 -1
  257. package/dist/extensions/actions.js +3 -0
  258. package/dist/extensions/actions.js.map +1 -1
  259. package/dist/extensions/store.d.ts +5 -0
  260. package/dist/extensions/store.d.ts.map +1 -1
  261. package/dist/extensions/store.js +16 -1
  262. package/dist/extensions/store.js.map +1 -1
  263. package/dist/file-upload/actions/upload-image.d.ts +3 -0
  264. package/dist/file-upload/actions/upload-image.d.ts.map +1 -0
  265. package/dist/file-upload/actions/upload-image.js +145 -0
  266. package/dist/file-upload/actions/upload-image.js.map +1 -0
  267. package/dist/file-upload/builder.d.ts.map +1 -1
  268. package/dist/file-upload/builder.js +31 -11
  269. package/dist/file-upload/builder.js.map +1 -1
  270. package/dist/file-upload/index.d.ts +1 -0
  271. package/dist/file-upload/index.d.ts.map +1 -1
  272. package/dist/file-upload/index.js +1 -0
  273. package/dist/file-upload/index.js.map +1 -1
  274. package/dist/file-upload/pre-upload-attachments.d.ts +39 -0
  275. package/dist/file-upload/pre-upload-attachments.d.ts.map +1 -0
  276. package/dist/file-upload/pre-upload-attachments.js +110 -0
  277. package/dist/file-upload/pre-upload-attachments.js.map +1 -0
  278. package/dist/file-upload/registry.d.ts.map +1 -1
  279. package/dist/file-upload/registry.js +8 -7
  280. package/dist/file-upload/registry.js.map +1 -1
  281. package/dist/onboarding/default-steps.js +1 -1
  282. package/dist/onboarding/default-steps.js.map +1 -1
  283. package/dist/org/context.d.ts +15 -1
  284. package/dist/org/context.d.ts.map +1 -1
  285. package/dist/org/context.js +25 -0
  286. package/dist/org/context.js.map +1 -1
  287. package/dist/org/handlers.d.ts +2 -2
  288. package/dist/org/handlers.d.ts.map +1 -1
  289. package/dist/org/handlers.js +3 -17
  290. package/dist/org/handlers.js.map +1 -1
  291. package/dist/org/index.d.ts +1 -1
  292. package/dist/org/index.d.ts.map +1 -1
  293. package/dist/org/index.js +1 -1
  294. package/dist/org/index.js.map +1 -1
  295. package/dist/resources/handlers.d.ts +6 -0
  296. package/dist/resources/handlers.d.ts.map +1 -1
  297. package/dist/resources/handlers.js +30 -6
  298. package/dist/resources/handlers.js.map +1 -1
  299. package/dist/resources/script-helpers.d.ts +11 -2
  300. package/dist/resources/script-helpers.d.ts.map +1 -1
  301. package/dist/resources/script-helpers.js +20 -3
  302. package/dist/resources/script-helpers.js.map +1 -1
  303. package/dist/resources/store.d.ts +28 -3
  304. package/dist/resources/store.d.ts.map +1 -1
  305. package/dist/resources/store.js +170 -20
  306. package/dist/resources/store.js.map +1 -1
  307. package/dist/scripts/resources/list.d.ts +1 -1
  308. package/dist/scripts/resources/list.d.ts.map +1 -1
  309. package/dist/scripts/resources/list.js +16 -4
  310. package/dist/scripts/resources/list.js.map +1 -1
  311. package/dist/scripts/resources/write.d.ts +1 -1
  312. package/dist/scripts/resources/write.d.ts.map +1 -1
  313. package/dist/scripts/resources/write.js +47 -3
  314. package/dist/scripts/resources/write.js.map +1 -1
  315. package/dist/server/action-discovery.d.ts.map +1 -1
  316. package/dist/server/action-discovery.js +8 -3
  317. package/dist/server/action-discovery.js.map +1 -1
  318. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  319. package/dist/server/agent-chat-plugin.js +214 -25
  320. package/dist/server/agent-chat-plugin.js.map +1 -1
  321. package/dist/server/agent-discovery.d.ts +35 -0
  322. package/dist/server/agent-discovery.d.ts.map +1 -1
  323. package/dist/server/agent-discovery.js +139 -8
  324. package/dist/server/agent-discovery.js.map +1 -1
  325. package/dist/server/app-url.d.ts +12 -6
  326. package/dist/server/app-url.d.ts.map +1 -1
  327. package/dist/server/app-url.js +58 -11
  328. package/dist/server/app-url.js.map +1 -1
  329. package/dist/server/auth.d.ts +22 -0
  330. package/dist/server/auth.d.ts.map +1 -1
  331. package/dist/server/auth.js +316 -65
  332. package/dist/server/auth.js.map +1 -1
  333. package/dist/server/better-auth-instance.d.ts +0 -4
  334. package/dist/server/better-auth-instance.d.ts.map +1 -1
  335. package/dist/server/better-auth-instance.js +0 -3
  336. package/dist/server/better-auth-instance.js.map +1 -1
  337. package/dist/server/builder-browser.d.ts.map +1 -1
  338. package/dist/server/builder-browser.js +23 -0
  339. package/dist/server/builder-browser.js.map +1 -1
  340. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  341. package/dist/server/core-routes-plugin.js +29 -14
  342. package/dist/server/core-routes-plugin.js.map +1 -1
  343. package/dist/server/credential-provider.d.ts +14 -0
  344. package/dist/server/credential-provider.d.ts.map +1 -1
  345. package/dist/server/credential-provider.js +88 -11
  346. package/dist/server/credential-provider.js.map +1 -1
  347. package/dist/server/google-auth-plugin.d.ts.map +1 -1
  348. package/dist/server/google-auth-plugin.js +65 -17
  349. package/dist/server/google-auth-plugin.js.map +1 -1
  350. package/dist/server/google-oauth.d.ts.map +1 -1
  351. package/dist/server/google-oauth.js +47 -17
  352. package/dist/server/google-oauth.js.map +1 -1
  353. package/dist/server/index.d.ts +1 -1
  354. package/dist/server/index.d.ts.map +1 -1
  355. package/dist/server/index.js +1 -1
  356. package/dist/server/index.js.map +1 -1
  357. package/dist/server/local-migration.d.ts +41 -0
  358. package/dist/server/local-migration.d.ts.map +1 -0
  359. package/dist/server/local-migration.js +235 -0
  360. package/dist/server/local-migration.js.map +1 -0
  361. package/dist/server/oauth-public-origin.d.ts.map +1 -1
  362. package/dist/server/oauth-public-origin.js +19 -1
  363. package/dist/server/oauth-public-origin.js.map +1 -1
  364. package/dist/server/onboarding-html.d.ts.map +1 -1
  365. package/dist/server/onboarding-html.js +74 -19
  366. package/dist/server/onboarding-html.js.map +1 -1
  367. package/dist/server/poll.d.ts.map +1 -1
  368. package/dist/server/poll.js +20 -5
  369. package/dist/server/poll.js.map +1 -1
  370. package/dist/server/request-context.d.ts +8 -0
  371. package/dist/server/request-context.d.ts.map +1 -1
  372. package/dist/server/request-context.js.map +1 -1
  373. package/dist/shared/index.d.ts +2 -0
  374. package/dist/shared/index.d.ts.map +1 -1
  375. package/dist/shared/index.js +2 -0
  376. package/dist/shared/index.js.map +1 -1
  377. package/dist/shared/llm-connection.d.ts +10 -0
  378. package/dist/shared/llm-connection.d.ts.map +1 -0
  379. package/dist/shared/llm-connection.js +29 -0
  380. package/dist/shared/llm-connection.js.map +1 -0
  381. package/dist/shared/workspace-app-audience.d.ts +25 -0
  382. package/dist/shared/workspace-app-audience.d.ts.map +1 -0
  383. package/dist/shared/workspace-app-audience.js +126 -0
  384. package/dist/shared/workspace-app-audience.js.map +1 -0
  385. package/dist/shared/workspace-app-id.d.ts +1 -1
  386. package/dist/shared/workspace-app-id.d.ts.map +1 -1
  387. package/dist/shared/workspace-app-id.js +1 -0
  388. package/dist/shared/workspace-app-id.js.map +1 -1
  389. package/dist/sharing/access.d.ts.map +1 -1
  390. package/dist/sharing/access.js +46 -5
  391. package/dist/sharing/access.js.map +1 -1
  392. package/dist/sharing/actions/list-resource-shares.d.ts.map +1 -1
  393. package/dist/sharing/actions/list-resource-shares.js +8 -1
  394. package/dist/sharing/actions/list-resource-shares.js.map +1 -1
  395. package/dist/sharing/actions/set-resource-visibility.d.ts.map +1 -1
  396. package/dist/sharing/actions/set-resource-visibility.js +12 -3
  397. package/dist/sharing/actions/set-resource-visibility.js.map +1 -1
  398. package/dist/sharing/actions/share-resource.d.ts.map +1 -1
  399. package/dist/sharing/actions/share-resource.js +50 -1
  400. package/dist/sharing/actions/share-resource.js.map +1 -1
  401. package/dist/sharing/registry.d.ts +26 -0
  402. package/dist/sharing/registry.d.ts.map +1 -1
  403. package/dist/sharing/registry.js.map +1 -1
  404. package/dist/styles/agent-native.css +91 -0
  405. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +72 -0
  406. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +60 -37
  407. package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +28 -17
  408. package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +79 -0
  409. package/dist/templates/default/AGENTS.md +22 -19
  410. package/dist/templates/default/actions/navigate.ts +3 -0
  411. package/dist/templates/default/app/hooks/use-navigation-state.ts +29 -5
  412. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +251 -0
  413. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +264 -0
  414. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +130 -0
  415. package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +112 -0
  416. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +88 -0
  417. package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +191 -0
  418. package/dist/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +74 -0
  419. package/dist/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +75 -0
  420. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +190 -0
  421. package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +168 -0
  422. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +163 -0
  423. package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +205 -0
  424. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +720 -0
  425. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +92 -0
  426. package/dist/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +285 -0
  427. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +192 -0
  428. package/dist/templates/workspace-core/.agents/skills/onboarding/SKILL.md +43 -0
  429. package/dist/templates/workspace-core/.agents/skills/portability/SKILL.md +84 -0
  430. package/dist/templates/workspace-core/.agents/skills/qa/SKILL.md +313 -0
  431. package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +112 -0
  432. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +165 -0
  433. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +41 -0
  434. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +239 -0
  435. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +191 -0
  436. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +79 -0
  437. package/dist/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +73 -0
  438. package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +79 -0
  439. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +217 -0
  440. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +132 -0
  441. package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +150 -0
  442. package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +124 -0
  443. package/dist/templates/workspace-core/AGENTS.md +16 -1
  444. package/dist/templates/workspace-root/AGENTS.md +35 -0
  445. package/dist/templates/workspace-root/README.md +7 -0
  446. package/dist/tools/actions.d.ts +3 -0
  447. package/dist/tools/actions.d.ts.map +1 -0
  448. package/dist/tools/actions.js +272 -0
  449. package/dist/tools/actions.js.map +1 -0
  450. package/dist/tools/fetch-tool.d.ts +23 -0
  451. package/dist/tools/fetch-tool.d.ts.map +1 -0
  452. package/dist/tools/fetch-tool.js +178 -0
  453. package/dist/tools/fetch-tool.js.map +1 -0
  454. package/dist/tools/html-shell.d.ts +45 -0
  455. package/dist/tools/html-shell.d.ts.map +1 -0
  456. package/dist/tools/html-shell.js +514 -0
  457. package/dist/tools/html-shell.js.map +1 -0
  458. package/dist/tools/proxy-security.d.ts +12 -0
  459. package/dist/tools/proxy-security.d.ts.map +1 -0
  460. package/dist/tools/proxy-security.js +158 -0
  461. package/dist/tools/proxy-security.js.map +1 -0
  462. package/dist/tools/routes.d.ts +2 -0
  463. package/dist/tools/routes.d.ts.map +1 -0
  464. package/dist/tools/routes.js +627 -0
  465. package/dist/tools/routes.js.map +1 -0
  466. package/dist/tools/schema.d.ts +664 -0
  467. package/dist/tools/schema.d.ts.map +1 -0
  468. package/dist/tools/schema.js +146 -0
  469. package/dist/tools/schema.js.map +1 -0
  470. package/dist/tools/slots/routes.d.ts +15 -0
  471. package/dist/tools/slots/routes.d.ts.map +1 -0
  472. package/dist/tools/slots/routes.js +94 -0
  473. package/dist/tools/slots/routes.js.map +1 -0
  474. package/dist/tools/slots/schema.d.ts +303 -0
  475. package/dist/tools/slots/schema.d.ts.map +1 -0
  476. package/dist/tools/slots/schema.js +76 -0
  477. package/dist/tools/slots/schema.js.map +1 -0
  478. package/dist/tools/slots/store.d.ts +66 -0
  479. package/dist/tools/slots/store.d.ts.map +1 -0
  480. package/dist/tools/slots/store.js +227 -0
  481. package/dist/tools/slots/store.js.map +1 -0
  482. package/dist/tools/store.d.ts +40 -0
  483. package/dist/tools/store.d.ts.map +1 -0
  484. package/dist/tools/store.js +193 -0
  485. package/dist/tools/store.js.map +1 -0
  486. package/dist/tools/theme.d.ts +2 -0
  487. package/dist/tools/theme.d.ts.map +1 -0
  488. package/dist/tools/theme.js +67 -0
  489. package/dist/tools/theme.js.map +1 -0
  490. package/dist/tools/url-safety.d.ts +24 -0
  491. package/dist/tools/url-safety.d.ts.map +1 -0
  492. package/dist/tools/url-safety.js +224 -0
  493. package/dist/tools/url-safety.js.map +1 -0
  494. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  495. package/dist/vite/action-types-plugin.js +4 -0
  496. package/dist/vite/action-types-plugin.js.map +1 -1
  497. package/docs/content/authentication.md +36 -0
  498. package/docs/content/creating-templates.md +15 -0
  499. package/docs/content/dispatch.md +3 -3
  500. package/docs/content/multi-app-workspace.md +5 -0
  501. package/docs/content/tracking.md +12 -0
  502. package/docs/content/workspace-management.md +39 -4
  503. package/package.json +15 -12
  504. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +72 -0
  505. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +60 -37
  506. package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +28 -17
  507. package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +79 -0
  508. package/src/templates/default/AGENTS.md +22 -19
  509. package/src/templates/default/actions/navigate.ts +3 -0
  510. package/src/templates/default/app/hooks/use-navigation-state.ts +29 -5
  511. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +251 -0
  512. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +264 -0
  513. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +130 -0
  514. package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +112 -0
  515. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +88 -0
  516. package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +191 -0
  517. package/src/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +74 -0
  518. package/src/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +75 -0
  519. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +190 -0
  520. package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +168 -0
  521. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +163 -0
  522. package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +205 -0
  523. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +720 -0
  524. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +92 -0
  525. package/src/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +285 -0
  526. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +192 -0
  527. package/src/templates/workspace-core/.agents/skills/onboarding/SKILL.md +43 -0
  528. package/src/templates/workspace-core/.agents/skills/portability/SKILL.md +84 -0
  529. package/src/templates/workspace-core/.agents/skills/qa/SKILL.md +313 -0
  530. package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +112 -0
  531. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +165 -0
  532. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +41 -0
  533. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +239 -0
  534. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +191 -0
  535. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +79 -0
  536. package/src/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +73 -0
  537. package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +79 -0
  538. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +217 -0
  539. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +132 -0
  540. package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +150 -0
  541. package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +124 -0
  542. package/src/templates/workspace-core/AGENTS.md +16 -1
  543. package/src/templates/workspace-root/AGENTS.md +35 -0
  544. package/src/templates/workspace-root/README.md +7 -0
@@ -1 +1 @@
1
- {"version":3,"file":"agent-chat-plugin.d.ts","sourceRoot":"","sources":["../../src/server/agent-chat-plugin.ts"],"names":[],"mappings":"AAaA,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AAStC,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAElB,eAAe,EAEhB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAUjB,MAAM,wBAAwB,CAAC;AAuDhC,OAAO,EAGL,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAsErC,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,cAAc,EAAE,EACjC,WAAW,EAAE,SAAS,oBAAoB,EAAE,EAC5C,OAAO,G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ACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;KACrC,CAAC,CAAC;IACP;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAo3BD,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,cAAc,CA66FhB;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,cAAwC,CAAC;AAa9E,yEAAyE;AACzE,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAE7D"}
@@ -13,7 +13,7 @@ import { buildAssistantMessage, buildUserMessage, extractThreadMeta, mergeThread
13
13
  import { createError, defineEventHandler, setResponseStatus, setResponseHeader, getMethod, getQuery, getHeader, } from "h3";
14
14
  import { getSession } from "./auth.js";
15
15
  import { getOrigin } from "./google-oauth.js";
16
- import { createThread, forkThread, getThread, listThreads, searchThreads, updateThreadData, withThreadDataLock, deleteThread, setThreadQueuedMessages, } from "../chat-threads/store.js";
16
+ import { createThread, forkThread, getThread, listThreads, searchThreads, setThreadScope, updateThreadData, withThreadDataLock, deleteThread, setThreadQueuedMessages, } from "../chat-threads/store.js";
17
17
  import { resourceList, resourceListAccessible, resourceGet, resourceGetByPath, ensurePersonalDefaults, SHARED_OWNER, } from "../resources/store.js";
18
18
  import { getFrontmatterValue, getSkillNameFromPath, parseFrontmatter, } from "../resources/metadata.js";
19
19
  import nodePath from "node:path";
@@ -167,6 +167,13 @@ function createRefreshScreenEntry() {
167
167
  }
168
168
  /** Well-known application-state key used by the refresh-screen tool. */
169
169
  const SCREEN_REFRESH_KEY = "__screen_refresh__";
170
+ const SAFE_BROWSER_TAB_ID_RE = /^[A-Za-z0-9_-]{1,96}$/;
171
+ function appStateKeyForBrowserTab(key, browserTabId) {
172
+ if (typeof browserTabId !== "string")
173
+ return key;
174
+ const trimmed = browserTabId.trim();
175
+ return SAFE_BROWSER_TAB_ID_RE.test(trimmed) ? `${key}:${trimmed}` : key;
176
+ }
170
177
  /**
171
178
  * In-memory rate-limit tracker for `/generate-title`. Keyed by user email,
172
179
  * value is recent invocation timestamps within the rolling window. Stale
@@ -211,9 +218,15 @@ function createUrlTools() {
211
218
  const params = (args?.params ?? {});
212
219
  const merge = args?.merge !== "false";
213
220
  const { writeAppState } = await import("../application-state/script-helpers.js");
214
- await writeAppState("__set_url__", {
221
+ await writeAppState(appStateKeyForBrowserTab("__set_url__", getRequestRunContext()?.browserTabId), {
215
222
  searchParams: params,
216
223
  mergeSearchParams: merge,
224
+ // Unique-per-write token. The client's URLSync hook dedups by this
225
+ // so a fire-and-forget DELETE that loses its race against the next
226
+ // polling refetch can't cause the same URL command to be applied
227
+ // repeatedly (which caused the editor to bounce between slides
228
+ // when an agent turn errored partway through).
229
+ _writeId: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
217
230
  });
218
231
  const keys = Object.keys(params);
219
232
  return `set-search-params: ${keys.length} key${keys.length === 1 ? "" : "s"}${merge ? "" : " (replace)"}`;
@@ -253,10 +266,14 @@ function createUrlTools() {
253
266
  const params = (args?.params ?? {});
254
267
  const merge = args?.merge !== "false";
255
268
  const { writeAppState } = await import("../application-state/script-helpers.js");
256
- await writeAppState("__set_url__", {
269
+ await writeAppState(appStateKeyForBrowserTab("__set_url__", getRequestRunContext()?.browserTabId), {
257
270
  pathname,
258
271
  searchParams: params,
259
272
  mergeSearchParams: merge,
273
+ // See note in set-search-params: unique-per-write dedup token so a
274
+ // race between GET and consume-DELETE in URLSync can't re-apply
275
+ // this command.
276
+ _writeId: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
260
277
  });
261
278
  return `set-url-path: ${pathname}`;
262
279
  },
@@ -431,15 +448,26 @@ async function createDocsScriptEntries() {
431
448
  /**
432
449
  * Creates resource ScriptEntries available in both prod and dev modes.
433
450
  */
451
+ function shouldDefaultResourceWriteToWorkspace(path) {
452
+ const normalized = path.replace(/^\/+/, "");
453
+ return (normalized === "AGENTS.md" ||
454
+ normalized === "LEARNINGS.md" ||
455
+ normalized.startsWith("memory/") ||
456
+ normalized.startsWith("skills/") ||
457
+ normalized.startsWith("jobs/") ||
458
+ normalized.startsWith("agents/") ||
459
+ normalized.startsWith("remote-agents/"));
460
+ }
434
461
  async function createResourceScriptEntries() {
435
462
  try {
436
- const [list, read, write, del, saveMem, delMem] = await Promise.all([
463
+ const [list, read, write, del, saveMem, delMem, store] = await Promise.all([
437
464
  import("../scripts/resources/list.js"),
438
465
  import("../scripts/resources/read.js"),
439
466
  import("../scripts/resources/write.js"),
440
467
  import("../scripts/resources/delete.js"),
441
468
  import("../scripts/resources/save-memory.js"),
442
469
  import("../scripts/resources/delete-memory.js"),
470
+ import("../resources/store.js"),
443
471
  ]);
444
472
  // Wrap each CLI runner so it captures stdout and converts args properly
445
473
  const listEntry = wrapCliScript({
@@ -461,14 +489,14 @@ async function createResourceScriptEntries() {
461
489
  return {
462
490
  resources: {
463
491
  tool: {
464
- description: 'Manage persistent user files and notes. Actions: "list" (browse), "read" (get contents), "write" (create/update), "delete" (remove).',
492
+ description: 'Manage workspace resources. Actions: "list" (browse visible files), "read" (get contents), "write" (create/update), "promote" (make agent scratch visible), "delete" (remove). Agent scratch writes are hidden from the Workspace view by default; use visibility="workspace" only for files the user explicitly wants to keep/manage.',
465
493
  parameters: {
466
494
  type: "object",
467
495
  properties: {
468
496
  action: {
469
497
  type: "string",
470
498
  description: "The operation to perform",
471
- enum: ["list", "read", "write", "delete"],
499
+ enum: ["list", "read", "write", "promote", "delete"],
472
500
  },
473
501
  path: {
474
502
  type: "string",
@@ -496,6 +524,15 @@ async function createResourceScriptEntries() {
496
524
  description: 'Output format for list: "json" or "text" (default: text)',
497
525
  enum: ["json", "text"],
498
526
  },
527
+ visibility: {
528
+ type: "string",
529
+ description: 'Visibility for write: "agent_scratch" for internal working files, "workspace" for user-requested files. Defaults to agent_scratch except durable instruction/skill/job/memory paths.',
530
+ enum: ["workspace", "agent_scratch"],
531
+ },
532
+ includeAgentScratch: {
533
+ type: "boolean",
534
+ description: "Include hidden agent scratch files when listing.",
535
+ },
499
536
  },
500
537
  required: ["action"],
501
538
  },
@@ -510,16 +547,53 @@ async function createResourceScriptEntries() {
510
547
  return readEntry.run(rest);
511
548
  }
512
549
  if (a === "write") {
513
- if (!rest.path || !rest.content)
550
+ if (!rest.path ||
551
+ rest.content === undefined ||
552
+ rest.content === null)
514
553
  return "Error: path and content are required for write";
554
+ rest.createdBy = "agent";
555
+ rest.visibility =
556
+ rest.visibility ??
557
+ (shouldDefaultResourceWriteToWorkspace(String(rest.path))
558
+ ? "workspace"
559
+ : "agent_scratch");
560
+ const runCtx = getRequestRunContext();
561
+ if (runCtx?.threadId)
562
+ rest.threadId = runCtx.threadId;
515
563
  return writeEntry.run(rest);
516
564
  }
565
+ if (a === "promote") {
566
+ if (!rest.path)
567
+ return "Error: path is required for promote";
568
+ const scope = rest.scope ?? "personal";
569
+ const owner = scope === "shared"
570
+ ? store.SHARED_OWNER
571
+ : (getRequestRunContext()?.owner ??
572
+ getRequestUserEmail() ??
573
+ process.env.AGENT_USER_EMAIL);
574
+ if (!owner) {
575
+ return "Error: promote requires an authenticated user";
576
+ }
577
+ const resource = await store.resourceGetByPath(owner, String(rest.path));
578
+ if (!resource) {
579
+ return `Resource not found: ${rest.path}`;
580
+ }
581
+ const promoted = await store.resourcePut(owner, resource.path, resource.content, resource.mimeType, {
582
+ createdBy: resource.createdBy,
583
+ visibility: "workspace",
584
+ threadId: resource.threadId,
585
+ runId: resource.runId,
586
+ expiresAt: null,
587
+ metadata: resource.metadata,
588
+ });
589
+ return `Promoted resource: ${promoted.path}`;
590
+ }
517
591
  if (a === "delete") {
518
592
  if (!rest.path)
519
593
  return "Error: path is required for delete";
520
594
  return deleteEntry.run(rest);
521
595
  }
522
- return `Error: unknown action "${a}". Use: list, read, write, delete`;
596
+ return `Error: unknown action "${a}". Use: list, read, write, promote, delete`;
523
597
  },
524
598
  },
525
599
  "save-memory": wrapCliScript({
@@ -709,7 +783,7 @@ function createBuilderBrowserTool(deps) {
709
783
  return {
710
784
  "connect-builder": {
711
785
  tool: {
712
- description: "Render a Builder.io card inline in the chat. Call this IMMEDIATELY — no exploration, no planning — when the user asks to modify the APP'S OWN SOURCE CODE: add a feature, change the UI chrome, edit a React component, add a route, add an integration, fix a bug in the app itself, or anything else that requires source-file edits while in hosted/production mode. Do NOT call this for creating or editing extensions/widgets/dashboards/calculators/mini-apps; those are sandboxed extension data and must use create-extension/update-extension instead. Do NOT call this for content the app is meant to produce — creating a video, generating a design, drafting an email, building a slide deck, making a dashboard, etc. — those run through the app's own domain actions, not Builder. Do NOT mention 'click Send to Builder' in your response unless this card is already in the conversation. If Builder is connected and Builder Cloud Agents are enabled, the card shows a 'Send to Builder' button that hands the work off to Builder's cloud agent and returns a branch URL. If `builderEnabled` is false, the card shows a waitlist/local-dev fallback instead; do not claim the Builder card has everything, is pre-loaded for handoff, or can run the cloud agent. When you call this for a code-change request, pass the user's request verbatim as the `prompt` arg so the card can forward it to Builder unchanged when cloud agents are available.",
786
+ description: "Render a Builder.io card inline in the chat. Call this IMMEDIATELY — no exploration, no planning — when the user asks to modify the APP'S OWN SOURCE CODE: add a feature, change the UI chrome, edit a React component, add a route, add an integration, fix a bug in the app itself, or anything else that requires source-file edits while in hosted/production mode. Do NOT call this for creating or editing extensions/widgets/dashboards/calculators/mini-apps; those are sandboxed extension data and must use create-extension/update-extension instead. Do NOT call this for content the app is meant to produce — creating a video, generating a design, drafting an email, building a slide deck, making a dashboard, etc. — those run through the app's own domain actions, not Builder. Do NOT mention 'click Send to Builder' in your response unless this card is already in the conversation. If Builder is connected and Builder Cloud Agents are available, the card shows a 'Send to Builder' button that hands the work off to Builder's cloud agent and returns a branch URL. If `builderEnabled` is false, the card shows a waitlist/local-dev fallback instead; never tell the user to enable Builder Cloud Agents in Builder org settings or beta settings, and do not claim the Builder card has everything, is pre-loaded for handoff, or can run the cloud agent. When you call this for a code-change request, pass the user's request verbatim as the `prompt` arg so the card can forward it to Builder unchanged when cloud agents are available.",
713
787
  parameters: {
714
788
  type: "object",
715
789
  properties: {
@@ -1008,16 +1082,21 @@ const FRAMEWORK_CORE_COMPACT = `
1008
1082
  11. **Find tools when unsure** — Use \`tool-search\` to find the exact action/tool for a capability. It searches the live registry, including connected MCP server tools.
1009
1083
  12. **Relative dates use runtime context** — The \`<runtime-context>\` block gives the authoritative current date/time. Resolve "today", "yesterday", "last week", and similar phrases to explicit calendar dates before querying data or creating artifacts.
1010
1084
  13. **Make progress visible** — For work that takes more than a few seconds, keep the user oriented. Use \`manage-progress\` when available, emit concise status before long tool/action runs, and update after meaningful milestones so the chat never looks like it is spinning on nothing.
1085
+ 14. **Collaborate through uncertainty** — If a task stalls, errors, or depends on setup the user may not know about, shift into builder-coach mode instead of repeating the same attempt. State what you verified, name the most likely next checks, and proactively try common unblockers you can inspect (for example prompt size, missing environment variables, unavailable connections, current screen state, or tool choice). When you finish a meaningful step, offer one or two concrete next steps or improvements so non-technical users can keep iterating.
1011
1086
 
1012
1087
  ### Resources
1013
1088
 
1014
1089
  Use resource-list, resource-read, resource-write, resource-delete for persistent notes and context files.
1015
- Resources are NOT an agent scratchpad never create executable scripts, task plans, or work-in-progress files.
1090
+ Workspace resources are user-facing by default. If you need temporary working files, write them as agent scratch (\`visibility: "agent_scratch"\`); scratch is hidden from the Workspace view by default and expires. Use \`visibility: "workspace"\` only when the user explicitly asked to save/manage that file, or for durable AGENTS.md, LEARNINGS.md, memory, skills, jobs, or custom agents.
1016
1091
 
1017
1092
  ### Navigation Rule
1018
1093
 
1019
1094
  When the user says "show me", "go to", "open", etc., ALWAYS use \`navigate\` first.
1020
1095
 
1096
+ ### First-Session Personalization
1097
+
1098
+ On the user's first interaction, check \`readAppState("personalization")\`. If it isn't \`{ done: true }\`, greet briefly and ask two yes/no questions: (1) a theme pick that you can satisfy with \`change-appearance\` (presets: \`warm\`, \`ocean\`, \`forest\`, \`rose\`, \`slate\`, \`default\`), and (2) one short template-specific personalization question (see this template's AGENTS.md / CLAUDE.md, or fall back to a layout-density question). After they answer, apply the changes and write \`{ done: true }\` to \`application_state.personalization\`. If their first message is already on-task, answer it first and surface the theme offer in one trailing line, then mark personalization done so it never repeats.
1099
+
1021
1100
  ### Extended Capabilities
1022
1101
 
1023
1102
  You also have tools for: inline embeds, chat history search, agent teams/sub-agents, recurring jobs, A2A cross-app calls, structured memory, and browser automation (\`activate-browser\` to provision a real Chrome). Call \`get-framework-context\` to read detailed instructions for any of these when needed.
@@ -1100,7 +1179,7 @@ If the user says yes, call \`manage-jobs\` (action: "create") with the original
1100
1179
  Do NOT add this offer for one-shot work: lookups (find Alice, what's the schema, who reported X), single drafts/replies, navigation requests, or any task whose value is in the moment. Skip it when the prompt is already explicitly recurring (the user said "every morning…" — you'd be asking what they already told you). One short sentence at most; do not turn it into a list of cadence options.`,
1101
1180
  builder: `### Connecting Builder.io
1102
1181
 
1103
- When the user asks to connect Builder.io or you hit a "Builder not configured" error, call the \`connect-builder\` tool. It renders a one-click Connect card inline — do NOT write out multi-step setup instructions yourself.`,
1182
+ When the user asks to connect Builder.io or you hit a "Builder not configured" error, call the \`connect-builder\` tool. It renders a one-click Connect card inline — do NOT write out multi-step setup instructions yourself. If Builder Cloud Agents are not available for this workspace, never send the user to Builder org settings or beta settings; use the card's waitlist/local-dev fallback.`,
1104
1183
  browser: `### Browser Automation
1105
1184
 
1106
1185
  You can activate a real Chrome browser via Builder.io for tasks that need full page rendering:
@@ -1195,6 +1274,7 @@ const FRAMEWORK_CORE = `
1195
1274
  11. **Find tools when unsure** — Use \`tool-search\` to find the exact action/tool for a capability. It searches the live registry, including connected MCP server tools added through config, settings, or the MCP hub.
1196
1275
  12. **Relative dates use runtime context** — The \`<runtime-context>\` block gives the authoritative current date/time. Resolve "today", "yesterday", "last week", and similar phrases to explicit calendar dates before querying data or creating artifacts. When answering factual questions, include the exact date or date range you used.
1197
1276
  13. **Make progress visible** — For work that takes more than a few seconds, keep the user oriented. Use \`manage-progress\` when available, emit concise status before long tool/action runs, and update after meaningful milestones so the chat never looks like it is spinning on nothing.
1277
+ 14. **Collaborate through uncertainty** — If a task stalls, errors, or depends on setup the user may not know about, shift into builder-coach mode instead of repeating the same attempt. State what you verified, name the most likely next checks, and proactively try common unblockers you can inspect (for example prompt size, missing environment variables, unavailable connections, current screen state, or tool choice). When you finish a meaningful step, offer one or two concrete next steps or improvements so non-technical users can keep iterating.
1198
1278
 
1199
1279
  ### Resources
1200
1280
 
@@ -1204,7 +1284,7 @@ Resources can be personal (per-user) or shared (team-wide). By default, resource
1204
1284
 
1205
1285
  When the user gives instructions that should apply to all users/sessions, update the shared "AGENTS.md" resource.
1206
1286
 
1207
- **Resources are NOT an agent scratchpad.** Never use \`resource-write\` to store executable scripts, task plans, retry notes, or work-in-progress files you're writing to yourself. Specifically, do NOT create resources under \`scripts/\` or \`tasks/\` unless the user explicitly asked for a file at that path, or a tool (like \`manage-jobs\` or \`agent-teams\`) writes there as part of its contract. If you can't complete a task with the tools you have, say so don't improvise by leaving behind \`FINAL-*.md\`, \`EXECUTE-NOW-*.js\`, or similar artifacts. Resources are visible to the user in the workspace sidebar; every file you write is something they'll see and have to clean up.
1287
+ Workspace resources are user-facing by default. If you need temporary working files, use the \`resources\` tool with \`visibility: "agent_scratch"\`; scratch resources are hidden from the Workspace view by default and expire automatically. Use \`visibility: "workspace"\` only when the user explicitly asked to save/create/manage that file, or for durable control files such as \`AGENTS.md\`, \`LEARNINGS.md\`, \`memory/\`, \`skills/\`, \`jobs/\`, or \`agents/\`. If a scratch result becomes useful to the user, call \`resources\` with \`action: "promote"\` or rewrite it with \`visibility: "workspace"\`.
1208
1288
 
1209
1289
  ### Navigation Rule
1210
1290
 
@@ -1299,7 +1379,7 @@ Skip this offer for one-shot work — single lookups (find X, who is Y), one-off
1299
1379
 
1300
1380
  ### Connecting Builder.io
1301
1381
 
1302
- When the user asks to connect Builder.io, needs Builder for LLM access / browser automation, or you hit a "Builder not configured" error, call the \`connect-builder\` tool. It renders a one-click Connect card inline in the chat — do NOT write out multi-step setup instructions yourself (no "Option 1 / Option 2", no terminal commands). Just call the tool and let the card handle the rest.
1382
+ When the user asks to connect Builder.io, needs Builder for LLM access / browser automation, or you hit a "Builder not configured" error, call the \`connect-builder\` tool. It renders a one-click Connect card inline in the chat — do NOT write out multi-step setup instructions yourself (no "Option 1 / Option 2", no terminal commands). If Builder Cloud Agents are not available for this workspace, never send the user to Builder org settings or beta settings; use the card's waitlist/local-dev fallback. Just call the tool and let the card handle the rest.
1303
1383
 
1304
1384
  ### Browser Automation
1305
1385
 
@@ -1351,6 +1431,26 @@ You have a structured memory system. Your memory index (\`memory/MEMORY.md\`) is
1351
1431
  - Keep descriptions concise — the index is loaded every message
1352
1432
  - One memory per logical topic (e.g. 'coding-style', 'project-alpha')
1353
1433
  - Don't save temporary debugging notes or ephemeral task details
1434
+
1435
+ ### First-Session Personalization
1436
+
1437
+ On the user's very first interaction in this app, before answering their actual request, briefly personalize the workspace.
1438
+
1439
+ Check the application_state key \`personalization\` via \`readAppState("personalization")\`:
1440
+ - If it returns null (or has no \`done: true\`), this is the first session — run the flow below.
1441
+ - If \`done: true\` is set, skip the flow and answer normally.
1442
+
1443
+ **The flow (keep it to one short message, then wait for their answer before continuing):**
1444
+
1445
+ 1. Greet briefly in one sentence.
1446
+ 2. Ask **two** yes/no questions inline, on separate lines:
1447
+ - A theme question: _"Want me to pick a color theme for your workspace? I have a few presets — say a name or just 'yes' for my pick."_ Available presets: \`warm\`, \`ocean\`, \`forest\`, \`rose\`, \`slate\` (call \`change-appearance\` with one of these; or \`default\` to clear). When the user says yes without a name, pick one preset that fits this template's tone.
1448
+ - A template-specific question that the template's AGENTS.md / CLAUDE.md documents (e.g. for calendar: _"Want me to color-code meetings by attendee or by category?"_; for mail: _"Want me to surface emails that look like they need a reply at the top?"_). If the template doesn't suggest a question, ask one generic preference question (e.g. _"Do you prefer a denser layout or roomy spacing?"_).
1449
+ 3. After they answer (or decline), call \`change-appearance\` if appropriate, do whatever the second answer implies (e.g. set a calendar visual preference), and then write \`application_state.personalization\` = \`{ "done": true }\` via \`writeAppState\` so this flow doesn't run again.
1450
+
1451
+ If the user's first message is clearly already on-task (e.g. "what's on my calendar today?"), answer it first — but still surface ONE line at the end like _"By the way, want me to set a theme for your workspace? Try \`change-appearance warm\` or just ask."_ — then mark personalization done so the offer never repeats.
1452
+
1453
+ Do NOT block on this flow. If the user ignores it, just proceed; never re-ask the personalization questions in later sessions.
1354
1454
  `;
1355
1455
  const PROD_FRAMEWORK_PROMPT = `## Agent-Native Framework — Production Mode
1356
1456
 
@@ -1402,7 +1502,9 @@ In Act mode, when the user asks you to change the UI, modify code, add a feature
1402
1502
 
1403
1503
  1. Briefly acknowledge the user's specific request in their own terms — one short clause naming what they asked for (e.g. "Got it — wider subject lines in the email list."). Do NOT restate the request verbatim, do NOT add a generic preamble, and do NOT promise outcomes. Skip this step entirely if the user already knows you're handing off (e.g. they said "send this to Builder").
1404
1504
  2. Call the \`connect-builder\` tool, passing the user's full request verbatim as the \`prompt\` argument. This renders an inline card. If Builder is connected and \`builderEnabled\` is true, the card hands the prompt off to Builder's cloud agent on one click and returns a branch URL. If Builder is not connected, it shows the Connect Builder flow. If \`builderEnabled\` is false, it shows a waitlist/local-dev fallback instead of a cloud handoff.
1405
- 3. After the card renders, inspect the tool result and write one sentence that frames the next click around what the user just asked — not as a Builder pitch. Examples: "Click Send to Builder and it'll wire that up for you." / "Connect Builder once and it'll handle this and future changes." / "Builder Cloud Agents aren't enabled here yet — you can still do this locally, and the Agent Native Desktop app handles it: https://www.agent-native.com/download." Do NOT say the card is pre-loaded, has everything, or lead with "Builder Cloud Agents are…" as if it were the headline.
1505
+ 3. After the card renders, inspect the tool result and write one sentence that frames the next click around what the user just asked — not as a Builder pitch. Examples: "Click Send to Builder and it'll wire that up for you." / "Connect Builder once and it'll handle this and future changes." / "Builder Cloud Agents aren't available here yet — join the waitlist in the card, or use the Agent Native Desktop app for local code changes: https://www.agent-native.com/download." Do NOT say the card is pre-loaded, has everything, or lead with "Builder Cloud Agents are…" as if it were the headline.
1506
+
1507
+ When \`builderEnabled\` is false, Builder Cloud Agents are not self-serve from Builder org settings. Do NOT tell the user to go to Builder org settings, beta features, "Cloud Agents", or "AI Agents" to enable them. The only allowed guidance is the card's waitlist/local-dev fallback: join the waitlist when the card offers it, use Agent Native Desktop, or edit from a local clone.
1406
1508
 
1407
1509
  **Act-mode hard rules — do NOT break these:**
1408
1510
  - Do NOT read source files, list directories, or explore the codebase. You have no filesystem tools and don't need to look at code to recommend Builder.
@@ -1464,7 +1566,7 @@ If the user wants a **new self-contained surface** (custom widget, dashboard, li
1464
1566
 
1465
1567
  ### Code Changes — Call \`connect-builder\`
1466
1568
 
1467
- In Act mode, when a request genuinely needs a source-code edit (per the rules above), do this in order: (1) briefly acknowledge the user's specific ask in their own terms — one short clause, no preamble — then (2) call \`connect-builder\` with the user's request as the \`prompt\`, then (3) write one sentence framing the next click around what they asked for, not a Builder pitch. Do NOT write code, list files, make plans, or spawn sub-agents. Mention \`npx agent-native create <app-name>\` as an offline fallback when Builder Cloud Agents aren't available.
1569
+ In Act mode, when a request genuinely needs a source-code edit (per the rules above), do this in order: (1) briefly acknowledge the user's specific ask in their own terms — one short clause, no preamble — then (2) call \`connect-builder\` with the user's request as the \`prompt\`, then (3) write one sentence framing the next click around what they asked for, not a Builder pitch. Do NOT write code, list files, make plans, or spawn sub-agents. Mention \`npx agent-native create <app-name>\`, Agent Native Desktop, or the waitlist card as the fallback when Builder Cloud Agents aren't available. Never tell users to enable Builder Cloud Agents from Builder org settings, beta features, "Cloud Agents", or "AI Agents"; they are not self-serve there.
1468
1570
  ${FRAMEWORK_CORE_COMPACT}`;
1469
1571
  const DEV_FRAMEWORK_PROMPT_COMPACT = `## Agent-Native Framework — Development Mode
1470
1572
 
@@ -1501,7 +1603,7 @@ const DEFAULT_SYSTEM_PROMPT = PROD_FRAMEWORK_PROMPT;
1501
1603
  * AGENTS.md and restarting the server is all it takes; Vite HMR invalidates
1502
1604
  * the bundle in dev so changes land instantly.
1503
1605
  */
1504
- async function loadResourcesForPrompt(owner, compact = false) {
1606
+ async function loadResourcesForPrompt(owner, compact = false, selfAppId) {
1505
1607
  await ensurePersonalDefaults(owner);
1506
1608
  const sections = [];
1507
1609
  // 1. Workspace AGENTS.md + skills merged into the template bundle.
@@ -1558,6 +1660,16 @@ async function loadResourcesForPrompt(owner, compact = false) {
1558
1660
  catch { }
1559
1661
  }
1560
1662
  }
1663
+ try {
1664
+ const agents = (await discoverAgents(selfAppId)).slice(0, 30);
1665
+ if (agents.length > 0) {
1666
+ const lines = agents.map((agent) => `- ${agent.name} (${agent.id}) — ${agent.description || "Connected A2A app"}`);
1667
+ sections.push(`<available-apps>\nWorkspace apps available over A2A/call-agent:\n${lines.join("\n")}\n\nUse \`call-agent\` with the app id when another app owns the work or data. Use tool-search or app-specific actions for details only when needed.\n</available-apps>`);
1668
+ }
1669
+ }
1670
+ catch {
1671
+ // Agent discovery is helpful context, not required for the run.
1672
+ }
1561
1673
  if (sections.length === 0)
1562
1674
  return "";
1563
1675
  return ("\n\nThe following resources contain template-specific instructions and user context. Use the information in them to help the user.\n\n" +
@@ -2307,7 +2419,7 @@ export function createAgentChatPlugin(options) {
2307
2419
  if (!userEmail)
2308
2420
  throw new Error("no authenticated user");
2309
2421
  const owner = userEmail;
2310
- const resources = await loadResourcesForPrompt(owner, lazyContext);
2422
+ const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId);
2311
2423
  const schemaBlock = lazyContext
2312
2424
  ? ""
2313
2425
  : await buildSchemaBlock(owner, devActive);
@@ -2493,7 +2605,7 @@ export function createAgentChatPlugin(options) {
2493
2605
  ...toolActions,
2494
2606
  });
2495
2607
  const mcpTools = actionsToEngineTools(mcpActions);
2496
- const resources = await loadResourcesForPrompt(SHARED_OWNER, lazyContext);
2608
+ const resources = await loadResourcesForPrompt(SHARED_OWNER, lazyContext, options?.appId);
2497
2609
  const schemaBlock = lazyContext
2498
2610
  ? ""
2499
2611
  : await buildSchemaBlock(SHARED_OWNER, devActiveMcp);
@@ -3010,7 +3122,10 @@ When the user asks for ANY of the following — add a feature, edit a component,
3010
3122
 
3011
3123
  1. Do NOT call \`connect-builder\`, \`scaffold-workspace-app\`, \`start-workspace-app-creation\`, or any other tool that creates or edits source.
3012
3124
  2. Do NOT write code, list files, propose patches, or describe what you would change.
3013
- 3. Reply with one short message saying chat-in-browser on localhost can't edit code (page reloads kill the session) and offer these alternatives, in this order:
3125
+ 3. Reply with one short message saying chat-in-browser on localhost can't edit code (page reloads kill the session). If — and only if the request is specifically to **add or scaffold a new workspace app**, lead with the CLI option since it runs in the same terminal the user is already using:
3126
+ - **Agent Native CLI** — \`npx @agent-native/core add-app\` in this workspace directory (best for template apps like Mail/Calendar/Slides; the workspace gateway picks them up automatically)
3127
+
3128
+ Then offer these alternatives for general source-editing work, in this order:
3014
3129
  - **Agent Native Desktop** — https://www.agent-native.com/download (recommended; same chat, no reload risk)
3015
3130
  - **Claude Code** — \`claude\` in the project directory
3016
3131
  - **Codex** — \`codex\` in the project directory
@@ -3029,7 +3144,7 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
3029
3144
  if (leanPrompt) {
3030
3145
  return setSystemPromptOnContext(leanBasePrompt + runtimeContext + browserLocalDev + extra);
3031
3146
  }
3032
- const resources = await loadResourcesForPrompt(owner, lazyContext);
3147
+ const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId);
3033
3148
  // In lazy context mode, skip embedding the full schema — the agent
3034
3149
  // calls `db-schema` on demand. This saves ~1-2K tokens per request.
3035
3150
  const schemaBlock = lazyContext
@@ -3160,7 +3275,7 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
3160
3275
  if (leanPrompt) {
3161
3276
  return setSystemPromptOnContext(leanBasePrompt + runtimeContext + extra);
3162
3277
  }
3163
- const resources = await loadResourcesForPrompt(owner, lazyContext);
3278
+ const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId);
3164
3279
  const schemaBlock = lazyContext
3165
3280
  ? ""
3166
3281
  : await buildSchemaBlock(owner, true);
@@ -3885,6 +4000,46 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
3885
4000
  // ─── Thread management endpoints ──────────────────────────────────────
3886
4001
  // Single handler for /threads and /threads/:id — h3's use() does prefix
3887
4002
  // matching so we can't reliably split them into separate handlers.
4003
+ const parseScopeFromQuery = (q) => {
4004
+ const type = q.scopeType ? String(q.scopeType).trim() : "";
4005
+ const id = q.scopeId ? String(q.scopeId).trim() : "";
4006
+ if (!type || !id)
4007
+ return null;
4008
+ const label = q.scopeLabel ? String(q.scopeLabel) : undefined;
4009
+ return label ? { type, id, label } : { type, id };
4010
+ };
4011
+ const parseScopeFromBody = (raw) => {
4012
+ if (raw == null)
4013
+ return null;
4014
+ if (typeof raw !== "object")
4015
+ return null;
4016
+ const r = raw;
4017
+ const type = typeof r.type === "string" ? r.type.trim() : "";
4018
+ const id = typeof r.id === "string" ? r.id.trim() : "";
4019
+ if (!type || !id)
4020
+ return null;
4021
+ const label = typeof r.label === "string" ? r.label : undefined;
4022
+ return label ? { type, id, label } : { type, id };
4023
+ };
4024
+ const parseForkSourceFromBody = (raw) => {
4025
+ if (!raw || typeof raw !== "object")
4026
+ return null;
4027
+ const r = raw;
4028
+ if (typeof r.threadData !== "string")
4029
+ return null;
4030
+ const messageCount = typeof r.messageCount === "number"
4031
+ ? r.messageCount
4032
+ : Number(r.messageCount ?? 0);
4033
+ return {
4034
+ threadData: r.threadData,
4035
+ title: typeof r.title === "string" ? r.title : "",
4036
+ preview: typeof r.preview === "string" ? r.preview : "",
4037
+ messageCount,
4038
+ ...(Object.prototype.hasOwnProperty.call(r, "scope")
4039
+ ? { scope: parseScopeFromBody(r.scope) }
4040
+ : {}),
4041
+ };
4042
+ };
3888
4043
  getH3App(nitroApp).use(`${routePath}/threads`, defineEventHandler(async (event) => {
3889
4044
  const owner = await getOwnerFromEvent(event);
3890
4045
  const method = getMethod(event);
@@ -3944,6 +4099,14 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
3944
4099
  }
3945
4100
  }
3946
4101
  await updateThreadData(threadId, newThreadData, body.title ?? thread.title, body.preview ?? thread.preview, newMessageCount);
4102
+ // Scope updates piggyback on the PUT — the client uses this
4103
+ // path for both "detach" (scope: null) and "retag" flows.
4104
+ // Send the field as `scope: undefined` (or omit it) when
4105
+ // you don't want to touch the existing scope.
4106
+ if (Object.prototype.hasOwnProperty.call(body, "scope")) {
4107
+ const incomingScope = parseScopeFromBody(body.scope);
4108
+ await setThreadScope(threadId, incomingScope);
4109
+ }
3947
4110
  return { ok: true };
3948
4111
  });
3949
4112
  }
@@ -3971,6 +4134,7 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
3971
4134
  const body = await readBody(event);
3972
4135
  const forked = await forkThread(threadId, owner, {
3973
4136
  id: body?.id,
4137
+ source: parseForkSourceFromBody(body?.source),
3974
4138
  });
3975
4139
  if (!forked) {
3976
4140
  setResponseStatus(event, 404);
@@ -3995,12 +4159,21 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
3995
4159
  const query = getQuery(event);
3996
4160
  const limit = Math.min(parseInt(String(query.limit ?? "50"), 10) || 50, 200);
3997
4161
  const q = query.q ? String(query.q).trim() : "";
4162
+ const scope = parseScopeFromQuery(query);
4163
+ const unscopedOnly = String(query.unscoped ?? "") === "1";
3998
4164
  if (q) {
3999
- const threads = await searchThreads(owner, q, limit);
4165
+ const threads = await searchThreads(owner, q, limit, {
4166
+ scope: scope ?? undefined,
4167
+ });
4000
4168
  return { threads };
4001
4169
  }
4002
4170
  const offset = parseInt(String(query.offset ?? "0"), 10) || 0;
4003
- const threads = await listThreads(owner, limit, offset);
4171
+ const threads = await listThreads(owner, {
4172
+ limit,
4173
+ offset,
4174
+ scope: scope ?? undefined,
4175
+ unscopedOnly,
4176
+ });
4004
4177
  return { threads };
4005
4178
  }
4006
4179
  if (method === "POST") {
@@ -4025,6 +4198,7 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
4025
4198
  const thread = await createThread(owner, {
4026
4199
  id: body?.id,
4027
4200
  title: body?.title ?? "",
4201
+ scope: parseScopeFromBody(body?.scope),
4028
4202
  });
4029
4203
  return thread;
4030
4204
  }
@@ -4060,6 +4234,11 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
4060
4234
  const ownerContext = await resolveOwnerContext(event);
4061
4235
  const owner = ownerContext.owner;
4062
4236
  // Resolve org ID: explicit callback > session.orgId from Better Auth
4237
+ // > implicit org membership. Better Auth leaves session.orgId null
4238
+ // until the user explicitly switches orgs, so a fresh signup with
4239
+ // implicit membership (e.g. domain-matched org) would otherwise see
4240
+ // no org-scoped credentials. getOrgContext() does the same DB lookup
4241
+ // the /builder/status endpoint uses to decide "Connected".
4063
4242
  let resolvedOrgId;
4064
4243
  if (options?.resolveOrgId) {
4065
4244
  resolvedOrgId = (await options.resolveOrgId(event)) ?? undefined;
@@ -4072,6 +4251,16 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
4072
4251
  catch {
4073
4252
  // Session not available
4074
4253
  }
4254
+ if (!resolvedOrgId) {
4255
+ try {
4256
+ const { getOrgContext } = await import("../org/context.js");
4257
+ const ctx = await getOrgContext(event);
4258
+ resolvedOrgId = ctx.orgId ?? undefined;
4259
+ }
4260
+ catch {
4261
+ // org_members table may not exist yet on first boot
4262
+ }
4263
+ }
4075
4264
  }
4076
4265
  // Propagate the caller's IANA timezone from `x-user-timezone` so that
4077
4266
  // tool calls made by the agent (e.g. log-meal with no explicit date)
@@ -4123,7 +4312,7 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
4123
4312
  ...toolActions,
4124
4313
  }),
4125
4314
  getSystemPrompt: async (owner) => {
4126
- const resources = await loadResourcesForPrompt(owner, lazyContext);
4315
+ const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId);
4127
4316
  const schemaBlock = lazyContext
4128
4317
  ? ""
4129
4318
  : await buildSchemaBlock(owner, false);
@@ -4164,7 +4353,7 @@ Non-code requests are still fine on this surface — read data, navigate the UI,
4164
4353
  ...toolActions,
4165
4354
  }),
4166
4355
  getSystemPrompt: async (owner) => {
4167
- const resources = await loadResourcesForPrompt(owner, lazyContext);
4356
+ const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId);
4168
4357
  const schemaBlock = lazyContext
4169
4358
  ? ""
4170
4359
  : await buildSchemaBlock(owner, false);