@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
|
@@ -4,65 +4,46 @@ import * as Capability from "@dxos/app-framework/Capability";
|
|
|
4
4
|
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
5
5
|
import { DebugNodes, DebugSurface } from "#types";
|
|
6
6
|
import { meta } from "#meta";
|
|
7
|
-
import
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
8
|
import { Annotation, Collection, Entity, Filter, Obj, Type } from "@dxos/echo";
|
|
9
|
-
import {
|
|
10
|
-
import { jsx
|
|
11
|
-
import
|
|
9
|
+
import { useCallback, useMemo } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
import * as SpaceCapabilities from "@dxos/plugin-space/SpaceCapabilities";
|
|
12
12
|
import * as SpaceOperation from "@dxos/plugin-space/SpaceOperation";
|
|
13
|
-
import * as Effect from "effect/Effect";
|
|
14
13
|
import * as GraphPath from "@dxos/app-toolkit/GraphPath";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { DebugObjectPanel, DebugSettings, DebugSpaceObjectsPanel, DebugStatus,
|
|
14
|
+
import * as Position from "@dxos/util/Position";
|
|
15
|
+
import * as Surface from "@dxos/app-framework/Surface";
|
|
16
|
+
import * as AppSurface from "@dxos/app-toolkit/AppSurface";
|
|
17
|
+
import { DebugConsole, DebugObjectPanel, DebugPanelDrawer, DebugPanelStatus, DebugSettings, DebugSpaceObjectsPanel, DebugStatus, LoggerPanel, SpaceGenerator, StatsPanel, Wireframe } from "#containers";
|
|
19
18
|
import { useAtomValue } from "@effect/atom-react/Hooks";
|
|
20
19
|
import * as Option from "effect/Option";
|
|
20
|
+
import * as Hooks from "@dxos/app-framework/Hooks";
|
|
21
21
|
import * as AppAnnotation from "@dxos/app-toolkit/AppAnnotation";
|
|
22
|
+
import * as ToolkitHooks from "@dxos/app-toolkit/Hooks";
|
|
22
23
|
import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
|
|
23
|
-
import
|
|
24
|
-
import * as
|
|
24
|
+
import * as SettingsScope from "@dxos/app-toolkit/SettingsScope";
|
|
25
|
+
import * as TypeOptions from "@dxos/app-toolkit/TypeOptions";
|
|
25
26
|
import { useClient } from "@dxos/react-client";
|
|
26
|
-
import {
|
|
27
|
+
import { SpaceState } from "@dxos/react-client/echo";
|
|
27
28
|
//#region src/capabilities/DebugSurfaces.tsx
|
|
28
|
-
/**
|
|
29
|
-
var
|
|
30
|
-
const client = useClient();
|
|
31
|
-
const showHidden = useAtomCapability(SpaceCapabilities.SettingsAtom)?.showHidden ?? false;
|
|
32
|
-
const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));
|
|
33
|
-
const hiddenTypenames = useMemo(() => {
|
|
34
|
-
const result = /* @__PURE__ */ new Set();
|
|
35
|
-
for (const typeEntity of allTypes) {
|
|
36
|
-
const schema = Type.getSchema(typeEntity);
|
|
37
|
-
if (HiddenAnnotation.get(schema).pipe(Option.getOrElse(() => false))) result.add(Type.getTypename(typeEntity));
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
}, [allTypes]);
|
|
41
|
-
return {
|
|
42
|
-
onOpen: useCallback((object) => {
|
|
43
|
-
invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });
|
|
44
|
-
}, [invokePromise]),
|
|
45
|
-
canOpen: useCallback((entity) => {
|
|
46
|
-
if (showHidden) return true;
|
|
47
|
-
const typename = Entity.getTypename(entity);
|
|
48
|
-
return !hiddenTypenames.has(typename ?? "");
|
|
49
|
-
}, [showHidden, hiddenTypenames])
|
|
50
|
-
};
|
|
51
|
-
};
|
|
29
|
+
/** `react-surface.ts` is a plain `.ts` file, so the JSX for the console page's article surface lives here. */
|
|
30
|
+
var DebugConsoleArticle = () => /* @__PURE__ */ jsx(DebugConsole, { fit: true });
|
|
52
31
|
var DebugSettingsSurface = ({ subject, logStore, onUpload }) => {
|
|
53
|
-
const { settings, updateSettings } = useSettingsState(subject.atom);
|
|
32
|
+
const { settings, updateSettings } = Hooks.useSettingsState(subject.atom);
|
|
54
33
|
return /* @__PURE__ */ jsx(DebugSettings, {
|
|
55
34
|
settings,
|
|
56
35
|
onSettingsChange: updateSettings,
|
|
57
36
|
logStore,
|
|
58
|
-
onUpload
|
|
37
|
+
onUpload,
|
|
38
|
+
scope: /* @__PURE__ */ jsx(SettingsScope.Root, { prefix: subject.prefix })
|
|
59
39
|
});
|
|
60
40
|
};
|
|
61
|
-
/** Generated objects are added to the space's root collection, resolved at invocation time. */
|
|
62
|
-
var SpaceGeneratorSurface = ({ role
|
|
63
|
-
const
|
|
41
|
+
/** Generated objects are added to the active space's root collection, resolved at invocation time. */
|
|
42
|
+
var SpaceGeneratorSurface = ({ role }) => {
|
|
43
|
+
const space = ToolkitHooks.useActiveSpace();
|
|
44
|
+
const { invokePromise } = Hooks.useOperationInvoker();
|
|
64
45
|
const handleCreateObjects = useCallback((objects) => {
|
|
65
|
-
const collection = space
|
|
46
|
+
const collection = space?.state.get() === SpaceState.SPACE_READY && Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;
|
|
66
47
|
if (!Obj.instanceOf(Collection.Collection, collection)) return;
|
|
67
48
|
objects.forEach((object) => {
|
|
68
49
|
invokePromise(SpaceOperation.AddObject, {
|
|
@@ -71,6 +52,7 @@ var SpaceGeneratorSurface = ({ role, space }) => {
|
|
|
71
52
|
});
|
|
72
53
|
});
|
|
73
54
|
}, [space, invokePromise]);
|
|
55
|
+
if (!space) return null;
|
|
74
56
|
return /* @__PURE__ */ jsx(SpaceGenerator, {
|
|
75
57
|
role,
|
|
76
58
|
space,
|
|
@@ -78,7 +60,7 @@ var SpaceGeneratorSurface = ({ role, space }) => {
|
|
|
78
60
|
});
|
|
79
61
|
};
|
|
80
62
|
var ObjectDebugSurface = ({ role, companionTo }) => {
|
|
81
|
-
const { invokePromise } = useOperationInvoker();
|
|
63
|
+
const { invokePromise } = Hooks.useOperationInvoker();
|
|
82
64
|
const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
|
|
83
65
|
return /* @__PURE__ */ jsx(DebugObjectPanel, {
|
|
84
66
|
role,
|
|
@@ -88,8 +70,8 @@ var ObjectDebugSurface = ({ role, companionTo }) => {
|
|
|
88
70
|
});
|
|
89
71
|
};
|
|
90
72
|
var SpaceObjectsSurface = () => {
|
|
91
|
-
const space = useActiveSpace();
|
|
92
|
-
const { invokePromise } = useOperationInvoker();
|
|
73
|
+
const space = ToolkitHooks.useActiveSpace();
|
|
74
|
+
const { invokePromise } = Hooks.useOperationInvoker();
|
|
93
75
|
const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
|
|
94
76
|
if (!space) return null;
|
|
95
77
|
return /* @__PURE__ */ jsx(DebugSpaceObjectsPanel, {
|
|
@@ -98,23 +80,29 @@ var SpaceObjectsSurface = () => {
|
|
|
98
80
|
canOpen
|
|
99
81
|
});
|
|
100
82
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
83
|
+
/** Returns `onOpen` and `canOpen` for the ObjectsTree "Open" action. */
|
|
84
|
+
var useObjectOpenAction = (invokePromise) => {
|
|
85
|
+
const client = useClient();
|
|
86
|
+
const showHidden = Hooks.useAtomCapability(SpaceCapabilities.SettingsAtom)?.showHidden ?? false;
|
|
87
|
+
const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));
|
|
88
|
+
const hiddenTypenames = useMemo(() => {
|
|
89
|
+
const result = /* @__PURE__ */ new Set();
|
|
90
|
+
for (const typeEntity of allTypes) if (!TypeOptions.isUserType(typeEntity)) result.add(Type.getTypename(typeEntity));
|
|
91
|
+
return result;
|
|
92
|
+
}, [allTypes]);
|
|
93
|
+
return {
|
|
94
|
+
onOpen: useCallback((object) => {
|
|
95
|
+
invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });
|
|
96
|
+
}, [invokePromise]),
|
|
97
|
+
canOpen: useCallback((entity) => {
|
|
98
|
+
if (showHidden) return true;
|
|
99
|
+
const typename = Entity.getTypename(entity);
|
|
100
|
+
return !hiddenTypenames.has(typename ?? "");
|
|
101
|
+
}, [showHidden, hiddenTypenames])
|
|
102
|
+
};
|
|
103
|
+
};
|
|
115
104
|
//#endregion
|
|
116
105
|
//#region src/capabilities/react-surface.ts
|
|
117
|
-
var isSpaceDebug = (data) => typeof data === "object" && data !== null && "type" in data && data.type === DebugNodes.SpaceType && "space" in data && isSpace(data.space);
|
|
118
106
|
var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({ logStore }) {
|
|
119
107
|
const registry = yield* Capabilities.AtomRegistry;
|
|
120
108
|
const settingsAtom = yield* DebugCapabilities.Settings;
|
|
@@ -132,12 +120,9 @@ var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({
|
|
|
132
120
|
}),
|
|
133
121
|
Surface.create({
|
|
134
122
|
id: "space",
|
|
135
|
-
filter: AppSurface.
|
|
123
|
+
filter: AppSurface.literal(DebugSurface.Page, DebugNodes.SpaceType),
|
|
136
124
|
component: SpaceGeneratorSurface,
|
|
137
|
-
props: ({ role
|
|
138
|
-
role,
|
|
139
|
-
space: subject.space
|
|
140
|
-
})
|
|
125
|
+
props: ({ role }) => ({ role })
|
|
141
126
|
}),
|
|
142
127
|
Surface.create({
|
|
143
128
|
id: "wireframe",
|
|
@@ -156,6 +141,16 @@ var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({
|
|
|
156
141
|
classNames: "row-span-2 overflow-hidden"
|
|
157
142
|
})
|
|
158
143
|
}),
|
|
144
|
+
Surface.create({
|
|
145
|
+
id: "console",
|
|
146
|
+
filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Console),
|
|
147
|
+
component: DebugConsoleArticle
|
|
148
|
+
}),
|
|
149
|
+
Surface.create({
|
|
150
|
+
id: "logsArticle",
|
|
151
|
+
filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Logs),
|
|
152
|
+
component: LoggerPanel
|
|
153
|
+
}),
|
|
159
154
|
Surface.create({
|
|
160
155
|
id: "objectDebug",
|
|
161
156
|
filter: AppSurface.allOf(AppSurface.literal(AppSurface.Article, "debug"), AppSurface.companion(AppSurface.Article)),
|
|
@@ -177,19 +172,26 @@ var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({
|
|
|
177
172
|
component: DebugStatus
|
|
178
173
|
}),
|
|
179
174
|
Surface.create({
|
|
180
|
-
id: "
|
|
181
|
-
filter: Surface.makeFilter(AppSurface.
|
|
182
|
-
component:
|
|
175
|
+
id: "debugPanelStatus",
|
|
176
|
+
filter: Surface.makeFilter(AppSurface.StatusIndicator),
|
|
177
|
+
component: DebugPanelStatus
|
|
183
178
|
}),
|
|
184
179
|
Surface.create({
|
|
185
|
-
id: "
|
|
186
|
-
filter: Surface.makeFilter(AppSurface.
|
|
187
|
-
component:
|
|
180
|
+
id: "debugDrawer",
|
|
181
|
+
filter: Surface.makeFilter(AppSurface.Drawer),
|
|
182
|
+
component: DebugPanelDrawer
|
|
188
183
|
}),
|
|
189
184
|
Surface.create({
|
|
190
185
|
id: "statsPanel",
|
|
191
186
|
filter: Surface.makeFilter(DebugSurface.Stats),
|
|
192
187
|
component: StatsPanel
|
|
188
|
+
}),
|
|
189
|
+
Surface.create({
|
|
190
|
+
id: "statsCards",
|
|
191
|
+
filter: Surface.makeFilter(AppSurface.DevtoolsOverview),
|
|
192
|
+
position: 20,
|
|
193
|
+
component: StatsPanel,
|
|
194
|
+
props: () => ({ showEmpty: false })
|
|
193
195
|
})
|
|
194
196
|
]);
|
|
195
197
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/DebugSurfaces.tsx","../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// Surface components that cannot be expressed as a `props` mapper, because they call hooks or compose.\n\nimport { useAtomValue } from '@effect/atom-react/Hooks';\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { useAtomCapability, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';\nimport * as AppAnnotation from '@dxos/app-toolkit/AppAnnotation';\nimport type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport { useActiveSpace } from '@dxos/app-toolkit/ui';\nimport { Annotation, Collection, Entity, Filter, Obj, Type } from '@dxos/echo';\nimport { HiddenAnnotation } from '@dxos/echo/Annotation';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport * as SpaceCapabilities from '@dxos/plugin-space/SpaceCapabilities';\nimport * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';\nimport { useClient } from '@dxos/react-client';\nimport { type Space, SpaceState } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\nimport { Logger } from '@dxos/react-ui-debug';\n\nimport { DebugObjectPanel, DebugSettings, DebugSpaceObjectsPanel, SpaceGenerator } from '#containers';\nimport { Settings } from '#types';\n\n/** Returns `onOpen` and `canOpen` for the ObjectsTree \"Open\" action. */\nconst useObjectOpenAction = (invokePromise: ReturnType<typeof useOperationInvoker>['invokePromise']) => {\n const client = useClient();\n const spaceSettings = useAtomCapability(SpaceCapabilities.SettingsAtom);\n const showHidden = spaceSettings?.showHidden ?? false;\n\n const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));\n\n const hiddenTypenames = useMemo(() => {\n const result = new Set<string>();\n for (const typeEntity of allTypes) {\n const schema = Type.getSchema(typeEntity);\n if (HiddenAnnotation.get(schema).pipe(Option.getOrElse(() => false))) {\n result.add(Type.getTypename(typeEntity));\n }\n }\n return result;\n }, [allTypes]);\n\n const onOpen = useCallback(\n (object: Obj.Unknown) => {\n void invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });\n },\n [invokePromise],\n );\n\n const canOpen = useCallback(\n (entity: Entity.Snapshot) => {\n if (showHidden) {\n return true;\n }\n const typename = Entity.getTypename(entity);\n return !hiddenTypenames.has(typename ?? '');\n },\n [showHidden, hiddenTypenames],\n );\n\n return { onOpen, canOpen };\n};\n\nexport type DebugSettingsSurfaceProps = {\n subject: AppCapabilities.Settings;\n logStore?: IdbLogStore;\n onUpload?: AppCapabilities.FileUploader;\n};\n\nexport const DebugSettingsSurface = ({ subject, logStore, onUpload }: DebugSettingsSurfaceProps) => {\n const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);\n\n return (\n <DebugSettings settings={settings} onSettingsChange={updateSettings} logStore={logStore} onUpload={onUpload} />\n );\n};\n\nexport type SpaceGeneratorSurfaceProps = {\n role: string;\n space: Space;\n};\n\n/** Generated objects are added to the space's root collection, resolved at invocation time. */\nexport const SpaceGeneratorSurface = ({ role, space }: SpaceGeneratorSurfaceProps) => {\n const { invokePromise } = useOperationInvoker();\n const handleCreateObjects = useCallback(\n (objects: Obj.Unknown[]) => {\n const collection =\n space.state.get() === SpaceState.SPACE_READY &&\n Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;\n if (!Obj.instanceOf(Collection.Collection, collection)) {\n return;\n }\n\n objects.forEach((object) => {\n void invokePromise(SpaceOperation.AddObject, { target: collection, object });\n });\n },\n [space, invokePromise],\n );\n\n return <SpaceGenerator role={role} space={space} onCreateObjects={handleCreateObjects} />;\n};\n\nexport type ObjectDebugSurfaceProps = {\n role: string;\n companionTo: Obj.Unknown;\n};\n\nexport const ObjectDebugSurface = ({ role, companionTo }: ObjectDebugSurfaceProps) => {\n const { invokePromise } = useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n\n return <DebugObjectPanel role={role} companionTo={companionTo} onOpen={onOpen} canOpen={canOpen} />;\n};\n\nexport const SpaceObjectsSurface = () => {\n const space = useActiveSpace();\n const { invokePromise } = useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n if (!space) {\n return null;\n }\n\n return <DebugSpaceObjectsPanel space={space} onOpen={onOpen} canOpen={canOpen} />;\n};\n\nexport const LoggerSurface = () => (\n <Logger.Root>\n <Panel.Root>\n <Panel.Toolbar asChild>\n <Logger.Toolbar />\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Logger.Content>\n <Logger.List />\n </Logger.Content>\n </Panel.Content>\n <Panel.Statusbar asChild>\n <Logger.Filter />\n </Panel.Statusbar>\n </Panel.Root>\n </Logger.Root>\n);\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport { Surface } from '@dxos/app-framework/ui';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport { type Space, isSpace } from '@dxos/react-client/echo';\nimport { Position } from '@dxos/util';\n\nimport { DebugStatus, LogStatus, StatsPanel, Wireframe } from '#containers';\nimport { meta } from '#meta';\nimport { DebugNodes, DebugSurface } from '#types';\n\nimport { DebugCapabilities } from '../types/Debug';\nimport {\n DebugSettingsSurface,\n LoggerSurface,\n ObjectDebugSurface,\n SpaceGeneratorSurface,\n SpaceObjectsSurface,\n} from './DebugSurfaces';\n\ntype SpaceDebug = {\n type: string;\n space: Space;\n};\n\nconst isSpaceDebug = (data: unknown): data is SpaceDebug =>\n typeof data === 'object' &&\n data !== null &&\n 'type' in data &&\n data.type === DebugNodes.SpaceType &&\n 'space' in data &&\n isSpace(data.space);\n\ntype ReactSurfaceOptions = {\n logStore?: IdbLogStore;\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {\n const registry = yield* Capabilities.AtomRegistry;\n const settingsAtom = yield* DebugCapabilities.Settings;\n const fileUploader = (yield* Capability.getAll(AppCapabilities.FileUploader))[0];\n\n return Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: 'pluginSettings',\n filter: AppSurface.settings(AppSurface.Article, meta.profile.key),\n component: DebugSettingsSurface,\n props: ({ data: { subject } }) => ({ subject, logStore, onUpload: fileUploader }),\n }),\n Surface.create({\n id: 'space',\n filter: AppSurface.subject(AppSurface.Article, isSpaceDebug),\n component: SpaceGeneratorSurface,\n props: ({ role, data: { subject } }) => ({ role, space: subject.space }),\n }),\n Surface.create({\n id: 'wireframe',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.subject(AppSurface.Article, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n AppSurface.subject(AppSurface.Section, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n ),\n position: Position.first,\n component: Wireframe,\n props: ({ role, name, data: { subject } }) => ({\n label: `${role}:${name}`,\n object: subject,\n classNames: 'row-span-2 overflow-hidden',\n }),\n }),\n Surface.create({\n id: 'objectDebug',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'debug'),\n AppSurface.companion(AppSurface.Article),\n ),\n component: ObjectDebugSurface,\n props: ({ role, data: { companionTo } }) => ({ role, companionTo }),\n }),\n Surface.create({\n id: 'spaceObjects',\n filter: Surface.makeFilter(AppSurface.deckCompanion('spaceObjects')),\n component: SpaceObjectsSurface,\n }),\n Surface.create({\n id: 'debugStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n position: Position.first,\n component: DebugStatus,\n }),\n Surface.create({\n id: 'logs',\n filter: Surface.makeFilter(AppSurface.deckCompanion('logs')),\n component: LoggerSurface,\n }),\n Surface.create({\n id: 'logStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n component: LogStatus,\n }),\n Surface.create({\n id: 'statsPanel',\n filter: Surface.makeFilter(DebugSurface.Stats),\n component: StatsPanel,\n }),\n ]);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,uBAAuB,kBAA2E;CACtG,MAAM,SAAS,UAAU;CAEzB,MAAM,aADgB,kBAAkB,kBAAkB,YACvC,CAAA,EAAe,cAAc;CAEhD,MAAM,WAAW,aAAa,cAAc,OAAO,MAAM,SAAS,MAAM,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CAE/G,MAAM,kBAAkB,cAAc;EACpC,MAAM,yBAAS,IAAI,IAAY;EAC/B,KAAK,MAAM,cAAc,UAAU;GACjC,MAAM,SAAS,KAAK,UAAU,UAAU;GACxC,IAAI,iBAAiB,IAAI,MAAM,CAAC,CAAC,KAAK,OAAO,gBAAgB,KAAK,CAAC,GACjE,OAAO,IAAI,KAAK,YAAY,UAAU,CAAC;EAE3C;EACA,OAAO;CACT,GAAG,CAAC,QAAQ,CAAC;CAoBb,OAAO;EAAE,QAlBM,aACZ,WAAwB;GACvB,cAAmB,gBAAgB,MAAM,EAAE,SAAS,CAAC,UAAU,wBAAwB,MAAM,CAAC,EAAE,CAAC;EACnG,GACA,CAAC,aAAa,CAcP;EAAQ,SAXD,aACb,WAA4B;GAC3B,IAAI,YACF,OAAO;GAET,MAAM,WAAW,OAAO,YAAY,MAAM;GAC1C,OAAO,CAAC,gBAAgB,IAAI,YAAY,EAAE;EAC5C,GACA,CAAC,YAAY,eAAe,CAGb;CAAQ;AAC3B;AAQA,IAAa,wBAAwB,EAAE,SAAS,UAAU,eAA0C;CAClG,MAAM,EAAE,UAAU,mBAAmB,iBAAoC,QAAQ,IAAI;CAErF,OACE,oBAAC,eAAD;EAAyB;EAAU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GACX,QAAQ,EAAE,MAAM,MAAM,MAAM,EAAE,iBAAiB;IAC7C,OAAO,GAAG,KAAK,GAAG;IAClB,QAAQ;IACR,YAAY;GACd;EACF,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,WAAW,MACjB,WAAW,QAAQ,WAAW,SAAS,OAAO,GAC9C,WAAW,UAAU,WAAW,OAAO,CACzC;GACA,WAAW;GACX,QAAQ,EAAE,MAAM,MAAM,EAAE,qBAAqB;IAAE;IAAM;GAAY;EACnE,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,cAAc,cAAc,CAAC;GACnE,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,eAAe;GACrD,UAAU,SAAS;GACnB,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,cAAc,MAAM,CAAC;GAC3D,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,eAAe;GACrD,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,aAAa,KAAK;GAC7C,WAAW;EACb,CAAC;CACH,CAAC;AACH,CAAC,CACH"}
|
|
1
|
+
{"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/DebugSurfaces.tsx","../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// Surface components that cannot be expressed as a `props` mapper, because they call hooks or compose.\n\nimport { useAtomValue } from '@effect/atom-react/Hooks';\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useMemo } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport * as AppAnnotation from '@dxos/app-toolkit/AppAnnotation';\nimport type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport * as ToolkitHooks from '@dxos/app-toolkit/Hooks';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as SettingsScope from '@dxos/app-toolkit/SettingsScope';\nimport * as TypeOptions from '@dxos/app-toolkit/TypeOptions';\nimport { Annotation, Collection, Entity, Filter, Obj, Type } from '@dxos/echo';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport * as SpaceCapabilities from '@dxos/plugin-space/SpaceCapabilities';\nimport * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';\nimport { useClient } from '@dxos/react-client';\nimport { SpaceState } from '@dxos/react-client/echo';\n\nimport { DebugConsole, DebugObjectPanel, DebugSettings, DebugSpaceObjectsPanel, SpaceGenerator } from '#containers';\nimport { Settings } from '#types';\n\n//\n// DebugConsoleArticle\n//\n\n/** `react-surface.ts` is a plain `.ts` file, so the JSX for the console page's article surface lives here. */\nexport const DebugConsoleArticle = () => <DebugConsole fit />;\n\n//\n// DebugSettings\n//\n\nexport type DebugSettingsSurfaceProps = {\n subject: AppCapabilities.Settings;\n logStore?: IdbLogStore;\n onUpload?: AppCapabilities.FileUploader;\n};\n\nexport const DebugSettingsSurface = ({ subject, logStore, onUpload }: DebugSettingsSurfaceProps) => {\n const { settings, updateSettings } = Hooks.useSettingsState<Settings.Settings>(subject.atom);\n\n return (\n <DebugSettings\n settings={settings}\n onSettingsChange={updateSettings}\n logStore={logStore}\n onUpload={onUpload}\n scope={<SettingsScope.Root prefix={subject.prefix} />}\n />\n );\n};\n\n//\n// SpaceGeneratorSurface\n//\n\nexport type SpaceGeneratorSurfaceProps = {\n role: string;\n};\n\n/** Generated objects are added to the active space's root collection, resolved at invocation time. */\nexport const SpaceGeneratorSurface = ({ role }: SpaceGeneratorSurfaceProps) => {\n const space = ToolkitHooks.useActiveSpace();\n const { invokePromise } = Hooks.useOperationInvoker();\n\n const handleCreateObjects = useCallback(\n (objects: Obj.Unknown[]) => {\n const collection =\n space?.state.get() === SpaceState.SPACE_READY &&\n Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;\n if (!Obj.instanceOf(Collection.Collection, collection)) {\n return;\n }\n\n objects.forEach((object) => {\n void invokePromise(SpaceOperation.AddObject, { target: collection, object });\n });\n },\n [space, invokePromise],\n );\n\n if (!space) {\n return null;\n }\n\n return <SpaceGenerator role={role} space={space} onCreateObjects={handleCreateObjects} />;\n};\n\n//\n// ObjectDebugSurface\n//\n\nexport type ObjectDebugSurfaceProps = {\n role: string;\n companionTo: Obj.Unknown;\n};\n\nexport const ObjectDebugSurface = ({ role, companionTo }: ObjectDebugSurfaceProps) => {\n const { invokePromise } = Hooks.useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n\n return <DebugObjectPanel role={role} companionTo={companionTo} onOpen={onOpen} canOpen={canOpen} />;\n};\n\n//\n// SpaceObjectsSurface\n//\n\nexport const SpaceObjectsSurface = () => {\n const space = ToolkitHooks.useActiveSpace();\n const { invokePromise } = Hooks.useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n if (!space) {\n return null;\n }\n\n return <DebugSpaceObjectsPanel space={space} onOpen={onOpen} canOpen={canOpen} />;\n};\n\n/** Returns `onOpen` and `canOpen` for the ObjectsTree \"Open\" action. */\nconst useObjectOpenAction = (invokePromise: ReturnType<typeof Hooks.useOperationInvoker>['invokePromise']) => {\n const client = useClient();\n const spaceSettings = Hooks.useAtomCapability(SpaceCapabilities.SettingsAtom);\n const showHidden = spaceSettings?.showHidden ?? false;\n\n const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));\n\n const hiddenTypenames = useMemo(() => {\n const result = new Set<string>();\n for (const typeEntity of allTypes) {\n if (!TypeOptions.isUserType(typeEntity)) {\n result.add(Type.getTypename(typeEntity));\n }\n }\n return result;\n }, [allTypes]);\n\n const onOpen = useCallback(\n (object: Obj.Unknown) => {\n void invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });\n },\n [invokePromise],\n );\n\n const canOpen = useCallback(\n (entity: Entity.Snapshot) => {\n if (showHidden) {\n return true;\n }\n const typename = Entity.getTypename(entity);\n return !hiddenTypenames.has(typename ?? '');\n },\n [showHidden, hiddenTypenames],\n );\n\n return { onOpen, canOpen };\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Surface from '@dxos/app-framework/Surface';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport { Obj } from '@dxos/echo';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport * as Position from '@dxos/util/Position';\n\nimport { DebugPanelDrawer, DebugPanelStatus, DebugStatus, LoggerPanel, StatsPanel, Wireframe } from '#containers';\nimport { meta } from '#meta';\nimport { DebugNodes, DebugSurface } from '#types';\n\nimport { DebugCapabilities } from '../types/Debug.ts';\nimport {\n DebugConsoleArticle,\n DebugSettingsSurface,\n ObjectDebugSurface,\n SpaceGeneratorSurface,\n SpaceObjectsSurface,\n} from './DebugSurfaces.tsx';\n\ntype ReactSurfaceOptions = {\n logStore?: IdbLogStore;\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {\n const registry = yield* Capabilities.AtomRegistry;\n const settingsAtom = yield* DebugCapabilities.Settings;\n const fileUploader = (yield* Capability.getAll(AppCapabilities.FileUploader))[0];\n\n return Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: 'pluginSettings',\n filter: AppSurface.settings(AppSurface.Article, meta.profile.key),\n component: DebugSettingsSurface,\n props: ({ data: { subject } }) => ({ subject, logStore, onUpload: fileUploader }),\n }),\n Surface.create({\n id: 'space',\n filter: AppSurface.literal(DebugSurface.Page, DebugNodes.SpaceType),\n component: SpaceGeneratorSurface,\n props: ({ role }) => ({ role }),\n }),\n Surface.create({\n id: 'wireframe',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.subject(AppSurface.Article, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n AppSurface.subject(AppSurface.Section, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n ),\n position: Position.first,\n component: Wireframe,\n props: ({ role, name, data: { subject } }) => ({\n label: `${role}:${name}`,\n object: subject,\n classNames: 'row-span-2 overflow-hidden',\n }),\n }),\n Surface.create({\n id: 'console',\n filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Console),\n component: DebugConsoleArticle,\n }),\n Surface.create({\n id: 'logsArticle',\n filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Logs),\n component: LoggerPanel,\n }),\n Surface.create({\n id: 'objectDebug',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'debug'),\n AppSurface.companion(AppSurface.Article),\n ),\n component: ObjectDebugSurface,\n props: ({ role, data: { companionTo } }) => ({ role, companionTo }),\n }),\n Surface.create({\n id: 'spaceObjects',\n filter: Surface.makeFilter(AppSurface.deckCompanion('spaceObjects')),\n component: SpaceObjectsSurface,\n }),\n Surface.create({\n id: 'debugStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n position: Position.first,\n component: DebugStatus,\n }),\n Surface.create({\n id: 'debugPanelStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n component: DebugPanelStatus,\n }),\n Surface.create({\n id: 'debugDrawer',\n filter: Surface.makeFilter(AppSurface.Drawer),\n component: DebugPanelDrawer,\n }),\n Surface.create({\n id: 'statsPanel',\n filter: Surface.makeFilter(DebugSurface.Stats),\n component: StatsPanel,\n }),\n Surface.create({\n id: 'statsCards',\n filter: Surface.makeFilter(AppSurface.DevtoolsOverview),\n // After the devtools cards (0–12) and before contributors that sit last.\n position: 20,\n component: StatsPanel,\n props: () => ({ showEmpty: false }),\n }),\n ]);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAa,4BAA4B,oBAAC,cAAD,EAAc,KAAA,KAAK,CAAA;AAY5D,IAAa,wBAAwB,EAAE,SAAS,UAAU,eAA0C;CAClG,MAAM,EAAE,UAAU,mBAAmB,MAAM,iBAAoC,QAAQ,IAAI;CAE3F,OACE,oBAAC,eAAD;EACY;EACV,kBAAkB;EACR;EACA;EACV,OAAO,oBAAC,cAAc,MAAf,EAAoB,QAAQ,QAAQ,OAAS,CAAA;CACrD,CAAA;AAEL;;AAWA,IAAa,yBAAyB,EAAE,WAAuC;CAC7E,MAAM,QAAQ,aAAa,eAAe;CAC1C,MAAM,EAAE,kBAAkB,MAAM,oBAAoB;CAEpD,MAAM,sBAAsB,aACzB,YAA2B;EAC1B,MAAM,aACJ,OAAO,MAAM,IAAI,MAAM,WAAW,eAClC,WAAW,IAAI,MAAM,YAAY,cAAc,wBAAwB,CAAC,CAAC,KAAK,OAAO,cAAc,CAAC,EAAE;EACxG,IAAI,CAAC,IAAI,WAAW,WAAW,YAAY,UAAU,GACnD;EAGF,QAAQ,SAAS,WAAW;GAC1B,cAAmB,eAAe,WAAW;IAAE,QAAQ;IAAY;GAAO,CAAC;EAC7E,CAAC;CACH,GACA,CAAC,OAAO,aAAa,CACvB;CAEA,IAAI,CAAC,OACH,OAAO;CAGT,OAAO,oBAAC,gBAAD;EAAsB;EAAa;EAAO,iBAAiB;CAAsB,CAAA;AAC1F;AAWA,IAAa,sBAAsB,EAAE,MAAM,kBAA2C;CACpF,MAAM,EAAE,kBAAkB,MAAM,oBAAoB;CACpD,MAAM,EAAE,QAAQ,YAAY,oBAAoB,aAAa;CAE7D,OAAO,oBAAC,kBAAD;EAAwB;EAAmB;EAAqB;E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E,qBAAqB;IAAE;IAAM;GAAY;EACnE,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,cAAc,cAAc,CAAC;GACnE,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,eAAe;GACrD,UAAU,SAAS;GACnB,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,eAAe;GACrD,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,MAAM;GAC5C,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,aAAa,KAAK;GAC7C,WAAW;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,WAAW,gBAAgB;GAEtD,UAAU;GACV,WAAW;GACX,cAAc,EAAE,WAAW,MAAM;EACnC,CAAC;CACH,CAAC;AACH,CAAC,CACH"}
|
|
@@ -3,10 +3,10 @@ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
|
3
3
|
import { Debug, Settings } from "#types";
|
|
4
4
|
import { meta } from "#meta";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
|
-
import
|
|
6
|
+
import * as KvsStore from "@dxos/effect/KvsStore";
|
|
7
7
|
//#region src/capabilities/settings.ts
|
|
8
8
|
var settings_default = Capability.makeModule(() => Effect.sync(() => {
|
|
9
|
-
const settingsAtom =
|
|
9
|
+
const settingsAtom = KvsStore.make({
|
|
10
10
|
key: meta.profile.key,
|
|
11
11
|
schema: Settings.Settings,
|
|
12
12
|
defaultValue: () => ({})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-settings.mjs","names":[],"sources":["../../src/capabilities/settings.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport
|
|
1
|
+
{"version":3,"file":"chunk-settings.mjs","names":[],"sources":["../../src/capabilities/settings.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as KvsStore from '@dxos/effect/KvsStore';\n\nimport { meta } from '#meta';\nimport { Debug, Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.sync(() => {\n const settingsAtom = KvsStore.make({\n key: meta.profile.key,\n schema: Settings.Settings,\n defaultValue: () => ({}),\n });\n\n return [\n Capability.contribute(Debug.DebugCapabilities.Settings, settingsAtom),\n Capability.contribute(AppCapabilities.Settings, {\n prefix: meta.profile.key,\n schema: Settings.Settings,\n atom: settingsAtom,\n }),\n ];\n }),\n);\n"],"mappings":";;;;;;;AAaA,IAAA,mBAAe,WAAW,iBACxB,OAAO,WAAW;CAChB,MAAM,eAAe,SAAS,KAAK;EACjC,KAAK,KAAK,QAAQ;EAClB,QAAQ,SAAS;EACjB,qBAAqB,CAAC;CACxB,CAAC;CAED,OAAO,CACL,WAAW,WAAW,MAAM,kBAAkB,UAAU,YAAY,GACpE,WAAW,WAAW,gBAAgB,UAAU;EAC9C,QAAQ,KAAK,QAAQ;EACrB,QAAQ,SAAS;EACjB,MAAM;CACR,CAAC,CACH;AACF,CAAC,CACH"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
4
|
+
import { DebugOperation } from "#types";
|
|
5
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import { Filter, Obj, Query, Relation } from "@dxos/echo";
|
|
8
|
+
import * as Markdown from "@dxos/plugin-markdown/Markdown";
|
|
9
|
+
import { AnchoredTo } from "@dxos/types";
|
|
10
|
+
import { LogLevel } from "@dxos/log";
|
|
11
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
12
|
+
import * as AppGraphNode from "@dxos/app-graph/AppGraphNode";
|
|
13
|
+
import { logBuffer } from "@dxos/react-ui-debug/log-buffer";
|
|
14
|
+
import * as Option from "effect/Option";
|
|
15
|
+
import * as AppGraph from "@dxos/app-graph/AppGraph";
|
|
16
|
+
import * as AppSpace from "@dxos/app-toolkit/AppSpace";
|
|
17
|
+
import * as ClientCapabilities from "@dxos/plugin-client/ClientCapabilities";
|
|
18
|
+
import * as AttentionCapabilities from "@dxos/plugin-attention/AttentionCapabilities";
|
|
19
|
+
import { SpaceState } from "@dxos/protocols/buf/dxos/client/invitation_pb";
|
|
20
|
+
//#region src/operations/snapshot.ts
|
|
21
|
+
/** Best-effort localization: an i18n tuple degrades to its key when no translator is active. */
|
|
22
|
+
var makeTranslate = (translator) => (label) => {
|
|
23
|
+
if (typeof label === "string") return label;
|
|
24
|
+
if (Array.isArray(label) && typeof label[0] === "string") return translator ? translator.t(label[0], label[1]) : label[0];
|
|
25
|
+
};
|
|
26
|
+
/** ECHO objects summarize to identity — a snapshot must be O(planks), never O(space). */
|
|
27
|
+
var summarizeSubject = (data) => {
|
|
28
|
+
if (data == null || typeof data !== "object") return;
|
|
29
|
+
if (Obj.isObject(data)) return {
|
|
30
|
+
dxn: String(Obj.getURI(data)),
|
|
31
|
+
typename: Obj.getTypename(data),
|
|
32
|
+
name: Obj.getLabel(data),
|
|
33
|
+
text: Obj.instanceOf(Markdown.Document, data) ? data.content.target?.content : void 0
|
|
34
|
+
};
|
|
35
|
+
if ("id" in data && typeof data.id === "string") return { id: data.id };
|
|
36
|
+
};
|
|
37
|
+
/** The comment threads on an object, with their messages loaded — the review companion's view of it. */
|
|
38
|
+
var collectComments = async (subject) => {
|
|
39
|
+
if (!Obj.isObject(subject)) return;
|
|
40
|
+
const db = Obj.getDatabase(subject);
|
|
41
|
+
if (!db) return;
|
|
42
|
+
const anchors = await db.query(Query.select(Filter.id(subject.id)).targetOf(AnchoredTo.AnchoredTo)).run();
|
|
43
|
+
return Promise.all(anchors.map(async (anchor) => {
|
|
44
|
+
const thread = Relation.getSource(anchor);
|
|
45
|
+
const messages = await Promise.all(thread.messages.map((ref) => ref.load()));
|
|
46
|
+
return {
|
|
47
|
+
id: thread.id,
|
|
48
|
+
anchorId: anchor.id,
|
|
49
|
+
anchor: anchor.anchor,
|
|
50
|
+
status: thread.status,
|
|
51
|
+
messages: messages.map((message) => ({
|
|
52
|
+
id: message.id,
|
|
53
|
+
sender: message.sender.name ?? message.sender.identityDid,
|
|
54
|
+
text: message.blocks.map((block) => block._tag === "text" ? block.text : void 0).filter((text) => text !== void 0).join("\n")
|
|
55
|
+
}))
|
|
56
|
+
};
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
var OPERATION_DXN = /dxn:[^/]+/;
|
|
60
|
+
/** Flattens the node's actions with one level of group expansion — what a menu would show. */
|
|
61
|
+
var collectActions = (graph, translate, nodeId) => {
|
|
62
|
+
const out = [];
|
|
63
|
+
const walk = (items, depth) => {
|
|
64
|
+
for (const item of items) {
|
|
65
|
+
const group = AppGraphNode.isActionGroup(item);
|
|
66
|
+
const properties = item.properties ?? {};
|
|
67
|
+
out.push({
|
|
68
|
+
id: item.id,
|
|
69
|
+
label: translate(properties.label),
|
|
70
|
+
icon: typeof properties.icon === "string" ? properties.icon : void 0,
|
|
71
|
+
disabled: typeof properties.disabled === "boolean" ? properties.disabled : void 0,
|
|
72
|
+
operation: item.id.match(OPERATION_DXN)?.[0],
|
|
73
|
+
group: group ? true : void 0
|
|
74
|
+
});
|
|
75
|
+
if (group && depth < 1) walk(AppGraph.getActions(graph, item.id), depth + 1);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
walk(AppGraph.getActions(graph, nodeId), 0);
|
|
79
|
+
return out;
|
|
80
|
+
};
|
|
81
|
+
/** Interim surface source until the surface registry (INTROSPECTION.md §3.2): dev builds wrap every mounted surface in `<dx-surface>`. */
|
|
82
|
+
var collectSurfaces = () => {
|
|
83
|
+
if (typeof document === "undefined") return [];
|
|
84
|
+
return Array.from(document.querySelectorAll("dx-surface")).map((el) => ({
|
|
85
|
+
id: el.getAttribute("data-id") ?? void 0,
|
|
86
|
+
role: el.getAttribute("data-role") ?? void 0,
|
|
87
|
+
component: el.getAttribute("data-component") ?? void 0
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
/** The app's own report of what an operation just did — read the way a user reads it, off the DOM. */
|
|
91
|
+
var collectToasts = () => {
|
|
92
|
+
if (typeof document === "undefined") return [];
|
|
93
|
+
return Array.from(document.querySelectorAll("[data-scope=\"toast\"][data-part=\"root\"]")).map((el) => ({
|
|
94
|
+
title: el.querySelector("[data-part=\"title\"]")?.textContent ?? void 0,
|
|
95
|
+
description: el.querySelector("[data-part=\"description\"]")?.textContent ?? void 0,
|
|
96
|
+
actions: Array.from(el.querySelectorAll("button")).map((button) => button.getAttribute("aria-label") ?? button.textContent ?? "")
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
/** Recent error-level entries from the process-wide log buffer, which the plugin starts recording at startup. */
|
|
100
|
+
var collectErrors = (since) => logBuffer.getRows().filter(({ entry }) => entry.level >= LogLevel.ERROR && entry.timestamp >= since).map(({ entry }) => ({
|
|
101
|
+
timestamp: entry.timestamp,
|
|
102
|
+
message: entry.message,
|
|
103
|
+
error: entry.computedError,
|
|
104
|
+
file: entry.meta?.F
|
|
105
|
+
}));
|
|
106
|
+
var DEFAULT_ERROR_WINDOW_MS = 6e4;
|
|
107
|
+
var handler = DebugOperation.Snapshot.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ since }) {
|
|
108
|
+
const manager = yield* Plugin.Service;
|
|
109
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
110
|
+
const layoutAtom = yield* Capability.getOption(AppCapabilities.Layout);
|
|
111
|
+
const graphBuilder = yield* Capability.getOption(AppCapabilities.AppGraph);
|
|
112
|
+
const translator = yield* Capability.getOption(AppCapabilities.Translator);
|
|
113
|
+
const attention = yield* Capability.getOption(AttentionCapabilities.Attention);
|
|
114
|
+
const client = yield* Capability.getOption(ClientCapabilities.Client);
|
|
115
|
+
const translate = makeTranslate(Option.getOrUndefined(translator));
|
|
116
|
+
const layout = Option.getOrUndefined(Option.map(layoutAtom, (atom) => registry.get(atom)));
|
|
117
|
+
const graph = Option.getOrUndefined(Option.map(graphBuilder, (builder) => builder.graph));
|
|
118
|
+
const planks = yield* Effect.promise(() => Promise.all((layout?.active ?? []).map(async (id) => {
|
|
119
|
+
const node = graph ? Option.getOrUndefined(AppGraph.getNode(graph, id)) : void 0;
|
|
120
|
+
return {
|
|
121
|
+
id,
|
|
122
|
+
label: node ? translate(node.properties?.label) : void 0,
|
|
123
|
+
type: node?.type,
|
|
124
|
+
subject: node ? summarizeSubject(node.data) : void 0,
|
|
125
|
+
actions: graph ? collectActions(graph, translate, id) : [],
|
|
126
|
+
comments: node ? await collectComments(node.data) : void 0
|
|
127
|
+
};
|
|
128
|
+
})));
|
|
129
|
+
const spaces = Option.match(client, {
|
|
130
|
+
onNone: () => [],
|
|
131
|
+
onSome: (client) => {
|
|
132
|
+
const defaultSpace = AppSpace.getDefaultSpace(client);
|
|
133
|
+
return client.spaces.get().map((space) => ({
|
|
134
|
+
id: space.id,
|
|
135
|
+
name: space.state.get() === SpaceState.SPACE_READY ? space.properties.name : void 0,
|
|
136
|
+
state: SpaceState[space.state.get()],
|
|
137
|
+
default: space === defaultSpace ? true : void 0
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
const activeModules = new Set(manager.getActive());
|
|
142
|
+
const plugins = manager.getPlugins();
|
|
143
|
+
return {
|
|
144
|
+
layout: layout && {
|
|
145
|
+
mode: layout.mode,
|
|
146
|
+
sidebarOpen: layout.sidebarOpen,
|
|
147
|
+
complementarySidebarOpen: layout.complementarySidebarOpen,
|
|
148
|
+
dialogOpen: layout.dialogOpen,
|
|
149
|
+
workspace: layout.workspace,
|
|
150
|
+
active: layout.active,
|
|
151
|
+
inactive: layout.inactive,
|
|
152
|
+
scrollIntoView: layout.scrollIntoView
|
|
153
|
+
},
|
|
154
|
+
attention: Option.getOrUndefined(attention)?.getCurrent().slice() ?? [],
|
|
155
|
+
planks,
|
|
156
|
+
surfaces: collectSurfaces(),
|
|
157
|
+
spaces,
|
|
158
|
+
toasts: collectToasts(),
|
|
159
|
+
errors: collectErrors(since ?? Date.now() - DEFAULT_ERROR_WINDOW_MS),
|
|
160
|
+
plugins: {
|
|
161
|
+
installed: plugins.length,
|
|
162
|
+
enabled: manager.getEnabled().length,
|
|
163
|
+
active: plugins.filter((plugin) => plugin.modules.some((module) => activeModules.has(module.id))).length
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
})));
|
|
167
|
+
//#endregion
|
|
168
|
+
export { handler as default };
|
|
169
|
+
|
|
170
|
+
//# sourceMappingURL=chunk-snapshot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-snapshot.mjs","names":[],"sources":["../../src/operations/snapshot.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppGraph from '@dxos/app-graph/AppGraph';\nimport * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppSpace from '@dxos/app-toolkit/AppSpace';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Filter, Obj, Query, Relation } from '@dxos/echo';\nimport { LogLevel } from '@dxos/log';\nimport * as AttentionCapabilities from '@dxos/plugin-attention/AttentionCapabilities';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as Markdown from '@dxos/plugin-markdown/Markdown';\nimport { SpaceState } from '@dxos/protocols/buf/dxos/client/invitation_pb';\n// UI-free subpath: the root barrel reaches the panel components.\nimport { logBuffer } from '@dxos/react-ui-debug/log-buffer';\nimport { AnchoredTo, type Message, type Thread } from '@dxos/types';\n\nimport { DebugOperation } from '#types';\n\ntype Translate = (label: unknown) => string | undefined;\n\n/** Best-effort localization: an i18n tuple degrades to its key when no translator is active. */\nconst makeTranslate =\n (translator: { t: (key: string, options?: unknown) => string } | undefined): Translate =>\n (label) => {\n if (typeof label === 'string') {\n return label;\n }\n if (Array.isArray(label) && typeof label[0] === 'string') {\n return translator ? translator.t(label[0], label[1]) : label[0];\n }\n return undefined;\n };\n\n/** ECHO objects summarize to identity — a snapshot must be O(planks), never O(space). */\nconst summarizeSubject = (data: unknown) => {\n if (data == null || typeof data !== 'object') {\n return undefined;\n }\n if (Obj.isObject(data)) {\n return {\n dxn: String(Obj.getURI(data)),\n typename: Obj.getTypename(data),\n name: Obj.getLabel(data),\n // Bounded by the one open document, so the snapshot stays O(planks).\n text: Obj.instanceOf(Markdown.Document, data) ? data.content.target?.content : undefined,\n };\n }\n if ('id' in data && typeof data.id === 'string') {\n return { id: data.id };\n }\n return undefined;\n};\n\n/** The comment threads on an object, with their messages loaded — the review companion's view of it. */\nconst collectComments = async (subject: unknown) => {\n if (!Obj.isObject(subject)) {\n return undefined;\n }\n const db = Obj.getDatabase(subject);\n if (!db) {\n return undefined;\n }\n const anchors: AnchoredTo.AnchoredTo[] = await db\n .query(Query.select(Filter.id(subject.id)).targetOf(AnchoredTo.AnchoredTo))\n .run();\n return Promise.all(\n anchors.map(async (anchor) => {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const messages: Message.Message[] = await Promise.all(thread.messages.map((ref) => ref.load()));\n return {\n id: thread.id,\n anchorId: anchor.id,\n anchor: anchor.anchor,\n status: thread.status,\n messages: messages.map((message) => ({\n id: message.id,\n sender: message.sender.name ?? message.sender.identityDid,\n text: message.blocks\n .map((block) => (block._tag === 'text' ? block.text : undefined))\n .filter((text): text is string => text !== undefined)\n .join('\\n'),\n })),\n };\n }),\n );\n};\n\nconst OPERATION_DXN = /dxn:[^/]+/;\n\n/** Flattens the node's actions with one level of group expansion — what a menu would show. */\nconst collectActions = (\n graph: Parameters<typeof AppGraph.getActions>[0],\n translate: Translate,\n nodeId: string,\n): { id: string; label?: string; icon?: string; disabled?: boolean; operation?: string; group?: boolean }[] => {\n const out: ReturnType<typeof collectActions> = [];\n const walk = (items: readonly AppGraphNode.Node[], depth: number) => {\n for (const item of items) {\n const group = AppGraphNode.isActionGroup(item);\n const properties = item.properties ?? {};\n out.push({\n id: item.id,\n label: translate(properties.label),\n icon: typeof properties.icon === 'string' ? properties.icon : undefined,\n disabled: typeof properties.disabled === 'boolean' ? properties.disabled : undefined,\n operation: item.id.match(OPERATION_DXN)?.[0],\n group: group ? true : undefined,\n });\n if (group && depth < 1) {\n walk(AppGraph.getActions(graph, item.id), depth + 1);\n }\n }\n };\n walk(AppGraph.getActions(graph, nodeId), 0);\n return out;\n};\n\n/** Interim surface source until the surface registry (INTROSPECTION.md §3.2): dev builds wrap every mounted surface in `<dx-surface>`. */\nconst collectSurfaces = () => {\n if (typeof document === 'undefined') {\n return [];\n }\n return Array.from(document.querySelectorAll('dx-surface')).map((el) => ({\n id: el.getAttribute('data-id') ?? undefined,\n role: el.getAttribute('data-role') ?? undefined,\n component: el.getAttribute('data-component') ?? undefined,\n }));\n};\n\n/** The app's own report of what an operation just did — read the way a user reads it, off the DOM. */\nconst collectToasts = () => {\n if (typeof document === 'undefined') {\n return [];\n }\n return Array.from(document.querySelectorAll('[data-scope=\"toast\"][data-part=\"root\"]')).map((el) => ({\n title: el.querySelector('[data-part=\"title\"]')?.textContent ?? undefined,\n description: el.querySelector('[data-part=\"description\"]')?.textContent ?? undefined,\n actions: Array.from(el.querySelectorAll('button')).map(\n (button) => button.getAttribute('aria-label') ?? button.textContent ?? '',\n ),\n }));\n};\n\n/** Recent error-level entries from the process-wide log buffer, which the plugin starts recording at startup. */\nconst collectErrors = (since: number) =>\n logBuffer\n .getRows()\n .filter(({ entry }) => entry.level >= LogLevel.ERROR && entry.timestamp >= since)\n .map(({ entry }) => ({\n timestamp: entry.timestamp,\n message: entry.message,\n error: entry.computedError,\n file: entry.meta?.F,\n }));\n\nconst DEFAULT_ERROR_WINDOW_MS = 60_000;\n\nconst handler: Operation.WithHandler<typeof DebugOperation.Snapshot> = DebugOperation.Snapshot.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ since }) {\n const manager = yield* Plugin.Service;\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n // Each source is optional: the snapshot degrades per-section rather than failing when a\n // contributing plugin (deck, graph, attention) is not active on this host.\n const layoutAtom = yield* Capability.getOption(AppCapabilities.Layout);\n const graphBuilder = yield* Capability.getOption(AppCapabilities.AppGraph);\n const translator = yield* Capability.getOption(AppCapabilities.Translator);\n const attention = yield* Capability.getOption(AttentionCapabilities.Attention);\n const client = yield* Capability.getOption(ClientCapabilities.Client);\n\n const translate = makeTranslate(Option.getOrUndefined(translator));\n const layout = Option.getOrUndefined(Option.map(layoutAtom, (atom) => registry.get(atom)));\n const graph = Option.getOrUndefined(Option.map(graphBuilder, (builder) => builder.graph));\n\n const planks = yield* Effect.promise(() =>\n Promise.all(\n (layout?.active ?? []).map(async (id) => {\n const node = graph ? Option.getOrUndefined(AppGraph.getNode(graph, id)) : undefined;\n return {\n id,\n label: node ? translate(node.properties?.label) : undefined,\n type: node?.type,\n subject: node ? summarizeSubject(node.data) : undefined,\n actions: graph ? collectActions(graph, translate, id) : [],\n comments: node ? await collectComments(node.data) : undefined,\n };\n }),\n ),\n );\n\n const spaces = Option.match(client, {\n onNone: () => [],\n onSome: (client) => {\n const defaultSpace = AppSpace.getDefaultSpace(client);\n return client.spaces.get().map((space) => ({\n id: space.id,\n name: space.state.get() === SpaceState.SPACE_READY ? space.properties.name : undefined,\n state: SpaceState[space.state.get()],\n default: space === defaultSpace ? true : undefined,\n }));\n },\n });\n\n const activeModules = new Set(manager.getActive());\n const plugins = manager.getPlugins();\n\n return {\n layout: layout && {\n mode: layout.mode,\n sidebarOpen: layout.sidebarOpen,\n complementarySidebarOpen: layout.complementarySidebarOpen,\n dialogOpen: layout.dialogOpen,\n workspace: layout.workspace,\n active: layout.active,\n inactive: layout.inactive,\n scrollIntoView: layout.scrollIntoView,\n },\n attention: Option.getOrUndefined(attention)?.getCurrent().slice() ?? [],\n planks,\n surfaces: collectSurfaces(),\n spaces,\n toasts: collectToasts(),\n errors: collectErrors(since ?? Date.now() - DEFAULT_ERROR_WINDOW_MS),\n plugins: {\n installed: plugins.length,\n enabled: manager.getEnabled().length,\n active: plugins.filter((plugin) => plugin.modules.some((module) => activeModules.has(module.id))).length,\n },\n };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,iBACH,gBACA,UAAU;CACT,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,IAAI,MAAM,QAAQ,KAAK,KAAK,OAAO,MAAM,OAAO,UAC9C,OAAO,aAAa,WAAW,EAAE,MAAM,IAAI,MAAM,EAAE,IAAI,MAAM;AAGjE;;AAGF,IAAM,oBAAoB,SAAkB;CAC1C,IAAI,QAAQ,QAAQ,OAAO,SAAS,UAClC;CAEF,IAAI,IAAI,SAAS,IAAI,GACnB,OAAO;EACL,KAAK,OAAO,IAAI,OAAO,IAAI,CAAC;EAC5B,UAAU,IAAI,YAAY,IAAI;EAC9B,MAAM,IAAI,SAAS,IAAI;EAEvB,MAAM,IAAI,WAAW,SAAS,UAAU,IAAI,IAAI,KAAK,QAAQ,QAAQ,UAAU,KAAA;CACjF;CAEF,IAAI,QAAQ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,CAAC,KAAK,WAAW;IACzC,IAAI,MAAM;IACV,MAAM,MAAM,MAAM,IAAI,MAAM,WAAW,cAAc,MAAM,WAAW,OAAO,KAAA;IAC7E,OAAO,WAAW,MAAM,MAAM,IAAI;IAClC,SAAS,UAAU,eAAe,OAAO,KAAA;GAC3C,EAAE;EACJ;CACF,CAAC;CAED,MAAM,gBAAgB,IAAI,IAAI,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAU,QAAQ,WAAW;CAEnC,OAAO;EACL,QAAQ,UAAU;GAChB,MAAM,OAAO;GACb,aAAa,OAAO;GACpB,0BAA0B,OAAO;GACjC,YAAY,OAAO;GACnB,WAAW,OAAO;GAClB,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,gBAAgB,OAAO;EACzB;EACA,WAAW,OAAO,eAAe,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC;EACtE;EACA,UAAU,gBAAgB;EAC1B;EACA,QAAQ,cAAc;EACtB,QAAQ,cAAc,SAAS,KAAK,IAAI,IAAI,uBAAuB;EACnE,SAAS;GACP,WAAW,QAAQ;GACnB,SAAS,QAAQ,WAAW,CAAC,CAAC;GAC9B,QAAQ,QAAQ,QAAQ,WAAW,OAAO,QAAQ,MAAM,WAAW,cAAc,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;EACpG;CACF;AACF,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { r as makeTemplate } from "./chunk-IncidentSpace.mjs";
|
|
2
|
+
import { r as makeTemplate$1 } from "./chunk-PipelineSpace.mjs";
|
|
3
|
+
import { i as makeTemplate$2 } from "./chunk-ReviewSpace.mjs";
|
|
4
|
+
import { r as makeTemplate$3 } from "./chunk-StockfishSpace.mjs";
|
|
5
|
+
import { r as makeTemplate$4 } from "./chunk-TidepoolSpace.mjs";
|
|
6
|
+
import { r as makeTemplate$5 } from "./chunk-WeatherSpace.mjs";
|
|
7
|
+
import { r as makeTemplate$6 } from "./chunk-WorkerSpace.mjs";
|
|
8
|
+
//#region src/capabilities/space-templates.ts
|
|
9
|
+
var space_templates_default = [
|
|
10
|
+
makeTemplate$1(),
|
|
11
|
+
makeTemplate$4(),
|
|
12
|
+
makeTemplate$3(),
|
|
13
|
+
makeTemplate$6(),
|
|
14
|
+
makeTemplate$5(),
|
|
15
|
+
makeTemplate(),
|
|
16
|
+
makeTemplate$2()
|
|
17
|
+
];
|
|
18
|
+
//#endregion
|
|
19
|
+
export { space_templates_default as default };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=chunk-space-templates.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-space-templates.mjs","names":[],"sources":["../../src/capabilities/space-templates.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\n\nimport {\n IncidentSpace,\n PipelineSpace,\n ReviewSpace,\n StockfishSpace,\n TidepoolSpace,\n WeatherSpace,\n WorkerSpace,\n} from '../samples/index.ts';\n\nexport default [\n PipelineSpace.makeTemplate(),\n TidepoolSpace.makeTemplate(),\n StockfishSpace.makeTemplate(),\n WorkerSpace.makeTemplate(),\n WeatherSpace.makeTemplate(),\n IncidentSpace.makeTemplate(),\n ReviewSpace.makeTemplate(),\n] satisfies ReadonlyArray<AppCapabilities.SpaceTemplate>;\n"],"mappings":";;;;;;;;AAgBA,IAAA,0BAAe;CACb,eAA2B;CAC3B,eAA2B;CAC3B,eAA4B;CAC5B,eAAyB;CACzB,eAA0B;CAC1B,aAA2B;CAC3B,eAAyB;AAC3B"}
|
|
@@ -3,7 +3,7 @@ import * as Capability from "@dxos/app-framework/Capability";
|
|
|
3
3
|
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
4
4
|
import { meta } from "#meta";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
|
-
import * as Atom from "effect/
|
|
6
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
7
7
|
//#region src/capabilities/stats-panel.ts
|
|
8
8
|
var STORAGE_KEY = `${meta.profile.key}.statsPanel`;
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-stats-panel.mjs","names":[],"sources":["../../src/capabilities/stats-panel.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Atom from 'effect/
|
|
1
|
+
{"version":3,"file":"chunk-stats-panel.mjs","names":[],"sources":["../../src/capabilities/stats-panel.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Atom from 'effect/reactivity/Atom';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\n\nimport { meta } from '#meta';\n\ntype StatsPanelOptions = {\n /** Persist the store to localStorage (hydrate on load, save on write). */\n persist?: boolean;\n};\n\nconst STORAGE_KEY = `${meta.profile.key}.statsPanel`;\n\n/**\n * Contributes the {@link AppCapabilities.StatsPanel} store: a single reactive atom holding one\n * compartment per plugin, keyed by plugin key. Read access spans the whole store; writes are scoped\n * to a compartment via `compartment(pluginKey)`. Kept alive with `Atom.keepAlive` so a background\n * writer (e.g. a sync operation) can populate it before any surface subscribes. When `persist` is set\n * the store hydrates from and saves to localStorage so stats survive a reload.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ persist = true }: StatsPanelOptions = {}) {\n const registry = yield* Capabilities.AtomRegistry;\n const canPersist = persist && typeof localStorage !== 'undefined';\n\n const hydrate = (): Record<string, unknown> => {\n if (!canPersist) {\n return {};\n }\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n return raw ? JSON.parse(raw) : {};\n } catch {\n // Best-effort: a malformed/unavailable value just starts empty.\n return {};\n }\n };\n\n const statsAtom = Atom.make<Record<string, unknown>>(hydrate()).pipe(Atom.keepAlive);\n\n const save = () => {\n if (!canPersist) {\n return;\n }\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(registry.get(statsAtom)));\n } catch {\n // Best-effort: localStorage may be disabled or over quota; the in-memory atom is authoritative.\n }\n };\n\n return Capability.contribute(AppCapabilities.StatsPanel, {\n statsAtom,\n get: (pluginKey) => registry.get(statsAtom)[pluginKey],\n compartment: (pluginKey) => ({\n set: (stats) => {\n registry.set(statsAtom, { ...registry.get(statsAtom), [pluginKey]: stats });\n save();\n },\n clear: () => {\n const { [pluginKey]: _removed, ...rest } = registry.get(statsAtom);\n registry.set(statsAtom, rest);\n save();\n },\n }),\n });\n }),\n);\n"],"mappings":";;;;;;;AAkBA,IAAM,cAAc,GAAG,KAAK,QAAQ,IAAI;;;;;;;;AASxC,IAAA,sBAAe,WAAW,WACxB,OAAO,WAAW,WAAW,EAAE,UAAU,SAA4B,CAAC,GAAG;CACvE,MAAM,WAAW,OAAO,aAAa;CACrC,MAAM,aAAa,WAAW,OAAO,iBAAiB;CAEtD,MAAM,gBAAyC;EAC7C,IAAI,CAAC,YACH,OAAO,CAAC;EAEV,IAAI;GACF,MAAM,MAAM,aAAa,QAAQ,WAAW;GAC5C,OAAO,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;EAClC,QAAQ;GAEN,OAAO,CAAC;EACV;CACF;CAEA,MAAM,YAAY,KAAK,KAA8B,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS;CAEnF,MAAM,aAAa;EACjB,IAAI,CAAC,YACH;EAEF,IAAI;GACF,aAAa,QAAQ,aAAa,KAAK,UAAU,SAAS,IAAI,SAAS,CAAC,CAAC;EAC3E,QAAQ,CAER;CACF;CAEA,OAAO,WAAW,WAAW,gBAAgB,YAAY;EACvD;EACA,MAAM,cAAc,SAAS,IAAI,SAAS,CAAC,CAAC;EAC5C,cAAc,eAAe;GAC3B,MAAM,UAAU;IACd,SAAS,IAAI,WAAW;KAAE,GAAG,SAAS,IAAI,SAAS;MAAI,YAAY;IAAM,CAAC;IAC1E,KAAK;GACP;GACA,aAAa;IACX,MAAM,GAAG,YAAY,UAAU,GAAG,SAAS,SAAS,IAAI,SAAS;IACjE,SAAS,IAAI,WAAW,IAAI;IAC5B,KAAK;GACP;EACF;CACF,CAAC;AACH,CAAC,CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as NothingToUndoError } from "./chunk-errors.mjs";
|
|
2
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
3
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
4
|
+
import { DebugOperation } from "#types";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
7
|
+
//#region src/operations/undo.ts
|
|
8
|
+
var handler = DebugOperation.Undo.pipe(Operation.withHandler(Effect.fnUntraced(function* () {
|
|
9
|
+
const tracker = yield* Capability.get(Capabilities.HistoryTracker);
|
|
10
|
+
if (!tracker.canUndo()) return yield* Effect.fail(new NothingToUndoError());
|
|
11
|
+
yield* tracker.undo();
|
|
12
|
+
return { undone: true };
|
|
13
|
+
})));
|
|
14
|
+
//#endregion
|
|
15
|
+
export { handler as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=chunk-undo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-undo.mjs","names":[],"sources":["../../src/operations/undo.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { DebugOperation } from '#types';\n\nimport { NothingToUndoError } from '../errors.ts';\n\nconst handler: Operation.WithHandler<typeof DebugOperation.Undo> = DebugOperation.Undo.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n const tracker = yield* Capability.get(Capabilities.HistoryTracker);\n if (!tracker.canUndo()) {\n return yield* Effect.fail(new NothingToUndoError());\n }\n yield* tracker.undo();\n return { undone: true };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;AAcA,IAAM,UAA6D,eAAe,KAAK,KACrF,UAAU,YACR,OAAO,WAAW,aAAa;CAC7B,MAAM,UAAU,OAAO,WAAW,IAAI,aAAa,cAAc;CACjE,IAAI,CAAC,QAAQ,QAAQ,GACnB,OAAO,OAAO,OAAO,KAAK,IAAI,mBAAmB,CAAC;CAEpD,OAAO,QAAQ,KAAK;CACpB,OAAO,EAAE,QAAQ,KAAK;AACxB,CAAC,CACH,CACF"}
|