@dxos/plugin-automation 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77

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 (175) hide show
  1. package/dist/lib/browser/AutomationPanel-4QA5G3ZY.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-6XLG2PCK.mjs +69 -0
  3. package/dist/lib/browser/AutomationSettings-6XLG2PCK.mjs.map +7 -0
  4. package/dist/lib/browser/{FunctionsContainer-IOB333TX.mjs → FunctionsContainer-BQ6VBDIG.mjs} +9 -12
  5. package/dist/lib/browser/FunctionsContainer-BQ6VBDIG.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs → FunctionsPanel-QBTOFFNU.mjs} +3 -3
  7. package/dist/lib/browser/{app-graph-builder-ZTAUTFI4.mjs → app-graph-builder-6TP6ZNYG.mjs} +8 -8
  8. package/dist/lib/browser/app-graph-builder-6TP6ZNYG.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-BDJPBZGC.mjs +14 -0
  10. package/dist/lib/browser/chunk-BDJPBZGC.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-LYJVTIVD.mjs → chunk-EAQL33PI.mjs} +5 -5
  12. package/dist/lib/browser/chunk-EAQL33PI.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-HN7OHFCB.mjs → chunk-F4K5EMWL.mjs} +2 -2
  14. package/dist/lib/browser/{chunk-FSJZXTS2.mjs → chunk-IN2YC7NY.mjs} +18 -18
  15. package/dist/lib/browser/chunk-IN2YC7NY.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-ERTIGJYE.mjs → chunk-LNMCGQC2.mjs} +14 -18
  17. package/dist/lib/browser/chunk-LNMCGQC2.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-M2WQCY2T.mjs +53 -0
  19. package/dist/lib/browser/chunk-M2WQCY2T.mjs.map +7 -0
  20. package/dist/lib/browser/chunk-U66KBK53.mjs +14 -0
  21. package/dist/lib/browser/chunk-U66KBK53.mjs.map +7 -0
  22. package/dist/lib/browser/{chunk-GW5U2DGT.mjs → chunk-WWURMV25.mjs} +2 -4
  23. package/dist/lib/browser/chunk-WWURMV25.mjs.map +7 -0
  24. package/dist/lib/browser/chunk-ZTXBAXUT.mjs +15 -0
  25. package/dist/lib/browser/chunk-ZTXBAXUT.mjs.map +7 -0
  26. package/dist/lib/browser/compute-runtime-OFQPXD5I.mjs +158 -0
  27. package/dist/lib/browser/compute-runtime-OFQPXD5I.mjs.map +7 -0
  28. package/dist/lib/browser/hooks/index.mjs +12 -0
  29. package/dist/lib/browser/index.mjs +25 -16
  30. package/dist/lib/browser/index.mjs.map +4 -4
  31. package/dist/lib/browser/{intent-resolver-U3ZAQEFW.mjs → intent-resolver-JXVWRAAH.mjs} +11 -10
  32. package/dist/lib/browser/intent-resolver-JXVWRAAH.mjs.map +7 -0
  33. package/dist/lib/browser/meta.json +1 -1
  34. package/dist/lib/browser/{react-surface-4DFSM7OX.mjs → react-surface-NG3MJCDH.mjs} +17 -17
  35. package/dist/lib/browser/react-surface-NG3MJCDH.mjs.map +7 -0
  36. package/dist/lib/browser/types/index.mjs +2 -2
  37. package/dist/lib/node-esm/{AutomationPanel-YYUMSK2W.mjs → AutomationPanel-WMVR3IST.mjs} +4 -4
  38. package/dist/lib/node-esm/AutomationSettings-4IW7RGMN.mjs +70 -0
  39. package/dist/lib/node-esm/AutomationSettings-4IW7RGMN.mjs.map +7 -0
  40. package/dist/lib/node-esm/{FunctionsContainer-DJWB6WFH.mjs → FunctionsContainer-LHUUOLA5.mjs} +9 -12
  41. package/dist/lib/node-esm/FunctionsContainer-LHUUOLA5.mjs.map +7 -0
  42. package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs → FunctionsPanel-SHTQIMDV.mjs} +3 -3
  43. package/dist/lib/node-esm/FunctionsPanel-SHTQIMDV.mjs.map +7 -0
  44. package/dist/lib/node-esm/{app-graph-builder-3FP63ZSG.mjs → app-graph-builder-3A2NIPR5.mjs} +8 -8
  45. package/dist/lib/node-esm/app-graph-builder-3A2NIPR5.mjs.map +7 -0
  46. package/dist/lib/node-esm/chunk-2L2X4JMP.mjs +16 -0
  47. package/dist/lib/node-esm/chunk-2L2X4JMP.mjs.map +7 -0
  48. package/dist/lib/node-esm/{chunk-NK5N3QKD.mjs → chunk-5MQJPJR2.mjs} +2 -4
  49. package/dist/lib/node-esm/chunk-5MQJPJR2.mjs.map +7 -0
  50. package/dist/lib/node-esm/chunk-B6O6UBS7.mjs +16 -0
  51. package/dist/lib/node-esm/chunk-B6O6UBS7.mjs.map +7 -0
  52. package/dist/lib/node-esm/{chunk-OEZNHUL2.mjs → chunk-CEWZ2CDM.mjs} +2 -2
  53. package/dist/lib/node-esm/chunk-DSEZPWSO.mjs +54 -0
  54. package/dist/lib/node-esm/chunk-DSEZPWSO.mjs.map +7 -0
  55. package/dist/lib/node-esm/{chunk-HIMYPGHF.mjs → chunk-MN5S5J4O.mjs} +14 -18
  56. package/dist/lib/node-esm/chunk-MN5S5J4O.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-AZH66CED.mjs → chunk-N7NES6SZ.mjs} +18 -18
  58. package/dist/lib/node-esm/chunk-N7NES6SZ.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-ZGPUV5VS.mjs → chunk-PBULJE4B.mjs} +5 -5
  60. package/dist/lib/node-esm/chunk-PBULJE4B.mjs.map +7 -0
  61. package/dist/lib/node-esm/chunk-UTZIMYCX.mjs +16 -0
  62. package/dist/lib/node-esm/chunk-UTZIMYCX.mjs.map +7 -0
  63. package/dist/lib/node-esm/compute-runtime-W5UJNSQY.mjs +159 -0
  64. package/dist/lib/node-esm/compute-runtime-W5UJNSQY.mjs.map +7 -0
  65. package/dist/lib/node-esm/hooks/index.mjs +13 -0
  66. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  67. package/dist/lib/node-esm/index.mjs +25 -16
  68. package/dist/lib/node-esm/index.mjs.map +4 -4
  69. package/dist/lib/node-esm/{intent-resolver-3QWXEBPX.mjs → intent-resolver-ROEBZXSS.mjs} +11 -10
  70. package/dist/lib/node-esm/intent-resolver-ROEBZXSS.mjs.map +7 -0
  71. package/dist/lib/node-esm/meta.json +1 -1
  72. package/dist/lib/node-esm/{react-surface-3PNW7NDW.mjs → react-surface-A4KTYX6Z.mjs} +17 -17
  73. package/dist/lib/node-esm/react-surface-A4KTYX6Z.mjs.map +7 -0
  74. package/dist/lib/node-esm/types/index.mjs +2 -2
  75. package/dist/types/src/AutomationPlugin.d.ts +1 -1
  76. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  78. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/capabilities.d.ts +18 -0
  80. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
  82. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/index.d.ts +5 -3
  84. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  86. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  88. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -5
  89. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  90. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -4
  91. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  92. package/dist/types/src/components/AutomationSettings.d.ts +5 -0
  93. package/dist/types/src/components/AutomationSettings.d.ts.map +1 -0
  94. package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
  95. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  96. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  97. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +2 -2
  98. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  99. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +45 -4
  100. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  101. package/dist/types/src/components/TriggerSettings.d.ts +6 -0
  102. package/dist/types/src/components/TriggerSettings.d.ts.map +1 -0
  103. package/dist/types/src/components/index.d.ts +2 -2
  104. package/dist/types/src/components/index.d.ts.map +1 -1
  105. package/dist/types/src/hooks/index.d.ts +3 -0
  106. package/dist/types/src/hooks/index.d.ts.map +1 -0
  107. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
  108. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
  109. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +11 -0
  110. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  111. package/dist/types/src/index.d.ts +1 -0
  112. package/dist/types/src/index.d.ts.map +1 -1
  113. package/dist/types/src/meta.d.ts +0 -1
  114. package/dist/types/src/meta.d.ts.map +1 -1
  115. package/dist/types/src/translations.d.ts +2 -0
  116. package/dist/types/src/translations.d.ts.map +1 -1
  117. package/dist/types/tsconfig.tsbuildinfo +1 -1
  118. package/package.json +60 -41
  119. package/src/AutomationPlugin.tsx +35 -31
  120. package/src/capabilities/app-graph-builder.ts +5 -5
  121. package/src/capabilities/capabilities.ts +47 -0
  122. package/src/capabilities/compute-runtime.ts +136 -0
  123. package/src/capabilities/index.ts +3 -0
  124. package/src/capabilities/intent-resolver.ts +7 -7
  125. package/src/capabilities/react-surface.tsx +11 -11
  126. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +13 -13
  127. package/src/components/AutomationPanel/AutomationPanel.tsx +17 -29
  128. package/src/components/AutomationSettings.tsx +30 -0
  129. package/src/components/FunctionsContainer.tsx +11 -13
  130. package/src/components/FunctionsPanel/FunctionsPanel.tsx +4 -4
  131. package/src/components/TriggerEditor/SpecSelector.tsx +16 -16
  132. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +15 -14
  133. package/src/components/TriggerEditor/TriggerEditor.tsx +6 -12
  134. package/src/components/TriggerSettings.tsx +25 -0
  135. package/src/components/index.ts +1 -1
  136. package/src/hooks/index.ts +6 -0
  137. package/src/hooks/useComputeRuntimeCallback.ts +30 -0
  138. package/src/hooks/useTriggerRuntimeControls.ts +52 -0
  139. package/src/index.ts +1 -0
  140. package/src/meta.ts +1 -3
  141. package/src/translations.ts +4 -0
  142. package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs +0 -38
  143. package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs.map +0 -7
  144. package/dist/lib/browser/AutomationPanel-ZWA6GOFY.mjs +0 -11
  145. package/dist/lib/browser/FunctionsContainer-IOB333TX.mjs.map +0 -7
  146. package/dist/lib/browser/app-graph-builder-ZTAUTFI4.mjs.map +0 -7
  147. package/dist/lib/browser/chunk-ECSTS2UI.mjs +0 -14
  148. package/dist/lib/browser/chunk-ECSTS2UI.mjs.map +0 -7
  149. package/dist/lib/browser/chunk-ERTIGJYE.mjs.map +0 -7
  150. package/dist/lib/browser/chunk-FSJZXTS2.mjs.map +0 -7
  151. package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
  152. package/dist/lib/browser/chunk-LYJVTIVD.mjs.map +0 -7
  153. package/dist/lib/browser/intent-resolver-U3ZAQEFW.mjs.map +0 -7
  154. package/dist/lib/browser/react-surface-4DFSM7OX.mjs.map +0 -7
  155. package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs +0 -39
  156. package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs.map +0 -7
  157. package/dist/lib/node-esm/FunctionsContainer-DJWB6WFH.mjs.map +0 -7
  158. package/dist/lib/node-esm/app-graph-builder-3FP63ZSG.mjs.map +0 -7
  159. package/dist/lib/node-esm/chunk-AZH66CED.mjs.map +0 -7
  160. package/dist/lib/node-esm/chunk-HIMYPGHF.mjs.map +0 -7
  161. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
  162. package/dist/lib/node-esm/chunk-SGZPTJ47.mjs +0 -16
  163. package/dist/lib/node-esm/chunk-SGZPTJ47.mjs.map +0 -7
  164. package/dist/lib/node-esm/chunk-ZGPUV5VS.mjs.map +0 -7
  165. package/dist/lib/node-esm/intent-resolver-3QWXEBPX.mjs.map +0 -7
  166. package/dist/lib/node-esm/react-surface-3PNW7NDW.mjs.map +0 -7
  167. package/dist/types/src/components/AutomationContainer.d.ts +0 -5
  168. package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
  169. package/src/components/AutomationContainer.tsx +0 -30
  170. /package/dist/lib/browser/{AutomationPanel-ZWA6GOFY.mjs.map → AutomationPanel-4QA5G3ZY.mjs.map} +0 -0
  171. /package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs.map → FunctionsPanel-QBTOFFNU.mjs.map} +0 -0
  172. /package/dist/lib/browser/{chunk-HN7OHFCB.mjs.map → chunk-F4K5EMWL.mjs.map} +0 -0
  173. /package/dist/lib/{node-esm/AutomationPanel-YYUMSK2W.mjs.map → browser/hooks/index.mjs.map} +0 -0
  174. /package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs.map → AutomationPanel-WMVR3IST.mjs.map} +0 -0
  175. /package/dist/lib/node-esm/{chunk-OEZNHUL2.mjs.map → chunk-CEWZ2CDM.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-automation",
3
- "version": "0.8.4-main.67995b8",
3
+ "version": "0.8.4-main.a4bbb77",
4
4
  "description": "Prompt chain plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,21 +10,34 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
15
  "browser": "./dist/lib/browser/index.mjs",
15
- "node": "./dist/lib/node-esm/index.mjs",
16
- "source": "./src/index.ts"
16
+ "node": "./dist/lib/node-esm/index.mjs"
17
+ },
18
+ "./hooks": {
19
+ "source": "./src/hooks/index.ts",
20
+ "types": "./dist/types/src/hooks/index.d.ts",
21
+ "browser": "./dist/lib/browser/hooks/index.mjs",
22
+ "node": "./dist/lib/node-esm/hooks/index.mjs"
17
23
  },
