@tomsun28/pizza 0.0.9 → 0.1.1
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/README.md +20 -143
- package/README.zh-CN.md +36 -0
- package/dist/bun/cli.d.ts +2 -0
- package/dist/bun/cli.js +6 -0
- package/dist/bun/register-bedrock.d.ts +1 -0
- package/dist/bun/register-bedrock.js +3 -0
- package/dist/cli/args.d.ts +48 -0
- package/dist/cli/args.js +330 -0
- package/dist/cli/config-selector.d.ts +13 -0
- package/dist/cli/config-selector.js +30 -0
- package/dist/cli/file-processor.d.ts +14 -0
- package/dist/cli/file-processor.js +82 -0
- package/dist/cli/initial-message.d.ts +17 -0
- package/dist/cli/initial-message.js +21 -0
- package/dist/cli/list-models.d.ts +8 -0
- package/dist/cli/list-models.js +96 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +68 -0
- package/dist/config.d.ts +79 -0
- package/dist/config.js +223 -0
- package/dist/core/agent/index.d.ts +6 -0
- package/dist/core/agent/index.js +6 -0
- package/dist/core/agent/types.d.ts +202 -0
- package/dist/core/agent/types.js +51 -0
- package/dist/core/auth-storage.d.ts +135 -0
- package/dist/core/auth-storage.js +417 -0
- package/dist/core/bash-executor.d.ts +31 -0
- package/dist/core/bash-executor.js +107 -0
- package/dist/core/compaction/branch-summarization.d.ts +87 -0
- package/dist/core/compaction/branch-summarization.js +242 -0
- package/dist/core/compaction/compaction-engine.d.ts +40 -0
- package/dist/core/compaction/compaction-engine.js +292 -0
- package/dist/core/compaction/compaction.d.ts +106 -0
- package/dist/core/compaction/compaction.js +295 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/utils.d.ts +37 -0
- package/dist/core/compaction/utils.js +152 -0
- package/dist/core/defaults.d.ts +2 -0
- package/dist/core/defaults.js +1 -0
- package/dist/core/diagnostics.d.ts +14 -0
- package/dist/core/diagnostics.js +1 -0
- package/dist/core/event-bus.d.ts +8 -0
- package/dist/core/event-bus.js +24 -0
- package/dist/core/event-store/events.d.ts +465 -0
- package/dist/core/event-store/events.js +6 -0
- package/dist/core/event-store/index.d.ts +10 -0
- package/dist/core/event-store/index.js +10 -0
- package/dist/core/event-store/sqlite-store.d.ts +27 -0
- package/dist/core/event-store/sqlite-store.js +275 -0
- package/dist/core/event-store/store.d.ts +91 -0
- package/dist/core/event-store/store.js +7 -0
- package/dist/core/event-store/thread-scoped-store.d.ts +29 -0
- package/dist/core/event-store/thread-scoped-store.js +50 -0
- package/dist/core/event-store/types.d.ts +70 -0
- package/dist/core/event-store/types.js +7 -0
- package/dist/core/event-store/workspace.d.ts +37 -0
- package/dist/core/event-store/workspace.js +71 -0
- package/dist/core/exec.d.ts +28 -0
- package/dist/core/exec.js +74 -0
- package/dist/core/export-html/ansi-to-html.d.ts +21 -0
- package/dist/core/export-html/ansi-to-html.js +248 -0
- package/dist/core/export-html/index.d.ts +29 -0
- package/dist/core/export-html/index.js +186 -0
- package/dist/core/export-html/template.css +1017 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1742 -0
- package/dist/core/export-html/tool-renderer.d.ts +39 -0
- package/dist/core/export-html/tool-renderer.js +94 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +6 -0
- package/dist/core/extensions/index.d.ts +12 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/loader.d.ts +24 -0
- package/dist/core/extensions/loader.js +492 -0
- package/dist/core/extensions/runner.d.ts +167 -0
- package/dist/core/extensions/runner.js +898 -0
- package/dist/core/extensions/session-context.d.ts +67 -0
- package/dist/core/extensions/session-context.js +272 -0
- package/dist/core/extensions/types.d.ts +1147 -0
- package/dist/core/extensions/types.js +44 -0
- package/dist/core/extensions/wrapper.d.ts +19 -0
- package/dist/core/extensions/wrapper.js +21 -0
- package/dist/core/footer-data-provider.d.ts +47 -0
- package/dist/core/footer-data-provider.js +321 -0
- package/dist/core/goal/index.d.ts +3 -0
- package/dist/core/goal/index.js +1 -0
- package/dist/core/goal/scheduler.d.ts +83 -0
- package/dist/core/goal/scheduler.js +154 -0
- package/dist/core/goal/types.d.ts +182 -0
- package/dist/core/goal/types.js +11 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.js +8 -0
- package/dist/core/intent/classifier.d.ts +53 -0
- package/dist/core/intent/classifier.js +353 -0
- package/dist/core/intent/index.d.ts +8 -0
- package/dist/core/intent/index.js +8 -0
- package/dist/core/intent/tool-adapter.d.ts +31 -0
- package/dist/core/intent/tool-adapter.js +168 -0
- package/dist/core/intent/types.d.ts +71 -0
- package/dist/core/intent/types.js +6 -0
- package/dist/core/keybindings.d.ts +297 -0
- package/dist/core/keybindings.js +250 -0
- package/dist/core/messages.d.ts +30 -0
- package/dist/core/messages.js +134 -0
- package/dist/core/model-registry.d.ts +131 -0
- package/dist/core/model-registry.js +634 -0
- package/dist/core/model-resolver.d.ts +109 -0
- package/dist/core/model-resolver.js +486 -0
- package/dist/core/output-guard.d.ts +5 -0
- package/dist/core/output-guard.js +58 -0
- package/dist/core/package-manager.d.ts +196 -0
- package/dist/core/package-manager.js +1873 -0
- package/dist/core/projection/boundary-inferrer.d.ts +58 -0
- package/dist/core/projection/boundary-inferrer.js +122 -0
- package/dist/core/projection/event-to-message.d.ts +35 -0
- package/dist/core/projection/event-to-message.js +253 -0
- package/dist/core/projection/goal-projection.d.ts +67 -0
- package/dist/core/projection/goal-projection.js +339 -0
- package/dist/core/projection/index.d.ts +13 -0
- package/dist/core/projection/index.js +13 -0
- package/dist/core/projection/session-manager.d.ts +100 -0
- package/dist/core/projection/session-manager.js +331 -0
- package/dist/core/projection/session-projection.d.ts +58 -0
- package/dist/core/projection/session-projection.js +257 -0
- package/dist/core/projection/task-history.d.ts +13 -0
- package/dist/core/projection/task-history.js +61 -0
- package/dist/core/projection/timeline-projection.d.ts +82 -0
- package/dist/core/projection/timeline-projection.js +276 -0
- package/dist/core/projection/types.d.ts +69 -0
- package/dist/core/projection/types.js +6 -0
- package/dist/core/prompt-templates.d.ts +51 -0
- package/dist/core/prompt-templates.js +249 -0
- package/dist/core/resolve-config-value.d.ts +22 -0
- package/dist/core/resolve-config-value.js +125 -0
- package/dist/core/resource-loader.d.ts +193 -0
- package/dist/core/resource-loader.js +685 -0
- package/dist/core/runtime/ai-client.d.ts +12 -0
- package/dist/core/runtime/ai-client.js +153 -0
- package/dist/core/runtime/checkpoint.d.ts +12 -0
- package/dist/core/runtime/checkpoint.js +78 -0
- package/dist/core/runtime/index.d.ts +12 -0
- package/dist/core/runtime/index.js +12 -0
- package/dist/core/runtime/llm-types.d.ts +99 -0
- package/dist/core/runtime/llm-types.js +6 -0
- package/dist/core/runtime/local-runtime.d.ts +23 -0
- package/dist/core/runtime/local-runtime.js +59 -0
- package/dist/core/runtime/policies.d.ts +72 -0
- package/dist/core/runtime/policies.js +37 -0
- package/dist/core/runtime/reactor.d.ts +213 -0
- package/dist/core/runtime/reactor.js +992 -0
- package/dist/core/runtime/runtime.d.ts +191 -0
- package/dist/core/runtime/runtime.js +449 -0
- package/dist/core/runtime/types.d.ts +42 -0
- package/dist/core/runtime/types.js +1 -0
- package/dist/core/sdk.d.ts +12 -0
- package/dist/core/sdk.js +10 -0
- package/dist/core/session-context-builder.d.ts +9 -0
- package/dist/core/session-context-builder.js +87 -0
- package/dist/core/session-cwd.d.ts +18 -0
- package/dist/core/session-cwd.js +36 -0
- package/dist/core/session-facade-factory.d.ts +79 -0
- package/dist/core/session-facade-factory.js +460 -0
- package/dist/core/session-facade.d.ts +57 -0
- package/dist/core/session-facade.js +91 -0
- package/dist/core/session-listing.d.ts +30 -0
- package/dist/core/session-listing.js +168 -0
- package/dist/core/session-reader.d.ts +19 -0
- package/dist/core/session-reader.js +101 -0
- package/dist/core/session-ref.d.ts +7 -0
- package/dist/core/session-ref.js +25 -0
- package/dist/core/session-services.d.ts +51 -0
- package/dist/core/session-services.js +90 -0
- package/dist/core/session-stats.d.ts +43 -0
- package/dist/core/session-stats.js +41 -0
- package/dist/core/settings-manager.d.ts +236 -0
- package/dist/core/settings-manager.js +706 -0
- package/dist/core/skill-block-parser.d.ts +12 -0
- package/dist/core/skill-block-parser.js +15 -0
- package/dist/core/skills.d.ts +59 -0
- package/dist/core/skills.js +408 -0
- package/dist/core/slash-commands.d.ts +13 -0
- package/dist/core/slash-commands.js +17 -0
- package/dist/core/source-info.d.ts +17 -0
- package/dist/core/source-info.js +18 -0
- package/dist/core/system-prompt.d.ts +27 -0
- package/dist/core/system-prompt.js +179 -0
- package/dist/core/timings.d.ts +7 -0
- package/dist/core/timings.js +30 -0
- package/dist/core/tools/bash.d.ts +95 -0
- package/dist/core/tools/bash.js +513 -0
- package/dist/core/tools/builtin-commands.d.ts +75 -0
- package/dist/core/tools/builtin-commands.js +503 -0
- package/dist/core/tools/compat-commands.d.ts +12 -0
- package/dist/core/tools/compat-commands.js +1280 -0
- package/dist/core/tools/edit-diff.d.ts +59 -0
- package/dist/core/tools/edit-diff.js +263 -0
- package/dist/core/tools/edit.d.ts +49 -0
- package/dist/core/tools/edit.js +340 -0
- package/dist/core/tools/file-mutation-queue.d.ts +5 -0
- package/dist/core/tools/file-mutation-queue.js +36 -0
- package/dist/core/tools/find.d.ts +34 -0
- package/dist/core/tools/find.js +459 -0
- package/dist/core/tools/grep.d.ts +36 -0
- package/dist/core/tools/grep.js +422 -0
- package/dist/core/tools/index.d.ts +70 -0
- package/dist/core/tools/index.js +129 -0
- package/dist/core/tools/line-anchors.d.ts +33 -0
- package/dist/core/tools/line-anchors.js +151 -0
- package/dist/core/tools/ls.d.ts +36 -0
- package/dist/core/tools/ls.js +268 -0
- package/dist/core/tools/path-utils.d.ts +7 -0
- package/dist/core/tools/path-utils.js +80 -0
- package/dist/core/tools/read.d.ts +35 -0
- package/dist/core/tools/read.js +244 -0
- package/dist/core/tools/render-utils.d.ts +20 -0
- package/dist/core/tools/render-utils.js +48 -0
- package/dist/core/tools/session-split.d.ts +9 -0
- package/dist/core/tools/session-split.js +77 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +13 -0
- package/dist/core/tools/tool-definition-wrapper.js +32 -0
- package/dist/core/tools/truncate.d.ts +69 -0
- package/dist/core/tools/truncate.js +204 -0
- package/dist/core/tools/write.d.ts +25 -0
- package/dist/core/tools/write.js +211 -0
- package/dist/core/types/session-types.d.ts +123 -0
- package/dist/core/types/session-types.js +8 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +38 -0
- package/dist/main.d.ts +11 -2
- package/dist/main.js +577 -149
- package/dist/modes/event-mapper.d.ts +115 -0
- package/dist/modes/event-mapper.js +200 -0
- package/dist/modes/gui/server.d.ts +14 -0
- package/dist/modes/gui/server.js +1032 -0
- package/dist/modes/index.d.ts +10 -0
- package/dist/modes/index.js +9 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +33 -0
- package/dist/modes/interactive/components/armin.js +328 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +19 -0
- package/dist/modes/interactive/components/assistant-message.js +115 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +33 -0
- package/dist/modes/interactive/components/bash-execution.js +169 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +15 -0
- package/dist/modes/interactive/components/bordered-loader.js +50 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +15 -0
- package/dist/modes/interactive/components/branch-summary-message.js +41 -0
- package/dist/modes/interactive/components/brand-header.d.ts +33 -0
- package/dist/modes/interactive/components/brand-header.js +235 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +15 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +42 -0
- package/dist/modes/interactive/components/config-selector.d.ts +70 -0
- package/dist/modes/interactive/components/config-selector.js +469 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +13 -0
- package/dist/modes/interactive/components/countdown-timer.js +27 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +27 -0
- package/dist/modes/interactive/components/custom-editor.js +94 -0
- package/dist/modes/interactive/components/custom-message.d.ts +19 -0
- package/dist/modes/interactive/components/custom-message.js +73 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +22 -0
- package/dist/modes/interactive/components/daxnuts.js +137 -0
- package/dist/modes/interactive/components/diff.d.ts +11 -0
- package/dist/modes/interactive/components/diff.js +132 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +14 -0
- package/dist/modes/interactive/components/dynamic-border.js +19 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +4 -0
- package/dist/modes/interactive/components/earendil-announcement.js +39 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +19 -0
- package/dist/modes/interactive/components/extension-editor.js +105 -0
- package/dist/modes/interactive/components/extension-input.d.ts +22 -0
- package/dist/modes/interactive/components/extension-input.js +54 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +23 -0
- package/dist/modes/interactive/components/extension-selector.js +70 -0
- package/dist/modes/interactive/components/footer.d.ts +55 -0
- package/dist/modes/interactive/components/footer.js +207 -0
- package/dist/modes/interactive/components/index.d.ts +31 -0
- package/dist/modes/interactive/components/index.js +32 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +7 -0
- package/dist/modes/interactive/components/keybinding-hints.js +21 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +41 -0
- package/dist/modes/interactive/components/login-dialog.js +138 -0
- package/dist/modes/interactive/components/model-selector.d.ts +32 -0
- package/dist/modes/interactive/components/model-selector.js +209 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +18 -0
- package/dist/modes/interactive/components/oauth-selector.js +91 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +57 -0
- package/dist/modes/interactive/components/settings-selector.js +299 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +9 -0
- package/dist/modes/interactive/components/show-images-selector.js +37 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +16 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +44 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +10 -0
- package/dist/modes/interactive/components/theme-selector.js +47 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +10 -0
- package/dist/modes/interactive/components/thinking-selector.js +50 -0
- package/dist/modes/interactive/components/timeline-view.d.ts +31 -0
- package/dist/modes/interactive/components/timeline-view.js +81 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +64 -0
- package/dist/modes/interactive/components/tool-execution.js +305 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +88 -0
- package/dist/modes/interactive/components/tree-selector.js +1072 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +29 -0
- package/dist/modes/interactive/components/user-message-selector.js +110 -0
- package/dist/modes/interactive/components/user-message.d.ts +9 -0
- package/dist/modes/interactive/components/user-message.js +27 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +23 -0
- package/dist/modes/interactive/components/visual-truncate.js +32 -0
- package/dist/modes/interactive/interactive-mode.d.ts +394 -0
- package/dist/modes/interactive/interactive-mode.js +4116 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +84 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +80 -0
- package/dist/modes/interactive/theme/theme.js +973 -0
- package/dist/modes/print-mode.d.ts +27 -0
- package/dist/modes/print-mode.js +102 -0
- package/dist/modes/rpc/jsonl.d.ts +16 -0
- package/dist/modes/rpc/jsonl.js +48 -0
- package/dist/modes/rpc/rpc-client.d.ts +219 -0
- package/dist/modes/rpc/rpc-client.js +405 -0
- package/dist/modes/rpc/rpc-mode.d.ts +19 -0
- package/dist/modes/rpc/rpc-mode.js +381 -0
- package/dist/modes/rpc/rpc-types.d.ts +406 -0
- package/dist/modes/rpc/rpc-types.js +7 -0
- package/dist/package-manager-cli.d.ts +3 -0
- package/dist/package-manager-cli.js +233 -0
- package/dist/utils/changelog.d.ts +20 -0
- package/dist/utils/changelog.js +86 -0
- package/dist/utils/child-process.d.ts +10 -0
- package/dist/utils/child-process.js +77 -0
- package/dist/utils/clipboard-image.d.ts +10 -0
- package/dist/utils/clipboard-image.js +244 -0
- package/dist/utils/clipboard-native.d.ts +7 -0
- package/dist/utils/clipboard-native.js +13 -0
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +77 -0
- package/dist/utils/exif-orientation.d.ts +4 -0
- package/dist/utils/exif-orientation.js +157 -0
- package/dist/utils/frontmatter.d.ts +7 -0
- package/dist/utils/frontmatter.js +25 -0
- package/dist/utils/git.d.ts +25 -0
- package/dist/utils/git.js +162 -0
- package/dist/utils/image-convert.d.ts +8 -0
- package/dist/utils/image-convert.js +38 -0
- package/dist/utils/image-resize.d.ts +35 -0
- package/dist/utils/image-resize.js +136 -0
- package/dist/utils/mime.d.ts +1 -0
- package/dist/utils/mime.js +25 -0
- package/dist/utils/path-shims.d.ts +1 -0
- package/dist/utils/path-shims.js +90 -0
- package/dist/utils/paths.d.ts +6 -0
- package/dist/utils/paths.js +18 -0
- package/dist/utils/photon.d.ts +20 -0
- package/dist/utils/photon.js +120 -0
- package/dist/utils/shell.d.ts +29 -0
- package/dist/utils/shell.js +189 -0
- package/dist/utils/sleep.d.ts +4 -0
- package/dist/utils/sleep.js +16 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.js +101 -0
- package/dist/vendor/bin/darwin-arm64/fd +0 -0
- package/dist/vendor/bin/darwin-arm64/rg +0 -0
- package/dist/vendor/bin/darwin-x64/fd +0 -0
- package/dist/vendor/bin/darwin-x64/rg +0 -0
- package/dist/vendor/bin/linux-arm64/fd +0 -0
- package/dist/vendor/bin/linux-arm64/rg +0 -0
- package/dist/vendor/bin/linux-x64/fd +0 -0
- package/dist/vendor/bin/linux-x64/rg +0 -0
- package/dist/vendor/bin/win32-arm64/fd.exe +0 -0
- package/dist/vendor/bin/win32-arm64/rg.exe +0 -0
- package/dist/vendor/bin/win32-x64/fd.exe +0 -0
- package/dist/vendor/bin/win32-x64/rg.exe +0 -0
- package/package.json +90 -26
- package/dist/extension/core.d.ts +0 -69
- package/dist/extension/core.js +0 -270
- package/dist/extension/core.js.map +0 -1
- package/dist/extension/index.d.ts +0 -25
- package/dist/extension/index.js +0 -303
- package/dist/extension/index.js.map +0 -1
- package/dist/main.js.map +0 -1
- package/themes/pizza.json +0 -87
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Component, Container } from "@earendil-works/pi-tui";
|
|
2
|
+
interface UserMessageItem {
|
|
3
|
+
id: string;
|
|
4
|
+
text: string;
|
|
5
|
+
timestamp?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Custom user message list component with selection
|
|
9
|
+
*/
|
|
10
|
+
declare class UserMessageList implements Component {
|
|
11
|
+
private messages;
|
|
12
|
+
private selectedIndex;
|
|
13
|
+
onSelect?: (entryId: string) => void;
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
private maxVisible;
|
|
16
|
+
constructor(messages: UserMessageItem[], initialSelectedId?: string);
|
|
17
|
+
invalidate(): void;
|
|
18
|
+
render(width: number): string[];
|
|
19
|
+
handleInput(keyData: string): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Component that renders a user message selector for branching
|
|
23
|
+
*/
|
|
24
|
+
export declare class UserMessageSelectorComponent extends Container {
|
|
25
|
+
private messageList;
|
|
26
|
+
constructor(messages: UserMessageItem[], onSelect: (entryId: string) => void, onCancel: () => void, initialSelectedId?: string);
|
|
27
|
+
getMessageList(): UserMessageList;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Container, getKeybindings, Spacer, Text, truncateToWidth } from "@earendil-works/pi-tui";
|
|
2
|
+
import { theme } from "../theme/theme.js";
|
|
3
|
+
import { DynamicBorder } from "./dynamic-border.js";
|
|
4
|
+
/**
|
|
5
|
+
* Custom user message list component with selection
|
|
6
|
+
*/
|
|
7
|
+
class UserMessageList {
|
|
8
|
+
constructor(messages, initialSelectedId) {
|
|
9
|
+
this.messages = [];
|
|
10
|
+
this.selectedIndex = 0;
|
|
11
|
+
this.maxVisible = 10; // Max messages visible
|
|
12
|
+
// Store messages in chronological order (oldest to newest)
|
|
13
|
+
this.messages = messages;
|
|
14
|
+
const initialIndex = initialSelectedId ? messages.findIndex((message) => message.id === initialSelectedId) : -1;
|
|
15
|
+
// Start with selected message if provided, else default to the most recent
|
|
16
|
+
this.selectedIndex = initialIndex >= 0 ? initialIndex : Math.max(0, messages.length - 1);
|
|
17
|
+
}
|
|
18
|
+
invalidate() {
|
|
19
|
+
// No cached state to invalidate currently
|
|
20
|
+
}
|
|
21
|
+
render(width) {
|
|
22
|
+
const lines = [];
|
|
23
|
+
if (this.messages.length === 0) {
|
|
24
|
+
lines.push(theme.fg("muted", " No user messages found"));
|
|
25
|
+
return lines;
|
|
26
|
+
}
|
|
27
|
+
// Calculate visible range with scrolling
|
|
28
|
+
const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(this.maxVisible / 2), this.messages.length - this.maxVisible));
|
|
29
|
+
const endIndex = Math.min(startIndex + this.maxVisible, this.messages.length);
|
|
30
|
+
// Render visible messages (2 lines per message + blank line)
|
|
31
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
32
|
+
const message = this.messages[i];
|
|
33
|
+
const isSelected = i === this.selectedIndex;
|
|
34
|
+
// Normalize message to single line
|
|
35
|
+
const normalizedMessage = message.text.replace(/\n/g, " ").trim();
|
|
36
|
+
// First line: cursor + message
|
|
37
|
+
const cursor = isSelected ? theme.fg("accent", "› ") : " ";
|
|
38
|
+
const maxMsgWidth = width - 2; // Account for cursor (2 chars)
|
|
39
|
+
const truncatedMsg = truncateToWidth(normalizedMessage, maxMsgWidth);
|
|
40
|
+
const messageLine = cursor + (isSelected ? theme.bold(truncatedMsg) : truncatedMsg);
|
|
41
|
+
lines.push(messageLine);
|
|
42
|
+
// Second line: metadata (position in history)
|
|
43
|
+
const position = i + 1;
|
|
44
|
+
const metadata = ` Message ${position} of ${this.messages.length}`;
|
|
45
|
+
const metadataLine = theme.fg("muted", metadata);
|
|
46
|
+
lines.push(metadataLine);
|
|
47
|
+
lines.push(""); // Blank line between messages
|
|
48
|
+
}
|
|
49
|
+
// Add scroll indicator if needed
|
|
50
|
+
if (startIndex > 0 || endIndex < this.messages.length) {
|
|
51
|
+
const scrollInfo = theme.fg("muted", ` (${this.selectedIndex + 1}/${this.messages.length})`);
|
|
52
|
+
lines.push(scrollInfo);
|
|
53
|
+
}
|
|
54
|
+
return lines;
|
|
55
|
+
}
|
|
56
|
+
handleInput(keyData) {
|
|
57
|
+
const kb = getKeybindings();
|
|
58
|
+
// Up arrow - go to previous (older) message, wrap to bottom when at top
|
|
59
|
+
if (kb.matches(keyData, "tui.select.up")) {
|
|
60
|
+
this.selectedIndex = this.selectedIndex === 0 ? this.messages.length - 1 : this.selectedIndex - 1;
|
|
61
|
+
}
|
|
62
|
+
// Down arrow - go to next (newer) message, wrap to top when at bottom
|
|
63
|
+
else if (kb.matches(keyData, "tui.select.down")) {
|
|
64
|
+
this.selectedIndex = this.selectedIndex === this.messages.length - 1 ? 0 : this.selectedIndex + 1;
|
|
65
|
+
}
|
|
66
|
+
// Enter - select message and branch
|
|
67
|
+
else if (kb.matches(keyData, "tui.select.confirm")) {
|
|
68
|
+
const selected = this.messages[this.selectedIndex];
|
|
69
|
+
if (selected && this.onSelect) {
|
|
70
|
+
this.onSelect(selected.id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Escape - cancel
|
|
74
|
+
else if (kb.matches(keyData, "tui.select.cancel")) {
|
|
75
|
+
if (this.onCancel) {
|
|
76
|
+
this.onCancel();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Component that renders a user message selector for branching
|
|
83
|
+
*/
|
|
84
|
+
export class UserMessageSelectorComponent extends Container {
|
|
85
|
+
constructor(messages, onSelect, onCancel, initialSelectedId) {
|
|
86
|
+
super();
|
|
87
|
+
// Add header
|
|
88
|
+
this.addChild(new Spacer(1));
|
|
89
|
+
this.addChild(new Text(theme.bold("Fork from Message"), 1, 0));
|
|
90
|
+
this.addChild(new Text(theme.fg("muted", "Select a user message to copy the active path up to that point into a new session"), 1, 0));
|
|
91
|
+
this.addChild(new Spacer(1));
|
|
92
|
+
this.addChild(new DynamicBorder());
|
|
93
|
+
this.addChild(new Spacer(1));
|
|
94
|
+
// Create message list
|
|
95
|
+
this.messageList = new UserMessageList(messages, initialSelectedId);
|
|
96
|
+
this.messageList.onSelect = onSelect;
|
|
97
|
+
this.messageList.onCancel = onCancel;
|
|
98
|
+
this.addChild(this.messageList);
|
|
99
|
+
// Add bottom border
|
|
100
|
+
this.addChild(new Spacer(1));
|
|
101
|
+
this.addChild(new DynamicBorder());
|
|
102
|
+
// Auto-cancel if no messages
|
|
103
|
+
if (messages.length === 0) {
|
|
104
|
+
setTimeout(() => onCancel(), 100);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
getMessageList() {
|
|
108
|
+
return this.messageList;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Container, type MarkdownTheme } from "@earendil-works/pi-tui";
|
|
2
|
+
/**
|
|
3
|
+
* Component that renders a user message
|
|
4
|
+
*/
|
|
5
|
+
export declare class UserMessageComponent extends Container {
|
|
6
|
+
private contentBox;
|
|
7
|
+
constructor(text: string, markdownTheme?: MarkdownTheme);
|
|
8
|
+
render(width: number): string[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Box, Container, Markdown } from "@earendil-works/pi-tui";
|
|
2
|
+
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
3
|
+
const OSC133_ZONE_START = "\x1b]133;A\x07";
|
|
4
|
+
const OSC133_ZONE_END = "\x1b]133;B\x07";
|
|
5
|
+
const OSC133_ZONE_FINAL = "\x1b]133;C\x07";
|
|
6
|
+
/**
|
|
7
|
+
* Component that renders a user message
|
|
8
|
+
*/
|
|
9
|
+
export class UserMessageComponent extends Container {
|
|
10
|
+
constructor(text, markdownTheme = getMarkdownTheme()) {
|
|
11
|
+
super();
|
|
12
|
+
this.contentBox = new Box(1, 1, (content) => theme.bg("userMessageBg", content));
|
|
13
|
+
this.contentBox.addChild(new Markdown(text, 0, 0, markdownTheme, {
|
|
14
|
+
color: (content) => theme.fg("userMessageText", content),
|
|
15
|
+
}));
|
|
16
|
+
this.addChild(this.contentBox);
|
|
17
|
+
}
|
|
18
|
+
render(width) {
|
|
19
|
+
const lines = super.render(width);
|
|
20
|
+
if (lines.length === 0) {
|
|
21
|
+
return lines;
|
|
22
|
+
}
|
|
23
|
+
lines[0] = OSC133_ZONE_START + lines[0];
|
|
24
|
+
lines[lines.length - 1] = OSC133_ZONE_END + OSC133_ZONE_FINAL + lines[lines.length - 1];
|
|
25
|
+
return lines;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for truncating text to visual lines (accounting for line wrapping).
|
|
3
|
+
* Used by both tool-execution.ts and bash-execution.ts for consistent behavior.
|
|
4
|
+
*/
|
|
5
|
+
export interface VisualTruncateResult {
|
|
6
|
+
/** The visual lines to display */
|
|
7
|
+
visualLines: string[];
|
|
8
|
+
/** Number of visual lines that were skipped (hidden) */
|
|
9
|
+
skippedCount: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Truncate text to a maximum number of visual lines (from the end).
|
|
13
|
+
* This accounts for line wrapping based on terminal width.
|
|
14
|
+
*
|
|
15
|
+
* @param text - The text content (may contain newlines)
|
|
16
|
+
* @param maxVisualLines - Maximum number of visual lines to show
|
|
17
|
+
* @param width - Terminal/render width
|
|
18
|
+
* @param paddingX - Horizontal padding for Text component (default 0).
|
|
19
|
+
* Use 0 when result will be placed in a Box (Box adds its own padding).
|
|
20
|
+
* Use 1 when result will be placed in a plain Container.
|
|
21
|
+
* @returns The truncated visual lines and count of skipped lines
|
|
22
|
+
*/
|
|
23
|
+
export declare function truncateToVisualLines(text: string, maxVisualLines: number, width: number, paddingX?: number): VisualTruncateResult;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for truncating text to visual lines (accounting for line wrapping).
|
|
3
|
+
* Used by both tool-execution.ts and bash-execution.ts for consistent behavior.
|
|
4
|
+
*/
|
|
5
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
6
|
+
/**
|
|
7
|
+
* Truncate text to a maximum number of visual lines (from the end).
|
|
8
|
+
* This accounts for line wrapping based on terminal width.
|
|
9
|
+
*
|
|
10
|
+
* @param text - The text content (may contain newlines)
|
|
11
|
+
* @param maxVisualLines - Maximum number of visual lines to show
|
|
12
|
+
* @param width - Terminal/render width
|
|
13
|
+
* @param paddingX - Horizontal padding for Text component (default 0).
|
|
14
|
+
* Use 0 when result will be placed in a Box (Box adds its own padding).
|
|
15
|
+
* Use 1 when result will be placed in a plain Container.
|
|
16
|
+
* @returns The truncated visual lines and count of skipped lines
|
|
17
|
+
*/
|
|
18
|
+
export function truncateToVisualLines(text, maxVisualLines, width, paddingX = 0) {
|
|
19
|
+
if (!text) {
|
|
20
|
+
return { visualLines: [], skippedCount: 0 };
|
|
21
|
+
}
|
|
22
|
+
// Create a temporary Text component to render and get visual lines
|
|
23
|
+
const tempText = new Text(text, paddingX, 0);
|
|
24
|
+
const allVisualLines = tempText.render(width);
|
|
25
|
+
if (allVisualLines.length <= maxVisualLines) {
|
|
26
|
+
return { visualLines: allVisualLines, skippedCount: 0 };
|
|
27
|
+
}
|
|
28
|
+
// Take the last N visual lines
|
|
29
|
+
const truncatedLines = allVisualLines.slice(-maxVisualLines);
|
|
30
|
+
const skippedCount = allVisualLines.length - maxVisualLines;
|
|
31
|
+
return { visualLines: truncatedLines, skippedCount };
|
|
32
|
+
}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive mode for the coding agent.
|
|
3
|
+
* Handles TUI rendering and user interaction, delegating business logic to SessionFacade.
|
|
4
|
+
*/
|
|
5
|
+
import type { ImageContent } from "@earendil-works/pi-ai/compat";
|
|
6
|
+
import type { CreateSessionFacadeResult } from "../../core/session-facade-factory.js";
|
|
7
|
+
/**
|
|
8
|
+
* Options for InteractiveMode initialization.
|
|
9
|
+
*/
|
|
10
|
+
export interface InteractiveModeOptions {
|
|
11
|
+
/** Warning message if session model couldn't be restored */
|
|
12
|
+
modelFallbackMessage?: string;
|
|
13
|
+
/** Initial message to send on startup (can include @file content) */
|
|
14
|
+
initialMessage?: string;
|
|
15
|
+
/** Images to attach to the initial message */
|
|
16
|
+
initialImages?: ImageContent[];
|
|
17
|
+
/** Additional messages to send after the initial message */
|
|
18
|
+
initialMessages?: string[];
|
|
19
|
+
/** Force verbose startup (overrides quietStartup setting) */
|
|
20
|
+
verbose?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare class InteractiveMode {
|
|
23
|
+
private facade;
|
|
24
|
+
private facadeResult?;
|
|
25
|
+
private options;
|
|
26
|
+
private _isStreaming;
|
|
27
|
+
private _isCompacting;
|
|
28
|
+
private _retryAttempt;
|
|
29
|
+
private _streamingText;
|
|
30
|
+
private ui;
|
|
31
|
+
private chatContainer;
|
|
32
|
+
private pendingMessagesContainer;
|
|
33
|
+
private statusContainer;
|
|
34
|
+
private defaultEditor;
|
|
35
|
+
private editor;
|
|
36
|
+
private autocompleteProvider;
|
|
37
|
+
private fdPath;
|
|
38
|
+
private editorContainer;
|
|
39
|
+
private footer;
|
|
40
|
+
private footerDataProvider;
|
|
41
|
+
private keybindings;
|
|
42
|
+
private version;
|
|
43
|
+
private isInitialized;
|
|
44
|
+
private onInputCallback?;
|
|
45
|
+
private loadingAnimation;
|
|
46
|
+
private pendingWorkingMessage;
|
|
47
|
+
private workingIndicatorOptions;
|
|
48
|
+
private readonly defaultWorkingMessage;
|
|
49
|
+
private readonly defaultHiddenThinkingLabel;
|
|
50
|
+
private hiddenThinkingLabel;
|
|
51
|
+
private lastSigintTime;
|
|
52
|
+
private lastEscapeTime;
|
|
53
|
+
private anthropicSubscriptionWarningShown;
|
|
54
|
+
private lastStatusSpacer;
|
|
55
|
+
private lastStatusText;
|
|
56
|
+
private streamingComponent;
|
|
57
|
+
private streamingMessage;
|
|
58
|
+
private pendingTools;
|
|
59
|
+
private isFirstUserMessage;
|
|
60
|
+
private toolOutputExpanded;
|
|
61
|
+
private hideThinkingBlock;
|
|
62
|
+
private skillCommands;
|
|
63
|
+
private unsubscribe?;
|
|
64
|
+
private signalCleanupHandlers;
|
|
65
|
+
private isBashMode;
|
|
66
|
+
private bashComponent;
|
|
67
|
+
private pendingBashComponents;
|
|
68
|
+
private autoCompactionLoader;
|
|
69
|
+
private autoCompactionEscapeHandler?;
|
|
70
|
+
private retryLoader;
|
|
71
|
+
private retryCountdown;
|
|
72
|
+
private retryEscapeHandler?;
|
|
73
|
+
private compactionQueuedMessages;
|
|
74
|
+
private shutdownRequested;
|
|
75
|
+
private extensionSelector;
|
|
76
|
+
private extensionInput;
|
|
77
|
+
private extensionEditor;
|
|
78
|
+
private extensionTerminalInputUnsubscribers;
|
|
79
|
+
private extensionWidgetsAbove;
|
|
80
|
+
private extensionWidgetsBelow;
|
|
81
|
+
private widgetContainerAbove;
|
|
82
|
+
private widgetContainerBelow;
|
|
83
|
+
private customFooter;
|
|
84
|
+
private headerContainer;
|
|
85
|
+
private builtInHeader;
|
|
86
|
+
private customHeader;
|
|
87
|
+
private taskHistoryProjection;
|
|
88
|
+
private taskHistoryUnsubscribe;
|
|
89
|
+
private get modelRegistryValue();
|
|
90
|
+
private get extensionRunnerValue();
|
|
91
|
+
private get resourceLoaderValue();
|
|
92
|
+
private get currentModel();
|
|
93
|
+
private getCurrentModelFromFacade;
|
|
94
|
+
private get currentThinkingLevel();
|
|
95
|
+
private get isStreaming();
|
|
96
|
+
private get isCompacting();
|
|
97
|
+
private get autoCompactionEnabled();
|
|
98
|
+
private get promptTemplatesValue();
|
|
99
|
+
private get pendingMessageCountValue();
|
|
100
|
+
private get messagesValue();
|
|
101
|
+
private get retryAttemptValue();
|
|
102
|
+
private get systemPromptValue();
|
|
103
|
+
private get isBashRunningValue();
|
|
104
|
+
private compactFacade;
|
|
105
|
+
private getContextUsageFacade;
|
|
106
|
+
private abortCompactionFacade;
|
|
107
|
+
private abortRetryFacade;
|
|
108
|
+
private abortBashFacade;
|
|
109
|
+
private abortBranchSummaryFacade;
|
|
110
|
+
private setModelFacade;
|
|
111
|
+
private setThinkingLevelFacade;
|
|
112
|
+
private setAutoCompactionEnabledFacade;
|
|
113
|
+
private cycleModelFacade;
|
|
114
|
+
private cycleThinkingLevelFacade;
|
|
115
|
+
private getAvailableThinkingLevelsFacade;
|
|
116
|
+
private navigateTreeFacade;
|
|
117
|
+
private getSteeringMessagesFacade;
|
|
118
|
+
private getFollowUpMessagesFacade;
|
|
119
|
+
private clearQueueFacade;
|
|
120
|
+
private getUserMessagesForForkingFacade;
|
|
121
|
+
private getLastAssistantTextFacade;
|
|
122
|
+
private exportToHtmlFacade;
|
|
123
|
+
private reloadFacade;
|
|
124
|
+
private executeBashFacade;
|
|
125
|
+
private recordBashResultFacade;
|
|
126
|
+
private waitForIdleFacade;
|
|
127
|
+
private get projectionSessionManager();
|
|
128
|
+
/** Session directory (workspace dir in agent storage) */
|
|
129
|
+
private get sessionDir();
|
|
130
|
+
/** Current session reference string for session selector */
|
|
131
|
+
private get sessionFile();
|
|
132
|
+
private get facadeCwd();
|
|
133
|
+
private get settingsManager();
|
|
134
|
+
private getExtensionSessionManager;
|
|
135
|
+
/**
|
|
136
|
+
* Create InteractiveMode with SessionFacade (event-sourced architecture).
|
|
137
|
+
*/
|
|
138
|
+
static fromFacade(facadeResult: CreateSessionFacadeResult, options?: InteractiveModeOptions): InteractiveMode;
|
|
139
|
+
/** Shared UI initialization */
|
|
140
|
+
private initUI;
|
|
141
|
+
private createFacadeFooterInfo;
|
|
142
|
+
private getAutocompleteSourceTag;
|
|
143
|
+
private prefixAutocompleteDescription;
|
|
144
|
+
private getBuiltInCommandConflictDiagnostics;
|
|
145
|
+
private setupAutocomplete;
|
|
146
|
+
private showStartupNoticesIfNeeded;
|
|
147
|
+
private initializeTaskHistoryHeader;
|
|
148
|
+
private updateTaskHistoryHeader;
|
|
149
|
+
init(): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Update terminal title with session name and cwd.
|
|
152
|
+
*/
|
|
153
|
+
private updateTerminalTitle;
|
|
154
|
+
/**
|
|
155
|
+
* Run the interactive mode. This is the main entry point.
|
|
156
|
+
* Initializes the UI, shows warnings, processes initial messages, and starts the interactive loop.
|
|
157
|
+
*/
|
|
158
|
+
run(): Promise<void>;
|
|
159
|
+
private checkTmuxKeyboardSetup;
|
|
160
|
+
private getMarkdownThemeWithSettings;
|
|
161
|
+
private formatDisplayPath;
|
|
162
|
+
private formatContextPath;
|
|
163
|
+
private getStartupExpansionState;
|
|
164
|
+
/**
|
|
165
|
+
* Get a short path relative to the package root for display.
|
|
166
|
+
*/
|
|
167
|
+
private getShortPath;
|
|
168
|
+
private getCompactPathLabel;
|
|
169
|
+
private getCompactPackageSourceLabel;
|
|
170
|
+
private getCompactExtensionLabel;
|
|
171
|
+
private getCompactDisplayPathSegments;
|
|
172
|
+
private getCompactNonPackageExtensionLabel;
|
|
173
|
+
private getCompactExtensionLabels;
|
|
174
|
+
private getDisplaySourceInfo;
|
|
175
|
+
private getScopeGroup;
|
|
176
|
+
private isPackageSource;
|
|
177
|
+
private buildScopeGroups;
|
|
178
|
+
private formatScopeGroups;
|
|
179
|
+
private findSourceInfoForPath;
|
|
180
|
+
private formatPathWithSource;
|
|
181
|
+
private formatDiagnostics;
|
|
182
|
+
private showLoadedResources;
|
|
183
|
+
/**
|
|
184
|
+
* Initialize the extension system with TUI-based UI context.
|
|
185
|
+
*/
|
|
186
|
+
private bindCurrentSessionExtensions;
|
|
187
|
+
private applyRuntimeSettings;
|
|
188
|
+
private rebindCurrentSession;
|
|
189
|
+
private handleFatalRuntimeError;
|
|
190
|
+
private renderCurrentSessionState;
|
|
191
|
+
/**
|
|
192
|
+
* Get a registered tool definition by name (for custom rendering).
|
|
193
|
+
*/
|
|
194
|
+
private getRegisteredToolDefinition;
|
|
195
|
+
/**
|
|
196
|
+
* Set up keyboard shortcuts registered by extensions.
|
|
197
|
+
*/
|
|
198
|
+
private setupExtensionShortcuts;
|
|
199
|
+
/**
|
|
200
|
+
* Set extension status text in the footer.
|
|
201
|
+
*/
|
|
202
|
+
private setExtensionStatus;
|
|
203
|
+
private setWorkingIndicator;
|
|
204
|
+
private setHiddenThinkingLabel;
|
|
205
|
+
/**
|
|
206
|
+
* Set an extension widget (string array or custom component).
|
|
207
|
+
*/
|
|
208
|
+
private setExtensionWidget;
|
|
209
|
+
private clearExtensionWidgets;
|
|
210
|
+
private resetExtensionUI;
|
|
211
|
+
private static readonly MAX_WIDGET_LINES;
|
|
212
|
+
/**
|
|
213
|
+
* Render all extension widgets to the widget container.
|
|
214
|
+
*/
|
|
215
|
+
private renderWidgets;
|
|
216
|
+
private renderWidgetContainer;
|
|
217
|
+
/**
|
|
218
|
+
* Set a custom footer component, or restore the built-in footer.
|
|
219
|
+
*/
|
|
220
|
+
private setExtensionFooter;
|
|
221
|
+
/**
|
|
222
|
+
* Set a custom header component, or restore the built-in header.
|
|
223
|
+
*/
|
|
224
|
+
private setExtensionHeader;
|
|
225
|
+
private addExtensionTerminalInputListener;
|
|
226
|
+
private clearExtensionTerminalInputListeners;
|
|
227
|
+
/**
|
|
228
|
+
* Create the ExtensionUIContext for extensions.
|
|
229
|
+
*/
|
|
230
|
+
private createExtensionUIContext;
|
|
231
|
+
/**
|
|
232
|
+
* Show a selector for extensions.
|
|
233
|
+
*/
|
|
234
|
+
private showExtensionSelector;
|
|
235
|
+
/**
|
|
236
|
+
* Hide the extension selector.
|
|
237
|
+
*/
|
|
238
|
+
private hideExtensionSelector;
|
|
239
|
+
/**
|
|
240
|
+
* Show a confirmation dialog for extensions.
|
|
241
|
+
*/
|
|
242
|
+
private showExtensionConfirm;
|
|
243
|
+
private promptForMissingSessionCwd;
|
|
244
|
+
/**
|
|
245
|
+
* Show a text input for extensions.
|
|
246
|
+
*/
|
|
247
|
+
private showExtensionInput;
|
|
248
|
+
/**
|
|
249
|
+
* Hide the extension input.
|
|
250
|
+
*/
|
|
251
|
+
private hideExtensionInput;
|
|
252
|
+
/**
|
|
253
|
+
* Show a multi-line editor for extensions (with Ctrl+G support).
|
|
254
|
+
*/
|
|
255
|
+
private showExtensionEditor;
|
|
256
|
+
/**
|
|
257
|
+
* Hide the extension editor.
|
|
258
|
+
*/
|
|
259
|
+
private hideExtensionEditor;
|
|
260
|
+
/**
|
|
261
|
+
* Set a custom editor component from an extension.
|
|
262
|
+
* Pass undefined to restore the default editor.
|
|
263
|
+
*/
|
|
264
|
+
private setCustomEditorComponent;
|
|
265
|
+
/**
|
|
266
|
+
* Show a notification for extensions.
|
|
267
|
+
*/
|
|
268
|
+
private showExtensionNotify;
|
|
269
|
+
/** Show a custom component with keyboard focus. Overlay mode renders on top of existing content. */
|
|
270
|
+
private showExtensionCustom;
|
|
271
|
+
/**
|
|
272
|
+
* Show an extension error in the UI.
|
|
273
|
+
*/
|
|
274
|
+
private showExtensionError;
|
|
275
|
+
private setupKeyHandlers;
|
|
276
|
+
private handleClipboardImagePaste;
|
|
277
|
+
private setupEditorSubmitHandler;
|
|
278
|
+
/**
|
|
279
|
+
* Prompt via facade or session, depending on mode.
|
|
280
|
+
*/
|
|
281
|
+
private promptFacadeOrSession;
|
|
282
|
+
private subscribeToAgent;
|
|
283
|
+
/**
|
|
284
|
+
* Subscribe to SessionFacade events (TypedEvent → ModeEvent).
|
|
285
|
+
*/
|
|
286
|
+
private subscribeToFacade;
|
|
287
|
+
/**
|
|
288
|
+
* Handle ModeEvent (converted from TypedEvent via ModeEventMapper).
|
|
289
|
+
*/
|
|
290
|
+
private handleModeEvent;
|
|
291
|
+
/** Extract text content from a user message */
|
|
292
|
+
private getUserMessageText;
|
|
293
|
+
/**
|
|
294
|
+
* Show a status message in the chat.
|
|
295
|
+
*
|
|
296
|
+
* If multiple status messages are emitted back-to-back (without anything else being added to the chat),
|
|
297
|
+
* we update the previous status line instead of appending new ones to avoid log spam.
|
|
298
|
+
*/
|
|
299
|
+
private showStatus;
|
|
300
|
+
private addMessageToChat;
|
|
301
|
+
/**
|
|
302
|
+
* Render session context to chat. Used for initial load and rebuild after compaction.
|
|
303
|
+
* @param sessionContext Session context to render
|
|
304
|
+
* @param options.updateFooter Update footer state
|
|
305
|
+
* @param options.populateHistory Add user messages to editor history
|
|
306
|
+
*/
|
|
307
|
+
private renderSessionContext;
|
|
308
|
+
renderInitialMessages(): void;
|
|
309
|
+
getUserInput(): Promise<string>;
|
|
310
|
+
private rebuildChatFromMessages;
|
|
311
|
+
private handleCtrlC;
|
|
312
|
+
private handleCtrlD;
|
|
313
|
+
/**
|
|
314
|
+
* Gracefully shutdown the agent.
|
|
315
|
+
* Emits shutdown event to extensions, then exits.
|
|
316
|
+
*/
|
|
317
|
+
private isShuttingDown;
|
|
318
|
+
private shutdown;
|
|
319
|
+
/**
|
|
320
|
+
* Check if shutdown was requested and perform shutdown if so.
|
|
321
|
+
*/
|
|
322
|
+
private checkShutdownRequested;
|
|
323
|
+
private registerSignalHandlers;
|
|
324
|
+
private unregisterSignalHandlers;
|
|
325
|
+
private handleCtrlZ;
|
|
326
|
+
private handleFollowUp;
|
|
327
|
+
private handleDequeue;
|
|
328
|
+
private updateEditorBorderColor;
|
|
329
|
+
private cycleThinkingLevel;
|
|
330
|
+
private cycleModel;
|
|
331
|
+
private toggleToolOutputExpansion;
|
|
332
|
+
private setToolsExpanded;
|
|
333
|
+
private toggleThinkingBlockVisibility;
|
|
334
|
+
private openExternalEditor;
|
|
335
|
+
clearEditor(): void;
|
|
336
|
+
showError(errorMessage: string): void;
|
|
337
|
+
showWarning(warningMessage: string): void;
|
|
338
|
+
private getAllQueuedMessages;
|
|
339
|
+
/**
|
|
340
|
+
* Clear all queued messages and return their contents.
|
|
341
|
+
* Clears both session queue and compaction queue.
|
|
342
|
+
*/
|
|
343
|
+
private clearAllQueues;
|
|
344
|
+
private updatePendingMessagesDisplay;
|
|
345
|
+
private restoreQueuedMessagesToEditor;
|
|
346
|
+
private queueCompactionMessage;
|
|
347
|
+
private isExtensionCommand;
|
|
348
|
+
private flushCompactionQueue;
|
|
349
|
+
/** Move pending bash components from pending area to chat */
|
|
350
|
+
private flushPendingBashComponents;
|
|
351
|
+
/**
|
|
352
|
+
* Shows a selector component in place of the editor.
|
|
353
|
+
* @param create Factory that receives a `done` callback and returns the component and focus target
|
|
354
|
+
*/
|
|
355
|
+
private showSelector;
|
|
356
|
+
private showSettingsSelector;
|
|
357
|
+
private handleModelCommand;
|
|
358
|
+
private findExactModelMatch;
|
|
359
|
+
private getModelCandidates;
|
|
360
|
+
/** Update the footer's available provider count from current model candidates */
|
|
361
|
+
private updateAvailableProviderCount;
|
|
362
|
+
private maybeWarnAboutAnthropicSubscriptionAuth;
|
|
363
|
+
private showModelSelector;
|
|
364
|
+
private showRewindSelector;
|
|
365
|
+
private showTreeSelector;
|
|
366
|
+
private handleResumeSession;
|
|
367
|
+
private showOAuthSelector;
|
|
368
|
+
private showLoginDialog;
|
|
369
|
+
private handleReloadCommand;
|
|
370
|
+
private handleExportCommand;
|
|
371
|
+
private getPathCommandArgument;
|
|
372
|
+
private handleShareCommand;
|
|
373
|
+
private handleCopyCommand;
|
|
374
|
+
private handleStatsCommand;
|
|
375
|
+
/**
|
|
376
|
+
* Capitalize keybinding for display (e.g., "ctrl+c" -> "Ctrl+C").
|
|
377
|
+
*/
|
|
378
|
+
private capitalizeKey;
|
|
379
|
+
/**
|
|
380
|
+
* Get capitalized display string for an app keybinding action.
|
|
381
|
+
*/
|
|
382
|
+
private getAppKeyDisplay;
|
|
383
|
+
/**
|
|
384
|
+
* Get capitalized display string for an editor keybinding action.
|
|
385
|
+
*/
|
|
386
|
+
private getEditorKeyDisplay;
|
|
387
|
+
private handleHotkeysCommand;
|
|
388
|
+
private handleDebugCommand;
|
|
389
|
+
private handleDaxnuts;
|
|
390
|
+
private checkDaxnutsEasterEgg;
|
|
391
|
+
private handleBashCommand;
|
|
392
|
+
private handleCompactCommand;
|
|
393
|
+
stop(): void;
|
|
394
|
+
}
|