@try-works/dsh-recursive-mode 0.1.12 → 0.1.14

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.
@@ -10,4 +10,5 @@ export interface BoardProps {
10
10
  }
11
11
  export declare function Board({ snapshot, onOpenInspector, onClose }: BoardProps): import("react").DetailedReactHTMLElement<{
12
12
  className: string;
13
+ 'data-theme': import("./theme.ts").BoardTheme;
13
14
  }, HTMLElement> | null;
@@ -106,11 +106,15 @@ export interface WorkspaceListStateLike {
106
106
  recentWorkspaceId?: string;
107
107
  }
108
108
  /**
109
- * Resolve the CURRENT workspace path for a workspace-scoped board (run 14):
110
- * the WORKSPACE owns the .recursive/ run-layer, not the session. Resolution:
111
- * 1) recentWorkspaceId's item path (the workspace the user is viewing), else
112
- * 2) the workspace whose sessionIds contains sessionList.current, else
113
- * 3) the workspace whose path === currentSessionCwd(sessionList), else
109
+ * Resolve the CURRENT workspace path for a workspace-scoped board (run 14,
110
+ * corrected run 16/0.1.14): the WORKSPACE owns the .recursive/ run-layer, not
111
+ * the session. Resolution mirrors the harness's startSession precedence
112
+ * (service.ts:183) the CURRENT session's workspace wins over the
113
+ * recentWorkspaceId (which the harness derives as the most recently ACTIVE
114
+ * workspace by session updatedAt, NOT the workspace being viewed):
115
+ * 1) the workspace whose sessionIds contains sessionList.current, else
116
+ * 2) the workspace whose path === currentSessionCwd(sessionList), else
117
+ * 3) recentWorkspaceId's item path (fallback ONLY when no current session resolves), else
114
118
  * 4) '' (empty -> the route returns null root -> board renders nothing).
115
119
  */
116
120
  export declare function currentWorkspacePath(list: WorkspaceListStateLike, sessionList: SessionListStateLike): string;
@@ -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,4 +1,5 @@
1
1
  import type { LiveProjectionValue } from './contract.ts';
2
+ import type { BoardTheme } from './theme.ts';
2
3
  export interface InspectorProps {
3
4
  runId: string;
4
5
  worktreeRoot: string;
@@ -8,4 +9,5 @@ export interface InspectorProps {
8
9
  }
9
10
  export declare function Inspector({ runId, worktreeRoot, snapshot, onBackToToolDetails, onClose }: InspectorProps): import("react").DetailedReactHTMLElement<{
10
11
  className: string;
12
+ 'data-theme': BoardTheme;
11
13
  }, HTMLElement>;
@@ -1,11 +1,13 @@
1
1
  /**
2
- * One-shot board/inspector stylesheet injection (run 15). The client bundle is a
3
- * plain CJS closure with NO CSS pipeline (tsdown has no CSS handling), so we
4
- * inject a single <style data-dsh-recursive> element into document.head and
5
- * style via class names + the shell's --dsw-* theme tokens. That unlocks hover,
6
- * grid layout, and light/dark/skin theme followingimpossible with inline
7
- * styles. Idempotent: guarded by document.querySelector, so every registration
8
- * reuses the one element; the returned disposer removes it.
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.
9
11
  */
10
12
  /**
11
13
  * Inject the board/inspector stylesheet once. Idempotent: if a <style
@@ -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>;