@try-works/dsh-recursive-mode 0.2.2 → 0.2.4

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.
@@ -9,8 +9,14 @@ export interface BoardProps {
9
9
  workspacePath?: string;
10
10
  onOpenInspector?: (selection: BoardSelection) => void;
11
11
  onClose?: () => void;
12
+ /**
13
+ * 'overlay' (default) renders the board as a full-viewport fixed overlay
14
+ * (shell.overlay / launcher). 'view' renders it inline, filling its parent
15
+ * (a conversation.view tab), with no close button and no fixed positioning.
16
+ */
17
+ variant?: 'overlay' | 'view';
12
18
  }
13
- export declare function Board({ snapshot, workspacePath, onOpenInspector, onClose }: BoardProps): import("react").DetailedReactHTMLElement<{
19
+ export declare function Board({ snapshot, workspacePath, onOpenInspector, onClose, variant }: BoardProps): import("react").DetailedReactHTMLElement<{
14
20
  className: string;
15
21
  'data-theme': import("./theme.ts").BoardTheme;
16
22
  }, HTMLElement> | null;
@@ -0,0 +1,40 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { BoardTheme } from './theme.ts';
3
+ /** One rendered markdown line (parsePlan base + fenced code + tables). */
4
+ export interface DocLine {
5
+ kind: 'blank' | 'h1' | 'h2' | 'h3' | 'h4' | 'li' | 'plain' | 'code' | 'table';
6
+ text: string;
7
+ /** table: data rows (header separator row dropped); first row is the header. */
8
+ cells?: string[][];
9
+ }
10
+ /** Inline segment parsed from line text (bold / code span / link). */
11
+ export interface InlineSegment {
12
+ type: 'text' | 'bold' | 'code' | 'link';
13
+ text: string;
14
+ href?: string;
15
+ }
16
+ /**
17
+ * Markdown -> line tokens. Base is parsePlan (blank/h1-h4/li/plain, MIT),
18
+ * extended for fenced code blocks (one code line per block) and pipe tables
19
+ * (one table line per block, header separator row dropped).
20
+ */
21
+ export declare function parseDoc(plan: string): DocLine[];
22
+ /**
23
+ * Inline scanner: **bold**, `code`, [text](url); unmatched markers stay plain
24
+ * text. Used to build the React children of a line text.
25
+ */
26
+ export declare function parseInline(text: string): InlineSegment[];
27
+ export interface DocViewerProps {
28
+ runId: string;
29
+ worktreeRoot: string;
30
+ fileName: string;
31
+ theme: BoardTheme;
32
+ onClose: () => void;
33
+ }
34
+ /**
35
+ * The per-phase doc viewer. Fetches the route on mount / fileName change.
36
+ * Vim nav + / search + n/N + Esc; y copies the doc. Esc closes search first,
37
+ * else the viewer. data-theme is passed down by the hoisting Inspector
38
+ * (0.1.10 invariant: useBoardTheme lives in the panel).
39
+ */
40
+ export declare function DocViewer({ runId, worktreeRoot, fileName, theme, onClose }: DocViewerProps): ReactNode;
@@ -15,6 +15,19 @@ export interface LiveScope {
15
15
  }
16
16
  /** Fetch the current state for one session scope (host resolves the workspace root). */
17
17
  export declare function fetchLiveState(scope: LiveScope, signal?: AbortSignal): Promise<LiveRecursiveState>;
18
+ /** One doc fetch request: the host-known workspace root + run id + phase doc file. */
19
+ export interface PhaseDocRequest {
20
+ root: string;
21
+ runId: string;
22
+ file: string;
23
+ }
24
+ /**
25
+ * Fetch one per-phase run doc (0.2.4) via the lazy GET /.recursive/api/doc
26
+ * route. Raw markdown text; the host validates the root (known workspace) and
27
+ * guards the file path (phase-doc basename only, containment under the run
28
+ * dir). Same 15s AbortController timeout as fetchLiveState.
29
+ */
30
+ export declare function fetchPhaseDoc(req: PhaseDocRequest): Promise<string>;
18
31
  /**
19
32
  * Subscribe to the SSE events feed. Returns a disposer. The host pushes a full
20
33
  * {revision, root, projection} frame on every fs change + a 15s heartbeat.
@@ -14,6 +14,8 @@
14
14
  import type { ClientContext } from './contract.ts';
15
15
  export { Board, listRuns } from './board.tsx';
16
16
  export { Inspector } from './inspector.tsx';
17
+ export { DocViewer, parseDoc, parseInline } from './doc-viewer.tsx';
18
+ export { RecursiveView } from './slots.ts';
17
19
  export { RecursiveSettings } from './settings.tsx';
18
20
  export { useLiveProjection } from './use-live.ts';
19
21
  export type { LiveProjectionSnapshot } from './use-live.ts';
@@ -41,6 +41,16 @@ export declare function useRecursiveSessions(useSessions: SnapshotSelectorHook<S
41
41
  export declare function RecursiveLauncherGate({ useSessions }: {
42
42
  useSessions: SnapshotSelectorHook<SessionListStateLike>;
43
43
  }): ReactNode;
44
+ /**
45
+ * RecursiveView: the conversation.view tab body. Renders the run board INLINE
46
+ * (fills the view area) keyed on the CURRENT workspace, and swaps to the
47
+ * inspector modal when a run is opened. Read-only (R9): uses the live host
48
+ * route. No preset gate — the tab is discoverable in any session.
49
+ */
50
+ export declare function RecursiveView({ useSessions, useWorkspaces }: {
51
+ useSessions: SnapshotSelectorHook<SessionListStateLike>;
52
+ useWorkspaces: SnapshotSelectorHook<WorkspaceListStateLike>;
53
+ }): ReactNode;
44
54
  export declare function registerSlots(ctx: ClientContext): () => void;
45
55
  /**
46
56
  * Board overlay: subscribes to the shared board store, gates on open + recursive