@dxos/plugin-assistant 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.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 (724) hide show
  1. package/PLUGIN.mdl +102 -11
  2. package/dist/lib/Assistant.mjs.map +1 -1
  3. package/dist/lib/AssistantCapabilities.mjs +6 -2
  4. package/dist/lib/AssistantCapabilities.mjs.map +1 -1
  5. package/dist/lib/AssistantOperation.mjs +112 -11
  6. package/dist/lib/AssistantOperation.mjs.map +1 -1
  7. package/dist/lib/AssistantOptions.mjs.map +1 -1
  8. package/dist/lib/AssistantService.mjs +2 -2
  9. package/dist/lib/AssistantService.mjs.map +1 -1
  10. package/dist/lib/AssistantSkill.mjs.map +1 -1
  11. package/dist/lib/Chat.mjs +3 -0
  12. package/dist/lib/Ollama.mjs +1 -1
  13. package/dist/lib/Ollama.mjs.map +1 -1
  14. package/dist/lib/PluginManagerSkill.mjs +95 -0
  15. package/dist/lib/PluginManagerSkill.mjs.map +1 -0
  16. package/dist/lib/Settings.mjs +10 -2
  17. package/dist/lib/Settings.mjs.map +1 -1
  18. package/dist/lib/TracePanel.mjs +87 -0
  19. package/dist/lib/TracePanel.mjs.map +1 -0
  20. package/dist/lib/capabilities.browser.mjs +140 -0
  21. package/dist/lib/capabilities.browser.mjs.map +1 -0
  22. package/dist/lib/capabilities.mjs +39 -10
  23. package/dist/lib/capabilities.mjs.map +1 -1
  24. package/dist/lib/capabilities.node.mjs +36 -18
  25. package/dist/lib/capabilities.node.mjs.map +1 -1
  26. package/dist/lib/capabilities.tauri.mjs +140 -0
  27. package/dist/lib/capabilities.tauri.mjs.map +1 -0
  28. package/dist/lib/capabilities.workerd.mjs +13 -16
  29. package/dist/lib/capabilities.workerd.mjs.map +1 -1
  30. package/dist/lib/chunk-AgentArticle.mjs +13 -10
  31. package/dist/lib/chunk-AgentArticle.mjs.map +1 -1
  32. package/dist/lib/chunk-AgentProperties.mjs +4 -4
  33. package/dist/lib/chunk-AgentProperties.mjs.map +1 -1
  34. package/dist/lib/chunk-AssistantSettings.mjs +53 -54
  35. package/dist/lib/chunk-AssistantSettings.mjs.map +1 -1
  36. package/dist/lib/chunk-Chat.mjs +2027 -0
  37. package/dist/lib/chunk-Chat.mjs.map +1 -0
  38. package/dist/lib/chunk-ChatArticle.mjs +40 -33
  39. package/dist/lib/chunk-ChatArticle.mjs.map +1 -1
  40. package/dist/lib/chunk-ChatCompanion.mjs +3 -3
  41. package/dist/lib/chunk-ChatCompanion.mjs.map +1 -1
  42. package/dist/lib/chunk-ChatDialog.mjs +8 -11
  43. package/dist/lib/chunk-ChatDialog.mjs.map +1 -1
  44. package/dist/lib/chunk-IntegrationPrompt.mjs +65 -20
  45. package/dist/lib/chunk-IntegrationPrompt.mjs.map +1 -1
  46. package/dist/lib/chunk-ObjectCardSurface.mjs +29 -0
  47. package/dist/lib/chunk-ObjectCardSurface.mjs.map +1 -0
  48. package/dist/lib/chunk-PLUGIN.mjs +6 -0
  49. package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
  50. package/dist/lib/chunk-PluginPrompt.mjs +32 -46
  51. package/dist/lib/chunk-PluginPrompt.mjs.map +1 -1
  52. package/dist/lib/chunk-PluginUrlPrompt.mjs +100 -0
  53. package/dist/lib/chunk-PluginUrlPrompt.mjs.map +1 -0
  54. package/dist/lib/chunk-QuestionSurface.mjs +142 -0
  55. package/dist/lib/chunk-QuestionSurface.mjs.map +1 -0
  56. package/dist/lib/chunk-SpaceHomePrompt.mjs +11 -14
  57. package/dist/lib/chunk-SpaceHomePrompt.mjs.map +1 -1
  58. package/dist/lib/chunk-SpaceHomeSuggestions.mjs +12 -11
  59. package/dist/lib/chunk-SpaceHomeSuggestions.mjs.map +1 -1
  60. package/dist/lib/chunk-TracePanel.mjs +4 -234
  61. package/dist/lib/chunk-TracePanel.mjs.map +1 -1
  62. package/dist/lib/chunk-TriggerStatus.mjs +29 -26
  63. package/dist/lib/chunk-TriggerStatus.mjs.map +1 -1
  64. package/dist/lib/chunk-agent-hydrator.mjs +1 -1
  65. package/dist/lib/chunk-agent-service.mjs +10 -9
  66. package/dist/lib/chunk-agent-service.mjs.map +1 -1
  67. package/dist/lib/chunk-agents.mjs +22 -0
  68. package/dist/lib/chunk-agents.mjs.map +1 -0
  69. package/dist/lib/chunk-ai-context.mjs +1 -1
  70. package/dist/lib/chunk-ai-service.mjs +3 -3
  71. package/dist/lib/chunk-ai-service.mjs.map +1 -1
  72. package/dist/lib/chunk-answer-question.mjs +67 -0
  73. package/dist/lib/chunk-answer-question.mjs.map +1 -0
  74. package/dist/lib/chunk-app-graph-builder.mjs +30 -13
  75. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
  76. package/dist/lib/chunk-automation-templates.mjs +4 -4
  77. package/dist/lib/chunk-automation-templates.mjs.map +1 -1
  78. package/dist/lib/chunk-bind-chat-context.mjs +4 -4
  79. package/dist/lib/chunk-companion-chat-provisioner.mjs +51 -22
  80. package/dist/lib/chunk-companion-chat-provisioner.mjs.map +1 -1
  81. package/dist/lib/chunk-connector.mjs +51 -22
  82. package/dist/lib/chunk-connector.mjs.map +1 -1
  83. package/dist/lib/chunk-constants.mjs +5 -1
  84. package/dist/lib/chunk-constants.mjs.map +1 -1
  85. package/dist/lib/chunk-context.mjs +4 -2
  86. package/dist/lib/chunk-context.mjs.map +1 -1
  87. package/dist/lib/chunk-create-chat.mjs +9 -6
  88. package/dist/lib/chunk-create-chat.mjs.map +1 -1
  89. package/dist/lib/chunk-create-object.mjs +6 -4
  90. package/dist/lib/chunk-create-object.mjs.map +1 -1
  91. package/dist/lib/chunk-edge-model-resolver.mjs +19 -9
  92. package/dist/lib/chunk-edge-model-resolver.mjs.map +1 -1
  93. package/dist/lib/chunk-ensure-companion-chat.mjs +9 -2
  94. package/dist/lib/chunk-ensure-companion-chat.mjs.map +1 -1
  95. package/dist/lib/chunk-extensions.mjs +2 -2
  96. package/dist/lib/chunk-extensions.mjs.map +1 -1
  97. package/dist/lib/chunk-fork-chat.mjs +5 -5
  98. package/dist/lib/chunk-fork-chat.mjs.map +1 -1
  99. package/dist/lib/chunk-generate-home-suggestions.mjs +33 -26
  100. package/dist/lib/chunk-generate-home-suggestions.mjs.map +1 -1
  101. package/dist/lib/chunk-local-model-resolver.mjs +2 -2
  102. package/dist/lib/chunk-local-model-resolver.mjs.map +1 -1
  103. package/dist/lib/chunk-markdown-extension.mjs +1 -1
  104. package/dist/lib/chunk-markdown-extension.mjs.map +1 -1
  105. package/dist/lib/chunk-operation-handler.mjs +17 -11
  106. package/dist/lib/chunk-operation-handler.mjs.map +1 -1
  107. package/dist/lib/chunk-paths.mjs +2 -2
  108. package/dist/lib/chunk-paths.mjs.map +1 -1
  109. package/dist/lib/chunk-presets.mjs +60 -0
  110. package/dist/lib/chunk-presets.mjs.map +1 -0
  111. package/dist/lib/chunk-processor.mjs +568 -53
  112. package/dist/lib/chunk-processor.mjs.map +1 -1
  113. package/dist/lib/chunk-question-resumer.mjs +54 -0
  114. package/dist/lib/chunk-question-resumer.mjs.map +1 -0
  115. package/dist/lib/chunk-react-surface.mjs +54 -20
  116. package/dist/lib/chunk-react-surface.mjs.map +1 -1
  117. package/dist/lib/chunk-respond-to-request.mjs +26 -0
  118. package/dist/lib/chunk-respond-to-request.mjs.map +1 -0
  119. package/dist/lib/chunk-resume-prompt.mjs +18 -0
  120. package/dist/lib/chunk-resume-prompt.mjs.map +1 -0
  121. package/dist/lib/chunk-rolldown-runtime.mjs +15 -1
  122. package/dist/lib/chunk-run-prompt-in-chat.mjs +73 -0
  123. package/dist/lib/chunk-run-prompt-in-chat.mjs.map +1 -0
  124. package/dist/lib/chunk-run-prompt-in-new-chat.mjs +8 -8
  125. package/dist/lib/chunk-run-prompt-in-new-chat.mjs.map +1 -1
  126. package/dist/lib/chunk-schema-defs.mjs +10 -5
  127. package/dist/lib/chunk-schema-defs.mjs.map +1 -1
  128. package/dist/lib/chunk-set-current-chat.mjs +1 -1
  129. package/dist/lib/chunk-set-trace-panel-debug.mjs +1 -1
  130. package/dist/lib/chunk-settings.mjs +2 -2
  131. package/dist/lib/chunk-settings.mjs.map +1 -1
  132. package/dist/lib/chunk-skill-definition.mjs +14 -5
  133. package/dist/lib/chunk-skill-definition.mjs.map +1 -1
  134. package/dist/lib/chunk-state.mjs +5 -5
  135. package/dist/lib/chunk-state.mjs.map +1 -1
  136. package/dist/lib/chunk-subject-context.mjs +1 -1
  137. package/dist/lib/chunk-toolkit.mjs +2 -2
  138. package/dist/lib/chunk-toolkit.mjs.map +1 -1
  139. package/dist/lib/chunk-turn-producers.mjs +36 -0
  140. package/dist/lib/chunk-turn-producers.mjs.map +1 -0
  141. package/dist/lib/chunk-update-chat-name.mjs +5 -5
  142. package/dist/lib/chunk-update-chat-name.mjs.map +1 -1
  143. package/dist/lib/components.mjs +53 -1798
  144. package/dist/lib/components.mjs.map +1 -1
  145. package/dist/lib/containers.mjs +5 -2
  146. package/dist/lib/containers.mjs.map +1 -1
  147. package/dist/lib/hooks.mjs +342 -129
  148. package/dist/lib/hooks.mjs.map +1 -1
  149. package/dist/lib/index.mjs +6 -3
  150. package/dist/lib/meta.mjs +1 -1
  151. package/dist/lib/meta.mjs.map +1 -1
  152. package/dist/lib/ns/Chat.mjs +21 -0
  153. package/dist/lib/ns/Chat.mjs.map +1 -0
  154. package/dist/lib/ns/Extensions.mjs +8 -0
  155. package/dist/lib/ns/Extensions.mjs.map +1 -0
  156. package/dist/lib/ns/Hooks.mjs +10 -0
  157. package/dist/lib/ns/Hooks.mjs.map +1 -0
  158. package/dist/lib/ns/TracePanel.mjs +8 -0
  159. package/dist/lib/ns/TracePanel.mjs.map +1 -0
  160. package/dist/lib/operations.mjs +3 -0
  161. package/dist/lib/operations.mjs.map +1 -1
  162. package/dist/lib/plugin.mjs +2 -2
  163. package/dist/lib/plugin.mjs.map +1 -1
  164. package/dist/lib/skills.mjs +1 -85
  165. package/dist/lib/testing.mjs +125 -0
  166. package/dist/lib/testing.mjs.map +1 -0
  167. package/dist/lib/translations.mjs +52 -25
  168. package/dist/lib/translations.mjs.map +1 -1
  169. package/dist/types/src/AssistantPlugin.workerd.test.d.ts +2 -0
  170. package/dist/types/src/AssistantPlugin.workerd.test.d.ts.map +1 -0
  171. package/dist/types/src/Chat.d.ts +23 -0
  172. package/dist/types/src/Chat.d.ts.map +1 -0
  173. package/dist/types/src/Extensions.d.ts +2 -0
  174. package/dist/types/src/Extensions.d.ts.map +1 -0
  175. package/dist/types/src/Hooks.d.ts +2 -0
  176. package/dist/types/src/Hooks.d.ts.map +1 -0
  177. package/dist/types/src/TracePanel.d.ts +3 -0
  178. package/dist/types/src/TracePanel.d.ts.map +1 -0
  179. package/dist/types/src/capabilities/AssistantSurfaces.d.ts.map +1 -1
  180. package/dist/types/src/capabilities/agent-service.d.ts +2 -1
  181. package/dist/types/src/capabilities/agent-service.d.ts.map +1 -1
  182. package/dist/types/src/capabilities/agents.d.ts +7 -0
  183. package/dist/types/src/capabilities/agents.d.ts.map +1 -0
  184. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -1
  185. package/dist/types/src/capabilities/connector.d.ts.map +1 -1
  186. package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
  187. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  188. package/dist/types/src/capabilities/gen/browser.d.ts +26 -0
  189. package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
  190. package/dist/types/src/capabilities/gen/node.d.ts +6 -4
  191. package/dist/types/src/capabilities/gen/node.d.ts.map +1 -1
  192. package/dist/types/src/capabilities/gen/tauri.d.ts +26 -0
  193. package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
  194. package/dist/types/src/capabilities/gen/workerd.d.ts +5 -3
  195. package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -1
  196. package/dist/types/src/capabilities/index.d.ts +5 -3
  197. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  198. package/dist/types/src/capabilities/question-resumer.d.ts +13 -0
  199. package/dist/types/src/capabilities/question-resumer.d.ts.map +1 -0
  200. package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
  201. package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -1
  202. package/dist/types/src/capabilities/turn-producers.d.ts +10 -0
  203. package/dist/types/src/capabilities/turn-producers.d.ts.map +1 -0
  204. package/dist/types/src/commands/index.d.ts +1 -1
  205. package/dist/types/src/commands/index.d.ts.map +1 -1
  206. package/dist/types/src/commands/task-commands.d.ts +3 -7
  207. package/dist/types/src/commands/task-commands.d.ts.map +1 -1
  208. package/dist/types/src/commands/task-commands.test.d.ts +2 -0
  209. package/dist/types/src/commands/task-commands.test.d.ts.map +1 -0
  210. package/dist/types/src/components/AgentProperties/AgentProperties.d.ts +1 -1
  211. package/dist/types/src/components/AgentProperties/AgentProperties.d.ts.map +1 -1
  212. package/dist/types/src/components/AgentProperties/index.d.ts +1 -1
  213. package/dist/types/src/components/AgentProperties/index.d.ts.map +1 -1
  214. package/dist/types/src/components/Chat/Chat.d.ts +40 -18
  215. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  216. package/dist/types/src/components/Chat/Error.stories.d.ts.map +1 -1
  217. package/dist/types/src/components/Chat/ObjectCardWidget.d.ts +23 -0
  218. package/dist/types/src/components/Chat/ObjectCardWidget.d.ts.map +1 -0
  219. package/dist/types/src/components/Chat/SurfaceWidget.d.ts +2 -2
  220. package/dist/types/src/components/Chat/SurfaceWidget.d.ts.map +1 -1
  221. package/dist/types/src/components/Chat/Thread.stories.d.ts +6 -0
  222. package/dist/types/src/components/Chat/Thread.stories.d.ts.map +1 -1
  223. package/dist/types/src/components/Chat/context.d.ts +41 -8
  224. package/dist/types/src/components/Chat/context.d.ts.map +1 -1
  225. package/dist/types/src/components/Chat/events.d.ts +25 -0
  226. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  227. package/dist/types/src/components/Chat/index.d.ts +4 -2
  228. package/dist/types/src/components/Chat/index.d.ts.map +1 -1
  229. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +21 -9
  230. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  231. package/dist/types/src/components/ChatPrompt/ChatActions.stories.d.ts +39 -0
  232. package/dist/types/src/components/ChatPrompt/ChatActions.stories.d.ts.map +1 -0
  233. package/dist/types/src/components/ChatPrompt/ChatActivity.d.ts +19 -0
  234. package/dist/types/src/components/ChatPrompt/ChatActivity.d.ts.map +1 -0
  235. package/dist/types/src/components/ChatPrompt/ChatActivity.stories.d.ts +46 -0
  236. package/dist/types/src/components/ChatPrompt/ChatActivity.stories.d.ts.map +1 -0
  237. package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts +3 -3
  238. package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts.map +1 -1
  239. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +4 -4
  240. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  241. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +1 -1
  242. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -1
  243. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
  244. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +29 -9
  245. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -1
  246. package/dist/types/src/components/ChatPrompt/ChatPrompt.stories.d.ts +61 -0
  247. package/dist/types/src/components/ChatPrompt/ChatPrompt.stories.d.ts.map +1 -0
  248. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +2 -2
  249. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  250. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +33 -3
  251. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -1
  252. package/dist/types/src/components/ChatPrompt/ChatStatus.stories.d.ts +31 -0
  253. package/dist/types/src/components/ChatPrompt/ChatStatus.stories.d.ts.map +1 -0
  254. package/dist/types/src/components/ChatPrompt/index.d.ts +8 -7
  255. package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
  256. package/dist/types/src/components/ChatPrompt/useChatVoiceInput.d.ts.map +1 -1
  257. package/dist/types/src/components/ConnectorAuthMenu/ConnectorAuthMenu.d.ts +7 -1
  258. package/dist/types/src/components/ConnectorAuthMenu/ConnectorAuthMenu.d.ts.map +1 -1
  259. package/dist/types/src/components/ConnectorAuthMenu/ConnectorAuthMenu.stories.d.ts +21 -0
  260. package/dist/types/src/components/ConnectorAuthMenu/ConnectorAuthMenu.stories.d.ts.map +1 -1
  261. package/dist/types/src/components/ConnectorAuthMenu/index.d.ts +1 -1
  262. package/dist/types/src/components/ConnectorAuthMenu/index.d.ts.map +1 -1
  263. package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -3
  264. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  265. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -1
  266. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  267. package/dist/types/src/components/Toolbox/index.d.ts +1 -1
  268. package/dist/types/src/components/Toolbox/index.d.ts.map +1 -1
  269. package/dist/types/src/components/index.d.ts +6 -7
  270. package/dist/types/src/components/index.d.ts.map +1 -1
  271. package/dist/types/src/constants.d.ts +4 -0
  272. package/dist/types/src/constants.d.ts.map +1 -1
  273. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +2 -2
  274. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
  275. package/dist/types/src/containers/AgentArticle/index.d.ts +1 -1
  276. package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -1
  277. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +2 -2
  278. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -1
  279. package/dist/types/src/containers/AgentProperties/index.d.ts +1 -1
  280. package/dist/types/src/containers/AgentProperties/index.d.ts.map +1 -1
  281. package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts +2 -2
  282. package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  283. package/dist/types/src/containers/AssistantSettings/AssistantSettings.stories.d.ts +1 -1
  284. package/dist/types/src/containers/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
  285. package/dist/types/src/containers/AssistantSettings/OllamaModels.d.ts.map +1 -1
  286. package/dist/types/src/containers/AssistantSettings/index.d.ts +1 -1
  287. package/dist/types/src/containers/AssistantSettings/index.d.ts.map +1 -1
  288. package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts +6 -10
  289. package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -1
  290. package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts +39 -14
  291. package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts.map +1 -1
  292. package/dist/types/src/containers/ChatArticle/index.d.ts +1 -1
  293. package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -1
  294. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +7 -15
  295. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -1
  296. package/dist/types/src/containers/ChatCompanion/index.d.ts +1 -1
  297. package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -1
  298. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts +2 -2
  299. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
  300. package/dist/types/src/containers/ChatDialog/index.d.ts +1 -1
  301. package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -1
  302. package/dist/types/src/containers/IntegrationPrompt/IntegrationPrompt.d.ts.map +1 -1
  303. package/dist/types/src/containers/IntegrationPrompt/index.d.ts +1 -1
  304. package/dist/types/src/containers/IntegrationPrompt/index.d.ts.map +1 -1
  305. package/dist/types/src/containers/ObjectCardSurface/ObjectCardSurface.d.ts +11 -0
  306. package/dist/types/src/containers/ObjectCardSurface/ObjectCardSurface.d.ts.map +1 -0
  307. package/dist/types/src/containers/ObjectCardSurface/index.d.ts +2 -0
  308. package/dist/types/src/containers/ObjectCardSurface/index.d.ts.map +1 -0
  309. package/dist/types/src/containers/PluginPrompt/PluginPrompt.d.ts.map +1 -1
  310. package/dist/types/src/containers/PluginPrompt/PluginPrompt.stories.d.ts +26 -0
  311. package/dist/types/src/containers/PluginPrompt/PluginPrompt.stories.d.ts.map +1 -0
  312. package/dist/types/src/containers/PluginPrompt/index.d.ts +1 -1
  313. package/dist/types/src/containers/PluginPrompt/index.d.ts.map +1 -1
  314. package/dist/types/src/containers/PluginUrlPrompt/PluginUrlPrompt.d.ts +12 -0
  315. package/dist/types/src/containers/PluginUrlPrompt/PluginUrlPrompt.d.ts.map +1 -0
  316. package/dist/types/src/containers/PluginUrlPrompt/index.d.ts +2 -0
  317. package/dist/types/src/containers/PluginUrlPrompt/index.d.ts.map +1 -0
  318. package/dist/types/src/containers/QuestionCard/QuestionCard.d.ts +14 -0
  319. package/dist/types/src/containers/QuestionCard/QuestionCard.d.ts.map +1 -0
  320. package/dist/types/src/containers/QuestionCard/QuestionCard.stories.d.ts +97 -0
  321. package/dist/types/src/containers/QuestionCard/QuestionCard.stories.d.ts.map +1 -0
  322. package/dist/types/src/containers/QuestionSurface/QuestionSurface.d.ts +14 -0
  323. package/dist/types/src/containers/QuestionSurface/QuestionSurface.d.ts.map +1 -0
  324. package/dist/types/src/containers/QuestionSurface/index.d.ts +2 -0
  325. package/dist/types/src/containers/QuestionSurface/index.d.ts.map +1 -0
  326. package/dist/types/src/containers/SpaceHomePrompt/SpaceHomePrompt.d.ts.map +1 -1
  327. package/dist/types/src/containers/SpaceHomePrompt/index.d.ts +1 -1
  328. package/dist/types/src/containers/SpaceHomePrompt/index.d.ts.map +1 -1
  329. package/dist/types/src/containers/SpaceHomeSuggestions/SpaceHomeSuggestions.d.ts.map +1 -1
  330. package/dist/types/src/containers/SpaceHomeSuggestions/index.d.ts +1 -1
  331. package/dist/types/src/containers/SpaceHomeSuggestions/index.d.ts.map +1 -1
  332. package/dist/types/src/containers/TracePanel/TracePanel.d.ts +7 -3
  333. package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
  334. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
  335. package/dist/types/src/containers/TracePanel/index.d.ts +2 -2
  336. package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -1
  337. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +1 -1
  338. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -1
  339. package/dist/types/src/containers/TriggerStatus/index.d.ts +1 -1
  340. package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -1
  341. package/dist/types/src/containers/index.d.ts +3 -0
  342. package/dist/types/src/containers/index.d.ts.map +1 -1
  343. package/dist/types/src/errors.d.ts +33 -0
  344. package/dist/types/src/errors.d.ts.map +1 -0
  345. package/dist/types/src/extensions/index.d.ts +1 -1
  346. package/dist/types/src/extensions/index.d.ts.map +1 -1
  347. package/dist/types/src/hooks/index.d.ts +18 -17
  348. package/dist/types/src/hooks/index.d.ts.map +1 -1
  349. package/dist/types/src/hooks/useChatKeymap.d.ts +1 -1
  350. package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -1
  351. package/dist/types/src/hooks/useChatProcessor.d.ts +6 -3
  352. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  353. package/dist/types/src/hooks/useChatToolbarActions.d.ts +14 -2
  354. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
  355. package/dist/types/src/hooks/useDebug.d.ts +2 -2
  356. package/dist/types/src/hooks/useDebug.d.ts.map +1 -1
  357. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
  358. package/dist/types/src/hooks/useHomeSuggestions.d.ts.map +1 -1
  359. package/dist/types/src/hooks/useMcpServer.d.ts +34 -0
  360. package/dist/types/src/hooks/useMcpServer.d.ts.map +1 -0
  361. package/dist/types/src/hooks/usePlatform.d.ts.map +1 -1
  362. package/dist/types/src/hooks/usePresets.d.ts +6 -4
  363. package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
  364. package/dist/types/src/hooks/usePresets.test.d.ts +2 -0
  365. package/dist/types/src/hooks/usePresets.test.d.ts.map +1 -0
  366. package/dist/types/src/hooks/useProcessEphemeralStatus.d.ts.map +1 -1
  367. package/dist/types/src/hooks/useSelectionContext.d.ts +1 -1
  368. package/dist/types/src/hooks/useSelectionContext.d.ts.map +1 -1
  369. package/dist/types/src/hooks/useSessionTimeline.d.ts +16 -0
  370. package/dist/types/src/hooks/useSessionTimeline.d.ts.map +1 -0
  371. package/dist/types/src/hooks/useSkillRegistry.d.ts +11 -5
  372. package/dist/types/src/hooks/useSkillRegistry.d.ts.map +1 -1
  373. package/dist/types/src/hooks/useSkillRegistry.test.d.ts +2 -0
  374. package/dist/types/src/hooks/useSkillRegistry.test.d.ts.map +1 -0
  375. package/dist/types/src/index.d.ts +6 -3
  376. package/dist/types/src/index.d.ts.map +1 -1
  377. package/dist/types/src/operations/answer-question.d.ts +12 -0
  378. package/dist/types/src/operations/answer-question.d.ts.map +1 -0
  379. package/dist/types/src/operations/answer-question.test.d.ts +2 -0
  380. package/dist/types/src/operations/answer-question.test.d.ts.map +1 -0
  381. package/dist/types/src/operations/create-chat.d.ts.map +1 -1
  382. package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
  383. package/dist/types/src/operations/errors.d.ts +63 -0
  384. package/dist/types/src/operations/errors.d.ts.map +1 -0
  385. package/dist/types/src/operations/generate-home-suggestions.d.ts.map +1 -1
  386. package/dist/types/src/operations/index.d.ts.map +1 -1
  387. package/dist/types/src/operations/respond-to-request.d.ts +5 -0
  388. package/dist/types/src/operations/respond-to-request.d.ts.map +1 -0
  389. package/dist/types/src/operations/resume-prompt.d.ts +11 -0
  390. package/dist/types/src/operations/resume-prompt.d.ts.map +1 -0
  391. package/dist/types/src/operations/run-prompt-in-chat.d.ts +5 -0
  392. package/dist/types/src/operations/run-prompt-in-chat.d.ts.map +1 -0
  393. package/dist/types/src/plugin.d.ts.map +1 -1
  394. package/dist/types/src/processor/index.d.ts +5 -3
  395. package/dist/types/src/processor/index.d.ts.map +1 -1
  396. package/dist/types/src/processor/outbox.d.ts +76 -0
  397. package/dist/types/src/processor/outbox.d.ts.map +1 -0
  398. package/dist/types/src/processor/outbox.test.d.ts +2 -0
  399. package/dist/types/src/processor/outbox.test.d.ts.map +1 -0
  400. package/dist/types/src/processor/presets.d.ts +34 -0
  401. package/dist/types/src/processor/presets.d.ts.map +1 -1
  402. package/dist/types/src/processor/presets.test.d.ts +2 -0
  403. package/dist/types/src/processor/presets.test.d.ts.map +1 -0
  404. package/dist/types/src/processor/processor.d.ts +89 -8
  405. package/dist/types/src/processor/processor.d.ts.map +1 -1
  406. package/dist/types/src/processor/prompt.d.ts +3 -0
  407. package/dist/types/src/processor/prompt.d.ts.map +1 -1
  408. package/dist/types/src/processor/thread.d.ts +99 -0
  409. package/dist/types/src/processor/thread.d.ts.map +1 -0
  410. package/dist/types/src/processor/thread.test.d.ts.map +1 -0
  411. package/dist/types/src/skills/assistant/AssistantSkill.d.ts.map +1 -1
  412. package/dist/types/src/skills/assistant/index.d.ts +1 -1
  413. package/dist/types/src/skills/assistant/index.d.ts.map +1 -1
  414. package/dist/types/src/skills/index.d.ts +2 -2
  415. package/dist/types/src/skills/index.d.ts.map +1 -1
  416. package/dist/types/src/skills/plugin-manager/PluginManagerSkill.d.ts +2 -2
  417. package/dist/types/src/skills/plugin-manager/PluginManagerSkill.d.ts.map +1 -1
  418. package/dist/types/src/skills/plugin-manager/index.d.ts +1 -1
  419. package/dist/types/src/skills/plugin-manager/index.d.ts.map +1 -1
  420. package/dist/types/src/testing/index.d.ts +4 -4
  421. package/dist/types/src/testing/index.d.ts.map +1 -1
  422. package/dist/types/src/testing/remote-snapshot.test.d.ts.map +1 -0
  423. package/dist/types/src/translations.d.ts +2 -2
  424. package/dist/types/src/translations.d.ts.map +1 -1
  425. package/dist/types/src/types/Assistant.d.ts +3 -1
  426. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  427. package/dist/types/src/types/AssistantCapabilities.d.ts +41 -4
  428. package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -1
  429. package/dist/types/src/types/AssistantOperation.d.ts +47 -1
  430. package/dist/types/src/types/AssistantOperation.d.ts.map +1 -1
  431. package/dist/types/src/types/AssistantOptions.d.ts +8 -0
  432. package/dist/types/src/types/AssistantOptions.d.ts.map +1 -1
  433. package/dist/types/src/types/AssistantService.d.ts.map +1 -1
  434. package/dist/types/src/types/Ollama.d.ts +1 -1
  435. package/dist/types/src/types/Ollama.d.ts.map +1 -1
  436. package/dist/types/src/types/Settings.d.ts +2 -0
  437. package/dist/types/src/types/Settings.d.ts.map +1 -1
  438. package/dist/types/src/types/index.d.ts +10 -10
  439. package/dist/types/src/types/index.d.ts.map +1 -1
  440. package/dist/types/src/util/current-chat.d.ts +9 -0
  441. package/dist/types/src/util/current-chat.d.ts.map +1 -0
  442. package/dist/types/src/util/current-chat.test.d.ts +2 -0
  443. package/dist/types/src/util/current-chat.test.d.ts.map +1 -0
  444. package/dist/types/tsconfig.tsbuildinfo +1 -1
  445. package/package.json +142 -126
  446. package/src/AssistantPlugin.workerd.test.ts +22 -0
  447. package/src/Chat.ts +24 -0
  448. package/src/Extensions.ts +7 -0
  449. package/src/Hooks.ts +7 -0
  450. package/src/TracePanel.ts +8 -0
  451. package/src/capabilities/AssistantSurfaces.tsx +20 -12
  452. package/src/capabilities/agent-service.ts +29 -25
  453. package/src/capabilities/agents.ts +27 -0
  454. package/src/capabilities/ai-service.ts +2 -2
  455. package/src/capabilities/app-graph-builder.ts +18 -8
  456. package/src/capabilities/automation-templates.ts +1 -1
  457. package/src/capabilities/chats-section-query.test.ts +22 -2
  458. package/src/capabilities/companion-chat-provisioner.ts +55 -30
  459. package/src/capabilities/connector.ts +78 -29
  460. package/src/capabilities/create-object.ts +3 -1
  461. package/src/capabilities/edge-model-resolver.ts +27 -8
  462. package/src/capabilities/gen/browser.ts +192 -0
  463. package/src/capabilities/gen/node.ts +35 -41
  464. package/src/capabilities/gen/tauri.ts +192 -0
  465. package/src/capabilities/gen/workerd.ts +24 -38
  466. package/src/capabilities/index.ts +37 -24
  467. package/src/capabilities/local-model-resolver.ts +2 -2
  468. package/src/capabilities/markdown-extension.ts +1 -1
  469. package/src/capabilities/operation-handler.ts +16 -20
  470. package/src/capabilities/question-resumer.ts +82 -0
  471. package/src/capabilities/react-surface.ts +48 -8
  472. package/src/capabilities/schema-defs.ts +7 -2
  473. package/src/capabilities/settings.ts +2 -2
  474. package/src/capabilities/skill-definition.ts +12 -16
  475. package/src/capabilities/state.ts +5 -5
  476. package/src/capabilities/toolkit.ts +2 -2
  477. package/src/capabilities/turn-producers.ts +64 -0
  478. package/src/commands/index.ts +1 -1
  479. package/src/commands/task-commands.test.ts +130 -0
  480. package/src/commands/task-commands.ts +40 -33
  481. package/src/components/AgentProperties/AgentProperties.stories.tsx +2 -2
  482. package/src/components/AgentProperties/AgentProperties.tsx +19 -20
  483. package/src/components/AgentProperties/index.ts +1 -1
  484. package/src/components/Chat/Chat.tsx +487 -164
  485. package/src/components/Chat/Error.stories.tsx +10 -13
  486. package/src/components/Chat/ObjectCardWidget.tsx +69 -0
  487. package/src/components/Chat/SurfaceWidget.tsx +3 -3
  488. package/src/components/Chat/Thread.stories.tsx +69 -20
  489. package/src/components/Chat/context.ts +45 -9
  490. package/src/components/Chat/events.ts +25 -0
  491. package/src/components/Chat/index.ts +4 -2
  492. package/src/components/ChatPrompt/ChatActions.stories.tsx +145 -0
  493. package/src/components/ChatPrompt/ChatActions.tsx +99 -258
  494. package/src/components/ChatPrompt/ChatActivity.stories.tsx +195 -0
  495. package/src/components/ChatPrompt/ChatActivity.tsx +138 -0
  496. package/src/components/ChatPrompt/ChatMcpErrors.tsx +28 -16
  497. package/src/components/ChatPrompt/ChatOptions.stories.tsx +13 -6
  498. package/src/components/ChatPrompt/ChatOptions.tsx +438 -206
  499. package/src/components/ChatPrompt/ChatPresets.tsx +8 -7
  500. package/src/components/ChatPrompt/ChatPrompt.stories.tsx +252 -0
  501. package/src/components/ChatPrompt/ChatPrompt.tsx +97 -68
  502. package/src/components/ChatPrompt/ChatReferences.tsx +15 -10
  503. package/src/components/ChatPrompt/ChatStatus.stories.tsx +101 -0
  504. package/src/components/ChatPrompt/ChatStatus.tsx +85 -9
  505. package/src/components/ChatPrompt/index.ts +8 -7
  506. package/src/components/ChatPrompt/useChatVoiceInput.ts +5 -5
  507. package/src/components/ConnectorAuthMenu/ConnectorAuthMenu.stories.tsx +9 -13
  508. package/src/components/ConnectorAuthMenu/ConnectorAuthMenu.tsx +28 -16
  509. package/src/components/ConnectorAuthMenu/index.ts +1 -1
  510. package/src/components/Toolbox/Toolbox.stories.tsx +3 -3
  511. package/src/components/Toolbox/Toolbox.tsx +8 -8
  512. package/src/components/Toolbox/index.ts +1 -1
  513. package/src/components/index.ts +6 -7
  514. package/src/constants.ts +6 -0
  515. package/src/containers/AgentArticle/AgentArticle.stories.tsx +4 -4
  516. package/src/containers/AgentArticle/AgentArticle.tsx +16 -17
  517. package/src/containers/AgentArticle/index.ts +1 -1
  518. package/src/containers/AgentProperties/AgentProperties.tsx +6 -5
  519. package/src/containers/AgentProperties/index.ts +1 -1
  520. package/src/containers/AssistantSettings/AssistantSettings.stories.tsx +1 -1
  521. package/src/containers/AssistantSettings/AssistantSettings.tsx +11 -11
  522. package/src/containers/AssistantSettings/OllamaModels.stories.tsx +2 -2
  523. package/src/containers/AssistantSettings/OllamaModels.tsx +48 -59
  524. package/src/containers/AssistantSettings/index.ts +1 -1
  525. package/src/containers/ChatArticle/ChatArticle.stories.tsx +150 -46
  526. package/src/containers/ChatArticle/ChatArticle.tsx +72 -42
  527. package/src/containers/ChatArticle/index.ts +1 -1
  528. package/src/containers/ChatCompanion/ChatCompanion.tsx +8 -6
  529. package/src/containers/ChatCompanion/index.ts +1 -1
  530. package/src/containers/ChatDialog/ChatDialog.tsx +11 -10
  531. package/src/containers/ChatDialog/index.ts +1 -1
  532. package/src/containers/IntegrationPrompt/IntegrationPrompt.tsx +88 -22
  533. package/src/containers/IntegrationPrompt/index.ts +1 -1
  534. package/src/containers/ObjectCardSurface/ObjectCardSurface.tsx +38 -0
  535. package/src/containers/ObjectCardSurface/index.ts +5 -0
  536. package/src/containers/PluginPrompt/PluginPrompt.stories.tsx +101 -0
  537. package/src/containers/PluginPrompt/PluginPrompt.tsx +36 -29
  538. package/src/containers/PluginPrompt/index.ts +1 -1
  539. package/src/containers/PluginUrlPrompt/PluginUrlPrompt.tsx +112 -0
  540. package/src/containers/PluginUrlPrompt/index.ts +5 -0
  541. package/src/containers/QuestionCard/QuestionCard.stories.tsx +162 -0
  542. package/src/containers/QuestionCard/QuestionCard.tsx +98 -0
  543. package/src/containers/QuestionSurface/QuestionSurface.tsx +87 -0
  544. package/src/containers/QuestionSurface/index.ts +5 -0
  545. package/src/containers/SpaceHomePrompt/SpaceHomePrompt.tsx +11 -15
  546. package/src/containers/SpaceHomePrompt/index.ts +1 -1
  547. package/src/containers/SpaceHomeSuggestions/SpaceHomeSuggestions.tsx +14 -10
  548. package/src/containers/SpaceHomeSuggestions/index.ts +1 -1
  549. package/src/containers/TracePanel/TracePanel.stories.tsx +100 -66
  550. package/src/containers/TracePanel/TracePanel.tsx +121 -230
  551. package/src/containers/TracePanel/index.ts +2 -2
  552. package/src/containers/TriggerStatus/TriggerStatus.tsx +26 -26
  553. package/src/containers/TriggerStatus/index.ts +1 -1
  554. package/src/containers/index.ts +15 -12
  555. package/src/errors.ts +8 -0
  556. package/src/extensions/index.ts +1 -1
  557. package/src/extensions/prompt-extension.ts +1 -1
  558. package/src/functions/services.test.ts +13 -17
  559. package/src/hooks/index.ts +18 -17
  560. package/src/hooks/useChatKeymap.ts +1 -1
  561. package/src/hooks/useChatProcessor.ts +27 -9
  562. package/src/hooks/useChatServices.ts +3 -3
  563. package/src/hooks/useChatToolbarActions.ts +31 -12
  564. package/src/hooks/useContextBinder.ts +4 -4
  565. package/src/hooks/useContextObjects.ts +2 -2
  566. package/src/hooks/useDebug.ts +6 -2
  567. package/src/hooks/useFilteredTypes.ts +2 -5
  568. package/src/hooks/useHomeSuggestions.ts +6 -10
  569. package/src/hooks/useMcpServer.ts +172 -0
  570. package/src/hooks/usePlatform.ts +2 -2
  571. package/src/hooks/usePresets.test.tsx +52 -0
  572. package/src/hooks/usePresets.ts +64 -21
  573. package/src/hooks/useProcessEphemeralStatus.ts +8 -9
  574. package/src/hooks/useSelectionContext.test.ts +1 -1
  575. package/src/hooks/useSelectionContext.ts +4 -4
  576. package/src/hooks/useSessionTimeline.ts +60 -0
  577. package/src/hooks/useSkillRegistry.test.tsx +73 -0
  578. package/src/hooks/useSkillRegistry.ts +31 -52
  579. package/src/index.ts +6 -3
  580. package/src/meta.ts +1 -1
  581. package/src/operations/answer-question.test.ts +255 -0
  582. package/src/operations/answer-question.ts +81 -0
  583. package/src/operations/bind-chat-context.test.ts +49 -2
  584. package/src/operations/create-chat.ts +9 -2
  585. package/src/operations/ensure-companion-chat.ts +12 -2
  586. package/src/operations/errors.ts +17 -0
  587. package/src/operations/fork-chat.ts +1 -1
  588. package/src/operations/generate-home-suggestions.test.ts +52 -14
  589. package/src/operations/generate-home-suggestions.ts +56 -43
  590. package/src/operations/index.ts +14 -9
  591. package/src/operations/prompt.node.test.ts +6 -5
  592. package/src/operations/respond-to-request.ts +38 -0
  593. package/src/operations/resume-prompt.ts +19 -0
  594. package/src/operations/run-prompt-in-chat.ts +90 -0
  595. package/src/operations/run-prompt-in-new-chat.ts +3 -3
  596. package/src/operations/update-chat-name.ts +3 -3
  597. package/src/paths.ts +1 -1
  598. package/src/plugin.test.ts +20 -19
  599. package/src/plugin.ts +4 -0
  600. package/src/processor/index.ts +5 -3
  601. package/src/processor/outbox.test.ts +105 -0
  602. package/src/processor/outbox.ts +120 -0
  603. package/src/processor/presets.test.ts +53 -0
  604. package/src/processor/presets.ts +43 -0
  605. package/src/processor/processor.node.test.ts +42 -6
  606. package/src/processor/processor.ts +334 -45
  607. package/src/processor/prompt.test.ts +20 -1
  608. package/src/processor/prompt.ts +7 -0
  609. package/src/processor/streaming.node.test.ts +384 -99
  610. package/src/processor/thread.test.ts +588 -0
  611. package/src/processor/thread.ts +366 -0
  612. package/src/skills/assistant/AssistantSkill.ts +2 -0
  613. package/src/skills/assistant/index.ts +1 -1
  614. package/src/skills/assistant/skill.node.test.ts +3 -3
  615. package/src/skills/index.ts +2 -2
  616. package/src/skills/plugin-manager/PluginManagerSkill.ts +15 -6
  617. package/src/skills/plugin-manager/index.ts +1 -1
  618. package/src/templates/daily-digest.ts +1 -1
  619. package/src/templates/index.ts +2 -2
  620. package/src/templates/research-brief.ts +1 -1
  621. package/src/templates/routine-templates.test.ts +3 -3
  622. package/src/templates/scaffold.ts +2 -2
  623. package/src/testing/index.ts +6 -4
  624. package/src/{execution-graph → testing}/remote-snapshot.test.ts +2 -3
  625. package/src/testing/trace-timeline.node.test.ts +13 -15
  626. package/src/translations.ts +54 -26
  627. package/src/types/Assistant.ts +1 -1
  628. package/src/types/AssistantCapabilities.ts +38 -4
  629. package/src/types/AssistantOperation.ts +106 -1
  630. package/src/types/AssistantOptions.ts +9 -0
  631. package/src/types/AssistantService.ts +2 -2
  632. package/src/types/Ollama.ts +1 -1
  633. package/src/types/Settings.ts +15 -1
  634. package/src/types/index.ts +10 -10
  635. package/src/util/current-chat.test.ts +41 -0
  636. package/src/util/current-chat.ts +14 -0
  637. package/src/util/suggestions.test.ts +1 -1
  638. package/dist/lib/chunk-TracePanel2.mjs +0 -7
  639. package/dist/lib/chunk-TracePanel2.mjs.map +0 -1
  640. package/dist/lib/execution-graph.mjs +0 -978
  641. package/dist/lib/execution-graph.mjs.map +0 -1
  642. package/dist/lib/skills.mjs.map +0 -1
  643. package/dist/types/src/components/Chat/thread.d.ts +0 -42
  644. package/dist/types/src/components/Chat/thread.d.ts.map +0 -1
  645. package/dist/types/src/components/Chat/thread.test.d.ts.map +0 -1
  646. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +0 -17
  647. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +0 -1
  648. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +0 -8
  649. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +0 -1
  650. package/dist/types/src/components/ProcessTree/index.d.ts +0 -2
  651. package/dist/types/src/components/ProcessTree/index.d.ts.map +0 -1
  652. package/dist/types/src/containers/TracePanel/TraceToolbar.d.ts +0 -12
  653. package/dist/types/src/containers/TracePanel/TraceToolbar.d.ts.map +0 -1
  654. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +0 -19
  655. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +0 -1
  656. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +0 -2
  657. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +0 -1
  658. package/dist/types/src/containers/TracePanel/testing/index.d.ts +0 -3
  659. package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +0 -1
  660. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +0 -15
  661. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +0 -1
  662. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +0 -12
  663. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +0 -1
  664. package/dist/types/src/containers/TracePanel/trace-filter.d.ts +0 -32
  665. package/dist/types/src/containers/TracePanel/trace-filter.d.ts.map +0 -1
  666. package/dist/types/src/containers/TracePanel/trace-filter.test.d.ts +0 -2
  667. package/dist/types/src/containers/TracePanel/trace-filter.test.d.ts.map +0 -1
  668. package/dist/types/src/execution-graph/execution-graph.d.ts +0 -139
  669. package/dist/types/src/execution-graph/execution-graph.d.ts.map +0 -1
  670. package/dist/types/src/execution-graph/execution-graph.test.d.ts +0 -2
  671. package/dist/types/src/execution-graph/execution-graph.test.d.ts.map +0 -1
  672. package/dist/types/src/execution-graph/index.d.ts +0 -4
  673. package/dist/types/src/execution-graph/index.d.ts.map +0 -1
  674. package/dist/types/src/execution-graph/pending-block-status.d.ts +0 -26
  675. package/dist/types/src/execution-graph/pending-block-status.d.ts.map +0 -1
  676. package/dist/types/src/execution-graph/pending-block-status.test.d.ts +0 -2
  677. package/dist/types/src/execution-graph/pending-block-status.test.d.ts.map +0 -1
  678. package/dist/types/src/execution-graph/remote-snapshot.test.d.ts.map +0 -1
  679. package/dist/types/src/execution-graph/span-tree.d.ts +0 -106
  680. package/dist/types/src/execution-graph/span-tree.d.ts.map +0 -1
  681. package/dist/types/src/execution-graph/span-tree.test.d.ts +0 -2
  682. package/dist/types/src/execution-graph/span-tree.test.d.ts.map +0 -1
  683. package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts +0 -2
  684. package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts.map +0 -1
  685. package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts +0 -40
  686. package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts.map +0 -1
  687. package/dist/types/src/execution-graph/testing/index.d.ts +0 -2
  688. package/dist/types/src/execution-graph/testing/index.d.ts.map +0 -1
  689. package/dist/types/src/hooks/useTraceMessages.d.ts +0 -12
  690. package/dist/types/src/hooks/useTraceMessages.d.ts.map +0 -1
  691. package/dist/types/src/testing/test-trace.d.ts +0 -5
  692. package/dist/types/src/testing/test-trace.d.ts.map +0 -1
  693. package/dist/types/src/testing.d.ts +0 -2
  694. package/dist/types/src/testing.d.ts.map +0 -1
  695. package/src/components/Chat/thread.test.ts +0 -127
  696. package/src/components/Chat/thread.ts +0 -87
  697. package/src/components/ProcessTree/ProcessTree.stories.tsx +0 -90
  698. package/src/components/ProcessTree/ProcessTree.tsx +0 -215
  699. package/src/components/ProcessTree/index.ts +0 -5
  700. package/src/containers/TracePanel/TraceToolbar.tsx +0 -83
  701. package/src/containers/TracePanel/dxn-extractor.test.ts +0 -153
  702. package/src/containers/TracePanel/dxn-extractor.ts +0 -166
  703. package/src/containers/TracePanel/testing/index.ts +0 -6
  704. package/src/containers/TracePanel/testing/simulated-agent.ts +0 -115
  705. package/src/containers/TracePanel/testing/snapshot-playback.ts +0 -45
  706. package/src/containers/TracePanel/trace-filter.test.ts +0 -100
  707. package/src/containers/TracePanel/trace-filter.ts +0 -84
  708. package/src/execution-graph/SPEC.md +0 -749
  709. package/src/execution-graph/execution-graph.test.ts +0 -1161
  710. package/src/execution-graph/execution-graph.ts +0 -1078
  711. package/src/execution-graph/index.ts +0 -35
  712. package/src/execution-graph/pending-block-status.test.ts +0 -118
  713. package/src/execution-graph/pending-block-status.ts +0 -89
  714. package/src/execution-graph/span-tree.test.ts +0 -367
  715. package/src/execution-graph/span-tree.ts +0 -405
  716. package/src/execution-graph/sub-agent-delegation.test.ts +0 -65
  717. package/src/execution-graph/testing/collect-trace-events.ts +0 -76
  718. package/src/execution-graph/testing/index.ts +0 -5
  719. package/src/execution-graph/testing/sub-agent-delegation.json +0 -1285
  720. package/src/hooks/useTraceMessages.ts +0 -43
  721. package/src/testing/test-trace.ts +0 -22
  722. package/src/testing.ts +0 -9
  723. /package/dist/types/src/{components/Chat → processor}/thread.test.d.ts +0 -0
  724. /package/dist/types/src/{execution-graph → testing}/remote-snapshot.test.d.ts +0 -0
