@niscorp/nova 0.1.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 (170) hide show
  1. package/ACTION_DOCS.md +552 -0
  2. package/ADAPTER.md +170 -0
  3. package/DESIGN.md +719 -0
  4. package/I18N_DOCS.md +224 -0
  5. package/LAYOUT_DOCS.md +505 -0
  6. package/LICENSE +202 -0
  7. package/REACT_DOCS.md +562 -0
  8. package/README.md +379 -0
  9. package/SHELL_DOCS.md +615 -0
  10. package/TERMINAL_DOCS.md +124 -0
  11. package/dist/adapters/dom/components/index.cjs +473 -0
  12. package/dist/adapters/dom/components/index.cjs.map +1 -0
  13. package/dist/adapters/dom/components/index.d.cts +48 -0
  14. package/dist/adapters/dom/components/index.d.ts +48 -0
  15. package/dist/adapters/dom/components/index.js +420 -0
  16. package/dist/adapters/dom/components/index.js.map +1 -0
  17. package/dist/adapters/dom/index.cjs +171 -0
  18. package/dist/adapters/dom/index.cjs.map +1 -0
  19. package/dist/adapters/dom/index.d.cts +29 -0
  20. package/dist/adapters/dom/index.d.ts +29 -0
  21. package/dist/adapters/dom/index.js +15 -0
  22. package/dist/adapters/dom/index.js.map +1 -0
  23. package/dist/adapters/dom/server.cjs +129 -0
  24. package/dist/adapters/dom/server.cjs.map +1 -0
  25. package/dist/adapters/dom/server.d.cts +15 -0
  26. package/dist/adapters/dom/server.d.ts +15 -0
  27. package/dist/adapters/dom/server.js +37 -0
  28. package/dist/adapters/dom/server.js.map +1 -0
  29. package/dist/adapters/ink/index.d.ts +75 -0
  30. package/dist/adapters/ink/index.js +472 -0
  31. package/dist/adapters/ink/index.js.map +1 -0
  32. package/dist/adapters/react/components/index.cjs +552 -0
  33. package/dist/adapters/react/components/index.cjs.map +1 -0
  34. package/dist/adapters/react/components/index.d.cts +30 -0
  35. package/dist/adapters/react/components/index.d.ts +30 -0
  36. package/dist/adapters/react/components/index.js +12 -0
  37. package/dist/adapters/react/components/index.js.map +1 -0
  38. package/dist/adapters/react/index.cjs +1526 -0
  39. package/dist/adapters/react/index.cjs.map +1 -0
  40. package/dist/adapters/react/index.d.cts +149 -0
  41. package/dist/adapters/react/index.d.ts +149 -0
  42. package/dist/adapters/react/index.js +12 -0
  43. package/dist/adapters/react/index.js.map +1 -0
  44. package/dist/adapters/tty/components/index.cjs +255 -0
  45. package/dist/adapters/tty/components/index.cjs.map +1 -0
  46. package/dist/adapters/tty/components/index.d.cts +40 -0
  47. package/dist/adapters/tty/components/index.d.ts +40 -0
  48. package/dist/adapters/tty/components/index.js +187 -0
  49. package/dist/adapters/tty/components/index.js.map +1 -0
  50. package/dist/adapters/tty/index.cjs +76 -0
  51. package/dist/adapters/tty/index.cjs.map +1 -0
  52. package/dist/adapters/tty/index.d.cts +47 -0
  53. package/dist/adapters/tty/index.d.ts +47 -0
  54. package/dist/adapters/tty/index.js +76 -0
  55. package/dist/adapters/tty/index.js.map +1 -0
  56. package/dist/adapters/vue/components/index.cjs +619 -0
  57. package/dist/adapters/vue/components/index.cjs.map +1 -0
  58. package/dist/adapters/vue/components/index.d.cts +224 -0
  59. package/dist/adapters/vue/components/index.d.ts +224 -0
  60. package/dist/adapters/vue/components/index.js +12 -0
  61. package/dist/adapters/vue/components/index.js.map +1 -0
  62. package/dist/adapters/vue/index.cjs +747 -0
  63. package/dist/adapters/vue/index.cjs.map +1 -0
  64. package/dist/adapters/vue/index.d.cts +98 -0
  65. package/dist/adapters/vue/index.d.ts +98 -0
  66. package/dist/adapters/vue/index.js +127 -0
  67. package/dist/adapters/vue/index.js.map +1 -0
  68. package/dist/agent/index.cjs +178 -0
  69. package/dist/agent/index.cjs.map +1 -0
  70. package/dist/agent/index.d.cts +28 -0
  71. package/dist/agent/index.d.ts +28 -0
  72. package/dist/agent/index.js +30 -0
  73. package/dist/agent/index.js.map +1 -0
  74. package/dist/chunk-2MNLEL45.js +47 -0
  75. package/dist/chunk-2MNLEL45.js.map +1 -0
  76. package/dist/chunk-3HGE3VWK.js +753 -0
  77. package/dist/chunk-3HGE3VWK.js.map +1 -0
  78. package/dist/chunk-4ZID7UX5.js +549 -0
  79. package/dist/chunk-4ZID7UX5.js.map +1 -0
  80. package/dist/chunk-7B3RDENH.js +1982 -0
  81. package/dist/chunk-7B3RDENH.js.map +1 -0
  82. package/dist/chunk-7S5BNPUS.js +54 -0
  83. package/dist/chunk-7S5BNPUS.js.map +1 -0
  84. package/dist/chunk-7TS3YVQR.js +114 -0
  85. package/dist/chunk-7TS3YVQR.js.map +1 -0
  86. package/dist/chunk-EG2RUXJN.js +266 -0
  87. package/dist/chunk-EG2RUXJN.js.map +1 -0
  88. package/dist/chunk-GVBBL36G.js +429 -0
  89. package/dist/chunk-GVBBL36G.js.map +1 -0
  90. package/dist/chunk-I5D2R5UA.js +753 -0
  91. package/dist/chunk-I5D2R5UA.js.map +1 -0
  92. package/dist/chunk-IGLCWXQ3.js +304 -0
  93. package/dist/chunk-IGLCWXQ3.js.map +1 -0
  94. package/dist/chunk-JI7ZRESP.js +64 -0
  95. package/dist/chunk-JI7ZRESP.js.map +1 -0
  96. package/dist/chunk-L5223LLX.js +31 -0
  97. package/dist/chunk-L5223LLX.js.map +1 -0
  98. package/dist/chunk-LA3BSEMX.js +1905 -0
  99. package/dist/chunk-LA3BSEMX.js.map +1 -0
  100. package/dist/chunk-OAMC6R6E.js +121 -0
  101. package/dist/chunk-OAMC6R6E.js.map +1 -0
  102. package/dist/chunk-OGD5CCMZ.js +62 -0
  103. package/dist/chunk-OGD5CCMZ.js.map +1 -0
  104. package/dist/chunk-PF4OJTYU.js +199 -0
  105. package/dist/chunk-PF4OJTYU.js.map +1 -0
  106. package/dist/chunk-PZ5AY32C.js +9 -0
  107. package/dist/chunk-PZ5AY32C.js.map +1 -0
  108. package/dist/chunk-RBU5PHN4.js +8 -0
  109. package/dist/chunk-RBU5PHN4.js.map +1 -0
  110. package/dist/chunk-RQB4PRPV.js +285 -0
  111. package/dist/chunk-RQB4PRPV.js.map +1 -0
  112. package/dist/chunk-V32EVEVM.js +464 -0
  113. package/dist/chunk-V32EVEVM.js.map +1 -0
  114. package/dist/chunk-ZITHBBF3.js +85 -0
  115. package/dist/chunk-ZITHBBF3.js.map +1 -0
  116. package/dist/devtools/index.cjs +1088 -0
  117. package/dist/devtools/index.cjs.map +1 -0
  118. package/dist/devtools/index.d.cts +33 -0
  119. package/dist/devtools/index.d.ts +33 -0
  120. package/dist/devtools/index.js +399 -0
  121. package/dist/devtools/index.js.map +1 -0
  122. package/dist/effects-CndX9K7D.d.cts +123 -0
  123. package/dist/effects-CndX9K7D.d.ts +123 -0
  124. package/dist/endpoints-CD-6Jl-H.d.ts +36 -0
  125. package/dist/endpoints-Dem-EdRx.d.cts +36 -0
  126. package/dist/i18n/index.cjs +299 -0
  127. package/dist/i18n/index.cjs.map +1 -0
  128. package/dist/i18n/index.d.cts +28 -0
  129. package/dist/i18n/index.d.ts +28 -0
  130. package/dist/i18n/index.js +180 -0
  131. package/dist/i18n/index.js.map +1 -0
  132. package/dist/index-CNfzSBe2.d.ts +93 -0
  133. package/dist/index-caZoXSwr.d.cts +93 -0
  134. package/dist/index.cjs +3723 -0
  135. package/dist/index.cjs.map +1 -0
  136. package/dist/index.d.cts +144 -0
  137. package/dist/index.d.ts +144 -0
  138. package/dist/index.js +15 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/migrations/index.cjs +635 -0
  141. package/dist/migrations/index.cjs.map +1 -0
  142. package/dist/migrations/index.d.cts +97 -0
  143. package/dist/migrations/index.d.ts +97 -0
  144. package/dist/migrations/index.js +50 -0
  145. package/dist/migrations/index.js.map +1 -0
  146. package/dist/palette-CP0wd3bE.d.ts +15 -0
  147. package/dist/palette-lm0bU9i5.d.cts +15 -0
  148. package/dist/primitive-props-BH_EJWIe.d.cts +100 -0
  149. package/dist/primitive-props-BH_EJWIe.d.ts +100 -0
  150. package/dist/primitive-props-CGoJvmcH.d.cts +100 -0
  151. package/dist/primitive-props-CGoJvmcH.d.ts +100 -0
  152. package/dist/reflect/index.cjs +998 -0
  153. package/dist/reflect/index.cjs.map +1 -0
  154. package/dist/reflect/index.d.cts +125 -0
  155. package/dist/reflect/index.d.ts +125 -0
  156. package/dist/reflect/index.js +13 -0
  157. package/dist/reflect/index.js.map +1 -0
  158. package/dist/schemas-DPdeFlCT.d.cts +38 -0
  159. package/dist/schemas-DPdeFlCT.d.ts +38 -0
  160. package/dist/schemas-pMyyuXV7.d.cts +47 -0
  161. package/dist/schemas-pMyyuXV7.d.ts +47 -0
  162. package/dist/types-Boh9ckdG.d.ts +194 -0
  163. package/dist/types-Brc7v_pS.d.ts +198 -0
  164. package/dist/types-ByNSwtUV.d.cts +20 -0
  165. package/dist/types-DdltMfw7.d.ts +20 -0
  166. package/dist/types-De0KpxfI.d.cts +198 -0
  167. package/dist/types-DhHL0twe.d.ts +20 -0
  168. package/dist/types-Dv6JLmgo.d.cts +194 -0
  169. package/dist/types-Q80YtOQt.d.cts +20 -0
  170. package/package.json +237 -0
