@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.
- package/ACTION_DOCS.md +552 -0
- package/ADAPTER.md +170 -0
- package/DESIGN.md +719 -0
- package/I18N_DOCS.md +224 -0
- package/LAYOUT_DOCS.md +505 -0
- package/LICENSE +202 -0
- package/REACT_DOCS.md +562 -0
- package/README.md +379 -0
- package/SHELL_DOCS.md +615 -0
- package/TERMINAL_DOCS.md +124 -0
- package/dist/adapters/dom/components/index.cjs +473 -0
- package/dist/adapters/dom/components/index.cjs.map +1 -0
- package/dist/adapters/dom/components/index.d.cts +48 -0
- package/dist/adapters/dom/components/index.d.ts +48 -0
- package/dist/adapters/dom/components/index.js +420 -0
- package/dist/adapters/dom/components/index.js.map +1 -0
- package/dist/adapters/dom/index.cjs +171 -0
- package/dist/adapters/dom/index.cjs.map +1 -0
- package/dist/adapters/dom/index.d.cts +29 -0
- package/dist/adapters/dom/index.d.ts +29 -0
- package/dist/adapters/dom/index.js +15 -0
- package/dist/adapters/dom/index.js.map +1 -0
- package/dist/adapters/dom/server.cjs +129 -0
- package/dist/adapters/dom/server.cjs.map +1 -0
- package/dist/adapters/dom/server.d.cts +15 -0
- package/dist/adapters/dom/server.d.ts +15 -0
- package/dist/adapters/dom/server.js +37 -0
- package/dist/adapters/dom/server.js.map +1 -0
- package/dist/adapters/ink/index.d.ts +75 -0
- package/dist/adapters/ink/index.js +472 -0
- package/dist/adapters/ink/index.js.map +1 -0
- package/dist/adapters/react/components/index.cjs +552 -0
- package/dist/adapters/react/components/index.cjs.map +1 -0
- package/dist/adapters/react/components/index.d.cts +30 -0
- package/dist/adapters/react/components/index.d.ts +30 -0
- package/dist/adapters/react/components/index.js +12 -0
- package/dist/adapters/react/components/index.js.map +1 -0
- package/dist/adapters/react/index.cjs +1526 -0
- package/dist/adapters/react/index.cjs.map +1 -0
- package/dist/adapters/react/index.d.cts +149 -0
- package/dist/adapters/react/index.d.ts +149 -0
- package/dist/adapters/react/index.js +12 -0
- package/dist/adapters/react/index.js.map +1 -0
- package/dist/adapters/tty/components/index.cjs +255 -0
- package/dist/adapters/tty/components/index.cjs.map +1 -0
- package/dist/adapters/tty/components/index.d.cts +40 -0
- package/dist/adapters/tty/components/index.d.ts +40 -0
- package/dist/adapters/tty/components/index.js +187 -0
- package/dist/adapters/tty/components/index.js.map +1 -0
- package/dist/adapters/tty/index.cjs +76 -0
- package/dist/adapters/tty/index.cjs.map +1 -0
- package/dist/adapters/tty/index.d.cts +47 -0
- package/dist/adapters/tty/index.d.ts +47 -0
- package/dist/adapters/tty/index.js +76 -0
- package/dist/adapters/tty/index.js.map +1 -0
- package/dist/adapters/vue/components/index.cjs +619 -0
- package/dist/adapters/vue/components/index.cjs.map +1 -0
- package/dist/adapters/vue/components/index.d.cts +224 -0
- package/dist/adapters/vue/components/index.d.ts +224 -0
- package/dist/adapters/vue/components/index.js +12 -0
- package/dist/adapters/vue/components/index.js.map +1 -0
- package/dist/adapters/vue/index.cjs +747 -0
- package/dist/adapters/vue/index.cjs.map +1 -0
- package/dist/adapters/vue/index.d.cts +98 -0
- package/dist/adapters/vue/index.d.ts +98 -0
- package/dist/adapters/vue/index.js +127 -0
- package/dist/adapters/vue/index.js.map +1 -0
- package/dist/agent/index.cjs +178 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +28 -0
- package/dist/agent/index.d.ts +28 -0
- package/dist/agent/index.js +30 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/chunk-2MNLEL45.js +47 -0
- package/dist/chunk-2MNLEL45.js.map +1 -0
- package/dist/chunk-3HGE3VWK.js +753 -0
- package/dist/chunk-3HGE3VWK.js.map +1 -0
- package/dist/chunk-4ZID7UX5.js +549 -0
- package/dist/chunk-4ZID7UX5.js.map +1 -0
- package/dist/chunk-7B3RDENH.js +1982 -0
- package/dist/chunk-7B3RDENH.js.map +1 -0
- package/dist/chunk-7S5BNPUS.js +54 -0
- package/dist/chunk-7S5BNPUS.js.map +1 -0
- package/dist/chunk-7TS3YVQR.js +114 -0
- package/dist/chunk-7TS3YVQR.js.map +1 -0
- package/dist/chunk-EG2RUXJN.js +266 -0
- package/dist/chunk-EG2RUXJN.js.map +1 -0
- package/dist/chunk-GVBBL36G.js +429 -0
- package/dist/chunk-GVBBL36G.js.map +1 -0
- package/dist/chunk-I5D2R5UA.js +753 -0
- package/dist/chunk-I5D2R5UA.js.map +1 -0
- package/dist/chunk-IGLCWXQ3.js +304 -0
- package/dist/chunk-IGLCWXQ3.js.map +1 -0
- package/dist/chunk-JI7ZRESP.js +64 -0
- package/dist/chunk-JI7ZRESP.js.map +1 -0
- package/dist/chunk-L5223LLX.js +31 -0
- package/dist/chunk-L5223LLX.js.map +1 -0
- package/dist/chunk-LA3BSEMX.js +1905 -0
- package/dist/chunk-LA3BSEMX.js.map +1 -0
- package/dist/chunk-OAMC6R6E.js +121 -0
- package/dist/chunk-OAMC6R6E.js.map +1 -0
- package/dist/chunk-OGD5CCMZ.js +62 -0
- package/dist/chunk-OGD5CCMZ.js.map +1 -0
- package/dist/chunk-PF4OJTYU.js +199 -0
- package/dist/chunk-PF4OJTYU.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-RBU5PHN4.js +8 -0
- package/dist/chunk-RBU5PHN4.js.map +1 -0
- package/dist/chunk-RQB4PRPV.js +285 -0
- package/dist/chunk-RQB4PRPV.js.map +1 -0
- package/dist/chunk-V32EVEVM.js +464 -0
- package/dist/chunk-V32EVEVM.js.map +1 -0
- package/dist/chunk-ZITHBBF3.js +85 -0
- package/dist/chunk-ZITHBBF3.js.map +1 -0
- package/dist/devtools/index.cjs +1088 -0
- package/dist/devtools/index.cjs.map +1 -0
- package/dist/devtools/index.d.cts +33 -0
- package/dist/devtools/index.d.ts +33 -0
- package/dist/devtools/index.js +399 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/effects-CndX9K7D.d.cts +123 -0
- package/dist/effects-CndX9K7D.d.ts +123 -0
- package/dist/endpoints-CD-6Jl-H.d.ts +36 -0
- package/dist/endpoints-Dem-EdRx.d.cts +36 -0
- package/dist/i18n/index.cjs +299 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +28 -0
- package/dist/i18n/index.d.ts +28 -0
- package/dist/i18n/index.js +180 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-CNfzSBe2.d.ts +93 -0
- package/dist/index-caZoXSwr.d.cts +93 -0
- package/dist/index.cjs +3723 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +144 -0
- package/dist/index.d.ts +144 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.cjs +635 -0
- package/dist/migrations/index.cjs.map +1 -0
- package/dist/migrations/index.d.cts +97 -0
- package/dist/migrations/index.d.ts +97 -0
- package/dist/migrations/index.js +50 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/palette-CP0wd3bE.d.ts +15 -0
- package/dist/palette-lm0bU9i5.d.cts +15 -0
- package/dist/primitive-props-BH_EJWIe.d.cts +100 -0
- package/dist/primitive-props-BH_EJWIe.d.ts +100 -0
- package/dist/primitive-props-CGoJvmcH.d.cts +100 -0
- package/dist/primitive-props-CGoJvmcH.d.ts +100 -0
- package/dist/reflect/index.cjs +998 -0
- package/dist/reflect/index.cjs.map +1 -0
- package/dist/reflect/index.d.cts +125 -0
- package/dist/reflect/index.d.ts +125 -0
- package/dist/reflect/index.js +13 -0
- package/dist/reflect/index.js.map +1 -0
- package/dist/schemas-DPdeFlCT.d.cts +38 -0
- package/dist/schemas-DPdeFlCT.d.ts +38 -0
- package/dist/schemas-pMyyuXV7.d.cts +47 -0
- package/dist/schemas-pMyyuXV7.d.ts +47 -0
- package/dist/types-Boh9ckdG.d.ts +194 -0
- package/dist/types-Brc7v_pS.d.ts +198 -0
- package/dist/types-ByNSwtUV.d.cts +20 -0
- package/dist/types-DdltMfw7.d.ts +20 -0
- package/dist/types-De0KpxfI.d.cts +198 -0
- package/dist/types-DhHL0twe.d.ts +20 -0
- package/dist/types-Dv6JLmgo.d.cts +194 -0
- package/dist/types-Q80YtOQt.d.cts +20 -0
- package/package.json +237 -0
|
@@ -0,0 +1,1088 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
|
|
5
|
+
// src/devtools/dock.ts
|
|
6
|
+
var dockLayout = {
|
|
7
|
+
if: "$.collapsed",
|
|
8
|
+
then: { component: "Button", ref: "dock-expand", props: { size: "sm", variant: "ghost" }, children: "\u2699 devtools" },
|
|
9
|
+
else: {
|
|
10
|
+
component: "Panel",
|
|
11
|
+
// the ✕ lives in the Panel HEADER (closeRef — the same prop-ref convention
|
|
12
|
+
// as Table's rowRef); it collapses the dock to the pill
|
|
13
|
+
props: { title: "devtools", closeRef: "dock-close" },
|
|
14
|
+
children: {
|
|
15
|
+
component: "Stack",
|
|
16
|
+
props: { gap: 10 },
|
|
17
|
+
children: [
|
|
18
|
+
{
|
|
19
|
+
component: "Row",
|
|
20
|
+
props: { gap: 6 },
|
|
21
|
+
children: [
|
|
22
|
+
{ component: "Button", ref: "tab-shell", props: { size: "sm", variant: { $if: { $eq: ["$.tab", "shell"] }, $then: "primary", $else: "ghost" } }, children: "shell" },
|
|
23
|
+
{ component: "Button", ref: "tab-audit", props: { size: "sm", variant: { $if: { $eq: ["$.tab", "audit"] }, $then: "primary", $else: "ghost" } }, children: "audit" },
|
|
24
|
+
{ component: "Button", ref: "tab-timeline", props: { size: "sm", variant: { $if: { $eq: ["$.tab", "timeline"] }, $then: "primary", $else: "ghost" } }, children: "timeline" }
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
// ── shell: the live canvases + the shell model, as accordions ──
|
|
28
|
+
{
|
|
29
|
+
if: { $eq: ["$.tab", "shell"] },
|
|
30
|
+
then: {
|
|
31
|
+
component: "Stack",
|
|
32
|
+
props: { gap: 4 },
|
|
33
|
+
children: [
|
|
34
|
+
{ component: "Text", props: { size: "sm", color: "mute" }, children: "the live shell \u2014 a row opens its stack; \u2699 inspects an instance" },
|
|
35
|
+
// the shell model itself (layout store, component registry)
|
|
36
|
+
{
|
|
37
|
+
component: "Grid",
|
|
38
|
+
ref: "shell-open",
|
|
39
|
+
props: { value: "shell", hover: true, weights: [1, "auto"], gap: 8, selected: { $eq: ["$.shellOpen", "shell"] } },
|
|
40
|
+
children: [
|
|
41
|
+
{ component: "Text", props: { weight: 600, size: "sm" }, children: "shell model" },
|
|
42
|
+
{ component: "Text", props: { size: "xs", color: "mute" }, children: "layouts \xB7 components" }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
if: { $eq: ["$.shellOpen", "shell"] },
|
|
47
|
+
then: {
|
|
48
|
+
component: "Stack",
|
|
49
|
+
props: { gap: 4, pad: 6 },
|
|
50
|
+
children: [
|
|
51
|
+
{ component: "JsonTree", props: { value: "$.shell.layouts", label: "layout store" } },
|
|
52
|
+
{ component: "JsonTree", props: { value: "$.shell.components", label: "registry" } }
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
// each canvas: a row that opens its stack in place
|
|
57
|
+
{
|
|
58
|
+
for: "$.shell.canvases",
|
|
59
|
+
as: "c",
|
|
60
|
+
key: "id",
|
|
61
|
+
do: {
|
|
62
|
+
component: "Stack",
|
|
63
|
+
props: { gap: 2 },
|
|
64
|
+
children: [
|
|
65
|
+
{
|
|
66
|
+
component: "Grid",
|
|
67
|
+
ref: "shell-open",
|
|
68
|
+
props: { value: "$.c.id", hover: true, weights: [1, "auto"], gap: 8, selected: { $eq: ["$.shellOpen", "$.c.id"] } },
|
|
69
|
+
children: [
|
|
70
|
+
{ component: "Text", props: { weight: 600, size: "sm" }, children: "$.c.id" },
|
|
71
|
+
{ component: "Text", props: { size: "xs", color: "mute" }, children: "{{$.c.depth}} mounted" }
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
if: { $eq: ["$.shellOpen", "$.c.id"] },
|
|
76
|
+
then: {
|
|
77
|
+
component: "Stack",
|
|
78
|
+
props: { gap: 2, pad: 6 },
|
|
79
|
+
children: [
|
|
80
|
+
// stack navigation: pop the top (only shown when
|
|
81
|
+
// there's something beneath it — never empties a canvas)
|
|
82
|
+
{
|
|
83
|
+
if: "$.c.items.1",
|
|
84
|
+
then: { component: "Button", ref: "canvas-back", props: { size: "sm", variant: "ghost", value: "$.c.id" }, children: "\u2190 pop {{$.c.items.0.definitionId}}" }
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
for: "$.c.items",
|
|
88
|
+
as: "i",
|
|
89
|
+
key: "instanceId",
|
|
90
|
+
do: {
|
|
91
|
+
component: "Row",
|
|
92
|
+
props: { gap: 8, align: "center" },
|
|
93
|
+
children: [
|
|
94
|
+
{ component: "Button", ref: "inspect", props: { size: "sm", variant: "ghost", value: "$.i.instanceId" }, children: "\u2699 {{$.i.definitionId}}" },
|
|
95
|
+
{ component: "Badge", children: "$.i.status" },
|
|
96
|
+
// stack position, not status — 'top' receives events
|
|
97
|
+
{ if: "$.i.active", then: { component: "Badge", children: "top" } },
|
|
98
|
+
{ component: "Text", props: { size: "xs", color: "mute", mono: true }, children: "$.i.instanceId" }
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
// ── audit: static lint of the catalog; a row opens its findings in place ──
|
|
112
|
+
{
|
|
113
|
+
if: { $eq: ["$.tab", "audit"] },
|
|
114
|
+
then: {
|
|
115
|
+
component: "Stack",
|
|
116
|
+
props: { gap: 4 },
|
|
117
|
+
children: [
|
|
118
|
+
{ component: "Text", props: { size: "sm", color: "mute" }, children: "static lint of the action catalog \u2014 {{$.audit.address}} to address across {{$.audit.definitions}} actions" },
|
|
119
|
+
{
|
|
120
|
+
for: "$.audit.rows",
|
|
121
|
+
as: "r",
|
|
122
|
+
key: "id",
|
|
123
|
+
do: {
|
|
124
|
+
component: "Stack",
|
|
125
|
+
props: { gap: 2 },
|
|
126
|
+
children: [
|
|
127
|
+
{
|
|
128
|
+
component: "Grid",
|
|
129
|
+
ref: "audit-open",
|
|
130
|
+
props: { value: "$.r.id", hover: true, weights: [1, "auto"], gap: 8, selected: { $eq: ["$.auditOpen", "$.r.id"] } },
|
|
131
|
+
children: [
|
|
132
|
+
{ component: "Text", props: { weight: 600, size: "sm" }, children: "$.r.id" },
|
|
133
|
+
{ component: "Text", props: { size: "sm" }, children: "$.r.address" }
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
if: { $eq: ["$.auditOpen", "$.r.id"] },
|
|
138
|
+
then: {
|
|
139
|
+
component: "Stack",
|
|
140
|
+
props: { gap: 4, pad: 6 },
|
|
141
|
+
children: {
|
|
142
|
+
for: "$.r.issues",
|
|
143
|
+
as: "f",
|
|
144
|
+
do: {
|
|
145
|
+
component: "Row",
|
|
146
|
+
props: { gap: 8, align: "start" },
|
|
147
|
+
children: [
|
|
148
|
+
{ component: "Badge", children: "$.f.kind" },
|
|
149
|
+
{
|
|
150
|
+
component: "Stack",
|
|
151
|
+
props: { gap: 1 },
|
|
152
|
+
children: [
|
|
153
|
+
{ component: "Text", props: { size: "sm" }, children: "$.f.issue" },
|
|
154
|
+
{ if: "$.f.reason", then: { component: "Text", props: { size: "xs", color: "mute" }, children: "$.f.reason" } }
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
// ── timeline: endpoint calls; a row opens its detail in place ──
|
|
169
|
+
{
|
|
170
|
+
if: { $eq: ["$.tab", "timeline"] },
|
|
171
|
+
then: {
|
|
172
|
+
component: "Stack",
|
|
173
|
+
props: { gap: 4 },
|
|
174
|
+
children: [
|
|
175
|
+
{ component: "Text", props: { size: "sm", color: "mute" }, children: "{{$.timeline.count}} endpoint calls, newest first (fn = in-process, http = over the wire)" },
|
|
176
|
+
{
|
|
177
|
+
for: "$.timeline.rows",
|
|
178
|
+
as: "t",
|
|
179
|
+
key: "seq",
|
|
180
|
+
do: {
|
|
181
|
+
component: "Stack",
|
|
182
|
+
props: { gap: 2 },
|
|
183
|
+
children: [
|
|
184
|
+
{
|
|
185
|
+
component: "Grid",
|
|
186
|
+
ref: "timeline-open",
|
|
187
|
+
props: { value: "$.t.seq", hover: true, weights: [2, 2, "auto", "auto"], gap: 8, selected: { $eq: ["$.timelineOpen", "$.t.seq"] } },
|
|
188
|
+
children: [
|
|
189
|
+
{ component: "Text", props: { size: "sm" }, children: "$.t.name" },
|
|
190
|
+
{ component: "Text", props: { size: "xs", color: "mute" }, children: "$.t.action" },
|
|
191
|
+
{ component: "Badge", children: "$.t.kind" },
|
|
192
|
+
{ component: "Text", props: { size: "xs", color: { $if: "$.t.ok", $then: "mute", $else: "red" } }, children: "{{$.t.ms}}ms" }
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
if: { $eq: ["$.timelineOpen", "$.t.seq"] },
|
|
197
|
+
then: {
|
|
198
|
+
component: "Stack",
|
|
199
|
+
props: { gap: 2, pad: 6 },
|
|
200
|
+
children: [
|
|
201
|
+
{ 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" },
|
|
202
|
+
{ component: "Text", props: { size: "xs", color: "mute" }, children: "caller {{$.t.action}} on {{$.t.canvasId}}" },
|
|
203
|
+
{ component: "Text", props: { size: "xs", color: "mute", mono: true }, children: "$.t.instanceId" },
|
|
204
|
+
{ component: "Button", ref: "inspect", props: { size: "sm", variant: "ghost", value: "$.t.instanceId" }, children: "\u2699 inspect caller" }
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
var dockAction = {
|
|
219
|
+
id: "devtools.dock",
|
|
220
|
+
title: "devtools",
|
|
221
|
+
data: {
|
|
222
|
+
tab: "shell",
|
|
223
|
+
collapsed: false,
|
|
224
|
+
popCanvas: "",
|
|
225
|
+
shellOpen: "",
|
|
226
|
+
auditOpen: "",
|
|
227
|
+
timelineOpen: "",
|
|
228
|
+
shell: { canvases: [], layouts: [], components: [] },
|
|
229
|
+
audit: { rows: [], address: 0, definitions: 0 },
|
|
230
|
+
timeline: { rows: [], count: 0 }
|
|
231
|
+
},
|
|
232
|
+
layout: dockLayout,
|
|
233
|
+
endpoints: {
|
|
234
|
+
shellState: { fn: "devtools.shellState", target: "shell" },
|
|
235
|
+
audit: { fn: "devtools.audit", target: "audit" },
|
|
236
|
+
timeline: { fn: "devtools.timeline", target: "timeline" },
|
|
237
|
+
pop: { fn: "devtools.pop" }
|
|
238
|
+
},
|
|
239
|
+
lifecycle: { mount: [{ call: "shellState" }, { call: "audit" }] },
|
|
240
|
+
triggers: [
|
|
241
|
+
{ event: "ui:click", ref: "tab-shell", do: [{ set: "tab", value: "shell" }, { call: "shellState" }] },
|
|
242
|
+
{ event: "ui:click", ref: "tab-audit", do: [{ set: "tab", value: "audit" }, { call: "audit" }] },
|
|
243
|
+
{ event: "ui:click", ref: "tab-timeline", do: [{ set: "tab", value: "timeline" }, { call: "timeline" }] },
|
|
244
|
+
// the accordions: a row click toggles its detail open/closed in place —
|
|
245
|
+
// pure data ($if in the set value, the firing event in scope)
|
|
246
|
+
{ event: "ui:click", ref: "shell-open", do: [{ set: "shellOpen", value: { $if: { $eq: ["$.shellOpen", "@event.payload"] }, $then: "", $else: "@event.payload" } }] },
|
|
247
|
+
{ event: "ui:click", ref: "audit-open", do: [{ set: "auditOpen", value: { $if: { $eq: ["$.auditOpen", "@event.payload"] }, $then: "", $else: "@event.payload" } }] },
|
|
248
|
+
{ event: "ui:click", ref: "timeline-open", do: [{ set: "timelineOpen", value: { $if: { $eq: ["$.timelineOpen", "@event.payload"] }, $then: "", $else: "@event.payload" } }] },
|
|
249
|
+
// inspect (a dock ⚙, an app slotWrapper's chip, or a timeline detail) —
|
|
250
|
+
// PUSH the inspector onto this canvas: devtools navigation is the stack
|
|
251
|
+
{ event: "ui:click", ref: "inspect", do: [{ set: "collapsed", value: false }, { push: { action: "devtools.inspect", input: { instanceId: "@event.payload" } } }] },
|
|
252
|
+
// stack navigation: ← pops the top of that canvas (the shell change
|
|
253
|
+
// re-announces `devtools:state`, which re-reads the tree)
|
|
254
|
+
{ event: "ui:click", ref: "canvas-back", do: [{ set: "popCanvas", value: "@event.payload" }, { call: "pop" }] },
|
|
255
|
+
// ✕ collapses to the ⚙ pill (the dock stays mounted); the pill expands.
|
|
256
|
+
{ event: "ui:click", ref: "dock-close", do: [{ set: "collapsed", value: true }] },
|
|
257
|
+
{ event: "ui:click", ref: "dock-expand", do: [{ set: "collapsed", value: false }, { call: "shellState" }] },
|
|
258
|
+
// re-read on the app's telemetry announcements (notify-then-pull): the tree
|
|
259
|
+
// on any shell change, the timeline on any recorded endpoint call.
|
|
260
|
+
{ message: "devtools:state", do: [{ call: "shellState" }] },
|
|
261
|
+
{ message: "devtools:timeline", do: [{ call: "timeline" }] }
|
|
262
|
+
]
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// src/devtools/inspect.ts
|
|
266
|
+
var inspectAction = {
|
|
267
|
+
id: "devtools.inspect",
|
|
268
|
+
title: "\u2699 {{$.instance.id}}",
|
|
269
|
+
input: {
|
|
270
|
+
type: "object",
|
|
271
|
+
properties: { instanceId: { type: "string", description: "The instance to inspect." } }
|
|
272
|
+
},
|
|
273
|
+
data: {
|
|
274
|
+
instanceId: "",
|
|
275
|
+
instance: { id: "", found: false }
|
|
276
|
+
},
|
|
277
|
+
layout: {
|
|
278
|
+
component: "Panel",
|
|
279
|
+
// ← back (pop one level) · ✕ close (clear the stack back to the dock)
|
|
280
|
+
props: { title: "\u2699 {{$.instance.id}}", backRef: "inspect-back", closeRef: "inspect-close" },
|
|
281
|
+
children: {
|
|
282
|
+
component: "Stack",
|
|
283
|
+
props: { gap: 8 },
|
|
284
|
+
children: [
|
|
285
|
+
{ component: "Text", props: { size: "sm", color: "mute" }, children: "{{$.instance.id}} \xB7 {{$.instance.canvasId}} \xB7 {{$.instance.status}}" },
|
|
286
|
+
{ if: { $eq: ["$.instance.found", false] }, then: { component: "Text", props: { size: "sm", color: "mute" }, children: "not mounted \u2014 it unmounted since this reference was recorded" } },
|
|
287
|
+
{ component: "JsonTree", props: { value: "$.instance.data", label: "data" } },
|
|
288
|
+
{ component: "JsonTree", props: { value: "$.instance.layout", label: "layout" } },
|
|
289
|
+
{ component: "JsonTree", props: { value: "$.instance.issues", label: "audit" } }
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
endpoints: {
|
|
294
|
+
describe: { fn: "devtools.describe", target: "instance" }
|
|
295
|
+
},
|
|
296
|
+
lifecycle: { mount: [{ call: "describe" }] },
|
|
297
|
+
triggers: [
|
|
298
|
+
// ← = back: pop one level (the previous inspector, or the dock)
|
|
299
|
+
{ event: "ui:click", ref: "inspect-back", do: [{ pop: true }] },
|
|
300
|
+
// ✕ = close: clear the whole stack, back to a fresh dock at the root
|
|
301
|
+
{ event: "ui:click", ref: "inspect-close", do: [{ resetTo: { action: "devtools.dock" } }] },
|
|
302
|
+
// an inspect from here goes DEEPER — another inspector on the stack
|
|
303
|
+
{ event: "ui:click", ref: "inspect", do: [{ push: { action: "devtools.inspect", input: { instanceId: "@event.payload" } } }] }
|
|
304
|
+
]
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
// src/reflect/walk.ts
|
|
308
|
+
var isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
309
|
+
var walkNodes = (value, visit) => {
|
|
310
|
+
if (Array.isArray(value)) {
|
|
311
|
+
for (const item of value) walkNodes(item, visit);
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (!isRecord(value)) return;
|
|
315
|
+
visit(value);
|
|
316
|
+
for (const inner of Object.values(value)) walkNodes(inner, visit);
|
|
317
|
+
};
|
|
318
|
+
var refsOf = (value) => {
|
|
319
|
+
const out = /* @__PURE__ */ new Set();
|
|
320
|
+
walkNodes(value, (record) => {
|
|
321
|
+
if (record["component"] === void 0 || !isRecord(record["props"])) return;
|
|
322
|
+
walkNodes(record["props"], (props) => {
|
|
323
|
+
for (const [key, propValue] of Object.entries(props)) {
|
|
324
|
+
if ((key === "ref" || key.endsWith("Ref")) && typeof propValue === "string" && propValue !== "") out.add(propValue);
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
return out;
|
|
329
|
+
};
|
|
330
|
+
var loopVarsOf = (value) => {
|
|
331
|
+
const out = /* @__PURE__ */ new Set();
|
|
332
|
+
walkNodes(value, (record) => {
|
|
333
|
+
if (typeof record["as"] === "string" && record["for"] !== void 0) out.add(record["as"]);
|
|
334
|
+
});
|
|
335
|
+
return out;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// src/shared/common.ts
|
|
339
|
+
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
340
|
+
var isArray = (value) => Array.isArray(value);
|
|
341
|
+
var hasKey = (obj, key) => isObject(obj) && key in obj;
|
|
342
|
+
|
|
343
|
+
// src/shared/bindings/paths.ts
|
|
344
|
+
var splitPath = (path) => {
|
|
345
|
+
if (path.length === 0) return [];
|
|
346
|
+
return path.split(".");
|
|
347
|
+
};
|
|
348
|
+
var isIndex = (segment) => /^\d+$/.test(segment);
|
|
349
|
+
var cloneContainer = (value, nextSegment) => {
|
|
350
|
+
if (isArray(value)) return value.slice();
|
|
351
|
+
if (isObject(value)) return { ...value };
|
|
352
|
+
if (nextSegment !== void 0 && isIndex(nextSegment)) return [];
|
|
353
|
+
return {};
|
|
354
|
+
};
|
|
355
|
+
var writeSegment = (container, segment, value) => {
|
|
356
|
+
if (isArray(container)) {
|
|
357
|
+
if (isIndex(segment)) {
|
|
358
|
+
const index = Number.parseInt(segment, 10);
|
|
359
|
+
container[index] = value;
|
|
360
|
+
}
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
container[segment] = value;
|
|
364
|
+
};
|
|
365
|
+
var readSegment = (container, segment) => {
|
|
366
|
+
if (isArray(container)) {
|
|
367
|
+
if (!isIndex(segment)) return void 0;
|
|
368
|
+
const index = Number.parseInt(segment, 10);
|
|
369
|
+
return container[index];
|
|
370
|
+
}
|
|
371
|
+
return container[segment];
|
|
372
|
+
};
|
|
373
|
+
var getPath = (data, path) => {
|
|
374
|
+
const segments = splitPath(path);
|
|
375
|
+
let current = data;
|
|
376
|
+
for (const segment of segments) {
|
|
377
|
+
if (current === void 0 || current === null) return void 0;
|
|
378
|
+
if (isArray(current)) {
|
|
379
|
+
if (isIndex(segment)) {
|
|
380
|
+
const index = Number.parseInt(segment, 10);
|
|
381
|
+
current = current[index];
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
if (segment === "length") {
|
|
385
|
+
current = current.length;
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
return void 0;
|
|
389
|
+
}
|
|
390
|
+
if (isObject(current)) {
|
|
391
|
+
if (segment in current) {
|
|
392
|
+
current = current[segment];
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
return void 0;
|
|
396
|
+
}
|
|
397
|
+
return void 0;
|
|
398
|
+
}
|
|
399
|
+
return current;
|
|
400
|
+
};
|
|
401
|
+
var setPath = (data, path, value) => {
|
|
402
|
+
const segments = splitPath(path);
|
|
403
|
+
if (segments.length === 0) return value;
|
|
404
|
+
const root = cloneContainer(data, segments[0]);
|
|
405
|
+
let parent = root;
|
|
406
|
+
for (let i = 0; i < segments.length - 1; i += 1) {
|
|
407
|
+
const segment = segments[i];
|
|
408
|
+
const nextSegment = segments[i + 1];
|
|
409
|
+
if (segment === void 0) continue;
|
|
410
|
+
const existing = readSegment(parent, segment);
|
|
411
|
+
const cloned = cloneContainer(existing, nextSegment);
|
|
412
|
+
writeSegment(parent, segment, cloned);
|
|
413
|
+
parent = cloned;
|
|
414
|
+
}
|
|
415
|
+
const last = segments[segments.length - 1];
|
|
416
|
+
if (last !== void 0) writeSegment(parent, last, value);
|
|
417
|
+
return root;
|
|
418
|
+
};
|
|
419
|
+
var deletePath = (data, path) => {
|
|
420
|
+
const segments = splitPath(path);
|
|
421
|
+
if (segments.length === 0) return void 0;
|
|
422
|
+
const root = cloneContainer(data, segments[0]);
|
|
423
|
+
let parent = root;
|
|
424
|
+
for (let i = 0; i < segments.length - 1; i += 1) {
|
|
425
|
+
const segment = segments[i];
|
|
426
|
+
const nextSegment = segments[i + 1];
|
|
427
|
+
if (segment === void 0) continue;
|
|
428
|
+
const existing = readSegment(parent, segment);
|
|
429
|
+
if (existing === void 0 || existing === null) return root;
|
|
430
|
+
const cloned = cloneContainer(existing, nextSegment);
|
|
431
|
+
writeSegment(parent, segment, cloned);
|
|
432
|
+
parent = cloned;
|
|
433
|
+
}
|
|
434
|
+
const last = segments[segments.length - 1];
|
|
435
|
+
if (last === void 0) return root;
|
|
436
|
+
if (isArray(parent)) {
|
|
437
|
+
if (isIndex(last)) {
|
|
438
|
+
const index = Number.parseInt(last, 10);
|
|
439
|
+
parent.splice(index, 1);
|
|
440
|
+
}
|
|
441
|
+
} else {
|
|
442
|
+
delete parent[last];
|
|
443
|
+
}
|
|
444
|
+
return root;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
// src/action/mutations/ops/set.ts
|
|
448
|
+
var SetByValueSchema = zod.z.object({
|
|
449
|
+
set: zod.z.string().describe('Data path to write to, e.g. "user.name" or "items.0.title".'),
|
|
450
|
+
value: zod.z.unknown().describe("Literal value to write at the path.")
|
|
451
|
+
}).strict().describe("Set a field at a path to a literal value.");
|
|
452
|
+
var SetByFromSchema = zod.z.object({
|
|
453
|
+
set: zod.z.string().describe("Data path to write to."),
|
|
454
|
+
from: zod.z.string().describe("Data path (or template path) to read the value from.")
|
|
455
|
+
}).strict().describe("Set a field at a path by copying from another path.");
|
|
456
|
+
var setValueOp = {
|
|
457
|
+
key: "set",
|
|
458
|
+
schema: SetByValueSchema,
|
|
459
|
+
match: (mutation) => hasKey(mutation, "set") && hasKey(mutation, "value"),
|
|
460
|
+
apply: (data, mutation) => {
|
|
461
|
+
const next = setPath(data, mutation.set, mutation.value);
|
|
462
|
+
return isObject(next) ? next : data;
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
var setFromOp = {
|
|
466
|
+
key: "set",
|
|
467
|
+
schema: SetByFromSchema,
|
|
468
|
+
match: (mutation) => hasKey(mutation, "set") && hasKey(mutation, "from"),
|
|
469
|
+
apply: (data, mutation) => {
|
|
470
|
+
const value = getPath(data, mutation.from);
|
|
471
|
+
const next = setPath(data, mutation.set, value);
|
|
472
|
+
return isObject(next) ? next : data;
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
var ToggleSchema = zod.z.object({
|
|
476
|
+
toggle: zod.z.string().describe("Boolean data path to flip.")
|
|
477
|
+
}).strict().describe("Flip a boolean at the given path.");
|
|
478
|
+
var toggleOp = {
|
|
479
|
+
key: "toggle",
|
|
480
|
+
schema: ToggleSchema,
|
|
481
|
+
apply: (data, mutation) => {
|
|
482
|
+
const current = getPath(data, mutation.toggle);
|
|
483
|
+
const flipped = !(current === true);
|
|
484
|
+
const next = setPath(data, mutation.toggle, flipped);
|
|
485
|
+
return isObject(next) ? next : data;
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
var IncrementSchema = zod.z.object({
|
|
489
|
+
increment: zod.z.string().describe("Numeric data path to increment."),
|
|
490
|
+
by: zod.z.number().optional().describe("Amount to increment by; defaults to 1.")
|
|
491
|
+
}).strict().describe("Increment a numeric field.");
|
|
492
|
+
var incrementOp = {
|
|
493
|
+
key: "increment",
|
|
494
|
+
schema: IncrementSchema,
|
|
495
|
+
apply: (data, mutation) => {
|
|
496
|
+
const current = getPath(data, mutation.increment);
|
|
497
|
+
const base = typeof current === "number" ? current : 0;
|
|
498
|
+
const by = mutation.by ?? 1;
|
|
499
|
+
const next = setPath(data, mutation.increment, base + by);
|
|
500
|
+
return isObject(next) ? next : data;
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
var DecrementSchema = zod.z.object({
|
|
504
|
+
decrement: zod.z.string().describe("Numeric data path to decrement."),
|
|
505
|
+
by: zod.z.number().optional().describe("Amount to decrement by; defaults to 1.")
|
|
506
|
+
}).strict().describe("Decrement a numeric field.");
|
|
507
|
+
var decrementOp = {
|
|
508
|
+
key: "decrement",
|
|
509
|
+
schema: DecrementSchema,
|
|
510
|
+
apply: (data, mutation) => {
|
|
511
|
+
const current = getPath(data, mutation.decrement);
|
|
512
|
+
const base = typeof current === "number" ? current : 0;
|
|
513
|
+
const by = mutation.by ?? 1;
|
|
514
|
+
const next = setPath(data, mutation.decrement, base - by);
|
|
515
|
+
return isObject(next) ? next : data;
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
// src/shared/errors.ts
|
|
520
|
+
var ErrorCodes = {
|
|
521
|
+
mutation: "MUTATION_ERROR"};
|
|
522
|
+
var NovaError = class extends Error {
|
|
523
|
+
code;
|
|
524
|
+
context;
|
|
525
|
+
constructor(code, message, context, options) {
|
|
526
|
+
super(message, options);
|
|
527
|
+
this.name = "NovaError";
|
|
528
|
+
this.code = code;
|
|
529
|
+
this.context = context;
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
var MutationError = class extends NovaError {
|
|
533
|
+
constructor(message, context, options) {
|
|
534
|
+
super(ErrorCodes.mutation, message, context, options);
|
|
535
|
+
this.name = "MutationError";
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
// src/action/mutations/ops/push.ts
|
|
540
|
+
var PushSchema = zod.z.object({
|
|
541
|
+
push: zod.z.string().describe("Array data path to append to."),
|
|
542
|
+
value: zod.z.unknown().optional().describe("Value to append.")
|
|
543
|
+
}).strict().describe("Append a value to an array field.");
|
|
544
|
+
var pushOp = {
|
|
545
|
+
key: "push",
|
|
546
|
+
schema: PushSchema,
|
|
547
|
+
// Guard against the PushEffect navigation effect whose `push` is an object.
|
|
548
|
+
match: (mutation) => typeof mutation.push === "string",
|
|
549
|
+
apply: (data, mutation, ctx) => {
|
|
550
|
+
const current = getPath(data, mutation.push);
|
|
551
|
+
if (current !== void 0 && !isArray(current)) {
|
|
552
|
+
if (ctx.strict) {
|
|
553
|
+
throw new MutationError(
|
|
554
|
+
`push: path "${mutation.push}" is not an array`,
|
|
555
|
+
{ op: "push", path: mutation.push, reason: "wrong-type" }
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
return data;
|
|
559
|
+
}
|
|
560
|
+
if (current === void 0 && ctx.strict) {
|
|
561
|
+
throw new MutationError(
|
|
562
|
+
`push: path "${mutation.push}" does not exist`,
|
|
563
|
+
{ op: "push", path: mutation.push, reason: "missing" }
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
const arr = isArray(current) ? current.slice() : [];
|
|
567
|
+
arr.push(mutation.value);
|
|
568
|
+
const next = setPath(data, mutation.push, arr);
|
|
569
|
+
return isObject(next) ? next : data;
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
var PopSchema = zod.z.object({
|
|
573
|
+
pop: zod.z.string().describe("Array data path to remove the last element from.")
|
|
574
|
+
}).strict().describe("Remove the last element from an array field.");
|
|
575
|
+
var popOp = {
|
|
576
|
+
key: "pop",
|
|
577
|
+
schema: PopSchema,
|
|
578
|
+
// Guard against the PopEffect whose `pop` is the literal `true`.
|
|
579
|
+
match: (mutation) => typeof mutation.pop === "string",
|
|
580
|
+
apply: (data, mutation, ctx) => {
|
|
581
|
+
const current = getPath(data, mutation.pop);
|
|
582
|
+
if (!isArray(current)) {
|
|
583
|
+
if (ctx.strict) {
|
|
584
|
+
throw new MutationError(
|
|
585
|
+
`pop: path "${mutation.pop}" ${current === void 0 ? "does not exist" : "is not an array"}`,
|
|
586
|
+
{ op: "pop", path: mutation.pop, reason: current === void 0 ? "missing" : "wrong-type" }
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
return data;
|
|
590
|
+
}
|
|
591
|
+
const arr = current.slice();
|
|
592
|
+
arr.pop();
|
|
593
|
+
const next = setPath(data, mutation.pop, arr);
|
|
594
|
+
return isObject(next) ? next : data;
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
var RemoveAtSchema = zod.z.object({
|
|
598
|
+
removeAt: zod.z.string().describe("Array data path to remove an element from."),
|
|
599
|
+
index: zod.z.union([zod.z.number().int(), zod.z.string()]).describe('Index to remove. A string is a template (e.g. "{{@event.payload}}") resolved before applying.')
|
|
600
|
+
}).strict().describe("Remove an element at a specific index of an array field.");
|
|
601
|
+
var removeAtOp = {
|
|
602
|
+
key: "removeAt",
|
|
603
|
+
schema: RemoveAtSchema,
|
|
604
|
+
apply: (data, mutation, ctx) => {
|
|
605
|
+
const current = getPath(data, mutation.removeAt);
|
|
606
|
+
if (!isArray(current)) {
|
|
607
|
+
if (ctx.strict) {
|
|
608
|
+
throw new MutationError(
|
|
609
|
+
`removeAt: path "${mutation.removeAt}" ${current === void 0 ? "does not exist" : "is not an array"}`,
|
|
610
|
+
{
|
|
611
|
+
op: "removeAt",
|
|
612
|
+
path: mutation.removeAt,
|
|
613
|
+
reason: current === void 0 ? "missing" : "wrong-type"
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
return data;
|
|
618
|
+
}
|
|
619
|
+
const index = Number(mutation.index);
|
|
620
|
+
if (!Number.isInteger(index)) return data;
|
|
621
|
+
const arr = current.slice();
|
|
622
|
+
arr.splice(index, 1);
|
|
623
|
+
const next = setPath(data, mutation.removeAt, arr);
|
|
624
|
+
return isObject(next) ? next : data;
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
var MoveSchema = zod.z.object({
|
|
628
|
+
move: zod.z.string().describe("Array data path to reorder within."),
|
|
629
|
+
from: zod.z.union([zod.z.number().int(), zod.z.string()]).describe('Index to move. A string is a template (e.g. "{{@event.payload}}") resolved before applying.'),
|
|
630
|
+
to: zod.z.union([zod.z.number().int(), zod.z.string()]).describe("Destination index. A string is a template resolved before applying.")
|
|
631
|
+
}).strict().describe("Move an array element from one index to another.");
|
|
632
|
+
var moveOp = {
|
|
633
|
+
key: "move",
|
|
634
|
+
schema: MoveSchema,
|
|
635
|
+
apply: (data, mutation, ctx) => {
|
|
636
|
+
const current = getPath(data, mutation.move);
|
|
637
|
+
if (!isArray(current)) {
|
|
638
|
+
if (ctx.strict) {
|
|
639
|
+
throw new MutationError(
|
|
640
|
+
`move: path "${mutation.move}" ${current === void 0 ? "does not exist" : "is not an array"}`,
|
|
641
|
+
{
|
|
642
|
+
op: "move",
|
|
643
|
+
path: mutation.move,
|
|
644
|
+
reason: current === void 0 ? "missing" : "wrong-type"
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
}
|
|
648
|
+
return data;
|
|
649
|
+
}
|
|
650
|
+
const from = Number(mutation.from);
|
|
651
|
+
const to = Number(mutation.to);
|
|
652
|
+
if (!Number.isInteger(from) || !Number.isInteger(to)) return data;
|
|
653
|
+
if (from < 0 || from >= current.length) return data;
|
|
654
|
+
const arr = current.slice();
|
|
655
|
+
const [item] = arr.splice(from, 1);
|
|
656
|
+
arr.splice(Math.max(0, Math.min(to, arr.length)), 0, item);
|
|
657
|
+
const next = setPath(data, mutation.move, arr);
|
|
658
|
+
return isObject(next) ? next : data;
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
var ClearSchema = zod.z.object({
|
|
662
|
+
clear: zod.z.string().describe("Array or object data path to clear.")
|
|
663
|
+
}).strict().describe("Clear an array or object field.");
|
|
664
|
+
var clearOp = {
|
|
665
|
+
key: "clear",
|
|
666
|
+
schema: ClearSchema,
|
|
667
|
+
apply: (data, mutation, ctx) => {
|
|
668
|
+
const current = getPath(data, mutation.clear);
|
|
669
|
+
if (isArray(current)) {
|
|
670
|
+
const next2 = setPath(data, mutation.clear, []);
|
|
671
|
+
return isObject(next2) ? next2 : data;
|
|
672
|
+
}
|
|
673
|
+
if (isObject(current)) {
|
|
674
|
+
const next2 = setPath(data, mutation.clear, {});
|
|
675
|
+
return isObject(next2) ? next2 : data;
|
|
676
|
+
}
|
|
677
|
+
if (ctx.strict) {
|
|
678
|
+
throw new MutationError(
|
|
679
|
+
`clear: path "${mutation.clear}" ${current === void 0 ? "does not exist" : "is not an array or object"}`,
|
|
680
|
+
{
|
|
681
|
+
op: "clear",
|
|
682
|
+
path: mutation.clear,
|
|
683
|
+
reason: current === void 0 ? "missing" : "wrong-type"
|
|
684
|
+
}
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
const next = deletePath(data, mutation.clear);
|
|
688
|
+
return isObject(next) ? next : data;
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
var ResetSchema = zod.z.object({
|
|
692
|
+
reset: zod.z.string().describe("Data path to reset to its initial (definition.data) value.")
|
|
693
|
+
}).strict().describe("Reset a field to its initial value from the action definition.");
|
|
694
|
+
var resetOp = {
|
|
695
|
+
key: "reset",
|
|
696
|
+
schema: ResetSchema,
|
|
697
|
+
apply: (data, mutation, ctx) => {
|
|
698
|
+
const initialValue = getPath(ctx.initial, mutation.reset);
|
|
699
|
+
const next = setPath(data, mutation.reset, initialValue);
|
|
700
|
+
return isObject(next) ? next : data;
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
// src/action/mutations/ops/index.ts
|
|
705
|
+
var OPS = [
|
|
706
|
+
setValueOp,
|
|
707
|
+
setFromOp,
|
|
708
|
+
toggleOp,
|
|
709
|
+
incrementOp,
|
|
710
|
+
decrementOp,
|
|
711
|
+
pushOp,
|
|
712
|
+
popOp,
|
|
713
|
+
removeAtOp,
|
|
714
|
+
moveOp,
|
|
715
|
+
clearOp,
|
|
716
|
+
resetOp
|
|
717
|
+
];
|
|
718
|
+
zod.z.union(
|
|
719
|
+
OPS.map((op) => op.schema)
|
|
720
|
+
).describe("A single immutable mutation applied to the action data.");
|
|
721
|
+
|
|
722
|
+
// src/agent/affordances.ts
|
|
723
|
+
var KEY_PATTERN = /\$\.([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
724
|
+
var VAR_PATTERN = /\$([A-Za-z_][A-Za-z0-9_]*)\./g;
|
|
725
|
+
var collectInteractive = (layout) => {
|
|
726
|
+
const refs = [];
|
|
727
|
+
const models = [];
|
|
728
|
+
const boundKeys = /* @__PURE__ */ new Set();
|
|
729
|
+
const suspects = /* @__PURE__ */ new Set();
|
|
730
|
+
let componentCount = 0;
|
|
731
|
+
const scanString = (value, scope) => {
|
|
732
|
+
for (const match of value.matchAll(KEY_PATTERN)) {
|
|
733
|
+
const key = match[1];
|
|
734
|
+
if (key !== void 0) boundKeys.add(key);
|
|
735
|
+
}
|
|
736
|
+
for (const match of value.matchAll(VAR_PATTERN)) {
|
|
737
|
+
const name = match[1];
|
|
738
|
+
if (name !== void 0 && !scope.has(name)) suspects.add(`$${name}.`);
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
const walk = (node, scope) => {
|
|
742
|
+
if (typeof node === "string") return scanString(node, scope);
|
|
743
|
+
if (Array.isArray(node)) {
|
|
744
|
+
for (const child of node) walk(child, scope);
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
if (node === null || typeof node !== "object") return;
|
|
748
|
+
const record = node;
|
|
749
|
+
const loopVar = record["for"] !== void 0 && typeof record["as"] === "string" ? record["as"] : void 0;
|
|
750
|
+
const childScope = loopVar !== void 0 ? /* @__PURE__ */ new Set([...scope, loopVar]) : scope;
|
|
751
|
+
const component = typeof record["component"] === "string" ? record["component"] : void 0;
|
|
752
|
+
if (component !== void 0) {
|
|
753
|
+
componentCount += 1;
|
|
754
|
+
if (typeof record["ref"] === "string" && record["ref"].length > 0) {
|
|
755
|
+
refs.push({ ref: record["ref"], component, via: "ref" });
|
|
756
|
+
}
|
|
757
|
+
if (typeof record["model"] === "string" && record["model"].length > 0) {
|
|
758
|
+
models.push({ path: record["model"], component });
|
|
759
|
+
}
|
|
760
|
+
const props = record["props"];
|
|
761
|
+
if (props !== null && typeof props === "object" && !Array.isArray(props)) {
|
|
762
|
+
for (const [key, value] of Object.entries(props)) {
|
|
763
|
+
if (key.endsWith("Ref") && typeof value === "string" && value.length > 0) {
|
|
764
|
+
refs.push({ ref: value, component, via: key });
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
for (const value of Object.values(record)) walk(value, childScope);
|
|
770
|
+
};
|
|
771
|
+
walk(layout, /* @__PURE__ */ new Set());
|
|
772
|
+
return {
|
|
773
|
+
refs,
|
|
774
|
+
models,
|
|
775
|
+
boundKeys: [...boundKeys].sort(),
|
|
776
|
+
suspectBindings: [...suspects].sort(),
|
|
777
|
+
componentCount
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
// src/action/grammar.ts
|
|
782
|
+
var MUTATION_KEYS = [...new Set(OPS.map((op) => op.key))];
|
|
783
|
+
OPS.map((op) => op.match ?? ((step) => op.key in step));
|
|
784
|
+
|
|
785
|
+
// src/action/audit.ts
|
|
786
|
+
var collectChannels = (definition) => {
|
|
787
|
+
const emits = /* @__PURE__ */ new Set();
|
|
788
|
+
const listens = /* @__PURE__ */ new Set();
|
|
789
|
+
const walkSteps = (list) => {
|
|
790
|
+
if (!Array.isArray(list)) return;
|
|
791
|
+
for (const step of list) {
|
|
792
|
+
if (!isRecord2(step)) continue;
|
|
793
|
+
const emit = step["emit"];
|
|
794
|
+
if (isRecord2(emit) && typeof emit["channel"] === "string") emits.add(emit["channel"]);
|
|
795
|
+
if (typeof step["call"] === "string") {
|
|
796
|
+
walkSteps(step["onSuccess"]);
|
|
797
|
+
walkSteps(step["onError"]);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
for (const trigger of definition.triggers ?? []) {
|
|
802
|
+
if (typeof trigger.message === "string") listens.add(trigger.message);
|
|
803
|
+
walkSteps(trigger.do);
|
|
804
|
+
}
|
|
805
|
+
for (const hook of Object.values(definition.lifecycle ?? {})) walkSteps(hook);
|
|
806
|
+
return { emits: [...emits].sort(), listens: [...listens].sort() };
|
|
807
|
+
};
|
|
808
|
+
var firstSegment = (path) => {
|
|
809
|
+
const segment = path.split(".")[0];
|
|
810
|
+
return segment === void 0 || segment.length === 0 ? path : segment;
|
|
811
|
+
};
|
|
812
|
+
var isRecord2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
813
|
+
var navTargetOf = (step) => {
|
|
814
|
+
for (const key of ["push", "replace", "resetTo"]) {
|
|
815
|
+
const value = step[key];
|
|
816
|
+
if (isRecord2(value) && typeof value["action"] === "string") {
|
|
817
|
+
const input = value["input"];
|
|
818
|
+
return { action: value["action"], ...isRecord2(input) ? { input } : {} };
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return void 0;
|
|
822
|
+
};
|
|
823
|
+
var auditAction = (definition, options) => {
|
|
824
|
+
const issues = [];
|
|
825
|
+
const dataKeys = new Set(Object.keys(definition.data ?? {}));
|
|
826
|
+
const endpointNames = new Set(Object.keys(definition.endpoints ?? {}));
|
|
827
|
+
const steps = [];
|
|
828
|
+
const pushSteps = (list) => {
|
|
829
|
+
if (!Array.isArray(list)) return;
|
|
830
|
+
for (const step of list) {
|
|
831
|
+
if (!isRecord2(step)) continue;
|
|
832
|
+
steps.push(step);
|
|
833
|
+
if (typeof step["call"] === "string") {
|
|
834
|
+
pushSteps(step["onSuccess"]);
|
|
835
|
+
pushSteps(step["onError"]);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
for (const trigger of definition.triggers ?? []) pushSteps(trigger.do);
|
|
840
|
+
for (const hook of Object.values(definition.lifecycle ?? {})) pushSteps(hook);
|
|
841
|
+
for (const step of steps) {
|
|
842
|
+
const call = step["call"];
|
|
843
|
+
if (typeof call === "string" && !endpointNames.has(call)) {
|
|
844
|
+
issues.push(`step calls endpoint "${call}" but endpoints has no "${call}"`);
|
|
845
|
+
}
|
|
846
|
+
for (const key of MUTATION_KEYS) {
|
|
847
|
+
const path = step[key];
|
|
848
|
+
if (typeof path === "string" && path.length > 0 && !dataKeys.has(firstSegment(path))) {
|
|
849
|
+
issues.push(`step "${key}: ${path}" writes a key with no default in data`);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
const nav = navTargetOf(step);
|
|
853
|
+
if (nav !== void 0 && options?.catalog !== void 0) {
|
|
854
|
+
const entry = options.catalog.find((candidate) => candidate.id === nav.action);
|
|
855
|
+
if (entry === void 0 && nav.action !== definition.id) {
|
|
856
|
+
issues.push(`step pushes action "${nav.action}" which is not in the catalog`);
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
const properties = entry?.input?.["properties"];
|
|
860
|
+
if (nav.input !== void 0 && isRecord2(properties)) {
|
|
861
|
+
for (const key of Object.keys(nav.input)) {
|
|
862
|
+
if (!(key in properties)) {
|
|
863
|
+
issues.push(`push to "${nav.action}" seeds input key "${key}" which is not in its input contract`);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
for (const [name, endpoint] of Object.entries(definition.endpoints ?? {})) {
|
|
870
|
+
for (const field of ["target", "errorTarget"]) {
|
|
871
|
+
const target = endpoint[field];
|
|
872
|
+
if (typeof target === "string" && target.length > 0 && !dataKeys.has(firstSegment(target))) {
|
|
873
|
+
issues.push(`endpoint "${name}" ${field} "${target}" has no default in data`);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
if (options?.channels !== void 0) {
|
|
878
|
+
const known = new Set(options.channels);
|
|
879
|
+
const usage = collectChannels(definition);
|
|
880
|
+
for (const channel of usage.listens) {
|
|
881
|
+
if (!known.has(channel) && !usage.emits.includes(channel)) {
|
|
882
|
+
issues.push(`trigger listens on channel "${channel}" which nothing is known to emit`);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
for (const channel of usage.emits) {
|
|
886
|
+
if (!known.has(channel) && !usage.listens.includes(channel)) {
|
|
887
|
+
issues.push(`step emits channel "${channel}" which nothing is known to listen on`);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
if (definition.layout !== void 0 && typeof definition.layout !== "string") {
|
|
892
|
+
const surface = collectInteractive(definition.layout);
|
|
893
|
+
for (const key of surface.boundKeys) {
|
|
894
|
+
if (!dataKeys.has(key)) {
|
|
895
|
+
issues.push(`layout binds "$.${key}" but data has no "${key}" default`);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
for (const suspect of surface.suspectBindings) {
|
|
899
|
+
issues.push(
|
|
900
|
+
`layout binding "${suspect}\u2026" is malformed \u2014 the data root is "$." ("$.key"), and "$name." is only legal for a loop variable declared by an enclosing for/as`
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
const layoutRefs = new Set(surface.refs.map((entry) => entry.ref));
|
|
904
|
+
const triggerRefs = new Set(
|
|
905
|
+
(definition.triggers ?? []).map((trigger) => trigger.ref).filter((ref) => typeof ref === "string")
|
|
906
|
+
);
|
|
907
|
+
for (const ref of layoutRefs) {
|
|
908
|
+
if (!triggerRefs.has(ref)) {
|
|
909
|
+
issues.push(`layout ref "${ref}" has no trigger \u2014 dead chrome`);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
for (const ref of triggerRefs) {
|
|
913
|
+
if (!layoutRefs.has(ref)) {
|
|
914
|
+
issues.push(`trigger listens on ref "${ref}" but no layout node carries it`);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return { ok: issues.length === 0, issues };
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
// src/reflect/audit.ts
|
|
922
|
+
var classifyAudit = (issue, definition) => {
|
|
923
|
+
const layout = typeof definition.layout === "object" ? definition.layout : void 0;
|
|
924
|
+
const bind = issue.match(/binds "\$\.([\w.]+)"/);
|
|
925
|
+
if (bind !== null) {
|
|
926
|
+
const root = (bind[1] ?? "").split(".")[0] ?? "";
|
|
927
|
+
if (root === "index" || root === "items") {
|
|
928
|
+
return { kind: "info", tag: "loop scope", reason: `\`${root}\` is a renderer-reserved loop variable` };
|
|
929
|
+
}
|
|
930
|
+
if (loopVarsOf(layout).has(root)) {
|
|
931
|
+
return { kind: "info", tag: "loop var", reason: `\`${root}\` is a loop \`as:\` variable \u2014 in scope at runtime` };
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
const ref = issue.match(/ref "([^"]+)"/);
|
|
935
|
+
if (ref !== null && issue.includes("listens") && refsOf(layout).has(ref[1] ?? "")) {
|
|
936
|
+
return { kind: "info", tag: "prop ref", reason: "dispatched by a component from a props value (e.g. Table rowRef / cell.ref)" };
|
|
937
|
+
}
|
|
938
|
+
if (issue.includes("{{")) {
|
|
939
|
+
return { kind: "info", tag: "template", reason: "target resolves from data at runtime \u2014 statically unknowable" };
|
|
940
|
+
}
|
|
941
|
+
return { kind: "address" };
|
|
942
|
+
};
|
|
943
|
+
var auditCatalog = (definitions) => {
|
|
944
|
+
const defs = Array.isArray(definitions) ? [...definitions] : Object.values(definitions);
|
|
945
|
+
const catalog = defs.map((definition) => ({ id: definition.id, ...definition.input !== void 0 ? { input: definition.input } : {} }));
|
|
946
|
+
const channels = [
|
|
947
|
+
...new Set(
|
|
948
|
+
defs.flatMap((definition) => {
|
|
949
|
+
const usage = collectChannels(definition);
|
|
950
|
+
return [...usage.emits, ...usage.listens];
|
|
951
|
+
})
|
|
952
|
+
)
|
|
953
|
+
];
|
|
954
|
+
return defs.map((definition) => {
|
|
955
|
+
const issues = auditAction(definition, { catalog, channels }).issues.map((issue) => ({ issue, ...classifyAudit(issue, definition) }));
|
|
956
|
+
issues.sort((a, b) => Number(a.kind === "info") - Number(b.kind === "info"));
|
|
957
|
+
return { id: definition.id, address: issues.filter((issue) => issue.kind === "address").length, issues };
|
|
958
|
+
}).filter((row) => row.issues.length > 0).sort((a, b) => b.address - a.address);
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
// src/reflect/shell.ts
|
|
962
|
+
var snapshotShell = (shell, exclude = []) => {
|
|
963
|
+
const state = shell.getState();
|
|
964
|
+
const canvases = Object.values(state.canvases).filter((canvas) => !exclude.includes(canvas.id)).map((canvas) => ({
|
|
965
|
+
id: canvas.id,
|
|
966
|
+
depth: canvas.stack.length,
|
|
967
|
+
items: [...canvas.stack].reverse().map((instance) => ({
|
|
968
|
+
definitionId: instance.definitionId,
|
|
969
|
+
instanceId: instance.id,
|
|
970
|
+
status: instance.status,
|
|
971
|
+
active: instance.id === canvas.active?.id
|
|
972
|
+
}))
|
|
973
|
+
}));
|
|
974
|
+
return { canvases, layouts: shell.layoutStore.list(), components: shell.registry.list() };
|
|
975
|
+
};
|
|
976
|
+
var describeInstance = (shell, instanceId) => {
|
|
977
|
+
const runtime = shell.getRuntime(instanceId);
|
|
978
|
+
if (runtime === void 0) return void 0;
|
|
979
|
+
const definition = runtime.definition;
|
|
980
|
+
const layout = definition.layout;
|
|
981
|
+
const layoutNode = typeof layout === "string" ? shell.layoutStore.get(layout) : layout;
|
|
982
|
+
const issues = auditAction(definition).issues.map((issue) => ({ issue, ...classifyAudit(issue, definition) }));
|
|
983
|
+
return {
|
|
984
|
+
id: definition.id,
|
|
985
|
+
instanceId,
|
|
986
|
+
canvasId: runtime.instance.canvasId,
|
|
987
|
+
status: runtime.instance.status,
|
|
988
|
+
title: definition.title ?? "",
|
|
989
|
+
data: runtime.getData(),
|
|
990
|
+
endpoints: Object.entries(definition.endpoints ?? {}).map(([name, config]) => ({ name, config })),
|
|
991
|
+
triggers: definition.triggers ?? [],
|
|
992
|
+
lifecycle: definition.lifecycle ?? {},
|
|
993
|
+
layoutKind: typeof layout === "string" ? "store" : "inline",
|
|
994
|
+
layout: layoutNode,
|
|
995
|
+
input: definition.input,
|
|
996
|
+
issues
|
|
997
|
+
};
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
// src/devtools/fns.ts
|
|
1001
|
+
var DEVTOOLS_CANVAS = "devtools";
|
|
1002
|
+
var TIMELINE_CAP = 200;
|
|
1003
|
+
var createDevtoolsFunctions = (config) => {
|
|
1004
|
+
const { shell, definitions = {} } = config;
|
|
1005
|
+
const timeline = [];
|
|
1006
|
+
let seq = 0;
|
|
1007
|
+
queueMicrotask(() => {
|
|
1008
|
+
try {
|
|
1009
|
+
const live = shell();
|
|
1010
|
+
live.onStateChange(() => live.publish("devtools:state"));
|
|
1011
|
+
live.onEndpoint((event) => {
|
|
1012
|
+
if (event.canvasId === DEVTOOLS_CANVAS) return;
|
|
1013
|
+
timeline.push({
|
|
1014
|
+
seq: seq += 1,
|
|
1015
|
+
name: event.name,
|
|
1016
|
+
kind: event.kind,
|
|
1017
|
+
ok: event.ok,
|
|
1018
|
+
status: event.status,
|
|
1019
|
+
ms: Math.round(event.ms),
|
|
1020
|
+
canvasId: event.canvasId,
|
|
1021
|
+
instanceId: event.instanceId,
|
|
1022
|
+
action: live.getRuntime(event.instanceId)?.instance.definitionId ?? ""
|
|
1023
|
+
});
|
|
1024
|
+
if (timeline.length > TIMELINE_CAP) timeline.shift();
|
|
1025
|
+
live.publish("devtools:timeline");
|
|
1026
|
+
});
|
|
1027
|
+
live.publish("devtools:state");
|
|
1028
|
+
} catch {
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
return {
|
|
1032
|
+
// The served "devtools on" control — mount/unmount the dock on its canvas.
|
|
1033
|
+
// A settings toggle binds `$.devtools` and calls setEnabled; this is the
|
|
1034
|
+
// old install `sync()`: on → push the dock if absent, off → clear the
|
|
1035
|
+
// canvas. `enabled` reads current state so the toggle reflects reality.
|
|
1036
|
+
"devtools.enabled": async () => {
|
|
1037
|
+
try {
|
|
1038
|
+
return shell().getCanvasState(DEVTOOLS_CANVAS).stack.length > 0;
|
|
1039
|
+
} catch {
|
|
1040
|
+
return false;
|
|
1041
|
+
}
|
|
1042
|
+
},
|
|
1043
|
+
"devtools.setEnabled": async (data) => {
|
|
1044
|
+
const on = data["devtools"] === true;
|
|
1045
|
+
try {
|
|
1046
|
+
const live = shell();
|
|
1047
|
+
const occupied = live.getCanvasState(DEVTOOLS_CANVAS).stack.length > 0;
|
|
1048
|
+
if (on && !occupied) live.push(DEVTOOLS_CANVAS, "devtools.dock");
|
|
1049
|
+
else if (!on && occupied) live.clear(DEVTOOLS_CANVAS);
|
|
1050
|
+
} catch {
|
|
1051
|
+
}
|
|
1052
|
+
return on;
|
|
1053
|
+
},
|
|
1054
|
+
"devtools.shellState": async () => snapshotShell(shell(), [DEVTOOLS_CANVAS]),
|
|
1055
|
+
"devtools.audit": async () => {
|
|
1056
|
+
const rows = auditCatalog(definitions);
|
|
1057
|
+
return { rows, address: rows.reduce((total, row) => total + row.address, 0), definitions: rows.length };
|
|
1058
|
+
},
|
|
1059
|
+
// Stack navigation from the dock — pop the top of a canvas's stack. Only
|
|
1060
|
+
// ever pops ABOVE the root (a canvas is never emptied from devtools).
|
|
1061
|
+
"devtools.pop": async (data) => {
|
|
1062
|
+
const canvasId = String(data["popCanvas"] ?? "");
|
|
1063
|
+
try {
|
|
1064
|
+
const live = shell();
|
|
1065
|
+
if (live.getCanvasState(canvasId).stack.length > 1) live.pop(canvasId);
|
|
1066
|
+
} catch {
|
|
1067
|
+
}
|
|
1068
|
+
return null;
|
|
1069
|
+
},
|
|
1070
|
+
// Newest first — the ring buffer is oldest→newest; the dock shows a feed.
|
|
1071
|
+
"devtools.timeline": async () => ({ rows: timeline.slice().reverse(), count: timeline.length }),
|
|
1072
|
+
"devtools.describe": async (data) => describeInstance(shell(), String(data["instanceId"] ?? "")) ?? { id: "unmounted", found: false, data: {}, layout: null, issues: [] }
|
|
1073
|
+
};
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
// src/devtools/index.ts
|
|
1077
|
+
var devtoolsActions = {
|
|
1078
|
+
"devtools.dock": dockAction,
|
|
1079
|
+
"devtools.inspect": inspectAction
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
exports.DEVTOOLS_CANVAS = DEVTOOLS_CANVAS;
|
|
1083
|
+
exports.createDevtoolsFunctions = createDevtoolsFunctions;
|
|
1084
|
+
exports.devtoolsActions = devtoolsActions;
|
|
1085
|
+
exports.dockAction = dockAction;
|
|
1086
|
+
exports.inspectAction = inspectAction;
|
|
1087
|
+
//# sourceMappingURL=index.cjs.map
|
|
1088
|
+
//# sourceMappingURL=index.cjs.map
|