@dxos/plugin-debug 0.10.0 → 0.11.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.
Files changed (236) hide show
  1. package/PLUGIN.mdl +12 -325
  2. package/README.md +4 -14
  3. package/dist/lib/DebugPlugin.mjs +29 -0
  4. package/dist/lib/DebugPlugin.mjs.map +1 -0
  5. package/dist/lib/DebugPlugin.node.mjs +10 -0
  6. package/dist/lib/DebugPlugin.node.mjs.map +1 -0
  7. package/dist/lib/DebugPlugin.workerd.mjs +8 -0
  8. package/dist/lib/DebugPlugin.workerd.mjs.map +1 -0
  9. package/dist/lib/capabilities.mjs +11 -0
  10. package/dist/lib/capabilities.mjs.map +1 -0
  11. package/dist/lib/chunk-DebugObjectPanel.mjs +58 -0
  12. package/dist/lib/chunk-DebugObjectPanel.mjs.map +1 -0
  13. package/dist/lib/chunk-DebugSettings.mjs +237 -0
  14. package/dist/lib/chunk-DebugSettings.mjs.map +1 -0
  15. package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs +39 -0
  16. package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs.map +1 -0
  17. package/dist/lib/chunk-DebugStatus.mjs +117 -0
  18. package/dist/lib/chunk-DebugStatus.mjs.map +1 -0
  19. package/dist/lib/chunk-LogStatus.mjs +44 -0
  20. package/dist/lib/chunk-LogStatus.mjs.map +1 -0
  21. package/dist/lib/chunk-SpaceGenerator.mjs +208 -0
  22. package/dist/lib/chunk-SpaceGenerator.mjs.map +1 -0
  23. package/dist/lib/chunk-StatsPanel.mjs +58 -0
  24. package/dist/lib/chunk-StatsPanel.mjs.map +1 -0
  25. package/dist/lib/chunk-Wireframe.mjs +60 -0
  26. package/dist/lib/chunk-Wireframe.mjs.map +1 -0
  27. package/dist/lib/chunk-app-graph-builder.mjs +76 -0
  28. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
  29. package/dist/lib/chunk-log-recording.mjs +17 -0
  30. package/dist/lib/chunk-log-recording.mjs.map +1 -0
  31. package/dist/lib/chunk-meta.mjs +36 -0
  32. package/dist/lib/chunk-meta.mjs.map +1 -0
  33. package/dist/lib/chunk-react-surface.mjs +193 -0
  34. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  35. package/dist/lib/chunk-settings.mjs +23 -0
  36. package/dist/lib/chunk-settings.mjs.map +1 -0
  37. package/dist/lib/chunk-stats-panel.mjs +56 -0
  38. package/dist/lib/chunk-stats-panel.mjs.map +1 -0
  39. package/dist/lib/chunk-types.mjs +60 -0
  40. package/dist/lib/chunk-types.mjs.map +1 -0
  41. package/dist/lib/components.mjs +763 -0
  42. package/dist/lib/components.mjs.map +1 -0
  43. package/dist/lib/containers.mjs +14 -0
  44. package/dist/lib/containers.mjs.map +1 -0
  45. package/dist/lib/index.mjs +3 -0
  46. package/dist/lib/meta.mjs +2 -0
  47. package/dist/lib/plugin.mjs +8 -0
  48. package/dist/lib/plugin.mjs.map +1 -0
  49. package/dist/lib/translations.mjs +38 -0
  50. package/dist/lib/translations.mjs.map +1 -0
  51. package/dist/lib/types.mjs +2 -0
  52. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/DebugSurfaces.d.ts +25 -0
  54. package/dist/types/src/capabilities/DebugSurfaces.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  56. package/dist/types/src/capabilities/index.d.ts +4 -1
  57. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/log-recording.d.ts +10 -0
  59. package/dist/types/src/capabilities/log-recording.d.ts.map +1 -0
  60. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  61. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  62. package/dist/types/src/capabilities/settings.d.ts +1 -1
  63. package/dist/types/src/capabilities/stats-panel.d.ts +16 -0
  64. package/dist/types/src/capabilities/stats-panel.d.ts.map +1 -0
  65. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts +4 -3
  66. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -1
  67. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  68. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +4 -1
  69. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
  70. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +4 -1
  71. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -1
  72. package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts +30 -58
  73. package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts.map +1 -1
  74. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +4 -1
  75. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
  76. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts +4 -1
  77. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -1
  78. package/dist/types/src/containers/LogStatus/LogStatus.d.ts +6 -0
  79. package/dist/types/src/containers/LogStatus/LogStatus.d.ts.map +1 -0
  80. package/dist/types/src/containers/LogStatus/index.d.ts +2 -0
  81. package/dist/types/src/containers/LogStatus/index.d.ts.map +1 -0
  82. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +1 -1
  83. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  84. package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts +6 -0
  85. package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts.map +1 -0
  86. package/dist/types/src/containers/StatsPanel/index.d.ts +2 -0
  87. package/dist/types/src/containers/StatsPanel/index.d.ts.map +1 -0
  88. package/dist/types/src/containers/Wireframe/Wireframe.d.ts +4 -1
  89. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
  90. package/dist/types/src/containers/index.d.ts +4 -6
  91. package/dist/types/src/containers/index.d.ts.map +1 -1
  92. package/dist/types/src/translations.d.ts +26 -57
  93. package/dist/types/src/translations.d.ts.map +1 -1
  94. package/dist/types/src/types/DebugNodes.d.ts +7 -0
  95. package/dist/types/src/types/DebugNodes.d.ts.map +1 -0
  96. package/dist/types/src/types/DebugSurface.d.ts +8 -0
  97. package/dist/types/src/types/DebugSurface.d.ts.map +1 -0
  98. package/dist/types/src/types/debug.d.ts +3 -1
  99. package/dist/types/src/types/debug.d.ts.map +1 -1
  100. package/dist/types/src/types/index.d.ts +2 -2
  101. package/dist/types/src/types/index.d.ts.map +1 -1
  102. package/dist/types/tsconfig.tsbuildinfo +1 -1
  103. package/dx.config.ts +8 -13
  104. package/package.json +61 -63
  105. package/src/DebugPlugin.node.ts +1 -1
  106. package/src/DebugPlugin.tsx +10 -27
  107. package/src/DebugPlugin.workerd.ts +1 -1
  108. package/src/capabilities/DebugSurfaces.tsx +146 -0
  109. package/src/capabilities/app-graph-builder.ts +39 -373
  110. package/src/capabilities/index.ts +3 -2
  111. package/src/capabilities/log-recording.ts +20 -0
  112. package/src/capabilities/react-surface.ts +123 -0
  113. package/src/capabilities/stats-panel.ts +74 -0
  114. package/src/components/SchemaTable/SchemaTable.tsx +6 -5
  115. package/src/components/SpaceGenerator/ObjectGenerator.tsx +9 -3
  116. package/src/components/SpaceGenerator/presets.ts +2 -2
  117. package/src/components/index.ts +1 -1
  118. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +20 -20
  119. package/src/containers/DebugSettings/DebugSettings.tsx +4 -3
  120. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +4 -2
  121. package/src/containers/DebugStatus/DebugStatus.tsx +2 -0
  122. package/src/containers/LogStatus/LogStatus.tsx +51 -0
  123. package/src/containers/LogStatus/index.ts +5 -0
  124. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +108 -10
  125. package/src/containers/StatsPanel/StatsPanel.tsx +74 -0
  126. package/src/containers/StatsPanel/index.ts +5 -0
  127. package/src/containers/Wireframe/Wireframe.tsx +2 -0
  128. package/src/containers/index.ts +9 -7
  129. package/src/index.ts +1 -1
  130. package/src/meta.ts +1 -1
  131. package/src/plugin.ts +1 -1
  132. package/src/translations.ts +8 -52
  133. package/src/types/DebugNodes.ts +18 -0
  134. package/src/types/DebugSurface.ts +16 -0
  135. package/src/types/debug.ts +3 -1
  136. package/src/types/index.ts +3 -3
  137. package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs +0 -15
  138. package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +0 -7
  139. package/dist/lib/neutral/DebugObjectPanel-QSGQJ3LM.mjs +0 -61
  140. package/dist/lib/neutral/DebugObjectPanel-QSGQJ3LM.mjs.map +0 -7
  141. package/dist/lib/neutral/DebugPlugin.mjs +0 -59
  142. package/dist/lib/neutral/DebugPlugin.mjs.map +0 -7
  143. package/dist/lib/neutral/DebugPlugin.node.mjs +0 -18
  144. package/dist/lib/neutral/DebugPlugin.node.mjs.map +0 -7
  145. package/dist/lib/neutral/DebugPlugin.workerd.mjs +0 -12
  146. package/dist/lib/neutral/DebugPlugin.workerd.mjs.map +0 -7
  147. package/dist/lib/neutral/DebugSettings-Q3WUL6YQ.mjs +0 -229
  148. package/dist/lib/neutral/DebugSettings-Q3WUL6YQ.mjs.map +0 -7
  149. package/dist/lib/neutral/DebugSpaceObjectsPanel-AXFZWEIM.mjs +0 -36
  150. package/dist/lib/neutral/DebugSpaceObjectsPanel-AXFZWEIM.mjs.map +0 -7
  151. package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs +0 -122
  152. package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs.map +0 -7
  153. package/dist/lib/neutral/DevtoolsOverviewContainer-DWQHTK7D.mjs +0 -24
  154. package/dist/lib/neutral/DevtoolsOverviewContainer-DWQHTK7D.mjs.map +0 -7
  155. package/dist/lib/neutral/GithubPanel-4CSJRVKE.mjs +0 -177
  156. package/dist/lib/neutral/GithubPanel-4CSJRVKE.mjs.map +0 -7
  157. package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs +0 -161
  158. package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs.map +0 -7
  159. package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs +0 -146
  160. package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs.map +0 -7
  161. package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs +0 -52
  162. package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs.map +0 -7
  163. package/dist/lib/neutral/app-graph-builder-UKG4WVYK.mjs +0 -619
  164. package/dist/lib/neutral/app-graph-builder-UKG4WVYK.mjs.map +0 -7
  165. package/dist/lib/neutral/capabilities/index.mjs +0 -15
  166. package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
  167. package/dist/lib/neutral/chunk-72QXLYMI.mjs +0 -118
  168. package/dist/lib/neutral/chunk-72QXLYMI.mjs.map +0 -7
  169. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  170. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  171. package/dist/lib/neutral/chunk-R5C4CKOF.mjs +0 -54
  172. package/dist/lib/neutral/chunk-R5C4CKOF.mjs.map +0 -7
  173. package/dist/lib/neutral/components/index.mjs +0 -961
  174. package/dist/lib/neutral/components/index.mjs.map +0 -7
  175. package/dist/lib/neutral/containers/index.mjs +0 -27
  176. package/dist/lib/neutral/containers/index.mjs.map +0 -7
  177. package/dist/lib/neutral/index.mjs +0 -20
  178. package/dist/lib/neutral/index.mjs.map +0 -7
  179. package/dist/lib/neutral/meta.json +0 -1
  180. package/dist/lib/neutral/meta.mjs +0 -8
  181. package/dist/lib/neutral/meta.mjs.map +0 -7
  182. package/dist/lib/neutral/plugin.mjs +0 -12
  183. package/dist/lib/neutral/plugin.mjs.map +0 -7
  184. package/dist/lib/neutral/react-context-UJURDOO6.mjs +0 -17
  185. package/dist/lib/neutral/react-context-UJURDOO6.mjs.map +0 -7
  186. package/dist/lib/neutral/react-surface-URESE7J4.mjs +0 -484
  187. package/dist/lib/neutral/react-surface-URESE7J4.mjs.map +0 -7
  188. package/dist/lib/neutral/settings-5I2674B6.mjs +0 -28
  189. package/dist/lib/neutral/settings-5I2674B6.mjs.map +0 -7
  190. package/dist/lib/neutral/translations.mjs +0 -91
  191. package/dist/lib/neutral/translations.mjs.map +0 -7
  192. package/dist/lib/neutral/types/index.mjs +0 -16
  193. package/dist/lib/neutral/types/index.mjs.map +0 -7
  194. package/dist/types/src/DebugPlugin.test.d.ts +0 -2
  195. package/dist/types/src/DebugPlugin.test.d.ts.map +0 -1
  196. package/dist/types/src/capabilities/react-context.d.ts +0 -5
  197. package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
  198. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +0 -8
  199. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +0 -1
  200. package/dist/types/src/containers/DebugGraph/index.d.ts +0 -2
  201. package/dist/types/src/containers/DebugGraph/index.d.ts.map +0 -1
  202. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts +0 -3
  203. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +0 -1
  204. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +0 -2
  205. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +0 -1
  206. package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts +0 -15
  207. package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts.map +0 -1
  208. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +0 -106
  209. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +0 -1
  210. package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts +0 -3
  211. package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts.map +0 -1
  212. package/dist/types/src/containers/GithubPanel/index.d.ts +0 -2
  213. package/dist/types/src/containers/GithubPanel/index.d.ts.map +0 -1
  214. package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts +0 -3
  215. package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts.map +0 -1
  216. package/dist/types/src/containers/RegistryPanel/index.d.ts +0 -2
  217. package/dist/types/src/containers/RegistryPanel/index.d.ts.map +0 -1
  218. package/dist/types/src/types/Devtools.d.ts +0 -57
  219. package/dist/types/src/types/Devtools.d.ts.map +0 -1
  220. package/dist/types/src/types/surface.d.ts +0 -4
  221. package/dist/types/src/types/surface.d.ts.map +0 -1
  222. package/src/DebugPlugin.test.ts +0 -29
  223. package/src/capabilities/react-context.tsx +0 -25
  224. package/src/capabilities/react-surface.tsx +0 -504
  225. package/src/containers/DebugGraph/DebugGraph.tsx +0 -14
  226. package/src/containers/DebugGraph/index.ts +0 -5
  227. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +0 -27
  228. package/src/containers/DevtoolsOverviewContainer/index.ts +0 -5
  229. package/src/containers/GithubPanel/GithubComponent.stories.tsx +0 -38
  230. package/src/containers/GithubPanel/GithubComponent.tsx +0 -192
  231. package/src/containers/GithubPanel/GithubPanel.tsx +0 -17
  232. package/src/containers/GithubPanel/index.ts +0 -5
  233. package/src/containers/RegistryPanel/RegistryPanel.tsx +0 -150
  234. package/src/containers/RegistryPanel/index.ts +0 -5
  235. package/src/types/Devtools.ts +0 -73
  236. package/src/types/surface.ts +0 -10
