@hansenexus/hud 0.4.0 → 0.5.1

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 (159) hide show
  1. package/README.md +634 -12
  2. package/dist/a11y-B5DUaiCs.js +246 -0
  3. package/dist/a11y-panel-p_t4eD7p.js +207 -0
  4. package/dist/{capabilities-CjulXFQX.js → access-C7zlaqj6.js} +1 -90
  5. package/dist/{access-CNvJOwKM.d.ts → access-D_ewAEJG.d.ts} +11 -4
  6. package/dist/access-panel-CEfTr9ZI.js +123 -0
  7. package/dist/adapter-BYoxPYTI.d.ts +33 -0
  8. package/dist/adapter-hcwmJtNx.js +65 -0
  9. package/dist/auto/runtime.d.ts +65 -0
  10. package/dist/auto/runtime.js +50 -0
  11. package/dist/auto.d.ts +15 -0
  12. package/dist/auto.js +33 -0
  13. package/dist/capabilities-rDSKjXpq.js +110 -0
  14. package/dist/capture-CwrIwLqi.js +300 -0
  15. package/dist/capture-buffer-Bbbo6omF.d.ts +35 -0
  16. package/dist/cli.d.ts +1 -0
  17. package/dist/cli.js +275 -0
  18. package/dist/data-panel-DhxAmP91.js +817 -0
  19. package/dist/data-store-ChF1td_P.js +164 -0
  20. package/dist/define-hud-CHPedaQ5.d.ts +50 -0
  21. package/dist/design-D0kGgPoP.js +87 -0
  22. package/dist/detect-BxHZ0pxW.d.ts +25 -0
  23. package/dist/detect-CHZiSeZs.js +63 -0
  24. package/dist/dispatch-panel-B-xr_Giy.js +279 -0
  25. package/dist/{env-vEjyJfPW.d.ts → env-CApnbI0r.d.ts} +2 -0
  26. package/dist/{env-DfxpPfs9.js → env-CaiFPIhF.js} +3 -0
  27. package/dist/file-xdSaQ2uR.js +103 -0
  28. package/dist/flags-DVtaJ8pQ.d.ts +58 -0
  29. package/dist/flags.d.ts +2 -0
  30. package/dist/flags.js +82 -0
  31. package/dist/force-state-panel-_otVYh9i.js +97 -0
  32. package/dist/generate-C8lQl3Eh.js +53 -0
  33. package/dist/handler-BpVhxEmU.js +106 -0
  34. package/dist/{handler-WmE4Lu7l.d.ts → handler-DtYVCZY6.d.ts} +1 -1
  35. package/dist/index-BAV_1W8a.d.ts +43 -0
  36. package/dist/index-BJ26pse9.d.ts +70 -0
  37. package/dist/index-BnQ0dTZf.d.ts +19 -0
  38. package/dist/index-CwfX-W87.d.ts +72 -0
  39. package/dist/index-DcH9V3cU.d.ts +48 -0
  40. package/dist/index-DqOyNf1u.d.ts +65 -0
  41. package/dist/index-DstI_ike.d.ts +66 -0
  42. package/dist/index-Dxz4fn4j.d.ts +42 -0
  43. package/dist/index-Hhh7OXzU.d.ts +129 -0
  44. package/dist/index-ReFbhQ9p.d.ts +25 -0
  45. package/dist/index-RgXfMBuW.d.ts +48 -0
  46. package/dist/{index-BYsdS-7d.d.ts → index-gCZBO53s.d.ts} +21 -3
  47. package/dist/index.d.ts +5 -5
  48. package/dist/index.js +710 -69
  49. package/dist/inspect-C9Ft8fqn.js +142 -0
  50. package/dist/inspect-root-BkaupBMp.js +429 -0
  51. package/dist/meta-Bv0sEao3.js +6 -0
  52. package/dist/meta-C_G7MB5w.d.ts +49 -0
  53. package/dist/mocks-CA-wM2SB.d.ts +109 -0
  54. package/dist/mocks-ESiRqk9o.js +150 -0
  55. package/dist/msw-browser-wjaYgkB7.d.ts +31 -0
  56. package/dist/next/config.cjs +201 -0
  57. package/dist/next/config.d.cts +87 -0
  58. package/dist/next/config.d.ts +64 -0
  59. package/dist/next/config.js +84 -0
  60. package/dist/next.d.ts +14 -4
  61. package/dist/next.js +5 -3
  62. package/dist/observe-CdDnDBRP.js +89 -0
  63. package/dist/observe-panel-Cgp1M8oT.js +347 -0
  64. package/dist/ops-panel-CEqDe_UT.js +234 -0
  65. package/dist/{payload-CLKDVZWl.d.ts → payload-MUQ9ciER.d.ts} +25 -1
  66. package/dist/plugins/a11y.d.ts +2 -0
  67. package/dist/plugins/a11y.js +2 -0
  68. package/dist/plugins/access/server.d.ts +5 -5
  69. package/dist/plugins/access/server.js +4 -3
  70. package/dist/plugins/access.d.ts +5 -5
  71. package/dist/plugins/access.js +16 -215
  72. package/dist/plugins/agent/server.d.ts +3 -38
  73. package/dist/plugins/agent/server.js +47 -21
  74. package/dist/plugins/agent.d.ts +4 -4
  75. package/dist/plugins/agent.js +6 -348
  76. package/dist/plugins/capture/server.d.ts +92 -0
  77. package/dist/plugins/capture/server.js +248 -0
  78. package/dist/plugins/capture.d.ts +24 -0
  79. package/dist/plugins/capture.js +70 -0
  80. package/dist/plugins/data/msw-browser.d.ts +2 -0
  81. package/dist/plugins/data/msw-browser.js +39 -0
  82. package/dist/plugins/data/msw-node.d.ts +36 -0
  83. package/dist/plugins/data/msw-node.js +68 -0
  84. package/dist/plugins/data/server.d.ts +257 -0
  85. package/dist/plugins/data/server.js +717 -0
  86. package/dist/plugins/data.d.ts +6 -0
  87. package/dist/plugins/data.js +51 -0
  88. package/dist/plugins/design/server.d.ts +54 -0
  89. package/dist/plugins/design/server.js +198 -0
  90. package/dist/plugins/design.d.ts +4 -124
  91. package/dist/plugins/design.js +4 -619
  92. package/dist/plugins/inspect/convex.d.ts +2 -0
  93. package/dist/plugins/inspect/convex.js +486 -0
  94. package/dist/plugins/inspect/react-query.d.ts +2 -0
  95. package/dist/plugins/inspect/react-query.js +237 -0
  96. package/dist/plugins/inspect/sockets.d.ts +51 -0
  97. package/dist/plugins/inspect/sockets.js +397 -0
  98. package/dist/plugins/inspect/swr.d.ts +2 -0
  99. package/dist/plugins/inspect/swr.js +218 -0
  100. package/dist/plugins/inspect.d.ts +4 -0
  101. package/dist/plugins/inspect.js +3 -0
  102. package/dist/plugins/observe.d.ts +4 -64
  103. package/dist/plugins/observe.js +1 -616
  104. package/dist/plugins/ops/server.d.ts +1 -1
  105. package/dist/plugins/ops/server.js +2 -1
  106. package/dist/plugins/ops.d.ts +2 -1
  107. package/dist/plugins/ops.js +15 -336
  108. package/dist/plugins/routes/server.d.ts +88 -0
  109. package/dist/plugins/routes/server.js +62 -0
  110. package/dist/plugins/routes.d.ts +3 -0
  111. package/dist/plugins/routes.js +216 -0
  112. package/dist/plugins/seo.d.ts +2 -0
  113. package/dist/plugins/seo.js +2 -0
  114. package/dist/plugins/vitals.d.ts +2 -25
  115. package/dist/plugins/vitals.js +3 -2
  116. package/dist/{plugins-CQ_0w1ot.d.ts → plugins-BZvDqGx5.d.ts} +33 -3
  117. package/dist/poll-CjKsWZi8.js +89 -0
  118. package/dist/requests-BwD6MKEq.js +282 -0
  119. package/dist/requests-CJrUf465.d.ts +50 -0
  120. package/dist/review.js +2 -2
  121. package/dist/same-origin-BGet22CC.js +21 -0
  122. package/dist/scan-DzJNXqOk.js +165 -0
  123. package/dist/seo-Dq9q_QkO.js +551 -0
  124. package/dist/seo-panel-CfiY-TnT.js +124 -0
  125. package/dist/server.d.ts +2 -2
  126. package/dist/server.js +2 -105
  127. package/dist/sessions-panel-COvhPAzv.js +98 -0
  128. package/dist/{shortcut-U6ftVY06.js → shortcut-s_mjGeU8.js} +1 -44
  129. package/dist/{types-QJUajwWq.js → state-CjjZPjPJ.js} +13 -8
  130. package/dist/store/convex.d.ts +33 -0
  131. package/dist/store/convex.js +52 -0
  132. package/dist/{vitals-panel-Dvc5dnR-.js → store-CQqIIKTc.js} +1 -29
  133. package/dist/store-Ync9eb1G.js +67 -0
  134. package/dist/store.d.ts +76 -0
  135. package/dist/store.js +188 -0
  136. package/dist/{styles--slk86ZQ.js → styles-BA8ueHoV.js} +13 -3
  137. package/dist/styles-DKU_P8MH.js +139 -0
  138. package/dist/styles-DPpDPmzi.js +68 -0
  139. package/dist/tokens-panel-CbMQfasZ.js +142 -0
  140. package/dist/types-B-ulf2Jp.js +8 -0
  141. package/dist/types-BIgGf-0C.d.ts +25 -0
  142. package/dist/types-BIkI-qN8.js +30 -0
  143. package/dist/{types-DADBRiGk.d.ts → types-Cxh4twqc.d.ts} +1 -1
  144. package/dist/types-DIdPfjtV.js +6 -0
  145. package/dist/types-DaJcsEjO.d.ts +44 -0
  146. package/dist/types-Dn68psVz.d.ts +118 -0
  147. package/dist/types-szkr2QOF.d.ts +39 -0
  148. package/dist/unlock-store-4V3vR4Eg.js +96 -0
  149. package/dist/variant-groups-TIfO3NIj.js +137 -0
  150. package/dist/variant-groups-aAIrcNK5.d.ts +36 -0
  151. package/dist/variants-panel-BDoSkwBJ.js +457 -0
  152. package/dist/variants-types-CcRf119M.d.ts +63 -0
  153. package/dist/variants.d.ts +43 -0
  154. package/dist/variants.js +83 -0
  155. package/dist/vitals-panel-BCmMUntW.js +30 -0
  156. package/dist/vite.d.ts +37 -0
  157. package/dist/vite.js +134 -0
  158. package/package.json +72 -5
  159. package/dist/define-hud-BBzsSl8b.d.ts +0 -36
