@dxos/plugin-routine 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +105 -0
- package/PLUGIN.mdl +475 -0
- package/README.md +15 -0
- package/dist/lib/neutral/RoutineArticle-UNTMV4CC.mjs +95 -0
- package/dist/lib/neutral/RoutineArticle-UNTMV4CC.mjs.map +7 -0
- package/dist/lib/neutral/RoutineCompanion-ZZ6WMY7I.mjs +249 -0
- package/dist/lib/neutral/RoutineCompanion-ZZ6WMY7I.mjs.map +7 -0
- package/dist/lib/neutral/RoutinePlugin.mjs +10 -0
- package/dist/lib/neutral/RoutinePlugin.mjs.map +7 -0
- package/dist/lib/neutral/RoutinePlugin.node.mjs +1133 -0
- package/dist/lib/neutral/RoutinePlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/RoutinePlugin.workerd.mjs +36 -0
- package/dist/lib/neutral/RoutinePlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/RoutineSettings-ZJOM4F3S.mjs +48 -0
- package/dist/lib/neutral/RoutineSettings-ZJOM4F3S.mjs.map +7 -0
- package/dist/lib/neutral/RoutineTraceCompanion-5U6R7LJE.mjs +236 -0
- package/dist/lib/neutral/RoutineTraceCompanion-5U6R7LJE.mjs.map +7 -0
- package/dist/lib/neutral/SkillArticle-WWDNKW2Z.mjs +27 -0
- package/dist/lib/neutral/SkillArticle-WWDNKW2Z.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-FALWLZTI.mjs +90 -0
- package/dist/lib/neutral/app-graph-builder-FALWLZTI.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +25 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +19 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-674LDIUJ.mjs +9 -0
- package/dist/lib/neutral/chunk-674LDIUJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CNYAPXUW.mjs +65 -0
- package/dist/lib/neutral/chunk-CNYAPXUW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HLO4LYXT.mjs +44 -0
- package/dist/lib/neutral/chunk-HLO4LYXT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ODQDVFMZ.mjs +8 -0
- package/dist/lib/neutral/chunk-ODQDVFMZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-R7J2MU2M.mjs +263 -0
- package/dist/lib/neutral/chunk-R7J2MU2M.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WLNL77C7.mjs +14 -0
- package/dist/lib/neutral/chunk-WLNL77C7.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1921 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +17 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-V23KVDMJ.mjs +25 -0
- package/dist/lib/neutral/create-object-V23KVDMJ.mjs.map +7 -0
- package/dist/lib/neutral/create-routine-I67BYJA2.mjs +38 -0
- package/dist/lib/neutral/create-routine-I67BYJA2.mjs.map +7 -0
- package/dist/lib/neutral/create-trigger-from-template-U3KNS77V.mjs +70 -0
- package/dist/lib/neutral/create-trigger-from-template-U3KNS77V.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +47 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +27 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/layer-specs-ADQCTTRT.mjs +135 -0
- package/dist/lib/neutral/layer-specs-ADQCTTRT.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/navigation-resolver-KQIWUH6F.mjs +18 -0
- package/dist/lib/neutral/navigation-resolver-KQIWUH6F.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-QKLJSDCQ.mjs +13 -0
- package/dist/lib/neutral/operation-handler-QKLJSDCQ.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-GMO7I7YE.mjs +67 -0
- package/dist/lib/neutral/react-surface-GMO7I7YE.mjs.map +7 -0
- package/dist/lib/neutral/registry-sync-PHBU6CH2.mjs +86 -0
- package/dist/lib/neutral/registry-sync-PHBU6CH2.mjs.map +7 -0
- package/dist/lib/neutral/run-routine-HJWXIWLJ.mjs +37 -0
- package/dist/lib/neutral/run-routine-HJWXIWLJ.mjs.map +7 -0
- package/dist/lib/neutral/templates-IIUCEBAX.mjs +49 -0
- package/dist/lib/neutral/templates-IIUCEBAX.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +115 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/trigger-runtime-controller-7FOTH2NP.mjs +77 -0
- package/dist/lib/neutral/trigger-runtime-controller-7FOTH2NP.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +17 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/RoutinePlugin.d.ts +4 -0
- package/dist/types/src/RoutinePlugin.d.ts.map +1 -0
- package/dist/types/src/RoutinePlugin.node.d.ts +4 -0
- package/dist/types/src/RoutinePlugin.node.d.ts.map +1 -0
- package/dist/types/src/RoutinePlugin.test.d.ts +2 -0
- package/dist/types/src/RoutinePlugin.test.d.ts.map +1 -0
- package/dist/types/src/RoutinePlugin.workerd.d.ts +4 -0
- package/dist/types/src/RoutinePlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +5 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +5 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.test.d.ts +2 -0
- package/dist/types/src/capabilities/create-object.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +12 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/layer-specs.d.ts +5 -0
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +9 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
- package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
- package/dist/types/src/capabilities/templates.d.ts +5 -0
- package/dist/types/src/capabilities/templates.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts +2 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/index.d.ts +57 -0
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/list.d.ts +7 -0
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/options.d.ts +10 -0
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/remove.d.ts +8 -0
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts +13 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts +15 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts +13 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/util.d.ts +46 -0
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts +14 -0
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts.map +1 -0
- package/dist/types/src/components/CreateRoutinePanel/index.d.ts +2 -0
- package/dist/types/src/components/CreateRoutinePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts +16 -0
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts.map +1 -0
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts +17 -0
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/InstructionsEditor/index.d.ts +2 -0
- package/dist/types/src/components/InstructionsEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/MasterDetail/MasterDetail.d.ts +51 -0
- package/dist/types/src/components/MasterDetail/MasterDetail.d.ts.map +1 -0
- package/dist/types/src/components/MasterDetail/MasterDetail.stories.d.ts +16 -0
- package/dist/types/src/components/MasterDetail/MasterDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/MasterDetail/index.d.ts +2 -0
- package/dist/types/src/components/MasterDetail/index.d.ts.map +1 -0
- package/dist/types/src/components/RoutineForm/RoutineForm.d.ts +25 -0
- package/dist/types/src/components/RoutineForm/RoutineForm.d.ts.map +1 -0
- package/dist/types/src/components/RoutineForm/index.d.ts +2 -0
- package/dist/types/src/components/RoutineForm/index.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/Schedule.d.ts +80 -0
- package/dist/types/src/components/Schedule/Schedule.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/Schedule.stories.d.ts +23 -0
- package/dist/types/src/components/Schedule/Schedule.stories.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/cron.d.ts +44 -0
- package/dist/types/src/components/Schedule/cron.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/cron.test.d.ts +2 -0
- package/dist/types/src/components/Schedule/cron.test.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/index.d.ts +4 -0
- package/dist/types/src/components/Schedule/index.d.ts.map +1 -0
- package/dist/types/src/components/Schedule/types.d.ts +66 -0
- package/dist/types/src/components/Schedule/types.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +13 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +19 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +21 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +16 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/index.d.ts +2 -0
- package/dist/types/src/components/TemplateEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/types.d.ts +18 -0
- package/dist/types/src/components/TemplateEditor/types.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +24 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +25 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.d.ts +15 -0
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.stories.d.ts +15 -0
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.stories.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/index.d.ts +2 -0
- package/dist/types/src/components/TriggerEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +8 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +14 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +20 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts +17 -0
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.stories.d.ts +15 -0
- package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/RoutineCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineSettings/RoutineSettings.d.ts +10 -0
- package/dist/types/src/containers/RoutineSettings/RoutineSettings.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineSettings/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts +9 -0
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.d.ts +15 -0
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineTraceCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineTraceCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineTraceCompanion/runs.d.ts +34 -0
- package/dist/types/src/containers/RoutineTraceCompanion/runs.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineTraceCompanion/runs.test.d.ts +2 -0
- package/dist/types/src/containers/RoutineTraceCompanion/runs.test.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts +11 -0
- package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts.map +1 -0
- package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts +6 -0
- package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts.map +1 -0
- package/dist/types/src/containers/SkillArticle/index.d.ts +2 -0
- package/dist/types/src/containers/SkillArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +33 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/operations/create-routine.d.ts +5 -0
- package/dist/types/src/operations/create-routine.d.ts.map +1 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/run-routine.d.ts +5 -0
- package/dist/types/src/operations/run-routine.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts +5 -0
- package/dist/types/src/paths.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/index.d.ts +11 -0
- package/dist/types/src/templates/index.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +328 -0
- package/dist/types/src/testing/test-functions.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/Routine.d.ts +55 -0
- package/dist/types/src/types/Routine.d.ts.map +1 -0
- package/dist/types/src/types/Routine.test.d.ts +2 -0
- package/dist/types/src/types/Routine.test.d.ts.map +1 -0
- package/dist/types/src/types/RoutineCapabilities.d.ts +44 -0
- package/dist/types/src/types/RoutineCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/RoutineOperation.d.ts +45 -0
- package/dist/types/src/types/RoutineOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +5 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +33 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +3 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/routines-for-object.d.ts +22 -0
- package/dist/types/src/util/routines-for-object.d.ts.map +1 -0
- package/dist/types/src/util/routines-for-object.test.d.ts +2 -0
- package/dist/types/src/util/routines-for-object.test.d.ts.map +1 -0
- package/dist/types/src/util/run-instructions.d.ts +5 -0
- package/dist/types/src/util/run-instructions.d.ts.map +1 -0
- package/dist/types/src/util/run-instructions.test.d.ts +2 -0
- package/dist/types/src/util/run-instructions.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dx.config.ts +33 -0
- package/package.json +196 -0
- package/src/RoutinePlugin.node.ts +48 -0
- package/src/RoutinePlugin.test.ts +27 -0
- package/src/RoutinePlugin.tsx +58 -0
- package/src/RoutinePlugin.workerd.ts +24 -0
- package/src/capabilities/app-graph-builder.ts +80 -0
- package/src/capabilities/create-object.test.ts +18 -0
- package/src/capabilities/create-object.ts +26 -0
- package/src/capabilities/index.ts +22 -0
- package/src/capabilities/layer-specs.ts +190 -0
- package/src/capabilities/navigation-resolver.ts +21 -0
- package/src/capabilities/node.ts +19 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +66 -0
- package/src/capabilities/registry-sync.ts +114 -0
- package/src/capabilities/templates.ts +17 -0
- package/src/capabilities/trigger-runtime-controller.test.ts +107 -0
- package/src/capabilities/trigger-runtime-controller.ts +126 -0
- package/src/commands/index.ts +5 -0
- package/src/commands/trigger/create/index.ts +14 -0
- package/src/commands/trigger/create/queue.ts +87 -0
- package/src/commands/trigger/create/subscription.ts +126 -0
- package/src/commands/trigger/create/timer.ts +90 -0
- package/src/commands/trigger/index.ts +16 -0
- package/src/commands/trigger/list.ts +69 -0
- package/src/commands/trigger/options.ts +47 -0
- package/src/commands/trigger/remove.ts +45 -0
- package/src/commands/trigger/update/index.ts +14 -0
- package/src/commands/trigger/update/queue.ts +191 -0
- package/src/commands/trigger/update/subscription.ts +278 -0
- package/src/commands/trigger/update/timer.ts +194 -0
- package/src/commands/trigger/util.ts +412 -0
- package/src/components/CreateRoutinePanel/CreateRoutinePanel.tsx +68 -0
- package/src/components/CreateRoutinePanel/index.ts +5 -0
- package/src/components/InstructionsEditor/InstructionsEditor.stories.tsx +69 -0
- package/src/components/InstructionsEditor/InstructionsEditor.tsx +107 -0
- package/src/components/InstructionsEditor/index.ts +5 -0
- package/src/components/MasterDetail/MasterDetail.stories.tsx +100 -0
- package/src/components/MasterDetail/MasterDetail.tsx +175 -0
- package/src/components/MasterDetail/index.ts +5 -0
- package/src/components/RoutineForm/RoutineForm.tsx +293 -0
- package/src/components/RoutineForm/index.ts +5 -0
- package/src/components/Schedule/Schedule.stories.tsx +73 -0
- package/src/components/Schedule/Schedule.tsx +527 -0
- package/src/components/Schedule/cron.test.ts +230 -0
- package/src/components/Schedule/cron.ts +337 -0
- package/src/components/Schedule/index.ts +8 -0
- package/src/components/Schedule/types.ts +124 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +93 -0
- package/src/components/TemplateEditor/TemplateEditor.tsx +77 -0
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +76 -0
- package/src/components/TemplateEditor/TemplateForm.tsx +204 -0
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/TemplateEditor/index.ts +5 -0
- package/src/components/TemplateEditor/types.tsx +28 -0
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +122 -0
- package/src/components/TriggerEditor/TriggerEditor.tsx +365 -0
- package/src/components/TriggerEditor/TriggerKindSelector.stories.tsx +42 -0
- package/src/components/TriggerEditor/TriggerKindSelector.tsx +87 -0
- package/src/components/TriggerEditor/index.ts +5 -0
- package/src/components/index.ts +11 -0
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +146 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/RoutineCompanion/RoutineCompanion.stories.tsx +82 -0
- package/src/containers/RoutineCompanion/RoutineCompanion.tsx +342 -0
- package/src/containers/RoutineCompanion/index.ts +6 -0
- package/src/containers/RoutineSettings/RoutineSettings.tsx +65 -0
- package/src/containers/RoutineSettings/index.ts +5 -0
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.tsx +133 -0
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.tsx +125 -0
- package/src/containers/RoutineTraceCompanion/index.ts +5 -0
- package/src/containers/RoutineTraceCompanion/runs.test.ts +140 -0
- package/src/containers/RoutineTraceCompanion/runs.ts +135 -0
- package/src/containers/RoutineTraceCompanion/useRoutineRuns.ts +50 -0
- package/src/containers/SkillArticle/SkillArticle.tsx +29 -0
- package/src/containers/SkillArticle/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useTriggerRuntimeControls.ts +70 -0
- package/src/index.ts +7 -0
- package/src/meta.ts +9 -0
- package/src/operations/create-routine.ts +39 -0
- package/src/operations/create-trigger-from-template.ts +68 -0
- package/src/operations/index.ts +11 -0
- package/src/operations/run-routine.ts +45 -0
- package/src/paths.ts +18 -0
- package/src/plugin.ts +11 -0
- package/src/templates/index.ts +48 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/test-functions.ts +76 -0
- package/src/testing.ts +7 -0
- package/src/translations.ts +125 -0
- package/src/types/Routine.test.ts +51 -0
- package/src/types/Routine.ts +144 -0
- package/src/types/RoutineCapabilities.ts +51 -0
- package/src/types/RoutineOperation.ts +104 -0
- package/src/types/index.ts +9 -0
- package/src/types/schema.ts +31 -0
- package/src/util/index.ts +6 -0
- package/src/util/routines-for-object.test.ts +109 -0
- package/src/util/routines-for-object.ts +89 -0
- package/src/util/run-instructions.test.ts +23 -0
- package/src/util/run-instructions.ts +12 -0
- package/src/vite-env.d.ts +10 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/RoutinePlugin.tsx", "raw-loader:/Users/jdw/Code/dxos/packages/plugins/plugin-routine/PLUGIN.mdl"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { ActivationEvent, ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { Instructions, Operation, Trace, Trigger } from '@dxos/compute';\nimport { ClientEvents } from '@dxos/plugin-client';\n\nimport {\n AppGraphBuilder,\n CreateObject,\n LayerSpecs,\n NavigationResolver,\n OperationHandler,\n ReactSurface,\n RegistrySync,\n Templates,\n TriggerRuntimeController,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Routine } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const RoutinePlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addNavigationResolverModule({ activatesOn: ClientEvents.ClientReady, activate: NavigationResolver }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n AppPlugin.addSchemaModule({\n schema: [Routine.Routine, Operation.PersistentOperation, Instructions.Instructions, Trigger.Trigger, Trace.Message],\n }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n activatesOn: ClientEvents.ClientReady,\n firesBeforeActivation: [ActivationEvents.SetupProcessManager],\n activate: LayerSpecs,\n }),\n Plugin.addModule({\n activatesOn: ClientEvents.ClientReady,\n activate: RegistrySync,\n }),\n Plugin.addModule({ activatesOn: AppActivationEvents.SetupSchema, activate: Templates }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, ClientEvents.SpacesReady),\n activate: TriggerRuntimeController,\n }),\n Plugin.make,\n);\n\nexport default RoutinePlugin;\n", "---\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 space `computeEnvironment` is `edge`.\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 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [list view \u2014 triggers exist] \u2502\n \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502\n \u2502 \u2502 \u25CB fn-name [\u25B6] [\u2715] \u2502 \u2502\n \u2502 \u2502 \u25CF fn-name [\u21BA] [\u2715] \u2502 \u2502\n \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502\n \u2502 [+ New Trigger] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 [editor view \u2014 trigger selected] \u2502\n \u2502 Settings.Item \u2502\n \u2502 \u2514\u2500\u2500 TriggerEditor \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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 \u2192 Trigger.specTimer(cron)\n feed \u2192 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.computeEnvironment === \"local\"\n then: TriggerDispatcher starts for that space\n\n req F-2.2:\n when: space.properties.computeEnvironment === \"edge\" or \"disabled\"\n then: TriggerDispatcher stops for that space\n\n req F-2.3:\n when: computeEnvironment changes\n then: any in-flight dispatcher transition is cancelled before the new one starts\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 computeEnvironment !== \"disabled\"\n then: user can force-run the trigger immediately from AutomationPanel\n\n req F-3.2:\n when: computeEnvironment === \"local\"\n then: force-run invokes TriggerDispatcher.invokeTrigger directly in-process\n\n req F-3.3:\n when: computeEnvironment === \"edge\"\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, computeEnvironment = \"local\"\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 environment change\n given: space computeEnvironment = \"local\", dispatcher running\n when: space.properties.computeEnvironment changes to \"edge\"\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\", computeEnvironment = \"local\"\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 \u2014 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"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,iBAAiBC,kBAAkBC,cAAc;AAC1D,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,cAAcC,WAAWC,OAAOC,eAAe;AACxD,SAASC,oBAAoB;AAE7B,SACEC,iBACAC,cACAC,YACAC,oBACAC,kBACAC,cACAC,cACAC,WACAC,gCACK;AACP,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,eAAe;;;ACtBxB;;;AD2BO,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CC,UAAUC,kBAAkB;EAAEC,UAAUC;AAAgB,CAAA,GACxDH,UAAUI,sBAAsB;EAAEF,UAAUG;AAAa,CAAA,GACzDL,UAAUM,4BAA4B;EAAEC,aAAaC,aAAaC;EAAaP,UAAUQ;AAAmB,CAAA,GAC5GV,UAAUW,0BAA0B;EAAET,UAAUU;AAAiB,CAAA,GACjEZ,UAAUa,qBAAqB;EAC7BC,OAAO;IAAEC,UAAUjB,KAAKkB,QAAQC;IAAKC,MAAM;IAAcC,SAASC;IAAYC,UAAU;EAAoB;AAC9G,CAAA,GACArB,UAAUsB,gBAAgB;EACxBC,QAAQ;IAACC,QAAQA;IAASC,UAAUC;IAAqBC,aAAaA;IAAcC,QAAQA;IAASC,MAAMC;;AAC7G,CAAA,GACA9B,UAAU+B,iBAAiB;EAAE7B,UAAU8B;AAAa,CAAA,GACpDhC,UAAUiC,sBAAsB;EAAEC;AAAa,CAAA,GAC/CtC,OAAOuC,UAAU;EACf5B,aAAaC,aAAaC;EAC1B2B,uBAAuB;IAACC,iBAAiBC;;EACzCpC,UAAUqC;AACZ,CAAA,GACA3C,OAAOuC,UAAU;EACf5B,aAAaC,aAAaC;EAC1BP,UAAUsC;AACZ,CAAA,GACA5C,OAAOuC,UAAU;EAAE5B,aAAakC,oBAAoBC;EAAaxC,UAAUyC;AAAU,CAAA,GACrF/C,OAAOuC,UAAU;EACf5B,aAAaqC,gBAAgBC,MAAMR,iBAAiBS,qBAAqBtC,aAAauC,WAAW;EACjG7C,UAAU8C;AACZ,CAAA,GACApD,OAAOqD,IAAI;AAGb,IAAA,wBAAetD;",
|
|
6
|
+
"names": ["ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "Instructions", "Operation", "Trace", "Trigger", "ClientEvents", "AppGraphBuilder", "CreateObject", "LayerSpecs", "NavigationResolver", "OperationHandler", "ReactSurface", "RegistrySync", "Templates", "TriggerRuntimeController", "meta", "translations", "Routine", "RoutinePlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addCreateObjectModule", "CreateObject", "addNavigationResolverModule", "activatesOn", "ClientEvents", "ClientReady", "NavigationResolver", "addOperationHandlerModule", "OperationHandler", "addPluginAssetModule", "asset", "pluginId", "profile", "key", "path", "content", "pluginSpec", "mimeType", "addSchemaModule", "schema", "Routine", "Operation", "PersistentOperation", "Instructions", "Trigger", "Trace", "Message", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "firesBeforeActivation", "ActivationEvents", "SetupProcessManager", "LayerSpecs", "RegistrySync", "AppActivationEvents", "SetupSchema", "Templates", "ActivationEvent", "allOf", "ProcessManagerReady", "SpacesReady", "TriggerRuntimeController", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
|
|
4
|
+
// dx.config.ts
|
|
5
|
+
import { Config2 } from "@dxos/app-framework/config";
|
|
6
|
+
import { trim } from "@dxos/util";
|
|
7
|
+
var dx_config_default = Config2.make({
|
|
8
|
+
plugin: {
|
|
9
|
+
key: "org.dxos.plugin.routine",
|
|
10
|
+
name: "Routine",
|
|
11
|
+
author: "DXOS",
|
|
12
|
+
description: trim`
|
|
13
|
+
Event-driven workflow automation engine for DXOS Composer.
|
|
14
|
+
A Routine pairs a trigger ("when" — a timer schedule or an incoming feed) with an action
|
|
15
|
+
("then" — a persistent compute operation and instructions), enabling automated pipelines that
|
|
16
|
+
react to changes in real time without manual intervention.
|
|
17
|
+
|
|
18
|
+
Routines are configured in their own article and surfaced on a per-object "Routines" companion
|
|
19
|
+
that lists the routines connected to each object. A per-space TriggerDispatcher manages
|
|
20
|
+
execution: running locally in the browser when computeEnvironment is "local", or delegating to
|
|
21
|
+
the DXOS edge for server-side reliability; the space settings page chooses the runtime location.
|
|
22
|
+
|
|
23
|
+
Operation handlers and skills contributed by any plugin in the application are
|
|
24
|
+
automatically merged and made available to every space's OperationRegistry, so new
|
|
25
|
+
capabilities registered by other plugins become instantly invocable from routines.
|
|
26
|
+
`,
|
|
27
|
+
icon: {
|
|
28
|
+
key: "ph--atom--regular"
|
|
29
|
+
},
|
|
30
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-routine",
|
|
31
|
+
spec: "PLUGIN.mdl",
|
|
32
|
+
tags: [
|
|
33
|
+
"system"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// src/meta.ts
|
|
39
|
+
var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
meta
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=chunk-HLO4LYXT.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../dx.config.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.routine',\n name: 'Routine',\n author: 'DXOS',\n description: trim`\n Event-driven workflow automation engine for DXOS Composer.\n A Routine pairs a trigger (\"when\" — a timer schedule or an incoming feed) with an action\n (\"then\" — a persistent compute operation and instructions), enabling automated pipelines that\n react to changes in real time without manual intervention.\n\n Routines are configured in their own article and surfaced on a per-object \"Routines\" companion\n that lists the routines connected to each object. A per-space TriggerDispatcher manages\n execution: running locally in the browser when computeEnvironment is \"local\", or delegating to\n the DXOS edge for server-side reliability; the space settings page chooses the runtime location.\n\n Operation handlers and skills contributed by any plugin in the application are\n automatically merged and made available to every space's OperationRegistry, so new\n capabilities registered by other plugins become instantly invocable from routines.\n `,\n icon: { key: 'ph--atom--regular' },\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-routine',\n spec: 'PLUGIN.mdl',\n tags: ['system'],\n },\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;;;ACAvB,SAASC,eAAe;AACxB,SAASC,YAAY;AAErB,IAAA,oBAAeD,QAAQE,KAAK;EAC1BC,QAAQ;IACNC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,aAAaN;;;;;;;;;;;;;;;IAebO,MAAM;MAAEJ,KAAK;IAAoB;IACjCK,QAAQ;IACRC,MAAM;IACNC,MAAM;MAAC;;EACT;AACF,CAAA;;;ADxBO,IAAMC,OAAOC,OAAOC,kBAAkBC,iBAAAA;",
|
|
6
|
+
"names": ["Plugin", "Config2", "trim", "make", "plugin", "key", "name", "author", "description", "icon", "source", "spec", "tags", "meta", "Plugin", "getMetaFromConfig", "config"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// src/operations/index.ts
|
|
2
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
3
|
+
var RoutineOperationHandlerSet = OperationHandlerSet.lazy(() => import("./create-trigger-from-template-U3KNS77V.mjs"), () => import("./create-routine-I67BYJA2.mjs"), () => import("./run-routine-HJWXIWLJ.mjs"));
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
RoutineOperationHandlerSet
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=chunk-ODQDVFMZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const RoutineOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./create-trigger-from-template'),\n () => import('./create-routine'),\n () => import('./run-routine'),\n);\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,2BAA2B;AAE7B,IAAMC,6BAA6BD,oBAAoBE,KAC5D,MAAM,OAAO,6CAAA,GACb,MAAM,OAAO,+BAAA,GACb,MAAM,OAAO,4BAAA,CAAA;",
|
|
6
|
+
"names": ["OperationHandlerSet", "RoutineOperationHandlerSet", "lazy"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runInstructionsRef
|
|
3
|
+
} from "./chunk-674LDIUJ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
7
|
+
|
|
8
|
+
// src/types/schema.ts
|
|
9
|
+
import * as Schema from "effect/Schema";
|
|
10
|
+
import { Database } from "@dxos/echo";
|
|
11
|
+
import { meta } from "#meta";
|
|
12
|
+
var TriggerTemplate = Schema.Union(Schema.Struct({
|
|
13
|
+
type: Schema.Literal("timer"),
|
|
14
|
+
cron: Schema.String
|
|
15
|
+
}), Schema.Struct({
|
|
16
|
+
type: Schema.Literal("feed"),
|
|
17
|
+
feed: Schema.Any
|
|
18
|
+
}));
|
|
19
|
+
(function(AutomationAction2) {
|
|
20
|
+
class CreateTriggerFromTemplate2 extends Schema.TaggedClass()(`${meta.profile.key}.action.create-trigger-from-template`, {
|
|
21
|
+
input: Schema.Struct({
|
|
22
|
+
db: Database.Database,
|
|
23
|
+
template: TriggerTemplate,
|
|
24
|
+
enabled: Schema.optional(Schema.Boolean),
|
|
25
|
+
// TODO(wittjosiah): Improve how this lookup is done.
|
|
26
|
+
scriptName: Schema.optional(Schema.String),
|
|
27
|
+
input: Schema.optional(Schema.Record({
|
|
28
|
+
key: Schema.String,
|
|
29
|
+
value: Schema.Any
|
|
30
|
+
}))
|
|
31
|
+
}),
|
|
32
|
+
output: Schema.Void
|
|
33
|
+
}) {
|
|
34
|
+
}
|
|
35
|
+
AutomationAction2.CreateTriggerFromTemplate = CreateTriggerFromTemplate2;
|
|
36
|
+
})(AutomationAction || (AutomationAction = {}));
|
|
37
|
+
var AutomationAction;
|
|
38
|
+
|
|
39
|
+
// src/types/Routine.ts
|
|
40
|
+
var Routine_exports = {};
|
|
41
|
+
__export(Routine_exports, {
|
|
42
|
+
Kind: () => Kind,
|
|
43
|
+
Routine: () => Routine,
|
|
44
|
+
instanceOf: () => instanceOf,
|
|
45
|
+
instructionsRef: () => instructionsRef,
|
|
46
|
+
make: () => make,
|
|
47
|
+
runnableRef: () => runnableRef,
|
|
48
|
+
wireTriggers: () => wireTriggers
|
|
49
|
+
});
|
|
50
|
+
import * as Schema2 from "effect/Schema";
|
|
51
|
+
import { Instructions, Runnable, Trigger } from "@dxos/compute";
|
|
52
|
+
import { Annotation, DXN, Obj, Ref, Type } from "@dxos/echo";
|
|
53
|
+
import { LabelAnnotation } from "@dxos/echo/internal";
|
|
54
|
+
var Kinds = [
|
|
55
|
+
"runnable",
|
|
56
|
+
"instructions"
|
|
57
|
+
];
|
|
58
|
+
var Kind = Schema2.Literal(...Kinds);
|
|
59
|
+
var RunnableSpec = Schema2.Struct({
|
|
60
|
+
kind: Schema2.Literal("runnable"),
|
|
61
|
+
runnable: Ref.Ref(Runnable.Runnable)
|
|
62
|
+
});
|
|
63
|
+
var InstructionsSpec = Schema2.Struct({
|
|
64
|
+
kind: Schema2.Literal("instructions"),
|
|
65
|
+
instructions: Ref.Ref(Instructions.Instructions)
|
|
66
|
+
});
|
|
67
|
+
var RoutineSpec = Schema2.Union(RunnableSpec, InstructionsSpec);
|
|
68
|
+
var Routine = class extends Type.makeObject(DXN.make("org.dxos.type.routine", "0.2.0"))(Schema2.Struct({
|
|
69
|
+
name: Schema2.String.pipe(Schema2.optional),
|
|
70
|
+
description: Schema2.String.pipe(Schema2.optional),
|
|
71
|
+
/**
|
|
72
|
+
* The action to run: either an Operation (`spec.runnable`, bound directly) or the routine's own owned
|
|
73
|
+
* Instructions (`spec.instructions`). For an Operation action the trigger's `runnable` points at this
|
|
74
|
+
* Operation. For an Instructions action `spec.instructions` is the owned Instructions object (the operation
|
|
75
|
+
* is implicitly the static RunInstructions, so no separate operation ref is stored), and the trigger's
|
|
76
|
+
* `runnable` is RunInstructions with this instructions bound as its input.
|
|
77
|
+
*/
|
|
78
|
+
// TODO(burdon): Change to Array? Or handle that case with a ComputeGraph runnable.
|
|
79
|
+
spec: RoutineSpec.pipe(Schema2.optional),
|
|
80
|
+
/**
|
|
81
|
+
* Explicit membership, bi-directional with `trigger.runnable → runnable`. Required (not derived by query)
|
|
82
|
+
* because the runnable may be a shared registry operation referenced by multiple automations, which would
|
|
83
|
+
* conflate triggers. MVP enforces length <= 1.
|
|
84
|
+
*/
|
|
85
|
+
triggers: Schema2.Array(Ref.Ref(Trigger.Trigger))
|
|
86
|
+
}).pipe(LabelAnnotation.set([
|
|
87
|
+
"name"
|
|
88
|
+
]), Annotation.IconAnnotation.set({
|
|
89
|
+
icon: "ph--lightning--regular",
|
|
90
|
+
hue: "amber"
|
|
91
|
+
}))) {
|
|
92
|
+
};
|
|
93
|
+
var instanceOf = (value) => Obj.instanceOf(Routine, value);
|
|
94
|
+
var instructionsRef = (routine) => routine.spec?.kind === "instructions" ? routine.spec.instructions : void 0;
|
|
95
|
+
var runnableRef = (routine) => routine.spec?.kind === "runnable" ? routine.spec.runnable : void 0;
|
|
96
|
+
var withoutInstructions = (input) => {
|
|
97
|
+
if (!input || !("instructions" in input)) {
|
|
98
|
+
return input;
|
|
99
|
+
}
|
|
100
|
+
const { instructions: _drop, ...rest } = input;
|
|
101
|
+
return rest;
|
|
102
|
+
};
|
|
103
|
+
var wireTriggers = (routine) => {
|
|
104
|
+
const instructions = instructionsRef(routine);
|
|
105
|
+
const fn = instructions ? runInstructionsRef() : runnableRef(routine);
|
|
106
|
+
for (const ref of routine.triggers) {
|
|
107
|
+
const trigger = ref.target;
|
|
108
|
+
if (!trigger) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
Obj.update(trigger, (trigger2) => {
|
|
112
|
+
trigger2.runnable = fn;
|
|
113
|
+
const base = withoutInstructions(trigger2.input);
|
|
114
|
+
trigger2.input = instructions ? {
|
|
115
|
+
input: {},
|
|
116
|
+
...base,
|
|
117
|
+
instructions
|
|
118
|
+
} : base;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var make = ({ instructions, trigger, triggers = [], ...props }) => {
|
|
123
|
+
const routine = Obj.make(Routine, {
|
|
124
|
+
...props,
|
|
125
|
+
triggers
|
|
126
|
+
});
|
|
127
|
+
if (instructions) {
|
|
128
|
+
Obj.setParent(instructions, routine);
|
|
129
|
+
Obj.update(routine, (routine2) => {
|
|
130
|
+
routine2.spec = {
|
|
131
|
+
kind: "instructions",
|
|
132
|
+
instructions: Ref.make(instructions)
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (trigger) {
|
|
137
|
+
Obj.setParent(trigger, routine);
|
|
138
|
+
Obj.update(routine, (routine2) => {
|
|
139
|
+
routine2.triggers.push(Ref.make(trigger));
|
|
140
|
+
});
|
|
141
|
+
wireTriggers(routine);
|
|
142
|
+
}
|
|
143
|
+
return routine;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// src/types/RoutineCapabilities.ts
|
|
147
|
+
var RoutineCapabilities_exports = {};
|
|
148
|
+
__export(RoutineCapabilities_exports, {
|
|
149
|
+
AgentDelegationStrategy: () => AgentDelegationStrategy,
|
|
150
|
+
Template: () => Template
|
|
151
|
+
});
|
|
152
|
+
import { Capability } from "@dxos/app-framework";
|
|
153
|
+
var AgentDelegationStrategy = Capability.make("org.dxos.plugin.routine.capability.agentDelegationStrategy");
|
|
154
|
+
var Template = Capability.make("org.dxos.plugin.routine.capability.template");
|
|
155
|
+
|
|
156
|
+
// src/types/RoutineOperation.ts
|
|
157
|
+
var RoutineOperation_exports = {};
|
|
158
|
+
__export(RoutineOperation_exports, {
|
|
159
|
+
CreateRoutine: () => CreateRoutine,
|
|
160
|
+
CreateTriggerFromTemplate: () => CreateTriggerFromTemplate,
|
|
161
|
+
RunPromptInNewChat: () => RunPromptInNewChat,
|
|
162
|
+
RunRoutine: () => RunRoutine,
|
|
163
|
+
_EchoURIReference: () => _EchoURIReference
|
|
164
|
+
});
|
|
165
|
+
import * as Schema3 from "effect/Schema";
|
|
166
|
+
import { Capability as Capability2 } from "@dxos/app-framework";
|
|
167
|
+
import { Chat } from "@dxos/assistant-toolkit";
|
|
168
|
+
import { Instructions as Instructions2, Operation } from "@dxos/compute";
|
|
169
|
+
import { Database as Database2, DXN as DXN2, Obj as Obj2, Ref as Ref2, Type as Type2 } from "@dxos/echo";
|
|
170
|
+
import { EID as _EchoURIReference } from "@dxos/keys";
|
|
171
|
+
import { meta as meta2 } from "#meta";
|
|
172
|
+
var makeKey = (name) => DXN2.make(`${meta2.profile.key}.operation.${name}`);
|
|
173
|
+
var CreateTriggerFromTemplate = Operation.make({
|
|
174
|
+
meta: {
|
|
175
|
+
key: makeKey("createTriggerFromTemplate"),
|
|
176
|
+
name: "Create Trigger From Template",
|
|
177
|
+
icon: "ph--lightning--regular"
|
|
178
|
+
},
|
|
179
|
+
services: [
|
|
180
|
+
Capability2.Service
|
|
181
|
+
],
|
|
182
|
+
input: Schema3.Struct({
|
|
183
|
+
db: Database2.Database,
|
|
184
|
+
template: TriggerTemplate,
|
|
185
|
+
enabled: Schema3.optional(Schema3.Boolean),
|
|
186
|
+
scriptName: Schema3.optional(Schema3.String),
|
|
187
|
+
input: Schema3.optional(Schema3.Record({
|
|
188
|
+
key: Schema3.String,
|
|
189
|
+
value: Schema3.Any
|
|
190
|
+
}))
|
|
191
|
+
}),
|
|
192
|
+
output: Schema3.Void
|
|
193
|
+
});
|
|
194
|
+
var CreateRoutine = Operation.make({
|
|
195
|
+
meta: {
|
|
196
|
+
key: makeKey("createAutomation"),
|
|
197
|
+
name: "Create Routine",
|
|
198
|
+
icon: "ph--lightning--regular"
|
|
199
|
+
},
|
|
200
|
+
services: [
|
|
201
|
+
Capability2.Service
|
|
202
|
+
],
|
|
203
|
+
input: Schema3.Struct({
|
|
204
|
+
db: Database2.Database,
|
|
205
|
+
templateId: Schema3.String,
|
|
206
|
+
name: Schema3.optional(Schema3.String),
|
|
207
|
+
subject: Schema3.optional(Obj2.Unknown)
|
|
208
|
+
}),
|
|
209
|
+
output: Schema3.Struct({
|
|
210
|
+
id: Schema3.String,
|
|
211
|
+
subject: Schema3.Array(Schema3.String),
|
|
212
|
+
object: Obj2.Unknown
|
|
213
|
+
})
|
|
214
|
+
});
|
|
215
|
+
var RunPromptInNewChat = Operation.make({
|
|
216
|
+
meta: {
|
|
217
|
+
key: makeKey("runPromptInNewChat"),
|
|
218
|
+
name: "Run Prompt In New Chat",
|
|
219
|
+
icon: "ph--chat-text--regular"
|
|
220
|
+
},
|
|
221
|
+
services: [
|
|
222
|
+
Capability2.Service
|
|
223
|
+
],
|
|
224
|
+
input: Schema3.Struct({
|
|
225
|
+
db: Database2.Database,
|
|
226
|
+
/** Context objects to bind to the new chat. */
|
|
227
|
+
objects: Schema3.optional(Schema3.Array(Obj2.Unknown)),
|
|
228
|
+
/** Skill keys to look up and bind to the new chat. */
|
|
229
|
+
skills: Schema3.optional(Schema3.Array(Schema3.String)),
|
|
230
|
+
/** Raw instructions or an existing Routine object reference. */
|
|
231
|
+
instructions: Schema3.Union(Schema3.String, Ref2.Ref(Instructions2.Instructions)),
|
|
232
|
+
/**
|
|
233
|
+
* When true, skips opening the chat: runs the Agent prompt operation against the new chat via the compute runtime (traced).
|
|
234
|
+
*/
|
|
235
|
+
background: Schema3.optional(Schema3.Boolean)
|
|
236
|
+
}),
|
|
237
|
+
output: Schema3.Struct({
|
|
238
|
+
object: Type2.getSchema(Chat.Chat)
|
|
239
|
+
})
|
|
240
|
+
});
|
|
241
|
+
var RunRoutine = Operation.make({
|
|
242
|
+
meta: {
|
|
243
|
+
key: makeKey("runAutomation"),
|
|
244
|
+
name: "Run Routine",
|
|
245
|
+
icon: "ph--play--regular"
|
|
246
|
+
},
|
|
247
|
+
services: [
|
|
248
|
+
Capability2.Service
|
|
249
|
+
],
|
|
250
|
+
input: Schema3.Struct({
|
|
251
|
+
routine: Ref2.Ref(Routine)
|
|
252
|
+
}),
|
|
253
|
+
output: Schema3.Void
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
export {
|
|
257
|
+
TriggerTemplate,
|
|
258
|
+
AutomationAction,
|
|
259
|
+
Routine_exports,
|
|
260
|
+
RoutineCapabilities_exports,
|
|
261
|
+
RoutineOperation_exports
|
|
262
|
+
};
|
|
263
|
+
//# sourceMappingURL=chunk-R7J2MU2M.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/schema.ts", "../../../src/types/Routine.ts", "../../../src/types/RoutineCapabilities.ts", "../../../src/types/RoutineOperation.ts"],
|
|
4
|
+
"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({ key: Schema.String, value: Schema.Any })),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Instructions, Runnable, Trigger } from '@dxos/compute';\n// Operation is imported so TypeScript can name Operation.PersistentOperation in the emitted .d.ts\n// (Runnable is an alias for Operation.PersistentOperation, so Routine's class type references it).\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport { Operation } from '@dxos/compute';\nimport { Annotation, DXN, Obj, Ref, Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo/internal';\n\nimport { runInstructionsRef } from '../util/run-instructions';\n\nconst Kinds = ['runnable', 'instructions'] as const;\nexport const Kind = Schema.Literal(...Kinds);\nexport type Kind = (typeof Kinds)[number];\n\nconst RunnableSpec = Schema.Struct({\n kind: Schema.Literal('runnable'),\n runnable: Ref.Ref(Runnable.Runnable),\n});\n\nconst InstructionsSpec = Schema.Struct({\n kind: Schema.Literal('instructions'),\n instructions: Ref.Ref(Instructions.Instructions),\n});\n\nconst RoutineSpec = Schema.Union(RunnableSpec, InstructionsSpec);\n\n/**\n * User-facing routine: a thin aggregate of an action (`runnable`) and the triggers that fire it.\n * App-level only — EDGE stays unaware of it (triggers point directly at the runnable).\n */\nexport class Routine extends Type.makeObject<Routine>(DXN.make('org.dxos.type.routine', '0.2.0'))(\n Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n description: Schema.String.pipe(Schema.optional),\n\n /**\n * The action to run: either an Operation (`spec.runnable`, bound directly) or the routine's own owned\n * Instructions (`spec.instructions`). For an Operation action the trigger's `runnable` points at this\n * Operation. For an Instructions action `spec.instructions` is the owned Instructions object (the operation\n * is implicitly the static RunInstructions, so no separate operation ref is stored), and the trigger's\n * `runnable` is RunInstructions with this instructions bound as its input.\n */\n // TODO(burdon): Change to Array? Or handle that case with a ComputeGraph runnable.\n spec: RoutineSpec.pipe(Schema.optional),\n\n /**\n * Explicit membership, bi-directional with `trigger.runnable → runnable`. Required (not derived by query)\n * because the runnable may be a shared registry operation referenced by multiple automations, which would\n * conflate triggers. MVP enforces length <= 1.\n */\n triggers: Schema.Array(Ref.Ref(Trigger.Trigger)),\n }).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--lightning--regular', hue: 'amber' }),\n ),\n) {}\n\n/** Returns true when value is a Routine object. */\nexport const instanceOf = (value: unknown): value is Routine => Obj.instanceOf(Routine, value);\n\n/**\n * The owned Instructions ref of an instructions-action routine, or undefined for an operation action.\n * Classification is explicit in `spec.kind`, so this needs no `.target` dereference; callers resolve the ref\n * reactively (`useObject`) or asynchronously (`Database.load`) as appropriate.\n */\nexport const instructionsRef = (routine: Pick<Routine, 'spec'>): Ref.Ref<Instructions.Instructions> | undefined =>\n routine.spec?.kind === 'instructions' ? routine.spec.instructions : undefined;\n\n/** The Operation (runnable) ref of an operation-action routine, or undefined for an instructions action. */\nexport const runnableRef = (routine: Pick<Routine, 'spec'>): Ref.Ref<Runnable.Runnable> | undefined =>\n routine.spec?.kind === 'runnable' ? routine.spec.runnable : undefined;\n\n/** Strip a stale `instructions` binding from a trigger input. */\nconst withoutInstructions = (input: Record<string, unknown> | undefined): Record<string, unknown> | undefined => {\n if (!input || !('instructions' in input)) {\n return input;\n }\n const { instructions: _drop, ...rest } = input;\n return rest;\n};\n\n/**\n * Wire the routine's owned triggers to dispatch its current action (`spec`): an instructions action sets each\n * trigger's `runnable` to RunInstructions with the owned instructions bound into `input`; an operation action\n * binds the operation directly and drops any stale instructions binding. Call after the action (`spec`) changes\n * so a trigger never keeps a binding for the previous action.\n */\nexport const wireTriggers = (routine: Routine): void => {\n const instructions = instructionsRef(routine);\n const fn = instructions ? runInstructionsRef() : runnableRef(routine);\n for (const ref of routine.triggers) {\n const trigger = ref.target;\n if (!trigger) {\n continue;\n }\n Obj.update(trigger, (trigger) => {\n trigger.runnable = fn;\n const base = withoutInstructions(trigger.input);\n trigger.input = instructions ? { input: {}, ...base, instructions } : base;\n });\n }\n};\n\n/**\n * Creates a fully-wired in-memory routine graph. `instructions` and `trigger` are optional extras beyond the\n * schema fields: when provided they are parented under the routine and wired together (runnable, trigger\n * runnable, the trigger's instructions input binding, and the `triggers` ref) so that a single `Database.add`\n * cascades the whole graph. `triggers` defaults to `[]` so callers that supply a `trigger` need not provide it.\n */\nexport const make = ({\n instructions,\n trigger,\n triggers = [],\n ...props\n}: Omit<Obj.MakeProps<typeof Routine>, 'triggers'> & {\n triggers?: ReadonlyArray<Ref.Ref<Trigger.Trigger>>;\n instructions?: Instructions.Instructions;\n trigger?: Trigger.Trigger;\n}): Routine => {\n const routine = Obj.make(Routine, { ...props, triggers });\n if (instructions) {\n Obj.setParent(instructions, routine);\n Obj.update(routine, (routine) => {\n routine.spec = { kind: 'instructions', instructions: Ref.make(instructions) };\n });\n }\n if (trigger) {\n Obj.setParent(trigger, routine);\n Obj.update(routine, (routine) => {\n routine.triggers.push(Ref.make(trigger));\n });\n // Wire the trigger's `runnable`/`input` from the action (`spec`); preserves any template-provided input.\n wireTriggers(routine);\n }\n return routine;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport type { Database, Obj } from '@dxos/echo';\nimport type { DelegationStrategy } from '@dxos/functions-runtime';\n\nimport * as Routine from './Routine';\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 */\nexport const AgentDelegationStrategy = Capability.make<DelegationStrategy>(\n 'org.dxos.plugin.routine.capability.agentDelegationStrategy',\n);\n\n/**\n * An automation template contributed by a plugin. The create dialog and the per-object \"Automations\"\n * companion list contributed templates (`Capability.getAll(RoutineCapabilities.Template)`) and run the\n * chosen template's `scaffold` to build the automation.\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 /**\n * Whether this template applies to the given companion subject. The subject is the object whose\n * \"Automations\" companion is open, or undefined in the global create dialog. Templates that need a\n * specific subject (e.g. a feed-bearing Mailbox) gate themselves here. Defaults to always-applies.\n */\n appliesTo?: (subject?: Obj.Unknown) => boolean;\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 `Routine.make`. 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). `subject` is set\n * when scaffolding from an object's companion.\n */\n scaffold: (ctx: { name?: string; subject?: Obj.Unknown }) => Effect.Effect<Routine.Routine, Error, Database.Service>;\n};\n\nexport const Template = Capability.make<Template>('org.dxos.plugin.routine.capability.template');\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Chat } from '@dxos/assistant-toolkit';\nimport { Instructions, Operation } from '@dxos/compute';\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 { meta } from '#meta';\n\nimport * as Routine from './Routine';\nimport { TriggerTemplate } from './schema';\nexport { _EchoURIReference };\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const CreateTriggerFromTemplate = Operation.make({\n meta: {\n key: makeKey('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({ key: Schema.String, value: 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: makeKey('createAutomation'),\n name: 'Create Routine',\n icon: 'ph--lightning--regular',\n },\n services: [Capability.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 }),\n output: Schema.Struct({\n id: Schema.String,\n subject: Schema.Array(Schema.String),\n object: Obj.Unknown,\n }),\n});\n\nexport const RunPromptInNewChat = Operation.make({\n meta: {\n key: makeKey('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 `runnable` directly (bypassing its triggers). The runnable receives no input;\n// the trigger-driven path is what supplies event-mapped input, so manual runs target runnables that\n// need none.\nexport const RunRoutine = Operation.make({\n meta: {\n key: makeKey('runAutomation'),\n name: 'Run Routine',\n icon: 'ph--play--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n routine: Ref.Ref(Routine.Routine),\n }),\n output: Schema.Void,\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Schema", "Database", "meta", "TriggerTemplate", "Union", "Struct", "type", "Literal", "cron", "String", "feed", "Any", "AutomationAction", "CreateTriggerFromTemplate", "TaggedClass", "profile", "key", "input", "db", "template", "enabled", "optional", "Boolean", "scriptName", "Record", "value", "output", "Void", "Schema", "Instructions", "Runnable", "Trigger", "Annotation", "DXN", "Obj", "Ref", "Type", "LabelAnnotation", "Kinds", "Kind", "Literal", "RunnableSpec", "Struct", "kind", "runnable", "Ref", "Runnable", "InstructionsSpec", "instructions", "Instructions", "RoutineSpec", "Union", "Routine", "Type", "makeObject", "DXN", "make", "name", "String", "pipe", "optional", "description", "spec", "triggers", "Array", "Trigger", "LabelAnnotation", "set", "Annotation", "IconAnnotation", "icon", "hue", "instanceOf", "value", "Obj", "instructionsRef", "routine", "undefined", "runnableRef", "withoutInstructions", "input", "_drop", "rest", "wireTriggers", "fn", "runInstructionsRef", "ref", "trigger", "target", "update", "base", "props", "setParent", "push", "Capability", "AgentDelegationStrategy", "make", "Template", "Schema", "Capability", "Chat", "Instructions", "Operation", "Database", "DXN", "Obj", "Ref", "Type", "EID", "_EchoURIReference", "meta", "makeKey", "name", "DXN", "make", "meta", "profile", "key", "CreateTriggerFromTemplate", "Operation", "icon", "services", "Capability", "Service", "input", "Struct", "db", "Database", "template", "TriggerTemplate", "enabled", "optional", "Boolean", "scriptName", "String", "Record", "value", "Any", "output", "Void", "CreateRoutine", "templateId", "subject", "Obj", "Unknown", "id", "Array", "object", "RunPromptInNewChat", "objects", "skills", "instructions", "Union", "Ref", "Instructions", "background", "Type", "getSchema", "Chat", "RunRoutine", "routine", "Routine"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/paths.ts
|
|
2
|
+
import { Paths } from "@dxos/app-toolkit";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
import { Routine } from "#types";
|
|
5
|
+
var { getSectionPath: getRoutinesPath } = Paths.createTypeSectionPaths(Routine.Routine, {
|
|
6
|
+
groupId: Paths.GroupSegments.ai
|
|
7
|
+
});
|
|
8
|
+
var getRoutinesSettingsPath = (spaceId) => Paths.getSpacePath(spaceId, "settings", `${meta.profile.key}.routines`);
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
getRoutinesPath,
|
|
12
|
+
getRoutinesSettingsPath
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-WLNL77C7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/paths.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Paths } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\nimport { Routine } from '#types';\n\nconst { getSectionPath: getRoutinesPath } = Paths.createTypeSectionPaths(Routine.Routine, {\n groupId: Paths.GroupSegments.ai,\n});\n\n/** Path to the routines settings section for a given space. */\nexport const getRoutinesSettingsPath = (spaceId: string): string =>\n Paths.getSpacePath(spaceId, 'settings', `${meta.profile.key}.routines`);\n\nexport { getRoutinesPath };\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,aAAa;AAEtB,SAASC,YAAY;AACrB,SAASC,eAAe;AAExB,IAAM,EAAEC,gBAAgBC,gBAAe,IAAKJ,MAAMK,uBAAuBH,QAAQA,SAAS;EACxFI,SAASN,MAAMO,cAAcC;AAC/B,CAAA;AAGO,IAAMC,0BAA0B,CAACC,YACtCV,MAAMW,aAAaD,SAAS,YAAY,GAAGT,KAAKW,QAAQC,GAAG,WAAW;",
|
|
6
|
+
"names": ["Paths", "meta", "Routine", "getSectionPath", "getRoutinesPath", "createTypeSectionPaths", "groupId", "GroupSegments", "ai", "getRoutinesSettingsPath", "spaceId", "getSpacePath", "profile", "key"]
|
|
7
|
+
}
|