package/PLUGIN.mdl CHANGED
@@ -4,20 +4,17 @@ name: DebugPlugin
4
4
  version: 0.1.0
5
5
  ---
6
6
 
7
- Developer toolkit plugin for `DXOS` Composer — real-time object inspection, structured devtools panels for Client/HALO/ECHO/Mesh/EDGE subsystems, space data generation, wireframe overlays, a tools explorer, and downloadable log capture.
7
+ Developer debugging utilities for `DXOS` Composer — synthetic-object generation, a per-object Debug companion, a space-objects browser, a wireframe overlay, and a transient-stats panel. Rendered under a Debug node in the SYSTEM navigation group, a sibling of the Devtools inspector (`org.dxos.plugin.devtools`).
8
8
 
9
9
  ## Extensions
10
10
 
11
11
  The following extension dialects are used in this document.
12
- Each extension is defined in the Appendix or resolved via its URI.
13
12
 
14
13
  | Term | URI |
15
14
  |-------------|--------------------------------|
16
15
  | `type` | `org.dxos.mdl.type@1.0` |
17
16
  | `feat` | `org.dxos.mdl.feat@1.0` |
18
- | `test` | `org.dxos.mdl.test@1.0` |
19
17
  | `component` | `org.dxos.mdl.component@1.0` |
