@dxos/plugin-assistant 0.8.2-staging.7ac8446 → 0.8.3-main.672df60

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 (365) hide show
  1. package/dist/lib/browser/AssistantDialog-UAZSN6GT.mjs +46 -0
  2. package/dist/lib/browser/AssistantDialog-UAZSN6GT.mjs.map +7 -0
  3. package/dist/lib/browser/BlueprintEditor-DGV4KJDM.mjs +45 -0
  4. package/dist/lib/browser/BlueprintEditor-DGV4KJDM.mjs.map +7 -0
  5. package/dist/lib/browser/ChatContainer-UTN3AO5U.mjs +39 -0
  6. package/dist/lib/browser/ChatContainer-UTN3AO5U.mjs.map +7 -0
  7. package/dist/lib/browser/TemplateContainer-AKUYL4AV.mjs +28 -0
  8. package/dist/lib/browser/TemplateContainer-AKUYL4AV.mjs.map +7 -0
  9. package/dist/lib/browser/{ai-client-CDZLSNXE.mjs → ai-client-COXVUC6V.mjs} +6 -6
  10. package/dist/lib/browser/ai-client-COXVUC6V.mjs.map +7 -0
  11. package/dist/lib/browser/app-graph-builder-56OZ5RW4.mjs +206 -0
  12. package/dist/lib/browser/app-graph-builder-56OZ5RW4.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-TXJWGWJ7.mjs → chunk-3F44MBHU.mjs} +3 -3
  14. package/dist/lib/browser/chunk-3F44MBHU.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-6SD7S7W5.mjs +157 -0
  16. package/dist/lib/browser/chunk-6SD7S7W5.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-JQFUME3B.mjs +87 -0
  18. package/dist/lib/{node-esm/chunk-PBZA7XJR.mjs.map → browser/chunk-JQFUME3B.mjs.map} +1 -1
  19. package/dist/lib/browser/chunk-NBSPGIHL.mjs +206 -0
  20. package/dist/lib/browser/chunk-NBSPGIHL.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +96 -0
  22. package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +7 -0
  23. package/dist/lib/browser/{chunk-FMB7RGMP.mjs → chunk-Q6XE3O3E.mjs} +1714 -1536
  24. package/dist/lib/browser/chunk-Q6XE3O3E.mjs.map +7 -0
  25. package/dist/lib/browser/{chunk-3HCI5FIL.mjs → chunk-XOZ7YMO3.mjs} +3 -3
  26. package/dist/lib/browser/{chunk-3HCI5FIL.mjs.map → chunk-XOZ7YMO3.mjs.map} +1 -1
  27. package/dist/lib/browser/index.mjs +47 -23
  28. package/dist/lib/browser/index.mjs.map +3 -3
  29. package/dist/lib/browser/intent-resolver-GWELYIX2.mjs +39 -0
  30. package/dist/lib/browser/intent-resolver-GWELYIX2.mjs.map +7 -0
  31. package/dist/lib/browser/meta.json +1 -1
  32. package/dist/lib/browser/react-surface-DGS34EON.mjs +144 -0
  33. package/dist/lib/browser/react-surface-DGS34EON.mjs.map +7 -0
  34. package/dist/lib/browser/{settings-U6UFQX32.mjs → settings-BTFB7IQ6.mjs} +5 -5
  35. package/dist/lib/browser/settings-BTFB7IQ6.mjs.map +7 -0
  36. package/dist/lib/browser/types/index.mjs +6 -2
  37. package/dist/lib/node/AssistantDialog-RTB5Q7FP.cjs +72 -0
  38. package/dist/lib/node/AssistantDialog-RTB5Q7FP.cjs.map +7 -0
  39. package/dist/lib/node/BlueprintEditor-43VM3XPO.cjs +72 -0
  40. package/dist/lib/node/BlueprintEditor-43VM3XPO.cjs.map +7 -0
  41. package/dist/lib/node/{ChatContainer-ZJ5JXF6A.cjs → ChatContainer-P3JL4VZ7.cjs} +25 -19
  42. package/dist/lib/node/ChatContainer-P3JL4VZ7.cjs.map +7 -0
  43. package/dist/lib/node/TemplateContainer-CTG2MB4W.cjs +58 -0
  44. package/dist/lib/node/TemplateContainer-CTG2MB4W.cjs.map +7 -0
  45. package/dist/lib/node/{ai-client-URCCYU6B.cjs → ai-client-R2CGEYZW.cjs} +13 -13
  46. package/dist/lib/node/ai-client-R2CGEYZW.cjs.map +7 -0
  47. package/dist/lib/node/app-graph-builder-QLF353LH.cjs +216 -0
  48. package/dist/lib/node/app-graph-builder-QLF353LH.cjs.map +7 -0
  49. package/dist/lib/node/{chunk-XI2ARIEO.cjs → chunk-4EEWTDQK.cjs} +45 -39
  50. package/dist/lib/node/{chunk-XI2ARIEO.cjs.map → chunk-4EEWTDQK.cjs.map} +1 -1
  51. package/dist/lib/node/chunk-BWL5A3O5.cjs +184 -0
  52. package/dist/lib/node/chunk-BWL5A3O5.cjs.map +7 -0
  53. package/dist/lib/node/chunk-HRNIUYVQ.cjs +128 -0
  54. package/dist/lib/node/chunk-HRNIUYVQ.cjs.map +7 -0
  55. package/dist/lib/node/{chunk-Q5XWEMHB.cjs → chunk-P74TWGMG.cjs} +6 -6
  56. package/dist/lib/node/{chunk-Q5XWEMHB.cjs.map → chunk-P74TWGMG.cjs.map} +1 -1
  57. package/dist/lib/node/{chunk-RPBKMP2E.cjs → chunk-PG7YNQ4R.cjs} +1523 -1338
  58. package/dist/lib/node/chunk-PG7YNQ4R.cjs.map +7 -0
  59. package/dist/lib/node/{chunk-GBUNQ257.cjs → chunk-TS3H5OSX.cjs} +7 -7
  60. package/dist/lib/node/chunk-TS3H5OSX.cjs.map +7 -0
  61. package/dist/lib/node/chunk-UNVDZOLA.cjs +231 -0
  62. package/dist/lib/node/chunk-UNVDZOLA.cjs.map +7 -0
  63. package/dist/lib/node/index.cjs +88 -65
  64. package/dist/lib/node/index.cjs.map +3 -3
  65. package/dist/lib/node/{intent-resolver-R3OSTIMH.cjs → intent-resolver-U7663JU7.cjs} +15 -21
  66. package/dist/lib/node/intent-resolver-U7663JU7.cjs.map +7 -0
  67. package/dist/lib/node/meta.json +1 -1
  68. package/dist/lib/node/react-surface-QXZTILW6.cjs +157 -0
  69. package/dist/lib/node/react-surface-QXZTILW6.cjs.map +7 -0
  70. package/dist/lib/node/{settings-TXGRCYAL.cjs → settings-LBJMT6YB.cjs} +9 -9
  71. package/dist/lib/node/settings-LBJMT6YB.cjs.map +7 -0
  72. package/dist/lib/node/types/index.cjs +17 -13
  73. package/dist/lib/node/types/index.cjs.map +2 -2
  74. package/dist/lib/node-esm/AssistantDialog-DONAO6SA.mjs +47 -0
  75. package/dist/lib/node-esm/AssistantDialog-DONAO6SA.mjs.map +7 -0
  76. package/dist/lib/node-esm/BlueprintEditor-CTARB2FO.mjs +47 -0
  77. package/dist/lib/node-esm/BlueprintEditor-CTARB2FO.mjs.map +7 -0
  78. package/dist/lib/node-esm/ChatContainer-FVIGCDIG.mjs +40 -0
  79. package/dist/lib/node-esm/ChatContainer-FVIGCDIG.mjs.map +7 -0
  80. package/dist/lib/node-esm/TemplateContainer-IVDQ4XQG.mjs +29 -0
  81. package/dist/lib/node-esm/TemplateContainer-IVDQ4XQG.mjs.map +7 -0
  82. package/dist/lib/node-esm/{ai-client-WMHS5EGV.mjs → ai-client-I5LXHMOZ.mjs} +6 -6
  83. package/dist/lib/node-esm/ai-client-I5LXHMOZ.mjs.map +7 -0
  84. package/dist/lib/node-esm/app-graph-builder-5YX5TKKT.mjs +207 -0
  85. package/dist/lib/node-esm/app-graph-builder-5YX5TKKT.mjs.map +7 -0
  86. package/dist/lib/node-esm/{chunk-ECRK6TUQ.mjs → chunk-BB2TAT4P.mjs} +3 -3
  87. package/dist/lib/node-esm/{chunk-ECRK6TUQ.mjs.map → chunk-BB2TAT4P.mjs.map} +1 -1
  88. package/dist/lib/node-esm/chunk-CDAILLCU.mjs +98 -0
  89. package/dist/lib/node-esm/chunk-CDAILLCU.mjs.map +7 -0
  90. package/dist/lib/node-esm/chunk-GJE4WCUJ.mjs +158 -0
  91. package/dist/lib/node-esm/chunk-GJE4WCUJ.mjs.map +7 -0
  92. package/dist/lib/node-esm/{chunk-6JK5HEUQ.mjs → chunk-HLPGKJ7N.mjs} +3 -3
  93. package/dist/lib/node-esm/chunk-HLPGKJ7N.mjs.map +7 -0
  94. package/dist/lib/node-esm/{chunk-MVDAY3CZ.mjs → chunk-MNH6E6EB.mjs} +1714 -1536
  95. package/dist/lib/node-esm/chunk-MNH6E6EB.mjs.map +7 -0
  96. package/dist/lib/node-esm/{chunk-PBZA7XJR.mjs → chunk-OYN6HLXZ.mjs} +42 -36
  97. package/dist/lib/{browser/chunk-NFUHCW2J.mjs.map → node-esm/chunk-OYN6HLXZ.mjs.map} +1 -1
  98. package/dist/lib/node-esm/chunk-TQYSF2GS.mjs +207 -0
  99. package/dist/lib/node-esm/chunk-TQYSF2GS.mjs.map +7 -0
  100. package/dist/lib/node-esm/index.mjs +47 -23
  101. package/dist/lib/node-esm/index.mjs.map +3 -3
  102. package/dist/lib/node-esm/intent-resolver-N5TM3RTL.mjs +40 -0
  103. package/dist/lib/node-esm/intent-resolver-N5TM3RTL.mjs.map +7 -0
  104. package/dist/lib/node-esm/meta.json +1 -1
  105. package/dist/lib/node-esm/react-surface-FTKGQQD2.mjs +145 -0
  106. package/dist/lib/node-esm/react-surface-FTKGQQD2.mjs.map +7 -0
  107. package/dist/lib/node-esm/{settings-DZU5PNXM.mjs → settings-TGCCAH5D.mjs} +5 -5
  108. package/dist/lib/node-esm/settings-TGCCAH5D.mjs.map +7 -0
  109. package/dist/lib/node-esm/types/index.mjs +6 -2
  110. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  111. package/dist/types/src/capabilities/ai-client.d.ts +3 -3
  112. package/dist/types/src/capabilities/ai-client.d.ts.map +1 -1
  113. package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
  114. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  115. package/dist/types/src/capabilities/capabilities.d.ts +1 -1
  116. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  117. package/dist/types/src/capabilities/index.d.ts +3 -179
  118. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  119. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  120. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  121. package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +3 -1
  122. package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -1
  123. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  124. package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts +8 -0
  125. package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts.map +1 -0
  126. package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts +8 -0
  127. package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts.map +1 -0
  128. package/dist/types/src/components/BlueprintEditor/index.d.ts +3 -0
  129. package/dist/types/src/components/BlueprintEditor/index.d.ts.map +1 -0
  130. package/dist/types/src/components/ChatContainer.d.ts +4 -3
  131. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  132. package/dist/types/src/components/Prompt/Prompt.d.ts +5 -2
  133. package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -1
  134. package/dist/types/src/components/Prompt/Prompt.stories.d.ts +6 -3
  135. package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -1
  136. package/dist/types/src/components/Prompt/PromptBar.d.ts +9 -4
  137. package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -1
  138. package/dist/types/src/components/Prompt/PromptBar.stories.d.ts +9 -0
  139. package/dist/types/src/components/Prompt/PromptBar.stories.d.ts.map +1 -0
  140. package/dist/types/src/components/Prompt/autocomplete.d.ts +5 -1
  141. package/dist/types/src/components/Prompt/autocomplete.d.ts.map +1 -1
  142. package/dist/types/src/components/Prompt/references.d.ts.map +1 -1
  143. package/dist/types/src/components/PromptSettings.d.ts +6 -0
  144. package/dist/types/src/components/PromptSettings.d.ts.map +1 -0
  145. package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
  146. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  147. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  148. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -2
  149. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  150. package/dist/types/src/components/Thread/Thread.d.ts +2 -2
  151. package/dist/types/src/components/Thread/Thread.d.ts.map +1 -1
  152. package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -1
  153. package/dist/types/src/components/Thread/ThreadContainer.d.ts +1 -1
  154. package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -1
  155. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +2 -2
  156. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
  157. package/dist/types/src/components/Thread/ThreadMessage.d.ts +4 -2
  158. package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -1
  159. package/dist/types/src/components/Thread/ToolInvocations.d.ts +1 -1
  160. package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +1 -1
  161. package/dist/types/src/components/Thread/reducer.d.ts +1 -1
  162. package/dist/types/src/components/Thread/reducer.d.ts.map +1 -1
  163. package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -2
  164. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  165. package/dist/types/src/components/index.d.ts +5 -6
  166. package/dist/types/src/components/index.d.ts.map +1 -1
  167. package/dist/types/src/experimental/transcription/index.d.ts +1 -0
  168. package/dist/types/src/experimental/transcription/index.d.ts.map +1 -0
  169. package/dist/types/src/hooks/index.d.ts +0 -1
  170. package/dist/types/src/hooks/index.d.ts.map +1 -1
  171. package/dist/types/src/hooks/processor.d.ts +6 -5
  172. package/dist/types/src/hooks/processor.d.ts.map +1 -1
  173. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  174. package/dist/types/src/hooks/useContextProvider.d.ts +1 -1
  175. package/dist/types/src/hooks/useContextProvider.d.ts.map +1 -1
  176. package/dist/types/src/hooks/useMessageQueue.d.ts +11 -10
  177. package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -1
  178. package/dist/types/src/hooks/useServices.d.ts.map +1 -1
  179. package/dist/types/src/hooks/useTextInputEvents.d.ts.map +1 -1
  180. package/dist/types/src/parser/filter-generator.d.ts +4 -0
  181. package/dist/types/src/parser/filter-generator.d.ts.map +1 -0
  182. package/dist/types/src/parser/filter-generator.test.d.ts +2 -0
  183. package/dist/types/src/parser/filter-generator.test.d.ts.map +1 -0
  184. package/dist/types/src/parser/index.d.ts +4 -0
  185. package/dist/types/src/parser/index.d.ts.map +1 -0
  186. package/dist/types/src/parser/query-parser.d.ts +15 -0
  187. package/dist/types/src/parser/query-parser.d.ts.map +1 -0
  188. package/dist/types/src/parser/query-parser.test.d.ts +2 -0
  189. package/dist/types/src/parser/query-parser.test.d.ts.map +1 -0
  190. package/dist/types/src/parser/types.d.ts +24 -0
  191. package/dist/types/src/parser/types.d.ts.map +1 -0
  192. package/dist/types/src/stories/Prompt.stories.d.ts +8 -0
  193. package/dist/types/src/stories/Prompt.stories.d.ts.map +1 -0
  194. package/dist/types/src/stories/Query.stories.d.ts +19 -0
  195. package/dist/types/src/stories/Query.stories.d.ts.map +1 -0
  196. package/dist/types/src/stories/Research.stories.d.ts +15 -0
  197. package/dist/types/src/stories/Research.stories.d.ts.map +1 -0
  198. package/dist/types/src/stories/test-data.d.ts +3 -0
  199. package/dist/types/src/stories/test-data.d.ts.map +1 -0
  200. package/dist/types/src/stories/testing.d.ts +12 -0
  201. package/dist/types/src/stories/testing.d.ts.map +1 -0
  202. package/dist/types/src/testing/index.d.ts +1 -0
  203. package/dist/types/src/testing/index.d.ts.map +1 -1
  204. package/dist/types/src/testing/test-blueprint.d.ts +14 -0
  205. package/dist/types/src/testing/test-blueprint.d.ts.map +1 -0
  206. package/dist/types/src/testing/test-functions.d.ts +1 -1
  207. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  208. package/dist/types/src/tools/function.d.ts +4 -4
  209. package/dist/types/src/tools/function.d.ts.map +1 -1
  210. package/dist/types/src/tools/openapi.d.ts +3 -3
  211. package/dist/types/src/tools/openapi.d.ts.map +1 -1
  212. package/dist/types/src/translations.d.ts +6 -0
  213. package/dist/types/src/translations.d.ts.map +1 -1
  214. package/dist/types/src/types/chat.d.ts +18 -8
  215. package/dist/types/src/types/chat.d.ts.map +1 -1
  216. package/dist/types/src/types/service.d.ts +96 -95
  217. package/dist/types/src/types/service.d.ts.map +1 -1
  218. package/dist/types/src/types/template.d.ts +52 -52
  219. package/dist/types/src/types/template.d.ts.map +1 -1
  220. package/dist/types/src/types/types.d.ts +34 -23
  221. package/dist/types/src/types/types.d.ts.map +1 -1
  222. package/dist/types/tsconfig.tsbuildinfo +1 -1
  223. package/package.json +79 -61
  224. package/src/AssistantPlugin.tsx +12 -11
  225. package/src/capabilities/ai-client.ts +5 -6
  226. package/src/capabilities/app-graph-builder.ts +173 -135
  227. package/src/capabilities/capabilities.ts +1 -1
  228. package/src/capabilities/index.ts +1 -1
  229. package/src/capabilities/intent-resolver.ts +10 -11
  230. package/src/capabilities/react-surface.tsx +88 -22
  231. package/src/capabilities/settings.ts +2 -2
  232. package/src/components/AmbientDialog/AmbientDialog.stories.tsx +2 -2
  233. package/src/components/AmbientDialog/AmbientDialog.tsx +27 -13
  234. package/src/components/AssistantDialog.tsx +1 -1
  235. package/src/components/AssistantSettings/AssistantSettings.tsx +29 -7
  236. package/src/components/BlueprintEditor/BlueprintEditor.stories.tsx +32 -0
  237. package/src/components/BlueprintEditor/BlueprintEditor.tsx +40 -0
  238. package/src/components/BlueprintEditor/index.ts +7 -0
  239. package/src/components/ChatContainer.tsx +6 -8
  240. package/src/components/Prompt/Prompt.stories.tsx +60 -52
  241. package/src/components/Prompt/Prompt.tsx +24 -10
  242. package/src/components/Prompt/PromptBar.stories.tsx +69 -0
  243. package/src/components/Prompt/PromptBar.tsx +82 -88
  244. package/src/components/Prompt/autocomplete.ts +14 -8
  245. package/src/components/Prompt/references.ts +3 -3
  246. package/src/components/PromptSettings.tsx +91 -0
  247. package/src/components/TemplateContainer.tsx +3 -79
  248. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -4
  249. package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -3
  250. package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
  251. package/src/components/Thread/Thread.stories.tsx +14 -17
  252. package/src/components/Thread/Thread.tsx +2 -2
  253. package/src/components/Thread/ThreadContainer.stories.tsx +83 -62
  254. package/src/components/Thread/ThreadContainer.tsx +26 -5
  255. package/src/components/Thread/ThreadMessage.tsx +49 -11
  256. package/src/components/Thread/ToolInvocations.tsx +9 -7
  257. package/src/components/Thread/reducer.ts +1 -1
  258. package/src/components/Toolbox/Toolbox.stories.tsx +4 -4
  259. package/src/components/Toolbox/Toolbox.tsx +5 -4
  260. package/src/components/index.ts +4 -1
  261. package/src/experimental/transcription/index.ts +3 -0
  262. package/src/hooks/index.ts +0 -1
  263. package/src/hooks/processor.ts +68 -8
  264. package/src/hooks/useChatProcessor.tsx +12 -11
  265. package/src/hooks/useContextProvider.ts +20 -17
  266. package/src/hooks/useMessageQueue.ts +5 -5
  267. package/src/meta.ts +2 -2
  268. package/src/parser/filter-generator.test.ts +32 -0
  269. package/src/parser/filter-generator.ts +81 -0
  270. package/src/parser/index.ts +7 -0
  271. package/src/parser/query-parser.test.ts +139 -0
  272. package/src/parser/query-parser.ts +199 -0
  273. package/src/parser/types.ts +34 -0
  274. package/src/shims.d.ts +8 -0
  275. package/src/stories/Prompt.stories.tsx +60 -0
  276. package/src/stories/Query.stories.tsx +515 -0
  277. package/src/stories/Research.stories.tsx +496 -0
  278. package/src/stories/test-data.ts +128 -0
  279. package/src/stories/testing.ts +60 -0
  280. package/src/testing/index.ts +1 -0
  281. package/src/testing/test-blueprint.ts +50 -0
  282. package/src/testing/test-functions.ts +1 -1
  283. package/src/testing/test-services.ts +6 -6
  284. package/src/tools/function.ts +11 -12
  285. package/src/tools/openapi.test.ts +18 -19
  286. package/src/tools/openapi.ts +24 -17
  287. package/src/translations.ts +14 -6
  288. package/src/types/chat.ts +27 -4
  289. package/src/types/service.ts +39 -37
  290. package/src/types/template.ts +27 -25
  291. package/src/types/types.ts +24 -19
  292. package/dist/lib/browser/AssistantDialog-YSHMAHW5.mjs +0 -117
  293. package/dist/lib/browser/AssistantDialog-YSHMAHW5.mjs.map +0 -7
  294. package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs +0 -33
  295. package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs.map +0 -7
  296. package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs +0 -78
  297. package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs.map +0 -7
  298. package/dist/lib/browser/ai-client-CDZLSNXE.mjs.map +0 -7
  299. package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs +0 -209
  300. package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs.map +0 -7
  301. package/dist/lib/browser/chunk-FMB7RGMP.mjs.map +0 -7
  302. package/dist/lib/browser/chunk-IAMR2FAE.mjs +0 -183
  303. package/dist/lib/browser/chunk-IAMR2FAE.mjs.map +0 -7
  304. package/dist/lib/browser/chunk-KYMKVE6M.mjs +0 -128
  305. package/dist/lib/browser/chunk-KYMKVE6M.mjs.map +0 -7
  306. package/dist/lib/browser/chunk-NFUHCW2J.mjs +0 -81
  307. package/dist/lib/browser/chunk-TXJWGWJ7.mjs.map +0 -7
  308. package/dist/lib/browser/intent-resolver-WJGLKKVO.mjs +0 -46
  309. package/dist/lib/browser/intent-resolver-WJGLKKVO.mjs.map +0 -7
  310. package/dist/lib/browser/react-surface-57VRDOQT.mjs +0 -90
  311. package/dist/lib/browser/react-surface-57VRDOQT.mjs.map +0 -7
  312. package/dist/lib/browser/settings-U6UFQX32.mjs.map +0 -7
  313. package/dist/lib/node/AssistantDialog-YI2BSGSX.cjs +0 -141
  314. package/dist/lib/node/AssistantDialog-YI2BSGSX.cjs.map +0 -7
  315. package/dist/lib/node/ChatContainer-ZJ5JXF6A.cjs.map +0 -7
  316. package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs +0 -104
  317. package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs.map +0 -7
  318. package/dist/lib/node/ai-client-URCCYU6B.cjs.map +0 -7
  319. package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs +0 -220
  320. package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs.map +0 -7
  321. package/dist/lib/node/chunk-APRU3QWK.cjs +0 -206
  322. package/dist/lib/node/chunk-APRU3QWK.cjs.map +0 -7
  323. package/dist/lib/node/chunk-GBUNQ257.cjs.map +0 -7
  324. package/dist/lib/node/chunk-RPBKMP2E.cjs.map +0 -7
  325. package/dist/lib/node/chunk-ZKOC4ZFY.cjs +0 -152
  326. package/dist/lib/node/chunk-ZKOC4ZFY.cjs.map +0 -7
  327. package/dist/lib/node/intent-resolver-R3OSTIMH.cjs.map +0 -7
  328. package/dist/lib/node/react-surface-NUQTM6MS.cjs +0 -106
  329. package/dist/lib/node/react-surface-NUQTM6MS.cjs.map +0 -7
  330. package/dist/lib/node/settings-TXGRCYAL.cjs.map +0 -7
  331. package/dist/lib/node-esm/AssistantDialog-U2FQX5TD.mjs +0 -118
  332. package/dist/lib/node-esm/AssistantDialog-U2FQX5TD.mjs.map +0 -7
  333. package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs +0 -34
  334. package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs.map +0 -7
  335. package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs +0 -79
  336. package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs.map +0 -7
  337. package/dist/lib/node-esm/ai-client-WMHS5EGV.mjs.map +0 -7
  338. package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs +0 -210
  339. package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs.map +0 -7
  340. package/dist/lib/node-esm/chunk-6JK5HEUQ.mjs.map +0 -7
  341. package/dist/lib/node-esm/chunk-GBBXIW5F.mjs +0 -129
  342. package/dist/lib/node-esm/chunk-GBBXIW5F.mjs.map +0 -7
  343. package/dist/lib/node-esm/chunk-MVDAY3CZ.mjs.map +0 -7
  344. package/dist/lib/node-esm/chunk-MXK2EANZ.mjs +0 -184
  345. package/dist/lib/node-esm/chunk-MXK2EANZ.mjs.map +0 -7
  346. package/dist/lib/node-esm/intent-resolver-H32TL4X6.mjs +0 -47
  347. package/dist/lib/node-esm/intent-resolver-H32TL4X6.mjs.map +0 -7
  348. package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs +0 -91
  349. package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs.map +0 -7
  350. package/dist/lib/node-esm/settings-DZU5PNXM.mjs.map +0 -7
  351. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -6
  352. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +0 -1
  353. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +0 -8
  354. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +0 -1
  355. package/dist/types/src/components/ServiceRegistry/index.d.ts +0 -2
  356. package/dist/types/src/components/ServiceRegistry/index.d.ts.map +0 -1
  357. package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
  358. package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
  359. package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
  360. package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
  361. package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +0 -49
  362. package/src/components/ServiceRegistry/ServiceRegistry.tsx +0 -76
  363. package/src/components/ServiceRegistry/index.ts +0 -5
  364. package/src/hooks/invocation-handler.ts +0 -107
  365. package/src/hooks/useLocalTriggerManager.ts +0 -82
