@try-works/dsh-recursive-mode 0.1.12 → 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.
- package/lib/client/board.d.ts +1 -0
- package/lib/client/derive.d.ts +11 -0
- package/lib/client/inspector.d.ts +2 -0
- package/lib/client/styles.d.ts +9 -7
- package/lib/client/theme.d.ts +20 -0
- package/lib/client.js +423 -171
- package/package.json +1 -1
- package/src/client/board.tsx +24 -12
- package/src/client/derive.ts +34 -0
- package/src/client/inspector.tsx +20 -11
- package/src/client/styles.ts +300 -131
- package/src/client/theme.ts +53 -0
package/lib/client/board.d.ts
CHANGED
package/lib/client/derive.d.ts
CHANGED
|
@@ -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>;
|
package/lib/client/styles.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One-shot board/inspector stylesheet injection (run 15
|
|
3
|
-
* plain CJS closure with NO CSS pipeline (tsdown
|
|
4
|
-
* inject a single <style data-dsh-recursive> element into document.head
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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>;
|