package/PLUGIN.mdl CHANGED
@@ -16,9 +16,10 @@ Each extension is defined in the Appendix or resolved via its URI.
16
16
  |-------------|-------------------------------|
17
17
  | `type` | `org.dxos.mdl.type@1.0` |
18
18
  | `feat` | `org.dxos.mdl.feat@1.0` |
19
- | `test` | `org.dxos.mdl.test@1.0` |
19
+ | `scenario` | `org.dxos.mdl.scenario@1.0` |
20
20
  | `component` | `org.dxos.mdl.component@1.0` |
21
- | `op` | `org.dxos.mdl.op@1.0` |
21
+ | `op` | `org.dxos.mdl.op@1.1` |
22
+ | `test` | `org.dxos.mdl.test@1.0` |
22
23
 
23
24
  ## Types
24
25
 
@@ -47,6 +48,7 @@ type Settings
47
48
  chatView?: ChatView
48
49
  modelProvider?: ModelProvider
49
50
  modelDefaults?: ModelDefaults
51
+ codeMode?: boolean
50
52
  tracePanelDebug?: boolean
51
53
  ```
52
54
 
@@ -137,6 +139,7 @@ component AssistantSettings
137
139
 
138
140
  ```mdl
139
141
  op CreateChat
142
+ key: org.dxos.operation.assistant.createChat
140
143
  desc: Creates a new Chat object and optionally adds it to the active space.
