@dxos/plugin-automation 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8
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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/templates/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Automation, type AutomationCapabilities } from '#types';\n\n/**\n * Blank template: mints an empty automation with no runnable and no triggers; the action and trigger are\n * configured in the automation article. This is the no-op template (the create dialog's default), so the\n * create flow has a single resolve→scaffold path with no special-casing.\n */\nexport const blank: AutomationCapabilities.Template = {\n id: 'org.dxos.automation.blank',\n label: 'Blank',\n icon: 'ph--lightning--regular',\n scaffold: ({ name }) => Effect.succeed(Automation.make({ name, triggers: [] })),\n};\n\n/** Templates contributed by plugin-automation itself. */\nexport const defaultTemplates: AutomationCapabilities.Template[] = [blank];\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,kBAA+C;AAOjD,IAAMC,QAAyC;EACpDC,IAAI;EACJC,OAAO;EACPC,MAAM;EACNC,UAAU,CAAC,EAAEC,KAAI,MAAcC,eAAQP,WAAWQ,KAAK;IAAEF;IAAMG,UAAU,CAAA;EAAG,CAAA,CAAA;AAC9E;AAGO,IAAMC,mBAAsD;EAACT;;",
|
|
6
|
+
"names": ["Effect", "Automation", "blank", "id", "label", "icon", "scaffold", "name", "succeed", "make", "triggers", "defaultTemplates"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/containers/TriggerSettings/TriggerSettings.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useObject } from "@dxos/echo-react";
|
|
4
|
+
import { DropdownMenu, IconButton, useTranslation } from "@dxos/react-ui";
|
|
5
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
6
|
+
import { meta } from "#meta";
|
|
7
|
+
var TriggersSettings = ({ space }) => {
|
|
8
|
+
const { t } = useTranslation(meta.id);
|
|
9
|
+
const [properties, changeProperties] = useObject(space.properties);
|
|
10
|
+
const selected = properties.computeEnvironment ?? "local";
|
|
11
|
+
const handleUpdate = (option) => {
|
|
12
|
+
changeProperties((draft) => {
|
|
13
|
+
draft.computeEnvironment = option;
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
17
|
+
className: "grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
18
|
+
}, /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
19
|
+
title: t("runtime.label"),
|
|
20
|
+
description: t("runtime.description")
|
|
21
|
+
}, /* @__PURE__ */ React.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React.createElement(DropdownMenu.Trigger, {
|
|
22
|
+
asChild: true
|
|
23
|
+
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
24
|
+
iconEnd: true,
|
|
25
|
+
icon: "ph--caret-down--regular",
|
|
26
|
+
size: 4,
|
|
27
|
+
label: t(`runtime.${selected}.label`)
|
|
28
|
+
})), /* @__PURE__ */ React.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React.createElement(DropdownMenu.Content, {
|
|
29
|
+
side: "bottom"
|
|
30
|
+
}, /* @__PURE__ */ React.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
|
|
31
|
+
onClick: () => handleUpdate("disabled")
|
|
32
|
+
}, t(`runtime.disabled.label`)), /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
|
|
33
|
+
onClick: () => handleUpdate("local")
|
|
34
|
+
}, t(`runtime.local.label`)), /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
|
|
35
|
+
onClick: () => handleUpdate("edge")
|
|
36
|
+
}, t(`runtime.edge.label`))))))));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
TriggersSettings
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=chunk-2JP77CMN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/TriggerSettings/TriggerSettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type ComputeEnvironment } from '@dxos/client-protocol';\nimport { useObject } from '@dxos/echo-react';\nimport { type Space } from '@dxos/react-client/echo';\nimport { DropdownMenu, IconButton, useTranslation } from '@dxos/react-ui';\nimport { Settings } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\n\nexport const TriggersSettings = ({ space }: { space: Space }) => {\n const { t } = useTranslation(meta.id);\n const [properties, changeProperties] = useObject(space.properties);\n const selected = properties.computeEnvironment ?? 'local';\n\n const handleUpdate = (option: ComputeEnvironment) => {\n changeProperties((draft) => {\n draft.computeEnvironment = option;\n });\n };\n\n return (\n <div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>\n <Settings.Item title={t('runtime.label')} description={t('runtime.description')}>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton iconEnd icon='ph--caret-down--regular' size={4} label={t(`runtime.${selected}.label`)} />\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content side='bottom'>\n <DropdownMenu.Viewport>\n <DropdownMenu.Item onClick={() => handleUpdate('disabled')}>\n {t(`runtime.disabled.label`)}\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => handleUpdate('local')}>{t(`runtime.local.label`)}</DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => handleUpdate('edge')}>{t(`runtime.edge.label`)}</DropdownMenu.Item>\n </DropdownMenu.Viewport>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n </Settings.Item>\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,OAAOA,WAAW;AAGlB,SAASC,iBAAiB;AAE1B,SAASC,cAAcC,YAAYC,sBAAsB;AACzD,SAASC,gBAAgB;AAEzB,SAASC,YAAY;AAEd,IAAMC,mBAAmB,CAAC,EAAEC,MAAK,MAAoB;AAC1D,QAAM,EAAEC,EAAC,IAAKL,eAAeE,KAAKI,EAAE;AACpC,QAAM,CAACC,YAAYC,gBAAAA,IAAoBX,UAAUO,MAAMG,UAAU;AACjE,QAAME,WAAWF,WAAWG,sBAAsB;AAElD,QAAMC,eAAe,CAACC,WAAAA;AACpBJ,qBAAiB,CAACK,UAAAA;AAChBA,YAAMH,qBAAqBE;IAC7B,CAAA;EACF;AAEA,SACE,sBAAA,cAACE,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACd,SAASe,MAAI;IAACC,OAAOZ,EAAE,eAAA;IAAkBa,aAAab,EAAE,qBAAA;KACvD,sBAAA,cAACP,aAAaqB,MAAI,MAChB,sBAAA,cAACrB,aAAasB,SAAO;IAACC,SAAAA;KACpB,sBAAA,cAACtB,YAAAA;IAAWuB,SAAAA;IAAQC,MAAK;IAA0BC,MAAM;IAAGC,OAAOpB,EAAE,WAAWI,QAAAA,QAAgB;OAElG,sBAAA,cAACX,aAAa4B,QAAM,MAClB,sBAAA,cAAC5B,aAAa6B,SAAO;IAACC,MAAK;KACzB,sBAAA,cAAC9B,aAAa+B,UAAQ,MACpB,sBAAA,cAAC/B,aAAakB,MAAI;IAACc,SAAS,MAAMnB,aAAa,UAAA;KAC5CN,EAAE,wBAAwB,CAAA,GAE7B,sBAAA,cAACP,aAAakB,MAAI;IAACc,SAAS,MAAMnB,aAAa,OAAA;KAAWN,EAAE,qBAAqB,CAAA,GACjF,sBAAA,cAACP,aAAakB,MAAI;IAACc,SAAS,MAAMnB,aAAa,MAAA;KAAUN,EAAE,oBAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAQ/F;",
|
|
6
|
+
"names": ["React", "useObject", "DropdownMenu", "IconButton", "useTranslation", "Settings", "meta", "TriggersSettings", "space", "t", "id", "properties", "changeProperties", "selected", "computeEnvironment", "handleUpdate", "option", "draft", "div", "className", "Item", "title", "description", "Root", "Trigger", "asChild", "iconEnd", "icon", "size", "label", "Portal", "Content", "side", "Viewport", "onClick"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
import { DXN } from "@dxos/keys";
|
|
4
|
+
import { trim } from "@dxos/util";
|
|
5
|
+
var meta = Plugin.makeMeta({
|
|
6
|
+
key: DXN.make("org.dxos.plugin.automation"),
|
|
7
|
+
name: "Automation",
|
|
8
|
+
author: "DXOS",
|
|
9
|
+
description: trim`
|
|
10
|
+
Event-driven workflow automation engine for DXOS Composer.
|
|
11
|
+
An Automation is a user-facing object pairing a trigger ("when" — a timer schedule or an
|
|
12
|
+
incoming feed) with an action ("then" — a persistent compute operation or routine), enabling
|
|
13
|
+
automated pipelines that react to changes in real time without manual intervention.
|
|
14
|
+
|
|
15
|
+
Automations are configured in their own article and surfaced on a per-object "Automations"
|
|
16
|
+
companion that lists the automations connected to each object. A per-space TriggerDispatcher
|
|
17
|
+
manages execution: running locally in the browser when computeEnvironment is "local", or
|
|
18
|
+
delegating to the DXOS edge for server-side reliability; the space settings page chooses the
|
|
19
|
+
runtime location.
|
|
20
|
+
|
|
21
|
+
Operation handlers and blueprints contributed by any plugin in the application are
|
|
22
|
+
automatically merged and made available to every space's OperationRegistry, so new
|
|
23
|
+
capabilities registered by other plugins become instantly invocable from automations.
|
|
24
|
+
`,
|
|
25
|
+
icon: "ph--atom--regular",
|
|
26
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation",
|
|
27
|
+
spec: "PLUGIN.mdl",
|
|
28
|
+
tags: [
|
|
29
|
+
"system"
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
meta
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-DUGOIM7G.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.automation'),\n name: 'Automation',\n author: 'DXOS',\n description: trim`\n Event-driven workflow automation engine for DXOS Composer.\n An Automation is a user-facing object pairing a trigger (\"when\" — a timer schedule or an\n incoming feed) with an action (\"then\" — a persistent compute operation or routine), enabling\n automated pipelines that react to changes in real time without manual intervention.\n\n Automations are configured in their own article and surfaced on a per-object \"Automations\"\n companion that lists the automations connected to each object. A per-space TriggerDispatcher\n manages execution: running locally in the browser when computeEnvironment is \"local\", or\n delegating to the DXOS edge for server-side reliability; the space settings page chooses the\n runtime location.\n\n Operation handlers and blueprints contributed by any plugin in the application are\n automatically merged and made available to every space's OperationRegistry, so new\n capabilities registered by other plugins become instantly invocable from automations.\n `,\n icon: 'ph--atom--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',\n spec: 'PLUGIN.mdl',\n tags: ['system'],\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,OAAOH,OAAOI,SAAS;EAClCC,KAAKJ,IAAIK,KAAK,4BAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,aAAaP;;;;;;;;;;;;;;;;EAgBbQ,MAAM;EACNC,QAAQ;EACRC,MAAM;EACNC,MAAM;IAAC;;AACT,CAAA;",
|
|
6
|
+
"names": ["Plugin", "DXN", "trim", "meta", "makeMeta", "key", "make", "name", "author", "description", "icon", "source", "spec", "tags"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
// src/containers/AutomationArticle/AutomationArticle.tsx
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import React, { useCallback, useMemo } from "react";
|
|
4
|
+
import { Operation, Routine, Trigger } from "@dxos/compute";
|
|
5
|
+
import { Feed, Filter, JsonSchema, Obj, Query, Ref, Scope, Type } from "@dxos/echo";
|
|
6
|
+
import { DXN } from "@dxos/keys";
|
|
7
|
+
import { useObject, useQuery } from "@dxos/react-client/echo";
|
|
8
|
+
import { Button, Icon, Input, useTranslation } from "@dxos/react-ui";
|
|
9
|
+
import { Form, RefField, SelectField, Settings } from "@dxos/react-ui-form";
|
|
10
|
+
import { ParentLabelAnnotation } from "@dxos/schema";
|
|
11
|
+
import { meta } from "#meta";
|
|
12
|
+
var RUN_ROUTINE_DXN = "org.dxos.function.prompt";
|
|
13
|
+
var AutomationArticle = ({ role, subject }) => {
|
|
14
|
+
const { t } = useTranslation(meta.id);
|
|
15
|
+
const db = Obj.getDatabase(subject);
|
|
16
|
+
const trigger = usePrimaryTrigger(subject);
|
|
17
|
+
if (!db) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ React.createElement(Settings.Viewport, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
21
|
+
title: t("general.title"),
|
|
22
|
+
description: t("general.description")
|
|
23
|
+
}, /* @__PURE__ */ React.createElement(Settings.Panel, null, /* @__PURE__ */ React.createElement(GeneralSection, {
|
|
24
|
+
automation: subject,
|
|
25
|
+
trigger
|
|
26
|
+
}))), /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
27
|
+
title: t("trigger-picker.title"),
|
|
28
|
+
description: t("trigger-picker.description")
|
|
29
|
+
}, /* @__PURE__ */ React.createElement(Settings.Panel, null, /* @__PURE__ */ React.createElement(TriggerSection, {
|
|
30
|
+
db,
|
|
31
|
+
automation: subject,
|
|
32
|
+
trigger
|
|
33
|
+
}))), /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
34
|
+
title: t("action.title"),
|
|
35
|
+
description: t("action.description")
|
|
36
|
+
}, /* @__PURE__ */ React.createElement(Settings.Panel, null, /* @__PURE__ */ React.createElement(ActionSection, {
|
|
37
|
+
db,
|
|
38
|
+
automation: subject,
|
|
39
|
+
trigger
|
|
40
|
+
}))));
|
|
41
|
+
};
|
|
42
|
+
var GeneralForm = Schema.Struct({
|
|
43
|
+
name: Schema.String.pipe(Schema.annotations({
|
|
44
|
+
title: "Name"
|
|
45
|
+
}), Schema.optional),
|
|
46
|
+
enabled: Schema.Boolean.annotations({
|
|
47
|
+
title: "Enabled"
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
var GeneralSection = ({ automation, trigger }) => {
|
|
51
|
+
const { defaultValues, fieldMap, handleValuesChanged } = useGeneralForm(automation, trigger);
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Form.Root, {
|
|
53
|
+
key: trigger?.id ?? "new",
|
|
54
|
+
schema: GeneralForm,
|
|
55
|
+
defaultValues,
|
|
56
|
+
fieldMap,
|
|
57
|
+
onValuesChanged: handleValuesChanged
|
|
58
|
+
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.FieldSet, null)));
|
|
59
|
+
};
|
|
60
|
+
var EnabledField = ({ canEnable, messageKey, ...props }) => {
|
|
61
|
+
const { t } = useTranslation(meta.id);
|
|
62
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
63
|
+
className: "flex items-center gap-2 pt-form-padding"
|
|
64
|
+
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
65
|
+
disabled: !canEnable,
|
|
66
|
+
checked: Boolean(props.getValue()) && canEnable,
|
|
67
|
+
onCheckedChange: (checked) => props.onValueChange(props.type, checked)
|
|
68
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
69
|
+
className: "text-sm"
|
|
70
|
+
}, props.label), !canEnable && messageKey && /* @__PURE__ */ React.createElement("span", {
|
|
71
|
+
className: "text-sm text-description"
|
|
72
|
+
}, t(messageKey)));
|
|
73
|
+
};
|
|
74
|
+
var OperationAction = Schema.Struct({
|
|
75
|
+
kind: Schema.Literal("operation"),
|
|
76
|
+
operation: Ref.Ref(Operation.PersistentOperation).pipe(Schema.annotations({
|
|
77
|
+
title: "Operation"
|
|
78
|
+
}), Schema.optional)
|
|
79
|
+
});
|
|
80
|
+
var RoutineAction = Schema.Struct({
|
|
81
|
+
kind: Schema.Literal("routine"),
|
|
82
|
+
routine: Ref.Ref(Routine.Routine).pipe(Schema.annotations({
|
|
83
|
+
title: "Routine"
|
|
84
|
+
}), Schema.optional)
|
|
85
|
+
});
|
|
86
|
+
var ActionForm = Schema.Union(OperationAction, RoutineAction);
|
|
87
|
+
var ActionSection = ({ db, automation, trigger }) => {
|
|
88
|
+
const { defaultValues, fieldMap, handleValuesChanged, selectedOperation } = useActionForm(db, automation, trigger);
|
|
89
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
90
|
+
className: "flex flex-col gap-2"
|
|
91
|
+
}, /* @__PURE__ */ React.createElement(Form.Root, {
|
|
92
|
+
// Remount when the bound trigger changes so the uncontrolled form picks up its action.
|
|
93
|
+
key: trigger?.id ?? "new",
|
|
94
|
+
schema: ActionForm,
|
|
95
|
+
defaultValues,
|
|
96
|
+
db,
|
|
97
|
+
fieldMap,
|
|
98
|
+
onValuesChanged: handleValuesChanged
|
|
99
|
+
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.FieldSet, null))), trigger && selectedOperation && /* @__PURE__ */ React.createElement(ActionInputEditor, {
|
|
100
|
+
db,
|
|
101
|
+
operation: selectedOperation,
|
|
102
|
+
trigger
|
|
103
|
+
}));
|
|
104
|
+
};
|
|
105
|
+
var ActionInputEditor = ({ db, operation, trigger }) => {
|
|
106
|
+
const { t } = useTranslation(meta.id);
|
|
107
|
+
const effectSchema = useMemo(() => operation.inputSchema ? JsonSchema.toEffectSchema(operation.inputSchema) : void 0, [
|
|
108
|
+
operation.inputSchema
|
|
109
|
+
]);
|
|
110
|
+
const propertyCount = operation.inputSchema?.properties ? Object.keys(operation.inputSchema.properties).length : 0;
|
|
111
|
+
const defaultValues = useMemo(() => ({
|
|
112
|
+
...trigger.input ?? {}
|
|
113
|
+
}), [
|
|
114
|
+
operation.id,
|
|
115
|
+
trigger
|
|
116
|
+
]);
|
|
117
|
+
const handleValuesChanged = useCallback((values) => {
|
|
118
|
+
Obj.update(trigger, (trigger2) => {
|
|
119
|
+
trigger2.input = values;
|
|
120
|
+
});
|
|
121
|
+
}, [
|
|
122
|
+
trigger
|
|
123
|
+
]);
|
|
124
|
+
if (!effectSchema || propertyCount === 0) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Form.Label, {
|
|
128
|
+
label: t("action-input.label"),
|
|
129
|
+
asChild: true
|
|
130
|
+
}), /* @__PURE__ */ React.createElement(Form.Root, {
|
|
131
|
+
key: operation.id,
|
|
132
|
+
schema: effectSchema,
|
|
133
|
+
defaultValues,
|
|
134
|
+
db,
|
|
135
|
+
onValuesChanged: handleValuesChanged
|
|
136
|
+
}, /* @__PURE__ */ React.createElement(Form.FieldSet, null)));
|
|
137
|
+
};
|
|
138
|
+
var TimerSpecForm = Schema.Struct({
|
|
139
|
+
kind: Schema.Literal("timer"),
|
|
140
|
+
cron: Schema.String.pipe(Schema.annotations({
|
|
141
|
+
title: "Schedule (cron)"
|
|
142
|
+
}), Schema.optional)
|
|
143
|
+
});
|
|
144
|
+
var FeedSpecForm = Schema.Struct({
|
|
145
|
+
kind: Schema.Literal("feed"),
|
|
146
|
+
feed: Ref.Ref(Feed.Feed).pipe(ParentLabelAnnotation.set(true), Schema.annotations({
|
|
147
|
+
title: "Feed"
|
|
148
|
+
}), Schema.optional)
|
|
149
|
+
});
|
|
150
|
+
var TriggerForm = Schema.Union(TimerSpecForm, FeedSpecForm);
|
|
151
|
+
var triggerFormValues = (spec) => spec?.kind === "feed" ? {
|
|
152
|
+
kind: "feed",
|
|
153
|
+
feed: spec.feed
|
|
154
|
+
} : {
|
|
155
|
+
kind: "timer",
|
|
156
|
+
cron: spec?.kind === "timer" ? spec.cron : ""
|
|
157
|
+
};
|
|
158
|
+
var triggerFormSpec = (values) => values.kind === "feed" ? {
|
|
159
|
+
kind: "feed",
|
|
160
|
+
feed: values.feed
|
|
161
|
+
} : Trigger.specTimer(values.cron ?? "");
|
|
162
|
+
var TriggerSection = ({ db, automation, trigger }) => {
|
|
163
|
+
const { t } = useTranslation(meta.id);
|
|
164
|
+
const { defaultValues, fieldMap, handleValuesChanged, handleRemove } = useTriggerForm(db, automation, trigger);
|
|
165
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
166
|
+
className: "flex flex-col gap-2"
|
|
167
|
+
}, /* @__PURE__ */ React.createElement(Form.Root, {
|
|
168
|
+
// Remount when the bound trigger changes so the uncontrolled form picks up its spec.
|
|
169
|
+
key: trigger?.id ?? "new",
|
|
170
|
+
schema: TriggerForm,
|
|
171
|
+
defaultValues,
|
|
172
|
+
db,
|
|
173
|
+
fieldMap,
|
|
174
|
+
onValuesChanged: handleValuesChanged
|
|
175
|
+
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.FieldSet, null))), trigger && /* @__PURE__ */ React.createElement(Button, {
|
|
176
|
+
variant: "ghost",
|
|
177
|
+
classNames: "gap-1 self-start",
|
|
178
|
+
onClick: handleRemove
|
|
179
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
180
|
+
icon: "ph--trash--regular",
|
|
181
|
+
size: 4
|
|
182
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("remove-trigger.label"))));
|
|
183
|
+
};
|
|
184
|
+
var InlineSection = ({ title, children }) => /* @__PURE__ */ React.createElement("div", {
|
|
185
|
+
className: "flex flex-col gap-1"
|
|
186
|
+
}, /* @__PURE__ */ React.createElement("h3", {
|
|
187
|
+
className: "pli-1 text-sm font-medium text-description"
|
|
188
|
+
}, title), /* @__PURE__ */ React.createElement(Settings.Panel, null, children));
|
|
189
|
+
var AutomationInlineForm = ({ automation, db }) => {
|
|
190
|
+
const { t } = useTranslation(meta.id);
|
|
191
|
+
const trigger = usePrimaryTrigger(automation);
|
|
192
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
193
|
+
className: "flex flex-col gap-3"
|
|
194
|
+
}, /* @__PURE__ */ React.createElement(InlineSection, {
|
|
195
|
+
title: t("general.title")
|
|
196
|
+
}, /* @__PURE__ */ React.createElement(GeneralSection, {
|
|
197
|
+
automation,
|
|
198
|
+
trigger
|
|
199
|
+
})), /* @__PURE__ */ React.createElement(InlineSection, {
|
|
200
|
+
title: t("trigger-picker.title")
|
|
201
|
+
}, /* @__PURE__ */ React.createElement(TriggerSection, {
|
|
202
|
+
db,
|
|
203
|
+
automation,
|
|
204
|
+
trigger
|
|
205
|
+
})), /* @__PURE__ */ React.createElement(InlineSection, {
|
|
206
|
+
title: t("action.title")
|
|
207
|
+
}, /* @__PURE__ */ React.createElement(ActionSection, {
|
|
208
|
+
db,
|
|
209
|
+
automation,
|
|
210
|
+
trigger
|
|
211
|
+
})));
|
|
212
|
+
};
|
|
213
|
+
var usePrimaryTrigger = (automation) => {
|
|
214
|
+
const [snapshot] = useObject(automation);
|
|
215
|
+
return useMemo(() => {
|
|
216
|
+
for (const ref of snapshot.triggers) {
|
|
217
|
+
const target = ref.target;
|
|
218
|
+
if (Obj.instanceOf(Trigger.Trigger, target)) {
|
|
219
|
+
return target;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return void 0;
|
|
223
|
+
}, [
|
|
224
|
+
snapshot.triggers
|
|
225
|
+
]);
|
|
226
|
+
};
|
|
227
|
+
var useGeneralForm = (automation, trigger) => {
|
|
228
|
+
const [auto, updateAuto] = useObject(automation);
|
|
229
|
+
const canEnable = Boolean(trigger && auto.runnable);
|
|
230
|
+
const messageKey = !trigger ? "add-trigger-first.message" : !auto.runnable ? "select-action-first.message" : void 0;
|
|
231
|
+
const fieldMap = useMemo(() => ({
|
|
232
|
+
enabled: (props) => /* @__PURE__ */ React.createElement(EnabledField, {
|
|
233
|
+
...props,
|
|
234
|
+
canEnable,
|
|
235
|
+
messageKey
|
|
236
|
+
})
|
|
237
|
+
}), [
|
|
238
|
+
canEnable,
|
|
239
|
+
messageKey
|
|
240
|
+
]);
|
|
241
|
+
const defaultValues = useMemo(
|
|
242
|
+
() => ({
|
|
243
|
+
name: auto.name,
|
|
244
|
+
enabled: (trigger?.enabled ?? false) && canEnable
|
|
245
|
+
}),
|
|
246
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
247
|
+
[
|
|
248
|
+
automation,
|
|
249
|
+
trigger
|
|
250
|
+
]
|
|
251
|
+
);
|
|
252
|
+
const handleValuesChanged = useCallback((values) => {
|
|
253
|
+
updateAuto((automation2) => {
|
|
254
|
+
automation2.name = values.name;
|
|
255
|
+
});
|
|
256
|
+
if (trigger && canEnable) {
|
|
257
|
+
Obj.update(trigger, (trigger2) => {
|
|
258
|
+
trigger2.enabled = values.enabled ?? false;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}, [
|
|
262
|
+
updateAuto,
|
|
263
|
+
trigger,
|
|
264
|
+
canEnable
|
|
265
|
+
]);
|
|
266
|
+
return {
|
|
267
|
+
defaultValues,
|
|
268
|
+
fieldMap,
|
|
269
|
+
handleValuesChanged
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
var useActionForm = (db, automation, trigger) => {
|
|
273
|
+
const { t } = useTranslation(meta.id);
|
|
274
|
+
const [auto, updateAuto] = useObject(automation);
|
|
275
|
+
const operations = useQuery(
|
|
276
|
+
db,
|
|
277
|
+
// Include registry operations (built-in / plugin-provided) alongside space-resident ones.
|
|
278
|
+
Query.select(Filter.type(DXN.make(Type.getTypename(Operation.PersistentOperation)))).from(Scope.space(), Scope.registry())
|
|
279
|
+
);
|
|
280
|
+
const routines = useQuery(db, Query.select(Filter.type(DXN.make(Type.getTypename(Routine.Routine)))).from(Scope.space(), Scope.registry()));
|
|
281
|
+
const runRoutineOp = useMemo(() => findRunRoutineOp(operations), [
|
|
282
|
+
operations
|
|
283
|
+
]);
|
|
284
|
+
const boundRoutine = getBoundRoutine(trigger);
|
|
285
|
+
const runnableTarget = auto.runnable?.target;
|
|
286
|
+
const kindOptions = useMemo(() => [
|
|
287
|
+
{
|
|
288
|
+
value: "operation",
|
|
289
|
+
label: t("action-kind.operation.label")
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
value: "routine",
|
|
293
|
+
label: t("action-kind.routine.label")
|
|
294
|
+
}
|
|
295
|
+
], [
|
|
296
|
+
t
|
|
297
|
+
]);
|
|
298
|
+
const fieldMap = useMemo(() => ({
|
|
299
|
+
kind: (props) => /* @__PURE__ */ React.createElement(SelectField, {
|
|
300
|
+
...props,
|
|
301
|
+
options: kindOptions
|
|
302
|
+
}),
|
|
303
|
+
// Custom useResults so pickers draw from the already-queried sets (space + registry for
|
|
304
|
+
// operations; space-only for routines) rather than RefField's default typename query.
|
|
305
|
+
operation: (props) => /* @__PURE__ */ React.createElement(RefField, {
|
|
306
|
+
...props,
|
|
307
|
+
db,
|
|
308
|
+
useResults: () => operations
|
|
309
|
+
}),
|
|
310
|
+
routine: (props) => /* @__PURE__ */ React.createElement(RefField, {
|
|
311
|
+
...props,
|
|
312
|
+
db,
|
|
313
|
+
useResults: () => routines
|
|
314
|
+
})
|
|
315
|
+
}), [
|
|
316
|
+
kindOptions,
|
|
317
|
+
operations,
|
|
318
|
+
routines,
|
|
319
|
+
db
|
|
320
|
+
]);
|
|
321
|
+
const defaultValues = useMemo(() => {
|
|
322
|
+
if (boundRoutine) {
|
|
323
|
+
return {
|
|
324
|
+
kind: "routine",
|
|
325
|
+
routine: Ref.make(boundRoutine)
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
if (auto.runnable && Obj.instanceOf(Operation.PersistentOperation, runnableTarget)) {
|
|
329
|
+
return {
|
|
330
|
+
kind: "operation",
|
|
331
|
+
operation: auto.runnable
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
return {
|
|
335
|
+
kind: "operation"
|
|
336
|
+
};
|
|
337
|
+
}, [
|
|
338
|
+
automation,
|
|
339
|
+
trigger
|
|
340
|
+
]);
|
|
341
|
+
const handleValuesChanged = useCallback((values) => {
|
|
342
|
+
const action = values;
|
|
343
|
+
if (action.kind === "routine") {
|
|
344
|
+
const routineRef = action.routine;
|
|
345
|
+
if (!routineRef || !runRoutineOp) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
updateAuto((automation2) => {
|
|
349
|
+
automation2.runnable = Ref.make(runRoutineOp);
|
|
350
|
+
});
|
|
351
|
+
if (trigger) {
|
|
352
|
+
Obj.update(trigger, (trigger2) => {
|
|
353
|
+
trigger2.function = Ref.make(runRoutineOp);
|
|
354
|
+
trigger2.input = {
|
|
355
|
+
prompt: routineRef,
|
|
356
|
+
input: {}
|
|
357
|
+
};
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
} else if (action.kind === "operation" && action.operation) {
|
|
361
|
+
const operationRef = action.operation;
|
|
362
|
+
updateAuto((automation2) => {
|
|
363
|
+
automation2.runnable = operationRef;
|
|
364
|
+
});
|
|
365
|
+
if (trigger) {
|
|
366
|
+
Obj.update(trigger, (trigger2) => {
|
|
367
|
+
trigger2.function = operationRef;
|
|
368
|
+
trigger2.input = void 0;
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}, [
|
|
373
|
+
runRoutineOp,
|
|
374
|
+
trigger,
|
|
375
|
+
updateAuto
|
|
376
|
+
]);
|
|
377
|
+
const selectedOperation = !boundRoutine && Obj.instanceOf(Operation.PersistentOperation, runnableTarget) ? runnableTarget : void 0;
|
|
378
|
+
return {
|
|
379
|
+
defaultValues,
|
|
380
|
+
fieldMap,
|
|
381
|
+
handleValuesChanged,
|
|
382
|
+
selectedOperation
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
var useTriggerForm = (db, automation, trigger) => {
|
|
386
|
+
const { t } = useTranslation(meta.id);
|
|
387
|
+
const kindOptions = useMemo(() => [
|
|
388
|
+
{
|
|
389
|
+
value: "timer",
|
|
390
|
+
label: t("trigger-kind.timer.label")
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
value: "feed",
|
|
394
|
+
label: t("trigger-kind.feed.label")
|
|
395
|
+
}
|
|
396
|
+
], [
|
|
397
|
+
t
|
|
398
|
+
]);
|
|
399
|
+
const fieldMap = useMemo(() => ({
|
|
400
|
+
kind: (props) => /* @__PURE__ */ React.createElement(SelectField, {
|
|
401
|
+
...props,
|
|
402
|
+
options: kindOptions
|
|
403
|
+
})
|
|
404
|
+
}), [
|
|
405
|
+
kindOptions
|
|
406
|
+
]);
|
|
407
|
+
const defaultValues = useMemo(
|
|
408
|
+
() => triggerFormValues(trigger?.spec),
|
|
409
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
410
|
+
[
|
|
411
|
+
trigger
|
|
412
|
+
]
|
|
413
|
+
);
|
|
414
|
+
const handleValuesChanged = useCallback((values) => {
|
|
415
|
+
const spec = triggerFormSpec(values);
|
|
416
|
+
if (trigger) {
|
|
417
|
+
Obj.update(trigger, (trigger2) => {
|
|
418
|
+
trigger2.spec = spec;
|
|
419
|
+
});
|
|
420
|
+
} else {
|
|
421
|
+
const created = db.add(Trigger.make({
|
|
422
|
+
function: automation.runnable,
|
|
423
|
+
enabled: false,
|
|
424
|
+
spec
|
|
425
|
+
}));
|
|
426
|
+
Obj.setParent(created, automation);
|
|
427
|
+
Obj.update(automation, (automation2) => {
|
|
428
|
+
automation2.triggers = [
|
|
429
|
+
...automation2.triggers,
|
|
430
|
+
Ref.make(created)
|
|
431
|
+
];
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
}, [
|
|
435
|
+
db,
|
|
436
|
+
automation,
|
|
437
|
+
trigger
|
|
438
|
+
]);
|
|
439
|
+
const handleRemove = useCallback(() => {
|
|
440
|
+
if (!trigger) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
Obj.update(automation, (automation2) => {
|
|
444
|
+
automation2.triggers = automation2.triggers.filter((ref) => ref.target?.id !== trigger.id);
|
|
445
|
+
});
|
|
446
|
+
db.remove(trigger);
|
|
447
|
+
}, [
|
|
448
|
+
db,
|
|
449
|
+
automation,
|
|
450
|
+
trigger
|
|
451
|
+
]);
|
|
452
|
+
return {
|
|
453
|
+
defaultValues,
|
|
454
|
+
fieldMap,
|
|
455
|
+
handleValuesChanged,
|
|
456
|
+
handleRemove
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
var getBoundRoutine = (trigger) => {
|
|
460
|
+
const prompt = trigger?.input?.prompt;
|
|
461
|
+
const target = Ref.isRef(prompt) ? prompt.target : void 0;
|
|
462
|
+
return Obj.instanceOf(Routine.Routine, target) ? target : void 0;
|
|
463
|
+
};
|
|
464
|
+
var findRunRoutineOp = (operations) => {
|
|
465
|
+
for (const op of operations) {
|
|
466
|
+
if (!Obj.instanceOf(Operation.PersistentOperation, op)) {
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
try {
|
|
470
|
+
if (Operation.deserialize(op).meta.key.toString().includes(RUN_ROUTINE_DXN)) {
|
|
471
|
+
return op;
|
|
472
|
+
}
|
|
473
|
+
} catch {
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return void 0;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
export {
|
|
480
|
+
AutomationArticle,
|
|
481
|
+
GeneralSection,
|
|
482
|
+
ActionSection,
|
|
483
|
+
TriggerSection,
|
|
484
|
+
AutomationInlineForm
|
|
485
|
+
};
|
|
486
|
+
//# sourceMappingURL=chunk-FE7YFBX7.mjs.map
|