@dxos/plugin-debug 0.8.3 → 0.8.4-main.1068cf700f

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.
Files changed (132) hide show
  1. package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs +15 -0
  2. package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs.map +7 -0
  3. package/dist/lib/browser/DevtoolsOverviewContainer-2C6XMJ3L.mjs +19 -0
  4. package/dist/lib/browser/DevtoolsOverviewContainer-2C6XMJ3L.mjs.map +7 -0
  5. package/dist/lib/browser/SpaceGenerator-W3LJORYT.mjs +1152 -0
  6. package/dist/lib/browser/SpaceGenerator-W3LJORYT.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-DEBTVBQG.mjs +599 -0
  8. package/dist/lib/browser/app-graph-builder-DEBTVBQG.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-KS3YBEL7.mjs → chunk-4UFQXPP7.mjs} +13 -3
  10. package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-A5H5GRV6.mjs +20 -0
  12. package/dist/lib/browser/chunk-A5H5GRV6.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +42 -46
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/react-context-I3USIAF6.mjs +17 -0
  17. package/dist/lib/browser/react-context-I3USIAF6.mjs.map +7 -0
  18. package/dist/lib/browser/react-surface-FMVC5GPV.mjs +758 -0
  19. package/dist/lib/browser/react-surface-FMVC5GPV.mjs.map +7 -0
  20. package/dist/lib/browser/settings-SLTQJJNF.mjs +32 -0
  21. package/dist/lib/browser/settings-SLTQJJNF.mjs.map +7 -0
  22. package/dist/types/src/DebugPlugin.d.ts +2 -1
  23. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  25. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  27. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/index.d.ts +4 -8
  29. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
  31. package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
  33. package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  35. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  37. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/settings/index.d.ts +3 -0
  39. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
  41. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  42. package/dist/types/src/components/DebugGraph.d.ts +9 -0
  43. package/dist/types/src/components/DebugGraph.d.ts.map +1 -0
  44. package/dist/types/src/components/DebugObjectPanel.d.ts +1 -1
  45. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  46. package/dist/types/src/components/DebugSettings.d.ts +4 -2
  47. package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
  48. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +6 -4
  49. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  50. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +1 -1
  51. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  52. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +13 -4
  53. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +1 -1
  54. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  55. package/dist/types/src/components/SpaceGenerator/presets.d.ts +5 -8
  56. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  57. package/dist/types/src/components/Wireframe.d.ts +2 -2
  58. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  59. package/dist/types/src/components/index.d.ts +4 -3
  60. package/dist/types/src/components/index.d.ts.map +1 -1
  61. package/dist/types/src/meta.d.ts +2 -3
  62. package/dist/types/src/meta.d.ts.map +1 -1
  63. package/dist/types/src/translations.d.ts +62 -60
  64. package/dist/types/src/translations.d.ts.map +1 -1
  65. package/dist/types/src/types.d.ts +6 -1
  66. package/dist/types/src/types.d.ts.map +1 -1
  67. package/dist/types/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +79 -71
  69. package/src/DebugPlugin.tsx +19 -34
  70. package/src/capabilities/app-graph-builder/app-graph-builder.ts +421 -0
  71. package/src/capabilities/app-graph-builder/index.ts +7 -0
  72. package/src/capabilities/index.ts +4 -6
  73. package/src/capabilities/react-context/index.ts +7 -0
  74. package/src/capabilities/react-context/react-context.tsx +20 -0
  75. package/src/capabilities/react-surface/index.ts +7 -0
  76. package/src/capabilities/react-surface/react-surface.tsx +411 -0
  77. package/src/capabilities/settings/index.ts +7 -0
  78. package/src/capabilities/settings/settings.ts +31 -0
  79. package/src/components/DebugGraph.tsx +15 -0
  80. package/src/components/DebugObjectPanel.tsx +6 -9
  81. package/src/components/DebugSettings.tsx +109 -75
  82. package/src/components/DebugStatus.tsx +2 -2
  83. package/src/components/DevtoolsOverviewContainer.tsx +2 -2
  84. package/src/components/SpaceGenerator/ObjectGenerator.tsx +40 -41
  85. package/src/components/SpaceGenerator/SchemaTable.tsx +2 -2
  86. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +17 -15
  87. package/src/components/SpaceGenerator/SpaceGenerator.tsx +41 -94
  88. package/src/components/SpaceGenerator/draw-util.ts +5 -5
  89. package/src/components/SpaceGenerator/presets.ts +537 -259
  90. package/src/components/Wireframe.tsx +6 -6
  91. package/src/components/index.ts +4 -1
  92. package/src/meta.ts +8 -7
  93. package/src/translations.ts +9 -5
  94. package/src/types.ts +9 -1
  95. package/dist/lib/browser/DebugApp-WSEJPCKY.mjs +0 -225
  96. package/dist/lib/browser/DebugApp-WSEJPCKY.mjs.map +0 -7
  97. package/dist/lib/browser/DevtoolsOverviewContainer-IIIWO77Q.mjs +0 -25
  98. package/dist/lib/browser/DevtoolsOverviewContainer-IIIWO77Q.mjs.map +0 -7
  99. package/dist/lib/browser/SpaceGenerator-VB6IB2LL.mjs +0 -1238
  100. package/dist/lib/browser/SpaceGenerator-VB6IB2LL.mjs.map +0 -7
  101. package/dist/lib/browser/app-graph-builder-6HHJMKVU.mjs +0 -597
  102. package/dist/lib/browser/app-graph-builder-6HHJMKVU.mjs.map +0 -7
  103. package/dist/lib/browser/chunk-47JOZTT2.mjs +0 -18
  104. package/dist/lib/browser/chunk-47JOZTT2.mjs.map +0 -7
  105. package/dist/lib/browser/chunk-KS3YBEL7.mjs.map +0 -7
  106. package/dist/lib/browser/react-context-ZQRD2WG2.mjs +0 -16
  107. package/dist/lib/browser/react-context-ZQRD2WG2.mjs.map +0 -7
  108. package/dist/lib/browser/react-surface-UI6OK73H.mjs +0 -768
  109. package/dist/lib/browser/react-surface-UI6OK73H.mjs.map +0 -7
  110. package/dist/lib/browser/settings-SXQWSIM4.mjs +0 -22
  111. package/dist/lib/browser/settings-SXQWSIM4.mjs.map +0 -7
  112. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  113. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  114. package/dist/types/src/capabilities/react-context.d.ts +0 -8
  115. package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
  116. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  117. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  118. package/dist/types/src/capabilities/settings.d.ts +0 -4
  119. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  120. package/dist/types/src/components/DebugApp/DebugApp.d.ts +0 -6
  121. package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +0 -1
  122. package/dist/types/src/components/DebugApp/Tree.d.ts +0 -18
  123. package/dist/types/src/components/DebugApp/Tree.d.ts.map +0 -1
  124. package/dist/types/src/components/DebugApp/index.d.ts +0 -3
  125. package/dist/types/src/components/DebugApp/index.d.ts.map +0 -1
  126. package/src/capabilities/app-graph-builder.ts +0 -457
  127. package/src/capabilities/react-context.tsx +0 -16
  128. package/src/capabilities/react-surface.tsx +0 -397
  129. package/src/capabilities/settings.ts +0 -19
  130. package/src/components/DebugApp/DebugApp.tsx +0 -77
  131. package/src/components/DebugApp/Tree.tsx +0 -103
  132. package/src/components/DebugApp/index.ts +0 -7