@@ -0,0 +1,234 @@
1
+ import { i as stateRating, r as stateLabel, t as CI_POLL_MS } from "./state-CjjZPjPJ.js";
2
+ import { t as usePoll } from "./poll-CjKsWZi8.js";
3
+ import { t as TELEMETRY_RANGES } from "./types-B-ulf2Jp.js";
4
+ import { useState } from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/plugins/ops/styles.ts
7
+ /** Panel styles, rendered as a `<style>` inside the panel, so inside the shadow root. */
8
+ const OPS_CSS = `
9
+ .ops { display: grid; gap: 12px; }
10
+ .ops section { display: grid; gap: 6px; }
11
+ .ops h3 {
12
+ margin: 0;
13
+ font-size: 10px;
14
+ font-weight: 600;
15
+ letter-spacing: 0.06em;
16
+ text-transform: uppercase;
17
+ color: var(--hud-fg-muted);
18
+ }
19
+ .ops .head { display: flex; align-items: center; gap: 6px; font-family: var(--hud-mono); }
20
+ .ops .head .branch { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
21
+ .ops .warn { color: var(--hud-warn); margin: 0; }
22
+ .ops .muted { color: var(--hud-fg-muted); }
23
+ .ops ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
24
+ .ops li a, .ops li > span {
25
+ display: grid;
26
+ grid-template-columns: 6px minmax(0, 1fr) auto auto;
27
+ align-items: center;
28
+ gap: 8px;
29
+ padding: 3px 4px;
30
+ border-radius: 4px;
31
+ color: inherit;
32
+ text-decoration: none;
33
+ }
34
+ .ops li a:hover { background: var(--hud-bg-subtle); }
35
+ .ops .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
36
+ .ops .title small { color: var(--hud-fg-muted); margin-left: 6px; }
37
+ .ops .mono { font-family: var(--hud-mono); color: var(--hud-fg-muted); }
38
+ .ops .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
39
+ .ops .stat { padding: 6px 8px; border: 1px solid var(--hud-border); border-radius: 6px; }
40
+ .ops .stat b { display: block; font-family: var(--hud-mono); font-size: 13px; }
41
+ .ops .stat span { font-size: 10px; color: var(--hud-fg-muted); }
42
+ .ops .row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
43
+ .ops .ranges { display: flex; gap: 2px; }
44
+ .ops button.chip { padding: 1px 6px; border-radius: 999px; font-family: var(--hud-mono); }
45
+ .ops button.chip:hover, .ops button.chip[aria-pressed="true"] { background: var(--hud-bg-subtle); }
46
+ `;
47
+ //#endregion
48
+ //#region src/plugins/ops/ops-panel.tsx
49
+ const TELEMETRY_POLL_MS = 6e4;
50
+ /** `3m`, `5h`, `2d` since `iso`. */
51
+ function age(iso, now = Date.now()) {
52
+ if (!iso) return "";
53
+ const seconds = Math.max(0, Math.round((now - Date.parse(iso)) / 1e3));
54
+ if (seconds < 60) return `${seconds}s`;
55
+ if (seconds < 3600) return `${Math.round(seconds / 60)}m`;
56
+ if (seconds < 86400) return `${Math.round(seconds / 3600)}h`;
57
+ return `${Math.round(seconds / 86400)}d`;
58
+ }
59
+ function Missing({ name }) {
60
+ return /* @__PURE__ */ jsxs("p", {
61
+ className: "warn",
62
+ children: [
63
+ "Not configured: set ",
64
+ /* @__PURE__ */ jsx("code", { children: name ?? "its env" }),
65
+ " in the app's server env."
66
+ ]
67
+ });
68
+ }
69
+ function RunRow({ run }) {
70
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
71
+ /* @__PURE__ */ jsx("span", {
72
+ className: "dot",
73
+ "data-rating": stateRating(run.state),
74
+ title: stateLabel(run.state)
75
+ }),
76
+ /* @__PURE__ */ jsxs("span", {
77
+ className: "title",
78
+ title: run.title,
79
+ children: [run.name, /* @__PURE__ */ jsx("small", { children: run.title })]
80
+ }),
81
+ /* @__PURE__ */ jsx("span", {
82
+ className: "mono",
83
+ children: run.sha
84
+ }),
85
+ /* @__PURE__ */ jsx("span", {
86
+ className: "mono",
87
+ children: age(run.startedAt)
88
+ })
89
+ ] });
90
+ return /* @__PURE__ */ jsx("li", { children: run.url ? /* @__PURE__ */ jsx("a", {
91
+ href: run.url,
92
+ target: "_blank",
93
+ rel: "noreferrer",
94
+ children: content
95
+ }) : /* @__PURE__ */ jsx("span", { children: content }) });
96
+ }
97
+ function Deployment({ deployment }) {
98
+ if (!deployment) return /* @__PURE__ */ jsx("p", {
99
+ className: "muted",
100
+ children: "Nothing deployed."
101
+ });
102
+ const rows = [
103
+ ["Environment", deployment.environment],
104
+ ["Image", deployment.image],
105
+ ["Sha", deployment.sha],
106
+ ["Ready", deployment.ready],
107
+ ["Since", deployment.at && `${age(deployment.at)} ago`]
108
+ ];
109
+ return /* @__PURE__ */ jsx("table", {
110
+ className: "vitals",
111
+ children: /* @__PURE__ */ jsx("tbody", { children: rows.flatMap(([label, value]) => value ? /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("td", {
112
+ className: "label",
113
+ children: label
114
+ }), /* @__PURE__ */ jsx("td", { children: value })] }, label) : []) })
115
+ });
116
+ }
117
+ function CiSection({ ctx }) {
118
+ const { data, error, loading, refresh } = usePoll(ctx, "/ci", CI_POLL_MS);
119
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("section", {
120
+ "aria-label": "CI",
121
+ children: [
122
+ /* @__PURE__ */ jsxs("div", {
123
+ className: "row",
124
+ children: [/* @__PURE__ */ jsxs("h3", { children: ["CI", data ? ` · ${data.repo}` : ""] }), /* @__PURE__ */ jsx("button", {
125
+ type: "button",
126
+ className: "chip",
127
+ onClick: refresh,
128
+ children: "refresh"
129
+ })]
130
+ }),
131
+ loading && /* @__PURE__ */ jsx("p", {
132
+ className: "muted",
133
+ children: "Loading…"
134
+ }),
135
+ error && /* @__PURE__ */ jsx("p", {
136
+ className: "warn",
137
+ children: error
138
+ }),
139
+ data && !data.configured && /* @__PURE__ */ jsx(Missing, { name: data.missing }),
140
+ data?.configured && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
141
+ className: "head",
142
+ children: [
143
+ /* @__PURE__ */ jsx("span", {
144
+ className: "dot",
145
+ "data-rating": stateRating(data.state)
146
+ }),
147
+ /* @__PURE__ */ jsx("span", {
148
+ className: "branch",
149
+ children: data.branch ?? "no branch"
150
+ }),
151
+ /* @__PURE__ */ jsxs("span", {
152
+ className: "muted",
153
+ children: [data.branch ? stateLabel(data.state) : "latest runs, all branches", data.sha ? ` @ ${data.sha}` : ""]
154
+ })
155
+ ]
156
+ }), data.runs.length > 0 ? /* @__PURE__ */ jsx("ul", { children: data.runs.map((run) => /* @__PURE__ */ jsx(RunRow, { run }, run.id)) }) : /* @__PURE__ */ jsxs("p", {
157
+ className: "muted",
158
+ children: [
159
+ "No runs",
160
+ data.branch ? ` on ${data.branch}` : "",
161
+ "."
162
+ ]
163
+ })] })
164
+ ]
165
+ }), data && data.deployment !== void 0 && /* @__PURE__ */ jsxs("section", {
166
+ "aria-label": "Deployment",
167
+ children: [/* @__PURE__ */ jsx("h3", { children: "Deployment" }), /* @__PURE__ */ jsx(Deployment, { deployment: data.deployment })]
168
+ })] });
169
+ }
170
+ function formatStat(value, unit) {
171
+ if (value === null) return "–";
172
+ return `${value.toFixed(value < 10 ? 2 : 0)}${unit}`;
173
+ }
174
+ function TelemetrySection({ ctx }) {
175
+ const [range, setRange] = useState("1h");
176
+ const { data, error, loading } = usePoll(ctx, `/telemetry?range=${range}`, TELEMETRY_POLL_MS);
177
+ return /* @__PURE__ */ jsxs("section", {
178
+ "aria-label": "Telemetry",
179
+ children: [
180
+ /* @__PURE__ */ jsxs("div", {
181
+ className: "row",
182
+ children: [/* @__PURE__ */ jsxs("h3", { children: ["Telemetry", data ? ` · ${data.service}` : ""] }), /* @__PURE__ */ jsx("div", {
183
+ className: "ranges",
184
+ children: TELEMETRY_RANGES.map((r) => /* @__PURE__ */ jsx("button", {
185
+ type: "button",
186
+ className: "chip",
187
+ "aria-pressed": r === range,
188
+ onClick: () => setRange(r),
189
+ children: r
190
+ }, r))
191
+ })]
192
+ }),
193
+ loading && !data && /* @__PURE__ */ jsx("p", {
194
+ className: "muted",
195
+ children: "Loading…"
196
+ }),
197
+ error && /* @__PURE__ */ jsx("p", {
198
+ className: "warn",
199
+ children: error
200
+ }),
201
+ data && !data.configured && /* @__PURE__ */ jsx(Missing, { name: data.missing }),
202
+ data?.configured && /* @__PURE__ */ jsxs("div", {
203
+ className: "stats",
204
+ children: [
205
+ /* @__PURE__ */ jsxs("div", {
206
+ className: "stat",
207
+ children: [/* @__PURE__ */ jsx("b", { children: formatStat(data.errorRate, "/s") }), /* @__PURE__ */ jsx("span", { children: "errors" })]
208
+ }),
209
+ /* @__PURE__ */ jsxs("div", {
210
+ className: "stat",
211
+ children: [/* @__PURE__ */ jsx("b", { children: formatStat(data.p95Ms, " ms") }), /* @__PURE__ */ jsx("span", { children: "p95" })]
212
+ }),
213
+ /* @__PURE__ */ jsxs("div", {
214
+ className: "stat",
215
+ children: [/* @__PURE__ */ jsx("b", { children: formatStat(data.requestRate, "/s") }), /* @__PURE__ */ jsx("span", { children: "requests" })]
216
+ })
217
+ ]
218
+ })
219
+ ]
220
+ });
221
+ }
222
+ /** The ops panel: CI runs and deployment, telemetry. Loaded on first open. */
223
+ function OpsPanel({ ctx, ci, telemetry }) {
224
+ return /* @__PURE__ */ jsxs("div", {
225
+ className: "ops",
226
+ children: [
227
+ /* @__PURE__ */ jsx("style", { children: OPS_CSS }),
228
+ ci && /* @__PURE__ */ jsx(CiSection, { ctx }),
229
+ telemetry && /* @__PURE__ */ jsx(TelemetrySection, { ctx })
230
+ ]
231
+ });
232
+ }
233
+ //#endregion
234
+ export { age, OpsPanel as default };
@@ -44,6 +44,28 @@ interface ComponentHint {
44
44
  name: string;
45
45
  path: string;
46
46
  }
