@dxos/plugin-debug 0.8.4-main.ae835ea → 0.8.4-main.bcb3aa67d6

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 (149) hide show
  1. package/dist/lib/browser/index.mjs +101 -100
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/types/src/DebugPlugin.d.ts +7 -1
  5. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  6. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  7. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  8. package/dist/types/src/capabilities/index.d.ts +12 -5
  9. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  10. package/dist/types/src/capabilities/react-context.d.ts +4 -2
  11. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  12. package/dist/types/src/capabilities/react-surface.d.ts +7 -2
  13. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/settings.d.ts +8 -2
  15. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  16. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
  17. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
  18. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +79 -0
  19. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
  20. package/dist/types/src/components/DebugSettings/index.d.ts +3 -0
  21. package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
  22. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
  23. package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
  24. package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
  25. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +5 -5
  26. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  27. package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
  28. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
  29. package/dist/types/src/components/SpaceGenerator/presets.d.ts +2 -5
  30. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  31. package/dist/types/src/components/index.d.ts +4 -10
  32. package/dist/types/src/components/index.d.ts.map +1 -1
  33. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
  34. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
  35. package/dist/types/src/containers/DebugGraph/index.d.ts +3 -0
  36. package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
  37. package/dist/types/src/{components → containers/DebugObjectPanel}/DebugObjectPanel.d.ts +2 -2
  38. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
  39. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +3 -0
  40. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
  41. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -0
  42. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
  43. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +3 -0
  44. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
  45. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
  46. package/dist/types/src/containers/DebugStatus/index.d.ts +3 -0
  47. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
  48. package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
  49. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
  50. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +3 -0
  51. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
  52. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +15 -0
  53. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
  54. package/dist/types/src/containers/SpaceGenerator/index.d.ts +3 -0
  55. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
  56. package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +2 -2
  57. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
  58. package/dist/types/src/containers/Wireframe/index.d.ts +3 -0
  59. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
  60. package/dist/types/src/containers/index.d.ts +9 -0
  61. package/dist/types/src/containers/index.d.ts.map +1 -0
  62. package/dist/types/src/meta.d.ts +2 -2
  63. package/dist/types/src/meta.d.ts.map +1 -1
  64. package/dist/types/src/translations.d.ts +60 -58
  65. package/dist/types/src/translations.d.ts.map +1 -1
  66. package/dist/types/src/types/Settings.d.ts +6 -0
  67. package/dist/types/src/types/Settings.d.ts.map +1 -0
  68. package/dist/types/src/types/index.d.ts +67 -0
  69. package/dist/types/src/types/index.d.ts.map +1 -0
  70. package/dist/types/tsconfig.tsbuildinfo +1 -1
  71. package/package.json +83 -70
  72. package/src/DebugPlugin.tsx +31 -33
  73. package/src/capabilities/app-graph-builder.ts +363 -388
  74. package/src/capabilities/index.ts +5 -5
  75. package/src/capabilities/react-context.tsx +16 -7
  76. package/src/capabilities/react-surface.tsx +360 -337
  77. package/src/capabilities/settings.ts +24 -12
  78. package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
  79. package/src/components/DebugSettings/DebugSettings.tsx +228 -0
  80. package/src/components/DebugSettings/index.ts +7 -0
  81. package/src/components/SchemaTable/index.ts +5 -0
  82. package/src/components/SpaceGenerator/ObjectGenerator.tsx +21 -23
  83. package/src/components/SpaceGenerator/index.ts +2 -3
  84. package/src/components/SpaceGenerator/presets.ts +243 -121
  85. package/src/components/index.ts +4 -8
  86. package/src/containers/DebugGraph/DebugGraph.tsx +13 -0
  87. package/src/containers/DebugGraph/index.ts +7 -0
  88. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +47 -0
  89. package/src/containers/DebugObjectPanel/index.ts +7 -0
  90. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +55 -0
  91. package/src/containers/DebugSpaceObjectsPanel/index.ts +7 -0
  92. package/src/{components → containers/DebugStatus}/DebugStatus.tsx +41 -17
  93. package/src/containers/DebugStatus/index.ts +7 -0
  94. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
  95. package/src/containers/DevtoolsOverviewContainer/index.ts +7 -0
  96. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +130 -0
  97. package/src/containers/SpaceGenerator/index.ts +7 -0
  98. package/src/{components → containers/Wireframe}/Wireframe.tsx +6 -7
  99. package/src/containers/Wireframe/index.ts +7 -0
  100. package/src/containers/index.ts +13 -0
  101. package/src/meta.ts +3 -3
  102. package/src/translations.ts +66 -58
  103. package/src/types/Settings.ts +15 -0
  104. package/src/{types.ts → types/index.ts} +12 -10
  105. package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs +0 -20
  106. package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs.map +0 -7
  107. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs +0 -25
  108. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs.map +0 -7
  109. package/dist/lib/browser/SpaceGenerator-7Q7CX64P.mjs +0 -1159
  110. package/dist/lib/browser/SpaceGenerator-7Q7CX64P.mjs.map +0 -7
  111. package/dist/lib/browser/app-graph-builder-RXWTHLEW.mjs +0 -588
  112. package/dist/lib/browser/app-graph-builder-RXWTHLEW.mjs.map +0 -7
  113. package/dist/lib/browser/chunk-SRV2AIGJ.mjs +0 -68
  114. package/dist/lib/browser/chunk-SRV2AIGJ.mjs.map +0 -7
  115. package/dist/lib/browser/chunk-WZFZ4ESO.mjs +0 -20
  116. package/dist/lib/browser/chunk-WZFZ4ESO.mjs.map +0 -7
  117. package/dist/lib/browser/react-context-P2YDWEWI.mjs +0 -16
  118. package/dist/lib/browser/react-context-P2YDWEWI.mjs.map +0 -7
  119. package/dist/lib/browser/react-surface-4XGZUT3Z.mjs +0 -772
  120. package/dist/lib/browser/react-surface-4XGZUT3Z.mjs.map +0 -7
  121. package/dist/lib/browser/settings-SQXR3OAH.mjs +0 -22
  122. package/dist/lib/browser/settings-SQXR3OAH.mjs.map +0 -7
  123. package/dist/types/src/components/Container.d.ts +0 -5
  124. package/dist/types/src/components/Container.d.ts.map +0 -1
  125. package/dist/types/src/components/DebugGraph.d.ts +0 -8
  126. package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
  127. package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
  128. package/dist/types/src/components/DebugSettings.d.ts +0 -6
  129. package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
  130. package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
  131. package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
  132. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
  133. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +0 -9
  134. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
  135. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -15
  136. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
  137. package/dist/types/src/components/Wireframe.d.ts.map +0 -1
  138. package/dist/types/src/types.d.ts +0 -63
  139. package/dist/types/src/types.d.ts.map +0 -1
  140. package/src/components/Container.tsx +0 -15
  141. package/src/components/DebugGraph.tsx +0 -14
  142. package/src/components/DebugObjectPanel.tsx +0 -33
  143. package/src/components/DebugSettings.tsx +0 -159
  144. package/src/components/DevtoolsOverviewContainer.tsx +0 -20
  145. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
  146. package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -122
  147. /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
  148. /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
  149. /package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +0 -0