141
144
  input:
142
145
  db: Database
@@ -148,6 +151,7 @@ op CreateChat
148
151
 
149
152
  ```mdl
150
153
  op UpdateChatName
154
+ key: org.dxos.operation.assistant.updateChatName
151
155
  desc: Automatically derives and updates the name of a chat using the AI service.
152
156
  input:
153
157
  chat: Chat
@@ -176,6 +180,7 @@ op RunPromptInNewChat
176
180
 
177
181
  ```mdl
178
182
  op EnsureCompanionChat
183
+ key: org.dxos.operation.assistant.ensureCompanionChat
179
184
  desc: Returns the companion chat for an object, creating one if none exists.
180
185
  input:
181
186
  db: Database
@@ -198,6 +203,7 @@ op OnCreateSpace
198
203
 
199
204
  ```mdl
200
205
  op ToggleTracePanelDebug
206
+ key: org.dxos.operation.assistant.setTracePanelDebug
201
207
  desc: Toggles the trace panel between commit-graph and raw JSON debug view.
202
208
  input:
203
209
  state?: boolean
@@ -237,7 +243,7 @@ feat F-2: Companion Chat
237
243
  feat F-3: Skill System
238
244
 
239
245
  req F-3.1: Skills define named AI configurations (instructions, tools, model).
240
- req F-3.2: Built-in skills include: Assistant, Browser, Database, WebSearch, Discord, Linear, Agent, Planning, Memory, Automation, SkillManager, AgentWizard.
246
+ req F-3.2: Built-in skills include: Assistant, Browser, Database, WebSearch, Discord, Linear, Agent, Planning, Memory, Automation, SkillManager.
241
247
  req F-3.3:
242
248
  when: user selects a skill for a chat
243
249
  then: chat uses that skill's instructions and tool set
@@ -264,6 +270,12 @@ feat F-5: Tool Execution
264
270
  req F-5.3:
265
271
  when: AI invokes a tool during a conversation
266
272
  then: operation is dispatched via the compute runtime and result returned to the model
273
+ req F-5.4: Code mode is opt-in via `Settings.codeMode`, off by default; the host supplies the engine
274
+ through the `codeModeTurnProducer` plugin option, and without it the setting has no effect.
275
+ req F-5.5:
276
+ when: Settings.codeMode is enabled, the host supplied a code-mode producer, and no AgentTurnProducer is contributed
277
+ then: agent processes spawned afterwards run turns through the code-mode producer (one `eval` tool)
278
+ instead of AiSession
267
279
  ```
