@wrongstack/tui 1.0.4 → 1.0.6
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-action-type.d.ts +14 -0
- package/dist/app-key-handler.d.ts +5 -120
- package/dist/app-view-contract.d.ts +3 -0
- package/dist/app-view-sidebar.d.ts +9 -1
- package/dist/app.d.ts +3 -3
- package/dist/components/confirm-prompt.d.ts +1 -1
- package/dist/components/history/entry.d.ts +15 -1
- package/dist/components/history/index.d.ts +1 -1
- package/dist/components/history/tool-visual-types.d.ts +1 -1
- package/dist/components/history/types.d.ts +4 -0
- package/dist/components/inspect-overlay.d.ts +23 -1
- package/dist/components/powerline-rail.d.ts +4 -7
- package/dist/components/scrollable-history.d.ts +1 -1
- package/dist/components/sidebar-panel-frame.d.ts +31 -0
- package/dist/components/sidebar-panels-workspace.d.ts +11 -2
- package/dist/components/sidebar-scrollbar.d.ts +36 -0
- package/dist/components/sidebar.d.ts +13 -1
- package/dist/components/status-bar-icons.d.ts +0 -7
- package/dist/hooks/tui-slash-command-options.d.ts +30 -0
- package/dist/hooks/use-app-environment.d.ts +136 -0
- package/dist/hooks/use-app-pipeline-builders.d.ts +1 -0
- package/dist/hooks/use-app-ref-spine.d.ts +74 -0
- package/dist/hooks/use-app-state.d.ts +20 -0
- package/dist/hooks/use-design-kit-slash-commands.d.ts +8 -0
- package/dist/hooks/use-next-steps-auto-submit.d.ts +1 -0
- package/dist/hooks/use-provider-slash-commands.d.ts +13 -0
- package/dist/hooks/use-resource-slash-commands.d.ts +11 -0
- package/dist/hooks/use-session-slash-commands.d.ts +17 -0
- package/dist/hooks/use-settings-slash-commands.d.ts +22 -0
- package/dist/hooks/use-tui-slash-commands.d.ts +2 -29
- package/dist/index.js +7754 -6683
- package/dist/input-validation/action-types.d.ts +1 -1
- package/dist/key-handler-context.d.ts +142 -0
- package/dist/key-routes/key-route-busy.d.ts +23 -0
- package/dist/key-routes/key-route-composer.d.ts +33 -0
- package/dist/key-routes/key-route-overlay.d.ts +65 -0
- package/dist/key-routes/key-route-paste.d.ts +17 -0
- package/dist/key-routes/key-route-pointer.d.ts +18 -0
- package/dist/overlay-key-router.d.ts +2 -0
- package/dist/reducers/dialogs.d.ts +1 -1
- package/dist/reducers/workspace-panels.d.ts +11 -1
- package/dist/run-tui-exits.d.ts +46 -0
- package/dist/run-tui-launch.d.ts +23 -0
- package/dist/run-tui-mount.d.ts +28 -0
- package/dist/run-tui-session.d.ts +13 -0
- package/dist/run-tui.d.ts +1 -2
- package/dist/sidebar-sizing.d.ts +2 -1
- package/dist/ui-contracts.d.ts +15 -0
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Known reducer action types — exact, compile-time checked allow-list. */
|
|
2
|
-
export declare const ALLOWED_ACTION_TYPES: readonly ["addEntry", "archiveLoaded", "startArchiveLoad", "authBusy", "authCatalog", "authClose", "authConfirmEnd", "authConfirmStart", "authFormCancel", "authFormChange", "authFormStart", "authFilter", "authFlowDone", "authFlowLog", "authFlowStart", "authHint", "authMove", "authOpen", "authPromptChange", "authPromptEnd", "authPromptStart", "authProviders", "authView", "autonomyPickerClose", "autonomyPickerHint", "autonomyPickerMove", "autonomyPickerOpen", "brainBusy", "brainClose", "brainHint", "brainMove", "brainOpen", "brainPromptClear", "brainPromptSet", "brainRiskChange", "brainRowMove", "brainSetLog", "brainSettingsLoaded", "brainStatus", "brainView", "checkpointReceived", "clearConfirmClose", "clearConfirmOpen", "clearConfirmSetValue", "clearHistory", "clearInput", "clearInputHistory", "closeAllPanels", "collabBugFound", "collabEvalComplete", "sidebarScroll", "sidebarScrollReset", "toggleSidebarFocus", "skillPickerClose", "skillPickerHint", "skillPickerMove", "skillPickerOpen", "resourceMenuClose", "resourceMenuConfirm", "resourceMenuFilter", "resourceMenuHint", "resourceMenuMove", "resourceMenuOpen", "collabPlanEmitted", "collabSessionDone", "collabSubagentSpawned", "compactHistory", "confirmClearAll", "confirmClose", "confirmOpen", "continueConfirmClose", "continueConfirmOpen", "bugHuntContinueClose", "bugHuntContinueOpen", "bugHuntRunningClose", "bugHuntRunningOpen", "copiedNotice", "coordinatorEvent", "countdownEnded", "countdownTick", "debugStreamStats", "debugStreamStatsClear", "dequeueFirst", "designPickerClose", "designPickerMove", "designPickerOpen", "designPickerStack", "enhanceBusy", "enhanceClose", "enhanceOpen", "enhanceSet", "enqueue", "escConfirmClose", "escConfirmOpen", "fallbackOverlayClose", "fallbackOverlayMove", "fallbackOverlayOpen", "inspectOverlayClose", "inspectOverlayOpen", "inspectOverlayScroll", "eternalStage", "exitConfirmClose", "exitConfirmOpen", "fKeyPickerClose", "fKeyPickerMove", "fKeyPickerOpen", "fleetBatch", "fleetBudgetExtended", "fleetBudgetWarning", "fleetConcurrency", "fleetCost", "fleetCtxPct", "fleetDelta", "fleetDone", "fleetMessage", "fleetRemove", "fleetSeed", "fleetSpawn", "fleetStart", "fleetTool", "fleetToolEnd", "fleetToolStart", "fleetUsage", "goalRunElapsed", "goalRunInit", "goalRunMonitorToggle", "goalRunPhaseUpdate", "goalRunReset", "goalRunRunningPhases", "goalRunTaskActive", "goalSummary", "helpClose", "helpFilter", "helpHint", "helpMove", "helpOpen", "hint", "historyDown", "historyPush", "historyUp", "interrupt", "leaderCtxPct", "leaderIterEnd", "leaderIterStart", "leaderToolEnd", "leaderToolStart", "mcpPickerBusy", "mcpPickerClose", "mcpPickerHint", "mcpPickerMove", "mcpPickerOpen", "mcpPickerSetItems", "modePickerClose", "modePickerHint", "modePickerMove", "modePickerOpen", "modelPickerBack", "modelPickerClose", "modelPickerHint", "modelPickerMove", "modelPickerOpen", "modelPickerPickProvider", "modelPickerSearch", "pickerClose", "pickerMove", "pickerOpen", "pickerSetMatches", "pluginPickerBusy", "pluginPickerClose", "pluginPickerHint", "pluginPickerMove", "pluginPickerOpen", "pluginPickerSetItems", "projectPickerClose", "projectPickerFilter", "projectPickerHint", "projectPickerMove", "projectPickerOpen", "promptPickerCategory", "promptPickerClose", "promptPickerMove", "promptPickerOpen", "queueClear", "queueDelete", "queueToggleRefine", "refineCountdownClose", "refineCountdownOpen", "refineFailureClose", "refineFailureOpen", "replaceHistory", "autoProceedRelease", "bashModeEnter", "bashModeExit", "resumeLoadStart", "resumeLoadTick", "resumeStreamChunk", "resumeLoadAbort", "resetContextChip", "resetInterrupts", "resumePickerBusy", "resumePickerClose", "resumePickerError", "resumePickerHint", "resumePickerMove", "resumePickerOpen", "rewindOverlayClose", "rewindOverlayMove", "rewindOverlayOpen", "sddBoardSnapshot", "sddBoardFocusNext", "sddBoardFocusPrev", "sendModePickerClose", "sendModePickerMove", "sendModePickerOpen", "sessionResumeConfirmClear", "sessionResumeConfirmSet", "sessionRewound", "sessionsPanelBusy", "sessionsPanelMove", "sessionsPanelSet", "setBuffer", "setFleetChat", "setHistoryScrolled", "setInputHistory", "setViewportRows", "settingsClose", "settingsFieldMove", "settingsFieldSet", "settingsFilterSet", "settingsHint", "settingsOpen", "settingsThinkingEditCancel", "settingsThinkingEditChange", "settingsThinkingEditCommit", "settingsThinkingEditStart", "settingsWrongProxyUrlEditCancel", "settingsWrongProxyUrlEditChange", "settingsWrongProxyUrlEditCommit", "settingsWrongProxyUrlEditStart", "settingsValueChange", "settingsValueSet", "shadowClose", "shadowHint", "shadowOpen", "shadowUpdate", "shellCommandWarningClose", "shellCommandWarningOpen", "slashConfirmClose", "slashConfirmOpen", "slashPickerClose", "slashPickerMove", "slashPickerOpen", "status", "statuslineChipExpire", "statuslineChipShow", "statuslineClose", "statuslineFieldMove", "statuslineFieldSet", "statuslineFilter", "statuslineHint", "statuslineMoveLine", "statuslineOpen", "statuslineResetLayout", "statuslineSetDensity", "statuslineSetLine", "statuslineToggle", "statuslineToggleLine", "statuslineVisibleChipsSync", "steerConsume", "steerStart", "streamDelta", "streamReset", "themePickerClose", "themePickerHint", "themePickerMove", "themePickerOpen", "toggleAgentsMonitor", "toggleAuditPanel", "toggleContextPanel", "toggleConnectionsPanel", "toggleCoordinatorMonitor", "toggleCronMonitor", "toggleGoalKanbanPanel", "toggleGoalPanel", "toggleHelp", "toggleKanbanPanel", "toggleMonitor", "togglePlanPanel", "toggleProcessList", "toggleQueuePanel", "toggleSddBoardMonitor", "toggleSessionsPanel", "toggleTodosMonitor", "toggleWorktreeMonitor", "toolEnded", "toolStarted", "toolStreamAppend", "toolStreamClear", "toolResultViewSet", "topicCheckBusy", "toolsPickerBusy", "toolsPickerClose", "toolsPickerFilter", "toolsPickerHint", "toolsPickerMove", "toolsPickerOpen", "toolsPickerSetItems", "toolsPickerToggle", "worktreeRemove", "worktreeUpsert"];
|
|
2
|
+
export declare const ALLOWED_ACTION_TYPES: readonly ["addEntry", "archiveLoaded", "startArchiveLoad", "authBusy", "authCatalog", "authClose", "authConfirmEnd", "authConfirmStart", "authFormCancel", "authFormChange", "authFormStart", "authFilter", "authFlowDone", "authFlowLog", "authFlowStart", "authHint", "authMove", "authOpen", "authPromptChange", "authPromptEnd", "authPromptStart", "authProviders", "authView", "autonomyPickerClose", "autonomyPickerHint", "autonomyPickerMove", "autonomyPickerOpen", "brainBusy", "brainClose", "brainHint", "brainMove", "brainOpen", "brainPromptClear", "brainPromptSet", "brainRiskChange", "brainRowMove", "brainSetLog", "brainSettingsLoaded", "brainStatus", "brainView", "checkpointReceived", "clearConfirmClose", "clearConfirmOpen", "clearConfirmSetValue", "clearHistory", "clearInput", "clearInputHistory", "closeAllPanels", "collabBugFound", "collabEvalComplete", "sidebarScroll", "sidebarScrollSet", "sidebarScrollReset", "toggleSidebarFocus", "skillPickerClose", "skillPickerHint", "skillPickerMove", "skillPickerOpen", "resourceMenuClose", "resourceMenuConfirm", "resourceMenuFilter", "resourceMenuHint", "resourceMenuMove", "resourceMenuOpen", "collabPlanEmitted", "collabSessionDone", "collabSubagentSpawned", "compactHistory", "confirmClearAll", "confirmClose", "confirmResolved", "confirmOpen", "continueConfirmClose", "continueConfirmOpen", "bugHuntContinueClose", "bugHuntContinueOpen", "bugHuntRunningClose", "bugHuntRunningOpen", "copiedNotice", "coordinatorEvent", "countdownEnded", "countdownTick", "debugStreamStats", "debugStreamStatsClear", "dequeueFirst", "designPickerClose", "designPickerMove", "designPickerOpen", "designPickerStack", "enhanceBusy", "enhanceClose", "enhanceOpen", "enhanceSet", "enqueue", "escConfirmClose", "escConfirmOpen", "fallbackOverlayClose", "fallbackOverlayMove", "fallbackOverlayOpen", "inspectOverlayClose", "inspectOverlayOpen", "inspectOverlayScroll", "eternalStage", "exitConfirmClose", "exitConfirmOpen", "fKeyPickerClose", "fKeyPickerMove", "fKeyPickerOpen", "fleetBatch", "fleetBudgetExtended", "fleetBudgetWarning", "fleetConcurrency", "fleetCost", "fleetCtxPct", "fleetDelta", "fleetDone", "fleetMessage", "fleetRemove", "fleetSeed", "fleetSpawn", "fleetStart", "fleetTool", "fleetToolEnd", "fleetToolStart", "fleetUsage", "goalRunElapsed", "goalRunInit", "goalRunMonitorToggle", "goalRunPhaseUpdate", "goalRunReset", "goalRunRunningPhases", "goalRunTaskActive", "goalSummary", "helpClose", "helpFilter", "helpHint", "helpMove", "helpOpen", "hint", "historyDown", "historyPush", "historyUp", "interrupt", "leaderCtxPct", "leaderIterEnd", "leaderIterStart", "leaderToolEnd", "leaderToolStart", "mcpPickerBusy", "mcpPickerClose", "mcpPickerHint", "mcpPickerMove", "mcpPickerOpen", "mcpPickerSetItems", "modePickerClose", "modePickerHint", "modePickerMove", "modePickerOpen", "modelPickerBack", "modelPickerClose", "modelPickerHint", "modelPickerMove", "modelPickerOpen", "modelPickerPickProvider", "modelPickerSearch", "pickerClose", "pickerMove", "pickerOpen", "pickerSetMatches", "pluginPickerBusy", "pluginPickerClose", "pluginPickerHint", "pluginPickerMove", "pluginPickerOpen", "pluginPickerSetItems", "projectPickerClose", "projectPickerFilter", "projectPickerHint", "projectPickerMove", "projectPickerOpen", "promptPickerCategory", "promptPickerClose", "promptPickerMove", "promptPickerOpen", "queueClear", "queueDelete", "queueToggleRefine", "refineCountdownClose", "refineCountdownOpen", "refineFailureClose", "refineFailureOpen", "replaceHistory", "autoProceedRelease", "bashModeEnter", "bashModeExit", "resumeLoadStart", "resumeLoadTick", "resumeStreamChunk", "resumeLoadAbort", "resetContextChip", "resetInterrupts", "resumePickerBusy", "resumePickerClose", "resumePickerError", "resumePickerHint", "resumePickerMove", "resumePickerOpen", "rewindOverlayClose", "rewindOverlayMove", "rewindOverlayOpen", "sddBoardSnapshot", "sddBoardFocusNext", "sddBoardFocusPrev", "sendModePickerClose", "sendModePickerMove", "sendModePickerOpen", "sessionResumeConfirmClear", "sessionResumeConfirmSet", "sessionRewound", "sessionsPanelBusy", "sessionsPanelMove", "sessionsPanelSet", "setBuffer", "setFleetChat", "setHistoryScrolled", "setInputHistory", "setViewportRows", "settingsClose", "settingsFieldMove", "settingsFieldSet", "settingsFilterSet", "settingsHint", "settingsOpen", "settingsThinkingEditCancel", "settingsThinkingEditChange", "settingsThinkingEditCommit", "settingsThinkingEditStart", "settingsWrongProxyUrlEditCancel", "settingsWrongProxyUrlEditChange", "settingsWrongProxyUrlEditCommit", "settingsWrongProxyUrlEditStart", "settingsValueChange", "settingsValueSet", "shadowClose", "shadowHint", "shadowOpen", "shadowUpdate", "shellCommandWarningClose", "shellCommandWarningOpen", "slashConfirmClose", "slashConfirmOpen", "slashPickerClose", "slashPickerMove", "slashPickerOpen", "status", "statuslineChipExpire", "statuslineChipShow", "statuslineClose", "statuslineFieldMove", "statuslineFieldSet", "statuslineFilter", "statuslineHint", "statuslineMoveLine", "statuslineOpen", "statuslineResetLayout", "statuslineSetDensity", "statuslineSetLine", "statuslineToggle", "statuslineToggleLine", "statuslineVisibleChipsSync", "steerConsume", "steerStart", "streamDelta", "streamReset", "themePickerClose", "themePickerHint", "themePickerMove", "themePickerOpen", "toggleAgentsMonitor", "toggleAuditPanel", "toggleContextPanel", "toggleConnectionsPanel", "toggleCoordinatorMonitor", "toggleCronMonitor", "toggleGoalKanbanPanel", "toggleGoalPanel", "toggleHelp", "toggleKanbanPanel", "toggleMonitor", "togglePlanPanel", "toggleProcessList", "toggleQueuePanel", "toggleSddBoardMonitor", "toggleSessionsPanel", "toggleTodosMonitor", "toggleWorktreeMonitor", "toolEnded", "toolStarted", "toolStreamAppend", "toolStreamClear", "toolResultViewSet", "topicCheckBusy", "toolsPickerBusy", "toolsPickerClose", "toolsPickerFilter", "toolsPickerHint", "toolsPickerMove", "toolsPickerOpen", "toolsPickerSetItems", "toolsPickerToggle", "worktreeRemove", "worktreeUpsert"];
|
|
3
3
|
export type AllowedActionType = (typeof ALLOWED_ACTION_TYPES)[number];
|
|
4
4
|
//# sourceMappingURL=action-types.d.ts.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { Director } from '@wrongstack/core/coordination';
|
|
2
|
+
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
3
|
+
import type { Action } from './app-action-type.js';
|
|
4
|
+
import type { AppProps } from './app-props.js';
|
|
5
|
+
import type { State } from './app-state.js';
|
|
6
|
+
import type { KeyEvent } from './components/input.js';
|
|
7
|
+
import type { HistoryScrollController } from './components/scrollable-history.js';
|
|
8
|
+
import type { StatusBarClickMap } from './components/status-bar-types.js';
|
|
9
|
+
import type { StatuslineItem } from './components/statusline-picker.js';
|
|
10
|
+
import type { DOMElement } from './ink.js';
|
|
11
|
+
import type { PasteAccumState } from './paste-accumulator.js';
|
|
12
|
+
export interface AppKeyHandlerOptions {
|
|
13
|
+
state: State;
|
|
14
|
+
dispatch: Dispatch<Action>;
|
|
15
|
+
historyScrollRef: MutableRefObject<HistoryScrollController | null>;
|
|
16
|
+
/** Resets the live-tail timeout after a user-driven history navigation. */
|
|
17
|
+
onHistoryScrollActivity?: (() => void) | undefined;
|
|
18
|
+
runInterruptLadder: () => void;
|
|
19
|
+
enhanceCancelledRef: MutableRefObject<boolean>;
|
|
20
|
+
enhanceAbortRef: MutableRefObject<AbortController | null>;
|
|
21
|
+
inputGateRef: MutableRefObject<boolean>;
|
|
22
|
+
lastEscAtRef: MutableRefObject<number>;
|
|
23
|
+
pasteAccumRef: MutableRefObject<PasteAccumState>;
|
|
24
|
+
pasteFlushTimerRef: MutableRefObject<ReturnType<typeof setTimeout> | null>;
|
|
25
|
+
commitPaste: (full: string) => Promise<void>;
|
|
26
|
+
tryPickerKey: (input: string, key: KeyEvent, isEnter: boolean) => boolean;
|
|
27
|
+
dismissedEscAtRef: MutableRefObject<number>;
|
|
28
|
+
streamingTextRef: MutableRefObject<string>;
|
|
29
|
+
confirmExitRef: MutableRefObject<boolean>;
|
|
30
|
+
activeCtrlRef: MutableRefObject<AbortController | null>;
|
|
31
|
+
clearPendingConfirms: () => void;
|
|
32
|
+
liveDirector: () => Director | null;
|
|
33
|
+
openProjectPicker: () => Promise<void>;
|
|
34
|
+
loadLiveSessions: () => Promise<void>;
|
|
35
|
+
openStatuslinePicker: (field?: number) => void;
|
|
36
|
+
statuslineHiddenItems: StatuslineItem[];
|
|
37
|
+
getSddRun: AppProps['getSddRun'];
|
|
38
|
+
onSddLifecycle: AppProps['onSddLifecycle'];
|
|
39
|
+
getSettings: AppProps['getSettings'];
|
|
40
|
+
saveSettings: AppProps['saveSettings'];
|
|
41
|
+
lastEnterAtRef: MutableRefObject<number>;
|
|
42
|
+
draftRef: MutableRefObject<{
|
|
43
|
+
buffer: string;
|
|
44
|
+
cursor: number;
|
|
45
|
+
}>;
|
|
46
|
+
setDraft: (buffer: string, cursor: number) => void;
|
|
47
|
+
/** Submits the composer. `overrideRaw` bypasses the buffer (bash mode
|
|
48
|
+
* forwards its draft through the `!` shell path this way). */
|
|
49
|
+
submit: (overrideRaw?: string) => void;
|
|
50
|
+
mouseMode: boolean;
|
|
51
|
+
termRows: number;
|
|
52
|
+
terminalColumns: number;
|
|
53
|
+
terminalRows: number;
|
|
54
|
+
/** Width of the main column (terminal width minus sidebar). When > 0,
|
|
55
|
+
* scrollbar hit-tests use this instead of terminalColumns so the scrollbar
|
|
56
|
+
* track is correctly positioned to the left of the sidebar. */
|
|
57
|
+
mainColumnWidth: number;
|
|
58
|
+
/**
|
|
59
|
+
* Whether a full-width overlay owns the screen.
|
|
60
|
+
*
|
|
61
|
+
* Passed in rather than derived. The old proxy —
|
|
62
|
+
* `mainColumnWidth >= stdout.columns` — is true whenever the sidebar is
|
|
63
|
+
* ZERO wide, and `computeSidebarWidth` returns 0 for any terminal under
|
|
64
|
+
* `SIDEBAR_MIN_TERMINAL` (64 columns). So on a narrow terminal the flag was
|
|
65
|
+
* permanently true with nothing open, and the whole `if (!overlayOpen)`
|
|
66
|
+
* block below — wheel scrolling, scrollbar drag, drag-select, copy icons,
|
|
67
|
+
* every status-bar chip click, PageUp/PageDown — silently stopped working,
|
|
68
|
+
* along with Shift+Tab, `?` help, and (via `routeInputKey`) up/down input
|
|
69
|
+
* history. `app.tsx` already hands the real value to `useMouseTracking`.
|
|
70
|
+
*/
|
|
71
|
+
overlayOpen: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Effective swarm-on-sidebar read: `panelPositions.fleet === 'sidebar'`
|
|
74
|
+
* OR the legacy `showAgentSwarmPanel === 'sidebar'` flag from
|
|
75
|
+
* `liveSettings`. The renderer at `app-view.tsx:897-899` reads
|
|
76
|
+
* ONLY the legacy `showAgentSwarmPanel` field (not the panel-
|
|
77
|
+
* position map) to decide whether to show the mission card; the
|
|
78
|
+
* scroll-clamp reservation must match that source or a config-only
|
|
79
|
+
* legacy 'sidebar' swarm mode (no recent picker open) will render
|
|
80
|
+
* the mission card but the clamp will under-reserve, hiding the
|
|
81
|
+
* bottom mission rows behind `RightSidebar`'s `overflowY="hidden"`
|
|
82
|
+
* viewport. The OR with `panelPositions.fleet` is directionally
|
|
83
|
+
* safe (over-reservation is harmless) and aligns with the field
|
|
84
|
+
* that gates whether the swarm twin is mounted. See
|
|
85
|
+
* {@link SidebarLayoutState.effectiveSwarmOnSidebar}. Threaded into
|
|
86
|
+
* `sidebarScroll` dispatches so the reducer's mission-queue
|
|
87
|
+
* reservation matches the actual render.
|
|
88
|
+
*/
|
|
89
|
+
effectiveSwarmOnSidebar: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Approximate row count for routed sidebar twin panels mounted above
|
|
92
|
+
* `SidebarContent`. Subtracted from `viewportHeight` by the reducer's
|
|
93
|
+
* scroll clamp so the user can't scroll past the end into blank space.
|
|
94
|
+
* See {@link SidebarLayoutState.sidebarTwinRowCount}.
|
|
95
|
+
*/
|
|
96
|
+
sidebarTwinRowCount: number;
|
|
97
|
+
statusBarWrapRef: MutableRefObject<DOMElement | null>;
|
|
98
|
+
belowStatusBarRef: MutableRefObject<DOMElement | null>;
|
|
99
|
+
/** Chip click map published by StatusBar on every render. */
|
|
100
|
+
statusBarClickMapRef: MutableRefObject<StatusBarClickMap | null>;
|
|
101
|
+
/** Actual rendered title row for inspect-modal Copy/Close hit-testing. */
|
|
102
|
+
inspectOverlayHeaderRef: MutableRefObject<DOMElement | null>;
|
|
103
|
+
openModelPicker: () => Promise<void>;
|
|
104
|
+
nextStepsAutoSubmitTimerRef: MutableRefObject<ReturnType<typeof setInterval> | undefined>;
|
|
105
|
+
nextStepsAutoSubmitSuggestionRef: MutableRefObject<string | null>;
|
|
106
|
+
nextStepsAutoSubmitLabel: string | null;
|
|
107
|
+
setNextStepsAutoSubmitCountdown: Dispatch<SetStateAction<number | null>>;
|
|
108
|
+
setNextStepsAutoSubmitLabel: Dispatch<SetStateAction<string | null>>;
|
|
109
|
+
cancelNextStepsCountdown: () => void;
|
|
110
|
+
pasteClipboardText: () => Promise<void>;
|
|
111
|
+
pasteClipboardImage: () => Promise<void>;
|
|
112
|
+
slashRegistry: AppProps['slashRegistry'];
|
|
113
|
+
agent: AppProps['agent'];
|
|
114
|
+
/**
|
|
115
|
+
* Called with the copied entry's id after a chat card's copy icon is clicked
|
|
116
|
+
* and its content was successfully written to the clipboard. Lets the host
|
|
117
|
+
* surface a transient "Copied" confirmation and flash that card's icon. Not
|
|
118
|
+
* called when the click missed or the write failed.
|
|
119
|
+
*/
|
|
120
|
+
onHistoryCopy?: ((entryId: number) => void) | undefined;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The shared view of the key-handler wiring that the ordered route modules
|
|
124
|
+
* (decomposition Phase 3 — docs/decomposition-plan.md) receive. It is the
|
|
125
|
+
* factory's full `AppKeyHandlerOptions` plus the three values the factory
|
|
126
|
+
* derives once per session: the resolved stdout shape, the effective history
|
|
127
|
+
* width (terminal minus sidebar), and the `detach` helper that runs route
|
|
128
|
+
* promises without risking the process.
|
|
129
|
+
*/
|
|
130
|
+
export interface KeyRouteContext extends AppKeyHandlerOptions {
|
|
131
|
+
stdout: {
|
|
132
|
+
columns: number;
|
|
133
|
+
rows: number;
|
|
134
|
+
};
|
|
135
|
+
/** Effective width of the history area (terminal minus sidebar). */
|
|
136
|
+
historyWidth: number;
|
|
137
|
+
/** Runs a detached promise from a route; failures surface as error entries. */
|
|
138
|
+
detach: (work: Promise<unknown> | undefined, what: string) => void;
|
|
139
|
+
}
|
|
140
|
+
/** Re-exported for route modules that need the ref/callback shapes. */
|
|
141
|
+
export type { Action, AppProps, Director, Dispatch, DOMElement, HistoryScrollController, MutableRefObject, PasteAccumState, SetStateAction, StatusBarClickMap, StatuslineItem, };
|
|
142
|
+
//# sourceMappingURL=key-handler-context.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { KeyEvent } from '../components/input.js';
|
|
2
|
+
import type { KeyRouteContext } from '../key-handler-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Busy-interrupt routes (Ctrl+C escalation + the busy-state interrupt
|
|
5
|
+
* router), moved verbatim from handleKey (decomposition Phase 3 —
|
|
6
|
+
* docs/decomposition-plan.md). Called by the orchestrator at their pinned
|
|
7
|
+
* positions: Ctrl+C before every modal/status guard, the busy router after
|
|
8
|
+
* the panel-close routes.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Ctrl+C: THE unconditional escape hatch. Raw-mode terminals
|
|
12
|
+
* (ConPTY/Windows, and any tty in raw mode) deliver Ctrl+C as KEY DATA — no
|
|
13
|
+
* SIGINT is ever generated — so it must be routed into the escalation ladder
|
|
14
|
+
* from here. This check runs BEFORE every modal/status guard on purpose:
|
|
15
|
+
* Ctrl+C has to work precisely when everything else is wedged ('aborting'
|
|
16
|
+
* block, pending confirm panel, enhance overlay, …). The ladder itself is
|
|
17
|
+
* state-aware (cancels open pickers on the first press, aborts + kills the
|
|
18
|
+
* fleet, then exits on the second press, hard-exits on the third).
|
|
19
|
+
*/
|
|
20
|
+
export declare function routeCtrlCEscalation(ctx: KeyRouteContext, input: string, key: KeyEvent): boolean;
|
|
21
|
+
/** Busy-state interrupts: abort confirmation ladder while streaming. */
|
|
22
|
+
export declare function routeBusyInterrupt(ctx: KeyRouteContext, key: KeyEvent): boolean;
|
|
23
|
+
//# sourceMappingURL=key-route-busy.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer routes for the TUI key handler — decomposition Phase 3 route 6
|
|
3
|
+
* (final route; R5 picker was already a single delegation and needed no
|
|
4
|
+
* module — see docs/decomposition-plan.md execution log).
|
|
5
|
+
*
|
|
6
|
+
* Moved verbatim from `createAppKeyHandler`/`handleKey`
|
|
7
|
+
* (docs/decomposition-plan.md, Phase 3). `routeComposer` owns the
|
|
8
|
+
* empty-draft `?`/`!` shortcuts and the Enter pipeline (Shift+Enter
|
|
9
|
+
* newline, bash-mode run through `/dev`, the 50ms `\r\n` dedupe window,
|
|
10
|
+
* the intentionally-not-awaited detached submit). `routeComposerTail`
|
|
11
|
+
* owns the `routeInputKey` delegation (args bag built from ctx) and the
|
|
12
|
+
* Ctrl+P → PhaseMonitor / `/goal` alias.
|
|
13
|
+
*
|
|
14
|
+
* Call-order contract (pinned by tests/key-handler-replay-corpus.test.ts):
|
|
15
|
+
* routeComposer runs after the panel/picker routes; routeComposerTail runs
|
|
16
|
+
* after the pointer route, as the last content routes before handleKey ends.
|
|
17
|
+
*/
|
|
18
|
+
import type { KeyEvent } from '../components/input.js';
|
|
19
|
+
import type { KeyRouteContext } from '../key-handler-context.js';
|
|
20
|
+
/**
|
|
21
|
+
* Empty-draft `?`/`!` shortcuts plus the Enter pipeline. `isEnter` is
|
|
22
|
+
* derived in the orchestrator (the picker delegation consumes it too) and
|
|
23
|
+
* passed in. Returns true when the key was consumed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function routeComposer(ctx: KeyRouteContext, input: string, key: KeyEvent, isEnter: boolean): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The composer tail: the `routeInputKey` delegation (text insertion,
|
|
28
|
+
* cursor movement, input history, autocomplete — the router owns the
|
|
29
|
+
* full contract) followed by the Ctrl+P → PhaseMonitor / `/goal`
|
|
30
|
+
* alias. Returns true when the key was consumed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function routeComposerTail(ctx: KeyRouteContext, input: string, key: KeyEvent): Promise<boolean>;
|
|
33
|
+
//# sourceMappingURL=key-route-composer.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { KeyEvent } from '../components/input.js';
|
|
2
|
+
import type { KeyRouteContext } from '../key-handler-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Overlay/panel routes, moved verbatim from handleKey (decomposition Phase 3
|
|
5
|
+
* — docs/decomposition-plan.md). Membership delta recorded per D2: the
|
|
6
|
+
* chord (Ctrl+B/Y) and F-key panel toggles, and the SDD board drill-down
|
|
7
|
+
* ride with this route as the panel family (no dedicated slice among the
|
|
8
|
+
* approved route names).
|
|
9
|
+
*
|
|
10
|
+
* Orchestrator call order (pinned): routeModalOverlay → routeDoubleEsc →
|
|
11
|
+
* routeEscClosePanels → routeChordPanels → routeFKeyPanels → routeSddBoard →
|
|
12
|
+
* routeSettingsOverlay → routePanelEscapeRouter.
|
|
13
|
+
*/
|
|
14
|
+
/** Modal overlays with their own dedicated UI (confirmQueue, enhance,
|
|
15
|
+
* modelPicker, autonomyPicker, settingsPicker, rewindOverlay, helpOpen). */
|
|
16
|
+
export declare function routeModalOverlay(ctx: KeyRouteContext, input: string, key: KeyEvent): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Double-Esc clears the input buffer. When the user presses Esc twice
|
|
19
|
+
* within ESC_DOUBLE_PRESS_MS ms while the buffer is non-empty, clear it.
|
|
20
|
+
* This mirrors the behaviour of bash's Ctrl+C double-press clearing the
|
|
21
|
+
* line, adapted for Esc (no Ctrl needed).
|
|
22
|
+
*/
|
|
23
|
+
export declare function routeDoubleEsc(ctx: KeyRouteContext, key: KeyEvent): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Esc closes the topmost panel BEFORE the busy-interrupt ladder. Pressing
|
|
26
|
+
* Esc with a monitor/panel open means "close this panel", not "abort the
|
|
27
|
+
* run and drop the queue" — even mid-stream. Panels whose own useInput owns
|
|
28
|
+
* Esc (kanban's inline prompt, worktree, goal kanban, phase monitor) are
|
|
29
|
+
* only CONSUMED here: the broadcast useInput model delivers the same
|
|
30
|
+
* keypress to their handler, which performs the close/cancel itself. Either
|
|
31
|
+
* way the double-Esc clear-input timer is disarmed — an Esc spent on a panel
|
|
32
|
+
* must not count toward the buffer-wipe double-press. Bash mode owns Esc
|
|
33
|
+
* too — but only after the panel router above, so an open monitor still
|
|
34
|
+
* closes first; exiting the shell composer must NOT read as a
|
|
35
|
+
* busy-interrupt.
|
|
36
|
+
*/
|
|
37
|
+
export declare function routeEscClosePanels(ctx: KeyRouteContext, key: KeyEvent): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Monitor-overlay chords. Ctrl+F/G/T are the primary chords; F2/F3/F4 are
|
|
40
|
+
* terminal-safe aliases because some terminals intercept the chord before it
|
|
41
|
+
* reaches the app (notably Windows Terminal eats Ctrl+F for "Find"). Ctrl+B
|
|
42
|
+
* opens the SDD board, Ctrl+Y the project kanban (chord-only — no F-key
|
|
43
|
+
* alias; Ctrl+J is unsuitable because Ink 7 special-cases 0x0A as Enter).
|
|
44
|
+
*/
|
|
45
|
+
export declare function routeChordPanels(ctx: KeyRouteContext, input: string, key: KeyEvent): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* F-key / Ctrl-alias dispatch — table-driven via fKeyEntryFor. Entries with
|
|
48
|
+
* hostAction need host-side work; the rest dispatch directly via
|
|
49
|
+
* actionForFKeyPanel.
|
|
50
|
+
*/
|
|
51
|
+
export declare function routeFKeyPanels(ctx: KeyRouteContext, input: string, key: KeyEvent): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* SDD board drill-down. While the SDD board overlay is open, ←/→ drive the
|
|
54
|
+
* per-phase drill-down and `c`/`z`/`x` drive run lifecycle — clean
|
|
55
|
+
* worktrees / rollback commits / destroy. The lifecycle shortcuts MUST be
|
|
56
|
+
* gated on an empty input draft (and bash mode opts out entirely):
|
|
57
|
+
* otherwise typing literal letters in chat would silently fire destructive
|
|
58
|
+
* lifecycle ops.
|
|
59
|
+
*/
|
|
60
|
+
export declare function routeSddBoard(ctx: KeyRouteContext, input: string, key: KeyEvent): boolean;
|
|
61
|
+
/** The settings overlay owns keys while open (routed before panels). */
|
|
62
|
+
export declare function routeSettingsOverlay(ctx: KeyRouteContext, input: string, key: KeyEvent, isEnter: boolean): boolean;
|
|
63
|
+
/** Panel Escape router (bottom-routed process list etc.). */
|
|
64
|
+
export declare function routePanelEscapeRouter(ctx: KeyRouteContext, key: KeyEvent): boolean;
|
|
65
|
+
//# sourceMappingURL=key-route-overlay.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KeyRouteContext } from '../key-handler-context.js';
|
|
2
|
+
/**
|
|
3
|
+
* Bracketed-paste accumulation — moved verbatim from handleKey
|
|
4
|
+
* (decomposition Phase 3 — docs/decomposition-plan.md).
|
|
5
|
+
*
|
|
6
|
+
* Must run before the Enter/key handling below: a paste split across
|
|
7
|
+
* events can land a fragment that is exactly "\n", which would
|
|
8
|
+
* otherwise be read as Enter and submit mid-paste. The begin marker
|
|
9
|
+
* (`\x1b[200~`, or a bare [200~ when Ink ate the ESC) opens accumulation;
|
|
10
|
+
* we swallow every fragment until the end marker (`\x1b[201~` / [201~),
|
|
11
|
+
* then finalize the whole payload at once.
|
|
12
|
+
*
|
|
13
|
+
* Returns true when the key was consumed by the paste pipeline; false
|
|
14
|
+
* falls through to the later routes.
|
|
15
|
+
*/
|
|
16
|
+
export declare function routePastePipeline(ctx: KeyRouteContext, input: string): Promise<boolean>;
|
|
17
|
+
//# sourceMappingURL=key-route-paste.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { KeyEvent } from '../components/input.js';
|
|
2
|
+
import type { KeyRouteContext } from '../key-handler-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Sidebar focus + scroll. Shift+Tab on an empty draft toggles keyboard focus
|
|
5
|
+
* between the chat input and the right sidebar. When sidebar-focused, ↑/↓
|
|
6
|
+
* scroll the sidebar content. Esc or typing unfocuses automatically.
|
|
7
|
+
*/
|
|
8
|
+
export declare function routeSidebarFocusScroll(ctx: KeyRouteContext, input: string, key: KeyEvent): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Full mouse block: right-press copy fallback, wheel split (sidebar band vs
|
|
11
|
+
* history viewport), sidebar rail press/drag scrub, history scrollbar
|
|
12
|
+
* click/drag with inspect/copy/tool-control icons, drag-to-select,
|
|
13
|
+
* release-commits-copy, clickable status-bar chips (mouseMode-gated), and
|
|
14
|
+
* PageUp/PageDown/Ctrl+U/D history paging. Returns true when the event was
|
|
15
|
+
* consumed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function routePointerEvents(ctx: KeyRouteContext, input: string, key: KeyEvent): Promise<boolean>;
|
|
18
|
+
//# sourceMappingURL=key-route-pointer.d.ts.map
|
|
@@ -41,7 +41,9 @@ interface ModalOverlayKeyHost {
|
|
|
41
41
|
readonly state: State;
|
|
42
42
|
readonly enhanceCancelled: MutableCell<boolean>;
|
|
43
43
|
readonly enhanceController: MutableCell<AbortController | null>;
|
|
44
|
+
readonly inspectPointerAction?: 'copy' | 'close' | null | undefined;
|
|
44
45
|
dispatch(action: Action): void;
|
|
46
|
+
copyInspectOverlay?(): void;
|
|
45
47
|
}
|
|
46
48
|
/** Route the modal overlay ladder that has precedence over every composer key. */
|
|
47
49
|
export declare function routeModalOverlayKey(host: ModalOverlayKeyHost, input: string, key: KeyEvent): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Action } from '../app-action-type.js';
|
|
2
2
|
import type { State } from '../app-state.js';
|
|
3
|
-
declare const dialogActionTypes: readonly ["authOpen", "authClose", "authProviders", "authCatalog", "authView", "authMove", "authBusy", "authHint", "authFilter", "authFlowStart", "authFlowLog", "authFlowDone", "authPromptStart", "authPromptChange", "authPromptEnd", "authConfirmStart", "authConfirmEnd", "authFormStart", "authFormChange", "authFormCancel", "projectPickerOpen", "projectPickerClose", "projectPickerMove", "projectPickerFilter", "projectPickerHint", "fKeyPickerOpen", "fKeyPickerClose", "fKeyPickerMove", "confirmOpen", "confirmClose", "confirmClearAll", "shellCommandWarningOpen", "shellCommandWarningClose", "enhanceOpen", "enhanceClose", "enhanceSet", "enhanceBusy", "topicCheckBusy", "refineCountdownOpen", "refineCountdownClose", "refineFailureOpen", "refineFailureClose", "continueConfirmOpen", "continueConfirmClose", "bugHuntContinueOpen", "bugHuntContinueClose", "bugHuntRunningOpen", "bugHuntRunningClose", "clearConfirmOpen", "clearConfirmSetValue", "clearConfirmClose", "exitConfirmOpen", "exitConfirmClose", "slashConfirmOpen", "slashConfirmClose", "escConfirmOpen", "escConfirmClose", "fallbackOverlayOpen", "fallbackOverlayMove", "fallbackOverlayClose", "inspectOverlayOpen", "inspectOverlayClose", "inspectOverlayScroll", "sendModePickerOpen", "sendModePickerMove", "sendModePickerClose", "resetContextChip"];
|
|
3
|
+
declare const dialogActionTypes: readonly ["authOpen", "authClose", "authProviders", "authCatalog", "authView", "authMove", "authBusy", "authHint", "authFilter", "authFlowStart", "authFlowLog", "authFlowDone", "authPromptStart", "authPromptChange", "authPromptEnd", "authConfirmStart", "authConfirmEnd", "authFormStart", "authFormChange", "authFormCancel", "projectPickerOpen", "projectPickerClose", "projectPickerMove", "projectPickerFilter", "projectPickerHint", "fKeyPickerOpen", "fKeyPickerClose", "fKeyPickerMove", "confirmOpen", "confirmClose", "confirmResolved", "confirmClearAll", "shellCommandWarningOpen", "shellCommandWarningClose", "enhanceOpen", "enhanceClose", "enhanceSet", "enhanceBusy", "topicCheckBusy", "refineCountdownOpen", "refineCountdownClose", "refineFailureOpen", "refineFailureClose", "continueConfirmOpen", "continueConfirmClose", "bugHuntContinueOpen", "bugHuntContinueClose", "bugHuntRunningOpen", "bugHuntRunningClose", "clearConfirmOpen", "clearConfirmSetValue", "clearConfirmClose", "exitConfirmOpen", "exitConfirmClose", "slashConfirmOpen", "slashConfirmClose", "escConfirmOpen", "escConfirmClose", "fallbackOverlayOpen", "fallbackOverlayMove", "fallbackOverlayClose", "inspectOverlayOpen", "inspectOverlayClose", "inspectOverlayScroll", "sendModePickerOpen", "sendModePickerMove", "sendModePickerClose", "resetContextChip"];
|
|
4
4
|
type DialogAction = Extract<Action, {
|
|
5
5
|
type: (typeof dialogActionTypes)[number];
|
|
6
6
|
}>;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import type { Action } from '../app-action-type.js';
|
|
2
2
|
import type { State } from '../app-state.js';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Estimate the sidebar's maximum useful scroll offset — the exact number
|
|
5
|
+
* the `sidebarScroll` / `sidebarScrollSet` reducer clamp computes. Exported
|
|
6
|
+
* so the scrollbar thumb math (`components/sidebar-scrollbar.tsx`) and the
|
|
7
|
+
* wheel/press dispatchers in `app-key-handler.ts` share one source of truth
|
|
8
|
+
* instead of re-deriving the row budget (drift here would desynchronize
|
|
9
|
+
* the thumb from the real clamp). Mirrors the private
|
|
10
|
+
* {@link computeMaxSidebarScroll}; see its doc for the layout budget.
|
|
11
|
+
*/
|
|
12
|
+
export declare function estimateSidebarMaxScroll(state: State, viewportHeight?: number, effectiveSwarmOnSidebar?: boolean | undefined): number;
|
|
13
|
+
declare const workspacePanelActionTypes: readonly ["toggleMonitor", "toggleAgentsMonitor", "toggleHelp", "toggleTodosMonitor", "toggleQueuePanel", "toggleProcessList", "toggleCronMonitor", "togglePlanPanel", "closeAllPanels", "toggleSidebarFocus", "sidebarScroll", "sidebarScrollSet", "sidebarScrollReset", "toggleKanbanPanel", "toggleGoalPanel", "toggleGoalKanbanPanel", "toggleContextPanel", "toggleConnectionsPanel", "checkpointReceived", "rewindOverlayOpen", "rewindOverlayClose", "rewindOverlayMove", "sessionRewound", "eternalStage", "goalSummary", "goalRunInit", "goalRunPhaseUpdate", "goalRunTaskActive", "goalRunRunningPhases", "goalRunElapsed", "goalRunMonitorToggle", "goalRunReset", "sddBoardSnapshot", "toggleSddBoardMonitor", "sddBoardFocusNext", "sddBoardFocusPrev", "worktreeUpsert", "worktreeRemove", "toggleWorktreeMonitor"];
|
|
4
14
|
type WorkspacePanelAction = Extract<Action, {
|
|
5
15
|
type: (typeof workspacePanelActionTypes)[number];
|
|
6
16
|
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TerminalLifecycle } from '@wrongstack/core/utils';
|
|
2
|
+
import type { RunTuiOptions } from './run-tui-options.js';
|
|
3
|
+
/** Everything runTui needs from the exit wiring after handing it over. */
|
|
4
|
+
export interface ExitOrchestrator {
|
|
5
|
+
/** Resolves the run promise through the durable-close budget. */
|
|
6
|
+
settle: (code: number) => void;
|
|
7
|
+
/** Clean project-switch exit: unmount, then a 5s hard-exit fallback. */
|
|
8
|
+
requestExit: (code: number) => void;
|
|
9
|
+
/** Raw-stdin Ctrl+C watcher — pass to mountInkApp (armed after render). */
|
|
10
|
+
onRawCtrlC: (data: Buffer | string) => void;
|
|
11
|
+
/** Exit code last recorded by a signal/exit path (0 until then). */
|
|
12
|
+
getRunExitCode: () => number;
|
|
13
|
+
/** Records an exit code reported outside the orchestrator (App prop). */
|
|
14
|
+
recordExitCode: (code: number) => void;
|
|
15
|
+
/** Signal handlers unmount through this — set after mountInkApp returns. */
|
|
16
|
+
setInkInstance: (instance: {
|
|
17
|
+
unmount: () => void;
|
|
18
|
+
}) => void;
|
|
19
|
+
/** Called by runTui's executor: wires the deferred run promise resolve. */
|
|
20
|
+
attachResolve: (resolve: (code: number) => void) => void;
|
|
21
|
+
/** The render try flips this when the alternate buffer is entered. */
|
|
22
|
+
markAlternateScreenActive: () => void;
|
|
23
|
+
}
|
|
24
|
+
export interface ExitOrchestratorDeps {
|
|
25
|
+
opts: RunTuiOptions;
|
|
26
|
+
stdout: NodeJS.WriteStream;
|
|
27
|
+
inkStdin: NodeJS.ReadStream;
|
|
28
|
+
lifecycle: TerminalLifecycle;
|
|
29
|
+
stopTitle: () => void;
|
|
30
|
+
/** No-op-when-null wrapper over runTui's trace-tee restore handle. */
|
|
31
|
+
restoreTrace: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Single owner for the six exit paths through idempotent cleanup — moved
|
|
35
|
+
* verbatim from runTui() (decomposition Phase 1 R4, docs/decomposition-plan.md):
|
|
36
|
+
* natural settle, SIGTERM/SIGHUP/SIGBREAK, SIGINT rapid-press, the raw-stdin
|
|
37
|
+
* Ctrl+C watcher, the process 'exit' listener, and requestExit. Builds on
|
|
38
|
+
* createDurableTeardown (salvage + bounded close on every path) and composes
|
|
39
|
+
* setupTuiSession for the client registration lifecycle.
|
|
40
|
+
*
|
|
41
|
+
* Ownership transferred from runTui: the `cleaned` and alternate-screen flags,
|
|
42
|
+
* the client registration handle, the ink instance reference, and the deferred
|
|
43
|
+
* resolve (attachResolve from the run promise's executor).
|
|
44
|
+
*/
|
|
45
|
+
export declare function createExitOrchestrator(deps: ExitOrchestratorDeps): ExitOrchestrator;
|
|
46
|
+
//# sourceMappingURL=run-tui-exits.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { detectTerminal } from '@wrongstack/core/utils';
|
|
2
|
+
import type { RunTuiOptions } from './run-tui-options.js';
|
|
3
|
+
/** Capability profile + pointer-mode decision, resolved before Ink mounts. */
|
|
4
|
+
export interface TuiLaunchPlan {
|
|
5
|
+
capability: ReturnType<typeof detectTerminal>;
|
|
6
|
+
mouseEnabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Everything that must be decided before Ink takes over the screen — moved
|
|
10
|
+
* verbatim from runTui() (decomposition Phase 1 R1, docs/decomposition-plan.md):
|
|
11
|
+
* the interactive-TTY guard, the one-time capability probe, the pointer-mode
|
|
12
|
+
* opt-in, and the terminal-silence call.
|
|
13
|
+
*
|
|
14
|
+
* On a non-TTY invocation this writes the user-facing explanation and returns
|
|
15
|
+
* `{ ok: false, exitCode: 2 }`; runTui() returns that code untouched.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveTuiLaunchPlan(opts: RunTuiOptions): {
|
|
18
|
+
ok: false;
|
|
19
|
+
exitCode: number;
|
|
20
|
+
} | ({
|
|
21
|
+
ok: true;
|
|
22
|
+
} & TuiLaunchPlan);
|
|
23
|
+
//# sourceMappingURL=run-tui-launch.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
/** Ink mount handle: the instance signal handlers unmount, plus the resize unsubscription. */
|
|
3
|
+
export interface MountInkAppResult {
|
|
4
|
+
instance: {
|
|
5
|
+
unmount: () => void;
|
|
6
|
+
waitUntilExit(): Promise<unknown>;
|
|
7
|
+
};
|
|
8
|
+
detachResize: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Ink mount — moved verbatim from runTui() (decomposition Phase 1 R3,
|
|
12
|
+
* docs/decomposition-plan.md): render() with exitOnCtrlC disabled and fps
|
|
13
|
+
* bounding, the raw-Ctrl+C stdin watcher arming (only AFTER Ink owns stdin —
|
|
14
|
+
* attaching earlier would flip the stream into flowing mode and drop
|
|
15
|
+
* boot-time keystrokes), and the resize erase handler.
|
|
16
|
+
*
|
|
17
|
+
* Any mount failure is reported through onStartupFailure and returns null;
|
|
18
|
+
* runTui then returns without wiring waitUntilExit — same as the original
|
|
19
|
+
* catch-and-return.
|
|
20
|
+
*/
|
|
21
|
+
export declare function mountInkApp(deps: {
|
|
22
|
+
appElement: React.ReactElement;
|
|
23
|
+
inkStdin: NodeJS.ReadStream;
|
|
24
|
+
stdout: NodeJS.WriteStream;
|
|
25
|
+
onRawCtrlC: (data: Buffer | string) => void;
|
|
26
|
+
onStartupFailure: (err: unknown) => void;
|
|
27
|
+
}): MountInkAppResult | null;
|
|
28
|
+
//# sourceMappingURL=run-tui-mount.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRunTuiClientRegistration } from './run-tui-client-registration.js';
|
|
2
|
+
import type { RunTuiOptions } from './run-tui-options.js';
|
|
3
|
+
/**
|
|
4
|
+
* Session/client bootstrap — moved verbatim from runTui() (decomposition
|
|
5
|
+
* Phase 1 R2, docs/decomposition-plan.md): registers this TUI client with
|
|
6
|
+
* the shared registry, heartbeats, and telemetry bridges, returning the
|
|
7
|
+
* handle whose unregister() every exit path calls.
|
|
8
|
+
*
|
|
9
|
+
* `isCleaned` backs the registry's heartbeat/sync guards; it must be wired
|
|
10
|
+
* to runTui's `cleaned` flag so registration activity stops on cleanup.
|
|
11
|
+
*/
|
|
12
|
+
export declare function setupTuiSession(opts: RunTuiOptions, isCleaned: () => boolean): ReturnType<typeof createRunTuiClientRegistration>;
|
|
13
|
+
//# sourceMappingURL=run-tui-session.d.ts.map
|
package/dist/run-tui.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { RunTuiOptions } from './run-tui-options.js';
|
|
2
|
-
import { silenceTerminal, unsilenceTerminal } from './terminal-silence.js';
|
|
3
2
|
export type { AutonomyStage } from '@wrongstack/core/types';
|
|
4
3
|
export type { RunTuiOptions } from './run-tui-options.js';
|
|
5
|
-
export { silenceTerminal, unsilenceTerminal };
|
|
4
|
+
export { silenceTerminal, unsilenceTerminal } from './terminal-silence.js';
|
|
6
5
|
export declare function runTui(opts: RunTuiOptions): Promise<number>;
|
|
7
6
|
//# sourceMappingURL=run-tui.d.ts.map
|
package/dist/sidebar-sizing.d.ts
CHANGED
|
@@ -21,7 +21,8 @@ import type { PanelId } from './ui-contracts.js';
|
|
|
21
21
|
/**
|
|
22
22
|
* Natural-height budget for each routed sidebar panel at the minimum
|
|
23
23
|
* 16-column content width. Worklist panels reserve their maximum item count
|
|
24
|
-
* × the bounded wrap ceiling; connections reserve
|
|
24
|
+
* × the bounded wrap ceiling; connections reserve a summary block (counts
|
|
25
|
+
* chips + health meter) plus one row per service.
|
|
25
26
|
*/
|
|
26
27
|
export declare const SIDEBAR_TWIN_HEIGHT_BY_PANEL: Readonly<Record<PanelId, number>>;
|
|
27
28
|
/**
|
package/dist/ui-contracts.d.ts
CHANGED
|
@@ -88,6 +88,21 @@ export declare const DEFAULT_PANEL_POSITIONS: PanelPositionMap;
|
|
|
88
88
|
* rather than re-implementing the mapping to avoid divergent defaults.
|
|
89
89
|
*/
|
|
90
90
|
export declare function coercePanelPositionMap(v: Partial<Record<PanelId, PanelPosition>> | undefined): PanelPositionMap;
|
|
91
|
+
/**
|
|
92
|
+
* True when the right sidebar is "pinned on": at least one F-key panel is
|
|
93
|
+
* routed to the sidebar slot (per {@link coercePanelPositionMap}-coerced
|
|
94
|
+
* positions), or the legacy tri-state agent-swarm mode is 'sidebar' (which
|
|
95
|
+
* mounts the AGENT SWARM + MISSIONS cards on the rail). While pinned, the
|
|
96
|
+
* master `showSidebar` switch must not resolve to off — a routed panel's
|
|
97
|
+
* only home is the sidebar, so hiding the rail would orphan it.
|
|
98
|
+
*
|
|
99
|
+
* Lives beside {@link coercePanelPositionMap} because every guard site (the
|
|
100
|
+
* settings picker, the settings reducer, the /lite and /settings slash
|
|
101
|
+
* commands, and the layout resolver) already depends on this module, and
|
|
102
|
+
* routing it through app-ui-state.ts would close a type-inclusive import
|
|
103
|
+
* cycle back into the reducer chain.
|
|
104
|
+
*/
|
|
105
|
+
export declare function hasPanelRoutedToSidebar(panelPositions: Partial<Record<PanelId, 'bottom' | 'sidebar'>> | undefined, legacySwarmOnSidebar?: boolean | undefined): boolean;
|
|
91
106
|
export interface AgentTranscriptReader {
|
|
92
107
|
getTranscript(subagentId: string, limit?: number): AgentTimelineEntry[];
|
|
93
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/tui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack terminal UI: Ink-based interactive renderer with history, pickers, and slash menus.",
|
|
6
6
|
"repository": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"!dist/**/*.map"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@wrongstack/core": "1.0.
|
|
30
|
-
"@wrongstack/kanban": "1.0.
|
|
31
|
-
"@wrongstack/runtime": "1.0.
|
|
32
|
-
"@wrongstack/sage": "1.0.
|
|
33
|
-
"@wrongstack/sdd": "1.0.
|
|
34
|
-
"@wrongstack/tools": "1.0.
|
|
29
|
+
"@wrongstack/core": "1.0.6",
|
|
30
|
+
"@wrongstack/kanban": "1.0.6",
|
|
31
|
+
"@wrongstack/runtime": "1.0.6",
|
|
32
|
+
"@wrongstack/sage": "1.0.6",
|
|
33
|
+
"@wrongstack/sdd": "1.0.6",
|
|
34
|
+
"@wrongstack/tools": "1.0.6",
|
|
35
35
|
"ink": "7.1.1",
|
|
36
36
|
"react": "^19.2.8",
|
|
37
37
|
"string-width": "8.2.2",
|