18
24
  "./types": {
25
+ "source": "./src/types/index.ts",
19
26
  "types": "./dist/types/src/types/index.d.ts",
20
27
  "browser": "./dist/lib/browser/types/index.mjs",
21
- "node": "./dist/lib/node-esm/types/index.mjs",
22
- "source": "./src/types/index.ts"
28
+ "node": "./dist/lib/node-esm/types/index.mjs"
23
29
  }
24
30
  },
25
31
  "types": "dist/types/src/index.d.ts",
26
32
  "typesVersions": {
27
- "*": {}
33
+ "*": {
34
+ "hooks": [
35
+ "dist/types/src/hooks/index.d.ts"
36
+ ],
37
+ "types": [
38
+ "dist/types/src/types/index.d.ts"
39
+ ]
40
+ }
28
41
  },
29
42
  "files": [
30
43
  "assets",
@@ -32,49 +45,55 @@
32
45
  "src"
33
46
  ],
34
47
  "dependencies": {
48
+ "@effect/ai": "0.29.1",
49
+ "@effect/platform-browser": "0.72.0",
35
50
  "@preact-signals/safe-react": "^0.9.0",
36
- "@preact/signals-core": "^1.9.0",
37
- "@dxos/app-framework": "0.8.4-main.67995b8",
38
- "@dxos/async": "0.8.4-main.67995b8",
39
- "@dxos/conductor": "0.8.4-main.67995b8",
40
- "@dxos/echo": "0.8.4-main.67995b8",
41
- "@dxos/functions": "0.8.4-main.67995b8",
42
- "@dxos/echo-schema": "0.8.4-main.67995b8",
43
- "@dxos/live-object": "0.8.4-main.67995b8",
44
- "@dxos/log": "0.8.4-main.67995b8",
45
- "@dxos/plugin-client": "0.8.4-main.67995b8",
46
- "@dxos/invariant": "0.8.4-main.67995b8",
47
- "@dxos/plugin-deck": "0.8.4-main.67995b8",
48
- "@dxos/plugin-graph": "0.8.4-main.67995b8",
49
- "@dxos/plugin-space": "0.8.4-main.67995b8",
50
- "@dxos/random": "0.8.4-main.67995b8",
51
- "@dxos/react-ui-form": "0.8.4-main.67995b8",
52
- "@dxos/react-client": "0.8.4-main.67995b8",
53
- "@dxos/react-ui-list": "0.8.4-main.67995b8",
54
- "@dxos/util": "0.8.4-main.67995b8",
55
- "@dxos/react-ui-stack": "0.8.4-main.67995b8"
51
+ "@preact/signals-core": "^1.12.1",
52
+ "@dxos/ai": "0.8.4-main.a4bbb77",
53
+ "@dxos/app-framework": "0.8.4-main.a4bbb77",
54
+ "@dxos/assistant": "0.8.4-main.a4bbb77",
55
+ "@dxos/async": "0.8.4-main.a4bbb77",
56
+ "@dxos/conductor": "0.8.4-main.a4bbb77",
57
+ "@dxos/echo": "0.8.4-main.a4bbb77",
58
+ "@dxos/keys": "0.8.4-main.a4bbb77",
59
+ "@dxos/echo-schema": "0.8.4-main.a4bbb77",
60
+ "@dxos/functions": "0.8.4-main.a4bbb77",
61
+ "@dxos/log": "0.8.4-main.a4bbb77",
62
+ "@dxos/invariant": "0.8.4-main.a4bbb77",
63
+ "@dxos/live-object": "0.8.4-main.a4bbb77",
64
+ "@dxos/plugin-client": "0.8.4-main.a4bbb77",
65
+ "@dxos/plugin-deck": "0.8.4-main.a4bbb77",
66
+ "@dxos/plugin-space": "0.8.4-main.a4bbb77",
67
+ "@dxos/random": "0.8.4-main.a4bbb77",
68
+ "@dxos/plugin-graph": "0.8.4-main.a4bbb77",
69
+ "@dxos/context": "0.8.4-main.a4bbb77",
70
+ "@dxos/react-ui-form": "0.8.4-main.a4bbb77",
71
+ "@dxos/react-client": "0.8.4-main.a4bbb77",
72
+ "@dxos/react-ui-list": "0.8.4-main.a4bbb77",
73
+ "@dxos/react-ui-stack": "0.8.4-main.a4bbb77",
74
+ "@dxos/util": "0.8.4-main.a4bbb77"
56
75
  },
