@hansenexus/hud 0.6.0 → 0.8.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/README.md +172 -25
- package/dist/{a11y-B5DUaiCs.js → a11y-BGWw4jBr.js} +14 -2
- package/dist/{a11y-panel-p_t4eD7p.js → a11y-panel-DcfXnPHk.js} +1 -1
- package/dist/{access-D_ewAEJG.d.ts → access-CwPCPsv0.d.ts} +1 -1
- package/dist/{access-panel-CEfTr9ZI.js → access-panel-grAsMEDk.js} +1 -1
- package/dist/auto/runtime.d.ts +9 -9
- package/dist/auto.d.ts +2 -2
- package/dist/auto.js +5 -5
- package/dist/cli.js +34 -1
- package/dist/{data-panel-BmcHCQnM.js → data-panel-B6WPNmV6.js} +1 -1
- package/dist/{data-store-ChF1td_P.js → data-store-FNTQKMkG.js} +1 -1
- package/dist/{define-hud-CHPedaQ5.d.ts → define-hud-B0aFXrcK.d.ts} +15 -5
- package/dist/{design-D0kGgPoP.js → design-BIXY1-Ex.js} +45 -11
- package/dist/{dispatch-panel-B-xr_Giy.js → dispatch-panel-BDHgMhOk.js} +1 -1
- package/dist/{force-state-panel-_otVYh9i.js → force-state-panel-D5oDydLs.js} +1 -1
- package/dist/{handler-BpVhxEmU.js → handler-BKzaOhlJ.js} +1 -1
- package/dist/{handler-DtYVCZY6.d.ts → handler-BmFhaA2D.d.ts} +1 -1
- package/dist/icons-ByDyNq_E.js +71 -0
- package/dist/index-5B7foZut.d.ts +116 -0
- package/dist/{index-ReFbhQ9p.d.ts → index-B2KCKkN0.d.ts} +5 -0
- package/dist/index-B7qaEUgh.d.ts +44 -0
- package/dist/{index-DcH9V3cU.d.ts → index-BGFyuJyN.d.ts} +3 -0
- package/dist/{index-Hhh7OXzU.d.ts → index-BeqWehuh.d.ts} +44 -10
- package/dist/{index-DstI_ike.d.ts → index-BqKysxTq.d.ts} +5 -1
- package/dist/{index-DqOyNf1u.d.ts → index-D97Fnoie.d.ts} +4 -2
- package/dist/{index-CwfX-W87.d.ts → index-DS0yT0c-.d.ts} +3 -0
- package/dist/{index-BAV_1W8a.d.ts → index-DvlCkGB1.d.ts} +3 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1226 -256
- package/dist/{inspect-C9Ft8fqn.js → inspect-CSkm8tn3.js} +14 -2
- package/dist/{inspect-root-BkaupBMp.js → inspect-root-CmiFX0e5.js} +1 -1
- package/dist/navigation-CX6AXm7H.js +176 -0
- package/dist/next.d.ts +4 -1
- package/dist/next.js +12 -1
- package/dist/{observe-CdDnDBRP.js → observe-CBNLU148.js} +12 -2
- package/dist/{observe-panel-Cgp1M8oT.js → observe-panel-zU5LD-U9.js} +1 -1
- package/dist/obstacles-CCmRFTcZ.js +176 -0
- package/dist/{ops-panel-CEqDe_UT.js → ops-panel-DHhAnChL.js} +1 -1
- package/dist/plugins/a11y.d.ts +1 -1
- package/dist/plugins/a11y.js +1 -1
- package/dist/plugins/access/server.d.ts +3 -3
- package/dist/plugins/access/server.js +1 -1
- package/dist/plugins/access.d.ts +5 -2
- package/dist/plugins/access.js +18 -5
- package/dist/plugins/agent/server.js +2 -2
- package/dist/plugins/agent.d.ts +4 -2
- package/dist/plugins/agent.js +6 -3
- package/dist/plugins/capture/server.js +1 -1
- package/dist/plugins/capture.d.ts +2 -2
- package/dist/plugins/capture.js +1 -1
- package/dist/plugins/data/server.d.ts +1 -1
- package/dist/plugins/data/server.js +2 -2
- package/dist/plugins/data.d.ts +1 -1
- package/dist/plugins/data.js +30 -9
- package/dist/plugins/design/server.d.ts +55 -15
- package/dist/plugins/design/server.js +188 -123
- package/dist/plugins/design.d.ts +3 -3
- package/dist/plugins/design.js +1 -1
- package/dist/plugins/inspect.d.ts +1 -1
- package/dist/plugins/inspect.js +1 -1
- package/dist/plugins/observe.d.ts +1 -1
- package/dist/plugins/observe.js +1 -1
- package/dist/plugins/ops/server.d.ts +1 -1
- package/dist/plugins/ops/server.js +1 -1
- package/dist/plugins/ops.d.ts +5 -1
- package/dist/plugins/ops.js +16 -4
- package/dist/plugins/routes/server.d.ts +1 -1
- package/dist/plugins/routes/server.js +1 -1
- package/dist/plugins/routes.d.ts +3 -3
- package/dist/plugins/routes.js +384 -53
- package/dist/plugins/seo.d.ts +1 -1
- package/dist/plugins/seo.js +1 -1
- package/dist/plugins/vitals.d.ts +1 -1
- package/dist/plugins/vitals.js +9 -1
- package/dist/{plugins-DVy_vaYr.js → plugins-CcW_K7c2.js} +9 -1
- package/dist/{plugins-BZvDqGx5.d.ts → plugins-pL2CoWzI.d.ts} +39 -3
- package/dist/{poll-CjKsWZi8.js → poll-Dm0OijM4.js} +1 -1
- package/dist/same-origin-BHuZO1_H.js +36 -0
- package/dist/{seo-Dq9q_QkO.js → seo-BnnGq_vj.js} +13 -2
- package/dist/{seo-panel-CfiY-TnT.js → seo-panel-BThx56KM.js} +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/{sessions-panel-COvhPAzv.js → sessions-panel-MknKsTge.js} +1 -1
- package/dist/store.d.ts +1 -1
- package/dist/store.js +2 -2
- package/dist/{meta-C_G7MB5w.d.ts → types-Dc6JWZR7.d.ts} +6 -6
- package/dist/{unlock-store-4V3vR4Eg.js → unlock-store-CrGXQx1V.js} +1 -1
- package/dist/variant-bar-BzZ0ln-C.js +768 -0
- package/dist/variant-picks-Byc0hC8a.js +144 -0
- package/dist/variants-export-vEtZ-OGC.js +75 -0
- package/dist/{variants-panel-BDoSkwBJ.js → variants-panel-D23v5KIp.js} +72 -55
- package/dist/variants-types-BOsZ5fDz.js +65 -0
- package/dist/variants-types-VkW7vFZF.d.ts +139 -0
- package/dist/variants.d.ts +1 -1
- package/dist/variants.js +1 -1
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +1 -1
- package/package.json +1 -1
- package/dist/index-BnQ0dTZf.d.ts +0 -19
- package/dist/index-gCZBO53s.d.ts +0 -73
- package/dist/same-origin-BGet22CC.js +0 -21
- package/dist/variants-types-CcRf119M.d.ts +0 -63
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createHudHandler } from "./handler-
|
|
1
|
+
import { t as createHudHandler } from "./handler-BKzaOhlJ.js";
|
|
2
2
|
import { n as detectHudAuto, r as parsePackageJson } from "./detect-CHZiSeZs.js";
|
|
3
3
|
import { t as generateAutoModule } from "./generate-C8lQl3Eh.js";
|
|
4
4
|
//#region src/vite/bridge.ts
|
package/package.json
CHANGED
package/dist/index-BnQ0dTZf.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { c as HudPluginProps } from "./plugins-BZvDqGx5.js";
|
|
2
|
-
//#region src/plugins/routes/routes-panel.d.ts
|
|
3
|
-
declare function RoutesPanel({ ctx }: HudPluginProps): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/plugins/routes/index.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Route index: every page of the app's `app/` tree, dynamic segments filled
|
|
8
|
-
* from the fixtures the server half knows, one click away. Client half; the
|
|
9
|
-
* scanner lives in `@hansenexus/hud/plugins/routes/server`, which also feeds
|
|
10
|
-
* the `hud sweep` CLI.
|
|
11
|
-
*/
|
|
12
|
-
declare function routes(): {
|
|
13
|
-
readonly id: "routes";
|
|
14
|
-
readonly title: "Routes";
|
|
15
|
-
readonly capability: "routes.read";
|
|
16
|
-
readonly panel: typeof RoutesPanel;
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
|
-
export { routes as t };
|
package/dist/index-gCZBO53s.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { o as HudPlugin, r as HudCapability } from "./plugins-BZvDqGx5.js";
|
|
2
|
-
import "./define-hud-CHPedaQ5.js";
|
|
3
|
-
//#region src/core/grabber/outline.d.ts
|
|
4
|
-
interface ElementOutlineProps {
|
|
5
|
-
/** The element to outline; `null` renders nothing. */
|
|
6
|
-
element: Element | null;
|
|
7
|
-
label: string;
|
|
8
|
-
/** Called on Escape, on a pointer press outside the overlay's own root, or once the element leaves the DOM. */
|
|
9
|
-
onDismiss: () => void;
|
|
10
|
-
/** Scroll the element into view when it changes. Default true. */
|
|
11
|
-
reveal?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Outlines one element with the grabber's overlay without entering grab mode:
|
|
15
|
-
* findings in a panel point at the page this way. The box follows scrolling
|
|
16
|
-
* and resizes; the outline goes away on Escape, on a press on the page, or
|
|
17
|
-
* when the element is removed.
|
|
18
|
-
*/
|
|
19
|
-
declare function ElementOutline({ element, label, onDismiss, reveal }: ElementOutlineProps): import("react").JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/core/grabber/picker.d.ts
|
|
22
|
-
interface PickPoint {
|
|
23
|
-
clientX: number;
|
|
24
|
-
clientY: number;
|
|
25
|
-
}
|
|
26
|
-
interface ElementPickerProps {
|
|
27
|
-
active: boolean;
|
|
28
|
-
onPick: (element: Element, point: PickPoint) => void;
|
|
29
|
-
onCancel: () => void;
|
|
30
|
-
/** Banner text while active. */
|
|
31
|
-
hint?: string;
|
|
32
|
-
/** Label next to the hover outline. Default: the tag name. */
|
|
33
|
-
describe?: (element: Element) => string;
|
|
34
|
-
/** Extra elements to leave alone, on top of the picker's own shadow host. */
|
|
35
|
-
ignore?: (element: Element) => boolean;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Styles for the picker overlay. The picker renders where it is mounted, so
|
|
39
|
-
* the caller puts these into the same (shadow) root. Colours fall back when
|
|
40
|
-
* the `--hud-*` tokens are absent.
|
|
41
|
-
*/
|
|
42
|
-
declare const PICKER_CSS = "\n.grab-layer { position: fixed; inset: 0; pointer-events: none; }\n.grab-hint {\n position: fixed;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 12px;\n border-radius: 0 0 6px 6px;\n white-space: nowrap;\n background: var(--hud-accent, #0369a1);\n color: var(--hud-accent-fg, #ffffff);\n font: 600 11px/1.5 var(--hud-mono, ui-monospace, monospace);\n}\n.grab-outline {\n position: fixed;\n border: 1.5px solid var(--hud-accent, #0369a1);\n background: color-mix(in srgb, var(--hud-accent, #0369a1) 8%, transparent);\n border-radius: 3px;\n}\n.grab-label {\n position: fixed;\n max-width: min(480px, calc(100vw - 8px));\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 1px 6px;\n border-radius: 3px;\n background: var(--hud-accent, #0369a1);\n color: var(--hud-accent-fg, #ffffff);\n font: 600 10px/1.6 var(--hud-mono, ui-monospace, monospace);\n}\n";
|
|
43
|
-
/**
|
|
44
|
-
* Click-to-pick controller: crosshair, hover outline with a label, the next
|
|
45
|
-
* click picks, Escape cancels. Events inside the picker's own shadow host
|
|
46
|
-
* (the HUD's pill and panels) pass through untouched, so panels stay usable
|
|
47
|
-
* and mounted during a grab.
|
|
48
|
-
*/
|
|
49
|
-
declare function ElementPicker({ active, onPick, onCancel, hint, describe, ignore }: ElementPickerProps): import("react").JSX.Element;
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/shell/hud.d.ts
|
|
52
|
-
interface HudProps {
|
|
53
|
-
/** App slug: labels the pill and keys the persisted layout. */
|
|
54
|
-
appSlug: string;
|
|
55
|
-
/** Badge shown at the start of the pill. Default "DEV". */
|
|
56
|
-
envLabel?: string;
|
|
57
|
-
/** Client halves of the plugins, in pill order. Keep the array stable across renders. */
|
|
58
|
-
plugins?: readonly HudPlugin[];
|
|
59
|
-
/** Base path of the plugin routes. Default "/api/hud". */
|
|
60
|
-
apiBase?: string;
|
|
61
|
-
/** Capability check. Default: grant all (core assumes development). Keep it stable. */
|
|
62
|
-
can?: (capability: HudCapability) => boolean;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* The HUD shell: a shadow-rooted status pill and floating panels.
|
|
66
|
-
*
|
|
67
|
-
* It renders unconditionally. Keeping it out of production builds is the
|
|
68
|
-
* loader's job, at the import site, so a bundler can drop the whole module
|
|
69
|
-
* (see `@hansenexus/hud/next`).
|
|
70
|
-
*/
|
|
71
|
-
declare function Hud({ appSlug, envLabel, plugins, apiBase, can }: HudProps): import("react").JSX.Element;
|
|
72
|
-
//#endregion
|
|
73
|
-
export { PICKER_CSS as a, ElementOutlineProps as c, ElementPickerProps as i, HudProps as n, PickPoint as o, ElementPicker as r, ElementOutline as s, Hud as t };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//#region src/server/same-origin.ts
|
|
2
|
-
/**
|
|
3
|
-
* Refuses a state-changing request from another origin. A page elsewhere must
|
|
4
|
-
* not be able to write through the developer's browser: a JSON content type
|
|
5
|
-
* forces a CORS preflight that HUD routes never answer, and `Sec-Fetch-Site`
|
|
6
|
-
* rejects cross-site requests outright where the browser sends it.
|
|
7
|
-
*/
|
|
8
|
-
function refuseCrossSite(request) {
|
|
9
|
-
const site = request.headers.get("sec-fetch-site");
|
|
10
|
-
if (site && site !== "same-origin" && site !== "none") return Response.json({
|
|
11
|
-
ok: false,
|
|
12
|
-
error: "cross-site request refused"
|
|
13
|
-
}, { status: 403 });
|
|
14
|
-
if (!request.headers.get("content-type")?.toLowerCase().startsWith("application/json")) return Response.json({
|
|
15
|
-
ok: false,
|
|
16
|
-
error: "expected application/json"
|
|
17
|
-
}, { status: 415 });
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { refuseCrossSite as t };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
//#region src/plugins/design/variants-types.d.ts
|
|
2
|
-
/** Wire types shared by the Variants panel and `variantsServer()`. */
|
|
3
|
-
/** The store collection scores and decisions live in: `.hud/variants.json` with `file()`. */
|
|
4
|
-
declare const VARIANTS_COLLECTION = "variants";
|
|
5
|
-
type VariantStatus = "open" | "decided" | "rejected";
|
|
6
|
-
/**
|
|
7
|
-
* One variant's record. The store keys it `<group>:<id>`; an agent writes
|
|
8
|
-
* `score`, `rationale` and `scoredBy`, Decide writes `status` and `decidedAt`.
|
|
9
|
-
* Everything but `group` and `id` is optional, since the file is edited by hand.
|
|
10
|
-
*/
|
|
11
|
-
interface VariantRecord {
|
|
12
|
-
group: string;
|
|
13
|
-
id: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
status?: VariantStatus;
|
|
16
|
-
/** Higher is better; the panel ranks by it. */
|
|
17
|
-
score?: number;
|
|
18
|
-
rationale?: string;
|
|
19
|
-
/** Who scored it, e.g. `claude-code`. */
|
|
20
|
-
scoredBy?: string;
|
|
21
|
-
/** ISO timestamp set by Decide on the winner. */
|
|
22
|
-
decidedAt?: string;
|
|
23
|
-
}
|
|
24
|
-
/** `GET <apiBase>/variants/`. */
|
|
25
|
-
interface VariantsListResponse {
|
|
26
|
-
ok: true;
|
|
27
|
-
records: VariantRecord[];
|
|
28
|
-
}
|
|
29
|
-
/** `POST <apiBase>/variants/:group/decide`. */
|
|
30
|
-
interface DecideBody {
|
|
31
|
-
/** The winner. */
|
|
32
|
-
id: string;
|
|
33
|
-
/** The group's label, for the brief. */
|
|
34
|
-
label?: string;
|
|
35
|
-
/** Every variant of the group as the page registers it, so losers get a record too. */
|
|
36
|
-
variants?: {
|
|
37
|
-
id: string;
|
|
38
|
-
label: string;
|
|
39
|
-
}[];
|
|
40
|
-
}
|
|
41
|
-
interface DecideResponse {
|
|
42
|
-
ok: true;
|
|
43
|
-
group: string;
|
|
44
|
-
id: string;
|
|
45
|
-
decidedAt: string;
|
|
46
|
-
/** The queued cleanup brief, or null when no dispatch provider is configured. */
|
|
47
|
-
queued: {
|
|
48
|
-
target: string;
|
|
49
|
-
runId: string;
|
|
50
|
-
detail?: string;
|
|
51
|
-
} | null;
|
|
52
|
-
/** The decision stuck but the brief did not go out. */
|
|
53
|
-
queueError?: string;
|
|
54
|
-
}
|
|
55
|
-
declare function recordKey(group: string, id: string): string;
|
|
56
|
-
/**
|
|
57
|
-
* A store entry as a `VariantRecord`: group and id come from the fields, or
|
|
58
|
-
* from a `<group>:<id>` key when the file omits them. Unknown fields are
|
|
59
|
-
* dropped, wrong types ignored; null when neither names the variant.
|
|
60
|
-
*/
|
|
61
|
-
declare function toVariantRecord(id: string, value: unknown): VariantRecord | null;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { VariantStatus as a, toVariantRecord as c, VariantRecord as i, DecideResponse as n, VariantsListResponse as o, VARIANTS_COLLECTION as r, recordKey as s, DecideBody as t };
|