@try-works/dsh-recursive-mode 0.1.10 → 0.1.12
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 +0 -26
- package/lib/client/contract.d.ts +29 -0
- package/lib/client/index.d.ts +2 -2
- package/lib/client/inspector.d.ts +0 -14
- package/lib/client/slots.d.ts +3 -2
- package/lib/client/styles.d.ts +15 -0
- package/lib/client.js +506 -283
- package/package.json +1 -1
- package/src/client/board.tsx +53 -95
- package/src/client/contract.ts +48 -0
- package/src/client/index.ts +2 -2
- package/src/client/inspector.tsx +40 -49
- package/src/client/slots.ts +17 -9
- package/src/client/styles.ts +397 -0
package/lib/client/board.d.ts
CHANGED
|
@@ -1,39 +1,13 @@
|
|
|
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;
|
|
39
13
|
}, HTMLElement> | null;
|
package/lib/client/contract.d.ts
CHANGED
|
@@ -85,3 +85,32 @@ export interface LiveProjectionValue {
|
|
|
85
85
|
export declare function isRecursivePreset(state: SessionListStateLike): boolean;
|
|
86
86
|
/** The current session's cwd (the client passes it as a fallback hint; the host resolves the root). */
|
|
87
87
|
export declare function currentSessionCwd(state: SessionListStateLike): string;
|
|
88
|
+
/**
|
|
89
|
+
* A workspace row — the structural mirror of the REAL WorkspaceView the host
|
|
90
|
+
* injects. We consume only workspaceId/path/title/sessionIds.
|
|
91
|
+
*/
|
|
92
|
+
export interface WorkspaceViewLike {
|
|
93
|
+
workspaceId: string;
|
|
94
|
+
path: string;
|
|
95
|
+
title: string;
|
|
96
|
+
sessionIds: string[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The workspace-list snapshot — the structural subset of the REAL
|
|
100
|
+
* WorkspaceListState we consume (items + recentWorkspaceId). The real state
|
|
101
|
+
* also carries archivedSessionIds/state/phase/error/baselinesReady; those are
|
|
102
|
+
* irrelevant here and the real value satisfies this subset.
|
|
103
|
+
*/
|
|
104
|
+
export interface WorkspaceListStateLike {
|
|
105
|
+
items: readonly WorkspaceViewLike[];
|
|
106
|
+
recentWorkspaceId?: string;
|
|
107
|
+
}
|
|
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
|
|
114
|
+
* 4) '' (empty -> the route returns null root -> board renders nothing).
|
|
115
|
+
*/
|
|
116
|
+
export declare function currentWorkspacePath(list: WorkspaceListStateLike, sessionList: SessionListStateLike): string;
|
package/lib/client/index.d.ts
CHANGED
|
@@ -20,8 +20,8 @@ export { useLiveProjection } from './use-live.ts';
|
|
|
20
20
|
export type { LiveProjectionSnapshot } from './use-live.ts';
|
|
21
21
|
export { fetchLiveState, subscribeLiveEvents } from './host-api.ts';
|
|
22
22
|
export type { LiveRecursiveState, LiveRecursiveFrame, LiveScope } from './host-api.ts';
|
|
23
|
-
export { isRecursivePreset, currentSessionCwd } from './contract.ts';
|
|
24
|
-
export type { SessionSummaryRow, SessionListStateLike, SnapshotSelectorHook, ClientContext } from './contract.ts';
|
|
23
|
+
export { isRecursivePreset, currentSessionCwd, currentWorkspacePath } from './contract.ts';
|
|
24
|
+
export type { SessionSummaryRow, SessionListStateLike, SnapshotSelectorHook, WorkspaceViewLike, WorkspaceListStateLike, ClientContext } from './contract.ts';
|
|
25
25
|
/** Required services (fiber inject waiting — the runtime must be up first). */
|
|
26
26
|
export declare const inject: string[];
|
|
27
27
|
/** Browser-half plugin entry (R4 + SP2 R1). */
|
|
@@ -1,25 +1,11 @@
|
|
|
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';
|
|
14
2
|
export interface InspectorProps {
|
|
15
3
|
runId: string;
|
|
16
4
|
worktreeRoot: string;
|
|
17
5
|
snapshot: LiveProjectionValue | null;
|
|
18
6
|
onBackToToolDetails: () => void;
|
|
19
|
-
/** Closes the overlay (run 12). */
|
|
20
7
|
onClose?: () => void;
|
|
21
8
|
}
|
|
22
9
|
export declare function Inspector({ runId, worktreeRoot, snapshot, onBackToToolDetails, onClose }: InspectorProps): import("react").DetailedReactHTMLElement<{
|
|
23
10
|
className: string;
|
|
24
|
-
style: CSSProperties;
|
|
25
11
|
}, HTMLElement>;
|
package/lib/client/slots.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* READ-ONLY (R9): the client only GETs the live host route; no mutation.
|
|
18
18
|
*/
|
|
19
19
|
import { type ReactNode } from 'react';
|
|
20
|
-
import type { ClientContext, SessionListStateLike, SnapshotSelectorHook } from './contract.ts';
|
|
20
|
+
import type { ClientContext, SessionListStateLike, SnapshotSelectorHook, WorkspaceListStateLike } from './contract.ts';
|
|
21
21
|
import { isRecursivePreset, currentSessionCwd } from './contract.ts';
|
|
22
22
|
export type OverlayContent = 'hidden' | 'board' | 'inspector';
|
|
23
23
|
/** Gate: hidden unless open AND recursive preset; inspector when a run is selected. */
|
|
@@ -49,8 +49,9 @@ export declare function registerSlots(ctx: ClientContext): () => void;
|
|
|
49
49
|
* Run 10: consumes the full SessionListStateLike through the identity selector
|
|
50
50
|
* (useSessions((s) => s)); no fake {list:{getSnapshot}} wrapper.
|
|
51
51
|
*/
|
|
52
|
-
export declare function RecursiveBoardOverlay({ useSessions }: {
|
|
52
|
+
export declare function RecursiveBoardOverlay({ useSessions, useWorkspaces }: {
|
|
53
53
|
useSessions: SnapshotSelectorHook<SessionListStateLike>;
|
|
54
|
+
useWorkspaces?: SnapshotSelectorHook<WorkspaceListStateLike>;
|
|
54
55
|
}): ReactNode;
|
|
55
56
|
/**
|
|
56
57
|
* Strip gate: same preset gate, session-scoped sessionId; the strip renders
|
|
@@ -0,0 +1,15 @@
|
|
|
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 following — impossible with inline
|
|
7
|
+
* styles. Idempotent: guarded by document.querySelector, so every registration
|
|
8
|
+
* reuses the one element; the returned disposer removes it.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Inject the board/inspector stylesheet once. Idempotent: if a <style
|
|
12
|
+
* data-dsh-recursive> already exists, returns a disposer that does nothing
|
|
13
|
+
* (the first injector owns the element). Returns a disposer that removes it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function injectBoardStyles(): () => void;
|