@dxos/plugin-automation 0.8.4-main.fffef41 → 0.9.0
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/LICENSE +102 -5
- package/PLUGIN.mdl +428 -0
- package/README.md +1 -1
- package/dist/lib/neutral/AutomationArticle-GN36NUX2.mjs +17 -0
- package/dist/lib/neutral/AutomationCompanion-M26WR6VP.mjs +165 -0
- package/dist/lib/neutral/AutomationCompanion-M26WR6VP.mjs.map +7 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs +1132 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AutomationPlugin.workerd.mjs +36 -0
- package/dist/lib/neutral/AutomationPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/AutomationSettings-YXUJDRQA.mjs +27 -0
- package/dist/lib/neutral/AutomationSettings-YXUJDRQA.mjs.map +7 -0
- package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
- package/dist/lib/neutral/app-graph-builder-BTTHS4VK.mjs +102 -0
- package/dist/lib/neutral/app-graph-builder-BTTHS4VK.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +25 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +19 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-24JKY6NU.mjs +21 -0
- package/dist/lib/neutral/chunk-24JKY6NU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DUGOIM7G.mjs +36 -0
- package/dist/lib/neutral/chunk-DUGOIM7G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FE7YFBX7.mjs +486 -0
- package/dist/lib/neutral/chunk-FE7YFBX7.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GARB7S5R.mjs +157 -0
- package/dist/lib/neutral/chunk-GARB7S5R.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HPUHQ3L6.mjs +64 -0
- package/dist/lib/neutral/chunk-HPUHQ3L6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-SONGOJRB.mjs +8 -0
- package/dist/lib/neutral/chunk-SONGOJRB.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +48 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +15 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-automation-OE3TNXYE.mjs +41 -0
- package/dist/lib/neutral/create-automation-OE3TNXYE.mjs.map +7 -0
- package/dist/lib/neutral/create-object-MEJOWGMH.mjs +25 -0
- package/dist/lib/neutral/create-object-MEJOWGMH.mjs.map +7 -0
- package/dist/lib/neutral/create-trigger-from-template-TERHKWJM.mjs +68 -0
- package/dist/lib/neutral/create-trigger-from-template-TERHKWJM.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +47 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +22 -0
- package/dist/lib/neutral/layer-specs-G6GCH7BE.mjs +137 -0
- package/dist/lib/neutral/layer-specs-G6GCH7BE.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/navigation-resolver-I3L5FHJO.mjs +14 -0
- package/dist/lib/neutral/navigation-resolver-I3L5FHJO.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-IBRWUKPC.mjs +54 -0
- package/dist/lib/neutral/react-surface-IBRWUKPC.mjs.map +7 -0
- package/dist/lib/neutral/registry-sync-G6TKKZGK.mjs +86 -0
- package/dist/lib/neutral/registry-sync-G6TKKZGK.mjs.map +7 -0
- package/dist/lib/neutral/templates-ETXVD3VE.mjs +16 -0
- package/dist/lib/neutral/templates-ETXVD3VE.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/translations.mjs +64 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs +77 -0
- package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +18 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts +3 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
- package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.test.d.ts +2 -0
- package/dist/types/src/capabilities/create-object.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +16 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +6 -0
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +9 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
- package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
- package/dist/types/src/capabilities/templates.d.ts +6 -0
- package/dist/types/src/capabilities/templates.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts +2 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/index.d.ts +57 -0
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/list.d.ts +7 -0
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/options.d.ts +10 -0
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/remove.d.ts +8 -0
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts +11 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/util.d.ts +85 -0
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/components/CreateAutomationPanel/CreateAutomationPanel.d.ts +14 -0
- package/dist/types/src/components/CreateAutomationPanel/CreateAutomationPanel.d.ts.map +1 -0
- package/dist/types/src/components/CreateAutomationPanel/index.d.ts +2 -0
- package/dist/types/src/components/CreateAutomationPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -7
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationArticle/AutomationArticle.d.ts +35 -0
- package/dist/types/src/containers/AutomationArticle/AutomationArticle.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationArticle/index.d.ts +3 -0
- package/dist/types/src/containers/AutomationArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationCompanion/AutomationCompanion.d.ts +13 -0
- package/dist/types/src/containers/AutomationCompanion/AutomationCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/AutomationCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +10 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/containers/AutomationSettings/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 +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +5 -4
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -5
- 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/operations/create-automation.d.ts +5 -0
- package/dist/types/src/operations/create-automation.d.ts.map +1 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts +3 -0
- package/dist/types/src/paths.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/index.d.ts +10 -0
- package/dist/types/src/templates/index.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +318 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +90 -31
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Automation.d.ts +41 -0
- package/dist/types/src/types/Automation.d.ts.map +1 -0
- package/dist/types/src/types/Automation.test.d.ts +2 -0
- package/dist/types/src/types/Automation.test.d.ts.map +1 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts +42 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AutomationOperation.d.ts +31 -0
- package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
- package/dist/types/src/types/Runnable.d.ts +14 -0
- package/dist/types/src/types/Runnable.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +13 -5
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/automations-for-object.d.ts +20 -0
- package/dist/types/src/util/automations-for-object.d.ts.map +1 -0
- package/dist/types/src/util/automations-for-object.test.d.ts +2 -0
- package/dist/types/src/util/automations-for-object.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +136 -71
- package/src/AutomationPlugin.node.ts +48 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +47 -35
- package/src/AutomationPlugin.workerd.ts +24 -0
- package/src/capabilities/app-graph-builder.ts +81 -78
- package/src/capabilities/create-object.test.ts +18 -0
- package/src/capabilities/create-object.ts +26 -0
- package/src/capabilities/index.ts +17 -7
- package/src/capabilities/layer-specs.ts +196 -0
- package/src/capabilities/navigation-resolver.ts +19 -0
- package/src/capabilities/node.ts +19 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +45 -46
- package/src/capabilities/registry-sync.ts +114 -0
- package/src/capabilities/templates.ts +17 -0
- package/src/capabilities/trigger-runtime-controller.test.ts +107 -0
- package/src/capabilities/trigger-runtime-controller.ts +126 -0
- package/src/commands/index.ts +5 -0
- package/src/commands/trigger/create/index.ts +14 -0
- package/src/commands/trigger/create/queue.ts +87 -0
- package/src/commands/trigger/create/subscription.ts +126 -0
- package/src/commands/trigger/create/timer.ts +90 -0
- package/src/commands/trigger/index.ts +16 -0
- package/src/commands/trigger/list.ts +69 -0
- package/src/commands/trigger/options.ts +47 -0
- package/src/commands/trigger/remove.ts +45 -0
- package/src/commands/trigger/update/index.ts +14 -0
- package/src/commands/trigger/update/queue.ts +191 -0
- package/src/commands/trigger/update/subscription.ts +279 -0
- package/src/commands/trigger/update/timer.ts +195 -0
- package/src/commands/trigger/util.ts +410 -0
- package/src/components/CreateAutomationPanel/CreateAutomationPanel.tsx +68 -0
- package/src/components/CreateAutomationPanel/index.ts +5 -0
- package/src/components/index.ts +1 -8
- package/src/containers/AutomationArticle/AutomationArticle.tsx +586 -0
- package/src/containers/AutomationArticle/index.ts +6 -0
- package/src/containers/AutomationCompanion/AutomationCompanion.tsx +183 -0
- package/src/containers/AutomationCompanion/index.ts +6 -0
- package/src/containers/AutomationSettings/AutomationSettings.tsx +34 -0
- package/src/containers/AutomationSettings/index.ts +5 -0
- package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +10 -0
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useTriggerRuntimeControls.ts +38 -19
- package/src/index.ts +1 -6
- package/src/meta.ts +23 -7
- package/src/operations/create-automation.ts +38 -0
- package/src/operations/create-trigger-from-template.ts +70 -0
- package/src/operations/index.ts +10 -0
- package/src/paths.ts +13 -0
- package/src/plugin.ts +11 -0
- package/src/templates/index.ts +22 -0
- package/src/testing/test-functions.ts +43 -9
- package/src/testing.ts +7 -0
- package/src/translations.ts +49 -33
- package/src/types/Automation.test.ts +37 -0
- package/src/types/Automation.ts +45 -0
- package/src/types/AutomationCapabilities.ts +52 -0
- package/src/types/AutomationOperation.ts +61 -0
- package/src/types/Runnable.ts +14 -0
- package/src/types/index.ts +5 -0
- package/src/types/schema.ts +6 -6
- package/src/util/automations-for-object.test.ts +86 -0
- package/src/util/automations-for-object.ts +72 -0
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
- package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
- package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-CRW6SJUN.mjs +0 -10
- 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-EPEXQP45.mjs +0 -14
- package/dist/lib/browser/chunk-EPEXQP45.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-LZQFZO3B.mjs +0 -17
- package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-NAPXRXTY.mjs +0 -100
- package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
- package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
- package/dist/lib/browser/chunk-QKFBHAGN.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-EIQTHJFZ.mjs +0 -113
- package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -13
- package/dist/lib/browser/index.mjs +0 -130
- package/dist/lib/browser/index.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/meta.json +0 -1
- package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
- package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -8
- package/dist/lib/node-esm/AutomationPanel-HCVFNHGQ.mjs +0 -12
- package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
- package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
- package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs +0 -11
- 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-6YRKST6M.mjs +0 -185
- package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +0 -19
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
- package/dist/lib/node-esm/chunk-CPP35BE6.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-KB7NFEYY.mjs +0 -16
- package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PICJ2REN.mjs +0 -101
- package/dist/lib/node-esm/chunk-PICJ2REN.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/chunk-W76WUTZY.mjs +0 -268
- package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
- package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -14
- package/dist/lib/node-esm/index.mjs +0 -131
- package/dist/lib/node-esm/index.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/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
- package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- 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/components/AutomationPanel/AutomationPanel.d.ts +0 -13
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +0 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +0 -50
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +0 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts +0 -4
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +0 -1
- 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 +0 -7
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts +0 -7
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsPanel/index.d.ts +0 -4
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +0 -8
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +0 -2
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +0 -12
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +0 -5
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +0 -13
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +0 -51
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/index.d.ts +0 -2
- package/dist/types/src/components/TriggerEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/TriggerSettings.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/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -41
- package/src/capabilities/compute-runtime.ts +0 -127
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +0 -56
- package/src/components/AutomationPanel/AutomationPanel.tsx +0 -223
- package/src/components/AutomationPanel/index.ts +0 -9
- package/src/components/AutomationSettings.tsx +0 -30
- package/src/components/FunctionsContainer.tsx +0 -36
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +0 -116
- package/src/components/FunctionsPanel/index.ts +0 -8
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +0 -135
- package/src/components/FunctionsRegistry/index.ts +0 -5
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +0 -84
- package/src/components/TriggerEditor/SpecSelector.tsx +0 -65
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +0 -121
- package/src/components/TriggerEditor/TriggerEditor.tsx +0 -127
- package/src/components/TriggerEditor/index.ts +0 -5
- package/src/components/TriggerSettings.tsx +0 -25
- package/src/events.ts +0 -11
- package/src/hooks/useComputeRuntimeCallback.ts +0 -68
- /package/dist/lib/{browser/AutomationPanel-7OECLR5N.mjs.map → neutral/AutomationArticle-GN36NUX2.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks/index.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/hooks → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-HCVFNHGQ.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → neutral/testing.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Filter, Query } from '@dxos/echo';
|
|
8
|
-
import { Trigger } from '@dxos/functions';
|
|
9
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../../meta';
|
|
13
|
-
|
|
14
|
-
export type SpecSelectorProps = InputProps;
|
|
15
|
-
|
|
16
|
-
export const SpecSelector = (props: SpecSelectorProps) => {
|
|
17
|
-
const { t } = useTranslation(meta.id);
|
|
18
|
-
const specProps = useInputProps(['spec' satisfies keyof Trigger.Trigger]);
|
|
19
|
-
|
|
20
|
-
const handleTypeChange = useCallback(
|
|
21
|
-
(_type: any, value: string): Trigger.Spec | undefined => {
|
|
22
|
-
const getDefaultTriggerSpec = (kind: string) => {
|
|
23
|
-
switch (kind) {
|
|
24
|
-
case 'timer':
|
|
25
|
-
return { kind: 'timer', cron: '' };
|
|
26
|
-
case 'subscription':
|
|
27
|
-
return {
|
|
28
|
-
kind: 'subscription',
|
|
29
|
-
query: {
|
|
30
|
-
ast: Query.select(Filter.nothing()).ast,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
case 'queue':
|
|
34
|
-
return { kind: 'queue', queue: 'dxn:' };
|
|
35
|
-
case 'email':
|
|
36
|
-
return { kind: 'email' };
|
|
37
|
-
case 'webhook':
|
|
38
|
-
return { kind: 'webhook' };
|
|
39
|
-
default:
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const defaultSpec = getDefaultTriggerSpec(value);
|
|
45
|
-
if (!defaultSpec) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Update the entire spec object, not just the `spec.kind`.
|
|
50
|
-
specProps.onValueChange('object', defaultSpec);
|
|
51
|
-
},
|
|
52
|
-
[specProps],
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const options = useMemo(
|
|
56
|
-
() =>
|
|
57
|
-
Trigger.Kinds.map((kind) => ({
|
|
58
|
-
value: kind,
|
|
59
|
-
label: t(`trigger type ${kind}`),
|
|
60
|
-
})),
|
|
61
|
-
[t],
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
|
|
65
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React, { useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
|
|
9
|
-
import { Function } from '@dxos/functions';
|
|
10
|
-
import { Trigger } from '@dxos/functions';
|
|
11
|
-
import { invariant } from '@dxos/invariant';
|
|
12
|
-
import { faker } from '@dxos/random';
|
|
13
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
14
|
-
import { ContactType, useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
|
-
import { Employer, Organization, Person, Project } from '@dxos/types';
|
|
18
|
-
|
|
19
|
-
import { functions } from '../../testing';
|
|
20
|
-
import { translations } from '../../translations';
|
|
21
|
-
|
|
22
|
-
import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
|
|
23
|
-
|
|
24
|
-
const types = [
|
|
25
|
-
// TODO(burdon): Get label from annotation.
|
|
26
|
-
{ value: Organization.Organization.typename, label: 'Organization' },
|
|
27
|
-
{ value: Person.Person.typename, label: 'Person' },
|
|
28
|
-
{ value: Type.getTypename(Project.Project), label: 'Project' },
|
|
29
|
-
{ value: Employer.Employer.typename, label: 'Employer' },
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
const DefaultStory = (props: Partial<TriggerEditorProps>) => {
|
|
33
|
-
const { space } = useClientProvider();
|
|
34
|
-
const [trigger, setTrigger] = useState<Trigger.Trigger>();
|
|
35
|
-
const tags = useQuery(space, Filter.type(Tag.Tag));
|
|
36
|
-
|
|
37
|
-
useAsyncEffect(async () => {
|
|
38
|
-
if (!space) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const result = await space.db.query(Filter.type(Function.Function)).run();
|
|
43
|
-
const fn = result.objects.find((fn) => fn.name === 'example.com/function/forex');
|
|
44
|
-
invariant(fn);
|
|
45
|
-
const trigger = space.db.add(
|
|
46
|
-
Trigger.make({
|
|
47
|
-
function: Ref.make(fn),
|
|
48
|
-
spec: { kind: 'webhook' },
|
|
49
|
-
input: {
|
|
50
|
-
from: 'USD',
|
|
51
|
-
to: 'JPY',
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
);
|
|
55
|
-
setTrigger(trigger);
|
|
56
|
-
}, [space]);
|
|
57
|
-
|
|
58
|
-
if (!space || !trigger) {
|
|
59
|
-
return <div />;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div role='none' className='is-[32rem] bs-fit border border-separator rounded-sm'>
|
|
64
|
-
<TriggerEditor
|
|
65
|
-
space={space}
|
|
66
|
-
trigger={trigger}
|
|
67
|
-
types={types}
|
|
68
|
-
tags={tags}
|
|
69
|
-
onSave={(values) => console.log('on save', values)}
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const meta = {
|
|
77
|
-
title: 'plugins/plugin-automation/TriggerEditor',
|
|
78
|
-
component: TriggerEditor as any,
|
|
79
|
-
render: DefaultStory,
|
|
80
|
-
decorators: [
|
|
81
|
-
withTheme,
|
|
82
|
-
withLayout({ container: 'column' }),
|
|
83
|
-
withClientProvider({
|
|
84
|
-
createIdentity: true,
|
|
85
|
-
createSpace: true,
|
|
86
|
-
types: [Tag.Tag, Function.Function, Trigger.Trigger, ContactType],
|
|
87
|
-
onCreateSpace: ({ space }) => {
|
|
88
|
-
space.db.add(Tag.make({ label: 'Important' }));
|
|
89
|
-
space.db.add(Tag.make({ label: 'Investor' }));
|
|
90
|
-
space.db.add(Tag.make({ label: 'New' }));
|
|
91
|
-
|
|
92
|
-
for (const fn of functions) {
|
|
93
|
-
space.db.add(Function.make(fn));
|
|
94
|
-
}
|
|
95
|
-
Array.from({ length: 10 }).map(() => {
|
|
96
|
-
return space.db.add(
|
|
97
|
-
Obj.make(ContactType, {
|
|
98
|
-
name: faker.person.fullName(),
|
|
99
|
-
identifiers: [],
|
|
100
|
-
}),
|
|
101
|
-
);
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
}),
|
|
105
|
-
],
|
|
106
|
-
parameters: {
|
|
107
|
-
translations,
|
|
108
|
-
},
|
|
109
|
-
} satisfies Meta<typeof DefaultStory>;
|
|
110
|
-
|
|
111
|
-
export default meta;
|
|
112
|
-
|
|
113
|
-
type Story = StoryObj<typeof meta>;
|
|
114
|
-
|
|
115
|
-
export const Default: Story = {};
|
|
116
|
-
|
|
117
|
-
export const ReadonlySpec: Story = {
|
|
118
|
-
args: {
|
|
119
|
-
readonlySpec: true,
|
|
120
|
-
},
|
|
121
|
-
};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { ComputeGraph } from '@dxos/conductor';
|
|
8
|
-
import { type Query, Type } from '@dxos/echo';
|
|
9
|
-
import { Function, Script, Trigger } from '@dxos/functions';
|
|
10
|
-
import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
|
|
11
|
-
import { Input } from '@dxos/react-ui';
|
|
12
|
-
import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
|
|
13
|
-
import { type CustomInputMap, Form, InputHeader, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
14
|
-
|
|
15
|
-
import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
|
|
16
|
-
import { SpecSelector } from './SpecSelector';
|
|
17
|
-
|
|
18
|
-
export type TriggerEditorProps = {
|
|
19
|
-
space: Space;
|
|
20
|
-
trigger: Trigger.Trigger;
|
|
21
|
-
// TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
|
|
22
|
-
readonlySpec?: boolean;
|
|
23
|
-
onSave?: (trigger: Omit<Trigger.Trigger, 'id'>) => void;
|
|
24
|
-
onCancel?: () => void;
|
|
25
|
-
} & Pick<QueryFormProps, 'types' | 'tags'>;
|
|
26
|
-
|
|
27
|
-
export const TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }: TriggerEditorProps) => {
|
|
28
|
-
const handleSave = ({ id: _, ...values }: Trigger.Trigger) => {
|
|
29
|
-
onSave?.(values);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
33
|
-
const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<Form
|
|
37
|
-
outerSpacing={false}
|
|
38
|
-
Custom={Custom}
|
|
39
|
-
schema={Trigger.Trigger}
|
|
40
|
-
values={trigger}
|
|
41
|
-
onSave={handleSave}
|
|
42
|
-
onCancel={onCancel}
|
|
43
|
-
onQueryRefOptions={handleRefQueryLookup}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
type UseCustomInputsProps = {
|
|
49
|
-
space: Space;
|
|
50
|
-
readonlySpec?: boolean;
|
|
51
|
-
onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
|
|
52
|
-
} & Pick<QueryFormProps, 'types' | 'tags'>;
|
|
53
|
-
|
|
54
|
-
const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }: UseCustomInputsProps) => {
|
|
55
|
-
const functions = useQuery(space, Filter.type(Function.Function));
|
|
56
|
-
const workflows = useQuery(space, Filter.type(ComputeGraph));
|
|
57
|
-
const scripts = useQuery(space, Filter.type(Script.Script));
|
|
58
|
-
|
|
59
|
-
return useMemo(
|
|
60
|
-
(): CustomInputMap => ({
|
|
61
|
-
// Function selector.
|
|
62
|
-
['function' satisfies keyof Trigger.Trigger]: (props) => {
|
|
63
|
-
const getValue = useCallback(() => {
|
|
64
|
-
const formValue = props.getValue();
|
|
65
|
-
if (Ref.isRef(formValue)) {
|
|
66
|
-
return formValue.dxn.toString() as string;
|
|
67
|
-
}
|
|
68
|
-
return undefined;
|
|
69
|
-
}, [props]);
|
|
70
|
-
|
|
71
|
-
const handleOnValueChange = useCallback(
|
|
72
|
-
(_type: any, dxnString: string) => {
|
|
73
|
-
const dxn = Type.DXN.parse(dxnString);
|
|
74
|
-
if (dxn) {
|
|
75
|
-
const ref = Ref.fromDXN(dxn);
|
|
76
|
-
props.onValueChange('object', ref);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[props.onValueChange],
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<SelectInput
|
|
84
|
-
{...props}
|
|
85
|
-
getValue={getValue as any}
|
|
86
|
-
onValueChange={handleOnValueChange}
|
|
87
|
-
options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
// Spec selector.
|
|
93
|
-
['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
|
|
94
|
-
|
|
95
|
-
// TODO(wittjosiah): Copied from ViewEditor.
|
|
96
|
-
// Query input editor.
|
|
97
|
-
['spec.query' as const]: (props) => {
|
|
98
|
-
const handleChange = useCallback(
|
|
99
|
-
(query: Query.Any) => props.onValueChange('object', { ast: query.ast }),
|
|
100
|
-
[props.onValueChange],
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<Input.Root>
|
|
105
|
-
<InputHeader label={props.label} />
|
|
106
|
-
<QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
|
|
107
|
-
</Input.Root>
|
|
108
|
-
);
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
// Function input editor.
|
|
112
|
-
['input' as const]: (props) => (
|
|
113
|
-
<FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
|
|
114
|
-
),
|
|
115
|
-
}),
|
|
116
|
-
[workflows, scripts, functions, readonlySpec],
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const getWorkflowOptions = (graphs: ComputeGraph[]) => {
|
|
121
|
-
return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
|
|
125
|
-
const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
|
|
126
|
-
return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
|
|
127
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
8
|
-
import { Input, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { ControlItemInput } from '@dxos/react-ui-form';
|
|
10
|
-
|
|
11
|
-
import { useTriggerRuntimeControls } from '../hooks';
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
|
|
14
|
-
export const TriggersSettings = ({ space }: { space: Space }) => {
|
|
15
|
-
const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
|
|
16
|
-
const { t } = useTranslation(meta.id);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
20
|
-
<ControlItemInput title={t('runtime label')} description={t('runtime description')}>
|
|
21
|
-
<Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />
|
|
22
|
-
</ControlItemInput>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
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
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Cause from 'effect/Cause';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Exit from 'effect/Exit';
|
|
8
|
-
import { useCallback } from 'react';
|
|
9
|
-
|
|
10
|
-
import { useCapability } from '@dxos/app-framework/react';
|
|
11
|
-
import { type FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
|
|
12
|
-
import { InvocationTracer, TracingServiceExt } from '@dxos/functions-runtime';
|
|
13
|
-
import { log } from '@dxos/log';
|
|
14
|
-
import type { Space } from '@dxos/react-client/echo';
|
|
15
|
-
|
|
16
|
-
import { AutomationCapabilities } from '../capabilities';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create an effectful function that has access to compute services
|
|
20
|
-
*/
|
|
21
|
-
// TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).
|
|
22
|
-
export const useComputeRuntimeCallback = <T>(
|
|
23
|
-
space: Space | undefined,
|
|
24
|
-
fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
|
|
25
|
-
deps?: React.DependencyList,
|
|
26
|
-
): (() => Promise<T>) => {
|
|
27
|
-
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
28
|
-
const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;
|
|
29
|
-
|
|
30
|
-
return useCallback(() => {
|
|
31
|
-
if (!runtime) {
|
|
32
|
-
throw new TypeError('Space not provided to useComputeRuntimeCallback');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return runtime.runPromise(fn());
|
|
36
|
-
}, [runtime, ...(deps ?? [])]);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// TODO(wittjosiah): Function invoking should automatically be traced (DX-647).
|
|
40
|
-
export const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<I, O>, inputData: I) =>
|
|
41
|
-
Effect.gen(function* () {
|
|
42
|
-
const tracer = yield* InvocationTracer;
|
|
43
|
-
const trace = yield* tracer.traceInvocationStart({
|
|
44
|
-
target: undefined,
|
|
45
|
-
payload: {
|
|
46
|
-
data: {},
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Invoke the function.
|
|
51
|
-
const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(
|
|
52
|
-
Effect.provide(TracingServiceExt.layerQueue(trace.invocationTraceQueue)),
|
|
53
|
-
Effect.exit,
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
if (Exit.isFailure(result)) {
|
|
57
|
-
const error = Cause.prettyErrors(result.cause)[0];
|
|
58
|
-
log.error(error.message, error.cause ?? error.stack);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
yield* tracer.traceInvocationEnd({
|
|
62
|
-
trace,
|
|
63
|
-
// TODO(dmaretskyi): Might miss errors.
|
|
64
|
-
exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
return result;
|
|
68
|
-
});
|
|
File without changes
|
/package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.mjs.map → neutral/AutomationPlugin.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|