@caupulican/pi-adaptative 0.93.19 → 0.94.0
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 +14 -0
- package/README.md +3 -2
- package/dist/core/extensions/loader.d.ts +0 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +0 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +0 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/tools/artifact-retrieve.d.ts.map +1 -1
- package/dist/core/tools/artifact-retrieve.js +0 -1
- package/dist/core/tools/artifact-retrieve.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +0 -7
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +0 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +0 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +0 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/skill-audit.d.ts.map +1 -1
- package/dist/core/tools/skill-audit.js +0 -1
- package/dist/core/tools/skill-audit.js.map +1 -1
- package/dist/core/tools/skill.d.ts.map +1 -1
- package/dist/core/tools/skill.js +0 -1
- package/dist/core/tools/skill.js.map +1 -1
- package/dist/core/tools/skillify.d.ts.map +1 -1
- package/dist/core/tools/skillify.js +0 -1
- package/dist/core/tools/skillify.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +1 -2
- package/dist/core/tools/write.js.map +1 -1
- package/dist/modes/interactive/components/action-transcript.d.ts +24 -0
- package/dist/modes/interactive/components/action-transcript.d.ts.map +1 -0
- package/dist/modes/interactive/components/action-transcript.js +72 -0
- package/dist/modes/interactive/components/action-transcript.js.map +1 -0
- package/dist/modes/interactive/components/active-tool-call-registry.d.ts +12 -0
- package/dist/modes/interactive/components/active-tool-call-registry.d.ts.map +1 -0
- package/dist/modes/interactive/components/active-tool-call-registry.js +25 -0
- package/dist/modes/interactive/components/active-tool-call-registry.js.map +1 -0
- package/dist/modes/interactive/components/activity-lane.d.ts +1 -1
- package/dist/modes/interactive/components/activity-lane.d.ts.map +1 -1
- package/dist/modes/interactive/components/activity-lane.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +2 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +7 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +0 -2
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +0 -2
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -7
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +2 -76
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/transcript-overlay.d.ts +3 -1
- package/dist/modes/interactive/components/transcript-overlay.d.ts.map +1 -1
- package/dist/modes/interactive/components/transcript-overlay.js +8 -5
- package/dist/modes/interactive/components/transcript-overlay.js.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.d.ts +2 -3
- package/dist/modes/interactive/interactive-event-controller.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.js +9 -9
- package/dist/modes/interactive/interactive-event-controller.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +6 -6
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +50 -100
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.d.ts.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.js +3 -4
- package/dist/modes/interactive/settings-selector-flow.js.map +1 -1
- package/docs/UI_POLISH_ORCHESTRATION.md +4 -4
- package/docs/extensions.md +4 -12
- package/docs/keybindings.md +2 -2
- package/docs/settings.md +1 -1
- package/docs/task-steps.md +3 -3
- package/docs/tool-repair.md +1 -1
- package/docs/usage.md +1 -1
- 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/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 +12 -12
- package/package.json +4 -4
- package/dist/modes/interactive/components/tool-group.d.ts +0 -28
- package/dist/modes/interactive/components/tool-group.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-group.js +0 -200
- package/dist/modes/interactive/components/tool-group.js.map +0 -1
- package/dist/modes/interactive/components/tool-panel-registry.d.ts +0 -30
- package/dist/modes/interactive/components/tool-panel-registry.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-panel-registry.js +0 -145
- package/dist/modes/interactive/components/tool-panel-registry.js.map +0 -1
|
@@ -5,13 +5,13 @@ import type { AgentSession } from "../../core/agent-session.ts";
|
|
|
5
5
|
import type { AgentSessionEvent } from "../../core/agent-session-contracts.ts";
|
|
6
6
|
import type { FooterDataProvider } from "../../core/footer-data-provider.ts";
|
|
7
7
|
import type { SettingsManager } from "../../core/settings-manager.ts";
|
|
8
|
+
import type { ActiveToolCallRegistry } from "./components/active-tool-call-registry.ts";
|
|
8
9
|
import { type ActivityLaneComponent, type ActivityLaneKind } from "./components/activity-lane.ts";
|
|
9
10
|
import { AssistantMessageComponent } from "./components/assistant-message.ts";
|
|
10
11
|
import { CountdownTimer } from "./components/countdown-timer.ts";
|
|
11
12
|
import type { CustomEditor } from "./components/custom-editor.ts";
|
|
12
13
|
import type { FooterComponent } from "./components/footer.ts";
|
|
13
14
|
import type { ToolExecutionComponent } from "./components/tool-execution.ts";
|
|
14
|
-
import { type ToolPanelRegistry, type ToolPanelTenantScope } from "./components/tool-panel-registry.ts";
|
|
15
15
|
/** Structural host consumed by the event owner. InteractiveMode deliberately remains a thin facade. */
|
|
16
16
|
export interface InteractiveEventHost {
|
|
17
17
|
isInitialized: boolean;
|
|
@@ -34,7 +34,7 @@ export interface InteractiveEventHost {
|
|
|
34
34
|
streamingMessage: AssistantMessage | undefined;
|
|
35
35
|
hideThinkingBlock: boolean;
|
|
36
36
|
lastStreamingUiUpdateAt: number;
|
|
37
|
-
|
|
37
|
+
activeToolCalls: ActiveToolCallRegistry;
|
|
38
38
|
init(): Promise<void>;
|
|
39
39
|
createWorkingLoader(): Loader;
|
|
40
40
|
stopWorkingLoader(): void;
|
|
@@ -58,7 +58,6 @@ export interface InteractiveEventHost {
|
|
|
58
58
|
toolActivityKind(toolName: string): ActivityLaneKind;
|
|
59
59
|
toolActivityLabel(toolName: string): string;
|
|
60
60
|
toolActivityTerminalStatus(isError: boolean, details: unknown): "success" | "failure" | "neutral";
|
|
61
|
-
getToolPanelScope(): ToolPanelTenantScope;
|
|
62
61
|
isNativeReflectionEnabled(): boolean;
|
|
63
62
|
maybeRunNativeReflection(messages: AgentMessage[]): void;
|
|
64
63
|
maybeStartAutoLearn(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-event-controller.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-event-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACN,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAGlB,KAAK,GAAG,EACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAGrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"interactive-event-controller.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-event-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACN,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAGlB,KAAK,GAAG,EACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE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,wBAAwB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACzD,mBAAmB,IAAI,OAAO,CAAC;IAC/B,wBAAwB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAC5D,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,oBAAoB,CAAC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAaD,2EAA2E;AAC3E,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgVhH"}
|
|
@@ -4,7 +4,6 @@ import { BACKGROUND_TOOL_ACTIVITY_ID_PREFIX, backgroundToolActivityId, } from ".
|
|
|
4
4
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
5
5
|
import { CountdownTimer } from "./components/countdown-timer.js";
|
|
6
6
|
import { keyText } from "./components/keybinding-hints.js";
|
|
7
|
-
import { getToolPanelResultActionKeys, } from "./components/tool-panel-registry.js";
|
|
8
7
|
import { theme } from "./theme/theme.js";
|
|
9
8
|
function clearRetryControls(host) {
|
|
10
9
|
if (host.retryEscapeHandler) {
|
|
@@ -75,7 +74,9 @@ export async function handleInteractiveEvent(host, event) {
|
|
|
75
74
|
host.updateEditorBorderColor();
|
|
76
75
|
break;
|
|
77
76
|
case "warning":
|
|
78
|
-
|
|
77
|
+
// AgentSession warnings are operational diagnostics. Keep them in the transient status lane;
|
|
78
|
+
// direct local UI validation still uses InteractiveMode.showWarning() and remains chat-local.
|
|
79
|
+
host.activityLane?.announce(event.message, "warning");
|
|
79
80
|
break;
|
|
80
81
|
case "delegate_workers":
|
|
81
82
|
host.footerDataProvider.setExtensionStatus("delegate", undefined);
|
|
@@ -136,13 +137,13 @@ export async function handleInteractiveEvent(host, event) {
|
|
|
136
137
|
host.applyStreamingMessageUpdate(host.streamingMessage, { force: true });
|
|
137
138
|
if (host.streamingMessage.stopReason === "aborted" || host.streamingMessage.stopReason === "error") {
|
|
138
139
|
errorMessage ??= host.streamingMessage.errorMessage || "Error";
|
|
139
|
-
for (const [, component] of host.
|
|
140
|
+
for (const [, component] of host.activeToolCalls.activeEntries()) {
|
|
140
141
|
component.updateResult({ content: [{ type: "text", text: errorMessage }], isError: true });
|
|
141
142
|
}
|
|
142
143
|
host.clearActiveToolCalls();
|
|
143
144
|
}
|
|
144
145
|
else {
|
|
145
|
-
for (const [, component] of host.
|
|
146
|
+
for (const [, component] of host.activeToolCalls.activeEntries())
|
|
146
147
|
component.setArgsComplete();
|
|
147
148
|
}
|
|
148
149
|
host.streamingComponent = undefined;
|
|
@@ -159,7 +160,7 @@ export async function handleInteractiveEvent(host, event) {
|
|
|
159
160
|
label: host.toolActivityLabel(event.toolName),
|
|
160
161
|
tag: event.toolName,
|
|
161
162
|
});
|
|
162
|
-
let component = host.
|
|
163
|
+
let component = host.activeToolCalls.getActive(event.toolCallId);
|
|
163
164
|
if (!component) {
|
|
164
165
|
component = host.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);
|
|
165
166
|
}
|
|
@@ -171,7 +172,7 @@ export async function handleInteractiveEvent(host, event) {
|
|
|
171
172
|
break;
|
|
172
173
|
}
|
|
173
174
|
case "tool_execution_update": {
|
|
174
|
-
const component = host.
|
|
175
|
+
const component = host.activeToolCalls.getActive(event.toolCallId);
|
|
175
176
|
if (component) {
|
|
176
177
|
component.updateArgs(event.args, event.repair);
|
|
177
178
|
component.updateResult({ ...event.partialResult, isError: false }, true);
|
|
@@ -195,11 +196,10 @@ export async function handleInteractiveEvent(host, event) {
|
|
|
195
196
|
host.activityLane.remove(toolActivityId);
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
|
-
const component = host.
|
|
199
|
+
const component = host.activeToolCalls.getActive(event.toolCallId);
|
|
199
200
|
if (component) {
|
|
200
201
|
component.updateResult({ ...event.result, isError: event.isError });
|
|
201
|
-
host.
|
|
202
|
-
host.toolPanels.finish(event.toolCallId);
|
|
202
|
+
host.activeToolCalls.finish(event.toolCallId);
|
|
203
203
|
host.ui.requestRender();
|
|
204
204
|
}
|
|
205
205
|
if (["task_steps", "goal", "delegate"].includes(event.toolName)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-event-controller.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-event-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,EAKN,MAAM,EACN,IAAI,GAEJ,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAGN,kCAAkC,EAClC,wBAAwB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EACN,4BAA4B,GAG5B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AA6DzC,SAAS,kBAAkB,CAAC,IAA0B;IACrD,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACtD,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACrC,CAAC;IACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;IACjC,CAAC;AACF,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,sBAAsB,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AE,CAAC;YACxB,MAAM;IACR,CAAC;AACF,CAAC","sourcesContent":["import type { AgentMessage, ToolCallRepairInfo } from \"@caupulican/pi-agent-core\";\nimport { createCompactionSummaryMessage } from \"@caupulican/pi-agent-core/messages\";\nimport type { AssistantMessage } from \"@caupulican/pi-ai\";\nimport {\n\ttype Container,\n\ttype Loader,\n\ttype LoaderIndicatorOptions,\n\ttype MarkdownTheme,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AgentSessionEvent } from \"../../core/agent-session-contracts.ts\";\nimport type { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport type { SettingsManager } from \"../../core/settings-manager.ts\";\nimport {\n\ttype ActivityLaneComponent,\n\ttype ActivityLaneKind,\n\tBACKGROUND_TOOL_ACTIVITY_ID_PREFIX,\n\tbackgroundToolActivityId,\n} from \"./components/activity-lane.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport { CountdownTimer } from \"./components/countdown-timer.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { keyText } from \"./components/keybinding-hints.ts\";\nimport type { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport {\n\tgetToolPanelResultActionKeys,\n\ttype ToolPanelRegistry,\n\ttype ToolPanelTenantScope,\n} from \"./components/tool-panel-registry.ts\";\nimport { theme } from \"./theme/theme.ts\";\n\n/** Structural host consumed by the event owner. InteractiveMode deliberately remains a thin facade. */\nexport interface InteractiveEventHost {\n\tisInitialized: boolean;\n\tsession: AgentSession;\n\tsettingsManager: SettingsManager;\n\tfooter: FooterComponent;\n\tfooterDataProvider: FooterDataProvider;\n\tui: TUI;\n\tdefaultEditor: CustomEditor;\n\tstatusContainer: Container;\n\tchatContainer: Container;\n\tactivityLane: ActivityLaneComponent | undefined;\n\tloadingAnimation: Loader | undefined;\n\tworkingVisible: boolean;\n\tworkingIndicatorOptions: LoaderIndicatorOptions | undefined;\n\tretryEscapeHandler: (() => void) | undefined;\n\tretryCountdown: CountdownTimer | undefined;\n\tautoCompactionEscapeHandler: (() => void) | undefined;\n\tstreamingComponent: AssistantMessageComponent | undefined;\n\tstreamingMessage: AssistantMessage | undefined;\n\thideThinkingBlock: boolean;\n\tlastStreamingUiUpdateAt: number;\n\ttoolPanels: ToolPanelRegistry;\n\tinit(): Promise<void>;\n\tcreateWorkingLoader(): Loader;\n\tstopWorkingLoader(): void;\n\tclearActiveToolCalls(): void;\n\tgetWorkingLoaderMessage(): string;\n\tupdatePendingMessagesDisplay(): void;\n\tupdateTerminalTitle(): void;\n\trefreshActivityLane(): void;\n\tupdateEditorBorderColor(): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\taddMessageToChat(message: AgentMessage): void;\n\tclearPendingStreamingUiUpdate(): void;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tapplyStreamingMessageUpdate(message: AssistantMessage, options?: { force?: boolean }): void;\n\tupdateRuntimeStatus(message?: AssistantMessage): void;\n\ttrimLiveTuiHistory(): void;\n\tattachToolExecutionComponent(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: unknown,\n\t\trepair?: ToolCallRepairInfo,\n\t): ToolExecutionComponent;\n\ttoolActivityKind(toolName: string): ActivityLaneKind;\n\ttoolActivityLabel(toolName: string): string;\n\ttoolActivityTerminalStatus(isError: boolean, details: unknown): \"success\" | \"failure\" | \"neutral\";\n\tgetToolPanelScope(): ToolPanelTenantScope;\n\tisNativeReflectionEnabled(): boolean;\n\tmaybeRunNativeReflection(messages: AgentMessage[]): void;\n\tmaybeStartAutoLearn(): boolean;\n\tmaybeStartAutonomyReview(messages: AgentMessage[]): boolean;\n\tcheckShutdownRequested(): Promise<void>;\n\trebuildChatFromMessages(): Promise<void>;\n\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n}\n\nfunction clearRetryControls(host: InteractiveEventHost): void {\n\tif (host.retryEscapeHandler) {\n\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\thost.retryEscapeHandler = undefined;\n\t}\n\tif (host.retryCountdown) {\n\t\thost.retryCountdown.dispose();\n\t\thost.retryCountdown = undefined;\n\t}\n}\n\n/** Single owner for AgentSessionEvent -> terminal UI state transitions. */\nexport async function handleInteractiveEvent(host: InteractiveEventHost, event: AgentSessionEvent): Promise<void> {\n\tif (!host.isInitialized) await host.init();\n\thost.footer.invalidate();\n\n\tswitch (event.type) {\n\t\tcase \"routing_start\":\n\t\t\tif (!host.session.isStreaming && !host.loadingAnimation && host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({ id: \"runtime:routing\", kind: \"runtime\", label: \"Routing\" });\n\t\t\t\t}\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"routing_end\":\n\t\t\thost.stopWorkingLoader();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"agent_start\":\n\t\t\thost.clearActiveToolCalls();\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.remove(\"runtime:retry\");\n\t\t\thost.stopWorkingLoader();\n\t\t\tif (host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({\n\t\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\t\tlabel: host.getWorkingLoaderMessage(),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"queue_update\":\n\t\t\thost.updatePendingMessagesDisplay();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"session_info_changed\":\n\t\t\thost.updateTerminalTitle();\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"thinking_level_changed\":\n\t\t\thost.footer.invalidate();\n\t\t\thost.updateEditorBorderColor();\n\t\t\tbreak;\n\n\t\tcase \"warning\":\n\t\t\thost.showWarning(event.message);\n\t\t\tbreak;\n\n\t\tcase \"delegate_workers\":\n\t\t\thost.footerDataProvider.setExtensionStatus(\"delegate\", undefined);\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\tbreak;\n\n\t\tcase \"background_tools\":\n\t\t\thost.activityLane?.removeByPrefix(BACKGROUND_TOOL_ACTIVITY_ID_PREFIX);\n\t\t\tfor (const task of event.tasks) {\n\t\t\t\thost.activityLane?.start({\n\t\t\t\t\tid: backgroundToolActivityId(task.taskId),\n\t\t\t\t\tkind: \"tool\",\n\t\t\t\t\tlabel: task.description.trim() || `${task.toolName} · ${task.taskId}`,\n\t\t\t\t\ttag: task.toolName,\n\t\t\t\t});\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"message_start\":\n\t\t\tif (event.message.role === \"custom\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"user\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.updatePendingMessagesDisplay();\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"assistant\") {\n\t\t\t\thost.clearPendingStreamingUiUpdate();\n\t\t\t\thost.lastStreamingUiUpdateAt = 0;\n\t\t\t\thost.streamingComponent = new AssistantMessageComponent(\n\t\t\t\t\tundefined,\n\t\t\t\t\thost.hideThinkingBlock,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t);\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.chatContainer.addChild(host.streamingComponent);\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\thost.trimLiveTuiHistory();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_update\":\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.applyStreamingMessageUpdate(event.message);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_end\":\n\t\t\tif (event.message.role === \"user\") break;\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\tlet errorMessage: string | undefined;\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\") {\n\t\t\t\t\tconst retryAttempt = host.session.retryAttempt;\n\t\t\t\t\terrorMessage =\n\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? \"s\" : \"\"}`\n\t\t\t\t\t\t\t: \"Operation aborted\";\n\t\t\t\t\thost.streamingMessage.errorMessage = errorMessage;\n\t\t\t\t}\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\" || host.streamingMessage.stopReason === \"error\") {\n\t\t\t\t\terrorMessage ??= host.streamingMessage.errorMessage || \"Error\";\n\t\t\t\t\tfor (const [, component] of host.toolPanels.activeEntries()) {\n\t\t\t\t\t\tcomponent.updateResult({ content: [{ type: \"text\", text: errorMessage }], isError: true });\n\t\t\t\t\t}\n\t\t\t\t\thost.clearActiveToolCalls();\n\t\t\t\t} else {\n\t\t\t\t\tfor (const [, component] of host.toolPanels.activeEntries()) component.setArgsComplete();\n\t\t\t\t}\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t\thost.footer.invalidate();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"tool_execution_start\": {\n\t\t\thost.updateRuntimeStatus();\n\t\t\thost.activityLane?.start({\n\t\t\t\tid: `tool:${event.toolCallId}`,\n\t\t\t\tkind: host.toolActivityKind(event.toolName),\n\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\ttag: event.toolName,\n\t\t\t});\n\t\t\tlet component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (!component) {\n\t\t\t\tcomponent = host.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);\n\t\t\t} else {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t}\n\t\t\tcomponent.markExecutionStarted(event.repair);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_update\": {\n\t\t\tconst component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t\tcomponent.updateResult({ ...event.partialResult, isError: false }, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_end\": {\n\t\t\tconst toolActivityId = `tool:${event.toolCallId}`;\n\t\t\tif (host.activityLane) {\n\t\t\t\tconst toolKind = host.toolActivityKind(event.toolName);\n\t\t\t\tconst terminalStatus = host.toolActivityTerminalStatus(event.isError, event.result.details);\n\t\t\t\tif (toolKind === \"tool\" || terminalStatus !== \"success\") {\n\t\t\t\t\thost.activityLane.finish(toolActivityId, terminalStatus, {\n\t\t\t\t\t\tid: toolActivityId,\n\t\t\t\t\t\tkind: toolKind,\n\t\t\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane.remove(toolActivityId);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.result, isError: event.isError });\n\t\t\t\thost.toolPanels.registerAliases(\n\t\t\t\t\tcomponent,\n\t\t\t\t\tgetToolPanelResultActionKeys(host.getToolPanelScope(), event.toolName, event.result),\n\t\t\t\t);\n\t\t\t\thost.toolPanels.finish(event.toolCallId);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tif ([\"task_steps\", \"goal\", \"delegate\"].includes(event.toolName)) {\n\t\t\t\thost.refreshActivityLane();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"agent_end\": {\n\t\t\tif (host.isNativeReflectionEnabled()) host.maybeRunNativeReflection(event.messages);\n\t\t\telse if (!host.maybeStartAutoLearn()) host.maybeStartAutonomyReview(event.messages);\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (event.willRetry) {\n\t\t\t\thost.activityLane?.remove(\"runtime:turn\");\n\t\t\t} else {\n\t\t\t\tconst finalAssistant = event.messages.findLast(\n\t\t\t\t\t(message): message is AssistantMessage => message.role === \"assistant\",\n\t\t\t\t);\n\t\t\t\tconst failed = finalAssistant?.stopReason === \"error\" || finalAssistant?.stopReason === \"aborted\";\n\t\t\t\thost.activityLane?.finish(\"runtime:turn\", failed ? \"failure\" : \"success\", {\n\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: failed ? \"Turn failed\" : \"Done\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (host.loadingAnimation) {\n\t\t\t\thost.loadingAnimation.stop();\n\t\t\t\thost.loadingAnimation = undefined;\n\t\t\t\thost.statusContainer.clear();\n\t\t\t}\n\t\t\tif (host.streamingComponent) {\n\t\t\t\thost.chatContainer.removeChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t}\n\t\t\thost.clearActiveToolCalls();\n\t\t\thost.activityLane?.removeByPrefix(\"tool:\");\n\t\t\tawait host.checkShutdownRequested();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_start\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\thost.autoCompactionEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortCompaction();\n\t\t\thost.stopWorkingLoader();\n\t\t\tconst cancelHint = `(${keyText(\"app.interrupt\")} to cancel)`;\n\t\t\tconst label =\n\t\t\t\tevent.reason === \"manual\"\n\t\t\t\t\t? `Compacting context ${cancelHint}`\n\t\t\t\t\t: `${event.reason === \"overflow\" ? \"Context overflow · \" : \"\"}Auto-compacting ${cancelHint}`;\n\t\t\thost.activityLane?.start({ id: \"runtime:compaction\", kind: \"runtime\", label });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_end\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (host.autoCompactionEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.autoCompactionEscapeHandler;\n\t\t\t\thost.autoCompactionEscapeHandler = undefined;\n\t\t\t}\n\t\t\tif (event.aborted) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction cancelled\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(\"Compaction cancelled\");\n\t\t\t} else if (event.result) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"success\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Context compacted\",\n\t\t\t\t});\n\t\t\t\tawait host.rebuildChatFromMessages();\n\t\t\t\thost.addMessageToChat(\n\t\t\t\t\tcreateCompactionSummaryMessage(\n\t\t\t\t\t\tevent.result.summary,\n\t\t\t\t\t\tevent.result.tokensBefore,\n\t\t\t\t\t\tnew Date().toISOString(),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\thost.footer.invalidate();\n\t\t\t} else if (event.errorMessage) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"failure\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction failed\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(event.errorMessage);\n\t\t\t\telse {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\thost.chatContainer.addChild(new Text(theme.fg(\"error\", event.errorMessage), 1, 0));\n\t\t\t\t}\n\t\t\t} else if (event.skipReason) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: `Compaction skipped · ${event.skipReason}`,\n\t\t\t\t});\n\t\t\t}\n\t\t\tvoid host.flushCompactionQueue({ willRetry: event.willRetry });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_start\": {\n\t\t\thost.retryEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortRetry();\n\t\t\thost.retryCountdown?.dispose();\n\t\t\tconst retryMessage = (seconds: number) =>\n\t\t\t\t`Retry ${event.attempt}/${event.maxAttempts} in ${seconds}s · ${keyText(\"app.interrupt\")} cancel`;\n\t\t\thost.activityLane?.wait({\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: retryMessage(Math.ceil(event.delayMs / 1000)),\n\t\t\t});\n\t\t\thost.retryCountdown = new CountdownTimer(\n\t\t\t\tevent.delayMs,\n\t\t\t\thost.ui,\n\t\t\t\t(seconds) => host.activityLane?.update(\"runtime:retry\", retryMessage(seconds)),\n\t\t\t\t() => {\n\t\t\t\t\thost.retryCountdown = undefined;\n\t\t\t\t},\n\t\t\t);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_end\":\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.finish(\"runtime:retry\", event.success ? \"success\" : \"failure\", {\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: event.success ? \"Retry resumed\" : \"Retry failed\",\n\t\t\t});\n\t\t\tif (!event.success) {\n\t\t\t\thost.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || \"Unknown error\"}`);\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-event-controller.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-event-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,EAKN,MAAM,EACN,IAAI,GAEJ,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAGN,kCAAkC,EAClC,wBAAwB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AA4DzC,SAAS,kBAAkB,CAAC,IAA0B;IACrD,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,kB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CAAC;gBACpB,IAAI,CAAC,SAAS,CAAC,sBAAsB,KAAK,CAAC,OAAO,cAAc,KAAK,CAAC,UAAU,IAAI,eAAe,EAAE,CAAC,CAAC;YACxG,CAAC;YACD,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM;IACR,CAAC;AACF,CAAC","sourcesContent":["import type { AgentMessage, ToolCallRepairInfo } from \"@caupulican/pi-agent-core\";\nimport { createCompactionSummaryMessage } from \"@caupulican/pi-agent-core/messages\";\nimport type { AssistantMessage } from \"@caupulican/pi-ai\";\nimport {\n\ttype Container,\n\ttype Loader,\n\ttype LoaderIndicatorOptions,\n\ttype MarkdownTheme,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AgentSessionEvent } from \"../../core/agent-session-contracts.ts\";\nimport type { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport type { SettingsManager } from \"../../core/settings-manager.ts\";\nimport type { ActiveToolCallRegistry } from \"./components/active-tool-call-registry.ts\";\nimport {\n\ttype ActivityLaneComponent,\n\ttype ActivityLaneKind,\n\tBACKGROUND_TOOL_ACTIVITY_ID_PREFIX,\n\tbackgroundToolActivityId,\n} from \"./components/activity-lane.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport { CountdownTimer } from \"./components/countdown-timer.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { keyText } from \"./components/keybinding-hints.ts\";\nimport type { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { theme } from \"./theme/theme.ts\";\n\n/** Structural host consumed by the event owner. InteractiveMode deliberately remains a thin facade. */\nexport interface InteractiveEventHost {\n\tisInitialized: boolean;\n\tsession: AgentSession;\n\tsettingsManager: SettingsManager;\n\tfooter: FooterComponent;\n\tfooterDataProvider: FooterDataProvider;\n\tui: TUI;\n\tdefaultEditor: CustomEditor;\n\tstatusContainer: Container;\n\tchatContainer: Container;\n\tactivityLane: ActivityLaneComponent | undefined;\n\tloadingAnimation: Loader | undefined;\n\tworkingVisible: boolean;\n\tworkingIndicatorOptions: LoaderIndicatorOptions | undefined;\n\tretryEscapeHandler: (() => void) | undefined;\n\tretryCountdown: CountdownTimer | undefined;\n\tautoCompactionEscapeHandler: (() => void) | undefined;\n\tstreamingComponent: AssistantMessageComponent | undefined;\n\tstreamingMessage: AssistantMessage | undefined;\n\thideThinkingBlock: boolean;\n\tlastStreamingUiUpdateAt: number;\n\tactiveToolCalls: ActiveToolCallRegistry;\n\tinit(): Promise<void>;\n\tcreateWorkingLoader(): Loader;\n\tstopWorkingLoader(): void;\n\tclearActiveToolCalls(): void;\n\tgetWorkingLoaderMessage(): string;\n\tupdatePendingMessagesDisplay(): void;\n\tupdateTerminalTitle(): void;\n\trefreshActivityLane(): void;\n\tupdateEditorBorderColor(): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\taddMessageToChat(message: AgentMessage): void;\n\tclearPendingStreamingUiUpdate(): void;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tapplyStreamingMessageUpdate(message: AssistantMessage, options?: { force?: boolean }): void;\n\tupdateRuntimeStatus(message?: AssistantMessage): void;\n\ttrimLiveTuiHistory(): void;\n\tattachToolExecutionComponent(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: unknown,\n\t\trepair?: ToolCallRepairInfo,\n\t): ToolExecutionComponent;\n\ttoolActivityKind(toolName: string): ActivityLaneKind;\n\ttoolActivityLabel(toolName: string): string;\n\ttoolActivityTerminalStatus(isError: boolean, details: unknown): \"success\" | \"failure\" | \"neutral\";\n\tisNativeReflectionEnabled(): boolean;\n\tmaybeRunNativeReflection(messages: AgentMessage[]): void;\n\tmaybeStartAutoLearn(): boolean;\n\tmaybeStartAutonomyReview(messages: AgentMessage[]): boolean;\n\tcheckShutdownRequested(): Promise<void>;\n\trebuildChatFromMessages(): Promise<void>;\n\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n}\n\nfunction clearRetryControls(host: InteractiveEventHost): void {\n\tif (host.retryEscapeHandler) {\n\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\thost.retryEscapeHandler = undefined;\n\t}\n\tif (host.retryCountdown) {\n\t\thost.retryCountdown.dispose();\n\t\thost.retryCountdown = undefined;\n\t}\n}\n\n/** Single owner for AgentSessionEvent -> terminal UI state transitions. */\nexport async function handleInteractiveEvent(host: InteractiveEventHost, event: AgentSessionEvent): Promise<void> {\n\tif (!host.isInitialized) await host.init();\n\thost.footer.invalidate();\n\n\tswitch (event.type) {\n\t\tcase \"routing_start\":\n\t\t\tif (!host.session.isStreaming && !host.loadingAnimation && host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({ id: \"runtime:routing\", kind: \"runtime\", label: \"Routing\" });\n\t\t\t\t}\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"routing_end\":\n\t\t\thost.stopWorkingLoader();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"agent_start\":\n\t\t\thost.clearActiveToolCalls();\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.remove(\"runtime:retry\");\n\t\t\thost.stopWorkingLoader();\n\t\t\tif (host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({\n\t\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\t\tlabel: host.getWorkingLoaderMessage(),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"queue_update\":\n\t\t\thost.updatePendingMessagesDisplay();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"session_info_changed\":\n\t\t\thost.updateTerminalTitle();\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"thinking_level_changed\":\n\t\t\thost.footer.invalidate();\n\t\t\thost.updateEditorBorderColor();\n\t\t\tbreak;\n\n\t\tcase \"warning\":\n\t\t\t// AgentSession warnings are operational diagnostics. Keep them in the transient status lane;\n\t\t\t// direct local UI validation still uses InteractiveMode.showWarning() and remains chat-local.\n\t\t\thost.activityLane?.announce(event.message, \"warning\");\n\t\t\tbreak;\n\n\t\tcase \"delegate_workers\":\n\t\t\thost.footerDataProvider.setExtensionStatus(\"delegate\", undefined);\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\tbreak;\n\n\t\tcase \"background_tools\":\n\t\t\thost.activityLane?.removeByPrefix(BACKGROUND_TOOL_ACTIVITY_ID_PREFIX);\n\t\t\tfor (const task of event.tasks) {\n\t\t\t\thost.activityLane?.start({\n\t\t\t\t\tid: backgroundToolActivityId(task.taskId),\n\t\t\t\t\tkind: \"tool\",\n\t\t\t\t\tlabel: task.description.trim() || `${task.toolName} · ${task.taskId}`,\n\t\t\t\t\ttag: task.toolName,\n\t\t\t\t});\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"message_start\":\n\t\t\tif (event.message.role === \"custom\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"user\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.updatePendingMessagesDisplay();\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"assistant\") {\n\t\t\t\thost.clearPendingStreamingUiUpdate();\n\t\t\t\thost.lastStreamingUiUpdateAt = 0;\n\t\t\t\thost.streamingComponent = new AssistantMessageComponent(\n\t\t\t\t\tundefined,\n\t\t\t\t\thost.hideThinkingBlock,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t);\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.chatContainer.addChild(host.streamingComponent);\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\thost.trimLiveTuiHistory();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_update\":\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.applyStreamingMessageUpdate(event.message);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_end\":\n\t\t\tif (event.message.role === \"user\") break;\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\tlet errorMessage: string | undefined;\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\") {\n\t\t\t\t\tconst retryAttempt = host.session.retryAttempt;\n\t\t\t\t\terrorMessage =\n\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? \"s\" : \"\"}`\n\t\t\t\t\t\t\t: \"Operation aborted\";\n\t\t\t\t\thost.streamingMessage.errorMessage = errorMessage;\n\t\t\t\t}\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\" || host.streamingMessage.stopReason === \"error\") {\n\t\t\t\t\terrorMessage ??= host.streamingMessage.errorMessage || \"Error\";\n\t\t\t\t\tfor (const [, component] of host.activeToolCalls.activeEntries()) {\n\t\t\t\t\t\tcomponent.updateResult({ content: [{ type: \"text\", text: errorMessage }], isError: true });\n\t\t\t\t\t}\n\t\t\t\t\thost.clearActiveToolCalls();\n\t\t\t\t} else {\n\t\t\t\t\tfor (const [, component] of host.activeToolCalls.activeEntries()) component.setArgsComplete();\n\t\t\t\t}\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t\thost.footer.invalidate();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"tool_execution_start\": {\n\t\t\thost.updateRuntimeStatus();\n\t\t\thost.activityLane?.start({\n\t\t\t\tid: `tool:${event.toolCallId}`,\n\t\t\t\tkind: host.toolActivityKind(event.toolName),\n\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\ttag: event.toolName,\n\t\t\t});\n\t\t\tlet component = host.activeToolCalls.getActive(event.toolCallId);\n\t\t\tif (!component) {\n\t\t\t\tcomponent = host.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);\n\t\t\t} else {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t}\n\t\t\tcomponent.markExecutionStarted(event.repair);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_update\": {\n\t\t\tconst component = host.activeToolCalls.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t\tcomponent.updateResult({ ...event.partialResult, isError: false }, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_end\": {\n\t\t\tconst toolActivityId = `tool:${event.toolCallId}`;\n\t\t\tif (host.activityLane) {\n\t\t\t\tconst toolKind = host.toolActivityKind(event.toolName);\n\t\t\t\tconst terminalStatus = host.toolActivityTerminalStatus(event.isError, event.result.details);\n\t\t\t\tif (toolKind === \"tool\" || terminalStatus !== \"success\") {\n\t\t\t\t\thost.activityLane.finish(toolActivityId, terminalStatus, {\n\t\t\t\t\t\tid: toolActivityId,\n\t\t\t\t\t\tkind: toolKind,\n\t\t\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane.remove(toolActivityId);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst component = host.activeToolCalls.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.result, isError: event.isError });\n\t\t\t\thost.activeToolCalls.finish(event.toolCallId);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tif ([\"task_steps\", \"goal\", \"delegate\"].includes(event.toolName)) {\n\t\t\t\thost.refreshActivityLane();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"agent_end\": {\n\t\t\tif (host.isNativeReflectionEnabled()) host.maybeRunNativeReflection(event.messages);\n\t\t\telse if (!host.maybeStartAutoLearn()) host.maybeStartAutonomyReview(event.messages);\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (event.willRetry) {\n\t\t\t\thost.activityLane?.remove(\"runtime:turn\");\n\t\t\t} else {\n\t\t\t\tconst finalAssistant = event.messages.findLast(\n\t\t\t\t\t(message): message is AssistantMessage => message.role === \"assistant\",\n\t\t\t\t);\n\t\t\t\tconst failed = finalAssistant?.stopReason === \"error\" || finalAssistant?.stopReason === \"aborted\";\n\t\t\t\thost.activityLane?.finish(\"runtime:turn\", failed ? \"failure\" : \"success\", {\n\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: failed ? \"Turn failed\" : \"Done\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (host.loadingAnimation) {\n\t\t\t\thost.loadingAnimation.stop();\n\t\t\t\thost.loadingAnimation = undefined;\n\t\t\t\thost.statusContainer.clear();\n\t\t\t}\n\t\t\tif (host.streamingComponent) {\n\t\t\t\thost.chatContainer.removeChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t}\n\t\t\thost.clearActiveToolCalls();\n\t\t\thost.activityLane?.removeByPrefix(\"tool:\");\n\t\t\tawait host.checkShutdownRequested();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_start\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\thost.autoCompactionEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortCompaction();\n\t\t\thost.stopWorkingLoader();\n\t\t\tconst cancelHint = `(${keyText(\"app.interrupt\")} to cancel)`;\n\t\t\tconst label =\n\t\t\t\tevent.reason === \"manual\"\n\t\t\t\t\t? `Compacting context ${cancelHint}`\n\t\t\t\t\t: `${event.reason === \"overflow\" ? \"Context overflow · \" : \"\"}Auto-compacting ${cancelHint}`;\n\t\t\thost.activityLane?.start({ id: \"runtime:compaction\", kind: \"runtime\", label });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_end\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (host.autoCompactionEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.autoCompactionEscapeHandler;\n\t\t\t\thost.autoCompactionEscapeHandler = undefined;\n\t\t\t}\n\t\t\tif (event.aborted) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction cancelled\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(\"Compaction cancelled\");\n\t\t\t} else if (event.result) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"success\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Context compacted\",\n\t\t\t\t});\n\t\t\t\tawait host.rebuildChatFromMessages();\n\t\t\t\thost.addMessageToChat(\n\t\t\t\t\tcreateCompactionSummaryMessage(\n\t\t\t\t\t\tevent.result.summary,\n\t\t\t\t\t\tevent.result.tokensBefore,\n\t\t\t\t\t\tnew Date().toISOString(),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\thost.footer.invalidate();\n\t\t\t} else if (event.errorMessage) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"failure\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction failed\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(event.errorMessage);\n\t\t\t\telse {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\thost.chatContainer.addChild(new Text(theme.fg(\"error\", event.errorMessage), 1, 0));\n\t\t\t\t}\n\t\t\t} else if (event.skipReason) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: `Compaction skipped · ${event.skipReason}`,\n\t\t\t\t});\n\t\t\t}\n\t\t\tvoid host.flushCompactionQueue({ willRetry: event.willRetry });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_start\": {\n\t\t\thost.retryEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortRetry();\n\t\t\thost.retryCountdown?.dispose();\n\t\t\tconst retryMessage = (seconds: number) =>\n\t\t\t\t`Retry ${event.attempt}/${event.maxAttempts} in ${seconds}s · ${keyText(\"app.interrupt\")} cancel`;\n\t\t\thost.activityLane?.wait({\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: retryMessage(Math.ceil(event.delayMs / 1000)),\n\t\t\t});\n\t\t\thost.retryCountdown = new CountdownTimer(\n\t\t\t\tevent.delayMs,\n\t\t\t\thost.ui,\n\t\t\t\t(seconds) => host.activityLane?.update(\"runtime:retry\", retryMessage(seconds)),\n\t\t\t\t() => {\n\t\t\t\t\thost.retryCountdown = undefined;\n\t\t\t\t},\n\t\t\t);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_end\":\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.finish(\"runtime:retry\", event.success ? \"success\" : \"failure\", {\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: event.success ? \"Retry resumed\" : \"Retry failed\",\n\t\t\t});\n\t\t\tif (!event.success) {\n\t\t\t\thost.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || \"Unknown error\"}`);\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t}\n}\n"]}
|
|
@@ -75,8 +75,9 @@ export declare class InteractiveMode {
|
|
|
75
75
|
private streamingMessage;
|
|
76
76
|
private streamingUiUpdateTimer;
|
|
77
77
|
private lastStreamingUiUpdateAt;
|
|
78
|
-
private
|
|
78
|
+
private activeToolCalls;
|
|
79
79
|
private toolOutputExpanded;
|
|
80
|
+
private transcriptActionsExpanded;
|
|
80
81
|
private hideThinkingBlock;
|
|
81
82
|
private skillCommands;
|
|
82
83
|
private unsubscribe?;
|
|
@@ -155,12 +156,10 @@ export declare class InteractiveMode {
|
|
|
155
156
|
* Get a registered tool definition by name (for custom rendering).
|
|
156
157
|
*/
|
|
157
158
|
private getRegisteredToolDefinition;
|
|
158
|
-
private
|
|
159
|
-
private appendToolExecutionComponent;
|
|
160
|
-
private detachToolExecutionComponent;
|
|
159
|
+
private appendTranscriptAction;
|
|
161
160
|
private attachToolExecutionComponent;
|
|
162
161
|
clearActiveToolCalls(): void;
|
|
163
|
-
private
|
|
162
|
+
private clearActiveToolCallState;
|
|
164
163
|
private getWorkingLoaderMessage;
|
|
165
164
|
private createWorkingLoader;
|
|
166
165
|
private stopWorkingLoader;
|
|
@@ -201,7 +200,7 @@ export declare class InteractiveMode {
|
|
|
201
200
|
private closeAgentsOverlay;
|
|
202
201
|
private toggleAgentsOverlay;
|
|
203
202
|
private showTranscriptPager;
|
|
204
|
-
private
|
|
203
|
+
private attachStreamingToolActions;
|
|
205
204
|
applyStreamingMessageUpdate(message: AssistantMessage, options?: {
|
|
206
205
|
force?: boolean;
|
|
207
206
|
}): void;
|
|
@@ -252,6 +251,7 @@ export declare class InteractiveMode {
|
|
|
252
251
|
private cycleModel;
|
|
253
252
|
private toggleToolOutputExpansion;
|
|
254
253
|
private setToolsExpanded;
|
|
254
|
+
private setTranscriptActionsExpanded;
|
|
255
255
|
private toggleThinkingBlockVisibility;
|
|
256
256
|
private openExternalEditor;
|
|
257
257
|
private openEditorForPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAkB,cAAc,EAAoB,MAAM,gCAAgC,CAAC;AAEvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAExF,OAAO,EAIN,KAAK,sBAAsB,EAM3B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AA2B/E,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"interactive-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAkB,cAAc,EA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.js";
|
|
|
25
25
|
import * as autonomyCommands from "./autonomy-commands.js";
|
|
26
26
|
import * as clipboardInput from "./clipboard-input.js";
|
|
27
27
|
import * as compactionQueue from "./compaction-queue.js";
|
|
28
|
+
import { ActionTranscriptComponent } from "./components/action-transcript.js";
|
|
29
|
+
import { ActiveToolCallRegistry } from "./components/active-tool-call-registry.js";
|
|
28
30
|
import { ActivityLaneComponent } from "./components/activity-lane.js";
|
|
29
31
|
import { AgentsOverlay } from "./components/agents-overlay.js";
|
|
30
32
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
@@ -39,8 +41,6 @@ import { FooterComponent } from "./components/footer.js";
|
|
|
39
41
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
40
42
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
41
43
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
42
|
-
import { ToolGroupComponent } from "./components/tool-group.js";
|
|
43
|
-
import { getToolPanelActionKey, shouldReuseToolPanelInPlace, ToolPanelRegistry, } from "./components/tool-panel-registry.js";
|
|
44
44
|
import { openTranscriptOverlay } from "./components/transcript-overlay.js";
|
|
45
45
|
import { UserMessageComponent } from "./components/user-message.js";
|
|
46
46
|
import * as configBackup from "./config-backup.js";
|
|
@@ -153,10 +153,11 @@ export class InteractiveMode {
|
|
|
153
153
|
this.streamingMessage = undefined;
|
|
154
154
|
this.streamingUiUpdateTimer = undefined;
|
|
155
155
|
this.lastStreamingUiUpdateAt = 0;
|
|
156
|
-
//
|
|
157
|
-
this.
|
|
156
|
+
// Active execution identity. Completed actions are owned by the transcript.
|
|
157
|
+
this.activeToolCalls = new ActiveToolCallRegistry();
|
|
158
158
|
// Tool output expansion state
|
|
159
159
|
this.toolOutputExpanded = false;
|
|
160
|
+
this.transcriptActionsExpanded = false;
|
|
160
161
|
// Thinking block visibility state
|
|
161
162
|
this.hideThinkingBlock = true;
|
|
162
163
|
// Skill commands: command name -> skill file path
|
|
@@ -884,7 +885,7 @@ export class InteractiveMode {
|
|
|
884
885
|
this.compactionQueuedMessages = [];
|
|
885
886
|
this.streamingComponent = undefined;
|
|
886
887
|
this.streamingMessage = undefined;
|
|
887
|
-
this.
|
|
888
|
+
this.clearActiveToolCallState();
|
|
888
889
|
void this.renderInitialMessages();
|
|
889
890
|
}
|
|
890
891
|
/**
|
|
@@ -893,106 +894,44 @@ export class InteractiveMode {
|
|
|
893
894
|
getRegisteredToolDefinition(toolName) {
|
|
894
895
|
return this.session.getToolDefinition(toolName);
|
|
895
896
|
}
|
|
896
|
-
|
|
897
|
-
return {
|
|
898
|
-
sessionId: this.sessionManager.getSessionId?.(),
|
|
899
|
-
sessionFile: this.sessionManager.getSessionFile?.(),
|
|
900
|
-
cwd: this.sessionManager.getCwd(),
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
|
-
appendToolExecutionComponent(component, allowGrouping) {
|
|
904
|
-
const toolGroup = allowGrouping ? component.toolGroup?.trim() : undefined;
|
|
905
|
-
if (!toolGroup) {
|
|
906
|
-
this.chatContainer.addChild(component);
|
|
907
|
-
this.trimLiveTuiHistory();
|
|
908
|
-
return;
|
|
909
|
-
}
|
|
897
|
+
appendTranscriptAction(component) {
|
|
910
898
|
const children = this.chatContainer.children;
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
group.addTool(component);
|
|
921
|
-
group.setExpanded(this.toolOutputExpanded);
|
|
922
|
-
children[children.length - 1] = group;
|
|
923
|
-
this.trimLiveTuiHistory();
|
|
924
|
-
return;
|
|
899
|
+
for (let index = children.length - 1; index >= 0; index--) {
|
|
900
|
+
const candidate = children[index];
|
|
901
|
+
if (candidate instanceof ActionTranscriptComponent) {
|
|
902
|
+
if (candidate.canAccept()) {
|
|
903
|
+
candidate.addAction(component);
|
|
904
|
+
this.trimLiveTuiHistory();
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
break;
|
|
925
908
|
}
|
|
926
|
-
|
|
927
|
-
if (toolGroup === "bash") {
|
|
928
|
-
const group = new ToolGroupComponent(toolGroup, [component]);
|
|
929
|
-
group.setExpanded(this.toolOutputExpanded);
|
|
930
|
-
this.chatContainer.addChild(group);
|
|
931
|
-
this.trimLiveTuiHistory();
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
this.chatContainer.addChild(component);
|
|
935
|
-
this.trimLiveTuiHistory();
|
|
936
|
-
}
|
|
937
|
-
detachToolExecutionComponent(component) {
|
|
938
|
-
const children = this.chatContainer.children;
|
|
939
|
-
const directIndex = children.indexOf(component);
|
|
940
|
-
if (directIndex !== -1) {
|
|
941
|
-
children.splice(directIndex, 1);
|
|
942
|
-
return;
|
|
943
|
-
}
|
|
944
|
-
for (let i = 0; i < children.length; i++) {
|
|
945
|
-
const child = children[i];
|
|
946
|
-
if (!(child instanceof ToolGroupComponent) || !child.removeTool(component))
|
|
909
|
+
if (candidate instanceof AssistantMessageComponent && !candidate.hasVisibleOutput())
|
|
947
910
|
continue;
|
|
948
|
-
|
|
949
|
-
if (remaining === 0) {
|
|
950
|
-
children.splice(i, 1);
|
|
951
|
-
}
|
|
952
|
-
else if (remaining === 1 && child.toolGroup !== "bash") {
|
|
953
|
-
const onlyTool = child.getOnlyTool();
|
|
954
|
-
if (onlyTool)
|
|
955
|
-
children[i] = onlyTool;
|
|
956
|
-
}
|
|
957
|
-
return;
|
|
911
|
+
break;
|
|
958
912
|
}
|
|
913
|
+
const transcript = new ActionTranscriptComponent([component]);
|
|
914
|
+
transcript.setTranscriptExpanded(this.transcriptActionsExpanded);
|
|
915
|
+
this.chatContainer.addChild(transcript);
|
|
916
|
+
this.trimLiveTuiHistory();
|
|
959
917
|
}
|
|
960
918
|
attachToolExecutionComponent(toolName, toolCallId, args, repair, deferResultUntilExpanded = false) {
|
|
961
|
-
const actionKey = getToolPanelActionKey(this.getToolPanelScope(), toolName, args);
|
|
962
919
|
const toolDefinition = this.getRegisteredToolDefinition(toolName);
|
|
963
|
-
const reuseInPlace = shouldReuseToolPanelInPlace(toolName, args);
|
|
964
|
-
const existing = this.toolPanels.getReusable(actionKey, { allowActive: reuseInPlace });
|
|
965
|
-
if (existing) {
|
|
966
|
-
if (reuseInPlace && actionKey) {
|
|
967
|
-
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair, deferResultUntilExpanded);
|
|
968
|
-
existing.setExpanded(this.toolOutputExpanded);
|
|
969
|
-
this.toolPanels.replaceActiveForAction(toolCallId, existing, actionKey);
|
|
970
|
-
this.ui.requestRender();
|
|
971
|
-
return existing;
|
|
972
|
-
}
|
|
973
|
-
this.detachToolExecutionComponent(existing);
|
|
974
|
-
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair, deferResultUntilExpanded);
|
|
975
|
-
existing.setExpanded(this.toolOutputExpanded);
|
|
976
|
-
this.appendToolExecutionComponent(existing, true);
|
|
977
|
-
this.toolPanels.register(toolCallId, existing, actionKey);
|
|
978
|
-
return existing;
|
|
979
|
-
}
|
|
980
920
|
const component = new ToolExecutionComponent(toolName, toolCallId, args, {
|
|
981
921
|
showImages: this.settingsManager.getShowImages(),
|
|
982
922
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
983
923
|
repair,
|
|
984
924
|
deferResultUntilExpanded,
|
|
985
925
|
}, toolDefinition, this.ui, this.sessionManager.getCwd());
|
|
986
|
-
|
|
987
|
-
this.
|
|
988
|
-
this.toolPanels.register(toolCallId, component, actionKey);
|
|
926
|
+
this.appendTranscriptAction(component);
|
|
927
|
+
this.activeToolCalls.register(toolCallId, component);
|
|
989
928
|
return component;
|
|
990
929
|
}
|
|
991
930
|
clearActiveToolCalls() {
|
|
992
|
-
this.
|
|
931
|
+
this.activeToolCalls.clearActive();
|
|
993
932
|
}
|
|
994
|
-
|
|
995
|
-
this.
|
|
933
|
+
clearActiveToolCallState() {
|
|
934
|
+
this.activeToolCalls.clearActive();
|
|
996
935
|
}
|
|
997
936
|
getWorkingLoaderMessage() {
|
|
998
937
|
return this.runtimeStatus.getWorkingLoaderMessage();
|
|
@@ -1507,7 +1446,7 @@ export class InteractiveMode {
|
|
|
1507
1446
|
showDeferredHistoryPlaceholder(options = {}) {
|
|
1508
1447
|
this.chatContainer.children = [];
|
|
1509
1448
|
this.resetLiveTuiHistoryTrim();
|
|
1510
|
-
this.
|
|
1449
|
+
this.clearActiveToolCallState();
|
|
1511
1450
|
const entryCount = this.getSessionEntryCount();
|
|
1512
1451
|
if (entryCount > 0) {
|
|
1513
1452
|
this.chatContainer.addChild(new Text(theme.fg("dim", `History hidden for typing performance (${entryCount} entries). Press ${keyText("app.history.load")} to load session history.`), 1, 0));
|
|
@@ -1585,19 +1524,21 @@ export class InteractiveMode {
|
|
|
1585
1524
|
keybindings: this.keybindings,
|
|
1586
1525
|
getToolsExpanded: () => this.toolOutputExpanded,
|
|
1587
1526
|
setToolsExpanded: (expanded) => this.setToolsExpanded(expanded),
|
|
1527
|
+
getActionsExpanded: () => this.transcriptActionsExpanded,
|
|
1528
|
+
setActionsExpanded: (expanded) => this.setTranscriptActionsExpanded(expanded),
|
|
1588
1529
|
showOverlay: (component, options) => this.ui.showOverlay(component, options),
|
|
1589
1530
|
});
|
|
1590
1531
|
}
|
|
1591
|
-
|
|
1532
|
+
attachStreamingToolActions(message) {
|
|
1592
1533
|
for (const content of message.content) {
|
|
1593
1534
|
if (content.type !== "toolCall")
|
|
1594
1535
|
continue;
|
|
1595
1536
|
const repair = getToolCallRepairInfo(content);
|
|
1596
|
-
if (!this.
|
|
1537
|
+
if (!this.activeToolCalls.hasActive(content.id)) {
|
|
1597
1538
|
this.attachToolExecutionComponent(content.name, content.id, content.arguments, repair);
|
|
1598
1539
|
}
|
|
1599
1540
|
else {
|
|
1600
|
-
const component = this.
|
|
1541
|
+
const component = this.activeToolCalls.getActive(content.id);
|
|
1601
1542
|
if (component) {
|
|
1602
1543
|
component.updateArgs(content.arguments, repair);
|
|
1603
1544
|
}
|
|
@@ -1617,7 +1558,7 @@ export class InteractiveMode {
|
|
|
1617
1558
|
if (!this.streamingComponent || !this.streamingMessage)
|
|
1618
1559
|
return;
|
|
1619
1560
|
this.streamingComponent.updateContent(this.streamingMessage);
|
|
1620
|
-
this.
|
|
1561
|
+
this.attachStreamingToolActions(this.streamingMessage);
|
|
1621
1562
|
this.lastStreamingUiUpdateAt = performance.now();
|
|
1622
1563
|
this.ui.requestRender();
|
|
1623
1564
|
};
|
|
@@ -1648,8 +1589,9 @@ export class InteractiveMode {
|
|
|
1648
1589
|
protect(this.streamingComponent);
|
|
1649
1590
|
protect(this.lastStatusSpacer);
|
|
1650
1591
|
protect(this.lastStatusText);
|
|
1651
|
-
for (const [,
|
|
1652
|
-
|
|
1592
|
+
for (const [, action] of this.activeToolCalls.activeEntries()) {
|
|
1593
|
+
const transcript = children.find((child) => child instanceof ActionTranscriptComponent && child.containsAction(action));
|
|
1594
|
+
protect(transcript);
|
|
1653
1595
|
}
|
|
1654
1596
|
const trimStart = children[0] === this.liveHistoryHiddenNotice ? 1 : 0;
|
|
1655
1597
|
const targetTrimEnd = children.length - TUI_LIVE_HISTORY_TRIM_TO_COMPONENTS;
|
|
@@ -1802,7 +1744,7 @@ export class InteractiveMode {
|
|
|
1802
1744
|
const stagingChatContainer = new Container();
|
|
1803
1745
|
this.chatContainer = stagingChatContainer;
|
|
1804
1746
|
this.resetLiveTuiHistoryTrim();
|
|
1805
|
-
this.
|
|
1747
|
+
this.clearActiveToolCallState();
|
|
1806
1748
|
const renderedPendingTools = new Map();
|
|
1807
1749
|
try {
|
|
1808
1750
|
if (options.updateFooter) {
|
|
@@ -1840,7 +1782,7 @@ export class InteractiveMode {
|
|
|
1840
1782
|
errorMessage = message.errorMessage || "Error";
|
|
1841
1783
|
}
|
|
1842
1784
|
component.updateResult({ content: [{ type: "text", text: errorMessage }], isError: true });
|
|
1843
|
-
this.
|
|
1785
|
+
this.activeToolCalls.finish(content.id);
|
|
1844
1786
|
}
|
|
1845
1787
|
else {
|
|
1846
1788
|
renderedPendingTools.set(content.id, component);
|
|
@@ -1854,7 +1796,7 @@ export class InteractiveMode {
|
|
|
1854
1796
|
if (component) {
|
|
1855
1797
|
component.updateResult(message);
|
|
1856
1798
|
renderedPendingTools.delete(message.toolCallId);
|
|
1857
|
-
this.
|
|
1799
|
+
this.activeToolCalls.finish(message.toolCallId);
|
|
1858
1800
|
}
|
|
1859
1801
|
}
|
|
1860
1802
|
else {
|
|
@@ -2109,6 +2051,14 @@ export class InteractiveMode {
|
|
|
2109
2051
|
}
|
|
2110
2052
|
this.ui.requestRender();
|
|
2111
2053
|
}
|
|
2054
|
+
setTranscriptActionsExpanded(expanded) {
|
|
2055
|
+
this.transcriptActionsExpanded = expanded;
|
|
2056
|
+
for (const child of this.chatContainer.children) {
|
|
2057
|
+
if (child instanceof ActionTranscriptComponent)
|
|
2058
|
+
child.setTranscriptExpanded(expanded);
|
|
2059
|
+
}
|
|
2060
|
+
this.ui.requestRender();
|
|
2061
|
+
}
|
|
2112
2062
|
async toggleThinkingBlockVisibility() {
|
|
2113
2063
|
this.hideThinkingBlock = !this.hideThinkingBlock;
|
|
2114
2064
|
this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
|
|
@@ -2120,10 +2070,10 @@ export class InteractiveMode {
|
|
|
2120
2070
|
this.streamingComponent.updateContent(this.streamingMessage);
|
|
2121
2071
|
this.updateRuntimeStatus(this.streamingMessage);
|
|
2122
2072
|
this.chatContainer.addChild(this.streamingComponent);
|
|
2123
|
-
// Rebuilding the chat clears
|
|
2073
|
+
// Rebuilding the chat clears active call identity. Reattach
|
|
2124
2074
|
// any tool calls that are still arriving so toggling thinking visibility
|
|
2125
2075
|
// cannot make an in-flight tool disappear from the TUI.
|
|
2126
|
-
this.
|
|
2076
|
+
this.attachStreamingToolActions(this.streamingMessage);
|
|
2127
2077
|
}
|
|
2128
2078
|
this.showStatus(`Thinking blocks: ${this.hideThinkingBlock ? "hidden" : "visible"}`);
|
|
2129
2079
|
}
|