47
+ /** A PNG of the grabbed element, as the `capture` plugin attaches it. */
48
+ interface GrabScreenshotImage {
49
+ status: "ready";
50
+ mime: "image/png";
51
+ /** The PNG, base64 encoded. */
52
+ base64: string;
53
+ width: number;
54
+ height: number;
55
+ /** `element` when the crop matched the selector, `viewport` when it fell back to the page. */
56
+ scope: "element" | "viewport";
57
+ }
58
+ /**
59
+ * The grab's screenshot: absent without the `capture` plugin, `pending` while
60
+ * it renders, `unavailable` with a reason (and a setup hint) when it cannot.
61
+ */
62
+ type GrabScreenshot = {
63
+ status: "pending";
64
+ } | GrabScreenshotImage | {
65
+ status: "unavailable";
66
+ reason: string;
67
+ hint?: string;
68
+ };
47
69
  /** What a completed grab hands to plugins (`onGrab`, `ctx.grab`). */
48
70
  interface GrabPayload {
49
71
  app: string;
@@ -57,6 +79,8 @@ interface GrabPayload {
57
79
  height: number;
58
80
  };
59
81
  grabbedAt: string;
82
+ /** Attached after the grab by the `capture` plugin's `onGrab`; see `HudGrab.amend`. */
83
+ screenshot?: GrabScreenshot;
60
84
  }