@@ -0,0 +1,144 @@
1
+ import {
2
+ AssistantDialog,
3
+ AssistantSettings,
4
+ BlueprintEditor,
5
+ ChatContainer,
6
+ PromptSettings,
7
+ TemplateContainer
8
+ } from "./chunk-6SD7S7W5.mjs";
9
+ import "./chunk-JQFUME3B.mjs";
10
+ import "./chunk-Q6UZ4F3H.mjs";
11
+ import "./chunk-Q6XE3O3E.mjs";
12
+ import "./chunk-3F44MBHU.mjs";
13
+ import {
14
+ AIChatType,
15
+ AssistantAction,
16
+ CompanionTo,
17
+ TemplateType
18
+ } from "./chunk-NBSPGIHL.mjs";
19
+ import {
20
+ ASSISTANT_DIALOG,
21
+ ASSISTANT_PLUGIN
22
+ } from "./chunk-XOZ7YMO3.mjs";
23
+
24
+ // packages/plugins/plugin-assistant/src/capabilities/react-surface.tsx
25
+ import { Effect } from "effect";
26
+ import React, { useEffect, useMemo } from "react";
27
+ import { Capabilities, contributes, createIntent, createSurface, useIntentDispatcher } from "@dxos/app-framework";
28
+ import { Blueprint } from "@dxos/assistant";
29
+ import { Obj } from "@dxos/echo";
30
+ import { Filter, isInstanceOf, Query } from "@dxos/echo-schema";
31
+ import { SettingsStore } from "@dxos/local-storage";
32
+ import { SpaceAction } from "@dxos/plugin-space/types";
33
+ import { fullyQualifiedId, getSpace, getTypename, isEchoObject } from "@dxos/react-client/echo";
34
+ import { StackItem } from "@dxos/react-ui-stack";
35
+ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
36
+ createSurface({
37
+ id: `${ASSISTANT_PLUGIN}/plugin-settings`,
38
+ role: "article",
39
+ filter: (data) => data.subject instanceof SettingsStore && data.subject.prefix === ASSISTANT_PLUGIN,
40
+ component: ({ data: { subject } }) => /* @__PURE__ */ React.createElement(AssistantSettings, {
41
+ settings: subject.value
42
+ })
43
+ }),
44
+ createSurface({
45
+ id: `${ASSISTANT_PLUGIN}/chat`,
46
+ role: "article",
47
+ filter: (data) => Obj.instanceOf(AIChatType, data.subject) && data.variant !== "assistant-chat",
48
+ component: ({ data, role }) => /* @__PURE__ */ React.createElement(ChatContainer, {
49
+ role,
50
+ chat: data.subject
51
+ })
52
+ }),
53
+ createSurface({
54
+ id: `${ASSISTANT_PLUGIN}/object-chat`,
55
+ role: "article",
56
+ filter: (data) => isEchoObject(data.companionTo) && (isInstanceOf(AIChatType, data.subject) || data.subject === "assistant-chat"),
57
+ component: ({ data, role }) => {
58
+ const { dispatch } = useIntentDispatcher();
59
+ const associatedArtifact = useMemo(() => ({
60
+ id: fullyQualifiedId(data.companionTo),
61
+ typename: getTypename(data.companionTo) ?? "unknown",
62
+ spaceId: getSpace(data.companionTo)?.id ?? "unknown"
63
+ }), [
64
+ data.companionTo
65
+ ]);
66
+ useEffect(() => {
67
+ const timeout = setTimeout(async () => {
68
+ const space = getSpace(data.companionTo);
69
+ if (space && data.subject === "assistant-chat") {
70
+ const result = await space.db.query(Query.select(Filter.ids(data.companionTo.id)).targetOf(CompanionTo).source()).run();
71
+ if (result.objects.length > 0) {
72
+ return;
73
+ }
74
+ const program = Effect.gen(function* () {
75
+ const { object } = yield* dispatch(createIntent(AssistantAction.CreateChat, {
76
+ space
77
+ }));
78
+ yield* dispatch(createIntent(SpaceAction.AddObject, {
79
+ object,
80
+ target: space,
81
+ hidden: true
82
+ }));
83
+ yield* dispatch(createIntent(SpaceAction.AddRelation, {
84
+ space,
85
+ schema: CompanionTo,
86
+ source: object,
87
+ target: data.companionTo
88
+ }));
89
+ });
90
+ void Effect.runPromise(program);
91
+ }
92
+ });
93
+ return () => clearTimeout(timeout);
94
+ }, [
95
+ data.subject
96
+ ]);
97
+ if (data.subject === "assistant-chat") {
98
+ return null;
99
+ }
100
+ return /* @__PURE__ */ React.createElement(ChatContainer, {
101
+ role,
102
+ chat: data.subject,
103
+ associatedArtifact
104
+ });
105
+ }
106
+ }),
107
+ createSurface({
108
+ id: `${ASSISTANT_PLUGIN}/blueprint`,
109
+ role: "article",
110
+ filter: (data) => Obj.instanceOf(Blueprint, data.subject),
111
+ component: ({ data, role }) => /* @__PURE__ */ React.createElement(StackItem.Content, {
112
+ role
113
+ }, /* @__PURE__ */ React.createElement(BlueprintEditor, {
114
+ blueprint: data.subject
115
+ }))
116
+ }),
117
+ createSurface({
118
+ id: `${ASSISTANT_PLUGIN}/template`,
119
+ role: "article",
120
+ filter: (data) => Obj.instanceOf(TemplateType, data.subject),
121
+ component: ({ data, role }) => /* @__PURE__ */ React.createElement(TemplateContainer, {
122
+ role,
123
+ template: data.subject
124
+ })
125
+ }),
126
+ createSurface({
127
+ id: ASSISTANT_DIALOG,
128
+ role: "dialog",
129
+ filter: (data) => data.component === ASSISTANT_DIALOG,
130
+ component: ({ data }) => /* @__PURE__ */ React.createElement(AssistantDialog, data.props)
131
+ }),
132
+ createSurface({
133
+ id: `${ASSISTANT_PLUGIN}/prompt-settings`,
134
+ role: "object-settings",
135
+ filter: (data) => Obj.instanceOf(TemplateType, data.subject),
136
+ component: ({ data }) => /* @__PURE__ */ React.createElement(PromptSettings, {
137
+ template: data.subject
138
+ })
139
+ })
140
+ ]);
141
+ export {
142
+ react_surface_default as default
143
+ };
144
+ //# sourceMappingURL=react-surface-DGS34EON.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/react-surface.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Effect } from 'effect';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { Capabilities, contributes, createIntent, createSurface, useIntentDispatcher } from '@dxos/app-framework';\nimport { Blueprint } from '@dxos/assistant';\nimport { Obj } from '@dxos/echo';\nimport { Filter, isInstanceOf, Query } from '@dxos/echo-schema';\nimport { SettingsStore } from '@dxos/local-storage';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport {\n type AnyLiveObject,\n fullyQualifiedId,\n getSpace,\n getTypename,\n isEchoObject,\n type SpaceId,\n} from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport {\n AssistantDialog,\n AssistantSettings,\n BlueprintEditor,\n ChatContainer,\n PromptSettings,\n TemplateContainer,\n} from '../components';\nimport { ASSISTANT_PLUGIN, ASSISTANT_DIALOG } from '../meta';\nimport { AIChatType, AssistantAction, type AssistantSettingsProps, CompanionTo, TemplateType } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${ASSISTANT_PLUGIN}/plugin-settings`,\n role: 'article',\n filter: (data): data is { subject: SettingsStore<AssistantSettingsProps> } =>\n data.subject instanceof SettingsStore && data.subject.prefix === ASSISTANT_PLUGIN,\n component: ({ data: { subject } }) => <AssistantSettings settings={subject.value} />,\n }),\n createSurface({\n id: `${ASSISTANT_PLUGIN}/chat`,\n role: 'article',\n filter: (data): data is { subject: AIChatType; variant: undefined } =>\n Obj.instanceOf(AIChatType, data.subject) && data.variant !== 'assistant-chat',\n component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,\n }),\n createSurface({\n id: `${ASSISTANT_PLUGIN}/object-chat`,\n role: 'article',\n filter: (data): data is { companionTo: AnyLiveObject<any>; subject: AIChatType | 'assistant-chat' } =>\n isEchoObject(data.companionTo) && (isInstanceOf(AIChatType, data.subject) || data.subject === 'assistant-chat'),\n component: ({ data, role }) => {\n const { dispatch } = useIntentDispatcher();\n const associatedArtifact = useMemo(\n () => ({\n id: fullyQualifiedId(data.companionTo),\n typename: getTypename(data.companionTo) ?? 'unknown',\n spaceId: (getSpace(data.companionTo)?.id ?? 'unknown') as SpaceId,\n }),\n [data.companionTo],\n );\n\n // TODO(wittjosiah): Factor out to container.\n useEffect(() => {\n const timeout = setTimeout(async () => {\n const space = getSpace(data.companionTo);\n if (space && data.subject === 'assistant-chat') {\n const result = await space.db\n .query(Query.select(Filter.ids(data.companionTo.id)).targetOf(CompanionTo).source())\n .run();\n if (result.objects.length > 0) {\n return;\n }\n\n const program = Effect.gen(function* () {\n const { object } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));\n yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space, hidden: true }));\n yield* dispatch(\n createIntent(SpaceAction.AddRelation, {\n space,\n schema: CompanionTo,\n source: object,\n target: data.companionTo,\n }),\n );\n });\n void Effect.runPromise(program);\n }\n });\n\n return () => clearTimeout(timeout);\n }, [data.subject]);\n\n if (data.subject === 'assistant-chat') {\n return null;\n }\n\n return <ChatContainer role={role} chat={data.subject} associatedArtifact={associatedArtifact} />;\n },\n }),\n createSurface({\n id: `${ASSISTANT_PLUGIN}/blueprint`,\n role: 'article',\n filter: (data): data is { subject: Blueprint } => Obj.instanceOf(Blueprint, data.subject),\n component: ({ data, role }) => (\n <StackItem.Content role={role}>\n <BlueprintEditor blueprint={data.subject} />\n </StackItem.Content>\n ),\n }),\n createSurface({\n id: `${ASSISTANT_PLUGIN}/template`,\n role: 'article',\n filter: (data): data is { subject: TemplateType } => Obj.instanceOf(TemplateType, data.subject),\n component: ({ data, role }) => <TemplateContainer role={role} template={data.subject} />,\n }),\n createSurface({\n id: ASSISTANT_DIALOG,\n role: 'dialog',\n filter: (data): data is { props: { chat: AIChatType } } => data.component === ASSISTANT_DIALOG,\n component: ({ data }) => <AssistantDialog {...data.props} />,\n }),\n createSurface({\n id: `${ASSISTANT_PLUGIN}/prompt-settings`,\n role: 'object-settings',\n filter: (data): data is { subject: TemplateType } => Obj.instanceOf(TemplateType, data.subject),\n component: ({ data }) => <PromptSettings template={data.subject} />,\n }),\n ]);\n"],
5
+ "mappings": "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",
6
+ "names": ["Effect", "React", "useEffect", "useMemo", "Capabilities", "contributes", "createIntent", "createSurface", "useIntentDispatcher", "Blueprint", "Obj", "Filter", "isInstanceOf", "Query", "SettingsStore", "SpaceAction", "fullyQualifiedId", "getSpace", "getTypename", "isEchoObject", "StackItem", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "ASSISTANT_PLUGIN", "role", "filter", "data", "subject", "SettingsStore", "prefix", "component", "AssistantSettings", "settings", "value", "Obj", "instanceOf", "AIChatType", "variant", "ChatContainer", "chat", "isEchoObject", "companionTo", "isInstanceOf", "dispatch", "useIntentDispatcher", "associatedArtifact", "useMemo", "fullyQualifiedId", "typename", "getTypename", "spaceId", "getSpace", "useEffect", "timeout", "setTimeout", "space", "result", "db", "query", "Query", "select", "Filter", "ids", "targetOf", "CompanionTo", "source", "run", "objects", "length", "program", "Effect", "gen", "object", "createIntent", "AssistantAction", "CreateChat", "SpaceAction", "AddObject", "target", "hidden", "AddRelation", "schema", "runPromise", "clearTimeout", "Blueprint", "StackItem", "Content", "BlueprintEditor", "blueprint", "TemplateType", "TemplateContainer", "template", "ASSISTANT_DIALOG", "AssistantDialog", "props", "PromptSettings"]
7
+ }
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  AssistantSettingsSchema
3
- } from "./chunk-IAMR2FAE.mjs";
3
+ } from "./chunk-NBSPGIHL.mjs";
4
4
  import {
5
5
  ASSISTANT_PLUGIN
6
- } from "./chunk-3HCI5FIL.mjs";
6
+ } from "./chunk-XOZ7YMO3.mjs";
7
7
 
