@dxos/plugin-automation 0.8.4-main.5ea62a8 → 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 (158) 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-U4HASI4P.mjs → FunctionsContainer-BQ6VBDIG.mjs} +7 -7
  5. package/dist/lib/browser/FunctionsContainer-BQ6VBDIG.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-I443Y6KB.mjs → FunctionsPanel-QBTOFFNU.mjs} +3 -3
  7. package/dist/lib/browser/{app-graph-builder-4OFKIRAI.mjs → app-graph-builder-6TP6ZNYG.mjs} +7 -7
  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-Z5DT4MHW.mjs → chunk-EAQL33PI.mjs} +4 -4
  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-S4SM663I.mjs → chunk-IN2YC7NY.mjs} +4 -4
  15. package/dist/lib/browser/{chunk-S4SM663I.mjs.map → chunk-IN2YC7NY.mjs.map} +3 -3
  16. package/dist/lib/browser/{chunk-PUUREQ2B.mjs → chunk-LNMCGQC2.mjs} +7 -7
  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 +23 -14
  30. package/dist/lib/browser/index.mjs.map +4 -4
  31. package/dist/lib/browser/{intent-resolver-4PSYSQQG.mjs → intent-resolver-JXVWRAAH.mjs} +5 -5
  32. package/dist/lib/browser/{intent-resolver-4PSYSQQG.mjs.map → intent-resolver-JXVWRAAH.mjs.map} +1 -1
  33. package/dist/lib/browser/meta.json +1 -1
  34. package/dist/lib/browser/{react-surface-N4ZVZH4O.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-KUP2555Y.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-VZIVURH6.mjs → FunctionsContainer-LHUUOLA5.mjs} +7 -7
  41. package/dist/lib/node-esm/FunctionsContainer-LHUUOLA5.mjs.map +7 -0
  42. package/dist/lib/node-esm/{FunctionsPanel-ELINCXPW.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-555IHYOB.mjs → app-graph-builder-3A2NIPR5.mjs} +7 -7
  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-JU7JA5X4.mjs → chunk-MN5S5J4O.mjs} +7 -7
  56. package/dist/lib/node-esm/chunk-MN5S5J4O.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-ZOJVKPCA.mjs → chunk-N7NES6SZ.mjs} +4 -4
  58. package/dist/lib/node-esm/{chunk-ZOJVKPCA.mjs.map → chunk-N7NES6SZ.mjs.map} +3 -3
  59. package/dist/lib/node-esm/{chunk-CX2AILIS.mjs → chunk-PBULJE4B.mjs} +4 -4
  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 +23 -14
  68. package/dist/lib/node-esm/index.mjs.map +4 -4
  69. package/dist/lib/node-esm/{intent-resolver-6ZGBUILG.mjs → intent-resolver-ROEBZXSS.mjs} +5 -5
  70. package/dist/lib/node-esm/{intent-resolver-6ZGBUILG.mjs.map → intent-resolver-ROEBZXSS.mjs.map} +1 -1
  71. package/dist/lib/node-esm/meta.json +1 -1
  72. package/dist/lib/node-esm/{react-surface-XE7ILYWA.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/capabilities.d.ts +18 -0
  78. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
  80. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/index.d.ts +2 -0
  82. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  83. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +4 -3
  84. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  85. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +2 -1
  86. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  87. package/dist/types/src/components/AutomationSettings.d.ts +5 -0
  88. package/dist/types/src/components/AutomationSettings.d.ts.map +1 -0
  89. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +4 -3
  90. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  91. package/dist/types/src/components/TriggerSettings.d.ts +6 -0
  92. package/dist/types/src/components/TriggerSettings.d.ts.map +1 -0
  93. package/dist/types/src/components/index.d.ts +2 -2
  94. package/dist/types/src/components/index.d.ts.map +1 -1
  95. package/dist/types/src/hooks/index.d.ts +3 -0
  96. package/dist/types/src/hooks/index.d.ts.map +1 -0
  97. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
  98. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
  99. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +11 -0
  100. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  101. package/dist/types/src/index.d.ts +1 -0
  102. package/dist/types/src/index.d.ts.map +1 -1
  103. package/dist/types/src/meta.d.ts +0 -1
  104. package/dist/types/src/meta.d.ts.map +1 -1
  105. package/dist/types/src/translations.d.ts +2 -0
  106. package/dist/types/src/translations.d.ts.map +1 -1
  107. package/dist/types/tsconfig.tsbuildinfo +1 -1
  108. package/package.json +56 -37
  109. package/src/AutomationPlugin.tsx +33 -29
  110. package/src/capabilities/app-graph-builder.ts +3 -3
  111. package/src/capabilities/capabilities.ts +47 -0
  112. package/src/capabilities/compute-runtime.ts +136 -0
  113. package/src/capabilities/index.ts +3 -0
  114. package/src/capabilities/react-surface.tsx +11 -11
  115. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +3 -6
  116. package/src/components/AutomationPanel/AutomationPanel.tsx +7 -7
  117. package/src/components/{AutomationContainer.tsx → AutomationSettings.tsx} +8 -6
  118. package/src/components/FunctionsContainer.tsx +4 -4
  119. package/src/components/FunctionsPanel/FunctionsPanel.tsx +2 -2
  120. package/src/components/TriggerEditor/SpecSelector.tsx +2 -2
  121. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +4 -6
  122. package/src/components/TriggerSettings.tsx +25 -0
  123. package/src/components/index.ts +1 -1
  124. package/src/hooks/index.ts +6 -0
  125. package/src/hooks/useComputeRuntimeCallback.ts +30 -0
  126. package/src/hooks/useTriggerRuntimeControls.ts +52 -0
  127. package/src/index.ts +1 -0
  128. package/src/meta.ts +1 -3
  129. package/src/translations.ts +4 -0
  130. package/dist/lib/browser/AutomationContainer-A46DB774.mjs +0 -35
  131. package/dist/lib/browser/AutomationContainer-A46DB774.mjs.map +0 -7
  132. package/dist/lib/browser/AutomationPanel-TQXXZHLR.mjs +0 -11
  133. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
  134. package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
  135. package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
  136. package/dist/lib/browser/chunk-IAUUJ5RL.mjs +0 -14
  137. package/dist/lib/browser/chunk-IAUUJ5RL.mjs.map +0 -7
  138. package/dist/lib/browser/chunk-PUUREQ2B.mjs.map +0 -7
  139. package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
  140. package/dist/lib/browser/react-surface-N4ZVZH4O.mjs.map +0 -7
  141. package/dist/lib/node-esm/AutomationContainer-5S3BBZVY.mjs +0 -36
  142. package/dist/lib/node-esm/AutomationContainer-5S3BBZVY.mjs.map +0 -7
  143. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
  144. package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
  145. package/dist/lib/node-esm/chunk-7XZGYNT6.mjs +0 -16
  146. package/dist/lib/node-esm/chunk-7XZGYNT6.mjs.map +0 -7
  147. package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
  148. package/dist/lib/node-esm/chunk-JU7JA5X4.mjs.map +0 -7
  149. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
  150. package/dist/lib/node-esm/react-surface-XE7ILYWA.mjs.map +0 -7
  151. package/dist/types/src/components/AutomationContainer.d.ts +0 -5
  152. package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
  153. /package/dist/lib/browser/{AutomationPanel-TQXXZHLR.mjs.map → AutomationPanel-4QA5G3ZY.mjs.map} +0 -0
  154. /package/dist/lib/browser/{FunctionsPanel-I443Y6KB.mjs.map → FunctionsPanel-QBTOFFNU.mjs.map} +0 -0
  155. /package/dist/lib/browser/{chunk-HN7OHFCB.mjs.map → chunk-F4K5EMWL.mjs.map} +0 -0
  156. /package/dist/lib/{node-esm/AutomationPanel-KUP2555Y.mjs.map → browser/hooks/index.mjs.map} +0 -0
  157. /package/dist/lib/node-esm/{FunctionsPanel-ELINCXPW.mjs.map → AutomationPanel-WMVR3IST.mjs.map} +0 -0
  158. /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.5ea62a8",
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",
@@ -15,6 +15,12 @@
15
15
  "browser": "./dist/lib/browser/index.mjs",
16
16
  "node": "./dist/lib/node-esm/index.mjs"
17
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"
23
+ },
18
24
  "./types": {
19
25
  "source": "./src/types/index.ts",
20
26
  "types": "./dist/types/src/types/index.d.ts",
@@ -24,7 +30,14 @@
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.5ea62a8",
38
- "@dxos/async": "0.8.4-main.5ea62a8",
39
- "@dxos/conductor": "0.8.4-main.5ea62a8",
40
- "@dxos/echo": "0.8.4-main.5ea62a8",
41
- "@dxos/echo-schema": "0.8.4-main.5ea62a8",
42
- "@dxos/functions": "0.8.4-main.5ea62a8",
43
- "@dxos/live-object": "0.8.4-main.5ea62a8",
44
- "@dxos/plugin-client": "0.8.4-main.5ea62a8",
45
- "@dxos/plugin-deck": "0.8.4-main.5ea62a8",
46
- "@dxos/plugin-graph": "0.8.4-main.5ea62a8",
47
- "@dxos/plugin-space": "0.8.4-main.5ea62a8",
48
- "@dxos/random": "0.8.4-main.5ea62a8",
49
- "@dxos/react-client": "0.8.4-main.5ea62a8",
50
- "@dxos/react-ui-form": "0.8.4-main.5ea62a8",
51
- "@dxos/log": "0.8.4-main.5ea62a8",
52
- "@dxos/react-ui-list": "0.8.4-main.5ea62a8",
53
- "@dxos/react-ui-stack": "0.8.4-main.5ea62a8",
54
- "@dxos/util": "0.8.4-main.5ea62a8",
55
- "@dxos/invariant": "0.8.4-main.5ea62a8"
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.90.2",
60
- "@types/react": "~18.2.0",
61
- "@types/react-dom": "~18.2.0",
62
- "effect": "3.17.7",
63
- "react": "~18.2.0",
64
- "react-dom": "~18.2.0",
65
- "vite": "7.1.1",
66
- "@dxos/react-ui": "0.8.4-main.5ea62a8",
67
- "@dxos/storybook-utils": "0.8.4-main.5ea62a8",
68
- "@dxos/react-ui-theme": "0.8.4-main.5ea62a8"
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.5ea62a8",
77
- "@dxos/react-ui-theme": "0.8.4-main.5ea62a8"
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"
@@ -6,35 +6,39 @@ import { Capabilities, Events, contributes, defineModule, definePlugin } from '@
6
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
+ ]);
@@ -10,7 +10,7 @@ import { Obj } from '@dxos/echo';
10
10
  import { ScriptType } from '@dxos/functions';