20
- | `op` | `org.dxos.mdl.op@1.0` |
21
18
 
22
19
  ## Types
23
20
 
@@ -32,342 +29,32 @@ type Settings
32
29
  type DebugPluginOptions
33
30
  fields:
34
31
  logStore?: IdbLogStore # shared persistent log store for capturing and downloading logs
32
+ persistStats?: boolean # persist the stats-panel store to localStorage (default true)
35
33
  ```
36
34
 
37
- ```mdl
38
- type DebugContextType
39
- fields:
40
- running: boolean
41
- start(cb: TimerCallback, options: TimerOptions): void
42
- stop(): void
43
- ```
44
-
45
- ## Components
46
-
47
- ```mdl
48
- component DebugSettings
49
- desc: Settings panel rendered in the plugin-settings article slot; controls wireframe and traceAll toggles and exposes log download.
50
- props:
51
- settings: Settings
52
- logStore?: IdbLogStore
53
- actions:
54
- updateSettings(patch: Partial<Settings>)
55
- downloadLogs()
56
- ```
57
-
58
- ```mdl
59
- component DebugStatus
60
- desc: Status-indicator surface shown in the main toolbar; reflects the generator timer running state.
61
- state:
62
- running: boolean
63
- ```
64
-
65
- ```mdl
66
- component DevtoolsOverviewContainer
67
- desc: Deck-companion panel that provides quick access to all devtools sections via a categorised link list.
68
- layout: |
69
- ┌─────────────────────────────┐
70
- │ Client ▸ Config / Storage │
71
- │ Logs / Diag │
72
- │ HALO ▸ Identity / Keys │
73
- │ ECHO ▸ Spaces / Feeds │
74
- │ Objects / Schema │
75
- │ Mesh ▸ Signal / Swarm │
76
- │ EDGE ▸ Dashboard / … │
77
- └─────────────────────────────┘
78
- ```
79
-
80
- ```mdl
81
- component DebugObjectPanel
82
- desc: Companion panel for any ECHO object that shows raw field values, type info, and DXN.
83
- props:
84
- companionTo: string # DXN of the object being inspected
85
- ```
86
-
87
- ```mdl
88
- component DebugSpaceObjectsPanel
89
- desc: Deck-companion panel listing all objects in the active space with their type, ID, and field count.
90
- props:
91
- space: Space
92
- ```
93
-
94
- ```mdl
95
- component DebugGraph
96
- desc: Visual representation of the Composer app-graph as a collapsible JSON tree.
97
- props:
98
- graph: Graph.Graph
99
- root: string # node ID used as the traversal root
100
- ```
101
-
102
- ```mdl
103
- component SpaceGenerator
104
- desc: Article view for generating synthetic ECHO objects into a space; controls count, type mix, and relation density.
105
- props:
106
- space: Space
107
- actions:
108
- generateObjects(count: number, types: string[])
109
- clear()
110
- emits:
111
- onCreateObjects(objects: Obj.Unknown[])
112
- ```
113
-
114
- ```mdl
115
- component Wireframe
116
- desc: Transparent overlay that wraps any article or section surface and renders a labelled border for layout debugging.
117
- props:
118
- label: string # "role:name" descriptor shown in the corner badge
119
- object: Obj.Unknown
120
- classNames?: string
121
- ```
122
-
123
- ```mdl
124
- component SchemaTable
125
- desc: Tabular display of all registered ECHO schemas with typename, fields, and version.
126
- ```
127
-
128
- ```mdl
129
- component GithubPanel
130
- desc: Developer panel linking to open GitHub issues and CI run status for the current build.
131
- ```
132
- ```
133
-
134
- ## Components (Devtools Panels)
135
-
136
- The following components are thin wrappers around `@dxos/devtools` panel components, each bound to a specific `Devtools.*` node:
137
-
138
- | Component | Devtools node | Displays |
139
- |------------------------|----------------------------|-----------------------------------------|
140
- | ConfigPanel | Client.Config | Vault config JSON viewer |
141
- | StoragePanel | Client.Storage | Local storage browser |
142
- | LoggingPanel | Client.Logs | Live log stream; download via logStore |
143
- | DiagnosticsPanel | Client.Diagnostics | Client health / metric charts |
144
- | IdentityPanel | Halo.Identity | Local identity key + device list |
145
- | DeviceListPanel | Halo.Devices | All devices paired with this identity |
146
- | KeyringPanel | Halo.Keyring | Raw keyring entries |
147
- | CredentialsPanel | Halo.Credentials | Credentials held in the active space |
148
- | SpaceListPanel | Echo.Spaces | All spaces with state + select action |
149
- | SpaceInfoPanel | Echo.Space | Selected space feeds / pipelines |
150
- | FeedsPanel | Echo.Feeds | Feed entries for the active space |
151
- | ObjectsPanel | Echo.Objects | All objects in the active space |
152
- | SchemaPanel | Echo.Schema | Schemas registered in the active space |
153
- | AutomergePanel | Echo.Automerge | Automerge document internals |
154
- | QueuesPanel | Echo.Queues | Pending queue items |
155
- | MembersPanel | Echo.Members | Space members with last-seen |
156
- | MetadataPanel | Echo.Metadata | Space/feed metadata blobs |
157
- | SignalPanel | Mesh.Signal | Signal-server connection state |
158
- | SwarmPanel | Mesh.Swarm | Active swarm peers |
159
- | NetworkPanel | Mesh.Network | Full network topology for active space |
160
- | EdgeDashboardPanel | Edge.Dashboard | EDGE node health / worker stats |
161
- | WorkflowPanel | Edge.Workflows | Workflow definitions in active space |
162
- | InvocationTraceContainer | Edge.Traces | Invocation trace timeline from feed |
163
- | TestingPanel | Edge.Testing | Integration test harness for EDGE |
164
- | ToolsExplorer | ToolsExplorer | MCP-backed tools explorer |
165
-
166
- ## Operations
167
-
168
- No first-party operations are defined by DebugPlugin. The plugin invokes `SpaceOperation.AddObject`, `SpaceOperation.Migrate`, `LayoutOperation.Open`, and `ScriptOperation.CreateScript` from other plugins via `useOperationInvoker` inside its surfaces.
169
-
170
35
  ## Features