268
280
 
269
281
  ```mdl
@@ -286,7 +298,7 @@ feat F-7: Execution Trace
286
298
  ## Acceptance
287
299
 
288
300
  ```mdl
289
- test T-1: Create chat and send message
301
+ scenario T-1: Create chat and send message
290
302
  given: a space is open and the assistant plugin is active
291
303
  when: user creates a new Chat and sends "Hello"
292
304
  then:
@@ -296,7 +308,7 @@ test T-1: Create chat and send message
296
308
  ```
297
309
 
298
310
  ```mdl
299
- test T-2: Companion chat provisioning
311
+ scenario T-2: Companion chat provisioning
300
312
  given: user opens a document with no companion chat
301
313
  when: companion panel initializes
302
314
  then:
@@ -305,7 +317,7 @@ test T-2: Companion chat provisioning
305
317
  ```
306
318
 
307
319
  ```mdl
308
- test T-3: Skill binding
320
+ scenario T-3: Skill binding
309
321
  given: a chat exists
310
322
  when: user binds the "WebSearch" skill key
311
323
  then:
@@ -314,7 +326,7 @@ test T-3: Skill binding
314
326
  ```
315
327
 
316
328
  ```mdl
317
- test T-4: Model provider switch
329
+ scenario T-4: Model provider switch
318
330
  given: assistant settings are open
319
331
  when: user switches provider from edge to ollama
320
332
  then:
@@ -323,7 +335,7 @@ test T-4: Model provider switch
323
335
  ```
324
336
 
325
337
  ```mdl
326
- test T-5: Run prompt in background
338
+ scenario T-5: Run prompt in background
327
339
  given: a database and a prompt string are available
328
340
  when: op:RunPromptInNewChat is called with background: true
329
341
  then:
@@ -332,7 +344,7 @@ test T-5: Run prompt in background
332
344
  ```
333
345
 
334
346
  ```mdl
335
- test T-7: Trace panel debug toggle
347
+ scenario T-7: Trace panel debug toggle
336
348
  given: trace panel is showing commit-graph view
337
349
  when: op:ToggleTracePanelDebug is invoked with no argument
338
350
  then:
@@ -340,6 +352,85 @@ test T-7: Trace panel debug toggle
340
352
  - trace panel switches to raw JSON view
341
353
  ```
342
354
 
355
+ ## QA
356
+
357
+ Executable tests. Each step carries a human instruction (`do`) and, where the step maps to an
358
+ invocable operation, an agent binding (`invoke`). Report failures by test and step number.
359
+
360
+ ```mdl
361
+ test QA-1: Create a chat and send a message
362
+ desc: The core assistant round-trip — create a Chat, send a prompt, get a streamed AI response.
363
+ actors: both
364
+ covers: [F-1.1, F-1.2, F-1.3, F-1.4, T-1]
365
+ status: unverified
366
+ given:
367
+ - an identity exists
368
+ - space: a space is open
369
+ - no Chat named "QA Chat" exists — ABORT rather than deleting one this test did not create
370
+ steps:
371
+ - name: Create the chat
372
+ do: Open the assistant panel and click "New chat".
373
+ invoke: [op:CreateChat] { name: "QA Chat" }
374
+ capture: created
375
+ expect: a new Chat named "QA Chat" opens, empty
376
+ assert: return !!$created.object
377
+ note: |
378
+ CreateChat returns the chat UNFILED — the handler adds its feed regardless, but persisting
379
+ it in the space is a separate step (see plugin-space's addObject), which the UI's "New
380
+ chat" gesture does implicitly.
381
+ - name: Send a message
382
+ do: Type "Hello" into the chat input and press Enter.
383
+ expect: "Hello" appears as a user message, followed by a streamed assistant response, and
384
+ the chat is persisted to ECHO and replicated to peers
385
+ note: |
386
+ NO `invoke` — sending a prompt runs through the AI streaming path (`AiSession`), not
387
+ through the operation invoker; there is no `SendMessage` operation to call directly.
388
+ - name: Chat is auto-named
389
+ do: (no gesture — happens automatically once the chat has enough messages)
390
+ invoke: [op:UpdateChatName] { chat: $created.object }
391
+ expect: the chat's name changes from "QA Chat" to something derived from the conversation
392
+ assert: return typeof $result === 'undefined' || true;
393
+ note: |
394
+ `UpdateChatName` returns void — verify the effect on `chat.name`, not the return value
395
+ (Execution Rule 3). Included here for completeness; a fast QA pass may treat this as
396
+ `given` already established rather than re-triggering it.
397
+ after:
398
+ - name: Delete the chat
399
+ do: Right-click "QA Chat" in the navtree and choose Delete.
400
+ invoke: org.dxos.operation.space.removeObjects { objects: [$created.object], target: $given.space.db }
401
+ expect: the row leaves the navtree and its plank closes if it was open
402
+ ```
403
+
404
+ ```mdl
405
+ test QA-2: Companion chat is provisioned and bound
406
+ desc: op:EnsureCompanionChat + op:BindChatContext — the chat a companioned object gets automatically.
407
+ actors: both
408
+ covers: [F-2.1, F-2.2, F-2.3, T-2]
409
+ status: unverified
410
+ given:
411
+ - an identity exists
412
+ - space: a space is open
413
+ - subject: a Document in the space that has no companion chat yet
414
+ steps:
415
+ - name: Ensure the companion chat
416
+ do: Open the document; the companion chat panel initializes automatically.
417
+ invoke: [op:EnsureCompanionChat] { companionTo: $given.subject }
418
+ capture: ensured
419
+ expect: a new Chat is returned and NOT yet persisted (`persisted === false`)
420
+ assert: return $result.persisted === false && !!$result.chat;
421
+ - name: Bind chat context
422
+ do: (no separate gesture — panel initialization runs this immediately after ensuring the chat)
423
+ invoke: org.dxos.operation.assistant.bindChatContext { chat: $ensured.chat, subject: $given.subject }
424
+ note: No `op BindChatContext` block is declared above — referenced by its full runtime key.
425
+ expect: the companion chat's context now includes the document (and any skills its type
426
+ declares via Skill.SkillsAnnotation)
427
+ after:
428
+ - name: (nothing to undo)
429
+ do: The companion chat is never persisted unless a message is sent, so nothing was written
430
+ to the space.
431
+ expect: the document still has no persisted companion chat
432
+ ```
433
+
343
434
  ---
344
435
 
345
436
  ## Appendix: Extension Definitions
@@ -369,8 +460,8 @@ ext feat
369
460
  ```
370
461
 
371
462
  ```mdl
372
- ext test
373
- uri: org.dxos.mdl.test@1.0
463
+ ext scenario
464
+ uri: org.dxos.mdl.scenario@1.0
374
465
  desc: An acceptance scenario expressed as given / when / then steps.
375
466
  fields:
376
467
  given?: Step | Step[]
@@ -1 +1 @@
1
- {"version":3,"file":"Assistant.mjs","names":[],"sources":["../../src/types/Assistant.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type DXN } from '@dxos/keys';\n\n// Re-export Settings as merged const/type (not as namespace).\nimport * as SettingsModule from './Settings';\nexport const Settings = SettingsModule.Settings;\nexport type Settings = SettingsModule.Settings;\n\nexport const ChatViews = SettingsModule.ChatViews;\n\nexport const ModelProviders: readonly DXN.DXN[] = SettingsModule.ModelProviders;\nexport const ModelProvider = SettingsModule.ModelProvider;\nexport type ModelProvider = SettingsModule.ModelProvider;\n\nexport const ModelDefaults = SettingsModule.ModelDefaults;\nexport type ModelDefaults = SettingsModule.ModelDefaults;\n"],"mappings":";;;;;;;;;;AAUA,IAAa,WAAW;AAGxB,IAAa,YAAY;AAEzB,IAAa,iBAAqC;AAClD,IAAa,gBAAgB;AAG7B,IAAa,gBAAgB"}
1
+ {"version":3,"file":"Assistant.mjs","names":[],"sources":["../../src/types/Assistant.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type DXN } from '@dxos/keys';\n\n// Re-export Settings as merged const/type (not as namespace).\nimport * as SettingsModule from './Settings.ts';\nexport const Settings = SettingsModule.Settings;\nexport type Settings = SettingsModule.Settings;\n\nexport const ChatViews = SettingsModule.ChatViews;\n\nexport const ModelProviders: readonly DXN.DXN[] = SettingsModule.ModelProviders;\nexport const ModelProvider = SettingsModule.ModelProvider;\nexport type ModelProvider = SettingsModule.ModelProvider;\n\nexport const ModelDefaults = SettingsModule.ModelDefaults;\nexport type ModelDefaults = SettingsModule.ModelDefaults;\n"],"mappings":";;;;;;;;;;AAUA,IAAa,WAAW;AAGxB,IAAa,YAAY;AAEzB,IAAa,iBAAqC;AAClD,IAAa,gBAAgB;AAG7B,IAAa,gBAAgB"}
@@ -5,6 +5,7 @@ import * as Schema from "effect/Schema";
5
5
  import * as Struct from "effect/Struct";
6
6
  //#region src/types/AssistantCapabilities.ts
7
7
  var AssistantCapabilities_exports = /* @__PURE__ */ __exportAll({
8
+ Agent: () => Agent,
8
9
  AgentTurnProducer: () => AgentTurnProducer,
9
10
  CompanionChatCache: () => CompanionChatCache,
10
11
  HomeSuggestionsCache: () => HomeSuggestionsCache,
@@ -30,7 +31,9 @@ var HomeSuggestionsCacheSchema = Schema.Record(Schema.String, Schema.mutableKey(
30
31
  /** Epoch ms timestamp of the successful generation that produced these prompts. */
31
32
  generatedAt: Schema.Number,
32
33
  /** Non-empty, trimmed prompts from a successful generation. */
33
- prompts: Schema.Array(Schema.String)
34
+ prompts: Schema.Array(Schema.String),
35
+ /** The recent objects the prompts were generated from; an unchanged set reuses them. */
36
+ fingerprint: Schema.optional(Schema.String)
34
37
  })));
35
38
  /** Per-space cache of LLM-generated home starter prompts, persisted across page reloads. */
36
39
  var HomeSuggestionsCache = Capability.makeSingleton()(`${meta.profile.key}.capability.homeSuggestionsCache`);
@@ -43,8 +46,9 @@ var HomeSuggestionsCache = Capability.makeSingleton()(`${meta.profile.key}.capab
43
46
  * has to be able to contribute one before the app's own module activates without colliding.
