@hansenexus/hud 0.7.0 → 0.9.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 +153 -14
- package/dist/{access-Bc709qpl.d.ts → access-CwPCPsv0.d.ts} +1 -1
- package/dist/auto/runtime.d.ts +9 -9
- package/dist/auto.d.ts +2 -2
- package/dist/auto.js +1 -1
- package/dist/cli.js +34 -1
- package/dist/{define-hud-DTv3njuU.d.ts → define-hud-B0aFXrcK.d.ts} +1 -1
- package/dist/{design-BXG1a4we.js → design-BIXY1-Ex.js} +26 -8
- package/dist/{force-state-panel-mu-txJnA.js → force-state-panel-D5oDydLs.js} +1 -1
- package/dist/{handler-DMzSTqyG.d.ts → handler-BmFhaA2D.d.ts} +1 -1
- package/dist/{index-C3wzZS3o.d.ts → index-5B7foZut.d.ts} +2 -2
- package/dist/{index-D-hI-DRJ.d.ts → index-B2KCKkN0.d.ts} +1 -1
- package/dist/index-B7qaEUgh.d.ts +44 -0
- package/dist/{index-CQXiuMZQ.d.ts → index-BGFyuJyN.d.ts} +1 -1
- package/dist/{index-Caohnz3B.d.ts → index-BeqWehuh.d.ts} +38 -10
- package/dist/{index-BJJoAXJ2.d.ts → index-BqKysxTq.d.ts} +1 -1
- package/dist/{index-DLCSLWW4.d.ts → index-D97Fnoie.d.ts} +2 -2
- package/dist/{index-BR5OB7DO.d.ts → index-DS0yT0c-.d.ts} +1 -1
- package/dist/{index-BNoPbSYD.d.ts → index-DvlCkGB1.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +49 -196
- package/dist/lanes-panel-Disg54DY.js +395 -0
- package/dist/navigation-CX6AXm7H.js +176 -0
- package/dist/next/config.cjs +2 -0
- package/dist/next/config.d.cts +1 -0
- package/dist/next/config.d.ts +1 -0
- package/dist/next/config.js +2 -0
- package/dist/next.d.ts +4 -1
- package/dist/next.js +12 -1
- package/dist/obstacles-CCmRFTcZ.js +176 -0
- package/dist/plugins/a11y.d.ts +1 -1
- package/dist/plugins/access/server.d.ts +3 -3
- package/dist/plugins/access.d.ts +2 -2
- package/dist/plugins/agent/server.js +1 -1
- package/dist/plugins/agent.d.ts +2 -2
- package/dist/plugins/capture.d.ts +2 -2
- package/dist/plugins/data/server.d.ts +1 -1
- package/dist/plugins/data/server.js +1 -1
- package/dist/plugins/data.d.ts +1 -1
- package/dist/plugins/design/server.d.ts +55 -15
- package/dist/plugins/design/server.js +187 -122
- 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/lanes/server.d.ts +165 -0
- package/dist/plugins/lanes/server.js +845 -0
- package/dist/plugins/lanes.d.ts +22 -0
- package/dist/plugins/lanes.js +30 -0
- package/dist/plugins/observe.d.ts +1 -1
- package/dist/plugins/ops/server.d.ts +1 -1
- package/dist/plugins/ops.d.ts +1 -1
- package/dist/plugins/routes/server.d.ts +1 -1
- package/dist/plugins/routes.d.ts +3 -3
- package/dist/plugins/routes.js +381 -52
- package/dist/plugins/seo.d.ts +1 -1
- package/dist/plugins/vitals.d.ts +1 -1
- package/dist/{plugins-BZT-1LBe.d.ts → plugins-pL2CoWzI.d.ts} +7 -0
- package/dist/same-origin-BHuZO1_H.js +36 -0
- package/dist/server.d.ts +2 -2
- package/dist/store.d.ts +1 -1
- package/dist/store.js +1 -1
- package/dist/types-BkrkOP3h.js +6 -0
- package/dist/types-Dazn3aWZ.d.ts +86 -0
- package/dist/{meta-C_G7MB5w.d.ts → types-Dc6JWZR7.d.ts} +6 -6
- 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-B6zWcknV.js → variants-panel-D23v5KIp.js} +71 -54
- 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/package.json +2 -2
- package/dist/index-B1vHAY9p.d.ts +0 -20
- package/dist/same-origin-BGet22CC.js +0 -21
- package/dist/variants-types-CcRf119M.d.ts +0 -63
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import "./marker-uZYPOJ4M.js";
|
|
2
|
+
import { createContext, useContext, useEffect, useState, useSyncExternalStore } from "react";
|
|
3
|
+
//#region src/shell/panels/panels-context.ts
|
|
4
|
+
const PanelsContext = createContext(null);
|
|
5
|
+
function usePanels() {
|
|
6
|
+
const api = useContext(PanelsContext);
|
|
7
|
+
if (!api) throw new Error("usePanels() used outside <PanelManager>");
|
|
8
|
+
return api;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/shell/pill/visual-viewport.ts
|
|
12
|
+
function subscribe(listener) {
|
|
13
|
+
const vv = window.visualViewport;
|
|
14
|
+
window.addEventListener("resize", listener);
|
|
15
|
+
vv?.addEventListener("resize", listener);
|
|
16
|
+
vv?.addEventListener("scroll", listener);
|
|
17
|
+
return () => {
|
|
18
|
+
window.removeEventListener("resize", listener);
|
|
19
|
+
vv?.removeEventListener("resize", listener);
|
|
20
|
+
vv?.removeEventListener("scroll", listener);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
let cached = {
|
|
24
|
+
x: 0,
|
|
25
|
+
y: 0,
|
|
26
|
+
w: 0,
|
|
27
|
+
h: 0,
|
|
28
|
+
detached: false
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* On a phone, a page wider than the screen (an image with a fixed width is
|
|
32
|
+
* enough) grows the layout viewport past the visible area, and a pill fixed
|
|
33
|
+
* to the bottom edge ends up below the fold. The visual viewport is what the
|
|
34
|
+
* user sees; the pill places itself in it.
|
|
35
|
+
*/
|
|
36
|
+
function read() {
|
|
37
|
+
const root = document.documentElement;
|
|
38
|
+
const layoutW = root.clientWidth || window.innerWidth;
|
|
39
|
+
const layoutH = root.clientHeight || window.innerHeight;
|
|
40
|
+
const vv = window.visualViewport;
|
|
41
|
+
const x = vv?.offsetLeft ?? 0;
|
|
42
|
+
const y = vv?.offsetTop ?? 0;
|
|
43
|
+
const w = Math.round(vv?.width ?? layoutW);
|
|
44
|
+
const h = Math.round(vv?.height ?? layoutH);
|
|
45
|
+
const detached = x !== 0 || y !== 0 || window.innerWidth > w + 1 || window.innerHeight > h + 1;
|
|
46
|
+
const next = {
|
|
47
|
+
x,
|
|
48
|
+
y,
|
|
49
|
+
w: detached ? w : layoutW,
|
|
50
|
+
h: detached ? h : layoutH,
|
|
51
|
+
detached
|
|
52
|
+
};
|
|
53
|
+
if (next.x !== cached.x || next.y !== cached.y || next.w !== cached.w || next.h !== cached.h || next.detached !== cached.detached) cached = next;
|
|
54
|
+
return cached;
|
|
55
|
+
}
|
|
56
|
+
function useVisualViewport() {
|
|
57
|
+
return useSyncExternalStore(subscribe, read, read);
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/shell/pill/obstacles.ts
|
|
61
|
+
/** Fixed elements covering more than this share of the viewport are backdrops, not corners. */
|
|
62
|
+
const MAX_AREA_SHARE = .5;
|
|
63
|
+
/** DOM changes settle for this long before the page is scanned again. */
|
|
64
|
+
const RESCAN_MS = 250;
|
|
65
|
+
function isFloating(el) {
|
|
66
|
+
const { position } = getComputedStyle(el);
|
|
67
|
+
return position === "fixed" || position === "sticky";
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The host page's fixed and sticky elements: what fights the pill for a
|
|
71
|
+
* corner. Nested ones are dropped since their floating ancestor already
|
|
72
|
+
* counts, and the HUD's own host is skipped.
|
|
73
|
+
*/
|
|
74
|
+
function scanFloating(root = document.body) {
|
|
75
|
+
const found = [];
|
|
76
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {
|
|
77
|
+
const el = node;
|
|
78
|
+
if (el.localName === "hn-hud") return NodeFilter.FILTER_REJECT;
|
|
79
|
+
return isFloating(el) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
80
|
+
} });
|
|
81
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
82
|
+
const el = node;
|
|
83
|
+
if (!found.some((outer) => outer.contains(el))) found.push(el);
|
|
84
|
+
}
|
|
85
|
+
return found;
|
|
86
|
+
}
|
|
87
|
+
/** Visible rects of `elements`, minus backdrops and anything off screen. */
|
|
88
|
+
function obstacleRects(elements) {
|
|
89
|
+
const vw = window.innerWidth;
|
|
90
|
+
const vh = window.innerHeight;
|
|
91
|
+
const rects = [];
|
|
92
|
+
for (const el of elements) {
|
|
93
|
+
const { left, top, width, height } = el.getBoundingClientRect();
|
|
94
|
+
if (width === 0 || height === 0) continue;
|
|
95
|
+
if (width * height > vw * vh * MAX_AREA_SHARE) continue;
|
|
96
|
+
if (left >= vw || top >= vh || left + width <= 0 || top + height <= 0) continue;
|
|
97
|
+
const style = getComputedStyle(el);
|
|
98
|
+
if (style.visibility === "hidden" || style.opacity === "0") continue;
|
|
99
|
+
rects.push({
|
|
100
|
+
left,
|
|
101
|
+
top,
|
|
102
|
+
width,
|
|
103
|
+
height
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return rects;
|
|
107
|
+
}
|
|
108
|
+
function sameRects(a, b) {
|
|
109
|
+
return a.length === b.length && a.every((r, i) => r.left === b[i]?.left && r.top === b[i]?.top && r.width === b[i]?.width && r.height === b[i]?.height);
|
|
110
|
+
}
|
|
111
|
+
const NONE = [];
|
|
112
|
+
/** Obstacle rects moved into visible-area coordinates when the visual viewport is offset. */
|
|
113
|
+
function offsetObstacles(rects, offset) {
|
|
114
|
+
if (offset.x === 0 && offset.y === 0) return rects;
|
|
115
|
+
return rects.map((o) => ({
|
|
116
|
+
...o,
|
|
117
|
+
left: o.left - offset.x,
|
|
118
|
+
top: o.top - offset.y
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Live obstacle rects. The element list is rescanned when the DOM settles
|
|
123
|
+
* after a change; rects are re-measured on scroll (sticky elements move) and
|
|
124
|
+
* resize, once per frame.
|
|
125
|
+
*/
|
|
126
|
+
function useObstacles() {
|
|
127
|
+
const [rects, setRects] = useState(NONE);
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
let elements = scanFloating();
|
|
130
|
+
let frame = 0;
|
|
131
|
+
let timer;
|
|
132
|
+
const measure = () => {
|
|
133
|
+
frame = 0;
|
|
134
|
+
const next = obstacleRects(elements);
|
|
135
|
+
setRects((prev) => sameRects(prev, next) ? prev : next);
|
|
136
|
+
};
|
|
137
|
+
const schedule = () => {
|
|
138
|
+
if (!frame) frame = requestAnimationFrame(measure);
|
|
139
|
+
};
|
|
140
|
+
const rescan = () => {
|
|
141
|
+
schedule();
|
|
142
|
+
clearTimeout(timer);
|
|
143
|
+
timer = setTimeout(() => {
|
|
144
|
+
elements = scanFloating();
|
|
145
|
+
schedule();
|
|
146
|
+
}, RESCAN_MS);
|
|
147
|
+
};
|
|
148
|
+
measure();
|
|
149
|
+
const observer = new MutationObserver(rescan);
|
|
150
|
+
observer.observe(document.body, {
|
|
151
|
+
childList: true,
|
|
152
|
+
subtree: true,
|
|
153
|
+
attributes: true,
|
|
154
|
+
attributeFilter: [
|
|
155
|
+
"class",
|
|
156
|
+
"style",
|
|
157
|
+
"hidden"
|
|
158
|
+
]
|
|
159
|
+
});
|
|
160
|
+
window.addEventListener("scroll", schedule, {
|
|
161
|
+
capture: true,
|
|
162
|
+
passive: true
|
|
163
|
+
});
|
|
164
|
+
window.addEventListener("resize", schedule);
|
|
165
|
+
return () => {
|
|
166
|
+
observer.disconnect();
|
|
167
|
+
clearTimeout(timer);
|
|
168
|
+
if (frame) cancelAnimationFrame(frame);
|
|
169
|
+
window.removeEventListener("scroll", schedule, { capture: true });
|
|
170
|
+
window.removeEventListener("resize", schedule);
|
|
171
|
+
};
|
|
172
|
+
}, []);
|
|
173
|
+
return rects;
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { usePanels as a, PanelsContext as i, useObstacles as n, useVisualViewport as r, offsetObstacles as t };
|
package/dist/plugins/a11y.d.ts
CHANGED
|
@@ -1,2 +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-
|
|
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-D97Fnoie.js";
|
|
2
2
|
export { type A11yFinding, A11yOptions, type A11ySnapshot, type A11yStatus, AXE_URL, AXE_VERSION, type AxeImpact, a11y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as HudCapability } from "../../plugins-
|
|
1
|
+
import { a as HudCapability } from "../../plugins-pL2CoWzI.js";
|
|
2
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-
|
|
4
|
-
import { t as HudGuard } from "../../handler-
|
|
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-CwPCPsv0.js";
|
|
4
|
+
import { t as HudGuard } from "../../handler-BmFhaA2D.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 {
|
package/dist/plugins/access.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as HudCapability, r as HudBadge, u as HudPluginProps } from "../plugins-
|
|
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-
|
|
1
|
+
import { a as HudCapability, r as HudBadge, u as HudPluginProps } from "../plugins-pL2CoWzI.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-CwPCPsv0.js";
|
|
3
3
|
//#region src/plugins/access/access-pill.d.ts
|
|
4
4
|
declare function AccessPill(): import("react").JSX.Element;
|
|
5
5
|
declare function useAccessBadge(): HudBadge;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as definePlugin } from "../../plugins-CcW_K7c2.js";
|
|
2
|
-
import { t as refuseCrossSite } from "../../same-origin-
|
|
2
|
+
import { t as refuseCrossSite } from "../../same-origin-BHuZO1_H.js";
|
|
3
3
|
//#region src/plugins/agent/prompt.ts
|
|
4
4
|
/** The task text every provider receives: grab context first, then the instruction. */
|
|
5
5
|
function dispatchPrompt({ note, payload, hints = [] }) {
|
package/dist/plugins/agent.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as GrabPayload, t as ComponentHint } from "../payload-MUQ9ciER.js";
|
|
2
|
-
import { l as HudPluginContext, u as HudPluginProps } from "../plugins-
|
|
3
|
-
import "../index-
|
|
2
|
+
import { l as HudPluginContext, u as HudPluginProps } from "../plugins-pL2CoWzI.js";
|
|
3
|
+
import "../index-5B7foZut.js";
|
|
4
4
|
import { a as DispatchTargetInfo, i as DispatchReceipt, n as AgentSessionStatus, o as SessionsResponse, r as DispatchBody, t as AgentSession } from "../types-Cxh4twqc.js";
|
|
5
5
|
//#region src/plugins/agent/index.d.ts
|
|
6
6
|
export interface AgentDispatchOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as GrabPayload } from "../payload-MUQ9ciER.js";
|
|
2
|
-
import { l as HudPluginContext } from "../plugins-
|
|
3
|
-
import "../index-
|
|
2
|
+
import { l as HudPluginContext } from "../plugins-pL2CoWzI.js";
|
|
3
|
+
import "../index-5B7foZut.js";
|
|
4
4
|
import { n as ScreenshotRequest, r as ScreenshotResponse, t as CAPTURE_CAPABILITY } from "../types-BIgGf-0C.js";
|
|
5
5
|
//#region src/plugins/capture/index.d.ts
|
|
6
6
|
export interface ScreenshotOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as HudRouteContext } from "../../plugins-
|
|
1
|
+
import { d as HudRouteContext } from "../../plugins-pL2CoWzI.js";
|
|
2
2
|
import { _ as validateScenarios, a as HudMockRegistry, c as HudMockScenarioInfo, d as MOCK_SCENARIO_ID, f as createMockResolver, g as toMockActive, h as readMockRegistry, i as HudMockNodeStatus, l as MOCKS_COLLECTION, m as parseEndpoint, n as HudMockContext, o as HudMockResolve, p as matchEndpoint, r as HudMockMethod, s as HudMockScenario, t as HudMockActive, u as MOCKS_DOCUMENT } from "../../mocks-CA-wM2SB.js";
|
|
3
3
|
import { c as HudFlagValue, g as serializeFlagOverrides, h as readFlagOverrides, l as flagCookieString, n as FLAGS_STORAGE_KEY, o as HudFlagOverride, r as FLAG_KEY, s as HudFlagScope, t as FLAGS_COOKIE } from "../../flags-DVtaJ8pQ.js";
|
|
4
4
|
import { a as FlagsResponse, c as HudFlagDefinition, d as HudSeedInfo, f as MocksResponse, h as SeedRunResponse, i as FlagOverrideBody, l as HudFlagType, m as RoleSwitchResponse, n as FLAGS_COLLECTION, o as HudAuthUser, p as RoleSwitchBody, r as FLAGS_DOCUMENT, s as HudAuthUserInfo, t as DataStateResponse, u as HudSeed } from "../../types-Dn68psVz.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as definePlugin } from "../../plugins-CcW_K7c2.js";
|
|
2
2
|
import { FLAGS_COOKIE, FLAGS_STORAGE_KEY, FLAG_KEY, flagCookieString, isFlagScope, isFlagValue, readFlagOverrides, serializeFlagOverrides } from "../../flags.js";
|
|
3
3
|
import { a as matchEndpoint, c as readMockRegistry, d as validateScenarios, i as createMockResolver, l as scenarioInfo, n as MOCKS_DOCUMENT, o as nodeMockStatus, r as MOCK_SCENARIO_ID, s as parseEndpoint, t as MOCKS_COLLECTION, u as toMockActive } from "../../mocks-ESiRqk9o.js";
|
|
4
|
-
import { t as refuseCrossSite } from "../../same-origin-
|
|
4
|
+
import { t as refuseCrossSite } from "../../same-origin-BHuZO1_H.js";
|
|
5
5
|
import { t as HudStoreError } from "../../types-BIkI-qN8.js";
|
|
6
6
|
import { t as file } from "../../file-xdSaQ2uR.js";
|
|
7
7
|
import { a as readCookie, c as timingSafeEqual } from "../../access-C7zlaqj6.js";
|
package/dist/plugins/data.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as HudMockClientStatus, n as data, r as HudMockClientOptions, t as DataOptions } from "../index-
|
|
1
|
+
import { i as HudMockClientStatus, n as data, r as HudMockClientOptions, t as DataOptions } from "../index-BqKysxTq.js";
|
|
2
2
|
import { c as HudMockScenarioInfo, i as HudMockNodeStatus, n as HudMockContext, o as HudMockResolve, r as HudMockMethod, s as HudMockScenario, t as HudMockActive } from "../mocks-CA-wM2SB.js";
|
|
3
3
|
import { n as HudMockWorkerModule, r as MockWorkerOptions, t as HudMockWorkerHandle } from "../msw-browser-wjaYgkB7.js";
|
|
4
4
|
import { c as HudFlagValue, h as readFlagOverrides, n as FLAGS_STORAGE_KEY, o as HudFlagOverride, r as FLAG_KEY, s as HudFlagScope, t as FLAGS_COOKIE, u as flagOverride } from "../flags-DVtaJ8pQ.js";
|
|
@@ -1,8 +1,37 @@
|
|
|
1
|
-
import { d as HudRouteContext } from "../../plugins-
|
|
2
|
-
import { a as
|
|
1
|
+
import { d as HudRouteContext } from "../../plugins-pL2CoWzI.js";
|
|
2
|
+
import { a as VariantGroupRecord, c as VariantStatus, d as toGroupRecord, f as toVariantRecord, i as VARIANTS_COLLECTION, l as VariantsListResponse, n as PickBody, o as VariantLogEntry, r as PickResponse, s as VariantRecord, t as CleanupResponse, u as recordKey } from "../../variants-types-VkW7vFZF.js";
|
|
3
3
|
import { n as DispatchProvider } from "../../types-szkr2QOF.js";
|
|
4
4
|
import { t as HudStore } from "../../types-DaJcsEjO.js";
|
|
5
5
|
import "../../server.js";
|
|
6
|
+
//#region src/plugins/design/variants-export.d.ts
|
|
7
|
+
/** One group's decision, as `hud variants` prints it. */
|
|
8
|
+
interface VariantGroupExport {
|
|
9
|
+
group: string;
|
|
10
|
+
label: string;
|
|
11
|
+
/** The picked variant, or null while the group is open. */
|
|
12
|
+
pick: {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
decidedAt?: string;
|
|
16
|
+
} | null;
|
|
17
|
+
note: string;
|
|
18
|
+
variants: {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
status: string;
|
|
22
|
+
score?: number;
|
|
23
|
+
rationale?: string;
|
|
24
|
+
}[];
|
|
25
|
+
log: VariantLogEntry[];
|
|
26
|
+
}
|
|
27
|
+
interface VariantsExport {
|
|
28
|
+
groups: VariantGroupExport[];
|
|
29
|
+
}
|
|
30
|
+
/** Every group of the store's `variants` collection with its pick, note and log, by group id. */
|
|
31
|
+
export declare function readVariants(store: HudStore): Promise<VariantsExport>;
|
|
32
|
+
/** The decisions as Markdown, for an issue comment or an agent's context. */
|
|
33
|
+
export declare function formatVariantsMarkdown({ groups }: VariantsExport): string;
|
|
34
|
+
//#endregion
|
|
6
35
|
//#region src/plugins/design/server.d.ts
|
|
7
36
|
export interface VariantDecision {
|
|
8
37
|
group: string;
|
|
@@ -16,27 +45,35 @@ export interface VariantDecision {
|
|
|
16
45
|
label: string;
|
|
17
46
|
}[];
|
|
18
47
|
decidedAt: string;
|
|
48
|
+
/** The owner's note on the pick; empty when there is none. */
|
|
49
|
+
note?: string;
|
|
19
50
|
}
|
|
20
51
|
export interface VariantsServerOptions {
|
|
21
|
-
/** Where scores and
|
|
52
|
+
/** Where scores, picks and notes live. `file()` keeps them in `.hud/variants.json`. */
|
|
22
53
|
store: HudStore;
|
|
23
54
|
/**
|
|
24
|
-
* The dispatch seam:
|
|
25
|
-
* `hermes()` from `@hansenexus/hud/plugins/agent/server`,
|
|
26
|
-
* the same shape).
|
|
55
|
+
* The dispatch seam: "Queue cleanup" hands the brief for a picked group to
|
|
56
|
+
* it (`claudeCode()`, `hermes()` from `@hansenexus/hud/plugins/agent/server`,
|
|
57
|
+
* or anything with the same shape). A pick never reaches it.
|
|
27
58
|
*/
|
|
28
59
|
dispatch?: DispatchProvider;
|
|
29
60
|
/** The brief's text. Default: `cleanupBrief`. */
|
|
30
61
|
brief?: (decision: VariantDecision) => string;
|
|
31
62
|
}
|
|
32
|
-
/** The cleanup brief
|
|
33
|
-
export declare function cleanupBrief({ group, label, winner, losers, decidedAt }: VariantDecision): string;
|
|
63
|
+
/** The cleanup brief "Queue cleanup" hands the dispatch seam. */
|
|
64
|
+
export declare function cleanupBrief({ group, label, winner, losers, decidedAt, note }: VariantDecision): string;
|
|
34
65
|
/**
|
|
35
|
-
* Server half of `variants()
|
|
36
|
-
*
|
|
37
|
-
* `
|
|
38
|
-
*
|
|
39
|
-
*
|
|
66
|
+
* Server half of `variants()`.
|
|
67
|
+
*
|
|
68
|
+
* - `GET /` lists every record of the store's `variants` collection, with the
|
|
69
|
+
* groups' notes and logs.
|
|
70
|
+
* - `POST /:group/pick` records a pick and a note through the storage seam
|
|
71
|
+
* (`status` and `decidedAt` on the variants, note and log on the group).
|
|
72
|
+
* It never touches the dispatch seam.
|
|
73
|
+
* - `POST /:group/cleanup` queues the cleanup brief of a picked group through
|
|
74
|
+
* the dispatch seam; the panel's "Queue cleanup" button is the only caller.
|
|
75
|
+
*
|
|
76
|
+
* Carries `variants.decide`, which only development grants by default.
|
|
40
77
|
*/
|
|
41
78
|
export declare function variantsServer({ store, dispatch, brief }: VariantsServerOptions): {
|
|
42
79
|
readonly id: "variants";
|
|
@@ -45,10 +82,13 @@ export declare function variantsServer({ store, dispatch, brief }: VariantsServe
|
|
|
45
82
|
readonly "/": {
|
|
46
83
|
GET: () => Promise<Response>;
|
|
47
84
|
};
|
|
48
|
-
readonly "/:group/
|
|
85
|
+
readonly "/:group/pick": {
|
|
86
|
+
readonly POST: (request: Request, { params }: HudRouteContext) => Promise<Response>;
|
|
87
|
+
};
|
|
88
|
+
readonly "/:group/cleanup": {
|
|
49
89
|
readonly POST: (request: Request, { params }: HudRouteContext) => Promise<Response>;
|
|
50
90
|
};
|
|
51
91
|
};
|
|
52
92
|
};
|
|
53
93
|
//#endregion
|
|
54
|
-
export { type
|
|
94
|
+
export { type CleanupResponse, type PickBody, type PickResponse, VARIANTS_COLLECTION, type VariantGroupExport, type VariantGroupRecord, type VariantLogEntry, type VariantRecord, type VariantStatus, type VariantsExport, type VariantsListResponse, recordKey, toGroupRecord, toVariantRecord };
|