@wrongstack/tui 1.0.24 → 1.0.27
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 +68 -1
- package/dist/app-panel-state.d.ts +49 -0
- package/dist/app-props.d.ts +20 -0
- package/dist/app-reducer.d.ts +1 -1
- package/dist/app-settings-type.d.ts +1 -0
- package/dist/app-state-core-types.d.ts +13 -0
- package/dist/app-view-contract.d.ts +1 -1
- package/dist/background-strip-model.d.ts +65 -0
- package/dist/brain-panel-model.d.ts +7 -7
- package/dist/chat-search-slash.d.ts +15 -0
- package/dist/clipboard.d.ts +14 -1
- package/dist/components/background-strip.d.ts +20 -0
- package/dist/components/chat-search-bar.d.ts +19 -0
- package/dist/components/checkpoint-timeline.d.ts +6 -2
- package/dist/components/history/code-block.d.ts +2 -136
- package/dist/components/history/diff-model.d.ts +143 -0
- package/dist/components/history/scroll-controller-types.d.ts +11 -0
- package/dist/components/history/scrollbar-rail.d.ts +14 -2
- package/dist/components/history/use-history-controller.d.ts +5 -0
- package/dist/components/monitor-shell.d.ts +5 -1
- package/dist/components/phase-monitor.d.ts +3 -1
- package/dist/components/prompt-picker-model.d.ts +16 -0
- package/dist/components/prompt-picker.d.ts +2 -16
- package/dist/components/resource-menu-model.d.ts +3 -0
- package/dist/components/resource-menu.d.ts +3 -3
- package/dist/components/scrollable-history.d.ts +1 -1
- package/dist/components/send-mode-model.d.ts +44 -0
- package/dist/components/send-mode-picker.d.ts +2 -43
- package/dist/components/settings-picker.d.ts +2 -1
- package/dist/components/sidebar-panel-agents.d.ts +10 -0
- package/dist/components/sidebar-panel-connections.d.ts +11 -0
- package/dist/components/sidebar-panel-coordinator.d.ts +11 -0
- package/dist/components/sidebar-panel-fleet.d.ts +16 -0
- package/dist/components/sidebar-panel-project.d.ts +12 -0
- package/dist/components/sidebar-panel-worktree.d.ts +10 -0
- package/dist/components/sidebar-panel-wrong-proxy.d.ts +25 -0
- package/dist/components/sidebar-panels-workspace.d.ts +10 -79
- package/dist/components/status-bar-rails-async.d.ts +2 -2
- package/dist/components/status-bar-types.d.ts +19 -0
- package/dist/components/status-bar.d.ts +1 -1
- package/dist/components/statusline-picker-model.d.ts +45 -0
- package/dist/components/statusline-picker.d.ts +2 -41
- package/dist/components/theme-picker.d.ts +19 -7
- package/dist/connections-health.d.ts +1 -0
- package/dist/connections-slash.d.ts +2 -2
- package/dist/hit-test.d.ts +2 -2
- package/dist/hooks/failed-run-tracker.d.ts +30 -0
- package/dist/hooks/fork-at-checkpoint.d.ts +25 -0
- package/dist/hooks/tui-slash-command-options.d.ts +9 -0
- package/dist/hooks/use-app-execution-pipeline.d.ts +1 -1
- package/dist/hooks/use-app-picker-keys.d.ts +5 -2
- package/dist/hooks/use-chip-staleness-guard.d.ts +6 -0
- package/dist/hooks/use-core-tui-commands.d.ts +7 -2
- package/dist/hooks/use-file-search.d.ts +10 -0
- package/dist/hooks/use-mcp-status-bridge.d.ts +18 -0
- package/dist/hooks/use-next-steps-auto-submit.d.ts +4 -2
- package/dist/hooks/use-picker-keys-brain-statusline.d.ts +4 -0
- package/dist/hooks/use-picker-keys-types.d.ts +5 -0
- package/dist/hooks/use-provider-quota.d.ts +5 -0
- package/dist/hooks/use-provider-warmup.d.ts +9 -0
- package/dist/hooks/use-queue-manager.d.ts +11 -1
- package/dist/hooks/use-session-rewind.d.ts +8 -1
- package/dist/hooks/use-slash-picker.d.ts +1 -1
- package/dist/hooks/use-stable-key-handler.d.ts +8 -1
- package/dist/hooks/use-status-sync-interval.d.ts +3 -2
- package/dist/hooks/use-theme-picker-handler.d.ts +7 -2
- package/dist/hooks/use-tui-environment-state.d.ts +3 -0
- package/dist/hooks/use-tui-event-bridge.d.ts +12 -0
- package/dist/hooks/use-tui-slash-commands.d.ts +1 -1
- package/dist/index.js +23899 -21785
- package/dist/ink.d.ts +1 -1
- package/dist/input-validation/action-types.d.ts +1 -1
- package/dist/input-validation/limits.d.ts +2 -0
- package/dist/input-validation-display.d.ts +9 -0
- package/dist/input-validation.d.ts +0 -52
- package/dist/key-routes/key-route-background-strip.d.ts +14 -0
- package/dist/key-routes/key-route-chat-search.d.ts +24 -0
- package/dist/layout-store.d.ts +2 -2
- package/dist/memory-slash-render.d.ts +1 -1
- package/dist/message-checkpoint.d.ts +19 -0
- package/dist/motion.d.ts +16 -0
- package/dist/reducers/chat-search.d.ts +11 -0
- package/dist/reducers/composer-action-types.d.ts +6 -0
- package/dist/reducers/composer-pickers.d.ts +4 -0
- package/dist/reducers/composer.d.ts +1 -5
- package/dist/reducers/message-jump.d.ts +16 -0
- package/dist/reducers/workspace-panels.d.ts +1 -1
- package/dist/resume-session-tree.d.ts +8 -0
- package/dist/rewind-prompt.d.ts +24 -0
- package/dist/run-tui-options.d.ts +23 -4
- package/dist/scroll-anchor.d.ts +6 -0
- package/dist/settings-contracts.d.ts +1 -0
- package/dist/submit-controller.d.ts +1 -1
- package/dist/submit-slash-command.d.ts +67 -0
- package/dist/theme-picker-rows.d.ts +70 -0
- package/dist/theme-presets/options.d.ts +13 -1
- package/dist/theme-presets/rose-pine.d.ts +1 -1
- package/dist/theme-types.d.ts +6 -0
- package/dist/theme-utils.d.ts +11 -0
- package/dist/transcript-search.d.ts +38 -0
- package/dist/ui-contracts.d.ts +1 -1
- package/dist/use-app-controller.d.ts +1 -1
- package/dist/use-controller-key-pipeline.d.ts +218 -0
- package/package.json +7 -7
package/dist/ink.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type BoxOwnProps = Omit<ComponentProps<typeof InkBox>, 'ref' | 'borderColor' | '
|
|
|
11
11
|
export type { DOMElement, Key } from 'ink';
|
|
12
12
|
export { measureElement, Static, useAnimation, useApp, useInput, useStdin, useStdout, } from 'ink';
|
|
13
13
|
/** Ink `Text` with named colors resolved against the active theme. */
|
|
14
|
-
export declare function Text({ color, backgroundColor, ...rest }: TextOwnProps): ReactElement;
|
|
14
|
+
export declare function Text({ color, backgroundColor, children, ...rest }: TextOwnProps): ReactElement;
|
|
15
15
|
/**
|
|
16
16
|
* Ink `Box` with named border/background colors resolved against the theme. Forwards
|
|
17
17
|
* `ref` so `measureElement` (used by the scrollable history) keeps working.
|
|
@@ -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", "sidebarScrollSet", "sidebarScrollReset", "toggleSidebarFocus", "skillMentionResults", "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", "goalRunTaskAgent", "goalRunTaskCompleted", "goalSummary", "helpClose", "helpFilter", "helpHint", "helpMove", "helpOpen", "helpScrollDetail", "hint", "historyDown", "historyPush", "historyUp", "interrupt", "leaderCtxPct", "leaderIterEnd", "leaderIterStart", "leaderToolEnd", "leaderToolStart", "mcpPickerBusy", "mcpPickerClose", "mcpPickerHint", "mcpPickerMove", "mcpPickerOpen", "mcpPickerSetItems", "modePickerClose", "modePickerHint", "modePickerMove", "modePickerOpen", "modelPickerBack", "modelPickerClose", "modelPickerEffort", "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", "statuslineMoveOrder", "statuslineOpen", "statuslineResetLayout", "statuslineSetDensity", "statuslineSetLine", "statuslineToggle", "statuslineToggleLine", "statuslineVisibleChipsSync", "subagentModelsClose", "subagentModelsHint", "subagentModelsMove", "subagentModelsOpen", "subagentModelsUpdate", "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", "skillMentionResults", "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", "chatSearchClose", "chatSearchOpen", "chatSearchSetQuery", "chatSearchStep", "messageJump", "messageJumpClear", "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", "goalRunTaskAgent", "goalRunTaskCompleted", "goalSummary", "helpClose", "helpFilter", "helpHint", "helpMove", "helpOpen", "helpScrollDetail", "hint", "historyDown", "historyPush", "historyUp", "interrupt", "leaderCtxPct", "leaderIterEnd", "leaderIterStart", "leaderToolEnd", "leaderToolStart", "mcpPickerBusy", "mcpPickerClose", "mcpPickerHint", "mcpPickerMove", "mcpPickerOpen", "mcpPickerSetItems", "modePickerClose", "modePickerHint", "modePickerMove", "modePickerOpen", "modelPickerBack", "modelPickerClose", "modelPickerEffort", "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", "checkpointFork", "forkRequestDone", "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", "statuslineMoveOrder", "statuslineOpen", "statuslineResetLayout", "statuslineSetDensity", "statuslineSetLine", "statuslineToggle", "statuslineToggleLine", "statuslineVisibleChipsSync", "subagentModelsClose", "subagentModelsHint", "subagentModelsMove", "subagentModelsOpen", "subagentModelsUpdate", "steerConsume", "steerStart", "streamDelta", "streamReset", "themePickerClose", "themePickerHint", "themePickerFilter", "themePickerFilterMode", "themePickerPreview", "themePickerMove", "themePickerOpen", "themePickerUndo", "themePickerSwapPrevious", "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
|
|
@@ -24,4 +24,6 @@ export declare const MAX_PASTE_FRAGMENT_CHARS = 100000;
|
|
|
24
24
|
export declare const MAX_HOST_STRING_FIELD = 500;
|
|
25
25
|
/** Maximum entries in a picker matches list. */
|
|
26
26
|
export declare const MAX_PICKER_MATCHES = 500;
|
|
27
|
+
/** Transcript search query cap (Alt+F / `/chat-search`). */
|
|
28
|
+
export declare const MAX_CHAT_SEARCH_QUERY_CHARS = 1000;
|
|
27
29
|
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ValidationResult } from './input-validation/result.js';
|
|
2
|
+
export declare function validateDisplayAction(action: {
|
|
3
|
+
type: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}, type: string, normalized: string, payload: {
|
|
6
|
+
type: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}): ValidationResult<Record<string, unknown>>;
|
|
9
|
+
//# sourceMappingURL=input-validation-display.d.ts.map
|
|
@@ -1,55 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Central input validation for the TUI.
|
|
3
|
-
*
|
|
4
|
-
* EVERY external data source that crosses a trust boundary passes through
|
|
5
|
-
* this module. Uses an **allow-list** approach: define the exact allowed
|
|
6
|
-
* shape, types, ranges, and formats for each input; reject everything else.
|
|
7
|
-
*
|
|
8
|
-
* ── Trust boundaries ─────────────────────────────────────────────────
|
|
9
|
-
*
|
|
10
|
-
* Boundary | Source | Validator
|
|
11
|
-
* ------------------|---------------------|--------------------------
|
|
12
|
-
* stdin | terminal emulator | validateStdinFragment()
|
|
13
|
-
* paste | bracketed-paste | validatePasteContent()
|
|
14
|
-
* AppProps | CLI host | validateAppProps()
|
|
15
|
-
* Reducer Action | handleKey dispatch | validateAction()
|
|
16
|
-
* Host callbacks | CLI/plugin return | validateCallbackReturn()
|
|
17
|
-
* Mouse events | SGR protocol | validateMouseEvent()
|
|
18
|
-
* Fleet telemetry | Director/FleetBus | validateFleetEntry()
|
|
19
|
-
* Restore data | session JSONL | validateRestoreEntry()
|
|
20
|
-
*
|
|
21
|
-
* ── Rejection over coercion ──────────────────────────────────────────
|
|
22
|
-
*
|
|
23
|
-
* This module **rejects** invalid input rather than coercing it, for
|
|
24
|
-
* three reasons:
|
|
25
|
-
*
|
|
26
|
-
* 1. **Coercion masks injection.** Trimming whitespace from a string
|
|
27
|
-
* that contains an ANSI escape sequence leaves the sequence intact.
|
|
28
|
-
* 2. **Semantic gap.** Coercing a value (e.g. clamping a PID to a valid
|
|
29
|
-
* range) creates a gap between what was validated and what the
|
|
30
|
-
* application actually uses — a future code path may use the raw
|
|
31
|
-
* value, not the clamped one.
|
|
32
|
-
* 3. **Predictable failure.** Silent data transformation makes security
|
|
33
|
-
* debugging harder — rejection produces a clear error at the point
|
|
34
|
-
* of violation; coercion produces subtly wrong behavior downstream.
|
|
35
|
-
*
|
|
36
|
-
* The single exception is **normalization before comparison**: trimming
|
|
37
|
-
* whitespace from an enum label before comparing it to the allow-list
|
|
38
|
-
* prevents trivial bypasses (e.g. `" off "` vs `"off"`). This is
|
|
39
|
-
* NOT the same as coercing the input — the normalized comparison only
|
|
40
|
-
* determines allow/deny; the caller receives the original value.
|
|
41
|
-
*
|
|
42
|
-
* ── Conventions ──────────────────────────────────────────────────────
|
|
43
|
-
*
|
|
44
|
-
* - Every `validate*` function returns `ValidationResult<T>`:
|
|
45
|
-
* `{ valid: true; value: T }` — the validated, ready-to-use value
|
|
46
|
-
* `{ valid: false; error: string }` — a specific, actionable message
|
|
47
|
-
* - Every error message follows the pattern:
|
|
48
|
-
* `"{path}": {what went wrong} ({detail}).`
|
|
49
|
-
* - Size limits are defined as module-level constants with doc comments.
|
|
50
|
-
* - Enum/union allow-lists are defined as `const` arrays and kept in
|
|
51
|
-
* ONE place so the allowed set is auditable.
|
|
52
|
-
*/
|
|
53
1
|
import type { ValidationResult } from './input-validation/result.js';
|
|
54
2
|
export { ALLOWED_ACTION_TYPES } from './input-validation/action-types.js';
|
|
55
3
|
export { ALLOWED_ENTRY_KINDS, ALLOWED_FLEET_STATUSES, ALLOWED_KEY_EVENT_FIELDS, ALLOWED_MOUSE_BUTTONS, ALLOWED_MOUSE_KINDS, TEXT_BEARING_ENTRY_KINDS, } from './input-validation/allow-lists.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background strip keys (Alt+B). While the strip is focused, ←/→ pick a chip,
|
|
3
|
+
* Enter shows or hides its output, `x` asks to stop a background shell and
|
|
4
|
+
* `y` (or Enter) confirms, Esc or Alt+B leaves. Typing text leaves the strip
|
|
5
|
+
* and goes to the composer, as the sidebar focus does. Scrolling, function
|
|
6
|
+
* keys and Ctrl+C keep their normal routes.
|
|
7
|
+
*/
|
|
8
|
+
import type { KeyEvent } from '../components/input.js';
|
|
9
|
+
/**
|
|
10
|
+
* Returns true when the key was consumed. `stop` ends a background shell by
|
|
11
|
+
* PID; it is the process registry's kill in the TUI.
|
|
12
|
+
*/
|
|
13
|
+
export declare function routeBackgroundStrip(input: string, key: KeyEvent, stop: (pid: number) => void): boolean;
|
|
14
|
+
//# sourceMappingURL=key-route-background-strip.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transcript search bar keys (Alt+F / `/chat-search`).
|
|
3
|
+
*
|
|
4
|
+
* While the bar is open it owns text entry: typing edits the query and never
|
|
5
|
+
* reaches the composer draft. Scrolling (wheel, mouse, PgUp/PgDn), function
|
|
6
|
+
* keys and Ctrl+C keep their normal routes, so the user can still page
|
|
7
|
+
* around the transcript or open a panel with the bar visible.
|
|
8
|
+
*/
|
|
9
|
+
import type { KeyEvent } from '../components/input.js';
|
|
10
|
+
import type { KeyRouteContext } from '../key-handler-context.js';
|
|
11
|
+
/** Thinking cards are only searchable while they are shown. */
|
|
12
|
+
export declare function chatSearchIncludesReasoning(ctx: Pick<KeyRouteContext, 'getSettings'>): boolean;
|
|
13
|
+
/** Returns true when the key was consumed by the search bar (or opened it). */
|
|
14
|
+
export declare function routeChatSearch(ctx: KeyRouteContext, input: string, key: KeyEvent): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Alt+↑ / Alt+↓: jump to the previous / next message the user sent.
|
|
17
|
+
*
|
|
18
|
+
* The marked message then takes one key: Enter on an empty composer opens
|
|
19
|
+
* the rewind timeline at that message's checkpoint (Enter rewinds, `f`
|
|
20
|
+
* forks), Esc lets go of it. Any other key lets go of it too and does its
|
|
21
|
+
* usual job, so a mark left behind never captures a later Enter.
|
|
22
|
+
*/
|
|
23
|
+
export declare function routeMessageJump(ctx: KeyRouteContext, _input: string, key: KeyEvent): boolean;
|
|
24
|
+
//# sourceMappingURL=key-route-chat-search.d.ts.map
|
package/dist/layout-store.d.ts
CHANGED
|
@@ -72,8 +72,8 @@ export declare class LayoutStore {
|
|
|
72
72
|
* Remove entries no longer in the active set (after history retention).
|
|
73
73
|
*/
|
|
74
74
|
retain(entryIds: Set<number>): void;
|
|
75
|
-
/** Reset all in-memory state (on /clear). */
|
|
76
|
-
clear(): void
|
|
75
|
+
/** Reset all in-memory state (on /clear) and persist the empty snapshot. */
|
|
76
|
+
clear(): Promise<void>;
|
|
77
77
|
/**
|
|
78
78
|
* Load layout data from disk. Returns the number of entries restored, or 0
|
|
79
79
|
* when no data exists or the version has changed (caller should regenerate).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HistoryEntry } from './history-entry.js';
|
|
2
|
+
interface CheckpointLike {
|
|
3
|
+
promptIndex: number;
|
|
4
|
+
promptPreview: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The position in `checkpoints` of the checkpoint the user message
|
|
8
|
+
* `entryId` was sent under, or `undefined` when none can be told.
|
|
9
|
+
*
|
|
10
|
+
* Checkpoints carry only an 80-character preview of the prompt the agent
|
|
11
|
+
* received, so messages and checkpoints are paired in order by the start of
|
|
12
|
+
* their text. A message whose screen text differs from what was sent (a
|
|
13
|
+
* pasted block shows as a placeholder) matches nothing; then, when every
|
|
14
|
+
* message has a checkpoint, the n-th message is paired with the n-th.
|
|
15
|
+
* Steering notes (`↯ …`) are folded into a running turn and have none.
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkpointForMessage(entries: readonly HistoryEntry[], checkpoints: readonly CheckpointLike[], entryId: number): number | undefined;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=message-checkpoint.d.ts.map
|
package/dist/motion.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function reducedMotionFromEnv(env?: NodeJS.ProcessEnv): boolean;
|
|
2
|
+
/** The style actually rendered: the environment override wins over settings. */
|
|
3
|
+
export declare function effectiveAnimationStyle<S extends string>(style: S): S | 'static';
|
|
4
|
+
/** Whether the animated terminal title may run. */
|
|
5
|
+
export declare function titleAnimationAllowed(setting: boolean | undefined): boolean;
|
|
6
|
+
/** Styles whose label colors move and therefore need the fast color clock. */
|
|
7
|
+
export declare function animatesColor(style: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Publish the effective style so leaves without a style prop (tool stream
|
|
10
|
+
* spinner, composer activity icon) follow it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function setMotionStatic(value: boolean): void;
|
|
13
|
+
export declare function isMotionStatic(): boolean;
|
|
14
|
+
/** True while decorative motion is off. */
|
|
15
|
+
export declare function useMotionStatic(): boolean;
|
|
16
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Action } from '../app-action-type.js';
|
|
2
|
+
import type { State } from '../app-state.js';
|
|
3
|
+
declare const chatSearchActionTypes: readonly ["chatSearchOpen", "chatSearchSetQuery", "chatSearchStep", "chatSearchClose"];
|
|
4
|
+
type ChatSearchAction = Extract<Action, {
|
|
5
|
+
type: (typeof chatSearchActionTypes)[number];
|
|
6
|
+
}>;
|
|
7
|
+
export declare function isChatSearchAction(action: Action): action is ChatSearchAction;
|
|
8
|
+
/** Transcript search bar (Alt+F / `/chat-search`). */
|
|
9
|
+
export declare function reduceChatSearch(state: State, action: ChatSearchAction): State;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=chat-search.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Action } from '../app-action-type.js';
|
|
2
|
+
export declare const composerActionTypes: readonly ["brainPromptSet", "brainPromptClear", "pickerOpen", "pickerClose", "pickerSetMatches", "pickerMove", "toolStarted", "toolEnded", "toolStreamAppend", "toolStreamClear", "enqueue", "dequeueFirst", "queueClear", "queueDelete", "queueToggleRefine", "bashModeEnter", "bashModeExit", "slashPickerOpen", "slashPickerClose", "slashPickerMove", "historyPush", "historyUp", "historyDown", "setInputHistory", "clearInputHistory", "modelPickerOpen", "modelPickerClose", "modelPickerMove", "modelPickerPickProvider", "modelPickerBack", "modelPickerSearch", "modelPickerEffort", "modelPickerHint", "autonomyPickerOpen", "autonomyPickerClose", "autonomyPickerMove", "autonomyPickerHint", "themePickerOpen", "themePickerClose", "themePickerMove", "themePickerHint", "themePickerFilter", "themePickerFilterMode", "themePickerPreview", "themePickerUndo", "themePickerSwapPrevious", "modePickerOpen", "modePickerClose", "modePickerMove", "modePickerHint", "skillPickerOpen", "skillMentionResults", "skillPickerClose", "skillPickerMove", "skillPickerHint", "resourceMenuOpen", "resourceMenuClose", "resourceMenuMove", "resourceMenuHint", "resourceMenuFilter", "resourceMenuConfirm", "designPickerOpen", "designPickerClose", "designPickerMove", "designPickerStack", "promptPickerOpen", "promptPickerClose", "promptPickerMove", "promptPickerCategory", "resumePickerOpen", "resumePickerClose", "resumePickerMove", "resumePickerBusy", "resumePickerHint", "resumePickerError", "replaceHistory", "resumeLoadStart", "resumeLoadTick", "resumeStreamChunk", "resumeLoadAbort"];
|
|
3
|
+
export type ComposerAction = Extract<Action, {
|
|
4
|
+
type: (typeof composerActionTypes)[number];
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=composer-action-types.d.ts.map
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { Action } from '../app-action-type.js';
|
|
2
2
|
import type { State } from '../app-state.js';
|
|
3
|
-
|
|
4
|
-
type ComposerAction = Extract<Action, {
|
|
5
|
-
type: (typeof composerActionTypes)[number];
|
|
6
|
-
}>;
|
|
3
|
+
import { type ComposerAction } from './composer-action-types.js';
|
|
7
4
|
export declare function isComposerAction(action: Action): action is ComposerAction;
|
|
8
5
|
/** Reduces composer tools, queues, history navigation, and session/model pickers. */
|
|
9
6
|
export declare function reduceComposer(state: State, action: ComposerAction): State;
|
|
10
|
-
export {};
|
|
11
7
|
//# sourceMappingURL=composer.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Action } from '../app-action-type.js';
|
|
2
|
+
import type { State } from '../app-state.js';
|
|
3
|
+
type MessageJumpAction = Extract<Action, {
|
|
4
|
+
type: 'messageJump';
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Alt+↑ / Alt+↓: step through the user's own messages in the transcript.
|
|
8
|
+
* The first Alt+↑ lands on the newest one; further steps stop at either end.
|
|
9
|
+
* `seq` increments on every step so the view scrolls even when the target
|
|
10
|
+
* entry is the same one (the user may have scrolled away since).
|
|
11
|
+
*/
|
|
12
|
+
export declare function reduceMessageJump(state: State, action: MessageJumpAction): State;
|
|
13
|
+
/** Drop the marked message (Esc, or any key that goes on to the composer). */
|
|
14
|
+
export declare function clearMessageJump(state: State): State;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=message-jump.d.ts.map
|
|
@@ -10,7 +10,7 @@ import type { State } from '../app-state.js';
|
|
|
10
10
|
* {@link computeMaxSidebarScroll}; see its doc for the layout budget.
|
|
11
11
|
*/
|
|
12
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", "goalRunTaskAgent", "goalRunTaskCompleted", "goalRunRunningPhases", "goalRunElapsed", "goalRunMonitorToggle", "goalRunReset", "sddBoardSnapshot", "toggleSddBoardMonitor", "sddBoardFocusNext", "sddBoardFocusPrev", "worktreeUpsert", "worktreeRemove", "toggleWorktreeMonitor"];
|
|
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", "checkpointFork", "forkRequestDone", "sessionRewound", "eternalStage", "goalSummary", "goalRunInit", "goalRunPhaseUpdate", "goalRunTaskActive", "goalRunTaskAgent", "goalRunTaskCompleted", "goalRunRunningPhases", "goalRunElapsed", "goalRunMonitorToggle", "goalRunReset", "sddBoardSnapshot", "toggleSddBoardMonitor", "sddBoardFocusNext", "sddBoardFocusPrev", "worktreeUpsert", "worktreeRemove", "toggleWorktreeMonitor"];
|
|
14
14
|
type WorkspacePanelAction = Extract<Action, {
|
|
15
15
|
type: (typeof workspacePanelActionTypes)[number];
|
|
16
16
|
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ResumeSessionEntry } from './app-state-core-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Picker order for `/resume`: this worktree's sessions first, then each other
|
|
4
|
+
* worktree of the repository in the host's order. Inside each group, forks
|
|
5
|
+
* sit under their parent (see `orderSessionTree`) with a tree connector.
|
|
6
|
+
*/
|
|
7
|
+
export declare function orderResumeEntries(entries: readonly ResumeSessionEntry[]): ResumeSessionEntry[];
|
|
8
|
+
//# sourceMappingURL=resume-session-tree.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RewoundConversation } from '@wrongstack/core/storage';
|
|
2
|
+
import type { Action } from './app-action-type.js';
|
|
3
|
+
/**
|
|
4
|
+
* After a rewind or a fork, hand the prompt that was taken back to the user
|
|
5
|
+
* to edit and send again.
|
|
6
|
+
*
|
|
7
|
+
* Both wipe the composer (a rewind clears the transcript view, a fork
|
|
8
|
+
* resumes another session), so the draft from before is passed in. A draft
|
|
9
|
+
* wins over the prompt: it is what the user was typing, and losing it to a
|
|
10
|
+
* rewind was a bug of its own. The prompt is then shown as a note instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare function restoreRewoundPrompt(dispatch: (action: Action) => void, draftBefore: string, promptText: string | undefined): void;
|
|
13
|
+
/**
|
|
14
|
+
* Redraw the transcript from the conversation a rewind or redo left. The
|
|
15
|
+
* rewind event clears the screen; without this the turns that survived the
|
|
16
|
+
* rewind vanished from view while the model still had them.
|
|
17
|
+
*/
|
|
18
|
+
export declare function showConversation(dispatch: (action: Action) => void, conversation: RewoundConversation): void;
|
|
19
|
+
/** After a rewind: the surviving turns on screen, the prompt back in the composer. */
|
|
20
|
+
export declare function showRewind(dispatch: (action: Action) => void, draftBefore: string, outcome: {
|
|
21
|
+
promptText?: string | undefined;
|
|
22
|
+
conversation?: RewoundConversation | undefined;
|
|
23
|
+
}): void;
|
|
24
|
+
//# sourceMappingURL=rewind-prompt.d.ts.map
|
|
@@ -34,6 +34,12 @@ export interface RunTuiOptions {
|
|
|
34
34
|
banner?: boolean | undefined;
|
|
35
35
|
/** Persists the input queue across crashes; if omitted, the queue is in-memory only. */
|
|
36
36
|
queueStore?: QueueStore | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The queue store of another session. With it, `/resume` brings that
|
|
39
|
+
* session's queue along (the WebUI keeps its queue in the same file) and
|
|
40
|
+
* leaves the previous session's on disk.
|
|
41
|
+
*/
|
|
42
|
+
queueStoreFor?: ((sessionId: string) => QueueStore | undefined) | undefined;
|
|
37
43
|
/**
|
|
38
44
|
* Called with the queue's display texts (head first) on EVERY queue change
|
|
39
45
|
* — enqueue, /queue delete, /queue clear, dequeue-for-delivery. The CLI
|
|
@@ -118,6 +124,12 @@ export interface RunTuiOptions {
|
|
|
118
124
|
* the version chip when this is true, so users notice without having
|
|
119
125
|
* to read the stderr notice. */
|
|
120
126
|
updateAvailable?: boolean | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* The standalone executable's background update: called with the version
|
|
129
|
+
* once it is downloaded, verified and waiting to be swapped in when this
|
|
130
|
+
* session exits. The status bar's version chip then says so.
|
|
131
|
+
*/
|
|
132
|
+
subscribeUpdateReady?: ((listener: (version: string) => void) => () => void) | undefined;
|
|
121
133
|
/** Snapshot of keyed providers + their model lists for the `/model` picker. Async — the catalog fetch may need to hit disk/network. */
|
|
122
134
|
getPickableProviders?: (() => Promise<import('./components/model-picker.js').ProviderOption[]>) | undefined;
|
|
123
135
|
/** Apply a (provider, model) pair after the picker confirms. Returns an error string on failure. */
|
|
@@ -126,10 +138,9 @@ export interface RunTuiOptions {
|
|
|
126
138
|
switchAutonomy?: ((mode: 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel') => string | null) | undefined;
|
|
127
139
|
/**
|
|
128
140
|
* Model-specific maxContext (tokens), resolved by the CLI via the
|
|
129
|
-
* ModelsRegistry. When omitted, the TUI falls back to the provider
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* context chip uses this for its progress denominator.
|
|
141
|
+
* ModelsRegistry. When omitted, the TUI falls back to the provider's
|
|
142
|
+
* reported window, which is 0 (unknown) until the catalog resolves one.
|
|
143
|
+
* The status bar's context chip uses this for its progress denominator.
|
|
133
144
|
*/
|
|
134
145
|
effectiveMaxContext?: number | undefined;
|
|
135
146
|
/** Absolute project root for goal.json loading. */
|
|
@@ -520,6 +531,14 @@ export interface RunTuiOptions {
|
|
|
520
531
|
* from the session store and returns ResumeSessionEntry-shaped data.
|
|
521
532
|
*/
|
|
522
533
|
listSessions?: ((limit?: number) => Promise<import('./app-state.js').ResumeSessionEntry[]>) | undefined;
|
|
534
|
+
/**
|
|
535
|
+
* Branch a session at a checkpoint (the conversation before that prompt)
|
|
536
|
+
* into a new session, leaving the original as it is. Returns the new id;
|
|
537
|
+
* the TUI then resumes it. The working tree is shared, not copied.
|
|
538
|
+
*/
|
|
539
|
+
forkSession?: ((sessionId: string, checkpointPromptIndex: number) => Promise<{
|
|
540
|
+
id: string;
|
|
541
|
+
}>) | undefined;
|
|
523
542
|
/**
|
|
524
543
|
* Resume a session by id: load JSONL events, replay history entries,
|
|
525
544
|
* rebuild agent context, and return hydrated entries for the TUI to
|
package/dist/scroll-anchor.d.ts
CHANGED
|
@@ -59,6 +59,12 @@ export declare function anchorAtTopRow(geometry: ScrollGeometry, topRow: number)
|
|
|
59
59
|
* bottom returns `null` (re-pin).
|
|
60
60
|
*/
|
|
61
61
|
export declare function scrollAnchorBy(geometry: ScrollGeometry, current: ScrollAnchor | null, deltaUp: number): ScrollAnchor | null;
|
|
62
|
+
/**
|
|
63
|
+
* Anchor that puts the start of render group `index` at the viewport top.
|
|
64
|
+
* Groups too close to the bottom to reach the top re-pin (`null`), which
|
|
65
|
+
* still shows them. Out-of-range indexes return `undefined` (no move).
|
|
66
|
+
*/
|
|
67
|
+
export declare function anchorForGroupIndex(geometry: ScrollGeometry, index: number): ScrollAnchor | null | undefined;
|
|
62
68
|
/** Anchor for the very top of the transcript (or `null` when it all fits). */
|
|
63
69
|
export declare function scrollAnchorToTop(geometry: ScrollGeometry): ScrollAnchor | null;
|
|
64
70
|
/** Rows moved by one PageUp/PageDown press. */
|
|
@@ -38,6 +38,7 @@ export type SettingsPickerPatch = Partial<{
|
|
|
38
38
|
featureMemory: boolean;
|
|
39
39
|
featureSkills: boolean;
|
|
40
40
|
featureModelsRegistry: boolean;
|
|
41
|
+
featureToolCoach: boolean;
|
|
41
42
|
tokenSavingTier: TokenSavingTierTui;
|
|
42
43
|
allowOutsideProjectRoot: boolean;
|
|
43
44
|
contextAutoCompact: boolean;
|
|
@@ -2,7 +2,7 @@ import { type InputBuilder } from '@wrongstack/core/agent';
|
|
|
2
2
|
import type { Director } from '@wrongstack/core/coordination';
|
|
3
3
|
import type { AttachmentStore, ContentBlock } from '@wrongstack/core/types';
|
|
4
4
|
import type { Action, State } from './app-reducer.js';
|
|
5
|
-
import { emptyMemoryContextMonitor } from './memory-context-monitor.js';
|
|
5
|
+
import type { emptyMemoryContextMonitor } from './memory-context-monitor.js';
|
|
6
6
|
import type { MutableCell } from './shared-types.js';
|
|
7
7
|
import { type TokenPreviewStore } from './token-previews.js';
|
|
8
8
|
import type { SubmitCapabilities } from './tui-host-capabilities.js';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare function submitSlashCommand({ trimmed, sessionGenerationRef, attachments, tokenPreviewsRef, isAutomaticBugHuntReplay, dispatch, pushSubmittedHistory, clearDraft, slashRegistry, agent, refreshGoalSummary, onBugHuntStarted, mouseMode, nativeMouse, setNativeMouse, setMouseMode, getSettings, saveSettings, liveModel, setLiveModel, liveProvider, setLiveProvider, activeMaxContext, setActiveMaxContext, getYolo, yoloLive, setYoloLive, getAutonomy, autonomyLive, setAutonomyLive, getEternalEngine, runEternalLoopRef, getParallelEngine, runParallelLoopRef, getModeLabel, liveModeLabel, setLiveModeLabel, getToolsItems, setLiveToolCount, exit, onExit, builderRef, waitForIdleSettle, stateRef, runBlocks, liveDirector, clearTerminal, onClearHistory, setMemoryContextMonitor, tokenCounter, enhanceAbortRef, enhanceCancelledRef, enhanceOriginalRef, nextStepsAutoSubmitTimerRef, autoSubmitStreakRef, autoSubmitCapWarnedRef, autoSubmitLoopGuardRef, onAfterClear, }: {
|
|
2
|
+
trimmed: string;
|
|
3
|
+
sessionGenerationRef: import('./shared-types.js').MutableCell<number>;
|
|
4
|
+
attachments: import('@wrongstack/core/types').AttachmentStore;
|
|
5
|
+
tokenPreviewsRef: import('./shared-types.js').MutableCell<import('./token-previews.js').TokenPreviewStore>;
|
|
6
|
+
isAutomaticBugHuntReplay: boolean;
|
|
7
|
+
dispatch: (action: import('./app-action-type.js').Action) => void;
|
|
8
|
+
pushSubmittedHistory: () => void;
|
|
9
|
+
clearDraft: () => void;
|
|
10
|
+
slashRegistry: import('@wrongstack/core/registry').SlashCommandRegistry;
|
|
11
|
+
agent: import('@wrongstack/core/agent').Agent;
|
|
12
|
+
refreshGoalSummary: () => void;
|
|
13
|
+
onBugHuntStarted: (command: string, totalRounds?: number | undefined) => void;
|
|
14
|
+
mouseMode: boolean;
|
|
15
|
+
nativeMouse: boolean;
|
|
16
|
+
setNativeMouse: (value: boolean) => void;
|
|
17
|
+
setMouseMode: (value: boolean) => void;
|
|
18
|
+
getSettings: (() => import('./app-settings-type.js').Settings) | undefined;
|
|
19
|
+
saveSettings: ((settings: import('./app-settings-type.js').Settings) => string | Promise<string | null> | null) | undefined;
|
|
20
|
+
liveModel: string;
|
|
21
|
+
setLiveModel: (value: string) => void;
|
|
22
|
+
liveProvider: string;
|
|
23
|
+
setLiveProvider: (value: string) => void;
|
|
24
|
+
activeMaxContext: number | undefined;
|
|
25
|
+
setActiveMaxContext: (value: number) => void;
|
|
26
|
+
getYolo: (() => boolean) | undefined;
|
|
27
|
+
yoloLive: boolean;
|
|
28
|
+
setYoloLive: (value: boolean) => void;
|
|
29
|
+
getAutonomy: (() => 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel') | undefined;
|
|
30
|
+
autonomyLive: 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel';
|
|
31
|
+
setAutonomyLive: (value: 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel') => void;
|
|
32
|
+
getEternalEngine: (() => unknown) | undefined;
|
|
33
|
+
runEternalLoopRef: import('./shared-types.js').MutableCell<() => Promise<void>>;
|
|
34
|
+
getParallelEngine: (() => unknown) | undefined;
|
|
35
|
+
runParallelLoopRef: import('./shared-types.js').MutableCell<() => Promise<void>>;
|
|
36
|
+
getModeLabel: (() => string) | undefined;
|
|
37
|
+
liveModeLabel: string | undefined;
|
|
38
|
+
setLiveModeLabel: (value: string) => void;
|
|
39
|
+
getToolsItems: (() => {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
}[]) | undefined;
|
|
42
|
+
setLiveToolCount: (value: number) => void;
|
|
43
|
+
exit: () => void;
|
|
44
|
+
onExit: (code: number) => void;
|
|
45
|
+
builderRef: import('./shared-types.js').MutableCell<import('@wrongstack/core/agent').InputBuilder | null>;
|
|
46
|
+
waitForIdleSettle: (isIdle: () => boolean, deadlineMs: number, opts?: {
|
|
47
|
+
maxPollMs?: number;
|
|
48
|
+
}) => Promise<boolean>;
|
|
49
|
+
stateRef: import('./shared-types.js').MutableCell<import('./app-state.js').State>;
|
|
50
|
+
runBlocks: (blocks: import('@wrongstack/core/types').ContentBlock[]) => Promise<void>;
|
|
51
|
+
liveDirector: () => import('@wrongstack/core/coordination').Director | null;
|
|
52
|
+
clearTerminal: (() => void) | undefined;
|
|
53
|
+
onClearHistory: import('./tui-host-capabilities.js').SubmitCapabilities['onClearHistory'];
|
|
54
|
+
setMemoryContextMonitor: (value: import('./memory-context-monitor.js').MemoryContextMonitorState) => void;
|
|
55
|
+
tokenCounter: import('@wrongstack/core/types').TokenCounter | undefined;
|
|
56
|
+
enhanceAbortRef: import('./shared-types.js').MutableCell<AbortController | null>;
|
|
57
|
+
enhanceCancelledRef: import('./shared-types.js').MutableCell<boolean>;
|
|
58
|
+
enhanceOriginalRef: import('./shared-types.js').MutableCell<string>;
|
|
59
|
+
nextStepsAutoSubmitTimerRef: import('./shared-types.js').MutableCell<NodeJS.Timeout | undefined>;
|
|
60
|
+
autoSubmitStreakRef: import('./shared-types.js').MutableCell<number>;
|
|
61
|
+
autoSubmitCapWarnedRef: import('./shared-types.js').MutableCell<boolean>;
|
|
62
|
+
autoSubmitLoopGuardRef: import('./shared-types.js').MutableCell<{
|
|
63
|
+
reset(): void;
|
|
64
|
+
}>;
|
|
65
|
+
onAfterClear: (() => void) | undefined;
|
|
66
|
+
}): Promise<void>;
|
|
67
|
+
//# sourceMappingURL=submit-slash-command.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure selection/windowing logic behind the `/theme` picker.
|
|
3
|
+
*
|
|
4
|
+
* The picker used to window a flat list of 64 rows. Three additions made that
|
|
5
|
+
* arithmetic wrong on its own:
|
|
6
|
+
*
|
|
7
|
+
* - **Filtering.** Type-to-filter narrows the list, so the focused index is
|
|
8
|
+
* an index into the FILTERED list, not the full catalogue.
|
|
9
|
+
* - **Family grouping.** Headers are real rows now, and they differ in cost
|
|
10
|
+
* from option rows — a uniform `rowSpan` can no longer describe the list.
|
|
11
|
+
* - **The row budget.** `maxRows` is a hard contract the existing tests
|
|
12
|
+
* assert; adding header rows must not silently overflow it.
|
|
13
|
+
*
|
|
14
|
+
* So the picker now operates on a *row model* (headers + options interleaved)
|
|
15
|
+
* and windows over rows rather than over option indices. Everything here is a
|
|
16
|
+
* pure function of its arguments — no React, no Ink, no `useTerminalSize` — so
|
|
17
|
+
* the budget and windowing rules are unit-testable without rendering a frame.
|
|
18
|
+
*/
|
|
19
|
+
import type { ThemePickerOption } from './theme-types.js';
|
|
20
|
+
/** One rendered line: either a family header or a selectable preset row. */
|
|
21
|
+
export type ThemeRow = {
|
|
22
|
+
kind: 'header';
|
|
23
|
+
family: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'option';
|
|
26
|
+
option: ThemePickerOption;
|
|
27
|
+
index: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Narrow presets by a free-text query, matching name, id, and description.
|
|
31
|
+
*
|
|
32
|
+
* An empty or whitespace-only query returns the input unchanged so the common
|
|
33
|
+
* "filter cleared" case is free and the caller keeps a stable array identity.
|
|
34
|
+
* Matching is case-insensitive and substring-based; every whitespace-separated
|
|
35
|
+
* term must match somewhere (AND), so `tokyo storm` narrows to the Storm
|
|
36
|
+
* variant rather than the union of both words.
|
|
37
|
+
*/
|
|
38
|
+
export declare function filterThemeOptions(options: readonly ThemePickerOption[], query: string): readonly ThemePickerOption[];
|
|
39
|
+
/**
|
|
40
|
+
* Interleave family headers with option rows.
|
|
41
|
+
*
|
|
42
|
+
* A header is emitted before the first row of each family, so contiguous
|
|
43
|
+
* same-family presets share one header. `index` is each option's position in
|
|
44
|
+
* the *filtered* list, which is what `selected` refers to.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildThemeRows(options: readonly ThemePickerOption[]): ThemeRow[];
|
|
47
|
+
export interface ThemeWindow {
|
|
48
|
+
/** Rows to render, header rows included. */
|
|
49
|
+
rows: ThemeRow[];
|
|
50
|
+
hasAbove: boolean;
|
|
51
|
+
hasBelow: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Window the row model so it fits `budget` terminal rows.
|
|
55
|
+
*
|
|
56
|
+
* `budget` is the number of rows available for headers + options combined
|
|
57
|
+
* (the caller subtracts its own chrome). Two rules the flat list did not need:
|
|
58
|
+
*
|
|
59
|
+
* - A family header is pulled in whenever its first option is in the window,
|
|
60
|
+
* even if that header sits above the window's nominal start — otherwise the
|
|
61
|
+
* top visible option would appear to belong to the family above it.
|
|
62
|
+
* - Expansion alternates downward first, then upward, so a long family does
|
|
63
|
+
* not push every visible row below the focused one off the screen.
|
|
64
|
+
*
|
|
65
|
+
* The focused row is always included, even when `budget` is smaller than the
|
|
66
|
+
* two rows a focused option plus its header need — the caller's own
|
|
67
|
+
* lower-bound guarantee wins over a strict budget.
|
|
68
|
+
*/
|
|
69
|
+
export declare function windowThemeRows(rows: readonly ThemeRow[], selected: number, budget: number): ThemeWindow;
|
|
70
|
+
//# sourceMappingURL=theme-picker-rows.d.ts.map
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import type { ThemePickerOption } from '../theme-types.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Picker rows in canonical {@link THEME_PRESET_IDS} order.
|
|
4
|
+
*
|
|
5
|
+
* Name/description/family are NOT written here: they come from
|
|
6
|
+
* `THEME_PRESET_META` in `@wrongstack/core/types`, the single table the CLI
|
|
7
|
+
* `/theme` command reads too. This file used to hand-write a 64-row literal
|
|
8
|
+
* that duplicated the CLI's own table, so a reworded or renamed preset could
|
|
9
|
+
* drift between the two pickers with nothing failing to compile — only the
|
|
10
|
+
* id set was ever linked.
|
|
11
|
+
*
|
|
12
|
+
* Deriving from the shared record also means the family grouping the picker
|
|
13
|
+
* renders and the CLI's list are guaranteed to describe the same presets.
|
|
14
|
+
*/
|
|
3
15
|
export declare const THEME_OPTIONS: readonly ThemePickerOption[];
|
|
4
16
|
//# sourceMappingURL=options.d.ts.map
|
package/dist/theme-types.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ export interface ThemePickerOption {
|
|
|
6
6
|
id: ThemeName;
|
|
7
7
|
name: string;
|
|
8
8
|
description: string;
|
|
9
|
+
/**
|
|
10
|
+
* Palette family (Catppuccin, Tokyo Night, Gruvbox, …) used to group
|
|
11
|
+
* related rows in the picker. Sourced from `THEME_PRESET_META` in
|
|
12
|
+
* `@wrongstack/core/types`, the same table the CLI reads.
|
|
13
|
+
*/
|
|
14
|
+
family: string;
|
|
9
15
|
}
|
|
10
16
|
export interface Theme {
|
|
11
17
|
textPrimary: string;
|