61
85
  /**
62
86
  * Scores manifest entries against the route and anchor label. Pure token
@@ -65,4 +89,4 @@ interface GrabPayload {
65
89
  */
66
90
  declare function matchComponentHints(hints: readonly ComponentHint[] | undefined, route: string, label: string, max?: number): ComponentHint[];
67
91
  //#endregion
68
- export { GrabComponent as a, matchComponentHints as i, GrabAnchor as n, GrabPayload as r, ComponentHint as t };
92
+ export { GrabScreenshotImage as a, GrabScreenshot as i, GrabAnchor as n, matchComponentHints as o, GrabPayload as r, GrabComponent as s, ComponentHint as t };
@@ -0,0 +1,2 @@
1
+ import { a as A11yFinding, c as AxeImpact, i as A11yStatus, n as a11y, o as AXE_URL, r as A11ySnapshot, s as AXE_VERSION, t as A11yOptions } from "../index-DqOyNf1u.js";
2
+ export { type A11yFinding, A11yOptions, type A11ySnapshot, type A11yStatus, AXE_URL, AXE_VERSION, type AxeImpact, a11y };
@@ -0,0 +1,2 @@
1
+ import { a as AXE_VERSION, i as AXE_URL, t as a11y } from "../a11y-B5DUaiCs.js";
2
+ export { AXE_URL, AXE_VERSION, a11y };
@@ -1,7 +1,7 @@
1
- import { r as HudCapability } from "../../plugins-CQ_0w1ot.js";
2
- import { t as HudEnv } from "../../env-vEjyJfPW.js";
3
- import { a as signHudUnlockToken, c as CAPABILITY_MATRIX, d as hasCapability, f as isHudVisible, i as resolveHudAccess, l as CapabilityMatrixOverride, n as HudAccess, o as verifyHudUnlockToken, r as hudRequiresUnlock, s as ACCESS_UNLOCK_CAPABILITY, t as HUD_UNLOCK_COOKIE, u as HUD_CAPABILITIES } from "../../access-CNvJOwKM.js";
4
- import { t as HudGuard } from "../../handler-WmE4Lu7l.js";
1
+ import { r as HudCapability } from "../../plugins-BZvDqGx5.js";
2
+ import { t as HudEnv } from "../../env-CApnbI0r.js";
3
+ import { a as signHudUnlockToken, c as CAPABILITY_MATRIX, d as hasCapability, f as isHudVisible, i as resolveHudAccess, l as CapabilityMatrixOverride, n as HudAccess, o as verifyHudUnlockToken, p as isProductionDenied, r as hudRequiresUnlock, s as ACCESS_UNLOCK_CAPABILITY, t as HUD_UNLOCK_COOKIE, u as HUD_CAPABILITIES } from "../../access-D_ewAEJG.js";
4
+ import { t as HudGuard } from "../../handler-DtYVCZY6.js";
5
5
  //#region src/plugins/access/server/settings.d.ts
