@try-works/dsh-recursive-mode 0.1.11 → 0.1.13

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.
@@ -1,39 +1,14 @@
1
- /**
2
- * Board overlay (SP2 R1 + run 08 R3 + run 12): the kanban view over the live
3
- * host-route projection. Pure read-only renderer — no filesystem, no run-file
4
- * scraping. Cards are grouped by worktree root (the projection's outer key) and
5
- * mapped to their current-phase lane via derive.columnForRun. Renders NOTHING
6
- * when the snapshot is null (no recursive root / not loaded) or the current
7
- * session is not on the recursive preset (the gate lives in slots.ts — here an
8
- * empty projection with a null root is a no-op, not an "empty board").
9
- *
10
- * Run 08 R3: a card click opens the drill-down inspector via onOpenInspector
11
- * (the overlay swaps board <-> inspector in slots.ts). Read-only still: the
12
- * callback only selects a run for display; no mutation.
13
- *
14
- * Run 12 (LIVE BUG): shell.overlay is a click-through, unstyled frame layer —
15
- * without inline styles the mounted board was INVISIBLE (no position/size/z)
16
- * and CLICK-THROUGH (no pointer-events opt-in). Everything is styled inline
17
- * (no CSS pipeline in the CJS client bundle): full-cover fixed overlay, opaque
18
- * backdrop, pointerEvents auto, and a visible close button.
19
- */
20
- import { type CSSProperties } from 'react';
21
1
  import type { RecursiveProjection, RecursiveRunCard } from '../types.ts';
22
2
  import type { LiveProjectionValue } from './contract.ts';
23
3
  import type { BoardSelection } from './open-state.ts';
24
- /** Full-cover overlay style — the shell.overlay seat is click-through + unstyled by default (run 12). */
25
- export declare const overlayStyle: CSSProperties;
26
4
  /** Flatten the worktree-grouped projection into a stable run list. */
27
5
  export declare function listRuns(projection: RecursiveProjection | undefined): RecursiveRunCard[];
28
6
  export interface BoardProps {
29
- /** The live host-route snapshot (null = not loaded / no recursive root). */
30
7
  snapshot: LiveProjectionValue | null;
31
- /** Opens the drill-down inspector for a run (R3). */
32
8
  onOpenInspector?: (selection: BoardSelection) => void;
33
- /** Closes the overlay (run 12). */
34
9
  onClose?: () => void;
35
10
  }
36
11
  export declare function Board({ snapshot, onOpenInspector, onClose }: BoardProps): import("react").DetailedReactHTMLElement<{
37
12
  className: string;
38
- style: CSSProperties;
13
+ 'data-theme': import("./theme.ts").BoardTheme;
39
14
  }, HTMLElement> | null;
@@ -71,6 +71,17 @@ export declare function cardFacts(card: RecursiveRunCard): RecursiveCardFacts;
71
71
  * worktree root is part of the id so two runs with the same runId in
72
72
  * different worktrees never collide — never "latest unfinished".
73
73
  */
74
+ /** Solid status-pill kinds (run 16 / Paper StatusPill). */
75
+ export type PillKind = 'locked' | 'in-progress' | 'paused' | 'blocked' | 'tampered' | 'advisory' | 'neutral';
76
+ /** Human pill label per kind (neutral renders an empty dash). */
77
+ export declare const PILL_LABELS: Record<PillKind, string>;
78
+ /**
79
+ * Solid-pill kind for a whole run card. Priority: tamper > fully-locked >
80
+ * run-state blocked > run-state paused > still in-progress.
81
+ */
82
+ export declare function cardPill(card: RecursiveRunCard): PillKind;
83
+ /** Solid-pill kind for a phase row status string (LOCKED / DRAFT / '—'). */
84
+ export declare function phaseStatusPill(status: string): PillKind;
74
85
  export declare function nodeKeyOf(runId: string, worktreeRoot: string): string;
75
86
  /** One expanded inspector phase row (§11.5). */
76
87
  export interface RecursivePhaseInspectorRow {
@@ -1,25 +1,13 @@
1
- /**
2
- * Drill-down inspector (SP2 R1 + run 12): the details-seat swap rendering one
3
- * run's phase chain (with the always-shown 3.5 row + full 6/7/8 rows), lock
4
- * badges, and tamper/gate facts — all from the live host-route snapshot, never
5
- * disk.
6
- *
7
- * Run 12 (LIVE BUG): same as the board — shell.overlay is click-through and
8
- * unstyled, so the inspector mounts INVISIBLE + CLICK-THROUGH without inline
9
- * styles. Full-cover fixed overlay + pointerEvents auto + a back button and a
10
- * close button.
11
- */
12
- import { type CSSProperties } from 'react';
13
1
  import type { LiveProjectionValue } from './contract.ts';
2
+ import type { BoardTheme } from './theme.ts';
14
3
  export interface InspectorProps {
15
4
  runId: string;
16
5
  worktreeRoot: string;
17
6
  snapshot: LiveProjectionValue | null;
18
7
  onBackToToolDetails: () => void;
19
- /** Closes the overlay (run 12). */
20
8
  onClose?: () => void;
21
9
  }
22
10
  export declare function Inspector({ runId, worktreeRoot, snapshot, onBackToToolDetails, onClose }: InspectorProps): import("react").DetailedReactHTMLElement<{
23
11
  className: string;
24
- style: CSSProperties;
12
+ 'data-theme': BoardTheme;
25
13
  }, HTMLElement>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * One-shot board/inspector stylesheet injection (run 15 + run 16 / Paper).
3
+ * The client bundle is a plain CJS closure with NO CSS pipeline (tsdown), so we
4
+ * inject a single <style data-dsh-recursive> element into document.head.
5
+ *
6
+ * Run 16 (Paper): the design is ported 1:1 — DEFAULT LIGHT theme, dark via a
7
+ * data-theme attribute on the .rec-board / .rec-inspector root. Raw --rm3-*
8
+ * tokens live on the scoped roots; semantic --board-* aliases remap under
9
+ * [data-theme='dark']. EVERY component rule consumes ONLY --board-* aliases
10
+ * (never --rm3-* directly). Idempotent injection; disposer removes the element.
11
+ */
12
+ /**
13
+ * Inject the board/inspector stylesheet once. Idempotent: if a <style
14
+ * data-dsh-recursive> already exists, returns a disposer that does nothing
15
+ * (the first injector owns the element). Returns a disposer that removes it.
16
+ */
17
+ export declare function injectBoardStyles(): () => void;
@@ -0,0 +1,20 @@
1
+ export declare const BOARD_THEME_STORAGE_KEY = "dsh-recursive-theme";
2
+ export type BoardTheme = 'light' | 'dark';
3
+ export interface BoardThemeState {
4
+ theme: BoardTheme;
5
+ toggle: () => void;
6
+ }
7
+ /**
8
+ * Hoisted at the TOP of Board and Inspector (never after an early return — run
9
+ * 0.1.10 invariant). Defaults light, reads a persisted dark on init, and writes
10
+ * the chosen theme back to localStorage.
11
+ */
12
+ export declare function useBoardTheme(): BoardThemeState;
13
+ /** The shared header toggle button (moon in light, sun in dark). */
14
+ export declare function ThemeToggle({ theme, toggle }: BoardThemeState): import("react").DetailedReactHTMLElement<{
15
+ type: string;
16
+ className: string;
17
+ onClick: () => void;
18
+ title: string;
19
+ 'aria-label': string;
20
+ }, HTMLElement>;