@hansenexus/hud 0.8.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.
@@ -0,0 +1,22 @@
1
+ import { u as HudPluginProps } from "../plugins-pL2CoWzI.js";
2
+ import { a as LaneServer, c as ShotBody, i as LaneInfo, l as StartResponse, n as Delivery, o as LaneWorker, r as LANES_CAPABILITY, s as LanesResponse, t as CommentBody } from "../types-Dazn3aWZ.js";
3
+ //#region src/plugins/lanes/index.d.ts
4
+ export interface LanesOptions {
5
+ /** Refresh interval while the panel is open and the tab visible. Default 10 s. */
6
+ intervalMs?: number;
7
+ }
8
+ /**
9
+ * Lanes panel: the box's lanes with their dev servers, opened on the box's
10
+ * tailnet name; Start for a lane without one; and, for the lane this page is
11
+ * served from, a comment box and a Screenshot button that reach the lane's
12
+ * worker. Mount the server half from `@hansenexus/hud/plugins/lanes/server`.
13
+ */
14
+ export declare function lanes({ intervalMs }?: LanesOptions): {
15
+ readonly id: "lanes";
16
+ readonly title: "Lanes";
17
+ readonly capability: "lanes.preview";
18
+ readonly icon: import("react").ComponentType;
19
+ readonly panel: ({ ctx }: HudPluginProps) => import("react").JSX.Element;
20
+ };
21
+ //#endregion
22
+ export { type CommentBody, type Delivery, LANES_CAPABILITY, type LaneInfo, type LaneServer, type LaneWorker, type LanesResponse, type ShotBody, type StartResponse };
@@ -0,0 +1,30 @@
1
+ import { i as hudIcon } from "../icons-ByDyNq_E.js";
2
+ import { i as definePlugin } from "../plugins-CcW_K7c2.js";
3
+ import { n as LANES_ID, t as LANES_CAPABILITY } from "../types-BkrkOP3h.js";
4
+ import { lazy } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/plugins/lanes/index.tsx
7
+ const LanesPanel = lazy(() => import("../lanes-panel-Disg54DY.js"));
8
+ /**
9
+ * Lanes panel: the box's lanes with their dev servers, opened on the box's
10
+ * tailnet name; Start for a lane without one; and, for the lane this page is
11
+ * served from, a comment box and a Screenshot button that reach the lane's
12
+ * worker. Mount the server half from `@hansenexus/hud/plugins/lanes/server`.
13
+ */
14
+ function lanes({ intervalMs = 1e4 } = {}) {
15
+ function Panel({ ctx }) {
16
+ return /* @__PURE__ */ jsx(LanesPanel, {
17
+ ctx,
18
+ intervalMs
19
+ });
20
+ }
21
+ return definePlugin({
22
+ id: LANES_ID,
23
+ title: "Lanes",
24
+ capability: LANES_CAPABILITY,
25
+ icon: hudIcon("git-branch"),
26
+ panel: Panel
27
+ });
28
+ }
29
+ //#endregion
30
+ export { LANES_CAPABILITY, lanes };
@@ -0,0 +1,6 @@
1
+ //#region src/plugins/lanes/types.ts
2
+ /** Wire types shared by the `lanes` plugin's client and server halves. */
3
+ const LANES_ID = "lanes";
4
+ const LANES_CAPABILITY = "lanes.preview";
5
+ //#endregion
6
+ export { LANES_ID as n, LANES_CAPABILITY as t };
@@ -0,0 +1,86 @@
1
+ //#region src/plugins/lanes/types.d.ts
2
+ declare const LANES_CAPABILITY = "lanes.preview";
3
+ /** One dev server listening in a lane. */
4
+ interface LaneServer {
5
+ port: number;
6
+ pid: number;
7
+ /** Preview URL on the box's tailnet name, e.g. `http://box.ts.example.dev:5173/`. */
8
+ url: string;
9
+ /** Bound to 127.0.0.1 or ::1 only: the tailnet URL will not answer. */
10
+ loopback?: boolean;
11
+ }
12
+ /** The session working in a lane, from the box's session ledger. */
13
+ interface LaneWorker {
14
+ sid: string;
15
+ state: string;
16
+ /** Whether a terminal exists to type a comment into (`lane-runtime terminal list`). */
17
+ reachable?: boolean;
18
+ }
19
+ /** One lane on the box, as `GET <apiBase>/lanes/lanes` lists it. */
20
+ interface LaneInfo {
21
+ /** Folder name, `<repo>-issue-<N>-<slug>`. */
22
+ lane: string;
23
+ repo: string;
24
+ issue?: number;
25
+ branch?: string;
26
+ servers: LaneServer[];
27
+ worker?: LaneWorker;
28
+ /** The lane this HUD's own dev server runs in. */
29
+ current?: boolean;
30
+ /** Whether the lane has a `dev` script, so Start can run. */
31
+ startable: boolean;
32
+ }
33
+ interface LanesResponse {
34
+ /** The box's tailnet name; null when it is unknown (links then fall back to the page's host). */
35
+ host: string | null;
36
+ lanes: LaneInfo[];
37
+ }
38
+ type StartResponse = {
39
+ ok: true;
40
+ lane: string;
41
+ port: number;
42
+ url: string;
43
+ log?: string;
44
+ } | {
45
+ ok: false;
46
+ error: string;
47
+ };
48
+ /** `POST <apiBase>/lanes/comment`. */
49
+ interface CommentBody {
50
+ lane: string;
51
+ text: string;
52
+ /** The page the comment is about. */
53
+ url?: string;
54
+ viewport?: {
55
+ width: number;
56
+ height: number;
57
+ };
58
+ }
59
+ /** `POST <apiBase>/lanes/screenshot`: the page to render and the width it is viewed at. */
60
+ interface ShotBody {
61
+ lane: string;
62
+ url: string;
63
+ viewport: {
64
+ width: number;
65
+ height: number;
66
+ };
67
+ /** Optional words sent with the picture. */
68
+ text?: string;
69
+ }
70
+ /** What happened to a comment or screenshot, step by step. */
71
+ interface Delivery {
72
+ ok: boolean;
73
+ /** The ledger event that records it (`ledger:<to sid>:<event id>`), when written. */
74
+ ref?: string;
75
+ /** Typed into the worker's terminal. */
76
+ delivered: boolean;
77
+ /** PR comment URL, for a screenshot posted to the lane's PR. */
78
+ prComment?: string;
79
+ /** Where the PNG was saved on the box, for a screenshot. */
80
+ file?: string;
81
+ /** Why a step did not happen; the others may still have. */
82
+ notes: string[];
83
+ error?: string;
84
+ }
85
+ //#endregion
86
+ export { LaneServer as a, ShotBody as c, LaneInfo as i, StartResponse as l, Delivery as n, LaneWorker as o, LANES_CAPABILITY as r, LanesResponse as s, CommentBody as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hansenexus/hud",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Modular dev HUD for React apps: status pill, floating panels, element grabber, plugin API.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -147,7 +147,7 @@
147
147
  "convex": "^1.46.0",
148
148
  "jsdom": "^30.1.2",
149
149
  "msw": "^3.0.2",
150
- "next": "^16.4.0",
150
+ "next": "16.4.6",
151
151
  "playwright": "1.63.0",
152
152
  "rolldown": "^1.2.12",
153
153
  "swr": "^2.5.1",