44
47
  */
45
48
  var AgentTurnProducer = Capability.make()("org.dxos.plugin.assistant.capability.agentTurnProducer");
49
+ var Agent = Capability.make()(`${meta.profile.key}.capability.agent`);
46
50
  var SubjectContext = Capability.make()(`${meta.profile.key}.capability.subjectContext`);
47
51
  //#endregion
48
- export { AgentTurnProducer, CompanionChatCache, HomeSuggestionsCache, HomeSuggestionsCacheSchema, OllamaManager, Settings, State, StateSchema, SubjectContext, AssistantCapabilities_exports as t };
52
+ export { Agent, AgentTurnProducer, CompanionChatCache, HomeSuggestionsCache, HomeSuggestionsCacheSchema, OllamaManager, Settings, State, StateSchema, SubjectContext, AssistantCapabilities_exports as t };
49
53
 
50
54
  //# sourceMappingURL=AssistantCapabilities.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantCapabilities.mjs","names":[],"sources":["../../src/types/AssistantCapabilities.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport type * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\nimport * as Struct from 'effect/Struct';\nimport type * as Atom from 'effect/unstable/reactivity/Atom';\n\nimport type { MakeTurnProducer } from '@dxos/agent-runtime';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport type { AiContext } from '@dxos/assistant';\nimport type { Chat } from '@dxos/assistant-toolkit';\nimport type * as Instructions from '@dxos/compute/Instructions';\nimport { type Database, type Obj, type Ref, type Registry } from '@dxos/echo';\n\nimport { meta } from '#meta';\n\nimport * as Assistant from './Assistant';\nimport * as Ollama from './Ollama';\n\nexport const Settings = Capability.makeSingleton<Atom.Writable<Assistant.Settings>>()(\n `${meta.profile.key}.capability.settings`,\n);\n\nexport const OllamaManager = Capability.makeSingleton<Ollama.Manager>()(`${meta.profile.key}.capability.ollamaManager`);\n\nexport const StateSchema = Schema.Struct({\n /** Map of primary object dxn to current chat dxn. */\n currentChat: Schema.Record(Schema.String, Schema.UndefinedOr(Schema.String)),\n /** Map of chat object path to prompt text to auto-submit when the chat opens. */\n pendingPrompts: Schema.Record(Schema.String, Schema.UndefinedOr(Schema.String)),\n}).mapFields(Struct.map(Schema.mutableKey));\n\nexport type AssistantState = Schema.Schema.Type<typeof StateSchema>;\n\nexport const State = Capability.makeSingleton<Atom.Writable<AssistantState>>()(`${meta.profile.key}.capability.state`);\n\n/** Session-scoped cache of transient (not yet persisted) companion chats keyed by companion DXN string. */\nexport const CompanionChatCache = Capability.makeSingleton<Atom.Writable<Record<string, Obj.Unknown | undefined>>>()(\n `${meta.profile.key}.capability.companionChatCache`,\n);\n\nexport const HomeSuggestionsCacheSchema = Schema.Record(\n Schema.String,\n Schema.mutableKey(\n Schema.Struct({\n /** Epoch ms timestamp of the successful generation that produced these prompts. */\n generatedAt: Schema.Number,\n /** Non-empty, trimmed prompts from a successful generation. */\n prompts: Schema.Array(Schema.String),\n }),\n ),\n);\nexport type HomeSuggestionsCache = Schema.Schema.Type<typeof HomeSuggestionsCacheSchema>;\n\n/** Per-space cache of LLM-generated home starter prompts, persisted across page reloads. */\nexport const HomeSuggestionsCache = Capability.makeSingleton<Atom.Writable<HomeSuggestionsCache>>()(\n `${meta.profile.key}.capability.homeSuggestionsCache`,\n);\n\n/**\n * Optional engine for producing a conversation turn. When contributed, the agent process runs turns\n * through it instead of DXOS's own `AiSession` — e.g. a Claude Agent SDK host — while keeping its\n * queue, alarms, redelivery, delegation and hydration.\n *\n * A registry rather than a singleton, for the same reason as `AgentDelegationStrategy`: a harness\n * has to be able to contribute one before the app's own module activates without colliding.\n */\nexport const AgentTurnProducer = Capability.make<MakeTurnProducer>()(\n 'org.dxos.plugin.assistant.capability.agentTurnProducer',\n);\n\n/** Context a chat receives when it runs against a subject object. */\nexport type SubjectBindings = AiContext.BindingProps & {\n /** Applied to `chat.instructions` only when the chat has none; reaches the model via the system prompt. */\n instructions?: Ref.Ref<Instructions.Instructions>;\n};\n\n/**\n * Bindings contributed for a chat opened against a subject object — the object a companion chat is\n * attached to, or the object a chat was created for.\n *\n * Every contribution whose `appliesTo` accepts the subject runs and the results are merged, so a\n * type-specific provider adds to the default rather than replacing it. Invoked by\n * `AssistantOperation.BindChatContext`, which provides `Database.Service` for the subject's space and\n * declares `Registry.Service` for skills resolved out of the hypergraph registry.\n */\nexport type SubjectContext = {\n /** Whether this provider applies to the subject. Absent ⇒ applies to every subject. */\n appliesTo?: (subject: Obj.Unknown) => boolean;\n getBindings: (params: {\n subject: Obj.Unknown;\n chat: Chat.Chat;\n }) => Effect.Effect<SubjectBindings, Error, Database.Service | Registry.Service>;\n};\n\nexport const SubjectContext = Capability.make<SubjectContext>()(`${meta.profile.key}.capability.subjectContext`);\n"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,IAAa,WAAW,WAAW,cAAiD,CAAC,CACnF,GAAG,KAAK,QAAQ,IAAI,qBACtB;AAEA,IAAa,gBAAgB,WAAW,cAA8B,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,0BAA0B;AAEtH,IAAa,cAAc,OAAO,OAAO;;CAEvC,aAAa,OAAO,OAAO,OAAO,QAAQ,OAAO,YAAY,OAAO,MAAM,CAAC;;CAE3E,gBAAgB,OAAO,OAAO,OAAO,QAAQ,OAAO,YAAY,OAAO,MAAM,CAAC;AAChF,CAAC,CAAC,CAAC,UAAU,OAAO,IAAI,OAAO,UAAU,CAAC;AAI1C,IAAa,QAAQ,WAAW,cAA6C,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,kBAAkB;;AAGrH,IAAa,qBAAqB,WAAW,cAAsE,CAAC,CAClH,GAAG,KAAK,QAAQ,IAAI,+BACtB;AAEA,IAAa,6BAA6B,OAAO,OAC/C,OAAO,QACP,OAAO,WACL,OAAO,OAAO;;CAEZ,aAAa,OAAO;;CAEpB,SAAS,OAAO,MAAM,OAAO,MAAM;AACrC,CAAC,CACH,CACF;;AAIA,IAAa,uBAAuB,WAAW,cAAmD,CAAC,CACjG,GAAG,KAAK,QAAQ,IAAI,iCACtB;;;;;;;;;AAUA,IAAa,oBAAoB,WAAW,KAAuB,CAAC,CAClE,wDACF;AA0BA,IAAa,iBAAiB,WAAW,KAAqB,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,2BAA2B"}
