@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,70 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import type * as Context from 'effect/Context';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { useSpaceCallback } from '@dxos/app-framework/ui';
|
|
11
|
+
import { Trigger } from '@dxos/compute';
|
|
12
|
+
import { type Database, Filter, Query } from '@dxos/echo';
|
|
13
|
+
import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
|
|
14
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
15
|
+
|
|
16
|
+
interface TriggerRuntimeControls {
|
|
17
|
+
triggers: Trigger.Trigger[];
|
|
18
|
+
state: TriggerDispatcherState | undefined;
|
|
19
|
+
start: () => void;
|
|
20
|
+
stop: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
|
|
24
|
+
const triggers = useQuery(
|
|
25
|
+
db,
|
|
26
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-routine.useTriggerRuntimeControls'),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
|
|
30
|
+
|
|
31
|
+
const init = useSpaceCallback(
|
|
32
|
+
db?.spaceId,
|
|
33
|
+
[TriggerDispatcher],
|
|
34
|
+
Effect.fnUntraced(function* () {
|
|
35
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
36
|
+
setDispatcher(dispatcher);
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
void init();
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));
|
|
45
|
+
|
|
46
|
+
const start = useSpaceCallback(
|
|
47
|
+
db?.spaceId,
|
|
48
|
+
[TriggerDispatcher],
|
|
49
|
+
Effect.fnUntraced(function* () {
|
|
50
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
51
|
+
yield* dispatcher.start();
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const stop = useSpaceCallback(
|
|
56
|
+
db?.spaceId,
|
|
57
|
+
[TriggerDispatcher],
|
|
58
|
+
Effect.fnUntraced(function* () {
|
|
59
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
60
|
+
yield* dispatcher.stop();
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
triggers,
|
|
66
|
+
state,
|
|
67
|
+
start: () => void start(),
|
|
68
|
+
stop: () => void stop(),
|
|
69
|
+
};
|
|
70
|
+
};
|
package/src/index.ts
ADDED
package/src/meta.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database } from '@dxos/echo';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
12
|
+
|
|
13
|
+
import { getRoutinesPath } from '../paths';
|
|
14
|
+
import { RoutineCapabilities, RoutineOperation } from '../types';
|
|
15
|
+
|
|
16
|
+
const handler: Operation.WithHandler<typeof RoutineOperation.CreateRoutine> = RoutineOperation.CreateRoutine.pipe(
|
|
17
|
+
Operation.withHandler(
|
|
18
|
+
Effect.fnUntraced(function* ({ db, templateId, name, subject }) {
|
|
19
|
+
const templates = yield* Capability.getAll(RoutineCapabilities.Template);
|
|
20
|
+
const template = templates.find((entry) => entry.id === templateId);
|
|
21
|
+
invariant(template, `Unknown routine template: ${templateId}`);
|
|
22
|
+
|
|
23
|
+
// The scaffold returns a fully-wired in-memory routine graph (runnable, owned instructions, and trigger
|
|
24
|
+
// all parented and bound by `Routine.make`); AddObject's `Database.add` cascades the whole graph.
|
|
25
|
+
const draft = yield* template
|
|
26
|
+
.scaffold({ name, subject })
|
|
27
|
+
.pipe(Effect.provideService(Database.Service, Database.makeService(db)));
|
|
28
|
+
|
|
29
|
+
const targetNodeId = getRoutinesPath(db.spaceId);
|
|
30
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
31
|
+
object: draft,
|
|
32
|
+
target: db,
|
|
33
|
+
targetNodeId,
|
|
34
|
+
});
|
|
35
|
+
}),
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export default handler;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { LayoutOperation, Paths } from '@dxos/app-toolkit';
|
|
8
|
+
import { Operation, Script, Trigger } from '@dxos/compute';
|
|
9
|
+
import { type Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
|
|
12
|
+
import { getRoutinesSettingsPath } from '../paths';
|
|
13
|
+
import { RoutineOperation } from '../types';
|
|
14
|
+
|
|
15
|
+
const handler: Operation.WithHandler<typeof RoutineOperation.CreateTriggerFromTemplate> =
|
|
16
|
+
RoutineOperation.CreateTriggerFromTemplate.pipe(
|
|
17
|
+
Operation.withHandler(
|
|
18
|
+
Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
19
|
+
const trigger = Trigger.make({ enabled, input });
|
|
20
|
+
|
|
21
|
+
// TODO(wittjosiah): Factor out operation lookup by script name?
|
|
22
|
+
if (scriptName) {
|
|
23
|
+
const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, { name: scriptName })).run());
|
|
24
|
+
const [script] = scripts;
|
|
25
|
+
if (script) {
|
|
26
|
+
const operations = yield* Effect.promise(() =>
|
|
27
|
+
db.query(Filter.type(Operation.PersistentOperation, { source: Ref.make(script) })).run(),
|
|
28
|
+
);
|
|
29
|
+
const [operation] = operations;
|
|
30
|
+
if (operation) {
|
|
31
|
+
Obj.update(trigger, (trigger) => {
|
|
32
|
+
trigger.runnable = Ref.make(operation);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
switch (template.type) {
|
|
39
|
+
case 'timer': {
|
|
40
|
+
Obj.update(trigger, (trigger) => {
|
|
41
|
+
trigger.spec = Trigger.specTimer(template.cron);
|
|
42
|
+
});
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case 'feed': {
|
|
46
|
+
Obj.update(trigger, (trigger) => {
|
|
47
|
+
trigger.spec = Trigger.specFeed(template.feed as Feed.Feed);
|
|
48
|
+
});
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
default: {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
57
|
+
object: trigger,
|
|
58
|
+
target: db,
|
|
59
|
+
});
|
|
60
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
61
|
+
subject: [getRoutinesSettingsPath(db.spaceId)],
|
|
62
|
+
workspace: Paths.getSpacePath(db.spaceId),
|
|
63
|
+
});
|
|
64
|
+
}),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export default handler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
|
+
|
|
7
|
+
export const RoutineOperationHandlerSet = OperationHandlerSet.lazy(
|
|
8
|
+
() => import('./create-trigger-from-template'),
|
|
9
|
+
() => import('./create-routine'),
|
|
10
|
+
() => import('./run-routine'),
|
|
11
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { RunInstructions } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Obj } from '@dxos/echo';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
|
+
|
|
12
|
+
import { RoutineOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
// A routine's action is its `runnable`: either an Operation (invoked directly) or the routine's owned
|
|
15
|
+
// Instructions object (run as a background process — the same path triggers use — without creating a new
|
|
16
|
+
// Chat session object).
|
|
17
|
+
const handler: Operation.WithHandler<typeof RoutineOperation.RunRoutine> = RoutineOperation.RunRoutine.pipe(
|
|
18
|
+
Operation.withHandler(
|
|
19
|
+
Effect.fnUntraced(function* ({ routine }) {
|
|
20
|
+
const routineObj = yield* Database.load(routine);
|
|
21
|
+
const db = Obj.getDatabase(routineObj);
|
|
22
|
+
invariant(db, 'Routine is not attached to a database.');
|
|
23
|
+
|
|
24
|
+
// The action kind is explicit in `spec`; dispatch by kind rather than dereferencing to classify.
|
|
25
|
+
const spec = routineObj.spec;
|
|
26
|
+
if (spec?.kind === 'instructions') {
|
|
27
|
+
// The instructions carry their own context objects and skills; RunInstructions binds them when it
|
|
28
|
+
// executes. No Chat session object is created — the run appears in the process monitor only.
|
|
29
|
+
yield* Operation.schedule(
|
|
30
|
+
RunInstructions,
|
|
31
|
+
{ instructions: spec.instructions, input: {} },
|
|
32
|
+
{ spaceId: db.spaceId },
|
|
33
|
+
);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
invariant(spec?.kind === 'runnable', 'Routine has no action to run.');
|
|
38
|
+
const operation = yield* Database.load(spec.runnable);
|
|
39
|
+
invariant(Obj.instanceOf(Operation.PersistentOperation, operation), 'Routine has no action to run.');
|
|
40
|
+
yield* Operation.invoke(Operation.deserialize(operation));
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export default handler;
|
package/src/paths.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Paths } from '@dxos/app-toolkit';
|
|
6
|
+
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
import { Routine } from '#types';
|
|
9
|
+
|
|
10
|
+
const { getSectionPath: getRoutinesPath } = Paths.createTypeSectionPaths(Routine.Routine, {
|
|
11
|
+
groupId: Paths.GroupSegments.ai,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/** Path to the routines settings section for a given space. */
|
|
15
|
+
export const getRoutinesSettingsPath = (spaceId: string): string =>
|
|
16
|
+
Paths.getSpacePath(spaceId, 'settings', `${meta.profile.key}.routines`);
|
|
17
|
+
|
|
18
|
+
export { getRoutinesPath };
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const RoutinePlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { RoutineOperationHandlerSet } from './operations';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
|
|
8
|
+
import { AppAnnotation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Instructions, Skill, Trigger } from '@dxos/compute';
|
|
10
|
+
import { Obj, Ref, Type } from '@dxos/echo';
|
|
11
|
+
|
|
12
|
+
import { Routine, type RoutineCapabilities } from '#types';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Blank template: an instructions-action routine draft with an empty trigger; the action kind, schedule, and
|
|
16
|
+
* body are configured in the form. In an object companion the instructions are seeded with the subject (in
|
|
17
|
+
* `objects`) and its type's skills so the draft starts associated with the subject; the global create dialog
|
|
18
|
+
* (no subject) starts with bare instructions.
|
|
19
|
+
*/
|
|
20
|
+
export const blank: RoutineCapabilities.Template = {
|
|
21
|
+
id: 'org.dxos.routine.blank',
|
|
22
|
+
label: 'Blank',
|
|
23
|
+
icon: 'ph--lightning--regular',
|
|
24
|
+
scaffold: ({ name, subject }) =>
|
|
25
|
+
Effect.succeed(
|
|
26
|
+
Routine.make({
|
|
27
|
+
name,
|
|
28
|
+
instructions: Instructions.make({
|
|
29
|
+
skills: subject ? skillRefsForObject(subject) : [],
|
|
30
|
+
objects: subject ? [Ref.make(subject)] : undefined,
|
|
31
|
+
}),
|
|
32
|
+
trigger: Trigger.make({}),
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Templates contributed by plugin-routine itself. */
|
|
38
|
+
export const defaultTemplates: RoutineCapabilities.Template[] = [blank];
|
|
39
|
+
|
|
40
|
+
/** Registry skill refs declared by the object type's {@link AppAnnotation.SkillsAnnotation}. */
|
|
41
|
+
const skillRefsForObject = (object: Obj.Unknown): Ref.Ref<Skill.Skill>[] => {
|
|
42
|
+
const type = Obj.getType(object);
|
|
43
|
+
if (!type) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
const keys = Option.getOrElse(() => [] as string[])(AppAnnotation.SkillsAnnotation.get(Type.getSchema(type)));
|
|
47
|
+
return keys.map((key) => Ref.fromURI(Skill.registryURI(key)));
|
|
48
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { TestSchema } from '@dxos/client/testing';
|
|
8
|
+
import { DXN, JsonSchema, Ref } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Operations seeded into the local space in stories.
|
|
12
|
+
*/
|
|
13
|
+
export const functions = [
|
|
14
|
+
{
|
|
15
|
+
key: DXN.make('com.example.function.chess'),
|
|
16
|
+
name: 'com.example.function.chess',
|
|
17
|
+
version: '0.1.0',
|
|
18
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
19
|
+
Schema.Struct({
|
|
20
|
+
level: Schema.Number.annotations({
|
|
21
|
+
title: 'Level',
|
|
22
|
+
}),
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: DXN.make('com.example.function.forex'),
|
|
28
|
+
name: 'com.example.function.forex',
|
|
29
|
+
version: '0.1.0',
|
|
30
|
+
binding: 'FOREX',
|
|
31
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
32
|
+
Schema.Struct({
|
|
33
|
+
from: Schema.String.annotations({ title: 'Currency from' }),
|
|
34
|
+
to: Schema.String.annotations({ title: 'Currency to' }),
|
|
35
|
+
}),
|
|
36
|
+
),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: DXN.make('com.example.function.pingContact'),
|
|
40
|
+
name: 'com.example.function.ping-contact',
|
|
41
|
+
version: '0.0.1',
|
|
42
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
43
|
+
Schema.Struct({
|
|
44
|
+
contact: Ref.Ref(TestSchema.ContactType).annotations({ title: 'Contact' }),
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Operations seeded into the registry (not the local space) in stories.
|
|
52
|
+
* Simulates built-in or plugin-provided operations available globally.
|
|
53
|
+
*/
|
|
54
|
+
export const registryFunctions = [
|
|
55
|
+
{
|
|
56
|
+
key: 'com.example.function.translate',
|
|
57
|
+
name: 'com.example.function.translate',
|
|
58
|
+
version: '0.1.0',
|
|
59
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
60
|
+
Schema.Struct({
|
|
61
|
+
text: Schema.String.annotations({ title: 'Text' }),
|
|
62
|
+
targetLanguage: Schema.String.annotations({ title: 'Target language' }),
|
|
63
|
+
}),
|
|
64
|
+
),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'com.example.function.summarize',
|
|
68
|
+
name: 'com.example.function.summarize',
|
|
69
|
+
version: '0.1.0',
|
|
70
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
71
|
+
Schema.Struct({
|
|
72
|
+
content: Schema.String.annotations({ title: 'Content' }),
|
|
73
|
+
}),
|
|
74
|
+
),
|
|
75
|
+
},
|
|
76
|
+
];
|
package/src/testing.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
6
|
+
import { type Resource } from '@dxos/react-ui';
|
|
7
|
+
import { translations as componentsTranslations } from '@dxos/react-ui-components/translations';
|
|
8
|
+
import { translations as formTranslations } from '@dxos/react-ui-form/translations';
|
|
9
|
+
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
import { Routine } from '#types';
|
|
12
|
+
|
|
13
|
+
export const translations: Resource[] = [
|
|
14
|
+
...componentsTranslations,
|
|
15
|
+
...formTranslations,
|
|
16
|
+
{
|
|
17
|
+
'en-US': {
|
|
18
|
+
[Type.getTypename(Routine.Routine)]: {
|
|
19
|
+
'typename.label': 'Routine',
|
|
20
|
+
'typename.label_zero': 'Routines',
|
|
21
|
+
'typename.label_one': 'Routine',
|
|
22
|
+
'typename.label_other': 'Routines',
|
|
23
|
+
'object-name.placeholder': 'New routine',
|
|
24
|
+
'add-object.label': 'Add routine',
|
|
25
|
+
'rename-object.label': 'Rename routine',
|
|
26
|
+
'delete-object.label': 'Delete routine',
|
|
27
|
+
},
|
|
28
|
+
[meta.profile.key]: {
|
|
29
|
+
'plugin.name': 'Routine',
|
|
30
|
+
'automation-panel.label': 'Routines',
|
|
31
|
+
'create-panel.template.placeholder': 'Search templates...',
|
|
32
|
+
|
|
33
|
+
'schedule.kind.once.label': 'Once',
|
|
34
|
+
'schedule.kind.hourly.label': 'Hourly',
|
|
35
|
+
'schedule.kind.daily.label': 'Daily',
|
|
36
|
+
'schedule.kind.weekly.label': 'Weekly',
|
|
37
|
+
'schedule.kind.monthly.label': 'Monthly',
|
|
38
|
+
'schedule.kind.custom.label': 'Custom',
|
|
39
|
+
'schedule.at.label': 'At',
|
|
40
|
+
'schedule.on.label': 'On',
|
|
41
|
+
'schedule.minute.label': 'At minute',
|
|
42
|
+
'schedule.day.label': 'Day of month',
|
|
43
|
+
'schedule.cron.label': 'Cron',
|
|
44
|
+
'schedule.close.label': 'Close',
|
|
45
|
+
'schedule.note.message': 'Runs are staggered by a few minutes to spread server load.',
|
|
46
|
+
|
|
47
|
+
'command.placeholder': 'Enter slash command...',
|
|
48
|
+
'template.placeholder': 'Enter template...',
|
|
49
|
+
'run-prompt.label': 'Run prompt',
|
|
50
|
+
'routine-running.label': 'Running…',
|
|
51
|
+
'run.label': 'Run',
|
|
52
|
+
'run-error.message': 'Failed to run routine.',
|
|
53
|
+
|
|
54
|
+
'automation-name.label': 'Name',
|
|
55
|
+
'general.title': 'General',
|
|
56
|
+
'general.description': 'Name and description.',
|
|
57
|
+
|
|
58
|
+
'actions.title': 'Actions',
|
|
59
|
+
'actions.description': 'What this routine runs.',
|
|
60
|
+
'action.placeholder': 'Select an operation or instructions',
|
|
61
|
+
'action-input.label': 'Input',
|
|
62
|
+
'action-kind.operation.label': 'Operation',
|
|
63
|
+
'action-kind.instructions.label': 'Instructions',
|
|
64
|
+
|
|
65
|
+
'triggers.title': 'Triggers',
|
|
66
|
+
'triggers.description': 'When this routine runs.',
|
|
67
|
+
'trigger-kind.placeholder': 'Select trigger type',
|
|
68
|
+
'trigger-kind.timer.label': 'Schedule',
|
|
69
|
+
'trigger-kind.timer.description': 'Run on a recurring schedule or once at a future time.',
|
|
70
|
+
'trigger-kind.subscription.label': 'Query',
|
|
71
|
+
'trigger-kind.subscription.description': 'Run when objects matching a query change.',
|
|
72
|
+
'trigger-kind.webhook.label': 'Webhook',
|
|
73
|
+
'trigger-kind.webhook.description': 'Trigger from a POST request.',
|
|
74
|
+
'trigger-kind.feed.label': 'Feed',
|
|
75
|
+
'trigger-kind.feed.description': 'Run when a new item arrives in a feed.',
|
|
76
|
+
'trigger-kind.email.label': 'Email',
|
|
77
|
+
'trigger-kind.email.description': 'Run when an email is received.',
|
|
78
|
+
'trigger-kind.clear.label': 'Clear',
|
|
79
|
+
'trigger-kind.query-stub.message': 'Query editing is not yet available.',
|
|
80
|
+
'trigger-kind.email-note.message': 'Runs whenever a new email is received.',
|
|
81
|
+
|
|
82
|
+
'method.label': 'Method',
|
|
83
|
+
'port.label': 'Port',
|
|
84
|
+
'cron.placeholder': '0 0 * * *',
|
|
85
|
+
'feed.placeholder': 'Select a feed',
|
|
86
|
+
'enabled.label': 'Enabled',
|
|
87
|
+
'enabled.description': 'Turn this routine on or off.',
|
|
88
|
+
'add-trigger.label': 'Add trigger',
|
|
89
|
+
'add-trigger-first.message': 'Add a trigger to enable.',
|
|
90
|
+
'remove-trigger.label': 'Remove',
|
|
91
|
+
'select-action-first.message': 'Select an action first.',
|
|
92
|
+
'automation-companion.label': 'Routine',
|
|
93
|
+
'routine-runs.label': 'Runs',
|
|
94
|
+
|
|
95
|
+
'history.empty.message': 'No runs yet.',
|
|
96
|
+
'history.status.success.label': 'Success',
|
|
97
|
+
'history.status.failure.label': 'Failed',
|
|
98
|
+
'history.status.pending.label': 'Running',
|
|
99
|
+
'no-routines.message': 'No routines for this object.',
|
|
100
|
+
'routine-not-associated.message': 'Not yet associated with this object.',
|
|
101
|
+
'routine-detached.message': 'No longer associated with this object.',
|
|
102
|
+
'add-routine.label': 'Add routine',
|
|
103
|
+
'routine-actions.label': 'Routine actions',
|
|
104
|
+
'disabled.label': 'Disabled',
|
|
105
|
+
'delete.label': 'Delete',
|
|
106
|
+
'save.label': 'Save',
|
|
107
|
+
'cancel.label': 'Cancel',
|
|
108
|
+
|
|
109
|
+
'testing.title': 'Testing',
|
|
110
|
+
'force-run.label': 'Force run',
|
|
111
|
+
'reset-cursor.label': 'Reset feed cursor',
|
|
112
|
+
'reset-cursor-confirm.label': 'Confirm reset feed cursor',
|
|
113
|
+
|
|
114
|
+
'routine-verbose.label': 'Manage routines',
|
|
115
|
+
'routine.description': 'Manage where routines in this space run.',
|
|
116
|
+
|
|
117
|
+
'runtime.label': 'Runtime location',
|
|
118
|
+
'runtime.description': 'Determines where routines in this space run.',
|
|
119
|
+
'runtime.disabled.label': 'Disabled',
|
|
120
|
+
'runtime.local.label': 'Local',
|
|
121
|
+
'runtime.edge.label': 'EDGE (experimental)',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
] as const satisfies Resource[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { Instructions, Operation, Runnable, Trigger } from '@dxos/compute';
|
|
8
|
+
import { Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { blank } from '../templates';
|
|
11
|
+
import { isRunInstructions } from '../util';
|
|
12
|
+
import * as Routine from './Routine';
|
|
13
|
+
|
|
14
|
+
describe('Routine', () => {
|
|
15
|
+
test('make produces a typed Routine', ({ expect }) => {
|
|
16
|
+
const routine = Routine.make({ name: 'Test', triggers: [] });
|
|
17
|
+
expect(Routine.instanceOf(routine)).toBe(true);
|
|
18
|
+
expect(Obj.instanceOf(Routine.Routine, routine)).toBe(true);
|
|
19
|
+
expect(Type.getTypename(Routine.Routine)).toBe('org.dxos.type.routine');
|
|
20
|
+
expect(Obj.getLabel(routine)).toBe('Test');
|
|
21
|
+
expect(routine.triggers).toEqual([]);
|
|
22
|
+
expect(routine.spec).toBeUndefined();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('Runnable seam is currently the Operation type', ({ expect }) => {
|
|
26
|
+
// MVP: Runnable === Operation. Widening this to a union is the documented next step.
|
|
27
|
+
expect(Runnable.Runnable).toBe(Operation.PersistentOperation);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('make wires an instructions action so a single add yields a runnable routine', ({ expect }) => {
|
|
31
|
+
const instructions = Instructions.make({ name: 'Body', text: 'do something' });
|
|
32
|
+
const trigger = Trigger.make({ spec: Trigger.specTimer('0 9 * * *') });
|
|
33
|
+
const routine = Routine.make({ name: 'R', instructions, trigger });
|
|
34
|
+
|
|
35
|
+
// The routine owns the instructions, and the trigger dispatches RunInstructions with those instructions
|
|
36
|
+
// bound into the trigger input so no separate persistence step is needed.
|
|
37
|
+
expect(Routine.instructionsRef(routine)?.target?.id).toBe(instructions.id);
|
|
38
|
+
expect(routine.triggers[0]?.target?.id).toBe(trigger.id);
|
|
39
|
+
expect(isRunInstructions(trigger.runnable)).toBe(true);
|
|
40
|
+
const bound = trigger.input?.instructions;
|
|
41
|
+
expect(Ref.isRef(bound) ? bound.target?.id : undefined).toBe(instructions.id);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('blank template', () => {
|
|
45
|
+
test('is the default no-op template', ({ expect }) => {
|
|
46
|
+
expect(blank.id).toBe('org.dxos.routine.blank');
|
|
47
|
+
expect(blank.label).toBe('Blank');
|
|
48
|
+
expect(typeof blank.scaffold).toBe('function');
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|