@dxos/plugin-automation 0.7.4 → 0.7.5-labs.401163d

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 (302) hide show
  1. package/dist/lib/browser/AutomationPanel-VW2XIUPU.mjs +8 -0
  2. package/dist/lib/browser/ChatContainer-OLRZNGWK.mjs +12 -0
  3. package/dist/lib/browser/ai-client-5CNY6JBF.mjs +22 -0
  4. package/dist/lib/browser/ai-client-5CNY6JBF.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-6H7MDCXE.mjs +197 -0
  6. package/dist/lib/browser/app-graph-builder-6H7MDCXE.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-2H2EUYXL.mjs +15 -0
  8. package/dist/lib/browser/chunk-2H2EUYXL.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-ITG6CBKL.mjs +1602 -0
  10. package/dist/lib/browser/chunk-ITG6CBKL.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-MRBC5J4T.mjs +518 -0
  12. package/dist/lib/browser/chunk-MRBC5J4T.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-NQFZ6XRX.mjs +243 -0
  14. package/dist/lib/browser/chunk-NQFZ6XRX.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-Q4IMHYGH.mjs +150 -0
  16. package/dist/lib/browser/chunk-Q4IMHYGH.mjs.map +7 -0
  17. package/dist/lib/browser/{chunk-X5KMOH3I.mjs → chunk-R4JH4TLE.mjs} +6 -4
  18. package/dist/lib/browser/chunk-R4JH4TLE.mjs.map +7 -0
  19. package/dist/lib/browser/index.mjs +157 -252
  20. package/dist/lib/browser/index.mjs.map +4 -4
  21. package/dist/lib/browser/intent-resolver-BWAXKT27.mjs +29 -0
  22. package/dist/lib/browser/intent-resolver-BWAXKT27.mjs.map +7 -0
  23. package/dist/lib/browser/meta.json +1 -1
  24. package/dist/lib/browser/react-surface-O6SHIBCA.mjs +58 -0
  25. package/dist/lib/browser/react-surface-O6SHIBCA.mjs.map +7 -0
  26. package/dist/lib/browser/types/index.mjs +12 -3
  27. package/dist/lib/node/{meta.cjs → AutomationPanel-G6EDDYWW.cjs} +7 -11
  28. package/dist/lib/node/AutomationPanel-G6EDDYWW.cjs.map +7 -0
  29. package/dist/lib/node/ChatContainer-GRZDJIG5.cjs +33 -0
  30. package/dist/lib/node/ChatContainer-GRZDJIG5.cjs.map +7 -0
  31. package/dist/lib/node/ai-client-FKLPDELV.cjs +38 -0
  32. package/dist/lib/node/ai-client-FKLPDELV.cjs.map +7 -0
  33. package/dist/lib/node/app-graph-builder-7JMJLZIE.cjs +212 -0
  34. package/dist/lib/node/app-graph-builder-7JMJLZIE.cjs.map +7 -0
  35. package/dist/lib/node/chunk-CFBERLTN.cjs +1586 -0
  36. package/dist/lib/node/chunk-CFBERLTN.cjs.map +7 -0
  37. package/dist/lib/node/{chunk-DTJ7XVO2.cjs → chunk-EQYHOTGG.cjs} +11 -8
  38. package/dist/lib/node/chunk-EQYHOTGG.cjs.map +7 -0
  39. package/dist/lib/node/chunk-FQUY77HT.cjs +527 -0
  40. package/dist/lib/node/chunk-FQUY77HT.cjs.map +7 -0
  41. package/dist/lib/node/chunk-GB7245FH.cjs +173 -0
  42. package/dist/lib/node/chunk-GB7245FH.cjs.map +7 -0
  43. package/dist/lib/node/chunk-QXIHYOMF.cjs +267 -0
  44. package/dist/lib/node/chunk-QXIHYOMF.cjs.map +7 -0
  45. package/dist/lib/node/chunk-U5Z7LFWB.cjs +34 -0
  46. package/dist/lib/node/chunk-U5Z7LFWB.cjs.map +7 -0
  47. package/dist/lib/node/index.cjs +174 -282
  48. package/dist/lib/node/index.cjs.map +4 -4
  49. package/dist/lib/node/intent-resolver-C6OKFVEW.cjs +44 -0
  50. package/dist/lib/node/intent-resolver-C6OKFVEW.cjs.map +7 -0
  51. package/dist/lib/node/meta.json +1 -1
  52. package/dist/lib/node/react-surface-JT6SVCPK.cjs +76 -0
  53. package/dist/lib/node/react-surface-JT6SVCPK.cjs.map +7 -0
  54. package/dist/lib/node/types/index.cjs +16 -7
  55. package/dist/lib/node/types/index.cjs.map +2 -2
  56. package/dist/lib/node-esm/AutomationPanel-V3IWQAMO.mjs +9 -0
  57. package/dist/lib/node-esm/AutomationPanel-V3IWQAMO.mjs.map +7 -0
  58. package/dist/lib/node-esm/ChatContainer-ORVWQPJO.mjs +13 -0
  59. package/dist/lib/node-esm/ChatContainer-ORVWQPJO.mjs.map +7 -0
  60. package/dist/lib/node-esm/ai-client-XGNA6SJ5.mjs +23 -0
  61. package/dist/lib/node-esm/ai-client-XGNA6SJ5.mjs.map +7 -0
  62. package/dist/lib/node-esm/app-graph-builder-C6NUQGCU.mjs +198 -0
  63. package/dist/lib/node-esm/app-graph-builder-C6NUQGCU.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-2OKJZ4ZW.mjs +519 -0
  65. package/dist/lib/node-esm/chunk-2OKJZ4ZW.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-6HLBYDUI.mjs +244 -0
  67. package/dist/lib/node-esm/chunk-6HLBYDUI.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-7VPT3OO3.mjs +1603 -0
  69. package/dist/lib/node-esm/chunk-7VPT3OO3.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-DNCXRGAF.mjs +151 -0
  71. package/dist/lib/node-esm/chunk-DNCXRGAF.mjs.map +7 -0
  72. package/dist/lib/node-esm/{chunk-HNOBZHWK.mjs → chunk-EMVA6QUT.mjs} +6 -4
  73. package/dist/lib/node-esm/chunk-EMVA6QUT.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-IJRTDSKN.mjs +16 -0
  75. package/dist/lib/node-esm/chunk-IJRTDSKN.mjs.map +7 -0
  76. package/dist/lib/node-esm/index.mjs +157 -252
  77. package/dist/lib/node-esm/index.mjs.map +4 -4
  78. package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs +30 -0
  79. package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs.map +7 -0
  80. package/dist/lib/node-esm/meta.json +1 -1
  81. package/dist/lib/node-esm/react-surface-DSVM33SA.mjs +59 -0
  82. package/dist/lib/node-esm/react-surface-DSVM33SA.mjs.map +7 -0
  83. package/dist/lib/node-esm/types/index.mjs +12 -3
  84. package/dist/types/src/AutomationPlugin.d.ts +1 -3
  85. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  86. package/dist/types/src/artifacts.stories.d.ts +16 -0
  87. package/dist/types/src/artifacts.stories.d.ts.map +1 -0
  88. package/dist/types/src/capabilities/ai-client.d.ts +5 -0
  89. package/dist/types/src/capabilities/ai-client.d.ts.map +1 -0
  90. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  91. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  92. package/dist/types/src/capabilities/capabilities.d.ts +5 -0
  93. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  94. package/dist/types/src/capabilities/index.d.ts +182 -0
  95. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  96. package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
  97. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  98. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  99. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  100. package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts +3 -0
  101. package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts.map +1 -0
  102. package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.stories.d.ts +8 -0
  103. package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.stories.d.ts.map +1 -0
  104. package/dist/types/src/components/AmbientChatDialog/index.d.ts +2 -0
  105. package/dist/types/src/components/AmbientChatDialog/index.d.ts.map +1 -0
  106. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  107. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  108. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  109. package/dist/types/src/components/Box/StatusLine.d.ts +11 -0
  110. package/dist/types/src/components/Box/StatusLine.d.ts.map +1 -0
  111. package/dist/types/src/components/Box/StatusLine.stories.d.ts +9 -0
  112. package/dist/types/src/components/Box/StatusLine.stories.d.ts.map +1 -0
  113. package/dist/types/src/components/Box/Tabbed.d.ts +15 -0
  114. package/dist/types/src/components/Box/Tabbed.d.ts.map +1 -0
  115. package/dist/types/src/components/Box/Tabbed.stories.d.ts +8 -0
  116. package/dist/types/src/components/Box/Tabbed.stories.d.ts.map +1 -0
  117. package/dist/types/src/components/Box/ToggleContainer.d.ts +13 -0
  118. package/dist/types/src/components/Box/ToggleContainer.d.ts.map +1 -0
  119. package/dist/types/src/components/Box/ToggleContainer.stories.d.ts +9 -0
  120. package/dist/types/src/components/Box/ToggleContainer.stories.d.ts.map +1 -0
  121. package/dist/types/src/components/Box/index.d.ts +4 -0
  122. package/dist/types/src/components/Box/index.d.ts.map +1 -0
  123. package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +7 -0
  124. package/dist/types/src/components/ChatContainer/ChatContainer.d.ts.map +1 -0
  125. package/dist/types/src/components/ChatContainer/index.d.ts +4 -0
  126. package/dist/types/src/components/ChatContainer/index.d.ts.map +1 -0
  127. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts +14 -0
  128. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts.map +1 -0
  129. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts +8 -0
  130. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts.map +1 -0
  131. package/dist/types/src/components/MarkdownViewer/index.d.ts +2 -0
  132. package/dist/types/src/components/MarkdownViewer/index.d.ts.map +1 -0
  133. package/dist/types/src/components/Prompt/Prompt.d.ts +7 -0
  134. package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -0
  135. package/dist/types/src/components/Prompt/Prompt.stories.d.ts +8 -0
  136. package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -0
  137. package/dist/types/src/components/Prompt/index.d.ts +2 -0
  138. package/dist/types/src/components/Prompt/index.d.ts.map +1 -0
  139. package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts +20 -0
  140. package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts.map +1 -0
  141. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +6 -0
  142. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +1 -0
  143. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +8 -0
  144. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +1 -0
  145. package/dist/types/src/components/ServiceRegistry/index.d.ts +2 -0
  146. package/dist/types/src/components/ServiceRegistry/index.d.ts.map +1 -0
  147. package/dist/types/src/components/Thread/Thread.d.ts +11 -0
  148. package/dist/types/src/components/Thread/Thread.d.ts.map +1 -0
  149. package/dist/types/src/components/Thread/Thread.stories.d.ts +11 -0
  150. package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -0
  151. package/dist/types/src/components/Thread/ThreadMessage.d.ts +12 -0
  152. package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -0
  153. package/dist/types/src/components/Thread/index.d.ts +2 -0
  154. package/dist/types/src/components/Thread/index.d.ts.map +1 -0
  155. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
  156. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  157. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  158. package/dist/types/src/components/index.d.ts +13 -2
  159. package/dist/types/src/components/index.d.ts.map +1 -1
  160. package/dist/types/src/hooks/email.d.ts.map +1 -1
  161. package/dist/types/src/hooks/index.d.ts +4 -0
  162. package/dist/types/src/hooks/index.d.ts.map +1 -1
  163. package/dist/types/src/hooks/invocation-handler.d.ts.map +1 -1
  164. package/dist/types/src/hooks/processor.d.ts +70 -0
  165. package/dist/types/src/hooks/processor.d.ts.map +1 -0
  166. package/dist/types/src/hooks/processor.test.d.ts +2 -0
  167. package/dist/types/src/hooks/processor.test.d.ts.map +1 -0
  168. package/dist/types/src/hooks/useChatProcessor.d.ts +7 -0
  169. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -0
  170. package/dist/types/src/hooks/useMessageQueue.d.ts +41 -0
  171. package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -0
  172. package/dist/types/src/hooks/useServices.d.ts +7 -0
  173. package/dist/types/src/hooks/useServices.d.ts.map +1 -0
  174. package/dist/types/src/index.d.ts +1 -2
  175. package/dist/types/src/index.d.ts.map +1 -1
  176. package/dist/types/src/meta.d.ts +2 -2
  177. package/dist/types/src/meta.d.ts.map +1 -1
  178. package/dist/types/src/testing/index.d.ts +2 -1
  179. package/dist/types/src/testing/index.d.ts.map +1 -1
  180. package/dist/types/src/testing/{testing.d.ts → test-functions.d.ts} +3 -1
  181. package/dist/types/src/testing/test-functions.d.ts.map +1 -0
  182. package/dist/types/src/testing/test-services.d.ts +5 -0
  183. package/dist/types/src/testing/test-services.d.ts.map +1 -0
  184. package/dist/types/src/tools/function.d.ts +5 -0
  185. package/dist/types/src/tools/function.d.ts.map +1 -0
  186. package/dist/types/src/tools/index.d.ts +3 -0
  187. package/dist/types/src/tools/index.d.ts.map +1 -0
  188. package/dist/types/src/tools/openapi.d.ts +10 -0
  189. package/dist/types/src/tools/openapi.d.ts.map +1 -0
  190. package/dist/types/src/tools/openapi.test.d.ts +2 -0
  191. package/dist/types/src/tools/openapi.test.d.ts.map +1 -0
  192. package/dist/types/src/translations.d.ts +84 -2
  193. package/dist/types/src/translations.d.ts.map +1 -1
  194. package/dist/types/src/types/index.d.ts +1 -0
  195. package/dist/types/src/types/index.d.ts.map +1 -1
  196. package/dist/types/src/types/registry.d.ts +10 -0
  197. package/dist/types/src/types/registry.d.ts.map +1 -0
  198. package/dist/types/src/types/schema.d.ts +189 -39
  199. package/dist/types/src/types/schema.d.ts.map +1 -1
  200. package/dist/types/src/types/types.d.ts +16 -5
  201. package/dist/types/src/types/types.d.ts.map +1 -1
  202. package/dist/types/tsconfig.tsbuildinfo +1 -0
  203. package/package.json +57 -48
  204. package/src/AutomationPlugin.tsx +77 -194
  205. package/src/artifacts.stories.tsx +241 -0
  206. package/src/capabilities/ai-client.ts +19 -0
  207. package/src/capabilities/app-graph-builder.ts +187 -0
  208. package/src/capabilities/capabilities.ts +12 -0
  209. package/src/capabilities/index.ts +12 -0
  210. package/src/capabilities/intent-resolver.ts +27 -0
  211. package/src/capabilities/react-surface.tsx +42 -0
  212. package/src/components/AmbientChatDialog/AmbientChatDialog.stories.tsx +44 -0
  213. package/src/components/AmbientChatDialog/AmbientChatDialog.tsx +63 -0
  214. package/src/components/AmbientChatDialog/index.ts +5 -0
  215. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -2
  216. package/src/components/AutomationPanel/AutomationPanel.tsx +61 -39
  217. package/src/components/Box/StatusLine.stories.tsx +52 -0
  218. package/src/components/Box/StatusLine.tsx +76 -0
  219. package/src/components/Box/Tabbed.stories.tsx +51 -0
  220. package/src/components/Box/Tabbed.tsx +89 -0
  221. package/src/components/Box/ToggleContainer.stories.tsx +110 -0
  222. package/src/components/Box/ToggleContainer.tsx +108 -0
  223. package/src/components/Box/index.ts +7 -0
  224. package/src/components/ChatContainer/ChatContainer.tsx +52 -0
  225. package/src/components/ChatContainer/index.ts +8 -0
  226. package/src/components/MarkdownViewer/MarkdownViewer.stories.tsx +56 -0
  227. package/src/components/MarkdownViewer/MarkdownViewer.tsx +79 -0
  228. package/src/components/MarkdownViewer/index.ts +5 -0
  229. package/src/components/Prompt/Prompt.stories.tsx +50 -0
  230. package/src/components/Prompt/Prompt.tsx +39 -0
  231. package/src/components/Prompt/index.ts +5 -0
  232. package/src/components/Prompt/prompt-autocomplete.ts +200 -0
  233. package/src/components/PromptEditor/PromptEditor.stories.tsx +6 -6
  234. package/src/components/PromptEditor/PromptEditor.tsx +3 -3
  235. package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +49 -0
  236. package/src/components/ServiceRegistry/ServiceRegistry.tsx +76 -0
  237. package/src/components/ServiceRegistry/index.ts +5 -0
  238. package/src/components/Thread/Thread.stories.tsx +197 -0
  239. package/src/components/Thread/Thread.tsx +156 -0
  240. package/src/components/Thread/ThreadMessage.tsx +225 -0
  241. package/src/components/Thread/index.ts +5 -0
  242. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +1 -2
  243. package/src/components/TriggerEditor/TriggerEditor.tsx +86 -16
  244. package/src/components/index.ts +10 -1
  245. package/src/hooks/email.ts +2 -2
  246. package/src/hooks/index.ts +5 -0
  247. package/src/hooks/invocation-handler.ts +2 -2
  248. package/src/hooks/processor.test.ts +15 -0
  249. package/src/hooks/processor.ts +210 -0
  250. package/src/hooks/useChatProcessor.tsx +86 -0
  251. package/src/hooks/useMessageQueue.ts +23 -0
  252. package/src/hooks/useServices.ts +28 -0
  253. package/src/index.ts +1 -4
  254. package/src/meta.ts +5 -2
  255. package/src/testing/index.ts +2 -1
  256. package/src/testing/{testing.ts → test-functions.ts} +9 -2
  257. package/src/testing/test-services.ts +131 -0
  258. package/src/tools/function.ts +47 -0
  259. package/src/tools/index.ts +6 -0
  260. package/src/tools/openapi.test.ts +224 -0
  261. package/src/tools/openapi.ts +331 -0
  262. package/src/translations.ts +18 -2
  263. package/src/types/index.ts +1 -0
  264. package/src/types/registry.ts +26 -0
  265. package/src/types/schema.ts +96 -2
  266. package/src/types/types.ts +15 -21
  267. package/dist/lib/browser/AssistantPanel-N3QSALKY.mjs +0 -341
  268. package/dist/lib/browser/AssistantPanel-N3QSALKY.mjs.map +0 -7
  269. package/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs +0 -153
  270. package/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs.map +0 -7
  271. package/dist/lib/browser/chunk-7KB4UMXO.mjs +0 -49
  272. package/dist/lib/browser/chunk-7KB4UMXO.mjs.map +0 -7
  273. package/dist/lib/browser/chunk-X5KMOH3I.mjs.map +0 -7
  274. package/dist/lib/browser/meta.mjs +0 -9
  275. package/dist/lib/node/AssistantPanel-RIA4TI3B.cjs +0 -361
  276. package/dist/lib/node/AssistantPanel-RIA4TI3B.cjs.map +0 -7
  277. package/dist/lib/node/AutomationPanel-HZS5WKI5.cjs +0 -173
  278. package/dist/lib/node/AutomationPanel-HZS5WKI5.cjs.map +0 -7
  279. package/dist/lib/node/chunk-CUCUWUAF.cjs +0 -73
  280. package/dist/lib/node/chunk-CUCUWUAF.cjs.map +0 -7
  281. package/dist/lib/node/chunk-DTJ7XVO2.cjs.map +0 -7
  282. package/dist/lib/node/meta.cjs.map +0 -7
  283. package/dist/lib/node-esm/AssistantPanel-72YH43CH.mjs +0 -342
  284. package/dist/lib/node-esm/AssistantPanel-72YH43CH.mjs.map +0 -7
  285. package/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs +0 -154
  286. package/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs.map +0 -7
  287. package/dist/lib/node-esm/chunk-23LY7DYS.mjs +0 -51
  288. package/dist/lib/node-esm/chunk-23LY7DYS.mjs.map +0 -7
  289. package/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map +0 -7
  290. package/dist/lib/node-esm/meta.mjs +0 -10
  291. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts +0 -8
  292. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts.map +0 -1
  293. package/dist/types/src/components/AssistantPanel/index.d.ts +0 -3
  294. package/dist/types/src/components/AssistantPanel/index.d.ts.map +0 -1
  295. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts +0 -6
  296. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts.map +0 -1
  297. package/dist/types/src/testing/testing.d.ts.map +0 -1
  298. package/src/components/AssistantPanel/AssistantPanel.tsx +0 -230
  299. package/src/components/AssistantPanel/index.ts +0 -7
  300. package/src/components/AssistantPanel/system-instructions.ts +0 -166
  301. /package/dist/lib/browser/{meta.mjs.map → AutomationPanel-VW2XIUPU.mjs.map} +0 -0
  302. /package/dist/lib/{node-esm/meta.mjs.map → browser/ChatContainer-OLRZNGWK.mjs.map} +0 -0
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_GB7245FH_exports = {};
20
+ __export(chunk_GB7245FH_exports, {
21
+ AIChatType: () => AIChatType,
22
+ ApiAuthorization: () => ApiAuthorization,
23
+ AutomationAction: () => AutomationAction,
24
+ ChainInputSchema: () => ChainInputSchema,
25
+ ChainInputType: () => ChainInputType,
26
+ ChainPromptType: () => ChainPromptType,
27
+ ChainType: () => ChainType,
28
+ ServiceType: () => ServiceType,
29
+ categoryIcons: () => categoryIcons
30
+ });
31
+ module.exports = __toCommonJS(chunk_GB7245FH_exports);
32
+ var import_chunk_EQYHOTGG = require("./chunk-EQYHOTGG.cjs");
33
+ var import_conductor = require("@dxos/conductor");
34
+ var import_echo_schema = require("@dxos/echo-schema");
35
+ var import_functions = require("@dxos/functions");
36
+ var import_echo_schema2 = require("@dxos/echo-schema");
37
+ var categoryIcons = {
38
+ finance: "ph--bank--regular",
39
+ health: "ph--heart--regular",
40
+ geolocation: "ph--globe-simple--regular",
41
+ education: "ph--books--regular",
42
+ entertainment: "ph--music-notes--regular",
43
+ shopping: "ph--shopping-cart--regular",
44
+ travel: "ph--airplane-takeoff--regular",
45
+ utilities: "ph--lightning--regular",
46
+ weather: "ph--cloud-rain--regular"
47
+ };
48
+ var ChainInputType;
49
+ (function(ChainInputType2) {
50
+ ChainInputType2[ChainInputType2["VALUE"] = 0] = "VALUE";
51
+ ChainInputType2[ChainInputType2["PASS_THROUGH"] = 1] = "PASS_THROUGH";
52
+ ChainInputType2[ChainInputType2["RETRIEVER"] = 2] = "RETRIEVER";
53
+ ChainInputType2[ChainInputType2["FUNCTION"] = 3] = "FUNCTION";
54
+ ChainInputType2[ChainInputType2["QUERY"] = 4] = "QUERY";
55
+ ChainInputType2[ChainInputType2["RESOLVER"] = 5] = "RESOLVER";
56
+ ChainInputType2[ChainInputType2["CONTEXT"] = 6] = "CONTEXT";
57
+ ChainInputType2[ChainInputType2["SCHEMA"] = 7] = "SCHEMA";
58
+ })(ChainInputType || (ChainInputType = {}));
59
+ var ChainInputSchema = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
60
+ name: import_echo_schema.S.String,
61
+ type: import_echo_schema.S.optional(import_echo_schema.S.Enums(ChainInputType)),
62
+ value: import_echo_schema.S.optional(import_echo_schema.S.String)
63
+ }));
64
+ var ChainPromptType = class extends (0, import_echo_schema.TypedObject)({
65
+ typename: "dxos.org/type/ChainPrompt",
66
+ version: "0.1.0"
67
+ })({
68
+ command: import_echo_schema.S.optional(import_echo_schema.S.String),
69
+ template: import_echo_schema.S.String,
70
+ inputs: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Array(ChainInputSchema)))
71
+ }) {
72
+ };
73
+ var ChainType = class extends (0, import_echo_schema.TypedObject)({
74
+ typename: "dxos.org/type/Chain",
75
+ version: "0.1.0"
76
+ })({
77
+ name: import_echo_schema.S.optional(import_echo_schema.S.String),
78
+ prompts: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Array((0, import_echo_schema.Ref)(ChainPromptType))))
79
+ }) {
80
+ };
81
+ var AIChatType = class extends (0, import_echo_schema.TypedObject)({
82
+ typename: "dxos.org/type/AIChat",
83
+ version: "0.1.0"
84
+ })({
85
+ name: import_echo_schema.S.optional(import_echo_schema.S.String),
86
+ // TODO(wittjosiah): Should be a ref to a Queue.
87
+ queue: (0, import_echo_schema.Ref)(import_echo_schema.Expando)
88
+ }) {
89
+ };
90
+ var ApiAuthorizationKey = import_echo_schema.S.Struct({
91
+ type: import_echo_schema.S.Literal("api-key"),
92
+ key: import_echo_schema.S.String,
93
+ placement: import_echo_schema.S.Union(import_echo_schema.S.Struct({
94
+ type: import_echo_schema.S.Literal("authorization-header")
95
+ }), import_echo_schema.S.Struct({
96
+ type: import_echo_schema.S.Literal("query"),
97
+ name: import_echo_schema.S.String
98
+ }))
99
+ });
100
+ var ApiAuthorizationOauth = import_echo_schema.S.Struct({
101
+ type: import_echo_schema.S.Literal("oauth"),
102
+ clientId: import_echo_schema.S.String,
103
+ clientSecret: import_echo_schema.S.String,
104
+ tokenUrl: import_echo_schema.S.String,
105
+ grantType: import_echo_schema.S.String
106
+ });
107
+ var ApiAuthorization = import_echo_schema.S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
108
+ var ServiceInterfaceFunction = import_echo_schema.S.Struct({
109
+ kind: import_echo_schema.S.Literal("function"),
110
+ fn: (0, import_echo_schema.Ref)(import_functions.FunctionType)
111
+ });
112
+ var ServiceInterfaceWorkflow = import_echo_schema.S.Struct({
113
+ kind: import_echo_schema.S.Literal("workflow"),
114
+ workflow: (0, import_echo_schema.Ref)(import_conductor.ComputeGraph)
115
+ });
116
+ var ServiceInterfaceApi = import_echo_schema.S.Struct({
117
+ kind: import_echo_schema.S.Literal("api"),
118
+ /**
119
+ * URL to fetch the openapi schema.
120
+ */
121
+ schemaUrl: import_echo_schema.S.optional(import_echo_schema.S.String),
122
+ /**
123
+ * Inlined openapi schema.
124
+ */
125
+ schema: import_echo_schema.S.optional(import_echo_schema.S.Any),
126
+ /**
127
+ * Authorization configuration if required.
128
+ */
129
+ authorization: import_echo_schema.S.optional(ApiAuthorization)
130
+ });
131
+ var ServiceInterface = import_echo_schema.S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);
132
+ var ServiceType = class extends (0, import_echo_schema.TypedObject)({
133
+ typename: "dxos.org/type/ServiceType",
134
+ version: "0.1.0"
135
+ })({
136
+ serviceId: import_echo_schema.S.String,
137
+ name: import_echo_schema.S.optional(import_echo_schema.S.String),
138
+ description: import_echo_schema.S.optional(import_echo_schema.S.String),
139
+ category: import_echo_schema.S.optional(import_echo_schema.S.String),
140
+ enabled: import_echo_schema.S.optional(import_echo_schema.S.Boolean),
141
+ /**
142
+ * Entries exposed: functions, workflows, and APIs.
143
+ */
144
+ interfaces: import_echo_schema.S.optional(import_echo_schema.S.Array(ServiceInterface))
145
+ }) {
146
+ };
147
+ var AutomationAction;
148
+ (function(AutomationAction2) {
149
+ const AUTOMATION_ACTION = `${import_chunk_EQYHOTGG.AUTOMATION_PLUGIN}/action`;
150
+ class Create extends import_echo_schema2.S.TaggedClass()(`${AUTOMATION_ACTION}/create`, {
151
+ input: import_echo_schema2.S.Struct({
152
+ name: import_echo_schema2.S.optional(import_echo_schema2.S.String)
153
+ }),
154
+ output: import_echo_schema2.S.Struct({
155
+ object: AIChatType
156
+ })
157
+ }) {
158
+ }
159
+ AutomationAction2.Create = Create;
160
+ })(AutomationAction || (AutomationAction = {}));
161
+ // Annotate the CommonJS export names for ESM import in node:
162
+ 0 && (module.exports = {
163
+ AIChatType,
164
+ ApiAuthorization,
165
+ AutomationAction,
166
+ ChainInputSchema,
167
+ ChainInputType,
168
+ ChainPromptType,
169
+ ChainType,
170
+ ServiceType,
171
+ categoryIcons
172
+ });
173
+ //# sourceMappingURL=chunk-GB7245FH.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/registry.ts", "../../../src/types/schema.ts", "../../../src/types/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ServiceType } from './schema';\n\nexport type ServiceQuery = {\n name?: string;\n category?: string;\n};\n\nexport interface BaseServiceRegistry {\n queryServices(query?: ServiceQuery): Promise<ServiceType[]>;\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", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Expando, Ref, S, TypedObject, type Ref$ } from '@dxos/echo-schema';\nimport { FunctionType } from '@dxos/functions';\n\n// TODO(burdon): Change to S.Literal (and discriminated union).\nexport enum ChainInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n\nexport const ChainInputSchema = S.mutable(\n S.Struct({\n name: S.String,\n type: S.optional(S.Enums(ChainInputType)),\n value: S.optional(S.String),\n }),\n);\n\nexport type ChainInput = S.Schema.Type<typeof ChainInputSchema>;\n\nexport class ChainPromptType extends TypedObject({ typename: 'dxos.org/type/ChainPrompt', version: '0.1.0' })({\n command: S.optional(S.String),\n template: S.String,\n inputs: S.optional(S.mutable(S.Array(ChainInputSchema))),\n}) {}\n\nexport class ChainType extends TypedObject({ typename: 'dxos.org/type/Chain', version: '0.1.0' })({\n name: S.optional(S.String),\n prompts: S.optional(S.mutable(S.Array(Ref(ChainPromptType)))),\n}) {}\n\nexport class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({\n name: S.optional(S.String),\n // TODO(wittjosiah): Should be a ref to a Queue.\n queue: Ref(Expando),\n}) {}\n\nconst ApiAuthorizationKey = S.Struct({\n type: S.Literal('api-key'),\n key: S.String,\n placement: S.Union(\n S.Struct({\n type: S.Literal('authorization-header'),\n }),\n S.Struct({\n type: S.Literal('query'),\n name: S.String,\n }),\n ),\n});\n\nconst ApiAuthorizationOauth = S.Struct({\n type: S.Literal('oauth'),\n clientId: S.String,\n clientSecret: S.String,\n tokenUrl: S.String,\n grantType: S.String,\n});\n\nexport const ApiAuthorization = S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);\nexport type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;\n\nconst ServiceInterfaceFunction = S.Struct({\n kind: S.Literal('function'),\n fn: Ref(FunctionType) as Ref$<FunctionType>,\n});\n\nconst ServiceInterfaceWorkflow = S.Struct({\n kind: S.Literal('workflow'),\n workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,\n});\n\nconst ServiceInterfaceApi = S.Struct({\n kind: S.Literal('api'),\n\n /**\n * URL to fetch the openapi schema.\n */\n schemaUrl: S.optional(S.String),\n\n /**\n * Inlined openapi schema.\n */\n schema: S.optional(S.Any),\n\n /**\n * Authorization configuration if required.\n */\n authorization: S.optional(ApiAuthorization),\n});\n\nconst ServiceInterface = S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);\nexport type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;\n\n// export const ServiceType = S.Struct({\n// serviceId: S.String,\n// name: S.optional(S.String),\n// description: S.optional(S.String),\n// category: S.optional(S.String),\n// enabled: S.optional(S.Boolean),\n\n// /**\n// * Entries exposed: functions, workflows, and APIs.\n// */\n// interfaces: S.optional(S.Array(ServiceInterface)),\n// }).pipe(EchoObject('dxos.org/type/Service', '0.1.0'));\n// dxn:type:dxos.org/type/Service\n\n// export type ServiceType = S.Schema.Type<typeof ServiceType>;\n\nexport class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({\n serviceId: S.String,\n name: S.optional(S.String),\n description: S.optional(S.String),\n category: S.optional(S.String),\n enabled: S.optional(S.Boolean),\n\n /**\n * Entries exposed: functions, workflows, and APIs.\n */\n interfaces: S.optional(S.Array(ServiceInterface)),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { AIChatType } from './schema';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport namespace AutomationAction {\n const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${AUTOMATION_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: AIChatType,\n }),\n }) {}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA,uBAA6B;AAC7B,yBAAwD;AACxD,uBAA6B;ACF7B,IAAAA,sBAAkB;AFWX,IAAMC,gBAAwC;EACnDC,SAAS;EACTC,QAAQ;EACRC,aAAa;EACbC,WAAW;EACXC,eAAe;EACfC,UAAU;EACVC,QAAQ;EACRC,WAAW;EACXC,SAAS;AACX;;UChBYC,iBAAAA;;;;;;;;;GAAAA,mBAAAA,iBAAAA,CAAAA,EAAAA;AAWL,IAAMC,mBAAmBC,qBAAEC,QAChCD,qBAAEE,OAAO;EACPC,MAAMH,qBAAEI;EACRC,MAAML,qBAAEM,SAASN,qBAAEO,MAAMT,cAAAA,CAAAA;EACzBU,OAAOR,qBAAEM,SAASN,qBAAEI,MAAM;AAC5B,CAAA,CAAA;AAKK,IAAMK,kBAAN,kBAA8BC,gCAAY;EAAEC,UAAU;EAA6BC,SAAS;AAAQ,CAAA,EAAG;EAC5GC,SAASb,qBAAEM,SAASN,qBAAEI,MAAM;EAC5BU,UAAUd,qBAAEI;EACZW,QAAQf,qBAAEM,SAASN,qBAAEC,QAAQD,qBAAEgB,M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QAAQ,UAAA;EAChBe,cAAUpB,wBAAIqB,6BAAAA;AAChB,CAAA;AAEA,IAAMC,sBAAsBzC,qBAAEE,OAAO;EACnCiC,MAAMnC,qBAAEwB,QAAQ,KAAA;;;;EAKhBkB,WAAW1C,qBAAEM,SAASN,qBAAEI,MAAM;;;;EAK9BuC,QAAQ3C,qBAAEM,SAASN,qBAAE4C,GAAG;;;;EAKxBC,eAAe7C,qBAAEM,SAAS2B,gBAAAA;AAC5B,CAAA;AAEA,IAAMa,mBAAmB9C,qBAAE2B,MAAMO,0BAA0BI,0BAA0BG,mBAAAA;AAmB9E,IAAMM,cAAN,kBAA0BrC,gCAAY;EAAEC,UAAU;EAA6BC,SAAS;AAAQ,CAAA,EAAG;EACxGoC,WAAWhD,qBAAEI;EACbD,MAAMH,qBAAEM,SAASN,qBAAEI,MAAM;EACzB6C,aAAajD,qBAAEM,SAASN,qBAAEI,MAAM;EAChC8C,UAAUlD,qBAAEM,SAASN,qBAAEI,MAAM;EAC7B+C,SAASnD,qBAAEM,SAASN,qBAAEoD,OAAO;;;;EAK7BC,YAAYrD,qBAAEM,SAASN,qBAAEgB,MAAM8B,gBAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;UC1HaQ,mBAAAA;AACf,QAAMC,oBAAoB,GAAGC,uCAAAA;EAEtB,MAAMC,eAAezD,oBAAAA,EAAE0D,YAAW,EAAW,GAAGH,iBAAAA,WAA4B;IACjFI,OAAO3D,oBAAAA,EAAEE,OAAO;MACdC,MAAMH,oBAAAA,EAAEM,SAASN,oBAAAA,EAAEI,MAAM;IAC3B,CAAA;IACAwD,QAAQ5D,oBAAAA,EAAEE,OAAO;MACf2D,QAAQzC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;oBAPSqC,SAAAA;AAQf,GAXiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
6
+ "names": ["import_echo_schema", "categoryIcons", "finance", "health", "geolocation", "education", "entertainment", "shopping", "travel", "utilities", "weather", "ChainInputType", "ChainInputSchema", "S", "mutable", "Struct", "name", "String", "type", "optional", "Enums", "value", "ChainPromptType", "TypedObject", "typename", "version", "command", "template", "inputs", "Array", "ChainType", "prompts", "Ref", "AIChatType", "queue", "Expando", "ApiAuthorizationKey", "Literal", "key", "placement", "Union", "ApiAuthorizationOauth", "clientId", "clientSecret", "tokenUrl", "grantType", "ApiAuthorization", "ServiceInterfaceFunction", "kind", "fn", "FunctionType", "ServiceInterfaceWorkflow", "workflow", "ComputeGraph", "ServiceInterfaceApi", "schemaUrl", "schema", "Any", "authorization", "ServiceInterface", "ServiceType", "serviceId", "description", "category", "enabled", "Boolean", "interfaces", "AutomationAction", "AUTOMATION_ACTION", "AUTOMATION_PLUGIN", "Create", "TaggedClass", "input", "output", "object"]
7
+ }
@@ -0,0 +1,267 @@
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 chunk_QXIHYOMF_exports = {};
30
+ __export(chunk_QXIHYOMF_exports, {
31
+ AutomationPanel_default: () => AutomationPanel_default,
32
+ TriggerEditor: () => TriggerEditor
33
+ });
34
+ module.exports = __toCommonJS(chunk_QXIHYOMF_exports);
35
+ var import_chunk_EQYHOTGG = require("./chunk-EQYHOTGG.cjs");
36
+ var import_react = __toESM(require("react"));
37
+ var import_echo_schema = require("@dxos/echo-schema");
38
+ var import_functions = require("@dxos/functions");
39
+ var import_react_client = require("@dxos/react-client");
40
+ var import_echo = require("@dxos/react-client/echo");
41
+ var import_react_ui = require("@dxos/react-ui");
42
+ var import_react_ui_list = require("@dxos/react-ui-list");
43
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
44
+ var import_react2 = __toESM(require("react"));
45
+ var import_conductor = require("@dxos/conductor");
46
+ var import_functions2 = require("@dxos/functions");
47
+ var import_echo2 = require("@dxos/react-client/echo");
48
+ var import_react_ui2 = require("@dxos/react-ui");
49
+ var import_react_ui_form = require("@dxos/react-ui-form");
50
+ var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
51
+ const { t } = (0, import_react_ui2.useTranslation)(import_chunk_EQYHOTGG.AUTOMATION_PLUGIN);
52
+ const functions = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(import_functions2.FunctionType));
53
+ const workflows = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(import_conductor.ComputeGraph));
54
+ const scripts = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(import_functions2.ScriptType));
55
+ const handleSave = (values) => {
56
+ onSave?.(values);
57
+ };
58
+ return /* @__PURE__ */ import_react2.default.createElement(import_react_ui_form.Form, {
59
+ schema: import_functions2.FunctionTriggerSchema,
60
+ values: trigger,
61
+ onSave: handleSave,
62
+ onCancel,
63
+ Custom: {
64
+ ["function"]: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react_ui_form.SelectInput, {
65
+ ...props,
66
+ options: getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))
67
+ }),
68
+ ["spec.type"]: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react_ui_form.SelectInput, {
69
+ ...props,
70
+ options: Object.values(import_functions2.TriggerKind).map((kind) => ({
71
+ value: kind,
72
+ label: t(`trigger type ${kind}`)
73
+ }))
74
+ }),
75
+ ["meta"]: (props) => {
76
+ const meta = props.getValue();
77
+ (0, import_react2.useEffect)(() => props.onValueChange("object", {
78
+ ...meta
79
+ }), []);
80
+ const [newMetaFieldName, setNewMetaFieldName] = (0, import_react2.useState)("");
81
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("div", null, props.label), [
82
+ ...Object.keys(meta)
83
+ ].map((key) => {
84
+ const compositeKey = `meta.${key}`;
85
+ return /* @__PURE__ */ import_react2.default.createElement("div", {
86
+ key: compositeKey,
87
+ role: "none",
88
+ className: "flex items-center mt-2 gap-1"
89
+ }, /* @__PURE__ */ import_react2.default.createElement("div", {
90
+ role: "none",
91
+ className: "flex-1"
92
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui_form.TextInput, {
93
+ ...props,
94
+ getValue: () => props.getValue()[key],
95
+ type: "string",
96
+ label: key
97
+ })), /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.IconButton, {
98
+ icon: "ph--trash--regular",
99
+ iconOnly: true,
100
+ classNames: "mt-6",
101
+ label: t("trigger meta remove"),
102
+ onClick: () => {
103
+ const newValues = {
104
+ ...props.getValue()
105
+ };
106
+ delete newValues[key];
107
+ props.onValueChange("object", newValues);
108
+ }
109
+ }));
110
+ }), /* @__PURE__ */ import_react2.default.createElement("div", {
111
+ role: "none",
112
+ className: "flex items-center mt-2 gap-1 plb-1"
113
+ }, /* @__PURE__ */ import_react2.default.createElement("div", {
114
+ role: "none",
115
+ className: "flex-1"
116
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Input.Root, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Input.TextInput, {
117
+ placeholder: t("trigger meta prop name placeholder"),
118
+ value: newMetaFieldName,
119
+ onChange: (event) => setNewMetaFieldName(event.target.value)
120
+ }))), /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.IconButton, {
121
+ icon: "ph--plus--regular",
122
+ iconOnly: true,
123
+ label: t("trigger meta add"),
124
+ onClick: () => {
125
+ if (newMetaFieldName.length) {
126
+ const meta2 = props.getValue() ?? {};
127
+ const metaWithNewProp = {
128
+ ...meta2,
129
+ [newMetaFieldName]: ""
130
+ };
131
+ setNewMetaFieldName("");
132
+ props.onValueChange("object", metaWithNewProp);
133
+ }
134
+ }
135
+ })));
136
+ }
137
+ }
138
+ });
139
+ };
140
+ var getWorkflowOptions = (graphs) => {
141
+ return graphs.map((graph) => ({
142
+ label: `compute-${graph.id}`,
143
+ value: `dxn:echo:@:${graph.id}`
144
+ }));
145
+ };
146
+ var getFunctionOptions = (scripts, functions) => {
147
+ const getLabel = (fn) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
148
+ return functions.map((fn) => ({
149
+ label: getLabel(fn),
150
+ value: `dxn:worker:${fn.name}`
151
+ }));
152
+ };
153
+ var grid = "grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]";
154
+ var AutomationPanel = ({ space, object }) => {
155
+ const { t } = (0, import_react_ui.useTranslation)(import_chunk_EQYHOTGG.AUTOMATION_PLUGIN);
156
+ const client = (0, import_react_client.useClient)();
157
+ const triggers = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_functions.FunctionTrigger));
158
+ const functions = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_functions.FunctionType));
159
+ const scripts = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_functions.ScriptType));
160
+ const [trigger, setTrigger] = (0, import_react.useState)();
161
+ const [selected, setSelected] = (0, import_react.useState)();
162
+ const handleSelect = (trigger2) => {
163
+ const { id: _, ...values } = trigger2;
164
+ setTrigger(values);
165
+ setSelected(trigger2);
166
+ };
167
+ const handleAdd = () => {
168
+ setTrigger((0, import_echo.create)(import_functions.FunctionTriggerSchema, {
169
+ meta: {}
170
+ }));
171
+ setSelected(void 0);
172
+ };
173
+ const handleDelete = (trigger2) => {
174
+ space.db.remove(trigger2);
175
+ setTrigger(void 0);
176
+ setSelected(void 0);
177
+ };
178
+ const handleSave = (trigger2) => {
179
+ if (selected) {
180
+ Object.assign(selected, trigger2);
181
+ } else {
182
+ space.db.add((0, import_echo.create)(import_functions.FunctionTrigger, trigger2));
183
+ }
184
+ setTrigger(void 0);
185
+ setSelected(void 0);
186
+ };
187
+ const handleCancel = () => {
188
+ setTrigger(void 0);
189
+ };
190
+ return /* @__PURE__ */ import_react.default.createElement("div", {
191
+ className: "flex flex-col w-full divide-y divide-separator overflow-y-auto"
192
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.Root, {
193
+ items: triggers,
194
+ isItem: import_echo_schema.S.is(import_functions.FunctionTrigger),
195
+ getId: (field) => field.id
196
+ }, ({ items: triggers2 }) => /* @__PURE__ */ import_react.default.createElement("div", {
197
+ role: "list",
198
+ className: "flex flex-col w-full"
199
+ }, triggers2?.map((trigger2) => {
200
+ const copyAction = getCopyAction(client, trigger2);
201
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.Item, {
202
+ key: trigger2.id,
203
+ item: trigger2,
204
+ classNames: (0, import_react_ui_theme.mx)(grid, import_react_ui_theme.ghostHover, "items-center", "px-2")
205
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui.Input.Root, null, /* @__PURE__ */ import_react.default.createElement(import_react_ui.Input.Switch, {
206
+ checked: trigger2.enabled,
207
+ onCheckedChange: (checked) => trigger2.enabled = checked
208
+ })), /* @__PURE__ */ import_react.default.createElement("div", {
209
+ className: "flex"
210
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.ItemTitle, {
211
+ classNames: "px-1 cursor-pointer w-0 shrink truncate",
212
+ onClick: () => handleSelect(trigger2)
213
+ }, getFunctionName(scripts, functions, trigger2) ?? "\u2205"), copyAction && /* @__PURE__ */ import_react.default.createElement(import_react_ui.Button, {
214
+ onClick: () => navigator.clipboard.writeText(copyAction.contentProvider())
215
+ }, t(copyAction.translationKey))), /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.ItemDeleteButton, {
216
+ onClick: () => handleDelete(trigger2)
217
+ }));
218
+ }))), trigger && /* @__PURE__ */ import_react.default.createElement(TriggerEditor, {
219
+ space,
220
+ trigger,
221
+ onSave: handleSave,
222
+ onCancel: handleCancel
223
+ }), !trigger && /* @__PURE__ */ import_react.default.createElement("div", {
224
+ className: "flex p-2 justify-center"
225
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui.IconButton, {
226
+ icon: "ph--plus--regular",
227
+ label: t("new trigger"),
228
+ onClick: handleAdd
229
+ })));
230
+ };
231
+ var getCopyAction = (client, trigger) => {
232
+ if (trigger?.spec?.type === import_functions.TriggerKind.Email) {
233
+ return {
234
+ translationKey: "trigger copy email",
235
+ contentProvider: () => `${(0, import_echo.getSpace)(trigger).id}@dxos.network`
236
+ };
237
+ }
238
+ if (trigger?.spec?.type === import_functions.TriggerKind.Webhook) {
239
+ return {
240
+ translationKey: "trigger copy url",
241
+ contentProvider: () => getWebhookUrl(client, trigger)
242
+ };
243
+ }
244
+ return void 0;
245
+ };
246
+ var getWebhookUrl = (client, trigger) => {
247
+ const spaceId = (0, import_echo.getSpace)(trigger).id;
248
+ const edgeUrl = new URL(client.config.values.runtime.services.edge.url);
249
+ const isSecure = edgeUrl.protocol.startsWith("https") || edgeUrl.protocol.startsWith("wss");
250
+ edgeUrl.protocol = isSecure ? "https" : "http";
251
+ return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();
252
+ };
253
+ var getFunctionName = (scripts, functions, trigger) => {
254
+ const shortId = trigger.function && `${trigger.function?.slice(0, 16)}\u2026`;
255
+ const functionObject = functions.find((fn) => fn.name === trigger.function);
256
+ if (!functionObject) {
257
+ return shortId;
258
+ }
259
+ return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;
260
+ };
261
+ var AutomationPanel_default = AutomationPanel;
262
+ // Annotate the CommonJS export names for ESM import in node:
263
+ 0 && (module.exports = {
264
+ AutomationPanel_default,
265
+ TriggerEditor
266
+ });
267
+ //# sourceMappingURL=chunk-QXIHYOMF.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/AutomationPanel/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport {\n FunctionType,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n type FunctionTriggerType,\n ScriptType,\n} from '@dxos/functions';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';\nimport { IconButton, Input, useTranslation, Button } from '@dxos/react-ui';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';\n\nconst grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';\n\nexport type AutomationPanelProps = {\n space: Space;\n object?: ReactiveObject<any>;\n};\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ space, object }: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const triggers = useQuery(space, Filter.schema(FunctionTrigger));\n const functions = useQuery(space, Filter.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const [trigger, setTrigger] = useState<FunctionTriggerType>();\n const [selected, setSelected] = useState<FunctionTrigger>();\n\n const handleSelect = (trigger: FunctionTrigger) => {\n const { id: _, ...values } = trigger;\n setTrigger(values);\n setSelected(trigger);\n };\n\n const handleAdd = () => {\n setTrigger(create(FunctionTriggerSchema, { meta: {} }));\n setSelected(undefined);\n };\n\n const handleDelete = (trigger: FunctionTrigger) => {\n space.db.remove(trigger);\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleSave: TriggerEditorProps['onSave'] = (trigger) => {\n if (selected) {\n Object.assign(selected, trigger);\n } else {\n space.db.add(create(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n };\n\n return (\n <div className='flex flex-col w-full divide-y divide-separator overflow-y-auto'>\n <List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>\n {({ items: triggers }) => (\n <div role='list' className='flex flex-col w-full'>\n {triggers?.map((trigger) => {\n const copyAction = getCopyAction(client, trigger);\n return (\n <List.Item<FunctionTrigger>\n key={trigger.id}\n item={trigger}\n classNames={mx(grid, ghostHover, 'items-center', 'px-2')}\n >\n <Input.Root>\n <Input.Switch\n checked={trigger.enabled}\n onCheckedChange={(checked) => (trigger.enabled = checked)}\n />\n </Input.Root>\n\n <div className={'flex'}>\n <List.ItemTitle\n classNames='px-1 cursor-pointer w-0 shrink truncate'\n onClick={() => handleSelect(trigger)}\n >\n {getFunctionName(scripts, functions, trigger) ?? '∅'}\n </List.ItemTitle>\n\n {/* TODO: a better way to expose copy action */}\n {copyAction && (\n <Button onClick={() => navigator.clipboard.writeText(copyAction.contentProvider())}>\n {t(copyAction.translationKey)}\n </Button>\n )}\n </div>\n\n <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />\n </List.Item>\n );\n })}\n </div>\n )}\n </List.Root>\n\n {trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}\n\n {!trigger && (\n <div className='flex p-2 justify-center'>\n <IconButton icon='ph--plus--regular' label={t('new trigger')} onClick={handleAdd} />\n </div>\n )}\n </div>\n );\n};\n\nconst getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {\n if (trigger?.spec?.type === TriggerKind.Email) {\n return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };\n }\n\n if (trigger?.spec?.type === TriggerKind.Webhook) {\n return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };\n }\n\n return undefined;\n};\n\nconst getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {\n const spaceId = getSpace(trigger)!.id;\n const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);\n const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');\n edgeUrl.protocol = isSecure ? 'https' : 'http';\n return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();\n};\n\nconst getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {\n const shortId = trigger.function && `${trigger.function?.slice(0, 16)}…`;\n const functionObject = functions.find((fn) => fn.name === trigger.function);\n if (!functionObject) {\n return shortId;\n }\n return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport {\n FunctionType,\n FunctionTriggerSchema,\n type FunctionTriggerType,\n type FunctionTrigger,\n ScriptType,\n TriggerKind,\n} from '@dxos/functions';\nimport { Filter, useQuery, type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { Form, SelectInput, TextInput } from '@dxos/react-ui-form';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTriggerType;\n onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;\n onCancel?: () => void;\n};\n\nexport const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const functions = useQuery(space, Filter.schema(FunctionType));\n const workflows = useQuery(space, Filter.schema(ComputeGraph));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const handleSave = (values: FunctionTriggerType) => {\n onSave?.(values);\n };\n\n return (\n <Form<FunctionTriggerType>\n schema={FunctionTriggerSchema}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n Custom={{\n ['function' satisfies keyof FunctionTriggerType]: (props) => (\n <SelectInput\n {...props}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n ),\n ['spec.type' as const]: (props) => (\n <SelectInput\n {...props}\n options={Object.values(TriggerKind).map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n }))}\n />\n ),\n ['meta' as const]: (props) => {\n const meta = props.getValue()!;\n useEffect(() => props.onValueChange('object', { ...meta }), []);\n const [newMetaFieldName, setNewMetaFieldName] = useState('');\n\n return (\n <>\n <div>{props.label}</div>\n {[...Object.keys(meta)].map((key) => {\n const compositeKey: any = `meta.${key}`;\n return (\n <div key={compositeKey} role='none' className='flex items-center mt-2 gap-1'>\n <div role='none' className='flex-1'>\n <TextInput\n {...props}\n getValue={() => (props.getValue() as any)[key]}\n type={'string'}\n label={key}\n />\n </div>\n <IconButton\n icon='ph--trash--regular'\n iconOnly\n classNames={'mt-6'}\n label={t('trigger meta remove')}\n onClick={() => {\n const newValues: any = { ...props.getValue() };\n delete newValues[key];\n props.onValueChange('object', newValues);\n }}\n />\n </div>\n );\n })}\n <div role='none' className='flex items-center mt-2 gap-1 plb-1'>\n <div role='none' className='flex-1'>\n <Input.Root>\n <Input.TextInput\n placeholder={t('trigger meta prop name placeholder')}\n value={newMetaFieldName}\n onChange={(event) => setNewMetaFieldName(event.target.value)}\n />\n </Input.Root>\n </div>\n <IconButton\n icon='ph--plus--regular'\n iconOnly\n label={t('trigger meta add')}\n onClick={() => {\n if (newMetaFieldName.length) {\n const meta = props.getValue() ?? {};\n const metaWithNewProp = { ...meta, [newMetaFieldName]: '' };\n setNewMetaFieldName('');\n props.onValueChange('object', metaWithNewProp);\n }\n }}\n />\n </div>\n </>\n );\n },\n }}\n />\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {\n const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:worker:${fn.name}` }));\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AutomationPanel } from './AutomationPanel';\n\nexport default AutomationPanel;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAgC;AAEhC,yBAAkB;AAClB,uBAOO;AACP,0BAAuC;AACvC,kBAAoF;AACpF,sBAA0D;AAC1D,2BAAqB;AACrB,4BAA+B;ACf/B,IAAAA,gBAA2C;AAE3C,uBAA6B;AAC7B,IAAAC,oBAOO;AACP,IAAAC,eAA6C;AAC7C,IAAAC,mBAAkD;AAClD,2BAA6C;AAWtC,IAAMC,gBAAgB,CAAC,EAAEC,OAAOC,SAASC,QAAQC,SAAQ,MAAsB;AACpF,QAAM,EAAEC,EAAC,QAAKC,iCAAeC,uCAAAA;AAE7B,QAAMC,gBAAYC,uBAASR,OAAOS,oBAAOC,OAAOC,8BAAAA,CAAAA;AAChD,QAAMC,gBAAYJ,uBAASR,OAAOS,oBAAOC,OAAOG,6BAAAA,CAAAA;AAChD,QAAMC,cAAUN,uBAASR,OAAOS,oBAAOC,OAAOK,4BAAAA,CAAAA;AAE9C,QAAMC,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UAAUC,MAAM,GAAG,EAAA,CAAA;AAClE,QAAMC,iBAAiBpI,UAAU6D,KAAK,CAACD,OAAOA,GAAGI,SAAStE,QAAQwI,QAAQ;AAC1E,MAAI,CAACE,gBAAgB;AACnB,WAAOH;EACT;AACA,SAAO1H,QAAQsD,KAAK,CAACC,MAAMsE,eAAerE,QAAQV,QAAQK,OAAOI,EAAEJ,EAAE,GAAGM,QAAQiE;AAClF;AEtJA,IAAA,0BAAe/D;",
6
+ "names": ["import_react", "import_functions", "import_echo", "import_react_ui", "TriggerEditor", "space", "trigger", "onSave", "onCancel", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "schema", "FunctionType", "workflows", "ComputeGraph", "scripts", "ScriptType", "handleSave", "values", "React", "Form", "FunctionTriggerSchema", "Custom", "props", "SelectInput", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "Object", "TriggerKind", "map", "kind", "value", "label", "meta", "getValue", "useEffect", "onValueChange", "newMetaFieldName", "setNewMetaFieldName", "useState", "div", "keys", "key", "compositeKey", "role", "className", "TextInput", "type", "IconButton", "icon", "iconOnly", "classNames", "onClick", "newValues", "Input", "Root", "placeholder", "onChange", "event", "target", "length", "metaWithNewProp", "graphs", "graph", "id", "getLabel", "fn", "find", "s", "source", "name", "grid", "AutomationPanel", "object", "client", "useClient", "triggers", "FunctionTrigger", "setTrigger", "selected", "setSelected", "handleSelect", "_", "handleAdd", "create", "undefined", "handleDelete", "db", "remove", "assign", "add", "handleCancel", "List", "items", "isItem", "S", "is", "getId", "field", "copyAction", "getCopyAction", "Item", "item", "mx", "ghostHover", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "getFunctionName", "Button", "navigator", "clipboard", "writeText", "contentProvider", "translationKey", "ItemDeleteButton", "spec", "Email", "getSpace", "Webhook", "getWebhookUrl", "spaceId", "edgeUrl", "URL", "config", "runtime", "services", "edge", "url", "isSecure", "protocol", "startsWith", "toString", "shortId", "function", "slice", "functionObject"]
7
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_U5Z7LFWB_exports = {};
20
+ __export(chunk_U5Z7LFWB_exports, {
21
+ AutomationCapabilities: () => AutomationCapabilities
22
+ });
23
+ module.exports = __toCommonJS(chunk_U5Z7LFWB_exports);
24
+ var import_chunk_EQYHOTGG = require("./chunk-EQYHOTGG.cjs");
25
+ var import_app_framework = require("@dxos/app-framework");
26
+ var AutomationCapabilities;
27
+ (function(AutomationCapabilities2) {
28
+ AutomationCapabilities2.AiClient = (0, import_app_framework.defineCapability)(`${import_chunk_EQYHOTGG.AUTOMATION_PLUGIN}/capability/ai-client`);
29
+ })(AutomationCapabilities || (AutomationCapabilities = {}));
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ AutomationCapabilities
33
+ });
34
+ //# sourceMappingURL=chunk-U5Z7LFWB.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/capabilities.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type AIServiceClientImpl } from '@dxos/assistant';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport namespace AutomationCapabilities {\n export const AiClient = defineCapability<AIServiceClientImpl>(`${AUTOMATION_PLUGIN}/capability/ai-client`);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAiC;;UAKhBA,yBAAAA;0BACFC,eAAWC,uCAAsC,GAAGC,uCAAAA,uBAAwC;AAC3G,GAFiBH,2BAAAA,yBAAAA,CAAAA,EAAAA;",
6
+ "names": ["AutomationCapabilities", "AiClient", "defineCapability", "AUTOMATION_PLUGIN"]
7
+ }