6
6
  /** What the server half reads from its environment, per request. */
7
7
  interface AccessSettings {
@@ -119,4 +119,4 @@ export declare function accessServer(options?: AccessServerOptions): {
119
119
  };
120
120
  };
121
121
  //#endregion
122
- export { ACCESS_UNLOCK_CAPABILITY, type AccessServerOptions, type AccessSettings, CAPABILITY_MATRIX, type CapabilityMatrixOverride, HUD_CAPABILITIES, HUD_UNLOCK_COOKIE, type HudAccess, type HudGuardResult, hasCapability, hudRequiresUnlock, isHudVisible, resolveHudAccess, signHudUnlockToken, verifyHudUnlockToken };
122
+ export { ACCESS_UNLOCK_CAPABILITY, type AccessServerOptions, type AccessSettings, CAPABILITY_MATRIX, type CapabilityMatrixOverride, HUD_CAPABILITIES, HUD_UNLOCK_COOKIE, type HudAccess, type HudGuardResult, hasCapability, hudRequiresUnlock, isHudVisible, isProductionDenied, resolveHudAccess, signHudUnlockToken, verifyHudUnlockToken };
@@ -1,6 +1,7 @@
1
1
  import { i as definePlugin } from "../../plugins-DVy_vaYr.js";
2
- import { n as resolveHudEnv } from "../../env-DfxpPfs9.js";
3
- import { a as isHudVisible, c as HUD_UNLOCK_COOKIE, d as hudUnlockTtlMs, f as readCookie, g as verifyHudUnlockToken, h as timingSafeEqual, i as hasCapability, l as hudRequiresUnlock, m as signHudUnlockToken, n as CAPABILITY_MATRIX, o as resolveMatrix, p as resolveHudAccess, r as HUD_CAPABILITIES, t as ACCESS_UNLOCK_CAPABILITY, u as hudUnlockCookieString } from "../../capabilities-CjulXFQX.js";
2
+ import { n as resolveHudEnv } from "../../env-CaiFPIhF.js";
3
+ import { a as readCookie, c as timingSafeEqual, i as hudUnlockTtlMs, l as verifyHudUnlockToken, n as hudRequiresUnlock, o as resolveHudAccess, r as hudUnlockCookieString, s as signHudUnlockToken, t as HUD_UNLOCK_COOKIE } from "../../access-C7zlaqj6.js";
4
+ import { a as isHudVisible, i as hasCapability, n as CAPABILITY_MATRIX, o as isProductionDenied, r as HUD_CAPABILITIES, s as resolveMatrix, t as ACCESS_UNLOCK_CAPABILITY } from "../../capabilities-rDSKjXpq.js";
4
5
  //#region src/plugins/access/server/settings.ts
