@wrongstack/tui 0.284.1 → 0.285.0
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/dist/app-initial-state.d.ts +26 -0
- package/dist/app-initial-state.d.ts.map +1 -0
- package/dist/app-reducer.d.ts +5 -0
- package/dist/app-reducer.d.ts.map +1 -0
- package/dist/app-state.d.ts +1801 -0
- package/dist/app-state.d.ts.map +1 -0
- package/dist/app.d.ts +579 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/clipboard.d.ts +2 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/components/agents-monitor.d.ts +49 -0
- package/dist/components/agents-monitor.d.ts.map +1 -0
- package/dist/components/animation-style.d.ts +51 -0
- package/dist/components/animation-style.d.ts.map +1 -0
- package/dist/components/audit-panel.d.ts +9 -0
- package/dist/components/audit-panel.d.ts.map +1 -0
- package/dist/components/auth-panel-model.d.ts +150 -0
- package/dist/components/auth-panel-model.d.ts.map +1 -0
- package/dist/components/auth-panel.d.ts +8 -0
- package/dist/components/auth-panel.d.ts.map +1 -0
- package/dist/components/autonomy-picker.d.ts +15 -0
- package/dist/components/autonomy-picker.d.ts.map +1 -0
- package/dist/components/brain-decision-prompt.d.ts +28 -0
- package/dist/components/brain-decision-prompt.d.ts.map +1 -0
- package/dist/components/brain-panel.d.ts +16 -0
- package/dist/components/brain-panel.d.ts.map +1 -0
- package/dist/components/checkpoint-timeline.d.ts +19 -0
- package/dist/components/checkpoint-timeline.d.ts.map +1 -0
- package/dist/components/confirm-prompt.d.ts +26 -0
- package/dist/components/confirm-prompt.d.ts.map +1 -0
- package/dist/components/continue-confirm-panel.d.ts +47 -0
- package/dist/components/continue-confirm-panel.d.ts.map +1 -0
- package/dist/components/coordinator-panel.d.ts +11 -0
- package/dist/components/coordinator-panel.d.ts.map +1 -0
- package/dist/components/design-picker.d.ts +14 -0
- package/dist/components/design-picker.d.ts.map +1 -0
- package/dist/components/enhance-panel.d.ts +36 -0
- package/dist/components/enhance-panel.d.ts.map +1 -0
- package/dist/components/esc-confirm-prompt.d.ts +17 -0
- package/dist/components/esc-confirm-prompt.d.ts.map +1 -0
- package/dist/components/f-key-picker.d.ts +13 -0
- package/dist/components/f-key-picker.d.ts.map +1 -0
- package/dist/components/file-picker.d.ts +8 -0
- package/dist/components/file-picker.d.ts.map +1 -0
- package/dist/components/fleet-monitor.d.ts +60 -0
- package/dist/components/fleet-monitor.d.ts.map +1 -0
- package/dist/components/fleet-panel.d.ts +69 -0
- package/dist/components/fleet-panel.d.ts.map +1 -0
- package/dist/components/goal-panel.d.ts +17 -0
- package/dist/components/goal-panel.d.ts.map +1 -0
- package/dist/components/help-overlay.d.ts +27 -0
- package/dist/components/help-overlay.d.ts.map +1 -0
- package/dist/components/help-panel.d.ts +16 -0
- package/dist/components/help-panel.d.ts.map +1 -0
- package/dist/components/history/assistant.d.ts +61 -0
- package/dist/components/history/assistant.d.ts.map +1 -0
- package/dist/components/history/banner.d.ts +13 -0
- package/dist/components/history/banner.d.ts.map +1 -0
- package/dist/components/history/code-block.d.ts +217 -0
- package/dist/components/history/code-block.d.ts.map +1 -0
- package/dist/components/history/entry.d.ts +19 -0
- package/dist/components/history/entry.d.ts.map +1 -0
- package/dist/components/history/index.d.ts +21 -0
- package/dist/components/history/index.d.ts.map +1 -0
- package/dist/components/history/replay.d.ts +44 -0
- package/dist/components/history/replay.d.ts.map +1 -0
- package/dist/components/history/types.d.ts +146 -0
- package/dist/components/history/types.d.ts.map +1 -0
- package/dist/components/history/utils.d.ts +65 -0
- package/dist/components/history/utils.d.ts.map +1 -0
- package/dist/components/history.d.ts +2 -0
- package/dist/components/history.d.ts.map +1 -0
- package/dist/components/input.d.ts +57 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/kanban-panel.d.ts +7 -0
- package/dist/components/kanban-panel.d.ts.map +1 -0
- package/dist/components/key-hint-bar.d.ts +31 -0
- package/dist/components/key-hint-bar.d.ts.map +1 -0
- package/dist/components/live-activity-strip.d.ts +39 -0
- package/dist/components/live-activity-strip.d.ts.map +1 -0
- package/dist/components/mailbox-panel.d.ts +40 -0
- package/dist/components/mailbox-panel.d.ts.map +1 -0
- package/dist/components/mcp-picker.d.ts +18 -0
- package/dist/components/mcp-picker.d.ts.map +1 -0
- package/dist/components/mode-picker.d.ts +17 -0
- package/dist/components/mode-picker.d.ts.map +1 -0
- package/dist/components/model-picker.d.ts +32 -0
- package/dist/components/model-picker.d.ts.map +1 -0
- package/dist/components/phase-monitor.d.ts +33 -0
- package/dist/components/phase-monitor.d.ts.map +1 -0
- package/dist/components/phase-panel.d.ts +22 -0
- package/dist/components/phase-panel.d.ts.map +1 -0
- package/dist/components/plan-panel.d.ts +17 -0
- package/dist/components/plan-panel.d.ts.map +1 -0
- package/dist/components/plugin-picker.d.ts +22 -0
- package/dist/components/plugin-picker.d.ts.map +1 -0
- package/dist/components/process-list.d.ts +14 -0
- package/dist/components/process-list.d.ts.map +1 -0
- package/dist/components/project-picker.d.ts +21 -0
- package/dist/components/project-picker.d.ts.map +1 -0
- package/dist/components/prompt-picker.d.ts +31 -0
- package/dist/components/prompt-picker.d.ts.map +1 -0
- package/dist/components/provider-colors.d.ts +40 -0
- package/dist/components/provider-colors.d.ts.map +1 -0
- package/dist/components/queue-panel.d.ts +16 -0
- package/dist/components/queue-panel.d.ts.map +1 -0
- package/dist/components/resume-picker.d.ts +16 -0
- package/dist/components/resume-picker.d.ts.map +1 -0
- package/dist/components/scrollable-history.d.ts +60 -0
- package/dist/components/scrollable-history.d.ts.map +1 -0
- package/dist/components/sdd-board-overlay.d.ts +15 -0
- package/dist/components/sdd-board-overlay.d.ts.map +1 -0
- package/dist/components/send-mode-picker.d.ts +64 -0
- package/dist/components/send-mode-picker.d.ts.map +1 -0
- package/dist/components/sessions-panel.d.ts +46 -0
- package/dist/components/sessions-panel.d.ts.map +1 -0
- package/dist/components/settings-picker.d.ts +371 -0
- package/dist/components/settings-picker.d.ts.map +1 -0
- package/dist/components/shadow-panel.d.ts +13 -0
- package/dist/components/shadow-panel.d.ts.map +1 -0
- package/dist/components/shell-command-warning.d.ts +9 -0
- package/dist/components/shell-command-warning.d.ts.map +1 -0
- package/dist/components/slash-menu.d.ts +9 -0
- package/dist/components/slash-menu.d.ts.map +1 -0
- package/dist/components/status-bar.d.ts +378 -0
- package/dist/components/status-bar.d.ts.map +1 -0
- package/dist/components/statusline-picker.d.ts +55 -0
- package/dist/components/statusline-picker.d.ts.map +1 -0
- package/dist/components/suggestions.d.ts +9 -0
- package/dist/components/suggestions.d.ts.map +1 -0
- package/dist/components/todos-monitor.d.ts +13 -0
- package/dist/components/todos-monitor.d.ts.map +1 -0
- package/dist/components/tools-picker.d.ts +20 -0
- package/dist/components/tools-picker.d.ts.map +1 -0
- package/dist/components/worktree-monitor.d.ts +23 -0
- package/dist/components/worktree-monitor.d.ts.map +1 -0
- package/dist/components/worktree-panel.d.ts +21 -0
- package/dist/components/worktree-panel.d.ts.map +1 -0
- package/dist/f-key-panels.d.ts +46 -0
- package/dist/f-key-panels.d.ts.map +1 -0
- package/dist/file-search.d.ts +3 -0
- package/dist/file-search.d.ts.map +1 -0
- package/dist/fn-keys.d.ts +20 -0
- package/dist/fn-keys.d.ts.map +1 -0
- package/dist/git-info.d.ts +20 -0
- package/dist/git-info.d.ts.map +1 -0
- package/dist/heap-watchdog.d.ts +41 -0
- package/dist/heap-watchdog.d.ts.map +1 -0
- package/dist/highlight.d.ts +30 -0
- package/dist/highlight.d.ts.map +1 -0
- package/dist/hit-test.d.ts +75 -0
- package/dist/hit-test.d.ts.map +1 -0
- package/dist/hooks/use-auth-panel.d.ts +38 -0
- package/dist/hooks/use-auth-panel.d.ts.map +1 -0
- package/dist/hooks/use-autonomous-coordinator.d.ts +21 -0
- package/dist/hooks/use-autonomous-coordinator.d.ts.map +1 -0
- package/dist/hooks/use-brain-events.d.ts +7 -0
- package/dist/hooks/use-brain-events.d.ts.map +1 -0
- package/dist/hooks/use-director-fleet-bridge.d.ts +17 -0
- package/dist/hooks/use-director-fleet-bridge.d.ts.map +1 -0
- package/dist/hooks/use-file-search.d.ts +42 -0
- package/dist/hooks/use-file-search.d.ts.map +1 -0
- package/dist/hooks/use-input-history-persistence.d.ts +14 -0
- package/dist/hooks/use-input-history-persistence.d.ts.map +1 -0
- package/dist/hooks/use-mode-picker.d.ts +15 -0
- package/dist/hooks/use-mode-picker.d.ts.map +1 -0
- package/dist/hooks/use-paste-handling.d.ts +30 -0
- package/dist/hooks/use-paste-handling.d.ts.map +1 -0
- package/dist/hooks/use-picker-keys.d.ts +58 -0
- package/dist/hooks/use-picker-keys.d.ts.map +1 -0
- package/dist/hooks/use-prompt-picker.d.ts +28 -0
- package/dist/hooks/use-prompt-picker.d.ts.map +1 -0
- package/dist/hooks/use-queue-manager.d.ts +26 -0
- package/dist/hooks/use-queue-manager.d.ts.map +1 -0
- package/dist/hooks/use-statusline-hidden-sync.d.ts +14 -0
- package/dist/hooks/use-statusline-hidden-sync.d.ts.map +1 -0
- package/dist/hooks/use-statusline-state.d.ts +44 -0
- package/dist/hooks/use-statusline-state.d.ts.map +1 -0
- package/dist/hooks/use-stream-chip-expiration.d.ts +25 -0
- package/dist/hooks/use-stream-chip-expiration.d.ts.map +1 -0
- package/dist/hooks/use-subagent-events.d.ts +8 -0
- package/dist/hooks/use-subagent-events.d.ts.map +1 -0
- package/dist/hooks/use-token-counter-refresh.d.ts +30 -0
- package/dist/hooks/use-token-counter-refresh.d.ts.map +1 -0
- package/dist/hooks/use-tui-controllers.d.ts +31 -0
- package/dist/hooks/use-tui-controllers.d.ts.map +1 -0
- package/dist/hooks/use-tui-event-bridge.d.ts +29 -0
- package/dist/hooks/use-tui-event-bridge.d.ts.map +1 -0
- package/dist/hooks/use-working-dir-chip.d.ts +8 -0
- package/dist/hooks/use-working-dir-chip.d.ts.map +1 -0
- package/dist/index.d.ts +11 -910
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2633 -2188
- package/dist/index.js.map +7 -1
- package/dist/ink.d.ts +20 -0
- package/dist/ink.d.ts.map +1 -0
- package/dist/input-editing.d.ts +76 -0
- package/dist/input-editing.d.ts.map +1 -0
- package/dist/input-tokens.d.ts +65 -0
- package/dist/input-tokens.d.ts.map +1 -0
- package/dist/kill-slash.d.ts +3 -0
- package/dist/kill-slash.d.ts.map +1 -0
- package/dist/markdown-table.d.ts +45 -0
- package/dist/markdown-table.d.ts.map +1 -0
- package/dist/markdown.d.ts +47 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/mouse.d.ts +73 -0
- package/dist/mouse.d.ts.map +1 -0
- package/dist/on-panel-open.d.ts +62 -0
- package/dist/on-panel-open.d.ts.map +1 -0
- package/dist/paste-accumulator.d.ts +19 -0
- package/dist/paste-accumulator.d.ts.map +1 -0
- package/dist/ps-slash.d.ts +7 -0
- package/dist/ps-slash.d.ts.map +1 -0
- package/dist/queue-slash.d.ts +24 -0
- package/dist/queue-slash.d.ts.map +1 -0
- package/dist/reducers/fleet.d.ts +16 -0
- package/dist/reducers/fleet.d.ts.map +1 -0
- package/dist/reducers/helpers.d.ts +38 -0
- package/dist/reducers/helpers.d.ts.map +1 -0
- package/dist/rehydrate-history.d.ts +40 -0
- package/dist/rehydrate-history.d.ts.map +1 -0
- package/dist/run-tui.d.ts +507 -0
- package/dist/run-tui.d.ts.map +1 -0
- package/dist/slash-command-search.d.ts +10 -0
- package/dist/slash-command-search.d.ts.map +1 -0
- package/dist/steering-preamble.d.ts +25 -0
- package/dist/steering-preamble.d.ts.map +1 -0
- package/dist/submit-history.d.ts +17 -0
- package/dist/submit-history.d.ts.map +1 -0
- package/dist/terminal-title.d.ts +12 -0
- package/dist/terminal-title.d.ts.map +1 -0
- package/dist/theme.d.ts +91 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/thinking-word.d.ts +26 -0
- package/dist/thinking-word.d.ts.map +1 -0
- package/dist/tool-glyph.d.ts +18 -0
- package/dist/tool-glyph.d.ts.map +1 -0
- package/package.json +8 -9
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface GitInfo {
|
|
2
|
+
branch: string;
|
|
3
|
+
/** Total lines added in working tree vs HEAD (staged + unstaged). */
|
|
4
|
+
added: number;
|
|
5
|
+
/** Total lines deleted in working tree vs HEAD (staged + unstaged). */
|
|
6
|
+
deleted: number;
|
|
7
|
+
/** Count of untracked files in the working tree. */
|
|
8
|
+
untracked: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Read git branch + change summary for the given cwd. Returns `null`
|
|
12
|
+
* when the directory isn't a git repository or git isn't installed —
|
|
13
|
+
* the status bar just hides the git chip in that case.
|
|
14
|
+
*
|
|
15
|
+
* Spawns two short-lived `git` processes in parallel. Cheap enough to
|
|
16
|
+
* call on a 3–5 second interval; the caller is responsible for the
|
|
17
|
+
* cadence (this function is purely fire-and-result).
|
|
18
|
+
*/
|
|
19
|
+
export declare function readGitInfo(cwd: string): Promise<GitInfo | null>;
|
|
20
|
+
//# sourceMappingURL=git-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-info.d.ts","sourceRoot":"","sources":["../src/git-info.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAgCtE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface HeapSample {
|
|
2
|
+
ts: string;
|
|
3
|
+
/** Resident set size, bytes. */
|
|
4
|
+
rss: number;
|
|
5
|
+
heapUsed: number;
|
|
6
|
+
heapTotal: number;
|
|
7
|
+
/** Off-heap (buffers, etc.), bytes. */
|
|
8
|
+
external: number;
|
|
9
|
+
/** V8 hard heap limit, bytes — the OOM ceiling. */
|
|
10
|
+
heapLimit: number;
|
|
11
|
+
/** heapUsed / heapLimit, 0–1. */
|
|
12
|
+
load: number;
|
|
13
|
+
}
|
|
14
|
+
export interface HeapWatchdogOptions {
|
|
15
|
+
/** Sampling cadence. Default 60s. */
|
|
16
|
+
sampleEveryMs?: number | undefined;
|
|
17
|
+
/** Diagnostic-file append cadence. Default 5min. */
|
|
18
|
+
logEveryMs?: number | undefined;
|
|
19
|
+
/** Diagnostics file. Default ~/.wrongstack/logs/heap.jsonl */
|
|
20
|
+
logPath?: string | undefined;
|
|
21
|
+
/** Fraction of the heap limit that triggers a 'warn' callback. Default 0.6. */
|
|
22
|
+
warnAt?: number | undefined;
|
|
23
|
+
/** Fraction of the heap limit that triggers a 'critical' callback. Default 0.85. */
|
|
24
|
+
criticalAt?: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Extra structure sizes merged into every diagnostic line — supply cheap
|
|
27
|
+
* counters (array lengths, approximate char totals). Must not throw.
|
|
28
|
+
*/
|
|
29
|
+
collectStats?: (() => Record<string, number>) | undefined;
|
|
30
|
+
/** Called on threshold crossings with a human-readable message. */
|
|
31
|
+
onWarn?: ((level: 'warn' | 'critical', message: string, sample: HeapSample) => void) | undefined;
|
|
32
|
+
}
|
|
33
|
+
export declare function defaultHeapLogPath(): string;
|
|
34
|
+
export declare function takeHeapSample(): HeapSample;
|
|
35
|
+
/**
|
|
36
|
+
* Start the watchdog. Returns a stop function — call it on unmount/exit.
|
|
37
|
+
* All I/O is best-effort and serialized; a failed append never throws into
|
|
38
|
+
* the caller.
|
|
39
|
+
*/
|
|
40
|
+
export declare function startHeapWatchdog(opts?: HeapWatchdogOptions): () => void;
|
|
41
|
+
//# sourceMappingURL=heap-watchdog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heap-watchdog.d.ts","sourceRoot":"","sources":["../src/heap-watchdog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
|
5
|
+
bold?: boolean | undefined;
|
|
6
|
+
}
|
|
7
|
+
export type Lang = 'ts' | 'js' | 'json' | 'bash' | 'python' | 'diff' | 'plain';
|
|
8
|
+
/** Carry state for constructs that span lines (block comments, triple strings). */
|
|
9
|
+
export interface HLState {
|
|
10
|
+
block?: boolean | undefined;
|
|
11
|
+
triple?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Highlight ONE line. `carry` threads multi-line state (block comments, triple
|
|
15
|
+
* strings) from the previous line; pass the returned `carry` into the next call.
|
|
16
|
+
* Guarantees `result.tokens.map(t=>t.text).join('') === line`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function highlightLine(line: string, lang: Lang, carry?: HLState): {
|
|
19
|
+
tokens: Token[];
|
|
20
|
+
carry: HLState;
|
|
21
|
+
};
|
|
22
|
+
/** Map a code-fence info string (```ts, ```bash, …) to a supported Lang. */
|
|
23
|
+
export declare function detectLang(fenceInfo: string): Lang;
|
|
24
|
+
/**
|
|
25
|
+
* Infer a supported Lang from a file path's extension (`foo/bar.tsx` → `ts`).
|
|
26
|
+
* Used by diff rendering to syntax-highlight changed/context lines of the
|
|
27
|
+
* touched file. Unknown or missing extensions fall back to `plain`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function langFromPath(path: string): Lang;
|
|
30
|
+
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../src/highlight.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/E,mFAAmF;AACnF,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AA6aD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,EACV,KAAK,GAAE,OAAY,GAClB;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAgBrC;AAwBD,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI/C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mouse hit-testing for the full-mouse-mode TUI layout.
|
|
3
|
+
*
|
|
4
|
+
* Ink exposes no absolute terminal coordinates, but the mouse-mode layout is
|
|
5
|
+
* deterministic top-down: the chat history occupies the first `viewportRows`
|
|
6
|
+
* rows of the terminal (its managed scrollbar is the last column of that band),
|
|
7
|
+
* and everything below it (rows viewportRows+1 .. termRows) is the bottom region
|
|
8
|
+
* — input, pickers, confirm prompt, status bar, panels. That is enough to map a
|
|
9
|
+
* 1-based SGR mouse report (x,y) onto a coarse region without any DOM measuring.
|
|
10
|
+
*
|
|
11
|
+
* Finer resolution inside the bottom region (which status-bar line, which
|
|
12
|
+
* confirm button) is layered on top by the consumers using their own measured
|
|
13
|
+
* offsets + the co-located column-span helpers; this primitive only owns the
|
|
14
|
+
* top-level row/column geometry so it stays pure and unit-testable.
|
|
15
|
+
*/
|
|
16
|
+
/** Mouse-mode layout geometry. All values are 1-based to match SGR reports. */
|
|
17
|
+
export interface MouseLayout {
|
|
18
|
+
/** Live terminal row count. */
|
|
19
|
+
termRows: number;
|
|
20
|
+
/** Live terminal column count. */
|
|
21
|
+
termCols: number;
|
|
22
|
+
/** Rows the history viewport occupies, from the top of the screen. */
|
|
23
|
+
viewportRows: number;
|
|
24
|
+
}
|
|
25
|
+
export type HitRegion =
|
|
26
|
+
/** The managed scrollbar track; `cell` is the 0-based row on the track. */
|
|
27
|
+
{
|
|
28
|
+
kind: 'scrollbar';
|
|
29
|
+
cell: number;
|
|
30
|
+
}
|
|
31
|
+
/** Inside the history viewport; `row` is 0-based from the viewport top. */
|
|
32
|
+
| {
|
|
33
|
+
kind: 'history';
|
|
34
|
+
row: number;
|
|
35
|
+
}
|
|
36
|
+
/** Below the history viewport; `row` is 0-based from the bottom-region top. */
|
|
37
|
+
| {
|
|
38
|
+
kind: 'bottom';
|
|
39
|
+
row: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Columns at the right edge of the history viewport that count as the
|
|
43
|
+
* scrollbar, so a click need not land exactly on the 1-column track. The track
|
|
44
|
+
* itself renders in the last column; this widens the target by one.
|
|
45
|
+
*/
|
|
46
|
+
export declare const SCROLLBAR_HIT_WIDTH = 2;
|
|
47
|
+
/**
|
|
48
|
+
* Map a 1-based terminal (x,y) onto a layout region, or null when the point is
|
|
49
|
+
* outside the terminal. Pure — no side effects, no DOM access.
|
|
50
|
+
*/
|
|
51
|
+
export declare function hitRegion(layout: MouseLayout, x: number, y: number): HitRegion | null;
|
|
52
|
+
/**
|
|
53
|
+
* 1-based absolute terminal row of a status-bar content line.
|
|
54
|
+
*
|
|
55
|
+
* The status bar is bottom-anchored above whatever panels render below it, so
|
|
56
|
+
* its band starts at `termRows - belowHeight - statusBarHeight + 1`. Its first
|
|
57
|
+
* `headerRows` rows are non-content (the single top border), so content line
|
|
58
|
+
* `line` (0-based: line 1 = 0) sits `headerRows + line` rows into the band.
|
|
59
|
+
*
|
|
60
|
+
* `statusBarHeight` and `belowHeight` are live `measureElement` heights of the
|
|
61
|
+
* status-bar wrapper and the below-status-bar panel region. Returns null when
|
|
62
|
+
* the requested content line doesn't exist in the measured band.
|
|
63
|
+
*/
|
|
64
|
+
export declare function statusBarLineRow(opts: {
|
|
65
|
+
termRows: number;
|
|
66
|
+
/** Measured status-bar height, including its top border row. */
|
|
67
|
+
statusBarHeight: number;
|
|
68
|
+
/** Measured height of everything rendered below the status bar (0 if none). */
|
|
69
|
+
belowHeight: number;
|
|
70
|
+
/** Non-content rows at the top of the status bar (the border). */
|
|
71
|
+
headerRows: number;
|
|
72
|
+
/** 0-based content line index (line 1 = 0, line 2 = 1, …). */
|
|
73
|
+
line: number;
|
|
74
|
+
}): number | null;
|
|
75
|
+
//# sourceMappingURL=hit-test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hit-test.d.ts","sourceRoot":"","sources":["../src/hit-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,SAAS;AACnB,2EAA2E;AACzE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACrC,2EAA2E;GACzE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE;AAClC,+EAA+E;GAC7E;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAQrF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,eAAe,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,GAAG,IAAI,CAKhB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Action, State } from '../app-reducer.js';
|
|
2
|
+
import { type AuthPanelHost } from '../components/auth-panel-model.js';
|
|
3
|
+
export interface UseAuthPanelOptions {
|
|
4
|
+
authHost: AuthPanelHost | undefined;
|
|
5
|
+
stateRef: {
|
|
6
|
+
current: State;
|
|
7
|
+
};
|
|
8
|
+
dispatch: React.Dispatch<Action>;
|
|
9
|
+
/**
|
|
10
|
+
* Live `state.authPanel.open` — when the panel closes from OUTSIDE the
|
|
11
|
+
* controller (another panel's `closePanels`, an F-key toggle, Ctrl+C),
|
|
12
|
+
* any in-flight flow must be aborted so an invisible prompt can't leave
|
|
13
|
+
* an OAuth loopback server (or a pending readline promise) running
|
|
14
|
+
* behind a closed panel.
|
|
15
|
+
*/
|
|
16
|
+
open: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AuthPanelController {
|
|
19
|
+
/** Open the panel (used by `/auth` via the panel bridge). No-op without a host. */
|
|
20
|
+
openAuthPanel: (view?: 'list' | 'oauth') => boolean;
|
|
21
|
+
onAuthEnter: () => void;
|
|
22
|
+
onAuthBack: () => void;
|
|
23
|
+
onAuthShortcut: (input: string) => void;
|
|
24
|
+
onAuthPromptSubmit: () => void;
|
|
25
|
+
onAuthPromptCancel: () => void;
|
|
26
|
+
onAuthConfirm: (yes: boolean) => void;
|
|
27
|
+
onAuthFlowCancel: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Ctrl+C while the panel is open. In raw-mode terminals (ConPTY, most
|
|
30
|
+
* Windows setups) Ctrl+C arrives as key DATA — not a SIGINT — so the
|
|
31
|
+
* key router must handle it; the app's SIGINT ladder covers the
|
|
32
|
+
* console-event delivery path. Both paths abort any in-flight flow and
|
|
33
|
+
* close the panel.
|
|
34
|
+
*/
|
|
35
|
+
onAuthCtrlC: () => void;
|
|
36
|
+
}
|
|
37
|
+
export declare function useAuthPanel(opts: UseAuthPanelOptions): AuthPanelController;
|
|
38
|
+
//# sourceMappingURL=use-auth-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-auth-panel.d.ts","sourceRoot":"","sources":["../../src/hooks/use-auth-panel.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE;QAAE,OAAO,EAAE,KAAK,CAAA;KAAE,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,mFAAmF;IACnF,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,KAAK,OAAO,CAAC;IACpD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,aAAa,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAgBD,wBAAgB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB,CAoS3E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CoordinatorEvent } from '@wrongstack/core';
|
|
2
|
+
/**
|
|
3
|
+
* Wires the AutonomousCoordinator into the TUI reducer via dispatch.
|
|
4
|
+
*
|
|
5
|
+
* When `subscribeCoordinatorEvents` is provided, this hook:
|
|
6
|
+
* 1. Subscribes to all coordinator events on mount
|
|
7
|
+
* 2. Maps each CoordinatorEvent to a `coordinatorEvent` dispatch action
|
|
8
|
+
* 3. Cleans up the subscription on unmount
|
|
9
|
+
*
|
|
10
|
+
* When the option is omitted (coordinator not active), the hook is a no-op.
|
|
11
|
+
*
|
|
12
|
+
* @param subscribeCoordinatorEvents - the TUI's subscribe function from RunTuiOptions
|
|
13
|
+
* @param dispatch - the TUI reducer dispatch
|
|
14
|
+
*/
|
|
15
|
+
export declare function useAutonomousCoordinator(subscribeCoordinatorEvents: ((fn: (event: CoordinatorEvent) => void) => () => void) | undefined, dispatch: React.Dispatch<{
|
|
16
|
+
type: 'coordinatorEvent';
|
|
17
|
+
event: CoordinatorEvent;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'toggleCoordinatorMonitor';
|
|
20
|
+
}>): void;
|
|
21
|
+
//# sourceMappingURL=use-autonomous-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-autonomous-coordinator.d.ts","sourceRoot":"","sources":["../../src/hooks/use-autonomous-coordinator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,0BAA0B,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC,GAAG,SAAS,EAC/F,QAAQ,EAAE,KAAK,CAAC,QAAQ,CACpB;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,0BAA0B,CAAA;CAAE,CACvC,GACA,IAAI,CAgBN"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EventBus } from '@wrongstack/core';
|
|
2
|
+
import type { Action } from '../app-reducer.js';
|
|
3
|
+
/**
|
|
4
|
+
* Brain decision events → chat history / status bar.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useBrainEvents(events: EventBus, dispatch: React.Dispatch<Action>, getSessionId?: (() => string | undefined) | undefined): void;
|
|
7
|
+
//# sourceMappingURL=use-brain-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brain-events.d.ts","sourceRoot":"","sources":["../../src/hooks/use-brain-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,mBAAmB,CAAC;AAGvD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAChC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,GACpD,IAAI,CA6EN"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Director } from '@wrongstack/core';
|
|
2
|
+
import type { Action, State } from '../app-reducer.js';
|
|
3
|
+
export interface UseDirectorFleetBridgeOptions {
|
|
4
|
+
director: Director | null;
|
|
5
|
+
dispatch: React.Dispatch<Action>;
|
|
6
|
+
stateRef: React.MutableRefObject<State>;
|
|
7
|
+
streamFleet: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Director FleetBus -> TUI state bridge.
|
|
11
|
+
*
|
|
12
|
+
* High-frequency text deltas are batched so subagent streams do not cause a
|
|
13
|
+
* render per token. The hook keeps live refs for settings/state that should not
|
|
14
|
+
* force FleetBus re-subscription.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useDirectorFleetBridge({ director, dispatch, stateRef, streamFleet, }: UseDirectorFleetBridgeOptions): void;
|
|
17
|
+
//# sourceMappingURL=use-director-fleet-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-director-fleet-bridge.d.ts","sourceRoot":"","sources":["../../src/hooks/use-director-fleet-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAsBvD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,GACZ,EAAE,6BAA6B,GAAG,IAAI,CAoXtC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File-search hook — @-token detection, file search, and file picker
|
|
3
|
+
* selection handler. Extracted from app.tsx (Issue #23, PR 4).
|
|
4
|
+
*
|
|
5
|
+
* Drives the <FilePicker /> component: watches buffer/cursor for an
|
|
6
|
+
* active `@<query>` token, calls searchFiles(), dispatches matches,
|
|
7
|
+
* and on Enter/click registers the picked file as an attachment.
|
|
8
|
+
*/
|
|
9
|
+
import type { InputBuilder } from '@wrongstack/core';
|
|
10
|
+
import type { Action, State } from '../app-reducer.js';
|
|
11
|
+
/**
|
|
12
|
+
* Find an active `@<query>` token at the cursor. The token starts at the
|
|
13
|
+
* last `@` not preceded by a non-whitespace char, and runs up to the cursor
|
|
14
|
+
* (no whitespace allowed inside). Returns null if no active token.
|
|
15
|
+
*/
|
|
16
|
+
export declare function detectAtToken(buffer: string, cursor: number): {
|
|
17
|
+
start: number;
|
|
18
|
+
end: number;
|
|
19
|
+
query: string;
|
|
20
|
+
} | null;
|
|
21
|
+
export interface UseFileSearchOptions {
|
|
22
|
+
state: State;
|
|
23
|
+
dispatch: React.Dispatch<Action>;
|
|
24
|
+
projectRoot: string;
|
|
25
|
+
builderRef: React.MutableRefObject<InputBuilder | null>;
|
|
26
|
+
draftRef: React.MutableRefObject<{
|
|
27
|
+
buffer: string;
|
|
28
|
+
cursor: number;
|
|
29
|
+
}>;
|
|
30
|
+
setDraft: (buffer: string, cursor: number) => void;
|
|
31
|
+
tokenPreviewsRef: React.MutableRefObject<Map<string, string>>;
|
|
32
|
+
}
|
|
33
|
+
export interface FileSearchResult {
|
|
34
|
+
/** Called from the host's Enter handler when the file picker is open. */
|
|
35
|
+
onPickerEnter: () => Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Watches buffer/cursor for `@<query>` tokens, drives file search, and
|
|
39
|
+
* provides the Enter handler for the <FilePicker> component.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useFileSearch(options: UseFileSearchOptions): FileSearchResult;
|
|
42
|
+
//# sourceMappingURL=use-file-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-file-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-file-search.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAKvD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAetD;AAID,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACxD,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,gBAAgB,CA6E7E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Action, State } from '../app-reducer.js';
|
|
2
|
+
export interface UseInputHistoryPersistenceOptions {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
inputHistory: State['inputHistory'];
|
|
5
|
+
dispatch: React.Dispatch<Action>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Per-project prompt history persistence.
|
|
9
|
+
*
|
|
10
|
+
* Loads prompt history from `projectInputHistory` on mount and saves it back
|
|
11
|
+
* with a 200ms debounce whenever the in-memory list changes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useInputHistoryPersistence({ projectRoot, inputHistory, dispatch, }: UseInputHistoryPersistenceOptions): void;
|
|
14
|
+
//# sourceMappingURL=use-input-history-persistence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-input-history-persistence.d.ts","sourceRoot":"","sources":["../../src/hooks/use-input-history-persistence.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,WAAW,iCAAiC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,EAAE,iCAAiC,GAAG,IAAI,CA+C1C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Mode } from '@wrongstack/core';
|
|
2
|
+
import type { Action } from '../app-reducer.js';
|
|
3
|
+
export interface GetModesResult {
|
|
4
|
+
modes: Mode[];
|
|
5
|
+
activeId: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface UseModePickerOptions {
|
|
8
|
+
dispatch: React.Dispatch<Action>;
|
|
9
|
+
getModes?: (() => Promise<GetModesResult>) | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function buildModePickerOptions(result: GetModesResult): import("../components/mode-picker.js").ModeOption[];
|
|
12
|
+
export declare function useModePicker({ dispatch, getModes, }: UseModePickerOptions): {
|
|
13
|
+
openModePicker: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=use-mode-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mode-picker.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mode-picker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,SAAS,CAAC;CACxD;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,uDAE5D;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,GACT,EAAE,oBAAoB,GAAG;IAAE,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAShE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { InputBuilder } from '@wrongstack/core';
|
|
2
|
+
import type { Action } from '../app-reducer.js';
|
|
3
|
+
export interface UsePasteHandlingOptions {
|
|
4
|
+
builderRef: React.MutableRefObject<InputBuilder | null>;
|
|
5
|
+
dispatch: React.Dispatch<Action>;
|
|
6
|
+
draftRef: React.MutableRefObject<{
|
|
7
|
+
buffer: string;
|
|
8
|
+
cursor: number;
|
|
9
|
+
}>;
|
|
10
|
+
setDraft: (buffer: string, cursor: number) => void;
|
|
11
|
+
tokenPreviewsRef: React.MutableRefObject<Map<string, string>>;
|
|
12
|
+
}
|
|
13
|
+
export interface PasteHandlingResult {
|
|
14
|
+
pasteAccumRef: React.MutableRefObject<string | null>;
|
|
15
|
+
pasteFlushTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;
|
|
16
|
+
commitPaste: (full: string) => Promise<void>;
|
|
17
|
+
pasteClipboardImage: () => Promise<void>;
|
|
18
|
+
pasteClipboardText: () => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Bracketed-paste accumulator and clipboard paste handling.
|
|
22
|
+
*
|
|
23
|
+
* A single paste can be delivered across several stdin/keypress events: only
|
|
24
|
+
* the first carries the \x1b[200~ begin marker and only the last carries
|
|
25
|
+
* \x1b[201~. We buffer every fragment here between those markers and finalize
|
|
26
|
+
* once, so a paste never fragments into multiple placeholders or leaks
|
|
27
|
+
* newlines into the buffer.
|
|
28
|
+
*/
|
|
29
|
+
export declare function usePasteHandling({ builderRef, dispatch, draftRef, setDraft, tokenPreviewsRef, }: UsePasteHandlingOptions): PasteHandlingResult;
|
|
30
|
+
//# sourceMappingURL=use-paste-handling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-paste-handling.d.ts","sourceRoot":"","sources":["../../src/hooks/use-paste-handling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACxD,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACrD,kBAAkB,EAAE,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;IACjF,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,mBAAmB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,GACjB,EAAE,uBAAuB,GAAG,mBAAmB,CAwH/C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picker key dispatch.
|
|
3
|
+
*
|
|
4
|
+
* The picker dispatch is a closed dispatch table where each picker checks
|
|
5
|
+
* `state.<picker>.open` and either handles the key (returning `true`) or
|
|
6
|
+
* falls through (returning `false`). The hook returns a single function
|
|
7
|
+
* `tryPickerKey(input, key, isEnter)` that the caller's `handleKey` invokes
|
|
8
|
+
* *before* its non-picker dispatch and bails on `true`.
|
|
9
|
+
*/
|
|
10
|
+
import type { Action, State } from '../app-reducer.js';
|
|
11
|
+
import type { KeyEvent } from '../components/input.js';
|
|
12
|
+
import type { AutonomyStage } from './use-statusline-state.js';
|
|
13
|
+
export interface PickerKeysHost {
|
|
14
|
+
state: State;
|
|
15
|
+
dispatch: React.Dispatch<Action>;
|
|
16
|
+
lastEnterAtRef: {
|
|
17
|
+
current: number;
|
|
18
|
+
};
|
|
19
|
+
inputGateRef: {
|
|
20
|
+
current: boolean;
|
|
21
|
+
};
|
|
22
|
+
switchProviderAndModel: ((providerId: string, modelId: string) => string | null | Promise<string | null>) | undefined;
|
|
23
|
+
setLiveProvider: ((v: string) => void) | undefined;
|
|
24
|
+
setLiveModel: ((v: string) => void) | undefined;
|
|
25
|
+
setActiveMaxContext: ((v: number | undefined) => void) | undefined;
|
|
26
|
+
getAgentCtxMaxContext: () => number;
|
|
27
|
+
activeMaxContext: number | undefined;
|
|
28
|
+
currentContextTokens: number;
|
|
29
|
+
switchAutonomy: ((mode: AutonomyStage) => string | null) | undefined;
|
|
30
|
+
submit: ((text: string) => void) | undefined;
|
|
31
|
+
onAuthEnter: (() => void) | undefined;
|
|
32
|
+
onAuthBack: (() => void) | undefined;
|
|
33
|
+
onAuthShortcut: ((input: string) => void) | undefined;
|
|
34
|
+
onAuthPromptSubmit: (() => void) | undefined;
|
|
35
|
+
onAuthPromptCancel: (() => void) | undefined;
|
|
36
|
+
onAuthConfirm: ((yes: boolean) => void) | undefined;
|
|
37
|
+
onAuthFlowCancel: (() => void) | undefined;
|
|
38
|
+
onAuthCtrlC: (() => void) | undefined;
|
|
39
|
+
onPromptPickerEnter: (() => void) | undefined;
|
|
40
|
+
onResumePickerEnter: (() => Promise<void>) | undefined;
|
|
41
|
+
onSessionsPanelEnter: (() => Promise<void>) | undefined;
|
|
42
|
+
onProjectPickerEnter: (() => Promise<void>) | undefined;
|
|
43
|
+
onSlashPickerEnter: (() => void) | undefined;
|
|
44
|
+
onSettingsPickerEnter: (() => void) | undefined;
|
|
45
|
+
onPluginPickerToggle: (() => Promise<void> | void) | undefined;
|
|
46
|
+
onMcpPickerToggle: (() => Promise<void> | void) | undefined;
|
|
47
|
+
onMcpPickerRestart: (() => Promise<void> | void) | undefined;
|
|
48
|
+
onToolsPickerToggle: (() => Promise<void> | void) | undefined;
|
|
49
|
+
onHelpPanelEnter: (() => void) | undefined;
|
|
50
|
+
onBrainRiskChange: ((delta: number) => void) | undefined;
|
|
51
|
+
onShadowStart: (() => Promise<void> | void) | undefined;
|
|
52
|
+
onShadowStop: (() => Promise<void> | void) | undefined;
|
|
53
|
+
onFKeyPickerEnter: (() => void) | undefined;
|
|
54
|
+
onPickerEnter: (() => Promise<void>) | undefined;
|
|
55
|
+
onSlashPickerTab: (() => void) | undefined;
|
|
56
|
+
}
|
|
57
|
+
export declare function usePickerKeys(host: PickerKeysHost): (input: string, key: KeyEvent, isEnter: boolean) => boolean;
|
|
58
|
+
//# sourceMappingURL=use-picker-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-picker-keys.d.ts","sourceRoot":"","sources":["../../src/hooks/use-picker-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,cAAc,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,YAAY,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAEnC,sBAAsB,EAClB,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,GACjF,SAAS,CAAC;IAKd,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACnD,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAChD,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACnE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Entry {
|
|
4
|
+
slug: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
category: string;
|
|
8
|
+
source: string;
|
|
9
|
+
content: string;
|
|
10
|
+
favorite: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface PromptPickerOpenPayload {
|
|
13
|
+
all: PromptPickEntry[];
|
|
14
|
+
categories: string[];
|
|
15
|
+
recentSlugs: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function buildPromptPickerPayload(all: PromptLibraryEntry[], recentSlugs: string[]): PromptPickerOpenPayload;
|
|
18
|
+
export interface UsePromptPickerOptions {
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
dispatch: React.Dispatch<Action>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Lazily loads the prompt library and opens the TUI prompt picker.
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePromptPicker({ projectRoot, dispatch, }: UsePromptPickerOptions): {
|
|
26
|
+
openPromptPicker: () => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=use-prompt-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-prompt-picker.d.ts","sourceRoot":"","sources":["../../src/hooks/use-prompt-picker.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,eAAe,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,kBAAkB,EAAE,EACzB,WAAW,EAAE,MAAM,EAAE,GACpB,uBAAuB,CAkBzB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,GACT,EAAE,sBAAsB,GAAG;IAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAoCpE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { QueueStore, SlashCommandRegistry } from '@wrongstack/core';
|
|
2
|
+
import type { Action, State } from '../app-reducer.js';
|
|
3
|
+
import type { Settings } from '../app-state.js';
|
|
4
|
+
export interface UseQueueManagerOptions {
|
|
5
|
+
/** Optional persistent store — absent => in-memory only (no crash recovery). */
|
|
6
|
+
queueStore?: QueueStore | undefined;
|
|
7
|
+
/** Called on every queue change so the host learns what's waiting. */
|
|
8
|
+
onQueueChange?: ((items: string[]) => void) | undefined;
|
|
9
|
+
/** Slash registry to register the /queue command. */
|
|
10
|
+
slashRegistry: SlashCommandRegistry;
|
|
11
|
+
/** Live state snapshot (ref, not render-state) for slash command closures. */
|
|
12
|
+
stateRef: React.MutableRefObject<State>;
|
|
13
|
+
dispatch: React.Dispatch<Action>;
|
|
14
|
+
/** Settings access for persisting the mid-run send-mode picker toggle. */
|
|
15
|
+
getSettings?: (() => Settings) | undefined;
|
|
16
|
+
saveSettings?: ((settings: Settings) => string | Promise<string | null> | null) | undefined;
|
|
17
|
+
/** Live mirror of the mid-run send-mode picker enabled flag. */
|
|
18
|
+
midRunSendPickerRef: React.MutableRefObject<boolean>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Manages the TUI message queue: rehydration from persistent store,
|
|
22
|
+
* persistence on every change, host mirroring, and the /queue slash
|
|
23
|
+
* command. All side-effect wiring extracted from app.tsx.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useQueueManager({ queueStore, onQueueChange, slashRegistry, stateRef, dispatch, getSettings, saveSettings, midRunSendPickerRef, }: UseQueueManagerOptions): void;
|
|
26
|
+
//# sourceMappingURL=use-queue-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-queue-manager.d.ts","sourceRoot":"","sources":["../../src/hooks/use-queue-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoC,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,WAAW,sBAAsB;IACrC,gFAAgF;IAChF,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,sEAAsE;IACtE,aAAa,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACxD,qDAAqD;IACrD,aAAa,EAAE,oBAAoB,CAAC;IACpC,8EAA8E;IAC9E,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,CAAC,MAAM,QAAQ,CAAC,GAAG,SAAS,CAAC;IAC3C,YAAY,CAAC,EACT,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAChE,SAAS,CAAC;IACd,gEAAgE;IAChE,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,aAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,EAAE,sBAAsB,GAAG,IAAI,CAmE/B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StatuslineItem } from '../components/statusline-picker.js';
|
|
2
|
+
export declare function statuslineHiddenDiffers(hookHidden: readonly StatuslineItem[], pickerHidden: readonly StatuslineItem[]): boolean;
|
|
3
|
+
export interface UseStatuslineHiddenSyncOptions {
|
|
4
|
+
pickerOpen: boolean;
|
|
5
|
+
pickerHidden: readonly StatuslineItem[];
|
|
6
|
+
hiddenItems: readonly StatuslineItem[];
|
|
7
|
+
setHiddenItems: (items: StatuslineItem[]) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Mirrors reducer-owned statusline hidden-item changes back into the
|
|
11
|
+
* statusline state hook so the visible status bar updates immediately.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useStatuslineHiddenSync({ pickerOpen, pickerHidden, hiddenItems, setHiddenItems, }: UseStatuslineHiddenSyncOptions): void;
|
|
14
|
+
//# sourceMappingURL=use-statusline-hidden-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-statusline-hidden-sync.d.ts","sourceRoot":"","sources":["../../src/hooks/use-statusline-hidden-sync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,cAAc,EAAE,EACrC,YAAY,EAAE,SAAS,cAAc,EAAE,GACtC,OAAO,CAQT;AAED,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,SAAS,cAAc,EAAE,CAAC;IACxC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IACvC,cAAc,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,GACf,EAAE,8BAA8B,GAAG,IAAI,CAOvC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StatuslineItem } from '../components/statusline-picker.js';
|
|
2
|
+
export type AutonomyStage = 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel';
|
|
3
|
+
/**
|
|
4
|
+
* A statusline chip the user can persistently hide (written to
|
|
5
|
+
* `statusline.json` and toggled by the `/statusline` command).
|
|
6
|
+
*/
|
|
7
|
+
export type StatuslineHiddenItem = StatuslineItem;
|
|
8
|
+
export interface UseStatuslineStateOptions {
|
|
9
|
+
model: string;
|
|
10
|
+
provider: string | undefined;
|
|
11
|
+
effectiveMaxContext: number | undefined;
|
|
12
|
+
yolo: boolean;
|
|
13
|
+
getAutonomy?: (() => AutonomyStage) | undefined;
|
|
14
|
+
modeLabel: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The items the user has chosen to hide from the statusline.
|
|
17
|
+
* Accepted as either a `Set<string>` (the canonical shape) or
|
|
18
|
+
* a `readonly string[]` (the shape `App` actually receives from
|
|
19
|
+
* the `statuslineHiddenItems` prop, which is an array per the
|
|
20
|
+
* `.wrongstack/statusline.json` schema). The hook stores it
|
|
21
|
+
* internally as a `Set<string>` and exposes the same.
|
|
22
|
+
*/
|
|
23
|
+
statuslineHiddenItems: Set<string> | readonly string[];
|
|
24
|
+
}
|
|
25
|
+
export interface UseStatuslineState {
|
|
26
|
+
liveModel: string;
|
|
27
|
+
setLiveModel: (v: string) => void;
|
|
28
|
+
liveProvider: string;
|
|
29
|
+
setLiveProvider: (v: string) => void;
|
|
30
|
+
activeMaxContext: number | undefined;
|
|
31
|
+
setActiveMaxContext: (v: number | undefined) => void;
|
|
32
|
+
yoloLive: boolean;
|
|
33
|
+
setYoloLive: (v: boolean) => void;
|
|
34
|
+
autonomyLive: AutonomyStage;
|
|
35
|
+
setAutonomyLive: (v: AutonomyStage) => void;
|
|
36
|
+
liveModeLabel: string;
|
|
37
|
+
setLiveModeLabel: (v: string) => void;
|
|
38
|
+
hiddenItems: StatuslineHiddenItem[];
|
|
39
|
+
setHiddenItems: (v: StatuslineHiddenItem[]) => void;
|
|
40
|
+
sessionCount: number;
|
|
41
|
+
setSessionCount: (v: number) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare function useStatuslineState(opts: UseStatuslineStateOptions): UseStatuslineState;
|
|
44
|
+
//# sourceMappingURL=use-statusline-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-statusline-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-statusline-state.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,kBAAkB,CAAC;AAExF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,CAAC,MAAM,aAAa,CAAC,GAAG,SAAS,CAAC;IAChD,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;;;;;;OAOG;IACH,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,MAAM,EAAE,CAAC;CACxD;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MA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