@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
package/src/containers/index.ts
CHANGED
|
@@ -4,15 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export const
|
|
12
|
-
import('./
|
|
7
|
+
import { type DebugConsoleProps } from './DebugConsole/index.ts';
|
|
8
|
+
import { type DebugPanelDrawerProps } from './DebugPanelDrawer/index.ts';
|
|
9
|
+
import { type DebugPanelStatusProps } from './DebugPanelStatus/index.ts';
|
|
10
|
+
|
|
11
|
+
export const DebugConsole: ComponentType<DebugConsoleProps> = lazy(() =>
|
|
12
|
+
import('./DebugConsole/index.ts').then((module) => ({ default: module.DebugConsole })),
|
|
13
|
+
);
|
|
14
|
+
export const DebugObjectPanel: ComponentType<any> = lazy(() => import('./DebugObjectPanel/index.ts'));
|
|
15
|
+
export const DebugSettings: ComponentType<any> = lazy(() => import('./DebugSettings/index.ts'));
|
|
16
|
+
export const DebugSpaceObjectsPanel: ComponentType<any> = lazy(() => import('./DebugSpaceObjectsPanel/index.ts'));
|
|
17
|
+
export const DebugPanelDrawer: ComponentType<DebugPanelDrawerProps> = lazy(() =>
|
|
18
|
+
import('./DebugPanelDrawer/index.ts').then((module) => ({ default: module.DebugPanelDrawer })),
|
|
19
|
+
);
|
|
20
|
+
export const DebugPanelStatus: ComponentType<DebugPanelStatusProps> = lazy(() =>
|
|
21
|
+
import('./DebugPanelStatus/index.ts').then((module) => ({ default: module.DebugPanelStatus })),
|
|
22
|
+
);
|
|
23
|
+
export const DebugStatus: ComponentType<any> = lazy(() => import('./DebugStatus/index.ts'));
|
|
24
|
+
export const LoggerPanel: ComponentType<any> = lazy(() =>
|
|
25
|
+
import('./LoggerPanel/index.ts').then((module) => ({ default: module.LoggerPanel })),
|
|
13
26
|
);
|
|
14
|
-
export const SpaceGenerator: ComponentType<any> = lazy(() => import('./SpaceGenerator'));
|
|
15
|
-
export const Wireframe: ComponentType<any> = lazy(() => import('./Wireframe'));
|
|
27
|
+
export const SpaceGenerator: ComponentType<any> = lazy(() => import('./SpaceGenerator/index.ts'));
|
|
28
|
+
export const Wireframe: ComponentType<any> = lazy(() => import('./Wireframe/index.ts'));
|
|
16
29
|
export const StatsPanel: ComponentType<any> = lazy(() =>
|
|
17
|
-
import('./StatsPanel').then((module) => ({ default: module.StatsPanel })),
|
|
30
|
+
import('./StatsPanel/index.ts').then((module) => ({ default: module.StatsPanel })),
|
|
18
31
|
);
|
package/src/errors.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { BaseError } from '@dxos/errors';
|
|
6
|
+
|
|
7
|
+
/** The requested template id matches nothing contributed; the operation's listing names the valid ids. */
|
|
8
|
+
export class SpaceTemplateNotFoundError extends BaseError.extend(
|
|
9
|
+
'SpaceTemplateNotFoundError',
|
|
10
|
+
'No space template is registered under that id.',
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
/** The requested space id resolves to no space on this client. */
|
|
14
|
+
export class SpaceNotFoundError extends BaseError.extend('SpaceNotFoundError', 'No space with that id.') {}
|
|
15
|
+
|
|
16
|
+
/** Applying a template failed part-way; the cause carries what the phase actually threw. */
|
|
17
|
+
export class SpaceTemplateApplyError extends BaseError.extend(
|
|
18
|
+
'SpaceTemplateApplyError',
|
|
19
|
+
'Failed to apply the space template.',
|
|
20
|
+
) {}
|
|
21
|
+
|
|
22
|
+
/** The history tracker has no undoable operation to revert. */
|
|
23
|
+
export class NothingToUndoError extends BaseError.extend('NothingToUndoError', 'Nothing to undo.') {}
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -8,5 +8,9 @@ import * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';
|
|
|
8
8
|
import { DebugOperation } from '#types';
|
|
9
9
|
|
|
10
10
|
export const handlers = OperationHandlerSet.lazy([
|
|
11
|
-
DebugOperation.InsertLoremIpsum.pipe(Operation.lazyHandler(() => import('./insert-lorem-ipsum'))),
|
|
11
|
+
DebugOperation.InsertLoremIpsum.pipe(Operation.lazyHandler(() => import('./insert-lorem-ipsum.ts'))),
|
|
12
|
+
DebugOperation.OpenPage.pipe(Operation.lazyHandler(() => import('./open-page.ts'))),
|
|
13
|
+
DebugOperation.Snapshot.pipe(Operation.lazyHandler(() => import('./snapshot.ts'))),
|
|
14
|
+
DebugOperation.CreateSpaceFromTemplate.pipe(Operation.lazyHandler(() => import('./create-space-from-template.ts'))),
|
|
15
|
+
DebugOperation.Undo.pipe(Operation.lazyHandler(() => import('./undo.ts'))),
|
|
12
16
|
]);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as ActivationEvents from '@dxos/app-framework/ActivationEvents';
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
+
import * as Plugin from '@dxos/app-framework/Plugin';
|
|
10
|
+
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
11
|
+
import * as AppSpace from '@dxos/app-toolkit/AppSpace';
|
|
12
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
13
|
+
import * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';
|
|
14
|
+
import * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';
|
|
15
|
+
|
|
16
|
+
import { DebugOperation } from '#types';
|
|
17
|
+
|
|
18
|
+
import { SpaceTemplateApplyError, SpaceTemplateNotFoundError } from '../errors.ts';
|
|
19
|
+
|
|
20
|
+
const summarize = ({ id, label, description }: AppCapabilities.SpaceTemplate) => ({ id, label, description });
|
|
21
|
+
|
|
22
|
+
const handler: Operation.WithHandler<typeof DebugOperation.CreateSpaceFromTemplate> =
|
|
23
|
+
DebugOperation.CreateSpaceFromTemplate.pipe(
|
|
24
|
+
Operation.withHandler(
|
|
25
|
+
Effect.fnUntraced(function* ({ id }) {
|
|
26
|
+
yield* Plugin.activate(ActivationEvents.SpaceTemplatesRequested);
|
|
27
|
+
const templates = yield* Capability.getAll(AppCapabilities.SpaceTemplate);
|
|
28
|
+
const available = templates.map(summarize);
|
|
29
|
+
if (!id) {
|
|
30
|
+
return { available };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const template = templates.find((template) => template.id === id);
|
|
34
|
+
if (!template) {
|
|
35
|
+
return yield* Effect.fail(
|
|
36
|
+
new SpaceTemplateNotFoundError({ context: { id, available: available.map(({ id }) => id) } }),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { space, subject } = yield* Operation.invoke(SpaceOperation.Create, {
|
|
41
|
+
name: template.label,
|
|
42
|
+
icon: template.icon,
|
|
43
|
+
hue: template.hue,
|
|
44
|
+
});
|
|
45
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
46
|
+
AppSpace.setSpaceTemplateId(space, template.id);
|
|
47
|
+
yield* Effect.tryPromise({
|
|
48
|
+
try: () => template.apply({ client, space }),
|
|
49
|
+
catch: (cause) => new SpaceTemplateApplyError({ context: { id: template.id }, cause }),
|
|
50
|
+
}).pipe(Effect.tapError(() => Effect.ignore(Operation.invoke(SpaceOperation.Delete, { space }))));
|
|
51
|
+
|
|
52
|
+
return { applied: summarize(template), spaceId: space.id, subject, available };
|
|
53
|
+
}),
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
export default handler;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { BaseError } from '@dxos/errors';
|
|
6
|
+
|
|
7
|
+
/** Debug operation failed. The underlying failure, where there is one, is the `cause`. */
|
|
8
|
+
export class DebugOperationError extends BaseError.extend('DebugOperationError', 'Debug operation failed.') {}
|
package/src/operations/index.ts
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
8
|
+
import * as AppGraph from '@dxos/app-graph/AppGraph';
|
|
9
|
+
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
10
|
+
import * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';
|
|
11
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
12
|
+
import * as AttentionCapabilities from '@dxos/plugin-attention/AttentionCapabilities';
|
|
13
|
+
import { Path } from '@dxos/react-ui-list/util';
|
|
14
|
+
|
|
15
|
+
import { DebugNodes, DebugOperation } from '#types';
|
|
16
|
+
|
|
17
|
+
import { DEBUG_PANEL_CONTEXT, debugPanelAspect } from '../containers/DebugPanel/view-state.ts';
|
|
18
|
+
|
|
19
|
+
const handler: Operation.WithHandler<typeof DebugOperation.OpenPage> = DebugOperation.OpenPage.pipe(
|
|
20
|
+
Operation.withHandler(
|
|
21
|
+
Effect.fnUntraced(function* ({ nodeId }) {
|
|
22
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
23
|
+
const viewState = yield* Capability.get(AttentionCapabilities.ViewState);
|
|
24
|
+
|
|
25
|
+
// The page's ancestors are built by connectors that run only on expansion.
|
|
26
|
+
AppGraph.expandPath(graph, nodeId);
|
|
27
|
+
|
|
28
|
+
// Tree paths run root, tree id, then each ancestor's qualified id; open every branch above the page.
|
|
29
|
+
const segments = nodeId.split('/');
|
|
30
|
+
const ancestors = segments
|
|
31
|
+
.slice(0, -1)
|
|
32
|
+
.map((_, index) => segments.slice(0, index + 1).join('/'))
|
|
33
|
+
.filter((id) => id.startsWith(DebugNodes.DEBUG_ROOT_ID) && id !== DebugNodes.DEBUG_ROOT_ID);
|
|
34
|
+
const branches = ancestors.map((_, index) =>
|
|
35
|
+
Path.create(DebugNodes.DEBUG_ROOT_ID, DEBUG_PANEL_CONTEXT, ...ancestors.slice(0, index + 1)),
|
|
36
|
+
);
|
|
37
|
+
viewState.update(debugPanelAspect, DEBUG_PANEL_CONTEXT, (prev) => ({
|
|
38
|
+
...prev,
|
|
39
|
+
nodeId,
|
|
40
|
+
open: [...new Set([...prev.open, ...branches])],
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
// A floating panel is opened by its own status-bar trigger; it shows the page when next opened.
|
|
44
|
+
if ((viewState.get(debugPanelAspect, DEBUG_PANEL_CONTEXT).mode ?? 'docked') === 'docked') {
|
|
45
|
+
yield* Operation.invoke(LayoutOperation.UpdateDrawer, { state: 'open' });
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export default handler;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
8
|
+
import * as EffectEx from '@dxos/effect/EffectEx';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
import * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';
|
|
11
|
+
import * as ClientEvents from '@dxos/plugin-client/ClientEvents';
|
|
12
|
+
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
13
|
+
import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
14
|
+
import * as Harness from '@dxos/plugin-testing/Harness';
|
|
15
|
+
|
|
16
|
+
import { DebugPlugin } from '#plugin';
|
|
17
|
+
import { DebugOperation } from '#types';
|
|
18
|
+
|
|
19
|
+
describe('DebugOperation.Snapshot', () => {
|
|
20
|
+
test('returns a degraded snapshot on a headless host', async ({ expect }) => {
|
|
21
|
+
await using harness = await Harness.createComposerTestApp({ plugins: [DebugPlugin()] });
|
|
22
|
+
|
|
23
|
+
const snapshot = await harness.runPromise(Operation.invoke(DebugOperation.Snapshot, {}));
|
|
24
|
+
|
|
25
|
+
// No deck plugin — the layout section degrades rather than failing the call.
|
|
26
|
+
expect(snapshot.layout).toBeUndefined();
|
|
27
|
+
// Attention is part of the harness core, so the section is present (and empty).
|
|
28
|
+
expect(snapshot.attention).toEqual([]);
|
|
29
|
+
expect(snapshot.planks).toEqual([]);
|
|
30
|
+
expect(snapshot.surfaces).toEqual([]);
|
|
31
|
+
expect(snapshot.toasts).toEqual([]);
|
|
32
|
+
expect(snapshot.plugins.installed).toBeGreaterThan(0);
|
|
33
|
+
expect(snapshot.plugins.active).toBeGreaterThan(0);
|
|
34
|
+
expect(snapshot.plugins.enabled).toBeLessThanOrEqual(snapshot.plugins.installed);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('reports the spaces and the errors logged since a timestamp', async ({ expect }) => {
|
|
38
|
+
await using harness = await Harness.createComposerTestApp({
|
|
39
|
+
plugins: [ClientPlugin.make({}), SpacePlugin({}), DebugPlugin()],
|
|
40
|
+
});
|
|
41
|
+
const client = harness.get(ClientCapabilities.Client);
|
|
42
|
+
await EffectEx.runAndForwardErrors(initializeIdentity(client));
|
|
43
|
+
await harness.waitForEvent(ClientEvents.SpacesAvailable);
|
|
44
|
+
|
|
45
|
+
const before = Date.now();
|
|
46
|
+
log.error('snapshot test error');
|
|
47
|
+
const snapshot = await harness.runPromise(Operation.invoke(DebugOperation.Snapshot, { since: before }));
|
|
48
|
+
|
|
49
|
+
expect(snapshot.spaces.length).toBeGreaterThan(0);
|
|
50
|
+
expect(snapshot.spaces.some((space) => space.default)).toBe(true);
|
|
51
|
+
expect(snapshot.spaces.every((space) => space.state === 'SPACE_READY')).toBe(true);
|
|
52
|
+
expect(snapshot.errors.map((error) => error.message)).toContain('snapshot test error');
|
|
53
|
+
|
|
54
|
+
const later = await harness.runPromise(Operation.invoke(DebugOperation.Snapshot, { since: Date.now() }));
|
|
55
|
+
expect(later.errors).toEqual([]);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
|
|
8
|
+
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
9
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
10
|
+
import * as Plugin from '@dxos/app-framework/Plugin';
|
|
11
|
+
import * as AppGraph from '@dxos/app-graph/AppGraph';
|
|
12
|
+
import * as AppGraphNode from '@dxos/app-graph/AppGraphNode';
|
|
13
|
+
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
14
|
+
import * as AppSpace from '@dxos/app-toolkit/AppSpace';
|
|
15
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
16
|
+
import { Filter, Obj, Query, Relation } from '@dxos/echo';
|
|
17
|
+
import { LogLevel } from '@dxos/log';
|
|
18
|
+
import * as AttentionCapabilities from '@dxos/plugin-attention/AttentionCapabilities';
|
|
19
|
+
import * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';
|
|
20
|
+
import * as Markdown from '@dxos/plugin-markdown/Markdown';
|
|
21
|
+
import { SpaceState } from '@dxos/protocols/buf/dxos/client/invitation_pb';
|
|
22
|
+
// UI-free subpath: the root barrel reaches the panel components.
|
|
23
|
+
import { logBuffer } from '@dxos/react-ui-debug/log-buffer';
|
|
24
|
+
import { AnchoredTo, type Message, type Thread } from '@dxos/types';
|
|
25
|
+
|
|
26
|
+
import { DebugOperation } from '#types';
|
|
27
|
+
|
|
28
|
+
type Translate = (label: unknown) => string | undefined;
|
|
29
|
+
|
|
30
|
+
/** Best-effort localization: an i18n tuple degrades to its key when no translator is active. */
|
|
31
|
+
const makeTranslate =
|
|
32
|
+
(translator: { t: (key: string, options?: unknown) => string } | undefined): Translate =>
|
|
33
|
+
(label) => {
|
|
34
|
+
if (typeof label === 'string') {
|
|
35
|
+
return label;
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(label) && typeof label[0] === 'string') {
|
|
38
|
+
return translator ? translator.t(label[0], label[1]) : label[0];
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** ECHO objects summarize to identity — a snapshot must be O(planks), never O(space). */
|
|
44
|
+
const summarizeSubject = (data: unknown) => {
|
|
45
|
+
if (data == null || typeof data !== 'object') {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
if (Obj.isObject(data)) {
|
|
49
|
+
return {
|
|
50
|
+
dxn: String(Obj.getURI(data)),
|
|
51
|
+
typename: Obj.getTypename(data),
|
|
52
|
+
name: Obj.getLabel(data),
|
|
53
|
+
// Bounded by the one open document, so the snapshot stays O(planks).
|
|
54
|
+
text: Obj.instanceOf(Markdown.Document, data) ? data.content.target?.content : undefined,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if ('id' in data && typeof data.id === 'string') {
|
|
58
|
+
return { id: data.id };
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** The comment threads on an object, with their messages loaded — the review companion's view of it. */
|
|
64
|
+
const collectComments = async (subject: unknown) => {
|
|
65
|
+
if (!Obj.isObject(subject)) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const db = Obj.getDatabase(subject);
|
|
69
|
+
if (!db) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
const anchors: AnchoredTo.AnchoredTo[] = await db
|
|
73
|
+
.query(Query.select(Filter.id(subject.id)).targetOf(AnchoredTo.AnchoredTo))
|
|
74
|
+
.run();
|
|
75
|
+
return Promise.all(
|
|
76
|
+
anchors.map(async (anchor) => {
|
|
77
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
78
|
+
const messages: Message.Message[] = await Promise.all(thread.messages.map((ref) => ref.load()));
|
|
79
|
+
return {
|
|
80
|
+
id: thread.id,
|
|
81
|
+
anchorId: anchor.id,
|
|
82
|
+
anchor: anchor.anchor,
|
|
83
|
+
status: thread.status,
|
|
84
|
+
messages: messages.map((message) => ({
|
|
85
|
+
id: message.id,
|
|
86
|
+
sender: message.sender.name ?? message.sender.identityDid,
|
|
87
|
+
text: message.blocks
|
|
88
|
+
.map((block) => (block._tag === 'text' ? block.text : undefined))
|
|
89
|
+
.filter((text): text is string => text !== undefined)
|
|
90
|
+
.join('\n'),
|
|
91
|
+
})),
|
|
92
|
+
};
|
|
93
|
+
}),
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const OPERATION_DXN = /dxn:[^/]+/;
|
|
98
|
+
|
|
99
|
+
/** Flattens the node's actions with one level of group expansion — what a menu would show. */
|
|
100
|
+
const collectActions = (
|
|
101
|
+
graph: Parameters<typeof AppGraph.getActions>[0],
|
|
102
|
+
translate: Translate,
|
|
103
|
+
nodeId: string,
|
|
104
|
+
): { id: string; label?: string; icon?: string; disabled?: boolean; operation?: string; group?: boolean }[] => {
|
|
105
|
+
const out: ReturnType<typeof collectActions> = [];
|
|
106
|
+
const walk = (items: readonly AppGraphNode.Node[], depth: number) => {
|
|
107
|
+
for (const item of items) {
|
|
108
|
+
const group = AppGraphNode.isActionGroup(item);
|
|
109
|
+
const properties = item.properties ?? {};
|
|
110
|
+
out.push({
|
|
111
|
+
id: item.id,
|
|
112
|
+
label: translate(properties.label),
|
|
113
|
+
icon: typeof properties.icon === 'string' ? properties.icon : undefined,
|
|
114
|
+
disabled: typeof properties.disabled === 'boolean' ? properties.disabled : undefined,
|
|
115
|
+
operation: item.id.match(OPERATION_DXN)?.[0],
|
|
116
|
+
group: group ? true : undefined,
|
|
117
|
+
});
|
|
118
|
+
if (group && depth < 1) {
|
|
119
|
+
walk(AppGraph.getActions(graph, item.id), depth + 1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
walk(AppGraph.getActions(graph, nodeId), 0);
|
|
124
|
+
return out;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/** Interim surface source until the surface registry (INTROSPECTION.md §3.2): dev builds wrap every mounted surface in `<dx-surface>`. */
|
|
128
|
+
const collectSurfaces = () => {
|
|
129
|
+
if (typeof document === 'undefined') {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
return Array.from(document.querySelectorAll('dx-surface')).map((el) => ({
|
|
133
|
+
id: el.getAttribute('data-id') ?? undefined,
|
|
134
|
+
role: el.getAttribute('data-role') ?? undefined,
|
|
135
|
+
component: el.getAttribute('data-component') ?? undefined,
|
|
136
|
+
}));
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/** The app's own report of what an operation just did — read the way a user reads it, off the DOM. */
|
|
140
|
+
const collectToasts = () => {
|
|
141
|
+
if (typeof document === 'undefined') {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
return Array.from(document.querySelectorAll('[data-scope="toast"][data-part="root"]')).map((el) => ({
|
|
145
|
+
title: el.querySelector('[data-part="title"]')?.textContent ?? undefined,
|
|
146
|
+
description: el.querySelector('[data-part="description"]')?.textContent ?? undefined,
|
|
147
|
+
actions: Array.from(el.querySelectorAll('button')).map(
|
|
148
|
+
(button) => button.getAttribute('aria-label') ?? button.textContent ?? '',
|
|
149
|
+
),
|
|
150
|
+
}));
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** Recent error-level entries from the process-wide log buffer, which the plugin starts recording at startup. */
|
|
154
|
+
const collectErrors = (since: number) =>
|
|
155
|
+
logBuffer
|
|
156
|
+
.getRows()
|
|
157
|
+
.filter(({ entry }) => entry.level >= LogLevel.ERROR && entry.timestamp >= since)
|
|
158
|
+
.map(({ entry }) => ({
|
|
159
|
+
timestamp: entry.timestamp,
|
|
160
|
+
message: entry.message,
|
|
161
|
+
error: entry.computedError,
|
|
162
|
+
file: entry.meta?.F,
|
|
163
|
+
}));
|
|
164
|
+
|
|
165
|
+
const DEFAULT_ERROR_WINDOW_MS = 60_000;
|
|
166
|
+
|
|
167
|
+
const handler: Operation.WithHandler<typeof DebugOperation.Snapshot> = DebugOperation.Snapshot.pipe(
|
|
168
|
+
Operation.withHandler(
|
|
169
|
+
Effect.fnUntraced(function* ({ since }) {
|
|
170
|
+
const manager = yield* Plugin.Service;
|
|
171
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
172
|
+
// Each source is optional: the snapshot degrades per-section rather than failing when a
|
|
173
|
+
// contributing plugin (deck, graph, attention) is not active on this host.
|
|
174
|
+
const layoutAtom = yield* Capability.getOption(AppCapabilities.Layout);
|
|
175
|
+
const graphBuilder = yield* Capability.getOption(AppCapabilities.AppGraph);
|
|
176
|
+
const translator = yield* Capability.getOption(AppCapabilities.Translator);
|
|
177
|
+
const attention = yield* Capability.getOption(AttentionCapabilities.Attention);
|
|
178
|
+
const client = yield* Capability.getOption(ClientCapabilities.Client);
|
|
179
|
+
|
|
180
|
+
const translate = makeTranslate(Option.getOrUndefined(translator));
|
|
181
|
+
const layout = Option.getOrUndefined(Option.map(layoutAtom, (atom) => registry.get(atom)));
|
|
182
|
+
const graph = Option.getOrUndefined(Option.map(graphBuilder, (builder) => builder.graph));
|
|
183
|
+
|
|
184
|
+
const planks = yield* Effect.promise(() =>
|
|
185
|
+
Promise.all(
|
|
186
|
+
(layout?.active ?? []).map(async (id) => {
|
|
187
|
+
const node = graph ? Option.getOrUndefined(AppGraph.getNode(graph, id)) : undefined;
|
|
188
|
+
return {
|
|
189
|
+
id,
|
|
190
|
+
label: node ? translate(node.properties?.label) : undefined,
|
|
191
|
+
type: node?.type,
|
|
192
|
+
subject: node ? summarizeSubject(node.data) : undefined,
|
|
193
|
+
actions: graph ? collectActions(graph, translate, id) : [],
|
|
194
|
+
comments: node ? await collectComments(node.data) : undefined,
|
|
195
|
+
};
|
|
196
|
+
}),
|
|
197
|
+
),
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
const spaces = Option.match(client, {
|
|
201
|
+
onNone: () => [],
|
|
202
|
+
onSome: (client) => {
|
|
203
|
+
const defaultSpace = AppSpace.getDefaultSpace(client);
|
|
204
|
+
return client.spaces.get().map((space) => ({
|
|
205
|
+
id: space.id,
|
|
206
|
+
name: space.state.get() === SpaceState.SPACE_READY ? space.properties.name : undefined,
|
|
207
|
+
state: SpaceState[space.state.get()],
|
|
208
|
+
default: space === defaultSpace ? true : undefined,
|
|
209
|
+
}));
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const activeModules = new Set(manager.getActive());
|
|
214
|
+
const plugins = manager.getPlugins();
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
layout: layout && {
|
|
218
|
+
mode: layout.mode,
|
|
219
|
+
sidebarOpen: layout.sidebarOpen,
|
|
220
|
+
complementarySidebarOpen: layout.complementarySidebarOpen,
|
|
221
|
+
dialogOpen: layout.dialogOpen,
|
|
222
|
+
workspace: layout.workspace,
|
|
223
|
+
active: layout.active,
|
|
224
|
+
inactive: layout.inactive,
|
|
225
|
+
scrollIntoView: layout.scrollIntoView,
|
|
226
|
+
},
|
|
227
|
+
attention: Option.getOrUndefined(attention)?.getCurrent().slice() ?? [],
|
|
228
|
+
planks,
|
|
229
|
+
surfaces: collectSurfaces(),
|
|
230
|
+
spaces,
|
|
231
|
+
toasts: collectToasts(),
|
|
232
|
+
errors: collectErrors(since ?? Date.now() - DEFAULT_ERROR_WINDOW_MS),
|
|
233
|
+
plugins: {
|
|
234
|
+
installed: plugins.length,
|
|
235
|
+
enabled: manager.getEnabled().length,
|
|
236
|
+
active: plugins.filter((plugin) => plugin.modules.some((module) => activeModules.has(module.id))).length,
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
}),
|
|
240
|
+
),
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
export default handler;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
8
|
+
import * as Harness from '@dxos/plugin-testing/Harness';
|
|
9
|
+
|
|
10
|
+
import { DebugPlugin } from '#plugin';
|
|
11
|
+
import { DebugOperation } from '#types';
|
|
12
|
+
|
|
13
|
+
describe('DebugOperation.Undo', () => {
|
|
14
|
+
test('fails when there is nothing to undo', async ({ expect }) => {
|
|
15
|
+
await using harness = await Harness.createComposerTestApp({ plugins: [DebugPlugin()] });
|
|
16
|
+
|
|
17
|
+
await expect(harness.runPromise(Operation.invoke(DebugOperation.Undo, {}))).rejects.toThrow('Nothing to undo');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
10
|
+
|
|
11
|
+
import { DebugOperation } from '#types';
|
|
12
|
+
|
|
13
|
+
import { NothingToUndoError } from '../errors.ts';
|
|
14
|
+
|
|
15
|
+
const handler: Operation.WithHandler<typeof DebugOperation.Undo> = DebugOperation.Undo.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fnUntraced(function* () {
|
|
18
|
+
const tracker = yield* Capability.get(Capabilities.HistoryTracker);
|
|
19
|
+
if (!tracker.canUndo()) {
|
|
20
|
+
return yield* Effect.fail(new NothingToUndoError());
|
|
21
|
+
}
|
|
22
|
+
yield* tracker.undo();
|
|
23
|
+
return { undone: true };
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
package/src/plugin.tsx
CHANGED
|
@@ -7,11 +7,13 @@ import * as Plugin from '@dxos/app-framework/Plugin';
|
|
|
7
7
|
import {
|
|
8
8
|
AppGraphBuilder,
|
|
9
9
|
DebugSettings,
|
|
10
|
+
GraphRetention,
|
|
10
11
|
LogRecording,
|
|
11
12
|
MarkdownMenu,
|
|
12
13
|
OperationHandler,
|
|
13
14
|
PluginAsset,
|
|
14
15
|
ReactSurface,
|
|
16
|
+
SpaceTemplates,
|
|
15
17
|
StatsPanel,
|
|
16
18
|
Translations,
|
|
17
19
|
} from '#capabilities';
|
|
@@ -21,11 +23,13 @@ import { Debug } from '#types';
|
|
|
21
23
|
export const DebugPlugin = Plugin.define<Debug.DebugPluginOptions>(meta).pipe(
|
|
22
24
|
Plugin.addModule(AppGraphBuilder),
|
|
23
25
|
Plugin.addModule(DebugSettings),
|
|
26
|
+
Plugin.addModule(GraphRetention),
|
|
24
27
|
Plugin.addModule(LogRecording),
|
|
25
28
|
Plugin.addModule(MarkdownMenu),
|
|
26
29
|
Plugin.addModule(OperationHandler),
|
|
27
30
|
Plugin.addModule(PluginAsset),
|
|
28
31
|
Plugin.addModule(ReactSurface),
|
|
32
|
+
Plugin.addModule(SpaceTemplates),
|
|
29
33
|
Plugin.addModule(StatsPanel),
|
|
30
34
|
Plugin.addModule(Translations),
|
|
31
35
|
Plugin.make,
|
|
@@ -0,0 +1,55 @@
|
|
|
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 * as EffectEx from '@dxos/effect/EffectEx';
|
|
9
|
+
|
|
10
|
+
import * as PipelineSpace from './PipelineSpace.ts';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The CRM template is built on demand rather than committed, so this asserts its shape in place
|
|
14
|
+
* of a fixture: if a schema it seeds changes incompatibly, the build fails here.
|
|
15
|
+
*/
|
|
16
|
+
describe('Northwind Sales template', () => {
|
|
17
|
+
test('builds an archive with the board, the accounts and the mail', { timeout: 120_000 }, async ({ expect }) => {
|
|
18
|
+
const { json, objectCount } = await EffectEx.runPromise(buildArchive(PipelineSpace.make()));
|
|
19
|
+
const counts = histogram(json);
|
|
20
|
+
const countOf = (typename: string) =>
|
|
21
|
+
Object.entries(counts)
|
|
22
|
+
.filter(([type]) => type.includes(typename))
|
|
23
|
+
.reduce((total, [, count]) => total + count, 0);
|
|
24
|
+
|
|
25
|
+
expect(objectCount).toBeGreaterThan(0);
|
|
26
|
+
expect(countOf('type.organization')).toBe(7);
|
|
27
|
+
expect(countOf('type.person')).toBe(7);
|
|
28
|
+
expect(countOf('type.pipeline')).toBe(1);
|
|
29
|
+
expect(countOf('type.mailbox')).toBe(1);
|
|
30
|
+
// Eight emails, in the mailbox's feed rather than the database.
|
|
31
|
+
expect(countOf('type.message')).toBe(8);
|
|
32
|
+
// One view per pipeline stage.
|
|
33
|
+
expect(countOf('type.view')).toBe(5);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Same budget as above: this also boots a client and builds the whole space, which a shared CI
|
|
37
|
+
// runner with coverage instrumentation does not finish inside the 15s default.
|
|
38
|
+
test('backs every pipeline column with a stage-filtered view', { timeout: 120_000 }, async ({ expect }) => {
|
|
39
|
+
const { json } = await EffectEx.runPromise(buildArchive(PipelineSpace.make()));
|
|
40
|
+
const objects: Array<{ '@type'?: string; 'columns'?: Array<{ name: string; order: string[] }> }> =
|
|
41
|
+
JSON.parse(json).objects;
|
|
42
|
+
|
|
43
|
+
const pipeline = objects.find((object) => object['@type']?.includes('type.pipeline'));
|
|
44
|
+
const columns = pipeline?.columns ?? [];
|
|
45
|
+
expect(columns.map((column) => column.name)).toEqual([
|
|
46
|
+
'Prospect',
|
|
47
|
+
'Qualified',
|
|
48
|
+
'Commit',
|
|
49
|
+
'Closed won',
|
|
50
|
+
'Closed lost',
|
|
51
|
+
]);
|
|
52
|
+
// Two accounts sit at commit, two closed won, one at each of the rest.
|
|
53
|
+
expect(columns.map((column) => column.order.length)).toEqual([1, 1, 2, 2, 1]);
|
|
54
|
+
});
|
|
55
|
+
});
|