57
76
  "devDependencies": {
58
- "@effect-rx/rx-react": "0.38.0",
59
- "@effect/platform": "0.89.0",
60
- "@types/react": "~18.2.0",
61
- "@types/react-dom": "~18.2.0",
62
- "effect": "3.17.0",
63
- "react": "~18.2.0",
64
- "react-dom": "~18.2.0",
65
- "vite": "5.4.7",
66
- "@dxos/react-ui": "0.8.4-main.67995b8",
67
- "@dxos/react-ui-theme": "0.8.4-main.67995b8",
68
- "@dxos/storybook-utils": "0.8.4-main.67995b8"
77
+ "@effect-rx/rx-react": "0.42.4",
78
+ "@effect/platform": "0.92.1",
79
+ "@types/react": "~19.2.0",
80
+ "@types/react-dom": "~19.2.0",
81
+ "effect": "3.18.3",
82
+ "react": "~19.2.0",
83
+ "react-dom": "~19.2.0",
84
+ "vite": "7.1.9",
85
+ "@dxos/react-ui": "0.8.4-main.a4bbb77",
86
+ "@dxos/react-ui-theme": "0.8.4-main.a4bbb77",
87
+ "@dxos/storybook-utils": "0.8.4-main.a4bbb77"
69
88
  },