171
36
 
172
37
  ```mdl
173
- feat F-1: Devtools Graph Node
174
-
175
- req F-1.1:
176
- when: DebugPlugin is loaded
177
- then: a "Devtools" node appears pinned at the end of each root and space in the nav graph
178
-
179
- req F-1.2: The Devtools node contains sub-trees for Client, HALO, ECHO, Mesh, and EDGE categories.
180
- req F-1.3: An app-graph sub-node renders DebugGraph rooted at the current space or root.
181
- req F-1.4: A tools-explorer sub-node renders ToolsExplorer connected to the MCP introspect service.
182
- ```
183
-
184
- ```mdl
185
- feat F-2: Object Debug Companion
186
-
187
- req F-2.1:
188
- when: any ECHO object is open in the deck
189
- then: a "Debug" companion tab is injected at the last position
190
-
191
- req F-2.2: DebugObjectPanel shows raw object fields, DXN, and typename for the companion target.
192
- ```
193
-
194
- ```mdl
195
- feat F-3: Space Object Explorer
196
-
197
- req F-3.1:
198
- when: user opens the "Space Objects" deck companion
199
- then: DebugSpaceObjectsPanel lists all ECHO objects in the active space
200
-
201
- req F-3.2: List updates reactively as objects are added or removed.
202
- ```
203
-
204
- ```mdl
205
- feat F-4: Devtools Overview Companion
206
-
207
- req F-4.1:
208
- when: user opens the "Devtools" deck companion
209
- then: DevtoolsOverviewContainer renders a categorised link list to all devtools panels
210
-
211
- req F-4.2: Clicking a category link navigates the deck to the corresponding devtools article.
212
- ```
213
-
214
- ```mdl
215
- feat F-5: Space Data Generator
216
-
217
- req F-5.1:
218
- when: user navigates to the debug node under a space
219
- then: SpaceGenerator is rendered as the article
220
-
221
- req F-5.2:
222
- when: user triggers object generation
223
- then: synthetic ECHO objects are created via op:SpaceOperation.AddObject in the active collection
224
-
225
- req F-5.3: DebugStatus indicator in the toolbar shows a running state while generation is active.
38
+ feat GenerateObjects
39
+ desc: Create configurable batches of synthetic ECHO objects into a space collection.
226
40
  ```
