@caupulican/pi-adaptative 0.81.26 → 0.81.29
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 +45 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +3 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +4 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +19 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +30 -12
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +128 -36
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +6 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +35 -0
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/autonomy/bounded-completion.d.ts.map +1 -1
- package/dist/core/autonomy/bounded-completion.js +59 -19
- package/dist/core/autonomy/bounded-completion.js.map +1 -1
- package/dist/core/autonomy/contracts.d.ts +2 -0
- package/dist/core/autonomy/contracts.d.ts.map +1 -1
- package/dist/core/autonomy/contracts.js.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.d.ts +31 -0
- package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -0
- package/dist/core/autonomy/lane-tool-surface.js +96 -0
- package/dist/core/autonomy/lane-tool-surface.js.map +1 -0
- package/dist/core/autonomy/lane-tracker.d.ts +5 -0
- package/dist/core/autonomy/lane-tracker.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tracker.js +14 -3
- package/dist/core/autonomy/lane-tracker.js.map +1 -1
- package/dist/core/background-lane-controller.d.ts +28 -4
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +237 -28
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/billing-failover-controller.d.ts.map +1 -1
- package/dist/core/billing-failover-controller.js +1 -1
- package/dist/core/billing-failover-controller.js.map +1 -1
- package/dist/core/context/current-work-memory.d.ts +9 -0
- package/dist/core/context/current-work-memory.d.ts.map +1 -0
- package/dist/core/context/current-work-memory.js +61 -0
- package/dist/core/context/current-work-memory.js.map +1 -0
- package/dist/core/context/file-store-memory-provider.d.ts +9 -0
- package/dist/core/context/file-store-memory-provider.d.ts.map +1 -0
- package/dist/core/context/file-store-memory-provider.js +106 -0
- package/dist/core/context/file-store-memory-provider.js.map +1 -0
- package/dist/core/context/long-term-memory-trigger.d.ts +15 -0
- package/dist/core/context/long-term-memory-trigger.d.ts.map +1 -0
- package/dist/core/context/long-term-memory-trigger.js +39 -0
- package/dist/core/context/long-term-memory-trigger.js.map +1 -0
- package/dist/core/context/memory-prompt-block.d.ts +3 -1
- package/dist/core/context/memory-prompt-block.d.ts.map +1 -1
- package/dist/core/context/memory-prompt-block.js +20 -3
- package/dist/core/context/memory-prompt-block.js.map +1 -1
- package/dist/core/context/memory-prompt-budget.d.ts +17 -0
- package/dist/core/context/memory-prompt-budget.d.ts.map +1 -0
- package/dist/core/context/memory-prompt-budget.js +64 -0
- package/dist/core/context/memory-prompt-budget.js.map +1 -0
- package/dist/core/context/memory-provider-contract.d.ts.map +1 -1
- package/dist/core/context/memory-provider-contract.js +2 -5
- package/dist/core/context/memory-provider-contract.js.map +1 -1
- package/dist/core/context/memory-tier-composer.d.ts +27 -0
- package/dist/core/context/memory-tier-composer.d.ts.map +1 -0
- package/dist/core/context/memory-tier-composer.js +79 -0
- package/dist/core/context/memory-tier-composer.js.map +1 -0
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +2 -0
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/context-pipeline.d.ts +5 -3
- package/dist/core/context-pipeline.d.ts.map +1 -1
- package/dist/core/context-pipeline.js +15 -5
- package/dist/core/context-pipeline.js.map +1 -1
- package/dist/core/cost/cost-summary.d.ts +3 -1
- package/dist/core/cost/cost-summary.d.ts.map +1 -1
- package/dist/core/cost/cost-summary.js +3 -3
- package/dist/core/cost/cost-summary.js.map +1 -1
- package/dist/core/cost-guard.d.ts +17 -7
- package/dist/core/cost-guard.d.ts.map +1 -1
- package/dist/core/cost-guard.js +33 -10
- package/dist/core/cost-guard.js.map +1 -1
- package/dist/core/default-tool-surface.d.ts +9 -0
- package/dist/core/default-tool-surface.d.ts.map +1 -0
- package/dist/core/default-tool-surface.js +18 -0
- package/dist/core/default-tool-surface.js.map +1 -0
- package/dist/core/delegation/worker-result.d.ts.map +1 -1
- package/dist/core/delegation/worker-result.js +3 -0
- package/dist/core/delegation/worker-result.js.map +1 -1
- package/dist/core/delegation/worker-runner.d.ts +11 -5
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +77 -16
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +15 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +2 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +9 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/failure-corpus.d.ts.map +1 -1
- package/dist/core/failure-corpus.js +2 -4
- package/dist/core/failure-corpus.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +9 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.js +4 -3
- package/dist/core/goals/goal-continuation-prompt.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +12 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +42 -4
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/local-runtime-controller.d.ts +16 -0
- package/dist/core/local-runtime-controller.d.ts.map +1 -1
- package/dist/core/local-runtime-controller.js +107 -28
- package/dist/core/local-runtime-controller.js.map +1 -1
- package/dist/core/memory/memory-manager.d.ts +8 -3
- package/dist/core/memory/memory-manager.d.ts.map +1 -1
- package/dist/core/memory/memory-manager.js +27 -11
- package/dist/core/memory/memory-manager.js.map +1 -1
- package/dist/core/memory/memory-provider.d.ts +5 -1
- package/dist/core/memory/memory-provider.d.ts.map +1 -1
- package/dist/core/memory/memory-provider.js.map +1 -1
- package/dist/core/memory/providers/file-store.d.ts +3 -1
- package/dist/core/memory/providers/file-store.d.ts.map +1 -1
- package/dist/core/memory/providers/file-store.js +7 -2
- package/dist/core/memory/providers/file-store.js.map +1 -1
- package/dist/core/memory/providers/transcript-recall.d.ts +1 -0
- package/dist/core/memory/providers/transcript-recall.d.ts.map +1 -1
- package/dist/core/memory/providers/transcript-recall.js +4 -7
- package/dist/core/memory/providers/transcript-recall.js.map +1 -1
- package/dist/core/memory-controller.d.ts +36 -10
- package/dist/core/memory-controller.d.ts.map +1 -1
- package/dist/core/memory-controller.js +137 -21
- package/dist/core/memory-controller.js.map +1 -1
- package/dist/core/model-registry.d.ts +25 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +91 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +30 -11
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +33 -29
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/model-selection-controller.d.ts +3 -0
- package/dist/core/model-selection-controller.d.ts.map +1 -1
- package/dist/core/model-selection-controller.js +8 -1
- package/dist/core/model-selection-controller.js.map +1 -1
- package/dist/core/models/local-runtime.d.ts +2 -0
- package/dist/core/models/local-runtime.d.ts.map +1 -1
- package/dist/core/models/local-runtime.js +10 -4
- package/dist/core/models/local-runtime.js.map +1 -1
- package/dist/core/models/perf-profile.d.ts.map +1 -1
- package/dist/core/models/perf-profile.js +95 -33
- package/dist/core/models/perf-profile.js.map +1 -1
- package/dist/core/models/runtime-arbiter.d.ts +11 -0
- package/dist/core/models/runtime-arbiter.d.ts.map +1 -1
- package/dist/core/models/runtime-arbiter.js +35 -13
- package/dist/core/models/runtime-arbiter.js.map +1 -1
- package/dist/core/profile-filter-controller.d.ts +11 -0
- package/dist/core/profile-filter-controller.d.ts.map +1 -1
- package/dist/core/profile-filter-controller.js +56 -11
- package/dist/core/profile-filter-controller.js.map +1 -1
- package/dist/core/profile-registry.d.ts +2 -2
- package/dist/core/profile-registry.d.ts.map +1 -1
- package/dist/core/profile-registry.js +58 -7
- package/dist/core/profile-registry.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +9 -7
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +81 -12
- package/dist/core/reflection-controller.js.map +1 -1
- package/dist/core/research/research-runner.d.ts +2 -2
- package/dist/core/research/research-runner.d.ts.map +1 -1
- package/dist/core/research/research-runner.js +8 -6
- package/dist/core/research/research-runner.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -2
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +11 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-builder.d.ts +30 -3
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +140 -40
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/sdk.d.ts +8 -7
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +38 -5
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/security/secret-text.d.ts +3 -0
- package/dist/core/security/secret-text.d.ts.map +1 -0
- package/dist/core/security/secret-text.js +26 -0
- package/dist/core/security/secret-text.js.map +1 -0
- package/dist/core/settings-manager.d.ts +59 -17
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +300 -51
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +7 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +23 -1
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/tool-gate-controller.d.ts +3 -0
- package/dist/core/tool-gate-controller.d.ts.map +1 -1
- package/dist/core/tool-gate-controller.js +20 -15
- package/dist/core/tool-gate-controller.js.map +1 -1
- package/dist/core/tool-selection/expected-utility.d.ts +51 -0
- package/dist/core/tool-selection/expected-utility.d.ts.map +1 -0
- package/dist/core/tool-selection/expected-utility.js +85 -0
- package/dist/core/tool-selection/expected-utility.js.map +1 -0
- package/dist/core/tool-selection/tool-performance-store.d.ts +82 -0
- package/dist/core/tool-selection/tool-performance-store.d.ts.map +1 -0
- package/dist/core/tool-selection/tool-performance-store.js +249 -0
- package/dist/core/tool-selection/tool-performance-store.js.map +1 -0
- package/dist/core/tool-selection/tool-selection-controller.d.ts +41 -0
- package/dist/core/tool-selection/tool-selection-controller.d.ts.map +1 -0
- package/dist/core/tool-selection/tool-selection-controller.js +199 -0
- package/dist/core/tool-selection/tool-selection-controller.js.map +1 -0
- package/dist/core/tools/delegate-status.d.ts +9 -0
- package/dist/core/tools/delegate-status.d.ts.map +1 -0
- package/dist/core/tools/delegate-status.js +52 -0
- package/dist/core/tools/delegate-status.js.map +1 -0
- package/dist/core/tools/delegate.d.ts +10 -0
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +36 -13
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/run-toolkit-script.d.ts +3 -0
- package/dist/core/tools/run-toolkit-script.d.ts.map +1 -1
- package/dist/core/tools/run-toolkit-script.js +17 -7
- package/dist/core/tools/run-toolkit-script.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +8 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +69 -29
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/config-backup.d.ts +7 -1
- package/dist/modes/interactive/config-backup.d.ts.map +1 -1
- package/dist/modes/interactive/config-backup.js +196 -32
- package/dist/modes/interactive/config-backup.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +22 -28
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/local-model-commands.d.ts.map +1 -1
- package/dist/modes/interactive/local-model-commands.js +2 -0
- package/dist/modes/interactive/local-model-commands.js.map +1 -1
- package/dist/modes/interactive/profile-menu-controller.d.ts +6 -4
- package/dist/modes/interactive/profile-menu-controller.d.ts.map +1 -1
- package/dist/modes/interactive/profile-menu-controller.js +248 -65
- package/dist/modes/interactive/profile-menu-controller.js.map +1 -1
- package/dist/modes/interactive/report-commands.d.ts.map +1 -1
- package/dist/modes/interactive/report-commands.js +8 -2
- package/dist/modes/interactive/report-commands.js.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.d.ts.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.js +8 -0
- package/dist/modes/interactive/settings-selector-flow.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +3 -1
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/docs/extensions.md +32 -0
- package/docs/integration-sweep-builder-blueprint-2026-07-09.md +365 -0
- package/docs/integration-sweep-resume-2026-07-09.md +407 -0
- package/docs/resources.md +15 -7
- package/docs/settings.md +56 -5
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/preset.ts +2 -2
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +44 -35
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-commands.js","sourceRoot":"","sources":["../../../src/modes/interactive/report-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIlD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAA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AC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACnF,aAAa,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;AAAA,CACD","sourcesContent":["/**\n * Read-only report and easter-egg commands extracted from interactive-mode.\n *\n * These build informational output (usage/cost summary, changelog, hotkeys\n * table, render debug dump) or render an easter-egg component, appending to the\n * chat container and requesting a render. None mutate agent/session state, so\n * they operate through narrow `host` seams (chat container, TUI, and a few\n * read accessors) while interactive-mode keeps thin delegating wrappers.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { Container, Keybinding, MarkdownTheme, TUI } from \"@caupulican/pi-tui\";\nimport { Markdown, Spacer, Text, visibleWidth } from \"@caupulican/pi-tui\";\nimport { getDebugLogPath } from \"../../config.ts\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AppKeybinding, KeybindingsManager } from \"../../core/keybindings.ts\";\nimport type { AutoLearnSettings } from \"../../core/settings-manager.ts\";\nimport { getChangelogPath, parseChangelog } from \"../../utils/changelog.ts\";\nimport { getProcessMemoryMb } from \"../../utils/process-memory.ts\";\nimport { ArminComponent } from \"./components/armin.ts\";\nimport { DaxnutsComponent } from \"./components/daxnuts.ts\";\nimport { DynamicBorder } from \"./components/dynamic-border.ts\";\nimport { EarendilAnnouncementComponent } from \"./components/earendil-announcement.ts\";\nimport { formatKeyText } from \"./components/keybinding-hints.ts\";\nimport { theme } from \"./theme/theme.ts\";\n\nexport interface ReportRenderHost {\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n}\n\nexport interface UsageReportHost extends ReportRenderHost {\n\treadonly session: AgentSession;\n\tgetCurrentAutoLearnSettings(): Required<AutoLearnSettings>;\n}\n\nexport interface ChangelogReportHost extends ReportRenderHost {\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n}\n\nexport interface HotkeysReportHost extends ReportRenderHost {\n\treadonly session: AgentSession;\n\treadonly keybindings: KeybindingsManager;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tgetAppKeyDisplay(action: AppKeybinding): string;\n\tgetEditorKeyDisplay(action: Keybinding): string;\n}\n\nexport interface DebugReportHost extends ReportRenderHost {\n\treadonly session: AgentSession;\n}\n\nexport function handleUsageCommand(host: UsageReportHost): void {\n\tconst stats = host.session.getSessionStats();\n\tconst costs = host.session.getCostSummary();\n\tconst context = host.session.getContextUsage();\n\tconst autoLearn = host.getCurrentAutoLearnSettings();\n\tconst costGuard = host.session.getLastCostGuardDecision();\n\n\tlet info = `${theme.bold(\"Usage & Optimization\")}\\n\\n`;\n\tinfo += `${theme.bold(\"Session tokens\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Input:\")} ${stats.tokens.input.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Output:\")} ${stats.tokens.output.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Cache read:\")} ${stats.tokens.cacheRead.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Cache write:\")} ${stats.tokens.cacheWrite.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Total:\")} ${stats.tokens.total.toLocaleString()}\\n\\n`;\n\n\tinfo += `${theme.bold(\"Cost\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"CURRENT (session):\")} $${costs.currentCost.toFixed(4)}\\n`;\n\tif (costs.subagentReports > 0 || costs.subagentCost > 0) {\n\t\tinfo += `${theme.fg(\"dim\", \"SUBAGENTS (included in CURRENT):\")} $${costs.subagentCost.toFixed(4)} (${costs.subagentReports} reports)\\n`;\n\t}\n\tinfo += `${theme.fg(\"dim\", \"TODAY (host local day):\")} $${costs.todayCost.toFixed(4)}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Today rollover:\")} local midnight\\n\\n`;\n\n\tconst processMemory = getProcessMemoryMb();\n\tinfo += `${theme.bold(\"Process\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Memory:\")} rss ${processMemory.rssMb}MB, heap ${processMemory.heapUsedMb}MB, external ${processMemory.externalMb}MB\\n\\n`;\n\n\tinfo += `${theme.bold(\"Optimization state\")}\\n`;\n\tconst contextPercent = context?.percent;\n\tconst contextTokens = context?.tokens;\n\tif (\n\t\tcontext &&\n\t\tcontextPercent !== undefined &&\n\t\tcontextPercent !== null &&\n\t\tcontextTokens !== undefined &&\n\t\tcontextTokens !== null\n\t) {\n\t\tinfo += `${theme.fg(\"dim\", \"Context:\")} ${contextPercent.toFixed(1)}% (${contextTokens.toLocaleString()}/${context.contextWindow.toLocaleString()})\\n`;\n\t} else {\n\t\tinfo += `${theme.fg(\"dim\", \"Context:\")} unknown until next provider usage sample\\n`;\n\t}\n\tinfo += `${theme.fg(\"dim\", \"Auto-compaction:\")} ${host.session.autoCompactionEnabled ? \"enabled\" : \"disabled\"}\\n`;\n\tconst compactionGates = stats.compactionGates ?? {\n\t\tgateFailures: 0,\n\t\tdeterministicGapFills: 0,\n\t\tcompactionsWithGateFailures: 0,\n\t};\n\tinfo += `${theme.fg(\"dim\", \"Compaction gate failures:\")} ${compactionGates.gateFailures} (${compactionGates.deterministicGapFills} deterministic gap-fill)\\n`;\n\tif (costGuard) {\n\t\tconst status = costGuard.over ? \"over\" : \"ok\";\n\t\tinfo += `${theme.fg(\"dim\", \"Cost guard:\")} ${status} $${costGuard.estUsd.toFixed(4)}/$${costGuard.thresholdUsd.toFixed(4)} (${costGuard.action})\\n`;\n\t} else {\n\t\tinfo += `${theme.fg(\"dim\", \"Cost guard:\")} disabled\\n`;\n\t}\n\tinfo += `${theme.fg(\"dim\", \"Auto Learn:\")} ${autoLearn.enabled ? \"enabled\" : \"disabled\"}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Scavenger model:\")} ${autoLearn.model || \"active\"}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Reflection review:\")} ${autoLearn.reflectionReview ? \"enabled\" : \"disabled\"} (${autoLearn.reflectionMinToolCalls} tool-call trigger)\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Auto Learn concurrency:\")} ${autoLearn.maxConcurrentLearners} learner(s), ${autoLearn.cooldownMinutes}m cooldown\\n\\n`;\n\n\tinfo += `${theme.bold(\"Model Router\")}\\n`;\n\tinfo += `${host.session.getModelRouterStatus((label) => theme.fg(\"dim\", label))}\\n\\n`;\n\n\tinfo += `${theme.bold(\"Manual controls\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"/compact\")}: compact the active context now\\n`;\n\tinfo += `${theme.fg(\"dim\", \"/settings\")}: adjust Auto Learn, cost guard, compaction, and model-router config\\n`;\n\tinfo += `${theme.fg(\"dim\", \"/auto-learn status|run\")}: inspect or launch background learning\\n`;\n\tinfo += `${theme.fg(\"dim\", \"context_audit\")}: ask the agent to inspect provider-visible context contributors\\n`;\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Text(info, 1, 0));\n\thost.ui.requestRender();\n}\n\nexport function handleChangelogCommand(host: ChangelogReportHost): void {\n\tconst changelogPath = getChangelogPath();\n\tconst allEntries = parseChangelog(changelogPath);\n\n\tconst changelogMarkdown =\n\t\tallEntries.length > 0\n\t\t\t? allEntries\n\t\t\t\t\t.reverse()\n\t\t\t\t\t.map((e) => e.content)\n\t\t\t\t\t.join(\"\\n\\n\")\n\t\t\t: \"No changelog entries found.\";\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.chatContainer.addChild(new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0));\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, host.getMarkdownThemeWithSettings()));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.ui.requestRender();\n}\n\nexport function handleHotkeysCommand(host: HotkeysReportHost): void {\n\t// Navigation keybindings\n\tconst cursorUp = host.getEditorKeyDisplay(\"tui.editor.cursorUp\");\n\tconst cursorDown = host.getEditorKeyDisplay(\"tui.editor.cursorDown\");\n\tconst cursorLeft = host.getEditorKeyDisplay(\"tui.editor.cursorLeft\");\n\tconst cursorRight = host.getEditorKeyDisplay(\"tui.editor.cursorRight\");\n\tconst cursorWordLeft = host.getEditorKeyDisplay(\"tui.editor.cursorWordLeft\");\n\tconst cursorWordRight = host.getEditorKeyDisplay(\"tui.editor.cursorWordRight\");\n\tconst cursorLineStart = host.getEditorKeyDisplay(\"tui.editor.cursorLineStart\");\n\tconst cursorLineEnd = host.getEditorKeyDisplay(\"tui.editor.cursorLineEnd\");\n\tconst jumpForward = host.getEditorKeyDisplay(\"tui.editor.jumpForward\");\n\tconst jumpBackward = host.getEditorKeyDisplay(\"tui.editor.jumpBackward\");\n\tconst pageUp = host.getEditorKeyDisplay(\"tui.editor.pageUp\");\n\tconst pageDown = host.getEditorKeyDisplay(\"tui.editor.pageDown\");\n\n\t// Editing keybindings\n\tconst submit = host.getEditorKeyDisplay(\"tui.input.submit\");\n\tconst newLine = host.getEditorKeyDisplay(\"tui.input.newLine\");\n\tconst deleteWordBackward = host.getEditorKeyDisplay(\"tui.editor.deleteWordBackward\");\n\tconst deleteWordForward = host.getEditorKeyDisplay(\"tui.editor.deleteWordForward\");\n\tconst deleteToLineStart = host.getEditorKeyDisplay(\"tui.editor.deleteToLineStart\");\n\tconst deleteToLineEnd = host.getEditorKeyDisplay(\"tui.editor.deleteToLineEnd\");\n\tconst yank = host.getEditorKeyDisplay(\"tui.editor.yank\");\n\tconst yankPop = host.getEditorKeyDisplay(\"tui.editor.yankPop\");\n\tconst undo = host.getEditorKeyDisplay(\"tui.editor.undo\");\n\tconst tab = host.getEditorKeyDisplay(\"tui.input.tab\");\n\n\t// App keybindings\n\tconst interrupt = host.getAppKeyDisplay(\"app.interrupt\");\n\tconst clear = host.getAppKeyDisplay(\"app.clear\");\n\tconst exit = host.getAppKeyDisplay(\"app.exit\");\n\tconst suspend = host.getAppKeyDisplay(\"app.suspend\");\n\tconst cycleThinkingLevel = host.getAppKeyDisplay(\"app.thinking.cycle\");\n\tconst cycleModelForward = host.getAppKeyDisplay(\"app.model.cycleForward\");\n\tconst selectModel = host.getAppKeyDisplay(\"app.model.select\");\n\tconst expandTools = host.getAppKeyDisplay(\"app.tools.expand\");\n\tconst toggleThinking = host.getAppKeyDisplay(\"app.thinking.toggle\");\n\tconst externalEditor = host.getAppKeyDisplay(\"app.editor.external\");\n\tconst cycleModelBackward = host.getAppKeyDisplay(\"app.model.cycleBackward\");\n\tconst followUp = host.getAppKeyDisplay(\"app.message.followUp\");\n\tconst dequeue = host.getAppKeyDisplay(\"app.message.dequeue\");\n\tconst pasteImage = host.getAppKeyDisplay(\"app.clipboard.pasteImage\");\n\n\tlet hotkeys = `\n**Navigation**\n| Key | Action |\n|-----|--------|\n| \\`${cursorUp}\\` / \\`${cursorDown}\\` / \\`${cursorLeft}\\` / \\`${cursorRight}\\` | Move cursor / browse history (Up when empty) |\n| \\`${cursorWordLeft}\\` / \\`${cursorWordRight}\\` | Move by word |\n| \\`${cursorLineStart}\\` | Start of line |\n| \\`${cursorLineEnd}\\` | End of line |\n| \\`${jumpForward}\\` | Jump forward to character |\n| \\`${jumpBackward}\\` | Jump backward to character |\n| \\`${pageUp}\\` / \\`${pageDown}\\` | Scroll by page |\n\n**Editing**\n| Key | Action |\n|-----|--------|\n| \\`${submit}\\` | Send message |\n| \\`${newLine}\\` | New line${process.platform === \"win32\" ? \" (Ctrl+Enter on Windows Terminal)\" : \"\"} |\n| \\`${deleteWordBackward}\\` | Delete word backwards |\n| \\`${deleteWordForward}\\` | Delete word forwards |\n| \\`${deleteToLineStart}\\` | Delete to start of line |\n| \\`${deleteToLineEnd}\\` | Delete to end of line |\n| \\`${yank}\\` | Paste the most-recently-deleted text |\n| \\`${yankPop}\\` | Cycle through the deleted text after pasting |\n| \\`${undo}\\` | Undo |\n\n**Other**\n| Key | Action |\n|-----|--------|\n| \\`${tab}\\` | Path completion / accept autocomplete |\n| \\`${interrupt}\\` | Cancel autocomplete / abort streaming |\n| \\`${clear}\\` | Clear editor (first) / exit (second) |\n| \\`${exit}\\` | Exit (when editor is empty) |\n| \\`${suspend}\\` | Suspend to background |\n| \\`${cycleThinkingLevel}\\` | Cycle thinking level |\n| \\`${cycleModelForward}\\` / \\`${cycleModelBackward}\\` | Cycle models |\n| \\`${selectModel}\\` | Open model selector |\n| \\`${expandTools}\\` | Toggle tool output expansion |\n| \\`${toggleThinking}\\` | Toggle thinking block visibility |\n| \\`${externalEditor}\\` | Edit message in external editor |\n| \\`${followUp}\\` | Queue follow-up message |\n| \\`${dequeue}\\` | Restore queued messages |\n| \\`${pasteImage}\\` | Paste image from clipboard |\n| \\`/\\` | Slash commands |\n| \\`!\\` | Run bash command |\n| \\`!!\\` | Run bash command (excluded from context) |\n`;\n\n\t// Add extension-registered shortcuts\n\tconst extensionRunner = host.session.extensionRunner;\n\tconst shortcuts = extensionRunner.getShortcuts(host.keybindings.getEffectiveConfig());\n\tif (shortcuts.size > 0) {\n\t\thotkeys += `\n**Extensions**\n| Key | Action |\n|-----|--------|\n`;\n\t\tfor (const [key, shortcut] of shortcuts) {\n\t\t\tconst description = shortcut.description ?? shortcut.extensionPath;\n\t\t\tconst keyDisplay = formatKeyText(key, { capitalize: true });\n\t\t\thotkeys += `| \\`${keyDisplay}\\` | ${description} |\\n`;\n\t\t}\n\t}\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.chatContainer.addChild(new Text(theme.bold(theme.fg(\"accent\", \"Keyboard Shortcuts\")), 1, 0));\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, host.getMarkdownThemeWithSettings()));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.ui.requestRender();\n}\n\nexport function handleDebugCommand(host: DebugReportHost): void {\n\tconst width = host.ui.terminal.columns;\n\tconst height = host.ui.terminal.rows;\n\tconst allLines = host.ui.render(width);\n\n\tconst debugLogPath = getDebugLogPath();\n\tconst debugData = [\n\t\t`Debug output at ${new Date().toISOString()}`,\n\t\t`Terminal: ${width}x${height}`,\n\t\t`Total lines: ${allLines.length}`,\n\t\t\"\",\n\t\t\"=== All rendered lines with visible widths ===\",\n\t\t...allLines.map((line, idx) => {\n\t\t\tconst vw = visibleWidth(line);\n\t\t\tconst escaped = JSON.stringify(line);\n\t\t\treturn `[${idx}] (w=${vw}) ${escaped}`;\n\t\t}),\n\t\t\"\",\n\t\t\"=== Agent messages (JSONL) ===\",\n\t\t...host.session.messages.map((msg) => JSON.stringify(msg)),\n\t\t\"\",\n\t].join(\"\\n\");\n\n\tfs.mkdirSync(path.dirname(debugLogPath), { recursive: true });\n\tfs.writeFileSync(debugLogPath, debugData);\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(\n\t\tnew Text(`${theme.fg(\"accent\", \"✓ Debug log written\")}\\n${theme.fg(\"muted\", debugLogPath)}`, 1, 1),\n\t);\n\thost.ui.requestRender();\n}\n\nexport function handleArminSaysHi(host: ReportRenderHost): void {\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new ArminComponent(host.ui));\n\thost.ui.requestRender();\n}\n\nexport function handleDementedDelves(host: ReportRenderHost): void {\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new EarendilAnnouncementComponent());\n\thost.ui.requestRender();\n}\n\nexport function handleDaxnuts(host: ReportRenderHost): void {\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new DaxnutsComponent(host.ui));\n\thost.ui.requestRender();\n}\n\nexport function checkDaxnutsEasterEgg(host: ReportRenderHost, model: { provider: string; id: string }): void {\n\tif (model.provider === \"opencode\" && model.id.toLowerCase().includes(\"kimi-k2.5\")) {\n\t\thandleDaxnuts(host);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"report-commands.js","sourceRoot":"","sources":["../../../src/modes/interactive/report-commands.ts"],"names":[],"mappings":"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output (usage/cost summary, changelog, hotkeys\n * table, render debug dump) or render an easter-egg component, appending to the\n * chat container and requesting a render. None mutate agent/session state, so\n * they operate through narrow `host` seams (chat container, TUI, and a few\n * read accessors) while interactive-mode keeps thin delegating wrappers.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { Container, Keybinding, MarkdownTheme, TUI } from \"@caupulican/pi-tui\";\nimport { Markdown, Spacer, Text, visibleWidth } from \"@caupulican/pi-tui\";\nimport { getDebugLogPath } from \"../../config.ts\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AppKeybinding, KeybindingsManager } from \"../../core/keybindings.ts\";\nimport type { AutoLearnSettings } from \"../../core/settings-manager.ts\";\nimport { getChangelogPath, parseChangelog } from \"../../utils/changelog.ts\";\nimport { getProcessMemoryMb } from \"../../utils/process-memory.ts\";\nimport { ArminComponent } from \"./components/armin.ts\";\nimport { DaxnutsComponent } from \"./components/daxnuts.ts\";\nimport { DynamicBorder } from \"./components/dynamic-border.ts\";\nimport { EarendilAnnouncementComponent } from \"./components/earendil-announcement.ts\";\nimport { formatKeyText } from \"./components/keybinding-hints.ts\";\nimport { theme } from \"./theme/theme.ts\";\n\nexport interface ReportRenderHost {\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n}\n\nexport interface UsageReportHost extends ReportRenderHost {\n\treadonly session: AgentSession;\n\tgetCurrentAutoLearnSettings(): Required<AutoLearnSettings>;\n}\n\nexport interface ChangelogReportHost extends ReportRenderHost {\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n}\n\nexport interface HotkeysReportHost extends ReportRenderHost {\n\treadonly session: AgentSession;\n\treadonly keybindings: KeybindingsManager;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tgetAppKeyDisplay(action: AppKeybinding): string;\n\tgetEditorKeyDisplay(action: Keybinding): string;\n}\n\nexport interface DebugReportHost extends ReportRenderHost {\n\treadonly session: AgentSession;\n}\n\nexport function handleUsageCommand(host: UsageReportHost): void {\n\tconst stats = host.session.getSessionStats();\n\tconst costs = host.session.getCostSummary();\n\tconst context = host.session.getContextUsage();\n\tconst autoLearn = host.getCurrentAutoLearnSettings();\n\tconst costGuard = host.session.getLastCostGuardDecision();\n\tconst activeModel = host.session.model;\n\tconst usingSubscription = activeModel ? host.session.modelRegistry.isUsingOAuth(activeModel) : false;\n\tconst isChatGptSubscription = usingSubscription && activeModel?.provider === \"openai-codex\";\n\n\tlet info = `${theme.bold(\"Usage & Optimization\")}\\n\\n`;\n\tinfo += `${theme.bold(\"Session tokens\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Input:\")} ${stats.tokens.input.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Output:\")} ${stats.tokens.output.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Cache read:\")} ${stats.tokens.cacheRead.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Cache write:\")} ${stats.tokens.cacheWrite.toLocaleString()}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Total:\")} ${stats.tokens.total.toLocaleString()}\\n\\n`;\n\n\tinfo += `${theme.bold(\"Cost\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"CURRENT (session):\")} $${costs.currentCost.toFixed(4)}${usingSubscription ? \" (sub)\" : \"\"}\\n`;\n\tif (costs.subagentReports > 0 || costs.subagentCost > 0) {\n\t\tinfo += `${theme.fg(\"dim\", \"SUBAGENTS (included in CURRENT):\")} $${costs.subagentCost.toFixed(4)} (${costs.subagentReports} reports)\\n`;\n\t}\n\tinfo += `${theme.fg(\"dim\", \"TODAY (host local day):\")} $${costs.todayCost.toFixed(4)}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Today rollover:\")} local midnight\\n\\n`;\n\n\tconst processMemory = getProcessMemoryMb();\n\tinfo += `${theme.bold(\"Process\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Memory:\")} rss ${processMemory.rssMb}MB, heap ${processMemory.heapUsedMb}MB, external ${processMemory.externalMb}MB\\n\\n`;\n\n\tinfo += `${theme.bold(\"Optimization state\")}\\n`;\n\tconst contextPercent = context?.percent;\n\tconst contextTokens = context?.tokens;\n\tif (\n\t\tcontext &&\n\t\tcontextPercent !== undefined &&\n\t\tcontextPercent !== null &&\n\t\tcontextTokens !== undefined &&\n\t\tcontextTokens !== null\n\t) {\n\t\tinfo += `${theme.fg(\"dim\", \"Context:\")} ${contextPercent.toFixed(1)}% (${contextTokens.toLocaleString()}/${context.contextWindow.toLocaleString()})\\n`;\n\t} else {\n\t\tinfo += `${theme.fg(\"dim\", \"Context:\")} unknown until next provider usage sample\\n`;\n\t}\n\tinfo += `${theme.fg(\"dim\", \"Auto-compaction:\")} ${host.session.autoCompactionEnabled ? \"enabled\" : \"disabled\"}\\n`;\n\tconst compactionGates = stats.compactionGates ?? {\n\t\tgateFailures: 0,\n\t\tdeterministicGapFills: 0,\n\t\tcompactionsWithGateFailures: 0,\n\t};\n\tinfo += `${theme.fg(\"dim\", \"Compaction gate failures:\")} ${compactionGates.gateFailures} (${compactionGates.deterministicGapFills} deterministic gap-fill)\\n`;\n\tif (isChatGptSubscription) {\n\t\tinfo += `${theme.fg(\"dim\", \"Cost guard:\")} not applicable to ChatGPT subscription usage\\n`;\n\t} else if (costGuard) {\n\t\tconst status = costGuard.over ? \"over\" : \"ok\";\n\t\tinfo += `${theme.fg(\"dim\", \"Cost guard:\")} ${status} $${costGuard.estUsd.toFixed(4)}/$${costGuard.thresholdUsd.toFixed(4)} (${costGuard.action})\\n`;\n\t} else {\n\t\tinfo += `${theme.fg(\"dim\", \"Cost guard:\")} disabled\\n`;\n\t}\n\tinfo += `${theme.fg(\"dim\", \"Auto Learn:\")} ${autoLearn.enabled ? \"enabled\" : \"disabled\"}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Scavenger model:\")} ${autoLearn.model || \"active\"}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Reflection review:\")} ${autoLearn.reflectionReview ? \"enabled\" : \"disabled\"} (${autoLearn.reflectionMinToolCalls} tool-call trigger)\\n`;\n\tinfo += `${theme.fg(\"dim\", \"Auto Learn concurrency:\")} ${autoLearn.maxConcurrentLearners} learner(s), ${autoLearn.cooldownMinutes}m cooldown\\n\\n`;\n\n\tinfo += `${theme.bold(\"Model Router\")}\\n`;\n\tinfo += `${host.session.getModelRouterStatus((label) => theme.fg(\"dim\", label))}\\n\\n`;\n\n\tinfo += `${theme.bold(\"Manual controls\")}\\n`;\n\tinfo += `${theme.fg(\"dim\", \"/compact\")}: compact the active context now\\n`;\n\tinfo += `${theme.fg(\"dim\", \"/settings\")}: adjust Auto Learn, cost guard, compaction, and model-router config\\n`;\n\tinfo += `${theme.fg(\"dim\", \"/auto-learn status|run\")}: inspect or launch background learning\\n`;\n\tinfo += `${theme.fg(\"dim\", \"context_audit\")}: ask the agent to inspect provider-visible context contributors\\n`;\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Text(info, 1, 0));\n\thost.ui.requestRender();\n}\n\nexport function handleChangelogCommand(host: ChangelogReportHost): void {\n\tconst changelogPath = getChangelogPath();\n\tconst allEntries = parseChangelog(changelogPath);\n\n\tconst changelogMarkdown =\n\t\tallEntries.length > 0\n\t\t\t? allEntries\n\t\t\t\t\t.reverse()\n\t\t\t\t\t.map((e) => e.content)\n\t\t\t\t\t.join(\"\\n\\n\")\n\t\t\t: \"No changelog entries found.\";\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.chatContainer.addChild(new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0));\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, host.getMarkdownThemeWithSettings()));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.ui.requestRender();\n}\n\nexport function handleHotkeysCommand(host: HotkeysReportHost): void {\n\t// Navigation keybindings\n\tconst cursorUp = host.getEditorKeyDisplay(\"tui.editor.cursorUp\");\n\tconst cursorDown = host.getEditorKeyDisplay(\"tui.editor.cursorDown\");\n\tconst cursorLeft = host.getEditorKeyDisplay(\"tui.editor.cursorLeft\");\n\tconst cursorRight = host.getEditorKeyDisplay(\"tui.editor.cursorRight\");\n\tconst cursorWordLeft = host.getEditorKeyDisplay(\"tui.editor.cursorWordLeft\");\n\tconst cursorWordRight = host.getEditorKeyDisplay(\"tui.editor.cursorWordRight\");\n\tconst cursorLineStart = host.getEditorKeyDisplay(\"tui.editor.cursorLineStart\");\n\tconst cursorLineEnd = host.getEditorKeyDisplay(\"tui.editor.cursorLineEnd\");\n\tconst jumpForward = host.getEditorKeyDisplay(\"tui.editor.jumpForward\");\n\tconst jumpBackward = host.getEditorKeyDisplay(\"tui.editor.jumpBackward\");\n\tconst pageUp = host.getEditorKeyDisplay(\"tui.editor.pageUp\");\n\tconst pageDown = host.getEditorKeyDisplay(\"tui.editor.pageDown\");\n\n\t// Editing keybindings\n\tconst submit = host.getEditorKeyDisplay(\"tui.input.submit\");\n\tconst newLine = host.getEditorKeyDisplay(\"tui.input.newLine\");\n\tconst deleteWordBackward = host.getEditorKeyDisplay(\"tui.editor.deleteWordBackward\");\n\tconst deleteWordForward = host.getEditorKeyDisplay(\"tui.editor.deleteWordForward\");\n\tconst deleteToLineStart = host.getEditorKeyDisplay(\"tui.editor.deleteToLineStart\");\n\tconst deleteToLineEnd = host.getEditorKeyDisplay(\"tui.editor.deleteToLineEnd\");\n\tconst yank = host.getEditorKeyDisplay(\"tui.editor.yank\");\n\tconst yankPop = host.getEditorKeyDisplay(\"tui.editor.yankPop\");\n\tconst undo = host.getEditorKeyDisplay(\"tui.editor.undo\");\n\tconst tab = host.getEditorKeyDisplay(\"tui.input.tab\");\n\n\t// App keybindings\n\tconst interrupt = host.getAppKeyDisplay(\"app.interrupt\");\n\tconst clear = host.getAppKeyDisplay(\"app.clear\");\n\tconst exit = host.getAppKeyDisplay(\"app.exit\");\n\tconst suspend = host.getAppKeyDisplay(\"app.suspend\");\n\tconst cycleThinkingLevel = host.getAppKeyDisplay(\"app.thinking.cycle\");\n\tconst cycleModelForward = host.getAppKeyDisplay(\"app.model.cycleForward\");\n\tconst selectModel = host.getAppKeyDisplay(\"app.model.select\");\n\tconst expandTools = host.getAppKeyDisplay(\"app.tools.expand\");\n\tconst toggleThinking = host.getAppKeyDisplay(\"app.thinking.toggle\");\n\tconst externalEditor = host.getAppKeyDisplay(\"app.editor.external\");\n\tconst cycleModelBackward = host.getAppKeyDisplay(\"app.model.cycleBackward\");\n\tconst followUp = host.getAppKeyDisplay(\"app.message.followUp\");\n\tconst dequeue = host.getAppKeyDisplay(\"app.message.dequeue\");\n\tconst pasteImage = host.getAppKeyDisplay(\"app.clipboard.pasteImage\");\n\n\tlet hotkeys = `\n**Navigation**\n| Key | Action |\n|-----|--------|\n| \\`${cursorUp}\\` / \\`${cursorDown}\\` / \\`${cursorLeft}\\` / \\`${cursorRight}\\` | Move cursor / browse history (Up when empty) |\n| \\`${cursorWordLeft}\\` / \\`${cursorWordRight}\\` | Move by word |\n| \\`${cursorLineStart}\\` | Start of line |\n| \\`${cursorLineEnd}\\` | End of line |\n| \\`${jumpForward}\\` | Jump forward to character |\n| \\`${jumpBackward}\\` | Jump backward to character |\n| \\`${pageUp}\\` / \\`${pageDown}\\` | Scroll by page |\n\n**Editing**\n| Key | Action |\n|-----|--------|\n| \\`${submit}\\` | Send message |\n| \\`${newLine}\\` | New line${process.platform === \"win32\" ? \" (Ctrl+Enter on Windows Terminal)\" : \"\"} |\n| \\`${deleteWordBackward}\\` | Delete word backwards |\n| \\`${deleteWordForward}\\` | Delete word forwards |\n| \\`${deleteToLineStart}\\` | Delete to start of line |\n| \\`${deleteToLineEnd}\\` | Delete to end of line |\n| \\`${yank}\\` | Paste the most-recently-deleted text |\n| \\`${yankPop}\\` | Cycle through the deleted text after pasting |\n| \\`${undo}\\` | Undo |\n\n**Other**\n| Key | Action |\n|-----|--------|\n| \\`${tab}\\` | Path completion / accept autocomplete |\n| \\`${interrupt}\\` | Cancel autocomplete / abort streaming |\n| \\`${clear}\\` | Clear editor (first) / exit (second) |\n| \\`${exit}\\` | Exit (when editor is empty) |\n| \\`${suspend}\\` | Suspend to background |\n| \\`${cycleThinkingLevel}\\` | Cycle thinking level |\n| \\`${cycleModelForward}\\` / \\`${cycleModelBackward}\\` | Cycle models |\n| \\`${selectModel}\\` | Open model selector |\n| \\`${expandTools}\\` | Toggle tool output expansion |\n| \\`${toggleThinking}\\` | Toggle thinking block visibility |\n| \\`${externalEditor}\\` | Edit message in external editor |\n| \\`${followUp}\\` | Queue follow-up message |\n| \\`${dequeue}\\` | Restore queued messages |\n| \\`${pasteImage}\\` | Paste image from clipboard |\n| \\`/\\` | Slash commands |\n| \\`!\\` | Run bash command |\n| \\`!!\\` | Run bash command (excluded from context) |\n`;\n\n\t// Add extension-registered shortcuts\n\tconst extensionRunner = host.session.extensionRunner;\n\tconst shortcuts = extensionRunner.getShortcuts(host.keybindings.getEffectiveConfig());\n\tif (shortcuts.size > 0) {\n\t\thotkeys += `\n**Extensions**\n| Key | Action |\n|-----|--------|\n`;\n\t\tfor (const [key, shortcut] of shortcuts) {\n\t\t\tconst description = shortcut.description ?? shortcut.extensionPath;\n\t\t\tconst keyDisplay = formatKeyText(key, { capitalize: true });\n\t\t\thotkeys += `| \\`${keyDisplay}\\` | ${description} |\\n`;\n\t\t}\n\t}\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.chatContainer.addChild(new Text(theme.bold(theme.fg(\"accent\", \"Keyboard Shortcuts\")), 1, 0));\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, host.getMarkdownThemeWithSettings()));\n\thost.chatContainer.addChild(new DynamicBorder());\n\thost.ui.requestRender();\n}\n\nexport function handleDebugCommand(host: DebugReportHost): void {\n\tconst width = host.ui.terminal.columns;\n\tconst height = host.ui.terminal.rows;\n\tconst allLines = host.ui.render(width);\n\n\tconst debugLogPath = getDebugLogPath();\n\tconst debugData = [\n\t\t`Debug output at ${new Date().toISOString()}`,\n\t\t`Terminal: ${width}x${height}`,\n\t\t`Total lines: ${allLines.length}`,\n\t\t\"\",\n\t\t\"=== All rendered lines with visible widths ===\",\n\t\t...allLines.map((line, idx) => {\n\t\t\tconst vw = visibleWidth(line);\n\t\t\tconst escaped = JSON.stringify(line);\n\t\t\treturn `[${idx}] (w=${vw}) ${escaped}`;\n\t\t}),\n\t\t\"\",\n\t\t\"=== Agent messages (JSONL) ===\",\n\t\t...host.session.messages.map((msg) => JSON.stringify(msg)),\n\t\t\"\",\n\t].join(\"\\n\");\n\n\tfs.mkdirSync(path.dirname(debugLogPath), { recursive: true });\n\tfs.writeFileSync(debugLogPath, debugData);\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(\n\t\tnew Text(`${theme.fg(\"accent\", \"✓ Debug log written\")}\\n${theme.fg(\"muted\", debugLogPath)}`, 1, 1),\n\t);\n\thost.ui.requestRender();\n}\n\nexport function handleArminSaysHi(host: ReportRenderHost): void {\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new ArminComponent(host.ui));\n\thost.ui.requestRender();\n}\n\nexport function handleDementedDelves(host: ReportRenderHost): void {\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new EarendilAnnouncementComponent());\n\thost.ui.requestRender();\n}\n\nexport function handleDaxnuts(host: ReportRenderHost): void {\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new DaxnutsComponent(host.ui));\n\thost.ui.requestRender();\n}\n\nexport function checkDaxnutsEasterEgg(host: ReportRenderHost, model: { provider: string; id: string }): void {\n\tif (model.provider === \"opencode\" && model.id.toLowerCase().includes(\"kimi-k2.5\")) {\n\t\thandleDaxnuts(host);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
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IAClC,uBAAuB,IAAI,IAAI,CAAC;IAChC,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,8BAA8B,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,GAAG,SAAS,CAAC;IACvF,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnE,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3E,qBAAqB,IAAI,IAAI,CAAC;IAC9B,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAyRrE","sourcesContent":["/**\n * `/settings` selector flow extracted from interactive-mode.\n *\n * Builds the SettingsSelectorComponent model from the current settings/session\n * state and wires its change callbacks back through a `SettingsSelectorHost`\n * seam. Self-mod/auto-learn validation, autonomy-preset application, autocomplete\n * rebuild, and the resources-hub hand-off stay host-side (shared with other\n * flows); interactive-mode keeps a thin wrapper building the host once.\n */\n\nimport type { Component, Container, EditorComponent, SelectItem, TUI } from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport { configureHttpDispatcher, formatHttpIdleTimeoutMs } from \"../../core/http-dispatcher.ts\";\nimport type {\n\tAutonomyMode,\n\tSelfModificationSettings,\n\tSettingsManager,\n\tSettingsScope,\n} from \"../../core/settings-manager.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { SettingsSelectorComponent } from \"./components/settings-selector.ts\";\nimport { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { ToolGroupComponent } from \"./components/tool-group.ts\";\nimport { getAvailableThemes, setTheme } from \"./theme/theme.ts\";\n\nexport interface SettingsSelectorHost {\n\treadonly session: AgentSession;\n\treadonly settingsManager: SettingsManager;\n\treadonly footer: FooterComponent;\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n\treadonly defaultEditor: CustomEditor;\n\treadonly editor: EditorComponent;\n\thideThinkingBlock: boolean;\n\tshowSelector(create: (done: () => void) => { component: Component; focus: Component }): void;\n\tshowStatus(message: string): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\tgetAutoLearnModelOptions(): SelectItem[];\n\tsetupAutocompleteProvider(): void;\n\tupdateEditorBorderColor(): void;\n\trebuildChatFromMessages(): Promise<void>;\n\tvalidateSelfModificationSource(settings: SelfModificationSettings): string | undefined;\n\tapplyAutonomyMode(mode: AutonomyMode, scope?: SettingsScope): void;\n\tvalidateAutoLearnModelValue(value: string | undefined): string | undefined;\n\tupdateAutoLearnFooter(): void;\n\thandleResourcesHubAction(action: string): Promise<void>;\n}\n\nexport function showSettingsSelector(host: SettingsSelectorHost): void {\n\thost.showSelector((done) => {\n\t\tconst projectSettings = host.settingsManager.getProjectSettings();\n\t\tconst profileOptions = [\n\t\t\t{\n\t\t\t\tvalue: \"(none)\",\n\t\t\t\tlabel: \"(none)\",\n\t\t\t\tdescription: \"Use configured profile selection (session default)\",\n\t\t\t},\n\t\t\t...host.settingsManager\n\t\t\t\t.getProfileRegistry()\n\t\t\t\t.listProfiles()\n\t\t\t\t.map((profile) => ({\n\t\t\t\t\tvalue: profile.name,\n\t\t\t\t\tlabel: profile.name,\n\t\t\t\t\tdescription: profile.description ?? profile.source,\n\t\t\t\t})),\n\t\t];\n\t\tconst selector = new SettingsSelectorComponent(\n\t\t\t{\n\t\t\t\tautoCompact: host.session.autoCompactionEnabled,\n\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\tautoResizeImages: host.settingsManager.getImageAutoResize(),\n\t\t\t\tblockImages: host.settingsManager.getBlockImages(),\n\t\t\t\tenableSkillCommands: host.settingsManager.getEnableSkillCommands(),\n\t\t\t\tsteeringMode: host.session.steeringMode,\n\t\t\t\tfollowUpMode: host.session.followUpMode,\n\t\t\t\ttransport: host.settingsManager.getTransport(),\n\t\t\t\thttpIdleTimeoutMs: host.settingsManager.getHttpIdleTimeoutMs(),\n\t\t\t\tthinkingLevel: host.session.thinkingLevel,\n\t\t\t\tavailableThinkingLevels: host.session.getAvailableThinkingLevels(),\n\t\t\t\tcurrentTheme: host.settingsManager.getTheme() || \"dark\",\n\t\t\t\t// The picker offers only themes the active profile permits (no-bypass). The theme\n\t\t\t\t// registry/renderer keeps the full set, so an already-applied theme still renders\n\t\t\t\t// even if the profile would block re-selecting it.\n\t\t\t\tavailableThemes: getAvailableThemes().filter((name) =>\n\t\t\t\t\thost.settingsManager.isResourceAllowedByProfile(\"themes\", name),\n\t\t\t\t),\n\t\t\t\thideThinkingBlock: host.hideThinkingBlock,\n\t\t\t\tcollapseChangelog: host.settingsManager.getCollapseChangelog(),\n\t\t\t\tenableInstallTelemetry: host.settingsManager.getEnableInstallTelemetry(),\n\t\t\t\tdoubleEscapeAction: host.settingsManager.getDoubleEscapeAction(),\n\t\t\t\ttreeFilterMode: host.settingsManager.getTreeFilterMode(),\n\t\t\t\tshowHardwareCursor: host.settingsManager.getShowHardwareCursor(),\n\t\t\t\teditorPaddingX: host.settingsManager.getEditorPaddingX(),\n\t\t\t\tautocompleteMaxVisible: host.settingsManager.getAutocompleteMaxVisible(),\n\t\t\t\tquietStartup: host.settingsManager.getQuietStartup(),\n\t\t\t\tclearOnShrink: host.settingsManager.getClearOnShrink(),\n\t\t\t\tshowTerminalProgress: host.settingsManager.getShowTerminalProgress(),\n\t\t\t\twarnings: host.settingsManager.getWarnings(),\n\t\t\t\tselfModification: host.settingsManager.getSelfModificationSettings(),\n\t\t\t\tselfModificationScope: projectSettings.selfModification ? \"project\" : \"global\",\n\t\t\t\tautonomy: host.settingsManager.getAutonomySettings(),\n\t\t\t\tautonomyScope: projectSettings.autonomy ? \"project\" : \"global\",\n\t\t\t\tresearchLane: host.settingsManager.getResearchLaneSettings(),\n\t\t\t\tresearchLaneScope: projectSettings.researchLane ? \"project\" : \"global\",\n\t\t\t\tworkerDelegation: host.settingsManager.getWorkerDelegationSettings(),\n\t\t\t\tworkerDelegationScope: projectSettings.workerDelegation ? \"project\" : \"global\",\n\t\t\t\tcontextCuration: host.settingsManager.getContextCurationSettings(),\n\t\t\t\tcontextCurationScope: projectSettings.contextPolicy?.curation ? \"project\" : \"global\",\n\t\t\t\tlearningPolicy: host.settingsManager.getLearningPolicySettings(),\n\t\t\t\tlearningPolicyScope: projectSettings.learningPolicy ? \"project\" : \"global\",\n\t\t\t\tmodelCapability: host.settingsManager.getModelCapabilitySettings(),\n\t\t\t\tmodelCapabilityScope: projectSettings.modelCapability ? \"project\" : \"global\",\n\t\t\t\tmodelRouter: host.settingsManager.getModelRouterSettings(),\n\t\t\t\tmodelRouterScope: projectSettings.modelRouter ? \"project\" : \"global\",\n\t\t\t\tautoLearn: host.settingsManager.getAutoLearnSettings(),\n\t\t\t\tautoLearnScope: projectSettings.autoLearn ? \"project\" : \"global\",\n\t\t\t\tautoLearnModelOptions: host.getAutoLearnModelOptions(),\n\t\t\t\tcontextPolicyEnforcement: host.settingsManager.getContextPromptEnforcementSettings(),\n\t\t\t\tcontextPolicyEnforcementScope: projectSettings.contextPolicy?.enforcement ? \"project\" : \"global\",\n\t\t\t\tcontextMemoryRetrieval: host.settingsManager.getMemoryRetrievalSettings(),\n\t\t\t\tcontextMemoryRetrievalScope: projectSettings.contextPolicy?.memory ? \"project\" : \"global\",\n\t\t\t\tcurrentModelPattern: host.session.model\n\t\t\t\t\t? `${host.session.model.provider}/${host.session.model.id}`\n\t\t\t\t\t: undefined,\n\t\t\t\tactiveProfileName: host.settingsManager.getActiveResourceProfileNames()[0],\n\t\t\t\tprofileOptions,\n\t\t\t\texternalResourceRoots: host.settingsManager.getExternalResourceRoots(),\n\t\t\t\ttrustedResourceRoots: host.settingsManager.getTrustedResourceRoots(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tonAutoCompactChange: (enabled) => {\n\t\t\t\t\thost.session.setAutoCompactionEnabled(enabled);\n\t\t\t\t\thost.footer.setAutoCompactEnabled(enabled);\n\t\t\t\t},\n\t\t\t\tonShowImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowImages(enabled);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setShowImages(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonImageWidthCellsChange: (width) => {\n\t\t\t\t\thost.settingsManager.setImageWidthCells(width);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setImageWidthCells(width);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonAutoResizeImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setImageAutoResize(enabled);\n\t\t\t\t},\n\t\t\t\tonBlockImagesChange: (blocked) => {\n\t\t\t\t\thost.settingsManager.setBlockImages(blocked);\n\t\t\t\t},\n\t\t\t\tonEnableSkillCommandsChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableSkillCommands(enabled);\n\t\t\t\t\thost.setupAutocompleteProvider();\n\t\t\t\t},\n\t\t\t\tonSteeringModeChange: (mode) => {\n\t\t\t\t\thost.session.setSteeringMode(mode);\n\t\t\t\t},\n\t\t\t\tonFollowUpModeChange: (mode) => {\n\t\t\t\t\thost.session.setFollowUpMode(mode);\n\t\t\t\t},\n\t\t\t\tonTransportChange: (transport) => {\n\t\t\t\t\thost.settingsManager.setTransport(transport);\n\t\t\t\t\thost.session.agent.transport = transport;\n\t\t\t\t},\n\t\t\t\tonHttpIdleTimeoutMsChange: (timeoutMs) => {\n\t\t\t\t\thost.settingsManager.setHttpIdleTimeoutMs(timeoutMs);\n\t\t\t\t\tconfigureHttpDispatcher(timeoutMs);\n\t\t\t\t\thost.showStatus(`HTTP idle timeout: ${formatHttpIdleTimeoutMs(timeoutMs)}`);\n\t\t\t\t},\n\t\t\t\tonThinkingLevelChange: (level) => {\n\t\t\t\t\thost.session.setThinkingLevel(level);\n\t\t\t\t\thost.footer.invalidate();\n\t\t\t\t\thost.updateEditorBorderColor();\n\t\t\t\t},\n\t\t\t\tonThemeChange: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\thost.settingsManager.setTheme(themeName);\n\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\tif (!result.success) {\n\t\t\t\t\t\thost.showError(`Failed to load theme \"${themeName}\": ${result.error}\\nFell back to dark theme.`);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonHideThinkingBlockChange: (hidden) => {\n\t\t\t\t\thost.hideThinkingBlock = hidden;\n\t\t\t\t\thost.settingsManager.setHideThinkingBlock(hidden);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\t\t\t\t\tchild.setHideThinkingBlock(hidden);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvoid host.rebuildChatFromMessages();\n\t\t\t\t},\n\t\t\t\tonCollapseChangelogChange: (collapsed) => {\n\t\t\t\t\thost.settingsManager.setCollapseChangelog(collapsed);\n\t\t\t\t},\n\t\t\t\tonEnableInstallTelemetryChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableInstallTelemetry(enabled);\n\t\t\t\t},\n\t\t\t\tonQuietStartupChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setQuietStartup(enabled);\n\t\t\t\t},\n\t\t\t\tonDoubleEscapeActionChange: (action) => {\n\t\t\t\t\thost.settingsManager.setDoubleEscapeAction(action);\n\t\t\t\t},\n\t\t\t\tonTreeFilterModeChange: (mode) => {\n\t\t\t\t\thost.settingsManager.setTreeFilterMode(mode);\n\t\t\t\t},\n\t\t\t\tonShowHardwareCursorChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowHardwareCursor(enabled);\n\t\t\t\t\thost.ui.setShowHardwareCursor(enabled);\n\t\t\t\t},\n\t\t\t\tonEditorPaddingXChange: (padding) => {\n\t\t\t\t\thost.settingsManager.setEditorPaddingX(padding);\n\t\t\t\t\thost.defaultEditor.setPaddingX(padding);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setPaddingX !== undefined) {\n\t\t\t\t\t\thost.editor.setPaddingX(padding);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonAutocompleteMaxVisibleChange: (maxVisible) => {\n\t\t\t\t\thost.settingsManager.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\thost.defaultEditor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setAutocompleteMaxVisible !== undefined) {\n\t\t\t\t\t\thost.editor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonClearOnShrinkChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setClearOnShrink(enabled);\n\t\t\t\t\thost.ui.setClearOnShrink(enabled);\n\t\t\t\t},\n\t\t\t\tonShowTerminalProgressChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowTerminalProgress(enabled);\n\t\t\t\t},\n\t\t\t\tonWarningsChange: (warnings) => {\n\t\t\t\t\thost.settingsManager.setWarnings(warnings);\n\t\t\t\t},\n\t\t\t\tonSelfModificationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setSelfModificationSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateSelfModificationSource(settings);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Self modification settings saved to ${scope}. Start a new session or /reload for system-prompt guardrails to fully refresh.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonAutonomyChange: (settings, scope) => {\n\t\t\t\t\thost.applyAutonomyMode(settings.mode ?? \"off\", scope);\n\t\t\t\t\thost.showStatus(`Autonomy mode ${settings.mode ?? \"off\"} saved to ${scope}. Use /autonomy status.`);\n\t\t\t\t},\n\t\t\t\tonResearchLaneChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setResearchLaneSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Research lane settings saved to ${scope}. Use /autonomy research or /autonomy diagnostics.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonWorkerDelegationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setWorkerDelegationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Worker delegation settings saved to ${scope}. The delegate tool uses them.`);\n\t\t\t\t},\n\t\t\t\tonLearningPolicyChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setLearningPolicySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Learning policy saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonModelCapabilityChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelCapabilitySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Model capability mode saved to ${scope}. Applies on the next model switch or /reload.`);\n\t\t\t\t},\n\t\t\t\tonContextCurationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextCurationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Context curation settings saved to ${scope}. Run /fitness <model> first if the model is unprobed.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonModelRouterChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelRouterSettings(settings, scope);\n\t\t\t\t\tfor (const value of [settings.cheapModel, settings.expensiveModel, settings.learningModel]) {\n\t\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(value);\n\t\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\t\thost.showWarning(validationMessage.replace(\"Auto Learn model\", \"Model router model\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Model Router settings saved to ${scope}. Use /session or /usage to inspect routing.`);\n\t\t\t\t},\n\t\t\t\tonAutoLearnChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setAutoLearnSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(settings.model);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Auto Learn settings saved to ${scope}. Use /auto-learn status or /auto-learn run.`);\n\t\t\t\t},\n\t\t\t\tonContextPolicyEnforcementChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextPromptEnforcementSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/prompt-policy settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonContextMemoryRetrievalChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setMemoryRetrievalSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/memory-retrieval settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonResourcesHubAction: (action) => {\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid host.handleResourcesHubAction(action);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\treturn { component: selector, focus: selector.getSettingsList() };\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"settings-selector-flow.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/settings-selector-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EACX,YAAY,EACZ,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAM9D,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;IACjB,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK;QAAE,SAAS,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7F,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,wBAAwB,IAAI,UAAU,EAAE,CAAC;IACzC,yBAAyB,IAAI,IAAI,CAAC;IAClC,uBAAuB,IAAI,IAAI,CAAC;IAChC,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,8BAA8B,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,GAAG,SAAS,CAAC;IACvF,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnE,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3E,qBAAqB,IAAI,IAAI,CAAC;IAC9B,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CA8RrE","sourcesContent":["/**\n * `/settings` selector flow extracted from interactive-mode.\n *\n * Builds the SettingsSelectorComponent model from the current settings/session\n * state and wires its change callbacks back through a `SettingsSelectorHost`\n * seam. Self-mod/auto-learn validation, autonomy-preset application, autocomplete\n * rebuild, and the resources-hub hand-off stay host-side (shared with other\n * flows); interactive-mode keeps a thin wrapper building the host once.\n */\n\nimport { getSupportedThinkingLevels } from \"@caupulican/pi-ai\";\nimport type { Component, Container, EditorComponent, SelectItem, TUI } from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport { configureHttpDispatcher, formatHttpIdleTimeoutMs } from \"../../core/http-dispatcher.ts\";\nimport { resolveCliModel } from \"../../core/model-resolver.ts\";\nimport type {\n\tAutonomyMode,\n\tSelfModificationSettings,\n\tSettingsManager,\n\tSettingsScope,\n} from \"../../core/settings-manager.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { SettingsSelectorComponent } from \"./components/settings-selector.ts\";\nimport { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { ToolGroupComponent } from \"./components/tool-group.ts\";\nimport { getAvailableThemes, setTheme } from \"./theme/theme.ts\";\n\nexport interface SettingsSelectorHost {\n\treadonly session: AgentSession;\n\treadonly settingsManager: SettingsManager;\n\treadonly footer: FooterComponent;\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n\treadonly defaultEditor: CustomEditor;\n\treadonly editor: EditorComponent;\n\thideThinkingBlock: boolean;\n\tshowSelector(create: (done: () => void) => { component: Component; focus: Component }): void;\n\tshowStatus(message: string): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\tgetAutoLearnModelOptions(): SelectItem[];\n\tsetupAutocompleteProvider(): void;\n\tupdateEditorBorderColor(): void;\n\trebuildChatFromMessages(): Promise<void>;\n\tvalidateSelfModificationSource(settings: SelfModificationSettings): string | undefined;\n\tapplyAutonomyMode(mode: AutonomyMode, scope?: SettingsScope): void;\n\tvalidateAutoLearnModelValue(value: string | undefined): string | undefined;\n\tupdateAutoLearnFooter(): void;\n\thandleResourcesHubAction(action: string): Promise<void>;\n}\n\nexport function showSettingsSelector(host: SettingsSelectorHost): void {\n\thost.showSelector((done) => {\n\t\tconst projectSettings = host.settingsManager.getProjectSettings();\n\t\tconst profileOptions = [\n\t\t\t{\n\t\t\t\tvalue: \"(none)\",\n\t\t\t\tlabel: \"(none)\",\n\t\t\t\tdescription: \"Use configured profile selection (session default)\",\n\t\t\t},\n\t\t\t...host.settingsManager\n\t\t\t\t.getProfileRegistry()\n\t\t\t\t.listProfiles()\n\t\t\t\t.map((profile) => ({\n\t\t\t\t\tvalue: profile.name,\n\t\t\t\t\tlabel: profile.name,\n\t\t\t\t\tdescription: profile.description ?? profile.source,\n\t\t\t\t})),\n\t\t];\n\t\tconst selector = new SettingsSelectorComponent(\n\t\t\t{\n\t\t\t\tautoCompact: host.session.autoCompactionEnabled,\n\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\tautoResizeImages: host.settingsManager.getImageAutoResize(),\n\t\t\t\tblockImages: host.settingsManager.getBlockImages(),\n\t\t\t\tenableSkillCommands: host.settingsManager.getEnableSkillCommands(),\n\t\t\t\tsteeringMode: host.session.steeringMode,\n\t\t\t\tfollowUpMode: host.session.followUpMode,\n\t\t\t\ttransport: host.settingsManager.getTransport(),\n\t\t\t\thttpIdleTimeoutMs: host.settingsManager.getHttpIdleTimeoutMs(),\n\t\t\t\tthinkingLevel: host.session.thinkingLevel,\n\t\t\t\tavailableThinkingLevels: host.session.getAvailableThinkingLevels(),\n\t\t\t\tcurrentTheme: host.settingsManager.getTheme() || \"dark\",\n\t\t\t\t// The picker offers only themes the active profile permits (no-bypass). The theme\n\t\t\t\t// registry/renderer keeps the full set, so an already-applied theme still renders\n\t\t\t\t// even if the profile would block re-selecting it.\n\t\t\t\tavailableThemes: getAvailableThemes().filter((name) =>\n\t\t\t\t\thost.settingsManager.isResourceAllowedByProfile(\"themes\", name),\n\t\t\t\t),\n\t\t\t\thideThinkingBlock: host.hideThinkingBlock,\n\t\t\t\tcollapseChangelog: host.settingsManager.getCollapseChangelog(),\n\t\t\t\tenableInstallTelemetry: host.settingsManager.getEnableInstallTelemetry(),\n\t\t\t\tdoubleEscapeAction: host.settingsManager.getDoubleEscapeAction(),\n\t\t\t\ttreeFilterMode: host.settingsManager.getTreeFilterMode(),\n\t\t\t\tshowHardwareCursor: host.settingsManager.getShowHardwareCursor(),\n\t\t\t\teditorPaddingX: host.settingsManager.getEditorPaddingX(),\n\t\t\t\tautocompleteMaxVisible: host.settingsManager.getAutocompleteMaxVisible(),\n\t\t\t\tquietStartup: host.settingsManager.getQuietStartup(),\n\t\t\t\tclearOnShrink: host.settingsManager.getClearOnShrink(),\n\t\t\t\tshowTerminalProgress: host.settingsManager.getShowTerminalProgress(),\n\t\t\t\twarnings: host.settingsManager.getWarnings(),\n\t\t\t\tselfModification: host.settingsManager.getSelfModificationSettings(),\n\t\t\t\tselfModificationScope: projectSettings.selfModification ? \"project\" : \"global\",\n\t\t\t\tautonomy: host.settingsManager.getAutonomySettings(),\n\t\t\t\tautonomyScope: projectSettings.autonomy ? \"project\" : \"global\",\n\t\t\t\tresearchLane: host.settingsManager.getResearchLaneSettings(),\n\t\t\t\tresearchLaneScope: projectSettings.researchLane ? \"project\" : \"global\",\n\t\t\t\tworkerDelegation: host.settingsManager.getWorkerDelegationSettings(),\n\t\t\t\tworkerDelegationScope: projectSettings.workerDelegation ? \"project\" : \"global\",\n\t\t\t\tcontextCuration: host.settingsManager.getContextCurationSettings(),\n\t\t\t\tcontextCurationScope: projectSettings.contextPolicy?.curation ? \"project\" : \"global\",\n\t\t\t\tlearningPolicy: host.settingsManager.getLearningPolicySettings(),\n\t\t\t\tlearningPolicyScope: projectSettings.learningPolicy ? \"project\" : \"global\",\n\t\t\t\tmodelCapability: host.settingsManager.getModelCapabilitySettings(),\n\t\t\t\tmodelCapabilityScope: projectSettings.modelCapability ? \"project\" : \"global\",\n\t\t\t\tmodelRouter: host.settingsManager.getModelRouterSettings(),\n\t\t\t\tmodelRouterScope: projectSettings.modelRouter ? \"project\" : \"global\",\n\t\t\t\tautoLearn: host.settingsManager.getAutoLearnSettings(),\n\t\t\t\tautoLearnScope: projectSettings.autoLearn ? \"project\" : \"global\",\n\t\t\t\tautoLearnModelOptions: host.getAutoLearnModelOptions(),\n\t\t\t\tresolveModelThinkingLevels: (modelPattern) => {\n\t\t\t\t\tif (!modelPattern) return host.session.getAvailableThinkingLevels();\n\t\t\t\t\tconst resolved = resolveCliModel({ cliModel: modelPattern, modelRegistry: host.session.modelRegistry });\n\t\t\t\t\treturn resolved.model ? getSupportedThinkingLevels(resolved.model) : undefined;\n\t\t\t\t},\n\t\t\t\tcontextPolicyEnforcement: host.settingsManager.getContextPromptEnforcementSettings(),\n\t\t\t\tcontextPolicyEnforcementScope: projectSettings.contextPolicy?.enforcement ? \"project\" : \"global\",\n\t\t\t\tcontextMemoryRetrieval: host.settingsManager.getMemoryRetrievalSettings(),\n\t\t\t\tcontextMemoryRetrievalScope: projectSettings.contextPolicy?.memory ? \"project\" : \"global\",\n\t\t\t\tcurrentModelPattern: host.session.model\n\t\t\t\t\t? `${host.session.model.provider}/${host.session.model.id}`\n\t\t\t\t\t: undefined,\n\t\t\t\tactiveProfileName: host.settingsManager.getActiveResourceProfileNames()[0],\n\t\t\t\tprofileOptions,\n\t\t\t\texternalResourceRoots: host.settingsManager.getExternalResourceRoots(),\n\t\t\t\ttrustedResourceRoots: host.settingsManager.getTrustedResourceRoots(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tonAutoCompactChange: (enabled) => {\n\t\t\t\t\thost.session.setAutoCompactionEnabled(enabled);\n\t\t\t\t\thost.footer.setAutoCompactEnabled(enabled);\n\t\t\t\t},\n\t\t\t\tonShowImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowImages(enabled);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setShowImages(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonImageWidthCellsChange: (width) => {\n\t\t\t\t\thost.settingsManager.setImageWidthCells(width);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setImageWidthCells(width);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonAutoResizeImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setImageAutoResize(enabled);\n\t\t\t\t},\n\t\t\t\tonBlockImagesChange: (blocked) => {\n\t\t\t\t\thost.settingsManager.setBlockImages(blocked);\n\t\t\t\t},\n\t\t\t\tonEnableSkillCommandsChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableSkillCommands(enabled);\n\t\t\t\t\thost.setupAutocompleteProvider();\n\t\t\t\t},\n\t\t\t\tonSteeringModeChange: (mode) => {\n\t\t\t\t\thost.session.setSteeringMode(mode);\n\t\t\t\t},\n\t\t\t\tonFollowUpModeChange: (mode) => {\n\t\t\t\t\thost.session.setFollowUpMode(mode);\n\t\t\t\t},\n\t\t\t\tonTransportChange: (transport) => {\n\t\t\t\t\thost.settingsManager.setTransport(transport);\n\t\t\t\t\thost.session.agent.transport = transport;\n\t\t\t\t},\n\t\t\t\tonHttpIdleTimeoutMsChange: (timeoutMs) => {\n\t\t\t\t\thost.settingsManager.setHttpIdleTimeoutMs(timeoutMs);\n\t\t\t\t\tconfigureHttpDispatcher(timeoutMs);\n\t\t\t\t\thost.showStatus(`HTTP idle timeout: ${formatHttpIdleTimeoutMs(timeoutMs)}`);\n\t\t\t\t},\n\t\t\t\tonThinkingLevelChange: (level) => {\n\t\t\t\t\thost.session.setThinkingLevel(level);\n\t\t\t\t\thost.footer.invalidate();\n\t\t\t\t\thost.updateEditorBorderColor();\n\t\t\t\t},\n\t\t\t\tonThemeChange: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\thost.settingsManager.setTheme(themeName);\n\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\tif (!result.success) {\n\t\t\t\t\t\thost.showError(`Failed to load theme \"${themeName}\": ${result.error}\\nFell back to dark theme.`);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonHideThinkingBlockChange: (hidden) => {\n\t\t\t\t\thost.hideThinkingBlock = hidden;\n\t\t\t\t\thost.settingsManager.setHideThinkingBlock(hidden);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\t\t\t\t\tchild.setHideThinkingBlock(hidden);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvoid host.rebuildChatFromMessages();\n\t\t\t\t},\n\t\t\t\tonCollapseChangelogChange: (collapsed) => {\n\t\t\t\t\thost.settingsManager.setCollapseChangelog(collapsed);\n\t\t\t\t},\n\t\t\t\tonEnableInstallTelemetryChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableInstallTelemetry(enabled);\n\t\t\t\t},\n\t\t\t\tonQuietStartupChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setQuietStartup(enabled);\n\t\t\t\t},\n\t\t\t\tonDoubleEscapeActionChange: (action) => {\n\t\t\t\t\thost.settingsManager.setDoubleEscapeAction(action);\n\t\t\t\t},\n\t\t\t\tonTreeFilterModeChange: (mode) => {\n\t\t\t\t\thost.settingsManager.setTreeFilterMode(mode);\n\t\t\t\t},\n\t\t\t\tonShowHardwareCursorChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowHardwareCursor(enabled);\n\t\t\t\t\thost.ui.setShowHardwareCursor(enabled);\n\t\t\t\t},\n\t\t\t\tonEditorPaddingXChange: (padding) => {\n\t\t\t\t\thost.settingsManager.setEditorPaddingX(padding);\n\t\t\t\t\thost.defaultEditor.setPaddingX(padding);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setPaddingX !== undefined) {\n\t\t\t\t\t\thost.editor.setPaddingX(padding);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonAutocompleteMaxVisibleChange: (maxVisible) => {\n\t\t\t\t\thost.settingsManager.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\thost.defaultEditor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setAutocompleteMaxVisible !== undefined) {\n\t\t\t\t\t\thost.editor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonClearOnShrinkChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setClearOnShrink(enabled);\n\t\t\t\t\thost.ui.setClearOnShrink(enabled);\n\t\t\t\t},\n\t\t\t\tonShowTerminalProgressChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowTerminalProgress(enabled);\n\t\t\t\t},\n\t\t\t\tonWarningsChange: (warnings) => {\n\t\t\t\t\thost.settingsManager.setWarnings(warnings);\n\t\t\t\t},\n\t\t\t\tonSelfModificationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setSelfModificationSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateSelfModificationSource(settings);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Self modification settings saved to ${scope}. Start a new session or /reload for system-prompt guardrails to fully refresh.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonAutonomyChange: (settings, scope) => {\n\t\t\t\t\thost.applyAutonomyMode(settings.mode ?? \"off\", scope);\n\t\t\t\t\thost.showStatus(`Autonomy mode ${settings.mode ?? \"off\"} saved to ${scope}. Use /autonomy status.`);\n\t\t\t\t},\n\t\t\t\tonResearchLaneChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setResearchLaneSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Research lane settings saved to ${scope}. Use /autonomy research or /autonomy diagnostics.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonWorkerDelegationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setWorkerDelegationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Worker delegation settings saved to ${scope}. The delegate tool uses them.`);\n\t\t\t\t},\n\t\t\t\tonLearningPolicyChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setLearningPolicySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Learning policy saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonModelCapabilityChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelCapabilitySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Model capability mode saved to ${scope}. Applies on the next model switch or /reload.`);\n\t\t\t\t},\n\t\t\t\tonContextCurationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextCurationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Context curation settings saved to ${scope}. Run /fitness <model> first if the model is unprobed.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonModelRouterChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelRouterSettings(settings, scope);\n\t\t\t\t\tfor (const value of [settings.cheapModel, settings.expensiveModel, settings.learningModel]) {\n\t\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(value);\n\t\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\t\thost.showWarning(validationMessage.replace(\"Auto Learn model\", \"Model router model\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Model Router settings saved to ${scope}. Use /session or /usage to inspect routing.`);\n\t\t\t\t},\n\t\t\t\tonAutoLearnChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setAutoLearnSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(settings.model);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Auto Learn settings saved to ${scope}. Use /auto-learn status or /auto-learn run.`);\n\t\t\t\t},\n\t\t\t\tonContextPolicyEnforcementChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextPromptEnforcementSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/prompt-policy settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonContextMemoryRetrievalChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setMemoryRetrievalSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/memory-retrieval settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonResourcesHubAction: (action) => {\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid host.handleResourcesHubAction(action);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\treturn { component: selector, focus: selector.getSettingsList() };\n\t});\n}\n"]}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* rebuild, and the resources-hub hand-off stay host-side (shared with other
|
|
8
8
|
* flows); interactive-mode keeps a thin wrapper building the host once.
|
|
9
9
|
*/
|
|
10
|
+
import { getSupportedThinkingLevels } from "@caupulican/pi-ai";
|
|
10
11
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
12
|
+
import { resolveCliModel } from "../../core/model-resolver.js";
|
|
11
13
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
12
14
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
13
15
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
@@ -80,6 +82,12 @@ export function showSettingsSelector(host) {
|
|
|
80
82
|
autoLearn: host.settingsManager.getAutoLearnSettings(),
|
|
81
83
|
autoLearnScope: projectSettings.autoLearn ? "project" : "global",
|
|
82
84
|
autoLearnModelOptions: host.getAutoLearnModelOptions(),
|
|
85
|
+
resolveModelThinkingLevels: (modelPattern) => {
|
|
86
|
+
if (!modelPattern)
|
|
87
|
+
return host.session.getAvailableThinkingLevels();
|
|
88
|
+
const resolved = resolveCliModel({ cliModel: modelPattern, modelRegistry: host.session.modelRegistry });
|
|
89
|
+
return resolved.model ? getSupportedThinkingLevels(resolved.model) : undefined;
|
|
90
|
+
},
|
|
83
91
|
contextPolicyEnforcement: host.settingsManager.getContextPromptEnforcementSettings(),
|
|
84
92
|
contextPolicyEnforcementScope: projectSettings.contextPolicy?.enforcement ? "project" : "global",
|
|
85
93
|
contextMemoryRetrieval: host.settingsManager.getMemoryRetrievalSettings(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-selector-flow.js","sourceRoot":"","sources":["../../../src/modes/interactive/settings-selector-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAOjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAG9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA0BhE,MAAM,UAAU,oBAAoB,CAAC,IAA0B,EAAQ;IACtE,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,kBAAkB,EAAE,CAAC;QAClE,MAAM,cAAc,GAAG;YACtB;gBACC,KAAK,EAAE,QAAQ;gBACf,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,oDAAoD;aACjE;YACD,GAAG,IAA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C,eAAe,CAAC,mCAAmC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAC1E,IAAI,CAAC,UAAU,CAAC,2CAA2C,KAAK,GAAG,CAAC,CAAC;YAAA,CACrE;YACD,8BAA8B,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC;gBACpD,IAAI,CAAC,eAAe,CAAC,0BAA0B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBACjE,IAAI,CAAC,UAAU,CAAC,8CAA8C,KAAK,GAAG,CAAC,CAAC;YAAA,CACxE;YACD,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;gBACjC,IAAI,EAAE,CAAC;gBACP,KAAK,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;YAAA,CAC3C;YACD,QAAQ,EAAE,GAAG,EAAE,CAAC;gBACf,IAAI,EAAE,CAAC;gBACP,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;YAAA,CACxB;SACD,CACD,CAAC;QACF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC;IAAA,CAClE,CAAC,CAAC;AAAA,CACH","sourcesContent":["/**\n * `/settings` selector flow extracted from interactive-mode.\n *\n * Builds the SettingsSelectorComponent model from the current settings/session\n * state and wires its change callbacks back through a `SettingsSelectorHost`\n * seam. Self-mod/auto-learn validation, autonomy-preset application, autocomplete\n * rebuild, and the resources-hub hand-off stay host-side (shared with other\n * flows); interactive-mode keeps a thin wrapper building the host once.\n */\n\nimport type { Component, Container, EditorComponent, SelectItem, TUI } from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport { configureHttpDispatcher, formatHttpIdleTimeoutMs } from \"../../core/http-dispatcher.ts\";\nimport type {\n\tAutonomyMode,\n\tSelfModificationSettings,\n\tSettingsManager,\n\tSettingsScope,\n} from \"../../core/settings-manager.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { SettingsSelectorComponent } from \"./components/settings-selector.ts\";\nimport { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { ToolGroupComponent } from \"./components/tool-group.ts\";\nimport { getAvailableThemes, setTheme } from \"./theme/theme.ts\";\n\nexport interface SettingsSelectorHost {\n\treadonly session: AgentSession;\n\treadonly settingsManager: SettingsManager;\n\treadonly footer: FooterComponent;\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n\treadonly defaultEditor: CustomEditor;\n\treadonly editor: EditorComponent;\n\thideThinkingBlock: boolean;\n\tshowSelector(create: (done: () => void) => { component: Component; focus: Component }): void;\n\tshowStatus(message: string): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\tgetAutoLearnModelOptions(): SelectItem[];\n\tsetupAutocompleteProvider(): void;\n\tupdateEditorBorderColor(): void;\n\trebuildChatFromMessages(): Promise<void>;\n\tvalidateSelfModificationSource(settings: SelfModificationSettings): string | undefined;\n\tapplyAutonomyMode(mode: AutonomyMode, scope?: SettingsScope): void;\n\tvalidateAutoLearnModelValue(value: string | undefined): string | undefined;\n\tupdateAutoLearnFooter(): void;\n\thandleResourcesHubAction(action: string): Promise<void>;\n}\n\nexport function showSettingsSelector(host: SettingsSelectorHost): void {\n\thost.showSelector((done) => {\n\t\tconst projectSettings = host.settingsManager.getProjectSettings();\n\t\tconst profileOptions = [\n\t\t\t{\n\t\t\t\tvalue: \"(none)\",\n\t\t\t\tlabel: \"(none)\",\n\t\t\t\tdescription: \"Use configured profile selection (session default)\",\n\t\t\t},\n\t\t\t...host.settingsManager\n\t\t\t\t.getProfileRegistry()\n\t\t\t\t.listProfiles()\n\t\t\t\t.map((profile) => ({\n\t\t\t\t\tvalue: profile.name,\n\t\t\t\t\tlabel: profile.name,\n\t\t\t\t\tdescription: profile.description ?? profile.source,\n\t\t\t\t})),\n\t\t];\n\t\tconst selector = new SettingsSelectorComponent(\n\t\t\t{\n\t\t\t\tautoCompact: host.session.autoCompactionEnabled,\n\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\tautoResizeImages: host.settingsManager.getImageAutoResize(),\n\t\t\t\tblockImages: host.settingsManager.getBlockImages(),\n\t\t\t\tenableSkillCommands: host.settingsManager.getEnableSkillCommands(),\n\t\t\t\tsteeringMode: host.session.steeringMode,\n\t\t\t\tfollowUpMode: host.session.followUpMode,\n\t\t\t\ttransport: host.settingsManager.getTransport(),\n\t\t\t\thttpIdleTimeoutMs: host.settingsManager.getHttpIdleTimeoutMs(),\n\t\t\t\tthinkingLevel: host.session.thinkingLevel,\n\t\t\t\tavailableThinkingLevels: host.session.getAvailableThinkingLevels(),\n\t\t\t\tcurrentTheme: host.settingsManager.getTheme() || \"dark\",\n\t\t\t\t// The picker offers only themes the active profile permits (no-bypass). The theme\n\t\t\t\t// registry/renderer keeps the full set, so an already-applied theme still renders\n\t\t\t\t// even if the profile would block re-selecting it.\n\t\t\t\tavailableThemes: getAvailableThemes().filter((name) =>\n\t\t\t\t\thost.settingsManager.isResourceAllowedByProfile(\"themes\", name),\n\t\t\t\t),\n\t\t\t\thideThinkingBlock: host.hideThinkingBlock,\n\t\t\t\tcollapseChangelog: host.settingsManager.getCollapseChangelog(),\n\t\t\t\tenableInstallTelemetry: host.settingsManager.getEnableInstallTelemetry(),\n\t\t\t\tdoubleEscapeAction: host.settingsManager.getDoubleEscapeAction(),\n\t\t\t\ttreeFilterMode: host.settingsManager.getTreeFilterMode(),\n\t\t\t\tshowHardwareCursor: host.settingsManager.getShowHardwareCursor(),\n\t\t\t\teditorPaddingX: host.settingsManager.getEditorPaddingX(),\n\t\t\t\tautocompleteMaxVisible: host.settingsManager.getAutocompleteMaxVisible(),\n\t\t\t\tquietStartup: host.settingsManager.getQuietStartup(),\n\t\t\t\tclearOnShrink: host.settingsManager.getClearOnShrink(),\n\t\t\t\tshowTerminalProgress: host.settingsManager.getShowTerminalProgress(),\n\t\t\t\twarnings: host.settingsManager.getWarnings(),\n\t\t\t\tselfModification: host.settingsManager.getSelfModificationSettings(),\n\t\t\t\tselfModificationScope: projectSettings.selfModification ? \"project\" : \"global\",\n\t\t\t\tautonomy: host.settingsManager.getAutonomySettings(),\n\t\t\t\tautonomyScope: projectSettings.autonomy ? \"project\" : \"global\",\n\t\t\t\tresearchLane: host.settingsManager.getResearchLaneSettings(),\n\t\t\t\tresearchLaneScope: projectSettings.researchLane ? \"project\" : \"global\",\n\t\t\t\tworkerDelegation: host.settingsManager.getWorkerDelegationSettings(),\n\t\t\t\tworkerDelegationScope: projectSettings.workerDelegation ? \"project\" : \"global\",\n\t\t\t\tcontextCuration: host.settingsManager.getContextCurationSettings(),\n\t\t\t\tcontextCurationScope: projectSettings.contextPolicy?.curation ? \"project\" : \"global\",\n\t\t\t\tlearningPolicy: host.settingsManager.getLearningPolicySettings(),\n\t\t\t\tlearningPolicyScope: projectSettings.learningPolicy ? \"project\" : \"global\",\n\t\t\t\tmodelCapability: host.settingsManager.getModelCapabilitySettings(),\n\t\t\t\tmodelCapabilityScope: projectSettings.modelCapability ? \"project\" : \"global\",\n\t\t\t\tmodelRouter: host.settingsManager.getModelRouterSettings(),\n\t\t\t\tmodelRouterScope: projectSettings.modelRouter ? \"project\" : \"global\",\n\t\t\t\tautoLearn: host.settingsManager.getAutoLearnSettings(),\n\t\t\t\tautoLearnScope: projectSettings.autoLearn ? \"project\" : \"global\",\n\t\t\t\tautoLearnModelOptions: host.getAutoLearnModelOptions(),\n\t\t\t\tcontextPolicyEnforcement: host.settingsManager.getContextPromptEnforcementSettings(),\n\t\t\t\tcontextPolicyEnforcementScope: projectSettings.contextPolicy?.enforcement ? \"project\" : \"global\",\n\t\t\t\tcontextMemoryRetrieval: host.settingsManager.getMemoryRetrievalSettings(),\n\t\t\t\tcontextMemoryRetrievalScope: projectSettings.contextPolicy?.memory ? \"project\" : \"global\",\n\t\t\t\tcurrentModelPattern: host.session.model\n\t\t\t\t\t? `${host.session.model.provider}/${host.session.model.id}`\n\t\t\t\t\t: undefined,\n\t\t\t\tactiveProfileName: host.settingsManager.getActiveResourceProfileNames()[0],\n\t\t\t\tprofileOptions,\n\t\t\t\texternalResourceRoots: host.settingsManager.getExternalResourceRoots(),\n\t\t\t\ttrustedResourceRoots: host.settingsManager.getTrustedResourceRoots(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tonAutoCompactChange: (enabled) => {\n\t\t\t\t\thost.session.setAutoCompactionEnabled(enabled);\n\t\t\t\t\thost.footer.setAutoCompactEnabled(enabled);\n\t\t\t\t},\n\t\t\t\tonShowImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowImages(enabled);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setShowImages(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonImageWidthCellsChange: (width) => {\n\t\t\t\t\thost.settingsManager.setImageWidthCells(width);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setImageWidthCells(width);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonAutoResizeImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setImageAutoResize(enabled);\n\t\t\t\t},\n\t\t\t\tonBlockImagesChange: (blocked) => {\n\t\t\t\t\thost.settingsManager.setBlockImages(blocked);\n\t\t\t\t},\n\t\t\t\tonEnableSkillCommandsChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableSkillCommands(enabled);\n\t\t\t\t\thost.setupAutocompleteProvider();\n\t\t\t\t},\n\t\t\t\tonSteeringModeChange: (mode) => {\n\t\t\t\t\thost.session.setSteeringMode(mode);\n\t\t\t\t},\n\t\t\t\tonFollowUpModeChange: (mode) => {\n\t\t\t\t\thost.session.setFollowUpMode(mode);\n\t\t\t\t},\n\t\t\t\tonTransportChange: (transport) => {\n\t\t\t\t\thost.settingsManager.setTransport(transport);\n\t\t\t\t\thost.session.agent.transport = transport;\n\t\t\t\t},\n\t\t\t\tonHttpIdleTimeoutMsChange: (timeoutMs) => {\n\t\t\t\t\thost.settingsManager.setHttpIdleTimeoutMs(timeoutMs);\n\t\t\t\t\tconfigureHttpDispatcher(timeoutMs);\n\t\t\t\t\thost.showStatus(`HTTP idle timeout: ${formatHttpIdleTimeoutMs(timeoutMs)}`);\n\t\t\t\t},\n\t\t\t\tonThinkingLevelChange: (level) => {\n\t\t\t\t\thost.session.setThinkingLevel(level);\n\t\t\t\t\thost.footer.invalidate();\n\t\t\t\t\thost.updateEditorBorderColor();\n\t\t\t\t},\n\t\t\t\tonThemeChange: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\thost.settingsManager.setTheme(themeName);\n\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\tif (!result.success) {\n\t\t\t\t\t\thost.showError(`Failed to load theme \"${themeName}\": ${result.error}\\nFell back to dark theme.`);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonHideThinkingBlockChange: (hidden) => {\n\t\t\t\t\thost.hideThinkingBlock = hidden;\n\t\t\t\t\thost.settingsManager.setHideThinkingBlock(hidden);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\t\t\t\t\tchild.setHideThinkingBlock(hidden);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvoid host.rebuildChatFromMessages();\n\t\t\t\t},\n\t\t\t\tonCollapseChangelogChange: (collapsed) => {\n\t\t\t\t\thost.settingsManager.setCollapseChangelog(collapsed);\n\t\t\t\t},\n\t\t\t\tonEnableInstallTelemetryChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableInstallTelemetry(enabled);\n\t\t\t\t},\n\t\t\t\tonQuietStartupChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setQuietStartup(enabled);\n\t\t\t\t},\n\t\t\t\tonDoubleEscapeActionChange: (action) => {\n\t\t\t\t\thost.settingsManager.setDoubleEscapeAction(action);\n\t\t\t\t},\n\t\t\t\tonTreeFilterModeChange: (mode) => {\n\t\t\t\t\thost.settingsManager.setTreeFilterMode(mode);\n\t\t\t\t},\n\t\t\t\tonShowHardwareCursorChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowHardwareCursor(enabled);\n\t\t\t\t\thost.ui.setShowHardwareCursor(enabled);\n\t\t\t\t},\n\t\t\t\tonEditorPaddingXChange: (padding) => {\n\t\t\t\t\thost.settingsManager.setEditorPaddingX(padding);\n\t\t\t\t\thost.defaultEditor.setPaddingX(padding);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setPaddingX !== undefined) {\n\t\t\t\t\t\thost.editor.setPaddingX(padding);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonAutocompleteMaxVisibleChange: (maxVisible) => {\n\t\t\t\t\thost.settingsManager.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\thost.defaultEditor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setAutocompleteMaxVisible !== undefined) {\n\t\t\t\t\t\thost.editor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonClearOnShrinkChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setClearOnShrink(enabled);\n\t\t\t\t\thost.ui.setClearOnShrink(enabled);\n\t\t\t\t},\n\t\t\t\tonShowTerminalProgressChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowTerminalProgress(enabled);\n\t\t\t\t},\n\t\t\t\tonWarningsChange: (warnings) => {\n\t\t\t\t\thost.settingsManager.setWarnings(warnings);\n\t\t\t\t},\n\t\t\t\tonSelfModificationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setSelfModificationSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateSelfModificationSource(settings);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Self modification settings saved to ${scope}. Start a new session or /reload for system-prompt guardrails to fully refresh.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonAutonomyChange: (settings, scope) => {\n\t\t\t\t\thost.applyAutonomyMode(settings.mode ?? \"off\", scope);\n\t\t\t\t\thost.showStatus(`Autonomy mode ${settings.mode ?? \"off\"} saved to ${scope}. Use /autonomy status.`);\n\t\t\t\t},\n\t\t\t\tonResearchLaneChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setResearchLaneSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Research lane settings saved to ${scope}. Use /autonomy research or /autonomy diagnostics.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonWorkerDelegationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setWorkerDelegationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Worker delegation settings saved to ${scope}. The delegate tool uses them.`);\n\t\t\t\t},\n\t\t\t\tonLearningPolicyChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setLearningPolicySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Learning policy saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonModelCapabilityChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelCapabilitySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Model capability mode saved to ${scope}. Applies on the next model switch or /reload.`);\n\t\t\t\t},\n\t\t\t\tonContextCurationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextCurationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Context curation settings saved to ${scope}. Run /fitness <model> first if the model is unprobed.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonModelRouterChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelRouterSettings(settings, scope);\n\t\t\t\t\tfor (const value of [settings.cheapModel, settings.expensiveModel, settings.learningModel]) {\n\t\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(value);\n\t\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\t\thost.showWarning(validationMessage.replace(\"Auto Learn model\", \"Model router model\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Model Router settings saved to ${scope}. Use /session or /usage to inspect routing.`);\n\t\t\t\t},\n\t\t\t\tonAutoLearnChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setAutoLearnSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(settings.model);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Auto Learn settings saved to ${scope}. Use /auto-learn status or /auto-learn run.`);\n\t\t\t\t},\n\t\t\t\tonContextPolicyEnforcementChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextPromptEnforcementSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/prompt-policy settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonContextMemoryRetrievalChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setMemoryRetrievalSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/memory-retrieval settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonResourcesHubAction: (action) => {\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid host.handleResourcesHubAction(action);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\treturn { component: selector, focus: selector.getSettingsList() };\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"settings-selector-flow.js","sourceRoot":"","sources":["../../../src/modes/interactive/settings-selector-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAO/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAG9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA0BhE,MAAM,UAAU,oBAAoB,CAAC,IAA0B,EAAQ;IACtE,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,kBAAkB,EAAE,CAAC;QAClE,MAAM,cAAc,GAAG;YACtB;gBACC,KAAK,EAAE,QAA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sourcesContent":["/**\n * `/settings` selector flow extracted from interactive-mode.\n *\n * Builds the SettingsSelectorComponent model from the current settings/session\n * state and wires its change callbacks back through a `SettingsSelectorHost`\n * seam. Self-mod/auto-learn validation, autonomy-preset application, autocomplete\n * rebuild, and the resources-hub hand-off stay host-side (shared with other\n * flows); interactive-mode keeps a thin wrapper building the host once.\n */\n\nimport { getSupportedThinkingLevels } from \"@caupulican/pi-ai\";\nimport type { Component, Container, EditorComponent, SelectItem, TUI } from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport { configureHttpDispatcher, formatHttpIdleTimeoutMs } from \"../../core/http-dispatcher.ts\";\nimport { resolveCliModel } from \"../../core/model-resolver.ts\";\nimport type {\n\tAutonomyMode,\n\tSelfModificationSettings,\n\tSettingsManager,\n\tSettingsScope,\n} from \"../../core/settings-manager.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { SettingsSelectorComponent } from \"./components/settings-selector.ts\";\nimport { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { ToolGroupComponent } from \"./components/tool-group.ts\";\nimport { getAvailableThemes, setTheme } from \"./theme/theme.ts\";\n\nexport interface SettingsSelectorHost {\n\treadonly session: AgentSession;\n\treadonly settingsManager: SettingsManager;\n\treadonly footer: FooterComponent;\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n\treadonly defaultEditor: CustomEditor;\n\treadonly editor: EditorComponent;\n\thideThinkingBlock: boolean;\n\tshowSelector(create: (done: () => void) => { component: Component; focus: Component }): void;\n\tshowStatus(message: string): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\tgetAutoLearnModelOptions(): SelectItem[];\n\tsetupAutocompleteProvider(): void;\n\tupdateEditorBorderColor(): void;\n\trebuildChatFromMessages(): Promise<void>;\n\tvalidateSelfModificationSource(settings: SelfModificationSettings): string | undefined;\n\tapplyAutonomyMode(mode: AutonomyMode, scope?: SettingsScope): void;\n\tvalidateAutoLearnModelValue(value: string | undefined): string | undefined;\n\tupdateAutoLearnFooter(): void;\n\thandleResourcesHubAction(action: string): Promise<void>;\n}\n\nexport function showSettingsSelector(host: SettingsSelectorHost): void {\n\thost.showSelector((done) => {\n\t\tconst projectSettings = host.settingsManager.getProjectSettings();\n\t\tconst profileOptions = [\n\t\t\t{\n\t\t\t\tvalue: \"(none)\",\n\t\t\t\tlabel: \"(none)\",\n\t\t\t\tdescription: \"Use configured profile selection (session default)\",\n\t\t\t},\n\t\t\t...host.settingsManager\n\t\t\t\t.getProfileRegistry()\n\t\t\t\t.listProfiles()\n\t\t\t\t.map((profile) => ({\n\t\t\t\t\tvalue: profile.name,\n\t\t\t\t\tlabel: profile.name,\n\t\t\t\t\tdescription: profile.description ?? profile.source,\n\t\t\t\t})),\n\t\t];\n\t\tconst selector = new SettingsSelectorComponent(\n\t\t\t{\n\t\t\t\tautoCompact: host.session.autoCompactionEnabled,\n\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\tautoResizeImages: host.settingsManager.getImageAutoResize(),\n\t\t\t\tblockImages: host.settingsManager.getBlockImages(),\n\t\t\t\tenableSkillCommands: host.settingsManager.getEnableSkillCommands(),\n\t\t\t\tsteeringMode: host.session.steeringMode,\n\t\t\t\tfollowUpMode: host.session.followUpMode,\n\t\t\t\ttransport: host.settingsManager.getTransport(),\n\t\t\t\thttpIdleTimeoutMs: host.settingsManager.getHttpIdleTimeoutMs(),\n\t\t\t\tthinkingLevel: host.session.thinkingLevel,\n\t\t\t\tavailableThinkingLevels: host.session.getAvailableThinkingLevels(),\n\t\t\t\tcurrentTheme: host.settingsManager.getTheme() || \"dark\",\n\t\t\t\t// The picker offers only themes the active profile permits (no-bypass). The theme\n\t\t\t\t// registry/renderer keeps the full set, so an already-applied theme still renders\n\t\t\t\t// even if the profile would block re-selecting it.\n\t\t\t\tavailableThemes: getAvailableThemes().filter((name) =>\n\t\t\t\t\thost.settingsManager.isResourceAllowedByProfile(\"themes\", name),\n\t\t\t\t),\n\t\t\t\thideThinkingBlock: host.hideThinkingBlock,\n\t\t\t\tcollapseChangelog: host.settingsManager.getCollapseChangelog(),\n\t\t\t\tenableInstallTelemetry: host.settingsManager.getEnableInstallTelemetry(),\n\t\t\t\tdoubleEscapeAction: host.settingsManager.getDoubleEscapeAction(),\n\t\t\t\ttreeFilterMode: host.settingsManager.getTreeFilterMode(),\n\t\t\t\tshowHardwareCursor: host.settingsManager.getShowHardwareCursor(),\n\t\t\t\teditorPaddingX: host.settingsManager.getEditorPaddingX(),\n\t\t\t\tautocompleteMaxVisible: host.settingsManager.getAutocompleteMaxVisible(),\n\t\t\t\tquietStartup: host.settingsManager.getQuietStartup(),\n\t\t\t\tclearOnShrink: host.settingsManager.getClearOnShrink(),\n\t\t\t\tshowTerminalProgress: host.settingsManager.getShowTerminalProgress(),\n\t\t\t\twarnings: host.settingsManager.getWarnings(),\n\t\t\t\tselfModification: host.settingsManager.getSelfModificationSettings(),\n\t\t\t\tselfModificationScope: projectSettings.selfModification ? \"project\" : \"global\",\n\t\t\t\tautonomy: host.settingsManager.getAutonomySettings(),\n\t\t\t\tautonomyScope: projectSettings.autonomy ? \"project\" : \"global\",\n\t\t\t\tresearchLane: host.settingsManager.getResearchLaneSettings(),\n\t\t\t\tresearchLaneScope: projectSettings.researchLane ? \"project\" : \"global\",\n\t\t\t\tworkerDelegation: host.settingsManager.getWorkerDelegationSettings(),\n\t\t\t\tworkerDelegationScope: projectSettings.workerDelegation ? \"project\" : \"global\",\n\t\t\t\tcontextCuration: host.settingsManager.getContextCurationSettings(),\n\t\t\t\tcontextCurationScope: projectSettings.contextPolicy?.curation ? \"project\" : \"global\",\n\t\t\t\tlearningPolicy: host.settingsManager.getLearningPolicySettings(),\n\t\t\t\tlearningPolicyScope: projectSettings.learningPolicy ? \"project\" : \"global\",\n\t\t\t\tmodelCapability: host.settingsManager.getModelCapabilitySettings(),\n\t\t\t\tmodelCapabilityScope: projectSettings.modelCapability ? \"project\" : \"global\",\n\t\t\t\tmodelRouter: host.settingsManager.getModelRouterSettings(),\n\t\t\t\tmodelRouterScope: projectSettings.modelRouter ? \"project\" : \"global\",\n\t\t\t\tautoLearn: host.settingsManager.getAutoLearnSettings(),\n\t\t\t\tautoLearnScope: projectSettings.autoLearn ? \"project\" : \"global\",\n\t\t\t\tautoLearnModelOptions: host.getAutoLearnModelOptions(),\n\t\t\t\tresolveModelThinkingLevels: (modelPattern) => {\n\t\t\t\t\tif (!modelPattern) return host.session.getAvailableThinkingLevels();\n\t\t\t\t\tconst resolved = resolveCliModel({ cliModel: modelPattern, modelRegistry: host.session.modelRegistry });\n\t\t\t\t\treturn resolved.model ? getSupportedThinkingLevels(resolved.model) : undefined;\n\t\t\t\t},\n\t\t\t\tcontextPolicyEnforcement: host.settingsManager.getContextPromptEnforcementSettings(),\n\t\t\t\tcontextPolicyEnforcementScope: projectSettings.contextPolicy?.enforcement ? \"project\" : \"global\",\n\t\t\t\tcontextMemoryRetrieval: host.settingsManager.getMemoryRetrievalSettings(),\n\t\t\t\tcontextMemoryRetrievalScope: projectSettings.contextPolicy?.memory ? \"project\" : \"global\",\n\t\t\t\tcurrentModelPattern: host.session.model\n\t\t\t\t\t? `${host.session.model.provider}/${host.session.model.id}`\n\t\t\t\t\t: undefined,\n\t\t\t\tactiveProfileName: host.settingsManager.getActiveResourceProfileNames()[0],\n\t\t\t\tprofileOptions,\n\t\t\t\texternalResourceRoots: host.settingsManager.getExternalResourceRoots(),\n\t\t\t\ttrustedResourceRoots: host.settingsManager.getTrustedResourceRoots(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tonAutoCompactChange: (enabled) => {\n\t\t\t\t\thost.session.setAutoCompactionEnabled(enabled);\n\t\t\t\t\thost.footer.setAutoCompactEnabled(enabled);\n\t\t\t\t},\n\t\t\t\tonShowImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowImages(enabled);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setShowImages(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonImageWidthCellsChange: (width) => {\n\t\t\t\t\thost.settingsManager.setImageWidthCells(width);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setImageWidthCells(width);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonAutoResizeImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setImageAutoResize(enabled);\n\t\t\t\t},\n\t\t\t\tonBlockImagesChange: (blocked) => {\n\t\t\t\t\thost.settingsManager.setBlockImages(blocked);\n\t\t\t\t},\n\t\t\t\tonEnableSkillCommandsChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableSkillCommands(enabled);\n\t\t\t\t\thost.setupAutocompleteProvider();\n\t\t\t\t},\n\t\t\t\tonSteeringModeChange: (mode) => {\n\t\t\t\t\thost.session.setSteeringMode(mode);\n\t\t\t\t},\n\t\t\t\tonFollowUpModeChange: (mode) => {\n\t\t\t\t\thost.session.setFollowUpMode(mode);\n\t\t\t\t},\n\t\t\t\tonTransportChange: (transport) => {\n\t\t\t\t\thost.settingsManager.setTransport(transport);\n\t\t\t\t\thost.session.agent.transport = transport;\n\t\t\t\t},\n\t\t\t\tonHttpIdleTimeoutMsChange: (timeoutMs) => {\n\t\t\t\t\thost.settingsManager.setHttpIdleTimeoutMs(timeoutMs);\n\t\t\t\t\tconfigureHttpDispatcher(timeoutMs);\n\t\t\t\t\thost.showStatus(`HTTP idle timeout: ${formatHttpIdleTimeoutMs(timeoutMs)}`);\n\t\t\t\t},\n\t\t\t\tonThinkingLevelChange: (level) => {\n\t\t\t\t\thost.session.setThinkingLevel(level);\n\t\t\t\t\thost.footer.invalidate();\n\t\t\t\t\thost.updateEditorBorderColor();\n\t\t\t\t},\n\t\t\t\tonThemeChange: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\thost.settingsManager.setTheme(themeName);\n\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\tif (!result.success) {\n\t\t\t\t\t\thost.showError(`Failed to load theme \"${themeName}\": ${result.error}\\nFell back to dark theme.`);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonHideThinkingBlockChange: (hidden) => {\n\t\t\t\t\thost.hideThinkingBlock = hidden;\n\t\t\t\t\thost.settingsManager.setHideThinkingBlock(hidden);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\t\t\t\t\tchild.setHideThinkingBlock(hidden);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvoid host.rebuildChatFromMessages();\n\t\t\t\t},\n\t\t\t\tonCollapseChangelogChange: (collapsed) => {\n\t\t\t\t\thost.settingsManager.setCollapseChangelog(collapsed);\n\t\t\t\t},\n\t\t\t\tonEnableInstallTelemetryChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableInstallTelemetry(enabled);\n\t\t\t\t},\n\t\t\t\tonQuietStartupChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setQuietStartup(enabled);\n\t\t\t\t},\n\t\t\t\tonDoubleEscapeActionChange: (action) => {\n\t\t\t\t\thost.settingsManager.setDoubleEscapeAction(action);\n\t\t\t\t},\n\t\t\t\tonTreeFilterModeChange: (mode) => {\n\t\t\t\t\thost.settingsManager.setTreeFilterMode(mode);\n\t\t\t\t},\n\t\t\t\tonShowHardwareCursorChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowHardwareCursor(enabled);\n\t\t\t\t\thost.ui.setShowHardwareCursor(enabled);\n\t\t\t\t},\n\t\t\t\tonEditorPaddingXChange: (padding) => {\n\t\t\t\t\thost.settingsManager.setEditorPaddingX(padding);\n\t\t\t\t\thost.defaultEditor.setPaddingX(padding);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setPaddingX !== undefined) {\n\t\t\t\t\t\thost.editor.setPaddingX(padding);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonAutocompleteMaxVisibleChange: (maxVisible) => {\n\t\t\t\t\thost.settingsManager.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\thost.defaultEditor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setAutocompleteMaxVisible !== undefined) {\n\t\t\t\t\t\thost.editor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonClearOnShrinkChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setClearOnShrink(enabled);\n\t\t\t\t\thost.ui.setClearOnShrink(enabled);\n\t\t\t\t},\n\t\t\t\tonShowTerminalProgressChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowTerminalProgress(enabled);\n\t\t\t\t},\n\t\t\t\tonWarningsChange: (warnings) => {\n\t\t\t\t\thost.settingsManager.setWarnings(warnings);\n\t\t\t\t},\n\t\t\t\tonSelfModificationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setSelfModificationSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateSelfModificationSource(settings);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Self modification settings saved to ${scope}. Start a new session or /reload for system-prompt guardrails to fully refresh.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonAutonomyChange: (settings, scope) => {\n\t\t\t\t\thost.applyAutonomyMode(settings.mode ?? \"off\", scope);\n\t\t\t\t\thost.showStatus(`Autonomy mode ${settings.mode ?? \"off\"} saved to ${scope}. Use /autonomy status.`);\n\t\t\t\t},\n\t\t\t\tonResearchLaneChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setResearchLaneSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Research lane settings saved to ${scope}. Use /autonomy research or /autonomy diagnostics.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonWorkerDelegationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setWorkerDelegationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Worker delegation settings saved to ${scope}. The delegate tool uses them.`);\n\t\t\t\t},\n\t\t\t\tonLearningPolicyChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setLearningPolicySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Learning policy saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonModelCapabilityChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelCapabilitySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Model capability mode saved to ${scope}. Applies on the next model switch or /reload.`);\n\t\t\t\t},\n\t\t\t\tonContextCurationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextCurationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Context curation settings saved to ${scope}. Run /fitness <model> first if the model is unprobed.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonModelRouterChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelRouterSettings(settings, scope);\n\t\t\t\t\tfor (const value of [settings.cheapModel, settings.expensiveModel, settings.learningModel]) {\n\t\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(value);\n\t\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\t\thost.showWarning(validationMessage.replace(\"Auto Learn model\", \"Model router model\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Model Router settings saved to ${scope}. Use /session or /usage to inspect routing.`);\n\t\t\t\t},\n\t\t\t\tonAutoLearnChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setAutoLearnSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(settings.model);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Auto Learn settings saved to ${scope}. Use /auto-learn status or /auto-learn run.`);\n\t\t\t\t},\n\t\t\t\tonContextPolicyEnforcementChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextPromptEnforcementSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/prompt-policy settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonContextMemoryRetrievalChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setMemoryRetrievalSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/memory-retrieval settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonResourcesHubAction: (action) => {\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid host.handleResourcesHubAction(action);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\treturn { component: selector, focus: selector.getSettingsList() };\n\t});\n}\n"]}
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
},
|
|
287
287
|
"thinkingXhigh": {
|
|
288
288
|
"$ref": "#/$defs/colorValue",
|
|
289
|
-
"description": "
|
|
289
|
+
"description": "Highest-intensity thinking border shared by xhigh, max, and ultra"
|
|
290
290
|
},
|
|
291
291
|
"bashMode": {
|
|
292
292
|
"$ref": "#/$defs/colorValue",
|
|
@@ -25,7 +25,7 @@ export declare class Theme {
|
|
|
25
25
|
getFgAnsi(color: ThemeColor): string;
|
|
26
26
|
getBgAnsi(color: ThemeBg): string;
|
|
27
27
|
getColorMode(): ColorMode;
|
|
28
|
-
getThinkingBorderColor(level: "off" | "minimal" | "low" | "medium" | "high" | "xhigh"): (str: string) => string;
|
|
28
|
+
getThinkingBorderColor(level: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra"): (str: string) => string;
|
|
29
29
|
getBashModeBorderColor(): (str: string) => string;
|
|
30
30
|
}
|
|
31
31
|
export declare function getAvailableThemes(): string[];
|