@dxos/plugin-automation 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
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-GH5TMGD6.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-M6VFFEWK.mjs +37 -0
- package/dist/lib/browser/AutomationSettings-M6VFFEWK.mjs.map +7 -0
- package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs +43 -0
- package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-ZX4J75UM.mjs → FunctionsPanel-NMA4RYJL.mjs} +3 -3
- package/dist/lib/browser/FunctionsRegistry-TMKAEG5E.mjs +10 -0
- package/dist/lib/browser/TriggerSettings-56AIMOEC.mjs +11 -0
- package/dist/lib/browser/{app-graph-builder-LAQMEBMH.mjs → app-graph-builder-74ILZP25.mjs} +19 -20
- package/dist/lib/browser/app-graph-builder-74ILZP25.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QW3EM35H.mjs → chunk-24ZULVVT.mjs} +60 -15
- package/dist/lib/browser/chunk-24ZULVVT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BFUIVUQH.mjs → chunk-75XLBFAG.mjs} +11 -16
- package/dist/lib/browser/chunk-75XLBFAG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YWLEY2FD.mjs → chunk-7HT7OLB5.mjs} +119 -50
- package/dist/lib/browser/chunk-7HT7OLB5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PZNBEKO5.mjs → chunk-EL64ZPPN.mjs} +2 -2
- package/dist/lib/browser/{chunk-PZNBEKO5.mjs.map → chunk-EL64ZPPN.mjs.map} +1 -1
- package/dist/lib/browser/{FunctionsContainer-6QLC7JP4.mjs → chunk-FUVAC5EC.mjs} +15 -48
- package/dist/lib/browser/chunk-FUVAC5EC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JOXPQ27I.mjs → chunk-GVHAETEQ.mjs} +7 -7
- package/dist/lib/browser/chunk-GVHAETEQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-H2MV4XE6.mjs +31 -0
- package/dist/lib/browser/chunk-H2MV4XE6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RAF2FJST.mjs → chunk-OAZ2JYXV.mjs} +19 -12
- package/dist/lib/browser/chunk-OAZ2JYXV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BKFQBKYO.mjs → chunk-Z7F7X2C5.mjs} +2 -2
- package/dist/lib/browser/cli/index.mjs +62 -54
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{compute-runtime-WTWLQ67J.mjs → compute-runtime-F3UMRKCL.mjs} +28 -18
- package/dist/lib/browser/compute-runtime-F3UMRKCL.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +3 -3
- package/dist/lib/browser/index.mjs +26 -25
- 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 → operation-resolver-IRC2DZU7.mjs} +11 -9
- package/dist/lib/browser/operation-resolver-IRC2DZU7.mjs.map +7 -0
- package/dist/lib/browser/react-surface-RCVPEK2V.mjs +65 -0
- package/dist/lib/browser/react-surface-RCVPEK2V.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{AutomationPanel-B7NAGDFA.mjs → AutomationPanel-7LW44A5O.mjs} +4 -4
- package/dist/lib/node-esm/AutomationPanel-7LW44A5O.mjs.map +7 -0
- package/dist/lib/node-esm/AutomationSettings-EYJ4YLYT.mjs +38 -0
- package/dist/lib/node-esm/AutomationSettings-EYJ4YLYT.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs +44 -0
- package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-SS6GIVNU.mjs → FunctionsPanel-DCXXLSVP.mjs} +3 -3
- package/dist/lib/node-esm/FunctionsPanel-DCXXLSVP.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs +11 -0
- package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs +12 -0
- package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-4UCMXHYY.mjs → app-graph-builder-VDXPOWCH.mjs} +19 -20
- package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HQLVREIX.mjs → chunk-2UF55HSG.mjs} +19 -12
- package/dist/lib/node-esm/chunk-2UF55HSG.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2CKVH7JC.mjs → chunk-37CFAD4Y.mjs} +119 -50
- package/dist/lib/node-esm/chunk-37CFAD4Y.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-RX52VKI2.mjs → chunk-6B4WZRVH.mjs} +7 -7
- package/dist/lib/node-esm/chunk-6B4WZRVH.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsContainer-J4O2ULWR.mjs → chunk-6JVB3IHW.mjs} +15 -48
- package/dist/lib/node-esm/chunk-6JVB3IHW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JVUE5PMI.mjs +32 -0
- package/dist/lib/node-esm/chunk-JVUE5PMI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KWKWOGS5.mjs → chunk-K7T2MVB7.mjs} +11 -16
- package/dist/lib/node-esm/chunk-K7T2MVB7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LJAXQ6CX.mjs → chunk-QUJ4MTMR.mjs} +60 -15
- package/dist/lib/node-esm/chunk-QUJ4MTMR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-K7GCM342.mjs → chunk-R5YEWJCG.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-5FXNN3MV.mjs → chunk-WC5AT7B3.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-5FXNN3MV.mjs.map → chunk-WC5AT7B3.mjs.map} +1 -1
- package/dist/lib/node-esm/cli/index.mjs +62 -54
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{compute-runtime-ZHROOBLY.mjs → compute-runtime-AMFVJMF2.mjs} +28 -18
- package/dist/lib/node-esm/compute-runtime-AMFVJMF2.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +3 -3
- package/dist/lib/node-esm/index.mjs +26 -25
- 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 → operation-resolver-CBLQHL4N.mjs} +11 -9
- package/dist/lib/node-esm/operation-resolver-CBLQHL4N.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-S6VZJCEZ.mjs → react-surface-X4ZKOBC3.mjs} +25 -25
- package/dist/lib/node-esm/react-surface-X4ZKOBC3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +1 -1
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/util.d.ts +2 -2
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +3 -4
- 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/FunctionsRegistry/index.d.ts +3 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +2 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +3 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +3 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.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 +2 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +3 -3
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -46
- package/src/AutomationPlugin.tsx +7 -6
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +17 -15
- package/src/capabilities/compute-runtime/compute-runtime.ts +26 -13
- package/src/capabilities/operation-resolver/operation-resolver.ts +7 -6
- package/src/capabilities/react-surface/react-surface.tsx +16 -19
- package/src/cli/commands/trigger/create/queue.ts +4 -4
- package/src/cli/commands/trigger/create/subscription.ts +4 -4
- package/src/cli/commands/trigger/create/timer.ts +4 -4
- package/src/cli/commands/trigger/list.ts +2 -2
- package/src/cli/commands/trigger/remove.ts +2 -2
- package/src/cli/commands/trigger/update/queue.ts +5 -5
- package/src/cli/commands/trigger/update/subscription.ts +5 -5
- package/src/cli/commands/trigger/update/timer.ts +5 -5
- package/src/cli/commands/trigger/util.ts +34 -25
- package/src/cli/plugin.ts +3 -2
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +3 -3
- package/src/components/AutomationPanel/AutomationPanel.tsx +137 -69
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +9 -11
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +9 -10
- package/src/components/FunctionsRegistry/index.ts +4 -1
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +13 -4
- package/src/components/TriggerEditor/SpecSelector.tsx +1 -1
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +46 -4
- package/src/components/TriggerEditor/TriggerEditor.tsx +37 -6
- package/src/components/index.ts +1 -2
- package/src/{components → containers/AutomationSettings}/AutomationSettings.tsx +8 -11
- package/src/containers/AutomationSettings/index.ts +7 -0
- package/src/{components → containers/FunctionsContainer}/FunctionsContainer.tsx +10 -13
- package/src/containers/FunctionsContainer/index.ts +7 -0
- package/src/containers/TriggerSettings/TriggerSettings.tsx +26 -0
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/useComputeRuntimeCallback.ts +1 -1
- package/src/hooks/useTriggerRuntimeControls.ts +22 -8
- package/src/meta.ts +1 -1
- package/src/testing/test-functions.ts +5 -5
- package/src/translations.ts +2 -0
- package/src/types/capabilities.ts +3 -2
- package/src/types/events.ts +1 -1
- package/src/types/schema.ts +3 -3
- package/dist/lib/browser/AutomationPanel-FAS6ADCW.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs +0 -56
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-54PANILA.mjs +0 -14
- package/dist/lib/browser/chunk-54PANILA.mjs.map +0 -7
- package/dist/lib/browser/chunk-BFUIVUQH.mjs.map +0 -7
- package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +0 -7
- package/dist/lib/browser/chunk-QW3EM35H.mjs.map +0 -7
- package/dist/lib/browser/chunk-RAF2FJST.mjs.map +0 -7
- package/dist/lib/browser/chunk-YWLEY2FD.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EV3AC62F.mjs +0 -65
- package/dist/lib/browser/react-surface-EV3AC62F.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs +0 -57
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2CKVH7JC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7QRUPEHH.mjs +0 -16
- package/dist/lib/node-esm/chunk-7QRUPEHH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HQLVREIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KWKWOGS5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs.map +0 -7
- package/dist/types/src/components/AutomationSettings.d.ts +0 -5
- package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
- package/src/components/TriggerSettings.tsx +0 -25
- /package/dist/lib/browser/{AutomationPanel-FAS6ADCW.mjs.map → AutomationPanel-GH5TMGD6.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-ZX4J75UM.mjs.map → FunctionsPanel-NMA4RYJL.mjs.map} +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-B7NAGDFA.mjs.map → browser/FunctionsRegistry-TMKAEG5E.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-SS6GIVNU.mjs.map → browser/TriggerSettings-56AIMOEC.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-BKFQBKYO.mjs.map → chunk-Z7F7X2C5.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-K7GCM342.mjs.map → chunk-R5YEWJCG.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-automation",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.6fa680abb7",
|
|
4
4
|
"description": "Prompt chain plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -54,62 +54,66 @@
|
|
|
54
54
|
"src"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@effect/
|
|
58
|
-
"@effect/
|
|
59
|
-
"@effect/
|
|
57
|
+
"@effect-atom/atom": "^0.5.1",
|
|
58
|
+
"@effect/ai": "0.33.2",
|
|
59
|
+
"@effect/cli": "0.73.2",
|
|
60
|
+
"@effect/platform-browser": "0.74.0",
|
|
60
61
|
"@effect/printer-ansi": "0.47.0",
|
|
61
|
-
"@dxos/ai": "0.8.4-main.
|
|
62
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/plugin-
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/react-ui-
|
|
86
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/schema": "0.8.4-main.
|
|
90
|
-
"@dxos/
|
|
62
|
+
"@dxos/ai": "0.8.4-main.6fa680abb7",
|
|
63
|
+
"@dxos/app-framework": "0.8.4-main.6fa680abb7",
|
|
64
|
+
"@dxos/app-toolkit": "0.8.4-main.6fa680abb7",
|
|
65
|
+
"@dxos/assistant": "0.8.4-main.6fa680abb7",
|
|
66
|
+
"@dxos/async": "0.8.4-main.6fa680abb7",
|
|
67
|
+
"@dxos/cli-util": "0.8.4-main.6fa680abb7",
|
|
68
|
+
"@dxos/client": "0.8.4-main.6fa680abb7",
|
|
69
|
+
"@dxos/context": "0.8.4-main.6fa680abb7",
|
|
70
|
+
"@dxos/conductor": "0.8.4-main.6fa680abb7",
|
|
71
|
+
"@dxos/echo-db": "0.8.4-main.6fa680abb7",
|
|
72
|
+
"@dxos/echo": "0.8.4-main.6fa680abb7",
|
|
73
|
+
"@dxos/echo-atom": "0.8.4-main.6fa680abb7",
|
|
74
|
+
"@dxos/effect": "0.8.4-main.6fa680abb7",
|
|
75
|
+
"@dxos/functions": "0.8.4-main.6fa680abb7",
|
|
76
|
+
"@dxos/invariant": "0.8.4-main.6fa680abb7",
|
|
77
|
+
"@dxos/functions-runtime": "0.8.4-main.6fa680abb7",
|
|
78
|
+
"@dxos/operation": "0.8.4-main.6fa680abb7",
|
|
79
|
+
"@dxos/keys": "0.8.4-main.6fa680abb7",
|
|
80
|
+
"@dxos/plugin-client": "0.8.4-main.6fa680abb7",
|
|
81
|
+
"@dxos/log": "0.8.4-main.6fa680abb7",
|
|
82
|
+
"@dxos/plugin-graph": "0.8.4-main.6fa680abb7",
|
|
83
|
+
"@dxos/plugin-deck": "0.8.4-main.6fa680abb7",
|
|
84
|
+
"@dxos/plugin-space": "0.8.4-main.6fa680abb7",
|
|
85
|
+
"@dxos/random": "0.8.4-main.6fa680abb7",
|
|
86
|
+
"@dxos/react-ui-editor": "0.8.4-main.6fa680abb7",
|
|
87
|
+
"@dxos/react-ui-form": "0.8.4-main.6fa680abb7",
|
|
88
|
+
"@dxos/react-ui-components": "0.8.4-main.6fa680abb7",
|
|
89
|
+
"@dxos/react-ui-stack": "0.8.4-main.6fa680abb7",
|
|
90
|
+
"@dxos/schema": "0.8.4-main.6fa680abb7",
|
|
91
|
+
"@dxos/react-ui-list": "0.8.4-main.6fa680abb7",
|
|
92
|
+
"@dxos/types": "0.8.4-main.6fa680abb7",
|
|
93
|
+
"@dxos/util": "0.8.4-main.6fa680abb7",
|
|
94
|
+
"@dxos/react-client": "0.8.4-main.6fa680abb7"
|
|
91
95
|
},
|
|
92
96
|
"devDependencies": {
|
|
93
|
-
"@effect-atom/atom-react": "^0.
|
|
94
|
-
"@effect/platform": "0.
|
|
97
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
98
|
+
"@effect/platform": "0.94.4",
|
|
95
99
|
"@types/react": "~19.2.7",
|
|
96
100
|
"@types/react-dom": "~19.2.3",
|
|
97
|
-
"effect": "3.19.
|
|
101
|
+
"effect": "3.19.16",
|
|
98
102
|
"react": "~19.2.3",
|
|
99
103
|
"react-dom": "~19.2.3",
|
|
100
|
-
"vite": "7.1.
|
|
101
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
102
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
103
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
104
|
+
"vite": "^7.1.11",
|
|
105
|
+
"@dxos/react-ui": "0.8.4-main.6fa680abb7",
|
|
106
|
+
"@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
|
|
107
|
+
"@dxos/ui-theme": "0.8.4-main.6fa680abb7"
|
|
104
108
|
},
|
|
105
109
|
"peerDependencies": {
|
|
106
|
-
"@effect-atom/atom-react": "^0.
|
|
107
|
-
"@effect/platform": "0.
|
|
108
|
-
"effect": "3.19.
|
|
110
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
111
|
+
"@effect/platform": "0.94.4",
|
|
112
|
+
"effect": "3.19.16",
|
|
109
113
|
"react": "~19.2.3",
|
|
110
114
|
"react-dom": "~19.2.3",
|
|
111
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
112
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
115
|
+
"@dxos/react-ui": "0.8.4-main.6fa680abb7",
|
|
116
|
+
"@dxos/ui-theme": "0.8.4-main.6fa680abb7"
|
|
113
117
|
},
|
|
114
118
|
"publishConfig": {
|
|
115
119
|
"access": "public"
|
package/src/AutomationPlugin.tsx
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
import { Function, Trigger } from '@dxos/functions';
|
|
7
8
|
import { ClientEvents } from '@dxos/plugin-client/types';
|
|
8
9
|
|
|
@@ -12,11 +13,11 @@ import { translations } from './translations';
|
|
|
12
13
|
import { AutomationEvents } from './types';
|
|
13
14
|
|
|
14
15
|
export const AutomationPlugin = Plugin.define(meta).pipe(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
17
|
+
AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
18
|
+
AppPlugin.addSchemaModule({ schema: [Function.Function, Trigger.Trigger] }),
|
|
19
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
20
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
20
21
|
Plugin.addModule({
|
|
21
22
|
activatesOn: ClientEvents.ClientReady,
|
|
22
23
|
activatesAfter: [AutomationEvents.ComputeRuntimeReady],
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { Script } from '@dxos/functions';
|
|
9
|
-
import {
|
|
10
|
+
import { COMPANION_PREFIX } from '@dxos/app-toolkit';
|
|
11
|
+
import { PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
10
12
|
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
13
|
import { meta as spaceMeta } from '@dxos/plugin-space';
|
|
12
14
|
|
|
@@ -16,14 +18,14 @@ export default Capability.makeModule(
|
|
|
16
18
|
Effect.fnUntraced(function* () {
|
|
17
19
|
const extensions = yield* Effect.all([
|
|
18
20
|
GraphBuilder.createExtension({
|
|
19
|
-
id: `${meta.id}
|
|
20
|
-
match: NodeMatcher.whenNodeType(`${spaceMeta.id}
|
|
21
|
+
id: `${meta.id}.space-settings-automation`,
|
|
22
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
21
23
|
connector: (node) =>
|
|
22
24
|
Effect.succeed([
|
|
23
25
|
{
|
|
24
|
-
id:
|
|
25
|
-
type: `${meta.id}
|
|
26
|
-
data: `${meta.id}
|
|
26
|
+
id: `${meta.id}.automations`,
|
|
27
|
+
type: `${meta.id}.space-settings-automation`,
|
|
28
|
+
data: `${meta.id}.space-settings-automation`,
|
|
27
29
|
properties: {
|
|
28
30
|
label: ['automation panel label', { ns: meta.id }],
|
|
29
31
|
icon: 'ph--lightning--regular',
|
|
@@ -32,14 +34,14 @@ export default Capability.makeModule(
|
|
|
32
34
|
]),
|
|
33
35
|
}),
|
|
34
36
|
GraphBuilder.createExtension({
|
|
35
|
-
id: `${meta.id}
|
|
36
|
-
match: NodeMatcher.whenNodeType(`${spaceMeta.id}
|
|
37
|
+
id: `${meta.id}.space-settings-functions`,
|
|
38
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
37
39
|
connector: (node) =>
|
|
38
40
|
Effect.succeed([
|
|
39
41
|
{
|
|
40
|
-
id:
|
|
41
|
-
type: `${meta.id}
|
|
42
|
-
data: `${meta.id}
|
|
42
|
+
id: `${meta.id}.functions`,
|
|
43
|
+
type: `${meta.id}.space-settings-functions`,
|
|
44
|
+
data: `${meta.id}.space-settings-functions`,
|
|
43
45
|
properties: {
|
|
44
46
|
label: ['functions panel label', { ns: meta.id }],
|
|
45
47
|
icon: 'ph--function--regular',
|
|
@@ -48,12 +50,12 @@ export default Capability.makeModule(
|
|
|
48
50
|
]),
|
|
49
51
|
}),
|
|
50
52
|
GraphBuilder.createTypeExtension({
|
|
51
|
-
id: `${meta.id}
|
|
53
|
+
id: `${meta.id}.script-companion`,
|
|
52
54
|
type: Script.Script,
|
|
53
55
|
connector: (script) =>
|
|
54
56
|
Effect.succeed([
|
|
55
57
|
{
|
|
56
|
-
id:
|
|
58
|
+
id: `${COMPANION_PREFIX}automation`,
|
|
57
59
|
type: PLANK_COMPANION_TYPE,
|
|
58
60
|
data: 'automation',
|
|
59
61
|
properties: {
|
|
@@ -66,6 +68,6 @@ export default Capability.makeModule(
|
|
|
66
68
|
}),
|
|
67
69
|
]);
|
|
68
70
|
|
|
69
|
-
return Capability.contributes(
|
|
71
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
70
72
|
}),
|
|
71
73
|
);
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as BrowserKeyValueStore from '@effect/platform-browser/BrowserKeyValueStore';
|
|
6
|
+
import { Registry } from '@effect-atom/atom';
|
|
6
7
|
import * as Effect from 'effect/Effect';
|
|
7
8
|
import * as Layer from 'effect/Layer';
|
|
8
9
|
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
11
|
+
import { GenericToolkit } from '@dxos/ai';
|
|
12
|
+
import { Capabilities, Capability, type CapabilityManager } from '@dxos/app-framework';
|
|
13
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
14
|
+
import { ToolExecutionServices } from '@dxos/assistant';
|
|
12
15
|
import { SpaceProperties } from '@dxos/client/echo';
|
|
13
16
|
import { Resource } from '@dxos/context';
|
|
14
|
-
import { Database, Obj, Query, Ref } from '@dxos/echo';
|
|
17
|
+
import { Database, Feed, Obj, Query, Ref } from '@dxos/echo';
|
|
18
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
15
19
|
import { CredentialsService, QueueService } from '@dxos/functions';
|
|
16
20
|
import {
|
|
17
21
|
FunctionImplementationResolver,
|
|
@@ -65,30 +69,38 @@ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilit
|
|
|
65
69
|
Effect.gen(this, function* () {
|
|
66
70
|
const client = this.#capabilities.get(ClientCapabilities.Client);
|
|
67
71
|
const aiServiceLayer =
|
|
68
|
-
this.#capabilities.get(
|
|
72
|
+
this.#capabilities.get(AppCapabilities.AiServiceLayer) ?? Layer.die('AiService not found');
|
|
73
|
+
const registry = this.#capabilities.get(Capabilities.AtomRegistry);
|
|
69
74
|
|
|
70
75
|
// TODO(dmaretskyi): Make these reactive.
|
|
71
|
-
const functions =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
const functions = [
|
|
77
|
+
...this.#capabilities.getAll(AppCapabilities.Functions).flat(),
|
|
78
|
+
...this.#capabilities.getAll(AppCapabilities.BlueprintDefinition).flatMap((blueprint) => blueprint.functions),
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
const genericToolkitProvider = Layer.succeed(GenericToolkit.Provider, {
|
|
82
|
+
getToolkit: () => {
|
|
83
|
+
const toolkits = this.#capabilities.getAll(AppCapabilities.Toolkit);
|
|
84
|
+
return GenericToolkit.merge(...toolkits);
|
|
85
|
+
},
|
|
86
|
+
});
|
|
76
87
|
|
|
77
88
|
const space = client.spaces.get(spaceId);
|
|
78
89
|
invariant(space, `Invalid space: ${spaceId}`);
|
|
79
90
|
yield* Effect.promise(() => space.waitUntilReady());
|
|
80
91
|
|
|
81
92
|
return Layer.mergeAll(TriggerDispatcher.layer({ timeControl: 'natural' })).pipe(
|
|
93
|
+
Layer.provideMerge(Layer.succeed(Registry.AtomRegistry, registry)),
|
|
82
94
|
Layer.provideMerge(
|
|
83
95
|
Layer.mergeAll(
|
|
84
96
|
TracingServiceLive,
|
|
85
97
|
TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
|
|
86
|
-
|
|
87
|
-
makeToolExecutionServiceFromFunctions(toolkit, toolkitLayer),
|
|
98
|
+
ToolExecutionServices,
|
|
88
99
|
),
|
|
89
100
|
),
|
|
90
101
|
Layer.provideMerge(
|
|
91
102
|
FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(
|
|
103
|
+
Layer.provideMerge(genericToolkitProvider),
|
|
92
104
|
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions })),
|
|
93
105
|
Layer.provideMerge(
|
|
94
106
|
RemoteFunctionExecutionService.fromClient(
|
|
@@ -99,8 +111,9 @@ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilit
|
|
|
99
111
|
),
|
|
100
112
|
Layer.provideMerge(aiServiceLayer),
|
|
101
113
|
Layer.provideMerge(CredentialsService.layerFromDatabase()),
|
|
102
|
-
Layer.provideMerge(space ? Database.
|
|
114
|
+
Layer.provideMerge(space ? Database.layer(space.db) : Database.notAvailable),
|
|
103
115
|
Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
|
|
116
|
+
Layer.provideMerge(space ? createFeedServiceLayer(space.queues) : Feed.notAvailable),
|
|
104
117
|
),
|
|
105
118
|
),
|
|
106
119
|
);
|
|
@@ -115,7 +128,7 @@ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilit
|
|
|
115
128
|
|
|
116
129
|
const TracingServiceLive = Layer.unwrapEffect(
|
|
117
130
|
Effect.gen(function* () {
|
|
118
|
-
const objects = yield* Database.
|
|
131
|
+
const objects = yield* Database.runQuery(Query.type(SpaceProperties));
|
|
119
132
|
const [properties] = objects;
|
|
120
133
|
invariant(properties);
|
|
121
134
|
// TODO(burdon): Check ref target has loaded?
|
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
8
9
|
import { Obj, Ref } from '@dxos/echo';
|
|
9
10
|
import { Function, Script, Trigger } from '@dxos/functions';
|
|
10
11
|
import { type DXN } from '@dxos/keys';
|
|
11
12
|
import { Operation, OperationResolver } from '@dxos/operation';
|
|
12
|
-
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
13
13
|
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
14
14
|
import { Filter } from '@dxos/react-client/echo';
|
|
15
15
|
|
|
16
|
+
import { meta } from '../../meta';
|
|
16
17
|
import { AutomationOperation } from '../../types';
|
|
17
18
|
|
|
18
19
|
export default Capability.makeModule(
|
|
19
20
|
Effect.fnUntraced(function* () {
|
|
20
|
-
return Capability.contributes(
|
|
21
|
+
return Capability.contributes(Capabilities.OperationResolver, [
|
|
21
22
|
OperationResolver.make({
|
|
22
23
|
operation: AutomationOperation.CreateTriggerFromTemplate,
|
|
23
24
|
handler: Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
@@ -68,9 +69,9 @@ export default Capability.makeModule(
|
|
|
68
69
|
target: db,
|
|
69
70
|
hidden: true,
|
|
70
71
|
});
|
|
71
|
-
yield* Operation.invoke(
|
|
72
|
-
subject: [
|
|
73
|
-
workspace: db.spaceId,
|
|
72
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
73
|
+
subject: [`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`],
|
|
74
|
+
workspace: getSpacePath(db.spaceId),
|
|
74
75
|
});
|
|
75
76
|
}),
|
|
76
77
|
}),
|
|
@@ -5,25 +5,24 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
|
-
import {
|
|
11
|
+
import { useActiveSpace } from '@dxos/plugin-space';
|
|
12
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
12
13
|
|
|
13
|
-
import { AutomationSettings, FunctionsContainer } from '../../
|
|
14
|
+
import { AutomationSettings, FunctionsContainer } from '../../containers';
|
|
14
15
|
import { meta } from '../../meta';
|
|
15
16
|
|
|
16
17
|
export default Capability.makeModule(() =>
|
|
17
18
|
Effect.succeed(
|
|
18
|
-
Capability.contributes(
|
|
19
|
-
|
|
20
|
-
id: `${meta.id}
|
|
19
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
20
|
+
Surface.create({
|
|
21
|
+
id: `${meta.id}.space-settings-functions`,
|
|
21
22
|
role: 'article',
|
|
22
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}
|
|
23
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}.space-settings-functions`,
|
|
23
24
|
component: () => {
|
|
24
|
-
const
|
|
25
|
-
const { spaceId } = parseId(layout.workspace);
|
|
26
|
-
const space = useSpace(spaceId);
|
|
25
|
+
const space = useActiveSpace();
|
|
27
26
|
if (!space) {
|
|
28
27
|
return null;
|
|
29
28
|
}
|
|
@@ -31,14 +30,12 @@ export default Capability.makeModule(() =>
|
|
|
31
30
|
return <FunctionsContainer space={space} />;
|
|
32
31
|
},
|
|
33
32
|
}),
|
|
34
|
-
|
|
35
|
-
id: `${meta.id}
|
|
33
|
+
Surface.create({
|
|
34
|
+
id: `${meta.id}.space-settings-automation`,
|
|
36
35
|
role: 'article',
|
|
37
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}
|
|
36
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}.space-settings-automation`,
|
|
38
37
|
component: () => {
|
|
39
|
-
const
|
|
40
|
-
const { spaceId } = parseId(layout.workspace);
|
|
41
|
-
const space = useSpace(spaceId);
|
|
38
|
+
const space = useActiveSpace();
|
|
42
39
|
if (!space) {
|
|
43
40
|
return null;
|
|
44
41
|
}
|
|
@@ -46,8 +43,8 @@ export default Capability.makeModule(() =>
|
|
|
46
43
|
return <AutomationSettings space={space} />;
|
|
47
44
|
},
|
|
48
45
|
}),
|
|
49
|
-
|
|
50
|
-
id: `${meta.id}
|
|
46
|
+
Surface.create({
|
|
47
|
+
id: `${meta.id}.companion.automation`,
|
|
51
48
|
role: 'article',
|
|
52
49
|
filter: (data): data is { companionTo: Obj.Unknown; subject: 'automation' } =>
|
|
53
50
|
Obj.isObject(data.companionTo) && data.subject === 'automation',
|
|
@@ -13,7 +13,7 @@ import * as Option from 'effect/Option';
|
|
|
13
13
|
import { CommandConfig } from '@dxos/cli-util';
|
|
14
14
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
15
15
|
import { Common } from '@dxos/cli-util';
|
|
16
|
-
import { Database, Filter,
|
|
16
|
+
import { Database, Filter, JsonSchema, Ref } from '@dxos/echo';
|
|
17
17
|
import { Function, Trigger } from '@dxos/functions';
|
|
18
18
|
|
|
19
19
|
import { Enabled, Input, Queue } from '../options';
|
|
@@ -36,7 +36,7 @@ export const queue = Command.make(
|
|
|
36
36
|
onNone: () => selectFunction(),
|
|
37
37
|
onSome: (id) => Effect.succeed(id),
|
|
38
38
|
});
|
|
39
|
-
const functions = yield* Database.
|
|
39
|
+
const functions = yield* Database.runQuery(Filter.type(Function.Function));
|
|
40
40
|
const fn = functions.find((fn) => fn.id === functionId);
|
|
41
41
|
if (!fn) {
|
|
42
42
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -48,7 +48,7 @@ export const queue = Command.make(
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const input = yield* Option.match(options.input, {
|
|
51
|
-
onNone: () => promptForSchemaInput(fn.inputSchema ?
|
|
51
|
+
onNone: () => promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined),
|
|
52
52
|
onSome: (value) => Effect.succeed(Object.fromEntries(HashMap.toEntries(value))),
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -72,7 +72,7 @@ export const queue = Command.make(
|
|
|
72
72
|
input,
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
yield* Database.
|
|
75
|
+
yield* Database.add(trigger);
|
|
76
76
|
|
|
77
77
|
if (json) {
|
|
78
78
|
yield* Console.log(JSON.stringify(trigger, null, 2));
|
|
@@ -13,7 +13,7 @@ import * as Option from 'effect/Option';
|
|
|
13
13
|
import { CommandConfig } from '@dxos/cli-util';
|
|
14
14
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
15
15
|
import { Common } from '@dxos/cli-util';
|
|
16
|
-
import { Database, Filter, Query, Ref
|
|
16
|
+
import { Database, Filter, JsonSchema, Query, Ref } from '@dxos/echo';
|
|
17
17
|
import { Function, Trigger } from '@dxos/functions';
|
|
18
18
|
|
|
19
19
|
import { Deep, Delay, Enabled, Input, Typename } from '../options';
|
|
@@ -38,7 +38,7 @@ export const subscription = Command.make(
|
|
|
38
38
|
onNone: () => selectFunction(),
|
|
39
39
|
onSome: (id) => Effect.succeed(id),
|
|
40
40
|
});
|
|
41
|
-
const functions = yield* Database.
|
|
41
|
+
const functions = yield* Database.runQuery(Filter.type(Function.Function));
|
|
42
42
|
const fn = functions.find((fn) => fn.id === functionId);
|
|
43
43
|
if (!fn) {
|
|
44
44
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -85,7 +85,7 @@ export const subscription = Command.make(
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
const input = yield* Option.match(options.input, {
|
|
88
|
-
onNone: () => promptForSchemaInput(fn.inputSchema ?
|
|
88
|
+
onNone: () => promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined),
|
|
89
89
|
onSome: (value) => Effect.succeed(Object.fromEntries(HashMap.toEntries(value))),
|
|
90
90
|
});
|
|
91
91
|
|
|
@@ -111,7 +111,7 @@ export const subscription = Command.make(
|
|
|
111
111
|
},
|
|
112
112
|
input,
|
|
113
113
|
});
|
|
114
|
-
yield* Database.
|
|
114
|
+
yield* Database.add(trigger);
|
|
115
115
|
|
|
116
116
|
if (json) {
|
|
117
117
|
yield* Console.log(JSON.stringify(trigger, null, 2));
|
|
@@ -13,7 +13,7 @@ import * as Option from 'effect/Option';
|
|
|
13
13
|
import { CommandConfig } from '@dxos/cli-util';
|
|
14
14
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
15
15
|
import { Common } from '@dxos/cli-util';
|
|
16
|
-
import { Database, Filter,
|
|
16
|
+
import { Database, Filter, JsonSchema, Ref } from '@dxos/echo';
|
|
17
17
|
import { Function, Trigger } from '@dxos/functions';
|
|
18
18
|
|
|
19
19
|
import { Cron, Enabled, Input } from '../options';
|
|
@@ -37,7 +37,7 @@ export const timer = Command.make(
|
|
|
37
37
|
onNone: () => selectFunction(),
|
|
38
38
|
onSome: (id) => Effect.succeed(id),
|
|
39
39
|
});
|
|
40
|
-
const functions = yield* Database.
|
|
40
|
+
const functions = yield* Database.runQuery(Filter.type(Function.Function));
|
|
41
41
|
const fn = functions.find((fn) => fn.id === functionId);
|
|
42
42
|
if (!fn) {
|
|
43
43
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -52,7 +52,7 @@ export const timer = Command.make(
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
const input = yield* Option.match(options.input, {
|
|
55
|
-
onNone: () => promptForSchemaInput(fn.inputSchema ?
|
|
55
|
+
onNone: () => promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined),
|
|
56
56
|
onSome: (value) => Effect.succeed(Object.fromEntries(HashMap.toEntries(value))),
|
|
57
57
|
});
|
|
58
58
|
|
|
@@ -76,7 +76,7 @@ export const timer = Command.make(
|
|
|
76
76
|
input,
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
yield* Database.
|
|
79
|
+
yield* Database.add(trigger);
|
|
80
80
|
|
|
81
81
|
if (json) {
|
|
82
82
|
yield* Console.log(JSON.stringify(trigger, null, 2));
|
|
@@ -23,13 +23,13 @@ export const list = Command.make(
|
|
|
23
23
|
const { json } = yield* CommandConfig;
|
|
24
24
|
|
|
25
25
|
// Fetch local triggers
|
|
26
|
-
const triggers = yield* Database.
|
|
26
|
+
const triggers = yield* Database.runQuery(Filter.type(Trigger.Trigger));
|
|
27
27
|
|
|
28
28
|
// Fetch remote cron triggers to check availability
|
|
29
29
|
const remoteCronIds = yield* Effect.gen(function* () {
|
|
30
30
|
const client = yield* ClientService;
|
|
31
31
|
const spaceId = yield* spaceIdWithDefault(spaceIdOption);
|
|
32
|
-
const result = yield* Effect.promise(() => client.edge.getCronTriggers(spaceId)).pipe(
|
|
32
|
+
const result = yield* Effect.promise(() => client.edge.http.getCronTriggers(spaceId)).pipe(
|
|
33
33
|
Effect.catchAll(() => Effect.succeed({ cronIds: [] })),
|
|
34
34
|
);
|
|
35
35
|
return result.cronIds;
|
|
@@ -30,8 +30,8 @@ export const remove = Command.make(
|
|
|
30
30
|
onSome: (id) => Effect.succeed(id),
|
|
31
31
|
});
|
|
32
32
|
const dxn = DXN.fromLocalObjectId(triggerId);
|
|
33
|
-
const trigger = yield* Database.
|
|
34
|
-
yield* Database.
|
|
33
|
+
const trigger = yield* Database.resolve(dxn, Trigger.Trigger);
|
|
34
|
+
yield* Database.remove(trigger);
|
|
35
35
|
if (json) {
|
|
36
36
|
yield* Console.log(JSON.stringify({ id: trigger.id, removed: true }, null, 2));
|
|
37
37
|
} else {
|
|
@@ -12,7 +12,7 @@ import * as Option from 'effect/Option';
|
|
|
12
12
|
import { CommandConfig } from '@dxos/cli-util';
|
|
13
13
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
14
14
|
import { Common } from '@dxos/cli-util';
|
|
15
|
-
import { DXN, Database, Filter, Obj, Ref
|
|
15
|
+
import { DXN, Database, Filter, JsonSchema, Obj, Ref } from '@dxos/echo';
|
|
16
16
|
import { Function, Trigger } from '@dxos/functions';
|
|
17
17
|
|
|
18
18
|
import { Enabled, Input, Queue, TriggerId } from '../options';
|
|
@@ -37,7 +37,7 @@ export const queue = Command.make(
|
|
|
37
37
|
onSome: (id) => Effect.succeed(id),
|
|
38
38
|
});
|
|
39
39
|
const dxn = DXN.fromLocalObjectId(triggerId);
|
|
40
|
-
const trigger = yield* Database.
|
|
40
|
+
const trigger = yield* Database.resolve(dxn, Trigger.Trigger);
|
|
41
41
|
if (trigger.spec?.kind !== 'queue') {
|
|
42
42
|
return yield* Effect.fail(new Error(`Invalid trigger type: ${trigger.spec?.kind}`));
|
|
43
43
|
}
|
|
@@ -68,7 +68,7 @@ export const queue = Command.make(
|
|
|
68
68
|
*/
|
|
69
69
|
const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionIdOption: Option.Option<string>) {
|
|
70
70
|
let currentFn: Function.Function | undefined = trigger.function
|
|
71
|
-
? yield* Database.
|
|
71
|
+
? yield* Database.load(trigger.function) as any
|
|
72
72
|
: undefined;
|
|
73
73
|
if (currentFn && !Obj.instanceOf(Function.Function, currentFn)) {
|
|
74
74
|
currentFn = undefined;
|
|
@@ -87,7 +87,7 @@ const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionId
|
|
|
87
87
|
onNone: () => selectFunction(),
|
|
88
88
|
onSome: (id) => Effect.succeed(id),
|
|
89
89
|
});
|
|
90
|
-
const functions = yield* Database.
|
|
90
|
+
const functions = yield* Database.runQuery(Filter.type(Function.Function));
|
|
91
91
|
const foundFn = functions.find((fn) => fn.id === functionId);
|
|
92
92
|
if (!foundFn || !Obj.instanceOf(Function.Function, foundFn)) {
|
|
93
93
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -163,7 +163,7 @@ const updateInput = Effect.fn(function* (
|
|
|
163
163
|
if (shouldChangeInput) {
|
|
164
164
|
const inputObj = yield* Option.match(inputOption, {
|
|
165
165
|
onNone: () =>
|
|
166
|
-
promptForSchemaInput(fn.inputSchema ?
|
|
166
|
+
promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined, currentInput),
|
|
167
167
|
onSome: (value) => Effect.succeed(value as Record<string, any>),
|
|
168
168
|
});
|
|
169
169
|
Obj.change(trigger, (mutableTrigger) => {
|