@dxos/plugin-routine 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLUGIN.mdl +79 -12
- package/dist/lib/InstructionsEditor.mjs +55 -0
- package/dist/lib/InstructionsEditor.mjs.map +1 -0
- package/dist/lib/RoutineOperation.mjs +3 -3
- package/dist/lib/RoutineOperation.mjs.map +1 -1
- package/dist/lib/TemplateEditor.mjs +2 -0
- package/dist/lib/Wire.mjs +2 -0
- package/dist/lib/capabilities.browser.mjs +70 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +24 -9
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs +22 -5
- package/dist/lib/capabilities.node.mjs.map +1 -1
- package/dist/lib/capabilities.tauri.mjs +70 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +6 -1
- package/dist/lib/capabilities.workerd.mjs.map +1 -1
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-RoutineArticle.mjs +18 -21
- package/dist/lib/chunk-RoutineArticle.mjs.map +1 -1
- package/dist/lib/chunk-RoutineSettings.mjs +12 -11
- package/dist/lib/chunk-RoutineSettings.mjs.map +1 -1
- package/dist/lib/chunk-RoutineTraceCompanion.mjs +39 -46
- package/dist/lib/chunk-RoutineTraceCompanion.mjs.map +1 -1
- package/dist/lib/chunk-SkillArticle.mjs +4 -6
- package/dist/lib/chunk-SkillArticle.mjs.map +1 -1
- package/dist/lib/chunk-TemplateEditor.mjs +284 -0
- package/dist/lib/chunk-TemplateEditor.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +26 -23
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/chunk-commands.mjs +69 -63
- package/dist/lib/chunk-commands.mjs.map +1 -1
- package/dist/lib/chunk-create-routine.mjs +1 -1
- package/dist/lib/chunk-create-trigger-from-template.mjs +1 -1
- package/dist/lib/chunk-create-trigger-from-template.mjs.map +1 -1
- package/dist/lib/chunk-layer-specs.mjs +67 -16
- package/dist/lib/chunk-layer-specs.mjs.map +1 -1
- package/dist/lib/chunk-paths.mjs +6 -4
- package/dist/lib/chunk-paths.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +2 -2
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-registry-sync.mjs +60 -55
- package/dist/lib/chunk-registry-sync.mjs.map +1 -1
- package/dist/lib/chunk-rolldown-runtime.mjs +15 -1
- package/dist/lib/chunk-run-routine.mjs +2 -2
- package/dist/lib/chunk-run-routine.mjs.map +1 -1
- package/dist/lib/chunk-templates.mjs +2 -2
- package/dist/lib/chunk-templates.mjs.map +1 -1
- package/dist/lib/chunk-wire.mjs +66 -0
- package/dist/lib/chunk-wire.mjs.map +1 -0
- package/dist/lib/components.mjs +131 -433
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/hooks.mjs +6 -6
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/index.mjs +6 -4
- package/dist/lib/meta.mjs +1 -1
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/ns/Hooks.mjs +10 -0
- package/dist/lib/ns/Hooks.mjs.map +1 -0
- package/dist/lib/ns/InstructionsEditor.mjs +8 -0
- package/dist/lib/ns/InstructionsEditor.mjs.map +1 -0
- package/dist/lib/ns/RoutinePath.mjs +12 -0
- package/dist/lib/ns/RoutinePath.mjs.map +1 -0
- package/dist/lib/ns/TemplateEditor.mjs +8 -0
- package/dist/lib/ns/TemplateEditor.mjs.map +1 -0
- package/dist/lib/ns/Wire.mjs +11 -0
- package/dist/lib/ns/Wire.mjs.map +1 -0
- package/dist/lib/operations.mjs.map +1 -1
- package/dist/lib/testing.mjs +53 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/lib/util.mjs +1 -65
- package/dist/types/src/Hooks.d.ts +2 -0
- package/dist/types/src/Hooks.d.ts.map +1 -0
- package/dist/types/src/InstructionsEditor.d.ts +3 -0
- package/dist/types/src/InstructionsEditor.d.ts.map +1 -0
- package/dist/types/src/RoutinePath.d.ts +2 -0
- package/dist/types/src/RoutinePath.d.ts.map +1 -0
- package/dist/types/src/TemplateEditor.d.ts +3 -0
- package/dist/types/src/TemplateEditor.d.ts.map +1 -0
- package/dist/types/src/Wire.d.ts +2 -0
- package/dist/types/src/Wire.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +16 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.test.d.ts +2 -0
- package/dist/types/src/capabilities/app-graph-builder.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/commands.d.ts +1 -1
- package/dist/types/src/capabilities/commands.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/browser.d.ts +14 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/tauri.d.ts +14 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -1
- package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -1
- package/dist/types/src/commands/errors.d.ts +33 -0
- package/dist/types/src/commands/errors.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts +1 -1
- package/dist/types/src/commands/index.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/feed.d.ts +4 -3
- package/dist/types/src/commands/trigger/create/feed.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/index.d.ts +2 -2
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/subscription.d.ts +4 -3
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/create/timer.d.ts +4 -3
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/index.d.ts +2 -2
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/list.d.ts +1 -1
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/options.d.ts +1 -1
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/remove.d.ts +2 -2
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/feed.d.ts +4 -3
- package/dist/types/src/commands/trigger/update/feed.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/index.d.ts +2 -2
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/subscription.d.ts +4 -3
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/update/timer.d.ts +4 -3
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -1
- package/dist/types/src/commands/trigger/util.d.ts +5 -4
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -1
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts +6 -5
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.stories.d.ts +77 -1
- package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateRoutinePanel/index.d.ts +1 -1
- package/dist/types/src/components/CreateRoutinePanel/index.d.ts.map +1 -1
- package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts.map +1 -1
- package/dist/types/src/components/InstructionsEditor/index.d.ts +1 -1
- package/dist/types/src/components/InstructionsEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/RoutineCard/RoutineCard.d.ts +1 -1
- package/dist/types/src/components/RoutineCard/RoutineCard.d.ts.map +1 -1
- package/dist/types/src/components/RoutineCard/index.d.ts +1 -1
- package/dist/types/src/components/RoutineCard/index.d.ts.map +1 -1
- package/dist/types/src/components/RoutineForm/RoutineForm.d.ts.map +1 -1
- package/dist/types/src/components/RoutineForm/index.d.ts +1 -1
- package/dist/types/src/components/RoutineForm/index.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/Schedule.d.ts +5 -5
- package/dist/types/src/components/Schedule/Schedule.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/Schedule.stories.d.ts +1 -1
- package/dist/types/src/components/Schedule/Schedule.stories.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/cron.d.ts +2 -2
- package/dist/types/src/components/Schedule/cron.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/describe-schedule.d.ts +1 -1
- package/dist/types/src/components/Schedule/describe-schedule.d.ts.map +1 -1
- package/dist/types/src/components/Schedule/index.d.ts +5 -5
- package/dist/types/src/components/Schedule/index.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/index.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerKindSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/index.d.ts +1 -1
- package/dist/types/src/components/TriggerEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/trigger-kind-icon.d.ts +1 -1
- package/dist/types/src/components/TriggerEditor/trigger-kind-icon.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +7 -7
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/index.d.ts +1 -1
- package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineSettings/index.d.ts +1 -1
- package/dist/types/src/containers/RoutineSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/index.d.ts +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/index.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/runs.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts +1 -1
- package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts.map +1 -1
- package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts +1 -1
- package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts.map +1 -1
- package/dist/types/src/containers/SkillArticle/index.d.ts +1 -1
- package/dist/types/src/containers/SkillArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +6 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/paths.d.ts +3 -1
- package/dist/types/src/paths.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts +12 -6
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/RoutineOperation.d.ts +2 -2
- package/dist/types/src/types/RoutineOperation.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +4 -4
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -2
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +96 -78
- package/src/Hooks.ts +7 -0
- package/src/InstructionsEditor.ts +8 -0
- package/src/RoutinePath.ts +7 -0
- package/src/TemplateEditor.ts +8 -0
- package/src/Wire.ts +7 -0
- package/src/capabilities/app-graph-builder.test.ts +54 -0
- package/src/capabilities/app-graph-builder.ts +24 -19
- package/src/capabilities/commands.ts +1 -1
- package/src/capabilities/create-object.test.ts +1 -1
- package/src/capabilities/gen/browser.ts +86 -0
- package/src/capabilities/gen/node.ts +13 -13
- package/src/capabilities/gen/tauri.ts +86 -0
- package/src/capabilities/gen/workerd.ts +6 -6
- package/src/capabilities/index.ts +16 -16
- package/src/capabilities/layer-specs.ts +74 -7
- package/src/capabilities/react-surface.ts +2 -2
- package/src/capabilities/registry-sync.ts +47 -42
- package/src/capabilities/templates.ts +1 -1
- package/src/capabilities/trigger-runtime-controller.test.ts +8 -8
- package/src/commands/errors.ts +8 -0
- package/src/commands/index.ts +1 -1
- package/src/commands/trigger/create/feed.ts +8 -7
- package/src/commands/trigger/create/index.ts +4 -4
- package/src/commands/trigger/create/subscription.ts +11 -10
- package/src/commands/trigger/create/timer.ts +9 -8
- package/src/commands/trigger/index.ts +5 -5
- package/src/commands/trigger/list.ts +3 -3
- package/src/commands/trigger/options.ts +13 -9
- package/src/commands/trigger/remove.ts +4 -4
- package/src/commands/trigger/update/feed.ts +13 -12
- package/src/commands/trigger/update/index.ts +4 -4
- package/src/commands/trigger/update/subscription.ts +16 -15
- package/src/commands/trigger/update/timer.ts +14 -13
- package/src/commands/trigger/util.ts +22 -17
- package/src/components/CreateRoutinePanel/CreateRoutinePanel.stories.tsx +13 -11
- package/src/components/CreateRoutinePanel/CreateRoutinePanel.tsx +54 -31
- package/src/components/CreateRoutinePanel/index.ts +1 -1
- package/src/components/InstructionsEditor/InstructionsEditor.stories.tsx +1 -1
- package/src/components/InstructionsEditor/InstructionsEditor.tsx +7 -18
- package/src/components/InstructionsEditor/index.ts +1 -1
- package/src/components/RoutineCard/RoutineCard.stories.tsx +4 -4
- package/src/components/RoutineCard/RoutineCard.tsx +11 -6
- package/src/components/RoutineCard/index.ts +1 -1
- package/src/components/RoutineForm/RoutineForm.stories.tsx +1 -1
- package/src/components/RoutineForm/RoutineForm.tsx +19 -19
- package/src/components/RoutineForm/index.ts +1 -1
- package/src/components/Schedule/Schedule.stories.tsx +2 -2
- package/src/components/Schedule/Schedule.tsx +83 -72
- package/src/components/Schedule/cron.test.ts +2 -2
- package/src/components/Schedule/cron.ts +2 -2
- package/src/components/Schedule/describe-schedule.ts +3 -3
- package/src/components/Schedule/index.ts +5 -5
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.tsx +12 -10
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +1 -1
- package/src/components/TemplateEditor/TemplateForm.tsx +23 -25
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +3 -3
- package/src/components/TemplateEditor/extensions/index.ts +2 -2
- package/src/components/TemplateEditor/extensions/xml-extension.ts +1 -1
- package/src/components/TemplateEditor/index.ts +1 -1
- package/src/components/TriggerEditor/TriggerEditor.tsx +17 -15
- package/src/components/TriggerEditor/TriggerKindSelector.stories.tsx +2 -2
- package/src/components/TriggerEditor/TriggerKindSelector.tsx +18 -11
- package/src/components/TriggerEditor/index.ts +1 -1
- package/src/components/TriggerEditor/trigger-kind-icon.ts +1 -1
- package/src/components/index.ts +7 -7
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +15 -13
- package/src/containers/RoutineArticle/RoutineArticle.tsx +14 -18
- package/src/containers/RoutineArticle/index.ts +1 -1
- package/src/containers/RoutineSettings/RoutineSettings.tsx +10 -11
- package/src/containers/RoutineSettings/index.ts +1 -1
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.tsx +4 -4
- package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.tsx +37 -40
- package/src/containers/RoutineTraceCompanion/index.ts +1 -1
- package/src/containers/RoutineTraceCompanion/runs.test.ts +5 -5
- package/src/containers/RoutineTraceCompanion/runs.ts +3 -2
- package/src/containers/RoutineTraceCompanion/useRoutineRuns.ts +1 -1
- package/src/containers/SkillArticle/SkillArticle.tsx +9 -8
- package/src/containers/SkillArticle/index.ts +1 -1
- package/src/containers/index.ts +4 -4
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useTriggerRuntimeControls.ts +5 -5
- package/src/index.ts +6 -4
- package/src/meta.ts +1 -1
- package/src/operations/create-trigger-from-template.ts +1 -1
- package/src/operations/index.ts +3 -3
- package/src/operations/run-routine.test.ts +4 -4
- package/src/operations/run-routine.ts +2 -2
- package/src/paths.ts +6 -4
- package/src/plugin.test.ts +2 -2
- package/src/templates/index.ts +1 -1
- package/src/testing/index.ts +4 -1
- package/src/translations.ts +3 -3
- package/src/types/RoutineOperation.ts +5 -5
- package/src/types/index.ts +4 -4
- package/src/util/index.ts +2 -2
- package/src/util/run-instructions.test.ts +3 -3
- package/src/util/wire.test.ts +3 -3
- package/src/util/wire.ts +1 -1
- package/dist/lib/util.mjs.map +0 -1
- package/dist/types/src/testing.d.ts +0 -2
- package/dist/types/src/testing.d.ts.map +0 -1
- package/src/testing.ts +0 -7
package/PLUGIN.mdl
CHANGED
|
@@ -35,9 +35,10 @@ Each extension is defined in the Appendix or resolved via its URI.
|
|
|
35
35
|
|-------------|-------------------------------|
|
|
36
36
|
| `type` | `org.dxos.mdl.type@1.0` |
|
|
37
37
|
| `feat` | `org.dxos.mdl.feat@1.0` |
|
|
38
|
-
| `
|
|
38
|
+
| `scenario` | `org.dxos.mdl.scenario@1.0` |
|
|
39
39
|
| `component` | `org.dxos.mdl.component@1.0` |
|
|
40
|
-
| `op` | `org.dxos.mdl.op@1.
|
|
40
|
+
| `op` | `org.dxos.mdl.op@1.1` |
|
|
41
|
+
| `test` | `org.dxos.mdl.test@1.0` |
|
|
41
42
|
|
|
42
43
|
## Types
|
|
43
44
|
|
|
@@ -180,6 +181,7 @@ surface prompts -> RoutineList # space-home prompt list; dispatche
|
|
|
180
181
|
|
|
181
182
|
```mdl
|
|
182
183
|
op CreateTriggerFromTemplate
|
|
184
|
+
key: org.dxos.operation.routine.createTriggerFromTemplate
|
|
183
185
|
desc: |
|
|
184
186
|
Creates a new Trigger from a lightweight template, optionally wiring it to
|
|
185
187
|
a named Script's PersistentOperation, and navigates to the automations
|
|
@@ -203,6 +205,7 @@ op CreateTriggerFromTemplate
|
|
|
203
205
|
|
|
204
206
|
```mdl
|
|
205
207
|
op RunPromptInNewChat
|
|
208
|
+
key: org.dxos.operation.routine.runPromptInNewChat
|
|
206
209
|
desc: Creates a new chat, binds context objects and skills, then runs a prompt.
|
|
207
210
|
input:
|
|
208
211
|
db: Database
|
|
@@ -335,7 +338,7 @@ feat F-6: Create Trigger From Template
|
|
|
335
338
|
## Acceptance
|
|
336
339
|
|
|
337
340
|
```mdl
|
|
338
|
-
|
|
341
|
+
scenario T-1: Create trigger via AutomationPanel
|
|
339
342
|
given: AutomationPanel rendered for a space with no triggers
|
|
340
343
|
when: user clicks "New Trigger"
|
|
341
344
|
then:
|
|
@@ -344,7 +347,7 @@ test T-1: Create trigger via AutomationPanel
|
|
|
344
347
|
```
|
|
345
348
|
|
|
346
349
|
```mdl
|
|
347
|
-
|
|
350
|
+
scenario T-2: Save new trigger
|
|
348
351
|
given: TriggerEditor open with blank Trigger
|
|
349
352
|
when: user fills in a function and spec, then saves
|
|
350
353
|
then:
|
|
@@ -354,7 +357,7 @@ test T-2: Save new trigger
|
|
|
354
357
|
```
|
|
355
358
|
|
|
356
359
|
```mdl
|
|
357
|
-
|
|
360
|
+
scenario T-3: Edit existing trigger
|
|
358
361
|
given: AutomationPanel listing one trigger
|
|
359
362
|
when: user clicks the trigger row
|
|
360
363
|
then:
|
|
@@ -364,7 +367,7 @@ test T-3: Edit existing trigger
|
|
|
364
367
|
```
|
|
365
368
|
|
|
366
369
|
```mdl
|
|
367
|
-
|
|
370
|
+
scenario T-4: Enable/disable toggle
|
|
368
371
|
given: AutomationPanel showing trigger with enabled = false
|
|
369
372
|
when: user flips the toggle
|
|
370
373
|
then:
|
|
@@ -373,7 +376,7 @@ test T-4: Enable/disable toggle
|
|
|
373
376
|
```
|
|
374
377
|
|
|
375
378
|
```mdl
|
|
376
|
-
|
|
379
|
+
scenario T-5: Force run timer trigger (local)
|
|
377
380
|
given: timer trigger enabled, trigger.remote unset
|
|
378
381
|
when: user clicks the force-run button
|
|
379
382
|
then:
|
|
@@ -382,7 +385,7 @@ test T-5: Force run timer trigger (local)
|
|
|
382
385
|
```
|
|
383
386
|
|
|
384
387
|
```mdl
|
|
385
|
-
|
|
388
|
+
scenario T-6: Dispatcher lifecycle on kill-switch change
|
|
386
389
|
given: space triggersDisabled unset, dispatcher running
|
|
387
390
|
when: space.properties.triggersDisabled changes to true
|
|
388
391
|
then:
|
|
@@ -391,7 +394,7 @@ test T-6: Dispatcher lifecycle on kill-switch change
|
|
|
391
394
|
```
|
|
392
395
|
|
|
393
396
|
```mdl
|
|
394
|
-
|
|
397
|
+
scenario T-7: CreateTriggerFromTemplate with timer
|
|
395
398
|
given: db contains Script "daily-summary", space triggersDisabled unset
|
|
396
399
|
when: op:CreateTriggerFromTemplate invoked with template={type:"timer",cron:"0 8 * * *"}, scriptName="daily-summary"
|
|
397
400
|
then:
|
|
@@ -402,7 +405,7 @@ test T-7: CreateTriggerFromTemplate with timer
|
|
|
402
405
|
```
|
|
403
406
|
|
|
404
407
|
```mdl
|
|
405
|
-
|
|
408
|
+
scenario T-8: CreateTriggerFromTemplate with feed
|
|
406
409
|
given: db contains a Feed object "email-feed"
|
|
407
410
|
when: op:CreateTriggerFromTemplate invoked with template={type:"feed",feed:<email-feed>}
|
|
408
411
|
then:
|
|
@@ -412,6 +415,70 @@ test T-8: CreateTriggerFromTemplate with feed
|
|
|
412
415
|
|
|
413
416
|
---
|
|
414
417
|
|
|
418
|
+
## QA
|
|
419
|
+
|
|
420
|
+
Executable tests. Each step carries a human instruction (`do`) and, where the step maps to an
|
|
421
|
+
invocable operation, an agent binding (`invoke`). Report failures by test and step number.
|
|
422
|
+
|
|
423
|
+
```mdl
|
|
424
|
+
test QA-1: Create a routine and run it
|
|
425
|
+
desc: The core automation round-trip — create a Routine from a template, then run it on demand.
|
|
426
|
+
actors: agent
|
|
427
|
+
covers: [F-1.1, F-1.2, T-2]
|
|
428
|
+
status: unverified
|
|
429
|
+
given:
|
|
430
|
+
- an identity exists
|
|
431
|
+
- space: a space is open
|
|
432
|
+
- no Routine named "QA Routine" exists — ABORT rather than reusing one this test did not create
|
|
433
|
+
steps:
|
|
434
|
+
- name: Create the routine
|
|
435
|
+
do: In the navtree, click + on a collection and choose Routine (or Prompt). Name it "QA Routine".
|
|
436
|
+
invoke: org.dxos.operation.routine.createAutomation { db: $given.space.db, templateId: "blank", name: "QA Routine" }
|
|
437
|
+
capture: created
|
|
438
|
+
expect: a Routine named "QA Routine" now exists
|
|
439
|
+
assert: return $result.object.id === $created.object.id
|
|
440
|
+
|
|
441
|
+
- name: Run it
|
|
442
|
+
do: Open "QA Routine" and click the run button.
|
|
443
|
+
invoke: org.dxos.operation.routine.runAutomation { routine: $created.object }
|
|
444
|
+
expect: the routine executes without error and a trace message is appended
|
|
445
|
+
after:
|
|
446
|
+
- name: Delete the routine
|
|
447
|
+
do: Right-click "QA Routine" in the navtree and choose Delete.
|
|
448
|
+
invoke: org.dxos.operation.space.removeObjects { objects: [$created.object], target: $given.space }
|
|
449
|
+
expect: the row leaves the navtree
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
```mdl
|
|
453
|
+
test QA-2: Timer trigger from a template
|
|
454
|
+
desc: Wire a timer-spec Trigger from a lightweight template — the entrypoint used by Skill actions.
|
|
455
|
+
actors: both
|
|
456
|
+
covers: [F-6.1, F-6.3, T-7]
|
|
457
|
+
status: blocked
|
|
458
|
+
given:
|
|
459
|
+
- an identity exists
|
|
460
|
+
- space: a space is open, with plugin-script's TriggersDisabled unset
|
|
461
|
+
steps:
|
|
462
|
+
- name: Create a timer trigger
|
|
463
|
+
do: From a Skill's suggested action, click "Automate this".
|
|
464
|
+
invoke: [op:CreateTriggerFromTemplate] { db: $given.space.db, template: { type: "timer", cron: "0 8 * * *" }, enabled: false }
|
|
465
|
+
expect: layout navigates to the space's automations settings panel, and a new (disabled) timer
|
|
466
|
+
trigger is listed
|
|
467
|
+
note: Trigger is added as a hidden object, so it will not appear in the navtree — only in
|
|
468
|
+
AutomationPanel.
|
|
469
|
+
after:
|
|
470
|
+
- name: Delete the trigger
|
|
471
|
+
do: In AutomationPanel, click the delete icon on the new trigger row.
|
|
472
|
+
expect: the trigger row leaves AutomationPanel
|
|
473
|
+
blocked: |
|
|
474
|
+
[op:CreateTriggerFromTemplate] declares `output: void`, so the `test` stage has nothing to
|
|
475
|
+
capture and this `after` step has no id to pass to `space.removeObjects`. Deletion is
|
|
476
|
+
human-only (AutomationPanel's own delete button) until the operation returns the created
|
|
477
|
+
Trigger, or `after` looks it up by name.
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
415
482
|
## Appendix: Extension Definitions
|
|
416
483
|
|
|
417
484
|
Extension block types used in this document are defined below using
|
|
@@ -439,8 +506,8 @@ ext feat
|
|
|
439
506
|
```
|
|
440
507
|
|
|
441
508
|
```mdl
|
|
442
|
-
ext
|
|
443
|
-
uri: org.dxos.mdl.
|
|
509
|
+
ext scenario
|
|
510
|
+
uri: org.dxos.mdl.scenario@1.0
|
|
444
511
|
desc: An acceptance scenario expressed as given / when / then steps.
|
|
445
512
|
fields:
|
|
446
513
|
given?: Step | Step[]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Entity, Obj, Type } from "@dxos/echo";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as Hooks from "@dxos/app-framework/Hooks";
|
|
5
|
+
import * as AppActivationEvents from "@dxos/app-toolkit/AppActivationEvents";
|
|
6
|
+
import * as TypeOptions from "@dxos/app-toolkit/TypeOptions";
|
|
7
|
+
import * as Instructions from "@dxos/compute/Instructions";
|
|
8
|
+
import * as Skill from "@dxos/compute/Skill";
|
|
9
|
+
import { Form } from "@dxos/react-ui-form";
|
|
10
|
+
//#region src/components/InstructionsEditor/InstructionsEditor.tsx
|
|
11
|
+
var INSTRUCTIONS_SCHEMA = Type.getSchema(Instructions.Instructions);
|
|
12
|
+
var DEFAULT_FIELDS = ["text", "skills"];
|
|
13
|
+
/**
|
|
14
|
+
* Sub-form: edits the owned Instructions in place — by default its `text` (Markdown) and `skills`,
|
|
15
|
+
* both fields of the Instructions schema. A bare Form.Root + FieldSet (no Viewport) keeps these
|
|
16
|
+
* fields left-aligned with the sibling general/action forms; only the rendered fields are written
|
|
17
|
+
* back so a partial editor never clobbers the rest of the object.
|
|
18
|
+
*/
|
|
19
|
+
var InstructionsEditor = ({ db: dbProp, instructions, readonly, fields = DEFAULT_FIELDS }) => {
|
|
20
|
+
Hooks.useActivationSignal(AppActivationEvents.AssistantStart);
|
|
21
|
+
const db = dbProp ?? Obj.getDatabase(instructions);
|
|
22
|
+
const defaultValues = useMemo(() => ({ ...Obj.getSnapshot(instructions) }), [instructions]);
|
|
23
|
+
const fieldSet = useMemo(() => new Set(fields), [fields]);
|
|
24
|
+
const handleValuesChanged = useCallback((values, { isValid }) => {
|
|
25
|
+
if (!isValid) return;
|
|
26
|
+
Obj.update(instructions, (instructions) => {
|
|
27
|
+
if (fieldSet.has("text") && values.text) instructions.text = values.text;
|
|
28
|
+
if (fieldSet.has("skills")) instructions.skills = [...values.skills ?? []];
|
|
29
|
+
if (fieldSet.has("objects")) instructions.objects = [...values.objects ?? []];
|
|
30
|
+
});
|
|
31
|
+
}, [instructions, fieldSet]);
|
|
32
|
+
return /* @__PURE__ */ jsx(Form.Root, {
|
|
33
|
+
schema: INSTRUCTIONS_SCHEMA,
|
|
34
|
+
db,
|
|
35
|
+
readonly,
|
|
36
|
+
defaultValues,
|
|
37
|
+
getOptions: getRefOptions,
|
|
38
|
+
onValuesChanged: handleValuesChanged,
|
|
39
|
+
children: /* @__PURE__ */ jsx(Form.Fields, { filter: (props) => props.filter((prop) => fieldSet.has(prop.name.toString())) })
|
|
40
|
+
}, instructions.id);
|
|
41
|
+
};
|
|
42
|
+
var isSystemObject = (object) => Obj.isObject(object) && !TypeOptions.isUserObject(object);
|
|
43
|
+
var getRefOptions = (results, { getTypePlaceholder } = {}) => results.filter((entity) => !isSystemObject(entity)).map((entity) => {
|
|
44
|
+
const id = Entity.getURI(entity, { prefer: "named" });
|
|
45
|
+
const typename = Entity.getTypename(entity);
|
|
46
|
+
return {
|
|
47
|
+
id,
|
|
48
|
+
label: Entity.getLabel(entity) ?? (typename ? getTypePlaceholder?.(typename) : void 0) ?? id,
|
|
49
|
+
description: Obj.instanceOf(Skill.Skill, entity) ? Obj.getMeta(entity).key : typename
|
|
50
|
+
};
|
|
51
|
+
}).sort((left, right) => left.label.localeCompare(right.label));
|
|
52
|
+
//#endregion
|
|
53
|
+
export { InstructionsEditor };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=InstructionsEditor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstructionsEditor.mjs","names":[],"sources":["../../src/components/InstructionsEditor/InstructionsEditor.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport * as AppActivationEvents from '@dxos/app-toolkit/AppActivationEvents';\nimport * as TypeOptions from '@dxos/app-toolkit/TypeOptions';\nimport * as Instructions from '@dxos/compute/Instructions';\nimport * as Skill from '@dxos/compute/Skill';\nimport { type Database, Entity, Obj, Type } from '@dxos/echo';\nimport { Form } from '@dxos/react-ui-form';\n\nconst INSTRUCTIONS_SCHEMA = Type.getSchema(Instructions.Instructions);\n\n// Owned-routine action fields surfaced by default — the prompt text and the agent's `skills`. The\n// context `objects` are excluded here so a routine form doesn't show a second, divergent list beside\n// its owning subject; a surface that owns the context concern (e.g. a project's Context section)\n// opts in via `fields`.\nconst DEFAULT_FIELDS: readonly string[] = ['text', 'skills'];\n\nexport type InstructionsEditorProps = {\n db?: Database.Database; // TODO(burdon): Should not be optional if instructions are not.\n instructions: Instructions.Instructions;\n readonly?: boolean;\n /** Instructions schema fields rendered AND written back; others are left untouched. */\n fields?: readonly string[];\n};\n\n/**\n * Sub-form: edits the owned Instructions in place — by default its `text` (Markdown) and `skills`,\n * both fields of the Instructions schema. A bare Form.Root + FieldSet (no Viewport) keeps these\n * fields left-aligned with the sibling general/action forms; only the rendered fields are written\n * back so a partial editor never clobbers the rest of the object.\n */\nexport const InstructionsEditor = ({\n db: dbProp,\n instructions,\n readonly,\n fields = DEFAULT_FIELDS,\n}: InstructionsEditorProps) => {\n // Signalled here rather than by each embedding surface: a `skills` row renders blank until the\n // modules gated on this event contribute their definitions.\n Hooks.useActivationSignal(AppActivationEvents.AssistantStart);\n\n // A draft routine is not yet attached to a database, so fall back to the explicit `db` for ref queries.\n const db = dbProp ?? Obj.getDatabase(instructions);\n\n const defaultValues = useMemo<Partial<Instructions.Instructions>>(\n () => ({ ...Obj.getSnapshot(instructions) }),\n [instructions],\n );\n\n const fieldSet = useMemo(() => new Set(fields), [fields]);\n const handleValuesChanged = useCallback(\n (values: Partial<Instructions.Instructions>, { isValid }: { isValid: boolean }) => {\n // Skip while invalid (e.g. an empty ref slot just added by the skills array field) so a partial\n // selection isn't persisted; the write lands once the slot is filled.\n if (!isValid) {\n return;\n }\n\n Obj.update(instructions, (instructions) => {\n if (fieldSet.has('text') && values.text) {\n instructions.text = values.text;\n }\n if (fieldSet.has('skills')) {\n instructions.skills = [...(values.skills ?? [])];\n }\n if (fieldSet.has('objects')) {\n instructions.objects = [...(values.objects ?? [])];\n }\n });\n },\n [instructions, fieldSet],\n );\n\n return (\n <Form.Root\n key={instructions.id}\n schema={INSTRUCTIONS_SCHEMA}\n db={db}\n readonly={readonly}\n defaultValues={defaultValues}\n getOptions={getRefOptions}\n onValuesChanged={handleValuesChanged}\n >\n <Form.Fields filter={(props) => props.filter((prop) => fieldSet.has(prop.name.toString()))} />\n </Form.Root>\n );\n};\n\n// System objects (e.g. SpaceProperties) are infrastructure, not user content, so they are excluded\n// from the context picker.\nconst isSystemObject = (object: Entity.Any): boolean => Obj.isObject(object) && !TypeOptions.isUserObject(object);\n\n// Ref-picker options shared by the routine form's skill and object fields: surface a secondary line\n// per candidate — a Skill's registry key, otherwise the object's typename — and sort by label, so the\n// pickers present refs consistently. Falls back to the type placeholder (then URI) for unlabelled objects,\n// matching the default RefField; system objects are excluded.\nconst getRefOptions = (\n results: Entity.Any[],\n { getTypePlaceholder }: { getTypePlaceholder?: (typename: string) => string } = {},\n): { id: string; label: string; description?: string }[] =>\n results\n .filter((entity) => !isSystemObject(entity))\n .map((entity) => {\n const id = Entity.getURI(entity, { prefer: 'named' });\n const typename = Entity.getTypename(entity);\n const label = Entity.getLabel(entity) ?? (typename ? getTypePlaceholder?.(typename) : undefined) ?? id;\n const description = Obj.instanceOf(Skill.Skill, entity) ? Obj.getMeta(entity).key : typename;\n return { id, label, description };\n })\n .sort((left, right) => left.label.localeCompare(right.label));\n"],"mappings":";;;;;;;;;;AAcA,IAAM,sBAAsB,KAAK,UAAU,aAAa,YAAY;AAMpE,IAAM,iBAAoC,CAAC,QAAQ,QAAQ;;;;;;;AAgB3D,IAAa,sBAAsB,EACjC,IAAI,QACJ,cACA,UACA,SAAS,qBACoB;CAG7B,MAAM,oBAAoB,oBAAoB,cAAc;CAG5D,MAAM,KAAK,UAAU,IAAI,YAAY,YAAY;CAEjD,MAAM,gBAAgB,eACb,EAAE,GAAG,IAAI,YAAY,YAAY,EAAE,IAC1C,CAAC,YAAY,CACf;CAEA,MAAM,WAAW,cAAc,IAAI,IAAI,MAAM,GAAG,CAAC,MAAM,CAAC;CACxD,MAAM,sBAAsB,aACzB,QAA4C,EAAE,cAAoC;EAGjF,IAAI,CAAC,SACH;EAGF,IAAI,OAAO,eAAe,iBAAiB;GACzC,IAAI,SAAS,IAAI,MAAM,KAAK,OAAO,MACjC,aAAa,OAAO,OAAO;GAE7B,IAAI,SAAS,IAAI,QAAQ,GACvB,aAAa,SAAS,CAAC,GAAI,OAAO,UAAU,CAAC,CAAE;GAEjD,IAAI,SAAS,IAAI,SAAS,GACxB,aAAa,UAAU,CAAC,GAAI,OAAO,WAAW,CAAC,CAAE;EAErD,CAAC;CACH,GACA,CAAC,cAAc,QAAQ,CACzB;CAEA,OACE,oBAAC,KAAK,MAAN;EAEE,QAAQ;EACJ;EACM;EACK;EACf,YAAY;EACZ,iBAAiB;EAEjB,UAAA,oBAAC,KAAK,QAAN,EAAa,SAAS,UAAU,MAAM,QAAQ,SAAS,SAAS,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,EAAI,CAAA;CACpF,GATJ,aAAa,EAST;AAEf;AAIA,IAAM,kBAAkB,WAAgC,IAAI,SAAS,MAAM,KAAK,CAAC,YAAY,aAAa,MAAM;AAMhH,IAAM,iBACJ,SACA,EAAE,uBAA8E,CAAC,MAEjF,QACG,QAAQ,WAAW,CAAC,eAAe,MAAM,CAAC,CAAA,CAC1C,KAAK,WAAW;CACf,MAAM,KAAK,OAAO,OAAO,QAAQ,EAAE,QAAQ,QAAQ,CAAC;CACpD,MAAM,WAAW,OAAO,YAAY,MAAM;CAG1C,OAAO;EAAE;EAAI,OAFC,OAAO,SAAS,MAAM,MAAM,WAAW,qBAAqB,QAAQ,IAAI,KAAA,MAAc;EAEhF,aADA,IAAI,WAAW,MAAM,OAAO,MAAM,IAAI,IAAI,QAAQ,MAAM,CAAC,CAAC,MAAM;CACpD;AAClC,CAAC,CAAA,CACA,MAAM,MAAM,UAAU,KAAK,MAAM,cAAc,MAAM,KAAK,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
2
|
import { TriggerTemplate } from "./Routine.mjs";
|
|
3
3
|
import * as Capability from "@dxos/app-framework/Capability";
|
|
4
|
-
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
5
4
|
import * as Routine from "@dxos/compute/Routine";
|
|
6
5
|
import { DXN, Database, Obj, Ref, Type } from "@dxos/echo";
|
|
7
|
-
import * as Schema from "effect/Schema";
|
|
8
6
|
import * as Instructions from "@dxos/compute/Instructions";
|
|
7
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
9
|
import * as Operation from "@dxos/compute/Operation";
|
|
10
10
|
import * as Trigger from "@dxos/compute/Trigger";
|
|
11
|
-
import * as Chat from "@dxos/assistant
|
|
11
|
+
import * as Chat from "@dxos/assistant/Chat";
|
|
12
12
|
import { EID as _EchoURIReference } from "@dxos/keys";
|
|
13
13
|
//#region src/types/RoutineOperation.ts
|
|
14
14
|
var RoutineOperation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoutineOperation.mjs","names":[],"sources":["../../src/types/RoutineOperation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as Chat from '@dxos/assistant
|
|
1
|
+
{"version":3,"file":"RoutineOperation.mjs","names":[],"sources":["../../src/types/RoutineOperation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\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 * as Capability from '@dxos/app-framework/Capability';\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as Instructions from '@dxos/compute/Instructions';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Routine from '@dxos/compute/Routine';\nimport * as Trigger from '@dxos/compute/Trigger';\nimport { Database, DXN, Obj, Ref, Type } from '@dxos/echo';\nimport { EID as _EchoURIReference } from '@dxos/keys';\n\nimport { TriggerTemplate } from './Routine.ts';\nexport { _EchoURIReference };\n\nexport const CreateTriggerFromTemplate = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.createTriggerFromTemplate'),\n name: 'Create Trigger From Template',\n icon: 'ph--lightning--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n db: Database.Database,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record(Schema.String, Schema.Any)),\n }),\n output: Schema.Void,\n});\n\n// The single creation entrypoint for every path (create dialog, companion, sidebar) so placement and\n// ownership are established in one place. Output mirrors `SpaceCapabilities.CreateObjectResult`.\nexport const CreateRoutine = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.createAutomation'),\n name: 'Create Routine',\n icon: 'ph--lightning--regular',\n },\n services: [Capability.Service, Plugin.Service],\n input: Schema.Struct({\n db: Database.Database,\n templateId: Schema.String,\n name: Schema.optional(Schema.String),\n subject: Schema.optional(Obj.Unknown),\n /** Values for the template's `inputSchema`. */\n input: Schema.optional(Schema.Unknown),\n }),\n output: Schema.Struct({\n id: Schema.String,\n object: Obj.Unknown,\n }),\n});\n\nexport const RunPromptInNewChat = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.runPromptInNewChat'),\n name: 'Run Prompt In New Chat',\n icon: 'ph--chat-text--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n db: Database.Database,\n /** Context objects to bind to the new chat. */\n objects: Schema.optional(Schema.Array(Obj.Unknown)),\n /** Skill keys to look up and bind to the new chat. */\n skills: Schema.optional(Schema.Array(Schema.String)),\n /** Raw instructions or an existing Routine object reference. */\n instructions: Schema.Union([Schema.String, Ref.Ref(Instructions.Instructions)]),\n /**\n * When true, skips opening the chat: runs the Agent prompt operation against the new chat via the compute runtime (traced).\n */\n background: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Struct({\n object: Type.getSchema(Chat.Chat),\n }),\n});\n\n// Runs a routine's action now, routed by its first trigger — that is where both the runnable's input\n// (e.g. a sync routine's binding cursor) and the `remote` flag live. A `remote` trigger force-runs on the\n// EDGE dispatcher over HTTP, since that is the only runtime it is registered on; a local one runs\n// in-process. Without the trigger a manual run would invoke an input-taking runnable with nothing, and\n// would silently run an edge routine on the client.\nexport const RunRoutine = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.routine.runAutomation'),\n name: 'Run Routine',\n icon: 'ph--play--regular',\n },\n services: [Capability.Service, Trigger.TriggerMonitorService],\n input: Schema.Struct({\n routine: Ref.Ref(Routine.Routine),\n }),\n output: Schema.Void,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,4BAA4B,UAAU,KAAK;CACtD,MAAM;EACJ,KAAK,IAAI,KAAK,sDAAsD;EACpE,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,OAAO;CAC7B,OAAO,OAAO,OAAO;EACnB,IAAI,SAAS;EACb,UAAU;EACV,SAAS,OAAO,SAAS,OAAO,OAAO;EACvC,YAAY,OAAO,SAAS,OAAO,MAAM;EACzC,OAAO,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,GAAG,CAAC;CACjE,CAAC;CACD,QAAQ,OAAO;AACjB,CAAC;AAID,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAK,IAAI,KAAK,6CAA6C;EAC3D,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,SAAS,OAAO,OAAO;CAC7C,OAAO,OAAO,OAAO;EACnB,IAAI,SAAS;EACb,YAAY,OAAO;EACnB,MAAM,OAAO,SAAS,OAAO,MAAM;EACnC,SAAS,OAAO,SAAS,IAAI,OAAO;;EAEpC,OAAO,OAAO,SAAS,OAAO,OAAO;CACvC,CAAC;CACD,QAAQ,OAAO,OAAO;EACpB,IAAI,OAAO;EACX,QAAQ,IAAI;CACd,CAAC;AACH,CAAC;AAED,IAAa,qBAAqB,UAAU,KAAK;CAC/C,MAAM;EACJ,KAAK,IAAI,KAAK,+CAA+C;EAC7D,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,OAAO;CAC7B,OAAO,OAAO,OAAO;EACnB,IAAI,SAAS;;EAEb,SAAS,OAAO,SAAS,OAAO,MAAM,IAAI,OAAO,CAAC;;EAElD,QAAQ,OAAO,SAAS,OAAO,MAAM,OAAO,MAAM,CAAC;;EAEnD,cAAc,OAAO,MAAM,CAAC,OAAO,QAAQ,IAAI,IAAI,aAAa,YAAY,CAAC,CAAC;;;;EAI9E,YAAY,OAAO,SAAS,OAAO,OAAO;CAC5C,CAAC;CACD,QAAQ,OAAO,OAAO,EACpB,QAAQ,KAAK,UAAU,KAAK,IAAI,EAClC,CAAC;AACH,CAAC;AAOD,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAK,IAAI,KAAK,0CAA0C;EACxD,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,SAAS,QAAQ,qBAAqB;CAC5D,OAAO,OAAO,OAAO,EACnB,SAAS,IAAI,IAAI,QAAQ,OAAO,EAClC,CAAC;CACD,QAAQ,OAAO;AACjB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { t as PLUGIN_default } from "./chunk-PLUGIN.mjs";
|
|
2
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
3
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
4
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
5
|
+
import { translations } from "#translations";
|
|
6
|
+
import { RoutineCapabilities } from "#types";
|
|
7
|
+
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
8
|
+
import * as ClientCapabilities from "@dxos/plugin-client/ClientCapabilities";
|
|
9
|
+
import * as ClientEvents from "@dxos/plugin-client/ClientEvents";
|
|
10
|
+
import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
|
|
11
|
+
import { meta } from "#meta";
|
|
12
|
+
//#region src/capabilities/gen/browser.ts
|
|
13
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"), { environments: [
|
|
14
|
+
"browser",
|
|
15
|
+
"node",
|
|
16
|
+
"tauri"
|
|
17
|
+
] });
|
|
18
|
+
var Commands = AppCapability.commands(() => import("./chunk-commands.mjs"));
|
|
19
|
+
var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"), { environments: ["browser", "tauri"] });
|
|
20
|
+
var LayerSpecs = AppCapability.layerSpec(() => import("./chunk-layer-specs.mjs"), {
|
|
21
|
+
name: "LayerSpecs",
|
|
22
|
+
provides: [Capabilities.TraceSink]
|
|
23
|
+
});
|
|
24
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"));
|
|
25
|
+
var PluginAsset = AppCapability.pluginAsset({
|
|
26
|
+
pluginId: meta.profile.key,
|
|
27
|
+
path: "PLUGIN.mdl",
|
|
28
|
+
content: PLUGIN_default,
|
|
29
|
+
mimeType: "application/x-mdl"
|
|
30
|
+
});
|
|
31
|
+
var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: ["org.dxos.role.article", "org.dxos.role.cardContent"] });
|
|
32
|
+
var RegistrySync = Capability.lazyModule("RegistrySync", {
|
|
33
|
+
requires: [
|
|
34
|
+
ClientCapabilities.Client,
|
|
35
|
+
Capabilities.AtomRegistry,
|
|
36
|
+
AppCapabilities.SkillDefinition,
|
|
37
|
+
Capabilities.OperationHandler
|
|
38
|
+
],
|
|
39
|
+
provides: [],
|
|
40
|
+
environments: [
|
|
41
|
+
"browser",
|
|
42
|
+
"node",
|
|
43
|
+
"tauri"
|
|
44
|
+
]
|
|
45
|
+
}, () => import("./chunk-registry-sync.mjs"));
|
|
46
|
+
var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
|
|
47
|
+
var Templates = Capability.lazyModule("Templates", {
|
|
48
|
+
provides: [RoutineCapabilities.Template],
|
|
49
|
+
environments: [
|
|
50
|
+
"browser",
|
|
51
|
+
"node",
|
|
52
|
+
"tauri",
|
|
53
|
+
"workerd"
|
|
54
|
+
]
|
|
55
|
+
}, () => import("./chunk-templates.mjs"));
|
|
56
|
+
var Translations = AppCapability.translations(translations);
|
|
57
|
+
var TriggerRuntimeController = Capability.lazyModule("TriggerRuntimeController", {
|
|
58
|
+
requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],
|
|
59
|
+
provides: [],
|
|
60
|
+
activatesOn: ClientEvents.SpacesAvailable,
|
|
61
|
+
environments: [
|
|
62
|
+
"browser",
|
|
63
|
+
"node",
|
|
64
|
+
"tauri"
|
|
65
|
+
]
|
|
66
|
+
}, () => import("./chunk-trigger-runtime-controller.mjs"));
|
|
67
|
+
//#endregion
|
|
68
|
+
export { AppGraphBuilder, Commands, CreateObject, LayerSpecs, OperationHandler, PluginAsset, ReactSurface, RegistrySync, Schema, Templates, Translations, TriggerRuntimeController };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=capabilities.browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.browser.mjs","names":[],"sources":["../../src/capabilities/gen/browser.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'browser' condition.\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as ClientEvents from '@dxos/plugin-client/ClientEvents';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\nimport pluginSpec from '../../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder.ts'), {\n environments: ['browser', 'node', 'tauri'],\n});\n\nexport const Commands = AppCapability.commands(() => import('../commands.ts'));\n\n// The entry carries a live `customPanel` (`CreateRoutinePanel`) alongside the object factory, so the\n// module cannot be evaluated without React.\nexport const CreateObject = SpaceCapability.createObject(() => import('../create-object.ts'), {\n environments: ['browser', 'tauri'],\n});\n\nexport const LayerSpecs = AppCapability.layerSpec(() => import('../layer-specs.ts'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'));\n\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\n\nexport const ReactSurface = AppCapability.surface(() => import('../react-surface.ts'), {\n roles: ['org.dxos.role.article', 'org.dxos.role.cardContent'],\n});\n\nexport const RegistrySync = Capability.lazyModule(\n 'RegistrySync',\n {\n requires: [\n ClientCapabilities.Client,\n Capabilities.AtomRegistry,\n AppCapabilities.SkillDefinition,\n Capabilities.OperationHandler,\n ],\n provides: [],\n environments: ['browser', 'node', 'tauri'],\n },\n () => import('../registry-sync.ts'),\n);\n\nexport const Schema = AppCapability.schema(() => import('../schema.ts'));\n\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['browser', 'node', 'tauri', 'workerd'] },\n () => import('../templates.ts'),\n);\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const TriggerRuntimeController = Capability.lazyModule(\n 'TriggerRuntimeController',\n {\n requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],\n provides: [],\n // Runtime event: triggers only need to react to spaces once the client observes them.\n activatesOn: ClientEvents.SpacesAvailable,\n environments: ['browser', 'node', 'tauri'],\n },\n () => import('../trigger-runtime-controller.ts'),\n);\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,kCAA4B,EACpG,cAAc;CAAC;CAAW;CAAQ;AAAO,EAC3C,CAAC;AAED,IAAa,WAAW,cAAc,eAAe,OAAO,uBAAiB;AAI7E,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,8BAAwB,EAC5F,cAAc,CAAC,WAAW,OAAO,EACnC,CAAC;AAED,IAAa,aAAa,cAAc,gBAAgB,OAAO,4BAAsB;CACnF,MAAM;CACN,UAAU,CAAC,aAAa,SAAS;AACnC,CAAC;AAED,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,gCAA0B;AAEtG,IAAa,cAAc,cAAc,YAAY;CACnD,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC;AAED,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAwB,EACrF,OAAO,CAAC,yBAAyB,2BAA2B,EAC9D,CAAC;AAED,IAAa,eAAe,WAAW,WACrC,gBACA;CACE,UAAU;EACR,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,aAAa;CACf;CACA,UAAU,CAAC;CACX,cAAc;EAAC;EAAW;EAAQ;CAAO;AAC3C,SACM,OAAO,4BACf;AAEA,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAe;AAEvE,IAAa,YAAY,WAAW,WAClC,aACA;CAAE,UAAU,CAAC,oBAAoB,QAAQ;CAAG,cAAc;EAAC;EAAW;EAAQ;EAAS;CAAS;AAAE,SAC5F,OAAO,wBACf;AAEA,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,2BAA2B,WAAW,WACjD,4BACA;CACE,UAAU,CAAC,mBAAmB,QAAQ,aAAa,qBAAqB;CACxE,UAAU,CAAC;CAEX,aAAa,aAAa;CAC1B,cAAc;EAAC;EAAW;EAAQ;CAAO;AAC3C,SACM,OAAO,yCACf"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as PLUGIN_default } from "./chunk-PLUGIN.mjs";
|
|
1
2
|
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
2
3
|
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
4
|
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
@@ -8,13 +9,14 @@ import * as ClientCapabilities from "@dxos/plugin-client/ClientCapabilities";
|
|
|
8
9
|
import * as ClientEvents from "@dxos/plugin-client/ClientEvents";
|
|
9
10
|
import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
|
|
10
11
|
import { meta } from "#meta";
|
|
11
|
-
//#region PLUGIN.mdl?raw
|
|
12
|
-
var PLUGIN_default = "---\nid: org.dxos.plugin.automation\nname: AutomationPlugin\nversion: 0.1.0\n---\n\nA workflow automation engine plugin for DXOS Composer that enables event-driven\npipelines connecting ECHO objects to persistent compute functions.\n\nTriggers listen for ECHO mutations, timer schedules, incoming feeds (email, webhook),\nor data subscriptions and invoke `PersistentOperation` handlers when their conditions\nfire. Each trigger carries optional structured input and is dispatched by a\nper-space `TriggerDispatcher` that runs locally in the browser, or is delegated to\nthe DXOS edge when the trigger's `remote` flag is set. A space-wide\n`triggersDisabled` flag acts as a kill-switch that stops local dispatch entirely.\n\nThe plugin integrates with the `@dxos/compute` operation registry and the\n`@dxos/functions-runtime` execution layer. Skill, operation-handler, and\ntoolkit contributions from other plugins are gathered at application scope and\nmerged before being offered to space-level operation registries, so any plugin\nthat contributes a `Capabilities.OperationHandler` automatically becomes\ninvocable from an automation trigger.\n\nUsers interact with automations through the `AutomationPanel` settings surface,\nwhich lists active triggers for a space (or for a specific ECHO object) and\nopens the `TriggerEditor` form to create, configure, and enable/disable\nindividual triggers.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|-------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\nExisting types used by this plugin (defined in `@dxos/compute` and `@dxos/functions-runtime`):\n\n| Type | Source | Role in AutomationPlugin |\n|----------------------|---------------------------|--------------------------------------------------------------------|\n| `Trigger` | `@dxos/compute` | Persistent trigger configuration (spec, function ref, input, enabled) |\n| `PersistentOperation`| `@dxos/compute` | Registered compute function callable from a trigger |\n| `Trace.Message` | `@dxos/compute` | Execution trace record appended after each trigger run |\n| `Script` | `@dxos/compute` | Source script that produces one or more `PersistentOperation`s |\n| `Feed` | `@dxos/echo` | Feed object that a `feed`-spec trigger listens to |\n| `ComputeGraph` | `@dxos/conductor` | Visual workflow graph selectable as a trigger function |\n\nNew types defined by this plugin:\n\n```mdl\ntype TriggerTemplate\n desc: |\n Lightweight description of a trigger's spec used when creating a trigger\n from a pre-defined template (e.g. from a Skill action).\n literals: timer | feed\n fields:\n type: timer | feed\n cron?: string # required when type === timer; cron expression\n feed?: Feed # required when type === feed; the feed to subscribe to\n```\n\n## Components\n\n```mdl\ncomponent AutomationPanel\n desc: |\n Settings surface that lists all triggers for a space (or filtered to a\n specific ECHO object) and provides inline create / edit / delete via the\n TriggerEditor form. Displayed inside Settings.Panel at the path\n `<spacePath>/settings/org.dxos.plugin.automation.automations`.\n props:\n space: Space\n object?: Obj.Unknown # when set, only triggers matching this object are shown\n initialTrigger?: Trigger # pre-populate TriggerEditor for a new trigger\n onDone?: () => void\n state:\n trigger?: Trigger # trigger currently open in TriggerEditor (undefined = list view)\n selected?: Trigger # the existing trigger being edited (undefined = new)\n slots:\n (none)\n actions:\n handleAdd() # open TriggerEditor with a blank Trigger\n handleSelect(t: Trigger) # open TriggerEditor for an existing trigger\n handleDelete(t: Trigger) # remove trigger from space.db\n handleSave(t: Trigger) # persist new or update selected trigger\n handleCancel()\n handleForceRunTrigger(t: Trigger) # invoke timer trigger immediately\n handleResetCursor(t: Trigger) # clear feed cursor on a feed trigger\n layout: |\n ┌──────────────────────────────────┐\n │ [list view — triggers exist] │\n │ ┌────────────────────────────┐ │\n │ │ ○ fn-name [▶] [✕] │ │\n │ │ ● fn-name [↺] [✕] │ │\n │ └────────────────────────────┘ │\n │ ───────────────────────────── │\n │ [+ New Trigger] │\n ├──────────────────────────────────┤\n │ [editor view — trigger selected] │\n │ Settings.Item │\n │ └── TriggerEditor │\n └──────────────────────────────────┘\n```\n\n```mdl\ncomponent TriggerEditor\n desc: |\n Form-driven editor for a single Trigger. Renders a Form.Root backed by the\n Trigger schema with custom field overrides for function/workflow selection,\n spec kind selector, feed selector, subscription query builder, and\n structured input editor.\n props:\n db: Database\n trigger: Trigger\n types: TypeOption[] # available ECHO types for query builder\n tags: Tag[] # available tags for query builder\n readonlySpec?: boolean # lock spec.kind and spec.query (e.g. editing from an object context)\n onSave: (t: Partial<Trigger>) => void\n onCancel: () => void\n state:\n (managed by Form.Root)\n slots:\n (none)\n```\n\n```mdl\ncomponent FunctionsPanel\n desc: |\n Settings surface listing all PersistentOperation objects in a space.\n Each row shows the function name, optional source script name, a\n \"go to script\" icon button, and a delete button.\n props:\n space: Space\n state:\n functions: PersistentOperation[]\n scripts: Script[]\n slots:\n (none)\n actions:\n handleGoToScript(fn: PersistentOperation) # navigate to source Script\n handleDelete(fn: PersistentOperation) # remove function via SpaceOperation\n```\n\n```mdl\ncomponent TemplateEditor\n desc: |\n Markdown + Handlebars source editor backed by a Ref<Text>. Decorates\n Handlebars tags, DXN/URL tokens, and XML nodes. Reused by Routine and\n Skill article surfaces and by downstream plugins (plugin-script,\n plugin-magazine) via the `@dxos/plugin-routine/components` export.\n props:\n id: string\n source?: Ref<Text>\n lineNumbers?: boolean\n```\n\n```mdl\ncomponent RoutineProperties\n desc: Object-properties form for a Routine, rendered via ObjectProperties.\n props:\n routine: Routine\n```\n\n## Surfaces\n\n```mdl\nsurface skill -> SkillArticle # article for Skill objects\nsurface prompt -> RoutineArticle # article for Routine objects (template editor + run)\nsurface prompts -> RoutineList # space-home prompt list; dispatches RunPromptInNewChat\n```\n\n## Operations\n\n```mdl\nop CreateTriggerFromTemplate\n desc: |\n Creates a new Trigger from a lightweight template, optionally wiring it to\n a named Script's PersistentOperation, and navigates to the automations\n settings panel for the target space.\n input:\n db: Database\n template: TriggerTemplate\n enabled?: boolean # default false\n scriptName?: string # if provided, looks up Script by name and wires function ref\n input?: Record<string, any> # optional structured input forwarded to the trigger\n output: void\n effects: [echo:write, layout:navigate]\n requires: [SpaceOperation.AddObject, LayoutOperation.Open]\n note: |\n Resolves the named Script, finds its linked PersistentOperation, and sets\n trigger.function = Ref.make(fn). Template type determines spec:\n timer → Trigger.specTimer(cron)\n feed → Trigger.specFeed(feed)\n Trigger is added as a hidden object so it does not appear in the main graph.\n```\n\n```mdl\nop RunPromptInNewChat\n desc: Creates a new chat, binds context objects and skills, then runs a prompt.\n input:\n db: Database\n objects?: Obj[]\n skills?: string[]\n prompt: string | RoutineRef\n background?: boolean\n output: Chat\n effects: [echo:write, ai:infer]\n note: |\n Defined here so Routine UI (RoutineList, RoutineArticle) and downstream\n plugins can dispatch it without depending on plugin-assistant. The handler\n is contributed by plugin-assistant (chat creation + AiContext binding).\n When background is true, the prompt runs via the compute runtime without\n opening the chat UI. The returned Chat can be used to track progress.\n```\n\n## Features\n\n```mdl\nfeat F-1: Trigger Management\n\n req F-1.1: User can create a Trigger in any space via AutomationPanel.\n req F-1.2: User can edit an existing Trigger's function, spec, and input.\n req F-1.3: User can delete a Trigger; it is removed from space.db.\n req F-1.4: User can enable or disable a Trigger via an inline toggle.\n req F-1.5:\n when: object context provided to AutomationPanel\n then: only triggers matching that object's type or query are shown\n```\n\n```mdl\nfeat F-2: Trigger Dispatch\n\n req F-2.1:\n when: space.properties.triggersDisabled is unset or false\n then: TriggerDispatcher starts for that space\n\n req F-2.2:\n when: space.properties.triggersDisabled === true\n then: TriggerDispatcher stops for that space\n\n req F-2.3:\n when: triggersDisabled changes\n then: any in-flight dispatcher transition is cancelled before the new one starts\n\n req F-2.3a:\n when: trigger.remote === true\n then: the local TriggerDispatcher skips the trigger (it runs on the edge instead)\n\n req F-2.4:\n when: trigger spec.kind === \"timer\" and enabled === true\n then: TriggerDispatcher fires trigger according to cron expression\n\n req F-2.5:\n when: trigger spec.kind === \"feed\"\n then: TriggerDispatcher processes new messages from the linked Feed\n\n req F-2.6:\n when: trigger spec.kind === \"subscription\"\n then: TriggerDispatcher invokes trigger on matching ECHO object mutations\n```\n\n```mdl\nfeat F-3: Force Run and Cursor Reset\n\n req F-3.1:\n when: timer trigger is enabled and space.properties.triggersDisabled !== true\n then: user can force-run the trigger immediately from AutomationPanel\n\n req F-3.2:\n when: trigger.remote !== true\n then: force-run invokes TriggerDispatcher.invokeTrigger directly in-process\n\n req F-3.3:\n when: trigger.remote === true\n then: force-run calls FunctionsServiceClient.forceRunCronTrigger via HTTP\n\n req F-3.4:\n when: trigger spec.kind === \"feed\" and a cursor is stored\n then: user can reset the cursor to reprocess the feed from the beginning\n```\n\n```mdl\nfeat F-4: Operation Registry\n\n req F-4.1:\n when: plugin activates\n then: all Capabilities.OperationHandler contributions are merged into a single OperationHandlerProvider\n\n req F-4.2: OperationRegistry per space resolves operations from the merged OperationHandlerProvider.\n req F-4.3: Skill registry is populated from AppCapabilities.SkillDefinition contributions.\n req F-4.4: OpaqueToolkit aggregates AppCapabilities.Toolkit contributions for agent invocation.\n```\n\n```mdl\nfeat F-5: Trace Sink\n\n req F-5.1:\n when: a trigger executes\n then: execution trace messages are written to the space Feed via FeedTraceSink\n\n req F-5.2: FeedTraceSink is contributed to Capabilities.TraceSink and routed via makeRoutingSink.\n```\n\n```mdl\nfeat F-6: Create Trigger From Template\n\n req F-6.1:\n when: op:CreateTriggerFromTemplate is invoked\n then: a Trigger is created and added as a hidden ECHO object in the target space\n\n req F-6.2:\n when: scriptName is provided\n then: the Trigger.function is wired to the PersistentOperation linked to that Script\n\n req F-6.3:\n when: template.type === \"timer\"\n then: Trigger.spec is set via Trigger.specTimer(template.cron)\n\n req F-6.4:\n when: template.type === \"feed\"\n then: Trigger.spec is set via Trigger.specFeed(template.feed)\n\n req F-6.5:\n when: trigger is created\n then: layout navigates to the automations settings panel for the space\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create trigger via AutomationPanel\n given: AutomationPanel rendered for a space with no triggers\n when: user clicks \"New Trigger\"\n then:\n - TriggerEditor shown with a blank Trigger\n - selected state is undefined (new trigger mode)\n```\n\n```mdl\ntest T-2: Save new trigger\n given: TriggerEditor open with blank Trigger\n when: user fills in a function and spec, then saves\n then:\n - space.db.add called with a new Trigger\n - list view restored\n - onDone called\n```\n\n```mdl\ntest T-3: Edit existing trigger\n given: AutomationPanel listing one trigger\n when: user clicks the trigger row\n then:\n - TriggerEditor opens pre-populated with that trigger's values\n - selected state holds the original trigger\n - saving calls Obj.update on the original trigger\n```\n\n```mdl\ntest T-4: Enable/disable toggle\n given: AutomationPanel showing trigger with enabled = false\n when: user flips the toggle\n then:\n - Obj.update sets trigger.enabled = true\n - toggle reflects new state immediately\n```\n\n```mdl\ntest T-5: Force run timer trigger (local)\n given: timer trigger enabled, trigger.remote unset\n when: user clicks the force-run button\n then:\n - TriggerDispatcher.invokeTrigger called with a TimerEvent\n - no error surfaced to user\n```\n\n```mdl\ntest T-6: Dispatcher lifecycle on kill-switch change\n given: space triggersDisabled unset, dispatcher running\n when: space.properties.triggersDisabled changes to true\n then:\n - in-flight transition fiber interrupted\n - TriggerDispatcher.stop() called for that space\n```\n\n```mdl\ntest T-7: CreateTriggerFromTemplate with timer\n given: db contains Script \"daily-summary\", space triggersDisabled unset\n when: op:CreateTriggerFromTemplate invoked with template={type:\"timer\",cron:\"0 8 * * *\"}, scriptName=\"daily-summary\"\n then:\n - Trigger created with spec.kind === \"timer\", spec.cron === \"0 8 * * *\"\n - Trigger.function wired to PersistentOperation linked to \"daily-summary\" script\n - Trigger added as hidden ECHO object\n - layout navigates to automations settings panel\n```\n\n```mdl\ntest T-8: CreateTriggerFromTemplate with feed\n given: db contains a Feed object \"email-feed\"\n when: op:CreateTriggerFromTemplate invoked with template={type:\"feed\",feed:<email-feed>}\n then:\n - Trigger created with spec.kind === \"feed\", spec.feed === Ref to email-feed\n - Trigger added as hidden ECHO object\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive — the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n";
|
|
13
|
-
//#endregion
|
|
14
12
|
//#region src/capabilities/index.ts
|
|
15
|
-
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"), { environments: [
|
|
13
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"), { environments: [
|
|
14
|
+
"browser",
|
|
15
|
+
"node",
|
|
16
|
+
"tauri"
|
|
17
|
+
] });
|
|
16
18
|
var Commands = AppCapability.commands(() => import("./chunk-commands.mjs"));
|
|
17
|
-
var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"), { environments: [] });
|
|
19
|
+
var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"), { environments: ["browser", "tauri"] });
|
|
18
20
|
var LayerSpecs = AppCapability.layerSpec(() => import("./chunk-layer-specs.mjs"), {
|
|
19
21
|
name: "LayerSpecs",
|
|
20
22
|
provides: [Capabilities.TraceSink]
|
|
@@ -35,19 +37,32 @@ var RegistrySync = Capability.lazyModule("RegistrySync", {
|
|
|
35
37
|
Capabilities.OperationHandler
|
|
36
38
|
],
|
|
37
39
|
provides: [],
|
|
38
|
-
environments: [
|
|
40
|
+
environments: [
|
|
41
|
+
"browser",
|
|
42
|
+
"node",
|
|
43
|
+
"tauri"
|
|
44
|
+
]
|
|
39
45
|
}, () => import("./chunk-registry-sync.mjs"));
|
|
40
46
|
var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
|
|
41
47
|
var Templates = Capability.lazyModule("Templates", {
|
|
42
48
|
provides: [RoutineCapabilities.Template],
|
|
43
|
-
environments: [
|
|
49
|
+
environments: [
|
|
50
|
+
"browser",
|
|
51
|
+
"node",
|
|
52
|
+
"tauri",
|
|
53
|
+
"workerd"
|
|
54
|
+
]
|
|
44
55
|
}, () => import("./chunk-templates.mjs"));
|
|
45
56
|
var Translations = AppCapability.translations(translations);
|
|
46
57
|
var TriggerRuntimeController = Capability.lazyModule("TriggerRuntimeController", {
|
|
47
58
|
requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],
|
|
48
59
|
provides: [],
|
|
49
|
-
activatesOn: ClientEvents.
|
|
50
|
-
environments: [
|
|
60
|
+
activatesOn: ClientEvents.SpacesAvailable,
|
|
61
|
+
environments: [
|
|
62
|
+
"browser",
|
|
63
|
+
"node",
|
|
64
|
+
"tauri"
|
|
65
|
+
]
|
|
51
66
|
}, () => import("./chunk-trigger-runtime-controller.mjs"));
|
|
52
67
|
//#endregion
|
|
53
68
|
export { AppGraphBuilder, Commands, CreateObject, LayerSpecs, OperationHandler, PluginAsset, ReactSurface, RegistrySync, Schema, Templates, Translations, TriggerRuntimeController };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as ClientEvents from '@dxos/plugin-client/ClientEvents';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'), {\n environments: ['node'],\n});\nexport const Commands = AppCapability.commands(() => import('./commands'));\n// The entry carries a live `customPanel` (`CreateRoutinePanel`) alongside the object factory, so the\n// module cannot be evaluated without React.\nexport const CreateObject = SpaceCapability.createObject(() => import('./create-object'), {\n environments: [],\n});\nexport const LayerSpecs = AppCapability.layerSpec(() => import('./layer-specs'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'));\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: ['org.dxos.role.article', 'org.dxos.role.cardContent'],\n});\nexport const RegistrySync = Capability.lazyModule(\n 'RegistrySync',\n {\n requires: [\n ClientCapabilities.Client,\n Capabilities.AtomRegistry,\n AppCapabilities.SkillDefinition,\n Capabilities.OperationHandler,\n ],\n provides: [],\n environments: ['node'],\n },\n () => import('./registry-sync'),\n);\nexport const Schema = AppCapability.schema(() => import('./schema'));\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['node', 'workerd'] },\n () => import('./templates'),\n);\nexport const Translations = AppCapability.translations(translations);\nexport const TriggerRuntimeController = Capability.lazyModule(\n 'TriggerRuntimeController',\n {\n requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],\n provides: [],\n // Runtime event: triggers only need to react to spaces once the client observes them.\n activatesOn: ClientEvents.
|
|
1
|
+
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as ClientEvents from '@dxos/plugin-client/ClientEvents';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder.ts'), {\n environments: ['browser', 'node', 'tauri'],\n});\nexport const Commands = AppCapability.commands(() => import('./commands.ts'));\n// The entry carries a live `customPanel` (`CreateRoutinePanel`) alongside the object factory, so the\n// module cannot be evaluated without React.\nexport const CreateObject = SpaceCapability.createObject(() => import('./create-object.ts'), {\n environments: ['browser', 'tauri'],\n});\nexport const LayerSpecs = AppCapability.layerSpec(() => import('./layer-specs.ts'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler.ts'));\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface.ts'), {\n roles: ['org.dxos.role.article', 'org.dxos.role.cardContent'],\n});\nexport const RegistrySync = Capability.lazyModule(\n 'RegistrySync',\n {\n requires: [\n ClientCapabilities.Client,\n Capabilities.AtomRegistry,\n AppCapabilities.SkillDefinition,\n Capabilities.OperationHandler,\n ],\n provides: [],\n environments: ['browser', 'node', 'tauri'],\n },\n () => import('./registry-sync.ts'),\n);\nexport const Schema = AppCapability.schema(() => import('./schema.ts'));\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['browser', 'node', 'tauri', 'workerd'] },\n () => import('./templates.ts'),\n);\nexport const Translations = AppCapability.translations(translations);\nexport const TriggerRuntimeController = Capability.lazyModule(\n 'TriggerRuntimeController',\n {\n requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],\n provides: [],\n // Runtime event: triggers only need to react to spaces once the client observes them.\n activatesOn: ClientEvents.SpacesAvailable,\n environments: ['browser', 'node', 'tauri'],\n },\n () => import('./trigger-runtime-controller.ts'),\n);\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,kCAA2B,EACnG,cAAc;CAAC;CAAW;CAAQ;AAAO,EAC3C,CAAC;AACD,IAAa,WAAW,cAAc,eAAe,OAAO,uBAAgB;AAG5E,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,8BAAuB,EAC3F,cAAc,CAAC,WAAW,OAAO,EACnC,CAAC;AACD,IAAa,aAAa,cAAc,gBAAgB,OAAO,4BAAqB;CAClF,MAAM;CACN,UAAU,CAAC,aAAa,SAAS;AACnC,CAAC;AACD,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,gCAAyB;AACrG,IAAa,cAAc,cAAc,YAAY;CACnD,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC;AACD,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAuB,EACpF,OAAO,CAAC,yBAAyB,2BAA2B,EAC9D,CAAC;AACD,IAAa,eAAe,WAAW,WACrC,gBACA;CACE,UAAU;EACR,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,aAAa;CACf;CACA,UAAU,CAAC;CACX,cAAc;EAAC;EAAW;EAAQ;CAAO;AAC3C,SACM,OAAO,4BACf;AACA,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAc;AACtE,IAAa,YAAY,WAAW,WAClC,aACA;CAAE,UAAU,CAAC,oBAAoB,QAAQ;CAAG,cAAc;EAAC;EAAW;EAAQ;EAAS;CAAS;AAAE,SAC5F,OAAO,wBACf;AACA,IAAa,eAAe,cAAc,aAAa,YAAY;AACnE,IAAa,2BAA2B,WAAW,WACjD,4BACA;CACE,UAAU,CAAC,mBAAmB,QAAQ,aAAa,qBAAqB;CACxE,UAAU,CAAC;CAEX,aAAa,aAAa;CAC1B,cAAc;EAAC;EAAW;EAAQ;CAAO;AAC3C,SACM,OAAO,yCACf"}
|
|
@@ -7,7 +7,11 @@ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
|
7
7
|
import * as ClientCapabilities from "@dxos/plugin-client/ClientCapabilities";
|
|
8
8
|
import * as ClientEvents from "@dxos/plugin-client/ClientEvents";
|
|
9
9
|
//#region src/capabilities/gen/node.ts
|
|
10
|
-
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"), { environments: [
|
|
10
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"), { environments: [
|
|
11
|
+
"browser",
|
|
12
|
+
"node",
|
|
13
|
+
"tauri"
|
|
14
|
+
] });
|
|
11
15
|
var Commands = AppCapability.commands(() => import("./chunk-commands.mjs"));
|
|
12
16
|
var LayerSpecs = AppCapability.layerSpec(() => import("./chunk-layer-specs.mjs"), {
|
|
13
17
|
name: "LayerSpecs",
|
|
@@ -22,19 +26,32 @@ var RegistrySync = Capability.lazyModule("RegistrySync", {
|
|
|
22
26
|
Capabilities.OperationHandler
|
|
23
27
|
],
|
|
24
28
|
provides: [],
|
|
25
|
-
environments: [
|
|
29
|
+
environments: [
|
|
30
|
+
"browser",
|
|
31
|
+
"node",
|
|
32
|
+
"tauri"
|
|
33
|
+
]
|
|
26
34
|
}, () => import("./chunk-registry-sync.mjs"));
|
|
27
35
|
var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
|
|
28
36
|
var Templates = Capability.lazyModule("Templates", {
|
|
29
37
|
provides: [RoutineCapabilities.Template],
|
|
30
|
-
environments: [
|
|
38
|
+
environments: [
|
|
39
|
+
"browser",
|
|
40
|
+
"node",
|
|
41
|
+
"tauri",
|
|
42
|
+
"workerd"
|
|
43
|
+
]
|
|
31
44
|
}, () => import("./chunk-templates.mjs"));
|
|
32
45
|
var Translations = AppCapability.translations(translations);
|
|
33
46
|
var TriggerRuntimeController = Capability.lazyModule("TriggerRuntimeController", {
|
|
34
47
|
requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],
|
|
35
48
|
provides: [],
|
|
36
|
-
activatesOn: ClientEvents.
|
|
37
|
-
environments: [
|
|
49
|
+
activatesOn: ClientEvents.SpacesAvailable,
|
|
50
|
+
environments: [
|
|
51
|
+
"browser",
|
|
52
|
+
"node",
|
|
53
|
+
"tauri"
|
|
54
|
+
]
|
|
38
55
|
}, () => import("./chunk-trigger-runtime-controller.mjs"));
|
|
39
56
|
var CreateObject = void 0;
|
|
40
57
|
var PluginAsset = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.node.mjs","names":[],"sources":["../../src/capabilities/gen/node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' condition.\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as ClientEvents from '@dxos/plugin-client/ClientEvents';\n\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder'), {\n environments: ['node'],\n});\n\nexport const Commands = AppCapability.commands(() => import('../commands'));\n\nexport const LayerSpecs = AppCapability.layerSpec(() => import('../layer-specs'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler'));\n\nexport const RegistrySync = Capability.lazyModule(\n 'RegistrySync',\n {\n requires: [\n ClientCapabilities.Client,\n Capabilities.AtomRegistry,\n AppCapabilities.SkillDefinition,\n Capabilities.OperationHandler,\n ],\n provides: [],\n environments: ['node'],\n },\n () => import('../registry-sync'),\n);\n\nexport const Schema = AppCapability.schema(() => import('../schema'));\n\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['node', 'workerd'] },\n () => import('../templates'),\n);\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const TriggerRuntimeController = Capability.lazyModule(\n 'TriggerRuntimeController',\n {\n requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],\n provides: [],\n // Runtime event: triggers only need to react to spaces once the client observes them.\n activatesOn: ClientEvents.
|
|
1
|
+
{"version":3,"file":"capabilities.node.mjs","names":[],"sources":["../../src/capabilities/gen/node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' condition.\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as ClientEvents from '@dxos/plugin-client/ClientEvents';\n\nimport { translations } from '#translations';\nimport { RoutineCapabilities } from '#types';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder.ts'), {\n environments: ['browser', 'node', 'tauri'],\n});\n\nexport const Commands = AppCapability.commands(() => import('../commands.ts'));\n\nexport const LayerSpecs = AppCapability.layerSpec(() => import('../layer-specs.ts'), {\n name: 'LayerSpecs',\n provides: [Capabilities.TraceSink],\n});\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'));\n\nexport const RegistrySync = Capability.lazyModule(\n 'RegistrySync',\n {\n requires: [\n ClientCapabilities.Client,\n Capabilities.AtomRegistry,\n AppCapabilities.SkillDefinition,\n Capabilities.OperationHandler,\n ],\n provides: [],\n environments: ['browser', 'node', 'tauri'],\n },\n () => import('../registry-sync.ts'),\n);\n\nexport const Schema = AppCapability.schema(() => import('../schema.ts'));\n\nexport const Templates = Capability.lazyModule(\n 'Templates',\n { provides: [RoutineCapabilities.Template], environments: ['browser', 'node', 'tauri', 'workerd'] },\n () => import('../templates.ts'),\n);\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const TriggerRuntimeController = Capability.lazyModule(\n 'TriggerRuntimeController',\n {\n requires: [ClientCapabilities.Client, Capabilities.ProcessManagerRuntime],\n provides: [],\n // Runtime event: triggers only need to react to spaces once the client observes them.\n activatesOn: ClientEvents.SpacesAvailable,\n environments: ['browser', 'node', 'tauri'],\n },\n () => import('../trigger-runtime-controller.ts'),\n);\n\nexport const CreateObject = undefined;\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;;;;;;AAgBA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,kCAA4B,EACpG,cAAc;CAAC;CAAW;CAAQ;AAAO,EAC3C,CAAC;AAED,IAAa,WAAW,cAAc,eAAe,OAAO,uBAAiB;AAE7E,IAAa,aAAa,cAAc,gBAAgB,OAAO,4BAAsB;CACnF,MAAM;CACN,UAAU,CAAC,aAAa,SAAS;AACnC,CAAC;AAED,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,gCAA0B;AAEtG,IAAa,eAAe,WAAW,WACrC,gBACA;CACE,UAAU;EACR,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,aAAa;CACf;CACA,UAAU,CAAC;CACX,cAAc;EAAC;EAAW;EAAQ;CAAO;AAC3C,SACM,OAAO,4BACf;AAEA,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAe;AAEvE,IAAa,YAAY,WAAW,WAClC,aACA;CAAE,UAAU,CAAC,oBAAoB,QAAQ;CAAG,cAAc;EAAC;EAAW;EAAQ;EAAS;CAAS;AAAE,SAC5F,OAAO,wBACf;AAEA,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,2BAA2B,WAAW,WACjD,4BACA;CACE,UAAU,CAAC,mBAAmB,QAAQ,aAAa,qBAAqB;CACxE,UAAU,CAAC;CAEX,aAAa,aAAa;CAC1B,cAAc;EAAC;EAAW;EAAQ;CAAO;AAC3C,SACM,OAAO,yCACf;AAEA,IAAa,eAAe,KAAA;AAC5B,IAAa,cAAc,KAAA;AAC3B,IAAa,eAAe,KAAA"}
|