227
41
 
228
42
  ```mdl
229
- feat F-6: Wireframe Overlay
230
-
231
- req F-6.1:
232
- when: settings.wireframe is true
233
- then: Wireframe wraps every article and section surface with a labelled border
234
-
235
- req F-6.2:
236
- when: settings.wireframe is false or unset
237
- then: no overlay is injected; the Wireframe surface filter returns false immediately
238
- ```
239
-
240
- ```mdl
241
- feat F-7: Log Capture and Download
242
-
243
- req F-7.1:
244
- when: logStore is provided in DebugPluginOptions
245
- then: LoggingPanel can stream and display captured log entries
246
-
247
- req F-7.2:
248
- when: user clicks download in DebugSettings
249
- then: captured logs are serialised and offered as a file download via the file uploader capability
250
- ```
251
-
252
- ```mdl
253
- feat F-8: Global Dev Utilities
254
-
255
- req F-8.1:
256
- when: DebugPlugin activates
257
- then: globalThis.composer.changeStorageVersionInMetadata is registered for manual storage-migration testing
258
-
259
- req F-8.2: The function destroys the client, rewrites the storage version metadata, and reloads the page.
260
- ```
261
-
262
- ## Acceptance
263
-
264
- ```mdl
265
- test T-1: Devtools node appears in nav graph
266
- given: Composer loaded with DebugPlugin enabled
267
- when: user opens the navigation tree
268
- then:
269
- - "Devtools" node is visible pinned at the end of the root
270
- - sub-nodes Client, HALO, ECHO, Mesh, EDGE are present
43
+ feat ObjectDebugCompanion
44
+ desc: A Debug companion tab on every ECHO object exposing raw field values and DXNs.
271
45
  ```
272
46
 
273
47
  ```mdl
274
- test T-2: Debug companion on ECHO object
275
- given: a Document is open in the deck
276
- when: user clicks the "Debug" companion tab
277
- then:
278
- - DebugObjectPanel renders with the object's DXN and field map
48
+ feat SpaceObjectsBrowser
49
+ desc: A deck companion listing all objects in the active space with live reactive updates.
279
50
  ```
280
51
 
281
52
  ```mdl
282
- test T-3: Wireframe overlay toggle
283
- given: DebugPlugin settings panel is open
284
- when: user enables the wireframe toggle
285
- then:
286
- - every article and section surface shows a labelled border
287
- when: user disables the wireframe toggle
288
- then:
289
- - borders are removed immediately
53
+ feat Wireframe
54
+ desc: Overlay labelled borders around every article and section surface.
290
55
  ```
291
56
 
292
57
  ```mdl
293
- test T-4: Space object generation
294
- given: a space with an empty collection is active
295
- when: user opens the debug space node and generates 10 objects
296
- then:
297
- - 10 new objects appear in the active collection
298
- - DebugStatus shows "running" while generation is in progress
299
- ```
300
-
301
- ```mdl
302
- test T-5: Log download
303
- given: logStore is configured and some log entries have been captured
304
- when: user clicks "Download Logs" in DebugSettings
305
- then:
306
- - a file download is triggered containing the serialised log entries
307
- ```
308
-
309
- ---
310
-
311
- ## Appendix: Extension Definitions
312
-
313
- ```mdl
314
- ext type
315
- uri: org.dxos.mdl.type@1.0
316
- desc: A named data structure with typed fields and optional literals.
317
- fields:
318
- desc?: Prose
319
- fields?: FieldMap
320
- literals?: UnionList
321
- extends?: TypeRef[]
322
- ```
323
-
324
- ```mdl
325
- ext feat
326
- uri: org.dxos.mdl.feat@1.0
327
- desc: A named feature grouping one or more requirements.
328
- fields:
329
- desc?: Prose
330
- req: RequirementList
331
- nesting: self
332
- ```
333
-
334
- ```mdl
335
- ext test
336
- uri: org.dxos.mdl.test@1.0
337
- desc: An acceptance scenario expressed as given / when / then steps.
338
- fields:
339
- given?: Step | Step[]
340
- when?: Step | Step[]
341
- then: Step | Step[]
342
- tags?: TagList
343
- ```
344
-
345
- ```mdl
346
- ext component
347
- uri: org.dxos.mdl.component@1.0
348
- desc: A UI component with props, internal state, slots, actions, and events.
349
- fields:
350
- desc?: Prose
351
- props?: FieldMap
352
- state?: FieldMap
353
- slots?: FieldMap
354
- actions?: ActionMap
355
- emits?: EventMap
356
- layout?: CodeBlock
357
- ```
358
-
359
- ```mdl
360
- ext op
361
- uri: org.dxos.mdl.op@1.0
362
- desc: |
363
- A named operation with typed inputs, outputs, and declared errors.
364
- Pure ops have no effects or requires. Effectful ops declare both.
365
- fields:
366
- desc?: Prose
367
- input?: FieldMap
368
- output?: TypeExpr
369
- errors?: ErrorMap
370
- effects?: EffectList
371
- requires?: ServiceList
372
- note?: Prose
58
+ feat StatsPanel
59
+ desc: A transient-stats panel rendering the shared telemetry store.
373
60
  ```
package/README.md CHANGED
@@ -1,15 +1,5 @@
1
- # @dxos/plugin-kanban
1
+ # @dxos/plugin-debug
2
2
 