8
8
  // packages/plugins/plugin-assistant/src/capabilities/settings.ts
9
9
  import { Capabilities, contributes } from "@dxos/app-framework";
10
- import { create } from "@dxos/live-object";
10
+ import { live } from "@dxos/live-object";
11
11
  var settings_default = () => {
12
- const settings = create({});
12
+ const settings = live({});
13
13
  return contributes(Capabilities.Settings, {
14
14
  schema: AssistantSettingsSchema,
15
15
  prefix: ASSISTANT_PLUGIN,
@@ -19,4 +19,4 @@ var settings_default = () => {
19
19
  export {
20
20
  settings_default as default
21
21
  };
22
- //# sourceMappingURL=settings-U6UFQX32.mjs.map
22
+ //# sourceMappingURL=settings-BTFB7IQ6.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/settings.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps, AssistantSettingsSchema } from '../types';\n\nexport default () => {\n const settings = live<AssistantSettingsProps>({});\n\n return contributes(Capabilities.Settings, {\n schema: AssistantSettingsSchema,\n prefix: ASSISTANT_PLUGIN,\n value: settings,\n });\n};\n"],
5
+ "mappings": ";;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,YAAY;AAKrB,IAAA,mBAAe,MAAA;AACb,QAAMC,WAAWC,KAA6B,CAAC,CAAA;AAE/C,SAAOC,YAAYC,aAAaC,UAAU;IACxCC,QAAQC;IACRC,QAAQC;IACRC,OAAOT;EACT,CAAA;AACF;",
6
+ "names": ["Capabilities", "contributes", "live", "settings", "live", "contributes", "Capabilities", "Settings", "schema", "AssistantSettingsSchema", "prefix", "ASSISTANT_PLUGIN", "value"]
7
+ }
@@ -3,6 +3,8 @@ import {
3
3
  ApiAuthorization,
4
4
  AssistantAction,
5
5
  AssistantSettingsSchema,
6
+ CompanionTo,
7
+ LLM_PROVIDERS,
6
8
  ServiceType,
7
9
  TemplateInputSchema,
8
10
  TemplateInputType,
@@ -10,13 +12,15 @@ import {
10
12
  TemplateKinds,
11
13
  TemplateType,
12
14
  categoryIcons
13
- } from "../chunk-IAMR2FAE.mjs";
14
- import "../chunk-3HCI5FIL.mjs";
15
+ } from "../chunk-NBSPGIHL.mjs";
16
+ import "../chunk-XOZ7YMO3.mjs";
15
17
  export {
16
18
  AIChatType,
17
19
  ApiAuthorization,
18
20
  AssistantAction,
19
21
  AssistantSettingsSchema,
22
+ CompanionTo,
23
+ LLM_PROVIDERS,
20
24
  ServiceType,
21
25
  TemplateInputSchema,
22
26
  TemplateInputType,
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var AssistantDialog_RTB5Q7FP_exports = {};
30
+ __export(AssistantDialog_RTB5Q7FP_exports, {
31
+ AssistantDialog: () => AssistantDialog,
32
+ default: () => AssistantDialog_default
33
+ });
34
+ module.exports = __toCommonJS(AssistantDialog_RTB5Q7FP_exports);
35
+ var import_chunk_HRNIUYVQ = require("./chunk-HRNIUYVQ.cjs");
36
+ var import_chunk_PG7YNQ4R = require("./chunk-PG7YNQ4R.cjs");
37
+ var import_chunk_TS3H5OSX = require("./chunk-TS3H5OSX.cjs");
38
+ var import_chunk_UNVDZOLA = require("./chunk-UNVDZOLA.cjs");
39
+ var import_chunk_P74TWGMG = require("./chunk-P74TWGMG.cjs");
40
+ var import_tracking = require("@preact-signals/safe-react/tracking");
41
+ var import_react = __toESM(require("react"));
42
+ var import_app_framework = require("@dxos/app-framework");
43
+ var import_plugin_transcription = require("@dxos/plugin-transcription");
44
+ var import_react_ui = require("@dxos/react-ui");
45
+ var AssistantDialog = ({ chat }) => {
46
+ var _effect = (0, import_tracking.useSignals)();
47
+ try {
48
+ const { t } = (0, import_react_ui.useTranslation)(import_chunk_P74TWGMG.ASSISTANT_PLUGIN);
49
+ const transcription = (0, import_app_framework.useCapabilities)(import_plugin_transcription.TranscriptionCapabilities.Transcriber).length > 0;
50
+ const settings = (0, import_app_framework.useCapability)(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_P74TWGMG.ASSISTANT_PLUGIN)?.value;
51
+ const [open, setOpen] = (0, import_react.useState)(false);
52
+ return /* @__PURE__ */ import_react.default.createElement(import_chunk_HRNIUYVQ.AmbientDialog, {
53
+ open,
54
+ onOpenChange: setOpen,
55
+ title: t("assistant dialog title")
56
+ }, /* @__PURE__ */ import_react.default.createElement(import_chunk_PG7YNQ4R.ThreadContainer, {
57
+ part: "dialog",
58
+ chat,
59
+ onOpenChange: setOpen,
60
+ settings,
61
+ transcription
62
+ }));
63
+ } finally {
64
+ _effect.f();
65
+ }
66
+ };
67
+ var AssistantDialog_default = AssistantDialog;
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ AssistantDialog
71
+ });
72
+ //# sourceMappingURL=AssistantDialog-RTB5Q7FP.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/AssistantDialog.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type FC, useState } from 'react';\n\nimport { useCapability, Capabilities, useCapabilities } from '@dxos/app-framework';\nimport { TranscriptionCapabilities } from '@dxos/plugin-transcription';\nimport { useTranslation } from '@dxos/react-ui';\n\nimport { AmbientDialog } from './AmbientDialog';\nimport { ThreadContainer } from './Thread';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps, type AIChatType } from '../types';\n\nexport const AssistantDialog: FC<{ chat?: AIChatType }> = ({ chat }) => {\n const { t } = useTranslation(ASSISTANT_PLUGIN);\n const transcription = useCapabilities(TranscriptionCapabilities.Transcriber).length > 0;\n const settings = useCapability(Capabilities.SettingsStore).getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n // TODO(burdon): Refocus when open.\n const [open, setOpen] = useState(false);\n\n return (\n <AmbientDialog open={open} onOpenChange={setOpen} title={t('assistant dialog title')}>\n <ThreadContainer\n part={'dialog'}\n chat={chat}\n onOpenChange={setOpen}\n settings={settings}\n transcription={transcription}\n />\n </AmbientDialog>\n );\n};\n\nexport default AssistantDialog;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAyC;AAEzC,2BAA6D;AAC7D,kCAA0C;AAC1C,sBAA+B;AAOxB,IAAMA,kBAA6C,CAAC,EAAEC,KAAI,MAAE;;;AACjE,UAAM,EAAEC,EAAC,QAAKC,gCAAeC,sCAAAA;AAC7B,UAAMC,oBAAgBC,sCAAgBC,sDAA0BC,WAAW,EAAEC,SAAS;AACtF,UAAMC,eAAWC,oCAAcC,kCAAaC,aAAa,EAAEC,SAAiCV,sCAAAA,GAAmBW;AAG/G,UAAM,CAACC,MAAMC,OAAAA,QAAWC,uBAAS,KAAA;AAEjC,WACE,6BAAAC,QAAA,cAACC,qCAAAA;MAAcJ;MAAYK,cAAcJ;MAASK,OAAOpB,EAAE,wBAAA;OACzD,6BAAAiB,QAAA,cAACI,uCAAAA;MACCC,MAAM;MACNvB;MACAoB,cAAcJ;MACdP;MACAL;;;;;AAIR;AAEA,IAAA,0BAAeL;",
6
+ "names": ["AssistantDialog", "chat", "t", "useTranslation", "ASSISTANT_PLUGIN", "transcription", "useCapabilities", "TranscriptionCapabilities", "Transcriber", "length", "settings", "useCapability", "Capabilities", "SettingsStore", "getStore", "value", "open", "setOpen", "useState", "React", "AmbientDialog", "onOpenChange", "title", "ThreadContainer", "part"]
7
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var BlueprintEditor_43VM3XPO_exports = {};
30
+ __export(BlueprintEditor_43VM3XPO_exports, {
31
+ default: () => BlueprintEditor_default
32
+ });
33
+ module.exports = __toCommonJS(BlueprintEditor_43VM3XPO_exports);
34
+ var import_tracking = require("@preact-signals/safe-react/tracking");
35
+ var import_react = __toESM(require("react"));
36
+ var import_assistant = require("@dxos/assistant");
37
+ var import_echo_schema = require("@dxos/echo-schema");
38
+ var import_react_ui = require("@dxos/react-ui");
39
+ var import_react_ui_editor = require("@dxos/react-ui-editor");
40
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
41
+ var BlueprintEditor = ({ classNames, blueprint }) => {
42
+ var _effect = (0, import_tracking.useSignals)();
43
+ try {
44
+ const { themeMode } = (0, import_react_ui.useThemeContext)();
45
+ const { parentRef } = (0, import_react_ui_editor.useTextEditor)({
46
+ initialValue: JSON.stringify(blueprint, null, 2),
47
+ extensions: [
48
+ (0, import_react_ui_editor.createBasicExtensions)({
49
+ lineWrapping: false
50
+ }),
51
+ (0, import_react_ui_editor.createThemeExtensions)({
52
+ themeMode,
53
+ syntaxHighlighting: true
54
+ }),
55
+ (0, import_react_ui_editor.createJsonExtensions)({
56
+ schema: (0, import_echo_schema.toJsonSchema)(import_assistant.Blueprint, {
57
+ strict: true
58
+ })
59
+ }),
60
+ import_react_ui_editor.editorMonospace
61
+ ]
62
+ });
63
+ return /* @__PURE__ */ import_react.default.createElement("div", {
64
+ ref: parentRef,
65
+ className: (0, import_react_ui_theme.mx)("flex w-full pli-2 overflow-x-scroll border-x border-separator", classNames)
66
+ });
67
+ } finally {
68
+ _effect.f();
69
+ }
70
+ };
71
+ var BlueprintEditor_default = BlueprintEditor;
72
+ //# sourceMappingURL=BlueprintEditor-43VM3XPO.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/BlueprintEditor/BlueprintEditor.tsx", "../../../src/components/BlueprintEditor/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Blueprint } from '@dxos/assistant';\nimport { toJsonSchema } from '@dxos/echo-schema';\nimport { useThemeContext, type ThemedClassName } from '@dxos/react-ui';\nimport {\n createBasicExtensions,\n createJsonExtensions,\n createThemeExtensions,\n editorMonospace,\n useTextEditor,\n} from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nexport type BlueprintEditorProps = ThemedClassName<{\n blueprint: Blueprint;\n}>;\n\n// TODO(burdon): Factor out JsonEditor.\n// TODO(burdon): Make editable.\nexport const BlueprintEditor = ({ classNames, blueprint }: BlueprintEditorProps) => {\n const { themeMode } = useThemeContext();\n const { parentRef } = useTextEditor({\n initialValue: JSON.stringify(blueprint, null, 2),\n extensions: [\n createBasicExtensions({ lineWrapping: false }),\n createThemeExtensions({ themeMode, syntaxHighlighting: true }),\n createJsonExtensions({ schema: toJsonSchema(Blueprint, { strict: true }) }),\n editorMonospace,\n ],\n });\n\n return (\n <div ref={parentRef} className={mx('flex w-full pli-2 overflow-x-scroll border-x border-separator', classNames)} />\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { BlueprintEditor } from './BlueprintEditor';\n\nexport default BlueprintEditor;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,uBAA0B;AAC1B,yBAA6B;AAC7B,sBAAsD;AACtD,6BAMO;AACP,4BAAmB;AAQZ,IAAMA,kBAAkB,CAAC,EAAEC,YAAYC,UAAS,MAAwB;;;AAC7E,UAAM,EAAEC,UAAS,QAAKC,iCAAAA;AACtB,UAAM,EAAEC,UAAS,QAAKC,sCAAc;MAClCC,cAAcC,KAAKC,UAAUP,WAAW,MAAM,CAAA;MAC9CQ,YAAY;YACVC,8CAAsB;UAAEC,cAAc;QAAM,CAAA;YAC5CC,8CAAsB;UAAEV;UAAWW,oBAAoB;QAAK,CAAA;YAC5DC,6CAAqB;UAAEC,YAAQC,iCAAaC,4BAAW;YAAEC,QAAQ;UAAK,CAAA;QAAG,CAAA;QACzEC;;IAEJ,CAAA;AAEA,WACE,6BAAAC,QAAA,cAACC,OAAAA;MAAIC,KAAKlB;MAAWmB,eAAWC,0BAAG,iEAAiExB,UAAAA;;;;;AAExG;ACjCA,IAAA,0BAAeD;",
6
+ "names": ["BlueprintEditor", "classNames", "blueprint", "themeMode", "useThemeContext", "parentRef", "useTextEditor", "initialValue", "JSON", "stringify", "extensions", "createBasicExtensions", "lineWrapping", "createThemeExtensions", "syntaxHighlighting", "createJsonExtensions", "schema", "toJsonSchema", "Blueprint", "strict", "editorMonospace", "React", "div", "ref", "className", "mx"]
7
+ }
@@ -26,36 +26,42 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var ChatContainer_ZJ5JXF6A_exports = {};
30
- __export(ChatContainer_ZJ5JXF6A_exports, {
29
+ var ChatContainer_P3JL4VZ7_exports = {};
30
+ __export(ChatContainer_P3JL4VZ7_exports, {
31
31
  ChatContainer: () => ChatContainer,
32
32
  default: () => ChatContainer_default
33
33
  });
34
- module.exports = __toCommonJS(ChatContainer_ZJ5JXF6A_exports);
35
- var import_chunk_RPBKMP2E = require("./chunk-RPBKMP2E.cjs");
36
- var import_chunk_GBUNQ257 = require("./chunk-GBUNQ257.cjs");
37
- var import_chunk_APRU3QWK = require("./chunk-APRU3QWK.cjs");
38
- var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
34
+ module.exports = __toCommonJS(ChatContainer_P3JL4VZ7_exports);
35
+ var import_chunk_PG7YNQ4R = require("./chunk-PG7YNQ4R.cjs");
36
+ var import_chunk_TS3H5OSX = require("./chunk-TS3H5OSX.cjs");
37
+ var import_chunk_UNVDZOLA = require("./chunk-UNVDZOLA.cjs");
38
+ var import_chunk_P74TWGMG = require("./chunk-P74TWGMG.cjs");
39
+ var import_tracking = require("@preact-signals/safe-react/tracking");
39
40
  var import_react = __toESM(require("react"));
40
41
  var import_app_framework = require("@dxos/app-framework");
41
42
  var import_plugin_transcription = require("@dxos/plugin-transcription");
42
43
  var import_react_ui_stack = require("@dxos/react-ui-stack");
43
44
  var ChatContainer = ({ role, chat, associatedArtifact }) => {
44
- const transcription = (0, import_app_framework.useCapabilities)(import_plugin_transcription.TranscriptionCapabilities.Transcriber).length > 0;
45
- const settings = (0, import_app_framework.useCapability)(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN)?.value;
46
- return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
47
- role,
48
- classNames: "container-max-width"
49
- }, /* @__PURE__ */ import_react.default.createElement(import_chunk_RPBKMP2E.ThreadContainer, {
50
- chat,
51
- settings,
52
- transcription,
53
- associatedArtifact
54
- }));
45
+ var _effect = (0, import_tracking.useSignals)();
46
+ try {
47
+ const transcription = (0, import_app_framework.useCapabilities)(import_plugin_transcription.TranscriptionCapabilities.Transcriber).length > 0;
48
+ const settings = (0, import_app_framework.useCapability)(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_P74TWGMG.ASSISTANT_PLUGIN)?.value;
49
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
50
+ role,
51
+ classNames: "container-max-width"
52
+ }, /* @__PURE__ */ import_react.default.createElement(import_chunk_PG7YNQ4R.ThreadContainer, {
53
+ chat,
54
+ settings,
55
+ transcription,
56
+ associatedArtifact
57
+ }));
58
+ } finally {
59
+ _effect.f();
60
+ }
55
61
  };
