@dxos/plugin-routine 0.11.1 → 0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/Routine.mjs +34 -0
- package/dist/lib/Routine.mjs.map +1 -0
- package/dist/lib/RoutineCapabilities.mjs +30 -0
- package/dist/lib/RoutineCapabilities.mjs.map +1 -0
- package/dist/lib/RoutineEvents.mjs +14 -0
- package/dist/lib/RoutineEvents.mjs.map +1 -0
- package/dist/lib/RoutineOperation.mjs +92 -0
- package/dist/lib/RoutineOperation.mjs.map +1 -0
- package/dist/lib/RoutinePlugin.mjs +16 -2
- package/dist/lib/RoutinePlugin.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +51 -10
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs +45 -0
- package/dist/lib/capabilities.node.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +28 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -0
- package/dist/lib/chunk-RoutineArticle.mjs +8 -4
- package/dist/lib/chunk-RoutineArticle.mjs.map +1 -1
- package/dist/lib/chunk-RoutineSettings.mjs.map +1 -1
- package/dist/lib/chunk-RoutineTraceCompanion.mjs +14 -6
- package/dist/lib/chunk-RoutineTraceCompanion.mjs.map +1 -1
- package/dist/lib/chunk-SkillArticle.mjs.map +1 -1
- package/dist/lib/chunk-app-graph-builder.mjs +19 -24
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/{RoutinePlugin.node.mjs → chunk-commands.mjs} +33 -65
- package/dist/lib/chunk-commands.mjs.map +1 -0
- package/dist/lib/chunk-create-object.mjs +8 -6
- package/dist/lib/chunk-create-object.mjs.map +1 -1
- package/dist/lib/chunk-create-routine.mjs +14 -17
- package/dist/lib/chunk-create-routine.mjs.map +1 -1
- package/dist/lib/chunk-create-trigger-from-template.mjs +12 -15
- package/dist/lib/chunk-create-trigger-from-template.mjs.map +1 -1
- package/dist/lib/chunk-layer-specs.mjs +80 -46
- package/dist/lib/chunk-layer-specs.mjs.map +1 -1
- package/dist/lib/chunk-operation-handler.mjs +3 -2
- package/dist/lib/chunk-operation-handler.mjs.map +1 -1
- package/dist/lib/chunk-paths.mjs +2 -2
- package/dist/lib/chunk-paths.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +7 -14
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-registry-sync.mjs +15 -14
- package/dist/lib/chunk-registry-sync.mjs.map +1 -1
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-run-routine.mjs +9 -8
- package/dist/lib/chunk-run-routine.mjs.map +1 -1
- package/dist/lib/chunk-schema.mjs +21 -0
- package/dist/lib/chunk-schema.mjs.map +1 -0
- package/dist/lib/chunk-templates.mjs +9 -15
- package/dist/lib/chunk-templates.mjs.map +1 -1
- package/dist/lib/chunk-trigger-runtime-controller.mjs +12 -10
- package/dist/lib/chunk-trigger-runtime-controller.mjs.map +1 -1
- package/dist/lib/components.mjs +452 -250
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/containers.mjs +1 -2
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/hooks.mjs +4 -3
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/index.mjs +5 -4
- package/dist/lib/meta.mjs +34 -1
- package/dist/lib/meta.mjs.map +1 -0
- package/dist/lib/operations.mjs +8 -2
- package/dist/lib/operations.mjs.map +1 -1
- package/dist/lib/plugin.mjs +6 -6
- package/dist/lib/plugin.mjs.map +1 -1
- package/dist/lib/testing.mjs +1 -2
- package/dist/lib/translations.mjs +3 -7
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/lib/types.mjs +5 -2
- package/dist/lib/util.mjs +66 -0
- package/dist/lib/util.mjs.map +1 -0
- package/dist/types/src/RoutinePlugin.d.ts +36 -3
- package/dist/types/src/RoutinePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/commands.d.ts +3 -0
- package/dist/types/src/capabilities/commands.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +2 -2
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/node.d.ts +14 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts +14 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +13 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +2 -2
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +2 -3
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/registry-sync.d.ts +2 -2
- package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema.d.ts +12 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/templates.d.ts +2 -2
- package/dist/types/src/capabilities/templates.d.ts.map +1 -1
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +2 -2
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/feed.d.ts +8 -7
- package/dist/types/src/commands/trigger/create/feed.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/index.d.ts +2 -24
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/subscription.d.ts +8 -7
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/timer.d.ts +8 -7
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/index.d.ts +2 -56
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/list.d.ts +6 -4
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/options.d.ts +9 -9
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/remove.d.ts +6 -4
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/feed.d.ts +8 -6
- package/dist/types/src/commands/trigger/update/feed.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/index.d.ts +2 -27
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/subscription.d.ts +8 -6
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/timer.d.ts +8 -6
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/util.d.ts +10 -9
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -1
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts +10 -5
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.stories.d.ts +28 -0
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts +1 -1
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts.map +1 -1
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts +2 -1
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/RoutineCard/RoutineCard.d.ts +1 -1
- package/dist/types/src/components/RoutineCard/RoutineCard.d.ts.map +1 -1
- package/dist/types/src/components/RoutineCard/RoutineCard.stories.d.ts +2 -1
- package/dist/types/src/components/RoutineCard/RoutineCard.stories.d.ts.map +1 -1
- package/dist/types/src/components/RoutineForm/RoutineForm.d.ts +16 -10
- package/dist/types/src/components/RoutineForm/RoutineForm.d.ts.map +1 -1
- package/dist/types/src/components/{TriggerEditor/TriggerEditor.stories.d.ts → RoutineForm/RoutineForm.stories.d.ts} +4 -3
- package/dist/types/src/components/RoutineForm/RoutineForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/Schedule.stories.d.ts +5 -4
- package/dist/types/src/components/Schedule/Schedule.stories.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/types.d.ts +38 -38
- package/dist/types/src/components/Schedule/types.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +4 -3
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +3 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +50 -17
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.stories.d.ts +2 -1
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +2 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.d.ts +2 -1
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/runs.d.ts +2 -2
- package/dist/types/src/containers/RoutineTraceCompanion/runs.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts.map +1 -1
- package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts +1 -1
- package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +0 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-routine.d.ts +2 -2
- package/dist/types/src/operations/create-routine.d.ts.map +1 -1
- package/dist/types/src/operations/create-trigger-from-template.d.ts +2 -2
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/run-routine.d.ts +2 -2
- package/dist/types/src/operations/run-routine.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +2 -2
- package/dist/types/src/plugin.d.ts.map +1 -1
- package/dist/types/src/plugin.test.d.ts +2 -0
- package/dist/types/src/plugin.test.d.ts.map +1 -0
- package/dist/types/src/templates/index.d.ts +1 -3
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +1 -1
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Routine.d.ts +31 -0
- package/dist/types/src/types/Routine.d.ts.map +1 -0
- package/dist/types/src/types/RoutineCapabilities.d.ts +18 -15
- package/dist/types/src/types/RoutineCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/RoutineEvents.d.ts +7 -0
- package/dist/types/src/types/RoutineEvents.d.ts.map +1 -0
- package/dist/types/src/types/RoutineOperation.d.ts +9 -5
- package/dist/types/src/types/RoutineOperation.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +0 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/run-instructions.d.ts.map +1 -1
- package/dist/types/src/util/wire.d.ts +3 -1
- package/dist/types/src/util/wire.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -2
- package/package.json +102 -80
- package/src/RoutinePlugin.ts +15 -0
- package/src/capabilities/app-graph-builder.ts +18 -26
- package/src/capabilities/commands.ts +11 -0
- package/src/capabilities/create-object.ts +15 -6
- package/src/capabilities/gen/node.ts +69 -0
- package/src/capabilities/gen/workerd.ts +38 -0
- package/src/capabilities/index.ts +65 -12
- package/src/capabilities/layer-specs.ts +100 -39
- package/src/capabilities/operation-handler.ts +4 -4
- package/src/capabilities/react-surface.ts +6 -13
- package/src/capabilities/registry-sync.ts +17 -10
- package/src/capabilities/schema.ts +21 -0
- package/src/capabilities/templates.ts +2 -2
- package/src/capabilities/trigger-runtime-controller.test.ts +13 -12
- package/src/capabilities/trigger-runtime-controller.ts +11 -8
- package/src/commands/trigger/create/feed.ts +7 -6
- package/src/commands/trigger/create/index.ts +1 -1
- package/src/commands/trigger/create/subscription.ts +7 -6
- package/src/commands/trigger/create/timer.ts +7 -6
- package/src/commands/trigger/index.ts +1 -1
- package/src/commands/trigger/list.ts +4 -4
- package/src/commands/trigger/options.ts +8 -10
- package/src/commands/trigger/remove.ts +3 -3
- package/src/commands/trigger/update/feed.ts +5 -4
- package/src/commands/trigger/update/index.ts +1 -1
- package/src/commands/trigger/update/subscription.ts +7 -6
- package/src/commands/trigger/update/timer.ts +5 -4
- package/src/commands/trigger/util.ts +39 -25
- package/src/components/CreateRoutinePanel/CreateRoutinePanel.stories.tsx +136 -0
- package/src/components/CreateRoutinePanel/CreateRoutinePanel.tsx +121 -18
- package/src/components/InstructionsEditor/InstructionsEditor.stories.tsx +2 -1
- package/src/components/InstructionsEditor/InstructionsEditor.tsx +8 -1
- package/src/components/RoutineCard/RoutineCard.stories.tsx +3 -1
- package/src/components/RoutineCard/RoutineCard.tsx +2 -1
- package/src/components/{TriggerEditor/TriggerEditor.stories.tsx → RoutineForm/RoutineForm.stories.tsx} +12 -12
- package/src/components/RoutineForm/RoutineForm.tsx +277 -173
- package/src/components/Schedule/types.ts +52 -22
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -1
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -1
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
- package/src/components/TriggerEditor/TriggerEditor.tsx +182 -217
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +6 -3
- package/src/containers/RoutineArticle/RoutineArticle.tsx +6 -3
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.tsx +4 -2
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.tsx +6 -4
- package/src/containers/RoutineTraceCompanion/runs.test.ts +65 -2
- package/src/containers/RoutineTraceCompanion/runs.ts +16 -4
- package/src/containers/RoutineTraceCompanion/useRoutineRuns.ts +2 -1
- package/src/containers/SkillArticle/SkillArticle.tsx +1 -1
- package/src/containers/index.ts +0 -1
- package/src/hooks/useTriggerRuntimeControls.ts +4 -3
- package/src/index.ts +3 -2
- package/src/meta.ts +1 -1
- package/src/operations/create-routine.ts +10 -14
- package/src/operations/create-trigger-from-template.ts +9 -8
- package/src/operations/index.ts +11 -6
- package/src/operations/run-routine.test.ts +12 -6
- package/src/operations/run-routine.ts +3 -2
- package/src/paths.ts +2 -2
- package/src/{RoutinePlugin.test.ts → plugin.test.ts} +3 -4
- package/src/plugin.tsx +45 -0
- package/src/templates/index.ts +6 -18
- package/src/testing/test-functions.ts +7 -7
- package/src/testing.ts +1 -1
- package/src/translations.ts +3 -7
- package/src/types/{schema.ts → Routine.ts} +3 -3
- package/src/types/RoutineCapabilities.ts +22 -16
- package/src/types/RoutineEvents.ts +15 -0
- package/src/types/RoutineOperation.ts +17 -16
- package/src/types/index.ts +3 -3
- package/src/util/index.ts +0 -1
- package/src/util/run-instructions.ts +4 -3
- package/src/util/wire.test.ts +5 -1
- package/src/util/wire.ts +4 -3
- package/dist/lib/RoutinePlugin.node.mjs.map +0 -1
- package/dist/lib/RoutinePlugin.workerd.mjs +0 -20
- package/dist/lib/RoutinePlugin.workerd.mjs.map +0 -1
- package/dist/lib/capabilities/node.mjs +0 -12
- package/dist/lib/capabilities/node.mjs.map +0 -1
- package/dist/lib/chunk-RoutineCompanion.mjs +0 -192
- package/dist/lib/chunk-RoutineCompanion.mjs.map +0 -1
- package/dist/lib/chunk-RoutinePlugin.mjs +0 -38
- package/dist/lib/chunk-RoutinePlugin.mjs.map +0 -1
- package/dist/lib/chunk-meta.mjs +0 -36
- package/dist/lib/chunk-meta.mjs.map +0 -1
- package/dist/lib/chunk-types.mjs +0 -149
- package/dist/lib/chunk-types.mjs.map +0 -1
- package/dist/lib/chunk-util.mjs +0 -142
- package/dist/lib/chunk-util.mjs.map +0 -1
- package/dist/types/src/RoutinePlugin.node.d.ts +0 -4
- package/dist/types/src/RoutinePlugin.node.d.ts.map +0 -1
- package/dist/types/src/RoutinePlugin.test.d.ts +0 -2
- package/dist/types/src/RoutinePlugin.test.d.ts.map +0 -1
- package/dist/types/src/RoutinePlugin.workerd.d.ts +0 -4
- package/dist/types/src/RoutinePlugin.workerd.d.ts.map +0 -1
- package/dist/types/src/capabilities/node.d.ts +0 -9
- package/dist/types/src/capabilities/node.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/types.d.ts +0 -18
- package/dist/types/src/components/TemplateEditor/types.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +0 -1
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts +0 -9
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts.map +0 -1
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.stories.d.ts +0 -15
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.stories.d.ts.map +0 -1
- package/dist/types/src/containers/RoutineCompanion/index.d.ts +0 -3
- package/dist/types/src/containers/RoutineCompanion/index.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -33
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/util/routines-for-object.d.ts +0 -25
- package/dist/types/src/util/routines-for-object.d.ts.map +0 -1
- package/dist/types/src/util/routines-for-object.test.d.ts +0 -2
- package/dist/types/src/util/routines-for-object.test.d.ts.map +0 -1
- package/src/RoutinePlugin.node.ts +0 -47
- package/src/RoutinePlugin.tsx +0 -56
- package/src/RoutinePlugin.workerd.ts +0 -23
- package/src/capabilities/node.ts +0 -19
- package/src/components/TemplateEditor/types.tsx +0 -28
- package/src/containers/RoutineCompanion/RoutineCompanion.stories.tsx +0 -83
- package/src/containers/RoutineCompanion/RoutineCompanion.tsx +0 -346
- package/src/containers/RoutineCompanion/index.ts +0 -6
- package/src/plugin.ts +0 -11
- package/src/util/routines-for-object.test.ts +0 -141
- package/src/util/routines-for-object.ts +0 -114
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
import { Database } from "@dxos/echo";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
//#region src/types/Routine.ts
|
|
6
|
+
var Routine_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
AutomationAction: () => AutomationAction,
|
|
8
|
+
TriggerTemplate: () => TriggerTemplate
|
|
9
|
+
});
|
|
10
|
+
var TriggerTemplate = Schema.Union([Schema.Struct({
|
|
11
|
+
type: Schema.Literal("timer"),
|
|
12
|
+
cron: Schema.String
|
|
13
|
+
}), Schema.Struct({
|
|
14
|
+
type: Schema.Literal("feed"),
|
|
15
|
+
feed: Schema.Any
|
|
16
|
+
})]);
|
|
17
|
+
var AutomationAction;
|
|
18
|
+
(function(_AutomationAction) {
|
|
19
|
+
class CreateTriggerFromTemplate extends Schema.TaggedClass()(`${meta.profile.key}.action.create-trigger-from-template`, {
|
|
20
|
+
input: Schema.Struct({
|
|
21
|
+
db: Database.Database,
|
|
22
|
+
template: TriggerTemplate,
|
|
23
|
+
enabled: Schema.optional(Schema.Boolean),
|
|
24
|
+
scriptName: Schema.optional(Schema.String),
|
|
25
|
+
input: Schema.optional(Schema.Record(Schema.String, Schema.Any))
|
|
26
|
+
}),
|
|
27
|
+
output: Schema.Void
|
|
28
|
+
}) {}
|
|
29
|
+
_AutomationAction.CreateTriggerFromTemplate = CreateTriggerFromTemplate;
|
|
30
|
+
})(AutomationAction || (AutomationAction = {}));
|
|
31
|
+
//#endregion
|
|
32
|
+
export { AutomationAction, TriggerTemplate, Routine_exports as t };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=Routine.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Routine.mjs","names":[],"sources":["../../src/types/Routine.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Database } from '@dxos/echo';\n\nimport { meta } from '#meta';\n\nexport const TriggerTemplate = Schema.Union([\n Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),\n Schema.Struct({ type: Schema.Literal('feed'), feed: Schema.Any }),\n]);\n\nexport namespace AutomationAction {\n export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(\n `${meta.profile.key}.action.create-trigger-from-template`,\n {\n input: Schema.Struct({\n db: Database.Database,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n // TODO(wittjosiah): Improve how this lookup is done.\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record(Schema.String, Schema.Any)),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,kBAAkB,OAAO,MAAM,CAC1C,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,OAAO;CAAG,MAAM,OAAO;AAAO,CAAC,GACpE,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,MAAM;CAAG,MAAM,OAAO;AAAI,CAAC,CAClE,CAAC;AAEM,IAAU;CAAV,SAAA,mBAAA;CACE,MAAM,kCAAkC,OAAO,YAAuC,CAAC,CAC5F,GAAG,KAAK,QAAQ,IAAI,uCACpB;EACE,OAAO,OAAO,OAAO;GACnB,IAAI,SAAS;GACb,UAAU;GACV,SAAS,OAAO,SAAS,OAAO,OAAO;GAEvC,YAAY,OAAO,SAAS,OAAO,MAAM;GACzC,OAAO,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,GAAG,CAAC;EACjE,CAAC;EACD,QAAQ,OAAO;CACjB,CACF,CAAC,CAAC,CAAC;;AACL,EAAA,CAAA,qBAAA,mBAAA,CAAA,EAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
//#region src/types/RoutineCapabilities.ts
|
|
4
|
+
var RoutineCapabilities_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
AgentDelegationStrategy: () => AgentDelegationStrategy,
|
|
6
|
+
BlankTemplateId: () => BlankTemplateId,
|
|
7
|
+
Template: () => Template
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Optional supervisor strategy for the agent chat service. When contributed (by a plugin that knows
|
|
11
|
+
* the agent/plan model, e.g. plugin-assistant), the conversational agent delegates outstanding work
|
|
12
|
+
* to sub-agents and folds their results back into the conversation. Consumed by the AgentService
|
|
13
|
+
* LayerSpec; absent by default (a plain conversational agent).
|
|
14
|
+
*
|
|
15
|
+
* A registry rather than a singleton: the AgentService reads it with `getAll` and takes the first,
|
|
16
|
+
* and a harness that needs the strategy in place before the app's own module activates has to be
|
|
17
|
+
* able to contribute one without the two colliding.
|
|
18
|
+
*/
|
|
19
|
+
var AgentDelegationStrategy = Capability.make()("org.dxos.plugin.routine.capability.agentDelegationStrategy");
|
|
20
|
+
/**
|
|
21
|
+
* Id of the built-in blank template. Declared here (rather than on the template itself) so callers that
|
|
22
|
+
* scaffold a routine without the picker — e.g. a project's toolbar — can name it without importing the
|
|
23
|
+
* template module.
|
|
24
|
+
*/
|
|
25
|
+
var BlankTemplateId = "org.dxos.routine.blank";
|
|
26
|
+
var Template = Capability.make()("org.dxos.plugin.routine.capability.template");
|
|
27
|
+
//#endregion
|
|
28
|
+
export { AgentDelegationStrategy, BlankTemplateId, Template, RoutineCapabilities_exports as t };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=RoutineCapabilities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoutineCapabilities.mjs","names":[],"sources":["../../src/types/RoutineCapabilities.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Effect from 'effect/Effect';\nimport type * as Schema from 'effect/Schema';\n\nimport type { DelegationStrategy } from '@dxos/agent-runtime';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Routine from '@dxos/compute/Routine';\nimport type { Database, Obj } from '@dxos/echo';\n\n/**\n * Optional supervisor strategy for the agent chat service. When contributed (by a plugin that knows\n * the agent/plan model, e.g. plugin-assistant), the conversational agent delegates outstanding work\n * to sub-agents and folds their results back into the conversation. Consumed by the AgentService\n * LayerSpec; absent by default (a plain conversational agent).\n *\n * A registry rather than a singleton: the AgentService reads it with `getAll` and takes the first,\n * and a harness that needs the strategy in place before the app's own module activates has to be\n * able to contribute one without the two colliding.\n */\nexport const AgentDelegationStrategy = Capability.make<DelegationStrategy>()(\n 'org.dxos.plugin.routine.capability.agentDelegationStrategy',\n);\n\n/**\n * Id of the built-in blank template. Declared here (rather than on the template itself) so callers that\n * scaffold a routine without the picker — e.g. a project's toolbar — can name it without importing the\n * template module.\n */\nexport const BlankTemplateId = 'org.dxos.routine.blank';\n\n/**\n * A routine template contributed by a plugin. The create dialog lists contributed templates\n * (`Capability.getAll(RoutineCapabilities.Template)`) and runs the chosen template's `scaffold`.\n */\nexport type Template = {\n /** Stable id (e.g. 'org.dxos.routine.blank'). */\n id: string;\n /** Human-readable label shown in the picker. */\n label: string;\n /** Optional Phosphor icon name. */\n icon?: string;\n /** Omit from the create picker; reachable only by id, for a template that needs a caller's `subject`. */\n hidden?: boolean;\n /** Values the create panel collects as a form before scaffolding; omit and it scaffolds on selection. */\n inputSchema?: Schema.Codec<any, any>;\n /**\n * Build the routine as a fully-wired in-memory {@link Routine.Routine} graph — the routine plus its owned\n * trigger and instructions, assembled by `makeRoutine`. The create flow persists it with a single\n * `Database.add` (which cascades the owned children); scaffold must NOT call `Database.add` itself.\n * `Database.Service` may still be used for read-only lookups (e.g. loading a feed ref). `input` carries\n * the {@link inputSchema} values; `subject` is set only by a caller that seeds this template by id.\n */\n scaffold: (ctx: {\n name?: string;\n subject?: Obj.Unknown;\n input?: any;\n }) => Effect.Effect<Routine.Routine, Error, Database.Service>;\n};\n\nexport const Template = Capability.make<Template>()('org.dxos.plugin.routine.capability.template');\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,IAAa,0BAA0B,WAAW,KAAyB,CAAC,CAC1E,4DACF;;;;;;AAOA,IAAa,kBAAkB;AA+B/B,IAAa,WAAW,WAAW,KAAe,CAAC,CAAC,6CAA6C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
import * as ActivationEvent from "@dxos/app-framework/ActivationEvent";
|
|
4
|
+
//#region src/types/RoutineEvents.ts
|
|
5
|
+
var RoutineEvents_exports = /* @__PURE__ */ __exportAll({ Start: () => Start });
|
|
6
|
+
/**
|
|
7
|
+
* The feature's start event: cross-plugin contributions consumed by this feature activate here,
|
|
8
|
+
* alongside the plugin's own start-gated modules. Fired on demand and by the host's idle trickle.
|
|
9
|
+
*/
|
|
10
|
+
var Start = ActivationEvent.pluginStart(meta.profile.key);
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Start, RoutineEvents_exports as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=RoutineEvents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoutineEvents.mjs","names":[],"sources":["../../src/types/RoutineEvents.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as ActivationEvent from '@dxos/app-framework/ActivationEvent';\n\nimport { meta } from '#meta';\n\n/**\n * The feature's start event: cross-plugin contributions consumed by this feature activate here,\n * alongside the plugin's own start-gated modules. Fired on demand and by the host's idle trickle.\n */\nexport const Start = ActivationEvent.pluginStart(meta.profile.key);\n"],"mappings":";;;;;;;;;AAcA,IAAa,QAAQ,gBAAgB,YAAY,KAAK,QAAQ,GAAG"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { TriggerTemplate } from "./Routine.mjs";
|
|
3
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
4
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
5
|
+
import * as Routine from "@dxos/compute/Routine";
|
|
6
|
+
import { DXN, Database, Obj, Ref, Type } from "@dxos/echo";
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
|
+
import * as Instructions from "@dxos/compute/Instructions";
|
|
9
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
10
|
+
import * as Trigger from "@dxos/compute/Trigger";
|
|
11
|
+
import * as Chat from "@dxos/assistant-toolkit/Chat";
|
|
12
|
+
import { EID as _EchoURIReference } from "@dxos/keys";
|
|
13
|
+
//#region src/types/RoutineOperation.ts
|
|
14
|
+
var RoutineOperation_exports = /* @__PURE__ */ __exportAll({
|
|
15
|
+
CreateRoutine: () => CreateRoutine,
|
|
16
|
+
CreateTriggerFromTemplate: () => CreateTriggerFromTemplate,
|
|
17
|
+
RunPromptInNewChat: () => RunPromptInNewChat,
|
|
18
|
+
RunRoutine: () => RunRoutine,
|
|
19
|
+
_EchoURIReference: () => _EchoURIReference
|
|
20
|
+
});
|
|
21
|
+
var CreateTriggerFromTemplate = Operation.make({
|
|
22
|
+
meta: {
|
|
23
|
+
key: DXN.make("org.dxos.operation.routine.createTriggerFromTemplate"),
|
|
24
|
+
name: "Create Trigger From Template",
|
|
25
|
+
icon: "ph--lightning--regular"
|
|
26
|
+
},
|
|
27
|
+
services: [Capability.Service],
|
|
28
|
+
input: Schema.Struct({
|
|
29
|
+
db: Database.Database,
|
|
30
|
+
template: TriggerTemplate,
|
|
31
|
+
enabled: Schema.optional(Schema.Boolean),
|
|
32
|
+
scriptName: Schema.optional(Schema.String),
|
|
33
|
+
input: Schema.optional(Schema.Record(Schema.String, Schema.Any))
|
|
34
|
+
}),
|
|
35
|
+
output: Schema.Void
|
|
36
|
+
});
|
|
37
|
+
var CreateRoutine = Operation.make({
|
|
38
|
+
meta: {
|
|
39
|
+
key: DXN.make("org.dxos.operation.routine.createAutomation"),
|
|
40
|
+
name: "Create Routine",
|
|
41
|
+
icon: "ph--lightning--regular"
|
|
42
|
+
},
|
|
43
|
+
services: [Capability.Service, Plugin.Service],
|
|
44
|
+
input: Schema.Struct({
|
|
45
|
+
db: Database.Database,
|
|
46
|
+
templateId: Schema.String,
|
|
47
|
+
name: Schema.optional(Schema.String),
|
|
48
|
+
subject: Schema.optional(Obj.Unknown),
|
|
49
|
+
/** Values for the template's `inputSchema`. */
|
|
50
|
+
input: Schema.optional(Schema.Unknown)
|
|
51
|
+
}),
|
|
52
|
+
output: Schema.Struct({
|
|
53
|
+
id: Schema.String,
|
|
54
|
+
object: Obj.Unknown
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
var RunPromptInNewChat = Operation.make({
|
|
58
|
+
meta: {
|
|
59
|
+
key: DXN.make("org.dxos.operation.routine.runPromptInNewChat"),
|
|
60
|
+
name: "Run Prompt In New Chat",
|
|
61
|
+
icon: "ph--chat-text--regular"
|
|
62
|
+
},
|
|
63
|
+
services: [Capability.Service],
|
|
64
|
+
input: Schema.Struct({
|
|
65
|
+
db: Database.Database,
|
|
66
|
+
/** Context objects to bind to the new chat. */
|
|
67
|
+
objects: Schema.optional(Schema.Array(Obj.Unknown)),
|
|
68
|
+
/** Skill keys to look up and bind to the new chat. */
|
|
69
|
+
skills: Schema.optional(Schema.Array(Schema.String)),
|
|
70
|
+
/** Raw instructions or an existing Routine object reference. */
|
|
71
|
+
instructions: Schema.Union([Schema.String, Ref.Ref(Instructions.Instructions)]),
|
|
72
|
+
/**
|
|
73
|
+
* When true, skips opening the chat: runs the Agent prompt operation against the new chat via the compute runtime (traced).
|
|
74
|
+
*/
|
|
75
|
+
background: Schema.optional(Schema.Boolean)
|
|
76
|
+
}),
|
|
77
|
+
output: Schema.Struct({ object: Type.getSchema(Chat.Chat) })
|
|
78
|
+
});
|
|
79
|
+
var RunRoutine = Operation.make({
|
|
80
|
+
meta: {
|
|
81
|
+
key: DXN.make("org.dxos.operation.routine.runAutomation"),
|
|
82
|
+
name: "Run Routine",
|
|
83
|
+
icon: "ph--play--regular"
|
|
84
|
+
},
|
|
85
|
+
services: [Capability.Service, Trigger.TriggerMonitorService],
|
|
86
|
+
input: Schema.Struct({ routine: Ref.Ref(Routine.Routine) }),
|
|
87
|
+
output: Schema.Void
|
|
88
|
+
});
|
|
89
|
+
//#endregion
|
|
90
|
+
export { CreateRoutine, CreateTriggerFromTemplate, RunPromptInNewChat, RunRoutine, _EchoURIReference, RoutineOperation_exports as t };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=RoutineOperation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoutineOperation.mjs","names":[],"sources":["../../src/types/RoutineOperation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as Chat from '@dxos/assistant-toolkit/Chat';\nimport * as Instructions from '@dxos/compute/Instructions';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Routine from '@dxos/compute/Routine';\nimport * as Trigger from '@dxos/compute/Trigger';\nimport { Database, DXN, Obj, Ref, Type } from '@dxos/echo';\n// Value-side `EID` import keeps TS declaration emit portable — `TriggerTemplate`\n// references `EID.Schema` and the inferred `CreateTriggerFromTemplate` type\n// otherwise needs a transitive `@dxos/keys` import that's hard for d.ts emit to surface.\nimport { EID as _EchoURIReference } from '@dxos/keys';\n\nimport { TriggerTemplate } from './Routine';\nexport { _EchoURIReference };\n\nexport const CreateTriggerFromTemplate = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.createTriggerFromTemplate'),\n name: 'Create Trigger From Template',\n icon: 'ph--lightning--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n db: Database.Database,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record(Schema.String, Schema.Any)),\n }),\n output: Schema.Void,\n});\n\n// The single creation entrypoint for every path (create dialog, companion, sidebar) so placement and\n// ownership are established in one place. Output mirrors `SpaceCapabilities.CreateObjectResult`.\nexport const CreateRoutine = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.createAutomation'),\n name: 'Create Routine',\n icon: 'ph--lightning--regular',\n },\n services: [Capability.Service, Plugin.Service],\n input: Schema.Struct({\n db: Database.Database,\n templateId: Schema.String,\n name: Schema.optional(Schema.String),\n subject: Schema.optional(Obj.Unknown),\n /** Values for the template's `inputSchema`. */\n input: Schema.optional(Schema.Unknown),\n }),\n output: Schema.Struct({\n id: Schema.String,\n object: Obj.Unknown,\n }),\n});\n\nexport const RunPromptInNewChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.runPromptInNewChat'),\n name: 'Run Prompt In New Chat',\n icon: 'ph--chat-text--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n db: Database.Database,\n /** Context objects to bind to the new chat. */\n objects: Schema.optional(Schema.Array(Obj.Unknown)),\n /** Skill keys to look up and bind to the new chat. */\n skills: Schema.optional(Schema.Array(Schema.String)),\n /** Raw instructions or an existing Routine object reference. */\n instructions: Schema.Union([Schema.String, Ref.Ref(Instructions.Instructions)]),\n /**\n * When true, skips opening the chat: runs the Agent prompt operation against the new chat via the compute runtime (traced).\n */\n background: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Struct({\n object: Type.getSchema(Chat.Chat),\n }),\n});\n\n// Runs a routine's action now, routed by its first trigger — that is where both the runnable's input\n// (e.g. a sync routine's binding cursor) and the `remote` flag live. A `remote` trigger force-runs on the\n// EDGE dispatcher over HTTP, since that is the only runtime it is registered on; a local one runs\n// in-process. Without the trigger a manual run would invoke an input-taking runnable with nothing, and\n// would silently run an edge routine on the client.\nexport const RunRoutine = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.runAutomation'),\n name: 'Run Routine',\n icon: 'ph--play--regular',\n },\n services: [Capability.Service, Trigger.TriggerMonitorService],\n input: Schema.Struct({\n routine: Ref.Ref(Routine.Routine),\n }),\n output: Schema.Void,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,4BAA4B,UAAU,KAAK;CACtD,MAAM;EACJ,KAAK,IAAI,KAAK,sDAAsD;EACpE,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,OAAO;CAC7B,OAAO,OAAO,OAAO;EACnB,IAAI,SAAS;EACb,UAAU;EACV,SAAS,OAAO,SAAS,OAAO,OAAO;EACvC,YAAY,OAAO,SAAS,OAAO,MAAM;EACzC,OAAO,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,GAAG,CAAC;CACjE,CAAC;CACD,QAAQ,OAAO;AACjB,CAAC;AAID,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAK,IAAI,KAAK,6CAA6C;EAC3D,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,SAAS,OAAO,OAAO;CAC7C,OAAO,OAAO,OAAO;EACnB,IAAI,SAAS;EACb,YAAY,OAAO;EACnB,MAAM,OAAO,SAAS,OAAO,MAAM;EACnC,SAAS,OAAO,SAAS,IAAI,OAAO;;EAEpC,OAAO,OAAO,SAAS,OAAO,OAAO;CACvC,CAAC;CACD,QAAQ,OAAO,OAAO;EACpB,IAAI,OAAO;EACX,QAAQ,IAAI;CACd,CAAC;AACH,CAAC;AAED,IAAa,qBAAqB,UAAU,KAAK;CAC/C,MAAM;EACJ,KAAK,IAAI,KAAK,+CAA+C;EAC7D,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,OAAO;CAC7B,OAAO,OAAO,OAAO;EACnB,IAAI,SAAS;;EAEb,SAAS,OAAO,SAAS,OAAO,MAAM,IAAI,OAAO,CAAC;;EAElD,QAAQ,OAAO,SAAS,OAAO,MAAM,OAAO,MAAM,CAAC;;EAEnD,cAAc,OAAO,MAAM,CAAC,OAAO,QAAQ,IAAI,IAAI,aAAa,YAAY,CAAC,CAAC;;;;EAI9E,YAAY,OAAO,SAAS,OAAO,OAAO;CAC5C,CAAC;CACD,QAAQ,OAAO,OAAO,EACpB,QAAQ,KAAK,UAAU,KAAK,IAAI,EAClC,CAAC;AACH,CAAC;AAOD,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAK,IAAI,KAAK,0CAA0C;EACxD,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,SAAS,QAAQ,qBAAqB;CAC5D,OAAO,OAAO,OAAO,EACnB,SAAS,IAAI,IAAI,QAAQ,OAAO,EAClC,CAAC;CACD,QAAQ,OAAO;AACjB,CAAC"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { meta as meta$1 } from "#meta";
|
|
3
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
4
|
+
//#region src/RoutinePlugin.ts
|
|
5
|
+
var RoutinePlugin_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
make: () => make,
|
|
7
|
+
meta: () => meta
|
|
8
|
+
});
|
|
9
|
+
/** Plugin metadata, available without loading the plugin body. */
|
|
10
|
+
var meta = meta$1;
|
|
11
|
+
/** Constructs the plugin; the body loads on first enable. */
|
|
12
|
+
var make = Plugin.lazy(meta, () => import("#plugin"));
|
|
13
|
+
//#endregion
|
|
14
|
+
export { make, meta, RoutinePlugin_exports as t };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=RoutinePlugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoutinePlugin.mjs","names":[],"sources":["../../src/RoutinePlugin.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport { meta as pluginMeta } from '#meta';\n\n/** Plugin metadata, available without loading the plugin body. */\nexport const meta = pluginMeta;\n\n/** Constructs the plugin; the body loads on first enable. */\nexport const make = Plugin.lazy(meta, () => import('#plugin'));\n"],"mappings":";;;;;;;;;AAWA,IAAa,OAAO;;AAGpB,IAAa,OAAO,OAAO,KAAK,YAAY,OAAO,UAAU"}
|
|
@@ -1,14 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
4
|
+
import { translations } from "#translations";
|
|
5
|
+
import { RoutineCapabilities } from "#types";
|
|
6
|
+
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
7
|
+
import * as ClientCapabilities from "@dxos/plugin-client/ClientCapabilities";
|
|
8
|
+
import * as ClientEvents from "@dxos/plugin-client/ClientEvents";
|
|
9
|
+
import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
|
|
10
|
+
import { meta } from "#meta";
|
|
11
|
+
//#region PLUGIN.mdl?raw
|
|
12
|
+
var PLUGIN_default = "---\nid: org.dxos.plugin.automation\nname: AutomationPlugin\nversion: 0.1.0\n---\n\nA workflow automation engine plugin for DXOS Composer that enables event-driven\npipelines connecting ECHO objects to persistent compute functions.\n\nTriggers listen for ECHO mutations, timer schedules, incoming feeds (email, webhook),\nor data subscriptions and invoke `PersistentOperation` handlers when their conditions\nfire. Each trigger carries optional structured input and is dispatched by a\nper-space `TriggerDispatcher` that runs locally in the browser, or is delegated to\nthe DXOS edge when the trigger's `remote` flag is set. A space-wide\n`triggersDisabled` flag acts as a kill-switch that stops local dispatch entirely.\n\nThe plugin integrates with the `@dxos/compute` operation registry and the\n`@dxos/functions-runtime` execution layer. Skill, operation-handler, and\ntoolkit contributions from other plugins are gathered at application scope and\nmerged before being offered to space-level operation registries, so any plugin\nthat contributes a `Capabilities.OperationHandler` automatically becomes\ninvocable from an automation trigger.\n\nUsers interact with automations through the `AutomationPanel` settings surface,\nwhich lists active triggers for a space (or for a specific ECHO object) and\nopens the `TriggerEditor` form to create, configure, and enable/disable\nindividual triggers.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|-------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\nExisting types used by this plugin (defined in `@dxos/compute` and `@dxos/functions-runtime`):\n\n| Type | Source | Role in AutomationPlugin |\n|----------------------|---------------------------|--------------------------------------------------------------------|\n| `Trigger` | `@dxos/compute` | Persistent trigger configuration (spec, function ref, input, enabled) |\n| `PersistentOperation`| `@dxos/compute` | Registered compute function callable from a trigger |\n| `Trace.Message` | `@dxos/compute` | Execution trace record appended after each trigger run |\n| `Script` | `@dxos/compute` | Source script that produces one or more `PersistentOperation`s |\n| `Feed` | `@dxos/echo` | Feed object that a `feed`-spec trigger listens to |\n| `ComputeGraph` | `@dxos/conductor` | Visual workflow graph selectable as a trigger function |\n\nNew types defined by this plugin:\n\n```mdl\ntype TriggerTemplate\n desc: |\n Lightweight description of a trigger's spec used when creating a trigger\n from a pre-defined template (e.g. from a Skill action).\n literals: timer | feed\n fields:\n type: timer | feed\n cron?: string # required when type === timer; cron expression\n feed?: Feed # required when type === feed; the feed to subscribe to\n```\n\n## Components\n\n```mdl\ncomponent AutomationPanel\n desc: |\n Settings surface that lists all triggers for a space (or filtered to a\n specific ECHO object) and provides inline create / edit / delete via the\n TriggerEditor form. Displayed inside Settings.Panel at the path\n `<spacePath>/settings/org.dxos.plugin.automation.automations`.\n props:\n space: Space\n object?: Obj.Unknown # when set, only triggers matching this object are shown\n initialTrigger?: Trigger # pre-populate TriggerEditor for a new trigger\n onDone?: () => void\n state:\n trigger?: Trigger # trigger currently open in TriggerEditor (undefined = list view)\n selected?: Trigger # the existing trigger being edited (undefined = new)\n slots:\n (none)\n actions:\n handleAdd() # open TriggerEditor with a blank Trigger\n handleSelect(t: Trigger) # open TriggerEditor for an existing trigger\n handleDelete(t: Trigger) # remove trigger from space.db\n handleSave(t: Trigger) # persist new or update selected trigger\n handleCancel()\n handleForceRunTrigger(t: Trigger) # invoke timer trigger immediately\n handleResetCursor(t: Trigger) # clear feed cursor on a feed trigger\n layout: |\n ┌──────────────────────────────────┐\n │ [list view — triggers exist] │\n │ ┌────────────────────────────┐ │\n │ │ ○ fn-name [▶] [✕] │ │\n │ │ ● fn-name [↺] [✕] │ │\n │ └────────────────────────────┘ │\n │ ───────────────────────────── │\n │ [+ New Trigger] │\n ├──────────────────────────────────┤\n │ [editor view — trigger selected] │\n │ Settings.Item │\n │ └── TriggerEditor │\n └──────────────────────────────────┘\n```\n\n```mdl\ncomponent TriggerEditor\n desc: |\n Form-driven editor for a single Trigger. Renders a Form.Root backed by the\n Trigger schema with custom field overrides for function/workflow selection,\n spec kind selector, feed selector, subscription query builder, and\n structured input editor.\n props:\n db: Database\n trigger: Trigger\n types: TypeOption[] # available ECHO types for query builder\n tags: Tag[] # available tags for query builder\n readonlySpec?: boolean # lock spec.kind and spec.query (e.g. editing from an object context)\n onSave: (t: Partial<Trigger>) => void\n onCancel: () => void\n state:\n (managed by Form.Root)\n slots:\n (none)\n```\n\n```mdl\ncomponent FunctionsPanel\n desc: |\n Settings surface listing all PersistentOperation objects in a space.\n Each row shows the function name, optional source script name, a\n \"go to script\" icon button, and a delete button.\n props:\n space: Space\n state:\n functions: PersistentOperation[]\n scripts: Script[]\n slots:\n (none)\n actions:\n handleGoToScript(fn: PersistentOperation) # navigate to source Script\n handleDelete(fn: PersistentOperation) # remove function via SpaceOperation\n```\n\n```mdl\ncomponent TemplateEditor\n desc: |\n Markdown + Handlebars source editor backed by a Ref<Text>. Decorates\n Handlebars tags, DXN/URL tokens, and XML nodes. Reused by Routine and\n Skill article surfaces and by downstream plugins (plugin-script,\n plugin-magazine) via the `@dxos/plugin-routine/components` export.\n props:\n id: string\n source?: Ref<Text>\n lineNumbers?: boolean\n```\n\n```mdl\ncomponent RoutineProperties\n desc: Object-properties form for a Routine, rendered via ObjectProperties.\n props:\n routine: Routine\n```\n\n## Surfaces\n\n```mdl\nsurface skill -> SkillArticle # article for Skill objects\nsurface prompt -> RoutineArticle # article for Routine objects (template editor + run)\nsurface prompts -> RoutineList # space-home prompt list; dispatches RunPromptInNewChat\n```\n\n## Operations\n\n```mdl\nop CreateTriggerFromTemplate\n desc: |\n Creates a new Trigger from a lightweight template, optionally wiring it to\n a named Script's PersistentOperation, and navigates to the automations\n settings panel for the target space.\n input:\n db: Database\n template: TriggerTemplate\n enabled?: boolean # default false\n scriptName?: string # if provided, looks up Script by name and wires function ref\n input?: Record<string, any> # optional structured input forwarded to the trigger\n output: void\n effects: [echo:write, layout:navigate]\n requires: [SpaceOperation.AddObject, LayoutOperation.Open]\n note: |\n Resolves the named Script, finds its linked PersistentOperation, and sets\n trigger.function = Ref.make(fn). Template type determines spec:\n timer → Trigger.specTimer(cron)\n feed → Trigger.specFeed(feed)\n Trigger is added as a hidden object so it does not appear in the main graph.\n```\n\n```mdl\nop RunPromptInNewChat\n desc: Creates a new chat, binds context objects and skills, then runs a prompt.\n input:\n db: Database\n objects?: Obj[]\n skills?: string[]\n prompt: string | RoutineRef\n background?: boolean\n output: Chat\n effects: [echo:write, ai:infer]\n note: |\n Defined here so Routine UI (RoutineList, RoutineArticle) and downstream\n plugins can dispatch it without depending on plugin-assistant. The handler\n is contributed by plugin-assistant (chat creation + AiContext binding).\n When background is true, the prompt runs via the compute runtime without\n opening the chat UI. The returned Chat can be used to track progress.\n```\n\n## Features\n\n```mdl\nfeat F-1: Trigger Management\n\n req F-1.1: User can create a Trigger in any space via AutomationPanel.\n req F-1.2: User can edit an existing Trigger's function, spec, and input.\n req F-1.3: User can delete a Trigger; it is removed from space.db.\n req F-1.4: User can enable or disable a Trigger via an inline toggle.\n req F-1.5:\n when: object context provided to AutomationPanel\n then: only triggers matching that object's type or query are shown\n```\n\n```mdl\nfeat F-2: Trigger Dispatch\n\n req F-2.1:\n when: space.properties.triggersDisabled is unset or false\n then: TriggerDispatcher starts for that space\n\n req F-2.2:\n when: space.properties.triggersDisabled === true\n then: TriggerDispatcher stops for that space\n\n req F-2.3:\n when: triggersDisabled changes\n then: any in-flight dispatcher transition is cancelled before the new one starts\n\n req F-2.3a:\n when: trigger.remote === true\n then: the local TriggerDispatcher skips the trigger (it runs on the edge instead)\n\n req F-2.4:\n when: trigger spec.kind === \"timer\" and enabled === true\n then: TriggerDispatcher fires trigger according to cron expression\n\n req F-2.5:\n when: trigger spec.kind === \"feed\"\n then: TriggerDispatcher processes new messages from the linked Feed\n\n req F-2.6:\n when: trigger spec.kind === \"subscription\"\n then: TriggerDispatcher invokes trigger on matching ECHO object mutations\n```\n\n```mdl\nfeat F-3: Force Run and Cursor Reset\n\n req F-3.1:\n when: timer trigger is enabled and space.properties.triggersDisabled !== true\n then: user can force-run the trigger immediately from AutomationPanel\n\n req F-3.2:\n when: trigger.remote !== true\n then: force-run invokes TriggerDispatcher.invokeTrigger directly in-process\n\n req F-3.3:\n when: trigger.remote === true\n then: force-run calls FunctionsServiceClient.forceRunCronTrigger via HTTP\n\n req F-3.4:\n when: trigger spec.kind === \"feed\" and a cursor is stored\n then: user can reset the cursor to reprocess the feed from the beginning\n```\n\n```mdl\nfeat F-4: Operation Registry\n\n req F-4.1:\n when: plugin activates\n then: all Capabilities.OperationHandler contributions are merged into a single OperationHandlerProvider\n\n req F-4.2: OperationRegistry per space resolves operations from the merged OperationHandlerProvider.\n req F-4.3: Skill registry is populated from AppCapabilities.SkillDefinition contributions.\n req F-4.4: OpaqueToolkit aggregates AppCapabilities.Toolkit contributions for agent invocation.\n```\n\n```mdl\nfeat F-5: Trace Sink\n\n req F-5.1:\n when: a trigger executes\n then: execution trace messages are written to the space Feed via FeedTraceSink\n\n req F-5.2: FeedTraceSink is contributed to Capabilities.TraceSink and routed via makeRoutingSink.\n```\n\n```mdl\nfeat F-6: Create Trigger From Template\n\n req F-6.1:\n when: op:CreateTriggerFromTemplate is invoked\n then: a Trigger is created and added as a hidden ECHO object in the target space\n\n req F-6.2:\n when: scriptName is provided\n then: the Trigger.function is wired to the PersistentOperation linked to that Script\n\n req F-6.3:\n when: template.type === \"timer\"\n then: Trigger.spec is set via Trigger.specTimer(template.cron)\n\n req F-6.4:\n when: template.type === \"feed\"\n then: Trigger.spec is set via Trigger.specFeed(template.feed)\n\n req F-6.5:\n when: trigger is created\n then: layout navigates to the automations settings panel for the space\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create trigger via AutomationPanel\n given: AutomationPanel rendered for a space with no triggers\n when: user clicks \"New Trigger\"\n then:\n - TriggerEditor shown with a blank Trigger\n - selected state is undefined (new trigger mode)\n```\n\n```mdl\ntest T-2: Save new trigger\n given: TriggerEditor open with blank Trigger\n when: user fills in a function and spec, then saves\n then:\n - space.db.add called with a new Trigger\n - list view restored\n - onDone called\n```\n\n```mdl\ntest T-3: Edit existing trigger\n given: AutomationPanel listing one trigger\n when: user clicks the trigger row\n then:\n - TriggerEditor opens pre-populated with that trigger's values\n - selected state holds the original trigger\n - saving calls Obj.update on the original trigger\n```\n\n```mdl\ntest T-4: Enable/disable toggle\n given: AutomationPanel showing trigger with enabled = false\n when: user flips the toggle\n then:\n - Obj.update sets trigger.enabled = true\n - toggle reflects new state immediately\n```\n\n```mdl\ntest T-5: Force run timer trigger (local)\n given: timer trigger enabled, trigger.remote unset\n when: user clicks the force-run button\n then:\n - TriggerDispatcher.invokeTrigger called with a TimerEvent\n - no error surfaced to user\n```\n\n```mdl\ntest T-6: Dispatcher lifecycle on kill-switch change\n given: space triggersDisabled unset, dispatcher running\n when: space.properties.triggersDisabled changes to true\n then:\n - in-flight transition fiber interrupted\n - TriggerDispatcher.stop() called for that space\n```\n\n```mdl\ntest T-7: CreateTriggerFromTemplate with timer\n given: db contains Script \"daily-summary\", space triggersDisabled unset\n when: op:CreateTriggerFromTemplate invoked with template={type:\"timer\",cron:\"0 8 * * *\"}, scriptName=\"daily-summary\"\n then:\n - Trigger created with spec.kind === \"timer\", spec.cron === \"0 8 * * *\"\n - Trigger.function wired to PersistentOperation linked to \"daily-summary\" script\n - Trigger added as hidden ECHO object\n - layout navigates to automations settings panel\n```\n\n```mdl\ntest T-8: CreateTriggerFromTemplate with feed\n given: db contains a Feed object \"email-feed\"\n when: op:CreateTriggerFromTemplate invoked with template={type:\"feed\",feed:<email-feed>}\n then:\n - Trigger created with spec.kind === \"feed\", spec.feed === Ref to email-feed\n - Trigger added as hidden ECHO object\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive — the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n";
|
|
13
|
+
//#endregion
|
|
2
14
|
//#region src/capabilities/index.ts
|
|
3
|
-
var AppGraphBuilder =
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
15
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"), { environments: ["node"] });
|
|
16
|
+
var Commands = AppCapability.commands(() => import("./chunk-commands.mjs"));
|
|
17
|
+
var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"), { environments: [] });
|
|
18
|
+
var LayerSpecs = AppCapability.layerSpec(() => import("./chunk-layer-specs.mjs"), {
|
|
19
|
+
name: "LayerSpecs",
|
|
20
|
+
provides: [Capabilities.TraceSink]
|
|
21
|
+
});
|
|
22
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"));
|
|
23
|
+
var PluginAsset = AppCapability.pluginAsset({
|
|
24
|
+
pluginId: meta.profile.key,
|
|
25
|
+
path: "PLUGIN.mdl",
|
|
26
|
+
content: PLUGIN_default,
|
|
27
|
+
mimeType: "application/x-mdl"
|
|
28
|
+
});
|
|
29
|
+
var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: ["org.dxos.role.article", "org.dxos.role.cardContent"] });
|
|
30
|
+
var RegistrySync = Capability.lazyModule("RegistrySync", {
|
|
31
|
+
requires: [
|
|
32
|
+
ClientCapabilities.Client,
|
|
33
|
+
Capabilities.AtomRegistry,
|
|
34
|
+
AppCapabilities.SkillDefinition,
|
|
35
|
+
Capabilities.OperationHandler
|
|
36
|
+
],
|
|
37
|
+
provides: [],
|
|
38
|
+
environments: ["node"]
|
|
39
|
+
}, () => import("./chunk-registry-sync.mjs"));
|
|
40
|
+
var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
|
|
41
|
+
var Templates = Capability.lazyModule("Templates", {
|
|
42
|
+
provides: [RoutineCapabilities.Template],
|
|
43
|
+
environments: ["node", "workerd"]
|
|
44
|
+
}, () => import("./chunk-templates.mjs"));
|
|
45
|
+
var Translations = AppCapability.translations(translations);
|
|
46
|
+
var TriggerRuntimeController = Capability.lazyModule("TriggerRuntimeController", {
|
|
47
|
+
requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],
|
|
48
|
+
provides: [],
|
|
49
|
+
activatesOn: ClientEvents.SpacesReady,
|
|
50
|
+
environments: ["node"]
|
|
51
|
+
}, () => import("./chunk-trigger-runtime-controller.mjs"));
|
|
11
52
|
//#endregion
|
|
12
|
-
export { AppGraphBuilder, CreateObject, LayerSpecs, OperationHandler, ReactSurface, RegistrySync, Templates, TriggerRuntimeController };
|
|
53
|
+
export { AppGraphBuilder, Commands, CreateObject, LayerSpecs, OperationHandler, PluginAsset, ReactSurface, RegistrySync, Schema, Templates, Translations, TriggerRuntimeController };
|
|
13
54
|
|
|
14
55
|
//# sourceMappingURL=capabilities.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as ClientEvents from '@dxos/plugin-client/ClientEvents';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'), {\n environments: ['node'],\n});\nexport const Commands = AppCapability.commands(() => import('./commands'));\n// The entry carries a live `customPanel` (`CreateRoutinePanel`) alongside the object factory, so the\n// module cannot be evaluated without React.\nexport const CreateObject = SpaceCapability.createObject(() => import('./create-object'), {\n environments: [],\n});\nexport const LayerSpecs = AppCapability.layerSpec(() => import('./layer-specs'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'));\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: ['org.dxos.role.article', 'org.dxos.role.cardContent'],\n});\nexport const RegistrySync = Capability.lazyModule(\n 'RegistrySync',\n {\n requires: [\n ClientCapabilities.Client,\n Capabilities.AtomRegistry,\n AppCapabilities.SkillDefinition,\n Capabilities.OperationHandler,\n ],\n provides: [],\n environments: ['node'],\n },\n () => import('./registry-sync'),\n);\nexport const Schema = AppCapability.schema(() => import('./schema'));\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['node', 'workerd'] },\n () => import('./templates'),\n);\nexport const Translations = AppCapability.translations(translations);\nexport const TriggerRuntimeController = Capability.lazyModule(\n 'TriggerRuntimeController',\n {\n requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],\n provides: [],\n // Runtime event: triggers only need to react to spaces once the client observes them.\n activatesOn: ClientEvents.SpacesReady,\n environments: ['node'],\n },\n () => import('./trigger-runtime-controller'),\n);\n"],"mappings":";;;;;;;;;;;;;;AAmBA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,kCAAwB,EAChG,cAAc,CAAC,MAAM,EACvB,CAAC;AACD,IAAa,WAAW,cAAc,eAAe,OAAO,uBAAa;AAGzE,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,8BAAoB,EACxF,cAAc,CAAC,EACjB,CAAC;AACD,IAAa,aAAa,cAAc,gBAAgB,OAAO,4BAAkB;CAC/E,MAAM;CACN,UAAU,CAAC,aAAa,SAAS;AACnC,CAAC;AACD,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,gCAAsB;AAClG,IAAa,cAAc,cAAc,YAAY;CACnD,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC;AACD,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAoB,EACjF,OAAO,CAAC,yBAAyB,2BAA2B,EAC9D,CAAC;AACD,IAAa,eAAe,WAAW,WACrC,gBACA;CACE,UAAU;EACR,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,aAAa;CACf;CACA,UAAU,CAAC;CACX,cAAc,CAAC,MAAM;AACvB,SACM,OAAO,4BACf;AACA,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAW;AACnE,IAAa,YAAY,WAAW,WAClC,aACA;CAAE,UAAU,CAAC,oBAAoB,QAAQ;CAAG,cAAc,CAAC,QAAQ,SAAS;AAAE,SACxE,OAAO,wBACf;AACA,IAAa,eAAe,cAAc,aAAa,YAAY;AACnE,IAAa,2BAA2B,WAAW,WACjD,4BACA;CACE,UAAU,CAAC,mBAAmB,QAAQ,aAAa,qBAAqB;CACxE,UAAU,CAAC;CAEX,aAAa,aAAa;CAC1B,cAAc,CAAC,MAAM;AACvB,SACM,OAAO,yCACf"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
4
|
+
import { translations } from "#translations";
|
|
5
|
+
import { RoutineCapabilities } from "#types";
|
|
6
|
+
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
7
|
+
import * as ClientCapabilities from "@dxos/plugin-client/ClientCapabilities";
|
|
8
|
+
import * as ClientEvents from "@dxos/plugin-client/ClientEvents";
|
|
9
|
+
//#region src/capabilities/gen/node.ts
|
|
10
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"), { environments: ["node"] });
|
|
11
|
+
var Commands = AppCapability.commands(() => import("./chunk-commands.mjs"));
|
|
12
|
+
var LayerSpecs = AppCapability.layerSpec(() => import("./chunk-layer-specs.mjs"), {
|
|
13
|
+
name: "LayerSpecs",
|
|
14
|
+
provides: [Capabilities.TraceSink]
|
|
15
|
+
});
|
|
16
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"));
|
|
17
|
+
var RegistrySync = Capability.lazyModule("RegistrySync", {
|
|
18
|
+
requires: [
|
|
19
|
+
ClientCapabilities.Client,
|
|
20
|
+
Capabilities.AtomRegistry,
|
|
21
|
+
AppCapabilities.SkillDefinition,
|
|
22
|
+
Capabilities.OperationHandler
|
|
23
|
+
],
|
|
24
|
+
provides: [],
|
|
25
|
+
environments: ["node"]
|
|
26
|
+
}, () => import("./chunk-registry-sync.mjs"));
|
|
27
|
+
var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
|
|
28
|
+
var Templates = Capability.lazyModule("Templates", {
|
|
29
|
+
provides: [RoutineCapabilities.Template],
|
|
30
|
+
environments: ["node", "workerd"]
|
|
31
|
+
}, () => import("./chunk-templates.mjs"));
|
|
32
|
+
var Translations = AppCapability.translations(translations);
|
|
33
|
+
var TriggerRuntimeController = Capability.lazyModule("TriggerRuntimeController", {
|
|
34
|
+
requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],
|
|
35
|
+
provides: [],
|
|
36
|
+
activatesOn: ClientEvents.SpacesReady,
|
|
37
|
+
environments: ["node"]
|
|
38
|
+
}, () => import("./chunk-trigger-runtime-controller.mjs"));
|
|
39
|
+
var CreateObject = void 0;
|
|
40
|
+
var PluginAsset = void 0;
|
|
41
|
+
var ReactSurface = void 0;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { AppGraphBuilder, Commands, CreateObject, LayerSpecs, OperationHandler, PluginAsset, ReactSurface, RegistrySync, Schema, Templates, Translations, TriggerRuntimeController };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=capabilities.node.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.node.mjs","names":[],"sources":["../../src/capabilities/gen/node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' condition.\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as ClientEvents from '@dxos/plugin-client/ClientEvents';\n\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder'), {\n environments: ['node'],\n});\n\nexport const Commands = AppCapability.commands(() => import('../commands'));\n\nexport const LayerSpecs = AppCapability.layerSpec(() => import('../layer-specs'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler'));\n\nexport const RegistrySync = Capability.lazyModule(\n 'RegistrySync',\n {\n requires: [\n ClientCapabilities.Client,\n Capabilities.AtomRegistry,\n AppCapabilities.SkillDefinition,\n Capabilities.OperationHandler,\n ],\n provides: [],\n environments: ['node'],\n },\n () => import('../registry-sync'),\n);\n\nexport const Schema = AppCapability.schema(() => import('../schema'));\n\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['node', 'workerd'] },\n () => import('../templates'),\n);\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const TriggerRuntimeController = Capability.lazyModule(\n 'TriggerRuntimeController',\n {\n requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],\n provides: [],\n // Runtime event: triggers only need to react to spaces once the client observes them.\n activatesOn: ClientEvents.SpacesReady,\n environments: ['node'],\n },\n () => import('../trigger-runtime-controller'),\n);\n\nexport const CreateObject = undefined;\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;;;;;;AAgBA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,kCAAyB,EACjG,cAAc,CAAC,MAAM,EACvB,CAAC;AAED,IAAa,WAAW,cAAc,eAAe,OAAO,uBAAc;AAE1E,IAAa,aAAa,cAAc,gBAAgB,OAAO,4BAAmB;CAChF,MAAM;CACN,UAAU,CAAC,aAAa,SAAS;AACnC,CAAC;AAED,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,gCAAuB;AAEnG,IAAa,eAAe,WAAW,WACrC,gBACA;CACE,UAAU;EACR,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,aAAa;CACf;CACA,UAAU,CAAC;CACX,cAAc,CAAC,MAAM;AACvB,SACM,OAAO,4BACf;AAEA,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAY;AAEpE,IAAa,YAAY,WAAW,WAClC,aACA;CAAE,UAAU,CAAC,oBAAoB,QAAQ;CAAG,cAAc,CAAC,QAAQ,SAAS;AAAE,SACxE,OAAO,wBACf;AAEA,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,2BAA2B,WAAW,WACjD,4BACA;CACE,UAAU,CAAC,mBAAmB,QAAQ,aAAa,qBAAqB;CACxE,UAAU,CAAC;CAEX,aAAa,aAAa;CAC1B,cAAc,CAAC,MAAM;AACvB,SACM,OAAO,yCACf;AAEA,IAAa,eAAe,KAAA;AAC5B,IAAa,cAAc,KAAA;AAC3B,IAAa,eAAe,KAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
4
|
+
import { translations } from "#translations";
|
|
5
|
+
import { RoutineCapabilities } from "#types";
|
|
6
|
+
//#region src/capabilities/gen/workerd.ts
|
|
7
|
+
var Commands = AppCapability.commands(() => import("./chunk-commands.mjs"));
|
|
8
|
+
var LayerSpecs = AppCapability.layerSpec(() => import("./chunk-layer-specs.mjs"), {
|
|
9
|
+
name: "LayerSpecs",
|
|
10
|
+
provides: [Capabilities.TraceSink]
|
|
11
|
+
});
|
|
12
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"));
|
|
13
|
+
var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
|
|
14
|
+
var Templates = Capability.lazyModule("Templates", {
|
|
15
|
+
provides: [RoutineCapabilities.Template],
|
|
16
|
+
environments: ["node", "workerd"]
|
|
17
|
+
}, () => import("./chunk-templates.mjs"));
|
|
18
|
+
var Translations = AppCapability.translations(translations);
|
|
19
|
+
var AppGraphBuilder = void 0;
|
|
20
|
+
var CreateObject = void 0;
|
|
21
|
+
var PluginAsset = void 0;
|
|
22
|
+
var ReactSurface = void 0;
|
|
23
|
+
var RegistrySync = void 0;
|
|
24
|
+
var TriggerRuntimeController = void 0;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { AppGraphBuilder, Commands, CreateObject, LayerSpecs, OperationHandler, PluginAsset, ReactSurface, RegistrySync, Schema, Templates, Translations, TriggerRuntimeController };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=capabilities.workerd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.workerd.mjs","names":[],"sources":["../../src/capabilities/gen/workerd.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'workerd' condition.\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\nexport const Commands = AppCapability.commands(() => import('../commands'));\n\nexport const LayerSpecs = AppCapability.layerSpec(() => import('../layer-specs'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler'));\n\nexport const Schema = AppCapability.schema(() => import('../schema'));\n\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['node', 'workerd'] },\n () => import('../templates'),\n);\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const AppGraphBuilder = undefined;\nexport const CreateObject = undefined;\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\nexport const RegistrySync = undefined;\nexport const TriggerRuntimeController = undefined;\n"],"mappings":";;;;;;AAaA,IAAa,WAAW,cAAc,eAAe,OAAO,uBAAc;AAE1E,IAAa,aAAa,cAAc,gBAAgB,OAAO,4BAAmB;CAChF,MAAM;CACN,UAAU,CAAC,aAAa,SAAS;AACnC,CAAC;AAED,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,gCAAuB;AAEnG,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAY;AAEpE,IAAa,YAAY,WAAW,WAClC,aACA;CAAE,UAAU,CAAC,oBAAoB,QAAQ;CAAG,cAAc,CAAC,QAAQ,SAAS;AAAE,SACxE,OAAO,wBACf;AAEA,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,kBAAkB,KAAA;AAC/B,IAAa,eAAe,KAAA;AAC5B,IAAa,cAAc,KAAA;AAC3B,IAAa,eAAe,KAAA;AAC5B,IAAa,eAAe,KAAA;AAC5B,IAAa,2BAA2B,KAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { RoutineOperation } from "#types";
|
|
1
2
|
import { meta } from "#meta";
|
|
2
3
|
import { Obj, Ref } from "@dxos/echo";
|
|
3
4
|
import { useCallback, useContext, useMemo } from "react";
|
|
4
5
|
import { useObject } from "@dxos/echo-react";
|
|
5
6
|
import { Panel } from "@dxos/react-ui";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import * as Atom from "effect/unstable/reactivity/Atom";
|
|
10
10
|
import { RoutineForm } from "#components";
|
|
11
|
+
import { RegistryContext } from "@effect/atom-react/RegistryContext";
|
|
11
12
|
import { Menu, MenuBuilder, useMenuBuilder } from "@dxos/react-ui-menu";
|
|
12
13
|
//#region src/containers/RoutineArticle/RoutineArticle.tsx
|
|
13
14
|
/**
|
|
@@ -51,7 +52,10 @@ var RoutineArticle = ({ role, attendableId, subject }) => {
|
|
|
51
52
|
attendableId,
|
|
52
53
|
children: /* @__PURE__ */ jsxs(Panel.Root, {
|
|
53
54
|
role,
|
|
54
|
-
children: [/* @__PURE__ */ jsx(Panel.Toolbar, { children: /* @__PURE__ */ jsx(Menu.Toolbar, {
|
|
55
|
+
children: [/* @__PURE__ */ jsx(Panel.Toolbar, { children: /* @__PURE__ */ jsx(Menu.Toolbar, {
|
|
56
|
+
classNames: "dx-document",
|
|
57
|
+
children: /* @__PURE__ */ jsx(Menu.Items, {})
|
|
58
|
+
}) }), /* @__PURE__ */ jsx(Panel.Content, {
|
|
55
59
|
asChild: true,
|
|
56
60
|
children: /* @__PURE__ */ jsx(RoutineForm, {
|
|
57
61
|
db,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-RoutineArticle.mjs","names":[],"sources":["../../src/containers/RoutineArticle/RoutineArticle.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport {
|
|
1
|
+
{"version":3,"file":"chunk-RoutineArticle.mjs","names":[],"sources":["../../src/containers/RoutineArticle/RoutineArticle.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { RegistryContext } from '@effect/atom-react/RegistryContext';\nimport * as Atom from 'effect/unstable/reactivity/Atom';\nimport React, { useCallback, useContext, useMemo } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport * as Routine from '@dxos/compute/Routine';\nimport { Obj, Ref } from '@dxos/echo';\nimport { useObject } from '@dxos/echo-react';\nimport { Panel } from '@dxos/react-ui';\nimport { Menu, MenuBuilder, useMenuBuilder } from '@dxos/react-ui-menu';\n\nimport { RoutineForm } from '#components';\nimport { meta } from '#meta';\nimport { RoutineOperation } from '#types';\n\nexport type RoutineArticleProps = AppSurface.ObjectArticleProps<Routine.Routine>;\n\n/**\n * Article surface for a {@link Routine}. The form edits the live routine in place; each trigger's on/off state\n * is toggled inline in the trigger editor. The toolbar exposes Run.\n *\n * TODO(wittjosiah): Disable editing while the routine is running (you shouldn't mutate running code). This was\n * previously wired as \"read-only when enabled\" via a routine-level toggle, but that is not how we want to\n * achieve it — reintroduce a run-state-based lock instead.\n */\nexport const RoutineArticle = ({ role, attendableId, subject }: RoutineArticleProps) => {\n const { invokePromise } = useOperationInvoker();\n const registry = useContext(RegistryContext);\n // Subscribe so the run affordance tracks the routine's action (`spec`).\n const [routine] = useObject(subject);\n const db = Obj.getDatabase(subject);\n\n const runningAtom = useMemo(() => Atom.make(false), []);\n\n // Require both a spec and at least one trigger: manual runs are attributed to the first trigger\n // so they appear in history, and without a trigger the run would be invisible there.\n const canRun = useMemo(() => Boolean(routine.spec) && routine.triggers.length > 0, [routine.spec, routine.triggers]);\n\n const handleRun = useCallback(() => {\n if (!invokePromise || !db) {\n return;\n }\n\n // Thread the routine's first trigger as trace attribution so the run appears in history.\n // Manual runs bypass the trigger dispatcher (which normally stamps meta.trigger), so we\n // do it here — history filters on trigger entity id, and without this the run is invisible.\n const triggerRef = routine.triggers[0];\n registry.set(runningAtom, true);\n void invokePromise(\n RoutineOperation.RunRoutine,\n { routine: Ref.make(subject) },\n {\n spaceId: db.spaceId,\n notify: { error: ['run-error.message', { ns: meta.profile.key }] },\n ...(triggerRef ? { tracing: { trigger: triggerRef } } : {}),\n },\n ).finally(() => registry.set(runningAtom, false));\n }, [invokePromise, db, subject, routine, registry, runningAtom]);\n\n const menuActions = useArticleMenuActions({ canRun, runningAtom, handleRun });\n\n if (!db) {\n return null;\n }\n\n return (\n <Menu.Root {...menuActions} attendableId={attendableId}>\n <Panel.Root role={role}>\n <Panel.Toolbar>\n <Menu.Toolbar classNames='dx-document'>\n <Menu.Items />\n </Menu.Toolbar>\n </Panel.Toolbar>\n <Panel.Content asChild>\n <RoutineForm db={db} routine={subject} />\n </Panel.Content>\n </Panel.Root>\n </Menu.Root>\n );\n};\n\n//\n// Hooks\n//\n\ntype ArticleMenuActionsOptions = {\n canRun: boolean;\n runningAtom: Atom.Writable<boolean>;\n handleRun: () => void;\n};\n\nconst useArticleMenuActions = ({ canRun, runningAtom, handleRun }: ArticleMenuActionsOptions) =>\n useMenuBuilder(\n (get) =>\n MenuBuilder.make()\n .action(\n 'run',\n {\n label: ['run.label', { ns: meta.profile.key }],\n icon: 'ph--play--regular',\n disabled: get(runningAtom) || !canRun,\n disposition: 'toolbar',\n testId: 'routine.toolbar.run',\n },\n () => handleRun(),\n )\n .build(),\n [canRun, handleRun, runningAtom],\n );\n\nRoutineArticle.displayName = 'RoutineArticle';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,kBAAkB,EAAE,MAAM,cAAc,cAAmC;CACtF,MAAM,EAAE,kBAAkB,oBAAoB;CAC9C,MAAM,WAAW,WAAW,eAAe;CAE3C,MAAM,CAAC,WAAW,UAAU,OAAO;CACnC,MAAM,KAAK,IAAI,YAAY,OAAO;CAElC,MAAM,cAAc,cAAc,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC;CA2BtD,MAAM,cAAc,sBAAsB;EAAE,QAvB7B,cAAc,QAAQ,QAAQ,IAAI,KAAK,QAAQ,SAAS,SAAS,GAAG,CAAC,QAAQ,MAAM,QAAQ,QAAQ,CAuBtE;EAAQ;EAAa,WArB/C,kBAAkB;GAClC,IAAI,CAAC,iBAAiB,CAAC,IACrB;GAMF,MAAM,aAAa,QAAQ,SAAS;GACpC,SAAS,IAAI,aAAa,IAAI;GAC9B,cACE,iBAAiB,YACjB,EAAE,SAAS,IAAI,KAAK,OAAO,EAAE,GAC7B;IACE,SAAS,GAAG;IACZ,QAAQ,EAAE,OAAO,CAAC,qBAAqB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC,EAAE;IACjE,GAAI,aAAa,EAAE,SAAS,EAAE,SAAS,WAAW,EAAE,IAAI,CAAC;GAC3D,CACF,CAAC,CAAC,cAAc,SAAS,IAAI,aAAa,KAAK,CAAC;EAClD,GAAG;GAAC;GAAe;GAAI;GAAS;GAAS;GAAU;EAAW,CAEG;CAAU,CAAC;CAE5E,IAAI,CAAC,IACH,OAAO;CAGT,OACE,oBAAC,KAAK,MAAN;EAAW,GAAI;EAA2B;EACxC,UAAA,qBAAC,MAAM,MAAP;GAAkB;GAAlB,UAAA,CACE,oBAAC,MAAM,SAAP,EAAA,UACE,oBAAC,KAAK,SAAN;IAAc,YAAW;IACvB,UAAA,oBAAC,KAAK,OAAN,CAAa,CAAA;GACD,CAAA,EACD,CAAA,GACf,oBAAC,MAAM,SAAP;IAAe,SAAA;IACb,UAAA,oBAAC,aAAD;KAAiB;KAAI,SAAS;IAAU,CAAA;GAC3B,CAAA,CACL;;CACH,CAAA;AAEf;AAYA,IAAM,yBAAyB,EAAE,QAAQ,aAAa,gBACpD,gBACG,QACC,YAAY,KAAK,CAAA,CACd,OACC,OACA;CACE,OAAO,CAAC,aAAa,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;CAC7C,MAAM;CACN,UAAU,IAAI,WAAW,KAAK,CAAC;CAC/B,aAAa;CACb,QAAQ;AACV,SACM,UAAU,CAClB,CAAA,CACC,MAAM,GACX;CAAC;CAAQ;CAAW;AAAW,CACjC;AAEF,eAAe,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-RoutineSettings.mjs","names":[],"sources":["../../src/containers/RoutineSettings/RoutineSettings.tsx"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useActiveSpace } from '@dxos/app-toolkit/ui';\nimport { useObject } from '@dxos/echo-react';\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\n\n/**\n * Space-level routine settings. Individual routines are now first-class objects (configured in their\n * article + per-object companion), so this page exposes the space-wide kill-switch for trigger\n * execution. Per-trigger local/edge routing is set on each trigger via its `remote` flag.\n *\n * The page is reached from space settings, so the space comes from context rather than surface data.\n */\nexport const RoutineSettings = () => {\n const { t } = useTranslation(meta.profile.key);\n const space = useActiveSpace();\n const [properties, changeProperties] = useObject(space?.properties);\n const enabled = !(properties?.triggersDisabled ?? false);\n\n const handleToggle = (value: boolean) => {\n changeProperties((current) => {\n current.triggersDisabled = !value;\n });\n };\n\n if (!space) {\n return null;\n }\n\n return (\n <Form.Root variant='settings'>\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={t('routine-verbose.label')} description={t('routine.description')}>\n <Form.Row label={t('runtime.label')} description={t('runtime.description')}>\n <Input.Root>\n <Input.Switch checked={enabled} onCheckedChange={handleToggle} />\n </Input.Root>\n </Form.Row>\n </Form.Section>\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n\nRoutineSettings.displayName = 'RoutineSettings';\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAa,wBAAwB;CACnC,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,MAAM,QAAQ,eAAe;CAC7B,MAAM,CAAC,YAAY,oBAAoB,UAAU,OAAO,UAAU;CAClE,MAAM,UAAU,EAAE,YAAY,oBAAoB;CAElD,MAAM,gBAAgB,UAAmB;EACvC,kBAAkB,YAAY;GAC5B,QAAQ,mBAAmB,CAAC;EAC9B,CAAC;CACH;CAEA,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,KAAK,MAAN;EAAW,SAAQ;
|
|
1
|
+
{"version":3,"file":"chunk-RoutineSettings.mjs","names":[],"sources":["../../src/containers/RoutineSettings/RoutineSettings.tsx"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useActiveSpace } from '@dxos/app-toolkit/ui';\nimport { useObject } from '@dxos/echo-react';\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\n\n/**\n * Space-level routine settings. Individual routines are now first-class objects (configured in their\n * article + per-object companion), so this page exposes the space-wide kill-switch for trigger\n * execution. Per-trigger local/edge routing is set on each trigger via its `remote` flag.\n *\n * The page is reached from space settings, so the space comes from context rather than surface data.\n */\nexport const RoutineSettings = () => {\n const { t } = useTranslation(meta.profile.key);\n const space = useActiveSpace();\n const [properties, changeProperties] = useObject(space?.properties);\n const enabled = !(properties?.triggersDisabled ?? false);\n\n const handleToggle = (value: boolean) => {\n changeProperties((current) => {\n current.triggersDisabled = !value;\n });\n };\n\n if (!space) {\n return null;\n }\n\n return (\n <Form.Root variant='settings'>\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={t('routine-verbose.label')} description={t('routine.description')}>\n <Form.Row label={t('runtime.label')} description={t('runtime.description')}>\n <Input.Root>\n <Input.Switch checked={enabled} onCheckedChange={handleToggle} />\n </Input.Root>\n </Form.Row>\n </Form.Section>\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n\nRoutineSettings.displayName = 'RoutineSettings';\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAa,wBAAwB;CACnC,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,MAAM,QAAQ,eAAe;CAC7B,MAAM,CAAC,YAAY,oBAAoB,UAAU,OAAO,UAAU;CAClE,MAAM,UAAU,EAAE,YAAY,oBAAoB;CAElD,MAAM,gBAAgB,UAAmB;EACvC,kBAAkB,YAAY;GAC5B,QAAQ,mBAAmB,CAAC;EAC9B,CAAC;CACH;CAEA,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,KAAK,MAAN;EAAW,SAAQ;EACjB,UAAA,oBAAC,KAAK,UAAN;GAAe,QAAA;GACb,UAAA,oBAAC,KAAK,SAAN,EAAA,UACE,oBAAC,KAAK,SAAN;IAAc,OAAO,EAAE,uBAAuB;IAAG,aAAa,EAAE,qBAAqB;IACnF,UAAA,oBAAC,KAAK,KAAN;KAAU,OAAO,EAAE,eAAe;KAAG,aAAa,EAAE,qBAAqB;KACvE,UAAA,oBAAC,MAAM,MAAP,EAAA,UACE,oBAAC,MAAM,QAAP;MAAc,SAAS;MAAS,iBAAiB;KAAe,CAAA,EACtD,CAAA;IACJ,CAAA;GACE,CAAA,EACF,CAAA;EACD,CAAA;CACN,CAAA;AAEf;AAEA,gBAAgB,cAAc"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Trace } from "@dxos/compute";
|
|
2
1
|
import { meta } from "#meta";
|
|
3
2
|
import { Filter, Obj, Query } from "@dxos/echo";
|
|
4
|
-
import { EID } from "@dxos/keys";
|
|
5
3
|
import { useMemo } from "react";
|
|
6
4
|
import { useQuery } from "@dxos/echo-react";
|
|
7
|
-
import { Icon, Panel, ScrollArea, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
5
|
+
import { Flex, Icon, Panel, ScrollArea, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
8
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
7
|
import { Accordion, Empty, Listbox } from "@dxos/react-ui-list";
|
|
10
8
|
import { FeedTraceSink } from "@dxos/compute-runtime";
|
|
9
|
+
import { EID } from "@dxos/keys";
|
|
10
|
+
import * as Trace from "@dxos/compute/Trace";
|
|
11
11
|
import { JsonHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
12
|
+
import { RUN_AGAIN_ERROR_CODE, RUN_AGAIN_MESSAGE } from "@dxos/compute";
|
|
12
13
|
//#region src/containers/RoutineTraceCompanion/runs.ts
|
|
13
14
|
/**
|
|
14
15
|
* Groups trace messages into per-run summaries.
|
|
@@ -58,13 +59,18 @@ var groupIntoRuns = (messages, triggerEntityIds) => {
|
|
|
58
59
|
allEvents.sort((left, right) => left.timestamp - right.timestamp);
|
|
59
60
|
const startedAt = allEvents[0]?.timestamp ?? 0;
|
|
60
61
|
const duration = (allEvents.at(-1)?.timestamp ?? startedAt) - startedAt;
|
|
62
|
+
const isRunAgain = (data) => data.errorCode === RUN_AGAIN_ERROR_CODE || data.errorCode === void 0 && data.error === RUN_AGAIN_MESSAGE;
|
|
61
63
|
let status = "pending";
|
|
62
64
|
for (const evt of allEvents) if (Trace.isOfType(Trace.OperationEnd, evt)) {
|
|
63
65
|
if (evt.data.outcome === "failure") {
|
|
66
|
+
if (isRunAgain(evt.data)) {
|
|
67
|
+
status = "incomplete";
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
64
70
|
status = "failure";
|
|
65
71
|
break;
|
|
66
72
|
}
|
|
67
|
-
status = "success";
|
|
73
|
+
if (status !== "incomplete") status = "success";
|
|
68
74
|
}
|
|
69
75
|
const conversation = msgs.find((msg) => msg.meta.conversation)?.meta.conversation;
|
|
70
76
|
const events = allEvents.map((evt) => ({
|
|
@@ -115,11 +121,13 @@ var useRoutineRuns = (db, routine) => {
|
|
|
115
121
|
var STATUS_ICONS = {
|
|
116
122
|
success: "ph--check-circle--regular",
|
|
117
123
|
failure: "ph--x-circle--regular",
|
|
124
|
+
incomplete: "ph--arrows-clockwise--regular",
|
|
118
125
|
pending: "ph--clock--regular"
|
|
119
126
|
};
|
|
120
127
|
var STATUS_CLASSES = {
|
|
121
128
|
success: "text-success-text",
|
|
122
129
|
failure: "text-error-text",
|
|
130
|
+
incomplete: "text-warning-text",
|
|
123
131
|
pending: "text-description"
|
|
124
132
|
};
|
|
125
133
|
/** Companion panel showing the execution trace (runs) of a Routine. */
|
|
@@ -138,8 +146,8 @@ var RoutineTraceCompanion = ({ role, subject }) => {
|
|
|
138
146
|
children: /* @__PURE__ */ jsx(ScrollArea.Viewport, { children: runs.length === 0 ? /* @__PURE__ */ jsx(Empty, { label: t("history.empty.message") }) : /* @__PURE__ */ jsx(Accordion.Root, {
|
|
139
147
|
items: runs,
|
|
140
148
|
getId: getRunId,
|
|
141
|
-
children: ({ items }) => /* @__PURE__ */ jsx(
|
|
142
|
-
|
|
149
|
+
children: ({ items }) => /* @__PURE__ */ jsx(Flex, {
|
|
150
|
+
column: true,
|
|
143
151
|
children: items.map((run) => /* @__PURE__ */ jsxs(Accordion.Item, {
|
|
144
152
|
item: run,
|
|
145
153
|
classNames: "border-b border-subdued-separator",
|