@dxos/plugin-routine 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLUGIN.mdl +18 -13
- package/dist/lib/RoutinePlugin.mjs +2 -0
- package/dist/lib/RoutinePlugin.node.mjs +894 -0
- package/dist/lib/RoutinePlugin.node.mjs.map +1 -0
- package/dist/lib/RoutinePlugin.workerd.mjs +20 -0
- package/dist/lib/RoutinePlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities/node.mjs +12 -0
- package/dist/lib/capabilities/node.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +14 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-RoutineArticle.mjs +79 -0
- package/dist/lib/chunk-RoutineArticle.mjs.map +1 -0
- package/dist/lib/chunk-RoutineCompanion.mjs +192 -0
- package/dist/lib/chunk-RoutineCompanion.mjs.map +1 -0
- package/dist/lib/chunk-RoutinePlugin.mjs +38 -0
- package/dist/lib/chunk-RoutinePlugin.mjs.map +1 -0
- package/dist/lib/chunk-RoutineSettings.mjs +50 -0
- package/dist/lib/chunk-RoutineSettings.mjs.map +1 -0
- package/dist/lib/chunk-RoutineTraceCompanion.mjs +208 -0
- package/dist/lib/chunk-RoutineTraceCompanion.mjs.map +1 -0
- package/dist/lib/chunk-SkillArticle.mjs +28 -0
- package/dist/lib/chunk-SkillArticle.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +71 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-create-object.mjs +23 -0
- package/dist/lib/chunk-create-object.mjs.map +1 -0
- package/dist/lib/chunk-create-routine.mjs +34 -0
- package/dist/lib/chunk-create-routine.mjs.map +1 -0
- package/dist/lib/chunk-create-trigger-from-template.mjs +48 -0
- package/dist/lib/chunk-create-trigger-from-template.mjs.map +1 -0
- package/dist/lib/chunk-layer-specs.mjs +179 -0
- package/dist/lib/chunk-layer-specs.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-HLO4LYXT.mjs → chunk-meta.mjs} +19 -27
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +11 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-paths.mjs +11 -0
- package/dist/lib/chunk-paths.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +64 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-registry-sync.mjs +104 -0
- package/dist/lib/chunk-registry-sync.mjs.map +1 -0
- package/dist/lib/chunk-run-routine.mjs +57 -0
- package/dist/lib/chunk-run-routine.mjs.map +1 -0
- package/dist/lib/chunk-templates.mjs +37 -0
- package/dist/lib/chunk-templates.mjs.map +1 -0
- package/dist/lib/chunk-trigger-runtime-controller.mjs +73 -0
- package/dist/lib/chunk-trigger-runtime-controller.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +149 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/chunk-util.mjs +142 -0
- package/dist/lib/chunk-util.mjs.map +1 -0
- package/dist/lib/components.mjs +1645 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +11 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/hooks.mjs +37 -0
- package/dist/lib/hooks.mjs.map +1 -0
- package/dist/lib/index.mjs +5 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/operations.mjs +7 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/testing.mjs +2 -0
- package/dist/lib/translations.mjs +110 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/src/RoutinePlugin.d.ts.map +1 -1
- package/dist/types/src/RoutinePlugin.node.d.ts.map +1 -1
- package/dist/types/src/RoutinePlugin.workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/registry-sync.d.ts +1 -1
- package/dist/types/src/capabilities/templates.d.ts +1 -1
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/{queue.d.ts → feed.d.ts} +2 -2
- package/dist/types/src/commands/trigger/create/feed.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/{queue.d.ts → feed.d.ts} +2 -2
- package/dist/types/src/commands/trigger/update/feed.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/util.d.ts +1 -1
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -1
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts +7 -5
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts.map +1 -1
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts +3 -3
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/RoutineCard/RoutineCard.d.ts +9 -0
- package/dist/types/src/components/RoutineCard/RoutineCard.d.ts.map +1 -0
- package/dist/types/src/components/RoutineCard/RoutineCard.stories.d.ts +21 -0
- package/dist/types/src/components/RoutineCard/RoutineCard.stories.d.ts.map +1 -0
- package/dist/types/src/components/RoutineCard/index.d.ts +2 -0
- package/dist/types/src/components/RoutineCard/index.d.ts.map +1 -0
- package/dist/types/src/components/RoutineForm/RoutineForm.d.ts +7 -2
- package/dist/types/src/components/RoutineForm/RoutineForm.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/Schedule.d.ts +2 -26
- package/dist/types/src/components/Schedule/Schedule.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/days.d.ts +24 -0
- package/dist/types/src/components/Schedule/days.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/describe-schedule.d.ts +3 -0
- package/dist/types/src/components/Schedule/describe-schedule.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/index.d.ts +2 -0
- package/dist/types/src/components/Schedule/index.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.d.ts +5 -2
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/trigger-kind-icon.d.ts +5 -0
- package/dist/types/src/components/TriggerEditor/trigger-kind-icon.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +5 -10
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +6 -2
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts +4 -12
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineSettings/RoutineSettings.d.ts +4 -8
- package/dist/types/src/containers/RoutineSettings/RoutineSettings.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts +5 -3
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.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 +4 -1
- package/dist/types/src/containers/SkillArticle/SkillArticle.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 +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/run-routine.d.ts.map +1 -1
- package/dist/types/src/operations/run-routine.test.d.ts +2 -0
- package/dist/types/src/operations/run-routine.test.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +1 -1
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts +30 -6
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/RoutineCapabilities.d.ts +9 -3
- package/dist/types/src/types/RoutineCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/RoutineOperation.d.ts +2 -3
- package/dist/types/src/types/RoutineOperation.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/routines-for-object.d.ts +6 -3
- package/dist/types/src/util/routines-for-object.d.ts.map +1 -1
- package/dist/types/src/util/wire.d.ts +21 -0
- package/dist/types/src/util/wire.d.ts.map +1 -0
- package/dist/types/src/util/wire.test.d.ts +2 -0
- package/dist/types/src/util/wire.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +3 -2
- package/package.json +73 -71
- package/src/RoutinePlugin.node.ts +1 -2
- package/src/RoutinePlugin.tsx +2 -4
- package/src/RoutinePlugin.workerd.ts +1 -2
- package/src/capabilities/app-graph-builder.ts +9 -7
- package/src/capabilities/create-object.ts +2 -2
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/layer-specs.ts +78 -12
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +18 -22
- package/src/capabilities/trigger-runtime-controller.test.ts +12 -18
- package/src/capabilities/trigger-runtime-controller.ts +22 -25
- package/src/commands/trigger/create/{queue.ts → feed.ts} +1 -1
- package/src/commands/trigger/create/index.ts +2 -2
- package/src/commands/trigger/update/{queue.ts → feed.ts} +1 -1
- package/src/commands/trigger/update/index.ts +2 -2
- package/src/commands/trigger/util.ts +1 -2
- package/src/components/InstructionsEditor/InstructionsEditor.stories.tsx +7 -6
- package/src/components/InstructionsEditor/InstructionsEditor.tsx +31 -19
- package/src/components/RoutineCard/RoutineCard.stories.tsx +95 -0
- package/src/components/RoutineCard/RoutineCard.tsx +60 -0
- package/src/components/{MasterDetail → RoutineCard}/index.ts +1 -1
- package/src/components/RoutineForm/RoutineForm.tsx +60 -52
- package/src/components/Schedule/Schedule.stories.tsx +1 -1
- package/src/components/Schedule/Schedule.tsx +4 -73
- package/src/components/Schedule/days.ts +18 -0
- package/src/components/Schedule/describe-schedule.ts +64 -0
- package/src/components/Schedule/index.ts +2 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +1 -1
- package/src/components/TemplateEditor/TemplateForm.tsx +1 -1
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +3 -3
- package/src/components/TriggerEditor/TriggerEditor.tsx +79 -66
- package/src/components/TriggerEditor/TriggerKindSelector.tsx +4 -30
- package/src/components/TriggerEditor/trigger-kind-icon.ts +38 -0
- package/src/components/index.ts +1 -1
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +78 -19
- package/src/containers/RoutineArticle/RoutineArticle.tsx +8 -4
- package/src/containers/RoutineCompanion/RoutineCompanion.stories.tsx +5 -4
- package/src/containers/RoutineCompanion/RoutineCompanion.tsx +11 -7
- package/src/containers/RoutineSettings/RoutineSettings.tsx +22 -33
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.tsx +6 -5
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.tsx +3 -1
- package/src/containers/RoutineTraceCompanion/useRoutineRuns.ts +3 -5
- package/src/containers/SkillArticle/SkillArticle.tsx +2 -0
- package/src/hooks/useTriggerRuntimeControls.ts +2 -2
- package/src/index.ts +1 -0
- package/src/operations/create-routine.ts +1 -1
- package/src/operations/create-trigger-from-template.ts +2 -2
- package/src/operations/run-routine.test.ts +150 -0
- package/src/operations/run-routine.ts +18 -2
- package/src/paths.ts +5 -5
- package/src/templates/index.ts +5 -3
- package/src/translations.ts +5 -6
- package/src/types/RoutineCapabilities.ts +10 -4
- package/src/types/RoutineOperation.ts +7 -6
- package/src/types/index.ts +0 -1
- package/src/util/index.ts +1 -0
- package/src/util/routines-for-object.test.ts +37 -5
- package/src/util/routines-for-object.ts +33 -8
- package/src/util/wire.test.ts +77 -0
- package/src/util/wire.ts +76 -0
- package/dist/lib/neutral/RoutineArticle-UNTMV4CC.mjs +0 -95
- package/dist/lib/neutral/RoutineArticle-UNTMV4CC.mjs.map +0 -7
- package/dist/lib/neutral/RoutineCompanion-ZZ6WMY7I.mjs +0 -249
- package/dist/lib/neutral/RoutineCompanion-ZZ6WMY7I.mjs.map +0 -7
- package/dist/lib/neutral/RoutinePlugin.mjs +0 -10
- package/dist/lib/neutral/RoutinePlugin.mjs.map +0 -7
- package/dist/lib/neutral/RoutinePlugin.node.mjs +0 -1133
- package/dist/lib/neutral/RoutinePlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/RoutinePlugin.workerd.mjs +0 -36
- package/dist/lib/neutral/RoutinePlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/RoutineSettings-ZJOM4F3S.mjs +0 -48
- package/dist/lib/neutral/RoutineSettings-ZJOM4F3S.mjs.map +0 -7
- package/dist/lib/neutral/RoutineTraceCompanion-5U6R7LJE.mjs +0 -236
- package/dist/lib/neutral/RoutineTraceCompanion-5U6R7LJE.mjs.map +0 -7
- package/dist/lib/neutral/SkillArticle-WWDNKW2Z.mjs +0 -27
- package/dist/lib/neutral/SkillArticle-WWDNKW2Z.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-FALWLZTI.mjs +0 -90
- package/dist/lib/neutral/app-graph-builder-FALWLZTI.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -25
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/node.mjs +0 -19
- package/dist/lib/neutral/capabilities/node.mjs.map +0 -7
- package/dist/lib/neutral/chunk-674LDIUJ.mjs +0 -9
- package/dist/lib/neutral/chunk-674LDIUJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-HLO4LYXT.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-P3TDQKOO.mjs +0 -8
- package/dist/lib/neutral/chunk-P3TDQKOO.mjs.map +0 -7
- package/dist/lib/neutral/chunk-R7J2MU2M.mjs +0 -263
- package/dist/lib/neutral/chunk-R7J2MU2M.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WLNL77C7.mjs +0 -14
- package/dist/lib/neutral/chunk-WLNL77C7.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YGWSAKLD.mjs +0 -65
- package/dist/lib/neutral/chunk-YGWSAKLD.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -1921
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -17
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-object-V23KVDMJ.mjs +0 -25
- package/dist/lib/neutral/create-object-V23KVDMJ.mjs.map +0 -7
- package/dist/lib/neutral/create-routine-6QBY6TWF.mjs +0 -38
- package/dist/lib/neutral/create-routine-6QBY6TWF.mjs.map +0 -7
- package/dist/lib/neutral/create-trigger-from-template-U3KNS77V.mjs +0 -70
- package/dist/lib/neutral/create-trigger-from-template-U3KNS77V.mjs.map +0 -7
- package/dist/lib/neutral/hooks/index.mjs +0 -47
- package/dist/lib/neutral/hooks/index.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -27
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/layer-specs-2TWJU5HI.mjs +0 -135
- package/dist/lib/neutral/layer-specs-2TWJU5HI.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-KQIWUH6F.mjs +0 -18
- package/dist/lib/neutral/navigation-resolver-KQIWUH6F.mjs.map +0 -7
- package/dist/lib/neutral/operation-handler-QKLJSDCQ.mjs +0 -13
- package/dist/lib/neutral/operation-handler-QKLJSDCQ.mjs.map +0 -7
- package/dist/lib/neutral/operations/index.mjs +0 -8
- package/dist/lib/neutral/operations/index.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -16
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-GMO7I7YE.mjs +0 -67
- package/dist/lib/neutral/react-surface-GMO7I7YE.mjs.map +0 -7
- package/dist/lib/neutral/registry-sync-DYPOC7ZG.mjs +0 -86
- package/dist/lib/neutral/registry-sync-DYPOC7ZG.mjs.map +0 -7
- package/dist/lib/neutral/run-routine-AEWO6SYD.mjs +0 -37
- package/dist/lib/neutral/run-routine-AEWO6SYD.mjs.map +0 -7
- package/dist/lib/neutral/templates-IIUCEBAX.mjs +0 -49
- package/dist/lib/neutral/templates-IIUCEBAX.mjs.map +0 -7
- package/dist/lib/neutral/testing.mjs +0 -8
- package/dist/lib/neutral/testing.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -115
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/trigger-runtime-controller-WIDDFGQT.mjs +0 -77
- package/dist/lib/neutral/trigger-runtime-controller-WIDDFGQT.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -17
- package/dist/lib/neutral/types/index.mjs.map +0 -7
- package/dist/types/src/capabilities/navigation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +0 -1
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +0 -1
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +0 -1
- package/dist/types/src/components/MasterDetail/MasterDetail.d.ts +0 -51
- package/dist/types/src/components/MasterDetail/MasterDetail.d.ts.map +0 -1
- package/dist/types/src/components/MasterDetail/MasterDetail.stories.d.ts +0 -16
- package/dist/types/src/components/MasterDetail/MasterDetail.stories.d.ts.map +0 -1
- package/dist/types/src/components/MasterDetail/index.d.ts +0 -2
- package/dist/types/src/components/MasterDetail/index.d.ts.map +0 -1
- package/dist/types/src/types/Routine.d.ts +0 -55
- package/dist/types/src/types/Routine.d.ts.map +0 -1
- package/dist/types/src/types/Routine.test.d.ts +0 -2
- package/dist/types/src/types/Routine.test.d.ts.map +0 -1
- package/src/capabilities/navigation-resolver.ts +0 -21
- package/src/components/MasterDetail/MasterDetail.stories.tsx +0 -100
- package/src/components/MasterDetail/MasterDetail.tsx +0 -175
- package/src/types/Routine.test.ts +0 -51
- package/src/types/Routine.ts +0 -144
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/registry-sync.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
6
|
-
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
7
|
-
import { Operation } from "@dxos/compute";
|
|
8
|
-
import { log } from "@dxos/log";
|
|
9
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
10
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-routine/src/capabilities/registry-sync.ts";
|
|
11
|
-
var registry_sync_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
12
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
13
|
-
const atomRegistry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
14
|
-
const capabilityManager = yield* Capability.Service;
|
|
15
|
-
const skillDefinitionsAtom = capabilityManager.atom(AppCapabilities.SkillDefinition);
|
|
16
|
-
const prevSkillKeys = /* @__PURE__ */ new Set();
|
|
17
|
-
atomRegistry.subscribe(skillDefinitionsAtom, (definitions) => {
|
|
18
|
-
const fresh = [];
|
|
19
|
-
for (const def of definitions) {
|
|
20
|
-
if (!prevSkillKeys.has(def.key)) {
|
|
21
|
-
prevSkillKeys.add(def.key);
|
|
22
|
-
fresh.push(def.make());
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (fresh.length > 0) {
|
|
26
|
-
client.graph.registry.add(fresh);
|
|
27
|
-
}
|
|
28
|
-
}, {
|
|
29
|
-
immediate: true
|
|
30
|
-
});
|
|
31
|
-
const operationHandlersAtom = capabilityManager.atom(Capabilities.OperationHandler);
|
|
32
|
-
const prevOperationKeys = /* @__PURE__ */ new Set();
|
|
33
|
-
atomRegistry.subscribe(operationHandlersAtom, async (handlerSets) => {
|
|
34
|
-
try {
|
|
35
|
-
const handlers = (await Promise.all(handlerSets.map((set) => set.getHandlers()))).flat();
|
|
36
|
-
const seenKeys = /* @__PURE__ */ new Set();
|
|
37
|
-
const batch = [];
|
|
38
|
-
for (const handler of handlers) {
|
|
39
|
-
const key = handler.meta.key;
|
|
40
|
-
if (!key) {
|
|
41
|
-
log.warn("skipping operation handler without key", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 61, S: this });
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (seenKeys.has(key)) {
|
|
45
|
-
log("skipping duplicate operation", {
|
|
46
|
-
key
|
|
47
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 65, S: this });
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
seenKeys.add(key);
|
|
51
|
-
if (prevOperationKeys.has(key)) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
if (handler.meta.skipRegistry) {
|
|
55
|
-
prevOperationKeys.add(key);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
batch.push(Operation.serialize(handler));
|
|
60
|
-
} catch {
|
|
61
|
-
log.verbose("skipping operation with unserializable schema", {
|
|
62
|
-
key
|
|
63
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 81, S: this });
|
|
64
|
-
prevOperationKeys.add(key);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (batch.length > 0) {
|
|
68
|
-
client.graph.registry.add(batch);
|
|
69
|
-
for (const operation of batch) {
|
|
70
|
-
const operationKey = Operation.getKey(operation);
|
|
71
|
-
if (operationKey) {
|
|
72
|
-
prevOperationKeys.add(operationKey);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
} catch (error) {
|
|
77
|
-
log.catch(error, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 97, S: this });
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
immediate: true
|
|
81
|
-
});
|
|
82
|
-
}));
|
|
83
|
-
export {
|
|
84
|
-
registry_sync_default as default
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=registry-sync-DYPOC7ZG.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/registry-sync.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Operation, Skill } from '@dxos/compute';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\n/**\n * Syncs plugin capability contributions into `client.graph.registry`.\n *\n * Watches two capability atoms and imperatively adds entities to the\n * hypergraph registry when they change:\n * - {@link AppCapabilities.SkillDefinition} → instantiates each skill via `def.make()`.\n * - {@link Capabilities.OperationHandler} → serializes each handler via `Operation.serialize`.\n *\n * Skill DB copies (stored in a space when a skill is \"enabled\") are treated as\n * user forks and are not overwritten. The registry is always used as the source of truth\n * for skill instructions at request time — see `formatSystemPrompt` in `@dxos/assistant`.\n *\n * Note: the plugin framework does not yet expose a teardown hook for capability\n * modules (see the TODO in process-manager-capability.ts), so the subscriptions\n * are not explicitly cancelled. They are effectively scoped to the client's lifetime.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const atomRegistry = yield* Capability.get(Capabilities.AtomRegistry);\n const capabilityManager = yield* Capability.Service;\n\n //\n // Skill registration.\n //\n\n const skillDefinitionsAtom = capabilityManager.atom(AppCapabilities.SkillDefinition);\n const prevSkillKeys = new Set<string>();\n\n atomRegistry.subscribe(\n skillDefinitionsAtom,\n (definitions) => {\n const fresh: Skill.Skill[] = [];\n for (const def of definitions) {\n if (!prevSkillKeys.has(def.key)) {\n prevSkillKeys.add(def.key);\n fresh.push(def.make());\n }\n }\n if (fresh.length > 0) {\n client.graph.registry.add(fresh);\n }\n },\n { immediate: true },\n );\n\n //\n // Operation registration.\n //\n\n const operationHandlersAtom = capabilityManager.atom(Capabilities.OperationHandler);\n const prevOperationKeys = new Set<string>();\n\n atomRegistry.subscribe(\n operationHandlersAtom,\n async (handlerSets) => {\n try {\n const handlers = (await Promise.all(handlerSets.map((set) => set.getHandlers()))).flat();\n const seenKeys = new Set<string>();\n const batch: Operation.PersistentOperation[] = [];\n for (const handler of handlers) {\n const key = handler.meta.key;\n if (!key) {\n log.warn('skipping operation handler without key');\n continue;\n }\n if (seenKeys.has(key)) {\n log('skipping duplicate operation', { key });\n continue;\n }\n seenKeys.add(key);\n if (prevOperationKeys.has(key)) {\n continue;\n }\n if (handler.meta.skipRegistry) {\n prevOperationKeys.add(key);\n continue;\n }\n try {\n batch.push(Operation.serialize(handler));\n } catch {\n log.verbose('skipping operation with unserializable schema', { key });\n prevOperationKeys.add(key);\n }\n }\n if (batch.length > 0) {\n client.graph.registry.add(batch);\n for (const operation of batch) {\n const operationKey = Operation.getKey(operation);\n if (operationKey) {\n prevOperationKeys.add(operationKey);\n }\n }\n }\n } catch (error) {\n log.catch(error);\n }\n },\n { immediate: true },\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,iBAAwB;AACjC,SAASC,WAAW;AACpB,SAASC,0BAA0B;AAEnC,IAAA,eAAA;AAmBI,IAAMC,wBAAAA,WAAe,WAAsBN,kBAAAA,aAAaO;AACxD,QAAMC,SAAAA,OAAAA,WAA2BP,IAAAA,mBAAkB,MAAA;AAEnD,QAAE,eAAA,OAAA,WAAA,IAAA,aAAA,YAAA;AACF,QAAA,oBAAsB,OAAA,WAAA;AAMtBK,QAAAA,uBACEG,kBACCC,KAAAA,gBAAAA,eAAAA;QACC,gBAA+B,oBAAA,IAAA;eAC1B,UAAaA,sBAAa,CAAA,gBAAA;UAC7B,QAAKC,CAAAA;eACHA,OAAAA,aAAsBC;UACtBC,CAAAA,cAAeC,IAAI,IAAA,GAAA,GAAA;AACrB,sBAAA,IAAA,IAAA,GAAA;AACF,cAAA,KAAA,IAAA,KAAA,CAAA;MACID;;AAEJ,QAAA,MAAA,SAAA,GAAA;AAEF,aAAA,MAAA,SAAA,IAAA,KAAA;IAAEE;EAAgB,GAAA;IAGlB,WAAA;EACF,CAAA;AAMAT,QAAAA,wBACEU,kBACA,KAAOC,aAAAA,gBAAAA;QACL,oBAAI,oBAAA,IAAA;eACF,UAAMC,uBAA8BD,OAAAA,gBAAyBE;QAC7D;AACA,YAAMC,YAA2C,MAAA,QAAA,IAAA,YAAA,IAAA,CAAA,QAAA,IAAA,YAAA,CAAA,CAAA,GAAA,KAAA;AACjD,YAAK,WAAMC,oBAAAA,IAAWH;YACpB,QAAMN,CAAAA;iBACDA,WAAK,UAAA;cACRR,MAAQ,QAAC,KAAA;YACT,CAAA,KAAA;AACF,cAAA,KAAA,0CAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;AACIkB;;qBACoCV,IAAAA,GAAAA,GAAAA;AAAI,cAAA,gCAAA;YAC1C;UACF,GAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;AACAU;QACA;iBACE,IAAA,GAAA;AACF,YAAA,kBAAA,IAAA,GAAA,GAAA;AACID;;YAEF,QAAA,KAAA,cAAA;AACF,4BAAA,IAAA,GAAA;AACI;;AAEJ,YAAE;AACAjB,gBAAImB,KAAO,UAAC,UAAA,OAAA,CAAA;gBAAmDX;AAAI,cAAA,QAAA,iDAAA;YACnEY;UACF,GAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;AACF,4BAAA,IAAA,GAAA;QACIJ;;UAEF,MAAK,SAAMK,GAAAA;eACT,MAAMC,SAAAA,IAAevB,KAAAA;mBACjBuB,aAAc,OAAA;gBAChBF,eAAAA,UAAsBE,OAAAA,SAAAA;AACxB,cAAA,cAAA;AACF,8BAAA,IAAA,YAAA;UACF;QACA;MACAtB;IACF,SAAA,OAAA;AAEF,UAAA,MAAA,OAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;IAAEW;EAAgB,GAAA;IAGtB,WAAA;;;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "Operation", "log", "ClientCapabilities", "atomRegistry", "AtomRegistry", "capabilityManager", "skillDefinitionsAtom", "definitions", "prevSkillKeys", "key", "fresh", "make", "immediate", "operationHandlersAtom", "handlerSets", "handlers", "set", "batch", "handler", "seenKeys", "verbose", "prevOperationKeys", "operation", "operationKey"]
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RoutineOperation_exports
|
|
3
|
-
} from "./chunk-R7J2MU2M.mjs";
|
|
4
|
-
import "./chunk-674LDIUJ.mjs";
|
|
5
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
-
|
|
7
|
-
// src/operations/run-routine.ts
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
|
-
import { RunInstructions } from "@dxos/assistant-toolkit";
|
|
10
|
-
import { Operation } from "@dxos/compute";
|
|
11
|
-
import { Database, Obj } from "@dxos/echo";
|
|
12
|
-
import { invariant } from "@dxos/invariant";
|
|
13
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-routine/src/operations/run-routine.ts";
|
|
14
|
-
var handler = RoutineOperation_exports.RunRoutine.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ routine }) {
|
|
15
|
-
const routineObj = yield* Database.load(routine);
|
|
16
|
-
const db = Obj.getDatabase(routineObj);
|
|
17
|
-
invariant(db, "Routine is not attached to a database.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 16, S: this, A: ["db", "'Routine is not attached to a database.'"] });
|
|
18
|
-
const spec = routineObj.spec;
|
|
19
|
-
if (spec?.kind === "instructions") {
|
|
20
|
-
yield* Operation.schedule(RunInstructions, {
|
|
21
|
-
instructions: spec.instructions,
|
|
22
|
-
input: {}
|
|
23
|
-
}, {
|
|
24
|
-
spaceId: db.spaceId
|
|
25
|
-
});
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
invariant(spec?.kind === "runnable", "Routine has no action to run.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 30, S: this, A: ["spec?.kind === 'runnable'", "'Routine has no action to run.'"] });
|
|
29
|
-
const operation = yield* Database.load(spec.runnable);
|
|
30
|
-
invariant(Obj.instanceOf(Operation.PersistentOperation, operation), "Routine has no action to run.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 32, S: this, A: ["Obj.instanceOf(Operation.PersistentOperation, operation)", "'Routine has no action to run.'"] });
|
|
31
|
-
yield* Operation.invoke(Operation.deserialize(operation));
|
|
32
|
-
})));
|
|
33
|
-
var run_routine_default = handler;
|
|
34
|
-
export {
|
|
35
|
-
run_routine_default as default
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=run-routine-AEWO6SYD.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/run-routine.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { RunInstructions } from '@dxos/assistant-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\n\nimport { RoutineOperation } from '../types';\n\n// A routine's action is its `runnable`: either an Operation (invoked directly) or the routine's owned\n// Instructions object (run as a background process — the same path triggers use — without creating a new\n// Chat session object).\nconst handler: Operation.WithHandler<typeof RoutineOperation.RunRoutine> = RoutineOperation.RunRoutine.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ routine }) {\n const routineObj = yield* Database.load(routine);\n const db = Obj.getDatabase(routineObj);\n invariant(db, 'Routine is not attached to a database.');\n\n // The action kind is explicit in `spec`; dispatch by kind rather than dereferencing to classify.\n const spec = routineObj.spec;\n if (spec?.kind === 'instructions') {\n // The instructions carry their own context objects and skills; RunInstructions binds them when it\n // executes. No Chat session object is created — the run appears in the process monitor only.\n yield* Operation.schedule(\n RunInstructions,\n { instructions: spec.instructions, input: {} },\n { spaceId: db.spaceId },\n );\n return;\n }\n\n invariant(spec?.kind === 'runnable', 'Routine has no action to run.');\n const operation = yield* Database.load(spec.runnable);\n invariant(Obj.instanceOf(Operation.PersistentOperation, operation), 'Routine has no action to run.');\n yield* Operation.invoke(Operation.deserialize(operation));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAC9B,SAASC,iBAAiB;AAI1B,IAAA,eAAA;IAOM,UAAWC,yBAAgBC,WAAAA,KAAAA,UAAAA,YAAAA,kBAAAA,WAAAA,EAAAA,QAAAA,GAAAA;AAC3BC,QAAAA,aAAc,OAAA,SAAA,KAAA,OAAA;AAEd,QAAA,KAAA,IAAA,YAAA,UAAA;AACA,YAAMC,IAAOF,0CAAe,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,0CAAA,EAAA,CAAA;QAE1B,OAAA,WAAA;MACA,MAAA,SAAA,gBAAA;WAGqCG,UAAQ,SAAA,iBAAA;MAC3C,cAAA,KAAA;MAAEC,OAAAA,CAAAA;IAAoB,GAAA;MAExB,SAAA,GAAA;IACF,CAAA;AAEAH;EACA;AACAA,YAAUF,MAAIM,SAAWC,YAAUC,iCAAiC,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,6BAAA,iCAAA,EAAA,CAAA;AACpE,QAAA,YAAiBC,OAAOF,SAAUG,KAAAA,KAAAA,QAAYC;AAChD,YAAA,IAAA,WAAA,UAAA,qBAAA,SAAA,GAAA,iCAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,4DAAA,iCAAA,EAAA,CAAA;AAIJ,SAAA,UAAeC,OAAQ,UAAA,YAAA,SAAA,CAAA;;;",
|
|
6
|
-
"names": ["Effect", "RunInstructions", "Operation", "Database", "Obj", "invariant", "Obj", "routineObj", "invariant", "spec", "input", "spaceId", "instanceOf", "Operation", "PersistentOperation", "invoke", "deserialize", "operation", "handler"]
|
|
7
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/templates.ts
|
|
4
|
-
import * as Effect2 from "effect/Effect";
|
|
5
|
-
import { Capability } from "@dxos/app-framework";
|
|
6
|
-
import { RoutineCapabilities } from "#types";
|
|
7
|
-
|
|
8
|
-
// src/templates/index.ts
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import * as Option from "effect/Option";
|
|
11
|
-
import { AppAnnotation } from "@dxos/app-toolkit";
|
|
12
|
-
import { Instructions, Skill, Trigger } from "@dxos/compute";
|
|
13
|
-
import { Obj, Ref, Type } from "@dxos/echo";
|
|
14
|
-
import { Routine } from "#types";
|
|
15
|
-
var blank = {
|
|
16
|
-
id: "org.dxos.routine.blank",
|
|
17
|
-
label: "Blank",
|
|
18
|
-
icon: "ph--lightning--regular",
|
|
19
|
-
scaffold: ({ name, subject }) => Effect.succeed(Routine.make({
|
|
20
|
-
name,
|
|
21
|
-
instructions: Instructions.make({
|
|
22
|
-
skills: subject ? skillRefsForObject(subject) : [],
|
|
23
|
-
objects: subject ? [
|
|
24
|
-
Ref.make(subject)
|
|
25
|
-
] : void 0
|
|
26
|
-
}),
|
|
27
|
-
trigger: Trigger.make({})
|
|
28
|
-
}))
|
|
29
|
-
};
|
|
30
|
-
var defaultTemplates = [
|
|
31
|
-
blank
|
|
32
|
-
];
|
|
33
|
-
var skillRefsForObject = (object) => {
|
|
34
|
-
const type = Obj.getType(object);
|
|
35
|
-
if (!type) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
const keys = Option.getOrElse(() => [])(AppAnnotation.SkillsAnnotation.get(Type.getSchema(type)));
|
|
39
|
-
return keys.map((key) => Ref.fromURI(Skill.registryURI(key)));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// src/capabilities/templates.ts
|
|
43
|
-
var templates_default = Capability.makeModule(Effect2.fnUntraced(function* () {
|
|
44
|
-
return defaultTemplates.map((template) => Capability.contributes(RoutineCapabilities.Template, template));
|
|
45
|
-
}));
|
|
46
|
-
export {
|
|
47
|
-
templates_default as default
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=templates-IIUCEBAX.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/templates.ts", "../../../src/templates/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { RoutineCapabilities } from '#types';\n\nimport { defaultTemplates } from '../templates';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return defaultTemplates.map((template) => Capability.contributes(RoutineCapabilities.Template, template));\n }),\n);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { AppAnnotation } from '@dxos/app-toolkit';\nimport { Instructions, Skill, Trigger } from '@dxos/compute';\nimport { Obj, Ref, Type } from '@dxos/echo';\n\nimport { Routine, type RoutineCapabilities } from '#types';\n\n/**\n * Blank template: an instructions-action routine draft with an empty trigger; the action kind, schedule, and\n * body are configured in the form. In an object companion the instructions are seeded with the subject (in\n * `objects`) and its type's skills so the draft starts associated with the subject; the global create dialog\n * (no subject) starts with bare instructions.\n */\nexport const blank: RoutineCapabilities.Template = {\n id: 'org.dxos.routine.blank',\n label: 'Blank',\n icon: 'ph--lightning--regular',\n scaffold: ({ name, subject }) =>\n Effect.succeed(\n Routine.make({\n name,\n instructions: Instructions.make({\n skills: subject ? skillRefsForObject(subject) : [],\n objects: subject ? [Ref.make(subject)] : undefined,\n }),\n trigger: Trigger.make({}),\n }),\n ),\n};\n\n/** Templates contributed by plugin-routine itself. */\nexport const defaultTemplates: RoutineCapabilities.Template[] = [blank];\n\n/** Registry skill refs declared by the object type's {@link AppAnnotation.SkillsAnnotation}. */\nconst skillRefsForObject = (object: Obj.Unknown): Ref.Ref<Skill.Skill>[] => {\n const type = Obj.getType(object);\n if (!type) {\n return [];\n }\n const keys = Option.getOrElse(() => [] as string[])(AppAnnotation.SkillsAnnotation.get(Type.getSchema(type)));\n return keys.map((key) => Ref.fromURI(Skill.registryURI(key)));\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,aAAY;AAExB,SAASC,kBAAkB;AAE3B,SAASC,2BAA2B;;;ACJpC,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,qBAAqB;AAC9B,SAASC,cAAcC,OAAOC,eAAe;AAC7C,SAASC,KAAKC,KAAKC,YAAY;AAE/B,SAASC,eAAyC;AAQ3C,IAAMC,QAAsC;EACjDC,IAAI;EACJC,OAAO;EACPC,MAAM;EACNC,UAAU,CAAC,EAAEC,MAAMC,QAAO,MACjBC,eACLR,QAAQS,KAAK;IACXH;IACAI,cAAchB,aAAae,KAAK;MAC9BE,QAAQJ,UAAUK,mBAAmBL,OAAAA,IAAW,CAAA;MAChDM,SAASN,UAAU;QAACT,IAAIW,KAAKF,OAAAA;UAAYO;IAC3C,CAAA;IACAC,SAASnB,QAAQa,KAAK,CAAC,CAAA;EACzB,CAAA,CAAA;AAEN;AAGO,IAAMO,mBAAmD;EAACf;;AAGjE,IAAMW,qBAAqB,CAACK,WAAAA;AAC1B,QAAMC,OAAOrB,IAAIsB,QAAQF,MAAAA;AACzB,MAAI,CAACC,MAAM;AACT,WAAO,CAAA;EACT;AACA,QAAME,OAAcC,iBAAU,MAAM,CAAA,CAAE,EAAc5B,cAAc6B,iBAAiBC,IAAIxB,KAAKyB,UAAUN,IAAAA,CAAAA,CAAAA;AACtG,SAAOE,KAAKK,IAAI,CAACC,QAAQ5B,IAAI6B,QAAQhC,MAAMiC,YAAYF,GAAAA,CAAAA,CAAAA;AACzD;;;ADnCA,IAAA,oBAAeG,WAAWC,WACjBC,mBAAW,aAAA;AAChB,SAAOC,iBAAiBC,IAAI,CAACC,aAAaL,WAAWM,YAAYC,oBAAoBC,UAAUH,QAAAA,CAAAA;AACjG,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "RoutineCapabilities", "Effect", "Option", "AppAnnotation", "Instructions", "Skill", "Trigger", "Obj", "Ref", "Type", "Routine", "blank", "id", "label", "icon", "scaffold", "name", "subject", "succeed", "make", "instructions", "skills", "skillRefsForObject", "objects", "undefined", "trigger", "defaultTemplates", "object", "type", "getType", "keys", "getOrElse", "SkillsAnnotation", "get", "getSchema", "map", "key", "fromURI", "registryURI", "Capability", "makeModule", "fnUntraced", "defaultTemplates", "map", "template", "contributes", "RoutineCapabilities", "Template"]
|
|
7
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/translations.ts
|
|
4
|
-
import { Type } from "@dxos/echo";
|
|
5
|
-
import { translations as componentsTranslations } from "@dxos/react-ui-components/translations";
|
|
6
|
-
import { translations as formTranslations } from "@dxos/react-ui-form/translations";
|
|
7
|
-
import { meta } from "#meta";
|
|
8
|
-
import { Routine } from "#types";
|
|
9
|
-
var translations = [
|
|
10
|
-
...componentsTranslations,
|
|
11
|
-
...formTranslations,
|
|
12
|
-
{
|
|
13
|
-
"en-US": {
|
|
14
|
-
[Type.getTypename(Routine.Routine)]: {
|
|
15
|
-
"typename.label": "Routine",
|
|
16
|
-
"typename.label_zero": "Routines",
|
|
17
|
-
"typename.label_one": "Routine",
|
|
18
|
-
"typename.label_other": "Routines",
|
|
19
|
-
"object-name.placeholder": "New routine",
|
|
20
|
-
"add-object.label": "Add routine",
|
|
21
|
-
"rename-object.label": "Rename routine",
|
|
22
|
-
"delete-object.label": "Delete routine"
|
|
23
|
-
},
|
|
24
|
-
[meta.profile.key]: {
|
|
25
|
-
"plugin.name": "Routine",
|
|
26
|
-
"automation-panel.label": "Routines",
|
|
27
|
-
"create-panel.template.placeholder": "Search templates...",
|
|
28
|
-
"schedule.kind.once.label": "Once",
|
|
29
|
-
"schedule.kind.hourly.label": "Hourly",
|
|
30
|
-
"schedule.kind.daily.label": "Daily",
|
|
31
|
-
"schedule.kind.weekly.label": "Weekly",
|
|
32
|
-
"schedule.kind.monthly.label": "Monthly",
|
|
33
|
-
"schedule.kind.custom.label": "Custom",
|
|
34
|
-
"schedule.at.label": "At",
|
|
35
|
-
"schedule.on.label": "On",
|
|
36
|
-
"schedule.minute.label": "At minute",
|
|
37
|
-
"schedule.day.label": "Day of month",
|
|
38
|
-
"schedule.cron.label": "Cron",
|
|
39
|
-
"schedule.close.label": "Close",
|
|
40
|
-
"schedule.note.message": "Runs are staggered by a few minutes to spread server load.",
|
|
41
|
-
"command.placeholder": "Enter slash command...",
|
|
42
|
-
"template.placeholder": "Enter template...",
|
|
43
|
-
"run-prompt.label": "Run prompt",
|
|
44
|
-
"routine-running.label": "Running\u2026",
|
|
45
|
-
"run.label": "Run",
|
|
46
|
-
"run-error.message": "Failed to run routine.",
|
|
47
|
-
"automation-name.label": "Name",
|
|
48
|
-
"general.title": "General",
|
|
49
|
-
"general.description": "Name and description.",
|
|
50
|
-
"actions.title": "Actions",
|
|
51
|
-
"actions.description": "What this routine runs.",
|
|
52
|
-
"action.placeholder": "Select an operation or instructions",
|
|
53
|
-
"action-input.label": "Input",
|
|
54
|
-
"action-kind.operation.label": "Operation",
|
|
55
|
-
"action-kind.instructions.label": "Instructions",
|
|
56
|
-
"triggers.title": "Triggers",
|
|
57
|
-
"triggers.description": "When this routine runs.",
|
|
58
|
-
"trigger-kind.placeholder": "Select trigger type",
|
|
59
|
-
"trigger-kind.timer.label": "Schedule",
|
|
60
|
-
"trigger-kind.timer.description": "Run on a recurring schedule or once at a future time.",
|
|
61
|
-
"trigger-kind.subscription.label": "Query",
|
|
62
|
-
"trigger-kind.subscription.description": "Run when objects matching a query change.",
|
|
63
|
-
"trigger-kind.webhook.label": "Webhook",
|
|
64
|
-
"trigger-kind.webhook.description": "Trigger from a POST request.",
|
|
65
|
-
"trigger-kind.feed.label": "Feed",
|
|
66
|
-
"trigger-kind.feed.description": "Run when a new item arrives in a feed.",
|
|
67
|
-
"trigger-kind.email.label": "Email",
|
|
68
|
-
"trigger-kind.email.description": "Run when an email is received.",
|
|
69
|
-
"trigger-kind.clear.label": "Clear",
|
|
70
|
-
"trigger-kind.query-stub.message": "Query editing is not yet available.",
|
|
71
|
-
"trigger-kind.email-note.message": "Runs whenever a new email is received.",
|
|
72
|
-
"method.label": "Method",
|
|
73
|
-
"port.label": "Port",
|
|
74
|
-
"cron.placeholder": "0 0 * * *",
|
|
75
|
-
"feed.placeholder": "Select a feed",
|
|
76
|
-
"enabled.label": "Enabled",
|
|
77
|
-
"enabled.description": "Turn this routine on or off.",
|
|
78
|
-
"add-trigger.label": "Add trigger",
|
|
79
|
-
"add-trigger-first.message": "Add a trigger to enable.",
|
|
80
|
-
"remove-trigger.label": "Remove",
|
|
81
|
-
"select-action-first.message": "Select an action first.",
|
|
82
|
-
"automation-companion.label": "Routine",
|
|
83
|
-
"routine-runs.label": "Runs",
|
|
84
|
-
"history.empty.message": "No runs yet.",
|
|
85
|
-
"history.status.success.label": "Success",
|
|
86
|
-
"history.status.failure.label": "Failed",
|
|
87
|
-
"history.status.pending.label": "Running",
|
|
88
|
-
"no-routines.message": "No routines for this object.",
|
|
89
|
-
"routine-not-associated.message": "Not yet associated with this object.",
|
|
90
|
-
"routine-detached.message": "No longer associated with this object.",
|
|
91
|
-
"add-routine.label": "Add routine",
|
|
92
|
-
"routine-actions.label": "Routine actions",
|
|
93
|
-
"disabled.label": "Disabled",
|
|
94
|
-
"delete.label": "Delete",
|
|
95
|
-
"save.label": "Save",
|
|
96
|
-
"cancel.label": "Cancel",
|
|
97
|
-
"testing.title": "Testing",
|
|
98
|
-
"force-run.label": "Force run",
|
|
99
|
-
"reset-cursor.label": "Reset feed cursor",
|
|
100
|
-
"reset-cursor-confirm.label": "Confirm reset feed cursor",
|
|
101
|
-
"routine-verbose.label": "Manage routines",
|
|
102
|
-
"routine.description": "Manage where routines in this space run.",
|
|
103
|
-
"runtime.label": "Runtime location",
|
|
104
|
-
"runtime.description": "Determines where routines in this space run.",
|
|
105
|
-
"runtime.disabled.label": "Disabled",
|
|
106
|
-
"runtime.local.label": "Local",
|
|
107
|
-
"runtime.edge.label": "EDGE (experimental)"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
];
|
|
112
|
-
export {
|
|
113
|
-
translations
|
|
114
|
-
};
|
|
115
|
-
//# sourceMappingURL=translations.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as componentsTranslations } from '@dxos/react-ui-components/translations';\nimport { translations as formTranslations } from '@dxos/react-ui-form/translations';\n\nimport { meta } from '#meta';\nimport { Routine } from '#types';\n\nexport const translations: Resource[] = [\n ...componentsTranslations,\n ...formTranslations,\n {\n 'en-US': {\n [Type.getTypename(Routine.Routine)]: {\n 'typename.label': 'Routine',\n 'typename.label_zero': 'Routines',\n 'typename.label_one': 'Routine',\n 'typename.label_other': 'Routines',\n 'object-name.placeholder': 'New routine',\n 'add-object.label': 'Add routine',\n 'rename-object.label': 'Rename routine',\n 'delete-object.label': 'Delete routine',\n },\n [meta.profile.key]: {\n 'plugin.name': 'Routine',\n 'automation-panel.label': 'Routines',\n 'create-panel.template.placeholder': 'Search templates...',\n\n 'schedule.kind.once.label': 'Once',\n 'schedule.kind.hourly.label': 'Hourly',\n 'schedule.kind.daily.label': 'Daily',\n 'schedule.kind.weekly.label': 'Weekly',\n 'schedule.kind.monthly.label': 'Monthly',\n 'schedule.kind.custom.label': 'Custom',\n 'schedule.at.label': 'At',\n 'schedule.on.label': 'On',\n 'schedule.minute.label': 'At minute',\n 'schedule.day.label': 'Day of month',\n 'schedule.cron.label': 'Cron',\n 'schedule.close.label': 'Close',\n 'schedule.note.message': 'Runs are staggered by a few minutes to spread server load.',\n\n 'command.placeholder': 'Enter slash command...',\n 'template.placeholder': 'Enter template...',\n 'run-prompt.label': 'Run prompt',\n 'routine-running.label': 'Running…',\n 'run.label': 'Run',\n 'run-error.message': 'Failed to run routine.',\n\n 'automation-name.label': 'Name',\n 'general.title': 'General',\n 'general.description': 'Name and description.',\n\n 'actions.title': 'Actions',\n 'actions.description': 'What this routine runs.',\n 'action.placeholder': 'Select an operation or instructions',\n 'action-input.label': 'Input',\n 'action-kind.operation.label': 'Operation',\n 'action-kind.instructions.label': 'Instructions',\n\n 'triggers.title': 'Triggers',\n 'triggers.description': 'When this routine runs.',\n 'trigger-kind.placeholder': 'Select trigger type',\n 'trigger-kind.timer.label': 'Schedule',\n 'trigger-kind.timer.description': 'Run on a recurring schedule or once at a future time.',\n 'trigger-kind.subscription.label': 'Query',\n 'trigger-kind.subscription.description': 'Run when objects matching a query change.',\n 'trigger-kind.webhook.label': 'Webhook',\n 'trigger-kind.webhook.description': 'Trigger from a POST request.',\n 'trigger-kind.feed.label': 'Feed',\n 'trigger-kind.feed.description': 'Run when a new item arrives in a feed.',\n 'trigger-kind.email.label': 'Email',\n 'trigger-kind.email.description': 'Run when an email is received.',\n 'trigger-kind.clear.label': 'Clear',\n 'trigger-kind.query-stub.message': 'Query editing is not yet available.',\n 'trigger-kind.email-note.message': 'Runs whenever a new email is received.',\n\n 'method.label': 'Method',\n 'port.label': 'Port',\n 'cron.placeholder': '0 0 * * *',\n 'feed.placeholder': 'Select a feed',\n 'enabled.label': 'Enabled',\n 'enabled.description': 'Turn this routine on or off.',\n 'add-trigger.label': 'Add trigger',\n 'add-trigger-first.message': 'Add a trigger to enable.',\n 'remove-trigger.label': 'Remove',\n 'select-action-first.message': 'Select an action first.',\n 'automation-companion.label': 'Routine',\n 'routine-runs.label': 'Runs',\n\n 'history.empty.message': 'No runs yet.',\n 'history.status.success.label': 'Success',\n 'history.status.failure.label': 'Failed',\n 'history.status.pending.label': 'Running',\n 'no-routines.message': 'No routines for this object.',\n 'routine-not-associated.message': 'Not yet associated with this object.',\n 'routine-detached.message': 'No longer associated with this object.',\n 'add-routine.label': 'Add routine',\n 'routine-actions.label': 'Routine actions',\n 'disabled.label': 'Disabled',\n 'delete.label': 'Delete',\n 'save.label': 'Save',\n 'cancel.label': 'Cancel',\n\n 'testing.title': 'Testing',\n 'force-run.label': 'Force run',\n 'reset-cursor.label': 'Reset feed cursor',\n 'reset-cursor-confirm.label': 'Confirm reset feed cursor',\n\n 'routine-verbose.label': 'Manage routines',\n 'routine.description': 'Manage where routines in this space run.',\n\n 'runtime.label': 'Runtime location',\n 'runtime.description': 'Determines where routines in this space run.',\n 'runtime.disabled.label': 'Disabled',\n 'runtime.local.label': 'Local',\n 'runtime.edge.label': 'EDGE (experimental)',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,YAAY;AAErB,SAASC,gBAAgBC,8BAA8B;AACvD,SAASD,gBAAgBE,wBAAwB;AAEjD,SAASC,YAAY;AACrB,SAASC,eAAe;AAEjB,IAAMJ,eAA2B;KACnCC;KACAC;EACH;IACE,SAAS;MACP,CAACH,KAAKM,YAAYD,QAAQA,OAAO,CAAA,GAAI;QACnC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,oBAAoB;QACpB,uBAAuB;QACvB,uBAAuB;MACzB;MACA,CAACD,KAAKG,QAAQC,GAAG,GAAG;QAClB,eAAe;QACf,0BAA0B;QAC1B,qCAAqC;QAErC,4BAA4B;QAC5B,8BAA8B;QAC9B,6BAA6B;QAC7B,8BAA8B;QAC9B,+BAA+B;QAC/B,8BAA8B;QAC9B,qBAAqB;QACrB,qBAAqB;QACrB,yBAAyB;QACzB,sBAAsB;QACtB,uBAAuB;QACvB,wBAAwB;QACxB,yBAAyB;QAEzB,uBAAuB;QACvB,wBAAwB;QACxB,oBAAoB;QACpB,yBAAyB;QACzB,aAAa;QACb,qBAAqB;QAErB,yBAAyB;QACzB,iBAAiB;QACjB,uBAAuB;QAEvB,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,sBAAsB;QACtB,+BAA+B;QAC/B,kCAAkC;QAElC,kBAAkB;QAClB,wBAAwB;QACxB,4BAA4B;QAC5B,4BAA4B;QAC5B,kCAAkC;QAClC,mCAAmC;QACnC,yCAAyC;QACzC,8BAA8B;QAC9B,oCAAoC;QACpC,2BAA2B;QAC3B,iCAAiC;QACjC,4BAA4B;QAC5B,kCAAkC;QAClC,4BAA4B;QAC5B,mCAAmC;QACnC,mCAAmC;QAEnC,gBAAgB;QAChB,cAAc;QACd,oBAAoB;QACpB,oBAAoB;QACpB,iBAAiB;QACjB,uBAAuB;QACvB,qBAAqB;QACrB,6BAA6B;QAC7B,wBAAwB;QACxB,+BAA+B;QAC/B,8BAA8B;QAC9B,sBAAsB;QAEtB,yBAAyB;QACzB,gCAAgC;QAChC,gCAAgC;QAChC,gCAAgC;QAChC,uBAAuB;QACvB,kCAAkC;QAClC,4BAA4B;QAC5B,qBAAqB;QACrB,yBAAyB;QACzB,kBAAkB;QAClB,gBAAgB;QAChB,cAAc;QACd,gBAAgB;QAEhB,iBAAiB;QACjB,mBAAmB;QACnB,sBAAsB;QACtB,8BAA8B;QAE9B,yBAAyB;QACzB,uBAAuB;QAEvB,iBAAiB;QACjB,uBAAuB;QACvB,0BAA0B;QAC1B,uBAAuB;QACvB,sBAAsB;MACxB;IACF;EACF;;",
|
|
6
|
-
"names": ["Type", "translations", "componentsTranslations", "formTranslations", "meta", "Routine", "getTypename", "profile", "key"]
|
|
7
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/trigger-runtime-controller.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import * as Fiber from "effect/Fiber";
|
|
6
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
7
|
-
import { ServiceResolver } from "@dxos/compute";
|
|
8
|
-
import { Obj } from "@dxos/echo";
|
|
9
|
-
import { TriggerDispatcher } from "@dxos/functions-runtime";
|
|
10
|
-
import { log } from "@dxos/log";
|
|
11
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
12
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-routine/src/capabilities/trigger-runtime-controller.ts";
|
|
13
|
-
var LOCAL_ENVIRONMENT = "local";
|
|
14
|
-
var trigger_runtime_controller_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
15
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
16
|
-
const runtime = yield* Capability.get(Capabilities.ProcessManagerRuntime);
|
|
17
|
-
const trackers = /* @__PURE__ */ new Map();
|
|
18
|
-
const transition = (spaceId, environment) => runtime.runFork(Effect.gen(function* () {
|
|
19
|
-
const dispatcher = yield* TriggerDispatcher;
|
|
20
|
-
yield* environment === LOCAL_ENVIRONMENT ? dispatcher.start() : dispatcher.stop();
|
|
21
|
-
}).pipe(Effect.provide(ServiceResolver.provide({
|
|
22
|
-
space: spaceId
|
|
23
|
-
}, TriggerDispatcher)), Effect.tapErrorCause((cause) => Effect.sync(() => log.warn("trigger dispatcher transition failed", {
|
|
24
|
-
spaceId,
|
|
25
|
-
environment,
|
|
26
|
-
cause
|
|
27
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41, S: this })))));
|
|
28
|
-
const apply = (tracker, spaceId, environment) => {
|
|
29
|
-
if (tracker.lastEnvironment === environment) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
tracker.lastEnvironment = environment;
|
|
33
|
-
if (tracker.inFlight) {
|
|
34
|
-
runtime.runFork(Fiber.interrupt(tracker.inFlight));
|
|
35
|
-
}
|
|
36
|
-
tracker.inFlight = transition(spaceId, environment);
|
|
37
|
-
};
|
|
38
|
-
const install = (space) => {
|
|
39
|
-
if (trackers.has(space.id)) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const tracker = {
|
|
43
|
-
unsubscribe: () => {
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
trackers.set(space.id, tracker);
|
|
47
|
-
void space.waitUntilReady().then(() => {
|
|
48
|
-
if (trackers.get(space.id) !== tracker) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const readEnvironment = () => space.properties.computeEnvironment ?? LOCAL_ENVIRONMENT;
|
|
52
|
-
tracker.unsubscribe = Obj.subscribe(space.properties, () => apply(tracker, space.id, readEnvironment()));
|
|
53
|
-
apply(tracker, space.id, readEnvironment());
|
|
54
|
-
}).catch((err) => log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 76, S: this }));
|
|
55
|
-
};
|
|
56
|
-
const installAll = (spaces) => {
|
|
57
|
-
for (const space of spaces) {
|
|
58
|
-
install(space);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const spacesSubscription = client.spaces.subscribe(installAll);
|
|
62
|
-
installAll(client.spaces.get());
|
|
63
|
-
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => {
|
|
64
|
-
spacesSubscription.unsubscribe();
|
|
65
|
-
for (const tracker of trackers.values()) {
|
|
66
|
-
tracker.unsubscribe();
|
|
67
|
-
if (tracker.inFlight) {
|
|
68
|
-
runtime.runFork(Fiber.interrupt(tracker.inFlight));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
trackers.clear();
|
|
72
|
-
}));
|
|
73
|
-
}));
|
|
74
|
-
export {
|
|
75
|
-
trigger_runtime_controller_default as default
|
|
76
|
-
};
|
|
77
|
-
//# sourceMappingURL=trigger-runtime-controller-WIDDFGQT.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/trigger-runtime-controller.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { type ComputeEnvironment } from '@dxos/client-protocol';\nimport { ServiceResolver } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { TriggerDispatcher } from '@dxos/functions-runtime';\nimport { type SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { type Space } from '@dxos/react-client/echo';\n\n//\n// Capability Module\n//\n// Watches `space.properties.computeEnvironment` for every space and toggles\n// the per-space {@link TriggerDispatcher} accordingly:\n//\n// - `local` → `dispatcher.start()`\n// - `edge` / `disabled` → `dispatcher.stop()`\n//\n// Replaces the in-line watcher that used to live inside the removed\n// `compute-runtime.ts` per-space layer. The dispatcher itself is now\n// contributed unconditionally via `TriggerDispatcherSpec` in `layer-specs.ts`,\n// so this capability is only responsible for driving its lifecycle.\n//\n\n/** Trigger execution location the dispatcher should run locally. */\nconst LOCAL_ENVIRONMENT: ComputeEnvironment = 'local';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const runtime = yield* Capability.get(Capabilities.ProcessManagerRuntime);\n\n /** Per-space property-subscription unsubscribe, last-seen environment, and in-flight transition fiber. */\n type Tracker = {\n unsubscribe: () => void;\n lastEnvironment?: ComputeEnvironment;\n inFlight?: Fiber.RuntimeFiber<unknown, unknown>;\n };\n const trackers = new Map<SpaceId, Tracker>();\n\n /**\n * Resolve the per-space `TriggerDispatcher` from the process-manager\n * runtime and invoke `start()` / `stop()` according to the requested\n * environment. Returns a fiber so the caller can cancel a pending\n * transition when a new one supersedes it.\n */\n const transition = (spaceId: SpaceId, environment: ComputeEnvironment) =>\n runtime.runFork(\n Effect.gen(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* environment === LOCAL_ENVIRONMENT ? dispatcher.start() : dispatcher.stop();\n }).pipe(\n Effect.provide(ServiceResolver.provide({ space: spaceId }, TriggerDispatcher)),\n Effect.tapErrorCause((cause) =>\n Effect.sync(() => log.warn('trigger dispatcher transition failed', { spaceId, environment, cause })),\n ),\n ),\n );\n\n const apply = (tracker: Tracker, spaceId: SpaceId, environment: ComputeEnvironment): void => {\n if (tracker.lastEnvironment === environment) {\n return;\n }\n tracker.lastEnvironment = environment;\n if (tracker.inFlight) {\n runtime.runFork(Fiber.interrupt(tracker.inFlight));\n }\n tracker.inFlight = transition(spaceId, environment);\n };\n\n const install = (space: Space): void => {\n if (trackers.has(space.id)) {\n return;\n }\n // Reserve the slot synchronously so concurrent `client.spaces.subscribe`\n // notifications (e.g. spaces array churn while we await readiness) don't\n // wire a second subscriber for the same space.\n const tracker: Tracker = { unsubscribe: () => {} };\n trackers.set(space.id, tracker);\n\n void space\n .waitUntilReady()\n .then(() => {\n // The capability could have been torn down between `set` and the\n // promise resolving; bail out without subscribing in that case.\n if (trackers.get(space.id) !== tracker) {\n return;\n }\n const readEnvironment = (): ComputeEnvironment => space.properties.computeEnvironment ?? LOCAL_ENVIRONMENT;\n tracker.unsubscribe = Obj.subscribe(space.properties, () => apply(tracker, space.id, readEnvironment()));\n apply(tracker, space.id, readEnvironment());\n })\n .catch((err) => log.catch(err));\n };\n\n const installAll = (spaces: readonly Space[]): void => {\n for (const space of spaces) {\n install(space);\n }\n };\n\n const spacesSubscription = client.spaces.subscribe(installAll);\n installAll(client.spaces.get());\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n spacesSubscription.unsubscribe();\n for (const tracker of trackers.values()) {\n tracker.unsubscribe();\n if (tracker.inFlight) {\n runtime.runFork(Fiber.interrupt(tracker.inFlight));\n }\n }\n trackers.clear();\n }),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,cAAcC,kBAAkB;AAEzC,SAASC,uBAAuB;AAChC,SAASC,WAAW;AACpB,SAASC,yBAAyB;AAElC,SAASC,WAAW;AACpB,SAASC,0BAA0B;AAGnC,IAAE,eAAA;AAoBgE,IAAA,oBAAA;IAC9D,qCAAMC,WAAU,WAAsBP,kBAAaQ,aAAAA;AAQnD,QAAMC,SAAAA,OAAeC,WAAAA,IAAAA,mBAAAA,MAAAA;AAErB,QAAA,UAAA,OAAA,WAAA,IAAA,aAAA,qBAAA;;QAUM,aAAOC,CAAAA,SAAgBC,gBAAAA,QAAoBC,QAAgB,WAAKA,aAAWC;AAC1EC,UACDjB,aAAeI,OAAAA;AAA0Bc,WAAOC,gBAAAA,oBAAAA,WAAAA,MAAAA,IAAAA,WAAAA,KAAAA;EAAQ,CAAA,EAAGb,KAAAA,eAAAA,gBACpDc,QAAeC;;sBAC0DR,CAAAA,GAAAA,qBAAAA,CAAAA,UAAAA,YAAAA,MAAAA,IAAAA,KAAAA,wCAAAA;IAAaQ;IAAM;IAK1FC;EACTA,GAAAA,EAAAA,YAAQC,YAAoBV,GAAAA,cAAa,GAAA,IAAA,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;gBAC3C,CAAA,SAAA,SAAA,gBAAA;AACF,QAAA,QAAA,oBAAA,aAAA;AACAS;IACA;YACEb,kBAAsBe;AACxB,QAAA,QAAA,UAAA;AACAF,cAAQG,QAAWC,gBAAWP,QAASN,QAAAA,CAAAA;IACzC;AAEA,YAAMc,WAAWT,WAAAA,SAAAA,WAAAA;;kBAEb,CAAA,UAAA;AACF,QAAA,SAAA,IAAA,MAAA,EAAA,GAAA;AACA;IACA;AAEiD,UAAA,UAAA;MACjDP,aAAaO,MAAQ;MAAA;IAErB;aAGI,IAAA,MAAA,IAAA,OAAA;SACA,MAAA,eAAA,EAAA,KAAA,MAAA;AAGA,UAAA,SAAA,IAAA,MAAA,EAAA,MAAA,SAAA;AACA;MACAI;AACAM,YAAMN,kBAAiB,MAAEO,MAAAA,WAAAA,sBAAAA;AAE1BC,cAAOC,cAAkBA,IAAAA,UAAAA,MAAAA,YAAAA,MAAAA,MAAAA,SAAAA,MAAAA,IAAAA,gBAAAA,CAAAA,CAAAA;AAC9B,YAAA,SAAA,MAAA,IAAA,gBAAA,CAAA;IAEA,CAAA,EAAMC,MAAAA,CAAAA,QAAcC,IAAAA,MAAAA,KAAAA,QAAAA,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA,CAAAA;;qBAERf,CAAAA,WAAAA;AACV,eAAA,SAAA,QAAA;AACF,cAAA,KAAA;IAEA;EACAc;AAEA,QAAA,qBAAkBE,OAAYhC,OAAAA,UAAmB,UAC/CF;aACEmC,OAAAA,OAAAA,IAAmBC,CAAAA;oBACd,YAAiBzB,aAAS0B,MAAU,MAAA,MAAA,YAAA,MAAA;uBAC/BD,YAAW;eACfd,WAAQG,SAAU,OAAA,GAAA;cACpBhB,YAAgBR;AAClB,UAAA,QAAA,UAAA;AACF,gBAAA,QAAA,gBAAA,QAAA,QAAA,CAAA;MACAU;IACF;AAGJ,aAAA,MAAA;;;",
|
|
6
|
-
"names": ["Effect", "Fiber", "Capabilities", "Capability", "ServiceResolver", "Obj", "TriggerDispatcher", "log", "ClientCapabilities", "runtime", "ProcessManagerRuntime", "trackers", "Map", "environment", "LOCAL_ENVIRONMENT", "dispatcher", "stop", "pipe", "space", "spaceId", "tapErrorCause", "cause", "tracker", "lastEnvironment", "interrupt", "inFlight", "transition", "install", "apply", "readEnvironment", "catch", "err", "installAll", "spaces", "contributes", "spacesSubscription", "unsubscribe", "values"]
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationAction,
|
|
3
|
-
RoutineCapabilities_exports,
|
|
4
|
-
RoutineOperation_exports,
|
|
5
|
-
Routine_exports,
|
|
6
|
-
TriggerTemplate
|
|
7
|
-
} from "../chunk-R7J2MU2M.mjs";
|
|
8
|
-
import "../chunk-674LDIUJ.mjs";
|
|
9
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
10
|
-
export {
|
|
11
|
-
AutomationAction,
|
|
12
|
-
Routine_exports as Routine,
|
|
13
|
-
RoutineCapabilities_exports as RoutineCapabilities,
|
|
14
|
-
RoutineOperation_exports as RoutineOperation,
|
|
15
|
-
TriggerTemplate
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/navigation-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/trigger/create/queue.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAU/C,eAAO,MAAM,KAAK;;;;;;EAgEjB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/trigger/update/queue.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAU/C,eAAO,MAAM,KAAK;;;;;;;EAwCjB,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Atom } from '@effect-atom/atom-react';
|
|
2
|
-
import React, { type ReactNode } from 'react';
|
|
3
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
-
import { type ActionGraphProps } from '@dxos/react-ui-menu';
|
|
5
|
-
export type MasterDetailRecord = {
|
|
6
|
-
id: string;
|
|
7
|
-
};
|
|
8
|
-
/** A row's leading icon: same shape as {@link Obj.getIcon} — a Phosphor icon name and an optional hue. */
|
|
9
|
-
export type MasterDetailIcon = {
|
|
10
|
-
icon: string;
|
|
11
|
-
hue?: string;
|
|
12
|
-
};
|
|
13
|
-
/** A row's trailing adornment: a status icon with a tooltip label (e.g. a 'detached' warning badge). */
|
|
14
|
-
export type MasterDetailAdornment = {
|
|
15
|
-
icon: string;
|
|
16
|
-
label: string;
|
|
17
|
-
};
|
|
18
|
-
export type MasterDetailProps<T extends MasterDetailRecord> = ThemedClassName<{
|
|
19
|
-
items: readonly T[];
|
|
20
|
-
/** Currently highlighted row; `undefined` clears the selection (e.g. while a draft is active). */
|
|
21
|
-
selectedId?: string;
|
|
22
|
-
onSelect?: (id: string | undefined) => void;
|
|
23
|
-
/**
|
|
24
|
-
* Build the row's label reactively. Run inside an atom so it can subscribe to the item's state via `get`
|
|
25
|
-
* (e.g. the object's name) and update live when it changes.
|
|
26
|
-
*/
|
|
27
|
-
getLabel: (get: Atom.Context, item: T) => string;
|
|
28
|
-
/**
|
|
29
|
-
* Build the row's leading icon reactively. Run inside an atom so it can subscribe to the item's state via
|
|
30
|
-
* `get` (e.g. colour the icon by an `enabled` flag); returns the icon name and optional colour classes.
|
|
31
|
-
*/
|
|
32
|
-
getIcon?: (get: Atom.Context, item: T) => MasterDetailIcon | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Build the row's trailing adornment reactively (e.g. a status badge). Run inside an atom so it can subscribe
|
|
35
|
-
* to the item's state via `get`; returns a Phosphor icon name and a tooltip label, or `undefined` for none.
|
|
36
|
-
*/
|
|
37
|
-
getAdornment?: (get: Atom.Context, item: T) => MasterDetailAdornment | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Build the per-row overflow (three-dots) menu. Run inside each row's `useMenuBuilder`, so it should
|
|
40
|
-
* subscribe to that item's reactive state via `get` (e.g. an `enabled` flag) — the menu then updates live
|
|
41
|
-
* without re-rendering the whole list.
|
|
42
|
-
*/
|
|
43
|
-
getMenu?: (get: Atom.Context, item: T) => ActionGraphProps;
|
|
44
|
-
/** Message shown when there are no items. */
|
|
45
|
-
emptyLabel?: string;
|
|
46
|
-
/** Detail pane content (selected item's form, draft form, …); rendered below the list. */
|
|
47
|
-
detail?: ReactNode;
|
|
48
|
-
}>;
|
|
49
|
-
/** Selectable master list (with an optional per-row overflow menu) above a parent-supplied detail pane. */
|
|
50
|
-
export declare const MasterDetail: <T extends MasterDetailRecord>({ classNames, items, selectedId, onSelect, getLabel, getIcon, getAdornment, getMenu, emptyLabel, detail, }: MasterDetailProps<T>) => React.JSX.Element;
|
|
51
|
-
//# sourceMappingURL=MasterDetail.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MasterDetail.d.ts","sourceRoot":"","sources":["../../../../../src/components/MasterDetail/MasterDetail.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAuC,KAAK,eAAe,EAA2B,MAAM,gBAAgB,CAAC;AAEpH,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AAUlF,MAAM,MAAM,kBAAkB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,0GAA0G;AAC1G,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,wGAAwG;AACxG,MAAM,MAAM,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAIpE,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,kBAAkB,IAAI,eAAe,CAAC;IAC5E,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IACpB,kGAAkG;IAClG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACjD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,gBAAgB,GAAG,SAAS,CAAC;IACvE;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqB,GAAG,SAAS,CAAC;IACjF;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,gBAAgB,CAAC;IAC3D,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC,CAAC;AAEH,2GAA2G;AAC3G,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,kBAAkB,8GAWtD,iBAAiB,CAAC,CAAC,CAAC,sBAgCtB,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
render: () => React.JSX.Element;
|
|
6
|
-
decorators: import("@storybook/react").Decorator[];
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: string;
|
|
9
|
-
translations: import("i18next").Resource[];
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
export declare const Default: Story;
|
|
15
|
-
export declare const Empty: Story;
|
|
16
|
-
//# sourceMappingURL=MasterDetail.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MasterDetail.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/MasterDetail/MasterDetail.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AA8DxC,QAAA,MAAM,IAAI;;;;;;;;CAK2B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,KAAK,EAAE,KAiBnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/MasterDetail/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
|