@wrongstack/tui 0.284.1 → 0.286.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 +28 -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 +1841 -0
- package/dist/app-state.d.ts.map +1 -0
- package/dist/app.d.ts +593 -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 +114 -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-model.d.ts +107 -0
- package/dist/components/brain-panel-model.d.ts.map +1 -0
- package/dist/components/brain-panel.d.ts +22 -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 +37 -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 +387 -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/fleet-chat-coalescer.d.ts +32 -0
- package/dist/hooks/fleet-chat-coalescer.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-brain-panel.d.ts +43 -0
- package/dist/hooks/use-brain-panel.d.ts.map +1 -0
- package/dist/hooks/use-director-fleet-bridge.d.ts +31 -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-model-pick.d.ts +34 -0
- package/dist/hooks/use-model-pick.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 +72 -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 +16 -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 +37 -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 +12 -910
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4348 -2974
- 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 +522 -0
- package/dist/run-tui.d.ts.map +1 -0
- package/dist/sdd-lifecycle-entry.d.ts +18 -0
- package/dist/sdd-lifecycle-entry.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.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IAC1D,mEAAmE;IACnE,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAClG;AAID,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,cAAc,IAAI,UAAU,CAY3C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,mBAAwB,GAAG,MAAM,IAAI,CAoG5E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface Token {
|
|
2
|
+
text: string;
|
|
3
|
+
color?: string | undefined;
|
|
4
|
+
dim?: boolean | undefined;
|
|
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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure per-agent tool-call aggregation for compact fleet-chat mode.
|
|
3
|
+
*
|
|
4
|
+
* In `compact` mode the director bridge does not emit one chat line per
|
|
5
|
+
* subagent tool call; instead each call is folded into a per-agent
|
|
6
|
+
* `ToolAgg` and committed as ONE summary line at the same turn
|
|
7
|
+
* boundaries that flush the buffered assistant text (session end, task
|
|
8
|
+
* completion, effect teardown). Kept hook-free so it is unit-testable
|
|
9
|
+
* without React or a Director.
|
|
10
|
+
*/
|
|
11
|
+
export interface ToolAgg {
|
|
12
|
+
/** Total tool calls in this turn. */
|
|
13
|
+
total: number;
|
|
14
|
+
/** Calls that reported ok === false. */
|
|
15
|
+
fails: number;
|
|
16
|
+
/** Sum of reported durations (calls without a duration contribute 0). */
|
|
17
|
+
totalMs: number;
|
|
18
|
+
/** Call count per tool name, insertion-ordered. */
|
|
19
|
+
byTool: Map<string, number>;
|
|
20
|
+
}
|
|
21
|
+
export declare function newToolAgg(): ToolAgg;
|
|
22
|
+
export declare function addTool(agg: ToolAgg, name: string, ok?: boolean | undefined, durationMs?: number | undefined): void;
|
|
23
|
+
/**
|
|
24
|
+
* Render an aggregate as a single chat line:
|
|
25
|
+
* `14 tools · grep×9 read×5 · 3.2s · 1 ✗`
|
|
26
|
+
*
|
|
27
|
+
* The top `maxTools` tools by count are listed; any remainder collapses
|
|
28
|
+
* into `+N more`. Segments with nothing to say (no duration, no
|
|
29
|
+
* failures) are omitted. Returns '' for an empty aggregate.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatToolSummary(agg: ToolAgg, maxTools?: number): string;
|
|
32
|
+
//# sourceMappingURL=fleet-chat-coalescer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fleet-chat-coalescer.d.ts","sourceRoot":"","sources":["../../src/hooks/fleet-chat-coalescer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,OAAO;IACtB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,OAAO,CACrB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,EACZ,EAAE,CAAC,EAAE,OAAO,GAAG,SAAS,EACxB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAC9B,IAAI,CAON;AAQD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,SAAI,GAAG,MAAM,CAWpE"}
|
|
@@ -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,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brain panel controller — opens the panel and translates settings-view
|
|
3
|
+
* key actions into BrainPanelHost mutations (live apply + persist on the
|
|
4
|
+
* CLI side), refreshing the snapshot and surfacing errors as panel hints.
|
|
5
|
+
* Extracted from app.tsx (hotspot guardrail).
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { Action } from '../app-state.js';
|
|
9
|
+
import type { BrainRiskLevel } from '../components/brain-panel.js';
|
|
10
|
+
import { type BrainPanelHost, type BrainPanelRow } from '../components/brain-panel-model.js';
|
|
11
|
+
/** Selection returned by the shared model-pick overlay (null = cancelled). */
|
|
12
|
+
export type ModelPickSelection = {
|
|
13
|
+
providerId: string;
|
|
14
|
+
model: string;
|
|
15
|
+
} | null;
|
|
16
|
+
export interface UseBrainPanelOptions {
|
|
17
|
+
dispatch: React.Dispatch<Action>;
|
|
18
|
+
getBrainData?: (() => {
|
|
19
|
+
riskLevel: BrainRiskLevel;
|
|
20
|
+
log: Array<{
|
|
21
|
+
kind: string;
|
|
22
|
+
question: string;
|
|
23
|
+
outcome: string;
|
|
24
|
+
age: string;
|
|
25
|
+
}>;
|
|
26
|
+
}) | undefined;
|
|
27
|
+
brainPanelHost?: BrainPanelHost | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The SHARED two-step model picker (same overlay as /model), invoked in
|
|
30
|
+
* 'pick' mode: resolves with the selection instead of switching the
|
|
31
|
+
* session model. Provided by App's requestModelPick.
|
|
32
|
+
*/
|
|
33
|
+
requestModelPick?: ((title: string) => Promise<ModelPickSelection>) | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface BrainPanelController {
|
|
36
|
+
openBrainPanel: () => void;
|
|
37
|
+
handleBrainAdjust: (row: BrainPanelRow, delta: number) => void;
|
|
38
|
+
handleBrainEnter: (row: BrainPanelRow) => void;
|
|
39
|
+
handleBrainDelete: (row: BrainPanelRow) => void;
|
|
40
|
+
handleBrainVoterMod: (index: number, mod: 'persona' | 'veto') => void;
|
|
41
|
+
}
|
|
42
|
+
export declare function useBrainPanel(opts: UseBrainPanelOptions): BrainPanelController;
|
|
43
|
+
//# sourceMappingURL=use-brain-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brain-panel.d.ts","sourceRoot":"","sources":["../../src/hooks/use-brain-panel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAInB,MAAM,oCAAoC,CAAC;AAE5C,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC;AAE9E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EACT,CAAC,MAAM;QACL,SAAS,EAAE,cAAc,CAAC;QAC1B,GAAG,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC9E,CAAC,GACF,SAAS,CAAC;IACd,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,SAAS,CAAC;CACjF;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,iBAAiB,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,gBAAgB,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,iBAAiB,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAC;CACvE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,oBAAoB,CAmO9E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Director, FleetChatVerbosity } 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
|
+
chatMode: FleetChatVerbosity;
|
|
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
|
+
* Chat-history gating (`chatMode`):
|
|
17
|
+
* - 'full' — every tool call gets its own 🔧 line, interim 💬 text commits
|
|
18
|
+
* at each tool boundary (legacy behavior).
|
|
19
|
+
* - 'compact' — tool calls fold into a per-agent {@link ToolAgg} and the
|
|
20
|
+
* whole turn commits as ONE entry (💬 text with the tool
|
|
21
|
+
* summary as `detail`, or a lone 🔧 summary) at session end /
|
|
22
|
+
* task completion / teardown.
|
|
23
|
+
* - 'off' — no subagent chat entries at all; provider errors/retries
|
|
24
|
+
* still surface as warn/error entries.
|
|
25
|
+
* The fleet table (F2/F3) is fed in EVERY mode. The mode is read at commit
|
|
26
|
+
* time via a live ref; a mid-burst flip applies from the next boundary on.
|
|
27
|
+
* `/clear` mid-run is safe: buffers live inside the effect, and subagent
|
|
28
|
+
* entries are never rehydrated on resume.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useDirectorFleetBridge({ director, dispatch, stateRef, chatMode, }: UseDirectorFleetBridgeOptions): void;
|
|
31
|
+
//# 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,EAAE,kBAAkB,EAAc,MAAM,kBAAkB,CAAC;AAEjF,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAuBvD,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,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE,6BAA6B,GAAG,IAAI,CA+ZtC"}
|
|
@@ -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,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic model-pick request — the reusable side of the /model overlay.
|
|
3
|
+
*
|
|
4
|
+
* `requestModelPick(title)` opens the SAME two-step provider→model picker
|
|
5
|
+
* as the /model command, but in purpose 'pick': Enter RESOLVES the returned
|
|
6
|
+
* promise with the selection instead of switching the session model, and
|
|
7
|
+
* every close path (Esc at step 1, global overlay close, a competing open)
|
|
8
|
+
* resolves null. Callers: the Brain panel (pool/voters/judge) — and any
|
|
9
|
+
* future surface that needs a model choice.
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import type { Action } from '../app-state.js';
|
|
13
|
+
export type ModelPickSelection = {
|
|
14
|
+
providerId: string;
|
|
15
|
+
model: string;
|
|
16
|
+
} | null;
|
|
17
|
+
export interface UseModelPickRequestOptions {
|
|
18
|
+
dispatch: React.Dispatch<Action>;
|
|
19
|
+
getPickableProviders?: (() => Promise<Array<{
|
|
20
|
+
id: string;
|
|
21
|
+
family: string;
|
|
22
|
+
models: string[];
|
|
23
|
+
}>>) | undefined;
|
|
24
|
+
/** Live `state.modelPicker.open` — closes without a pick resolve null. */
|
|
25
|
+
pickerOpen: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ModelPickRequestController {
|
|
28
|
+
/** Open the shared picker; resolves with the choice or null on cancel. */
|
|
29
|
+
requestModelPick: (title: string) => Promise<ModelPickSelection>;
|
|
30
|
+
/** Wired into the key hook as `onModelPicked` (purpose 'pick' Enter). */
|
|
31
|
+
handleModelPicked: (providerId: string, modelId: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function useModelPickRequest(opts: UseModelPickRequestOptions): ModelPickRequestController;
|
|
34
|
+
//# sourceMappingURL=use-model-pick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-model-pick.d.ts","sourceRoot":"","sources":["../../src/hooks/use-model-pick.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC;AAE9E,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,oBAAoB,CAAC,EACjB,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC,CAAC,GACxE,SAAS,CAAC;IACd,0EAA0E;IAC1E,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,0EAA0E;IAC1E,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjE,yEAAyE;IACzE,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,0BAA0B,CAmChG"}
|
|
@@ -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,72 @@
|
|
|
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
|
+
/** Settings-view value edit: ←/→ on the focused row. */
|
|
52
|
+
onBrainAdjust: ((row: import('../components/brain-panel-model.js').BrainPanelRow, delta: number) => void) | undefined;
|
|
53
|
+
/** Settings-view Enter: toggle a boolean row or open the model picker. */
|
|
54
|
+
onBrainEnter: ((row: import('../components/brain-panel-model.js').BrainPanelRow) => void) | undefined;
|
|
55
|
+
/** Settings-view d/Delete on a removable row. */
|
|
56
|
+
onBrainDelete: ((row: import('../components/brain-panel-model.js').BrainPanelRow) => void) | undefined;
|
|
57
|
+
/** Voter row modifiers: p = cycle persona, v = toggle veto. */
|
|
58
|
+
onBrainVoterMod: ((index: number, mod: 'persona' | 'veto') => void) | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Generic model-pick resolution: Enter on the model step when the picker
|
|
61
|
+
* was opened with purpose 'pick' (requestModelPick) — the selection is
|
|
62
|
+
* RETURNED to the caller instead of switching the session model.
|
|
63
|
+
*/
|
|
64
|
+
onModelPicked: ((providerId: string, modelId: string) => void) | undefined;
|
|
65
|
+
onShadowStart: (() => Promise<void> | void) | undefined;
|
|
66
|
+
onShadowStop: (() => Promise<void> | void) | undefined;
|
|
67
|
+
onFKeyPickerEnter: (() => void) | undefined;
|
|
68
|
+
onPickerEnter: (() => Promise<void>) | undefined;
|
|
69
|
+
onSlashPickerTab: (() => void) | undefined;
|
|
70
|
+
}
|
|
71
|
+
export declare function usePickerKeys(host: PickerKeysHost): (input: string, key: KeyEvent, isEnter: boolean) => boolean;
|
|
72
|
+
//# sourceMappingURL=use-picker-keys.d.ts.map
|