3
- Surface plugin for kanban entities.
4
-
5
- ## DXOS Resources
6
-
7
- - [Website](https://dxos.org)
8
- - [Developer Documentation](https://docs.dxos.org)
9
- - Talk to us on [Discord](https://dxos.org/discord)
10
-
11
- ## Contributions
12
-
13
- Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
14
-
15
- License: [FSL-1.1-Apache-2.0](./LICENSE) Copyright 2023 © DXOS
3
+ Developer debugging utilities for DXOS Composer: synthetic-object generation, a per-object Debug
4
+ companion, a space-objects browser, a wireframe overlay, and a transient-stats panel. Rendered under
5
+ a Debug node in the SYSTEM navigation group, alongside the Devtools inspector (`@dxos/plugin-devtools`).
@@ -0,0 +1,29 @@
1
+ import { ActivationEvents, Capability, Plugin } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ import { AppPlugin } from "@dxos/app-toolkit";
4
+ import { AppGraphBuilder, DebugSettings, LogRecording, ReactSurface, StatsPanel } from "#capabilities";
5
+ import { translations } from "#translations";
6
+ //#endregion
7
+ //#region src/DebugPlugin.tsx
8
+ var DebugPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }), AppPlugin.addSettingsModule({ activate: DebugSettings }), Plugin.addModule(({ logStore }) => ({
9
+ id: Capability.getModuleTag(ReactSurface) ?? "surfaces",
10
+ activatesOn: ActivationEvents.SetupReactSurface,
11
+ activate: () => ReactSurface({ logStore })
12
+ })), Plugin.addModule({
13
+ id: "log-recording",
14
+ activatesOn: ActivationEvents.Startup,
15
+ activate: LogRecording
16
+ }), AppPlugin.addTranslationsModule({ translations }), Plugin.addModule(({ persistStats }) => ({
17
+ id: "stats-panel",
18
+ activatesOn: ActivationEvents.Startup,
19
+ activate: () => StatsPanel({ persist: persistStats ?? true })
20
+ })), AppPlugin.addPluginAssetModule({ asset: {
21
+ pluginId: meta.profile.key,
22
+ path: "PLUGIN.mdl",
23
+ content: "---\nid: org.dxos.plugin.debug\nname: DebugPlugin\nversion: 0.1.0\n---\n\nDeveloper debugging utilities for `DXOS` Composer — synthetic-object generation, a per-object Debug companion, a space-objects browser, a wireframe overlay, and a transient-stats panel. Rendered under a Debug node in the SYSTEM navigation group, a sibling of the Devtools inspector (`org.dxos.plugin.devtools`).\n\n## Extensions\n\nThe following extension dialects are used in this document.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n\n## Types\n\n```mdl\ntype Settings\n fields:\n wireframe?: boolean # overlay every article/section surface with a labelled border\n traceAll?: boolean # enable verbose operation tracing across all plugins\n```\n\n```mdl\ntype DebugPluginOptions\n fields:\n logStore?: IdbLogStore # shared persistent log store for capturing and downloading logs\n persistStats?: boolean # persist the stats-panel store to localStorage (default true)\n```\n\n## Features\n\n```mdl\nfeat GenerateObjects\n desc: Create configurable batches of synthetic ECHO objects into a space collection.\n```\n\n```mdl\nfeat ObjectDebugCompanion\n desc: A Debug companion tab on every ECHO object exposing raw field values and DXNs.\n```\n\n```mdl\nfeat SpaceObjectsBrowser\n desc: A deck companion listing all objects in the active space with live reactive updates.\n```\n\n```mdl\nfeat Wireframe\n desc: Overlay labelled borders around every article and section surface.\n```\n\n```mdl\nfeat StatsPanel\n desc: A transient-stats panel rendering the shared telemetry store.\n```\n",
24
+ mimeType: "application/x-mdl"
25
+ } }), Plugin.make);
26
+ //#endregion
27
+ export { DebugPlugin, DebugPlugin as default };
28
+
29
+ //# sourceMappingURL=DebugPlugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugPlugin.mjs","names":[],"sources":["../../src/DebugPlugin.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { ActivationEvents, Capability, Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder, DebugSettings, LogRecording, ReactSurface, StatsPanel } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { type DebugPluginOptions } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const DebugPlugin = Plugin.define<DebugPluginOptions>(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addSettingsModule({ activate: DebugSettings }),\n Plugin.addModule(({ logStore }) => ({\n id: Capability.getModuleTag(ReactSurface) ?? 'surfaces',\n activatesOn: ActivationEvents.SetupReactSurface,\n activate: () => ReactSurface({ logStore }),\n })),\n Plugin.addModule({\n id: 'log-recording',\n activatesOn: ActivationEvents.Startup,\n activate: LogRecording,\n }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule(({ persistStats }) => ({\n id: 'stats-panel',\n activatesOn: ActivationEvents.Startup,\n activate: () => StatsPanel({ persist: persistStats ?? true }),\n })),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default DebugPlugin;\n"],"mappings":";;;;;;;AAeA,IAAa,cAAc,OAAO,OAA2B,IAAI,CAAC,CAAC,KACjE,UAAU,kBAAkB,EAAE,UAAU,gBAAgB,CAAC,GACzD,UAAU,kBAAkB,EAAE,UAAU,cAAc,CAAC,GACvD,OAAO,WAAW,EAAE,gBAAgB;CAClC,IAAI,WAAW,aAAa,YAAY,KAAK;CAC7C,aAAa,iBAAiB;CAC9B,gBAAgB,aAAa,EAAE,SAAS,CAAC;AAC3C,EAAE,GACF,OAAO,UAAU;CACf,IAAI;CACJ,aAAa,iBAAiB;CAC9B,UAAU;AACZ,CAAC,GACD,UAAU,sBAAsB,EAAE,aAAa,CAAC,GAChD,OAAO,WAAW,EAAE,oBAAoB;CACtC,IAAI;CACJ,aAAa,iBAAiB;CAC9B,gBAAgB,WAAW,EAAE,SAAS,gBAAgB,KAAK,CAAC;AAC9D,EAAE,GACF,UAAU,qBAAqB,EAC7B,OAAO;CAAE,UAAU,KAAK,QAAQ;CAAK,MAAM;CAAc,SAAS;CAAY,UAAU;AAAoB,EAC9G,CAAC,GACD,OAAO,IACT"}
@@ -0,0 +1,10 @@
1
+ import { Plugin } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ import { AppPlugin } from "@dxos/app-toolkit";
4
+ import { AppGraphBuilder, DebugSettings } from "#capabilities";
5
+ //#region src/DebugPlugin.node.ts
6
+ var DebugPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }), AppPlugin.addSettingsModule({ activate: DebugSettings }), Plugin.make);
7
+ //#endregion
8
+ export { DebugPlugin, DebugPlugin as default };
9
+
10
+ //# sourceMappingURL=DebugPlugin.node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugPlugin.node.mjs","names":[],"sources":["../../src/DebugPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder, DebugSettings } from '#capabilities';\nimport { meta } from '#meta';\nimport { type DebugPluginOptions } from '#types';\n\nexport const DebugPlugin = Plugin.define<DebugPluginOptions>(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addSettingsModule({ activate: DebugSettings }),\n Plugin.make,\n);\n\nexport default DebugPlugin;\n"],"mappings":";;;;;AAWA,IAAa,cAAc,OAAO,OAA2B,IAAI,CAAC,CAAC,KACjE,UAAU,kBAAkB,EAAE,UAAU,gBAAgB,CAAC,GACzD,UAAU,kBAAkB,EAAE,UAAU,cAAc,CAAC,GACvD,OAAO,IACT"}
@@ -0,0 +1,8 @@
1
+ import { Plugin } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ //#region src/DebugPlugin.workerd.ts
4
+ var DebugPlugin = Plugin.define(meta).pipe(Plugin.make);
5
+ //#endregion
6
+ export { DebugPlugin, DebugPlugin as default };
7
+
8
+ //# sourceMappingURL=DebugPlugin.workerd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugPlugin.workerd.mjs","names":[],"sources":["../../src/DebugPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\nimport { type DebugPluginOptions } from '#types';\n\nexport const DebugPlugin = Plugin.define<DebugPluginOptions>(meta).pipe(Plugin.make);\n\nexport default DebugPlugin;\n"],"mappings":";;;AASA,IAAa,cAAc,OAAO,OAA2B,IAAI,CAAC,CAAC,KAAK,OAAO,IAAI"}
@@ -0,0 +1,11 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ //#region src/capabilities/index.ts
3
+ var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./chunk-app-graph-builder.mjs"));
4
+ var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
5
+ var DebugSettings = Capability.lazy("DebugSettings", () => import("./chunk-settings.mjs"));
6
+ var StatsPanel = Capability.lazy("StatsPanel", () => import("./chunk-stats-panel.mjs"));
7
+ var LogRecording = Capability.lazy("LogRecording", () => import("./chunk-log-recording.mjs"));
8
+ //#endregion
9
+ export { AppGraphBuilder, DebugSettings, LogRecording, ReactSurface, StatsPanel };
10
+
11
+ //# sourceMappingURL=capabilities.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const DebugSettings = Capability.lazy('DebugSettings', () => import('./settings'));\nexport const StatsPanel = Capability.lazy('StatsPanel', () => import('./stats-panel'));\nexport const LogRecording = Capability.lazy('LogRecording', () => import('./log-recording'));\n"],"mappings":";;AAMA,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,gCAAsB;AACrG,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,gBAAgB,WAAW,KAAK,uBAAuB,OAAO,uBAAa;AACxF,IAAa,aAAa,WAAW,KAAK,oBAAoB,OAAO,0BAAgB;AACrF,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB"}
@@ -0,0 +1,58 @@
1
+ import { useMemo, useState } from "react";
2
+ import { Clipboard, Panel, ScrollArea, Toolbar } from "@dxos/react-ui";
3
+ import { mx } from "@dxos/ui-theme";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Filter, Json, Obj, Query } from "@dxos/echo";
6
+ import { ObjectsTree } from "@dxos/devtools";
7
+ import { useQuery } from "@dxos/echo-react";
8
+ import { Syntax } from "@dxos/react-ui-syntax-highlighter";
9
+ //#region src/containers/DebugObjectPanel/DebugObjectPanel.tsx
10
+ var DebugObjectPanel = ({ role, companionTo, onOpen, canOpen }) => {
11
+ const db = Obj.getDatabase(companionTo);
12
+ const [selectedId, setSelectedId] = useState(null);
13
+ const [selectedObject] = useQuery(db, useMemo(() => db ? Query.select(Filter.id(selectedId ?? companionTo.id)).options({ deleted: "include" }).from(db, { includeFeeds: true }) : Query.select(Filter.nothing()), [
14
+ db,
15
+ selectedId,
16
+ companionTo.id
17
+ ]));
18
+ return /* @__PURE__ */ jsx(Clipboard.Provider, { children: /* @__PURE__ */ jsxs(Panel.Root, {
19
+ role,
20
+ children: [/* @__PURE__ */ jsx(Panel.Toolbar, {
21
+ asChild: true,
22
+ children: /* @__PURE__ */ jsx(Toolbar.Root, {})
23
+ }), /* @__PURE__ */ jsx(Panel.Content, {
24
+ asChild: true,
25
+ children: /* @__PURE__ */ jsxs("div", {
26
+ className: mx("grid divide-y divide-subdued-separator", db && "grid-rows-[1fr_2fr]"),
27
+ children: [db && /* @__PURE__ */ jsx(ScrollArea.Root, { children: /* @__PURE__ */ jsx(ScrollArea.Viewport, { children: /* @__PURE__ */ jsx(ObjectsTree, {
28
+ db,
29
+ root: companionTo,
30
+ onSelect: (entity) => setSelectedId(entity.id),
31
+ onOpen,
32
+ canOpen
33
+ }) }) }), /* @__PURE__ */ jsx(Syntax.Root, {
34
+ data: selectedObject,
35
+ getReplacer: (depth) => db ? Json.createRefReplacer({
36
+ db,
37
+ depth
38
+ }) : void 0,
39
+ children: /* @__PURE__ */ jsxs(Panel.Root, { children: [/* @__PURE__ */ jsx(Panel.Toolbar, {
40
+ asChild: true,
41
+ children: /* @__PURE__ */ jsxs(Toolbar.Root, {
42
+ classNames: "grid grid-cols-[1fr_3rem]",
43
+ children: [/* @__PURE__ */ jsx(Syntax.Filter, {}), /* @__PURE__ */ jsx(Syntax.Depth, {})]
44
+ })
45
+ }), /* @__PURE__ */ jsx(Panel.Content, {
46
+ asChild: true,
47
+ children: /* @__PURE__ */ jsx(Syntax.Viewport, { children: /* @__PURE__ */ jsx(Syntax.Code, {}) })
48
+ })] })
49
+ })]
50
+ })
51
+ })]
52
+ }) });
53
+ };
54
+ DebugObjectPanel.displayName = "DebugObjectPanel";
55
+ //#endregion
56
+ export { DebugObjectPanel as default };
57
+
58
+ //# sourceMappingURL=chunk-DebugObjectPanel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-DebugObjectPanel.mjs","names":[],"sources":["../../src/containers/DebugObjectPanel/DebugObjectPanel.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useMemo, useState } from 'react';\n\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { ObjectsTree } from '@dxos/devtools';\nimport { type Entity, Filter, Json, Obj, Query } from '@dxos/echo';\nimport { useQuery } from '@dxos/echo-react';\nimport type { EntityId } from '@dxos/keys';\nimport { Clipboard, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';\nimport { Syntax } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/ui-theme';\n\nexport type DebugObjectPanelProps = Pick<\n AppSurface.ObjectArticleProps<Obj.Unknown, {}, Obj.Unknown>,\n 'role' | 'companionTo'\n> & {\n onOpen?: (object: Obj.Unknown) => void;\n canOpen?: (entity: Entity.Snapshot) => boolean;\n};\n\nexport const DebugObjectPanel = ({ role, companionTo, onOpen, canOpen }: DebugObjectPanelProps) => {\n const db = Obj.getDatabase(companionTo);\n const [selectedId, setSelectedId] = useState<EntityId | null>(null);\n // Include feeds so that feed-backed objects (e.g. synced games) resolve in the selection query.\n const selectionQuery = useMemo(\n () =>\n db\n ? Query.select(Filter.id(selectedId ?? companionTo.id))\n .options({ deleted: 'include' })\n .from(db, { includeFeeds: true })\n : Query.select(Filter.nothing()),\n [db, selectedId, companionTo.id],\n );\n const [selectedObject] = useQuery(db, selectionQuery);\n\n return (\n <Clipboard.Provider>\n <Panel.Root role={role}>\n <Panel.Toolbar asChild>\n <Toolbar.Root />\n </Panel.Toolbar>\n <Panel.Content asChild>\n <div className={mx('grid divide-y divide-subdued-separator', db && 'grid-rows-[1fr_2fr]')}>\n {db && (\n <ScrollArea.Root>\n <ScrollArea.Viewport>\n <ObjectsTree\n db={db}\n root={companionTo}\n onSelect={(entity) => setSelectedId(entity.id)}\n onOpen={onOpen}\n canOpen={canOpen}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n )}\n <Syntax.Root\n data={selectedObject}\n getReplacer={(depth) => (db ? Json.createRefReplacer({ db, depth }) : undefined)}\n >\n <Panel.Root>\n <Panel.Toolbar asChild>\n <Toolbar.Root classNames='grid grid-cols-[1fr_3rem]'>\n <Syntax.Filter />\n <Syntax.Depth />\n </Toolbar.Root>\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Syntax.Viewport>\n <Syntax.Code />\n </Syntax.Viewport>\n </Panel.Content>\n </Panel.Root>\n </Syntax.Root>\n </div>\n </Panel.Content>\n </Panel.Root>\n </Clipboard.Provider>\n );\n};\n\nDebugObjectPanel.displayName = 'DebugObjectPanel';\n"],"mappings":";;;;;;;;;AAuBA,IAAa,oBAAoB,EAAE,MAAM,aAAa,QAAQ,cAAqC;CACjG,MAAM,KAAK,IAAI,YAAY,WAAW;CACtC,MAAM,CAAC,YAAY,iBAAiB,SAA0B,IAAI;CAWlE,MAAM,CAAC,kBAAkB,SAAS,IATX,cAEnB,KACI,MAAM,OAAO,OAAO,GAAG,cAAc,YAAY,EAAE,CAAC,CAAA,CACjD,QAAQ,EAAE,SAAS,UAAU,CAAC,CAAA,CAC9B,KAAK,IAAI,EAAE,cAAc,KAAK,CAAC,IAClC,MAAM,OAAO,OAAO,QAAQ,CAAC,GACnC;EAAC;EAAI;EAAY,YAAY;CAAE,CAEK,CAAc;CAEpD,OACE,oBAAC,UAAU,UAAX,EAAA,UACE,qBAAC,MAAM,MAAP;EAAkB;YAAlB,CACE,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,oBAAC,QAAQ,MAAT,CAAe,CAAA;EACF,CAAA,GACf,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,qBAAC,OAAD;IAAK,WAAW,GAAG,0CAA0C,MAAM,qBAAqB;cAAxF,CACG,MACC,oBAAC,WAAW,MAAZ,EAAA,UACE,oBAAC,WAAW,UAAZ,EAAA,UACE,oBAAC,aAAD;KACM;KACJ,MAAM;KACN,WAAW,WAAW,cAAc,OAAO,EAAE;KACrC;KACC;IACV,CAAA,EACkB,CAAA,EACN,CAAA,GAEnB,oBAAC,OAAO,MAAR;KACE,MAAM;KACN,cAAc,UAAW,KAAK,KAAK,kBAAkB;MAAE;MAAI;KAAM,CAAC,IAAI,KAAA;eAEtE,qBAAC,MAAM,MAAP,EAAA,UAAA,CACE,oBAAC,MAAM,SAAP;MAAe,SAAA;gBACb,qBAAC,QAAQ,MAAT;OAAc,YAAW;iBAAzB,CACE,oBAAC,OAAO,QAAR,CAAgB,CAAA,GAChB,oBAAC,OAAO,OAAR,CAAe,CAAA,CACH;;KACD,CAAA,GACf,oBAAC,MAAM,SAAP;MAAe,SAAA;gBACb,oBAAC,OAAO,UAAR,EAAA,UACE,oBAAC,OAAO,MAAR,CAAc,CAAA,EACC,CAAA;KACJ,CAAA,CACL,EAAA,CAAA;IACD,CAAA,CACV;;EACQ,CAAA,CACL;IACM,CAAA;AAExB;AAEA,iBAAiB,cAAc"}