@voltro/devtools 0.84.0 → 0.86.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 (44) hide show
  1. package/CHANGELOG.md +1215 -0
  2. package/THIRD-PARTY-NOTICES.md +5 -89
  3. package/dist/Devtools.js +327 -0
  4. package/dist/capsuleClearance.js +42 -0
  5. package/dist/capsulePlacement.js +66 -0
  6. package/dist/components/boundary.js +47 -0
  7. package/dist/components/dockMenu.js +121 -0
  8. package/dist/components/icons.js +236 -0
  9. package/dist/components/primitives.js +75 -0
  10. package/dist/console/Capsule.js +169 -0
  11. package/dist/console/Console.js +508 -0
  12. package/dist/console/InspectRefusals.js +89 -0
  13. package/dist/console/searchIndex.js +63 -0
  14. package/dist/console/sources.js +106 -0
  15. package/dist/consoleBridge.js +76 -0
  16. package/dist/externalWindow.js +9 -0
  17. package/dist/index.js +3 -4382
  18. package/dist/inspectAuth.js +16 -0
  19. package/dist/inspectFetch.js +46 -0
  20. package/dist/inspectRefusal.js +45 -0
  21. package/dist/inspectStream.js +88 -0
  22. package/dist/logsBus.js +22 -0
  23. package/dist/panels/desktop.js +101 -0
  24. package/dist/panels/indexes.js +233 -0
  25. package/dist/panels/logs.js +55 -0
  26. package/dist/panels/mutations.js +81 -0
  27. package/dist/panels/pwa.js +171 -0
  28. package/dist/panels/routes.js +69 -0
  29. package/dist/panels/runtimes.js +67 -0
  30. package/dist/panels/stores.js +125 -0
  31. package/dist/panels/subscriptions.js +117 -0
  32. package/dist/panels/traces.js +160 -0
  33. package/dist/panels/webhooks.js +248 -0
  34. package/dist/panels/workflows.js +478 -0
  35. package/dist/pushPage.js +36 -0
  36. package/dist/shadowHost.js +77 -0
  37. package/dist/strings.js +332 -0
  38. package/dist/styles.css +20 -0
  39. package/dist/useCapsuleClearance.js +85 -0
  40. package/dist/useDevStatuses.js +6 -0
  41. package/dist/useDock.js +181 -0
  42. package/dist/useDocumentVisible.js +5 -0
  43. package/dist/useLiveCacheEntries.js +19 -0
  44. package/package.json +4 -4