5
6
  /** The key material unlock cookies are signed with. */
6
7
  function signingSecret({ secret, password }) {
@@ -336,4 +337,4 @@ function accessServer(options = {}) {
336
337
  });
337
338
  }
338
339
  //#endregion
339
- export { ACCESS_UNLOCK_CAPABILITY, CAPABILITY_MATRIX, HUD_CAPABILITIES, HUD_UNLOCK_COOKIE, accessGuard, accessServer, checkHudRequest, handleHudUnlockAttempt, handleHudUnlockStatus, hasCapability, hudRequiresUnlock, isHudRequestUnlocked, isHudVisible, readAccessSettings, resetHudUnlockAttempts, resolveHudAccess, signHudUnlockToken, trackedHudUnlockClients, verifyHudUnlockToken };
340
+ export { ACCESS_UNLOCK_CAPABILITY, CAPABILITY_MATRIX, HUD_CAPABILITIES, HUD_UNLOCK_COOKIE, accessGuard, accessServer, checkHudRequest, handleHudUnlockAttempt, handleHudUnlockStatus, hasCapability, hudRequiresUnlock, isHudRequestUnlocked, isHudVisible, isProductionDenied, readAccessSettings, resetHudUnlockAttempts, resolveHudAccess, signHudUnlockToken, trackedHudUnlockClients, verifyHudUnlockToken };
@@ -1,7 +1,6 @@
1
- import { c as HudPluginProps, r as HudCapability } from "../plugins-CQ_0w1ot.js";
2
- import "../index-BYsdS-7d.js";
3
- import { c as CAPABILITY_MATRIX, d as hasCapability, i as resolveHudAccess, l as CapabilityMatrixOverride, n as HudAccess, r as hudRequiresUnlock, s as ACCESS_UNLOCK_CAPABILITY, u as HUD_CAPABILITIES } from "../access-CNvJOwKM.js";
4
- //#region src/plugins/access/access-panel.d.ts
1
+ import { c as HudPluginProps, r as HudCapability } from "../plugins-BZvDqGx5.js";
2
+ import { c as CAPABILITY_MATRIX, d as hasCapability, i as resolveHudAccess, l as CapabilityMatrixOverride, n as HudAccess, p as isProductionDenied, r as hudRequiresUnlock, s as ACCESS_UNLOCK_CAPABILITY, u as HUD_CAPABILITIES } from "../access-D_ewAEJG.js";
3
+ //#region src/plugins/access/access-pill.d.ts
5
4
  declare function AccessPill(): import("react").JSX.Element;
6
5
  //#endregion
7
6
  //#region src/plugins/access/unlock-store.d.ts
