@dxos/plugin-debug 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 +241 -3
- package/README.md +27 -3
- package/dist/lib/Debug.mjs.map +1 -1
- package/dist/lib/DebugNodes.mjs +21 -2
- package/dist/lib/DebugNodes.mjs.map +1 -1
- package/dist/lib/DebugOperation.mjs +166 -2
- package/dist/lib/DebugOperation.mjs.map +1 -1
- package/dist/lib/DebugPlugin.mjs.map +1 -1
- package/dist/lib/DebugSurface.mjs +7 -2
- package/dist/lib/DebugSurface.mjs.map +1 -1
- package/dist/lib/IncidentSpace.mjs +2 -0
- package/dist/lib/PipelineSpace.mjs +2 -0
- package/dist/lib/ReviewSpace.mjs +2 -0
- package/dist/lib/StockfishSpace.mjs +2 -0
- package/dist/lib/TidepoolSpace.mjs +2 -0
- package/dist/lib/WeatherSpace.mjs +2 -0
- package/dist/lib/WorkerSpace.mjs +2 -0
- package/dist/lib/capabilities.browser.mjs +71 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +17 -7
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs +13 -3
- package/dist/lib/capabilities.node.mjs.map +1 -1
- package/dist/lib/capabilities.tauri.mjs +71 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +3 -1
- package/dist/lib/capabilities.workerd.mjs.map +1 -1
- package/dist/lib/chunk-DebugConsole.mjs +241 -0
- package/dist/lib/chunk-DebugConsole.mjs.map +1 -0
- package/dist/lib/chunk-DebugObjectPanel.mjs +12 -16
- package/dist/lib/chunk-DebugObjectPanel.mjs.map +1 -1
- package/dist/lib/chunk-DebugPanelDrawer.mjs +48 -0
- package/dist/lib/chunk-DebugPanelDrawer.mjs.map +1 -0
- package/dist/lib/chunk-DebugPanelHeader.mjs +280 -0
- package/dist/lib/chunk-DebugPanelHeader.mjs.map +1 -0
- package/dist/lib/chunk-DebugPanelStatus.mjs +127 -0
- package/dist/lib/chunk-DebugPanelStatus.mjs.map +1 -0
- package/dist/lib/chunk-DebugSettings.mjs +81 -70
- package/dist/lib/chunk-DebugSettings.mjs.map +1 -1
- package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs +21 -12
- package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs.map +1 -1
- package/dist/lib/chunk-DebugStatus.mjs +12 -12
- package/dist/lib/chunk-DebugStatus.mjs.map +1 -1
- package/dist/lib/chunk-IncidentSpace.mjs +269 -0
- package/dist/lib/chunk-IncidentSpace.mjs.map +1 -0
- package/dist/lib/chunk-LoggerPanel.mjs +18 -0
- package/dist/lib/chunk-LoggerPanel.mjs.map +1 -0
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-PipelineSpace.mjs +378 -0
- package/dist/lib/chunk-PipelineSpace.mjs.map +1 -0
- package/dist/lib/chunk-ReviewSpace.mjs +356 -0
- package/dist/lib/chunk-ReviewSpace.mjs.map +1 -0
- package/dist/lib/chunk-SpaceGenerator.mjs +107 -73
- package/dist/lib/chunk-SpaceGenerator.mjs.map +1 -1
- package/dist/lib/chunk-StatsPanel.mjs +28 -35
- package/dist/lib/chunk-StatsPanel.mjs.map +1 -1
- package/dist/lib/chunk-StockfishSpace.mjs +563 -0
- package/dist/lib/chunk-StockfishSpace.mjs.map +1 -0
- package/dist/lib/chunk-TidepoolSpace.mjs +544 -0
- package/dist/lib/chunk-TidepoolSpace.mjs.map +1 -0
- package/dist/lib/chunk-WeatherSpace.mjs +206 -0
- package/dist/lib/chunk-WeatherSpace.mjs.map +1 -0
- package/dist/lib/chunk-Wireframe.mjs +6 -6
- package/dist/lib/chunk-Wireframe.mjs.map +1 -1
- package/dist/lib/chunk-WorkerSpace.mjs +177 -0
- package/dist/lib/chunk-WorkerSpace.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +72 -40
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/chunk-create-space-from-template.mjs +55 -0
- package/dist/lib/chunk-create-space-from-template.mjs.map +1 -0
- package/dist/lib/chunk-errors.mjs +13 -0
- package/dist/lib/chunk-errors.mjs.map +1 -0
- package/dist/lib/chunk-graph-retention.mjs +14 -0
- package/dist/lib/chunk-graph-retention.mjs.map +1 -0
- package/dist/lib/chunk-insert-lorem-ipsum.mjs +2 -2
- package/dist/lib/chunk-log-recording.mjs +29 -1
- package/dist/lib/chunk-log-recording.mjs.map +1 -1
- package/dist/lib/chunk-open-page.mjs +29 -0
- package/dist/lib/chunk-open-page.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +5 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +73 -71
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-settings.mjs +2 -2
- package/dist/lib/chunk-settings.mjs.map +1 -1
- package/dist/lib/chunk-snapshot.mjs +170 -0
- package/dist/lib/chunk-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-space-templates.mjs +21 -0
- package/dist/lib/chunk-space-templates.mjs.map +1 -0
- package/dist/lib/chunk-stats-panel.mjs +1 -1
- package/dist/lib/chunk-stats-panel.mjs.map +1 -1
- package/dist/lib/chunk-undo.mjs +17 -0
- package/dist/lib/chunk-undo.mjs.map +1 -0
- package/dist/lib/chunk-view-state.mjs +37 -0
- package/dist/lib/chunk-view-state.mjs.map +1 -0
- package/dist/lib/components.mjs +68 -28
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/containers.mjs +5 -2
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/index.mjs +8 -2
- package/dist/lib/meta.mjs +3 -2
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/operations.mjs +7 -1
- package/dist/lib/operations.mjs.map +1 -1
- package/dist/lib/plugin.mjs +2 -2
- package/dist/lib/plugin.mjs.map +1 -1
- package/dist/lib/translations.mjs +13 -4
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/scripts/build-template-archive.d.ts +2 -0
- package/dist/types/scripts/build-template-archive.d.ts.map +1 -0
- package/dist/types/src/DebugPlugin.d.ts +2 -2
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/DebugSurfaces.d.ts +4 -5
- package/dist/types/src/capabilities/DebugSurfaces.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +31 -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/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 +2 -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 +2 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/graph-retention.d.ts +5 -0
- package/dist/types/src/capabilities/graph-retention.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +2 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/log-recording.d.ts +4 -0
- package/dist/types/src/capabilities/log-recording.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/space-templates.d.ts +14 -0
- package/dist/types/src/capabilities/space-templates.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts +4 -3
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -1
- package/dist/types/src/components/SchemaTable/index.d.ts +1 -1
- package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugConsole/DebugConsole.d.ts +12 -0
- package/dist/types/src/containers/DebugConsole/DebugConsole.d.ts.map +1 -0
- package/dist/types/src/containers/DebugConsole/DebugConsole.stories.d.ts +103 -0
- package/dist/types/src/containers/DebugConsole/DebugConsole.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DebugConsole/cli.d.ts +24 -0
- package/dist/types/src/containers/DebugConsole/cli.d.ts.map +1 -0
- package/dist/types/src/containers/DebugConsole/index.d.ts +2 -0
- package/dist/types/src/containers/DebugConsole/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +1 -1
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +1 -1
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugPanel/DebugPanel.d.ts +30 -0
- package/dist/types/src/containers/DebugPanel/DebugPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanel/DebugPanel.stories.d.ts +126 -0
- package/dist/types/src/containers/DebugPanel/DebugPanel.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelContext.d.ts +16 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelContext.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelHeader.d.ts +14 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelHeader.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelMain.d.ts +6 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelMain.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelSidebar.d.ts +6 -0
- package/dist/types/src/containers/DebugPanel/DebugPanelSidebar.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanel/index.d.ts +7 -0
- package/dist/types/src/containers/DebugPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanel/view-state.d.ts +46 -0
- package/dist/types/src/containers/DebugPanel/view-state.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.d.ts +10 -0
- package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.stories.d.ts +114 -0
- package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanelDrawer/index.d.ts +2 -0
- package/dist/types/src/containers/DebugPanelDrawer/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.d.ts +11 -0
- package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.stories.d.ts +107 -0
- package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPanelStatus/index.d.ts +2 -0
- package/dist/types/src/containers/DebugPanelStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugPortSettings/DebugPortSettings.d.ts.map +1 -1
- package/dist/types/src/containers/DebugPortSettings/DebugPortSettings.stories.d.ts +13 -4
- package/dist/types/src/containers/DebugPortSettings/DebugPortSettings.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DebugPortSettings/index.d.ts +1 -1
- package/dist/types/src/containers/DebugPortSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +2 -2
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts +14 -5
- package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSettings/index.d.ts +1 -1
- package/dist/types/src/containers/DebugSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugStatus/index.d.ts +1 -1
- package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -1
- package/dist/types/src/containers/LoggerPanel/LoggerPanel.d.ts +6 -0
- package/dist/types/src/containers/LoggerPanel/LoggerPanel.d.ts.map +1 -0
- package/dist/types/src/containers/LoggerPanel/LoggerPanel.stories.d.ts +107 -0
- package/dist/types/src/containers/LoggerPanel/LoggerPanel.stories.d.ts.map +1 -0
- package/dist/types/src/containers/LoggerPanel/index.d.ts +2 -0
- package/dist/types/src/containers/LoggerPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.stories.d.ts +13 -4
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +1 -1
- package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -1
- package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts +5 -1
- package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts.map +1 -1
- package/dist/types/src/containers/StatsPanel/index.d.ts +1 -1
- package/dist/types/src/containers/StatsPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts +2 -2
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
- package/dist/types/src/containers/Wireframe/index.d.ts +1 -1
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +7 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +123 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/DebugOperationHandlerSet.d.ts.map +1 -1
- package/dist/types/src/operations/create-space-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-space-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/errors.d.ts +33 -0
- package/dist/types/src/operations/errors.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open-page.d.ts +5 -0
- package/dist/types/src/operations/open-page.d.ts.map +1 -0
- package/dist/types/src/operations/snapshot.d.ts +5 -0
- package/dist/types/src/operations/snapshot.d.ts.map +1 -0
- package/dist/types/src/operations/snapshot.test.d.ts +2 -0
- package/dist/types/src/operations/snapshot.test.d.ts.map +1 -0
- package/dist/types/src/operations/undo.d.ts +5 -0
- package/dist/types/src/operations/undo.d.ts.map +1 -0
- package/dist/types/src/operations/undo.test.d.ts +2 -0
- package/dist/types/src/operations/undo.test.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts.map +1 -1
- package/dist/types/src/samples/crm/PipelineSpace.d.ts +21 -0
- package/dist/types/src/samples/crm/PipelineSpace.d.ts.map +1 -0
- package/dist/types/src/samples/crm/PipelineSpace.test.d.ts +2 -0
- package/dist/types/src/samples/crm/PipelineSpace.test.d.ts.map +1 -0
- package/dist/types/src/samples/crm/accounts.d.ts +55 -0
- package/dist/types/src/samples/crm/accounts.d.ts.map +1 -0
- package/dist/types/src/samples/crm/inbox.d.ts +14 -0
- package/dist/types/src/samples/crm/inbox.d.ts.map +1 -0
- package/dist/types/src/samples/crm/pipeline.d.ts +9 -0
- package/dist/types/src/samples/crm/pipeline.d.ts.map +1 -0
- package/dist/types/src/samples/crm/util.d.ts +14 -0
- package/dist/types/src/samples/crm/util.d.ts.map +1 -0
- package/dist/types/src/samples/incident/IncidentSpace.d.ts +21 -0
- package/dist/types/src/samples/incident/IncidentSpace.d.ts.map +1 -0
- package/dist/types/src/samples/incident/IncidentSpace.test.d.ts +2 -0
- package/dist/types/src/samples/incident/IncidentSpace.test.d.ts.map +1 -0
- package/dist/types/src/samples/incident/docs.d.ts +14 -0
- package/dist/types/src/samples/incident/docs.d.ts.map +1 -0
- package/dist/types/src/samples/incident/project.d.ts +16 -0
- package/dist/types/src/samples/incident/project.d.ts.map +1 -0
- package/dist/types/src/samples/incident/tasks.d.ts +9 -0
- package/dist/types/src/samples/incident/tasks.d.ts.map +1 -0
- package/dist/types/src/samples/incident/util.d.ts +32 -0
- package/dist/types/src/samples/incident/util.d.ts.map +1 -0
- package/dist/types/src/samples/index.d.ts +8 -0
- package/dist/types/src/samples/index.d.ts.map +1 -0
- package/dist/types/src/samples/review/ReviewSpace.d.ts +19 -0
- package/dist/types/src/samples/review/ReviewSpace.d.ts.map +1 -0
- package/dist/types/src/samples/review/ReviewSpace.test.d.ts +2 -0
- package/dist/types/src/samples/review/ReviewSpace.test.d.ts.map +1 -0
- package/dist/types/src/samples/review/assets.d.ts +19 -0
- package/dist/types/src/samples/review/assets.d.ts.map +1 -0
- package/dist/types/src/samples/review/util.d.ts +4 -0
- package/dist/types/src/samples/review/util.d.ts.map +1 -0
- package/dist/types/src/samples/review/work.d.ts +15 -0
- package/dist/types/src/samples/review/work.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/StockfishSpace.d.ts +27 -0
- package/dist/types/src/samples/stockfish/StockfishSpace.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/StockfishSpace.test.d.ts +2 -0
- package/dist/types/src/samples/stockfish/StockfishSpace.test.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/docs.d.ts +8 -0
- package/dist/types/src/samples/stockfish/docs.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/game.d.ts +10 -0
- package/dist/types/src/samples/stockfish/game.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/project.d.ts +31 -0
- package/dist/types/src/samples/stockfish/project.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/run.test.d.ts +2 -0
- package/dist/types/src/samples/stockfish/run.test.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/skill.d.ts +8 -0
- package/dist/types/src/samples/stockfish/skill.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/tasks.d.ts +12 -0
- package/dist/types/src/samples/stockfish/tasks.d.ts.map +1 -0
- package/dist/types/src/samples/stockfish/util.d.ts +14 -0
- package/dist/types/src/samples/stockfish/util.d.ts.map +1 -0
- package/dist/types/src/samples/tidepool/TidepoolSpace.d.ts +22 -0
- package/dist/types/src/samples/tidepool/TidepoolSpace.d.ts.map +1 -0
- package/dist/types/src/samples/tidepool/TidepoolSpace.test.d.ts +2 -0
- package/dist/types/src/samples/tidepool/TidepoolSpace.test.d.ts.map +1 -0
- package/dist/types/src/samples/tidepool/docs.d.ts +12 -0
- package/dist/types/src/samples/tidepool/docs.d.ts.map +1 -0
- package/dist/types/src/samples/tidepool/project.d.ts +20 -0
- package/dist/types/src/samples/tidepool/project.d.ts.map +1 -0
- package/dist/types/src/samples/tidepool/tasks.d.ts +14 -0
- package/dist/types/src/samples/tidepool/tasks.d.ts.map +1 -0
- package/dist/types/src/samples/tidepool/team.d.ts +9 -0
- package/dist/types/src/samples/tidepool/team.d.ts.map +1 -0
- package/dist/types/src/samples/tidepool/util.d.ts +14 -0
- package/dist/types/src/samples/tidepool/util.d.ts.map +1 -0
- package/dist/types/src/samples/weather/WeatherSpace.d.ts +21 -0
- package/dist/types/src/samples/weather/WeatherSpace.d.ts.map +1 -0
- package/dist/types/src/samples/weather/WeatherSpace.test.d.ts +2 -0
- package/dist/types/src/samples/weather/WeatherSpace.test.d.ts.map +1 -0
- package/dist/types/src/samples/weather/project.d.ts +20 -0
- package/dist/types/src/samples/weather/project.d.ts.map +1 -0
- package/dist/types/src/samples/weather/skill.d.ts +12 -0
- package/dist/types/src/samples/weather/skill.d.ts.map +1 -0
- package/dist/types/src/samples/weather/tasks.d.ts +9 -0
- package/dist/types/src/samples/weather/tasks.d.ts.map +1 -0
- package/dist/types/src/samples/weather/util.d.ts +16 -0
- package/dist/types/src/samples/weather/util.d.ts.map +1 -0
- package/dist/types/src/samples/worker/WorkerSpace.d.ts +22 -0
- package/dist/types/src/samples/worker/WorkerSpace.d.ts.map +1 -0
- package/dist/types/src/samples/worker/WorkerSpace.test.d.ts +2 -0
- package/dist/types/src/samples/worker/WorkerSpace.test.d.ts.map +1 -0
- package/dist/types/src/samples/worker/project.d.ts +18 -0
- package/dist/types/src/samples/worker/project.d.ts.map +1 -0
- package/dist/types/src/samples/worker/tasks.d.ts +9 -0
- package/dist/types/src/samples/worker/tasks.d.ts.map +1 -0
- package/dist/types/src/samples/worker/util.d.ts +14 -0
- package/dist/types/src/samples/worker/util.d.ts.map +1 -0
- package/dist/types/src/stories/SpaceTemplates.stories.d.ts +114 -0
- package/dist/types/src/stories/SpaceTemplates.stories.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/stub-drawer-plugin.d.ts +8 -0
- package/dist/types/src/testing/stub-drawer-plugin.d.ts.map +1 -0
- package/dist/types/src/testing/stub-tools-plugin.d.ts +19 -0
- package/dist/types/src/testing/stub-tools-plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +13 -4
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Debug.d.ts +2 -2
- package/dist/types/src/types/Debug.d.ts.map +1 -1
- package/dist/types/src/types/DebugNodes.d.ts +13 -1
- package/dist/types/src/types/DebugNodes.d.ts.map +1 -1
- package/dist/types/src/types/DebugOperation.d.ts +119 -0
- package/dist/types/src/types/DebugOperation.d.ts.map +1 -1
- package/dist/types/src/types/DebugSurface.d.ts +7 -0
- package/dist/types/src/types/DebugSurface.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +6 -6
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +3 -2
- package/package.json +129 -73
- package/scripts/build-template-archive.ts +65 -0
- package/src/DebugPlugin.ts +1 -1
- package/src/capabilities/DebugSurfaces.tsx +85 -71
- package/src/capabilities/app-graph-builder.test.ts +45 -0
- package/src/capabilities/app-graph-builder.ts +83 -46
- package/src/capabilities/gen/browser.ts +85 -0
- package/src/capabilities/gen/node.ts +15 -8
- package/src/capabilities/gen/tauri.ts +85 -0
- package/src/capabilities/gen/workerd.ts +11 -4
- package/src/capabilities/graph-retention.ts +23 -0
- package/src/capabilities/index.ts +18 -10
- package/src/capabilities/log-recording.ts +20 -1
- package/src/capabilities/operation-handler.ts +9 -0
- package/src/capabilities/react-surface.ts +33 -29
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/space-templates.ts +25 -0
- package/src/capabilities/stats-panel.ts +1 -1
- package/src/components/SchemaTable/SchemaTable.tsx +44 -10
- package/src/components/SchemaTable/index.ts +1 -1
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +22 -2
- package/src/components/SpaceGenerator/index.ts +2 -2
- package/src/components/SpaceGenerator/presets.ts +4 -4
- package/src/components/index.ts +2 -2
- package/src/containers/DebugConsole/DebugConsole.stories.tsx +29 -0
- package/src/containers/DebugConsole/DebugConsole.tsx +94 -0
- package/src/containers/DebugConsole/cli.ts +296 -0
- package/src/containers/DebugConsole/index.ts +5 -0
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +44 -44
- package/src/containers/DebugObjectPanel/index.ts +1 -1
- package/src/containers/DebugPanel/DebugPanel.stories.tsx +118 -0
- package/src/containers/DebugPanel/DebugPanel.tsx +72 -0
- package/src/containers/DebugPanel/DebugPanelContext.ts +33 -0
- package/src/containers/DebugPanel/DebugPanelHeader.tsx +54 -0
- package/src/containers/DebugPanel/DebugPanelMain.tsx +116 -0
- package/src/containers/DebugPanel/DebugPanelSidebar.tsx +123 -0
- package/src/containers/DebugPanel/index.ts +10 -0
- package/src/containers/DebugPanel/view-state.ts +60 -0
- package/src/containers/DebugPanelDrawer/DebugPanelDrawer.stories.tsx +92 -0
- package/src/containers/DebugPanelDrawer/DebugPanelDrawer.tsx +72 -0
- package/src/containers/DebugPanelDrawer/index.ts +5 -0
- package/src/containers/DebugPanelStatus/DebugPanelStatus.stories.tsx +119 -0
- package/src/containers/DebugPanelStatus/DebugPanelStatus.tsx +167 -0
- package/src/containers/DebugPanelStatus/index.ts +5 -0
- package/src/containers/DebugPortSettings/DebugPortSettings.stories.tsx +2 -2
- package/src/containers/DebugPortSettings/DebugPortSettings.tsx +33 -40
- package/src/containers/DebugPortSettings/index.ts +1 -1
- package/src/containers/DebugSettings/DebugSettings.stories.tsx +1 -1
- package/src/containers/DebugSettings/DebugSettings.tsx +71 -64
- package/src/containers/DebugSettings/index.ts +1 -1
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +39 -28
- package/src/containers/DebugSpaceObjectsPanel/index.ts +1 -1
- package/src/containers/DebugStatus/DebugStatus.tsx +10 -10
- package/src/containers/DebugStatus/index.ts +1 -1
- package/src/containers/LoggerPanel/LoggerPanel.stories.tsx +62 -0
- package/src/containers/LoggerPanel/LoggerPanel.tsx +28 -0
- package/src/containers/LoggerPanel/index.ts +5 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.stories.tsx +8 -8
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +102 -73
- package/src/containers/SpaceGenerator/index.ts +1 -1
- package/src/containers/StatsPanel/StatsPanel.tsx +32 -31
- package/src/containers/StatsPanel/index.ts +1 -1
- package/src/containers/Wireframe/Wireframe.tsx +8 -7
- package/src/containers/Wireframe/index.ts +1 -1
- package/src/containers/index.ts +22 -9
- package/src/errors.ts +23 -0
- package/src/index.ts +2 -2
- package/src/meta.ts +1 -1
- package/src/operations/DebugOperationHandlerSet.ts +5 -1
- package/src/operations/create-space-from-template.ts +57 -0
- package/src/operations/errors.ts +8 -0
- package/src/operations/index.ts +1 -1
- package/src/operations/open-page.ts +51 -0
- package/src/operations/snapshot.test.ts +57 -0
- package/src/operations/snapshot.ts +243 -0
- package/src/operations/undo.test.ts +19 -0
- package/src/operations/undo.ts +28 -0
- package/src/plugin.tsx +4 -0
- package/src/samples/crm/PipelineSpace.test.ts +55 -0
- package/src/samples/crm/PipelineSpace.ts +52 -0
- package/src/samples/crm/accounts.ts +153 -0
- package/src/samples/crm/inbox.ts +158 -0
- package/src/samples/crm/pipeline.ts +70 -0
- package/src/samples/crm/util.ts +18 -0
- package/src/samples/incident/IncidentSpace.test.ts +68 -0
- package/src/samples/incident/IncidentSpace.ts +61 -0
- package/src/samples/incident/docs.ts +111 -0
- package/src/samples/incident/project.ts +61 -0
- package/src/samples/incident/tasks.ts +101 -0
- package/src/samples/incident/util.ts +24 -0
- package/src/samples/index.ts +11 -0
- package/src/samples/review/ReviewSpace.test.ts +89 -0
- package/src/samples/review/ReviewSpace.ts +47 -0
- package/src/samples/review/assets.ts +123 -0
- package/src/samples/review/util.ts +10 -0
- package/src/samples/review/work.ts +249 -0
- package/src/samples/stockfish/StockfishSpace.test.ts +129 -0
- package/src/samples/stockfish/StockfishSpace.ts +70 -0
- package/src/samples/stockfish/docs.ts +65 -0
- package/src/samples/stockfish/game.ts +47 -0
- package/src/samples/stockfish/project.ts +87 -0
- package/src/samples/stockfish/run.test.ts +193 -0
- package/src/samples/stockfish/skill.ts +154 -0
- package/src/samples/stockfish/tasks.ts +306 -0
- package/src/samples/stockfish/util.ts +17 -0
- package/src/samples/tidepool/TidepoolSpace.test.ts +61 -0
- package/src/samples/tidepool/TidepoolSpace.ts +65 -0
- package/src/samples/tidepool/docs.ts +140 -0
- package/src/samples/tidepool/project.ts +57 -0
- package/src/samples/tidepool/tasks.ts +252 -0
- package/src/samples/tidepool/team.ts +87 -0
- package/src/samples/tidepool/util.ts +18 -0
- package/src/samples/weather/WeatherSpace.test.ts +93 -0
- package/src/samples/weather/WeatherSpace.ts +59 -0
- package/src/samples/weather/project.ts +76 -0
- package/src/samples/weather/skill.ts +45 -0
- package/src/samples/weather/tasks.ts +98 -0
- package/src/samples/weather/util.ts +21 -0
- package/src/samples/worker/WorkerSpace.test.ts +102 -0
- package/src/samples/worker/WorkerSpace.ts +56 -0
- package/src/samples/worker/project.ts +72 -0
- package/src/samples/worker/tasks.ts +119 -0
- package/src/samples/worker/util.ts +17 -0
- package/src/stories/SpaceTemplates.stories.tsx +105 -0
- package/src/testing/index.ts +6 -0
- package/src/testing/stub-drawer-plugin.ts +65 -0
- package/src/testing/stub-tools-plugin.tsx +95 -0
- package/src/translations.ts +15 -6
- package/src/types/Debug.ts +2 -2
- package/src/types/DebugNodes.ts +21 -1
- package/src/types/DebugOperation.ts +206 -0
- package/src/types/DebugSurface.ts +7 -0
- package/src/types/index.ts +6 -6
- package/dist/lib/chunk-LogStatus.mjs +0 -44
- package/dist/lib/chunk-LogStatus.mjs.map +0 -1
- package/dist/types/src/containers/LogStatus/LogStatus.d.ts +0 -6
- package/dist/types/src/containers/LogStatus/LogStatus.d.ts.map +0 -1
- package/dist/types/src/containers/LogStatus/index.d.ts +0 -2
- package/dist/types/src/containers/LogStatus/index.d.ts.map +0 -1
- package/src/containers/LogStatus/LogStatus.tsx +0 -51
- package/src/containers/LogStatus/index.ts +0 -5
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { buildArchive, histogram } from '@dxos/app-toolkit/testing';
|
|
8
|
+
import { Type } from '@dxos/echo';
|
|
9
|
+
import * as EffectEx from '@dxos/effect/EffectEx';
|
|
10
|
+
|
|
11
|
+
import * as WeatherSpace from './WeatherSpace.ts';
|
|
12
|
+
|
|
13
|
+
/** A task as the archive serializes it: refs become `{ '/': 'echo:///<id>' }`. */
|
|
14
|
+
type ArchivedTask = {
|
|
15
|
+
'@type'?: string;
|
|
16
|
+
'id': string;
|
|
17
|
+
'title'?: string;
|
|
18
|
+
'status'?: string;
|
|
19
|
+
'dependsOn'?: Array<{ '/': string }>;
|
|
20
|
+
'assignee'?: unknown;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe('Weather MCP template', () => {
|
|
24
|
+
test('builds the project, its skill and four steps, and nothing else', { timeout: 120_000 }, async ({ expect }) => {
|
|
25
|
+
const { json, objectCount } = await EffectEx.runPromise(buildArchive(WeatherSpace.make()));
|
|
26
|
+
const counts = histogram(json);
|
|
27
|
+
const countOf = (typename: string) =>
|
|
28
|
+
Object.entries(counts)
|
|
29
|
+
.filter(([type]) => type.includes(typename))
|
|
30
|
+
.reduce((total, [, count]) => total + count, 0);
|
|
31
|
+
|
|
32
|
+
expect(objectCount).toBeGreaterThan(0);
|
|
33
|
+
expect(countOf('type.project')).toBe(1);
|
|
34
|
+
expect(countOf('type.instructions')).toBe(1);
|
|
35
|
+
expect(countOf('type.skill')).toBe(1);
|
|
36
|
+
expect(countOf('type.taskSet')).toBe(1);
|
|
37
|
+
expect(countOf('type.task:')).toBe(4);
|
|
38
|
+
expect(countOf('type.document')).toBe(0);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('every schema the content persists is declared', { timeout: 120_000 }, async ({ expect }) => {
|
|
42
|
+
const { json } = await EffectEx.runPromise(buildArchive(WeatherSpace.make()));
|
|
43
|
+
const declared = new Set(WeatherSpace.make().schemas.map((schema) => Type.getTypename(schema)));
|
|
44
|
+
|
|
45
|
+
for (const type of Object.keys(histogram(json))) {
|
|
46
|
+
const typename = type.match(/(?:[\w-]+\.)+type\.[\w.]+/)?.[0];
|
|
47
|
+
// `spaceProperties` is the space root the harness creates, in every archive and no definition.
|
|
48
|
+
if (typename && typename !== 'org.dxos.type.spaceProperties') {
|
|
49
|
+
expect(declared).toContain(typename);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test(
|
|
55
|
+
'four ordered steps, all the agent’s, each depending on the one before',
|
|
56
|
+
{ timeout: 120_000 },
|
|
57
|
+
async ({ expect }) => {
|
|
58
|
+
const tasks = await archived<ArchivedTask>('type.task:');
|
|
59
|
+
|
|
60
|
+
expect(tasks.map((task) => task.title)).toEqual([
|
|
61
|
+
'Build the weather MCP Worker',
|
|
62
|
+
'Deploy it to a temporary Cloudflare account',
|
|
63
|
+
'Configure the server for this space',
|
|
64
|
+
'Test the tool from this chat',
|
|
65
|
+
]);
|
|
66
|
+
expect(tasks.every((task) => task.status === 'todo')).toBe(true);
|
|
67
|
+
// The run is unattended: a step assigned to the reader would stall it.
|
|
68
|
+
expect(tasks.every((task) => task.assignee === undefined)).toBe(true);
|
|
69
|
+
expect(tasks.map((task) => task.dependsOn?.map((ref) => ref['/']))).toEqual([
|
|
70
|
+
undefined,
|
|
71
|
+
...tasks.slice(0, -1).map((task) => [`echo:///${task.id}`]),
|
|
72
|
+
]);
|
|
73
|
+
},
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
test(
|
|
77
|
+
'the seeded skill starts with no MCP server for the run to fill in',
|
|
78
|
+
{ timeout: 120_000 },
|
|
79
|
+
async ({ expect }) => {
|
|
80
|
+
const [skill] = await archived<{ mcpServers?: unknown[]; agentCanEnable?: boolean }>('type.skill');
|
|
81
|
+
|
|
82
|
+
expect(skill?.mcpServers).toEqual([]);
|
|
83
|
+
expect(skill?.agentCanEnable).toBe(true);
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
/** The archive's objects of one typename fragment, in the order they were written. */
|
|
89
|
+
const archived = async <T>(fragment: string): Promise<T[]> => {
|
|
90
|
+
const { json } = await EffectEx.runPromise(buildArchive(WeatherSpace.make()));
|
|
91
|
+
const objects: Array<{ '@type'?: string }> = JSON.parse(json).objects;
|
|
92
|
+
return objects.filter((object) => object['@type']?.includes(fragment)) as T[];
|
|
93
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
|
|
9
|
+
import type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
10
|
+
import * as SampleSpace from '@dxos/app-toolkit/SampleSpace';
|
|
11
|
+
|
|
12
|
+
import { ProjectPhase } from './project.ts';
|
|
13
|
+
import { WeatherSkill } from './skill.ts';
|
|
14
|
+
import { Tasks } from './tasks.ts';
|
|
15
|
+
import { REFERENCE } from './util.ts';
|
|
16
|
+
|
|
17
|
+
export { FORECAST_URL } from './util.ts';
|
|
18
|
+
|
|
19
|
+
const phases = {
|
|
20
|
+
skill: WeatherSkill,
|
|
21
|
+
tasks: Tasks,
|
|
22
|
+
project: ProjectPhase,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The fastest loop through building an MCP server and using it: one Worker with one tool over the
|
|
27
|
+
* Open-Meteo forecast, four tasks from an empty sandbox to a tool call in this chat, all of them the
|
|
28
|
+
* agent's.
|
|
29
|
+
*
|
|
30
|
+
* It sits between `WorkerSpace` (a deploy with nothing to call) and `StockfishSpace` (an engine, a
|
|
31
|
+
* design stage and a publish step): enough to exercise the whole build → deploy → configure → call
|
|
32
|
+
* path, small enough to run unattended. The account stays temporary and unclaimed, and the server is
|
|
33
|
+
* configured on a seeded skill because a skill is where a chat reads MCP servers from.
|
|
34
|
+
*/
|
|
35
|
+
export const make = (): SampleSpace.Definition<typeof phases, void> =>
|
|
36
|
+
SampleSpace.make({
|
|
37
|
+
// Reaches a space only where the definition is applied directly (the generator panel, the
|
|
38
|
+
// archive test): the create-space dialog takes its icon from `space-templates.ts`.
|
|
39
|
+
space: { name: 'Weather MCP', icon: 'sun', hue: 'sky' },
|
|
40
|
+
reference: REFERENCE,
|
|
41
|
+
phases,
|
|
42
|
+
build: (phases) =>
|
|
43
|
+
Effect.gen(function* () {
|
|
44
|
+
const skill = yield* phases.skill();
|
|
45
|
+
const tasks = yield* phases.tasks();
|
|
46
|
+
yield* phases.project({ tasks, skill });
|
|
47
|
+
|
|
48
|
+
// No root collection: this space seeds no documents — the project, its tasks and the skill
|
|
49
|
+
// surface through their own containers.
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const makeTemplate = (): AppCapabilities.SpaceTemplate =>
|
|
54
|
+
SampleSpace.makeTemplate({
|
|
55
|
+
id: 'org.dxos.plugin-debug.template.weather',
|
|
56
|
+
description:
|
|
57
|
+
'Four tasks an agent runs alone: a one-tool MCP server over a weather API, deployed to a temporary Worker and called from the chat.',
|
|
58
|
+
definition: make(),
|
|
59
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as SampleSpace from '@dxos/app-toolkit/SampleSpace';
|
|
8
|
+
import * as Instructions from '@dxos/compute/Instructions';
|
|
9
|
+
import * as Project from '@dxos/compute/Project';
|
|
10
|
+
import { Database, Ref } from '@dxos/echo';
|
|
11
|
+
import { Text } from '@dxos/schema';
|
|
12
|
+
import { Outline } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { type SkillResult } from './skill.ts';
|
|
15
|
+
import { type TasksResult } from './tasks.ts';
|
|
16
|
+
|
|
17
|
+
export type ProjectInput = { tasks: TasksResult; skill: SkillResult };
|
|
18
|
+
|
|
19
|
+
export type ProjectResult = { project: Project.Project; instructions: Instructions.Instructions };
|
|
20
|
+
|
|
21
|
+
const INSTRUCTIONS = `Build, deploy, configure and test the weather MCP server described by the task \
|
|
22
|
+
list, on your own and in one go: start the first task now, work them in order, and set each one's \
|
|
23
|
+
status as you finish it. Do not stop to ask — nothing in this project needs me.
|
|
24
|
+
|
|
25
|
+
The task descriptions are the whole specification: one Worker, one tool (\`get_weather\`), one \
|
|
26
|
+
upstream API. There is no design stage. If a step starts to look like architecture, it is the wrong step.
|
|
27
|
+
|
|
28
|
+
Write the code yourself in one sandbox, driving it through the Sandbox skill \
|
|
29
|
+
(\`org.dxos.skill.sandbox\`). Do not delegate to the coding agent in the sandbox image — it has none \
|
|
30
|
+
of this space's context.
|
|
31
|
+
|
|
32
|
+
The server is called from a browser, so it must answer CORS preflights and send CORS headers on \
|
|
33
|
+
every response — without them the tool silently never connects. Deploy with \`wrangler deploy --temporary\`. Do not claim the account and never file or repeat the \
|
|
34
|
+
claim URL. The container is not durable, so file the Worker URL and the tool's response on this \
|
|
35
|
+
project in the turn you produce them.
|
|
36
|
+
|
|
37
|
+
Configure the server by setting its URL on the Weather MCP skill's \`mcpServers\` with the Database \
|
|
38
|
+
skill; that skill is already bound here, so the tool is available on your next turn.
|
|
39
|
+
|
|
40
|
+
This project needs no Cloudflare login and no API keys. If a step seems to need either, that is the \
|
|
41
|
+
wrong step.`;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The work-stream. It adopts the task set the tasks phase built and binds the Weather MCP skill
|
|
45
|
+
* through `instructions.skills` — the only path a seeded skill reaches a chat by — so the run can
|
|
46
|
+
* configure the server with one update and no enable step.
|
|
47
|
+
*/
|
|
48
|
+
export const ProjectPhase: SampleSpace.Phase<ProjectResult, ProjectInput> = SampleSpace.phase('project', {
|
|
49
|
+
// `Project.make` builds an outline for the project and the instructions' prose is stored as a
|
|
50
|
+
// Text; a phase has to declare every type it persists or the space cannot register it.
|
|
51
|
+
schemas: [Project.Project, Instructions.Instructions, Outline.Outline, Text.Text],
|
|
52
|
+
run: ({ tasks, skill }: ProjectInput) =>
|
|
53
|
+
Effect.gen(function* () {
|
|
54
|
+
const instructions = yield* Database.add(
|
|
55
|
+
Instructions.make({
|
|
56
|
+
name: 'Weather MCP',
|
|
57
|
+
text: INSTRUCTIONS,
|
|
58
|
+
skills: [Ref.make(skill.skill)],
|
|
59
|
+
objects: [Ref.make(tasks.taskSet)],
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const project = yield* Database.add(
|
|
64
|
+
Project.make({
|
|
65
|
+
name: 'Weather MCP',
|
|
66
|
+
description:
|
|
67
|
+
'A one-tool MCP server over the Open-Meteo forecast, deployed as a temporary Cloudflare Worker and called from this chat.',
|
|
68
|
+
status: 'active',
|
|
69
|
+
instructions: Ref.make(instructions),
|
|
70
|
+
taskSet: Ref.make(tasks.taskSet),
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return { project, instructions };
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as SampleSpace from '@dxos/app-toolkit/SampleSpace';
|
|
8
|
+
import * as Skill from '@dxos/compute/Skill';
|
|
9
|
+
import * as Template from '@dxos/compute/Template';
|
|
10
|
+
import { Database } from '@dxos/echo';
|
|
11
|
+
import { Text } from '@dxos/schema';
|
|
12
|
+
import { trim } from '@dxos/util';
|
|
13
|
+
|
|
14
|
+
const INSTRUCTIONS = trim`
|
|
15
|
+
Carries the weather MCP server this project deploys. Its \`mcpServers\` list starts empty: the
|
|
16
|
+
Worker URL only exists once the deploy has run, and the run sets it here. A chat with this skill
|
|
17
|
+
bound connects every listed server at the start of each turn, so the \`get_weather\` tool appears
|
|
18
|
+
on the turn after the URL is set.
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export type SkillResult = { skill: Skill.Skill };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The skill the deployed server hangs off. Seeded rather than created by the run because a skill is
|
|
25
|
+
* the one place a chat reads MCP servers from, and the project's instructions can bind a seeded
|
|
26
|
+
* object — so configuring the server is one field update, not a skill to author and enable.
|
|
27
|
+
*/
|
|
28
|
+
export const WeatherSkill: SampleSpace.Phase<SkillResult> = SampleSpace.phase('skill', {
|
|
29
|
+
schemas: [Skill.Skill, Text.Text],
|
|
30
|
+
run: () =>
|
|
31
|
+
Effect.gen(function* () {
|
|
32
|
+
const skill = yield* Database.add(
|
|
33
|
+
Skill.make({
|
|
34
|
+
key: 'org.dxos.skill.weatherMcp',
|
|
35
|
+
name: 'Weather MCP',
|
|
36
|
+
description: 'The weather MCP server deployed by this project.',
|
|
37
|
+
instructions: Template.make({ source: INSTRUCTIONS }),
|
|
38
|
+
mcpServers: [],
|
|
39
|
+
agentCanEnable: true,
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return { skill };
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as SampleSpace from '@dxos/app-toolkit/SampleSpace';
|
|
8
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { EntityId } from '@dxos/echo/Key';
|
|
10
|
+
import { Task, TaskSet } from '@dxos/types';
|
|
11
|
+
|
|
12
|
+
import { FORECAST_URL, daysAgo } from './util.ts';
|
|
13
|
+
|
|
14
|
+
//
|
|
15
|
+
// Four steps, flat and in order, all the agent's: nothing here needs the reader, so a chat can run
|
|
16
|
+
// the plan end to end on its own. Each depends on the one before it, so a runner working ahead is
|
|
17
|
+
// visibly out of order rather than merely early.
|
|
18
|
+
//
|
|
19
|
+
|
|
20
|
+
type TaskSeed = {
|
|
21
|
+
readonly title: string;
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly estimate?: Task.Estimate;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const STEPS: ReadonlyArray<TaskSeed> = [
|
|
27
|
+
{
|
|
28
|
+
title: 'Build the weather MCP Worker',
|
|
29
|
+
description: `One sandbox for the run. A TypeScript Worker that speaks MCP over Streamable HTTP on one endpoint — \`initialize\`, \`tools/list\` and \`tools/call\` — with exactly one tool, \`get_weather\`, taking \`latitude\` and \`longitude\` and returning the current temperature and wind speed plus the hourly series from ${FORECAST_URL} with those coordinates substituted. The MCP client runs in the browser, so every response must carry CORS headers and an \`OPTIONS\` preflight must answer 204: \`Access-Control-Allow-Origin: *\`, \`Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS\`, \`Access-Control-Allow-Headers\` covering \`content-type\`, \`accept\`, \`authorization\`, \`mcp-session-id\` and \`mcp-protocol-version\`, and \`Access-Control-Expose-Headers: mcp-session-id\`. No auth, no dependencies beyond wrangler. The client is the MCP TypeScript SDK's Streamable HTTP transport, and it needs more than the three methods: answer every request with \`Content-Type: application/json\` and a JSON-RPC response object at HTTP 200 — an unknown method too, as a JSON-RPC error, never a 4xx; in \`initialize\` echo the \`protocolVersion\` the client sent, with \`capabilities: { tools: {} }\` and a \`serverInfo\`; answer any notification (a message with no \`id\`, such as \`notifications/initialized\`) with 202 and no body, since a client whose notification gets a 4xx never finishes connecting; answer \`GET\` and \`DELETE\` on the endpoint with 405. Return the tool's result as \`{ content: [{ type: 'text', text: <the forecast as JSON> }] }\`. \`--temporary\` needs wrangler 4.102+, which needs Node 22 while the sandbox runs Node 20: install \`wrangler@latest\` and run it as \`npx --yes node@22 node_modules/wrangler/bin/wrangler.js\`.`,
|
|
30
|
+
estimate: 's',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: 'Deploy it to a temporary Cloudflare account',
|
|
34
|
+
description:
|
|
35
|
+
'`wrangler deploy --temporary` — plain `wrangler deploy` demands a token non-interactively. File the Worker URL on the project. Do not claim the account and do not file or repeat the claim URL: it is a bearer credential, and this run never needs it.',
|
|
36
|
+
estimate: 'xs',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'Configure the server for this space',
|
|
40
|
+
description:
|
|
41
|
+
"Set the Worker URL on the Weather MCP skill's `mcpServers` as `{ name: 'weather', url, protocol: 'http' }` through the Database skill's update tool. The skill is already bound to this chat and servers are connected at the start of every turn, so `get_weather` appears on your next turn — no restart.",
|
|
42
|
+
estimate: 'xs',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: 'Test the tool from this chat',
|
|
46
|
+
description:
|
|
47
|
+
'Before calling, check CORS against the deployed URL — `curl -i -X OPTIONS -H "Origin: http://localhost" -H "Access-Control-Request-Method: POST" -H "Access-Control-Request-Headers: content-type,mcp-session-id" <url>` must return the allow headers; a browser client fails its preflight otherwise, and the tool never appears. Then call `get_weather` for Berlin (52.52, 13.41) and file the response on the project. The call has to appear as a tool call in the transcript; a forecast the model produced on its own is a failure, not a pass.',
|
|
48
|
+
estimate: 'xs',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
export type TasksResult = { taskSet: TaskSet.TaskSet; tasks: Task.Task[] };
|
|
53
|
+
|
|
54
|
+
/** The four steps, each depending on the one before it. */
|
|
55
|
+
export const Tasks: SampleSpace.Phase<TasksResult> = SampleSpace.phase('tasks', {
|
|
56
|
+
schemas: [TaskSet.TaskSet, Task.Task],
|
|
57
|
+
run: () =>
|
|
58
|
+
Effect.gen(function* () {
|
|
59
|
+
const taskSet = yield* Database.add(
|
|
60
|
+
TaskSet.make({
|
|
61
|
+
name: 'Weather MCP',
|
|
62
|
+
description: 'From an empty sandbox to a weather tool this chat calls.',
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const tasks = STEPS.map((step) =>
|
|
67
|
+
Task.make({
|
|
68
|
+
title: step.title,
|
|
69
|
+
description: step.description,
|
|
70
|
+
estimate: step.estimate,
|
|
71
|
+
status: 'todo',
|
|
72
|
+
// Task carries no due date; its dates are activity-log lines, so that is where they go.
|
|
73
|
+
history: [
|
|
74
|
+
{
|
|
75
|
+
id: EntityId.random(),
|
|
76
|
+
date: daysAgo(0),
|
|
77
|
+
event: 'created' as const,
|
|
78
|
+
description: 'Filed from the weather MCP template.',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
yield* SampleSpace.children(taskSet, tasks, (taskSet, refs) => {
|
|
84
|
+
taskSet.tasks = refs;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
for (const [index, task] of tasks.entries()) {
|
|
88
|
+
if (index > 0) {
|
|
89
|
+
const previous = tasks[index - 1];
|
|
90
|
+
Obj.update(task, (task) => {
|
|
91
|
+
task.dependsOn = [Ref.make(previous)];
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return { taskSet, tasks };
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as SampleSpace from '@dxos/app-toolkit/SampleSpace';
|
|
6
|
+
|
|
7
|
+
/** Stable reference date so regenerations are reproducible. Override with NOW=2026-05-20 env. */
|
|
8
|
+
export const REFERENCE = process.env.NOW ? new Date(process.env.NOW) : new Date('2026-05-20T15:00:00Z');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Bound to the same reference the definition declares, so the pure content builders can date their
|
|
12
|
+
* objects without every one of them being an effect.
|
|
13
|
+
*/
|
|
14
|
+
export const clock = SampleSpace.makeClock(REFERENCE);
|
|
15
|
+
|
|
16
|
+
/** ISO timestamp that many days before {@link REFERENCE}, at an optional UTC hour of that day. */
|
|
17
|
+
export const daysAgo = clock.daysAgo;
|
|
18
|
+
|
|
19
|
+
/** The upstream the Worker's one tool wraps; parameterised on coordinates by the tool. */
|
|
20
|
+
export const FORECAST_URL =
|
|
21
|
+
'https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t=temperature_2m,wind_speed_10m&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { buildArchive, histogram } from '@dxos/app-toolkit/testing';
|
|
8
|
+
import { Type } from '@dxos/echo';
|
|
9
|
+
import * as EffectEx from '@dxos/effect/EffectEx';
|
|
10
|
+
|
|
11
|
+
import * as WorkerSpace from './WorkerSpace.ts';
|
|
12
|
+
|
|
13
|
+
/** A task as the archive serializes it: refs become `{ '/': 'echo:///<id>' }`. */
|
|
14
|
+
type ArchivedTask = {
|
|
15
|
+
'@type'?: string;
|
|
16
|
+
'id': string;
|
|
17
|
+
'title'?: string;
|
|
18
|
+
'status'?: string;
|
|
19
|
+
'dependsOn'?: Array<{ '/': string }>;
|
|
20
|
+
'assignee'?: { role?: string; name?: string };
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** The archive's tasks, in the order they were written. */
|
|
24
|
+
const taskArchive = async (definition: ReturnType<typeof WorkerSpace.make>): Promise<ArchivedTask[]> => {
|
|
25
|
+
const { json } = await EffectEx.runPromise(buildArchive(definition));
|
|
26
|
+
const objects: ArchivedTask[] = JSON.parse(json).objects;
|
|
27
|
+
return objects.filter((object) => object['@type']?.includes('type.task:'));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Built on demand rather than committed, so this asserts the shape in place of a fixture: if a
|
|
32
|
+
* schema it seeds changes incompatibly, the build fails here.
|
|
33
|
+
*/
|
|
34
|
+
describe('Worker template', () => {
|
|
35
|
+
test('builds the project and its five steps, and nothing else', { timeout: 120_000 }, async ({ expect }) => {
|
|
36
|
+
const { json, objectCount } = await EffectEx.runPromise(buildArchive(WorkerSpace.make()));
|
|
37
|
+
const counts = histogram(json);
|
|
38
|
+
const countOf = (typename: string) =>
|
|
39
|
+
Object.entries(counts)
|
|
40
|
+
.filter(([type]) => type.includes(typename))
|
|
41
|
+
.reduce((total, [, count]) => total + count, 0);
|
|
42
|
+
|
|
43
|
+
expect(objectCount).toBeGreaterThan(0);
|
|
44
|
+
expect(countOf('type.project')).toBe(1);
|
|
45
|
+
expect(countOf('type.instructions')).toBe(1);
|
|
46
|
+
expect(countOf('type.taskSet')).toBe(1);
|
|
47
|
+
expect(countOf('type.task:')).toBe(5);
|
|
48
|
+
// The URL and the response body are what the run produces, so the space ships no documents.
|
|
49
|
+
expect(countOf('type.document')).toBe(0);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Falsifiable without hardcoding the archive's contents: every typename in the archive must be one
|
|
53
|
+
// the definition DECLARED. The zero-count above would not be — `countOf` substring-matches, so
|
|
54
|
+
// asserting a typename is absent passes just as well when the typename is misspelled.
|
|
55
|
+
test('every schema the content persists is declared', { timeout: 120_000 }, async ({ expect }) => {
|
|
56
|
+
const { json } = await EffectEx.runPromise(buildArchive(WorkerSpace.make()));
|
|
57
|
+
const declared = new Set(WorkerSpace.make().schemas.map((schema) => Type.getTypename(schema)));
|
|
58
|
+
|
|
59
|
+
for (const type of Object.keys(histogram(json))) {
|
|
60
|
+
// Not namespace-limited: `Project.make` persists `com.example.type.project`, so matching only
|
|
61
|
+
// `org.dxos.*` would let the project's own types go unchecked.
|
|
62
|
+
const typename = type.match(/(?:[\w-]+\.)+type\.[\w.]+/)?.[0];
|
|
63
|
+
// `spaceProperties` is the space root the harness creates, not a phase's content, so it is in
|
|
64
|
+
// every archive and in no definition's schema list.
|
|
65
|
+
if (typename && typename !== 'org.dxos.type.spaceProperties') {
|
|
66
|
+
expect(declared).toContain(typename);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('every step is todo and each depends on the one before it', { timeout: 120_000 }, async ({ expect }) => {
|
|
72
|
+
const tasks = await taskArchive(WorkerSpace.make());
|
|
73
|
+
|
|
74
|
+
expect(tasks.map((task) => task.title)).toEqual([
|
|
75
|
+
'Create a sandbox and install wrangler',
|
|
76
|
+
'Write the Worker',
|
|
77
|
+
'Deploy it with no Cloudflare login',
|
|
78
|
+
'Fetch the deployed URL and check the response',
|
|
79
|
+
'Claim the temporary Cloudflare account',
|
|
80
|
+
]);
|
|
81
|
+
expect(tasks.every((task) => task.status === 'todo')).toBe(true);
|
|
82
|
+
|
|
83
|
+
// The identity each dependency names, not merely how many there are: a chain wired to the wrong
|
|
84
|
+
// predecessor has the same shape as the right one and would otherwise pass.
|
|
85
|
+
expect(tasks.map((task) => task.dependsOn?.map((ref) => ref['/']))).toEqual([
|
|
86
|
+
undefined,
|
|
87
|
+
...tasks.slice(0, -1).map((task) => [`echo:///${task.id}`]),
|
|
88
|
+
]);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// The one browser step is the reader's, and it is last: an agent with no login cannot update a
|
|
92
|
+
// claimed account, so claiming before the deploy would strand the run.
|
|
93
|
+
test('only the claim is assigned to the reader, and it is last', { timeout: 120_000 }, async ({ expect }) => {
|
|
94
|
+
const tasks = await taskArchive(WorkerSpace.make());
|
|
95
|
+
const assigned = tasks.filter((task) => task.assignee !== undefined);
|
|
96
|
+
|
|
97
|
+
expect(assigned.map((task) => task.title)).toEqual(['Claim the temporary Cloudflare account']);
|
|
98
|
+
// The role is what the row reads as "not the agent's"; a name alone would not say that.
|
|
99
|
+
expect(assigned.map((task) => task.assignee?.role)).toEqual(['user']);
|
|
100
|
+
expect(tasks.at(-1)?.title).toEqual('Claim the temporary Cloudflare account');
|
|
101
|
+
});
|
|
102
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
|
|
9
|
+
import type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
10
|
+
import * as SampleSpace from '@dxos/app-toolkit/SampleSpace';
|
|
11
|
+
|
|
12
|
+
import { ProjectPhase } from './project.ts';
|
|
13
|
+
import { Tasks } from './tasks.ts';
|
|
14
|
+
import { REFERENCE } from './util.ts';
|
|
15
|
+
|
|
16
|
+
const phases = {
|
|
17
|
+
tasks: Tasks,
|
|
18
|
+
project: ProjectPhase,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The smallest thing that still builds and deploys: one Cloudflare Worker returning a greeting and
|
|
23
|
+
* the time, as five tasks from an empty sandbox to a URL that answers.
|
|
24
|
+
*
|
|
25
|
+
* It is the short path through the same ground `StockfishSpace` covers at length. There the work is
|
|
26
|
+
* the engine and the deploy is one stage of five; here the deploy IS the project, so there is no
|
|
27
|
+
* brief to design against, no skill to bind and nothing seeded for the run to point at — a chat
|
|
28
|
+
* that reads the task list has the whole specification.
|
|
29
|
+
*
|
|
30
|
+
* Reachable with no credentials but the reader's own DXOS identity: the first deploy uses wrangler's
|
|
31
|
+
* unauthenticated mode, and the single consent screen is the last task.
|
|
32
|
+
*/
|
|
33
|
+
export const make = (): SampleSpace.Definition<typeof phases, void> =>
|
|
34
|
+
SampleSpace.make({
|
|
35
|
+
// Reaches a space only where the definition is applied directly (the generator panel, the
|
|
36
|
+
// archive test): the create-space dialog takes its icon from `space-templates.ts`, which
|
|
37
|
+
// overrides every template's by list index. See DESIGN.md §7.
|
|
38
|
+
space: { name: 'Hello Worker', icon: 'rocket-launch', hue: 'cyan' },
|
|
39
|
+
reference: REFERENCE,
|
|
40
|
+
phases,
|
|
41
|
+
build: (phases) =>
|
|
42
|
+
Effect.gen(function* () {
|
|
43
|
+
const tasks = yield* phases.tasks();
|
|
44
|
+
yield* phases.project({ tasks });
|
|
45
|
+
|
|
46
|
+
// No root collection: the root holds collections only, and this space seeds no documents —
|
|
47
|
+
// the project and its tasks surface through their own containers.
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const makeTemplate = (): AppCapabilities.SpaceTemplate =>
|
|
52
|
+
SampleSpace.makeTemplate({
|
|
53
|
+
id: 'org.dxos.plugin-debug.template.worker',
|
|
54
|
+
description: 'Five tasks from an empty sandbox to a Cloudflare Worker that answers, with no account to start.',
|
|
55
|
+
definition: make(),
|
|
56
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as SampleSpace from '@dxos/app-toolkit/SampleSpace';
|
|
8
|
+
import * as Instructions from '@dxos/compute/Instructions';
|
|
9
|
+
import * as Project from '@dxos/compute/Project';
|
|
10
|
+
import { Database, Ref } from '@dxos/echo';
|
|
11
|
+
import { Text } from '@dxos/schema';
|
|
12
|
+
import { Outline } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { type TasksResult } from './tasks.ts';
|
|
15
|
+
|
|
16
|
+
export type ProjectInput = { tasks: TasksResult };
|
|
17
|
+
|
|
18
|
+
export type ProjectResult = { project: Project.Project; instructions: Instructions.Instructions };
|
|
19
|
+
|
|
20
|
+
const INSTRUCTIONS = `Deploy the Worker described by the task list, working the tasks in order and \
|
|
21
|
+
setting each one's status as you finish it: the task list is how I follow this run.
|
|
22
|
+
|
|
23
|
+
What the Worker does is the whole specification — one fetch handler, JSON out, a greeting and the \
|
|
24
|
+
current UTC time. There is no design stage and nothing to choose. If a step starts to look like \
|
|
25
|
+
architecture, it is the wrong step.
|
|
26
|
+
|
|
27
|
+
Write the code yourself in one sandbox, driving it through the Sandbox skill \
|
|
28
|
+
(\`org.dxos.skill.sandbox\`). The sandbox image ships a coding agent of its own; do not delegate to \
|
|
29
|
+
it — it has none of this space's context, and its output would land on a container filesystem \
|
|
30
|
+
rather than in this project.
|
|
31
|
+
|
|
32
|
+
The container is not durable, so file what has to outlive it — the Worker URL, the response body — \
|
|
33
|
+
as artifacts on this project in the turn you produce it, not at the end. The claim URL that the \
|
|
34
|
+
deploy prints is a bearer credential for the account: give it to me directly and file it nowhere.
|
|
35
|
+
|
|
36
|
+
This project needs no Cloudflare login and no API keys. If a step seems to need either, that is the \
|
|
37
|
+
wrong step.`;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The work-stream. It adopts the task set the tasks phase built (`Project.make` would otherwise
|
|
41
|
+
* create its own empty one), and starts with no artifacts: the URL and the response are what the
|
|
42
|
+
* run produces, and seeding either would name something that does not exist.
|
|
43
|
+
*/
|
|
44
|
+
export const ProjectPhase: SampleSpace.Phase<ProjectResult, ProjectInput> = SampleSpace.phase('project', {
|
|
45
|
+
// Neither `Outline.Outline` nor `Text.Text` is created here directly: `Project.make` builds an
|
|
46
|
+
// outline for the project, and the instructions' prose is stored as a Text. A phase has to declare
|
|
47
|
+
// every type it persists or the space cannot register it.
|
|
48
|
+
schemas: [Project.Project, Instructions.Instructions, Outline.Outline, Text.Text],
|
|
49
|
+
run: ({ tasks }: ProjectInput) =>
|
|
50
|
+
Effect.gen(function* () {
|
|
51
|
+
const instructions = yield* Database.add(
|
|
52
|
+
Instructions.make({
|
|
53
|
+
name: 'Hello Worker',
|
|
54
|
+
text: INSTRUCTIONS,
|
|
55
|
+
objects: [Ref.make(tasks.taskSet)],
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const project = yield* Database.add(
|
|
60
|
+
Project.make({
|
|
61
|
+
name: 'Hello Worker',
|
|
62
|
+
description:
|
|
63
|
+
'One Cloudflare Worker that answers with a greeting and the time, deployed from a sandbox with no Cloudflare account.',
|
|
64
|
+
status: 'active',
|
|
65
|
+
instructions: Ref.make(instructions),
|
|
66
|
+
taskSet: Ref.make(tasks.taskSet),
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return { project, instructions };
|
|
71
|
+
}),
|
|
72
|
+
});
|