@dxos/plugin-automation 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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-HFCK3JRB.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-XXZNGORC.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-RAF2FJST.mjs +86 -0
- 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 +5 -3
- package/dist/lib/browser/index.mjs +53 -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-WPMY3EX2.mjs → react-surface-EV3AC62F.mjs} +13 -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-NVEIUIZP.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-74ELGR7P.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-U5Q2NI7H.mjs → chunk-7QRUPEHH.mjs} +5 -5
- package/dist/lib/node-esm/chunk-HQLVREIX.mjs +87 -0
- 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 +5 -3
- package/dist/lib/node-esm/index.mjs +53 -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-Y2BBJV2I.mjs → react-surface-S6VZJCEZ.mjs} +13 -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 +3 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsContainer.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 +8 -0
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +2 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
- 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 +72 -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 +8 -4
- 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 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -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 -47
- 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/compute-runtime.ts +133 -0
- 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.stories.tsx +1 -1
- package/src/components/AutomationPanel/AutomationPanel.tsx +51 -22
- package/src/components/AutomationSettings.tsx +1 -1
- package/src/components/FunctionsContainer.tsx +7 -0
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +14 -12
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +111 -0
- package/src/components/FunctionsRegistry/index.ts +5 -0
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +23 -31
- package/src/components/TriggerEditor/SpecSelector.tsx +8 -6
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +33 -29
- package/src/components/TriggerEditor/TriggerEditor.tsx +56 -43
- package/src/components/TriggerSettings.tsx +3 -3
- package/src/hooks/useComputeRuntimeCallback.ts +43 -8
- package/src/hooks/useTriggerRuntimeControls.ts +9 -8
- package/src/index.ts +1 -2
- package/src/meta.ts +2 -2
- package/src/testing/test-functions.ts +2 -2
- package/src/translations.ts +4 -0
- package/src/{capabilities → types}/capabilities.ts +8 -14
- 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-LBXJDM6Z.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs +0 -68
- package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-IZTCGNJZ.mjs +0 -36
- package/dist/lib/browser/FunctionsContainer-IZTCGNJZ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7VKA2GS3.mjs +0 -81
- package/dist/lib/browser/app-graph-builder-7VKA2GS3.mjs.map +0 -7
- package/dist/lib/browser/chunk-CVYJM6OO.mjs +0 -66
- package/dist/lib/browser/chunk-CVYJM6OO.mjs.map +0 -7
- package/dist/lib/browser/chunk-FHSN7G4H.mjs +0 -107
- package/dist/lib/browser/chunk-FHSN7G4H.mjs.map +0 -7
- package/dist/lib/browser/chunk-GCGHLQM2.mjs +0 -15
- package/dist/lib/browser/chunk-GCGHLQM2.mjs.map +0 -7
- package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
- package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
- package/dist/lib/browser/chunk-K5YNWESC.mjs +0 -183
- package/dist/lib/browser/chunk-K5YNWESC.mjs.map +0 -7
- package/dist/lib/browser/chunk-LZQFZO3B.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-PFYRMGN2.mjs +0 -114
- package/dist/lib/browser/compute-runtime-PFYRMGN2.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-WPMY3EX2.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs +0 -69
- package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-KKRCIXGB.mjs +0 -37
- package/dist/lib/node-esm/FunctionsContainer-KKRCIXGB.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-RTOFJNFV.mjs +0 -82
- package/dist/lib/node-esm/app-graph-builder-RTOFJNFV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs +0 -67
- package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CEVIVRTY.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-JOCKHLFT.mjs +0 -108
- package/dist/lib/node-esm/chunk-JOCKHLFT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MRYKW5TM.mjs +0 -16
- package/dist/lib/node-esm/chunk-MRYKW5TM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
- package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Y7PJXFCJ.mjs +0 -184
- package/dist/lib/node-esm/chunk-Y7PJXFCJ.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-IXCSD3W7.mjs +0 -115
- package/dist/lib/node-esm/compute-runtime-IXCSD3W7.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-Y2BBJV2I.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 -19
- 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/compute-runtime.ts +0 -138
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/capabilities/react-surface.tsx +0 -55
- package/src/events.ts +0 -11
- /package/dist/lib/browser/{AutomationPanel-LBXJDM6Z.mjs.map → AutomationPanel-FAS6ADCW.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-HFCK3JRB.mjs.map → FunctionsPanel-ZX4J75UM.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-XXZNGORC.mjs.map → chunk-54PANILA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{AutomationPanel-NVEIUIZP.mjs.map → AutomationPanel-B7NAGDFA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsPanel-74ELGR7P.mjs.map → FunctionsPanel-SS6GIVNU.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-U5Q2NI7H.mjs.map → chunk-7QRUPEHH.mjs.map} +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { Script } from '@dxos/functions';
|
|
12
|
-
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
13
|
-
import { createExtension } from '@dxos/plugin-graph';
|
|
14
|
-
import { meta as spaceMeta } from '@dxos/plugin-space';
|
|
15
|
-
|
|
16
|
-
import { meta } from '../meta';
|
|
17
|
-
|
|
18
|
-
export default (context: PluginContext) =>
|
|
19
|
-
contributes(Capabilities.AppGraphBuilder, [
|
|
20
|
-
createExtension({
|
|
21
|
-
id: `${meta.id}/space-settings-automation`,
|
|
22
|
-
connector: (node) =>
|
|
23
|
-
Rx.make((get) =>
|
|
24
|
-
Function.pipe(
|
|
25
|
-
get(node),
|
|
26
|
-
Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
|
|
27
|
-
Option.map((node) => [
|
|
28
|
-
{
|
|
29
|
-
id: `automation-${node.id}`,
|
|
30
|
-
type: `${meta.id}/space-settings-automation`,
|
|
31
|
-
data: `${meta.id}/space-settings-automation`,
|
|
32
|
-
properties: {
|
|
33
|
-
label: ['automation panel label', { ns: meta.id }],
|
|
34
|
-
icon: 'ph--lightning--regular',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
]),
|
|
38
|
-
Option.getOrElse(() => []),
|
|
39
|
-
),
|
|
40
|
-
),
|
|
41
|
-
}),
|
|
42
|
-
createExtension({
|
|
43
|
-
id: `${meta.id}/space-settings-functions`,
|
|
44
|
-
connector: (node) =>
|
|
45
|
-
Rx.make((get) =>
|
|
46
|
-
Function.pipe(
|
|
47
|
-
get(node),
|
|
48
|
-
Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
|
|
49
|
-
Option.map((node) => [
|
|
50
|
-
{
|
|
51
|
-
id: `functions-${node.id}`,
|
|
52
|
-
type: `${meta.id}/space-settings-functions`,
|
|
53
|
-
data: `${meta.id}/space-settings-functions`,
|
|
54
|
-
properties: {
|
|
55
|
-
label: ['functions panel label', { ns: meta.id }],
|
|
56
|
-
icon: 'ph--function--regular',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
]),
|
|
60
|
-
Option.getOrElse(() => []),
|
|
61
|
-
),
|
|
62
|
-
),
|
|
63
|
-
}),
|
|
64
|
-
createExtension({
|
|
65
|
-
id: `${meta.id}/script-companion`,
|
|
66
|
-
connector: (node) =>
|
|
67
|
-
Rx.make((get) =>
|
|
68
|
-
Function.pipe(
|
|
69
|
-
get(node),
|
|
70
|
-
Option.flatMap((node) => (Obj.instanceOf(Script.Script, node.data) ? Option.some(node) : Option.none())),
|
|
71
|
-
Option.map((node) => [
|
|
72
|
-
{
|
|
73
|
-
id: [node.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
74
|
-
type: PLANK_COMPANION_TYPE,
|
|
75
|
-
data: 'automation',
|
|
76
|
-
properties: {
|
|
77
|
-
label: ['script automation label', { ns: meta.id }],
|
|
78
|
-
icon: 'ph--lightning--regular',
|
|
79
|
-
disposition: 'hidden',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
]),
|
|
83
|
-
Option.getOrElse(() => []),
|
|
84
|
-
),
|
|
85
|
-
),
|
|
86
|
-
}),
|
|
87
|
-
]);
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
|
-
import * as BrowserKeyValueStore from '@effect/platform-browser/BrowserKeyValueStore';
|
|
7
|
-
import * as Effect from 'effect/Effect';
|
|
8
|
-
import * as Layer from 'effect/Layer';
|
|
9
|
-
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
10
|
-
|
|
11
|
-
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
12
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
13
|
-
import { Resource } from '@dxos/context';
|
|
14
|
-
import { Query, Ref } from '@dxos/echo';
|
|
15
|
-
import {
|
|
16
|
-
CredentialsService,
|
|
17
|
-
DatabaseService,
|
|
18
|
-
FunctionImplementationResolver,
|
|
19
|
-
FunctionInvocationService,
|
|
20
|
-
InvocationTracer,
|
|
21
|
-
LocalFunctionExecutionService,
|
|
22
|
-
QueueService,
|
|
23
|
-
RemoteFunctionExecutionService,
|
|
24
|
-
TriggerDispatcher,
|
|
25
|
-
} from '@dxos/functions';
|
|
26
|
-
import { TriggerStateStore } from '@dxos/functions';
|
|
27
|
-
import { invariant } from '@dxos/invariant';
|
|
28
|
-
import { type SpaceId } from '@dxos/keys';
|
|
29
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
30
|
-
import { PropertiesType } from '@dxos/react-client/echo';
|
|
31
|
-
|
|
32
|
-
import { AutomationCapabilities } from './capabilities';
|
|
33
|
-
|
|
34
|
-
export default async (context: PluginContext) => {
|
|
35
|
-
const provider = await new ComputeRuntimeProviderImpl(context).open();
|
|
36
|
-
return contributes(AutomationCapabilities.ComputeRuntime, provider, async () => {
|
|
37
|
-
await provider.close();
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilities.ComputeRuntimeProvider {
|
|
42
|
-
readonly #runtimes = new Map<SpaceId, AutomationCapabilities.ComputeRuntime>();
|
|
43
|
-
readonly #context: PluginContext;
|
|
44
|
-
|
|
45
|
-
constructor(context: PluginContext) {
|
|
46
|
-
super();
|
|
47
|
-
this.#context = context;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
protected override async _open() {}
|
|
51
|
-
|
|
52
|
-
protected override async _close() {
|
|
53
|
-
await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));
|
|
54
|
-
this.#runtimes.clear();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
getRuntime(spaceId: SpaceId): AutomationCapabilities.ComputeRuntime {
|
|
58
|
-
if (this.#runtimes.has(spaceId)) {
|
|
59
|
-
return this.#runtimes.get(spaceId)!;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const layer = Layer.unwrapEffect(
|
|
63
|
-
Effect.gen(this, function* () {
|
|
64
|
-
const client = this.#context.getCapability(ClientCapabilities.Client);
|
|
65
|
-
const serviceLayer =
|
|
66
|
-
this.#context.getCapability(Capabilities.AiServiceLayer) ?? Layer.die('AiService not found');
|
|
67
|
-
|
|
68
|
-
// TODO(dmaretskyi): Make those reactive.
|
|
69
|
-
const functions = this.#context.getCapabilities(Capabilities.Functions);
|
|
70
|
-
const toolkits = this.#context.getCapabilities(Capabilities.Toolkit);
|
|
71
|
-
const handlers = this.#context.getCapabilities(Capabilities.ToolkitHandler);
|
|
72
|
-
|
|
73
|
-
const allFunctions = functions.flat();
|
|
74
|
-
// TODO(wittjosiah): Don't cast.
|
|
75
|
-
const toolkit = Toolkit.merge(...toolkits) as Toolkit.Toolkit<any>;
|
|
76
|
-
const handlersLayer = Layer.mergeAll(Layer.empty, ...handlers);
|
|
77
|
-
|
|
78
|
-
const space = client.spaces.get(spaceId);
|
|
79
|
-
invariant(space);
|
|
80
|
-
yield* Effect.promise(() => space.waitUntilReady());
|
|
81
|
-
|
|
82
|
-
return Layer.mergeAll(TriggerDispatcher.layer({ timeControl: 'natural' })).pipe(
|
|
83
|
-
Layer.provideMerge(
|
|
84
|
-
Layer.mergeAll(
|
|
85
|
-
InvocationTracerLive,
|
|
86
|
-
TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
|
|
87
|
-
makeToolResolverFromFunctions(allFunctions, toolkit),
|
|
88
|
-
makeToolExecutionServiceFromFunctions(toolkit, handlersLayer),
|
|
89
|
-
),
|
|
90
|
-
),
|
|
91
|
-
Layer.provideMerge(
|
|
92
|
-
Layer.mergeAll(
|
|
93
|
-
FunctionInvocationService.layer.pipe(
|
|
94
|
-
Layer.provideMerge(
|
|
95
|
-
LocalFunctionExecutionService.layerLive.pipe(
|
|
96
|
-
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: allFunctions })),
|
|
97
|
-
Layer.provideMerge(
|
|
98
|
-
RemoteFunctionExecutionService.fromClient(
|
|
99
|
-
client.edge.baseUrl,
|
|
100
|
-
// If agent is not enabled do not provide spaceId because space context will be unavailable on EDGE.
|
|
101
|
-
client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,
|
|
102
|
-
),
|
|
103
|
-
),
|
|
104
|
-
Layer.provideMerge(serviceLayer),
|
|
105
|
-
Layer.provideMerge(CredentialsService.layerFromDatabase()),
|
|
106
|
-
Layer.provideMerge(space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable),
|
|
107
|
-
Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
|
|
108
|
-
),
|
|
109
|
-
),
|
|
110
|
-
),
|
|
111
|
-
),
|
|
112
|
-
),
|
|
113
|
-
);
|
|
114
|
-
}),
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
const runtime = ManagedRuntime.make(layer);
|
|
118
|
-
this.#runtimes.set(spaceId, runtime);
|
|
119
|
-
|
|
120
|
-
return runtime;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const InvocationTracerLive = Layer.unwrapEffect(
|
|
125
|
-
Effect.gen(function* () {
|
|
126
|
-
const {
|
|
127
|
-
objects: [properties],
|
|
128
|
-
} = yield* DatabaseService.runQuery(Query.type(PropertiesType));
|
|
129
|
-
invariant(properties);
|
|
130
|
-
if (!properties.invocationTraceQueue) {
|
|
131
|
-
const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });
|
|
132
|
-
properties.invocationTraceQueue = Ref.fromDXN(queue.dxn);
|
|
133
|
-
}
|
|
134
|
-
const queue = properties.invocationTraceQueue.target;
|
|
135
|
-
invariant(queue);
|
|
136
|
-
return InvocationTracer.layerLive({ invocationTraceQueue: queue });
|
|
137
|
-
}),
|
|
138
|
-
);
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Capabilities,
|
|
7
|
-
LayoutAction,
|
|
8
|
-
type PluginContext,
|
|
9
|
-
contributes,
|
|
10
|
-
createIntent,
|
|
11
|
-
createResolver,
|
|
12
|
-
} from '@dxos/app-framework';
|
|
13
|
-
import { Ref } from '@dxos/echo';
|
|
14
|
-
import { Function, Script, Trigger } from '@dxos/functions';
|
|
15
|
-
import { type DXN } from '@dxos/keys';
|
|
16
|
-
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
17
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
18
|
-
import { Filter } from '@dxos/react-client/echo';
|
|
19
|
-
|
|
20
|
-
import { AutomationAction } from '../types';
|
|
21
|
-
|
|
22
|
-
export default (context: PluginContext) =>
|
|
23
|
-
contributes(Capabilities.IntentResolver, [
|
|
24
|
-
createResolver({
|
|
25
|
-
intent: AutomationAction.CreateTriggerFromTemplate,
|
|
26
|
-
resolve: async ({ space, template, enabled = false, scriptName, input }) => {
|
|
27
|
-
const trigger = Trigger.make({ enabled, input });
|
|
28
|
-
|
|
29
|
-
// TODO(wittjosiah): Factor out function lookup by script name?
|
|
30
|
-
if (scriptName) {
|
|
31
|
-
const {
|
|
32
|
-
objects: [script],
|
|
33
|
-
} = await space.db.query(Filter.type(Script.Script, { name: scriptName })).run();
|
|
34
|
-
if (script) {
|
|
35
|
-
const {
|
|
36
|
-
objects: [fn],
|
|
37
|
-
} = await space.db.query(Filter.type(Function.Function, { source: Ref.make(script) })).run();
|
|
38
|
-
if (fn) {
|
|
39
|
-
trigger.function = Ref.make(fn);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
switch (template.type) {
|
|
45
|
-
case 'timer': {
|
|
46
|
-
trigger.spec = { kind: 'timer', cron: template.cron };
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
case 'queue': {
|
|
50
|
-
trigger.spec = { kind: 'queue', queue: (template.queueDXN as DXN).toString() };
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
default: {
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
intents: [
|
|
60
|
-
createIntent(SpaceAction.AddObject, { object: trigger, target: space, hidden: true }),
|
|
61
|
-
createIntent(LayoutAction.Open, {
|
|
62
|
-
part: 'main',
|
|
63
|
-
subject: [`automation-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],
|
|
64
|
-
options: {
|
|
65
|
-
workspace: space.id,
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
],
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
}),
|
|
72
|
-
]);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface, useLayout } from '@dxos/app-framework';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { getSpace, parseId, useSpace } from '@dxos/react-client/echo';
|
|
10
|
-
|
|
11
|
-
import { AutomationSettings, FunctionsContainer } from '../components';
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
|
|
14
|
-
export default () =>
|
|
15
|
-
contributes(Capabilities.ReactSurface, [
|
|
16
|
-
createSurface({
|
|
17
|
-
id: `${meta.id}/space-settings-functions`,
|
|
18
|
-
role: 'article',
|
|
19
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-functions`,
|
|
20
|
-
component: () => {
|
|
21
|
-
const layout = useLayout();
|
|
22
|
-
const { spaceId } = parseId(layout.workspace);
|
|
23
|
-
const space = useSpace(spaceId);
|
|
24
|
-
if (!space) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return <FunctionsContainer space={space} />;
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
31
|
-
createSurface({
|
|
32
|
-
id: `${meta.id}/space-settings-automation`,
|
|
33
|
-
role: 'article',
|
|
34
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-automation`,
|
|
35
|
-
component: () => {
|
|
36
|
-
const layout = useLayout();
|
|
37
|
-
const { spaceId } = parseId(layout.workspace);
|
|
38
|
-
const space = useSpace(spaceId);
|
|
39
|
-
if (!space) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return <AutomationSettings space={space} />;
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
46
|
-
createSurface({
|
|
47
|
-
id: `${meta.id}/companion/automation`,
|
|
48
|
-
role: 'article',
|
|
49
|
-
filter: (data): data is { companionTo: Obj.Any; subject: 'automation' } =>
|
|
50
|
-
Obj.isObject(data.companionTo) && data.subject === 'automation',
|
|
51
|
-
component: ({ data }) => {
|
|
52
|
-
return <AutomationSettings space={getSpace(data.companionTo)!} object={data.companionTo} />;
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
]);
|
package/src/events.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineEvent } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { meta } from './meta';
|
|
8
|
-
|
|
9
|
-
export namespace AutomationEvents {
|
|
10
|
-
export const ComputeRuntimeReady = defineEvent(`${meta.id}/event/compute-runtime-ready`);
|
|
11
|
-
}
|
/package/dist/lib/browser/{AutomationPanel-LBXJDM6Z.mjs.map → AutomationPanel-FAS6ADCW.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/browser/{FunctionsPanel-HFCK3JRB.mjs.map → FunctionsPanel-ZX4J75UM.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{AutomationPanel-NVEIUIZP.mjs.map → AutomationPanel-B7NAGDFA.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/node-esm/{FunctionsPanel-74ELGR7P.mjs.map → FunctionsPanel-SS6GIVNU.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|