@@ -31,6 +30,7 @@ export declare function access(options?: AccessOptions): {
31
30
  readonly title: "Access";
32
31
  readonly capability: "access.unlock";
33
32
  readonly pill: typeof AccessPill;
33
+ readonly pillPriority: 30;
34
34
  readonly panel: ({ ctx }: HudPluginProps) => import("react").JSX.Element;
35
35
  readonly access: {
36
36
  readonly can: (env: string, capability: HudCapability) => boolean;
@@ -38,4 +38,4 @@ export declare function access(options?: AccessOptions): {
38
38
  };
39
39
  };
40
40
  //#endregion
41
- export { ACCESS_UNLOCK_CAPABILITY, CAPABILITY_MATRIX, type CapabilityMatrixOverride, HUD_CAPABILITIES, type HudAccess, type UnlockStatus, hasCapability, hudRequiresUnlock, resolveHudAccess };
41
+ export { ACCESS_UNLOCK_CAPABILITY, CAPABILITY_MATRIX, type CapabilityMatrixOverride, HUD_CAPABILITIES, type HudAccess, type UnlockStatus, hasCapability, hudRequiresUnlock, isProductionDenied, resolveHudAccess };
@@ -1,121 +1,10 @@
1
- import { i as definePlugin, n as HudApiError } from "../plugins-DVy_vaYr.js";
2
- import { d as hudUnlockTtlMs, i as hasCapability, l as hudRequiresUnlock, n as CAPABILITY_MATRIX, o as resolveMatrix, p as resolveHudAccess, r as HUD_CAPABILITIES, s as toHudEnv, t as ACCESS_UNLOCK_CAPABILITY } from "../capabilities-CjulXFQX.js";
3
- import { useEffect, useState, useSyncExternalStore } from "react";
1
+ import { i as definePlugin } from "../plugins-DVy_vaYr.js";
2
+ import { n as hudRequiresUnlock, o as resolveHudAccess } from "../access-C7zlaqj6.js";
3
+ import { c as toHudEnv, i as hasCapability, n as CAPABILITY_MATRIX, o as isProductionDenied, r as HUD_CAPABILITIES, s as resolveMatrix, t as ACCESS_UNLOCK_CAPABILITY } from "../capabilities-rDSKjXpq.js";
4
+ import { n as useUnlockState, r as useUnlocked } from "../unlock-store-4V3vR4Eg.js";
5
+ import { lazy } from "react";
4
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- //#region src/plugins/access/unlock-store.ts
6
- /**
7
- * Unlock state of the page's HUD. The browser never sees the password or the
8
- * token: the cookie is httpOnly and only the server can judge it, so this
9
- * store asks the unlock route rather than reading anything locally.
10
- */
11
- let state = {
12
- env: "development",
13
- status: "checking",
14
- error: null
15
- };
16
- const listeners = /* @__PURE__ */ new Set();
17
- function set(patch) {
18
- state = {
19
- ...state,
20
- ...patch
21
- };
22
- for (const listener of listeners) listener();
23
- }
24
- function subscribe(listener) {
25
- listeners.add(listener);
26
- return () => listeners.delete(listener);
27
- }
28
- const getState = () => state;
29
- function useUnlockState() {
30
- return useSyncExternalStore(subscribe, getState, getState);
31
- }
32
- function errorOf(body) {
33
- if (body && typeof body === "object" && "error" in body && typeof body.error === "string") return body.error;
34
- }
35
- /** Asks `<apiBase>/access/unlock` whether this browser is unlocked. Any failure keeps it shut. */
36
- async function refreshUnlockStatus(apiBase) {
37
- try {
38
- const res = await fetch(`${apiBase.replace(/\/+$/, "")}/access/unlock`, {
39
- cache: "no-store",
40
- headers: { accept: "application/json" }
41
- });
42
- const body = await res.json().catch(() => ({}));
43
- if (!res.ok || !body || typeof body !== "object") {
44
- set({ status: "locked" });
45
- return;
46
- }
47
- const { configured, unlocked } = body;
48
- set({ status: configured === false ? "unconfigured" : unlocked === true ? "unlocked" : "locked" });
49
- } catch {
50
- set({ status: "locked" });
51
- }
52
- }
53
- /** Trades the password for the unlock cookie through the plugin's own route. */
54
- async function submitPassword(api, password) {
55
- set({ error: null });
56
- try {
57
- if ((await api("/unlock", {
58
- method: "POST",
59
- headers: { "content-type": "application/json" },
60
- body: JSON.stringify({ password })
61
- }))?.unlocked === true) {
62
- set({ status: "unlocked" });
63
- return true;
64
- }
65
- set({ error: "unlock refused" });
66
- } catch (cause) {
67
- set({ error: cause instanceof HudApiError ? errorOf(cause.body) ?? `unlock refused (${cause.status})` : "unlock failed" });
68
- }
69
- return false;
70
- }
71
- /**
72
- * `HudAccessControl.useUnlocked`: development is open, a disabled or unknown
73
- * tier never unlocks, every deployed tier asks the server once per mount.
74
- */
75
- function useUnlocked(envName, apiBase) {
76
- const env = toHudEnv(envName);
77
- const access = resolveHudAccess(env);
78
- const { status } = useUnlockState();
79
- useEffect(() => {
80
- const required = hudRequiresUnlock(access);
81
- set({
82
- env,
83
- status: access === "open" ? "unlocked" : required ? "checking" : "locked"
84
- });
85
- if (required) refreshUnlockStatus(apiBase);
86
- }, [
87
- env,
88
- access,
89
- apiBase
90
- ]);
91
- if (access === "open") return true;
92
- if (access === "denied") return false;
93
- return status === "unlocked";
94
- }
95
- //#endregion
96
- //#region src/plugins/access/access-panel.tsx
97
- const ACCESS_TEXT = {
98
- open: "open, no password",
99
- password: "password",
100
- flag: "password, observe-only",
101
- denied: "disabled"
102
- };
103
- const field = {
104
- flex: 1,
105
- minWidth: 0,
106
- padding: "3px 6px",
107
- font: "inherit",
108
- fontFamily: "var(--hud-mono)",
109
- color: "var(--hud-fg)",
110
- background: "var(--hud-bg-subtle)",
111
- border: "1px solid var(--hud-border)",
112
- borderRadius: 4
113
- };
114
- const button = {
115
- padding: "3px 10px",
116
- border: "1px solid var(--hud-border)",
117
- borderRadius: 4
118
- };
7
+ //#region src/plugins/access/access-pill.tsx
119
8
  function AccessPill() {
120
9
  const { env, status } = useUnlockState();
121
10
  const access = resolveHudAccess(env);
@@ -125,104 +14,9 @@ function AccessPill() {
125
14
  "data-rating": unlocked ? "good" : "poor"
126
15
  }), access === "open" ? "Open" : unlocked ? "Unlocked" : "Locked"] });
127
16
  }
128
- /** The panel a locked deployed HUD shows instead of every other plugin. */
129
- function createAccessPanel(matrix) {
130
- return function AccessPanel({ ctx }) {
131
- const { env, status, error } = useUnlockState();
132
- const [password, setPassword] = useState("");
133
- const [submitting, setSubmitting] = useState(false);
134
- const access = resolveHudAccess(env);
135
- const ttlHours = hudUnlockTtlMs(access) / 36e5;
136
- async function onSubmit(event) {
137
- event.preventDefault();
138
- if (!password || submitting) return;
139
- setSubmitting(true);
140
- const ok = await submitPassword(ctx.api, password);
141
- setSubmitting(false);
142
- if (ok) setPassword("");
143
- }
144
- return /* @__PURE__ */ jsxs("div", {
145
- style: {
146
- display: "grid",
147
- gap: 8
148
- },
149
- children: [
150
- /* @__PURE__ */ jsxs("div", { children: [
151
- /* @__PURE__ */ jsx("strong", { children: env }),
152
- " ",
153
- /* @__PURE__ */ jsxs("span", {
154
- className: "empty",
155
- children: ["· ", ACCESS_TEXT[access]]
156
- })
157
- ] }),
158
- status === "unconfigured" && /* @__PURE__ */ jsx("p", {
159
- className: "empty",
160
- style: { margin: 0 },
161
- children: "No unlock password is configured on this deployment's server, so the HUD cannot be unlocked here."
162
- }),
163
- status !== "unconfigured" && access !== "open" && status !== "unlocked" && /* @__PURE__ */ jsxs("form", {
164
- style: {
165
- display: "flex",
166
- gap: 6
167
- },
168
- onSubmit,
169
- children: [/* @__PURE__ */ jsx("input", {
170
- type: "password",
171
- autoComplete: "off",
172
- value: password,
173
- onChange: (event) => setPassword(event.target.value),
174
- placeholder: "hud password",
175
- "aria-label": "hud password",
176
- style: field
177
- }), /* @__PURE__ */ jsx("button", {
178
- type: "submit",
179
- style: button,
180
- disabled: !password || submitting,
181
- children: submitting ? "Checking…" : "Unlock"
182
- })]
183
- }),
184
- error && /* @__PURE__ */ jsx("p", {
185
- role: "alert",
186
- style: {
187
- margin: 0,
188
- color: "var(--hud-poor)"
189
- },
190
- children: error
191
- }),
192
- access !== "open" && status === "unlocked" && /* @__PURE__ */ jsxs("p", {
193
- className: "empty",
194
- style: { margin: 0 },
195
- children: [
196
- "Unlocked for up to ",
197
- ttlHours,
198
- " h."
199
- ]
200
- }),
201
- access !== "open" && status !== "unlocked" && ttlHours > 0 && /* @__PURE__ */ jsxs("p", {
202
- className: "empty",
203
- style: { margin: 0 },
204
- children: [
205
- "An unlock lasts ",
206
- ttlHours,
207
- " h."
208
- ]
209
- }),
210
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
211
- className: "empty",
212
- children: "Capabilities"
213
- }), /* @__PURE__ */ jsx("code", {
214
- style: {
215
- fontFamily: "var(--hud-mono)",
216
- whiteSpace: "pre-wrap"
217
- },
218
- children: env === "development" ? "all" : matrix[env].join("\n") || "none"
219
- })] })
220
- ]
221
- });
222
- };
223
- }
224
17
  //#endregion