@@ -0,0 +1,508 @@
1
+ import { Activity as e, Compass as t, Database as n, Grip as r, Indexes as i, Logs as a, Monitor as o, Mutation as s, Search as ee, Trace as c, VoltroMark as l, Webhook as u, Workflow as d, X as te, Zap as f } from "../components/icons.js";
2
+ import { useDevtoolsStrings as p } from "../strings.js";
3
+ import { SubscriptionDetail as m } from "../panels/subscriptions.js";
4
+ import { DockMenu as h } from "../components/dockMenu.js";
5
+ import { InspectRefusals as ne } from "./InspectRefusals.js";
6
+ import { IndexesPanel as re, useIndexesCount as ie } from "../panels/indexes.js";
7
+ import { WebhooksPanel as ae, useWebhooksCount as oe } from "../panels/webhooks.js";
8
+ import { WorkflowsPanel as se, useWorkflowsCount as ce } from "../panels/workflows.js";
9
+ import { RoutesPanel as le } from "../panels/routes.js";
10
+ import { RuntimesPanel as ue } from "../panels/runtimes.js";
11
+ import { PwaPanel as de } from "../panels/pwa.js";
12
+ import { DesktopPanel as fe } from "../panels/desktop.js";
13
+ import { StoresPanel as pe } from "../panels/stores.js";
14
+ import { MutationDetail as g } from "../panels/mutations.js";
15
+ import { LogDetail as _ } from "../panels/logs.js";
16
+ import { TraceDetail as v } from "../panels/traces.js";
17
+ import { ALL_SCOPES as me, SEARCHABLE_SCOPES as he, countBySource as ge, filterConsoleItems as y, isPendingInvocation as b, isSearchableScope as x, stepSelection as S } from "./searchIndex.js";
18
+ import { useConsoleItems as _e } from "./sources.js";
19
+ import { useEffect as C, useMemo as w, useRef as T, useState as E, useSyncExternalStore as D } from "react";
20
+ import { getRouteSnapshot as O, subscribeRouteSnapshot as k } from "@voltro/web";
21
+ import { useConnectionStatus as A, useFrameworkRuntimes as ve } from "@voltro/client";
22
+ import { Fragment as ye, jsx as j, jsxs as M } from "react/jsx-runtime";
23
+ //#region src/console/Console.tsx
24
+ var N = {
25
+ all: null,
26
+ subscription: e,
27
+ mutation: s,
28
+ action: f,
29
+ trace: c,
30
+ log: a,
31
+ workflows: d,
32
+ stores: n,
33
+ indexes: i,
34
+ webhooks: u,
35
+ routes: t,
36
+ runtimes: o,
37
+ pwa: o,
38
+ desktop: o
39
+ }, P = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent) ? {
40
+ search: "⌘K",
41
+ alt: "⌥",
42
+ shift: "⇧"
43
+ } : {
44
+ search: "Ctrl K",
45
+ alt: "Alt",
46
+ shift: "Shift"
47
+ }, F = (e, t, n) => {
48
+ if (n.trim() !== "") return {
49
+ title: e.noResults,
50
+ hint: e.noResultsHint
51
+ };
52
+ switch (t) {
53
+ case "subscription": return {
54
+ title: e.emptySubscriptions,
55
+ hint: e.emptySubscriptionsHint
56
+ };
57
+ case "mutation": return {
58
+ title: e.emptyMutations,
59
+ hint: e.emptyMutationsHint
60
+ };
61
+ case "action": return {
62
+ title: e.emptyActions,
63
+ hint: e.emptyActionsHint
64
+ };
65
+ case "trace": return {
66
+ title: e.emptyTraces,
67
+ hint: e.emptyTracesHint
68
+ };
69
+ case "log": return {
70
+ title: e.emptyLogs,
71
+ hint: e.emptyLogsHint
72
+ };
73
+ default: return {
74
+ title: e.emptyAll,
75
+ hint: e.emptyAllHint
76
+ };
77
+ }
78
+ }, I = (e) => {
79
+ let t = new Date(e), n = (e) => e < 10 ? `0${e}` : String(e);
80
+ return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
81
+ }, be = ({ item: e, selected: t, onSelect: n }) => {
82
+ let r = T(null);
83
+ return C(() => {
84
+ t && r.current !== null && typeof r.current.scrollIntoView == "function" && r.current.scrollIntoView({ block: "nearest" });
85
+ }, [t]), /* @__PURE__ */ M("button", {
86
+ ref: r,
87
+ type: "button",
88
+ role: "option",
89
+ "aria-selected": t,
90
+ "data-source": e.source,
91
+ className: `vdt-row${t ? " vdt-row-sel" : ""}`,
92
+ onClick: n,
93
+ children: [
94
+ /* @__PURE__ */ j("span", {
95
+ className: `vdt-dot vdt-dot-${e.tone}`,
96
+ "aria-hidden": "true"
97
+ }),
98
+ /* @__PURE__ */ j("span", {
99
+ className: "vdt-row-src",
100
+ children: e.source
101
+ }),
102
+ /* @__PURE__ */ M("span", {
103
+ className: "vdt-row-main",
104
+ children: [/* @__PURE__ */ j("code", {
105
+ className: "vdt-row-name",
106
+ children: e.name
107
+ }), /* @__PURE__ */ j("span", {
108
+ className: "vdt-row-summary",
109
+ children: e.summary
110
+ })]
111
+ }),
112
+ /* @__PURE__ */ M("span", {
113
+ className: "vdt-row-meta",
114
+ children: [
115
+ e.apiName === void 0 ? null : /* @__PURE__ */ j("span", {
116
+ className: "vdt-row-api",
117
+ children: e.apiName
118
+ }),
119
+ e.status === void 0 ? null : /* @__PURE__ */ j("span", {
120
+ className: `vdt-tag vdt-tag-${e.tone}`,
121
+ children: e.status
122
+ }),
123
+ e.at > 0 ? /* @__PURE__ */ j("span", {
124
+ className: "vdt-row-time",
125
+ children: I(e.at)
126
+ }) : null
127
+ ]
128
+ })
129
+ ]
130
+ });
131
+ }, xe = ({ item: e, retained: t }) => {
132
+ let n = e.detail, r = p().shell;
133
+ return /* @__PURE__ */ M("div", {
134
+ className: "vdt-detail",
135
+ children: [/* @__PURE__ */ M("div", {
136
+ className: "vdt-detail-head",
137
+ children: [
138
+ /* @__PURE__ */ j("span", {
139
+ className: `vdt-dot vdt-dot-${e.tone}`,
140
+ "aria-hidden": "true"
141
+ }),
142
+ /* @__PURE__ */ j("span", {
143
+ className: "vdt-row-src",
144
+ children: e.source
145
+ }),
146
+ /* @__PURE__ */ j("code", {
147
+ className: "vdt-detail-name",
148
+ children: e.name
149
+ }),
150
+ e.status === void 0 ? null : /* @__PURE__ */ j("span", {
151
+ className: `vdt-tag vdt-tag-${e.tone}`,
152
+ children: e.status
153
+ }),
154
+ /* @__PURE__ */ j("span", { className: "vdt-sp" }),
155
+ e.apiName === void 0 ? null : /* @__PURE__ */ j("span", {
156
+ className: "vdt-row-api",
157
+ children: e.apiName
158
+ }),
159
+ e.at > 0 ? /* @__PURE__ */ j("span", {
160
+ className: "vdt-row-time",
161
+ children: I(e.at)
162
+ }) : null
163
+ ]
164
+ }), /* @__PURE__ */ M("div", {
165
+ className: "vdt-detail-body",
166
+ children: [
167
+ t ? /* @__PURE__ */ j("p", {
168
+ className: "vdt:px-3 vdt:py-2 vdt:text-xs vdt:text-foreground-muted",
169
+ role: "status",
170
+ children: r.retainedSelection
171
+ }) : null,
172
+ n.source === "subscription" ? /* @__PURE__ */ j(m, { entry: n.entry }) : null,
173
+ n.source === "mutation" || n.source === "action" ? /* @__PURE__ */ j(g, { mutation: n.mutation }) : null,
174
+ n.source === "trace" ? /* @__PURE__ */ j(v, { trace: n.trace }) : null,
175
+ n.source === "log" ? /* @__PURE__ */ j(_, { record: n.record }) : null
176
+ ]
177
+ })]
178
+ });
179
+ }, Se = ({ name: e }) => {
180
+ let t = p().shell, n = A(e).status, r = n === "connected" ? "ok" : n === "recovering" ? "warn" : "err", i = n === "connected" ? t.connected : n === "recovering" ? t.recovering : n === "degraded" ? t.degraded : t.offline;
181
+ return /* @__PURE__ */ M("span", {
182
+ className: "vdt-chip",
183
+ "data-status": n,
184
+ children: [
185
+ /* @__PURE__ */ j("span", {
186
+ className: `vdt-dot vdt-dot-${r}`,
187
+ "aria-hidden": "true"
188
+ }),
189
+ /* @__PURE__ */ j("b", { children: e }),
190
+ /* @__PURE__ */ j("span", { children: i })
191
+ ]
192
+ });
193
+ }, Ce = () => D(k, () => O().pathname ?? "", () => ""), L = (e) => {
194
+ let t = e.detail;
195
+ switch (t.source) {
196
+ case "subscription": return t.entry;
197
+ case "mutation":
198
+ case "action": return t.mutation;
199
+ case "trace": return t.trace;
200
+ case "log": return t.record;
201
+ }
202
+ }, R = ({ dock: e, push: t, onDock: n, onPush: i, onClose: a, scope: o, onScope: s, searchRef: c, onHeaderPointerDown: u }) => {
203
+ let d = p(), f = d.shell, m = d.tabs, g = ve(), [_, v] = E(!1), T = _e(!0, _), D = ie(!0), O = oe(!0), k = ce(!0), A = Ce(), [I, R] = E(""), [z, B] = E(!1), [V, H] = E(null), U = V?.id ?? null;
204
+ C(() => {
205
+ if (V === null || V.source === "subscription") return;
206
+ let e = T.find((e) => e.id === V.id);
207
+ e !== void 0 && L(e) !== L(V) && H(e);
208
+ }, [T, V]);
209
+ let W = x(o), G = w(() => ge(T), [T]), we = w(() => T.filter((e) => e.source === "trace" && e.tone === "err").length, [T]), K = w(() => T.filter(b).length, [T]), q = V === null ? null : T.find((e) => e.id === V.id) ?? null, J = V !== null && V.source !== "subscription" && q === null, Y = w(() => {
210
+ let e = q ?? (J ? V : null);
211
+ return e !== null && y([e], I, o).length > 0 ? e : null;
212
+ }, [
213
+ q,
214
+ J,
215
+ V,
216
+ I,
217
+ o
218
+ ]), X = w(() => {
219
+ let e = J && Y !== null ? [...T, Y] : T;
220
+ return y(z ? e.filter(b) : e, I, o);
221
+ }, [
222
+ T,
223
+ I,
224
+ o,
225
+ z,
226
+ J,
227
+ Y
228
+ ]), Z = w(() => z && I.trim() === "" ? {
229
+ title: f.emptyPending,
230
+ hint: f.emptyPendingHint
231
+ } : F(f, o, I), [
232
+ f,
233
+ o,
234
+ I,
235
+ z
236
+ ]), Q = (e) => {
237
+ H(e === null ? null : X.find((t) => t.id === e) ?? null);
238
+ }, Te = (e) => {
239
+ switch (e) {
240
+ case "all": return T.length;
241
+ case "subscription": return G.subscription;
242
+ case "mutation": return G.mutation;
243
+ case "action": return G.action;
244
+ case "trace": return G.trace;
245
+ case "log": return G.log;
246
+ case "indexes": return D;
247
+ case "webhooks": return O;
248
+ case "workflows": return k;
249
+ default: return null;
250
+ }
251
+ }, $ = (e) => {
252
+ switch (e) {
253
+ case "all": return f.scopeAll;
254
+ case "subscription": return m.subscriptions;
255
+ case "mutation": return m.mutations;
256
+ case "action": return m.actions;
257
+ case "trace": return m.traces;
258
+ case "log": return m.logs;
259
+ case "workflows": return m.workflows;
260
+ case "stores": return m.stores;
261
+ case "indexes": return m.indexes;
262
+ case "webhooks": return m.webhooks;
263
+ case "routes": return m.routes;
264
+ case "runtimes": return m.runtimes;
265
+ case "pwa": return m.pwa;
266
+ case "desktop": return m.desktop;
267
+ }
268
+ };
269
+ return /* @__PURE__ */ M(ye, { children: [
270
+ /* @__PURE__ */ M("header", {
271
+ className: "vdt-bar",
272
+ onPointerDown: u,
273
+ children: [
274
+ e === "window" ? /* @__PURE__ */ j("span", {
275
+ className: "vdt-win-handle",
276
+ title: f.moveTitle,
277
+ "aria-hidden": "true",
278
+ children: /* @__PURE__ */ j(r, { className: "vdt:w-4 vdt:h-4" })
279
+ }) : null,
280
+ /* @__PURE__ */ j(l, { className: "vdt-bar-mark" }),
281
+ W ? /* @__PURE__ */ M("label", {
282
+ className: "vdt-search",
283
+ children: [
284
+ /* @__PURE__ */ j(ee, { className: "vdt:w-3.5 vdt:h-3.5" }),
285
+ /* @__PURE__ */ j("input", {
286
+ ref: c,
287
+ type: "search",
288
+ value: I,
289
+ onChange: (e) => R(e.target.value),
290
+ onKeyDown: (e) => {
291
+ e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), Q(S(X.map((e) => e.id), U, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Escape" ? I === "" ? a() : (e.preventDefault(), R("")) : e.key === "Enter" && Y === null && X.length > 0 && Q(X[0].id);
292
+ },
293
+ placeholder: f.searchPlaceholder,
294
+ "aria-label": f.searchLabel,
295
+ autoComplete: "off",
296
+ spellCheck: !1
297
+ }),
298
+ /* @__PURE__ */ j("kbd", {
299
+ className: "vdt-kbd",
300
+ children: P.search
301
+ })
302
+ ]
303
+ }) : /* @__PURE__ */ M("span", {
304
+ className: "vdt-bar-title",
305
+ children: [/* @__PURE__ */ j("span", {
306
+ className: "vdt-bar-brand",
307
+ children: f.brandWord
308
+ }), /* @__PURE__ */ j("span", {
309
+ className: "vdt-bar-kicker",
310
+ children: f.kicker
311
+ })]
312
+ }),
313
+ /* @__PURE__ */ j("div", {
314
+ role: "tablist",
315
+ "aria-label": f.brand,
316
+ className: "vdt-scopes",
317
+ children: me.map((e, t) => {
318
+ let n = N[e], r = Te(e), i = e === o;
319
+ return /* @__PURE__ */ M("button", {
320
+ type: "button",
321
+ role: "tab",
322
+ "aria-label": r !== null && r > 0 ? `${$(e)} (${r})` : $(e),
323
+ "aria-selected": i,
324
+ "data-scope": e,
325
+ className: `vdt-scope${i ? " vdt-scope-on" : ""}${t === he.length ? " vdt-scope-sep" : ""}`,
326
+ onClick: () => {
327
+ s(e), Q(null), B(!1), x(e) && requestAnimationFrame(() => {
328
+ let e = c.current;
329
+ e !== null && e.getRootNode().activeElement !== e && e.focus();
330
+ });
331
+ },
332
+ children: [
333
+ n ? /* @__PURE__ */ j(n, { className: "vdt:w-3.5 vdt:h-3.5" }) : null,
334
+ /* @__PURE__ */ j("span", {
335
+ className: "vdt-scope-label",
336
+ children: $(e)
337
+ }),
338
+ r !== null && r > 0 ? /* @__PURE__ */ j("span", {
339
+ className: `vdt-badge${i ? " vdt-badge-acc" : ""}${e === "trace" && we > 0 ? " vdt-badge-err" : ""}`,
340
+ children: r
341
+ }) : null
342
+ ]
343
+ }, e);
344
+ })
345
+ }),
346
+ /* @__PURE__ */ j("span", { className: "vdt-sp" }),
347
+ /* @__PURE__ */ j(h, {
348
+ dock: e,
349
+ push: t,
350
+ onDock: n,
351
+ onPush: i
352
+ }),
353
+ /* @__PURE__ */ j("button", {
354
+ type: "button",
355
+ className: "vdt-iconbtn",
356
+ title: f.closeTitle,
357
+ "aria-label": f.closeTitle,
358
+ onClick: a,
359
+ children: /* @__PURE__ */ j(te, { className: "vdt:w-4 vdt:h-4" })
360
+ })
361
+ ]
362
+ }),
363
+ /* @__PURE__ */ j(ne, {}),
364
+ W ? /* @__PURE__ */ M("div", {
365
+ className: "vdt-body",
366
+ "data-empty": X.length === 0 && Y === null ? "true" : "false",
367
+ children: [/* @__PURE__ */ j("div", {
368
+ role: "listbox",
369
+ "aria-label": f.results(X.length),
370
+ tabIndex: 0,
371
+ className: "vdt-results",
372
+ onKeyDown: (e) => {
373
+ e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), Q(S(X.map((e) => e.id), U, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Escape" && a();
374
+ },
375
+ children: X.length === 0 ? /* @__PURE__ */ M("div", {
376
+ className: "vdt-empty",
377
+ children: [/* @__PURE__ */ j("div", {
378
+ className: "vdt-empty-title",
379
+ children: Z.title
380
+ }), /* @__PURE__ */ j("div", {
381
+ className: "vdt-empty-hint",
382
+ children: Z.hint
383
+ })]
384
+ }) : X.map((e) => /* @__PURE__ */ j(be, {
385
+ item: e,
386
+ selected: e.id === U,
387
+ onSelect: () => Q(e.id === U ? null : e.id)
388
+ }, e.id))
389
+ }), /* @__PURE__ */ j("aside", {
390
+ className: "vdt-side",
391
+ "aria-live": "polite",
392
+ children: Y === null ? /* @__PURE__ */ j("div", {
393
+ className: "vdt-empty vdt-empty-side",
394
+ children: /* @__PURE__ */ j("div", {
395
+ className: "vdt-empty-hint",
396
+ children: f.selectHint
397
+ })
398
+ }) : /* @__PURE__ */ j(xe, {
399
+ item: Y,
400
+ retained: J
401
+ })
402
+ })]
403
+ }) : /* @__PURE__ */ M("div", {
404
+ className: "vdt-body vdt-body-panel",
405
+ children: [
406
+ o === "workflows" ? /* @__PURE__ */ j(se, {}) : null,
407
+ o === "stores" ? /* @__PURE__ */ j(pe, {}) : null,
408
+ o === "indexes" ? /* @__PURE__ */ j(re, {}) : null,
409
+ o === "webhooks" ? /* @__PURE__ */ j(ae, {}) : null,
410
+ o === "routes" ? /* @__PURE__ */ j(le, {}) : null,
411
+ o === "runtimes" ? /* @__PURE__ */ j(ue, {}) : null,
412
+ o === "pwa" ? /* @__PURE__ */ j(de, {}) : null,
413
+ o === "desktop" ? /* @__PURE__ */ j(fe, {}) : null
414
+ ]
415
+ }),
416
+ /* @__PURE__ */ M("footer", {
417
+ className: "vdt-foot",
418
+ children: [
419
+ o === "trace" ? /* @__PURE__ */ j("button", {
420
+ type: "button",
421
+ className: "vdt-chip vdt-background-filter",
422
+ "aria-pressed": _,
423
+ onClick: () => v(!_),
424
+ children: d.traces.includeBackground
425
+ }) : null,
426
+ K > 0 || z ? /* @__PURE__ */ M("button", {
427
+ type: "button",
428
+ className: "vdt-chip vdt-chip-info vdt-pending-filter",
429
+ "data-chip": "pending",
430
+ "aria-label": f.pendingInvocations(K),
431
+ "aria-pressed": z,
432
+ onClick: () => {
433
+ B(!z), s("all"), R(""), Q(null);
434
+ },
435
+ children: [
436
+ /* @__PURE__ */ j("span", {
437
+ className: "vdt-dot vdt-dot-info",
438
+ "aria-hidden": "true"
439
+ }),
440
+ /* @__PURE__ */ j("b", { children: K }),
441
+ " ",
442
+ f.pending
443
+ ]
444
+ }) : null,
445
+ g.names.map((e) => /* @__PURE__ */ j(Se, { name: e }, e)),
446
+ A === "" ? null : /* @__PURE__ */ j("span", {
447
+ className: "vdt-foot-route",
448
+ children: /* @__PURE__ */ j("code", { children: A })
449
+ }),
450
+ /* @__PURE__ */ j("span", { className: "vdt-sp" }),
451
+ /* @__PURE__ */ M("span", {
452
+ className: "vdt-hints",
453
+ children: [
454
+ /* @__PURE__ */ M("span", { children: [
455
+ /* @__PURE__ */ j("kbd", {
456
+ className: "vdt-kbd",
457
+ children: "↑↓"
458
+ }),
459
+ " ",
460
+ f.hintNavigate
461
+ ] }),
462
+ /* @__PURE__ */ M("span", { children: [
463
+ /* @__PURE__ */ j("kbd", {
464
+ className: "vdt-kbd",
465
+ children: "↵"
466
+ }),
467
+ " ",
468
+ f.hintOpen
469
+ ] }),
470
+ /* @__PURE__ */ M("span", { children: [
471
+ /* @__PURE__ */ j("kbd", {
472
+ className: "vdt-kbd",
473
+ children: P.alt
474
+ }),
475
+ "+",
476
+ /* @__PURE__ */ j("kbd", {
477
+ className: "vdt-kbd",
478
+ children: "V"
479
+ }),
480
+ " ",
481
+ f.hintToggle
482
+ ] }),
483
+ /* @__PURE__ */ M("span", { children: [
484
+ /* @__PURE__ */ j("kbd", {
485
+ className: "vdt-kbd",
486
+ children: P.alt
487
+ }),
488
+ "+",
489
+ /* @__PURE__ */ j("kbd", {
490
+ className: "vdt-kbd",
491
+ children: P.shift
492
+ }),
493
+ "+",
494
+ /* @__PURE__ */ j("kbd", {
495
+ className: "vdt-kbd",
496
+ children: "←↑↓→"
497
+ }),
498
+ " ",
499
+ f.hintDock
500
+ ] })
501
+ ]
502
+ })
503
+ ]
504
+ })
505
+ ] });
506
+ };
507
+ //#endregion
508
+ export { R as Console, P as KEY_LABELS };
@@ -0,0 +1,89 @@
1
+ import { useDevtoolsStrings as e } from "../strings.js";
2
+ import { clearInspectRefusals as t, useInspectRefusals as n } from "../inspectRefusal.js";
3
+ import { useState as r } from "react";
4
+ import { useFrameworkRuntimes as i } from "@voltro/client";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region src/console/InspectRefusals.tsx
7
+ var s = (e) => {
8
+ if (e.login !== void 0) try {
9
+ return new URL(e.login, new URL(e.baseUrl, window.location.href)).href;
10
+ } catch {
11
+ return;
12
+ }
13
+ }, c = ({ url: n }) => {
14
+ let i = e().inspect, [s, c] = r(""), [l, u] = r(null), d = async (e) => {
15
+ e.preventDefault(), u(null);
16
+ try {
17
+ let e = await fetch(n, {
18
+ method: "POST",
19
+ credentials: "same-origin",
20
+ headers: { "content-type": "application/json" },
21
+ body: JSON.stringify({ token: s })
22
+ });
23
+ if (e.ok) {
24
+ c(""), t();
25
+ return;
26
+ }
27
+ let r = await e.json().catch(() => null), i = typeof r == "object" && r && typeof r.reason == "string" ? r.reason : `HTTP ${e.status}`;
28
+ u(i);
29
+ } catch (e) {
30
+ u(e instanceof Error ? e.message : String(e));
31
+ }
32
+ };
33
+ return /* @__PURE__ */ o("form", {
34
+ className: "vdt-refusal-signin",
35
+ onSubmit: (e) => {
36
+ d(e);
37
+ },
38
+ children: [
39
+ /* @__PURE__ */ o("label", { children: [/* @__PURE__ */ a("span", { children: i.tokenLabel }), /* @__PURE__ */ a("input", {
40
+ type: "password",
41
+ autoComplete: "off",
42
+ value: s,
43
+ onChange: (e) => c(e.target.value)
44
+ })] }),
45
+ /* @__PURE__ */ a("button", {
46
+ type: "submit",
47
+ disabled: s === "",
48
+ children: i.signIn
49
+ }),
50
+ l === null ? null : /* @__PURE__ */ a("span", {
51
+ className: "vdt-refusal-failed",
52
+ children: i.signInFailed(l)
53
+ })
54
+ ]
55
+ });
56
+ }, l = () => {
57
+ let t = n(), r = i(), l = e().inspect;
58
+ if (t.length === 0) return null;
59
+ let u = (e) => r.names.find((t) => r.get(t).inspectBaseUrl === e) ?? e;
60
+ return /* @__PURE__ */ a("div", {
61
+ className: "vdt-refusals",
62
+ role: "status",
63
+ children: t.map((e) => {
64
+ let t = e.locked === !0 ? s(e) : void 0;
65
+ return /* @__PURE__ */ o("div", {
66
+ className: "vdt-refusal",
67
+ children: [
68
+ /* @__PURE__ */ a("strong", { children: e.status === 0 ? l.unreachableTitle(u(e.baseUrl)) : l.refusedTitle(u(e.baseUrl), e.status) }),
69
+ e.status === 0 ? /* @__PURE__ */ a("p", { children: l.unreachableHint }) : /* @__PURE__ */ a("p", { children: [e.error, e.reason].filter((e) => e !== void 0).join(" — ") }),
70
+ e.fix === void 0 ? null : /* @__PURE__ */ o("p", { children: [
71
+ /* @__PURE__ */ a("span", {
72
+ className: "vdt-refusal-label",
73
+ children: l.fixLabel
74
+ }),
75
+ " ",
76
+ e.fix
77
+ ] }),
78
+ t === void 0 ? null : /* @__PURE__ */ a(c, { url: t }),
79
+ /* @__PURE__ */ a("p", {
80
+ className: "vdt-refusal-paused",
81
+ children: l.paused
82
+ })
83
+ ]
84
+ }, e.baseUrl);
85
+ })
86
+ });
87
+ };
88
+ //#endregion
89
+ export { l as InspectRefusals };
@@ -0,0 +1,63 @@
1
+ //#region src/console/searchIndex.ts
2
+ var e = [
3
+ "all",
4
+ "subscription",
5
+ "mutation",
6
+ "action",
7
+ "trace",
8
+ "log"
9
+ ], t = [
10
+ "workflows",
11
+ "stores",
12
+ "indexes",
13
+ "webhooks",
14
+ "routes",
15
+ "runtimes",
16
+ "pwa",
17
+ "desktop"
18
+ ], n = [...e, ...t], r = (t) => e.includes(t), i = (e) => {
19
+ let t = [], n = /"([^"]*)"|(\S+)/g, r;
20
+ for (; (r = n.exec(e)) !== null;) {
21
+ let e = (r[1] ?? r[2] ?? "").toLowerCase();
22
+ e !== "" && t.push(e);
23
+ }
24
+ return t;
25
+ }, a = (e, t) => t.every((t) => e.includes(t)), o = {
26
+ subscription: 0,
27
+ mutation: 1,
28
+ action: 1,
29
+ trace: 1,
30
+ log: 1
31
+ }, s = (e) => (e.source === "mutation" || e.source === "action") && e.status === "pending", c = (e, t, n) => {
32
+ let r = i(t), c = n === "all" ? e : e.filter((e) => e.source === n);
33
+ return [...r.length === 0 ? c : c.filter((e) => a(e.haystack, r))].sort((e, t) => {
34
+ let n = Number(s(t)) - Number(s(e));
35
+ if (n !== 0) return n;
36
+ let r = o[e.source] - o[t.source];
37
+ return r === 0 ? t.at - e.at : r;
38
+ });
39
+ }, l = (e) => {
40
+ let t = {
41
+ subscription: 0,
42
+ mutation: 0,
43
+ action: 0,
44
+ trace: 0,
45
+ log: 0
46
+ };
47
+ for (let n of e) t[n.source]++;
48
+ return t;
49
+ }, u = (e, t = 400) => {
50
+ let n;
51
+ try {
52
+ n = JSON.stringify(e) ?? String(e);
53
+ } catch {
54
+ n = String(e);
55
+ }
56
+ return n.length > t ? n.slice(0, t) : n;
57
+ }, d = (e, t, n) => {
58
+ if (e.length === 0) return null;
59
+ let r = t === null ? -1 : e.indexOf(t);
60
+ return r === -1 ? n === 1 ? e[0] : e[e.length - 1] : e[(r + n + e.length) % e.length];
61
+ };
62
+ //#endregion
63
+ export { n as ALL_SCOPES, t as PANEL_SCOPES, e as SEARCHABLE_SCOPES, u as compactJson, l as countBySource, c as filterConsoleItems, s as isPendingInvocation, r as isSearchableScope, a as matchesQuery, d as stepSelection, i as tokenize };