@dxos/plugin-automation 0.8.4-main.7ace549 → 0.8.4-main.9735255
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.
- package/dist/lib/browser/AutomationPanel-FAS6ADCW.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs +56 -0
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs.map +7 -0
- package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs +129 -0
- package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs → FunctionsPanel-ZX4J75UM.mjs} +3 -3
- package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs +84 -0
- package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CZVA5NMD.mjs → chunk-54PANILA.mjs} +5 -5
- package/dist/lib/browser/chunk-BFUIVUQH.mjs +102 -0
- package/dist/lib/browser/chunk-BFUIVUQH.mjs.map +7 -0
- package/dist/lib/browser/chunk-BKFQBKYO.mjs +8 -0
- package/dist/lib/browser/chunk-BKFQBKYO.mjs.map +7 -0
- package/dist/lib/browser/chunk-JOXPQ27I.mjs +83 -0
- package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LZQFZO3B.mjs → chunk-PZNBEKO5.mjs} +1 -1
- package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +7 -0
- package/dist/lib/browser/chunk-QW3EM35H.mjs +248 -0
- package/dist/lib/browser/chunk-QW3EM35H.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4MBM6C6A.mjs → chunk-RAF2FJST.mjs} +14 -28
- package/dist/lib/browser/chunk-RAF2FJST.mjs.map +7 -0
- package/dist/lib/browser/chunk-YWLEY2FD.mjs +200 -0
- package/dist/lib/browser/chunk-YWLEY2FD.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +1107 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs +114 -0
- package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +3 -3
- package/dist/lib/browser/index.mjs +49 -57
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs +82 -0
- package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-TKU2EQ5A.mjs → react-surface-EV3AC62F.mjs} +12 -11
- package/dist/lib/browser/react-surface-EV3AC62F.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -4
- package/dist/lib/node-esm/{AutomationPanel-F5CTC6AT.mjs → AutomationPanel-B7NAGDFA.mjs} +4 -4
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs +57 -0
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs +130 -0
- package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-RVVCS6VH.mjs → FunctionsPanel-SS6GIVNU.mjs} +3 -3
- package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs +85 -0
- package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2CKVH7JC.mjs +201 -0
- package/dist/lib/node-esm/chunk-2CKVH7JC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CEVIVRTY.mjs → chunk-5FXNN3MV.mjs} +1 -1
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3IYSC75Z.mjs → chunk-7QRUPEHH.mjs} +5 -5
- package/dist/lib/node-esm/{chunk-7B6NAAI6.mjs → chunk-HQLVREIX.mjs} +14 -28
- package/dist/lib/node-esm/chunk-HQLVREIX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-K7GCM342.mjs +10 -0
- package/dist/lib/node-esm/chunk-K7GCM342.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KWKWOGS5.mjs +103 -0
- package/dist/lib/node-esm/chunk-KWKWOGS5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs +249 -0
- package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RX52VKI2.mjs +84 -0
- package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +1108 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs +115 -0
- package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +3 -3
- package/dist/lib/node-esm/index.mjs +49 -57
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs +83 -0
- package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-7QROSEGH.mjs → react-surface-S6VZJCEZ.mjs} +12 -11
- package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -4
- package/dist/types/src/AutomationPlugin.d.ts +2 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
- package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/index.d.ts +2 -0
- package/dist/types/src/cli/commands/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
- package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
- package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
- package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
- package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
- package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +10 -7
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -6
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +70 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerSettings.d.ts +3 -3
- package/dist/types/src/components/TriggerSettings.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +6 -6
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -2
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts +202 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +22 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +30 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -49
- package/src/AutomationPlugin.tsx +13 -33
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +71 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/{compute-runtime.ts → compute-runtime/compute-runtime.ts} +48 -44
- package/src/capabilities/compute-runtime/index.ts +7 -0
- package/src/capabilities/index.ts +4 -8
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +79 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +60 -0
- package/src/cli/commands/index.ts +5 -0
- package/src/cli/commands/trigger/create/index.ts +14 -0
- package/src/cli/commands/trigger/create/queue.ts +89 -0
- package/src/cli/commands/trigger/create/subscription.ts +128 -0
- package/src/cli/commands/trigger/create/timer.ts +93 -0
- package/src/cli/commands/trigger/index.ts +16 -0
- package/src/cli/commands/trigger/list.ts +67 -0
- package/src/cli/commands/trigger/options.ts +59 -0
- package/src/cli/commands/trigger/remove.ts +45 -0
- package/src/cli/commands/trigger/update/index.ts +14 -0
- package/src/cli/commands/trigger/update/queue.ts +195 -0
- package/src/cli/commands/trigger/update/subscription.ts +278 -0
- package/src/cli/commands/trigger/update/timer.ts +193 -0
- package/src/cli/commands/trigger/util.ts +395 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +23 -0
- package/src/components/AutomationPanel/AutomationPanel.tsx +33 -12
- package/src/components/AutomationSettings.tsx +1 -1
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +11 -16
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +8 -24
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +23 -31
- package/src/components/TriggerEditor/SpecSelector.tsx +8 -6
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +27 -24
- package/src/components/TriggerEditor/TriggerEditor.tsx +55 -42
- package/src/components/TriggerSettings.tsx +3 -3
- package/src/hooks/useComputeRuntimeCallback.ts +9 -10
- package/src/hooks/useTriggerRuntimeControls.ts +7 -7
- package/src/index.ts +1 -2
- package/src/meta.ts +2 -2
- package/src/translations.ts +2 -0
- package/src/{capabilities → types}/capabilities.ts +8 -7
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +23 -2
- package/dist/lib/browser/AutomationPanel-M4M77L4V.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-4HCI6KJR.mjs +0 -68
- package/dist/lib/browser/AutomationSettings-4HCI6KJR.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs +0 -144
- package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
- package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
- package/dist/lib/browser/chunk-4MBM6C6A.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W6QMY3L.mjs +0 -267
- package/dist/lib/browser/chunk-7W6QMY3L.mjs.map +0 -7
- package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-T6ZESHDY.mjs +0 -191
- package/dist/lib/browser/chunk-T6ZESHDY.mjs.map +0 -7
- package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
- package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
- package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
- package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
- package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
- package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs +0 -113
- package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
- package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TKU2EQ5A.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationSettings-BQLJIFRT.mjs +0 -69
- package/dist/lib/node-esm/AutomationSettings-BQLJIFRT.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs +0 -145
- package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
- package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7B6NAAI6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CF2SWXPW.mjs +0 -268
- package/dist/lib/node-esm/chunk-CF2SWXPW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
- package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F76XVENA.mjs +0 -192
- package/dist/lib/node-esm/chunk-F76XVENA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
- package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
- package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs +0 -114
- package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
- package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7QROSEGH.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -20
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -87
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/capabilities/react-surface.tsx +0 -56
- package/src/events.ts +0 -11
- /package/dist/lib/browser/{AutomationPanel-M4M77L4V.mjs.map → AutomationPanel-FAS6ADCW.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs.map → FunctionsPanel-ZX4J75UM.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-CZVA5NMD.mjs.map → chunk-54PANILA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{AutomationPanel-F5CTC6AT.mjs.map → AutomationPanel-B7NAGDFA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsPanel-RVVCS6VH.mjs.map → FunctionsPanel-SS6GIVNU.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-3IYSC75Z.mjs.map → chunk-7QRUPEHH.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-automation",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.9735255",
|
|
4
4
|
"description": "Prompt chain plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
@@ -15,6 +19,11 @@
|
|
|
15
19
|
"browser": "./dist/lib/browser/index.mjs",
|
|
16
20
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
21
|
},
|
|
22
|
+
"./cli": {
|
|
23
|
+
"source": "./src/cli/index.ts",
|
|
24
|
+
"types": "./dist/types/src/cli/index.d.ts",
|
|
25
|
+
"node": "./dist/lib/node-esm/cli/index.mjs"
|
|
26
|
+
},
|
|
18
27
|
"./hooks": {
|
|
19
28
|
"source": "./src/hooks/index.ts",
|
|
20
29
|
"types": "./dist/types/src/hooks/index.d.ts",
|
|
@@ -45,59 +54,62 @@
|
|
|
45
54
|
"src"
|
|
46
55
|
],
|
|
47
56
|
"dependencies": {
|
|
48
|
-
"@effect/ai": "0.
|
|
49
|
-
"@effect/
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@dxos/ai": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/conductor": "0.8.4-main.
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/functions": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/react-ui-
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
57
|
+
"@effect/ai": "0.32.1",
|
|
58
|
+
"@effect/cli": "0.72.1",
|
|
59
|
+
"@effect/platform-browser": "0.73.0",
|
|
60
|
+
"@effect/printer-ansi": "0.47.0",
|
|
61
|
+
"@dxos/ai": "0.8.4-main.9735255",
|
|
62
|
+
"@dxos/app-framework": "0.8.4-main.9735255",
|
|
63
|
+
"@dxos/async": "0.8.4-main.9735255",
|
|
64
|
+
"@dxos/cli-util": "0.8.4-main.9735255",
|
|
65
|
+
"@dxos/assistant": "0.8.4-main.9735255",
|
|
66
|
+
"@dxos/conductor": "0.8.4-main.9735255",
|
|
67
|
+
"@dxos/client": "0.8.4-main.9735255",
|
|
68
|
+
"@dxos/context": "0.8.4-main.9735255",
|
|
69
|
+
"@dxos/echo": "0.8.4-main.9735255",
|
|
70
|
+
"@dxos/effect": "0.8.4-main.9735255",
|
|
71
|
+
"@dxos/functions": "0.8.4-main.9735255",
|
|
72
|
+
"@dxos/invariant": "0.8.4-main.9735255",
|
|
73
|
+
"@dxos/functions-runtime": "0.8.4-main.9735255",
|
|
74
|
+
"@dxos/keys": "0.8.4-main.9735255",
|
|
75
|
+
"@dxos/log": "0.8.4-main.9735255",
|
|
76
|
+
"@dxos/operation": "0.8.4-main.9735255",
|
|
77
|
+
"@dxos/plugin-deck": "0.8.4-main.9735255",
|
|
78
|
+
"@dxos/plugin-space": "0.8.4-main.9735255",
|
|
79
|
+
"@dxos/plugin-graph": "0.8.4-main.9735255",
|
|
80
|
+
"@dxos/random": "0.8.4-main.9735255",
|
|
81
|
+
"@dxos/react-client": "0.8.4-main.9735255",
|
|
82
|
+
"@dxos/plugin-client": "0.8.4-main.9735255",
|
|
83
|
+
"@dxos/react-ui-editor": "0.8.4-main.9735255",
|
|
84
|
+
"@dxos/react-ui-form": "0.8.4-main.9735255",
|
|
85
|
+
"@dxos/react-ui-components": "0.8.4-main.9735255",
|
|
86
|
+
"@dxos/react-ui-stack": "0.8.4-main.9735255",
|
|
87
|
+
"@dxos/react-ui-list": "0.8.4-main.9735255",
|
|
88
|
+
"@dxos/schema": "0.8.4-main.9735255",
|
|
89
|
+
"@dxos/types": "0.8.4-main.9735255",
|
|
90
|
+
"@dxos/util": "0.8.4-main.9735255"
|
|
79
91
|
},
|
|
80
92
|
"devDependencies": {
|
|
81
|
-
"@effect-atom/atom-react": "^0.
|
|
82
|
-
"@effect/platform": "0.
|
|
83
|
-
"@types/react": "~19.2.
|
|
84
|
-
"@types/react-dom": "~19.2.
|
|
85
|
-
"effect": "3.
|
|
86
|
-
"react": "~19.2.
|
|
87
|
-
"react-dom": "~19.2.
|
|
93
|
+
"@effect-atom/atom-react": "^0.4.6",
|
|
94
|
+
"@effect/platform": "0.93.6",
|
|
95
|
+
"@types/react": "~19.2.7",
|
|
96
|
+
"@types/react-dom": "~19.2.3",
|
|
97
|
+
"effect": "3.19.11",
|
|
98
|
+
"react": "~19.2.3",
|
|
99
|
+
"react-dom": "~19.2.3",
|
|
88
100
|
"vite": "7.1.9",
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
101
|
+
"@dxos/storybook-utils": "0.8.4-main.9735255",
|
|
102
|
+
"@dxos/ui-theme": "0.8.4-main.9735255",
|
|
103
|
+
"@dxos/react-ui": "0.8.4-main.9735255"
|
|
92
104
|
},
|
|
93
105
|
"peerDependencies": {
|
|
94
|
-
"@effect-atom/atom-react": "^0.
|
|
95
|
-
"@effect/platform": "
|
|
96
|
-
"effect": "
|
|
97
|
-
"react": "
|
|
98
|
-
"react-dom": "
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/react-ui
|
|
106
|
+
"@effect-atom/atom-react": "^0.4.6",
|
|
107
|
+
"@effect/platform": "0.93.6",
|
|
108
|
+
"effect": "3.19.11",
|
|
109
|
+
"react": "~19.2.3",
|
|
110
|
+
"react-dom": "~19.2.3",
|
|
111
|
+
"@dxos/ui-theme": "0.8.4-main.9735255",
|
|
112
|
+
"@dxos/react-ui": "0.8.4-main.9735255"
|
|
101
113
|
},
|
|
102
114
|
"publishConfig": {
|
|
103
115
|
"access": "public"
|
package/src/AutomationPlugin.tsx
CHANGED
|
@@ -2,45 +2,25 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Common, Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { Function, Trigger } from '@dxos/functions';
|
|
7
|
-
import {
|
|
7
|
+
import { ClientEvents } from '@dxos/plugin-client/types';
|
|
8
8
|
|
|
9
|
-
import { AppGraphBuilder, ComputeRuntime,
|
|
10
|
-
import { AutomationEvents } from './events';
|
|
9
|
+
import { AppGraphBuilder, ComputeRuntime, OperationResolver, ReactSurface } from './capabilities';
|
|
11
10
|
import { meta } from './meta';
|
|
12
11
|
import { translations } from './translations';
|
|
12
|
+
import { AutomationEvents } from './types';
|
|
13
13
|
|
|
14
|
-
export const AutomationPlugin =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}),
|
|
20
|
-
|
|
21
|
-
id: `${meta.id}/module/schema`,
|
|
22
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
23
|
-
activate: () => contributes(ClientCapabilities.Schema, [Function.Function, Trigger.Trigger]),
|
|
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
|
-
defineModule({
|
|
41
|
-
id: `${meta.id}/module/compute-runtime`,
|
|
14
|
+
export const AutomationPlugin = Plugin.define(meta).pipe(
|
|
15
|
+
Common.Plugin.addTranslationsModule({ translations }),
|
|
16
|
+
Common.Plugin.addSchemaModule({ schema: [Function.Function, Trigger.Trigger] }),
|
|
17
|
+
Common.Plugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
18
|
+
Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
19
|
+
Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
|
|
20
|
+
Plugin.addModule({
|
|
42
21
|
activatesOn: ClientEvents.ClientReady,
|
|
43
22
|
activatesAfter: [AutomationEvents.ComputeRuntimeReady],
|
|
44
23
|
activate: ComputeRuntime,
|
|
45
24
|
}),
|
|
46
|
-
|
|
25
|
+
Plugin.make,
|
|
26
|
+
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
+
import { Script } from '@dxos/functions';
|
|
9
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
10
|
+
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
|
+
import { meta as spaceMeta } from '@dxos/plugin-space';
|
|
12
|
+
|
|
13
|
+
import { meta } from '../../meta';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(
|
|
16
|
+
Effect.fnUntraced(function* () {
|
|
17
|
+
const extensions = yield* Effect.all([
|
|
18
|
+
GraphBuilder.createExtension({
|
|
19
|
+
id: `${meta.id}/space-settings-automation`,
|
|
20
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),
|
|
21
|
+
connector: (node) =>
|
|
22
|
+
Effect.succeed([
|
|
23
|
+
{
|
|
24
|
+
id: `automation-${node.id}`,
|
|
25
|
+
type: `${meta.id}/space-settings-automation`,
|
|
26
|
+
data: `${meta.id}/space-settings-automation`,
|
|
27
|
+
properties: {
|
|
28
|
+
label: ['automation panel label', { ns: meta.id }],
|
|
29
|
+
icon: 'ph--lightning--regular',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
]),
|
|
33
|
+
}),
|
|
34
|
+
GraphBuilder.createExtension({
|
|
35
|
+
id: `${meta.id}/space-settings-functions`,
|
|
36
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),
|
|
37
|
+
connector: (node) =>
|
|
38
|
+
Effect.succeed([
|
|
39
|
+
{
|
|
40
|
+
id: `functions-${node.id}`,
|
|
41
|
+
type: `${meta.id}/space-settings-functions`,
|
|
42
|
+
data: `${meta.id}/space-settings-functions`,
|
|
43
|
+
properties: {
|
|
44
|
+
label: ['functions panel label', { ns: meta.id }],
|
|
45
|
+
icon: 'ph--function--regular',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
]),
|
|
49
|
+
}),
|
|
50
|
+
GraphBuilder.createTypeExtension({
|
|
51
|
+
id: `${meta.id}/script-companion`,
|
|
52
|
+
type: Script.Script,
|
|
53
|
+
connector: (script) =>
|
|
54
|
+
Effect.succeed([
|
|
55
|
+
{
|
|
56
|
+
id: [script.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
57
|
+
type: PLANK_COMPANION_TYPE,
|
|
58
|
+
data: 'automation',
|
|
59
|
+
properties: {
|
|
60
|
+
label: ['script automation label', { ns: meta.id }],
|
|
61
|
+
icon: 'ph--lightning--regular',
|
|
62
|
+
disposition: 'hidden',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
]),
|
|
66
|
+
}),
|
|
67
|
+
]);
|
|
68
|
+
|
|
69
|
+
return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
@@ -7,40 +7,46 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import * as Layer from 'effect/Layer';
|
|
8
8
|
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { Capability, type CapabilityManager, Common } from '@dxos/app-framework';
|
|
11
11
|
import { GenericToolkit, makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
12
|
+
import { SpaceProperties } from '@dxos/client/echo';
|
|
12
13
|
import { Resource } from '@dxos/context';
|
|
13
|
-
import { Query, Ref } from '@dxos/echo';
|
|
14
|
-
import { CredentialsService,
|
|
14
|
+
import { Database, Obj, Query, Ref } from '@dxos/echo';
|
|
15
|
+
import { CredentialsService, QueueService } from '@dxos/functions';
|
|
15
16
|
import {
|
|
16
17
|
FunctionImplementationResolver,
|
|
17
18
|
FunctionInvocationServiceLayerWithLocalLoopbackExecutor,
|
|
18
|
-
InvocationTracer,
|
|
19
19
|
RemoteFunctionExecutionService,
|
|
20
|
+
TracingServiceExt,
|
|
20
21
|
TriggerDispatcher,
|
|
22
|
+
TriggerStateStore,
|
|
21
23
|
} from '@dxos/functions-runtime';
|
|
22
|
-
import { TriggerStateStore } from '@dxos/functions-runtime';
|
|
23
24
|
import { invariant } from '@dxos/invariant';
|
|
24
25
|
import { type SpaceId } from '@dxos/keys';
|
|
25
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
26
|
-
import { SpaceProperties } from '@dxos/react-client/echo';
|
|
26
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
27
27
|
|
|
28
|
-
import { AutomationCapabilities } from '
|
|
28
|
+
import { AutomationCapabilities } from '../../types';
|
|
29
29
|
|
|
30
|
-
export default
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
export default Capability.makeModule(
|
|
31
|
+
Effect.fnUntraced(function* () {
|
|
32
|
+
const capabilities = yield* Capability.Service;
|
|
33
|
+
const provider = yield* Effect.tryPromise(() => new ComputeRuntimeProviderImpl(capabilities).open());
|
|
34
|
+
return Capability.contributes(AutomationCapabilities.ComputeRuntime, provider, () =>
|
|
35
|
+
Effect.tryPromise(() => provider.close()),
|
|
36
|
+
);
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
36
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Adapts plugin capabilities to runtime layers.
|
|
42
|
+
*/
|
|
37
43
|
class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilities.ComputeRuntimeProvider {
|
|
38
44
|
readonly #runtimes = new Map<SpaceId, AutomationCapabilities.ComputeRuntime>();
|
|
39
|
-
readonly #
|
|
45
|
+
readonly #capabilities: CapabilityManager.CapabilityManager;
|
|
40
46
|
|
|
41
|
-
constructor(
|
|
47
|
+
constructor(capabilities: CapabilityManager.CapabilityManager) {
|
|
42
48
|
super();
|
|
43
|
-
this.#
|
|
49
|
+
this.#capabilities = capabilities;
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
protected override async _open() {}
|
|
@@ -57,46 +63,44 @@ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilit
|
|
|
57
63
|
|
|
58
64
|
const layer = Layer.unwrapEffect(
|
|
59
65
|
Effect.gen(this, function* () {
|
|
60
|
-
const client = this.#
|
|
61
|
-
const
|
|
62
|
-
this.#
|
|
66
|
+
const client = this.#capabilities.get(ClientCapabilities.Client);
|
|
67
|
+
const aiServiceLayer =
|
|
68
|
+
this.#capabilities.get(Common.Capability.AiServiceLayer) ?? Layer.die('AiService not found');
|
|
63
69
|
|
|
64
70
|
// TODO(dmaretskyi): Make these reactive.
|
|
65
|
-
const functions = this.#
|
|
66
|
-
const toolkits = this.#
|
|
71
|
+
const functions = this.#capabilities.getAll(Common.Capability.Functions).flat();
|
|
72
|
+
const toolkits = this.#capabilities.getAll(Common.Capability.Toolkit);
|
|
67
73
|
const mergedToolkit = GenericToolkit.merge(...toolkits);
|
|
68
74
|
const toolkit = mergedToolkit.toolkit;
|
|
69
75
|
const toolkitLayer = mergedToolkit.layer;
|
|
70
76
|
|
|
71
77
|
const space = client.spaces.get(spaceId);
|
|
72
|
-
invariant(space);
|
|
78
|
+
invariant(space, `Invalid space: ${spaceId}`);
|
|
73
79
|
yield* Effect.promise(() => space.waitUntilReady());
|
|
74
80
|
|
|
75
81
|
return Layer.mergeAll(TriggerDispatcher.layer({ timeControl: 'natural' })).pipe(
|
|
76
82
|
Layer.provideMerge(
|
|
77
83
|
Layer.mergeAll(
|
|
78
|
-
|
|
84
|
+
TracingServiceLive,
|
|
79
85
|
TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
|
|
80
86
|
makeToolResolverFromFunctions(functions, toolkit),
|
|
81
87
|
makeToolExecutionServiceFromFunctions(toolkit, toolkitLayer),
|
|
82
88
|
),
|
|
83
89
|
),
|
|
84
90
|
Layer.provideMerge(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,
|
|
93
|
-
),
|
|
91
|
+
FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(
|
|
92
|
+
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions })),
|
|
93
|
+
Layer.provideMerge(
|
|
94
|
+
RemoteFunctionExecutionService.fromClient(
|
|
95
|
+
client,
|
|
96
|
+
// If agent is not enabled do not provide spaceId because space context will be unavailable on EDGE.
|
|
97
|
+
client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,
|
|
94
98
|
),
|
|
95
|
-
Layer.provideMerge(serviceLayer),
|
|
96
|
-
Layer.provideMerge(CredentialsService.layerFromDatabase()),
|
|
97
|
-
Layer.provideMerge(space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable),
|
|
98
|
-
Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
|
|
99
99
|
),
|
|
100
|
+
Layer.provideMerge(aiServiceLayer),
|
|
101
|
+
Layer.provideMerge(CredentialsService.layerFromDatabase()),
|
|
102
|
+
Layer.provideMerge(space ? Database.Service.layer(space.db) : Database.Service.notAvailable),
|
|
103
|
+
Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
|
|
100
104
|
),
|
|
101
105
|
),
|
|
102
106
|
);
|
|
@@ -105,25 +109,25 @@ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilit
|
|
|
105
109
|
|
|
106
110
|
const runtime = ManagedRuntime.make(layer);
|
|
107
111
|
this.#runtimes.set(spaceId, runtime);
|
|
108
|
-
|
|
109
112
|
return runtime;
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
const
|
|
116
|
+
const TracingServiceLive = Layer.unwrapEffect(
|
|
114
117
|
Effect.gen(function* () {
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
} = yield* DatabaseService.runQuery(Query.type(SpaceProperties));
|
|
118
|
+
const objects = yield* Database.Service.runQuery(Query.type(SpaceProperties));
|
|
119
|
+
const [properties] = objects;
|
|
118
120
|
invariant(properties);
|
|
119
121
|
// TODO(burdon): Check ref target has loaded?
|
|
120
122
|
if (!properties.invocationTraceQueue || !properties.invocationTraceQueue.target) {
|
|
121
123
|
const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });
|
|
122
|
-
properties
|
|
124
|
+
Obj.change(properties, (m) => {
|
|
125
|
+
m.invocationTraceQueue = Ref.fromDXN(queue.dxn);
|
|
126
|
+
});
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
const queue = properties.invocationTraceQueue.target;
|
|
126
130
|
invariant(queue);
|
|
127
|
-
return
|
|
131
|
+
return TracingServiceExt.layerInvocationsQueue({ invocationTraceQueue: queue });
|
|
128
132
|
}),
|
|
129
133
|
);
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
10
|
-
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
11
|
-
|
|
12
|
-
export * from './capabilities';
|
|
5
|
+
export * from './app-graph-builder';
|
|
6
|
+
export * from './compute-runtime';
|
|
7
|
+
export * from './operation-resolver';
|
|
8
|
+
export * from './react-surface';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
+
import { Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { Function, Script, Trigger } from '@dxos/functions';
|
|
10
|
+
import { type DXN } from '@dxos/keys';
|
|
11
|
+
import { Operation, OperationResolver } from '@dxos/operation';
|
|
12
|
+
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
13
|
+
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
14
|
+
import { Filter } from '@dxos/react-client/echo';
|
|
15
|
+
|
|
16
|
+
import { AutomationOperation } from '../../types';
|
|
17
|
+
|
|
18
|
+
export default Capability.makeModule(
|
|
19
|
+
Effect.fnUntraced(function* () {
|
|
20
|
+
return Capability.contributes(Common.Capability.OperationResolver, [
|
|
21
|
+
OperationResolver.make({
|
|
22
|
+
operation: AutomationOperation.CreateTriggerFromTemplate,
|
|
23
|
+
handler: Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
24
|
+
const trigger = Trigger.make({ enabled, input });
|
|
25
|
+
|
|
26
|
+
// TODO(wittjosiah): Factor out function lookup by script name?
|
|
27
|
+
if (scriptName) {
|
|
28
|
+
const scripts = yield* Effect.promise(() =>
|
|
29
|
+
db.query(Filter.type(Script.Script, { name: scriptName })).run(),
|
|
30
|
+
);
|
|
31
|
+
const [script] = scripts;
|
|
32
|
+
if (script) {
|
|
33
|
+
const functions = yield* Effect.promise(() =>
|
|
34
|
+
db.query(Filter.type(Function.Function, { source: Ref.make(script) })).run(),
|
|
35
|
+
);
|
|
36
|
+
const [fn] = functions;
|
|
37
|
+
if (fn) {
|
|
38
|
+
Obj.change(trigger, (t) => {
|
|
39
|
+
t.function = Ref.make(fn);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
switch (template.type) {
|
|
46
|
+
case 'timer': {
|
|
47
|
+
Obj.change(trigger, (t) => {
|
|
48
|
+
t.spec = { kind: 'timer', cron: template.cron };
|
|
49
|
+
});
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 'queue': {
|
|
53
|
+
Obj.change(trigger, (t) => {
|
|
54
|
+
t.spec = {
|
|
55
|
+
kind: 'queue',
|
|
56
|
+
queue: (template.queueDXN as DXN).toString(),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
default: {
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
67
|
+
object: trigger,
|
|
68
|
+
target: db,
|
|
69
|
+
hidden: true,
|
|
70
|
+
});
|
|
71
|
+
yield* Operation.invoke(Common.LayoutOperation.Open, {
|
|
72
|
+
subject: [`automation-settings${ATTENDABLE_PATH_SEPARATOR}${db.spaceId}`],
|
|
73
|
+
workspace: db.spaceId,
|
|
74
|
+
});
|
|
75
|
+
}),
|
|
76
|
+
}),
|
|
77
|
+
]);
|
|
78
|
+
}),
|
|
79
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
9
|
+
import { useLayout } from '@dxos/app-framework/react';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { getSpace, parseId, useSpace } from '@dxos/react-client/echo';
|
|
12
|
+
|
|
13
|
+
import { AutomationSettings, FunctionsContainer } from '../../components';
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(() =>
|
|
17
|
+
Effect.succeed(
|
|
18
|
+
Capability.contributes(Common.Capability.ReactSurface, [
|
|
19
|
+
Common.createSurface({
|
|
20
|
+
id: `${meta.id}/space-settings-functions`,
|
|
21
|
+
role: 'article',
|
|
22
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-functions`,
|
|
23
|
+
component: () => {
|
|
24
|
+
const layout = useLayout();
|
|
25
|
+
const { spaceId } = parseId(layout.workspace);
|
|
26
|
+
const space = useSpace(spaceId);
|
|
27
|
+
if (!space) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return <FunctionsContainer space={space} />;
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
Common.createSurface({
|
|
35
|
+
id: `${meta.id}/space-settings-automation`,
|
|
36
|
+
role: 'article',
|
|
37
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-automation`,
|
|
38
|
+
component: () => {
|
|
39
|
+
const layout = useLayout();
|
|
40
|
+
const { spaceId } = parseId(layout.workspace);
|
|
41
|
+
const space = useSpace(spaceId);
|
|
42
|
+
if (!space) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return <AutomationSettings space={space} />;
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
Common.createSurface({
|
|
50
|
+
id: `${meta.id}/companion/automation`,
|
|
51
|
+
role: 'article',
|
|
52
|
+
filter: (data): data is { companionTo: Obj.Unknown; subject: 'automation' } =>
|
|
53
|
+
Obj.isObject(data.companionTo) && data.subject === 'automation',
|
|
54
|
+
component: ({ data }) => {
|
|
55
|
+
return <AutomationSettings space={getSpace(data.companionTo)!} object={data.companionTo} />;
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
]),
|
|
59
|
+
),
|
|
60
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { queue } from './queue';
|
|
8
|
+
import { subscription } from './subscription';
|
|
9
|
+
import { timer } from './timer';
|
|
10
|
+
|
|
11
|
+
export const create = Command.make('create').pipe(
|
|
12
|
+
Command.withDescription('Create a trigger.'),
|
|
13
|
+
Command.withSubcommands([subscription, timer, queue]),
|
|
14
|
+
);
|