@@ -2,430 +2,405 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import * as Function from 'effect/Function';
7
- import * as Option from 'effect/Option';
5
+ import * as Effect from 'effect/Effect';
8
6
 
9
- import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
10
- import { Obj } from '@dxos/echo';
11
- import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
12
- import { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';
13
- import { getActiveSpace, meta as spaceMeta } from '@dxos/plugin-space';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, AppNode, getSpaceIdFromPath } from '@dxos/app-toolkit';
9
+ import { ClientCapabilities } from '@dxos/plugin-client/types';
10
+ import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
11
+ import { meta as spaceMeta } from '@dxos/plugin-space/meta';
14
12
 
15
- import { meta } from '../meta';
16
- import { Devtools } from '../types';
13
+ import { meta } from '#meta';
14
+ import { Devtools } from '#types';
15
+ import { getParentId } from '@dxos/react-ui-attention';
17
16
 
18
- const DEVTOOLS_TYPE = `${meta.id}/devtools`;
17
+ const DEVTOOLS_TYPE = `${meta.id}.devtools`;
19
18
 
20
- export default (context: PluginContext) =>
21
- contributes(Capabilities.AppGraphBuilder, [
22
- // Devtools node.
23
- createExtension({
24
- id: `${meta.id}/devtools`,
25
- connector: (node) =>
26
- Rx.make((get) =>
27
- Function.pipe(
28
- get(node),
29
- Option.flatMap((node) =>
30
- node.id === ROOT_ID || node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none(),
31
- ),
32
- Option.map((node) => {
33
- const space = get(rxFromSignal(() => getActiveSpace(context)));
34
- const [graph] = get(context.capabilities(Capabilities.AppGraph));
19
+ export default Capability.makeModule(
20
+ Effect.fnUntraced(function* () {
21
+ const extensions = yield* Effect.all([
22
+ // Devtools node.
23
+ GraphBuilder.createExtension({
24
+ id: `${meta.id}.devtools`,
25
+ match: NodeMatcher.whenAny(NodeMatcher.whenRoot, NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`)),
26
+ connector: (node, get) =>
27
+ Effect.gen(function* () {
28
+ const client = yield* Capability.get(ClientCapabilities.Client);
29
+ const layoutAtom = get(yield* Capability.atom(AppCapabilities.Layout))[0];
30
+ const layout = layoutAtom ? get(layoutAtom) : undefined;
31
+ const spaceId = layout?.workspace ? getSpaceIdFromPath(layout.workspace) : undefined;
32
+ const space = spaceId ? client.spaces.get(spaceId) : undefined;
33
+ const [graph] = get(yield* Capability.atom(AppCapabilities.AppGraph));
35
34
 
36
- return [
37
- {
38
- id: `${Devtools.id}-${node.id}`,
39
- data: null,
40
- type: DEVTOOLS_TYPE,
41
- properties: {
42
- label: ['devtools label', { ns: meta.id }],
43
- icon: 'ph--hammer--regular',
44
- disposition: 'pin-end',
45
- position: 'fallback',
46
- },
47
- nodes: [
48
- ...(space && node.type === `${spaceMeta.id}/settings`
49
- ? [
50
- {
51
- id: `debug-${node.id}`,
52
- type: `${meta.id}/space`,
53
- data: { space, type: `${meta.id}/space` },
54
- properties: {
55
- label: ['debug label', { ns: meta.id }],
56
- icon: 'ph--bug--regular',
57
- },
58
- },
59
- ]
60
- : []),
61
- {
62
- id: `app-graph-${node.id}`,
63
- type: `${meta.id}/app-graph`,
64
- data: { graph: graph?.graph, root: space ? space.id : ROOT_ID },
65
- properties: {
66
- label: ['debug app graph label', { ns: meta.id }],
67
- icon: 'ph--graph--regular',
68
- },
69
- },
70
- {
71
- id: `${Devtools.Client.id}-${node.id}`,
72
- data: null,
73
- type: DEVTOOLS_TYPE,
74
- properties: {
75
- label: ['client label', { ns: meta.id }],
76
- icon: 'ph--users--regular',
77
- },
78
- nodes: [
79
- {
80
- id: `${Devtools.Client.Config}-${node.id}`,
81
- data: Devtools.Client.Config,
82
- type: DEVTOOLS_TYPE,
35
+ return [
36
+ Node.make({
37
+ id: Devtools.id,
38
+ data: null,
39
+ type: DEVTOOLS_TYPE,
40
+ properties: {
41
+ label: ['devtools.label', { ns: meta.id }],
42
+ icon: 'ph--hammer--regular',
43
+ disposition: 'pin-end',
44
+ position: 'fallback',
45
+ },
46
+ nodes: [
47
+ ...(space && node.type === `${spaceMeta.id}.settings`
48
+ ? [
49
+ Node.make({
50
+ id: 'debug',
51
+ type: `${meta.id}.space`,
52
+ data: { space, type: `${meta.id}.space` },
83
53
  properties: {
84
- label: ['config label', { ns: meta.id }],
85
- icon: 'ph--gear--regular',
54
+ label: ['debug.label', { ns: meta.id }],
55
+ icon: 'ph--bug--regular',
86
56
  },
57
+ }),
58
+ ]
59
+ : []),
60
+ Node.make({
61
+ id: 'app-graph',
62
+ type: `${meta.id}.app-graph`,
63
+ data: { graph: graph?.graph, root: node.id === Node.RootId ? node.id : getParentId(node.id) },
64
+ properties: {
65
+ label: ['debug-app-graph.label', { ns: meta.id }],
66
+ icon: 'ph--graph--regular',
67
+ },
68
+ }),
69
+ Node.make({
70
+ id: Devtools.Client.id,
71
+ data: null,
72
+ type: DEVTOOLS_TYPE,
73
+ properties: {
74
+ label: ['client.label', { ns: meta.id }],
75
+ icon: 'ph--users--regular',
76
+ },
77
+ nodes: [
78
+ Node.make({
79
+ id: Devtools.Client.Config,
80
+ data: Devtools.Client.Config,
81
+ type: DEVTOOLS_TYPE,
82
+ properties: {
83
+ label: ['config.label', { ns: meta.id }],
84
+ icon: 'ph--gear--regular',
87
85
  },
88
- {
89
- id: `${Devtools.Client.Storage}-${node.id}`,
90
- data: Devtools.Client.Storage,
91
- type: DEVTOOLS_TYPE,
92
- properties: {
93
- label: ['storage label', { ns: meta.id }],
94
- icon: 'ph--hard-drives--regular',
95
- },
86
+ }),
87
+ Node.make({
88
+ id: Devtools.Client.Storage,
89
+ data: Devtools.Client.Storage,
90
+ type: DEVTOOLS_TYPE,
91
+ properties: {
92
+ label: ['storage.label', { ns: meta.id }],
93
+ icon: 'ph--hard-drives--regular',
96
94
  },
97
- {
98
- id: `${Devtools.Client.Logs}-${node.id}`,
99
- data: Devtools.Client.Logs,
100
- type: DEVTOOLS_TYPE,
101
- properties: {
102
- label: ['logs label', { ns: meta.id }],
103
- icon: 'ph--file-text--regular',
104
- },
95
+ }),
96
+ Node.make({
97
+ id: Devtools.Client.Logs,
98
+ data: Devtools.Client.Logs,
99
+ type: DEVTOOLS_TYPE,
100
+ properties: {
101
+ label: ['logs.label', { ns: meta.id }],
102
+ icon: 'ph--file-text--regular',
105
103
  },
106
- {
107
- id: `${Devtools.Client.Diagnostics}-${node.id}`,
108
- data: Devtools.Client.Diagnostics,
109
- type: DEVTOOLS_TYPE,
110
- properties: {
111
- label: ['diagnostics label', { ns: meta.id }],
112
- icon: 'ph--chart-line--regular',
113
- },
104
+ }),
105
+ Node.make({
106
+ id: Devtools.Client.Diagnostics,
107
+ data: Devtools.Client.Diagnostics,
108
+ type: DEVTOOLS_TYPE,
109
+ properties: {
110
+ label: ['diagnostics.label', { ns: meta.id }],
111
+ icon: 'ph--chart-line--regular',
114
112
  },
115
- {
116
- id: `${Devtools.Client.Tracing}-${node.id}`,
117
- data: Devtools.Client.Tracing,
118
- type: DEVTOOLS_TYPE,
119
- properties: {
120
- label: ['tracing label', { ns: meta.id }],
121
- icon: 'ph--fire--regular',
122
- },
113
+ }),
114
+ Node.make({
115
+ id: Devtools.Client.Tracing,
116
+ data: Devtools.Client.Tracing,
117
+ type: DEVTOOLS_TYPE,
118
+ properties: {
119
+ label: ['tracing.label', { ns: meta.id }],
120
+ icon: 'ph--fire--regular',
123
121
  },
124
- ],
122
+ }),
123
+ ],
124
+ }),
125
+ Node.make({
126
+ id: Devtools.Halo.id,
127
+ data: null,
128
+ type: DEVTOOLS_TYPE,
129
+ properties: {
130
+ label: ['halo.label', { ns: meta.id }],
131
+ icon: 'ph--identification-badge--regular',
125
132
  },
126
- {
127
- id: `${Devtools.Halo.id}-${node.id}`,
128
- data: null,
129
- type: DEVTOOLS_TYPE,
130
- properties: {
131
- label: ['halo label', { ns: meta.id }],
132
- icon: 'ph--identification-badge--regular',
133
- },
134
- nodes: [
135
- {
136
- id: `${Devtools.Halo.Identity}-${node.id}`,
137
- data: Devtools.Halo.Identity,
138
- type: DEVTOOLS_TYPE,
139
- properties: {
140
- label: ['identity label', { ns: meta.id }],
141
- icon: 'ph--identification-badge--regular',
142
- },
133
+ nodes: [
134
+ Node.make({
135
+ id: Devtools.Halo.Identity,
136
+ data: Devtools.Halo.Identity,
137
+ type: DEVTOOLS_TYPE,
138
+ properties: {
139
+ label: ['identity.label', { ns: meta.id }],
140
+ icon: 'ph--identification-badge--regular',
143
141
  },
144
- {
145
- id: `${Devtools.Halo.Devices}-${node.id}`,
146
- data: Devtools.Halo.Devices,
147
- type: DEVTOOLS_TYPE,
148
- properties: {
149
- label: ['devices label', { ns: meta.id }],
150
- icon: 'ph--devices--regular',
151
- },
142
+ }),
143
+ Node.make({
144
+ id: Devtools.Halo.Devices,
145
+ data: Devtools.Halo.Devices,
146
+ type: DEVTOOLS_TYPE,
147
+ properties: {
148
+ label: ['devices.label', { ns: meta.id }],
149
+ icon: 'ph--devices--regular',
152
150
  },
153
- {
154
- id: `${Devtools.Halo.Keyring}-${node.id}`,
155
- data: Devtools.Halo.Keyring,
156
- type: DEVTOOLS_TYPE,
157
- properties: {
158
- label: ['keyring label', { ns: meta.id }],
159
- icon: 'ph--key--regular',
160
- },
151
+ }),
152
+ Node.make({
153
+ id: Devtools.Halo.Keyring,
154
+ data: Devtools.Halo.Keyring,
155
+ type: DEVTOOLS_TYPE,
156
+ properties: {
157
+ label: ['keyring.label', { ns: meta.id }],
158
+ icon: 'ph--key--regular',
161
159
  },
162
- {
163
- id: `${Devtools.Halo.Credentials}-${node.id}`,
164
- data: Devtools.Halo.Credentials,
165
- type: DEVTOOLS_TYPE,
166
- properties: {
167
- label: ['credentials label', { ns: meta.id }],
168
- icon: 'ph--credit-card--regular',
169
- },
160
+ }),
161
+ Node.make({
162
+ id: Devtools.Halo.Credentials,
163
+ data: Devtools.Halo.Credentials,
164
+ type: DEVTOOLS_TYPE,
165
+ properties: {
166
+ label: ['credentials.label', { ns: meta.id }],
167
+ icon: 'ph--credit-card--regular',
170
168
  },
171
- ],
169
+ }),
170
+ ],
171
+ }),
172
+ Node.make({
173
+ id: Devtools.Echo.id,
174
+ data: null,
175
+ type: DEVTOOLS_TYPE,
176
+ properties: {
177
+ label: ['echo.label', { ns: meta.id }],
178
+ icon: 'ph--database--regular',
172
179
  },
173
- {
174
- id: `${Devtools.Echo.id}-${node.id}`,
175
- data: null,
176
- type: DEVTOOLS_TYPE,
177
- properties: {
178
- label: ['echo label', { ns: meta.id }],
179
- icon: 'ph--database--regular',
180
- },
181
- nodes: [
182
- {
183
- id: `${Devtools.Echo.Spaces}-${node.id}`,
184
- data: Devtools.Echo.Spaces,
185
- type: DEVTOOLS_TYPE,
186
- properties: {
187
- label: ['spaces label', { ns: meta.id }],
188
- icon: 'ph--graph--regular',
189
- },
180
+ nodes: [
181
+ Node.make({
182
+ id: Devtools.Echo.Spaces,
183
+ data: Devtools.Echo.Spaces,
184
+ type: DEVTOOLS_TYPE,
185
+ properties: {
186
+ label: ['spaces.label', { ns: meta.id }],
187
+ icon: 'ph--graph--regular',
190
188
  },
191
- {
192
- id: `${Devtools.Echo.Space}-${node.id}`,
193
- data: Devtools.Echo.Space,
194
- type: DEVTOOLS_TYPE,
195
- properties: {
196
- label: ['space label', { ns: meta.id }],
197
- icon: 'ph--planet--regular',
198
- },
189
+ }),
190
+ Node.make({
191
+ id: Devtools.Echo.Space,
192
+ data: Devtools.Echo.Space,
193
+ type: DEVTOOLS_TYPE,
194
+ properties: {
195
+ label: ['space.label', { ns: meta.id }],
196
+ icon: 'ph--planet--regular',
199
197
  },
200
- {
201
- id: `${Devtools.Echo.Feeds}-${node.id}`,
202
- data: Devtools.Echo.Feeds,
203
- type: DEVTOOLS_TYPE,
204
- properties: {
205
- label: ['feeds label', { ns: meta.id }],
206
- icon: 'ph--list-bullets--regular',
207
- },
198
+ }),
199
+ Node.make({
200
+ id: Devtools.Echo.Feeds,
201
+ data: Devtools.Echo.Feeds,
202
+ type: DEVTOOLS_TYPE,
203
+ properties: {
204
+ label: ['feeds.label', { ns: meta.id }],
205
+ icon: 'ph--list-bullets--regular',
208
206
  },
209
- {
210
- id: `${Devtools.Echo.Objects}-${node.id}`,
211
- data: Devtools.Echo.Objects,
212
- type: DEVTOOLS_TYPE,
213
- properties: {
214
- label: ['objects label', { ns: meta.id }],
215
- icon: 'ph--cube--regular',
216
- },
207
+ }),
208
+ Node.make({
209
+ id: Devtools.Echo.Objects,
210
+ data: Devtools.Echo.Objects,
211
+ type: DEVTOOLS_TYPE,
212
+ properties: {
213
+ label: ['objects.label', { ns: meta.id }],
214
+ icon: 'ph--cube--regular',
217
215
  },
218
- {
219
- id: `${Devtools.Echo.Schema}-${node.id}`,
220
- data: Devtools.Echo.Schema,
221
- type: DEVTOOLS_TYPE,
222
- properties: {
223
- label: ['schema label', { ns: meta.id }],
224
- icon: 'ph--database--regular',
225
- },
216
+ }),
217
+ Node.make({
218
+ id: Devtools.Echo.Schema,
219
+ data: Devtools.Echo.Schema,
220
+ type: DEVTOOLS_TYPE,
221
+ properties: {
222
+ label: ['schema.label', { ns: meta.id }],
223
+ icon: 'ph--database--regular',
226
224
  },
227
- {
228
- id: `${Devtools.Echo.Automerge}-${node.id}`,
229
- data: Devtools.Echo.Automerge,
230
- type: DEVTOOLS_TYPE,
231
- properties: {
232
- label: ['automerge label', { ns: meta.id }],
233
- icon: 'ph--gear-six--regular',
234
- },
225
+ }),
226
+ Node.make({
227
+ id: Devtools.Echo.Automerge,
228
+ data: Devtools.Echo.Automerge,
229
+ type: DEVTOOLS_TYPE,
230
+ properties: {
231
+ label: ['automerge.label', { ns: meta.id }],
232
+ icon: 'ph--gear-six--regular',
235
233
  },
236
- {
237
- id: `${Devtools.Echo.Queues}-${node.id}`,
238
- data: Devtools.Echo.Queues,
239
- type: DEVTOOLS_TYPE,
240
- properties: {
241
- label: ['queues label', { ns: meta.id }],
242
- icon: 'ph--queue--regular',
243
- },
234
+ }),
235
+ Node.make({
236
+ id: Devtools.Echo.Queues,
237
+ data: Devtools.Echo.Queues,
238
+ type: DEVTOOLS_TYPE,
239
+ properties: {
240
+ label: ['queues.label', { ns: meta.id }],
241
+ icon: 'ph--queue--regular',
244
242
  },
245
- {
246
- id: `${Devtools.Echo.Members}-${node.id}`,
247
- data: Devtools.Echo.Members,
248
- type: DEVTOOLS_TYPE,
249
- properties: {
250
- label: ['members label', { ns: meta.id }],
251
- icon: 'ph--users--regular',
252
- },
243
+ }),
244
+ Node.make({
245
+ id: Devtools.Echo.Members,
246
+ data: Devtools.Echo.Members,
247
+ type: DEVTOOLS_TYPE,
248
+ properties: {
249
+ label: ['members.label', { ns: meta.id }],
250
+ icon: 'ph--users--regular',
253
251
  },
254
- {
255
- id: `${Devtools.Echo.Metadata}-${node.id}`,
256
- data: Devtools.Echo.Metadata,
257
- type: DEVTOOLS_TYPE,
258
- properties: {
259
- label: ['metadata label', { ns: meta.id }],
260
- icon: 'ph--hard-drive--regular',
261
- },
252
+ }),
253
+ Node.make({
254
+ id: Devtools.Echo.Metadata,
255
+ data: Devtools.Echo.Metadata,
256
+ type: DEVTOOLS_TYPE,
257
+ properties: {
258
+ label: ['metadata.label', { ns: meta.id }],
259
+ icon: 'ph--hard-drive--regular',
262
260
  },
263
- ],
261
+ }),
262
+ ],
263
+ }),
264
+ Node.make({
265
+ id: Devtools.Mesh.id,
266
+ data: null,
267
+ type: DEVTOOLS_TYPE,
268
+ properties: {
269
+ label: ['mesh.label', { ns: meta.id }],
270
+ icon: 'ph--graph--regular',
264
271
  },
265
- {
266
- id: `${Devtools.Mesh.id}-${node.id}`,
267
- data: null,
268
- type: DEVTOOLS_TYPE,
269
- properties: {
270
- label: ['mesh label', { ns: meta.id }],
271
- icon: 'ph--graph--regular',
272
- },
273
- nodes: [
274
- {
275
- id: `${Devtools.Mesh.Signal}-${node.id}`,
276
- data: Devtools.Mesh.Signal,
277
- type: DEVTOOLS_TYPE,
278
- properties: {
279
- label: ['signal label', { ns: meta.id }],
280
- icon: 'ph--wifi-high--regular',
281
- },
272
+ nodes: [
273
+ Node.make({
274
+ id: Devtools.Mesh.Signal,
275
+ data: Devtools.Mesh.Signal,
276
+ type: DEVTOOLS_TYPE,
277
+ properties: {
278
+ label: ['signal.label', { ns: meta.id }],
279
+ icon: 'ph--wifi-high--regular',
282
280
  },
283
- {
284
- id: `${Devtools.Mesh.Swarm}-${node.id}`,
285
- data: Devtools.Mesh.Swarm,
286
- type: DEVTOOLS_TYPE,
287
- properties: {
288
- label: ['swarm label', { ns: meta.id }],
289
- icon: 'ph--users-three--regular',
290
- },
281
+ }),
282
+ Node.make({
283
+ id: Devtools.Mesh.Swarm,
284
+ data: Devtools.Mesh.Swarm,
285
+ type: DEVTOOLS_TYPE,
286
+ properties: {
287
+ label: ['swarm.label', { ns: meta.id }],
288
+ icon: 'ph--users-three--regular',
291
289
  },
292
- {
293
- id: `${Devtools.Mesh.Network}-${node.id}`,
294
- data: Devtools.Mesh.Network,
295
- type: DEVTOOLS_TYPE,
296
- properties: {
297
- label: ['network label', { ns: meta.id }],
298
- icon: 'ph--polygon--regular',
299
- },
290
+ }),
291
+ Node.make({
292
+ id: Devtools.Mesh.Network,
293
+ data: Devtools.Mesh.Network,
294
+ type: DEVTOOLS_TYPE,
295
+ properties: {
296
+ label: ['network.label', { ns: meta.id }],
297
+ icon: 'ph--polygon--regular',
300
298
  },
301
- ],
299
+ }),
300
+ ],
301
+ }),
302
+ Node.make({
303
+ id: Devtools.Edge.id,
304
+ data: null,
305
+ type: DEVTOOLS_TYPE,
306
+ properties: {
307
+ label: ['edge.label', { ns: meta.id }],
308
+ icon: 'ph--cloud--regular',
302
309
  },
303
- // TODO(wittjosiah): Remove?
304
- // {
305
- // id: `${prefix}-${Devtools.Agent.id}`,
306
- // data: null,
307
- // type: DEVTOOLS_TYPE,
308
- // properties: {
309
- // label: ['agent label', { ns: meta.id }],
310
- // icon: 'ph--robot--regular',
311
- // },
312
- // nodes: [
313
- // {
314
- // id: `${prefix}-${Devtools.Agent.Dashboard}`,
315
- // data: Devtools.Agent.Dashboard,
316
- // type: DEVTOOLS_TYPE,
317
- // properties: {
318
- // label: ['dashboard label', { ns: meta.id }],
319
- // icon: 'ph--computer-tower--regular',
320
- // },
321
- // },
322
- // ],
323
- // },
324
- {
325
- id: `${Devtools.Edge.id}-${node.id}`,
326
- data: null,
327
- type: DEVTOOLS_TYPE,
328
- properties: {
329
- label: ['edge label', { ns: meta.id }],
330
- icon: 'ph--cloud--regular',
331
- },
332
- nodes: [
333
- {
334
- id: `${Devtools.Edge.Dashboard}-${node.id}`,
335
- data: Devtools.Edge.Dashboard,
336
- type: DEVTOOLS_TYPE,
337
- properties: {
338
- label: ['dashboard label', { ns: meta.id }],
339
- icon: 'ph--computer-tower--regular',
340
- },
310
+ nodes: [
311
+ Node.make({
312
+ id: Devtools.Edge.Dashboard,
313
+ data: Devtools.Edge.Dashboard,
314
+ type: DEVTOOLS_TYPE,
315
+ properties: {
316
+ label: ['dashboard.label', { ns: meta.id }],
317
+ icon: 'ph--computer-tower--regular',
341
318
  },
342
- {
343
- id: `${Devtools.Edge.Workflows}-${node.id}`,
344
- data: Devtools.Edge.Workflows,
345
- type: DEVTOOLS_TYPE,
346
- properties: {
347
- label: ['workflows label', { ns: meta.id }],
348
- icon: 'ph--function--regular',
349
- },
319
+ }),
320
+ Node.make({
321
+ id: Devtools.Edge.Workflows,
322
+ data: Devtools.Edge.Workflows,
323
+ type: DEVTOOLS_TYPE,
324
+ properties: {
325
+ label: ['workflows.label', { ns: meta.id }],
326
+ icon: 'ph--function--regular',
350
327
  },
351
- {
352
- id: `${Devtools.Edge.Traces}-${node.id}`,
353
- data: Devtools.Edge.Traces,
354
- type: DEVTOOLS_TYPE,
355
- properties: {
356
- label: ['traces label', { ns: meta.id }],
357
- icon: 'ph--line-segments--regular',
358
- },
328
+ }),
329
+ Node.make({
330
+ id: Devtools.Edge.Traces,
331
+ data: Devtools.Edge.Traces,
332
+ type: DEVTOOLS_TYPE,
333
+ properties: {
334
+ label: ['traces.label', { ns: meta.id }],
335
+ icon: 'ph--line-segments--regular',
359
336
  },
360
- {
361
- id: `${Devtools.Edge.Testing}-${node.id}`,
362
- data: Devtools.Edge.Testing,
363
- type: DEVTOOLS_TYPE,
364
- properties: {
365
- label: ['testing label', { ns: meta.id }],
366
- icon: 'ph--flask--regular',
367
- },
337
+ }),
338
+ Node.make({
339
+ id: Devtools.Edge.Testing,
340
+ data: Devtools.Edge.Testing,
341
+ type: DEVTOOLS_TYPE,
342
+ properties: {
343
+ label: ['testing.label', { ns: meta.id }],
344
+ icon: 'ph--flask--regular',
368
345
  },
369
- ],
370
- },
371
- ],
372
- },
373
- ];
346
+ }),
347
+ ],
348
+ }),
349
+ ],
350
+ }),
351
+ ];
352
+ }),
353
+ }),
354
+
355
+ // Debug object companion.
356
+ GraphBuilder.createExtension({
357
+ id: `${meta.id}.debug-object`,
358
+ match: NodeMatcher.whenEchoObject,
359
+ connector: () =>
360
+ Effect.succeed([
361
+ AppNode.makeCompanion({
362
+ id: 'debug',
363
+ label: ['debug.label', { ns: meta.id }],
364
+ icon: 'ph--bug--regular',
365
+ data: 'debug',
366
+ position: 'fallback',
374
367
  }),
375
- Option.getOrElse(() => []),
376
- ),
377
- ),
378
- }),
368
+ ]),
369
+ }),
379
370
 
380
- // Debug object companion.
381
- createExtension({
382
- id: `${meta.id}/debug-object`,
383
- connector: (node) =>
384
- Rx.make((get) =>
385
- Function.pipe(
386
- get(node),
387
- Option.flatMap((node) => (Obj.isObject(node.data) ? Option.some(node) : Option.none())),
388
- Option.map((node) => [
389
- {
390
- id: [node.id, 'debug'].join(ATTENDABLE_PATH_SEPARATOR),
391
- type: PLANK_COMPANION_TYPE,
392
- data: 'debug',
393
- properties: {
394
- label: ['debug label', { ns: meta.id }],
395
- icon: 'ph--bug--regular',
396
- disposition: 'hidden',
397
- position: 'fallback',
398
- },
399
- },
400
- ]),
401
- Option.getOrElse(() => []),
402
- ),
403
- ),
404
- }),
371
+ // Devtools deck companion.
372
+ GraphBuilder.createExtension({
373
+ id: `${meta.id}.devtools-overview`,
374
+ match: NodeMatcher.whenRoot,
375
+ connector: () =>
376
+ Effect.succeed([
377
+ AppNode.makeDeckCompanion({
378
+ id: 'devtools',
379
+ label: ['devtools-overview.label', { ns: meta.id }],
380
+ icon: 'ph--equalizer--regular',
381
+ data: 'devtools' as const,
382
+ position: 'fallback',
383
+ }),
384
+ ]),
385
+ }),
405
386
 
406
- // Devtools deck companion.
407
- createExtension({
408
- id: `${meta.id}/devtools-overview`,
409
- connector: (node) =>
410
- Rx.make((get) =>
411
- Function.pipe(
412
- get(node),
413
- Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
414
- Option.map((node) => [
415
- {
416
- id: [node.id, 'devtools'].join(ATTENDABLE_PATH_SEPARATOR),
417
- type: DECK_COMPANION_TYPE,
418
- data: null,
419
- properties: {
420
- label: ['devtools overview label', { ns: meta.id }],
421
- icon: 'ph--equalizer--regular',
422
- disposition: 'hidden',
423
- position: 'fallback',
424
- },
425
- },
426
- ]),
427
- Option.getOrElse(() => []),
428
- ),
429
- ),
430
- }),
431
- ]);
387
+ // Object explorer.
388
+ GraphBuilder.createExtension({
389
+ id: `${meta.id}.space-objects`,
390
+ match: NodeMatcher.whenRoot,
391
+ connector: () =>
392
+ Effect.succeed([
393
+ AppNode.makeDeckCompanion({
394
+ id: 'space-objects',
395
+ label: ['space-objects.label', { ns: meta.id }],
396
+ icon: 'ph--cube--regular',
397
+ data: 'space-objects' as const,
398
+ position: 'fallback',
399
+ }),
400
+ ]),
401
+ }),
402
+ ]);
403
+
404
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
405
+ }),
406
+ );