@kolisachint/hoocode-agent 0.5.31 → 0.5.32
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/CHANGELOG.md +131 -0
- package/dist/core/agent-session-runtime.d.ts +28 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +61 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/keybindings.d.ts +102 -30
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +123 -29
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -3
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +19 -8
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-types.d.ts +1 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +5 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tool-output-view.d.ts +33 -0
- package/dist/core/tool-output-view.d.ts.map +1 -0
- package/dist/core/tool-output-view.js +31 -0
- package/dist/core/tool-output-view.js.map +1 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/modes/interactive/command-executor.d.ts +20 -0
- package/dist/modes/interactive/command-executor.d.ts.map +1 -1
- package/dist/modes/interactive/command-executor.js +138 -9
- package/dist/modes/interactive/command-executor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +31 -2
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -2
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +2 -2
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +2 -2
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +13 -12
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-chain-summary.d.ts +65 -0
- package/dist/modes/interactive/components/tool-chain-summary.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-chain-summary.js +216 -0
- package/dist/modes/interactive/components/tool-chain-summary.js.map +1 -0
- package/dist/modes/interactive/components/tool-chain.d.ts +61 -0
- package/dist/modes/interactive/components/tool-chain.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-chain.js +156 -0
- package/dist/modes/interactive/components/tool-chain.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +55 -9
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +173 -33
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-signal.d.ts +50 -0
- package/dist/modes/interactive/components/tool-signal.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-signal.js +151 -0
- package/dist/modes/interactive/components/tool-signal.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +50 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +239 -29
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/resource-display.d.ts +9 -0
- package/dist/modes/interactive/resource-display.d.ts.map +1 -1
- package/dist/modes/interactive/resource-display.js +13 -0
- package/dist/modes/interactive/resource-display.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/settings-selector.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,SAAS,EACT,eAAe,EACf,KAAK,EAEL,UAAU,EAGV,YAAY,EACZ,MAAM,EACN,IAAI,GACJ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,mCAAmC,GAA4B;IACpE,qBAAqB,EAAE,EAAE;IACzB,qBAAqB,EAAE,EAAE;CACzB,CAAC;AAEF,MAAM,qBAAqB,GAAkC;IAC5D,GAAG,EAAE,cAAc;IACnB,OAAO,EAAE,mCAAmC;IAC5C,GAAG,EAAE,8BAA8B;IACnC,MAAM,EAAE,iCAAiC;IACzC,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,iCAAiC;CACxC,CAAC;AA0IF;;;;;GAKG;AACH,MAAM,cAAc,GAKf;IACJ;QACC,GAAG,EAAE,kBAAkB;QACvB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,+FAA+F;QAC5G,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;KAC9B;IACD;QACC,GAAG,E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AAI,YAAY,CACnC,QAAQ,EACR,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,EAC7B,oBAAoB,EAAE,EACtB,WAAW,EACX,SAAS,CAAC,QAAQ,EAClB;YACC,YAAY,EAAE,IAAI;SAClB,CACD,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACjC,IAAI,cAAc,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;IAAA,CACnC;IAED,mFAAmF;IAC3E,mBAAmB,GAAS;QACnC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,mBAAmB;YAAE,OAAO;QAC3D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAAA,CACxE;IAED,eAAe,GAAiB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC;IAAA,CACzB;CACD","sourcesContent":["import type { ThinkingLevel } from \"@kolisachint/hoocode-agent-core\";\nimport type { Transport } from \"@kolisachint/hoocode-ai\";\nimport {\n\tContainer,\n\tgetCapabilities,\n\tInput,\n\ttype SelectItem,\n\tSelectList,\n\ttype SelectListLayoutOptions,\n\ttype SettingItem,\n\tSettingsList,\n\tSpacer,\n\tText,\n} from \"@kolisachint/hoocode-tui\";\nimport type { MarketplacePlatform } from \"../../../core/extensions/plugins/formats/types.js\";\nimport type { ExternalToolStatus } from \"../../../core/external-tools.js\";\nimport { buildRowGates, statusLabel } from \"../../../core/external-tools.js\";\nimport type { PromptSurface } from \"../../../core/light.js\";\nimport type { LearnSettingKey, WarningSettings } from \"../../../core/settings-manager.js\";\nimport { getSelectListTheme, getSettingsListTheme, getThemeDescription, theme } from \"../theme/theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { keyDisplayText } from \"./keybinding-hints.js\";\n\nconst SETTINGS_SUBMENU_SELECT_LIST_LAYOUT: SelectListLayoutOptions = {\n\tminPrimaryColumnWidth: 12,\n\tmaxPrimaryColumnWidth: 32,\n};\n\nconst THINKING_DESCRIPTIONS: Record<ThinkingLevel, string> = {\n\toff: \"No reasoning\",\n\tminimal: \"Very brief reasoning (~1k tokens)\",\n\tlow: \"Light reasoning (~2k tokens)\",\n\tmedium: \"Moderate reasoning (~8k tokens)\",\n\thigh: \"Deep reasoning (~16k tokens)\",\n\txhigh: \"Maximum reasoning (~32k tokens)\",\n};\n\ninterface ToolToggleInfo {\n\t/** Tool name (e.g. \"read\", \"bash\"). */\n\tname: string;\n\t/** Whether the tool is currently enabled (not in the persisted disabled set). */\n\tenabled: boolean;\n\t/**\n\t * What this tool's serialized schema costs on every request. Priced whether or\n\t * not it is on: for a tool that is off, this is what turning it on will cost.\n\t * Undefined for a tool that was disabled before launch, whose schema this\n\t * session never built.\n\t */\n\ttokens?: number;\n}\n\ninterface FlagInfo {\n\t/** Flag name (without the leading --). */\n\tname: string;\n\tdescription?: string;\n\ttype: \"boolean\" | \"string\";\n\t/** Current effective value. */\n\tvalue: boolean | string;\n}\n\ninterface ToolGroupInfo {\n\t/** Group identifier (e.g. \"web\", \"embsearch\"). */\n\tid: string;\n\tlabel: string;\n\tdescription: string;\n\t/** Whether the group is currently enabled (its tools are available). */\n\tenabled: boolean;\n}\n\nexport interface SettingsConfig {\n\tautoCompact: boolean;\n\ttools: ToolToggleInfo[];\n\ttoolGroups: ToolGroupInfo[];\n\t/**\n\t * The external Rust binaries and whether each one is present. Rendered as\n\t * its own top-level category, and used to annotate the rows that are gated\n\t * on a binary that is not installed.\n\t */\n\texternalTools: ExternalToolStatus[];\n\tflags: FlagInfo[];\n\ttoolOutputDisplay: \"collapsed\" | \"peek\" | \"standard\";\n\ttoolOutputMaxBytes: number;\n\ttoolOutputMaxLines: number;\n\tcontextGc: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tautoResizeImages: boolean;\n\tblockImages: boolean;\n\tenableSkillCommands: boolean;\n\tlight: boolean;\n\tpluginInstallScope: \"user\" | \"project\";\n\tenablePluginTools: boolean;\n\t/**\n\t * settings.json keys the project file sets. A pane row writes user scope, so\n\t * anything listed here wins again on the next session however the row is set.\n\t */\n\tprojectPinnedSettings: string[];\n\t/** Platform layouts in force this session (empty = unset, per-consumer defaults apply). */\n\tplatform: MarketplacePlatform[];\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\ttransport: Transport;\n\tthinkingLevel: ThinkingLevel;\n\tavailableThinkingLevels: ThinkingLevel[];\n\tcurrentTheme: string;\n\tavailableThemes: string[];\n\thideThinkingBlock: boolean;\n\tcollapseChangelog: boolean;\n\tenableInstallTelemetry: boolean;\n\tdoubleEscapeAction: \"fork\" | \"tree\" | \"none\";\n\ttreeFilterMode: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\";\n\tshowHardwareCursor: boolean;\n\teditorBorder: \"rule\" | \"box\";\n\teditorPaddingX: number;\n\tautocompleteMaxVisible: number;\n\tquietStartup: boolean;\n\tclearOnShrink: boolean;\n\tshowTerminalProgress: boolean;\n\twarnings: WarningSettings;\n\tvoiceSilenceMs: number;\n\twebtoolsTimeoutSecs: number;\n\tlearn: Record<LearnSettingKey, number>;\n\t/**\n\t * Re-measure the fixed per-turn surface (system prompt + active tool schemas).\n\t * Called on open and after every change, so a toggle that costs tokens shows\n\t * what it cost. Omitted by callers that have no session to measure.\n\t */\n\tmeasureTokenSurface?: () => PromptSurface;\n}\n\nexport interface SettingsCallbacks {\n\tonAutoCompactChange: (enabled: boolean) => void;\n\tonToolEnabledChange: (name: string, enabled: boolean) => void;\n\tonToolGroupChange: (id: string, enabled: boolean) => void;\n\tonToolOutputDisplayChange: (level: \"collapsed\" | \"peek\" | \"standard\") => void;\n\tonToolOutputMaxBytesChange: (bytes: number) => void;\n\tonToolOutputMaxLinesChange: (lines: number) => void;\n\tonContextGcChange: (enabled: boolean) => void;\n\tonFlagChange: (name: string, value: boolean | string) => void;\n\tonShowImagesChange: (enabled: boolean) => void;\n\tonImageWidthCellsChange: (width: number) => void;\n\tonAutoResizeImagesChange: (enabled: boolean) => void;\n\tonBlockImagesChange: (blocked: boolean) => void;\n\tonEnableSkillCommandsChange: (enabled: boolean) => void;\n\tonLightChange: (enabled: boolean) => void;\n\tonPluginInstallScopeChange: (scope: \"user\" | \"project\") => void;\n\tonEnablePluginToolsChange: (enabled: boolean) => void;\n\tonPlatformChange: (platforms: MarketplacePlatform[]) => void;\n\tonSteeringModeChange: (mode: \"all\" | \"one-at-a-time\") => void;\n\tonFollowUpModeChange: (mode: \"all\" | \"one-at-a-time\") => void;\n\tonTransportChange: (transport: Transport) => void;\n\tonThinkingLevelChange: (level: ThinkingLevel) => void;\n\tonThemeChange: (theme: string) => void;\n\tonThemePreview?: (theme: string) => void;\n\tonHideThinkingBlockChange: (hidden: boolean) => void;\n\tonCollapseChangelogChange: (collapsed: boolean) => void;\n\tonEnableInstallTelemetryChange: (enabled: boolean) => void;\n\tonDoubleEscapeActionChange: (action: \"fork\" | \"tree\" | \"none\") => void;\n\tonTreeFilterModeChange: (mode: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\") => void;\n\tonShowHardwareCursorChange: (enabled: boolean) => void;\n\tonEditorBorderChange: (border: \"rule\" | \"box\") => void;\n\tonEditorPaddingXChange: (padding: number) => void;\n\tonAutocompleteMaxVisibleChange: (maxVisible: number) => void;\n\tonQuietStartupChange: (enabled: boolean) => void;\n\tonClearOnShrinkChange: (enabled: boolean) => void;\n\tonShowTerminalProgressChange: (enabled: boolean) => void;\n\tonWarningsChange: (warnings: WarningSettings) => void;\n\tonVoiceSilenceMsChange: (ms: number) => void;\n\tonWebtoolsTimeoutSecsChange: (secs: number) => void;\n\tonLearnSettingChange: (key: LearnSettingKey, value: number) => void;\n\tonCancel: () => void;\n}\n\n/**\n * The `/learn` thresholds as pane rows: the presets to cycle through, and what\n * each one buys. Kept as a table because all five are the same shape — a\n * positive integer with a handful of sensible values — and the pane, the change\n * handler and the category row all read from it rather than repeating the list.\n */\nconst LEARN_SETTINGS: ReadonlyArray<{\n\tkey: LearnSettingKey;\n\tlabel: string;\n\tdescription: string;\n\tpresets: number[];\n}> = [\n\t{\n\t\tkey: \"learnMaxSessions\",\n\t\tlabel: \"Sessions scanned\",\n\t\tdescription: \"How many recent sessions in this directory /learn mines. Raise it on a repo you touch rarely.\",\n\t\tpresets: [10, 20, 30, 50, 100],\n\t},\n\t{\n\t\tkey: \"learnMaxAgeDays\",\n\t\tlabel: \"Session age limit\",\n\t\tdescription: \"Ignore sessions older than this many days. A pattern that stopped is not a rule.\",\n\t\tpresets: [7, 14, 30, 60, 90, 180],\n\t},\n\t{\n\t\tkey: \"learnMinRepeats\",\n\t\tlabel: \"Directive repeats\",\n\t\tdescription:\n\t\t\t\"Times a directive must recur before it is proposed. The signal/noise dial: raise it for fewer, better-evidenced proposals.\",\n\t\tpresets: [2, 3, 4, 5],\n\t},\n\t{\n\t\tkey: \"learnMinRequestRepeats\",\n\t\tlabel: \"Workflow repeats\",\n\t\tdescription: \"Non-overlapping repeats a tool sequence needs before it is proposed as a skill.\",\n\t\tpresets: [2, 3, 4, 5, 6],\n\t},\n\t{\n\t\tkey: \"learnMaxProposals\",\n\t\tlabel: \"Max proposals\",\n\t\tdescription: \"Cap on each list in the digest. Every proposal costs the model context.\",\n\t\tpresets: [3, 5, 8, 12, 20],\n\t},\n];\n\nconst LEARN_KEYS: ReadonlySet<string> = new Set(LEARN_SETTINGS.map((setting) => setting.key));\n\n/**\n * Preset list for a numeric row, guaranteed to contain the value in force.\n *\n * Without this a value set by hand in settings.json — say 45 days — is absent\n * from the cycle, so the first keypress silently snaps it to the first preset,\n * discarding a deliberate choice the pane never showed as unusual. Every numeric\n * cycle row goes through this for that reason.\n */\nfunction presetValues(presets: number[], current: number): string[] {\n\tconst all = presets.includes(current) ? presets : [...presets, current].sort((a, b) => a - b);\n\treturn all.map(String);\n}\n\n/**\n * A submenu component for selecting from a list of options.\n */\nclass WarningSettingsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate state: WarningSettings;\n\n\tconstructor(warnings: WarningSettings, onChange: (warnings: WarningSettings) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tthis.state = { ...warnings };\n\n\t\tconst items: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"anthropic-extra-usage\",\n\t\t\t\tlabel: \"Anthropic extra usage\",\n\t\t\t\tdescription: \"Warn when Anthropic subscription auth may use paid extra usage\",\n\t\t\t\tcurrentValue: (this.state.anthropicExtraUsage ?? true) ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tswitch (id) {\n\t\t\t\t\tcase \"anthropic-extra-usage\":\n\t\t\t\t\t\tthis.state = { ...this.state, anthropicExtraUsage: newValue === \"true\" };\n\t\t\t\t\t\tonChange({ ...this.state });\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCancel,\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * The artifact platform targets, in the order the pane shows them. Each row is an\n * independent on/off toggle because `--platform` (and the `platform` setting it\n * mirrors) takes a list: emitting for two platforms at once is a supported shape.\n * The tokens here are the canonical ones — the CLI aliases (`copilot`, `gh`,\n * `native`) fold into these before anything reads them.\n */\nconst PLATFORM_ROWS: ReadonlyArray<{\n\tplatform: MarketplacePlatform;\n\tlabel: string;\n\tdescription: string;\n}> = [\n\t{\n\t\tplatform: \"claude\",\n\t\tlabel: \"claude\",\n\t\tdescription:\n\t\t\t\"Claude Code layout: .claude/ scaffolds, and authored plugins drop into ~/.claude/skills/<id>/. The default when nothing is set.\",\n\t},\n\t{\n\t\tplatform: \"github\",\n\t\tlabel: \"github (copilot, gh)\",\n\t\tdescription:\n\t\t\t\"Copilot layout: .github/ scaffolds, and authored plugins are produced under ~/.agents/publish/github/<id>/.\",\n\t},\n\t{\n\t\tplatform: \"agents\",\n\t\tlabel: \"agents (native)\",\n\t\tdescription:\n\t\t\t\"Cross-vendor .agents/ layout. Scaffolds only - a plugin belongs to no marketplace in this layout, so plugin authoring ignores it.\",\n\t},\n];\n\n/** Row value for the platform setting: the selection, or the fallback when it is empty. */\nfunction platformSummary(platforms: readonly MarketplacePlatform[]): string {\n\treturn platforms.length > 0 ? platforms.join(\", \") : \"default (claude)\";\n}\n\n/**\n * Submenu for the session's artifact platform targets (the `platform` setting,\n * same knob as `--platform`).\n *\n * A list rather than a cycle: the setting is a list, and the three tokens are not\n * mutually exclusive. Turning everything off is legal and means \"unset\" — the\n * per-consumer defaults come back (claude for plugins, .hoocode/ for scaffolds).\n */\nclass PlatformSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate selected: Set<MarketplacePlatform>;\n\n\tconstructor(\n\t\tplatforms: readonly MarketplacePlatform[],\n\t\tonChange: (platforms: MarketplacePlatform[]) => void,\n\t\tonDone: (summary: string) => void,\n\t) {\n\t\tsuper();\n\n\t\tthis.selected = new Set(platforms);\n\n\t\tconst items: SettingItem[] = PLATFORM_ROWS.map(({ platform, label, description }) => ({\n\t\t\tid: platform,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\tcurrentValue: this.selected.has(platform) ? \"on\" : \"off\",\n\t\t\tvalues: [\"on\", \"off\"],\n\t\t}));\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tconst platform = id as MarketplacePlatform;\n\t\t\t\tif (newValue === \"on\") this.selected.add(platform);\n\t\t\t\telse this.selected.delete(platform);\n\t\t\t\tonChange(this.ordered());\n\t\t\t},\n\t\t\t() => onDone(platformSummary(this.ordered())),\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\t/** Selection in the pane's order, so the persisted list does not depend on click order. */\n\tprivate ordered(): MarketplacePlatform[] {\n\t\treturn PLATFORM_ROWS.map((row) => row.platform).filter((platform) => this.selected.has(platform));\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * Trailing sentence for a row whose setting is inert until an external binary\n * shows up. The row is annotated rather than hidden: the binaries were invisible\n * precisely because nothing ever mentioned them, and a row that disappears when\n * its dependency is missing teaches the user nothing at all.\n */\nfunction gateNote(gate: ExternalToolStatus | undefined): string {\n\tif (!gate || gate.installed) return \"\";\n\treturn gate.downloadable\n\t\t? ` Needs the ${gate.tool} binary, which hoocode fetches the first time this is used. Until then: ${gate.fallback}`\n\t\t: ` Needs the ${gate.tool} binary, and this environment will not fetch it. Until then: ${gate.fallback}`;\n}\n\n/** \"3 of 5 installed\" - the one number that says whether this category needs attention. */\nfunction externalCount(statuses: readonly ExternalToolStatus[]): string {\n\tconst installed = statuses.filter((status) => status.installed).length;\n\treturn `${installed} of ${statuses.length} installed`;\n}\n\n/** The capability words, so the category row says what the binaries are for. */\nfunction externalSummary(statuses: readonly ExternalToolStatus[]): string {\n\treturn statuses.map((status) => status.tool).join(\", \");\n}\n\n/** Value-column marker for a gated row, so the list shows it without selecting. */\nfunction gateSuffix(gate: ExternalToolStatus | undefined): string | undefined {\n\tif (!gate || gate.installed) return undefined;\n\treturn `needs ${gate.tool}`;\n}\n\n/**\n * Submenu for tool availability. The first rows are group switches (web,\n * semantic search) that decide whether a group's tools\n * exist at all — this is the same master switch that governs, e.g., the\n * webfetch/websearch tools. Below them are per-tool on/off toggles for the\n * tools that are currently available.\n *\n * Group switches change tool availability and apply on the next session;\n * per-tool toggles apply live and persist. A minimum core (read/bash/edit/\n * write) is guarded so the agent can never be left with no way to act.\n */\nclass ToolsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate enabled: Map<string, boolean>;\n\tprivate static readonly CORE = new Set([\"read\", \"bash\", \"edit\", \"write\"]);\n\tprivate static readonly GROUP_PREFIX = \"group:\";\n\n\tconstructor(\n\t\ttools: ToolToggleInfo[],\n\t\tgroups: ToolGroupInfo[],\n\t\t/** Rows gated on an external binary, keyed by row id. See buildRowGates. */\n\t\tgates: ReadonlyMap<string, ExternalToolStatus>,\n\t\tonChange: (name: string, enabled: boolean) => void,\n\t\tonGroupChange: (id: string, enabled: boolean) => void,\n\t\tonCancel: () => void,\n\t) {\n\t\tsuper();\n\n\t\tthis.enabled = new Map(tools.map((t) => [t.name, t.enabled]));\n\n\t\tconst groupItems: SettingItem[] = groups.map((group) => {\n\t\t\tconst id = `${ToolsSubmenu.GROUP_PREFIX}${group.id}`;\n\t\t\tconst gate = gates.get(id);\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel: `[group] ${group.label}`,\n\t\t\t\tdescription: `${group.description} Governs whether these tools exist; applies on the next session.${gateNote(gate)}`,\n\t\t\t\tcurrentValue: group.enabled ? \"on\" : \"off\",\n\t\t\t\t// The switch stays settable with the binary missing: the setting is\n\t\t\t\t// what makes hoocode fetch it, so refusing the toggle would make the\n\t\t\t\t// group unreachable forever.\n\t\t\t\tvalueSuffix: gateSuffix(gate),\n\t\t\t\tvalues: [\"on\", \"off\"],\n\t\t\t};\n\t\t});\n\n\t\tconst toolItems: SettingItem[] = tools.map((tool) => ({\n\t\t\tid: tool.name,\n\t\t\tlabel: tool.name,\n\t\t\tdescription: ToolsSubmenu.CORE.has(tool.name)\n\t\t\t\t? \"Core tool. Disabling leaves the agent unable to perform this action in every session.\"\n\t\t\t\t: \"Disable to remove this tool from the agent this session and every future session.\",\n\t\t\tcurrentValue: tool.enabled ? \"on\" : \"off\",\n\t\t\t// What the schema costs on every request, whether the tool is on or off:\n\t\t\t// off, it is the price of turning it back on. This is the number that\n\t\t\t// makes a tool worth disabling, so it belongs beside the switch.\n\t\t\tvalueSuffix: tool.tokens !== undefined ? `${tokenCount(tool.tokens)} tok/turn` : undefined,\n\t\t\tvalues: [\"on\", \"off\"],\n\t\t}));\n\n\t\tconst items = [...groupItems, ...toolItems];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 12),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tconst wantEnabled = newValue === \"on\";\n\t\t\t\tif (id.startsWith(ToolsSubmenu.GROUP_PREFIX)) {\n\t\t\t\t\tonGroupChange(id.slice(ToolsSubmenu.GROUP_PREFIX.length), wantEnabled);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Guard: never let the last core tool be turned off.\n\t\t\t\tif (!wantEnabled && ToolsSubmenu.CORE.has(id)) {\n\t\t\t\t\tconst remainingCore = [...ToolsSubmenu.CORE].filter((n) => n !== id && this.enabled.get(n));\n\t\t\t\t\tif (remainingCore.length === 0) {\n\t\t\t\t\t\tthis.settingsList.updateValue(id, \"on\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.enabled.set(id, wantEnabled);\n\t\t\t\tonChange(id, wantEnabled);\n\t\t\t},\n\t\t\tonCancel,\n\t\t\t{ enableSearch: true },\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * Read-only detail for one external binary: what it is, whether it is here, what\n * it turns on, and what hoocode does without it.\n *\n * A submenu rather than a long `description` because the useful answer is five\n * or six lines and the pane shows descriptions on one. Nothing here is settable\n * - the binary is either on the machine or it is not - so the rows carry no\n * `values` and Enter does nothing but close.\n */\nclass ExternalToolDetailSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(status: ExternalToolStatus, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst acquisition =\n\t\t\tstatus.acquisition === \"startup\"\n\t\t\t\t? \"Downloaded in the background at startup.\"\n\t\t\t\t: status.acquisition === \"on-demand\"\n\t\t\t\t\t? \"Downloaded the first time the feature is used.\"\n\t\t\t\t\t: \"Never downloaded automatically; install it yourself.\";\n\n\t\tconst location = status.installed\n\t\t\t? status.source === \"path\"\n\t\t\t\t? `found on PATH as \\`${status.path}\\``\n\t\t\t\t: status.source === \"override\"\n\t\t\t\t\t? `${status.overrideEnv} points at ${status.path}`\n\t\t\t\t\t: `hoocode's own copy at ${status.path}`\n\t\t\t: status.downloadable\n\t\t\t\t? `${acquisition} Not on this machine yet.`\n\t\t\t\t: \"Not installed, and this environment will not download it (offline mode, or no published build for this platform).\";\n\n\t\tconst rows: ReadonlyArray<[label: string, value: string, description: string]> = [\n\t\t\t[\"Status\", statusLabel(status), location],\n\t\t\t[\n\t\t\t\t\"Enables\",\n\t\t\t\t`${status.enables.length} feature${status.enables.length === 1 ? \"\" : \"s\"}`,\n\t\t\t\tstatus.enables.join(\"; \"),\n\t\t\t],\n\t\t\t[\"Without it\", \"fallback\", status.fallback],\n\t\t\t[\"Source\", status.repo || \"-\", `Release archives come from github.com/${status.repo}. ${acquisition}`],\n\t\t\t[\"Env\", String(status.env.length), status.env.join(\" | \")],\n\t\t];\n\n\t\tconst items: SettingItem[] = rows.map(([label, value, description], index) => ({\n\t\t\tid: `detail-${index}`,\n\t\t\tlabel,\n\t\t\tcurrentValue: value,\n\t\t\tdescription,\n\t\t}));\n\n\t\tthis.settingsList = new SettingsList(items, items.length, getSettingsListTheme(), () => {}, onCancel);\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * The external-binary category: one row per managed Rust binary.\n *\n * These binaries were entirely invisible before this pane existed. hoocode works\n * without every one of them, which is the whole reason nobody found them: search\n * silently got slower, semantic ranking silently never happened, and web/voice\n * were simply features nobody knew were there. The row states presence; the\n * submenu states what presence buys.\n */\nclass ExternalToolsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(statuses: ExternalToolStatus[], onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SettingItem[] = statuses.map((status) => ({\n\t\t\tid: `ext-${status.tool}`,\n\t\t\tlabel: status.label,\n\t\t\tdescription: `${status.summary} Without it: ${status.fallback}`,\n\t\t\tcurrentValue: statusLabel(status),\n\t\t\t// The value column says whether it is here; the suffix says what it is\n\t\t\t// for, so the list reads without opening every row.\n\t\t\tvalueSuffix: status.installed ? undefined : status.downloadable ? \"auto-fetch\" : \"manual\",\n\t\t\tkeywords: [status.tool, status.repo, ...status.settingsKeys, ...status.enables].join(\" \"),\n\t\t\tsubmenu: (_currentValue, done) => new ExternalToolDetailSubmenu(status, () => done()),\n\t\t}));\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t() => {},\n\t\t\tonCancel,\n\t\t\t{ enableSearch: true },\n\t\t);\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/** Byte-cap presets shown as human labels; mapped back to raw byte counts. */\nconst TOOL_OUTPUT_BYTE_PRESETS: ReadonlyArray<[label: string, bytes: number]> = [\n\t[\"8 KB\", 8 * 1024],\n\t[\"16 KB\", 16 * 1024],\n\t[\"32 KB\", 32 * 1024],\n\t[\"64 KB\", 64 * 1024],\n\t[\"128 KB\", 128 * 1024],\n];\n\nfunction bytesToLabel(bytes: number): string {\n\tconst match = TOOL_OUTPUT_BYTE_PRESETS.find(([, b]) => b === bytes);\n\treturn match ? match[0] : `${Math.round(bytes / 1024)} KB`;\n}\n\n/** Byte-cap labels to cycle through, including a hand-set cap that matches no preset. */\nfunction byteLabels(current: number): string[] {\n\tconst all: Array<[string, number]> = TOOL_OUTPUT_BYTE_PRESETS.some(([, bytes]) => bytes === current)\n\t\t? [...TOOL_OUTPUT_BYTE_PRESETS]\n\t\t: [...TOOL_OUTPUT_BYTE_PRESETS, [bytesToLabel(current), current]];\n\treturn all.sort((a, b) => a[1] - b[1]).map(([label]) => label);\n}\n\ninterface ToolSettingsConfig {\n\ttoolOutputDisplay: \"collapsed\" | \"peek\" | \"standard\";\n\ttoolOutputMaxBytes: number;\n\ttoolOutputMaxLines: number;\n}\n\ninterface ToolSettingsCallbacks {\n\tonToolOutputDisplayChange: (level: \"collapsed\" | \"peek\" | \"standard\") => void;\n\tonToolOutputMaxBytesChange: (bytes: number) => void;\n\tonToolOutputMaxLinesChange: (lines: number) => void;\n}\n\n/**\n * Submenu for what a tool result looks like: how much of it is rendered, and\n * where it is truncated. The display level applies to the transcript at once;\n * the caps feed the tool runtime, so they bind on future tool calls.\n *\n * Context GC is deliberately not here. It is not about a tool's output but about\n * what stays in the outgoing context, which is the Context category's subject.\n */\nclass ToolSettingsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(config: ToolSettingsConfig, callbacks: ToolSettingsCallbacks, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"tool-output-display\",\n\t\t\t\tlabel: \"Display\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"How tool results render. 'standard': shown (expandable). 'collapsed': hidden. 'peek': hidden with a ▸ reveal caret (press the expand key to reveal).\",\n\t\t\t\tcurrentValue: config.toolOutputDisplay,\n\t\t\t\tvalues: [\"standard\", \"collapsed\", \"peek\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"output-max-bytes\",\n\t\t\t\tlabel: \"Max bytes\",\n\t\t\t\tdescription: \"Byte cap on a single read/bash result before truncation. Applies to future tool calls.\",\n\t\t\t\tcurrentValue: bytesToLabel(config.toolOutputMaxBytes),\n\t\t\t\tvalues: byteLabels(config.toolOutputMaxBytes),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"output-max-lines\",\n\t\t\t\tlabel: \"Max lines\",\n\t\t\t\tdescription: \"Line cap on a single read/bash result before truncation. Applies to future tool calls.\",\n\t\t\t\tcurrentValue: String(config.toolOutputMaxLines),\n\t\t\t\tvalues: presetValues([200, 400, 800, 1600, 3200], config.toolOutputMaxLines),\n\t\t\t},\n\t\t];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tswitch (id) {\n\t\t\t\t\tcase \"tool-output-display\":\n\t\t\t\t\t\tcallbacks.onToolOutputDisplayChange(newValue as \"collapsed\" | \"peek\" | \"standard\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"output-max-bytes\": {\n\t\t\t\t\t\tconst preset = TOOL_OUTPUT_BYTE_PRESETS.find(([label]) => label === newValue);\n\t\t\t\t\t\t// A hand-set cap has no preset entry; its label is \"<n> KB\" by\n\t\t\t\t\t\t// construction, so read the number back out of it.\n\t\t\t\t\t\tconst bytes = preset ? preset[1] : Math.round(parseFloat(newValue) * 1024);\n\t\t\t\t\t\tif (Number.isFinite(bytes) && bytes > 0) callbacks.onToolOutputMaxBytesChange(bytes);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"output-max-lines\":\n\t\t\t\t\t\tcallbacks.onToolOutputMaxLinesChange(parseInt(newValue, 10));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCancel,\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/** Single-line text editor for a string flag value. */\nclass FlagStringEditSubmenu extends Container {\n\tprivate input: Input;\n\n\tconstructor(flagName: string, currentValue: string, done: (value?: string) => void) {\n\t\tsuper();\n\n\t\tthis.addChild(new Text(theme.bold(theme.fg(\"accent\", `Flag: --${flagName}`)), 0, 0));\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"muted\", \"Enter a value · Enter to save · Esc to cancel\"), 0, 0));\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.input = new Input();\n\t\tthis.input.setValue(currentValue);\n\t\tthis.input.onSubmit = (value: string) => done(value);\n\t\tthis.input.onEscape = () => done();\n\t\tthis.addChild(this.input);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.input.handleInput(data);\n\t}\n}\n\n/**\n * Submenu listing extension-registered flags. Boolean flags toggle on/off;\n * string flags open a text editor. Changes persist to settings.json and are\n * applied live best-effort — extensions that read a flag only at load time\n * pick up the new value on the next launch.\n */\nclass FlagsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(flags: FlagInfo[], onChange: (name: string, value: boolean | string) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SettingItem[] = flags.map((flag) => {\n\t\t\tconst baseDescription = flag.description ?? \"Extension-registered flag.\";\n\t\t\tconst description = `${baseDescription} Persists across sessions; some flags need a restart to fully apply.`;\n\t\t\tif (flag.type === \"boolean\") {\n\t\t\t\treturn {\n\t\t\t\t\tid: flag.name,\n\t\t\t\t\tlabel: flag.name,\n\t\t\t\t\tdescription,\n\t\t\t\t\tcurrentValue: flag.value ? \"on\" : \"off\",\n\t\t\t\t\tvalues: [\"on\", \"off\"],\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tid: flag.name,\n\t\t\t\tlabel: flag.name,\n\t\t\t\tdescription,\n\t\t\t\tcurrentValue: String(flag.value ?? \"\"),\n\t\t\t\tsubmenu: (currentValue, done) => new FlagStringEditSubmenu(flag.name, currentValue, done),\n\t\t\t};\n\t\t});\n\n\t\tconst typeByName = new Map(flags.map((f) => [f.name, f.type]));\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 12),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tif (typeByName.get(id) === \"boolean\") {\n\t\t\t\t\tonChange(id, newValue === \"on\");\n\t\t\t\t} else {\n\t\t\t\t\tonChange(id, newValue);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCancel,\n\t\t\t{ enableSearch: true },\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * Generic submenu holding a subset of leaf settings under a category label.\n * Shares the parent's change handler so cycle rows behave exactly as they did\n * when flat; nested submenu rows (theme, thinking, warnings) keep their own\n * factories.\n */\nclass CategorySubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(items: SettingItem[], onChange: (id: string, newValue: string) => void, onCancel: () => void) {\n\t\tsuper();\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\tonChange,\n\t\t\tonCancel,\n\t\t\t{\n\t\t\t\tenableSearch: true,\n\t\t\t},\n\t\t);\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\nclass SelectSubmenu extends Container {\n\tprivate selectList: SelectList;\n\n\tconstructor(\n\t\ttitle: string,\n\t\tdescription: string,\n\t\toptions: SelectItem[],\n\t\tcurrentValue: string,\n\t\tonSelect: (value: string) => void,\n\t\tonCancel: () => void,\n\t\tonSelectionChange?: (value: string) => void,\n\t) {\n\t\tsuper();\n\n\t\t// Title\n\t\tthis.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n\n\t\t// Description\n\t\tif (description) {\n\t\t\tthis.addChild(new Spacer(1));\n\t\t\tthis.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n\t\t}\n\n\t\t// Spacer\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Select list\n\t\tthis.selectList = new SelectList(\n\t\t\toptions,\n\t\t\tMath.min(options.length, 10),\n\t\t\tgetSelectListTheme(),\n\t\t\tSETTINGS_SUBMENU_SELECT_LIST_LAYOUT,\n\t\t);\n\n\t\t// Pre-select current value\n\t\tconst currentIndex = options.findIndex((o) => o.value === currentValue);\n\t\tif (currentIndex !== -1) {\n\t\t\tthis.selectList.setSelectedIndex(currentIndex);\n\t\t}\n\n\t\tthis.selectList.onSelect = (item) => {\n\t\t\tonSelect(item.value);\n\t\t};\n\n\t\tthis.selectList.onCancel = onCancel;\n\n\t\tif (onSelectionChange) {\n\t\t\tthis.selectList.onSelectionChange = (item) => {\n\t\t\t\tonSelectionChange(item.value);\n\t\t\t};\n\t\t}\n\n\t\tthis.addChild(this.selectList);\n\n\t\t// Hint\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"dim\", \" Enter to select · Esc to go back\"), 0, 0));\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.selectList.handleInput(data);\n\t}\n}\n\n/**\n * Token counts, grouped and exact.\n *\n * `formatTokens` (2.7k) exists for the fixed-width chrome, where a count must\n * never grow the box it sits in. This pane is the opposite case: the point of\n * showing a number here is to compare it with another one, and \"2.7k\" hides the\n * difference between the tool that costs 2,710 and the one that costs 2,749.\n */\nfunction tokenCount(tokens: number): string {\n\treturn tokens.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}\n\n/**\n * The fixed per-turn cost, as one line under the pane.\n *\n * Every byte of system prompt and active tool schema is re-sent on every\n * request, and the pane is where that number is decided - so the pane is where\n * it should be visible. It reports the *live* session: a tool toggle applies at\n * once and moves it, while a setting that only takes effect next session (a tool\n * group, the light preset) leaves it alone until then.\n */\nfunction formatSurfaceLine(surface: PromptSurface): string {\n\tconst tools = `${surface.tools.length} tool${surface.tools.length === 1 ? \"\" : \"s\"}`;\n\treturn (\n\t\t` Per-turn surface: ${tokenCount(surface.totalTokens)} tokens ` +\n\t\t`${theme.fg(\"dim\", `(${tokenCount(surface.systemPromptTokens)} system prompt + ${tokenCount(surface.toolSchemaTokens)} schemas, ${tools})`)}`\n\t);\n}\n\n/**\n * Main settings selector component.\n */\nexport class SettingsSelectorComponent extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate surfaceLine?: Text;\n\tprivate measureTokenSurface?: () => PromptSurface;\n\n\tconstructor(config: SettingsConfig, callbacks: SettingsCallbacks) {\n\t\tsuper();\n\n\t\tthis.measureTokenSurface = config.measureTokenSurface;\n\n\t\tconst supportsImages = getCapabilities().images;\n\t\tconst followUpKey = keyDisplayText(\"app.message.followUp\");\n\t\tlet currentWarnings = { ...config.warnings };\n\n\t\t// A row writes the user settings file; a key the project file also sets is\n\t\t// merged over it on the next session, so say so rather than letting the row\n\t\t// look like it took.\n\t\tconst projectPinned = new Set(config.projectPinnedSettings);\n\t\tconst pinnedNote = (key: string): string =>\n\t\t\tprojectPinned.has(key)\n\t\t\t\t? ` This repo's .hoocode/settings.json sets ${key}, which overrides this row from the next session on.`\n\t\t\t\t: \"\";\n\n\t\t// Which rows are gated on an external binary that is not on this machine.\n\t\t// Built once so every row that needs it reads the same answer.\n\t\tconst rowGates = buildRowGates(config.externalTools);\n\n\t\tconst initialSurface = config.measureTokenSurface?.();\n\n\t\tconst toolsOn = config.tools.filter((t) => t.enabled).length;\n\t\tconst toolsOff = config.tools.length - toolsOn;\n\n\t\tconst items: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"autocompact\",\n\t\t\t\tlabel: \"Auto-compact\",\n\t\t\t\tdescription: \"Automatically compact context when it gets too large\",\n\t\t\t\tcurrentValue: config.autoCompact ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"steering-mode\",\n\t\t\t\tlabel: \"Steering mode\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Enter while streaming queues steering messages. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.\",\n\t\t\t\tcurrentValue: config.steeringMode,\n\t\t\t\tvalues: [\"one-at-a-time\", \"all\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"follow-up-mode\",\n\t\t\t\tlabel: \"Follow-up mode\",\n\t\t\t\tdescription: `${followUpKey} queues follow-up messages until agent stops. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.`,\n\t\t\t\tcurrentValue: config.followUpMode,\n\t\t\t\tvalues: [\"one-at-a-time\", \"all\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"transport\",\n\t\t\t\tlabel: \"Transport\",\n\t\t\t\tdescription: \"Preferred transport for providers that support multiple transports\",\n\t\t\t\tcurrentValue: config.transport,\n\t\t\t\tvalues: [\"sse\", \"websocket\", \"websocket-cached\", \"auto\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"hide-thinking\",\n\t\t\t\tlabel: \"Hide thinking\",\n\t\t\t\tdescription: \"Hide thinking blocks in assistant responses\",\n\t\t\t\tcurrentValue: config.hideThinkingBlock ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"collapse-changelog\",\n\t\t\t\tlabel: \"Collapse changelog\",\n\t\t\t\tdescription: \"Show condensed changelog after updates\",\n\t\t\t\tcurrentValue: config.collapseChangelog ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"quiet-startup\",\n\t\t\t\tlabel: \"Quiet startup\",\n\t\t\t\tdescription: \"Disable verbose printing at startup\",\n\t\t\t\tcurrentValue: config.quietStartup ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"install-telemetry\",\n\t\t\t\tlabel: \"Install telemetry\",\n\t\t\t\tdescription: \"Send an anonymous version/update ping after changelog-detected updates\",\n\t\t\t\tcurrentValue: config.enableInstallTelemetry ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"double-escape-action\",\n\t\t\t\tlabel: \"Double-escape action\",\n\t\t\t\tdescription: \"Action when pressing Escape twice with empty editor\",\n\t\t\t\tcurrentValue: config.doubleEscapeAction,\n\t\t\t\tvalues: [\"tree\", \"fork\", \"none\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"tree-filter-mode\",\n\t\t\t\tlabel: \"Tree filter mode\",\n\t\t\t\tdescription: \"Default filter when opening /tree\",\n\t\t\t\tcurrentValue: config.treeFilterMode,\n\t\t\t\tvalues: [\"default\", \"no-tools\", \"user-only\", \"labeled-only\", \"all\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"warnings\",\n\t\t\t\tlabel: \"Warnings\",\n\t\t\t\tdescription: \"Enable or disable individual warnings\",\n\t\t\t\tcurrentValue: \"configure\",\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew WarningSettingsSubmenu(\n\t\t\t\t\t\tcurrentWarnings,\n\t\t\t\t\t\t(warnings) => {\n\t\t\t\t\t\t\tcurrentWarnings = warnings;\n\t\t\t\t\t\t\tcallbacks.onWarningsChange(warnings);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"thinking\",\n\t\t\t\tlabel: \"Thinking level\",\n\t\t\t\tdescription: \"Reasoning depth for thinking-capable models\",\n\t\t\t\tcurrentValue: config.thinkingLevel,\n\t\t\t\tsubmenu: (currentValue, done) =>\n\t\t\t\t\tnew SelectSubmenu(\n\t\t\t\t\t\t\"Thinking Level\",\n\t\t\t\t\t\t\"Select reasoning depth for thinking-capable models\",\n\t\t\t\t\t\tconfig.availableThinkingLevels.map((level) => ({\n\t\t\t\t\t\t\tvalue: level,\n\t\t\t\t\t\t\tlabel: level,\n\t\t\t\t\t\t\tdescription: THINKING_DESCRIPTIONS[level],\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tcurrentValue,\n\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\tcallbacks.onThinkingLevelChange(value as ThinkingLevel);\n\t\t\t\t\t\t\tdone(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"theme\",\n\t\t\t\tlabel: \"Theme\",\n\t\t\t\tdescription: \"Color theme for the interface\",\n\t\t\t\tcurrentValue: config.currentTheme,\n\t\t\t\tsubmenu: (currentValue, done) =>\n\t\t\t\t\tnew SelectSubmenu(\n\t\t\t\t\t\t\"Theme\",\n\t\t\t\t\t\t\"Select color theme\",\n\t\t\t\t\t\tconfig.availableThemes.map((t) => ({\n\t\t\t\t\t\t\tvalue: t,\n\t\t\t\t\t\t\tlabel: t,\n\t\t\t\t\t\t\tdescription: getThemeDescription(t),\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tcurrentValue,\n\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\tcallbacks.onThemeChange(value);\n\t\t\t\t\t\t\tdone(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t// Restore original theme on cancel\n\t\t\t\t\t\t\tcallbacks.onThemePreview?.(currentValue);\n\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\t// Preview theme on selection change\n\t\t\t\t\t\t\tcallbacks.onThemePreview?.(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t},\n\t\t];\n\n\t\t// Only show image toggle if terminal supports it\n\t\tif (supportsImages) {\n\t\t\t// Insert after autocompact\n\t\t\titems.splice(1, 0, {\n\t\t\t\tid: \"show-images\",\n\t\t\t\tlabel: \"Show images\",\n\t\t\t\tdescription: \"Render images inline in terminal\",\n\t\t\t\tcurrentValue: config.showImages ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t});\n\t\t\titems.splice(2, 0, {\n\t\t\t\tid: \"image-width-cells\",\n\t\t\t\tlabel: \"Image width\",\n\t\t\t\tdescription: \"Preferred inline image width in terminal cells\",\n\t\t\t\tcurrentValue: String(config.imageWidthCells),\n\t\t\t\tvalues: presetValues([60, 80, 120], config.imageWidthCells),\n\t\t\t});\n\t\t}\n\n\t\t// Image auto-resize toggle (always available, affects both attached and read images)\n\t\titems.splice(supportsImages ? 3 : 1, 0, {\n\t\t\tid: \"auto-resize-images\",\n\t\t\tlabel: \"Auto-resize images\",\n\t\t\tdescription: \"Resize large images to 2000x2000 max for better model compatibility\",\n\t\t\tcurrentValue: config.autoResizeImages ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Block images toggle (always available, insert after auto-resize-images)\n\t\tconst autoResizeIndex = items.findIndex((item) => item.id === \"auto-resize-images\");\n\t\titems.splice(autoResizeIndex + 1, 0, {\n\t\t\tid: \"block-images\",\n\t\t\tlabel: \"Block images\",\n\t\t\tdescription: \"Prevent images from being sent to LLM providers\",\n\t\t\tcurrentValue: config.blockImages ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Context GC (insert after block-images), a leaf the Context category picks up.\n\t\titems.splice(items.findIndex((item) => item.id === \"block-images\") + 1, 0, {\n\t\t\tid: \"context-gc\",\n\t\t\tlabel: \"Context GC\",\n\t\t\tdescription: \"Stub superseded read results (files later edited or re-read) out of the outgoing context.\",\n\t\t\tcurrentValue: config.contextGc ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// The light preset (insert after context GC). Read at startup to pick the\n\t\t// tool set and the system prompt, so it lands on the next session.\n\t\tconst blockImagesIdx = items.findIndex((item) => item.id === \"context-gc\");\n\t\titems.splice(blockImagesIdx + 1, 0, {\n\t\t\tid: \"light\",\n\t\t\tlabel: \"Light preset\",\n\t\t\tdescription:\n\t\t\t\t\"Low-token preset for small or local models: read/write/edit/bash only with stripped schemas, a terse system prompt, and no subagents/TodoWrite/skills/context files. Applies on the next session.\",\n\t\t\tcurrentValue: config.light ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Skill commands toggle (insert after the light preset)\n\t\tconst blockImagesIndex = items.findIndex((item) => item.id === \"light\");\n\t\titems.splice(blockImagesIndex + 1, 0, {\n\t\t\tid: \"skill-commands\",\n\t\t\tlabel: \"Skill commands\",\n\t\t\tdescription: \"Register skills as /skill:name commands\",\n\t\t\tcurrentValue: config.enableSkillCommands ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// The autonomous plugin system's master switch (insert after skill-commands).\n\t\t// One flag for the lifecycle tools and the reuse nudge, so both flip together.\n\t\tconst skillCommandsIdx = items.findIndex((item) => item.id === \"skill-commands\");\n\t\titems.splice(skillCommandsIdx + 1, 0, {\n\t\t\tid: \"plugin-tools\",\n\t\t\tlabel: \"Plugin system\",\n\t\t\tdescription: `Autonomous plugin system: the lifecycle tools (SearchPlugins, InstallPlugin, ...), ProposePlugin, and the plugin-reuse nudge. Tools arrive on the next session; the nudge follows at once.${pinnedNote(\"enablePluginTools\")}`,\n\t\t\tcurrentValue: config.enablePluginTools ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Plugin install scope (insert after the master switch). Governs the\n\t\t// autonomous InstallPlugin only — /plugin install asks per install.\n\t\tconst pluginToolsIdx = items.findIndex((item) => item.id === \"plugin-tools\");\n\t\titems.splice(pluginToolsIdx + 1, 0, {\n\t\t\tid: \"plugin-install-scope\",\n\t\t\tlabel: \"Plugin install scope\",\n\t\t\tdescription: \"Where autonomous plugin installs go: user (~/.agents) or project (this repo, shared)\",\n\t\t\tcurrentValue: config.pluginInstallScope,\n\t\t\tvalues: [\"user\", \"project\"],\n\t\t});\n\n\t\t// Artifact platform targets (insert after plugin-install-scope). Set once and\n\t\t// it holds for every later session: it is the `platform` setting, which\n\t\t// `--platform` overrides for a single run.\n\t\tconst pluginScopeIdx = items.findIndex((item) => item.id === \"plugin-install-scope\");\n\t\tlet currentPlatforms = [...config.platform];\n\t\titems.splice(pluginScopeIdx + 1, 0, {\n\t\t\tid: \"platform\",\n\t\t\tlabel: \"Platform\",\n\t\t\tdescription: `Vendor layout(s) hoocode writes artifacts in: authored plugins and the /new-skill //new-agent //new-command scaffolds.${pinnedNote(\"platform\")}`,\n\t\t\tcurrentValue: platformSummary(currentPlatforms),\n\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\tnew PlatformSubmenu(\n\t\t\t\t\tcurrentPlatforms,\n\t\t\t\t\t(platforms) => {\n\t\t\t\t\t\tcurrentPlatforms = platforms;\n\t\t\t\t\t\tcallbacks.onPlatformChange(platforms);\n\t\t\t\t\t},\n\t\t\t\t\t(summary) => done(summary),\n\t\t\t\t),\n\t\t});\n\n\t\t// Hardware cursor toggle (insert after the platform row)\n\t\tconst platformIndex = items.findIndex((item) => item.id === \"platform\");\n\t\titems.splice(platformIndex + 1, 0, {\n\t\t\tid: \"show-hardware-cursor\",\n\t\t\tlabel: \"Show hardware cursor\",\n\t\t\tdescription: \"Show the terminal cursor while still positioning it for IME support\",\n\t\t\tcurrentValue: config.showHardwareCursor ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Editor border toggle (insert after show-hardware-cursor)\n\t\tconst hardwareCursorIndex = items.findIndex((item) => item.id === \"show-hardware-cursor\");\n\t\titems.splice(hardwareCursorIndex + 1, 0, {\n\t\t\tid: \"editor-border\",\n\t\t\tlabel: \"Editor border\",\n\t\t\tdescription: \"Box draws side borders, rule draws horizontal lines only\",\n\t\t\tcurrentValue: config.editorBorder,\n\t\t\tvalues: [\"box\", \"rule\"],\n\t\t});\n\n\t\t// Editor padding toggle (insert after editor-border)\n\t\tconst editorBorderIndex = items.findIndex((item) => item.id === \"editor-border\");\n\t\titems.splice(editorBorderIndex + 1, 0, {\n\t\t\tid: \"editor-padding\",\n\t\t\tlabel: \"Editor padding\",\n\t\t\tdescription: \"Horizontal padding for input editor (0-3)\",\n\t\t\tcurrentValue: String(config.editorPaddingX),\n\t\t\tvalues: [\"0\", \"1\", \"2\", \"3\"],\n\t\t});\n\n\t\t// Autocomplete max visible toggle (insert after editor-padding)\n\t\tconst editorPaddingIndex = items.findIndex((item) => item.id === \"editor-padding\");\n\t\titems.splice(editorPaddingIndex + 1, 0, {\n\t\t\tid: \"autocomplete-max-visible\",\n\t\t\tlabel: \"Autocomplete max items\",\n\t\t\tdescription: \"Max visible items in autocomplete dropdown (3-20)\",\n\t\t\tcurrentValue: String(config.autocompleteMaxVisible),\n\t\t\tvalues: presetValues([3, 5, 7, 10, 15, 20], config.autocompleteMaxVisible),\n\t\t});\n\n\t\t// Clear on shrink toggle (insert after autocomplete-max-visible)\n\t\tconst autocompleteIndex = items.findIndex((item) => item.id === \"autocomplete-max-visible\");\n\t\titems.splice(autocompleteIndex + 1, 0, {\n\t\t\tid: \"clear-on-shrink\",\n\t\t\tlabel: \"Clear on shrink\",\n\t\t\tdescription: \"Clear empty rows when content shrinks (may cause flicker)\",\n\t\t\tcurrentValue: config.clearOnShrink ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Terminal progress toggle (insert after clear-on-shrink)\n\t\tconst clearOnShrinkIndex = items.findIndex((item) => item.id === \"clear-on-shrink\");\n\t\titems.splice(clearOnShrinkIndex + 1, 0, {\n\t\t\tid: \"terminal-progress\",\n\t\t\tlabel: \"Terminal progress\",\n\t\t\tdescription: \"Show OSC 9;4 progress indicators in the terminal tab bar\",\n\t\t\tcurrentValue: config.showTerminalProgress ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Voice silence window (insert after terminal-progress)\n\t\tconst terminalProgressIndex = items.findIndex((item) => item.id === \"terminal-progress\");\n\t\titems.splice(terminalProgressIndex + 1, 0, {\n\t\t\tid: \"voice-silence-ms\",\n\t\t\tlabel: \"Voice silence window\",\n\t\t\tdescription: `Trailing-silence (ms) before voice capture auto-stops (300-10000). Env: VOICETOOLS_SILENCE_MS.${gateNote(rowGates.get(\"voice-silence-ms\"))}`,\n\t\t\tcurrentValue: String(config.voiceSilenceMs),\n\t\t\tvalueSuffix: gateSuffix(rowGates.get(\"voice-silence-ms\")),\n\t\t\tvalues: presetValues([300, 500, 800, 1200, 2000, 3000, 5000, 8000, 10000], config.voiceSilenceMs),\n\t\t});\n\n\t\t// Webtools request timeout (insert after voice-silence-ms)\n\t\tconst voiceSilenceIndex = items.findIndex((item) => item.id === \"voice-silence-ms\");\n\t\titems.splice(voiceSilenceIndex + 1, 0, {\n\t\t\tid: \"webtools-timeout-secs\",\n\t\t\tlabel: \"Web tools timeout\",\n\t\t\tdescription: `Per-request timeout (secs) for webfetch/websearch (1-120). Env: HOOCODE_WEBTOOLS_TIMEOUT.${gateNote(rowGates.get(\"webtools-timeout-secs\"))}`,\n\t\t\tcurrentValue: String(config.webtoolsTimeoutSecs),\n\t\t\tvalueSuffix: gateSuffix(rowGates.get(\"webtools-timeout-secs\")),\n\t\t\tvalues: presetValues([5, 10, 15, 30, 60, 120], config.webtoolsTimeoutSecs),\n\t\t});\n\n\t\t// The /learn thresholds, appended as leaf rows and gathered into their own\n\t\t// category below. They are written to the user settings.json, which /learn\n\t\t// re-reads on every invocation, so a change here applies to the next run.\n\t\tconst webtoolsIndex = items.findIndex((item) => item.id === \"webtools-timeout-secs\");\n\t\titems.splice(\n\t\t\twebtoolsIndex + 1,\n\t\t\t0,\n\t\t\t...LEARN_SETTINGS.map(({ key, label, description, presets }) => ({\n\t\t\t\tid: key,\n\t\t\t\tlabel,\n\t\t\t\tdescription,\n\t\t\t\tcurrentValue: String(config.learn[key]),\n\t\t\t\tvalues: presetValues(presets, config.learn[key]),\n\t\t\t})),\n\t\t);\n\n\t\t// Keep the tool/flag controls together as one block near the top, inserted\n\t\t// after the image/terminal splices above so they aren't leapfrogged.\n\t\tconst toolFlagGroup: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"tools\",\n\t\t\t\tlabel: \"Tools\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Enable/disable tools and tool groups (web, semantic search), each priced by what its schema costs per turn. Changes persist across sessions.\",\n\t\t\t\tcurrentValue: toolsOff > 0 ? `${toolsOn} on · ${toolsOff} off` : `${toolsOn} on`,\n\t\t\t\tvalueSuffix: initialSurface ? `${tokenCount(initialSurface.toolSchemaTokens)} tok/turn` : undefined,\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew ToolsSubmenu(\n\t\t\t\t\t\tconfig.tools,\n\t\t\t\t\t\tconfig.toolGroups,\n\t\t\t\t\t\trowGates,\n\t\t\t\t\t\t(name, enabled) => {\n\t\t\t\t\t\t\tcallbacks.onToolEnabledChange(name, enabled);\n\t\t\t\t\t\t\t// Applied live by the host, so the surface below is already stale.\n\t\t\t\t\t\t\tthis.refreshTokenSurface();\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(id, enabled) => callbacks.onToolGroupChange(id, enabled),\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"tool-output\",\n\t\t\t\tlabel: \"Tool output\",\n\t\t\t\tdescription: \"How much of a tool result is rendered, and where it is truncated.\",\n\t\t\t\tcurrentValue: config.toolOutputDisplay,\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew ToolSettingsSubmenu(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttoolOutputDisplay: config.toolOutputDisplay,\n\t\t\t\t\t\t\ttoolOutputMaxBytes: config.toolOutputMaxBytes,\n\t\t\t\t\t\t\ttoolOutputMaxLines: config.toolOutputMaxLines,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tonToolOutputDisplayChange: callbacks.onToolOutputDisplayChange,\n\t\t\t\t\t\t\tonToolOutputMaxBytesChange: callbacks.onToolOutputMaxBytesChange,\n\t\t\t\t\t\t\tonToolOutputMaxLinesChange: callbacks.onToolOutputMaxLinesChange,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t];\n\t\tif (config.flags.length > 0) {\n\t\t\ttoolFlagGroup.push({\n\t\t\t\tid: \"flags\",\n\t\t\t\tlabel: \"Flags\",\n\t\t\t\tdescription: \"Set flags registered by extensions. Changes persist across sessions.\",\n\t\t\t\tcurrentValue: `${config.flags.length} flag${config.flags.length === 1 ? \"\" : \"s\"}`,\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew FlagsSubmenu(\n\t\t\t\t\t\tconfig.flags,\n\t\t\t\t\t\t(name, value) => callbacks.onFlagChange(name, value),\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\t// Add borders\n\t\tthis.addChild(new DynamicBorder());\n\n\t\t// Shared change handler for every leaf (cycle) setting; used by the\n\t\t// top-level list and each category submenu.\n\t\tconst applyChange = (id: string, newValue: string): void => {\n\t\t\tswitch (id) {\n\t\t\t\tcase \"autocompact\":\n\t\t\t\t\tcallbacks.onAutoCompactChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"show-images\":\n\t\t\t\t\tcallbacks.onShowImagesChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"image-width-cells\":\n\t\t\t\t\tcallbacks.onImageWidthCellsChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"auto-resize-images\":\n\t\t\t\t\tcallbacks.onAutoResizeImagesChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"block-images\":\n\t\t\t\t\tcallbacks.onBlockImagesChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"skill-commands\":\n\t\t\t\t\tcallbacks.onEnableSkillCommandsChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"light\":\n\t\t\t\t\tcallbacks.onLightChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"plugin-tools\":\n\t\t\t\t\tcallbacks.onEnablePluginToolsChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"plugin-install-scope\":\n\t\t\t\t\tcallbacks.onPluginInstallScopeChange(newValue as \"user\" | \"project\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"platform\":\n\t\t\t\t\t// Display only. Each toggle inside the submenu already applied itself;\n\t\t\t\t\t// closing it hands back the summary purely to refresh this row's value.\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"steering-mode\":\n\t\t\t\t\tcallbacks.onSteeringModeChange(newValue as \"all\" | \"one-at-a-time\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"follow-up-mode\":\n\t\t\t\t\tcallbacks.onFollowUpModeChange(newValue as \"all\" | \"one-at-a-time\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"transport\":\n\t\t\t\t\tcallbacks.onTransportChange(newValue as Transport);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"hide-thinking\":\n\t\t\t\t\tcallbacks.onHideThinkingBlockChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"collapse-changelog\":\n\t\t\t\t\tcallbacks.onCollapseChangelogChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"quiet-startup\":\n\t\t\t\t\tcallbacks.onQuietStartupChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"install-telemetry\":\n\t\t\t\t\tcallbacks.onEnableInstallTelemetryChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"double-escape-action\":\n\t\t\t\t\tcallbacks.onDoubleEscapeActionChange(newValue as \"fork\" | \"tree\" | \"none\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"tree-filter-mode\":\n\t\t\t\t\tcallbacks.onTreeFilterModeChange(\n\t\t\t\t\t\tnewValue as \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\",\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"show-hardware-cursor\":\n\t\t\t\t\tcallbacks.onShowHardwareCursorChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"editor-border\":\n\t\t\t\t\tcallbacks.onEditorBorderChange(newValue as \"rule\" | \"box\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"editor-padding\":\n\t\t\t\t\tcallbacks.onEditorPaddingXChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"autocomplete-max-visible\":\n\t\t\t\t\tcallbacks.onAutocompleteMaxVisibleChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"clear-on-shrink\":\n\t\t\t\t\tcallbacks.onClearOnShrinkChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"terminal-progress\":\n\t\t\t\t\tcallbacks.onShowTerminalProgressChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"voice-silence-ms\":\n\t\t\t\t\tcallbacks.onVoiceSilenceMsChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"webtools-timeout-secs\":\n\t\t\t\t\tcallbacks.onWebtoolsTimeoutSecsChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// The /learn rows are keyed by their settings.json name, so they need\n\t\t\t\t\t// no case of their own — the id is the key to write.\n\t\t\t\t\tif (LEARN_KEYS.has(id)) callbacks.onLearnSettingChange(id as LearnSettingKey, parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Most rows leave the per-turn surface alone; the ones that do not (a tool\n\t\t\t// toggle, anything that rebuilds the system prompt) move it immediately.\n\t\t\t// Re-measuring after every change is cheaper than knowing which is which.\n\t\t\tthis.refreshTokenSurface();\n\t\t};\n\n\t\t// Partition the flat leaf settings into named category submenus so the\n\t\t// top level stays short. `items` holds autocompact + every leaf setting.\n\t\tconst byId = new Map(items.map((item) => [item.id, item] as const));\n\t\tconst pick = (ids: string[]): SettingItem[] =>\n\t\t\tids.map((id) => byId.get(id)).filter((item): item is SettingItem => item !== undefined);\n\t\tconst categoryRow = (id: string, label: string, description: string, ids: string[]): SettingItem => {\n\t\t\tconst members = pick(ids);\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel,\n\t\t\t\tdescription,\n\t\t\t\tcurrentValue: `${members.length} setting${members.length === 1 ? \"\" : \"s\"}`,\n\t\t\t\t// Categories shortened the top level but also hid every setting from\n\t\t\t\t// its search: searching \"theme\" matched no category label. The member\n\t\t\t\t// labels ride along as search text so the query lands on the category\n\t\t\t\t// that holds the setting.\n\t\t\t\tkeywords: members.map((member) => member.label).join(\" \"),\n\t\t\t\tsubmenu: (_currentValue, done) => new CategorySubmenu(members, applyChange, () => done()),\n\t\t\t};\n\t\t};\n\n\t\tconst topItems: SettingItem[] = [\n\t\t\t...toolFlagGroup,\n\t\t\t// What the model is sent, and how much of it. Auto-compact used to sit\n\t\t\t// alone at the top level and context GC was filed under tool settings,\n\t\t\t// which left the three settings that decide the token budget in three\n\t\t\t// different places - with the light preset in none of them.\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-context\",\n\t\t\t\t\"Context\",\n\t\t\t\t\"What the model is sent and how much of it: compaction, superseded reads, and the low-token preset.\",\n\t\t\t\t[\"autocompact\", \"context-gc\", \"light\"],\n\t\t\t),\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-behavior\",\n\t\t\t\t\"Behavior\",\n\t\t\t\t\"Agent and session behavior: steering, follow-up, thinking, escape, tree filter, transport.\",\n\t\t\t\t[\"steering-mode\", \"follow-up-mode\", \"thinking\", \"double-escape-action\", \"tree-filter-mode\", \"transport\"],\n\t\t\t),\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-interface\",\n\t\t\t\t\"Interface\",\n\t\t\t\t\"Appearance and editor: theme, thinking visibility, cursor, border, padding, autocomplete, terminal.\",\n\t\t\t\t[\n\t\t\t\t\t\"theme\",\n\t\t\t\t\t\"hide-thinking\",\n\t\t\t\t\t\"show-hardware-cursor\",\n\t\t\t\t\t\"editor-border\",\n\t\t\t\t\t\"editor-padding\",\n\t\t\t\t\t\"autocomplete-max-visible\",\n\t\t\t\t\t\"clear-on-shrink\",\n\t\t\t\t\t\"terminal-progress\",\n\t\t\t\t],\n\t\t\t),\n\t\t\t// Artifact production. `plugin-install-scope` had no category and was\n\t\t\t// therefore unreachable from the pane despite having a live callback.\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-plugins\",\n\t\t\t\t\"Plugins\",\n\t\t\t\t\"The autonomous plugin system's master switch, the vendor layout hoocode writes, and where autonomous installs land.\",\n\t\t\t\t[\"plugin-tools\", \"platform\", \"plugin-install-scope\"],\n\t\t\t),\n\t\t\tcategoryRow(\"cat-images\", \"Images\", \"Inline image rendering and resizing.\", [\n\t\t\t\t\"show-images\",\n\t\t\t\t\"image-width-cells\",\n\t\t\t\t\"auto-resize-images\",\n\t\t\t\t\"block-images\",\n\t\t\t]),\n\t\t\t// Top level rather than folded into Advanced: these are the thresholds\n\t\t\t// that decide whether /learn finds anything, and burying them is what\n\t\t\t// made them undiscoverable in the first place.\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-learn\",\n\t\t\t\t\"Learning\",\n\t\t\t\t\"Thresholds /learn mines sessions with: how far back to look, and how often something must repeat.\",\n\t\t\t\tLEARN_SETTINGS.map((setting) => setting.key),\n\t\t\t),\n\t\t\t// The external binaries. Top level, not folded into Advanced: their whole\n\t\t\t// problem was that nothing in the product ever said they existed, and a\n\t\t\t// row two levels down would have been the same silence with extra steps.\n\t\t\t// This is the only category built from live machine state rather than\n\t\t\t// settings, so it is assembled here instead of going through categoryRow.\n\t\t\t{\n\t\t\t\tid: \"cat-external\",\n\t\t\t\tlabel: \"External tools\",\n\t\t\t\tdescription: `Optional Rust binaries that expand what hoocode can do: ${externalSummary(config.externalTools)}. hoocode runs without every one of them - each row says what it adds and what happens without it.`,\n\t\t\t\tcurrentValue: externalCount(config.externalTools),\n\t\t\t\tkeywords: config.externalTools\n\t\t\t\t\t.flatMap((status) => [status.tool, status.label, ...status.settingsKeys])\n\t\t\t\t\t.join(\" \"),\n\t\t\t\tsubmenu: (_currentValue, done) => new ExternalToolsSubmenu(config.externalTools, () => done()),\n\t\t\t},\n\t\t\tcategoryRow(\"cat-advanced\", \"Advanced\", \"Startup, telemetry, skills, warnings, voice, and web tools.\", [\n\t\t\t\t\"quiet-startup\",\n\t\t\t\t\"collapse-changelog\",\n\t\t\t\t\"install-telemetry\",\n\t\t\t\t\"skill-commands\",\n\t\t\t\t\"warnings\",\n\t\t\t\t\"voice-silence-ms\",\n\t\t\t\t\"webtools-timeout-secs\",\n\t\t\t]),\n\t\t];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\ttopItems,\n\t\t\tMath.min(topItems.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\tapplyChange,\n\t\t\tcallbacks.onCancel,\n\t\t\t{\n\t\t\t\tenableSearch: true,\n\t\t\t},\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t\tif (initialSurface) {\n\t\t\tthis.surfaceLine = new Text(formatSurfaceLine(initialSurface), 0, 0);\n\t\t\tthis.addChild(this.surfaceLine);\n\t\t}\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\t/** Re-price the pane after a change that may have altered what each turn sends. */\n\tprivate refreshTokenSurface(): void {\n\t\tif (!this.surfaceLine || !this.measureTokenSurface) return;\n\t\tthis.surfaceLine.setText(formatSurfaceLine(this.measureTokenSurface()));\n\t}\n\n\tgetSettingsList(): SettingsList {\n\t\treturn this.settingsList;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"settings-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/settings-selector.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,SAAS,EACT,eAAe,EACf,KAAK,EAEL,UAAU,EAGV,YAAY,EACZ,MAAM,EACN,IAAI,GACJ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EACN,6BAA6B,EAC7B,iBAAiB,GAEjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,mCAAmC,GAA4B;IACpE,qBAAqB,EAAE,EAAE;IACzB,qBAAqB,EAAE,EAAE;CACzB,CAAC;AAEF,MAAM,qBAAqB,GAAkC;IAC5D,GAAG,EAAE,cAAc;IACnB,OAAO,EAAE,mCAAmC;IAC5C,GAAG,EAAE,8BAA8B;IACnC,MAAM,EAAE,iCAAiC;IACzC,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,iCAAiC;CACxC,CAAC;AA0IF;;;;;GAKG;AACH,MAAM,cAAc,GAKf;IACJ;QACC,GAAG,EAAE,kBAAkB;QACvB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,+FAA+F;QAC5G,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;KAC9B;IACD;QACC,GAAG,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aACvB,CAAC;SACF,CAAC;QAEF,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CACnC,QAAQ,EACR,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,EAC7B,oBAAoB,EAAE,EACtB,WAAW,EACX,SAAS,CAAC,QAAQ,EAClB;YACC,YAAY,EAAE,IAAI;SAClB,CACD,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACjC,IAAI,cAAc,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;IAAA,CACnC;IAED,mFAAmF;IAC3E,mBAAmB,GAAS;QACnC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,mBAAmB;YAAE,OAAO;QAC3D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAAA,CACxE;IAED,eAAe,GAAiB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC;IAAA,CACzB;CACD","sourcesContent":["import type { ThinkingLevel } from \"@kolisachint/hoocode-agent-core\";\nimport type { Transport } from \"@kolisachint/hoocode-ai\";\nimport {\n\tContainer,\n\tgetCapabilities,\n\tInput,\n\ttype SelectItem,\n\tSelectList,\n\ttype SelectListLayoutOptions,\n\ttype SettingItem,\n\tSettingsList,\n\tSpacer,\n\tText,\n} from \"@kolisachint/hoocode-tui\";\nimport type { MarketplacePlatform } from \"../../../core/extensions/plugins/formats/types.js\";\nimport type { ExternalToolStatus } from \"../../../core/external-tools.js\";\nimport { buildRowGates, statusLabel } from \"../../../core/external-tools.js\";\nimport type { PromptSurface } from \"../../../core/light.js\";\nimport type { LearnSettingKey, WarningSettings } from \"../../../core/settings-manager.js\";\nimport {\n\tTOOL_OUTPUT_VIEW_DESCRIPTIONS,\n\tTOOL_OUTPUT_VIEWS,\n\ttype ToolOutputView,\n} from \"../../../core/tool-output-view.js\";\nimport { getSelectListTheme, getSettingsListTheme, getThemeDescription, theme } from \"../theme/theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { keyDisplayText } from \"./keybinding-hints.js\";\n\nconst SETTINGS_SUBMENU_SELECT_LIST_LAYOUT: SelectListLayoutOptions = {\n\tminPrimaryColumnWidth: 12,\n\tmaxPrimaryColumnWidth: 32,\n};\n\nconst THINKING_DESCRIPTIONS: Record<ThinkingLevel, string> = {\n\toff: \"No reasoning\",\n\tminimal: \"Very brief reasoning (~1k tokens)\",\n\tlow: \"Light reasoning (~2k tokens)\",\n\tmedium: \"Moderate reasoning (~8k tokens)\",\n\thigh: \"Deep reasoning (~16k tokens)\",\n\txhigh: \"Maximum reasoning (~32k tokens)\",\n};\n\ninterface ToolToggleInfo {\n\t/** Tool name (e.g. \"read\", \"bash\"). */\n\tname: string;\n\t/** Whether the tool is currently enabled (not in the persisted disabled set). */\n\tenabled: boolean;\n\t/**\n\t * What this tool's serialized schema costs on every request. Priced whether or\n\t * not it is on: for a tool that is off, this is what turning it on will cost.\n\t * Undefined for a tool that was disabled before launch, whose schema this\n\t * session never built.\n\t */\n\ttokens?: number;\n}\n\ninterface FlagInfo {\n\t/** Flag name (without the leading --). */\n\tname: string;\n\tdescription?: string;\n\ttype: \"boolean\" | \"string\";\n\t/** Current effective value. */\n\tvalue: boolean | string;\n}\n\ninterface ToolGroupInfo {\n\t/** Group identifier (e.g. \"web\", \"embsearch\"). */\n\tid: string;\n\tlabel: string;\n\tdescription: string;\n\t/** Whether the group is currently enabled (its tools are available). */\n\tenabled: boolean;\n}\n\nexport interface SettingsConfig {\n\tautoCompact: boolean;\n\ttools: ToolToggleInfo[];\n\ttoolGroups: ToolGroupInfo[];\n\t/**\n\t * The external Rust binaries and whether each one is present. Rendered as\n\t * its own top-level category, and used to annotate the rows that are gated\n\t * on a binary that is not installed.\n\t */\n\texternalTools: ExternalToolStatus[];\n\tflags: FlagInfo[];\n\ttoolOutputView: ToolOutputView;\n\ttoolOutputMaxBytes: number;\n\ttoolOutputMaxLines: number;\n\tcontextGc: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tautoResizeImages: boolean;\n\tblockImages: boolean;\n\tenableSkillCommands: boolean;\n\tlight: boolean;\n\tpluginInstallScope: \"user\" | \"project\";\n\tenablePluginTools: boolean;\n\t/**\n\t * settings.json keys the project file sets. A pane row writes user scope, so\n\t * anything listed here wins again on the next session however the row is set.\n\t */\n\tprojectPinnedSettings: string[];\n\t/** Platform layouts in force this session (empty = unset, per-consumer defaults apply). */\n\tplatform: MarketplacePlatform[];\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\ttransport: Transport;\n\tthinkingLevel: ThinkingLevel;\n\tavailableThinkingLevels: ThinkingLevel[];\n\tcurrentTheme: string;\n\tavailableThemes: string[];\n\thideThinkingBlock: boolean;\n\tcollapseChangelog: boolean;\n\tenableInstallTelemetry: boolean;\n\tdoubleEscapeAction: \"fork\" | \"tree\" | \"none\";\n\ttreeFilterMode: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\";\n\tshowHardwareCursor: boolean;\n\teditorBorder: \"rule\" | \"box\";\n\teditorPaddingX: number;\n\tautocompleteMaxVisible: number;\n\tquietStartup: boolean;\n\tclearOnShrink: boolean;\n\tshowTerminalProgress: boolean;\n\twarnings: WarningSettings;\n\tvoiceSilenceMs: number;\n\twebtoolsTimeoutSecs: number;\n\tlearn: Record<LearnSettingKey, number>;\n\t/**\n\t * Re-measure the fixed per-turn surface (system prompt + active tool schemas).\n\t * Called on open and after every change, so a toggle that costs tokens shows\n\t * what it cost. Omitted by callers that have no session to measure.\n\t */\n\tmeasureTokenSurface?: () => PromptSurface;\n}\n\nexport interface SettingsCallbacks {\n\tonAutoCompactChange: (enabled: boolean) => void;\n\tonToolEnabledChange: (name: string, enabled: boolean) => void;\n\tonToolGroupChange: (id: string, enabled: boolean) => void;\n\tonToolOutputViewChange: (view: ToolOutputView) => void;\n\tonToolOutputMaxBytesChange: (bytes: number) => void;\n\tonToolOutputMaxLinesChange: (lines: number) => void;\n\tonContextGcChange: (enabled: boolean) => void;\n\tonFlagChange: (name: string, value: boolean | string) => void;\n\tonShowImagesChange: (enabled: boolean) => void;\n\tonImageWidthCellsChange: (width: number) => void;\n\tonAutoResizeImagesChange: (enabled: boolean) => void;\n\tonBlockImagesChange: (blocked: boolean) => void;\n\tonEnableSkillCommandsChange: (enabled: boolean) => void;\n\tonLightChange: (enabled: boolean) => void;\n\tonPluginInstallScopeChange: (scope: \"user\" | \"project\") => void;\n\tonEnablePluginToolsChange: (enabled: boolean) => void;\n\tonPlatformChange: (platforms: MarketplacePlatform[]) => void;\n\tonSteeringModeChange: (mode: \"all\" | \"one-at-a-time\") => void;\n\tonFollowUpModeChange: (mode: \"all\" | \"one-at-a-time\") => void;\n\tonTransportChange: (transport: Transport) => void;\n\tonThinkingLevelChange: (level: ThinkingLevel) => void;\n\tonThemeChange: (theme: string) => void;\n\tonThemePreview?: (theme: string) => void;\n\tonHideThinkingBlockChange: (hidden: boolean) => void;\n\tonCollapseChangelogChange: (collapsed: boolean) => void;\n\tonEnableInstallTelemetryChange: (enabled: boolean) => void;\n\tonDoubleEscapeActionChange: (action: \"fork\" | \"tree\" | \"none\") => void;\n\tonTreeFilterModeChange: (mode: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\") => void;\n\tonShowHardwareCursorChange: (enabled: boolean) => void;\n\tonEditorBorderChange: (border: \"rule\" | \"box\") => void;\n\tonEditorPaddingXChange: (padding: number) => void;\n\tonAutocompleteMaxVisibleChange: (maxVisible: number) => void;\n\tonQuietStartupChange: (enabled: boolean) => void;\n\tonClearOnShrinkChange: (enabled: boolean) => void;\n\tonShowTerminalProgressChange: (enabled: boolean) => void;\n\tonWarningsChange: (warnings: WarningSettings) => void;\n\tonVoiceSilenceMsChange: (ms: number) => void;\n\tonWebtoolsTimeoutSecsChange: (secs: number) => void;\n\tonLearnSettingChange: (key: LearnSettingKey, value: number) => void;\n\tonCancel: () => void;\n}\n\n/**\n * The `/learn` thresholds as pane rows: the presets to cycle through, and what\n * each one buys. Kept as a table because all five are the same shape — a\n * positive integer with a handful of sensible values — and the pane, the change\n * handler and the category row all read from it rather than repeating the list.\n */\nconst LEARN_SETTINGS: ReadonlyArray<{\n\tkey: LearnSettingKey;\n\tlabel: string;\n\tdescription: string;\n\tpresets: number[];\n}> = [\n\t{\n\t\tkey: \"learnMaxSessions\",\n\t\tlabel: \"Sessions scanned\",\n\t\tdescription: \"How many recent sessions in this directory /learn mines. Raise it on a repo you touch rarely.\",\n\t\tpresets: [10, 20, 30, 50, 100],\n\t},\n\t{\n\t\tkey: \"learnMaxAgeDays\",\n\t\tlabel: \"Session age limit\",\n\t\tdescription: \"Ignore sessions older than this many days. A pattern that stopped is not a rule.\",\n\t\tpresets: [7, 14, 30, 60, 90, 180],\n\t},\n\t{\n\t\tkey: \"learnMinRepeats\",\n\t\tlabel: \"Directive repeats\",\n\t\tdescription:\n\t\t\t\"Times a directive must recur before it is proposed. The signal/noise dial: raise it for fewer, better-evidenced proposals.\",\n\t\tpresets: [2, 3, 4, 5],\n\t},\n\t{\n\t\tkey: \"learnMinRequestRepeats\",\n\t\tlabel: \"Workflow repeats\",\n\t\tdescription: \"Non-overlapping repeats a tool sequence needs before it is proposed as a skill.\",\n\t\tpresets: [2, 3, 4, 5, 6],\n\t},\n\t{\n\t\tkey: \"learnMaxProposals\",\n\t\tlabel: \"Max proposals\",\n\t\tdescription: \"Cap on each list in the digest. Every proposal costs the model context.\",\n\t\tpresets: [3, 5, 8, 12, 20],\n\t},\n];\n\nconst LEARN_KEYS: ReadonlySet<string> = new Set(LEARN_SETTINGS.map((setting) => setting.key));\n\n/**\n * Preset list for a numeric row, guaranteed to contain the value in force.\n *\n * Without this a value set by hand in settings.json — say 45 days — is absent\n * from the cycle, so the first keypress silently snaps it to the first preset,\n * discarding a deliberate choice the pane never showed as unusual. Every numeric\n * cycle row goes through this for that reason.\n */\nfunction presetValues(presets: number[], current: number): string[] {\n\tconst all = presets.includes(current) ? presets : [...presets, current].sort((a, b) => a - b);\n\treturn all.map(String);\n}\n\n/**\n * A submenu component for selecting from a list of options.\n */\nclass WarningSettingsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate state: WarningSettings;\n\n\tconstructor(warnings: WarningSettings, onChange: (warnings: WarningSettings) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tthis.state = { ...warnings };\n\n\t\tconst items: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"anthropic-extra-usage\",\n\t\t\t\tlabel: \"Anthropic extra usage\",\n\t\t\t\tdescription: \"Warn when Anthropic subscription auth may use paid extra usage\",\n\t\t\t\tcurrentValue: (this.state.anthropicExtraUsage ?? true) ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tswitch (id) {\n\t\t\t\t\tcase \"anthropic-extra-usage\":\n\t\t\t\t\t\tthis.state = { ...this.state, anthropicExtraUsage: newValue === \"true\" };\n\t\t\t\t\t\tonChange({ ...this.state });\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCancel,\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * The artifact platform targets, in the order the pane shows them. Each row is an\n * independent on/off toggle because `--platform` (and the `platform` setting it\n * mirrors) takes a list: emitting for two platforms at once is a supported shape.\n * The tokens here are the canonical ones — the CLI aliases (`copilot`, `gh`,\n * `native`) fold into these before anything reads them.\n */\nconst PLATFORM_ROWS: ReadonlyArray<{\n\tplatform: MarketplacePlatform;\n\tlabel: string;\n\tdescription: string;\n}> = [\n\t{\n\t\tplatform: \"claude\",\n\t\tlabel: \"claude\",\n\t\tdescription:\n\t\t\t\"Claude Code layout: .claude/ scaffolds, and authored plugins drop into ~/.claude/skills/<id>/. The default when nothing is set.\",\n\t},\n\t{\n\t\tplatform: \"github\",\n\t\tlabel: \"github (copilot, gh)\",\n\t\tdescription:\n\t\t\t\"Copilot layout: .github/ scaffolds, and authored plugins are produced under ~/.agents/publish/github/<id>/.\",\n\t},\n\t{\n\t\tplatform: \"agents\",\n\t\tlabel: \"agents (native)\",\n\t\tdescription:\n\t\t\t\"Cross-vendor .agents/ layout. Scaffolds only - a plugin belongs to no marketplace in this layout, so plugin authoring ignores it.\",\n\t},\n];\n\n/** Row value for the platform setting: the selection, or the fallback when it is empty. */\nfunction platformSummary(platforms: readonly MarketplacePlatform[]): string {\n\treturn platforms.length > 0 ? platforms.join(\", \") : \"default (claude)\";\n}\n\n/**\n * Submenu for the session's artifact platform targets (the `platform` setting,\n * same knob as `--platform`).\n *\n * A list rather than a cycle: the setting is a list, and the three tokens are not\n * mutually exclusive. Turning everything off is legal and means \"unset\" — the\n * per-consumer defaults come back (claude for plugins, .hoocode/ for scaffolds).\n */\nclass PlatformSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate selected: Set<MarketplacePlatform>;\n\n\tconstructor(\n\t\tplatforms: readonly MarketplacePlatform[],\n\t\tonChange: (platforms: MarketplacePlatform[]) => void,\n\t\tonDone: (summary: string) => void,\n\t) {\n\t\tsuper();\n\n\t\tthis.selected = new Set(platforms);\n\n\t\tconst items: SettingItem[] = PLATFORM_ROWS.map(({ platform, label, description }) => ({\n\t\t\tid: platform,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\tcurrentValue: this.selected.has(platform) ? \"on\" : \"off\",\n\t\t\tvalues: [\"on\", \"off\"],\n\t\t}));\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tconst platform = id as MarketplacePlatform;\n\t\t\t\tif (newValue === \"on\") this.selected.add(platform);\n\t\t\t\telse this.selected.delete(platform);\n\t\t\t\tonChange(this.ordered());\n\t\t\t},\n\t\t\t() => onDone(platformSummary(this.ordered())),\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\t/** Selection in the pane's order, so the persisted list does not depend on click order. */\n\tprivate ordered(): MarketplacePlatform[] {\n\t\treturn PLATFORM_ROWS.map((row) => row.platform).filter((platform) => this.selected.has(platform));\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * Trailing sentence for a row whose setting is inert until an external binary\n * shows up. The row is annotated rather than hidden: the binaries were invisible\n * precisely because nothing ever mentioned them, and a row that disappears when\n * its dependency is missing teaches the user nothing at all.\n */\nfunction gateNote(gate: ExternalToolStatus | undefined): string {\n\tif (!gate || gate.installed) return \"\";\n\treturn gate.downloadable\n\t\t? ` Needs the ${gate.tool} binary, which hoocode fetches the first time this is used. Until then: ${gate.fallback}`\n\t\t: ` Needs the ${gate.tool} binary, and this environment will not fetch it. Until then: ${gate.fallback}`;\n}\n\n/** \"3 of 5 installed\" - the one number that says whether this category needs attention. */\nfunction externalCount(statuses: readonly ExternalToolStatus[]): string {\n\tconst installed = statuses.filter((status) => status.installed).length;\n\treturn `${installed} of ${statuses.length} installed`;\n}\n\n/** The capability words, so the category row says what the binaries are for. */\nfunction externalSummary(statuses: readonly ExternalToolStatus[]): string {\n\treturn statuses.map((status) => status.tool).join(\", \");\n}\n\n/** Value-column marker for a gated row, so the list shows it without selecting. */\nfunction gateSuffix(gate: ExternalToolStatus | undefined): string | undefined {\n\tif (!gate || gate.installed) return undefined;\n\treturn `needs ${gate.tool}`;\n}\n\n/**\n * Submenu for tool availability. The first rows are group switches (web,\n * semantic search) that decide whether a group's tools\n * exist at all — this is the same master switch that governs, e.g., the\n * webfetch/websearch tools. Below them are per-tool on/off toggles for the\n * tools that are currently available.\n *\n * Group switches change tool availability and apply on the next session;\n * per-tool toggles apply live and persist. A minimum core (read/bash/edit/\n * write) is guarded so the agent can never be left with no way to act.\n */\nclass ToolsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate enabled: Map<string, boolean>;\n\tprivate static readonly CORE = new Set([\"read\", \"bash\", \"edit\", \"write\"]);\n\tprivate static readonly GROUP_PREFIX = \"group:\";\n\n\tconstructor(\n\t\ttools: ToolToggleInfo[],\n\t\tgroups: ToolGroupInfo[],\n\t\t/** Rows gated on an external binary, keyed by row id. See buildRowGates. */\n\t\tgates: ReadonlyMap<string, ExternalToolStatus>,\n\t\tonChange: (name: string, enabled: boolean) => void,\n\t\tonGroupChange: (id: string, enabled: boolean) => void,\n\t\tonCancel: () => void,\n\t) {\n\t\tsuper();\n\n\t\tthis.enabled = new Map(tools.map((t) => [t.name, t.enabled]));\n\n\t\tconst groupItems: SettingItem[] = groups.map((group) => {\n\t\t\tconst id = `${ToolsSubmenu.GROUP_PREFIX}${group.id}`;\n\t\t\tconst gate = gates.get(id);\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel: `[group] ${group.label}`,\n\t\t\t\tdescription: `${group.description} Governs whether these tools exist; applies on the next session.${gateNote(gate)}`,\n\t\t\t\tcurrentValue: group.enabled ? \"on\" : \"off\",\n\t\t\t\t// The switch stays settable with the binary missing: the setting is\n\t\t\t\t// what makes hoocode fetch it, so refusing the toggle would make the\n\t\t\t\t// group unreachable forever.\n\t\t\t\tvalueSuffix: gateSuffix(gate),\n\t\t\t\tvalues: [\"on\", \"off\"],\n\t\t\t};\n\t\t});\n\n\t\tconst toolItems: SettingItem[] = tools.map((tool) => ({\n\t\t\tid: tool.name,\n\t\t\tlabel: tool.name,\n\t\t\tdescription: ToolsSubmenu.CORE.has(tool.name)\n\t\t\t\t? \"Core tool. Disabling leaves the agent unable to perform this action in every session.\"\n\t\t\t\t: \"Disable to remove this tool from the agent this session and every future session.\",\n\t\t\tcurrentValue: tool.enabled ? \"on\" : \"off\",\n\t\t\t// What the schema costs on every request, whether the tool is on or off:\n\t\t\t// off, it is the price of turning it back on. This is the number that\n\t\t\t// makes a tool worth disabling, so it belongs beside the switch.\n\t\t\tvalueSuffix: tool.tokens !== undefined ? `${tokenCount(tool.tokens)} tok/turn` : undefined,\n\t\t\tvalues: [\"on\", \"off\"],\n\t\t}));\n\n\t\tconst items = [...groupItems, ...toolItems];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 12),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tconst wantEnabled = newValue === \"on\";\n\t\t\t\tif (id.startsWith(ToolsSubmenu.GROUP_PREFIX)) {\n\t\t\t\t\tonGroupChange(id.slice(ToolsSubmenu.GROUP_PREFIX.length), wantEnabled);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Guard: never let the last core tool be turned off.\n\t\t\t\tif (!wantEnabled && ToolsSubmenu.CORE.has(id)) {\n\t\t\t\t\tconst remainingCore = [...ToolsSubmenu.CORE].filter((n) => n !== id && this.enabled.get(n));\n\t\t\t\t\tif (remainingCore.length === 0) {\n\t\t\t\t\t\tthis.settingsList.updateValue(id, \"on\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.enabled.set(id, wantEnabled);\n\t\t\t\tonChange(id, wantEnabled);\n\t\t\t},\n\t\t\tonCancel,\n\t\t\t{ enableSearch: true },\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * Read-only detail for one external binary: what it is, whether it is here, what\n * it turns on, and what hoocode does without it.\n *\n * A submenu rather than a long `description` because the useful answer is five\n * or six lines and the pane shows descriptions on one. Nothing here is settable\n * - the binary is either on the machine or it is not - so the rows carry no\n * `values` and Enter does nothing but close.\n */\nclass ExternalToolDetailSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(status: ExternalToolStatus, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst acquisition =\n\t\t\tstatus.acquisition === \"startup\"\n\t\t\t\t? \"Downloaded in the background at startup.\"\n\t\t\t\t: status.acquisition === \"on-demand\"\n\t\t\t\t\t? \"Downloaded the first time the feature is used.\"\n\t\t\t\t\t: \"Never downloaded automatically; install it yourself.\";\n\n\t\tconst location = status.installed\n\t\t\t? status.source === \"path\"\n\t\t\t\t? `found on PATH as \\`${status.path}\\``\n\t\t\t\t: status.source === \"override\"\n\t\t\t\t\t? `${status.overrideEnv} points at ${status.path}`\n\t\t\t\t\t: `hoocode's own copy at ${status.path}`\n\t\t\t: status.downloadable\n\t\t\t\t? `${acquisition} Not on this machine yet.`\n\t\t\t\t: \"Not installed, and this environment will not download it (offline mode, or no published build for this platform).\";\n\n\t\tconst rows: ReadonlyArray<[label: string, value: string, description: string]> = [\n\t\t\t[\"Status\", statusLabel(status), location],\n\t\t\t[\n\t\t\t\t\"Enables\",\n\t\t\t\t`${status.enables.length} feature${status.enables.length === 1 ? \"\" : \"s\"}`,\n\t\t\t\tstatus.enables.join(\"; \"),\n\t\t\t],\n\t\t\t[\"Without it\", \"fallback\", status.fallback],\n\t\t\t[\"Source\", status.repo || \"-\", `Release archives come from github.com/${status.repo}. ${acquisition}`],\n\t\t\t[\"Env\", String(status.env.length), status.env.join(\" | \")],\n\t\t];\n\n\t\tconst items: SettingItem[] = rows.map(([label, value, description], index) => ({\n\t\t\tid: `detail-${index}`,\n\t\t\tlabel,\n\t\t\tcurrentValue: value,\n\t\t\tdescription,\n\t\t}));\n\n\t\tthis.settingsList = new SettingsList(items, items.length, getSettingsListTheme(), () => {}, onCancel);\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * The external-binary category: one row per managed Rust binary.\n *\n * These binaries were entirely invisible before this pane existed. hoocode works\n * without every one of them, which is the whole reason nobody found them: search\n * silently got slower, semantic ranking silently never happened, and web/voice\n * were simply features nobody knew were there. The row states presence; the\n * submenu states what presence buys.\n */\nclass ExternalToolsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(statuses: ExternalToolStatus[], onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SettingItem[] = statuses.map((status) => ({\n\t\t\tid: `ext-${status.tool}`,\n\t\t\tlabel: status.label,\n\t\t\tdescription: `${status.summary} Without it: ${status.fallback}`,\n\t\t\tcurrentValue: statusLabel(status),\n\t\t\t// The value column says whether it is here; the suffix says what it is\n\t\t\t// for, so the list reads without opening every row.\n\t\t\tvalueSuffix: status.installed ? undefined : status.downloadable ? \"auto-fetch\" : \"manual\",\n\t\t\tkeywords: [status.tool, status.repo, ...status.settingsKeys, ...status.enables].join(\" \"),\n\t\t\tsubmenu: (_currentValue, done) => new ExternalToolDetailSubmenu(status, () => done()),\n\t\t}));\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t() => {},\n\t\t\tonCancel,\n\t\t\t{ enableSearch: true },\n\t\t);\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/** Byte-cap presets shown as human labels; mapped back to raw byte counts. */\nconst TOOL_OUTPUT_BYTE_PRESETS: ReadonlyArray<[label: string, bytes: number]> = [\n\t[\"8 KB\", 8 * 1024],\n\t[\"16 KB\", 16 * 1024],\n\t[\"32 KB\", 32 * 1024],\n\t[\"64 KB\", 64 * 1024],\n\t[\"128 KB\", 128 * 1024],\n];\n\nfunction bytesToLabel(bytes: number): string {\n\tconst match = TOOL_OUTPUT_BYTE_PRESETS.find(([, b]) => b === bytes);\n\treturn match ? match[0] : `${Math.round(bytes / 1024)} KB`;\n}\n\n/** Byte-cap labels to cycle through, including a hand-set cap that matches no preset. */\nfunction byteLabels(current: number): string[] {\n\tconst all: Array<[string, number]> = TOOL_OUTPUT_BYTE_PRESETS.some(([, bytes]) => bytes === current)\n\t\t? [...TOOL_OUTPUT_BYTE_PRESETS]\n\t\t: [...TOOL_OUTPUT_BYTE_PRESETS, [bytesToLabel(current), current]];\n\treturn all.sort((a, b) => a[1] - b[1]).map(([label]) => label);\n}\n\ninterface ToolSettingsConfig {\n\ttoolOutputView: ToolOutputView;\n\ttoolOutputMaxBytes: number;\n\ttoolOutputMaxLines: number;\n}\n\ninterface ToolSettingsCallbacks {\n\tonToolOutputViewChange: (view: ToolOutputView) => void;\n\tonToolOutputMaxBytesChange: (bytes: number) => void;\n\tonToolOutputMaxLinesChange: (lines: number) => void;\n}\n\n/**\n * Submenu for what a tool result looks like: how much of it is rendered, and\n * where it is truncated. The view applies to the whole transcript at once; the\n * caps feed the tool runtime, so they bind on future tool calls.\n *\n * Context GC is deliberately not here. It is not about a tool's output but about\n * what stays in the outgoing context, which is the Context category's subject.\n */\nclass ToolSettingsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(config: ToolSettingsConfig, callbacks: ToolSettingsCallbacks, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"tool-output-view\",\n\t\t\t\tlabel: \"View\",\n\t\t\t\tdescription: `How much of a tool call the transcript shows, least to most. 'radar': ${TOOL_OUTPUT_VIEW_DESCRIPTIONS.radar}. 'glance': ${TOOL_OUTPUT_VIEW_DESCRIPTIONS.glance}. 'full': ${TOOL_OUTPUT_VIEW_DESCRIPTIONS.full}.`,\n\t\t\t\tcurrentValue: config.toolOutputView,\n\t\t\t\tvalues: [...TOOL_OUTPUT_VIEWS],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"output-max-bytes\",\n\t\t\t\tlabel: \"Max bytes\",\n\t\t\t\tdescription: \"Byte cap on a single read/bash result before truncation. Applies to future tool calls.\",\n\t\t\t\tcurrentValue: bytesToLabel(config.toolOutputMaxBytes),\n\t\t\t\tvalues: byteLabels(config.toolOutputMaxBytes),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"output-max-lines\",\n\t\t\t\tlabel: \"Max lines\",\n\t\t\t\tdescription: \"Line cap on a single read/bash result before truncation. Applies to future tool calls.\",\n\t\t\t\tcurrentValue: String(config.toolOutputMaxLines),\n\t\t\t\tvalues: presetValues([200, 400, 800, 1600, 3200], config.toolOutputMaxLines),\n\t\t\t},\n\t\t];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tswitch (id) {\n\t\t\t\t\tcase \"tool-output-view\":\n\t\t\t\t\t\tcallbacks.onToolOutputViewChange(newValue as ToolOutputView);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"output-max-bytes\": {\n\t\t\t\t\t\tconst preset = TOOL_OUTPUT_BYTE_PRESETS.find(([label]) => label === newValue);\n\t\t\t\t\t\t// A hand-set cap has no preset entry; its label is \"<n> KB\" by\n\t\t\t\t\t\t// construction, so read the number back out of it.\n\t\t\t\t\t\tconst bytes = preset ? preset[1] : Math.round(parseFloat(newValue) * 1024);\n\t\t\t\t\t\tif (Number.isFinite(bytes) && bytes > 0) callbacks.onToolOutputMaxBytesChange(bytes);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"output-max-lines\":\n\t\t\t\t\t\tcallbacks.onToolOutputMaxLinesChange(parseInt(newValue, 10));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCancel,\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/** Single-line text editor for a string flag value. */\nclass FlagStringEditSubmenu extends Container {\n\tprivate input: Input;\n\n\tconstructor(flagName: string, currentValue: string, done: (value?: string) => void) {\n\t\tsuper();\n\n\t\tthis.addChild(new Text(theme.bold(theme.fg(\"accent\", `Flag: --${flagName}`)), 0, 0));\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"muted\", \"Enter a value · Enter to save · Esc to cancel\"), 0, 0));\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.input = new Input();\n\t\tthis.input.setValue(currentValue);\n\t\tthis.input.onSubmit = (value: string) => done(value);\n\t\tthis.input.onEscape = () => done();\n\t\tthis.addChild(this.input);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.input.handleInput(data);\n\t}\n}\n\n/**\n * Submenu listing extension-registered flags. Boolean flags toggle on/off;\n * string flags open a text editor. Changes persist to settings.json and are\n * applied live best-effort — extensions that read a flag only at load time\n * pick up the new value on the next launch.\n */\nclass FlagsSubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(flags: FlagInfo[], onChange: (name: string, value: boolean | string) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SettingItem[] = flags.map((flag) => {\n\t\t\tconst baseDescription = flag.description ?? \"Extension-registered flag.\";\n\t\t\tconst description = `${baseDescription} Persists across sessions; some flags need a restart to fully apply.`;\n\t\t\tif (flag.type === \"boolean\") {\n\t\t\t\treturn {\n\t\t\t\t\tid: flag.name,\n\t\t\t\t\tlabel: flag.name,\n\t\t\t\t\tdescription,\n\t\t\t\t\tcurrentValue: flag.value ? \"on\" : \"off\",\n\t\t\t\t\tvalues: [\"on\", \"off\"],\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tid: flag.name,\n\t\t\t\tlabel: flag.name,\n\t\t\t\tdescription,\n\t\t\t\tcurrentValue: String(flag.value ?? \"\"),\n\t\t\t\tsubmenu: (currentValue, done) => new FlagStringEditSubmenu(flag.name, currentValue, done),\n\t\t\t};\n\t\t});\n\n\t\tconst typeByName = new Map(flags.map((f) => [f.name, f.type]));\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 12),\n\t\t\tgetSettingsListTheme(),\n\t\t\t(id, newValue) => {\n\t\t\t\tif (typeByName.get(id) === \"boolean\") {\n\t\t\t\t\tonChange(id, newValue === \"on\");\n\t\t\t\t} else {\n\t\t\t\t\tonChange(id, newValue);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCancel,\n\t\t\t{ enableSearch: true },\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\n/**\n * Generic submenu holding a subset of leaf settings under a category label.\n * Shares the parent's change handler so cycle rows behave exactly as they did\n * when flat; nested submenu rows (theme, thinking, warnings) keep their own\n * factories.\n */\nclass CategorySubmenu extends Container {\n\tprivate settingsList: SettingsList;\n\n\tconstructor(items: SettingItem[], onChange: (id: string, newValue: string) => void, onCancel: () => void) {\n\t\tsuper();\n\t\tthis.settingsList = new SettingsList(\n\t\t\titems,\n\t\t\tMath.min(items.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\tonChange,\n\t\t\tonCancel,\n\t\t\t{\n\t\t\t\tenableSearch: true,\n\t\t\t},\n\t\t);\n\t\tthis.addChild(this.settingsList);\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.settingsList.handleInput(data);\n\t}\n}\n\nclass SelectSubmenu extends Container {\n\tprivate selectList: SelectList;\n\n\tconstructor(\n\t\ttitle: string,\n\t\tdescription: string,\n\t\toptions: SelectItem[],\n\t\tcurrentValue: string,\n\t\tonSelect: (value: string) => void,\n\t\tonCancel: () => void,\n\t\tonSelectionChange?: (value: string) => void,\n\t) {\n\t\tsuper();\n\n\t\t// Title\n\t\tthis.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n\n\t\t// Description\n\t\tif (description) {\n\t\t\tthis.addChild(new Spacer(1));\n\t\t\tthis.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n\t\t}\n\n\t\t// Spacer\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Select list\n\t\tthis.selectList = new SelectList(\n\t\t\toptions,\n\t\t\tMath.min(options.length, 10),\n\t\t\tgetSelectListTheme(),\n\t\t\tSETTINGS_SUBMENU_SELECT_LIST_LAYOUT,\n\t\t);\n\n\t\t// Pre-select current value\n\t\tconst currentIndex = options.findIndex((o) => o.value === currentValue);\n\t\tif (currentIndex !== -1) {\n\t\t\tthis.selectList.setSelectedIndex(currentIndex);\n\t\t}\n\n\t\tthis.selectList.onSelect = (item) => {\n\t\t\tonSelect(item.value);\n\t\t};\n\n\t\tthis.selectList.onCancel = onCancel;\n\n\t\tif (onSelectionChange) {\n\t\t\tthis.selectList.onSelectionChange = (item) => {\n\t\t\t\tonSelectionChange(item.value);\n\t\t\t};\n\t\t}\n\n\t\tthis.addChild(this.selectList);\n\n\t\t// Hint\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"dim\", \" Enter to select · Esc to go back\"), 0, 0));\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.selectList.handleInput(data);\n\t}\n}\n\n/**\n * Token counts, grouped and exact.\n *\n * `formatTokens` (2.7k) exists for the fixed-width chrome, where a count must\n * never grow the box it sits in. This pane is the opposite case: the point of\n * showing a number here is to compare it with another one, and \"2.7k\" hides the\n * difference between the tool that costs 2,710 and the one that costs 2,749.\n */\nfunction tokenCount(tokens: number): string {\n\treturn tokens.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}\n\n/**\n * The fixed per-turn cost, as one line under the pane.\n *\n * Every byte of system prompt and active tool schema is re-sent on every\n * request, and the pane is where that number is decided - so the pane is where\n * it should be visible. It reports the *live* session: a tool toggle applies at\n * once and moves it, while a setting that only takes effect next session (a tool\n * group, the light preset) leaves it alone until then.\n */\nfunction formatSurfaceLine(surface: PromptSurface): string {\n\tconst tools = `${surface.tools.length} tool${surface.tools.length === 1 ? \"\" : \"s\"}`;\n\treturn (\n\t\t` Per-turn surface: ${tokenCount(surface.totalTokens)} tokens ` +\n\t\t`${theme.fg(\"dim\", `(${tokenCount(surface.systemPromptTokens)} system prompt + ${tokenCount(surface.toolSchemaTokens)} schemas, ${tools})`)}`\n\t);\n}\n\n/**\n * Main settings selector component.\n */\nexport class SettingsSelectorComponent extends Container {\n\tprivate settingsList: SettingsList;\n\tprivate surfaceLine?: Text;\n\tprivate measureTokenSurface?: () => PromptSurface;\n\n\tconstructor(config: SettingsConfig, callbacks: SettingsCallbacks) {\n\t\tsuper();\n\n\t\tthis.measureTokenSurface = config.measureTokenSurface;\n\n\t\tconst supportsImages = getCapabilities().images;\n\t\tconst followUpKey = keyDisplayText(\"app.message.followUp\");\n\t\tlet currentWarnings = { ...config.warnings };\n\n\t\t// A row writes the user settings file; a key the project file also sets is\n\t\t// merged over it on the next session, so say so rather than letting the row\n\t\t// look like it took.\n\t\tconst projectPinned = new Set(config.projectPinnedSettings);\n\t\tconst pinnedNote = (key: string): string =>\n\t\t\tprojectPinned.has(key)\n\t\t\t\t? ` This repo's .hoocode/settings.json sets ${key}, which overrides this row from the next session on.`\n\t\t\t\t: \"\";\n\n\t\t// Which rows are gated on an external binary that is not on this machine.\n\t\t// Built once so every row that needs it reads the same answer.\n\t\tconst rowGates = buildRowGates(config.externalTools);\n\n\t\tconst initialSurface = config.measureTokenSurface?.();\n\n\t\tconst toolsOn = config.tools.filter((t) => t.enabled).length;\n\t\tconst toolsOff = config.tools.length - toolsOn;\n\n\t\tconst items: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"autocompact\",\n\t\t\t\tlabel: \"Auto-compact\",\n\t\t\t\tdescription: \"Automatically compact context when it gets too large\",\n\t\t\t\tcurrentValue: config.autoCompact ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"steering-mode\",\n\t\t\t\tlabel: \"Steering mode\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Enter while streaming queues steering messages. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.\",\n\t\t\t\tcurrentValue: config.steeringMode,\n\t\t\t\tvalues: [\"one-at-a-time\", \"all\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"follow-up-mode\",\n\t\t\t\tlabel: \"Follow-up mode\",\n\t\t\t\tdescription: `${followUpKey} queues follow-up messages until agent stops. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.`,\n\t\t\t\tcurrentValue: config.followUpMode,\n\t\t\t\tvalues: [\"one-at-a-time\", \"all\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"transport\",\n\t\t\t\tlabel: \"Transport\",\n\t\t\t\tdescription: \"Preferred transport for providers that support multiple transports\",\n\t\t\t\tcurrentValue: config.transport,\n\t\t\t\tvalues: [\"sse\", \"websocket\", \"websocket-cached\", \"auto\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"hide-thinking\",\n\t\t\t\tlabel: \"Hide thinking\",\n\t\t\t\tdescription: \"Hide thinking blocks in assistant responses\",\n\t\t\t\tcurrentValue: config.hideThinkingBlock ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"collapse-changelog\",\n\t\t\t\tlabel: \"Collapse changelog\",\n\t\t\t\tdescription: \"Show condensed changelog after updates\",\n\t\t\t\tcurrentValue: config.collapseChangelog ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"quiet-startup\",\n\t\t\t\tlabel: \"Quiet startup\",\n\t\t\t\tdescription: \"Disable verbose printing at startup\",\n\t\t\t\tcurrentValue: config.quietStartup ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"install-telemetry\",\n\t\t\t\tlabel: \"Install telemetry\",\n\t\t\t\tdescription: \"Send an anonymous version/update ping after changelog-detected updates\",\n\t\t\t\tcurrentValue: config.enableInstallTelemetry ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"double-escape-action\",\n\t\t\t\tlabel: \"Double-escape action\",\n\t\t\t\tdescription: \"Action when pressing Escape twice with empty editor\",\n\t\t\t\tcurrentValue: config.doubleEscapeAction,\n\t\t\t\tvalues: [\"tree\", \"fork\", \"none\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"tree-filter-mode\",\n\t\t\t\tlabel: \"Tree filter mode\",\n\t\t\t\tdescription: \"Default filter when opening /tree\",\n\t\t\t\tcurrentValue: config.treeFilterMode,\n\t\t\t\tvalues: [\"default\", \"no-tools\", \"user-only\", \"labeled-only\", \"all\"],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"warnings\",\n\t\t\t\tlabel: \"Warnings\",\n\t\t\t\tdescription: \"Enable or disable individual warnings\",\n\t\t\t\tcurrentValue: \"configure\",\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew WarningSettingsSubmenu(\n\t\t\t\t\t\tcurrentWarnings,\n\t\t\t\t\t\t(warnings) => {\n\t\t\t\t\t\t\tcurrentWarnings = warnings;\n\t\t\t\t\t\t\tcallbacks.onWarningsChange(warnings);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"thinking\",\n\t\t\t\tlabel: \"Thinking level\",\n\t\t\t\tdescription: \"Reasoning depth for thinking-capable models\",\n\t\t\t\tcurrentValue: config.thinkingLevel,\n\t\t\t\tsubmenu: (currentValue, done) =>\n\t\t\t\t\tnew SelectSubmenu(\n\t\t\t\t\t\t\"Thinking Level\",\n\t\t\t\t\t\t\"Select reasoning depth for thinking-capable models\",\n\t\t\t\t\t\tconfig.availableThinkingLevels.map((level) => ({\n\t\t\t\t\t\t\tvalue: level,\n\t\t\t\t\t\t\tlabel: level,\n\t\t\t\t\t\t\tdescription: THINKING_DESCRIPTIONS[level],\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tcurrentValue,\n\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\tcallbacks.onThinkingLevelChange(value as ThinkingLevel);\n\t\t\t\t\t\t\tdone(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"theme\",\n\t\t\t\tlabel: \"Theme\",\n\t\t\t\tdescription: \"Color theme for the interface\",\n\t\t\t\tcurrentValue: config.currentTheme,\n\t\t\t\tsubmenu: (currentValue, done) =>\n\t\t\t\t\tnew SelectSubmenu(\n\t\t\t\t\t\t\"Theme\",\n\t\t\t\t\t\t\"Select color theme\",\n\t\t\t\t\t\tconfig.availableThemes.map((t) => ({\n\t\t\t\t\t\t\tvalue: t,\n\t\t\t\t\t\t\tlabel: t,\n\t\t\t\t\t\t\tdescription: getThemeDescription(t),\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tcurrentValue,\n\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\tcallbacks.onThemeChange(value);\n\t\t\t\t\t\t\tdone(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t// Restore original theme on cancel\n\t\t\t\t\t\t\tcallbacks.onThemePreview?.(currentValue);\n\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\t// Preview theme on selection change\n\t\t\t\t\t\t\tcallbacks.onThemePreview?.(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t},\n\t\t];\n\n\t\t// Only show image toggle if terminal supports it\n\t\tif (supportsImages) {\n\t\t\t// Insert after autocompact\n\t\t\titems.splice(1, 0, {\n\t\t\t\tid: \"show-images\",\n\t\t\t\tlabel: \"Show images\",\n\t\t\t\tdescription: \"Render images inline in terminal\",\n\t\t\t\tcurrentValue: config.showImages ? \"true\" : \"false\",\n\t\t\t\tvalues: [\"true\", \"false\"],\n\t\t\t});\n\t\t\titems.splice(2, 0, {\n\t\t\t\tid: \"image-width-cells\",\n\t\t\t\tlabel: \"Image width\",\n\t\t\t\tdescription: \"Preferred inline image width in terminal cells\",\n\t\t\t\tcurrentValue: String(config.imageWidthCells),\n\t\t\t\tvalues: presetValues([60, 80, 120], config.imageWidthCells),\n\t\t\t});\n\t\t}\n\n\t\t// Image auto-resize toggle (always available, affects both attached and read images)\n\t\titems.splice(supportsImages ? 3 : 1, 0, {\n\t\t\tid: \"auto-resize-images\",\n\t\t\tlabel: \"Auto-resize images\",\n\t\t\tdescription: \"Resize large images to 2000x2000 max for better model compatibility\",\n\t\t\tcurrentValue: config.autoResizeImages ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Block images toggle (always available, insert after auto-resize-images)\n\t\tconst autoResizeIndex = items.findIndex((item) => item.id === \"auto-resize-images\");\n\t\titems.splice(autoResizeIndex + 1, 0, {\n\t\t\tid: \"block-images\",\n\t\t\tlabel: \"Block images\",\n\t\t\tdescription: \"Prevent images from being sent to LLM providers\",\n\t\t\tcurrentValue: config.blockImages ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Context GC (insert after block-images), a leaf the Context category picks up.\n\t\titems.splice(items.findIndex((item) => item.id === \"block-images\") + 1, 0, {\n\t\t\tid: \"context-gc\",\n\t\t\tlabel: \"Context GC\",\n\t\t\tdescription: \"Stub superseded read results (files later edited or re-read) out of the outgoing context.\",\n\t\t\tcurrentValue: config.contextGc ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// The light preset (insert after context GC). Read at startup to pick the\n\t\t// tool set and the system prompt, so it lands on the next session.\n\t\tconst blockImagesIdx = items.findIndex((item) => item.id === \"context-gc\");\n\t\titems.splice(blockImagesIdx + 1, 0, {\n\t\t\tid: \"light\",\n\t\t\tlabel: \"Light preset\",\n\t\t\tdescription:\n\t\t\t\t\"Low-token preset for small or local models: read/write/edit/bash only with stripped schemas, a terse system prompt, and no subagents/TodoWrite/skills/context files. Applies on the next session.\",\n\t\t\tcurrentValue: config.light ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Skill commands toggle (insert after the light preset)\n\t\tconst blockImagesIndex = items.findIndex((item) => item.id === \"light\");\n\t\titems.splice(blockImagesIndex + 1, 0, {\n\t\t\tid: \"skill-commands\",\n\t\t\tlabel: \"Skill commands\",\n\t\t\tdescription: \"Register skills as /skill:name commands\",\n\t\t\tcurrentValue: config.enableSkillCommands ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// The autonomous plugin system's master switch (insert after skill-commands).\n\t\t// One flag for the lifecycle tools and the reuse nudge, so both flip together.\n\t\tconst skillCommandsIdx = items.findIndex((item) => item.id === \"skill-commands\");\n\t\titems.splice(skillCommandsIdx + 1, 0, {\n\t\t\tid: \"plugin-tools\",\n\t\t\tlabel: \"Plugin system\",\n\t\t\tdescription: `Autonomous plugin system: the lifecycle tools (SearchPlugins, InstallPlugin, ...), ProposePlugin, and the plugin-reuse nudge. Tools arrive on the next session; the nudge follows at once.${pinnedNote(\"enablePluginTools\")}`,\n\t\t\tcurrentValue: config.enablePluginTools ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Plugin install scope (insert after the master switch). Governs the\n\t\t// autonomous InstallPlugin only — /plugin install asks per install.\n\t\tconst pluginToolsIdx = items.findIndex((item) => item.id === \"plugin-tools\");\n\t\titems.splice(pluginToolsIdx + 1, 0, {\n\t\t\tid: \"plugin-install-scope\",\n\t\t\tlabel: \"Plugin install scope\",\n\t\t\tdescription: \"Where autonomous plugin installs go: user (~/.agents) or project (this repo, shared)\",\n\t\t\tcurrentValue: config.pluginInstallScope,\n\t\t\tvalues: [\"user\", \"project\"],\n\t\t});\n\n\t\t// Artifact platform targets (insert after plugin-install-scope). Set once and\n\t\t// it holds for every later session: it is the `platform` setting, which\n\t\t// `--platform` overrides for a single run.\n\t\tconst pluginScopeIdx = items.findIndex((item) => item.id === \"plugin-install-scope\");\n\t\tlet currentPlatforms = [...config.platform];\n\t\titems.splice(pluginScopeIdx + 1, 0, {\n\t\t\tid: \"platform\",\n\t\t\tlabel: \"Platform\",\n\t\t\tdescription: `Vendor layout(s) hoocode writes artifacts in: authored plugins and the /new-skill //new-agent //new-command scaffolds.${pinnedNote(\"platform\")}`,\n\t\t\tcurrentValue: platformSummary(currentPlatforms),\n\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\tnew PlatformSubmenu(\n\t\t\t\t\tcurrentPlatforms,\n\t\t\t\t\t(platforms) => {\n\t\t\t\t\t\tcurrentPlatforms = platforms;\n\t\t\t\t\t\tcallbacks.onPlatformChange(platforms);\n\t\t\t\t\t},\n\t\t\t\t\t(summary) => done(summary),\n\t\t\t\t),\n\t\t});\n\n\t\t// Hardware cursor toggle (insert after the platform row)\n\t\tconst platformIndex = items.findIndex((item) => item.id === \"platform\");\n\t\titems.splice(platformIndex + 1, 0, {\n\t\t\tid: \"show-hardware-cursor\",\n\t\t\tlabel: \"Show hardware cursor\",\n\t\t\tdescription: \"Show the terminal cursor while still positioning it for IME support\",\n\t\t\tcurrentValue: config.showHardwareCursor ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Editor border toggle (insert after show-hardware-cursor)\n\t\tconst hardwareCursorIndex = items.findIndex((item) => item.id === \"show-hardware-cursor\");\n\t\titems.splice(hardwareCursorIndex + 1, 0, {\n\t\t\tid: \"editor-border\",\n\t\t\tlabel: \"Editor border\",\n\t\t\tdescription: \"Box draws side borders, rule draws horizontal lines only\",\n\t\t\tcurrentValue: config.editorBorder,\n\t\t\tvalues: [\"box\", \"rule\"],\n\t\t});\n\n\t\t// Editor padding toggle (insert after editor-border)\n\t\tconst editorBorderIndex = items.findIndex((item) => item.id === \"editor-border\");\n\t\titems.splice(editorBorderIndex + 1, 0, {\n\t\t\tid: \"editor-padding\",\n\t\t\tlabel: \"Editor padding\",\n\t\t\tdescription: \"Horizontal padding for input editor (0-3)\",\n\t\t\tcurrentValue: String(config.editorPaddingX),\n\t\t\tvalues: [\"0\", \"1\", \"2\", \"3\"],\n\t\t});\n\n\t\t// Autocomplete max visible toggle (insert after editor-padding)\n\t\tconst editorPaddingIndex = items.findIndex((item) => item.id === \"editor-padding\");\n\t\titems.splice(editorPaddingIndex + 1, 0, {\n\t\t\tid: \"autocomplete-max-visible\",\n\t\t\tlabel: \"Autocomplete max items\",\n\t\t\tdescription: \"Max visible items in autocomplete dropdown (3-20)\",\n\t\t\tcurrentValue: String(config.autocompleteMaxVisible),\n\t\t\tvalues: presetValues([3, 5, 7, 10, 15, 20], config.autocompleteMaxVisible),\n\t\t});\n\n\t\t// Clear on shrink toggle (insert after autocomplete-max-visible)\n\t\tconst autocompleteIndex = items.findIndex((item) => item.id === \"autocomplete-max-visible\");\n\t\titems.splice(autocompleteIndex + 1, 0, {\n\t\t\tid: \"clear-on-shrink\",\n\t\t\tlabel: \"Clear on shrink\",\n\t\t\tdescription: \"Clear empty rows when content shrinks (may cause flicker)\",\n\t\t\tcurrentValue: config.clearOnShrink ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Terminal progress toggle (insert after clear-on-shrink)\n\t\tconst clearOnShrinkIndex = items.findIndex((item) => item.id === \"clear-on-shrink\");\n\t\titems.splice(clearOnShrinkIndex + 1, 0, {\n\t\t\tid: \"terminal-progress\",\n\t\t\tlabel: \"Terminal progress\",\n\t\t\tdescription: \"Show OSC 9;4 progress indicators in the terminal tab bar\",\n\t\t\tcurrentValue: config.showTerminalProgress ? \"true\" : \"false\",\n\t\t\tvalues: [\"true\", \"false\"],\n\t\t});\n\n\t\t// Voice silence window (insert after terminal-progress)\n\t\tconst terminalProgressIndex = items.findIndex((item) => item.id === \"terminal-progress\");\n\t\titems.splice(terminalProgressIndex + 1, 0, {\n\t\t\tid: \"voice-silence-ms\",\n\t\t\tlabel: \"Voice silence window\",\n\t\t\tdescription: `Trailing-silence (ms) before voice capture auto-stops (300-10000). Env: VOICETOOLS_SILENCE_MS.${gateNote(rowGates.get(\"voice-silence-ms\"))}`,\n\t\t\tcurrentValue: String(config.voiceSilenceMs),\n\t\t\tvalueSuffix: gateSuffix(rowGates.get(\"voice-silence-ms\")),\n\t\t\tvalues: presetValues([300, 500, 800, 1200, 2000, 3000, 5000, 8000, 10000], config.voiceSilenceMs),\n\t\t});\n\n\t\t// Webtools request timeout (insert after voice-silence-ms)\n\t\tconst voiceSilenceIndex = items.findIndex((item) => item.id === \"voice-silence-ms\");\n\t\titems.splice(voiceSilenceIndex + 1, 0, {\n\t\t\tid: \"webtools-timeout-secs\",\n\t\t\tlabel: \"Web tools timeout\",\n\t\t\tdescription: `Per-request timeout (secs) for webfetch/websearch (1-120). Env: HOOCODE_WEBTOOLS_TIMEOUT.${gateNote(rowGates.get(\"webtools-timeout-secs\"))}`,\n\t\t\tcurrentValue: String(config.webtoolsTimeoutSecs),\n\t\t\tvalueSuffix: gateSuffix(rowGates.get(\"webtools-timeout-secs\")),\n\t\t\tvalues: presetValues([5, 10, 15, 30, 60, 120], config.webtoolsTimeoutSecs),\n\t\t});\n\n\t\t// The /learn thresholds, appended as leaf rows and gathered into their own\n\t\t// category below. They are written to the user settings.json, which /learn\n\t\t// re-reads on every invocation, so a change here applies to the next run.\n\t\tconst webtoolsIndex = items.findIndex((item) => item.id === \"webtools-timeout-secs\");\n\t\titems.splice(\n\t\t\twebtoolsIndex + 1,\n\t\t\t0,\n\t\t\t...LEARN_SETTINGS.map(({ key, label, description, presets }) => ({\n\t\t\t\tid: key,\n\t\t\t\tlabel,\n\t\t\t\tdescription,\n\t\t\t\tcurrentValue: String(config.learn[key]),\n\t\t\t\tvalues: presetValues(presets, config.learn[key]),\n\t\t\t})),\n\t\t);\n\n\t\t// Keep the tool/flag controls together as one block near the top, inserted\n\t\t// after the image/terminal splices above so they aren't leapfrogged.\n\t\tconst toolFlagGroup: SettingItem[] = [\n\t\t\t{\n\t\t\t\tid: \"tools\",\n\t\t\t\tlabel: \"Tools\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Enable/disable tools and tool groups (web, semantic search), each priced by what its schema costs per turn. Changes persist across sessions.\",\n\t\t\t\tcurrentValue: toolsOff > 0 ? `${toolsOn} on · ${toolsOff} off` : `${toolsOn} on`,\n\t\t\t\tvalueSuffix: initialSurface ? `${tokenCount(initialSurface.toolSchemaTokens)} tok/turn` : undefined,\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew ToolsSubmenu(\n\t\t\t\t\t\tconfig.tools,\n\t\t\t\t\t\tconfig.toolGroups,\n\t\t\t\t\t\trowGates,\n\t\t\t\t\t\t(name, enabled) => {\n\t\t\t\t\t\t\tcallbacks.onToolEnabledChange(name, enabled);\n\t\t\t\t\t\t\t// Applied live by the host, so the surface below is already stale.\n\t\t\t\t\t\t\tthis.refreshTokenSurface();\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(id, enabled) => callbacks.onToolGroupChange(id, enabled),\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"tool-output\",\n\t\t\t\tlabel: \"Tool output\",\n\t\t\t\tdescription: \"How much of a tool result is rendered, and where it is truncated.\",\n\t\t\t\tcurrentValue: config.toolOutputView,\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew ToolSettingsSubmenu(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttoolOutputView: config.toolOutputView,\n\t\t\t\t\t\t\ttoolOutputMaxBytes: config.toolOutputMaxBytes,\n\t\t\t\t\t\t\ttoolOutputMaxLines: config.toolOutputMaxLines,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tonToolOutputViewChange: callbacks.onToolOutputViewChange,\n\t\t\t\t\t\t\tonToolOutputMaxBytesChange: callbacks.onToolOutputMaxBytesChange,\n\t\t\t\t\t\t\tonToolOutputMaxLinesChange: callbacks.onToolOutputMaxLinesChange,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t},\n\t\t];\n\t\tif (config.flags.length > 0) {\n\t\t\ttoolFlagGroup.push({\n\t\t\t\tid: \"flags\",\n\t\t\t\tlabel: \"Flags\",\n\t\t\t\tdescription: \"Set flags registered by extensions. Changes persist across sessions.\",\n\t\t\t\tcurrentValue: `${config.flags.length} flag${config.flags.length === 1 ? \"\" : \"s\"}`,\n\t\t\t\tsubmenu: (_currentValue, done) =>\n\t\t\t\t\tnew FlagsSubmenu(\n\t\t\t\t\t\tconfig.flags,\n\t\t\t\t\t\t(name, value) => callbacks.onFlagChange(name, value),\n\t\t\t\t\t\t() => done(),\n\t\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\t// Add borders\n\t\tthis.addChild(new DynamicBorder());\n\n\t\t// Shared change handler for every leaf (cycle) setting; used by the\n\t\t// top-level list and each category submenu.\n\t\tconst applyChange = (id: string, newValue: string): void => {\n\t\t\tswitch (id) {\n\t\t\t\tcase \"autocompact\":\n\t\t\t\t\tcallbacks.onAutoCompactChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"show-images\":\n\t\t\t\t\tcallbacks.onShowImagesChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"image-width-cells\":\n\t\t\t\t\tcallbacks.onImageWidthCellsChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"auto-resize-images\":\n\t\t\t\t\tcallbacks.onAutoResizeImagesChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"block-images\":\n\t\t\t\t\tcallbacks.onBlockImagesChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"skill-commands\":\n\t\t\t\t\tcallbacks.onEnableSkillCommandsChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"light\":\n\t\t\t\t\tcallbacks.onLightChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"plugin-tools\":\n\t\t\t\t\tcallbacks.onEnablePluginToolsChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"plugin-install-scope\":\n\t\t\t\t\tcallbacks.onPluginInstallScopeChange(newValue as \"user\" | \"project\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"platform\":\n\t\t\t\t\t// Display only. Each toggle inside the submenu already applied itself;\n\t\t\t\t\t// closing it hands back the summary purely to refresh this row's value.\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"steering-mode\":\n\t\t\t\t\tcallbacks.onSteeringModeChange(newValue as \"all\" | \"one-at-a-time\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"follow-up-mode\":\n\t\t\t\t\tcallbacks.onFollowUpModeChange(newValue as \"all\" | \"one-at-a-time\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"transport\":\n\t\t\t\t\tcallbacks.onTransportChange(newValue as Transport);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"hide-thinking\":\n\t\t\t\t\tcallbacks.onHideThinkingBlockChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"collapse-changelog\":\n\t\t\t\t\tcallbacks.onCollapseChangelogChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"quiet-startup\":\n\t\t\t\t\tcallbacks.onQuietStartupChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"install-telemetry\":\n\t\t\t\t\tcallbacks.onEnableInstallTelemetryChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"double-escape-action\":\n\t\t\t\t\tcallbacks.onDoubleEscapeActionChange(newValue as \"fork\" | \"tree\" | \"none\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"tree-filter-mode\":\n\t\t\t\t\tcallbacks.onTreeFilterModeChange(\n\t\t\t\t\t\tnewValue as \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\",\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"show-hardware-cursor\":\n\t\t\t\t\tcallbacks.onShowHardwareCursorChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"editor-border\":\n\t\t\t\t\tcallbacks.onEditorBorderChange(newValue as \"rule\" | \"box\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"editor-padding\":\n\t\t\t\t\tcallbacks.onEditorPaddingXChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"autocomplete-max-visible\":\n\t\t\t\t\tcallbacks.onAutocompleteMaxVisibleChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"clear-on-shrink\":\n\t\t\t\t\tcallbacks.onClearOnShrinkChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"terminal-progress\":\n\t\t\t\t\tcallbacks.onShowTerminalProgressChange(newValue === \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"voice-silence-ms\":\n\t\t\t\t\tcallbacks.onVoiceSilenceMsChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"webtools-timeout-secs\":\n\t\t\t\t\tcallbacks.onWebtoolsTimeoutSecsChange(parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// The /learn rows are keyed by their settings.json name, so they need\n\t\t\t\t\t// no case of their own — the id is the key to write.\n\t\t\t\t\tif (LEARN_KEYS.has(id)) callbacks.onLearnSettingChange(id as LearnSettingKey, parseInt(newValue, 10));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Most rows leave the per-turn surface alone; the ones that do not (a tool\n\t\t\t// toggle, anything that rebuilds the system prompt) move it immediately.\n\t\t\t// Re-measuring after every change is cheaper than knowing which is which.\n\t\t\tthis.refreshTokenSurface();\n\t\t};\n\n\t\t// Partition the flat leaf settings into named category submenus so the\n\t\t// top level stays short. `items` holds autocompact + every leaf setting.\n\t\tconst byId = new Map(items.map((item) => [item.id, item] as const));\n\t\tconst pick = (ids: string[]): SettingItem[] =>\n\t\t\tids.map((id) => byId.get(id)).filter((item): item is SettingItem => item !== undefined);\n\t\tconst categoryRow = (id: string, label: string, description: string, ids: string[]): SettingItem => {\n\t\t\tconst members = pick(ids);\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel,\n\t\t\t\tdescription,\n\t\t\t\tcurrentValue: `${members.length} setting${members.length === 1 ? \"\" : \"s\"}`,\n\t\t\t\t// Categories shortened the top level but also hid every setting from\n\t\t\t\t// its search: searching \"theme\" matched no category label. The member\n\t\t\t\t// labels ride along as search text so the query lands on the category\n\t\t\t\t// that holds the setting.\n\t\t\t\tkeywords: members.map((member) => member.label).join(\" \"),\n\t\t\t\tsubmenu: (_currentValue, done) => new CategorySubmenu(members, applyChange, () => done()),\n\t\t\t};\n\t\t};\n\n\t\tconst topItems: SettingItem[] = [\n\t\t\t...toolFlagGroup,\n\t\t\t// What the model is sent, and how much of it. Auto-compact used to sit\n\t\t\t// alone at the top level and context GC was filed under tool settings,\n\t\t\t// which left the three settings that decide the token budget in three\n\t\t\t// different places - with the light preset in none of them.\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-context\",\n\t\t\t\t\"Context\",\n\t\t\t\t\"What the model is sent and how much of it: compaction, superseded reads, and the low-token preset.\",\n\t\t\t\t[\"autocompact\", \"context-gc\", \"light\"],\n\t\t\t),\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-behavior\",\n\t\t\t\t\"Behavior\",\n\t\t\t\t\"Agent and session behavior: steering, follow-up, thinking, escape, tree filter, transport.\",\n\t\t\t\t[\"steering-mode\", \"follow-up-mode\", \"thinking\", \"double-escape-action\", \"tree-filter-mode\", \"transport\"],\n\t\t\t),\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-interface\",\n\t\t\t\t\"Interface\",\n\t\t\t\t\"Appearance and editor: theme, thinking visibility, cursor, border, padding, autocomplete, terminal.\",\n\t\t\t\t[\n\t\t\t\t\t\"theme\",\n\t\t\t\t\t\"hide-thinking\",\n\t\t\t\t\t\"show-hardware-cursor\",\n\t\t\t\t\t\"editor-border\",\n\t\t\t\t\t\"editor-padding\",\n\t\t\t\t\t\"autocomplete-max-visible\",\n\t\t\t\t\t\"clear-on-shrink\",\n\t\t\t\t\t\"terminal-progress\",\n\t\t\t\t],\n\t\t\t),\n\t\t\t// Artifact production. `plugin-install-scope` had no category and was\n\t\t\t// therefore unreachable from the pane despite having a live callback.\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-plugins\",\n\t\t\t\t\"Plugins\",\n\t\t\t\t\"The autonomous plugin system's master switch, the vendor layout hoocode writes, and where autonomous installs land.\",\n\t\t\t\t[\"plugin-tools\", \"platform\", \"plugin-install-scope\"],\n\t\t\t),\n\t\t\tcategoryRow(\"cat-images\", \"Images\", \"Inline image rendering and resizing.\", [\n\t\t\t\t\"show-images\",\n\t\t\t\t\"image-width-cells\",\n\t\t\t\t\"auto-resize-images\",\n\t\t\t\t\"block-images\",\n\t\t\t]),\n\t\t\t// Top level rather than folded into Advanced: these are the thresholds\n\t\t\t// that decide whether /learn finds anything, and burying them is what\n\t\t\t// made them undiscoverable in the first place.\n\t\t\tcategoryRow(\n\t\t\t\t\"cat-learn\",\n\t\t\t\t\"Learning\",\n\t\t\t\t\"Thresholds /learn mines sessions with: how far back to look, and how often something must repeat.\",\n\t\t\t\tLEARN_SETTINGS.map((setting) => setting.key),\n\t\t\t),\n\t\t\t// The external binaries. Top level, not folded into Advanced: their whole\n\t\t\t// problem was that nothing in the product ever said they existed, and a\n\t\t\t// row two levels down would have been the same silence with extra steps.\n\t\t\t// This is the only category built from live machine state rather than\n\t\t\t// settings, so it is assembled here instead of going through categoryRow.\n\t\t\t{\n\t\t\t\tid: \"cat-external\",\n\t\t\t\tlabel: \"External tools\",\n\t\t\t\tdescription: `Optional Rust binaries that expand what hoocode can do: ${externalSummary(config.externalTools)}. hoocode runs without every one of them - each row says what it adds and what happens without it.`,\n\t\t\t\tcurrentValue: externalCount(config.externalTools),\n\t\t\t\tkeywords: config.externalTools\n\t\t\t\t\t.flatMap((status) => [status.tool, status.label, ...status.settingsKeys])\n\t\t\t\t\t.join(\" \"),\n\t\t\t\tsubmenu: (_currentValue, done) => new ExternalToolsSubmenu(config.externalTools, () => done()),\n\t\t\t},\n\t\t\tcategoryRow(\"cat-advanced\", \"Advanced\", \"Startup, telemetry, skills, warnings, voice, and web tools.\", [\n\t\t\t\t\"quiet-startup\",\n\t\t\t\t\"collapse-changelog\",\n\t\t\t\t\"install-telemetry\",\n\t\t\t\t\"skill-commands\",\n\t\t\t\t\"warnings\",\n\t\t\t\t\"voice-silence-ms\",\n\t\t\t\t\"webtools-timeout-secs\",\n\t\t\t]),\n\t\t];\n\n\t\tthis.settingsList = new SettingsList(\n\t\t\ttopItems,\n\t\t\tMath.min(topItems.length, 10),\n\t\t\tgetSettingsListTheme(),\n\t\t\tapplyChange,\n\t\t\tcallbacks.onCancel,\n\t\t\t{\n\t\t\t\tenableSearch: true,\n\t\t\t},\n\t\t);\n\n\t\tthis.addChild(this.settingsList);\n\t\tif (initialSurface) {\n\t\t\tthis.surfaceLine = new Text(formatSurfaceLine(initialSurface), 0, 0);\n\t\t\tthis.addChild(this.surfaceLine);\n\t\t}\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\t/** Re-price the pane after a change that may have altered what each turn sends. */\n\tprivate refreshTokenSurface(): void {\n\t\tif (!this.surfaceLine || !this.measureTokenSurface) return;\n\t\tthis.surfaceLine.setText(formatSurfaceLine(this.measureTokenSurface()));\n\t}\n\n\tgetSettingsList(): SettingsList {\n\t\treturn this.settingsList;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The radar view's chain line: one line for a run of consecutive tool calls.
|
|
3
|
+
*
|
|
4
|
+
* Two renderings of the same chain, because a run that is still going and a run
|
|
5
|
+
* that is over answer different questions.
|
|
6
|
+
*
|
|
7
|
+
* While it runs you want the shape — what it did, in order, and where it broke:
|
|
8
|
+
*
|
|
9
|
+
* ◐ grep › read › bash✗ › edit › bash… 4 done · 1 failed · running
|
|
10
|
+
*
|
|
11
|
+
* Once it is over the order has stopped mattering and what is left is what it
|
|
12
|
+
* amounted to:
|
|
13
|
+
*
|
|
14
|
+
* ● Edited packages/tui/src/keys.ts 5 calls · 1 failed
|
|
15
|
+
*
|
|
16
|
+
* A chain that did *not* finish keeps the running form plus a marker. The
|
|
17
|
+
* settled form is a claim about what was accomplished, and a chain cut off
|
|
18
|
+
* partway through has no such claim to make — the same reason
|
|
19
|
+
* `settleDanglingMainTasks` refuses to mark an aborted turn's plan items done.
|
|
20
|
+
*
|
|
21
|
+
* Everything here is pure and deterministic. A model-written phase label would
|
|
22
|
+
* read better than the inferred one, but it would cost tokens on every turn and
|
|
23
|
+
* this agent's whole premise is that nothing happens you did not pay for on
|
|
24
|
+
* purpose.
|
|
25
|
+
*/
|
|
26
|
+
/** One tool call's contribution to its chain. */
|
|
27
|
+
export interface ChainEntry {
|
|
28
|
+
tool: string;
|
|
29
|
+
/** The call's subject — a path, a command, a pattern. */
|
|
30
|
+
subject: string;
|
|
31
|
+
isError: boolean;
|
|
32
|
+
/** Still executing. */
|
|
33
|
+
isPartial: boolean;
|
|
34
|
+
/** Lines of text output the call returned. */
|
|
35
|
+
outputLines: number;
|
|
36
|
+
}
|
|
37
|
+
export type ChainState =
|
|
38
|
+
/** Calls are still arriving or executing. */
|
|
39
|
+
"running"
|
|
40
|
+
/** Every call finished and the turn moved on cleanly. */
|
|
41
|
+
| "done"
|
|
42
|
+
/** The turn was aborted, errored, or hit a length cap partway through. */
|
|
43
|
+
| "interrupted";
|
|
44
|
+
export type SegmentTone = "ok" | "error" | "running";
|
|
45
|
+
export interface ChainSegment {
|
|
46
|
+
label: string;
|
|
47
|
+
tone: SegmentTone;
|
|
48
|
+
}
|
|
49
|
+
/** The `grep › read × 3 › bash✗` part of a running chain line. */
|
|
50
|
+
export declare function chainSegments(entries: ChainEntry[]): ChainSegment[];
|
|
51
|
+
/** The flush-right stats for either rendering. */
|
|
52
|
+
export declare function chainStats(entries: ChainEntry[], state: ChainState): string;
|
|
53
|
+
/**
|
|
54
|
+
* The settled chain's phrase: what this run amounted to.
|
|
55
|
+
*
|
|
56
|
+
* Deliberately one clause, not an inventory. "Edited packages/tui, read 6
|
|
57
|
+
* files, searched packages" is a worse line than "Edited packages/tui" — the
|
|
58
|
+
* count is already in the stats, and the per-call detail is one `alt+u` away.
|
|
59
|
+
*
|
|
60
|
+
* A location is only named when the calls actually share one. Naming a single
|
|
61
|
+
* arbitrary file out of five would read as a claim the chain never made, so
|
|
62
|
+
* several unrelated targets collapse to a count instead.
|
|
63
|
+
*/
|
|
64
|
+
export declare function chainPhrase(entries: ChainEntry[]): string;
|
|
65
|
+
//# sourceMappingURL=tool-chain-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-chain-summary.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-chain-summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,iDAAiD;AACjD,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,2DAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,uBAAuB;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,UAAU;AACrB,6CAA6C;AAC3C,SAAS;AACX,yDAAyD;GACvD,MAAM;AACR,0EAA0E;GACxE,aAAa,CAAC;AAEjB,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;CAClB;AAgFD,yEAAkE;AAClE,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAEnE;AAMD,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAoB3E;AA2CD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CA2BzD","sourcesContent":["/**\n * The radar view's chain line: one line for a run of consecutive tool calls.\n *\n * Two renderings of the same chain, because a run that is still going and a run\n * that is over answer different questions.\n *\n * While it runs you want the shape — what it did, in order, and where it broke:\n *\n * ◐ grep › read › bash✗ › edit › bash… 4 done · 1 failed · running\n *\n * Once it is over the order has stopped mattering and what is left is what it\n * amounted to:\n *\n * ● Edited packages/tui/src/keys.ts 5 calls · 1 failed\n *\n * A chain that did *not* finish keeps the running form plus a marker. The\n * settled form is a claim about what was accomplished, and a chain cut off\n * partway through has no such claim to make — the same reason\n * `settleDanglingMainTasks` refuses to mark an aborted turn's plan items done.\n *\n * Everything here is pure and deterministic. A model-written phase label would\n * read better than the inferred one, but it would cost tokens on every turn and\n * this agent's whole premise is that nothing happens you did not pay for on\n * purpose.\n */\n\n/** One tool call's contribution to its chain. */\nexport interface ChainEntry {\n\ttool: string;\n\t/** The call's subject — a path, a command, a pattern. */\n\tsubject: string;\n\tisError: boolean;\n\t/** Still executing. */\n\tisPartial: boolean;\n\t/** Lines of text output the call returned. */\n\toutputLines: number;\n}\n\nexport type ChainState =\n\t/** Calls are still arriving or executing. */\n\t| \"running\"\n\t/** Every call finished and the turn moved on cleanly. */\n\t| \"done\"\n\t/** The turn was aborted, errored, or hit a length cap partway through. */\n\t| \"interrupted\";\n\nexport type SegmentTone = \"ok\" | \"error\" | \"running\";\n\nexport interface ChainSegment {\n\tlabel: string;\n\ttone: SegmentTone;\n}\n\n/** Segments beyond this many are elided in the middle rather than wrapped. */\nconst MAX_SEGMENTS = 8;\n/** Kept at the head when eliding. */\nconst HEAD_SEGMENTS = 3;\n/** Kept at the tail when eliding. */\nconst TAIL_SEGMENTS = 2;\n\nfunction tone(entry: ChainEntry): SegmentTone {\n\tif (entry.isError) return \"error\";\n\tif (entry.isPartial) return \"running\";\n\treturn \"ok\";\n}\n\n/**\n * Collapse consecutive calls to the same tool into one segment.\n *\n * A run of five reads is one act, not five, and spelling it out crowds out the\n * calls either side of it. A failure never merges: `read ×4` hiding one broken\n * read would defeat the point of the line.\n */\nfunction collapseRepeats(entries: ChainEntry[]): ChainSegment[] {\n\tconst segments: ChainSegment[] = [];\n\tlet index = 0;\n\twhile (index < entries.length) {\n\t\tconst entry = entries[index];\n\t\tconst entryTone = tone(entry);\n\t\tlet run = 1;\n\t\twhile (\n\t\t\tindex + run < entries.length &&\n\t\t\tentries[index + run].tool === entry.tool &&\n\t\t\ttone(entries[index + run]) === entryTone &&\n\t\t\tentryTone === \"ok\"\n\t\t) {\n\t\t\trun++;\n\t\t}\n\t\tconst marker = entryTone === \"error\" ? \"✗\" : \"\";\n\t\tsegments.push({ label: run > 1 ? `${entry.tool} ×${run}` : `${entry.tool}${marker}`, tone: entryTone });\n\t\tindex += run;\n\t}\n\treturn segments;\n}\n\n/**\n * Elide the middle of a long chain, keeping both ends legible.\n *\n * Failures are never elided. Where a run broke is the one thing the line exists\n * to show, and a long chain is exactly when you most need it — hiding the ✗\n * inside \"… 22 more …\" would leave the stats claiming a failure the line cannot\n * point at.\n */\nfunction capSegments(segments: ChainSegment[]): ChainSegment[] {\n\tif (segments.length <= MAX_SEGMENTS) return segments;\n\n\tconst keep = new Set<number>();\n\tfor (let i = 0; i < HEAD_SEGMENTS; i++) keep.add(i);\n\tfor (let i = segments.length - TAIL_SEGMENTS; i < segments.length; i++) keep.add(i);\n\tsegments.forEach((segment, i) => {\n\t\tif (segment.tone === \"error\") keep.add(i);\n\t});\n\n\tconst out: ChainSegment[] = [];\n\tlet gap = 0;\n\tconst flushGap = () => {\n\t\tif (gap > 0) out.push({ label: `… ${gap} more …`, tone: \"ok\" });\n\t\tgap = 0;\n\t};\n\tsegments.forEach((segment, i) => {\n\t\tif (keep.has(i)) {\n\t\t\tflushGap();\n\t\t\tout.push(segment);\n\t\t} else {\n\t\t\tgap++;\n\t\t}\n\t});\n\tflushGap();\n\treturn out;\n}\n\n/** The `grep › read × 3 › bash✗` part of a running chain line. */\nexport function chainSegments(entries: ChainEntry[]): ChainSegment[] {\n\treturn capSegments(collapseRepeats(entries));\n}\n\nfunction plural(n: number, one: string, many = `${one}s`): string {\n\treturn `${n} ${n === 1 ? one : many}`;\n}\n\n/** The flush-right stats for either rendering. */\nexport function chainStats(entries: ChainEntry[], state: ChainState): string {\n\tconst failed = entries.filter((e) => e.isError).length;\n\tconst parts: string[] = [];\n\n\tif (state === \"running\") {\n\t\tparts.push(`${entries.filter((e) => !e.isPartial).length} done`);\n\t} else {\n\t\tparts.push(plural(entries.length, \"call\"));\n\t}\n\tif (failed > 0) parts.push(`${failed} failed`);\n\n\tif (state === \"running\") {\n\t\tparts.push(\"running\");\n\t} else if (state === \"interrupted\") {\n\t\tparts.push(\"interrupted\");\n\t} else {\n\t\tconst lines = entries.reduce((sum, e) => sum + e.outputLines, 0);\n\t\tif (lines > 0) parts.push(plural(lines, \"line\"));\n\t}\n\treturn parts.join(\" · \");\n}\n\n/**\n * Tool families, in the order a settled chain reports them.\n *\n * The ordering is the whole trick: a chain that read six files and then changed\n * one is remembered as the edit. Mutation outranks execution outranks reading\n * outranks searching, so the phrase names the most consequential thing the\n * chain did rather than the most frequent.\n */\nconst FAMILIES: Array<{ verb: string; noun: string; tools: string[] }> = [\n\t{ verb: \"Edited\", noun: \"file\", tools: [\"edit\", \"write\", \"MultiEdit\", \"NotebookEdit\"] },\n\t{ verb: \"Ran\", noun: \"command\", tools: [\"bash\"] },\n\t{ verb: \"Delegated\", noun: \"task\", tools: [\"Task\", \"TaskOutput\"] },\n\t{ verb: \"Fetched\", noun: \"page\", tools: [\"webfetch\", \"websearch\"] },\n\t{ verb: \"Read\", noun: \"file\", tools: [\"read\"] },\n\t{ verb: \"Searched\", noun: \"search\", tools: [\"grep\", \"find\", \"search\", \"ls\"] },\n];\n\n/** Longest common directory prefix of the given paths, or \"\" when they share none. */\nfunction commonPathPrefix(paths: string[]): string {\n\tif (paths.length === 0) return \"\";\n\tconst split = paths.map((p) => p.split(\"/\").filter(Boolean));\n\tconst [first, ...rest] = split;\n\tconst prefix: string[] = [];\n\tfor (let i = 0; i < first.length; i++) {\n\t\tif (rest.every((parts) => parts[i] === first[i])) prefix.push(first[i]);\n\t\telse break;\n\t}\n\treturn prefix.join(\"/\");\n}\n\n/**\n * Whether a subject can stand in for a location.\n *\n * Globs are excluded even though they look pathlike: \"Searched *.test.ts\" reads\n * as a place the chain worked in, which is exactly what it is not.\n */\nfunction usableAsTarget(subject: string): boolean {\n\tif (/[*?]/.test(subject)) return false;\n\treturn subject.includes(\"/\") || /\\.[a-zA-Z0-9]+$/.test(subject);\n}\n\n/**\n * The settled chain's phrase: what this run amounted to.\n *\n * Deliberately one clause, not an inventory. \"Edited packages/tui, read 6\n * files, searched packages\" is a worse line than \"Edited packages/tui\" — the\n * count is already in the stats, and the per-call detail is one `alt+u` away.\n *\n * A location is only named when the calls actually share one. Naming a single\n * arbitrary file out of five would read as a claim the chain never made, so\n * several unrelated targets collapse to a count instead.\n */\nexport function chainPhrase(entries: ChainEntry[]): string {\n\tif (entries.length === 0) return \"No calls\";\n\n\tfor (const family of FAMILIES) {\n\t\tconst matched = entries.filter((e) => family.tools.includes(e.tool));\n\t\tif (matched.length === 0) continue;\n\n\t\tconst subjects = matched.map((e) => e.subject).filter(Boolean);\n\n\t\t// A lone call is fully described by its own subject, whatever shape it is:\n\t\t// a command, a pattern, a URL, a path.\n\t\tif (matched.length === 1 && subjects.length === 1) {\n\t\t\treturn `${family.verb} ${subjects[0]}`;\n\t\t}\n\n\t\t// Several calls: name the place they share, or fall back to a count.\n\t\tconst target = commonPathPrefix(subjects.filter(usableAsTarget));\n\t\tif (target) return `${family.verb} ${target}`;\n\t\t// Searching has no natural plural noun (\"3 searches\" says nothing the\n\t\t// stats do not), so the bare verb carries it.\n\t\tif (family.noun === \"search\") return \"Explored\";\n\t\treturn `${family.verb} ${plural(matched.length, family.noun)}`;\n\t}\n\n\t// An unrecognised tool set still gets a line rather than a blank.\n\tconst names = [...new Set(entries.map((e) => e.tool))];\n\treturn names.length === 1 ? `Called ${names[0]}` : `Called ${plural(names.length, \"tool\")}`;\n}\n"]}
|