1
+ {"version":3,"file":"AssistantCapabilities.mjs","names":[],"sources":["../../src/types/AssistantCapabilities.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport type * as Effect from 'effect/Effect';\nimport type * as Atom from 'effect/reactivity/Atom';\nimport * as Schema from 'effect/Schema';\nimport * as Struct from 'effect/Struct';\n\nimport type { MakeTurnProducer } from '@dxos/agent-runtime';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport type { AiContext } from '@dxos/assistant';\nimport type * as Chat from '@dxos/assistant/Chat';\nimport type * as Instructions from '@dxos/compute/Instructions';\nimport { type Database, type Obj, type Ref, type Registry } from '@dxos/echo';\nimport { type Message } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport * as Assistant from './Assistant.ts';\nimport * as Ollama from './Ollama.ts';\n\nexport const Settings = Capability.makeSingleton<Atom.Writable<Assistant.Settings>>()(\n `${meta.profile.key}.capability.settings`,\n);\n\nexport const OllamaManager = Capability.makeSingleton<Ollama.Manager>()(`${meta.profile.key}.capability.ollamaManager`);\n\nexport const StateSchema = Schema.Struct({\n /** Map of primary object dxn to current chat dxn. */\n currentChat: Schema.Record(Schema.String, Schema.UndefinedOr(Schema.String)),\n /** Map of chat object path to prompt text to auto-submit when the chat opens. */\n pendingPrompts: Schema.Record(Schema.String, Schema.UndefinedOr(Schema.String)),\n}).mapFields(Struct.map(Schema.mutableKey));\n\nexport type AssistantState = Schema.Schema.Type<typeof StateSchema>;\n\nexport const State = Capability.makeSingleton<Atom.Writable<AssistantState>>()(`${meta.profile.key}.capability.state`);\n\n/** Session-scoped cache of transient (not yet persisted) companion chats keyed by companion DXN string. */\nexport const CompanionChatCache = Capability.makeSingleton<Atom.Writable<Record<string, Obj.Unknown | undefined>>>()(\n `${meta.profile.key}.capability.companionChatCache`,\n);\n\nexport const HomeSuggestionsCacheSchema = Schema.Record(\n Schema.String,\n Schema.mutableKey(\n Schema.Struct({\n /** Epoch ms timestamp of the successful generation that produced these prompts. */\n generatedAt: Schema.Number,\n /** Non-empty, trimmed prompts from a successful generation. */\n prompts: Schema.Array(Schema.String),\n /** The recent objects the prompts were generated from; an unchanged set reuses them. */\n fingerprint: Schema.optional(Schema.String),\n }),\n ),\n);\nexport type HomeSuggestionsCache = Schema.Schema.Type<typeof HomeSuggestionsCacheSchema>;\n\n/** Per-space cache of LLM-generated home starter prompts, persisted across page reloads. */\nexport const HomeSuggestionsCache = Capability.makeSingleton<Atom.Writable<HomeSuggestionsCache>>()(\n `${meta.profile.key}.capability.homeSuggestionsCache`,\n);\n\n/**\n * Optional engine for producing a conversation turn. When contributed, the agent process runs turns\n * through it instead of DXOS's own `AiSession` — e.g. a Claude Agent SDK host — while keeping its\n * queue, alarms, redelivery, delegation and hydration.\n *\n * A registry rather than a singleton, for the same reason as `AgentDelegationStrategy`: a harness\n * has to be able to contribute one before the app's own module activates without colliding.\n */\nexport const AgentTurnProducer = Capability.make<MakeTurnProducer>()(\n 'org.dxos.plugin.assistant.capability.agentTurnProducer',\n);\n\n/**\n * Whether an agent can run on this device; one that cannot is still listed, with the reason as a\n * short lowercase phrase shown after its name.\n */\nexport type AgentAvailability = { readonly available: true } | { readonly available: false; readonly reason: string };\n\n/** A person's answer to a request block an agent added to a chat. */\nexport type AgentResponse = {\n chat: Chat.Chat;\n /** The message holding the request block. */\n message: Message.Message;\n requestId: string;\n optionId: string;\n};\n\n/**\n * An agent a chat can run on, keyed by `chat.session.harness`. Each plugin registers the agents it\n * provides; this plugin registers Composer's own loop as `composer`.\n */\nexport type Agent = {\n readonly id: string;\n readonly label: string;\n readonly icon: string;\n readonly availability: Atom.Atom<AgentAvailability>;\n readonly makeTurnProducer: MakeTurnProducer;\n /** Hands a person's answer to the agent; false when nothing is waiting on that request. */\n readonly respond?: (response: AgentResponse) => Effect.Effect<boolean, never, Database.Service>;\n};\n\nexport const Agent = Capability.make<Agent>()(`${meta.profile.key}.capability.agent`);\n\n/** Context a chat receives when it runs against a subject object. */\nexport type SubjectBindings = AiContext.BindingProps & {\n /** Applied to `chat.instructions` only when the chat has none; reaches the model via the system prompt. */\n instructions?: Ref.Ref<Instructions.Instructions>;\n};\n\n/**\n * Bindings contributed for a chat opened against a subject object — the object a companion chat is\n * attached to, or the object a chat was created for.\n *\n * Every contribution whose `appliesTo` accepts the subject runs and the results are merged, so a\n * type-specific provider adds to the default rather than replacing it. Invoked by\n * `AssistantOperation.BindChatContext`, which provides `Database.Service` for the subject's space and\n * declares `Registry.Service` for skills resolved out of the hypergraph registry.\n */\nexport type SubjectContext = {\n /** Whether this provider applies to the subject. Absent ⇒ applies to every subject. */\n appliesTo?: (subject: Obj.Unknown) => boolean;\n getBindings: (params: {\n subject: Obj.Unknown;\n chat: Chat.Chat;\n }) => Effect.Effect<SubjectBindings, Error, Database.Service | Registry.Service>;\n};\n\nexport const SubjectContext = Capability.make<SubjectContext>()(`${meta.profile.key}.capability.subjectContext`);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,IAAa,WAAW,WAAW,cAAiD,CAAC,CACnF,GAAG,KAAK,QAAQ,IAAI,qBACtB;AAEA,IAAa,gBAAgB,WAAW,cAA8B,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,0BAA0B;AAEtH,IAAa,cAAc,OAAO,OAAO;;CAEvC,aAAa,OAAO,OAAO,OAAO,QAAQ,OAAO,YAAY,OAAO,MAAM,CAAC;;CAE3E,gBAAgB,OAAO,OAAO,OAAO,QAAQ,OAAO,YAAY,OAAO,MAAM,CAAC;AAChF,CAAC,CAAC,CAAC,UAAU,OAAO,IAAI,OAAO,UAAU,CAAC;AAI1C,IAAa,QAAQ,WAAW,cAA6C,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,kBAAkB;;AAGrH,IAAa,qBAAqB,WAAW,cAAsE,CAAC,CAClH,GAAG,KAAK,QAAQ,IAAI,+BACtB;AAEA,IAAa,6BAA6B,OAAO,OAC/C,OAAO,QACP,OAAO,WACL,OAAO,OAAO;;CAEZ,aAAa,OAAO;;CAEpB,SAAS,OAAO,MAAM,OAAO,MAAM;;CAEnC,aAAa,OAAO,SAAS,OAAO,MAAM;AAC5C,CAAC,CACH,CACF;;AAIA,IAAa,uBAAuB,WAAW,cAAmD,CAAC,CACjG,GAAG,KAAK,QAAQ,IAAI,iCACtB;;;;;;;;;AAUA,IAAa,oBAAoB,WAAW,KAAuB,CAAC,CAClE,wDACF;AA+BA,IAAa,QAAQ,WAAW,KAAY,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,kBAAkB;AA0BpF,IAAa,iBAAiB,WAAW,KAAqB,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,2BAA2B"}
@@ -1,19 +1,25 @@
1
1
  import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
2
  import * as Capability from "@dxos/app-framework/Capability";
3
- import { Chat } from "@dxos/assistant-toolkit";
4
- import { DXN } from "@dxos/keys";
3
+ import * as Chat from "@dxos/assistant/Chat";
5
4
  import { Database, Obj, Ref, Registry, Type } from "@dxos/echo";
5
+ import { DXN as DXN$1 } from "@dxos/keys";
6
6
  import { AiService } from "@dxos/ai";
7
+ import { ContentBlock, Task } from "@dxos/types";
8
+ import * as AgentService from "@dxos/compute/AgentService";
7
9
  import * as Operation from "@dxos/compute/Operation";
10
+ import * as Trace from "@dxos/compute/Trace";
8
11
  import * as Schema from "effect/Schema";
9
12
  import * as Instructions from "@dxos/compute/Instructions";
10
13
  //#region src/types/AssistantOperation.ts
11
14
  var AssistantOperation_exports = /* @__PURE__ */ __exportAll({
15
+ AnswerQuestion: () => AnswerQuestion,
12
16
  BindChatContext: () => BindChatContext,
13
17
  CreateChat: () => CreateChat,
14
18
  EnsureCompanionChat: () => EnsureCompanionChat,
15
19
  ForkChat: () => ForkChat,
16
20
  GenerateHomeSuggestions: () => GenerateHomeSuggestions,
21
+ RespondToRequest: () => RespondToRequest,
22
+ RunPromptInChat: () => RunPromptInChat,
17
23
  SetCurrentChat: () => SetCurrentChat,
18
24
  SetTracePanelDebug: () => SetTracePanelDebug,
19
25
  SkillForm: () => SkillForm,
@@ -21,7 +27,7 @@ var AssistantOperation_exports = /* @__PURE__ */ __exportAll({
21
27
  });
22
28
  var CreateChat = Operation.make({
23
29
  meta: {
24
- key: DXN.make("org.dxos.operation.assistant.createChat"),
30
+ key: DXN$1.make("org.dxos.operation.assistant.createChat"),
25
31
  name: "Create Chat",
26
32
  icon: "ph--chat-text--regular"
27
33
  },
@@ -38,7 +44,7 @@ var CreateChat = Operation.make({
38
44
  });
39
45
  var UpdateChatName = Operation.make({
40
46
  meta: {
41
- key: DXN.make("org.dxos.operation.assistant.updateChatName"),
47
+ key: DXN$1.make("org.dxos.operation.assistant.updateChatName"),
42
48
  name: "Update Chat Name",
43
49
  icon: "ph--pencil--regular"
44
50
  },
@@ -52,7 +58,7 @@ var UpdateChatName = Operation.make({
52
58
  });
53
59
  var SetCurrentChat = Operation.make({
54
60
  meta: {
55
- key: DXN.make("org.dxos.operation.assistant.setCurrentChat"),
61
+ key: DXN$1.make("org.dxos.operation.assistant.setCurrentChat"),
56
62
  name: "Set Current Chat",
57
63
  icon: "ph--chat-text--regular"
58
64
  },
@@ -65,7 +71,7 @@ var SetCurrentChat = Operation.make({
65
71
  });
66
72
  var ForkChat = Operation.make({
67
73
  meta: {
68
- key: DXN.make("org.dxos.operation.assistant.forkChat"),
74
+ key: DXN$1.make("org.dxos.operation.assistant.forkChat"),
69
75
  name: "Fork Chat",
70
76
  icon: "ph--git-branch--regular",
71
77
  skipRegistry: true
@@ -86,7 +92,7 @@ var ForkChat = Operation.make({
86
92
  */
87
93
  var BindChatContext = Operation.make({
88
94
  meta: {
89
- key: DXN.make("org.dxos.operation.assistant.bindChatContext"),
95
+ key: DXN$1.make("org.dxos.operation.assistant.bindChatContext"),
90
96
  name: "Bind Chat Context",
91
97
  icon: "ph--link--regular"
92
98
  },
@@ -100,7 +106,7 @@ var BindChatContext = Operation.make({
100
106
  });
101
107
  var EnsureCompanionChat = Operation.make({
102
108
  meta: {
103
- key: DXN.make("org.dxos.operation.assistant.ensureCompanionChat"),
109
+ key: DXN$1.make("org.dxos.operation.assistant.ensureCompanionChat"),
104
110
  name: "Ensure Companion Chat",
105
111
  icon: "ph--chat-text--regular"
106
112
  },
@@ -112,6 +118,101 @@ var EnsureCompanionChat = Operation.make({
112
118
  persisted: Schema.Boolean
113
119
  })
114
120
  });
121
+ /**
122
+ * Runs `prompt` as a turn on an existing chat, for a caller starting one on the chat's behalf
123
+ * (delegation, a routine) rather than a reader typing it.
124
+ *
125
+ * The session is created with the model the chat's own UI would use — resolved from the assistant
126
+ * settings — because `AgentService` binds the model to the agent process at spawn and tears that
127
+ * process down when a later caller asks for a different one. A turn started on any other model
128
+ * therefore interrupts itself the moment the reader opens the chat.
129
+ */
130
+ var RunPromptInChat = Operation.make({
131
+ meta: {
132
+ key: DXN$1.make("org.dxos.operation.assistant.runPromptInChat"),
133
+ name: "Run Prompt in Chat",
134
+ icon: "ph--chat-text--regular",
135
+ skipRegistry: true
136
+ },
137
+ services: [
138
+ Capability.Service,
139
+ Database.Service,
140
+ AgentService.AgentService
141
+ ],
142
+ input: Schema.Struct({
143
+ chat: Schema.optional(Type.getSchema(Chat.Chat)),
144
+ companionTo: Schema.optional(Obj.Unknown),
145
+ prompt: Schema.String,
146
+ /**
147
+ * How the turn is attributed. `synthetic` marks a prompt the system raised on the reader's
148
+ * behalf — a resumed agent must be able to tell one from something a person typed, since only
149
+ * the latter is an instruction it owes an answer to.
150
+ *
151
+ * @default 'user'
152
+ */
153
+ disposition: Schema.optional(ContentBlock.Disposition)
154
+ }),
155
+ output: Schema.Void
156
+ });
157
+ /**
158
+ * Answers a request an agent raised in a chat (allow or refuse a tool call) and hands the choice to the
159
+ * agent waiting on it.
160
+ */
161
+ var RespondToRequest = Operation.make({
162
+ meta: {
163
+ key: DXN$1.make("org.dxos.operation.assistant.respondToRequest"),
164
+ name: "Respond to Request",
165
+ icon: "ph--check-circle--regular",
166
+ skipRegistry: true
167
+ },
168
+ services: [Capability.Service, Database.Service],
169
+ input: Schema.Struct({
170
+ chat: Type.getSchema(Chat.Chat),
171
+ /** The message holding the request block. */
172
+ messageId: Schema.String,
173
+ requestId: Schema.String,
174
+ optionId: Schema.String
175
+ }),
176
+ output: Schema.Struct({
177
+ /** False when nothing was waiting on the request any more (its turn ended, or it was answered). */
178
+ answered: Schema.Boolean })
179
+ });
180
+ /**
181
+ * Records a reader's answer to a question in a task's history and resumes the conversation that
182
+ * asked it.
183
+ *
184
+ * The resume is a synthetic prompt naming the question rather than the answer itself: the answer is
185
+ * already durable in the task's history, and an agent that reads it back there sees the record
186
+ * itself rather than a copy frozen into a message.
187
+ */
188
+ var AnswerQuestion = Operation.make({
189
+ meta: {
190
+ key: DXN$1.make("org.dxos.operation.assistant.answerQuestion"),
191
+ name: "Answer Question",
192
+ description: "Answer a question an agent asked, and resume the conversation that asked it.",
193
+ icon: "ph--question--regular",
194
+ skipRegistry: true
195
+ },
196
+ services: [Database.Service, Trace.TraceService],
197
+ input: Schema.Struct({
198
+ task: Type.getSchema(Task.Task),
199
+ /** Id of the question's entry in the task's history. */
200
+ question: Schema.String,
201
+ answer: Schema.String.annotate({ description: "The chosen option's title, or free-form text." })
202
+ }),
203
+ output: Schema.Struct({
204
+ /**
205
+ * False when the answer was blank, the question is not in the task's history, or it was already
206
+ * answered — nothing was written.
207
+ */
208
+ accepted: Schema.Boolean,
209
+ /**
210
+ * Whether the asking conversation was woken. Separate from `accepted` because the answer is
211
+ * durable either way, and conflating them would show a resumed agent that is still blocked.
212
+ */
213
+ resumed: Schema.Boolean
214
+ })
215
+ }).pipe(Operation.mutation("write"));
115
216
  var SkillForm = Schema.Struct({
116
217
  key: Schema.String,
117
218
  name: Schema.String,
@@ -119,7 +220,7 @@ var SkillForm = Schema.Struct({
119
220
  });
120
221
  var GenerateHomeSuggestions = Operation.make({
121
222
  meta: {
122
- key: DXN.make("org.dxos.operation.assistant.generateHomeSuggestions"),
223
+ key: DXN$1.make("org.dxos.operation.assistant.generateHomeSuggestions"),
123
224
  name: "Generate Home Suggestions",
124
225
  icon: "ph--sparkle--regular",
125
226
  skipRegistry: true
@@ -134,7 +235,7 @@ var GenerateHomeSuggestions = Operation.make({
134
235
  });
135
236
  var SetTracePanelDebug = Operation.make({
136
237
  meta: {
137
- key: DXN.make("org.dxos.operation.assistant.setTracePanelDebug"),
238
+ key: DXN$1.make("org.dxos.operation.assistant.setTracePanelDebug"),
138
239
  name: "Set trace panel debug",
139
240
  description: "Show the trace panel as a raw span tree JSON rather than a commit graph.",
140
241
  icon: "ph--bug--regular"
@@ -144,6 +245,6 @@ var SetTracePanelDebug = Operation.make({
144
245
  output: Schema.Boolean
145
246
  });
146
247
  //#endregion
147
- export { BindChatContext, CreateChat, EnsureCompanionChat, ForkChat, GenerateHomeSuggestions, SetCurrentChat, SetTracePanelDebug, SkillForm, UpdateChatName, AssistantOperation_exports as t };
248
+ export { AnswerQuestion, BindChatContext, CreateChat, EnsureCompanionChat, ForkChat, GenerateHomeSuggestions, RespondToRequest, RunPromptInChat, SetCurrentChat, SetTracePanelDebug, SkillForm, UpdateChatName, AssistantOperation_exports as t };
148
249
 
149
250
  //# sourceMappingURL=AssistantOperation.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantOperation.mjs","names":[],"sources":["../../src/types/AssistantOperation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport { Chat } from '@dxos/assistant-toolkit';\nimport * as Instructions from '@dxos/compute/Instructions';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database, Obj, Ref, Registry, Type } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nexport const CreateChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.createChat'),\n name: 'Create Chat',\n icon: 'ph--chat-text--regular',\n },\n // The chat is returned unfiled, for the caller to add with `SpaceOperation.AddObject` when it wants\n // a durable one. Its feed is added regardless — see the handler.\n services: [Capability.Service, Database.Service],\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n /**\n * Instructions steering the conversation, rendered into the system prompt at request time.\n * Held by reference so the chat follows later edits to them.\n */\n instructions: Schema.optional(Ref.Ref(Instructions.Instructions)),\n }),\n output: Schema.Struct({\n object: Type.getSchema(Chat.Chat),\n }),\n});\n\nexport const UpdateChatName = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.updateChatName'),\n name: 'Update Chat Name',\n icon: 'ph--pencil--regular',\n },\n services: [Database.Service, AiService.AiService],\n input: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** Initial user message text; used when the feed has no history yet (e.g. auto-rename on first send). */\n prompt: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n});\n\nexport const SetCurrentChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.setCurrentChat'),\n name: 'Set Current Chat',\n icon: 'ph--chat-text--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n companionTo: Obj.Unknown,\n chat: Type.getSchema(Chat.Chat).pipe(Schema.optional),\n }),\n output: Schema.Void,\n});\n\nexport const ForkChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.forkChat'),\n name: 'Fork Chat',\n icon: 'ph--git-branch--regular',\n skipRegistry: true,\n },\n services: [Capability.Service, Database.Service],\n input: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** When provided, the forked chat is set as the companion for this object rather than opened standalone. */\n companionTo: Schema.optional(Obj.Unknown),\n }),\n output: Schema.Struct({\n object: Type.getSchema(Chat.Chat),\n }),\n});\n\n/**\n * Applies every applicable `AssistantCapabilities.SubjectContext` contribution to a chat, binding the\n * subject and whatever else its providers derive from it (annotated skills, a project's instruction\n * objects, ...). Idempotent: `AiContext.Binder.bind` drops refs already in the conversation, so\n * re-running on an existing chat backfills bindings added since it was created.\n */\nexport const BindChatContext = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.bindChatContext'),\n name: 'Bind Chat Context',\n icon: 'ph--link--regular',\n },\n services: [Capability.Service, Registry.Service],\n input: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** The object the chat runs against — a companion's primary object, or a chat's originating object. */\n subject: Obj.Unknown,\n }),\n output: Schema.Void,\n});\n\nexport const EnsureCompanionChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.ensureCompanionChat'),\n name: 'Ensure Companion Chat',\n icon: 'ph--chat-text--regular',\n },\n services: [Capability.Service, Database.Service],\n input: Schema.Struct({\n companionTo: Obj.Unknown,\n }),\n output: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** Whether the returned chat was already persisted in the space. */\n persisted: Schema.Boolean,\n }),\n});\n\nexport const SkillForm = Schema.Struct({\n key: Schema.String,\n name: Schema.String,\n description: Schema.optional(Schema.String),\n});\n\nexport const GenerateHomeSuggestions = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.generateHomeSuggestions'),\n name: 'Generate Home Suggestions',\n icon: 'ph--sparkle--regular',\n // Internal UI operation — not exposed as an agent tool.\n skipRegistry: true,\n },\n services: [Capability.Service, AiService.AiService, Database.Service],\n input: Schema.Struct({}),\n output: Schema.Struct({ prompts: Schema.Array(Schema.String) }),\n});\n\nexport const SetTracePanelDebug = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.setTracePanelDebug'),\n name: 'Set trace panel debug',\n description: 'Show the trace panel as a raw span tree JSON rather than a commit graph.',\n icon: 'ph--bug--regular',\n },\n services: [Capability.Service],\n // Required: a caller that omitted it used to get a flip, which made the result depend on state the\n // caller had not read — two calls racing would land wherever the interleaving left them.\n input: Schema.Struct({\n state: Schema.Boolean,\n }),\n output: Schema.Boolean,\n});\n"],"mappings":"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"}
1
+ {"version":3,"file":"AssistantOperation.mjs","names":[],"sources":["../../src/types/AssistantOperation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as AgentService from '@dxos/compute/AgentService';\nimport * as Instructions from '@dxos/compute/Instructions';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Trace from '@dxos/compute/Trace';\nimport { Database, Obj, Ref, Registry, Type } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { ContentBlock, Task } from '@dxos/types';\n\nexport const CreateChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.createChat'),\n name: 'Create Chat',\n icon: 'ph--chat-text--regular',\n },\n // The chat is returned unfiled, for the caller to add with `SpaceOperation.AddObject` when it wants\n // a durable one. Its feed is added regardless — see the handler.\n services: [Capability.Service, Database.Service],\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n /**\n * Instructions steering the conversation, rendered into the system prompt at request time.\n * Held by reference so the chat follows later edits to them.\n */\n instructions: Schema.optional(Ref.Ref(Instructions.Instructions)),\n }),\n output: Schema.Struct({\n object: Type.getSchema(Chat.Chat),\n }),\n});\n\nexport const UpdateChatName = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.updateChatName'),\n name: 'Update Chat Name',\n icon: 'ph--pencil--regular',\n },\n services: [Database.Service, AiService.AiService],\n input: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** Initial user message text; used when the feed has no history yet (e.g. auto-rename on first send). */\n prompt: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n});\n\nexport const SetCurrentChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.setCurrentChat'),\n name: 'Set Current Chat',\n icon: 'ph--chat-text--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n companionTo: Obj.Unknown,\n chat: Type.getSchema(Chat.Chat).pipe(Schema.optional),\n }),\n output: Schema.Void,\n});\n\nexport const ForkChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.forkChat'),\n name: 'Fork Chat',\n icon: 'ph--git-branch--regular',\n skipRegistry: true,\n },\n services: [Capability.Service, Database.Service],\n input: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** When provided, the forked chat is set as the companion for this object rather than opened standalone. */\n companionTo: Schema.optional(Obj.Unknown),\n }),\n output: Schema.Struct({\n object: Type.getSchema(Chat.Chat),\n }),\n});\n\n/**\n * Applies every applicable `AssistantCapabilities.SubjectContext` contribution to a chat, binding the\n * subject and whatever else its providers derive from it (annotated skills, a project's instruction\n * objects, ...). Idempotent: `AiContext.Binder.bind` drops refs already in the conversation, so\n * re-running on an existing chat backfills bindings added since it was created.\n */\nexport const BindChatContext = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.bindChatContext'),\n name: 'Bind Chat Context',\n icon: 'ph--link--regular',\n },\n services: [Capability.Service, Registry.Service],\n input: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** The object the chat runs against — a companion's primary object, or a chat's originating object. */\n subject: Obj.Unknown,\n }),\n output: Schema.Void,\n});\n\nexport const EnsureCompanionChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.ensureCompanionChat'),\n name: 'Ensure Companion Chat',\n icon: 'ph--chat-text--regular',\n },\n services: [Capability.Service, Database.Service],\n input: Schema.Struct({\n companionTo: Obj.Unknown,\n }),\n output: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** Whether the returned chat was already persisted in the space. */\n persisted: Schema.Boolean,\n }),\n});\n\n/**\n * Runs `prompt` as a turn on an existing chat, for a caller starting one on the chat's behalf\n * (delegation, a routine) rather than a reader typing it.\n *\n * The session is created with the model the chat's own UI would use — resolved from the assistant\n * settings — because `AgentService` binds the model to the agent process at spawn and tears that\n * process down when a later caller asks for a different one. A turn started on any other model\n * therefore interrupts itself the moment the reader opens the chat.\n */\nexport const RunPromptInChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.runPromptInChat'),\n name: 'Run Prompt in Chat',\n icon: 'ph--chat-text--regular',\n // An agent already runs inside a session; handing it one that starts another is a footgun.\n skipRegistry: true,\n },\n services: [Capability.Service, Database.Service, AgentService.AgentService],\n input: Schema.Struct({\n chat: Schema.optional(Type.getSchema(Chat.Chat)),\n // The object whose companion chat should run the prompt — the way to name a companion chat that\n // has not been persisted yet, which a caller outside the page (an agent) cannot hold.\n companionTo: Schema.optional(Obj.Unknown),\n prompt: Schema.String,\n /**\n * How the turn is attributed. `synthetic` marks a prompt the system raised on the reader's\n * behalf — a resumed agent must be able to tell one from something a person typed, since only\n * the latter is an instruction it owes an answer to.\n *\n * @default 'user'\n */\n disposition: Schema.optional(ContentBlock.Disposition),\n }),\n output: Schema.Void,\n});\n\n/**\n * Answers a request an agent raised in a chat (allow or refuse a tool call) and hands the choice to the\n * agent waiting on it.\n */\nexport const RespondToRequest = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.respondToRequest'),\n name: 'Respond to Request',\n icon: 'ph--check-circle--regular',\n // Kept off every agent's tool surface: an agent must never be able to answer its own request.\n skipRegistry: true,\n },\n services: [Capability.Service, Database.Service],\n input: Schema.Struct({\n chat: Type.getSchema(Chat.Chat),\n /** The message holding the request block. */\n messageId: Schema.String,\n requestId: Schema.String,\n optionId: Schema.String,\n }),\n output: Schema.Struct({\n /** False when nothing was waiting on the request any more (its turn ended, or it was answered). */\n answered: Schema.Boolean,\n }),\n});\n\n/**\n * Records a reader's answer to a question in a task's history and resumes the conversation that\n * asked it.\n *\n * The resume is a synthetic prompt naming the question rather than the answer itself: the answer is\n * already durable in the task's history, and an agent that reads it back there sees the record\n * itself rather than a copy frozen into a message.\n */\nexport const AnswerQuestion = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.answerQuestion'),\n name: 'Answer Question',\n description: 'Answer a question an agent asked, and resume the conversation that asked it.',\n icon: 'ph--question--regular',\n // The asker is the agent; handing it the tool to answer itself is a footgun.\n skipRegistry: true,\n },\n // Not `Capability.Service`: the resume goes through `RunPromptInChat`, which declares the\n // services it needs itself, so requiring them here too would fail a caller that only records.\n services: [Database.Service, Trace.TraceService],\n input: Schema.Struct({\n task: Type.getSchema(Task.Task),\n /** Id of the question's entry in the task's history. */\n question: Schema.String,\n answer: Schema.String.annotate({ description: \"The chosen option's title, or free-form text.\" }),\n }),\n output: Schema.Struct({\n /**\n * False when the answer was blank, the question is not in the task's history, or it was already\n * answered — nothing was written.\n */\n accepted: Schema.Boolean,\n /**\n * Whether the asking conversation was woken. Separate from `accepted` because the answer is\n * durable either way, and conflating them would show a resumed agent that is still blocked.\n */\n resumed: Schema.Boolean,\n }),\n}).pipe(Operation.mutation('write'));\n\nexport const SkillForm = Schema.Struct({\n key: Schema.String,\n name: Schema.String,\n description: Schema.optional(Schema.String),\n});\n\nexport const GenerateHomeSuggestions = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.generateHomeSuggestions'),\n name: 'Generate Home Suggestions',\n icon: 'ph--sparkle--regular',\n // Internal UI operation — not exposed as an agent tool.\n skipRegistry: true,\n },\n services: [Capability.Service, AiService.AiService, Database.Service],\n input: Schema.Struct({}),\n output: Schema.Struct({ prompts: Schema.Array(Schema.String) }),\n});\n\nexport const SetTracePanelDebug = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistant.setTracePanelDebug'),\n name: 'Set trace panel debug',\n description: 'Show the trace panel as a raw span tree JSON rather than a commit graph.',\n icon: 'ph--bug--regular',\n },\n services: [Capability.Service],\n // Required: a caller that omitted it used to get a flip, which made the result depend on state the\n // caller had not read — two calls racing would land wherever the interleaving left them.\n input: Schema.Struct({\n state: Schema.Boolean,\n }),\n output: Schema.Boolean,\n});\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantOptions.mjs","names":[],"sources":["../../src/types/AssistantOptions.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport type { AiService } from '@dxos/ai';\n\nexport interface AssistantPluginOptions {\n aiServiceMiddleware?: (aiService: AiService.Service) => AiService.Service;\n\n /**\n * Whether creation is offered for the unfinished types (`Agent`, `Sequence`) — default true, off in\n * the curated set, which must not advertise a type it cannot yet do anything useful with.\n */\n experimentalTypes?: boolean;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"AssistantOptions.mjs","names":[],"sources":["../../src/types/AssistantOptions.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport type { MakeTurnProducer } from '@dxos/agent-runtime';\nimport type { AiService } from '@dxos/ai';\nimport type * as CapabilityManager from '@dxos/app-framework/CapabilityManager';\n\nexport interface AssistantPluginOptions {\n aiServiceMiddleware?: (aiService: AiService.Service) => AiService.Service;\n\n /**\n * Whether creation is offered for the unfinished types (`Agent`, `Sequence`) — default true, off in\n * the curated set, which must not advertise a type it cannot yet do anything useful with.\n */\n experimentalTypes?: boolean;\n\n /**\n * Builds the turn engine used when the user enables `Settings.codeMode`; injected by the host\n * because the code-mode package is not published. Handed the app's capabilities so the host can\n * reach what its sandbox needs (e.g. the client's services). Without it the setting has no effect.\n */\n codeModeTurnProducer?: (capabilities: CapabilityManager.CapabilityManager) => MakeTurnProducer;\n}\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- import { DXN, Ref, Type } from "@dxos/echo";
2
+ import { Annotation, DXN, Ref, Type } from "@dxos/echo";
3
3
  import * as Operation from "@dxos/compute/Operation";
4
4
  import * as Schema from "effect/Schema";
5
5
  import { ComputeGraph } from "@dxos/conductor";
@@ -63,7 +63,7 @@ var ServiceType = class extends Type.makeObject(DXN.make("org.dxos.type.service"
63
63
  * Entries exposed: functions, workflows, and APIs.
64
64
  */
65
65
  interfaces: Schema.optional(Schema.Array(ServiceInterface))
66
- })) {};
66
+ }).pipe(Annotation.UserType.set())) {};
67
67
  var categoryIcons = {
68
68
  finance: "ph--bank--regular",
69
69
  health: "ph--heart--regular",
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantService.mjs","names":[],"sources":["../../src/types/AssistantService.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { ComputeGraph } from '@dxos/conductor';\nimport { DXN, Ref, Type } from '@dxos/echo';\n\n// TODO(burdon): Factor out and reconcile with https://github.com/dxos/dxos/blob/main/packages/plugins/plugin-token-manager/src/defs/presets.ts#L7\n\nconst ApiAuthorizationKey = Schema.Struct({\n type: Schema.Literal('api-key'),\n key: Schema.String,\n placement: Schema.Union([\n Schema.Struct({\n type: Schema.Literal('authorization-header'),\n }),\n Schema.Struct({\n type: Schema.Literal('query'),\n name: Schema.String,\n }),\n ]),\n});\n\nconst ApiAuthorizationOauth = Schema.Struct({\n type: Schema.Literal('oauth'),\n clientId: Schema.String,\n clientSecret: Schema.String,\n tokenUrl: Schema.String,\n grantType: Schema.String,\n});\n\nexport const ApiAuthorization = Schema.Union([ApiAuthorizationKey, ApiAuthorizationOauth]);\nexport type ApiAuthorization = Schema.Schema.Type<typeof ApiAuthorization>;\n\nconst ServiceInterfaceFunction = Schema.Struct({\n kind: Schema.Literal('function'),\n fn: Ref.Ref(Operation.PersistentOperation),\n});\n\nconst ServiceInterfaceWorkflow = Schema.Struct({\n kind: Schema.Literal('workflow'),\n workflow: Ref.Ref(ComputeGraph),\n});\n\nconst ServiceInterfaceApi = Schema.Struct({\n kind: Schema.Literal('api'),\n\n /**\n * URL to fetch the openapi schema.\n */\n schemaUrl: Schema.optional(Schema.String),\n\n /**\n * Inlined openapi schema.\n */\n schema: Schema.optional(Schema.Any),\n\n /**\n * Authorization configuration if required.\n */\n authorization: Schema.optional(ApiAuthorization),\n});\n\nconst ServiceInterface = Schema.Union([\n // Service types.\n ServiceInterfaceFunction,\n ServiceInterfaceWorkflow,\n ServiceInterfaceApi,\n]);\n\nexport type ServiceInterface = Schema.Schema.Type<typeof ServiceInterface>;\n\nexport class ServiceType extends Type.makeObject<ServiceType>(DXN.make('org.dxos.type.service', '0.1.0'))(\n Schema.Struct({\n serviceId: Schema.String,\n name: Schema.optional(Schema.String),\n description: Schema.optional(Schema.String),\n category: Schema.optional(Schema.String),\n enabled: Schema.optional(Schema.Boolean),\n\n /**\n * Entries exposed: functions, workflows, and APIs.\n */\n interfaces: Schema.optional(Schema.Array(ServiceInterface)),\n }),\n) {}\n\n//\n// Service Registry\n//\n\nexport interface BaseServiceRegistry {\n queryServices(query?: ServiceQuery): Promise<ServiceType[]>;\n}\n\nexport type ServiceQuery = {\n name?: string;\n category?: string;\n};\n\nexport const categoryIcons: Record<string, string> = {\n finance: 'ph--bank--regular',\n health: 'ph--heart--regular',\n geolocation: 'ph--globe-simple--regular',\n education: 'ph--books--regular',\n entertainment: 'ph--music-notes--regular',\n shopping: 'ph--shopping-cart--regular',\n travel: 'ph--airplane-takeoff--regular',\n utilities: 'ph--lightning--regular',\n weather: 'ph--cloud-rain--regular',\n} as const;\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,sBAAsB,OAAO,OAAO;CACxC,MAAM,OAAO,QAAQ,SAAS;CAC9B,KAAK,OAAO;CACZ,WAAW,OAAO,MAAM,CACtB,OAAO,OAAO,EACZ,MAAM,OAAO,QAAQ,sBAAsB,EAC7C,CAAC,GACD,OAAO,OAAO;EACZ,MAAM,OAAO,QAAQ,OAAO;EAC5B,MAAM,OAAO;CACf,CAAC,CACH,CAAC;AACH,CAAC;AAED,IAAM,wBAAwB,OAAO,OAAO;CAC1C,MAAM,OAAO,QAAQ,OAAO;CAC5B,UAAU,OAAO;CACjB,cAAc,OAAO;CACrB,UAAU,OAAO;CACjB,WAAW,OAAO;AACpB,CAAC;AAED,IAAa,mBAAmB,OAAO,MAAM,CAAC,qBAAqB,qBAAqB,CAAC;AAGzF,IAAM,2BAA2B,OAAO,OAAO;CAC7C,MAAM,OAAO,QAAQ,UAAU;CAC/B,IAAI,IAAI,IAAI,UAAU,mBAAmB;AAC3C,CAAC;AAED,IAAM,2BAA2B,OAAO,OAAO;CAC7C,MAAM,OAAO,QAAQ,UAAU;CAC/B,UAAU,IAAI,IAAI,YAAY;AAChC,CAAC;AAED,IAAM,sBAAsB,OAAO,OAAO;CACxC,MAAM,OAAO,QAAQ,KAAK;;;;CAK1B,WAAW,OAAO,SAAS,OAAO,MAAM;;;;CAKxC,QAAQ,OAAO,SAAS,OAAO,GAAG;;;;CAKlC,eAAe,OAAO,SAAS,gBAAgB;AACjD,CAAC;AAED,IAAM,mBAAmB,OAAO,MAAM;CAEpC;CACA;CACA;AACF,CAAC;AAID,IAAa,cAAb,cAAiC,KAAK,WAAwB,IAAI,KAAK,yBAAyB,OAAO,CAAC,CAAC,CACvG,OAAO,OAAO;CACZ,WAAW,OAAO;CAClB,MAAM,OAAO,SAAS,OAAO,MAAM;CACnC,aAAa,OAAO,SAAS,OAAO,MAAM;CAC1C,UAAU,OAAO,SAAS,OAAO,MAAM;CACvC,SAAS,OAAO,SAAS,OAAO,OAAO;;;;CAKvC,YAAY,OAAO,SAAS,OAAO,MAAM,gBAAgB,CAAC;AAC5D,CAAC,CACH,CAAC,CAAC,CAAC;AAeH,IAAa,gBAAwC;CACnD,SAAS;CACT,QAAQ;CACR,aAAa;CACb,WAAW;CACX,eAAe;CACf,UAAU;CACV,QAAQ;CACR,WAAW;CACX,SAAS;AACX"}
1
+ {"version":3,"file":"AssistantService.mjs","names":[],"sources":["../../src/types/AssistantService.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Annotation, DXN, Ref, Type } from '@dxos/echo';\n\n// TODO(burdon): Factor out and reconcile with https://github.com/dxos/dxos/blob/main/packages/plugins/plugin-token-manager/src/defs/presets.ts#L7\n\nconst ApiAuthorizationKey = Schema.Struct({\n type: Schema.Literal('api-key'),\n key: Schema.String,\n placement: Schema.Union([\n Schema.Struct({\n type: Schema.Literal('authorization-header'),\n }),\n Schema.Struct({\n type: Schema.Literal('query'),\n name: Schema.String,\n }),\n ]),\n});\n\nconst ApiAuthorizationOauth = Schema.Struct({\n type: Schema.Literal('oauth'),\n clientId: Schema.String,\n clientSecret: Schema.String,\n tokenUrl: Schema.String,\n grantType: Schema.String,\n});\n\nexport const ApiAuthorization = Schema.Union([ApiAuthorizationKey, ApiAuthorizationOauth]);\nexport type ApiAuthorization = Schema.Schema.Type<typeof ApiAuthorization>;\n\nconst ServiceInterfaceFunction = Schema.Struct({\n kind: Schema.Literal('function'),\n fn: Ref.Ref(Operation.PersistentOperation),\n});\n\nconst ServiceInterfaceWorkflow = Schema.Struct({\n kind: Schema.Literal('workflow'),\n workflow: Ref.Ref(ComputeGraph),\n});\n\nconst ServiceInterfaceApi = Schema.Struct({\n kind: Schema.Literal('api'),\n\n /**\n * URL to fetch the openapi schema.\n */\n schemaUrl: Schema.optional(Schema.String),\n\n /**\n * Inlined openapi schema.\n */\n schema: Schema.optional(Schema.Any),\n\n /**\n * Authorization configuration if required.\n */\n authorization: Schema.optional(ApiAuthorization),\n});\n\nconst ServiceInterface = Schema.Union([\n // Service types.\n ServiceInterfaceFunction,\n ServiceInterfaceWorkflow,\n ServiceInterfaceApi,\n]);\n\nexport type ServiceInterface = Schema.Schema.Type<typeof ServiceInterface>;\n\nexport class ServiceType extends Type.makeObject<ServiceType>(DXN.make('org.dxos.type.service', '0.1.0'))(\n Schema.Struct({\n serviceId: Schema.String,\n name: Schema.optional(Schema.String),\n description: Schema.optional(Schema.String),\n category: Schema.optional(Schema.String),\n enabled: Schema.optional(Schema.Boolean),\n\n /**\n * Entries exposed: functions, workflows, and APIs.\n */\n interfaces: Schema.optional(Schema.Array(ServiceInterface)),\n }).pipe(Annotation.UserType.set()),\n) {}\n\n//\n// Service Registry\n//\n\nexport interface BaseServiceRegistry {\n queryServices(query?: ServiceQuery): Promise<ServiceType[]>;\n}\n\nexport type ServiceQuery = {\n name?: string;\n category?: string;\n};\n\nexport const categoryIcons: Record<string, string> = {\n finance: 'ph--bank--regular',\n health: 'ph--heart--regular',\n geolocation: 'ph--globe-simple--regular',\n education: 'ph--books--regular',\n entertainment: 'ph--music-notes--regular',\n shopping: 'ph--shopping-cart--regular',\n travel: 'ph--airplane-takeoff--regular',\n utilities: 'ph--lightning--regular',\n weather: 'ph--cloud-rain--regular',\n} as const;\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,sBAAsB,OAAO,OAAO;CACxC,MAAM,OAAO,QAAQ,SAAS;CAC9B,KAAK,OAAO;CACZ,WAAW,OAAO,MAAM,CACtB,OAAO,OAAO,EACZ,MAAM,OAAO,QAAQ,sBAAsB,EAC7C,CAAC,GACD,OAAO,OAAO;EACZ,MAAM,OAAO,QAAQ,OAAO;EAC5B,MAAM,OAAO;CACf,CAAC,CACH,CAAC;AACH,CAAC;AAED,IAAM,wBAAwB,OAAO,OAAO;CAC1C,MAAM,OAAO,QAAQ,OAAO;CAC5B,UAAU,OAAO;CACjB,cAAc,OAAO;CACrB,UAAU,OAAO;CACjB,WAAW,OAAO;AACpB,CAAC;AAED,IAAa,mBAAmB,OAAO,MAAM,CAAC,qBAAqB,qBAAqB,CAAC;AAGzF,IAAM,2BAA2B,OAAO,OAAO;CAC7C,MAAM,OAAO,QAAQ,UAAU;CAC/B,IAAI,IAAI,IAAI,UAAU,mBAAmB;AAC3C,CAAC;AAED,IAAM,2BAA2B,OAAO,OAAO;CAC7C,MAAM,OAAO,QAAQ,UAAU;CAC/B,UAAU,IAAI,IAAI,YAAY;AAChC,CAAC;AAED,IAAM,sBAAsB,OAAO,OAAO;CACxC,MAAM,OAAO,QAAQ,KAAK;;;;CAK1B,WAAW,OAAO,SAAS,OAAO,MAAM;;;;CAKxC,QAAQ,OAAO,SAAS,OAAO,GAAG;;;;CAKlC,eAAe,OAAO,SAAS,gBAAgB;AACjD,CAAC;AAED,IAAM,mBAAmB,OAAO,MAAM;CAEpC;CACA;CACA;AACF,CAAC;AAID,IAAa,cAAb,cAAiC,KAAK,WAAwB,IAAI,KAAK,yBAAyB,OAAO,CAAC,CAAC,CACvG,OAAO,OAAO;CACZ,WAAW,OAAO;CAClB,MAAM,OAAO,SAAS,OAAO,MAAM;CACnC,aAAa,OAAO,SAAS,OAAO,MAAM;CAC1C,UAAU,OAAO,SAAS,OAAO,MAAM;CACvC,SAAS,OAAO,SAAS,OAAO,OAAO;;;;CAKvC,YAAY,OAAO,SAAS,OAAO,MAAM,gBAAgB,CAAC;AAC5D,CAAC,CAAC,CAAC,KAAK,WAAW,SAAS,IAAI,CAAC,CACnC,CAAC,CAAC,CAAC;AAeH,IAAa,gBAAwC;CACnD,SAAS;CACT,QAAQ;CACR,aAAa;CACb,WAAW;CACX,eAAe;CACf,UAAU;CACV,QAAQ;CACR,WAAW;CACX,SAAS;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantSkill.mjs","names":[],"sources":["../../src/skills/assistant/AssistantSkill.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as NavigationOperation from '@dxos/app-toolkit/NavigationOperation';\nimport { templates } from '@dxos/assistant';\nimport * as Skill from '@dxos/compute/Skill';\n\nexport const key = 'org.dxos.skill.assistant';\n\nexport const make = (): Skill.Skill =>\n Skill.make({\n key,\n name: 'Assistant',\n tools: Skill.toolDefinitions({\n // TODO(wittjosiah): LayoutOperation.Open requires Capability.Service which is only available\n // via the compute-runtime layer (plugin-routine). Once Capability.Service is propagated\n // through the process operation runtime, this will work without the compute-runtime dependency.\n operations: [LayoutOperation.Open, NavigationOperation.ResolveNavigationTargets],\n }),\n instructions: templates.system,\n });\n"],"mappings":";;;;;;;;;;AASA,IAAa,MAAM;AAEnB,IAAa,aACX,MAAM,KAAK;CACT;CACA,MAAM;CACN,OAAO,MAAM,gBAAgB,EAI3B,YAAY,CAAC,gBAAgB,MAAM,oBAAoB,wBAAwB,EACjF,CAAC;CACD,cAAc,UAAU;AAC1B,CAAC"}
1
+ {"version":3,"file":"AssistantSkill.mjs","names":[],"sources":["../../src/skills/assistant/AssistantSkill.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as NavigationOperation from '@dxos/app-toolkit/NavigationOperation';\nimport { templates } from '@dxos/assistant';\nimport * as Skill from '@dxos/compute/Skill';\n\nexport const key = 'org.dxos.skill.assistant';\n\nexport const make = (): Skill.Skill =>\n Skill.make({\n key,\n name: 'Assistant',\n tools: Skill.toolDefinitions({\n // TODO(wittjosiah): LayoutOperation.Open requires Capability.Service which is only available\n // via the compute-runtime layer (plugin-routine). Once Capability.Service is propagated\n // through the process operation runtime, this will work without the compute-runtime dependency.\n operations: [LayoutOperation.Open, NavigationOperation.ResolveNavigationTargets],\n }),\n instructions: templates.system,\n });\n"],"mappings":";;;;;;;;;;AAWA,IAAa,MAAM;AAEnB,IAAa,aACX,MAAM,KAAK;CACT;CACA,MAAM;CACN,OAAO,MAAM,gBAAgB,EAI3B,YAAY,CAAC,gBAAgB,MAAM,oBAAoB,wBAAwB,EACjF,CAAC;CACD,cAAc,UAAU;AAC1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { a as useChatReportContext, i as useChatContext, n as ChatReportContextProvider, o as useChatThreadContext, r as ChatThreadContextProvider, t as ChatContextProvider } from "./chunk-context.mjs";
2
+ import { i as objectCardWidget, n as ObjectCard, r as ObjectCardWidget, t as Chat } from "./chunk-Chat.mjs";
3
+ export { Chat, ChatContextProvider, ChatReportContextProvider, ChatThreadContextProvider, ObjectCard, ObjectCardWidget, objectCardWidget, useChatContext, useChatReportContext, useChatThreadContext };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- import * as Atom from "effect/unstable/reactivity/Atom";
2
+ import * as Atom from "effect/reactivity/Atom";
3
3
  //#region src/types/Ollama.ts
4
4
  var Ollama_exports = /* @__PURE__ */ __exportAll({ emptyState: () => emptyState });
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Ollama.mjs","names":[],"sources":["../../src/types/Ollama.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport type * as Effect from 'effect/Effect';\nimport * as Atom from 'effect/unstable/reactivity/Atom';\n\nimport { type OllamaAdmin } from '@dxos/ai/resolvers';\n\n/**\n * Reactive state of the local Ollama model installation, surfaced to the settings UI.\n */\nexport type ModelsState = {\n kind: 'idle' | 'loading' | 'ready' | 'failed';\n models: OllamaAdmin.Model[];\n /** Models currently loaded into memory (from `/api/ps`). */\n loaded: OllamaAdmin.RunningModel[];\n /** In-flight pulls keyed by model name. */\n pulls: Record<string, OllamaAdmin.PullProgress>;\n /** Per-model action errors (load/unload/remove/pull), keyed by model name, shown inline. */\n errors: Record<string, string>;\n /** Connection-level error reaching the service (no specific model). */\n error?: string;\n};\n\n/**\n * Stable, empty model state. Subscribed to when no sidecar manager is present (web/mobile) so a\n * reactive read keeps an unconditional hook order.\n */\nexport const emptyState: Atom.Atom<ModelsState> = Atom.make<ModelsState>({\n kind: 'idle',\n models: [],\n loaded: [],\n pulls: {},\n errors: {},\n});\n\n/**\n * Capability for managing locally-installed Ollama models. Implemented by the native (desktop)\n * plugin against the bundled sidecar; absent in the browser/mobile, where the UI renders nothing.\n */\nexport type Manager = {\n readonly endpoint: string;\n state: Atom.Writable<ModelsState>;\n /** List installed models (and currently-loaded models). Ensures the sidecar is running. */\n refresh: Effect.Effect<void>;\n /** Refresh only the currently-loaded models; cheap, for polling while a chat runs. */\n refreshLoaded: Effect.Effect<void>;\n pull: (name: string) => Effect.Effect<void>;\n /** Abort an in-flight pull, leaving any already-downloaded layers in place. */\n cancel: (name: string) => Effect.Effect<void>;\n /** Load a model into memory (kept resident until unloaded). */\n load: (name: string) => Effect.Effect<void>;\n /** Unload a model from memory. */\n unload: (name: string) => Effect.Effect<void>;\n remove: (name: string) => Effect.Effect<void>;\n};\n"],"mappings":";;;;;;;;AA+BA,IAAa,aAAqC,KAAK,KAAkB;CACvE,MAAM;CACN,QAAQ,CAAC;CACT,QAAQ,CAAC;CACT,OAAO,CAAC;CACR,QAAQ,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"Ollama.mjs","names":[],"sources":["../../src/types/Ollama.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport type * as Effect from 'effect/Effect';\nimport * as Atom from 'effect/reactivity/Atom';\n\nimport { type OllamaAdmin } from '@dxos/ai/resolvers';\n\n/**\n * Reactive state of the local Ollama model installation, surfaced to the settings UI.\n */\nexport type ModelsState = {\n kind: 'idle' | 'loading' | 'ready' | 'failed';\n models: OllamaAdmin.Model[];\n /** Models currently loaded into memory (from `/api/ps`). */\n loaded: OllamaAdmin.RunningModel[];\n /** In-flight pulls keyed by model name. */\n pulls: Record<string, OllamaAdmin.PullProgress>;\n /** Per-model action errors (load/unload/remove/pull), keyed by model name, shown inline. */\n errors: Record<string, string>;\n /** Connection-level error reaching the service (no specific model). */\n error?: string;\n};\n\n/**\n * Stable, empty model state. Subscribed to when no sidecar manager is present (web/mobile) so a\n * reactive read keeps an unconditional hook order.\n */\nexport const emptyState: Atom.Atom<ModelsState> = Atom.make<ModelsState>({\n kind: 'idle',\n models: [],\n loaded: [],\n pulls: {},\n errors: {},\n});\n\n/**\n * Capability for managing locally-installed Ollama models. Implemented by the native (desktop)\n * plugin against the bundled sidecar; absent in the browser/mobile, where the UI renders nothing.\n */\nexport type Manager = {\n readonly endpoint: string;\n state: Atom.Writable<ModelsState>;\n /** List installed models (and currently-loaded models). Ensures the sidecar is running. */\n refresh: Effect.Effect<void>;\n /** Refresh only the currently-loaded models; cheap, for polling while a chat runs. */\n refreshLoaded: Effect.Effect<void>;\n pull: (name: string) => Effect.Effect<void>;\n /** Abort an in-flight pull, leaving any already-downloaded layers in place. */\n cancel: (name: string) => Effect.Effect<void>;\n /** Load a model into memory (kept resident until unloaded). */\n load: (name: string) => Effect.Effect<void>;\n /** Unload a model from memory. */\n unload: (name: string) => Effect.Effect<void>;\n remove: (name: string) => Effect.Effect<void>;\n};\n"],"mappings":";;;;;;;;AA+BA,IAAa,aAAqC,KAAK,KAAkB;CACvE,MAAM;CACN,QAAQ,CAAC;CACT,QAAQ,CAAC;CACT,OAAO,CAAC;CACR,QAAQ,CAAC;AACX,CAAC"}