11
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';
@@ -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,8 +2,6 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -11,7 +9,7 @@ import { Obj } from '@dxos/echo';
11
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
14
  import { functions } from '../../testing';
17
15
  import { translations } from '../../translations';
@@ -34,18 +32,17 @@ const meta = {
34
32
  component: AutomationPanel as any,
35
33
  render: DefaultStory,
36
34
  decorators: [
35
+ withTheme,
37
36
  withClientProvider({
38
37
  createIdentity: true,
39
38
  createSpace: true,
40
39
  types: [FunctionType, FunctionTrigger],
41
- onSpaceCreated: ({ space }) => {
40
+ onCreateSpace: ({ space }) => {
42
41
  for (const fn of functions) {
43
42
  space.db.add(Obj.make(FunctionType, fn));
44
43
  }
45
44
  },
46
45
  }),
47
- withLayout(),
48
- withTheme,
49
46
  ],
50
47
  parameters: {
51
48
  layout: 'centered',
@@ -9,26 +9,26 @@ import { Filter, Obj } from '@dxos/echo';
9
9
  import { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';
10
10
  import { type Client, useClient } from '@dxos/react-client';
11
11
  import { type Space, getSpace, useQuery } from '@dxos/react-client/echo';
12
- import { Clipboard, IconButton, Input, Separator, useTranslation } from '@dxos/react-ui';
12
+ import { Clipboard, IconButton, Input, Separator, type ThemedClassName, useTranslation } from '@dxos/react-ui';
13
13
  import { ControlItem, controlItemClasses } from '@dxos/react-ui-form';
14
14
  import { List } from '@dxos/react-ui-list';
15
15
  import { ghostHover, mx } from '@dxos/react-ui-theme';
16
16
 
17
- import { AUTOMATION_PLUGIN } from '../../meta';
17
+ import { meta } from '../../meta';
18
18
  import { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';
19
19
 
20
20
  const grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';
21
21
 
22
- export type AutomationPanelProps = {
22
+ export type AutomationPanelProps = ThemedClassName<{
23
23
  space: Space;
24
24
  object?: Obj.Any;
25
25
  initialTrigger?: FunctionTrigger;
26
26
  onDone?: () => void;
27
- };
27
+ }>;
28
28
 
29
29
  // TODO(burdon): Factor out common layout with ViewEditor.
30
- export const AutomationPanel = ({ space, object, initialTrigger, onDone }: AutomationPanelProps) => {
31
- const { t } = useTranslation(AUTOMATION_PLUGIN);
30
+ export const AutomationPanel = ({ classNames, space, object, initialTrigger, onDone }: AutomationPanelProps) => {
31
+ const { t } = useTranslation(meta.id);
32
32
  const client = useClient();
33
33
  const triggers = useQuery(space, Filter.type(FunctionTrigger));
34
34
  const functions = useQuery(space, Filter.type(FunctionType));
@@ -79,7 +79,7 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
79
79
  }
80
80
 
81
81
  return (
82
- <div className={controlItemClasses}>
82
+ <div className={mx(controlItemClasses, classNames)}>
83
83
  {triggers.length > 0 && (
84
84
  <List.Root<FunctionTrigger> items={triggers} isItem={Schema.is(FunctionTrigger)} getId={(field) => field.id}>
85
85
  {({ items: triggers }) => (
@@ -7,22 +7,24 @@ import React from 'react';
7
7
  import { useTranslation } from '@dxos/react-ui';
8
8
  import { ControlPage, ControlSection } from '@dxos/react-ui-form';
9
9
 
10
- import { AUTOMATION_PLUGIN } from '../meta';
10
+ import { meta } from '../meta';
11
11
 
12
12
  import { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';
13
+ import { TriggersSettings } from './TriggerSettings';
13
14
 
14
- export const AutomationContainer = (props: AutomationPanelProps) => {
15
- const { t } = useTranslation(AUTOMATION_PLUGIN);
15
+ export const AutomationSettings = (props: AutomationPanelProps) => {
16
+ const { t } = useTranslation(meta.id);
16
17
  return (
17
18
  <ControlPage>
18
19
  <ControlSection
19
- title={t('automation verbose label', { ns: AUTOMATION_PLUGIN })}
20
- description={t('automation description', { ns: AUTOMATION_PLUGIN })}
20
+ title={t('automation verbose label', { ns: meta.id })}
21
+ description={t('automation description', { ns: meta.id })}
21
22
  >
22
23
  <AutomationPanel {...props} />
24
+ <TriggersSettings space={props.space} />
23
25
  </ControlSection>
24
26
  </ControlPage>
25
27
  );
26
28
  };
27
29
 
28
- export default AutomationContainer;
30
+ export default AutomationSettings;
@@ -8,17 +8,17 @@ import { type Space } from '@dxos/react-client/echo';
8
8
  import { useTranslation } from '@dxos/react-ui';
9
9
  import { ControlPage, ControlSection } from '@dxos/react-ui-form';
10
10
 
11
- import { AUTOMATION_PLUGIN } from '../meta';
11
+ import { meta } from '../meta';
12
12
 
13
13
  import { FunctionsPanel } from './FunctionsPanel';
14
14
 
15
15
  export const FunctionsContainer = ({ space }: { space: Space }) => {
16
- const { t } = useTranslation(AUTOMATION_PLUGIN);
16
+ const { t } = useTranslation(meta.id);
17
17
  return (
18
18
  <ControlPage>
19
19
  <ControlSection
20
- title={t('functions verbose label', { ns: AUTOMATION_PLUGIN })}
21
- description={t('functions description', { ns: AUTOMATION_PLUGIN })}
20
+ title={t('functions verbose label', { ns: meta.id })}
21
+ description={t('functions description', { ns: meta.id })}
22
22
  >
23
23
  <FunctionsPanel space={space} />
24
24
  </ControlSection>
@@ -13,7 +13,7 @@ import { controlItemClasses } from '@dxos/react-ui-form';
13
13
  import { List } from '@dxos/react-ui-list';
14
14
  import { ghostHover, mx } from '@dxos/react-ui-theme';
15
15
 
16
- import { AUTOMATION_PLUGIN } from '../../meta';
16
+ import { meta } from '../../meta';
17
17
 
18
18
  const grid = 'grid grid-cols-[1fr_auto] min-bs-[2.5rem]';
19
19
 
@@ -22,7 +22,7 @@ export type FunctionsPanelProps = {
22
22
  };
23
23
 
24
24
  export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
25
- const { t } = useTranslation(AUTOMATION_PLUGIN);
25
+ const { t } = useTranslation(meta.id);
26
26
  const functions = useQuery(space, Filter.type(FunctionType));
27
27
  const scripts = useQuery(space, Filter.type(ScriptType));
28
28
  const { dispatchPromise: dispatch } = useIntentDispatcher();
@@ -8,12 +8,12 @@ import { type FunctionTrigger, TriggerKinds, type TriggerType } from '@dxos/func
8
8
  import { useTranslation } from '@dxos/react-ui';
9
9
  import { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';
10
10
 
11
- import { AUTOMATION_PLUGIN } from '../../meta';
11
+ import { meta } from '../../meta';
12
12
 
13
13
  export type SpecSelectorProps = InputProps;
14
14
 
15
15
  export const SpecSelector = (props: SpecSelectorProps) => {
16
- const { t } = useTranslation(AUTOMATION_PLUGIN);
16
+ const { t } = useTranslation(meta.id);
17
17
  const specProps = useInputProps(['spec' satisfies keyof FunctionTrigger]);
18
18
 
19
19
  const handleTypeChange = useCallback(