70
89
  "peerDependencies": {
71
90
  "@effect-rx/rx-react": "^0.34.1",
72
91
  "@effect/platform": "^0.80.12",
73
92
  "effect": "^3.13.3",
74
- "react": "~18.2.0",
75
- "react-dom": "~18.2.0",
76
- "@dxos/react-ui": "0.8.4-main.67995b8",
77
- "@dxos/react-ui-theme": "0.8.4-main.67995b8"
93
+ "react": "^19.0.0",
94
+ "react-dom": "^19.0.0",
95
+ "@dxos/react-ui": "0.8.4-main.a4bbb77",
96
+ "@dxos/react-ui-theme": "0.8.4-main.a4bbb77"
78
97
  },
79
98
  "publishConfig": {
80
99
  "access": "public"
@@ -2,39 +2,43 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';
6
- import { FunctionType, FunctionTrigger } from '@dxos/functions';
5
+ import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
6
+ import { FunctionTrigger, FunctionType } from '@dxos/functions';
7
7
  import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
8
8
 
9
- import { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';
9
+ import { AppGraphBuilder, ComputeRuntime, IntentResolver, ReactSurface } from './capabilities';
10
10
  import { meta } from './meta';
11
11
  import { translations } from './translations';
12
12
 
13
- export const AutomationPlugin = () =>
14
- definePlugin(meta, [
15
- defineModule({
16
- id: `${meta.id}/module/translations`,
17
- activatesOn: Events.SetupTranslations,
18
- activate: () => contributes(Capabilities.Translations, translations),
19
- }),
20
- defineModule({
21
- id: `${meta.id}/module/schema`,
22
- activatesOn: ClientEvents.SetupSchema,
23
- activate: () => contributes(ClientCapabilities.Schema, [FunctionType, FunctionTrigger]),
24
- }),
25
- defineModule({
26
- id: `${meta.id}/module/app-graph-builder`,
27
- activatesOn: Events.SetupAppGraph,
28
- activate: AppGraphBuilder,
29
- }),
30
- defineModule({
31
- id: `${meta.id}/module/intent-resolver`,
32
- activatesOn: Events.SetupIntentResolver,
33
- activate: IntentResolver,
34
- }),
35
- defineModule({
36
- id: `${meta.id}/module/react-surface`,
37
- activatesOn: Events.SetupReactSurface,
38
- activate: ReactSurface,
39
- }),
40
- ]);
13
+ export const AutomationPlugin = definePlugin(meta, () => [
14
+ defineModule({
15
+ id: `${meta.id}/module/translations`,
16
+ activatesOn: Events.SetupTranslations,
17
+ activate: () => contributes(Capabilities.Translations, translations),
18
+ }),
19
+ defineModule({
20
+ id: `${meta.id}/module/schema`,
21
+ activatesOn: ClientEvents.SetupSchema,
22
+ activate: () => contributes(ClientCapabilities.Schema, [FunctionType, FunctionTrigger]),
23
+ }),
24
+ defineModule({
25
+ id: `${meta.id}/module/app-graph-builder`,
26
+ activatesOn: Events.SetupAppGraph,
27
+ activate: AppGraphBuilder,
28
+ }),
29
+ defineModule({
30
+ id: `${meta.id}/module/intent-resolver`,
31
+ activatesOn: Events.SetupIntentResolver,
32
+ activate: IntentResolver,
33
+ }),
34
+ defineModule({
35
+ id: `${meta.id}/module/react-surface`,
36
+ activatesOn: Events.SetupReactSurface,
37
+ activate: ReactSurface,
38
+ }),
39
+ defineModule({
40
+ id: `${meta.id}/module/compute-runtime`,
41
+ activatesOn: ClientEvents.ClientReady,
42
+ activate: ComputeRuntime,
43
+ }),
44
+ ]);
@@ -5,12 +5,12 @@
5
5
  import { Rx } from '@effect-rx/rx-react';
6
6
  import { Option, pipe } from 'effect';
7
7
 
8
- import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
8
+ import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
9
9
  import { Obj } from '@dxos/echo';
10
10
  import { ScriptType } from '@dxos/functions';
11
- import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
11
+ import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
12
12
  import { createExtension } from '@dxos/plugin-graph';
13
- import { SPACE_PLUGIN } from '@dxos/plugin-space';
13
+ import { meta as spaceMeta } from '@dxos/plugin-space';
14
14
 
15
15
  import { meta } from '../meta';
16
16
 
@@ -22,7 +22,7 @@ export default (context: PluginContext) =>
22
22
  Rx.make((get) =>
23
23
  pipe(
24
24
  get(node),
25
- Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),
25
+ Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
26
26
  Option.map((node) => [
27
27
  {
28
28
  id: `automation-${node.id}`,
@@ -44,7 +44,7 @@ export default (context: PluginContext) =>
44
44
  Rx.make((get) =>
45
45
  pipe(
46
46
  get(node),
47
- Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),
47
+ Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
48
48
  Option.map((node) => [
49
49
  {
50
50
  id: `functions-${node.id}`,
@@ -0,0 +1,47 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ManagedRuntime } from 'effect';
6
+
7
+ import { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
8
+ import { defineCapability } from '@dxos/app-framework';
9
+ import type {
10
+ CredentialsService,
11
+ DatabaseService,
12
+ FunctionInvocationService,
13
+ InvocationTracer,
14
+ QueueService,
15
+ TriggerDispatcher,
16
+ TriggerStateStore,
17
+ } from '@dxos/functions';
18
+ import type { SpaceId } from '@dxos/keys';
19
+
20
+ import { meta } from '../meta';
21
+
22
+ export namespace AutomationCapabilities {
23
+ /**
24
+ * Service stack for executing agents, functions, and triggers.
25
+ */
26
+ export type ComputeServices =
27
+ | TriggerDispatcher
28
+ | AiService.AiService
29
+ | DatabaseService
30
+ | QueueService
31
+ | CredentialsService
32
+ | FunctionInvocationService
33
+ | InvocationTracer
34
+ | TriggerStateStore
35
+ // TODO(dmaretskyi): Those should be provided at AI-chat call site.
36
+ | ToolResolverService
37
+ | ToolExecutionService;
38
+
39
+ export interface ComputeRuntimeProvider {
40
+ getRuntime(spaceId: SpaceId): ManagedRuntime.ManagedRuntime<ComputeServices, never>;
41
+ }
42
+
43
+ /**
44
+ * Runtime for executing agents, functions, and triggers.
45
+ */
46
+ export const ComputeRuntime = defineCapability<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);
47
+ }
@@ -0,0 +1,136 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Toolkit } from '@effect/ai';
6
+ import { BrowserKeyValueStore } from '@effect/platform-browser';
7
+ import { Effect, Layer, ManagedRuntime } from 'effect';
8
+
9
+ import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
10
+ import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
11
+ import { Resource } from '@dxos/context';
12
+ import { Query, Ref } from '@dxos/echo';
13
+ import {
14
+ CredentialsService,
15
+ DatabaseService,
16
+ FunctionImplementationResolver,
17
+ FunctionInvocationService,
18
+ InvocationTracer,
19
+ LocalFunctionExecutionService,
20
+ QueueService,
21
+ RemoteFunctionExecutionService,
22
+ TriggerDispatcher,
23
+ } from '@dxos/functions';
24
+ import { TriggerStateStore } from '@dxos/functions';
25
+ import { invariant } from '@dxos/invariant';
26
+ import { type SpaceId } from '@dxos/keys';
27
+ import { ClientCapabilities } from '@dxos/plugin-client';
28
+ import { PropertiesType } from '@dxos/react-client/echo';
29
+
30
+ import { AutomationCapabilities } from './capabilities';
31
+
32
+ export default async (context: PluginContext) => {
33
+ const provider = await new ComputeRuntimeProviderImpl(context).open();
34
+ return contributes(AutomationCapabilities.ComputeRuntime, provider, async () => {
35
+ await provider.close();
36
+ });
37
+ };
38
+
39
+ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilities.ComputeRuntimeProvider {
40
+ readonly #runtimes = new Map<SpaceId, ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>>();
41
+ readonly #context: PluginContext;
42
+
43
+ constructor(context: PluginContext) {
44
+ super();
45
+ this.#context = context;
46
+ }
47
+
48
+ protected override async _open() {}
49
+
50
+ protected override async _close() {
51
+ await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));
52
+ this.#runtimes.clear();
53
+ }
54
+
55
+ getRuntime(spaceId: SpaceId): ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never> {
56
+ if (this.#runtimes.has(spaceId)) {
57
+ return this.#runtimes.get(spaceId)!;
58
+ }
59
+
60
+ const layer = Layer.unwrapEffect(
61
+ Effect.gen(this, function* () {
62
+ const client = this.#context.getCapability(ClientCapabilities.Client);
63
+ const serviceLayer =
64
+ this.#context.getCapability(Capabilities.AiServiceLayer) ?? Layer.die('AiService not found');
65
+
66
+ // TODO(dmaretskyi): Make those reactive.
67
+ const functions = this.#context.getCapabilities(Capabilities.Functions);
68
+ const toolkits = this.#context.getCapabilities(Capabilities.Toolkit);
69
+ const handlers = this.#context.getCapabilities(Capabilities.ToolkitHandler);
70
+
71
+ const allFunctions = functions.flat();
72
+ // TODO(wittjosiah): Don't cast.
73
+ const toolkit = Toolkit.merge(...toolkits) as Toolkit.Toolkit<any>;
74
+ const handlersLayer = Layer.mergeAll(Layer.empty, ...handlers);
75
+
76
+ const space = client.spaces.get(spaceId);
77
+ invariant(space);
78
+ yield* Effect.promise(() => space.waitUntilReady());
79
+
80
+ return Layer.mergeAll(TriggerDispatcher.layer({ timeControl: 'natural' })).pipe(
81
+ Layer.provideMerge(
82
+ Layer.mergeAll(
83
+ InvocationTracerLive,
84
+ TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
85
+ makeToolResolverFromFunctions(allFunctions, toolkit),
86
+ makeToolExecutionServiceFromFunctions(toolkit, handlersLayer),
87
+ ),
88
+ ),
89
+ Layer.provideMerge(
90
+ Layer.mergeAll(
91
+ FunctionInvocationService.layer.pipe(
92
+ Layer.provideMerge(
93
+ LocalFunctionExecutionService.layerLive.pipe(
94
+ Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: allFunctions })),
95
+ Layer.provideMerge(
96
+ RemoteFunctionExecutionService.fromClient(
97
+ client.edge.baseUrl,
98
+ // If agent is not enabled do not provide spaceId because space context will be unavailable on EDGE.
99
+ client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,
100
+ ),
101
+ ),
102
+ Layer.provideMerge(serviceLayer),
103
+ Layer.provideMerge(CredentialsService.layerFromDatabase()),
104
+ Layer.provideMerge(space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable),
105
+ Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
106
+ ),
107
+ ),
108
+ ),
109
+ ),
110
+ ),
111
+ );
112
+ }),
113
+ );
114
+
115
+ const runtime = ManagedRuntime.make(layer);
116
+ this.#runtimes.set(spaceId, runtime);
117
+
118
+ return runtime;
119
+ }
120
+ }
121
+
122
+ const InvocationTracerLive = Layer.unwrapEffect(
123
+ Effect.gen(function* () {
124
+ const {
125
+ objects: [properties],
126
+ } = yield* DatabaseService.runQuery(Query.type(PropertiesType));
127
+ invariant(properties);
128
+ if (!properties.invocationTraceQueue) {
129
+ const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });
130
+ properties.invocationTraceQueue = Ref.fromDXN(queue.dxn);
131
+ }
132
+ const queue = properties.invocationTraceQueue.target;
133
+ invariant(queue);
134
+ return InvocationTracer.layerLive({ invocationTraceQueue: queue });
135
+ }),
136
+ );
@@ -5,5 +5,8 @@
5
5
  import { lazy } from '@dxos/app-framework';
6
6
 
7
7
  export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
8
+ export const ComputeRuntime = lazy(() => import('./compute-runtime'));
8
9
  export const IntentResolver = lazy(() => import('./intent-resolver'));
9
10
  export const ReactSurface = lazy(() => import('./react-surface'));
11
+
12
+ export * from './capabilities';
@@ -3,15 +3,15 @@
3
3
  //
4
4
 
5
5
  import {
6
- contributes,
7
6
  Capabilities,
8
- createResolver,
7
+ LayoutAction,
9
8
  type PluginContext,
9
+ contributes,
10
10
  createIntent,
11
- LayoutAction,
11
+ createResolver,
12
12
  } from '@dxos/app-framework';
13
13
  import { Obj, Ref } from '@dxos/echo';
14
- import { FunctionTrigger, FunctionType, ScriptType, TriggerKind } from '@dxos/functions';
14
+ import { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';
15
15
  import { type DXN } from '@dxos/keys';
16
16
  import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
17
17
  import { SpaceAction } from '@dxos/plugin-space/types';
@@ -43,11 +43,11 @@ export default (context: PluginContext) =>
43
43
 
44
44
  switch (template.type) {
45
45
  case 'timer': {
46
- trigger.spec = { kind: TriggerKind.Timer, cron: template.cron };
46
+ trigger.spec = { kind: 'timer', cron: template.cron };
47
47
  break;
48
48
  }
49
49
  case 'queue': {
50
- trigger.spec = { kind: TriggerKind.Queue, queue: (template.queueDXN as DXN).toString() };
50
+ trigger.spec = { kind: 'queue', queue: (template.queueDXN as DXN).toString() };
51
51
  break;
52
52
  }
53
53
  default: {
@@ -57,7 +57,7 @@ export default (context: PluginContext) =>
57
57
 
58
58
  return {
59
59
  intents: [
60
- createIntent(SpaceAction.AddObject, { object: trigger, target: space }),
60
+ createIntent(SpaceAction.AddObject, { object: trigger, target: space, hidden: true }),
61
61
  createIntent(LayoutAction.Open, {
62
62
  part: 'main',
63
63
  subject: [`automation-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],
@@ -9,39 +9,39 @@ import { Obj } from '@dxos/echo';
9
9
  import { ScriptType } from '@dxos/functions';
10
10
  import { getSpace, parseId, useSpace } from '@dxos/react-client/echo';
11
11
 
12
- import { AutomationContainer, FunctionsContainer } from '../components';
12
+ import { AutomationSettings, FunctionsContainer } from '../components';
13
13
  import { meta } from '../meta';
14
14
 
15
15
  export default () =>
16
16
  contributes(Capabilities.ReactSurface, [
17
17
  createSurface({
18
- id: `${meta.id}/space-settings-automation`,
18
+ id: `${meta.id}/space-settings-functions`,
19
19
  role: 'article',
20
- filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-automation`,
20
+ filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-functions`,
21
21
  component: () => {
22
22
  const layout = useLayout();
23
23
  const { spaceId } = parseId(layout.workspace);
24
24
  const space = useSpace(spaceId);
25
- if (!space || !spaceId) {
25
+ if (!space) {
26
26
  return null;
27
27
  }
28
28
 
29
- return <AutomationContainer space={space} />;
29
+ return <FunctionsContainer space={space} />;
30
30
  },
31
31
  }),
32
32
  createSurface({
33
- id: `${meta.id}/space-settings-functions`,
33
+ id: `${meta.id}/space-settings-automation`,
34
34
  role: 'article',
35
- filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-functions`,
35
+ filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-automation`,
36
36
  component: () => {
37
37
  const layout = useLayout();
38
38
  const { spaceId } = parseId(layout.workspace);
39
39
  const space = useSpace(spaceId);
40
- if (!space || !spaceId) {
40
+ if (!space) {
41
41
  return null;
42
42
  }
43
43
 
44
- return <FunctionsContainer space={space} />;
44
+ return <AutomationSettings space={space} />;
45
45
  },
46
46
  }),
47
47
  createSurface({
@@ -49,8 +49,8 @@ export default () =>
49
49
  role: 'article',
50
50
  filter: (data): data is { companionTo: ScriptType; subject: 'automation' } =>
51
51
  Obj.instanceOf(ScriptType, data.companionTo) && data.subject === 'automation',
52
- component: ({ data, role }) => {
53
- return <AutomationContainer space={getSpace(data.companionTo)!} object={data.companionTo} />;
52
+ component: ({ data }) => {
53
+ return <AutomationSettings space={getSpace(data.companionTo)!} object={data.companionTo} />;
54
54
  },
55
55
  }),
56
56
  ]);
@@ -2,21 +2,20 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react-vite';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
10
8
  import { Obj } from '@dxos/echo';
11
- import { FunctionType, FunctionTrigger } from '@dxos/functions';
9
+ import { FunctionTrigger, FunctionType } from '@dxos/functions';
12
10
  import { useSpaces } from '@dxos/react-client/echo';
13
11
  import { withClientProvider } from '@dxos/react-client/testing';
14
- import { withLayout, withTheme } from '@dxos/storybook-utils';
12
+ import { withTheme } from '@dxos/react-ui/testing';
15
13
 
16
- import { AutomationPanel } from './AutomationPanel';
17
14
  import { functions } from '../../testing';
18
15
  import { translations } from '../../translations';
19
16
 
17
+ import { AutomationPanel } from './AutomationPanel';
18
+
20
19
  const DefaultStory = () => {
21
20
  const spaces = useSpaces();
22
21
  const space = spaces[1];
@@ -28,30 +27,31 @@ const DefaultStory = () => {
28
27
  );
29
28
  };
30
29
 
31
- const meta: Meta = {
30
+ const meta = {
32
31
  title: 'plugins/plugin-automation/AutomationPanel',
33
- component: AutomationPanel,
32
+ component: AutomationPanel as any,
34
33
  render: DefaultStory,
35
34
  decorators: [
35
+ withTheme,
36
36
  withClientProvider({
37
37
  createIdentity: true,
38
38
  createSpace: true,
39
39
  types: [FunctionType, FunctionTrigger],
40
- onSpaceCreated: ({ space }) => {
40
+ onCreateSpace: ({ space }) => {
41
41
  for (const fn of functions) {
42
42
  space.db.add(Obj.make(FunctionType, fn));
43
43
  }
44
44
  },
45
45
  }),
46
- withLayout(),
47
- withTheme,
48
46
  ],
49
47
  parameters: {
50
48
  layout: 'centered',
51
49
  translations,
52
50
  },
53
- };
51
+ } satisfies Meta<typeof DefaultStory>;
54
52
 
55
53
  export default meta;
56
54
 
57
- export const Default = {};
55
+ type Story = StoryObj<typeof meta>;
56
+
57
+ export const Default: Story = {};