56
62
  var ChatContainer_default = ChatContainer;
57
63
  // Annotate the CommonJS export names for ESM import in node:
58
64
  0 && (module.exports = {
59
65
  ChatContainer
60
66
  });
61
- //# sourceMappingURL=ChatContainer-ZJ5JXF6A.cjs.map
67
+ //# sourceMappingURL=ChatContainer-P3JL4VZ7.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ChatContainer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { Capabilities, useCapabilities, useCapability } from '@dxos/app-framework';\nimport { type AssociatedArtifact } from '@dxos/artifact';\nimport { TranscriptionCapabilities } from '@dxos/plugin-transcription';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { ThreadContainer } from './Thread';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps, type AIChatType } from '../types';\n\nexport type ChatContainerProps = {\n role: string;\n chat: AIChatType;\n associatedArtifact?: AssociatedArtifact;\n};\n\n// TODO(burdon): Attention.\nexport const ChatContainer: FC<ChatContainerProps> = ({ role, chat, associatedArtifact }) => {\n const transcription = useCapabilities(TranscriptionCapabilities.Transcriber).length > 0;\n const settings = useCapability(Capabilities.SettingsStore).getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n return (\n <StackItem.Content role={role} classNames='container-max-width'>\n <ThreadContainer\n chat={chat}\n settings={settings}\n transcription={transcription}\n associatedArtifact={associatedArtifact}\n />\n </StackItem.Content>\n );\n};\n\nexport default ChatContainer;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAA+B;AAE/B,2BAA6D;AAE7D,kCAA0C;AAC1C,4BAA0B;AAanB,IAAMA,gBAAwC,CAAC,EAAEC,MAAMC,MAAMC,mBAAkB,MAAE;;;AACtF,UAAMC,oBAAgBC,sCAAgBC,sDAA0BC,WAAW,EAAEC,SAAS;AACtF,UAAMC,eAAWC,oCAAcC,kCAAaC,aAAa,EAAEC,SAAiCC,sCAAAA,GAAmBC;AAE/G,WACE,6BAAAC,QAAA,cAACC,gCAAUC,SAAO;MAACjB;MAAYkB,YAAW;OACxC,6BAAAH,QAAA,cAACI,uCAAAA;MACClB;MACAO;MACAL;MACAD;;;;;AAIR;AAEA,IAAA,wBAAeH;",
6
+ "names": ["ChatContainer", "role", "chat", "associatedArtifact", "transcription", "useCapabilities", "TranscriptionCapabilities", "Transcriber", "length", "settings", "useCapability", "Capabilities", "SettingsStore", "getStore", "ASSISTANT_PLUGIN", "value", "React", "StackItem", "Content", "classNames", "ThreadContainer"]
7
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var TemplateContainer_CTG2MB4W_exports = {};
30
+ __export(TemplateContainer_CTG2MB4W_exports, {
31
+ TemplateContainer: () => TemplateContainer,
32
+ default: () => TemplateContainer_default
33
+ });
34
+ module.exports = __toCommonJS(TemplateContainer_CTG2MB4W_exports);
35
+ var import_chunk_4EEWTDQK = require("./chunk-4EEWTDQK.cjs");
36
+ var import_chunk_P74TWGMG = require("./chunk-P74TWGMG.cjs");
37
+ var import_tracking = require("@preact-signals/safe-react/tracking");
38
+ var import_react = __toESM(require("react"));
39
+ var import_react_ui_stack = require("@dxos/react-ui-stack");
40
+ var TemplateContainer = ({ template, role }) => {
41
+ var _effect = (0, import_tracking.useSignals)();
42
+ try {
43
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
44
+ role,
45
+ classNames: "container-max-width"
46
+ }, /* @__PURE__ */ import_react.default.createElement(import_chunk_4EEWTDQK.TemplateEditor, {
47
+ template
48
+ }));
49
+ } finally {
50
+ _effect.f();
51
+ }
52
+ };
53
+ var TemplateContainer_default = TemplateContainer;
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ TemplateContainer
57
+ });
58
+ //# sourceMappingURL=TemplateContainer-CTG2MB4W.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/TemplateContainer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { TemplateEditor } from './TemplateEditor';\nimport { type TemplateType } from '../types';\n\nexport const TemplateContainer = ({ template, role }: { template: TemplateType; role: string }) => {\n return (\n <StackItem.Content role={role} classNames='container-max-width'>\n <TemplateEditor template={template} />\n </StackItem.Content>\n );\n};\n\nexport default TemplateContainer;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,4BAA0B;AAKnB,IAAMA,oBAAoB,CAAC,EAAEC,UAAUC,KAAI,MAA4C;;;AAC5F,WACE,6BAAAC,QAAA,cAACC,gCAAUC,SAAO;MAACH;MAAYI,YAAW;OACxC,6BAAAH,QAAA,cAACI,sCAAAA;MAAeN;;;;;AAGtB;AAEA,IAAA,4BAAeD;",
6
+ "names": ["TemplateContainer", "template", "role", "React", "StackItem", "Content", "classNames", "TemplateEditor"]
7
+ }
@@ -16,34 +16,34 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var ai_client_URCCYU6B_exports = {};
20
- __export(ai_client_URCCYU6B_exports, {
19
+ var ai_client_R2CGEYZW_exports = {};
20
+ __export(ai_client_R2CGEYZW_exports, {
21
21
  default: () => ai_client_default
22
22
  });
23
- module.exports = __toCommonJS(ai_client_URCCYU6B_exports);
24
- var import_chunk_GBUNQ257 = require("./chunk-GBUNQ257.cjs");
25
- var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
23
+ module.exports = __toCommonJS(ai_client_R2CGEYZW_exports);
24
+ var import_chunk_TS3H5OSX = require("./chunk-TS3H5OSX.cjs");
25
+ var import_chunk_P74TWGMG = require("./chunk-P74TWGMG.cjs");
26
26
  var import_signals_core = require("@preact/signals-core");
27
+ var import_ai = require("@dxos/ai");
27
28
  var import_app_framework = require("@dxos/app-framework");
28
- var import_assistant = require("@dxos/assistant");
29
29
  var import_plugin_client = require("@dxos/plugin-client");
30
30
  var DEFAULT_AI_SERVICE_URL = "http://localhost:8788";
31
31
  var ai_client_default = (context) => {
32
- const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
32
+ const client = context.getCapability(import_plugin_client.ClientCapabilities.Client);
33
33
  const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
34
- const ai = (0, import_signals_core.signal)(new import_assistant.AIServiceEdgeClient({
34
+ const ai = (0, import_signals_core.signal)(new import_ai.AIServiceEdgeClient({
35
35
  endpoint
36
36
  }));
37
37
  const unsubscribe = (0, import_signals_core.effect)(() => {
38
- const settings = context.requestCapability(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN)?.value;
38
+ const settings = context.getCapability(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_P74TWGMG.ASSISTANT_PLUGIN)?.value;
39
39
  if (settings?.llmProvider === "ollama") {
40
- ai.value = new import_assistant.OllamaClient();
40
+ ai.value = new import_ai.OllamaClient();
41
41
  } else {
42
- ai.value = new import_assistant.AIServiceEdgeClient({
42
+ ai.value = new import_ai.AIServiceEdgeClient({
43
43
  endpoint
44
44
  });
45
45
  }
46
46
  });
47
- return (0, import_app_framework.contributes)(import_chunk_GBUNQ257.AssistantCapabilities.AiClient, ai, () => unsubscribe());
47
+ return (0, import_app_framework.contributes)(import_chunk_TS3H5OSX.AssistantCapabilities.AiClient, ai, () => unsubscribe());
48
48
  };
49
- //# sourceMappingURL=ai-client-URCCYU6B.cjs.map
49
+ //# sourceMappingURL=ai-client-R2CGEYZW.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/ai-client.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect, signal } from '@preact/signals-core';\n\nimport { type AIServiceClient, AIServiceEdgeClient, OllamaClient } from '@dxos/ai';\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AssistantCapabilities } from './capabilities';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps } from '../types';\n\n// TODO(wittjosiah): Factor out.\nconst DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';\n\nexport default (context: PluginContext) => {\n const client = context.getCapability(ClientCapabilities.Client);\n const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;\n\n const ai = signal<AIServiceClient>(new AIServiceEdgeClient({ endpoint }));\n\n const unsubscribe = effect(() => {\n const settings = context\n .getCapability(Capabilities.SettingsStore)\n .getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n if (settings?.llmProvider === 'ollama') {\n ai.value = new OllamaClient();\n } else {\n ai.value = new AIServiceEdgeClient({ endpoint });\n }\n });\n\n return contributes(AssistantCapabilities.AiClient, ai, () => unsubscribe());\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAA+B;AAE/B,gBAAwE;AACxE,2BAA8D;AAC9D,2BAAmC;AAOnC,IAAMA,yBAAyB;AAE/B,IAAA,oBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,cAAcC,wCAAmBC,MAAM;AAC9D,QAAMC,WAAWJ,OAAOK,OAAOC,OAAOC,SAASC,UAAUC,IAAIC,UAAUZ;AAEvE,QAAMW,SAAKE,4BAAwB,IAAIC,8BAAoB;IAAER;EAAS,CAAA,CAAA;AAEtE,QAAMS,kBAAcC,4BAAO,MAAA;AACzB,UAAMC,WAAWhB,QACdE,cAAce,kCAAaC,aAAa,EACxCC,SAAiCC,sCAAAA,GAAmBC;AAEvD,QAAIL,UAAUM,gBAAgB,UAAU;AACtCZ,SAAGW,QAAQ,IAAIE,uBAAAA;IACjB,OAAO;AACLb,SAAGW,QAAQ,IAAIR,8BAAoB;QAAER;MAAS,CAAA;IAChD;EACF,CAAA;AAEA,aAAOmB,kCAAYC,4CAAsBC,UAAUhB,IAAI,MAAMI,YAAAA,CAAAA;AAC/D;",
6
+ "names": ["DEFAULT_AI_SERVICE_URL", "context", "client", "getCapability", "ClientCapabilities", "Client", "endpoint", "config", "values", "runtime", "services", "ai", "server", "signal", "AIServiceEdgeClient", "unsubscribe", "effect", "settings", "Capabilities", "SettingsStore", "getStore", "ASSISTANT_PLUGIN", "value", "llmProvider", "OllamaClient", "contributes", "AssistantCapabilities", "AiClient"]
7
+ }