225
18
  //#region src/plugins/access/index.tsx
19
+ const Panel = lazy(() => import("../access-panel-CEfTr9ZI.js"));
226
20
  /**
227
21
  * Opt-in for deployed tiers. Without it `defineHud` renders nothing outside
228
22
  * development. With it the HUD follows the env ladder: a tier's capability
@@ -234,12 +28,19 @@ function createAccessPanel(matrix) {
234
28
  */
235
29
  function access(options = {}) {
236
30
  const matrix = resolveMatrix(options.matrix);
31
+ function AccessPanel({ ctx }) {
32
+ return /* @__PURE__ */ jsx(Panel, {
33
+ ctx,
34
+ matrix
35
+ });
36
+ }
237
37
  return definePlugin({
238
38
  id: "access",
239
39
  title: "Access",
240
40
  capability: ACCESS_UNLOCK_CAPABILITY,
241
41
  pill: AccessPill,
242
- panel: createAccessPanel(matrix),
42
+ pillPriority: 30,
43
+ panel: AccessPanel,
243
44
  access: {
244
45
  can: (env, capability) => capability === "access.unlock" || hasCapability(toHudEnv(env), capability, matrix),
245
46
  useUnlocked
@@ -247,4 +48,4 @@ function access(options = {}) {
247
48
  });
248
49
  }
249
50
  //#endregion
250
- export { ACCESS_UNLOCK_CAPABILITY, CAPABILITY_MATRIX, HUD_CAPABILITIES, access, hasCapability, hudRequiresUnlock, resolveHudAccess };
51
+ export { ACCESS_UNLOCK_CAPABILITY, CAPABILITY_MATRIX, HUD_CAPABILITIES, access, hasCapability, hudRequiresUnlock, isProductionDenied, resolveHudAccess };
@@ -1,42 +1,7 @@
1
- import { r as GrabPayload, t as ComponentHint } from "../../payload-CLKDVZWl.js";
2
- import { a as DispatchTargetInfo, i as DispatchReceipt, n as AgentSessionStatus, o as SessionsResponse, r as DispatchBody, t as AgentSession } from "../../types-DADBRiGk.js";
1
+ import { r as GrabPayload, t as ComponentHint } from "../../payload-MUQ9ciER.js";
2
+ import { a as DispatchTargetInfo, i as DispatchReceipt, n as AgentSessionStatus, o as SessionsResponse, r as DispatchBody, t as AgentSession } from "../../types-Cxh4twqc.js";
3
+ import { n as DispatchProvider, r as ProviderStatus, t as DispatchOrder } from "../../types-szkr2QOF.js";
3
4
  import { ChildProcess, SpawnOptions } from "node:child_process";
4
- //#region src/plugins/agent/providers/types.d.ts
5
- /** What a provider receives: the raw request plus the prompt built from it. */
6
- interface DispatchOrder {
7
- note: string;
8
- payload: GrabPayload | null;
9
- hints: ComponentHint[];
10
- /** `dispatchPrompt(...)` of the above; what an agent should be told. */
11
- prompt: string;
12
- }
13
- type ProviderStatus = {
14
- available: true;
15
- } | {
16
- available: false;
17
- reason: string;
18
- };
19
- /**
20
- * The `dispatch` provider seam. One implementation per backend: `hermes()`
21
- * and `claudeCode()` ship with the plugin; anything with the same shape works.
22
- * Runs server side only.
23
- */
24
- interface DispatchProvider {
25
- /** Unique among the providers passed in; the client selects a target by it. */
26
- id: string;
27
- label: string;
28
- description?: string;
29
- /** Default: available. */
30
- status?: () => ProviderStatus | Promise<ProviderStatus>;
31
- /** Starts work and returns as soon as it is accepted, not when it finishes. */
32
- dispatch: (order: DispatchOrder) => Promise<{
33
- runId: string;
34
- detail?: string;
35
- }>;
36
- /** Runs and sessions this backend knows about, for the Sessions panel. */
37
- sessions?: () => Promise<AgentSession[]>;
38
- }
39
- //#endregion
40
5
  //#region src/plugins/agent/prompt.d.ts
41
6
  interface PromptInput {
42
7
  note: string;