package/package.json CHANGED
@@ -1,17 +1,22 @@
1
1
  {
2
2
  "name": "@dxos/plugin-debug",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.1068cf700f",
4
4
  "description": "DXOS Surface plugin for testing.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
10
14
  "type": "module",
11
15
  "exports": {
12
16
  ".": {
13
- "types": "./dist/types/src/index.d.ts",
14
- "browser": "./dist/lib/browser/index.mjs"
17
+ "browser": "./dist/lib/browser/index.mjs",
18
+ "source": "./src/index.ts",
19
+ "types": "./dist/types/src/index.d.ts"
15
20
  }
16
21
  },
17
22
  "types": "dist/types/src/index.d.ts",
@@ -25,83 +30,86 @@
25
30
  "dependencies": {
26
31
  "@antv/graphlib": "^2.0.4",
27
32
  "@antv/layout": "^1.2.13",
28
- "@automerge/automerge": "3.0.0-beta.4",
29
- "@preact-signals/safe-react": "^0.9.0",
30
- "@preact/signals-core": "^1.9.0",
33
+ "@automerge/automerge": "3.2.3",
34
+ "@effect-atom/atom": "^0.5.1",
35
+ "@effect-atom/atom-react": "^0.5.0",
31
36
  "@tldraw/tldraw": "^3.0.0",
32
37
  "date-fns": "^3.3.1",
33
38
  "react-json-tree": "^0.18.0",
34
39
  "react-resize-detector": "^11.0.1",
35
40
  "workerize-loader": "^2.0.2",
36
- "@dxos/app-framework": "0.8.3",
37
- "@dxos/async": "0.8.3",
38
- "@dxos/compute": "0.8.3",
39
- "@dxos/client-services": "0.8.3",
40
- "@dxos/config": "0.8.3",
41
- "@dxos/conductor": "0.8.3",
42
- "@dxos/context": "0.8.3",
43
- "@dxos/devtools": "0.8.3",
44
- "@dxos/echo": "0.8.3",
45
- "@dxos/echo-generator": "0.8.3",
46
- "@dxos/echo-pipeline": "0.8.3",
47
- "@dxos/echo-schema": "0.8.3",
48
- "@dxos/functions": "0.8.3",
49
- "@dxos/invariant": "0.8.3",
50
- "@dxos/local-storage": "0.8.3",
51
- "@dxos/live-object": "0.8.3",
52
- "@dxos/keys": "0.8.3",
53
- "@dxos/log": "0.8.3",
54
- "@dxos/plugin-client": "0.8.3",
55
- "@dxos/plugin-deck": "0.8.3",
56
- "@dxos/plugin-graph": "0.8.3",
57
- "@dxos/plugin-markdown": "0.8.3",
58
- "@dxos/plugin-meeting": "0.8.3",
59
- "@dxos/plugin-sheet": "0.8.3",
60
- "@dxos/plugin-space": "0.8.3",
61
- "@dxos/plugin-script": "0.8.3",
62
- "@dxos/plugin-table": "0.8.3",
63
- "@dxos/plugin-status-bar": "0.8.3",
64
- "@dxos/protocols": "0.8.3",
65
- "@dxos/plugin-theme": "0.8.3",
66
- "@dxos/react-client": "0.8.3",
67
- "@dxos/react-ui-attention": "0.8.3",
68
- "@dxos/react-ui-canvas-compute": "0.8.3",
69
- "@dxos/react-ui-canvas-editor": "0.8.3",
70
- "@dxos/random": "0.8.3",
71
- "@dxos/react-ui-form": "0.8.3",
72
- "@dxos/react-ui-kanban": "0.8.3",
73
- "@dxos/react-hooks": "0.8.3",
74
- "@dxos/react-ui-stack": "0.8.3",
75
- "@dxos/react-ui-table": "0.8.3",
76
- "@dxos/react-ui-syntax-highlighter": "0.8.3",
77
- "@dxos/schema": "0.8.3",
78
- "@dxos/util": "0.8.3",
79
- "@dxos/plugin-sketch": "0.8.3"
41
+ "@dxos/app-toolkit": "0.8.4-main.1068cf700f",
42
+ "@dxos/async": "0.8.4-main.1068cf700f",
43
+ "@dxos/assistant-toolkit": "0.8.4-main.1068cf700f",
44
+ "@dxos/blueprints": "0.8.4-main.1068cf700f",
45
+ "@dxos/app-framework": "0.8.4-main.1068cf700f",
46
+ "@dxos/client-services": "0.8.4-main.1068cf700f",
47
+ "@dxos/compute": "0.8.4-main.1068cf700f",
48
+ "@dxos/conductor": "0.8.4-main.1068cf700f",
49
+ "@dxos/config": "0.8.4-main.1068cf700f",
50
+ "@dxos/echo": "0.8.4-main.1068cf700f",
51
+ "@dxos/echo-generator": "0.8.4-main.1068cf700f",
52
+ "@dxos/devtools": "0.8.4-main.1068cf700f",
53
+ "@dxos/context": "0.8.4-main.1068cf700f",
54
+ "@dxos/echo-pipeline": "0.8.4-main.1068cf700f",
55
+ "@dxos/effect": "0.8.4-main.1068cf700f",
56
+ "@dxos/invariant": "0.8.4-main.1068cf700f",
57
+ "@dxos/keys": "0.8.4-main.1068cf700f",
58
+ "@dxos/operation": "0.8.4-main.1068cf700f",
59
+ "@dxos/functions": "0.8.4-main.1068cf700f",
60
+ "@dxos/plugin-client": "0.8.4-main.1068cf700f",
61
+ "@dxos/plugin-deck": "0.8.4-main.1068cf700f",
62
+ "@dxos/log": "0.8.4-main.1068cf700f",
63
+ "@dxos/plugin-graph": "0.8.4-main.1068cf700f",
64
+ "@dxos/plugin-inbox": "0.8.4-main.1068cf700f",
65
+ "@dxos/plugin-meeting": "0.8.4-main.1068cf700f",
66
+ "@dxos/plugin-markdown": "0.8.4-main.1068cf700f",
67
+ "@dxos/plugin-script": "0.8.4-main.1068cf700f",
68
+ "@dxos/plugin-sheet": "0.8.4-main.1068cf700f",
69
+ "@dxos/plugin-sketch": "0.8.4-main.1068cf700f",
70
+ "@dxos/plugin-space": "0.8.4-main.1068cf700f",
71
+ "@dxos/plugin-status-bar": "0.8.4-main.1068cf700f",
72
+ "@dxos/plugin-table": "0.8.4-main.1068cf700f",
73
+ "@dxos/plugin-theme": "0.8.4-main.1068cf700f",
74
+ "@dxos/random": "0.8.4-main.1068cf700f",
75
+ "@dxos/protocols": "0.8.4-main.1068cf700f",
76
+ "@dxos/react-client": "0.8.4-main.1068cf700f",
77
+ "@dxos/react-ui-attention": "0.8.4-main.1068cf700f",
78
+ "@dxos/react-ui-canvas-compute": "0.8.4-main.1068cf700f",
79
+ "@dxos/react-hooks": "0.8.4-main.1068cf700f",
80
+ "@dxos/react-ui-canvas-editor": "0.8.4-main.1068cf700f",
81
+ "@dxos/react-ui-form": "0.8.4-main.1068cf700f",
82
+ "@dxos/react-ui-kanban": "0.8.4-main.1068cf700f",
83
+ "@dxos/react-ui-mosaic": "0.8.4-main.1068cf700f",
84
+ "@dxos/react-ui-stack": "0.8.4-main.1068cf700f",
85
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.1068cf700f",
86
+ "@dxos/react-ui-table": "0.8.4-main.1068cf700f",
87
+ "@dxos/schema": "0.8.4-main.1068cf700f",
88
+ "@dxos/types": "0.8.4-main.1068cf700f",
89
+ "@dxos/util": "0.8.4-main.1068cf700f"
80
90
  },
81
91
  "devDependencies": {
82
- "@effect-rx/rx-react": "^0.34.1",
83
- "@effect/platform": "0.80.12",
84
- "@phosphor-icons/react": "^2.1.5",
85
- "@types/react": "~18.2.0",
86
- "@types/react-dom": "~18.2.0",
87
- "effect": "3.14.21",
88
- "react": "~18.2.0",
89
- "react-dom": "~18.2.0",
90
- "vite": "5.4.7",
91
- "@dxos/react-ui": "0.8.3",
92
- "@dxos/react-ui-theme": "0.8.3",
93
- "@dxos/storybook-utils": "0.8.3"
92
+ "@effect-atom/atom-react": "^0.5.0",
93
+ "@effect/platform": "0.94.4",
94
+ "@types/react": "~19.2.7",
95
+ "@types/react-dom": "~19.2.3",
96
+ "effect": "3.19.16",
97
+ "react": "~19.2.3",
98
+ "react-dom": "~19.2.3",
99
+ "vite": "7.1.9",
100
+ "@dxos/react-ui": "0.8.4-main.1068cf700f",
101
+ "@dxos/storybook-utils": "0.8.4-main.1068cf700f",
102
+ "@dxos/ui-theme": "0.8.4-main.1068cf700f"
94
103
  },
95
104
  "peerDependencies": {
96
- "@effect-rx/rx-react": "^0.34.1",
97
- "@effect/platform": "0.80.12",
98
- "@phosphor-icons/react": "^2.1.5",
99
- "effect": "^3.13.3",
100
- "react": "~18.2.0",
101
- "react-dom": "~18.2.0",
102
- "@dxos/react-ui-theme": "0.8.3",
103
- "@dxos/react-ui": "0.8.3",
104
- "@dxos/random": "0.8.3"
105
+ "@effect-atom/atom-react": "^0.5.0",
106
+ "@effect/platform": "0.94.4",
107
+ "effect": "3.19.16",
108
+ "react": "~19.2.3",
109
+ "react-dom": "~19.2.3",
110
+ "@dxos/random": "0.8.4-main.1068cf700f",
111
+ "@dxos/react-ui": "0.8.4-main.1068cf700f",
112
+ "@dxos/ui-theme": "0.8.4-main.1068cf700f"
105
113
  },
106
114
  "publishConfig": {
107
115
  "access": "public"
@@ -2,45 +2,30 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { ActivationEvents, Plugin } from '@dxos/app-framework';
8
+ import { AppPlugin } from '@dxos/app-toolkit';
6
9
  import { type Client } from '@dxos/react-client';
7
10
 
8
11
  import { AppGraphBuilder, DebugSettings, ReactContext, ReactSurface } from './capabilities';
9
12
  import { meta } from './meta';
10
- import translations from './translations';
11
-
12
- // TODO(wittjosiah): Rename to DevtoolsPlugin?
13
- export const DebugPlugin = () => {
14
- setupDevtools();
13
+ import { translations } from './translations';
15
14
 
16
- return definePlugin(meta, [
17
- defineModule({
18
- id: `${meta.id}/module/settings`,
19
- activatesOn: Events.SetupSettings,
20
- activate: DebugSettings,
21
- }),
22
- defineModule({
23
- id: `${meta.id}/module/translations`,
24
- activatesOn: Events.SetupTranslations,
25
- activate: () => contributes(Capabilities.Translations, translations),
26
- }),
27
- defineModule({
28
- id: `${meta.id}/module/react-context`,
29
- activatesOn: Events.Startup,
30
- activate: ReactContext,
31
- }),
32
- defineModule({
33
- id: `${meta.id}/module/react-surface`,
34
- activatesOn: Events.SetupReactSurface,
35
- activate: ReactSurface,
36
- }),
37
- defineModule({
38
- id: `${meta.id}/module/app-graph-builder`,
39
- activatesOn: Events.SetupAppGraph,
40
- activate: AppGraphBuilder,
41
- }),
42
- ]);
43
- };
15
+ // TODO(wittjosiah): Factor out DevtoolsPlugin?
16
+ export const DebugPlugin = Plugin.define(meta).pipe(
17
+ AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
18
+ AppPlugin.addReactContextModule({ activate: ReactContext }),
19
+ AppPlugin.addSettingsModule({ activate: DebugSettings }),
20
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
21
+ AppPlugin.addTranslationsModule({ translations }),
22
+ Plugin.addModule({
23
+ id: 'setup-devtools',
24
+ activatesOn: ActivationEvents.Startup,
25
+ activate: () => Effect.sync(() => setupDevtools()),
26
+ }),
27
+ Plugin.make,
28
+ );
44
29
 
45
30
  const setupDevtools = () => {
46
31
  (globalThis as any).composer ??= {};
@@ -0,0 +1,421 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
+ import { Obj } from '@dxos/echo';
10
+ import { ClientCapabilities } from '@dxos/plugin-client';
11
+ import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
12
+ import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
13
+ import { meta as spaceMeta } from '@dxos/plugin-space';
14
+ import { parseId } from '@dxos/react-client/echo';
15
+
16
+ import { meta } from '../../meta';
17
+ import { Devtools } from '../../types';
18
+
19
+ const DEVTOOLS_TYPE = `${meta.id}/devtools`;
20
+
21
+ export default Capability.makeModule(
22
+ Effect.fnUntraced(function* () {
23
+ const extensions = yield* Effect.all([
24
+ // Devtools node.
25
+ GraphBuilder.createExtension({
26
+ id: `${meta.id}/devtools`,
27
+ match: NodeMatcher.whenAny(NodeMatcher.whenRoot, NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`)),
28
+ connector: (node, get) =>
29
+ Effect.gen(function* () {
30
+ const client = yield* Capability.get(ClientCapabilities.Client);
31
+ const layoutAtom = get(yield* Capability.atom(AppCapabilities.Layout))[0];
32
+ const layout = layoutAtom ? get(layoutAtom) : undefined;
33
+ const { spaceId } = parseId(layout?.workspace);
34
+ const space = spaceId ? client.spaces.get(spaceId) : undefined;
35
+ const [graph] = get(yield* Capability.atom(AppCapabilities.AppGraph));
36
+
37
+ return [
38
+ {
39
+ id: `${Devtools.id}-${node.id}`,
40
+ data: null,
41
+ type: DEVTOOLS_TYPE,
42
+ properties: {
43
+ label: ['devtools label', { ns: meta.id }],
44
+ icon: 'ph--hammer--regular',
45
+ disposition: 'pin-end',
46
+ position: 'fallback',
47
+ },
48
+ nodes: [
49
+ ...(space && node.type === `${spaceMeta.id}/settings`
50
+ ? [
51
+ {
52
+ id: `debug-${node.id}`,
53
+ type: `${meta.id}/space`,
54
+ data: { space, type: `${meta.id}/space` },
55
+ properties: {
56
+ label: ['debug label', { ns: meta.id }],
57
+ icon: 'ph--bug--regular',
58
+ },
59
+ },
60
+ ]
61
+ : []),
62
+ {
63
+ id: `app-graph-${node.id}`,
64
+ type: `${meta.id}/app-graph`,
65
+ data: { graph: graph?.graph, root: space ? space.id : Node.RootId },
66
+ properties: {
67
+ label: ['debug app graph label', { ns: meta.id }],
68
+ icon: 'ph--graph--regular',
69
+ },
70
+ },
71
+ {
72
+ id: `${Devtools.Client.id}-${node.id}`,
73
+ data: null,
74
+ type: DEVTOOLS_TYPE,
75
+ properties: {
76
+ label: ['client label', { ns: meta.id }],
77
+ icon: 'ph--users--regular',
78
+ },
79
+ nodes: [
80
+ {
81
+ id: `${Devtools.Client.Config}-${node.id}`,
82
+ data: Devtools.Client.Config,
83
+ type: DEVTOOLS_TYPE,
84
+ properties: {
85
+ label: ['config label', { ns: meta.id }],
86
+ icon: 'ph--gear--regular',
87
+ },
88
+ },
89
+ {
90
+ id: `${Devtools.Client.Storage}-${node.id}`,
91
+ data: Devtools.Client.Storage,
92
+ type: DEVTOOLS_TYPE,
93
+ properties: {
94
+ label: ['storage label', { ns: meta.id }],
95
+ icon: 'ph--hard-drives--regular',
96
+ },
97
+ },
98
+ {
99
+ id: `${Devtools.Client.Logs}-${node.id}`,
100
+ data: Devtools.Client.Logs,
101
+ type: DEVTOOLS_TYPE,
102
+ properties: {
103
+ label: ['logs label', { ns: meta.id }],
104
+ icon: 'ph--file-text--regular',
105
+ },
106
+ },
107
+ {
108
+ id: `${Devtools.Client.Diagnostics}-${node.id}`,
109
+ data: Devtools.Client.Diagnostics,
110
+ type: DEVTOOLS_TYPE,
111
+ properties: {
112
+ label: ['diagnostics label', { ns: meta.id }],
113
+ icon: 'ph--chart-line--regular',
114
+ },
115
+ },
116
+ {
117
+ id: `${Devtools.Client.Tracing}-${node.id}`,
118
+ data: Devtools.Client.Tracing,
119
+ type: DEVTOOLS_TYPE,
120
+ properties: {
121
+ label: ['tracing label', { ns: meta.id }],
122
+ icon: 'ph--fire--regular',
123
+ },
124
+ },
125
+ ],
126
+ },
127
+ {
128
+ id: `${Devtools.Halo.id}-${node.id}`,
129
+ data: null,
130
+ type: DEVTOOLS_TYPE,
131
+ properties: {
132
+ label: ['halo label', { ns: meta.id }],
133
+ icon: 'ph--identification-badge--regular',
134
+ },
135
+ nodes: [
136
+ {
137
+ id: `${Devtools.Halo.Identity}-${node.id}`,
138
+ data: Devtools.Halo.Identity,
139
+ type: DEVTOOLS_TYPE,
140
+ properties: {
141
+ label: ['identity label', { ns: meta.id }],
142
+ icon: 'ph--identification-badge--regular',
143
+ },
144
+ },
145
+ {
146
+ id: `${Devtools.Halo.Devices}-${node.id}`,
147
+ data: Devtools.Halo.Devices,
148
+ type: DEVTOOLS_TYPE,
149
+ properties: {
150
+ label: ['devices label', { ns: meta.id }],
151
+ icon: 'ph--devices--regular',
152
+ },
153
+ },
154
+ {
155
+ id: `${Devtools.Halo.Keyring}-${node.id}`,
156
+ data: Devtools.Halo.Keyring,
157
+ type: DEVTOOLS_TYPE,
158
+ properties: {
159
+ label: ['keyring label', { ns: meta.id }],
160
+ icon: 'ph--key--regular',
161
+ },
162
+ },
163
+ {
164
+ id: `${Devtools.Halo.Credentials}-${node.id}`,
165
+ data: Devtools.Halo.Credentials,
166
+ type: DEVTOOLS_TYPE,
167
+ properties: {
168
+ label: ['credentials label', { ns: meta.id }],
169
+ icon: 'ph--credit-card--regular',
170
+ },
171
+ },
172
+ ],
173
+ },
174
+ {
175
+ id: `${Devtools.Echo.id}-${node.id}`,
176
+ data: null,
177
+ type: DEVTOOLS_TYPE,
178
+ properties: {
179
+ label: ['echo label', { ns: meta.id }],
180
+ icon: 'ph--database--regular',
181
+ },
182
+ nodes: [
183
+ {
184
+ id: `${Devtools.Echo.Spaces}-${node.id}`,
185
+ data: Devtools.Echo.Spaces,
186
+ type: DEVTOOLS_TYPE,
187
+ properties: {
188
+ label: ['spaces label', { ns: meta.id }],
189
+ icon: 'ph--graph--regular',
190
+ },
191
+ },
192
+ {
193
+ id: `${Devtools.Echo.Space}-${node.id}`,
194
+ data: Devtools.Echo.Space,
195
+ type: DEVTOOLS_TYPE,
196
+ properties: {
197
+ label: ['space label', { ns: meta.id }],
198
+ icon: 'ph--planet--regular',
199
+ },
200
+ },
201
+ {
202
+ id: `${Devtools.Echo.Feeds}-${node.id}`,
203
+ data: Devtools.Echo.Feeds,
204
+ type: DEVTOOLS_TYPE,
205
+ properties: {
206
+ label: ['feeds label', { ns: meta.id }],
207
+ icon: 'ph--list-bullets--regular',
208
+ },
209
+ },
210
+ {
211
+ id: `${Devtools.Echo.Objects}-${node.id}`,
212
+ data: Devtools.Echo.Objects,
213
+ type: DEVTOOLS_TYPE,
214
+ properties: {
215
+ label: ['objects label', { ns: meta.id }],
216
+ icon: 'ph--cube--regular',
217
+ },
218
+ },
219
+ {
220
+ id: `${Devtools.Echo.Schema}-${node.id}`,
221
+ data: Devtools.Echo.Schema,
222
+ type: DEVTOOLS_TYPE,
223
+ properties: {
224
+ label: ['schema label', { ns: meta.id }],
225
+ icon: 'ph--database--regular',
226
+ },
227
+ },
228
+ {
229
+ id: `${Devtools.Echo.Automerge}-${node.id}`,
230
+ data: Devtools.Echo.Automerge,
231
+ type: DEVTOOLS_TYPE,
232
+ properties: {
233
+ label: ['automerge label', { ns: meta.id }],
234
+ icon: 'ph--gear-six--regular',
235
+ },
236
+ },
237
+ {
238
+ id: `${Devtools.Echo.Queues}-${node.id}`,
239
+ data: Devtools.Echo.Queues,
240
+ type: DEVTOOLS_TYPE,
241
+ properties: {
242
+ label: ['queues label', { ns: meta.id }],
243
+ icon: 'ph--queue--regular',
244
+ },
245
+ },
246
+ {
247
+ id: `${Devtools.Echo.Members}-${node.id}`,
248
+ data: Devtools.Echo.Members,
249
+ type: DEVTOOLS_TYPE,
250
+ properties: {
251
+ label: ['members label', { ns: meta.id }],
252
+ icon: 'ph--users--regular',
253
+ },
254
+ },
255
+ {
256
+ id: `${Devtools.Echo.Metadata}-${node.id}`,
257
+ data: Devtools.Echo.Metadata,
258
+ type: DEVTOOLS_TYPE,
259
+ properties: {
260
+ label: ['metadata label', { ns: meta.id }],
261
+ icon: 'ph--hard-drive--regular',
262
+ },
263
+ },
264
+ ],
265
+ },
266
+ {
267
+ id: `${Devtools.Mesh.id}-${node.id}`,
268
+ data: null,
269
+ type: DEVTOOLS_TYPE,
270
+ properties: {
271
+ label: ['mesh label', { ns: meta.id }],
272
+ icon: 'ph--graph--regular',
273
+ },
274
+ nodes: [
275
+ {
276
+ id: `${Devtools.Mesh.Signal}-${node.id}`,
277
+ data: Devtools.Mesh.Signal,
278
+ type: DEVTOOLS_TYPE,
279
+ properties: {
280
+ label: ['signal label', { ns: meta.id }],
281
+ icon: 'ph--wifi-high--regular',
282
+ },
283
+ },
284
+ {
285
+ id: `${Devtools.Mesh.Swarm}-${node.id}`,
286
+ data: Devtools.Mesh.Swarm,
287
+ type: DEVTOOLS_TYPE,
288
+ properties: {
289
+ label: ['swarm label', { ns: meta.id }],
290
+ icon: 'ph--users-three--regular',
291
+ },
292
+ },
293
+ {
294
+ id: `${Devtools.Mesh.Network}-${node.id}`,
295
+ data: Devtools.Mesh.Network,
296
+ type: DEVTOOLS_TYPE,
297
+ properties: {
298
+ label: ['network label', { ns: meta.id }],
299
+ icon: 'ph--polygon--regular',
300
+ },
301
+ },
302
+ ],
303
+ },
304
+ // TODO(wittjosiah): Remove?
305
+ // {
306
+ // id: `${prefix}-${Devtools.Agent.id}`,
307
+ // data: null,
308
+ // type: DEVTOOLS_TYPE,
309
+ // properties: {
310
+ // label: ['agent label', { ns: meta.id }],
311
+ // icon: 'ph--robot--regular',
312
+ // },
313
+ // nodes: [
314
+ // {
315
+ // id: `${prefix}-${Devtools.Agent.Dashboard}`,
316
+ // data: Devtools.Agent.Dashboard,
317
+ // type: DEVTOOLS_TYPE,
318
+ // properties: {
319
+ // label: ['dashboard label', { ns: meta.id }],
320
+ // icon: 'ph--computer-tower--regular',
321
+ // },
322
+ // },
323
+ // ],
324
+ // },
325
+ {
326
+ id: `${Devtools.Edge.id}-${node.id}`,
327
+ data: null,
328
+ type: DEVTOOLS_TYPE,
329
+ properties: {
330
+ label: ['edge label', { ns: meta.id }],
331
+ icon: 'ph--cloud--regular',
332
+ },
333
+ nodes: [
334
+ {
335
+ id: `${Devtools.Edge.Dashboard}-${node.id}`,
336
+ data: Devtools.Edge.Dashboard,
337
+ type: DEVTOOLS_TYPE,
338
+ properties: {
339
+ label: ['dashboard label', { ns: meta.id }],
340
+ icon: 'ph--computer-tower--regular',
341
+ },
342
+ },
343
+ {
344
+ id: `${Devtools.Edge.Workflows}-${node.id}`,
345
+ data: Devtools.Edge.Workflows,
346
+ type: DEVTOOLS_TYPE,
347
+ properties: {
348
+ label: ['workflows label', { ns: meta.id }],
349
+ icon: 'ph--function--regular',
350
+ },
351
+ },
352
+ {
353
+ id: `${Devtools.Edge.Traces}-${node.id}`,
354
+ data: Devtools.Edge.Traces,
355
+ type: DEVTOOLS_TYPE,
356
+ properties: {
357
+ label: ['traces label', { ns: meta.id }],
358
+ icon: 'ph--line-segments--regular',
359
+ },
360
+ },
361
+ {
362
+ id: `${Devtools.Edge.Testing}-${node.id}`,
363
+ data: Devtools.Edge.Testing,
364
+ type: DEVTOOLS_TYPE,
365
+ properties: {
366
+ label: ['testing label', { ns: meta.id }],
367
+ icon: 'ph--flask--regular',
368
+ },
369
+ },
370
+ ],
371
+ },
372
+ ],
373
+ },
374
+ ];
375
+ }),
376
+ }),
377
+
378
+ // Debug object companion.
379
+ GraphBuilder.createExtension({
380
+ id: `${meta.id}/debug-object`,
381
+ match: NodeMatcher.whenEchoObject,
382
+ connector: (object) =>
383
+ Effect.succeed([
384
+ {
385
+ id: [Obj.getDXN(object).toString(), 'debug'].join(ATTENDABLE_PATH_SEPARATOR),
386
+ type: PLANK_COMPANION_TYPE,
387
+ data: 'debug',
388
+ properties: {
389
+ label: ['debug label', { ns: meta.id }],
390
+ icon: 'ph--bug--regular',
391
+ disposition: 'hidden',
392
+ position: 'fallback',
393
+ },
394
+ },
395
+ ]),
396
+ }),
397
+
398
+ // Devtools deck companion.
399
+ GraphBuilder.createExtension({
400
+ id: `${meta.id}/devtools-overview`,
401
+ match: NodeMatcher.whenRoot,
402
+ connector: (node) =>
403
+ Effect.succeed([
404
+ {
405
+ id: [node.id, 'devtools'].join(ATTENDABLE_PATH_SEPARATOR),
406
+ type: DECK_COMPANION_TYPE,
407
+ data: null,
408
+ properties: {
409
+ label: ['devtools overview label', { ns: meta.id }],
410
+ icon: 'ph--equalizer--regular',
411
+ disposition: 'hidden',
412
+ position: 'fallback',
413
+ },
414
+ },
415
+ ]),
416
+ }),
417
+ ]);
418
+
419
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
420
+ }),
421
+ );