@@ -0,0 +1,399 @@
1
+ import { describeInstance, auditCatalog, snapshotShell } from '../chunk-IGLCWXQ3.js';
2
+ import '../chunk-RQB4PRPV.js';
3
+ import '../chunk-OGD5CCMZ.js';
4
+ import '../chunk-GVBBL36G.js';
5
+ import '../chunk-V32EVEVM.js';
6
+ import '../chunk-7TS3YVQR.js';
7
+ import '../chunk-PF4OJTYU.js';
8
+ import '../chunk-JI7ZRESP.js';
9
+ import '../chunk-RBU5PHN4.js';
10
+ import '../chunk-2MNLEL45.js';
11
+ import '../chunk-PZ5AY32C.js';
12
+
13
+ // src/devtools/dock.ts
14
+ var dockLayout = {
15
+ if: "$.collapsed",
16
+ then: { component: "Button", ref: "dock-expand", props: { size: "sm", variant: "ghost" }, children: "\u2699 devtools" },
17
+ else: {
18
+ component: "Panel",
19
+ // the ✕ lives in the Panel HEADER (closeRef — the same prop-ref convention
20
+ // as Table's rowRef); it collapses the dock to the pill
21
+ props: { title: "devtools", closeRef: "dock-close" },
22
+ children: {
23
+ component: "Stack",
24
+ props: { gap: 10 },
25
+ children: [
26
+ {
27
+ component: "Row",
28
+ props: { gap: 6 },
29
+ children: [
30
+ { component: "Button", ref: "tab-shell", props: { size: "sm", variant: { $if: { $eq: ["$.tab", "shell"] }, $then: "primary", $else: "ghost" } }, children: "shell" },
31
+ { component: "Button", ref: "tab-audit", props: { size: "sm", variant: { $if: { $eq: ["$.tab", "audit"] }, $then: "primary", $else: "ghost" } }, children: "audit" },
32
+ { component: "Button", ref: "tab-timeline", props: { size: "sm", variant: { $if: { $eq: ["$.tab", "timeline"] }, $then: "primary", $else: "ghost" } }, children: "timeline" }
33
+ ]
34
+ },
35
+ // ── shell: the live canvases + the shell model, as accordions ──
36
+ {
37
+ if: { $eq: ["$.tab", "shell"] },
38
+ then: {
39
+ component: "Stack",
40
+ props: { gap: 4 },
41
+ children: [
42
+ { component: "Text", props: { size: "sm", color: "mute" }, children: "the live shell \u2014 a row opens its stack; \u2699 inspects an instance" },
43
+ // the shell model itself (layout store, component registry)
44
+ {
45
+ component: "Grid",
46
+ ref: "shell-open",
47
+ props: { value: "shell", hover: true, weights: [1, "auto"], gap: 8, selected: { $eq: ["$.shellOpen", "shell"] } },
48
+ children: [
49
+ { component: "Text", props: { weight: 600, size: "sm" }, children: "shell model" },
50
+ { component: "Text", props: { size: "xs", color: "mute" }, children: "layouts \xB7 components" }
51
+ ]
52
+ },
53
+ {
54
+ if: { $eq: ["$.shellOpen", "shell"] },
55
+ then: {
56
+ component: "Stack",
57
+ props: { gap: 4, pad: 6 },
58
+ children: [
59
+ { component: "JsonTree", props: { value: "$.shell.layouts", label: "layout store" } },
60
+ { component: "JsonTree", props: { value: "$.shell.components", label: "registry" } }
61
+ ]
62
+ }
63
+ },
64
+ // each canvas: a row that opens its stack in place
65
+ {
66
+ for: "$.shell.canvases",
67
+ as: "c",
68
+ key: "id",
69
+ do: {
70
+ component: "Stack",
71
+ props: { gap: 2 },
72
+ children: [
73
+ {
74
+ component: "Grid",
75
+ ref: "shell-open",
76
+ props: { value: "$.c.id", hover: true, weights: [1, "auto"], gap: 8, selected: { $eq: ["$.shellOpen", "$.c.id"] } },
77
+ children: [
78
+ { component: "Text", props: { weight: 600, size: "sm" }, children: "$.c.id" },
79
+ { component: "Text", props: { size: "xs", color: "mute" }, children: "{{$.c.depth}} mounted" }
80
+ ]
81
+ },
82
+ {
83
+ if: { $eq: ["$.shellOpen", "$.c.id"] },
84
+ then: {
85
+ component: "Stack",
86
+ props: { gap: 2, pad: 6 },
87
+ children: [
88
+ // stack navigation: pop the top (only shown when
89
+ // there's something beneath it — never empties a canvas)
90
+ {
91
+ if: "$.c.items.1",
92
+ then: { component: "Button", ref: "canvas-back", props: { size: "sm", variant: "ghost", value: "$.c.id" }, children: "\u2190 pop {{$.c.items.0.definitionId}}" }
93
+ },
94
+ {
95
+ for: "$.c.items",
96
+ as: "i",
97
+ key: "instanceId",
98
+ do: {
99
+ component: "Row",
100
+ props: { gap: 8, align: "center" },
101
+ children: [
102
+ { component: "Button", ref: "inspect", props: { size: "sm", variant: "ghost", value: "$.i.instanceId" }, children: "\u2699 {{$.i.definitionId}}" },
103
+ { component: "Badge", children: "$.i.status" },
104
+ // stack position, not status — 'top' receives events
105
+ { if: "$.i.active", then: { component: "Badge", children: "top" } },
106
+ { component: "Text", props: { size: "xs", color: "mute", mono: true }, children: "$.i.instanceId" }
107
+ ]
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ }
116
+ ]
117
+ }
118
+ },
119
+ // ── audit: static lint of the catalog; a row opens its findings in place ──
120
+ {
121
+ if: { $eq: ["$.tab", "audit"] },
122
+ then: {
123
+ component: "Stack",
124
+ props: { gap: 4 },
125
+ children: [
126
+ { component: "Text", props: { size: "sm", color: "mute" }, children: "static lint of the action catalog \u2014 {{$.audit.address}} to address across {{$.audit.definitions}} actions" },
127
+ {
128
+ for: "$.audit.rows",
129
+ as: "r",
130
+ key: "id",
131
+ do: {
132
+ component: "Stack",
133
+ props: { gap: 2 },
134
+ children: [
135
+ {
136
+ component: "Grid",
137
+ ref: "audit-open",
138
+ props: { value: "$.r.id", hover: true, weights: [1, "auto"], gap: 8, selected: { $eq: ["$.auditOpen", "$.r.id"] } },
139
+ children: [
140
+ { component: "Text", props: { weight: 600, size: "sm" }, children: "$.r.id" },
141
+ { component: "Text", props: { size: "sm" }, children: "$.r.address" }
142
+ ]
143
+ },
144
+ {
145
+ if: { $eq: ["$.auditOpen", "$.r.id"] },
146
+ then: {
147
+ component: "Stack",
148
+ props: { gap: 4, pad: 6 },
149
+ children: {
150
+ for: "$.r.issues",
151
+ as: "f",
152
+ do: {
153
+ component: "Row",
154
+ props: { gap: 8, align: "start" },
155
+ children: [
156
+ { component: "Badge", children: "$.f.kind" },
157
+ {
158
+ component: "Stack",
159
+ props: { gap: 1 },
160
+ children: [
161
+ { component: "Text", props: { size: "sm" }, children: "$.f.issue" },
162
+ { if: "$.f.reason", then: { component: "Text", props: { size: "xs", color: "mute" }, children: "$.f.reason" } }
163
+ ]
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ }
169
+ }
170
+ ]
171
+ }
172
+ }
173
+ ]
174
+ }
175
+ },
176
+ // ── timeline: endpoint calls; a row opens its detail in place ──
177
+ {
178
+ if: { $eq: ["$.tab", "timeline"] },
179
+ then: {
180
+ component: "Stack",
181
+ props: { gap: 4 },
182
+ children: [
183
+ { component: "Text", props: { size: "sm", color: "mute" }, children: "{{$.timeline.count}} endpoint calls, newest first (fn = in-process, http = over the wire)" },
184
+ {
185
+ for: "$.timeline.rows",
186
+ as: "t",
187
+ key: "seq",
188
+ do: {
189
+ component: "Stack",
190
+ props: { gap: 2 },
191
+ children: [
192
+ {
193
+ component: "Grid",
194
+ ref: "timeline-open",
195
+ props: { value: "$.t.seq", hover: true, weights: [2, 2, "auto", "auto"], gap: 8, selected: { $eq: ["$.timelineOpen", "$.t.seq"] } },
196
+ children: [
197
+ { component: "Text", props: { size: "sm" }, children: "$.t.name" },
198
+ { component: "Text", props: { size: "xs", color: "mute" }, children: "$.t.action" },
199
+ { component: "Badge", children: "$.t.kind" },
200
+ { component: "Text", props: { size: "xs", color: { $if: "$.t.ok", $then: "mute", $else: "red" } }, children: "{{$.t.ms}}ms" }
201
+ ]
202
+ },
203
+ {
204
+ if: { $eq: ["$.timelineOpen", "$.t.seq"] },
205
+ then: {
206
+ component: "Stack",
207
+ props: { gap: 2, pad: 6 },
208
+ children: [
209
+ { component: "Text", props: { size: "xs", color: "mute" }, children: "endpoint {{$.t.name}} \xB7 {{$.t.kind}} \xB7 ok {{$.t.ok}} \xB7 status {{$.t.status}} \xB7 {{$.t.ms}}ms" },
210
+ { component: "Text", props: { size: "xs", color: "mute" }, children: "caller {{$.t.action}} on {{$.t.canvasId}}" },
211
+ { component: "Text", props: { size: "xs", color: "mute", mono: true }, children: "$.t.instanceId" },
212
+ { component: "Button", ref: "inspect", props: { size: "sm", variant: "ghost", value: "$.t.instanceId" }, children: "\u2699 inspect caller" }
213
+ ]
214
+ }
215
+ }
216
+ ]
217
+ }
218
+ }
219
+ ]
220
+ }
221
+ }
222
+ ]
223
+ }
224
+ }
225
+ };
226
+ var dockAction = {
227
+ id: "devtools.dock",
228
+ title: "devtools",
229
+ data: {
230
+ tab: "shell",
231
+ collapsed: false,
232
+ popCanvas: "",
233
+ shellOpen: "",
234
+ auditOpen: "",
235
+ timelineOpen: "",
236
+ shell: { canvases: [], layouts: [], components: [] },
237
+ audit: { rows: [], address: 0, definitions: 0 },
238
+ timeline: { rows: [], count: 0 }
239
+ },
240
+ layout: dockLayout,
241
+ endpoints: {
242
+ shellState: { fn: "devtools.shellState", target: "shell" },
243
+ audit: { fn: "devtools.audit", target: "audit" },
244
+ timeline: { fn: "devtools.timeline", target: "timeline" },
245
+ pop: { fn: "devtools.pop" }
246
+ },
247
+ lifecycle: { mount: [{ call: "shellState" }, { call: "audit" }] },
248
+ triggers: [
249
+ { event: "ui:click", ref: "tab-shell", do: [{ set: "tab", value: "shell" }, { call: "shellState" }] },
250
+ { event: "ui:click", ref: "tab-audit", do: [{ set: "tab", value: "audit" }, { call: "audit" }] },
251
+ { event: "ui:click", ref: "tab-timeline", do: [{ set: "tab", value: "timeline" }, { call: "timeline" }] },
252
+ // the accordions: a row click toggles its detail open/closed in place —
253
+ // pure data ($if in the set value, the firing event in scope)
254
+ { event: "ui:click", ref: "shell-open", do: [{ set: "shellOpen", value: { $if: { $eq: ["$.shellOpen", "@event.payload"] }, $then: "", $else: "@event.payload" } }] },
255
+ { event: "ui:click", ref: "audit-open", do: [{ set: "auditOpen", value: { $if: { $eq: ["$.auditOpen", "@event.payload"] }, $then: "", $else: "@event.payload" } }] },
256
+ { event: "ui:click", ref: "timeline-open", do: [{ set: "timelineOpen", value: { $if: { $eq: ["$.timelineOpen", "@event.payload"] }, $then: "", $else: "@event.payload" } }] },
257
+ // inspect (a dock ⚙, an app slotWrapper's chip, or a timeline detail) —
258
+ // PUSH the inspector onto this canvas: devtools navigation is the stack
259
+ { event: "ui:click", ref: "inspect", do: [{ set: "collapsed", value: false }, { push: { action: "devtools.inspect", input: { instanceId: "@event.payload" } } }] },
260
+ // stack navigation: ← pops the top of that canvas (the shell change
261
+ // re-announces `devtools:state`, which re-reads the tree)
262
+ { event: "ui:click", ref: "canvas-back", do: [{ set: "popCanvas", value: "@event.payload" }, { call: "pop" }] },
263
+ // ✕ collapses to the ⚙ pill (the dock stays mounted); the pill expands.
264
+ { event: "ui:click", ref: "dock-close", do: [{ set: "collapsed", value: true }] },
265
+ { event: "ui:click", ref: "dock-expand", do: [{ set: "collapsed", value: false }, { call: "shellState" }] },
266
+ // re-read on the app's telemetry announcements (notify-then-pull): the tree
267
+ // on any shell change, the timeline on any recorded endpoint call.
268
+ { message: "devtools:state", do: [{ call: "shellState" }] },
269
+ { message: "devtools:timeline", do: [{ call: "timeline" }] }
270
+ ]
271
+ };
272
+
273
+ // src/devtools/inspect.ts
274
+ var inspectAction = {
275
+ id: "devtools.inspect",
276
+ title: "\u2699 {{$.instance.id}}",
277
+ input: {
278
+ type: "object",
279
+ properties: { instanceId: { type: "string", description: "The instance to inspect." } }
280
+ },
281
+ data: {
282
+ instanceId: "",
283
+ instance: { id: "", found: false }
284
+ },
285
+ layout: {
286
+ component: "Panel",
287
+ // ← back (pop one level) · ✕ close (clear the stack back to the dock)
288
+ props: { title: "\u2699 {{$.instance.id}}", backRef: "inspect-back", closeRef: "inspect-close" },
289
+ children: {
290
+ component: "Stack",
291
+ props: { gap: 8 },
292
+ children: [
293
+ { component: "Text", props: { size: "sm", color: "mute" }, children: "{{$.instance.id}} \xB7 {{$.instance.canvasId}} \xB7 {{$.instance.status}}" },
294
+ { if: { $eq: ["$.instance.found", false] }, then: { component: "Text", props: { size: "sm", color: "mute" }, children: "not mounted \u2014 it unmounted since this reference was recorded" } },
295
+ { component: "JsonTree", props: { value: "$.instance.data", label: "data" } },
296
+ { component: "JsonTree", props: { value: "$.instance.layout", label: "layout" } },
297
+ { component: "JsonTree", props: { value: "$.instance.issues", label: "audit" } }
298
+ ]
299
+ }
300
+ },
301
+ endpoints: {
302
+ describe: { fn: "devtools.describe", target: "instance" }
303
+ },
304
+ lifecycle: { mount: [{ call: "describe" }] },
305
+ triggers: [
306
+ // ← = back: pop one level (the previous inspector, or the dock)
307
+ { event: "ui:click", ref: "inspect-back", do: [{ pop: true }] },
308
+ // ✕ = close: clear the whole stack, back to a fresh dock at the root
309
+ { event: "ui:click", ref: "inspect-close", do: [{ resetTo: { action: "devtools.dock" } }] },
310
+ // an inspect from here goes DEEPER — another inspector on the stack
311
+ { event: "ui:click", ref: "inspect", do: [{ push: { action: "devtools.inspect", input: { instanceId: "@event.payload" } } }] }
312
+ ]
313
+ };
314
+
315
+ // src/devtools/fns.ts
316
+ var DEVTOOLS_CANVAS = "devtools";
317
+ var TIMELINE_CAP = 200;
318
+ var createDevtoolsFunctions = (config) => {
319
+ const { shell, definitions = {} } = config;
320
+ const timeline = [];
321
+ let seq = 0;
322
+ queueMicrotask(() => {
323
+ try {
324
+ const live = shell();
325
+ live.onStateChange(() => live.publish("devtools:state"));
326
+ live.onEndpoint((event) => {
327
+ if (event.canvasId === DEVTOOLS_CANVAS) return;
328
+ timeline.push({
329
+ seq: seq += 1,
330
+ name: event.name,
331
+ kind: event.kind,
332
+ ok: event.ok,
333
+ status: event.status,
334
+ ms: Math.round(event.ms),
335
+ canvasId: event.canvasId,
336
+ instanceId: event.instanceId,
337
+ action: live.getRuntime(event.instanceId)?.instance.definitionId ?? ""
338
+ });
339
+ if (timeline.length > TIMELINE_CAP) timeline.shift();
340
+ live.publish("devtools:timeline");
341
+ });
342
+ live.publish("devtools:state");
343
+ } catch {
344
+ }
345
+ });
346
+ return {
347
+ // The served "devtools on" control — mount/unmount the dock on its canvas.
348
+ // A settings toggle binds `$.devtools` and calls setEnabled; this is the
349
+ // old install `sync()`: on → push the dock if absent, off → clear the
350
+ // canvas. `enabled` reads current state so the toggle reflects reality.
351
+ "devtools.enabled": async () => {
352
+ try {
353
+ return shell().getCanvasState(DEVTOOLS_CANVAS).stack.length > 0;
354
+ } catch {
355
+ return false;
356
+ }
357
+ },
358
+ "devtools.setEnabled": async (data) => {
359
+ const on = data["devtools"] === true;
360
+ try {
361
+ const live = shell();
362
+ const occupied = live.getCanvasState(DEVTOOLS_CANVAS).stack.length > 0;
363
+ if (on && !occupied) live.push(DEVTOOLS_CANVAS, "devtools.dock");
364
+ else if (!on && occupied) live.clear(DEVTOOLS_CANVAS);
365
+ } catch {
366
+ }
367
+ return on;
368
+ },
369
+ "devtools.shellState": async () => snapshotShell(shell(), [DEVTOOLS_CANVAS]),
370
+ "devtools.audit": async () => {
371
+ const rows = auditCatalog(definitions);
372
+ return { rows, address: rows.reduce((total, row) => total + row.address, 0), definitions: rows.length };
373
+ },
374
+ // Stack navigation from the dock — pop the top of a canvas's stack. Only
375
+ // ever pops ABOVE the root (a canvas is never emptied from devtools).
376
+ "devtools.pop": async (data) => {
377
+ const canvasId = String(data["popCanvas"] ?? "");
378
+ try {
379
+ const live = shell();
380
+ if (live.getCanvasState(canvasId).stack.length > 1) live.pop(canvasId);
381
+ } catch {
382
+ }
383
+ return null;
384
+ },
385
+ // Newest first — the ring buffer is oldest→newest; the dock shows a feed.
386
+ "devtools.timeline": async () => ({ rows: timeline.slice().reverse(), count: timeline.length }),
387
+ "devtools.describe": async (data) => describeInstance(shell(), String(data["instanceId"] ?? "")) ?? { id: "unmounted", found: false, data: {}, layout: null, issues: [] }
388
+ };
389
+ };
390
+
391
+ // src/devtools/index.ts
392
+ var devtoolsActions = {
393
+ "devtools.dock": dockAction,
394
+ "devtools.inspect": inspectAction
395
+ };
396
+
397
+ export { DEVTOOLS_CANVAS, createDevtoolsFunctions, devtoolsActions, dockAction, inspectAction };
398
+ //# sourceMappingURL=index.js.map
399
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/devtools/dock.ts","../../src/devtools/inspect.ts","../../src/devtools/fns.ts","../../src/devtools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAoBA,IAAM,UAAA,GAAyB;AAAA,EAC7B,EAAA,EAAI,aAAA;AAAA,EACJ,IAAA,EAAM,EAAE,SAAA,EAAW,QAAA,EAAU,KAAK,aAAA,EAAe,KAAA,EAAO,EAAE,IAAA,EAAM,IAAA,EAAM,OAAA,EAAS,OAAA,EAAQ,EAAG,UAAU,iBAAA,EAAa;AAAA,EACjH,IAAA,EAAM;AAAA,IACN,SAAA,EAAW,OAAA;AAAA;AAAA;AAAA,IAGX,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,EAAY,UAAU,YAAA,EAAa;AAAA,IACnD,QAAA,EAAU;AAAA,MACR,SAAA,EAAW,OAAA;AAAA,MACX,KAAA,EAAO,EAAE,GAAA,EAAK,EAAA,EAAG;AAAA,MACjB,QAAA,EAAU;AAAA,QACR;AAAA,UACE,SAAA,EAAW,KAAA;AAAA,UACX,KAAA,EAAO,EAAE,GAAA,EAAK,CAAA,EAAE;AAAA,UAChB,QAAA,EAAU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AAS,KAAA,EAAM,CAAE,OAAA,EAAQ,EAAG,KAAA,EAAO,QAAA,CAAS,MAAA,EAAO,CAAA;AAAA,IAC7F,mBAAA,EAAqB,OAAO,IAAA,KAC1B,gBAAA,CAAiB,KAAA,IAAS,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,IAAK,EAAE,CAAC,KAAK,EAAE,EAAA,EAAI,WAAA,EAAa,KAAA,EAAO,KAAA,EAAO,IAAA,EAAM,EAAC,EAAG,MAAA,EAAQ,IAAA,EAAM,MAAA,EAAQ,EAAC;AAAE,GACvI;AACF;;;ACnHO,IAAM,eAAA,GAAoD;AAAA,EAC/D,eAAA,EAAiB,UAAA;AAAA,EACjB,kBAAA,EAAoB;AACtB","file":"index.js","sourcesContent":["import type { ActionDefinition } from '@action';\nimport type { LayoutNode } from '@layout';\n\n// ═══════════════════════════════════════════════════════════\n// The devtools dock — pure nova, the ROOT of the devtools canvas's stack. Its\n// data is UI state + the reflect fns' results; its layout uses only generic\n// primitives (Panel, Grid, Row, Stack, Text, Badge, Button, JsonTree), so it\n// renders in ANY terminal — React, DOM, console. Three views, all ACCORDIONS\n// (detail opens in place, under the row): the live shell (canvases + the\n// shell model itself), the classified audit, and the endpoint timeline. Row\n// toggles are pure data: `$if` in the `set` value flips the open cursor.\n// Every ⚙ PUSHES a `devtools.inspect` onto this canvas — the inspector is\n// stack navigation, not dock state (see inspect.ts). All computation is\n// `fn:` (nova/reflect + the recorded telemetry).\n//\n// The ✕ COLLAPSES (a data flag — the dock stays mounted, rendering as a ⚙\n// pill that expands back). Mount/unmount itself belongs to the app's master\n// switch (`devtools.setEnabled`, e.g. a settings toggle).\n// ═══════════════════════════════════════════════════════════\n\nconst dockLayout: LayoutNode = {\n if: '$.collapsed',\n then: { component: 'Button', ref: 'dock-expand', props: { size: 'sm', variant: 'ghost' }, children: '⚙ devtools' },\n else: {\n component: 'Panel',\n // the ✕ lives in the Panel HEADER (closeRef — the same prop-ref convention\n // as Table's rowRef); it collapses the dock to the pill\n props: { title: 'devtools', closeRef: 'dock-close' },\n children: {\n component: 'Stack',\n props: { gap: 10 },\n children: [\n {\n component: 'Row',\n props: { gap: 6 },\n children: [\n { component: 'Button', ref: 'tab-shell', props: { size: 'sm', variant: { $if: { $eq: ['$.tab', 'shell'] }, $then: 'primary', $else: 'ghost' } }, children: 'shell' },\n { component: 'Button', ref: 'tab-audit', props: { size: 'sm', variant: { $if: { $eq: ['$.tab', 'audit'] }, $then: 'primary', $else: 'ghost' } }, children: 'audit' },\n { component: 'Button', ref: 'tab-timeline', props: { size: 'sm', variant: { $if: { $eq: ['$.tab', 'timeline'] }, $then: 'primary', $else: 'ghost' } }, children: 'timeline' },\n ],\n },\n\n // ── shell: the live canvases + the shell model, as accordions ──\n {\n if: { $eq: ['$.tab', 'shell'] },\n then: {\n component: 'Stack',\n props: { gap: 4 },\n children: [\n { component: 'Text', props: { size: 'sm', color: 'mute' }, children: 'the live shell — a row opens its stack; ⚙ inspects an instance' },\n // the shell model itself (layout store, component registry)\n {\n component: 'Grid',\n ref: 'shell-open',\n props: { value: 'shell', hover: true, weights: [1, 'auto'], gap: 8, selected: { $eq: ['$.shellOpen', 'shell'] } },\n children: [\n { component: 'Text', props: { weight: 600, size: 'sm' }, children: 'shell model' },\n { component: 'Text', props: { size: 'xs', color: 'mute' }, children: 'layouts · components' },\n ],\n },\n {\n if: { $eq: ['$.shellOpen', 'shell'] },\n then: {\n component: 'Stack',\n props: { gap: 4, pad: 6 },\n children: [\n { component: 'JsonTree', props: { value: '$.shell.layouts', label: 'layout store' } },\n { component: 'JsonTree', props: { value: '$.shell.components', label: 'registry' } },\n ],\n },\n },\n // each canvas: a row that opens its stack in place\n {\n for: '$.shell.canvases',\n as: 'c',\n key: 'id',\n do: {\n component: 'Stack',\n props: { gap: 2 },\n children: [\n {\n component: 'Grid',\n ref: 'shell-open',\n props: { value: '$.c.id', hover: true, weights: [1, 'auto'], gap: 8, selected: { $eq: ['$.shellOpen', '$.c.id'] } },\n children: [\n { component: 'Text', props: { weight: 600, size: 'sm' }, children: '$.c.id' },\n { component: 'Text', props: { size: 'xs', color: 'mute' }, children: '{{$.c.depth}} mounted' },\n ],\n },\n {\n if: { $eq: ['$.shellOpen', '$.c.id'] },\n then: {\n component: 'Stack',\n props: { gap: 2, pad: 6 },\n children: [\n // stack navigation: pop the top (only shown when\n // there's something beneath it — never empties a canvas)\n {\n if: '$.c.items.1',\n then: { component: 'Button', ref: 'canvas-back', props: { size: 'sm', variant: 'ghost', value: '$.c.id' }, children: '← pop {{$.c.items.0.definitionId}}' },\n },\n {\n for: '$.c.items',\n as: 'i',\n key: 'instanceId',\n do: {\n component: 'Row',\n props: { gap: 8, align: 'center' },\n children: [\n { component: 'Button', ref: 'inspect', props: { size: 'sm', variant: 'ghost', value: '$.i.instanceId' }, children: '⚙ {{$.i.definitionId}}' },\n { component: 'Badge', children: '$.i.status' },\n // stack position, not status — 'top' receives events\n { if: '$.i.active', then: { component: 'Badge', children: 'top' } },\n { component: 'Text', props: { size: 'xs', color: 'mute', mono: true }, children: '$.i.instanceId' },\n ],\n },\n },\n ],\n },\n },\n ],\n },\n },\n ],\n },\n },\n\n // ── audit: static lint of the catalog; a row opens its findings in place ──\n {\n if: { $eq: ['$.tab', 'audit'] },\n then: {\n component: 'Stack',\n props: { gap: 4 },\n children: [\n { component: 'Text', props: { size: 'sm', color: 'mute' }, children: 'static lint of the action catalog — {{$.audit.address}} to address across {{$.audit.definitions}} actions' },\n {\n for: '$.audit.rows',\n as: 'r',\n key: 'id',\n do: {\n component: 'Stack',\n props: { gap: 2 },\n children: [\n {\n component: 'Grid',\n ref: 'audit-open',\n props: { value: '$.r.id', hover: true, weights: [1, 'auto'], gap: 8, selected: { $eq: ['$.auditOpen', '$.r.id'] } },\n children: [\n { component: 'Text', props: { weight: 600, size: 'sm' }, children: '$.r.id' },\n { component: 'Text', props: { size: 'sm' }, children: '$.r.address' },\n ],\n },\n {\n if: { $eq: ['$.auditOpen', '$.r.id'] },\n then: {\n component: 'Stack',\n props: { gap: 4, pad: 6 },\n children: {\n for: '$.r.issues',\n as: 'f',\n do: {\n component: 'Row',\n props: { gap: 8, align: 'start' },\n children: [\n { component: 'Badge', children: '$.f.kind' },\n {\n component: 'Stack',\n props: { gap: 1 },\n children: [\n { component: 'Text', props: { size: 'sm' }, children: '$.f.issue' },\n { if: '$.f.reason', then: { component: 'Text', props: { size: 'xs', color: 'mute' }, children: '$.f.reason' } },\n ],\n },\n ],\n },\n },\n },\n },\n ],\n },\n },\n ],\n },\n },\n\n // ── timeline: endpoint calls; a row opens its detail in place ──\n {\n if: { $eq: ['$.tab', 'timeline'] },\n then: {\n component: 'Stack',\n props: { gap: 4 },\n children: [\n { component: 'Text', props: { size: 'sm', color: 'mute' }, children: '{{$.timeline.count}} endpoint calls, newest first (fn = in-process, http = over the wire)' },\n {\n for: '$.timeline.rows',\n as: 't',\n key: 'seq',\n do: {\n component: 'Stack',\n props: { gap: 2 },\n children: [\n {\n component: 'Grid',\n ref: 'timeline-open',\n props: { value: '$.t.seq', hover: true, weights: [2, 2, 'auto', 'auto'], gap: 8, selected: { $eq: ['$.timelineOpen', '$.t.seq'] } },\n children: [\n { component: 'Text', props: { size: 'sm' }, children: '$.t.name' },\n { component: 'Text', props: { size: 'xs', color: 'mute' }, children: '$.t.action' },\n { component: 'Badge', children: '$.t.kind' },\n { component: 'Text', props: { size: 'xs', color: { $if: '$.t.ok', $then: 'mute', $else: 'red' } }, children: '{{$.t.ms}}ms' },\n ],\n },\n {\n if: { $eq: ['$.timelineOpen', '$.t.seq'] },\n then: {\n component: 'Stack',\n props: { gap: 2, pad: 6 },\n children: [\n { component: 'Text', props: { size: 'xs', color: 'mute' }, children: 'endpoint {{$.t.name}} · {{$.t.kind}} · ok {{$.t.ok}} · status {{$.t.status}} · {{$.t.ms}}ms' },\n { component: 'Text', props: { size: 'xs', color: 'mute' }, children: 'caller {{$.t.action}} on {{$.t.canvasId}}' },\n { component: 'Text', props: { size: 'xs', color: 'mute', mono: true }, children: '$.t.instanceId' },\n { component: 'Button', ref: 'inspect', props: { size: 'sm', variant: 'ghost', value: '$.t.instanceId' }, children: '⚙ inspect caller' },\n ],\n },\n },\n ],\n },\n },\n ],\n },\n },\n\n ],\n },\n },\n};\n\nexport const dockAction: ActionDefinition = {\n id: 'devtools.dock',\n title: 'devtools',\n data: {\n tab: 'shell',\n collapsed: false,\n popCanvas: '',\n shellOpen: '',\n auditOpen: '',\n timelineOpen: '',\n shell: { canvases: [], layouts: [], components: [] },\n audit: { rows: [], address: 0, definitions: 0 },\n timeline: { rows: [], count: 0 },\n },\n layout: dockLayout,\n endpoints: {\n shellState: { fn: 'devtools.shellState', target: 'shell' },\n audit: { fn: 'devtools.audit', target: 'audit' },\n timeline: { fn: 'devtools.timeline', target: 'timeline' },\n pop: { fn: 'devtools.pop' },\n },\n lifecycle: { mount: [{ call: 'shellState' }, { call: 'audit' }] },\n triggers: [\n { event: 'ui:click', ref: 'tab-shell', do: [{ set: 'tab', value: 'shell' }, { call: 'shellState' }] },\n { event: 'ui:click', ref: 'tab-audit', do: [{ set: 'tab', value: 'audit' }, { call: 'audit' }] },\n { event: 'ui:click', ref: 'tab-timeline', do: [{ set: 'tab', value: 'timeline' }, { call: 'timeline' }] },\n // the accordions: a row click toggles its detail open/closed in place —\n // pure data ($if in the set value, the firing event in scope)\n { event: 'ui:click', ref: 'shell-open', do: [{ set: 'shellOpen', value: { $if: { $eq: ['$.shellOpen', '@event.payload'] }, $then: '', $else: '@event.payload' } }] },\n { event: 'ui:click', ref: 'audit-open', do: [{ set: 'auditOpen', value: { $if: { $eq: ['$.auditOpen', '@event.payload'] }, $then: '', $else: '@event.payload' } }] },\n { event: 'ui:click', ref: 'timeline-open', do: [{ set: 'timelineOpen', value: { $if: { $eq: ['$.timelineOpen', '@event.payload'] }, $then: '', $else: '@event.payload' } }] },\n // inspect (a dock ⚙, an app slotWrapper's chip, or a timeline detail) —\n // PUSH the inspector onto this canvas: devtools navigation is the stack\n { event: 'ui:click', ref: 'inspect', do: [{ set: 'collapsed', value: false }, { push: { action: 'devtools.inspect', input: { instanceId: '@event.payload' } } }] },\n // stack navigation: ← pops the top of that canvas (the shell change\n // re-announces `devtools:state`, which re-reads the tree)\n { event: 'ui:click', ref: 'canvas-back', do: [{ set: 'popCanvas', value: '@event.payload' }, { call: 'pop' }] },\n // ✕ collapses to the ⚙ pill (the dock stays mounted); the pill expands.\n { event: 'ui:click', ref: 'dock-close', do: [{ set: 'collapsed', value: true }] },\n { event: 'ui:click', ref: 'dock-expand', do: [{ set: 'collapsed', value: false }, { call: 'shellState' }] },\n // re-read on the app's telemetry announcements (notify-then-pull): the tree\n // on any shell change, the timeline on any recorded endpoint call.\n { message: 'devtools:state', do: [{ call: 'shellState' }] },\n { message: 'devtools:timeline', do: [{ call: 'timeline' }] },\n ],\n};\n","import type { ActionDefinition } from '@action';\n\n// ═══════════════════════════════════════════════════════════\n// The inspector — its OWN action, pushed onto the devtools canvas over the\n// dock by any ⚙ (a dock row, an app slotWrapper's chip, a timeline detail).\n// Every inspect PUSHES, so the devtools canvas builds a real stack — inspect\n// from an inspector and you go deeper. Window chrome, standard semantics:\n// ← (header left) is BACK — pop one level; ✕ (header right) is CLOSE —\n// clear the whole stack back to a fresh dock (resetTo). Card-deck rendering\n// shows the top of the stack, so the navigation is the canvas itself.\n// ═══════════════════════════════════════════════════════════\n\nexport const inspectAction: ActionDefinition = {\n id: 'devtools.inspect',\n title: '⚙ {{$.instance.id}}',\n input: {\n type: 'object',\n properties: { instanceId: { type: 'string', description: 'The instance to inspect.' } },\n },\n data: {\n instanceId: '',\n instance: { id: '', found: false },\n },\n layout: {\n component: 'Panel',\n // ← back (pop one level) · ✕ close (clear the stack back to the dock)\n props: { title: '⚙ {{$.instance.id}}', backRef: 'inspect-back', closeRef: 'inspect-close' },\n children: {\n component: 'Stack',\n props: { gap: 8 },\n children: [\n { component: 'Text', props: { size: 'sm', color: 'mute' }, children: '{{$.instance.id}} · {{$.instance.canvasId}} · {{$.instance.status}}' },\n { if: { $eq: ['$.instance.found', false] }, then: { component: 'Text', props: { size: 'sm', color: 'mute' }, children: 'not mounted — it unmounted since this reference was recorded' } },\n { component: 'JsonTree', props: { value: '$.instance.data', label: 'data' } },\n { component: 'JsonTree', props: { value: '$.instance.layout', label: 'layout' } },\n { component: 'JsonTree', props: { value: '$.instance.issues', label: 'audit' } },\n ],\n },\n },\n endpoints: {\n describe: { fn: 'devtools.describe', target: 'instance' },\n },\n lifecycle: { mount: [{ call: 'describe' }] },\n triggers: [\n // ← = back: pop one level (the previous inspector, or the dock)\n { event: 'ui:click', ref: 'inspect-back', do: [{ pop: true }] },\n // ✕ = close: clear the whole stack, back to a fresh dock at the root\n { event: 'ui:click', ref: 'inspect-close', do: [{ resetTo: { action: 'devtools.dock' } }] },\n // an inspect from here goes DEEPER — another inspector on the stack\n { event: 'ui:click', ref: 'inspect', do: [{ push: { action: 'devtools.inspect', input: { instanceId: '@event.payload' } } }] },\n ],\n};\n","import type { EndpointEvent, FunctionHandler, ActionDefinition } from '@action';\nimport type { Shell } from '@shell';\nimport { snapshotShell, describeInstance, auditCatalog } from '../reflect';\n\n// ═══════════════════════════════════════════════════════════\n// The devtools functions — nova reading itself through the reflect API. Closed\n// over ONE session's shell, with NO module globals: each session builds its\n// own via its own `functions(session)` call, so multi-session is correct by\n// construction (the singleton that broke the old app-local devtools is gone).\n//\n// Every view feeds from telemetry: the shell tree is reflect (pull) announced\n// by state-change telemetry (`devtools:state`); the timeline IS the shell's\n// endpoint telemetry (`shell.onEndpoint`), recorded per session and served by\n// `devtools.timeline`.\n// ═══════════════════════════════════════════════════════════\n\n// The canvas the dock mounts on — excluded from its own shell snapshot AND from\n// the timeline (the dock's reflect calls are the observer, not the observed).\nexport const DEVTOOLS_CANVAS = 'devtools';\n\n// How many endpoint calls the per-session timeline retains (a ring buffer —\n// oldest drops off). Bounded so a long-lived session can't grow unbounded.\nconst TIMELINE_CAP = 200;\n\nexport type TimelineEntry = {\n seq: number;\n name: string;\n kind: 'fn' | 'http';\n ok: boolean;\n status: number;\n ms: number;\n canvasId: string;\n instanceId: string;\n // the caller's definition id, resolved at record time (the instance is\n // alive then; it may be unmounted by the time the timeline is read)\n action: string;\n};\n\nexport type DevtoolsConfig = {\n // LAZY — a host's session shell may not be built when `functions()` is\n // called; the thunk is only invoked inside a handler, at request time.\n shell: () => Shell;\n // the definitions to audit (the app's catalog); omit to skip the audit\n definitions?: Record<string, ActionDefinition> | readonly ActionDefinition[];\n};\n\nexport const createDevtoolsFunctions = (config: DevtoolsConfig): Record<string, FunctionHandler> => {\n const { shell, definitions = {} } = config;\n\n // Per-session timeline — the recorded endpoint telemetry. A closure, not a\n // module global: dies with the session.\n const timeline: TimelineEntry[] = [];\n let seq = 0;\n\n // This factory runs mid-build (the dock's mount fires before the shell is\n // assigned), so tap the telemetry on a microtask — by then the shell exists.\n // A shell state change announces `devtools:state`; an endpoint call is\n // recorded and announces `devtools:timeline`. The dock listens and re-reads\n // (notify-then-pull). The initial publish paints the tree once it's up.\n // A data-only app (no shell) has no devtools — the thunk throws, caught.\n queueMicrotask(() => {\n try {\n const live = shell();\n live.onStateChange(() => live.publish('devtools:state'));\n live.onEndpoint((event: EndpointEvent) => {\n // The dock's own reflect calls (shellState/audit/describe/timeline) run\n // on the devtools canvas — exclude them, else the timeline records its\n // own reading and never settles.\n if (event.canvasId === DEVTOOLS_CANVAS) return;\n timeline.push({\n seq: (seq += 1),\n name: event.name,\n kind: event.kind,\n ok: event.ok,\n status: event.status,\n ms: Math.round(event.ms),\n canvasId: event.canvasId,\n instanceId: event.instanceId,\n action: live.getRuntime(event.instanceId)?.instance.definitionId ?? '',\n });\n if (timeline.length > TIMELINE_CAP) timeline.shift();\n live.publish('devtools:timeline');\n });\n live.publish('devtools:state');\n } catch {\n /* no shell to reflect */\n }\n });\n\n return {\n // The served \"devtools on\" control — mount/unmount the dock on its canvas.\n // A settings toggle binds `$.devtools` and calls setEnabled; this is the\n // old install `sync()`: on → push the dock if absent, off → clear the\n // canvas. `enabled` reads current state so the toggle reflects reality.\n 'devtools.enabled': async () => {\n try {\n return shell().getCanvasState(DEVTOOLS_CANVAS).stack.length > 0;\n } catch {\n return false;\n }\n },\n 'devtools.setEnabled': async (data) => {\n const on = data['devtools'] === true;\n try {\n const live = shell();\n const occupied = live.getCanvasState(DEVTOOLS_CANVAS).stack.length > 0;\n if (on && !occupied) live.push(DEVTOOLS_CANVAS, 'devtools.dock');\n else if (!on && occupied) live.clear(DEVTOOLS_CANVAS);\n } catch {\n /* the principal doesn't hold the dock, or no shell — a no-op */\n }\n return on;\n },\n 'devtools.shellState': async () => snapshotShell(shell(), [DEVTOOLS_CANVAS]),\n 'devtools.audit': async () => {\n const rows = auditCatalog(definitions);\n return { rows, address: rows.reduce((total, row) => total + row.address, 0), definitions: rows.length };\n },\n // Stack navigation from the dock — pop the top of a canvas's stack. Only\n // ever pops ABOVE the root (a canvas is never emptied from devtools).\n 'devtools.pop': async (data) => {\n const canvasId = String(data['popCanvas'] ?? '');\n try {\n const live = shell();\n if (live.getCanvasState(canvasId).stack.length > 1) live.pop(canvasId);\n } catch {\n /* unknown canvas or no shell — a no-op */\n }\n return null;\n },\n // Newest first — the ring buffer is oldest→newest; the dock shows a feed.\n 'devtools.timeline': async () => ({ rows: timeline.slice().reverse(), count: timeline.length }),\n 'devtools.describe': async (data) =>\n describeInstance(shell(), String(data['instanceId'] ?? '')) ?? { id: 'unmounted', found: false, data: {}, layout: null, issues: [] },\n };\n};\n","// @niscorp/nova/devtools — nova's own devtools, as pure nova.\n//\n// The dock is an ActionDefinition (data + layout + triggers + fns over\n// nova/reflect) using only generic primitives, so it renders in any terminal.\n// An app opts in: grant `devtools.*`, add the DEVTOOLS_CANVAS + a frame slot,\n// and wire `createDevtoolsFunctions(session.shell)` into `functions(session)`.\n// Per-session-correct because reflect reads the session's own shell.\nimport type { ActionDefinition } from '@action';\nimport { dockAction } from './dock';\nimport { inspectAction } from './inspect';\n\nexport { createDevtoolsFunctions, DEVTOOLS_CANVAS, type DevtoolsConfig, type TimelineEntry } from './fns';\nexport { dockAction } from './dock';\nexport { inspectAction } from './inspect';\n\n// The actions to include in the app's catalog (and grant to a dev role — a\n// `devtools.*` glob covers both). The dock is mounted/unmounted on the\n// devtools canvas by `devtools.setEnabled` (an app's settings toggle drives\n// it); every ⚙ pushes an inspector over it — the canvas stack IS the\n// devtools navigation.\nexport const devtoolsActions: Record<string, ActionDefinition> = {\n 'devtools.dock': dockAction,\n 'devtools.inspect': inspectAction,\n};\n"]}
@@ -0,0 +1,123 @@
1
+ import { z } from 'zod';
2
+
3
+ type MutationData = Record<string, unknown>;
4
+ type MutationContext = {
5
+ /** Snapshot of initial data used by `reset`. Deep-cloned at runtime init. */
6
+ initial: MutationData;
7
+ /** When true, ops throw MutationError on invalid paths / type mismatches. */
8
+ strict: boolean;
9
+ };
10
+ type MutationOp<TMutation> = {
11
+ key: string;
12
+ schema: z.ZodType<TMutation>;
13
+ match?: (mutation: Record<string, unknown>) => boolean;
14
+ apply: (data: MutationData, mutation: TMutation, ctx: MutationContext) => MutationData;
15
+ };
16
+
17
+ declare const OPS: readonly [MutationOp<{
18
+ set: string;
19
+ value: unknown;
20
+ }>, MutationOp<{
21
+ set: string;
22
+ from: string;
23
+ }>, MutationOp<{
24
+ toggle: string;
25
+ }>, MutationOp<{
26
+ increment: string;
27
+ by?: number | undefined;
28
+ }>, MutationOp<{
29
+ decrement: string;
30
+ by?: number | undefined;
31
+ }>, MutationOp<{
32
+ push: string;
33
+ value?: unknown;
34
+ }>, MutationOp<{
35
+ pop: string;
36
+ }>, MutationOp<{
37
+ removeAt: string;
38
+ index: string | number;
39
+ }>, MutationOp<{
40
+ move: string;
41
+ from: string | number;
42
+ to: string | number;
43
+ }>, MutationOp<{
44
+ clear: string;
45
+ }>, MutationOp<{
46
+ reset: string;
47
+ }>];
48
+ type MutationOf<O> = O extends MutationOp<infer T> ? T : never;
49
+ type Mutation = MutationOf<(typeof OPS)[number]>;
50
+ declare const MutationSchema: z.ZodUnion<[z.ZodType<Mutation, unknown, z.core.$ZodTypeInternals<Mutation, unknown>>, z.ZodType<Mutation, unknown, z.core.$ZodTypeInternals<Mutation, unknown>>, ...z.ZodType<Mutation, unknown, z.core.$ZodTypeInternals<Mutation, unknown>>[]]>;
51
+
52
+ type Step = Mutation | Effect;
53
+ type CallEffect = {
54
+ call: string;
55
+ onSuccess?: Step[];
56
+ onError?: Step[];
57
+ };
58
+ type EmitEffect = {
59
+ emit: {
60
+ channel: string;
61
+ payload?: unknown;
62
+ };
63
+ };
64
+ type PushEffect = {
65
+ push: {
66
+ action: string;
67
+ canvas?: string;
68
+ input?: Record<string, unknown>;
69
+ with?: string[];
70
+ };
71
+ };
72
+ type PopEffect = {
73
+ pop: true;
74
+ };
75
+ type ReplaceEffect = {
76
+ replace: {
77
+ action: string;
78
+ canvas?: string;
79
+ input?: Record<string, unknown>;
80
+ with?: string[];
81
+ };
82
+ };
83
+ type PopToEffect = {
84
+ popTo: {
85
+ canvas?: string;
86
+ instance: string;
87
+ };
88
+ };
89
+ type ResetToEffect = {
90
+ resetTo: {
91
+ action: string;
92
+ canvas?: string;
93
+ input?: Record<string, unknown>;
94
+ with?: string[];
95
+ };
96
+ };
97
+ type RemoveInstanceEffect = {
98
+ removeInstance: {
99
+ canvas?: string;
100
+ instance: string;
101
+ };
102
+ };
103
+ type RemoveSelfEffect = {
104
+ removeSelf: true;
105
+ };
106
+ type ReconcileEffect = {
107
+ reconcile: {
108
+ to: string;
109
+ action: string;
110
+ input?: string;
111
+ canvas?: string;
112
+ own?: 'pushed' | 'canvas';
113
+ with?: string[];
114
+ };
115
+ };
116
+ type ReloadEffect = {
117
+ reload: true;
118
+ };
119
+ type Effect = CallEffect | EmitEffect | PushEffect | PopEffect | ReplaceEffect | PopToEffect | ResetToEffect | RemoveInstanceEffect | RemoveSelfEffect | ReconcileEffect | ReloadEffect;
120
+ declare const StepSchema: z.ZodType<Step>;
121
+ declare const EffectSchema: z.ZodType<Effect>;
122
+
123
+ export { type CallEffect as C, type Effect as E, type Mutation as M, type PopEffect as P, type ReplaceEffect as R, type Step as S, EffectSchema as a, type EmitEffect as b, MutationSchema as c, type PushEffect as d, StepSchema as e, type PopToEffect as f, type ResetToEffect as g, type RemoveInstanceEffect as h, type RemoveSelfEffect as i };