@caupulican/pi-adaptative 0.93.18 → 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 +31 -0
- package/README.md +3 -2
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +22 -12
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction-controller.d.ts +21 -0
- package/dist/core/compaction-controller.d.ts.map +1 -1
- package/dist/core/compaction-controller.js +149 -26
- package/dist/core/compaction-controller.js.map +1 -1
- package/dist/core/delegation/worker-agent-control-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-agent-control-coordinator.js +1 -0
- package/dist/core/delegation/worker-agent-control-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-agent-control.d.ts +2 -0
- package/dist/core/delegation/worker-agent-control.d.ts.map +1 -1
- package/dist/core/delegation/worker-agent-control.js.map +1 -1
- 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/foreground-lifecycle-adapter.d.ts +27 -0
- package/dist/core/foreground-lifecycle-adapter.d.ts.map +1 -0
- package/dist/core/foreground-lifecycle-adapter.js +61 -0
- package/dist/core/foreground-lifecycle-adapter.js.map +1 -0
- package/dist/core/foreground-lifecycle-controller.d.ts +48 -0
- package/dist/core/foreground-lifecycle-controller.d.ts.map +1 -0
- package/dist/core/foreground-lifecycle-controller.js +404 -0
- package/dist/core/foreground-lifecycle-controller.js.map +1 -0
- package/dist/core/foreground-recovery-controller.d.ts +3 -0
- package/dist/core/foreground-recovery-controller.d.ts.map +1 -1
- package/dist/core/foreground-recovery-controller.js +15 -1
- package/dist/core/foreground-recovery-controller.js.map +1 -1
- package/dist/core/goals/goal-state.d.ts.map +1 -1
- package/dist/core/goals/goal-state.js +9 -2
- package/dist/core/goals/goal-state.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/memory/memory-manager.d.ts +22 -0
- package/dist/core/memory/memory-manager.d.ts.map +1 -1
- package/dist/core/memory/memory-manager.js +108 -49
- package/dist/core/memory/memory-manager.js.map +1 -1
- package/dist/core/model-router/session-buffer.d.ts +10 -2
- package/dist/core/model-router/session-buffer.d.ts.map +1 -1
- package/dist/core/model-router/session-buffer.js +35 -9
- package/dist/core/model-router/session-buffer.js.map +1 -1
- package/dist/core/model-router-controller.d.ts +20 -2
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +70 -17
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/provider-request-runtime-controller.d.ts +12 -1
- package/dist/core/provider-request-runtime-controller.d.ts.map +1 -1
- package/dist/core/provider-request-runtime-controller.js +45 -2
- package/dist/core/provider-request-runtime-controller.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/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +4 -2
- package/dist/core/tools/delegate.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 +3 -3
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +16 -20
- 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 +15 -0
- package/dist/modes/interactive/components/transcript-overlay.d.ts.map +1 -0
- package/dist/modes/interactive/components/transcript-overlay.js +38 -0
- package/dist/modes/interactive/components/transcript-overlay.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +7 -4
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.d.ts +3 -4
- package/dist/modes/interactive/interactive-event-controller.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.js +11 -10
- package/dist/modes/interactive/interactive-event-controller.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +15 -13
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +105 -184
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/runtime-status-controller.d.ts +40 -0
- package/dist/modes/interactive/runtime-status-controller.d.ts.map +1 -0
- package/dist/modes/interactive/runtime-status-controller.js +147 -0
- package/dist/modes/interactive/runtime-status-controller.js.map +1 -0
- package/dist/modes/interactive/runtime-status.d.ts +15 -0
- package/dist/modes/interactive/runtime-status.d.ts.map +1 -0
- package/dist/modes/interactive/runtime-status.js +18 -0
- package/dist/modes/interactive/runtime-status.js.map +1 -0
- 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/json.md +1 -1
- package/docs/keybindings.md +3 -2
- package/docs/session-format.md +59 -4
- 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 -25
- package/dist/modes/interactive/components/tool-group.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-group.js +0 -175
- 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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@caupulican/pi-ai";
|
|
2
|
+
import { type Container, Loader, type LoaderIndicatorOptions, type TUI } from "@caupulican/pi-tui";
|
|
3
|
+
import type { ActivityLaneComponent } from "./components/activity-lane.ts";
|
|
4
|
+
export interface RuntimeStatusControllerHost {
|
|
5
|
+
readonly ui: TUI;
|
|
6
|
+
readonly statusContainer: Container;
|
|
7
|
+
readonly activityLane: ActivityLaneComponent | undefined;
|
|
8
|
+
readonly hasHumanAudience: boolean;
|
|
9
|
+
isStreaming(): boolean;
|
|
10
|
+
isThinkingHidden(): boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Owns the human-facing turn indicator and its loader/activity-lane lifecycle. */
|
|
13
|
+
export declare class RuntimeStatusController {
|
|
14
|
+
private readonly host;
|
|
15
|
+
private activeLoader;
|
|
16
|
+
private workingMessage;
|
|
17
|
+
private workingVisible;
|
|
18
|
+
private workingIndicatorOptions;
|
|
19
|
+
private readonly defaultWorkingMessage;
|
|
20
|
+
private readonly defaultHiddenThinkingLabel;
|
|
21
|
+
private hiddenThinkingLabel;
|
|
22
|
+
private runtimeStatusLabel;
|
|
23
|
+
constructor(host: RuntimeStatusControllerHost);
|
|
24
|
+
get loadingAnimation(): Loader | undefined;
|
|
25
|
+
set loadingAnimation(value: Loader | undefined);
|
|
26
|
+
get isWorkingVisible(): boolean;
|
|
27
|
+
set isWorkingVisible(value: boolean);
|
|
28
|
+
get indicatorOptions(): LoaderIndicatorOptions | undefined;
|
|
29
|
+
set indicatorOptions(value: LoaderIndicatorOptions | undefined);
|
|
30
|
+
getWorkingLoaderMessage(): string;
|
|
31
|
+
createWorkingLoader(): Loader;
|
|
32
|
+
stopWorkingLoader(): void;
|
|
33
|
+
setWorkingVisible(visible: boolean): void;
|
|
34
|
+
setWorkingIndicator(options?: LoaderIndicatorOptions): void;
|
|
35
|
+
setHiddenThinkingLabel(label?: string): void;
|
|
36
|
+
updateRuntimeStatus(message?: AssistantMessage): void;
|
|
37
|
+
setWorkingMessage(message: string | undefined, messageInFlight: AssistantMessage | undefined): void;
|
|
38
|
+
resetWorkingIndicators(): void;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=runtime-status-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-status-controller.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/runtime-status-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,EAAE,KAAK,sBAAsB,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAK3E,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;IACjB,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,qBAAqB,GAAG,SAAS,CAAC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M,GAAG,SAAS,EAAE,eAAe,EAAE,gBAAgB,GAAG,SAAS,GAAG,IAAI,CAUlG;IAED,sBAAsB,IAAI,IAAI,CAQ7B;CACD"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Loader } from "@caupulican/pi-tui";
|
|
2
|
+
import { keyText } from "./components/keybinding-hints.js";
|
|
3
|
+
import { applyRuntimeStatusLabel, resolveHiddenThinkingStatus } from "./runtime-status.js";
|
|
4
|
+
import { theme } from "./theme/theme.js";
|
|
5
|
+
/** Owns the human-facing turn indicator and its loader/activity-lane lifecycle. */
|
|
6
|
+
export class RuntimeStatusController {
|
|
7
|
+
constructor(host) {
|
|
8
|
+
this.defaultWorkingMessage = "Working...";
|
|
9
|
+
this.defaultHiddenThinkingLabel = "Thinking...";
|
|
10
|
+
this.hiddenThinkingLabel = this.defaultHiddenThinkingLabel;
|
|
11
|
+
this.host = host;
|
|
12
|
+
this.workingVisible = host.hasHumanAudience;
|
|
13
|
+
}
|
|
14
|
+
get loadingAnimation() {
|
|
15
|
+
return this.activeLoader;
|
|
16
|
+
}
|
|
17
|
+
set loadingAnimation(value) {
|
|
18
|
+
this.activeLoader = value;
|
|
19
|
+
}
|
|
20
|
+
get isWorkingVisible() {
|
|
21
|
+
return this.workingVisible;
|
|
22
|
+
}
|
|
23
|
+
set isWorkingVisible(value) {
|
|
24
|
+
this.workingVisible = value;
|
|
25
|
+
}
|
|
26
|
+
get indicatorOptions() {
|
|
27
|
+
return this.workingIndicatorOptions;
|
|
28
|
+
}
|
|
29
|
+
set indicatorOptions(value) {
|
|
30
|
+
this.workingIndicatorOptions = value;
|
|
31
|
+
}
|
|
32
|
+
getWorkingLoaderMessage() {
|
|
33
|
+
return this.workingMessage ?? this.defaultWorkingMessage;
|
|
34
|
+
}
|
|
35
|
+
createWorkingLoader() {
|
|
36
|
+
return new Loader(this.host.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), this.runtimeStatusLabel ?? this.getWorkingLoaderMessage(), this.workingIndicatorOptions);
|
|
37
|
+
}
|
|
38
|
+
stopWorkingLoader() {
|
|
39
|
+
if (this.activeLoader) {
|
|
40
|
+
this.activeLoader.stop();
|
|
41
|
+
this.activeLoader = undefined;
|
|
42
|
+
}
|
|
43
|
+
this.host.statusContainer.clear();
|
|
44
|
+
this.runtimeStatusLabel = undefined;
|
|
45
|
+
this.host.activityLane?.remove("runtime:routing");
|
|
46
|
+
this.host.activityLane?.remove("runtime:turn");
|
|
47
|
+
}
|
|
48
|
+
setWorkingVisible(visible) {
|
|
49
|
+
if (!this.host.hasHumanAudience) {
|
|
50
|
+
this.workingVisible = false;
|
|
51
|
+
this.stopWorkingLoader();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.workingVisible = visible;
|
|
55
|
+
if (!visible) {
|
|
56
|
+
const currentRuntimeStatus = this.runtimeStatusLabel;
|
|
57
|
+
this.stopWorkingLoader();
|
|
58
|
+
if (this.host.isStreaming())
|
|
59
|
+
this.runtimeStatusLabel = currentRuntimeStatus;
|
|
60
|
+
this.host.ui.requestRender();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (this.host.isStreaming() && !this.activeLoader) {
|
|
64
|
+
if (this.workingIndicatorOptions) {
|
|
65
|
+
this.host.statusContainer.clear();
|
|
66
|
+
this.activeLoader = this.createWorkingLoader();
|
|
67
|
+
this.host.statusContainer.addChild(this.activeLoader);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.host.activityLane?.start({
|
|
71
|
+
id: "runtime:turn",
|
|
72
|
+
kind: "runtime",
|
|
73
|
+
label: this.runtimeStatusLabel ?? this.getWorkingLoaderMessage(),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
this.host.ui.requestRender();
|
|
78
|
+
}
|
|
79
|
+
setWorkingIndicator(options) {
|
|
80
|
+
this.workingIndicatorOptions = options;
|
|
81
|
+
if (!this.host.hasHumanAudience) {
|
|
82
|
+
this.stopWorkingLoader();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (options) {
|
|
86
|
+
this.host.activityLane?.remove("runtime:turn");
|
|
87
|
+
if (this.host.isStreaming() && this.workingVisible) {
|
|
88
|
+
const currentRuntimeStatus = this.runtimeStatusLabel;
|
|
89
|
+
this.stopWorkingLoader();
|
|
90
|
+
this.runtimeStatusLabel = currentRuntimeStatus;
|
|
91
|
+
this.activeLoader = this.createWorkingLoader();
|
|
92
|
+
this.host.statusContainer.addChild(this.activeLoader);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this.activeLoader?.stop();
|
|
97
|
+
this.activeLoader = undefined;
|
|
98
|
+
this.host.statusContainer.clear();
|
|
99
|
+
if (this.host.isStreaming() && this.workingVisible) {
|
|
100
|
+
this.host.activityLane?.start({
|
|
101
|
+
id: "runtime:turn",
|
|
102
|
+
kind: "runtime",
|
|
103
|
+
label: this.runtimeStatusLabel ?? this.getWorkingLoaderMessage(),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
this.host.ui.requestRender();
|
|
108
|
+
}
|
|
109
|
+
setHiddenThinkingLabel(label) {
|
|
110
|
+
this.hiddenThinkingLabel = label ?? this.defaultHiddenThinkingLabel;
|
|
111
|
+
}
|
|
112
|
+
updateRuntimeStatus(message) {
|
|
113
|
+
if (!this.host.hasHumanAudience)
|
|
114
|
+
return;
|
|
115
|
+
const label = message
|
|
116
|
+
? resolveHiddenThinkingStatus(message, this.host.isThinkingHidden(), this.hiddenThinkingLabel, this.getWorkingLoaderMessage())
|
|
117
|
+
: this.getWorkingLoaderMessage();
|
|
118
|
+
this.runtimeStatusLabel = applyRuntimeStatusLabel({
|
|
119
|
+
hasHumanAudience: this.host.hasHumanAudience,
|
|
120
|
+
currentLabel: this.runtimeStatusLabel,
|
|
121
|
+
loadingAnimation: this.activeLoader,
|
|
122
|
+
activityLane: this.host.activityLane,
|
|
123
|
+
requestRender: () => this.host.ui.requestRender(),
|
|
124
|
+
}, label);
|
|
125
|
+
}
|
|
126
|
+
setWorkingMessage(message, messageInFlight) {
|
|
127
|
+
this.workingMessage = message;
|
|
128
|
+
if (messageInFlight) {
|
|
129
|
+
this.updateRuntimeStatus(messageInFlight);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (this.activeLoader) {
|
|
133
|
+
this.activeLoader.setMessage(message ?? this.defaultWorkingMessage);
|
|
134
|
+
}
|
|
135
|
+
this.host.activityLane?.update("runtime:turn", message ?? this.defaultWorkingMessage);
|
|
136
|
+
}
|
|
137
|
+
resetWorkingIndicators() {
|
|
138
|
+
this.workingMessage = undefined;
|
|
139
|
+
this.workingVisible = this.host.hasHumanAudience;
|
|
140
|
+
this.setWorkingIndicator();
|
|
141
|
+
if (this.activeLoader) {
|
|
142
|
+
this.activeLoader.setMessage(`${this.defaultWorkingMessage} (${keyText("app.interrupt")} to interrupt)`);
|
|
143
|
+
}
|
|
144
|
+
this.setHiddenThinkingLabel();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=runtime-status-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-status-controller.js","sourceRoot":"","sources":["../../../src/modes/interactive/runtime-status-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,MAAM,EAAyC,MAAM,oBAAoB,CAAC;AAEnG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAWzC,mFAAmF;AACnF,MAAM,OAAO,uBAAuB;IAWnC,YAAY,IAAiC;QAL5B,0BAAqB,GAAG,YAAY,CAAC;QACrC,+BAA0B,GAAG,aAAa,CAAC;QACpD,wBAAmB,GAAG,IAAI,CAAC,0BAA0B,CAAC;QAI7D,IA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AC,OAAO,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE,OAAO,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACvF,CAAC;IAED,sBAAsB;QACrB,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC1G,CAAC;QACD,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAC/B,CAAC;CACD","sourcesContent":["import type { AssistantMessage } from \"@caupulican/pi-ai\";\nimport { type Container, Loader, type LoaderIndicatorOptions, type TUI } from \"@caupulican/pi-tui\";\nimport type { ActivityLaneComponent } from \"./components/activity-lane.ts\";\nimport { keyText } from \"./components/keybinding-hints.ts\";\nimport { applyRuntimeStatusLabel, resolveHiddenThinkingStatus } from \"./runtime-status.ts\";\nimport { theme } from \"./theme/theme.ts\";\n\nexport interface RuntimeStatusControllerHost {\n\treadonly ui: TUI;\n\treadonly statusContainer: Container;\n\treadonly activityLane: ActivityLaneComponent | undefined;\n\treadonly hasHumanAudience: boolean;\n\tisStreaming(): boolean;\n\tisThinkingHidden(): boolean;\n}\n\n/** Owns the human-facing turn indicator and its loader/activity-lane lifecycle. */\nexport class RuntimeStatusController {\n\tprivate readonly host: RuntimeStatusControllerHost;\n\tprivate activeLoader: Loader | undefined;\n\tprivate workingMessage: string | undefined;\n\tprivate workingVisible: boolean;\n\tprivate workingIndicatorOptions: LoaderIndicatorOptions | undefined;\n\tprivate readonly defaultWorkingMessage = \"Working...\";\n\tprivate readonly defaultHiddenThinkingLabel = \"Thinking...\";\n\tprivate hiddenThinkingLabel = this.defaultHiddenThinkingLabel;\n\tprivate runtimeStatusLabel: string | undefined;\n\n\tconstructor(host: RuntimeStatusControllerHost) {\n\t\tthis.host = host;\n\t\tthis.workingVisible = host.hasHumanAudience;\n\t}\n\n\tget loadingAnimation(): Loader | undefined {\n\t\treturn this.activeLoader;\n\t}\n\n\tset loadingAnimation(value: Loader | undefined) {\n\t\tthis.activeLoader = value;\n\t}\n\n\tget isWorkingVisible(): boolean {\n\t\treturn this.workingVisible;\n\t}\n\n\tset isWorkingVisible(value: boolean) {\n\t\tthis.workingVisible = value;\n\t}\n\n\tget indicatorOptions(): LoaderIndicatorOptions | undefined {\n\t\treturn this.workingIndicatorOptions;\n\t}\n\n\tset indicatorOptions(value: LoaderIndicatorOptions | undefined) {\n\t\tthis.workingIndicatorOptions = value;\n\t}\n\n\tgetWorkingLoaderMessage(): string {\n\t\treturn this.workingMessage ?? this.defaultWorkingMessage;\n\t}\n\n\tcreateWorkingLoader(): Loader {\n\t\treturn new Loader(\n\t\t\tthis.host.ui,\n\t\t\t(spinner) => theme.fg(\"accent\", spinner),\n\t\t\t(text) => theme.fg(\"muted\", text),\n\t\t\tthis.runtimeStatusLabel ?? this.getWorkingLoaderMessage(),\n\t\t\tthis.workingIndicatorOptions,\n\t\t);\n\t}\n\n\tstopWorkingLoader(): void {\n\t\tif (this.activeLoader) {\n\t\t\tthis.activeLoader.stop();\n\t\t\tthis.activeLoader = undefined;\n\t\t}\n\t\tthis.host.statusContainer.clear();\n\t\tthis.runtimeStatusLabel = undefined;\n\t\tthis.host.activityLane?.remove(\"runtime:routing\");\n\t\tthis.host.activityLane?.remove(\"runtime:turn\");\n\t}\n\n\tsetWorkingVisible(visible: boolean): void {\n\t\tif (!this.host.hasHumanAudience) {\n\t\t\tthis.workingVisible = false;\n\t\t\tthis.stopWorkingLoader();\n\t\t\treturn;\n\t\t}\n\t\tthis.workingVisible = visible;\n\t\tif (!visible) {\n\t\t\tconst currentRuntimeStatus = this.runtimeStatusLabel;\n\t\t\tthis.stopWorkingLoader();\n\t\t\tif (this.host.isStreaming()) this.runtimeStatusLabel = currentRuntimeStatus;\n\t\t\tthis.host.ui.requestRender();\n\t\t\treturn;\n\t\t}\n\t\tif (this.host.isStreaming() && !this.activeLoader) {\n\t\t\tif (this.workingIndicatorOptions) {\n\t\t\t\tthis.host.statusContainer.clear();\n\t\t\t\tthis.activeLoader = this.createWorkingLoader();\n\t\t\t\tthis.host.statusContainer.addChild(this.activeLoader);\n\t\t\t} else {\n\t\t\t\tthis.host.activityLane?.start({\n\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: this.runtimeStatusLabel ?? this.getWorkingLoaderMessage(),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tthis.host.ui.requestRender();\n\t}\n\n\tsetWorkingIndicator(options?: LoaderIndicatorOptions): void {\n\t\tthis.workingIndicatorOptions = options;\n\t\tif (!this.host.hasHumanAudience) {\n\t\t\tthis.stopWorkingLoader();\n\t\t\treturn;\n\t\t}\n\t\tif (options) {\n\t\t\tthis.host.activityLane?.remove(\"runtime:turn\");\n\t\t\tif (this.host.isStreaming() && this.workingVisible) {\n\t\t\t\tconst currentRuntimeStatus = this.runtimeStatusLabel;\n\t\t\t\tthis.stopWorkingLoader();\n\t\t\t\tthis.runtimeStatusLabel = currentRuntimeStatus;\n\t\t\t\tthis.activeLoader = this.createWorkingLoader();\n\t\t\t\tthis.host.statusContainer.addChild(this.activeLoader);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.activeLoader?.stop();\n\t\t\tthis.activeLoader = undefined;\n\t\t\tthis.host.statusContainer.clear();\n\t\t\tif (this.host.isStreaming() && this.workingVisible) {\n\t\t\t\tthis.host.activityLane?.start({\n\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: this.runtimeStatusLabel ?? this.getWorkingLoaderMessage(),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tthis.host.ui.requestRender();\n\t}\n\n\tsetHiddenThinkingLabel(label?: string): void {\n\t\tthis.hiddenThinkingLabel = label ?? this.defaultHiddenThinkingLabel;\n\t}\n\n\tupdateRuntimeStatus(message?: AssistantMessage): void {\n\t\tif (!this.host.hasHumanAudience) return;\n\t\tconst label = message\n\t\t\t? resolveHiddenThinkingStatus(\n\t\t\t\t\tmessage,\n\t\t\t\t\tthis.host.isThinkingHidden(),\n\t\t\t\t\tthis.hiddenThinkingLabel,\n\t\t\t\t\tthis.getWorkingLoaderMessage(),\n\t\t\t\t)\n\t\t\t: this.getWorkingLoaderMessage();\n\t\tthis.runtimeStatusLabel = applyRuntimeStatusLabel(\n\t\t\t{\n\t\t\t\thasHumanAudience: this.host.hasHumanAudience,\n\t\t\t\tcurrentLabel: this.runtimeStatusLabel,\n\t\t\t\tloadingAnimation: this.activeLoader,\n\t\t\t\tactivityLane: this.host.activityLane,\n\t\t\t\trequestRender: () => this.host.ui.requestRender(),\n\t\t\t},\n\t\t\tlabel,\n\t\t);\n\t}\n\n\tsetWorkingMessage(message: string | undefined, messageInFlight: AssistantMessage | undefined): void {\n\t\tthis.workingMessage = message;\n\t\tif (messageInFlight) {\n\t\t\tthis.updateRuntimeStatus(messageInFlight);\n\t\t\treturn;\n\t\t}\n\t\tif (this.activeLoader) {\n\t\t\tthis.activeLoader.setMessage(message ?? this.defaultWorkingMessage);\n\t\t}\n\t\tthis.host.activityLane?.update(\"runtime:turn\", message ?? this.defaultWorkingMessage);\n\t}\n\n\tresetWorkingIndicators(): void {\n\t\tthis.workingMessage = undefined;\n\t\tthis.workingVisible = this.host.hasHumanAudience;\n\t\tthis.setWorkingIndicator();\n\t\tif (this.activeLoader) {\n\t\t\tthis.activeLoader.setMessage(`${this.defaultWorkingMessage} (${keyText(\"app.interrupt\")} to interrupt)`);\n\t\t}\n\t\tthis.setHiddenThinkingLabel();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@caupulican/pi-ai";
|
|
2
|
+
export interface RuntimeStatusPresentation {
|
|
3
|
+
hasHumanAudience: boolean;
|
|
4
|
+
currentLabel: string | undefined;
|
|
5
|
+
loadingAnimation: {
|
|
6
|
+
setMessage(message: string): void;
|
|
7
|
+
} | undefined;
|
|
8
|
+
activityLane: {
|
|
9
|
+
update(id: string, label: string): void;
|
|
10
|
+
} | undefined;
|
|
11
|
+
requestRender(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function applyRuntimeStatusLabel(presentation: RuntimeStatusPresentation, label: string): string | undefined;
|
|
14
|
+
export declare function resolveHiddenThinkingStatus(message: AssistantMessage, hideThinkingBlock: boolean, hiddenThinkingLabel: string, workingLabel: string): string;
|
|
15
|
+
//# sourceMappingURL=runtime-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-status.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/runtime-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACzC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,gBAAgB,EAAE;QAAE,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IACpE,YAAY,EAAE;QAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IACtE,aAAa,IAAI,IAAI,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMlH;AAED,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,gBAAgB,EACzB,iBAAiB,EAAE,OAAO,EAC1B,mBAAmB,EAAE,MAAM,EAC3B,YAAY,EAAE,MAAM,GAClB,MAAM,CASR"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function applyRuntimeStatusLabel(presentation, label) {
|
|
2
|
+
if (!presentation.hasHumanAudience || presentation.currentLabel === label)
|
|
3
|
+
return presentation.currentLabel;
|
|
4
|
+
if (presentation.loadingAnimation)
|
|
5
|
+
presentation.loadingAnimation.setMessage(label);
|
|
6
|
+
else
|
|
7
|
+
presentation.activityLane?.update("runtime:turn", label);
|
|
8
|
+
presentation.requestRender();
|
|
9
|
+
return label;
|
|
10
|
+
}
|
|
11
|
+
export function resolveHiddenThinkingStatus(message, hideThinkingBlock, hiddenThinkingLabel, workingLabel) {
|
|
12
|
+
if (!hideThinkingBlock)
|
|
13
|
+
return workingLabel;
|
|
14
|
+
const hasThinking = message.content.some((content) => content.type === "thinking" && content.thinking.trim().length > 0);
|
|
15
|
+
const hasVisibleWork = message.content.some((content) => (content.type === "text" && content.text.trim().length > 0) || content.type === "toolCall");
|
|
16
|
+
return hasThinking && !hasVisibleWork ? hiddenThinkingLabel : workingLabel;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=runtime-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-status.js","sourceRoot":"","sources":["../../../src/modes/interactive/runtime-status.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,uBAAuB,CAAC,YAAuC,EAAE,KAAa;IAC7F,IAAI,CAAC,YAAY,CAAC,gBAAgB,IAAI,YAAY,CAAC,YAAY,KAAK,KAAK;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAC5G,IAAI,YAAY,CAAC,gBAAgB;QAAE,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;;QAC9E,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAC9D,YAAY,CAAC,aAAa,EAAE,CAAC;IAC7B,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,2BAA2B,CAC1C,OAAyB,EACzB,iBAA0B,EAC1B,mBAA2B,EAC3B,YAAoB;IAEpB,IAAI,CAAC,iBAAiB;QAAE,OAAO,YAAY,CAAC;IAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CACvC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAC9E,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAC1C,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,CACvG,CAAC;IACF,OAAO,WAAW,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY,CAAC;AAC5E,CAAC","sourcesContent":["import type { AssistantMessage } from \"@caupulican/pi-ai\";\n\nexport interface RuntimeStatusPresentation {\n\thasHumanAudience: boolean;\n\tcurrentLabel: string | undefined;\n\tloadingAnimation: { setMessage(message: string): void } | undefined;\n\tactivityLane: { update(id: string, label: string): void } | undefined;\n\trequestRender(): void;\n}\n\nexport function applyRuntimeStatusLabel(presentation: RuntimeStatusPresentation, label: string): string | undefined {\n\tif (!presentation.hasHumanAudience || presentation.currentLabel === label) return presentation.currentLabel;\n\tif (presentation.loadingAnimation) presentation.loadingAnimation.setMessage(label);\n\telse presentation.activityLane?.update(\"runtime:turn\", label);\n\tpresentation.requestRender();\n\treturn label;\n}\n\nexport function resolveHiddenThinkingStatus(\n\tmessage: AssistantMessage,\n\thideThinkingBlock: boolean,\n\thiddenThinkingLabel: string,\n\tworkingLabel: string,\n): string {\n\tif (!hideThinkingBlock) return workingLabel;\n\tconst hasThinking = message.content.some(\n\t\t(content) => content.type === \"thinking\" && content.thinking.trim().length > 0,\n\t);\n\tconst hasVisibleWork = message.content.some(\n\t\t(content) => (content.type === \"text\" && content.text.trim().length > 0) || content.type === \"toolCall\",\n\t);\n\treturn hasThinking && !hasVisibleWork ? hiddenThinkingLabel : workingLabel;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-selector-flow.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/settings-selector-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EACX,YAAY,EACZ,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-selector-flow.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/settings-selector-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EACX,YAAY,EACZ,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CA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+10,9 @@
|
|
|
10
10
|
import { getSupportedThinkingLevels } from "@caupulican/pi-ai";
|
|
11
11
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
12
12
|
import { resolveCliModel } from "../../core/model-resolver.js";
|
|
13
|
+
import { ActionTranscriptComponent } from "./components/action-transcript.js";
|
|
13
14
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
14
15
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
15
|
-
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
16
|
-
import { ToolGroupComponent } from "./components/tool-group.js";
|
|
17
16
|
import { getAvailableThemes, setTheme } from "./theme/theme.js";
|
|
18
17
|
export function showSettingsSelector(host) {
|
|
19
18
|
host.showSelector((done) => {
|
|
@@ -109,7 +108,7 @@ export function showSettingsSelector(host) {
|
|
|
109
108
|
onShowImagesChange: (enabled) => {
|
|
110
109
|
host.settingsManager.setShowImages(enabled);
|
|
111
110
|
for (const child of host.chatContainer.children) {
|
|
112
|
-
if (child instanceof
|
|
111
|
+
if (child instanceof ActionTranscriptComponent) {
|
|
113
112
|
child.setShowImages(enabled);
|
|
114
113
|
}
|
|
115
114
|
}
|
|
@@ -118,7 +117,7 @@ export function showSettingsSelector(host) {
|
|
|
118
117
|
onImageWidthCellsChange: (width) => {
|
|
119
118
|
host.settingsManager.setImageWidthCells(width);
|
|
120
119
|
for (const child of host.chatContainer.children) {
|
|
121
|
-
if (child instanceof
|
|
120
|
+
if (child instanceof ActionTranscriptComponent) {
|
|
122
121
|
child.setImageWidthCells(width);
|
|
123
122
|
}
|
|
124
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-selector-flow.js","sourceRoot":"","sources":["../../../src/modes/interactive/settings-selector-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAE,uBA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,CAAC,iBAAiB,CAAC,CAAC;gBACrC,CAAC;gBACD,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC7B,IAAI,CAAC,UAAU,CAAC,gCAAgC,KAAK,8CAA8C,CAAC,CAAC;YACtG,CAAC;YACD,gCAAgC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;gBACrD,IAAI,CAAC,eAAe,CAAC,mCAAmC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAC1E,IAAI,CAAC,UAAU,CAAC,2CAA2C,KAAK,GAAG,CAAC,CAAC;YACtE,CAAC;YACD,8BAA8B,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;gBACnD,IAAI,CAAC,eAAe,CAAC,0BAA0B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBACjE,IAAI,CAAC,UAAU,CAAC,8CAA8C,KAAK,GAAG,CAAC,CAAC;YACzE,CAAC;YACD,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE;gBAChC,IAAI,EAAE,CAAC;gBACP,KAAK,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;YAC5C,CAAC;YACD,QAAQ,EAAE,GAAG,EAAE;gBACd,IAAI,EAAE,CAAC;gBACP,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;YACzB,CAAC;SACD,CACD,CAAC;QACF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC;IACnE,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `/settings` selector flow extracted from interactive-mode.\n *\n * Builds the SettingsSelectorComponent model from the current settings/session\n * state and wires its change callbacks back through a `SettingsSelectorHost`\n * seam. Self-mod/auto-learn validation, autonomy-preset application, autocomplete\n * rebuild, and the resources-hub hand-off stay host-side (shared with other\n * flows); interactive-mode keeps a thin wrapper building the host once.\n */\n\nimport { getSupportedThinkingLevels } from \"@caupulican/pi-ai\";\nimport type { Component, Container, EditorComponent, SelectItem, TUI } from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport { configureHttpDispatcher, formatHttpIdleTimeoutMs } from \"../../core/http-dispatcher.ts\";\nimport { resolveCliModel } from \"../../core/model-resolver.ts\";\nimport type {\n\tAutonomyMode,\n\tSelfModificationSettings,\n\tSettingsManager,\n\tSettingsScope,\n} from \"../../core/settings-manager.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { SettingsSelectorComponent } from \"./components/settings-selector.ts\";\nimport { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { ToolGroupComponent } from \"./components/tool-group.ts\";\nimport { getAvailableThemes, setTheme } from \"./theme/theme.ts\";\n\nexport interface SettingsSelectorHost {\n\treadonly session: AgentSession;\n\treadonly settingsManager: SettingsManager;\n\treadonly footer: FooterComponent;\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n\treadonly defaultEditor: CustomEditor;\n\treadonly editor: EditorComponent;\n\thideThinkingBlock: boolean;\n\tshowSelector(create: (done: () => void) => { component: Component; focus: Component }): void;\n\tshowStatus(message: string): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\tgetAutoLearnModelOptions(): SelectItem[];\n\tsetupAutocompleteProvider(): void;\n\tupdateEditorBorderColor(): void;\n\trebuildChatFromMessages(): Promise<void>;\n\tvalidateSelfModificationSource(settings: SelfModificationSettings): string | undefined;\n\tapplyAutonomyMode(mode: AutonomyMode, scope?: SettingsScope): void;\n\tvalidateAutoLearnModelValue(value: string | undefined): string | undefined;\n\tupdateAutoLearnFooter(): void;\n\thandleResourcesHubAction(action: string): Promise<void>;\n}\n\nexport function showSettingsSelector(host: SettingsSelectorHost): void {\n\thost.showSelector((done) => {\n\t\tconst projectSettings = host.settingsManager.getProjectSettings();\n\t\tconst profileOptions = [\n\t\t\t{\n\t\t\t\tvalue: \"(none)\",\n\t\t\t\tlabel: \"(none)\",\n\t\t\t\tdescription: \"Use configured profile selection (session default)\",\n\t\t\t},\n\t\t\t...host.settingsManager\n\t\t\t\t.getProfileRegistry()\n\t\t\t\t.listProfiles()\n\t\t\t\t.map((profile) => ({\n\t\t\t\t\tvalue: profile.name,\n\t\t\t\t\tlabel: profile.name,\n\t\t\t\t\tdescription: profile.description ?? profile.source,\n\t\t\t\t})),\n\t\t];\n\t\tconst selector = new SettingsSelectorComponent(\n\t\t\t{\n\t\t\t\tautoCompact: host.session.autoCompactionEnabled,\n\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\tautoResizeImages: host.settingsManager.getImageAutoResize(),\n\t\t\t\tblockImages: host.settingsManager.getBlockImages(),\n\t\t\t\tenableSkillCommands: host.settingsManager.getEnableSkillCommands(),\n\t\t\t\tsteeringMode: host.session.steeringMode,\n\t\t\t\tfollowUpMode: host.session.followUpMode,\n\t\t\t\ttransport: host.settingsManager.getTransport(),\n\t\t\t\thttpIdleTimeoutMs: host.settingsManager.getHttpIdleTimeoutMs(),\n\t\t\t\tthinkingLevel: host.session.thinkingLevel,\n\t\t\t\tavailableThinkingLevels: host.session.getAvailableThinkingLevels(),\n\t\t\t\tcurrentTheme: host.settingsManager.getTheme() || \"dark\",\n\t\t\t\t// The picker offers only themes the active profile permits (no-bypass). The theme\n\t\t\t\t// registry/renderer keeps the full set, so an already-applied theme still renders\n\t\t\t\t// even if the profile would block re-selecting it.\n\t\t\t\tavailableThemes: getAvailableThemes().filter((name) =>\n\t\t\t\t\thost.settingsManager.isResourceAllowedByProfile(\"themes\", name),\n\t\t\t\t),\n\t\t\t\thideThinkingBlock: host.hideThinkingBlock,\n\t\t\t\tprojectContextFiles: host.settingsManager.getProjectContextFiles(),\n\t\t\t\tprojectContextFilesScope: host.settingsManager.getProjectContextFilesScope(),\n\t\t\t\tcollapseChangelog: host.settingsManager.getCollapseChangelog(),\n\t\t\t\tenableInstallTelemetry: host.settingsManager.getEnableInstallTelemetry(),\n\t\t\t\tdoubleEscapeAction: host.settingsManager.getDoubleEscapeAction(),\n\t\t\t\ttreeFilterMode: host.settingsManager.getTreeFilterMode(),\n\t\t\t\tshowHardwareCursor: host.settingsManager.getShowHardwareCursor(),\n\t\t\t\teditorPaddingX: host.settingsManager.getEditorPaddingX(),\n\t\t\t\tautocompleteMaxVisible: host.settingsManager.getAutocompleteMaxVisible(),\n\t\t\t\tquietStartup: host.settingsManager.getQuietStartup(),\n\t\t\t\tclearOnShrink: host.settingsManager.getClearOnShrink(),\n\t\t\t\tshowTerminalProgress: host.settingsManager.getShowTerminalProgress(),\n\t\t\t\twarnings: host.settingsManager.getWarnings(),\n\t\t\t\tselfModification: host.settingsManager.getSelfModificationSettings(),\n\t\t\t\tselfModificationScope: projectSettings.selfModification ? \"project\" : \"global\",\n\t\t\t\tautonomy: host.settingsManager.getAutonomySettings(),\n\t\t\t\tautonomyScope: projectSettings.autonomy ? \"project\" : \"global\",\n\t\t\t\tresearchLane: host.settingsManager.getResearchLaneSettings(),\n\t\t\t\tresearchLaneScope: projectSettings.researchLane ? \"project\" : \"global\",\n\t\t\t\tworkerDelegation: host.settingsManager.getWorkerDelegationSettings(),\n\t\t\t\tworkerDelegationScope: projectSettings.workerDelegation ? \"project\" : \"global\",\n\t\t\t\tcontextCuration: host.settingsManager.getContextCurationSettings(),\n\t\t\t\tcontextCurationScope: projectSettings.contextPolicy?.curation ? \"project\" : \"global\",\n\t\t\t\tlearningPolicy: host.settingsManager.getLearningPolicySettings(),\n\t\t\t\tlearningPolicyScope: projectSettings.learningPolicy ? \"project\" : \"global\",\n\t\t\t\tmodelCapability: host.settingsManager.getModelCapabilitySettings(),\n\t\t\t\tmodelCapabilityScope: projectSettings.modelCapability ? \"project\" : \"global\",\n\t\t\t\tmodelRouter: host.settingsManager.getModelRouterSettings(),\n\t\t\t\tmodelRouterScope: projectSettings.modelRouter ? \"project\" : \"global\",\n\t\t\t\tautoLearn: host.settingsManager.getAutoLearnSettings(),\n\t\t\t\tautoLearnScope: projectSettings.autoLearn ? \"project\" : \"global\",\n\t\t\t\tautoLearnModelOptions: host.getAutoLearnModelOptions(),\n\t\t\t\tresolveModelThinkingLevels: (modelPattern) => {\n\t\t\t\t\tif (!modelPattern) return host.session.getAvailableThinkingLevels();\n\t\t\t\t\tconst resolved = resolveCliModel({ cliModel: modelPattern, modelRegistry: host.session.modelRegistry });\n\t\t\t\t\treturn resolved.model ? getSupportedThinkingLevels(resolved.model) : undefined;\n\t\t\t\t},\n\t\t\t\tcontextPolicyEnforcement: host.settingsManager.getContextPromptEnforcementSettings(),\n\t\t\t\tcontextPolicyEnforcementScope: projectSettings.contextPolicy?.enforcement ? \"project\" : \"global\",\n\t\t\t\tcontextMemoryRetrieval: host.settingsManager.getMemoryRetrievalSettings(),\n\t\t\t\tcontextMemoryRetrievalScope: projectSettings.contextPolicy?.memory ? \"project\" : \"global\",\n\t\t\t\tcurrentModelPattern: host.session.model\n\t\t\t\t\t? `${host.session.model.provider}/${host.session.model.id}`\n\t\t\t\t\t: undefined,\n\t\t\t\tactiveProfileName: host.settingsManager.getActiveResourceProfileNames()[0],\n\t\t\t\tprofileOptions,\n\t\t\t\texternalResourceRoots: host.settingsManager.getExternalResourceRoots(),\n\t\t\t\ttrustedResourceRoots: host.settingsManager.getTrustedResourceRoots(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tonAutoCompactChange: (enabled) => {\n\t\t\t\t\thost.session.setAutoCompactionEnabled(enabled);\n\t\t\t\t\thost.footer.setAutoCompactEnabled(enabled);\n\t\t\t\t},\n\t\t\t\tonShowImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowImages(enabled);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setShowImages(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonImageWidthCellsChange: (width) => {\n\t\t\t\t\thost.settingsManager.setImageWidthCells(width);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {\n\t\t\t\t\t\t\tchild.setImageWidthCells(width);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonAutoResizeImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setImageAutoResize(enabled);\n\t\t\t\t},\n\t\t\t\tonBlockImagesChange: (blocked) => {\n\t\t\t\t\thost.settingsManager.setBlockImages(blocked);\n\t\t\t\t},\n\t\t\t\tonEnableSkillCommandsChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableSkillCommands(enabled);\n\t\t\t\t\thost.setupAutocompleteProvider();\n\t\t\t\t},\n\t\t\t\tonSteeringModeChange: (mode) => {\n\t\t\t\t\thost.session.setSteeringMode(mode);\n\t\t\t\t},\n\t\t\t\tonFollowUpModeChange: (mode) => {\n\t\t\t\t\thost.session.setFollowUpMode(mode);\n\t\t\t\t},\n\t\t\t\tonTransportChange: (transport) => {\n\t\t\t\t\thost.settingsManager.setTransport(transport);\n\t\t\t\t\thost.session.agent.transport = transport;\n\t\t\t\t},\n\t\t\t\tonHttpIdleTimeoutMsChange: (timeoutMs) => {\n\t\t\t\t\thost.settingsManager.setHttpIdleTimeoutMs(timeoutMs);\n\t\t\t\t\tconfigureHttpDispatcher(timeoutMs);\n\t\t\t\t\thost.showStatus(`HTTP idle timeout: ${formatHttpIdleTimeoutMs(timeoutMs)}`);\n\t\t\t\t},\n\t\t\t\tonThinkingLevelChange: (level) => {\n\t\t\t\t\thost.session.setThinkingLevel(level);\n\t\t\t\t\thost.footer.invalidate();\n\t\t\t\t\thost.updateEditorBorderColor();\n\t\t\t\t},\n\t\t\t\tonThemeChange: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\thost.settingsManager.setTheme(themeName);\n\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\tif (!result.success) {\n\t\t\t\t\t\thost.showError(`Failed to load theme \"${themeName}\": ${result.error}\\nFell back to dark theme.`);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonProjectContextFilesChange: (mode, scope) => {\n\t\t\t\t\thost.settingsManager.setProjectContextFiles(mode, scope);\n\t\t\t\t\tconst where =\n\t\t\t\t\t\tscope === \"directoryProfile\"\n\t\t\t\t\t\t\t? \"this directory\"\n\t\t\t\t\t\t\t: scope === \"project\"\n\t\t\t\t\t\t\t\t? \"this project\"\n\t\t\t\t\t\t\t\t: \"all projects\";\n\t\t\t\t\tconst load = mode === \"on-demand\" ? \"lists this project's AGENTS.md\" : \"global AGENTS.md only\";\n\t\t\t\t\thost.showStatus(`Project context files: ${load} (${where}). Run /reload to apply.`);\n\t\t\t\t},\n\t\t\t\tonHideThinkingBlockChange: (hidden) => {\n\t\t\t\t\thost.hideThinkingBlock = hidden;\n\t\t\t\t\thost.settingsManager.setHideThinkingBlock(hidden);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\t\t\t\t\tchild.setHideThinkingBlock(hidden);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvoid host.rebuildChatFromMessages();\n\t\t\t\t},\n\t\t\t\tonCollapseChangelogChange: (collapsed) => {\n\t\t\t\t\thost.settingsManager.setCollapseChangelog(collapsed);\n\t\t\t\t},\n\t\t\t\tonEnableInstallTelemetryChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableInstallTelemetry(enabled);\n\t\t\t\t},\n\t\t\t\tonQuietStartupChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setQuietStartup(enabled);\n\t\t\t\t},\n\t\t\t\tonDoubleEscapeActionChange: (action) => {\n\t\t\t\t\thost.settingsManager.setDoubleEscapeAction(action);\n\t\t\t\t},\n\t\t\t\tonTreeFilterModeChange: (mode) => {\n\t\t\t\t\thost.settingsManager.setTreeFilterMode(mode);\n\t\t\t\t},\n\t\t\t\tonShowHardwareCursorChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowHardwareCursor(enabled);\n\t\t\t\t\thost.ui.setShowHardwareCursor(enabled);\n\t\t\t\t},\n\t\t\t\tonEditorPaddingXChange: (padding) => {\n\t\t\t\t\thost.settingsManager.setEditorPaddingX(padding);\n\t\t\t\t\thost.defaultEditor.setPaddingX(padding);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setPaddingX !== undefined) {\n\t\t\t\t\t\thost.editor.setPaddingX(padding);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonAutocompleteMaxVisibleChange: (maxVisible) => {\n\t\t\t\t\thost.settingsManager.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\thost.defaultEditor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setAutocompleteMaxVisible !== undefined) {\n\t\t\t\t\t\thost.editor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonClearOnShrinkChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setClearOnShrink(enabled);\n\t\t\t\t\thost.ui.setClearOnShrink(enabled);\n\t\t\t\t},\n\t\t\t\tonShowTerminalProgressChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowTerminalProgress(enabled);\n\t\t\t\t},\n\t\t\t\tonWarningsChange: (warnings) => {\n\t\t\t\t\thost.settingsManager.setWarnings(warnings);\n\t\t\t\t},\n\t\t\t\tonSelfModificationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setSelfModificationSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateSelfModificationSource(settings);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Self modification settings saved to ${scope}. Start a new session or /reload for system-prompt guardrails to fully refresh.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonAutonomyChange: (settings, scope) => {\n\t\t\t\t\thost.applyAutonomyMode(settings.mode ?? \"off\", scope);\n\t\t\t\t\thost.showStatus(`Autonomy mode ${settings.mode ?? \"off\"} saved to ${scope}. Use /autonomy status.`);\n\t\t\t\t},\n\t\t\t\tonResearchLaneChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setResearchLaneSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Research lane settings saved to ${scope}. Use /autonomy research or /autonomy diagnostics.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonWorkerDelegationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setWorkerDelegationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Worker delegation settings saved to ${scope}. The delegate tool uses them.`);\n\t\t\t\t},\n\t\t\t\tonLearningPolicyChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setLearningPolicySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Learning policy saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonModelCapabilityChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelCapabilitySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Model capability mode saved to ${scope}. Applies on the next model switch or /reload.`);\n\t\t\t\t},\n\t\t\t\tonContextCurationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextCurationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Context curation settings saved to ${scope}. Run /fitness <model> first if the model is unprobed.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonModelRouterChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelRouterSettings(settings, scope);\n\t\t\t\t\tfor (const value of [settings.cheapModel, settings.expensiveModel, settings.learningModel]) {\n\t\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(value);\n\t\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\t\thost.showWarning(validationMessage.replace(\"Auto Learn model\", \"Model router model\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Model Router settings saved to ${scope}. Use /session or /usage to inspect routing.`);\n\t\t\t\t},\n\t\t\t\tonAutoLearnChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setAutoLearnSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(settings.model);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Auto Learn settings saved to ${scope}. Use /auto-learn status or /auto-learn run.`);\n\t\t\t\t},\n\t\t\t\tonContextPolicyEnforcementChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextPromptEnforcementSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/prompt-policy settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonContextMemoryRetrievalChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setMemoryRetrievalSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/memory-retrieval settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonResourcesHubAction: (action) => {\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid host.handleResourcesHubAction(action);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\treturn { component: selector, focus: selector.getSettingsList() };\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"settings-selector-flow.js","sourceRoot":"","sources":["../../../src/modes/interactive/settings-selector-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAO/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAG9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA0BhE,MAAM,UAAU,oBAAoB,CAAC,IAA0B;IAC9D,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;QAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,kBAAkB,EAAE,CAAC;QAClE,MAAM,cAAc,GAAG;YACtB;gBACC,KAAK,EAAE,QAAQ;gBACf,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,oDAAoD;aACjE;YACD,GAAG,IAAI,CAAC,eAAe;iBACrB,kBAAkB,EAAE;iBACpB,YAAY,EAAE;iBACd,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAClB,KAAK,EAAE,OAAO,CAAC,IAAI;gBACnB,KAAK,EAAE,OAAO,CAAC,IAAI;gBACnB,WAAW,EAAE,OAAO,CAAC,WAAW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AAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `/settings` selector flow extracted from interactive-mode.\n *\n * Builds the SettingsSelectorComponent model from the current settings/session\n * state and wires its change callbacks back through a `SettingsSelectorHost`\n * seam. Self-mod/auto-learn validation, autonomy-preset application, autocomplete\n * rebuild, and the resources-hub hand-off stay host-side (shared with other\n * flows); interactive-mode keeps a thin wrapper building the host once.\n */\n\nimport { getSupportedThinkingLevels } from \"@caupulican/pi-ai\";\nimport type { Component, Container, EditorComponent, SelectItem, TUI } from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport { configureHttpDispatcher, formatHttpIdleTimeoutMs } from \"../../core/http-dispatcher.ts\";\nimport { resolveCliModel } from \"../../core/model-resolver.ts\";\nimport type {\n\tAutonomyMode,\n\tSelfModificationSettings,\n\tSettingsManager,\n\tSettingsScope,\n} from \"../../core/settings-manager.ts\";\nimport { ActionTranscriptComponent } from \"./components/action-transcript.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { SettingsSelectorComponent } from \"./components/settings-selector.ts\";\nimport { getAvailableThemes, setTheme } from \"./theme/theme.ts\";\n\nexport interface SettingsSelectorHost {\n\treadonly session: AgentSession;\n\treadonly settingsManager: SettingsManager;\n\treadonly footer: FooterComponent;\n\treadonly chatContainer: Container;\n\treadonly ui: TUI;\n\treadonly defaultEditor: CustomEditor;\n\treadonly editor: EditorComponent;\n\thideThinkingBlock: boolean;\n\tshowSelector(create: (done: () => void) => { component: Component; focus: Component }): void;\n\tshowStatus(message: string): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\tgetAutoLearnModelOptions(): SelectItem[];\n\tsetupAutocompleteProvider(): void;\n\tupdateEditorBorderColor(): void;\n\trebuildChatFromMessages(): Promise<void>;\n\tvalidateSelfModificationSource(settings: SelfModificationSettings): string | undefined;\n\tapplyAutonomyMode(mode: AutonomyMode, scope?: SettingsScope): void;\n\tvalidateAutoLearnModelValue(value: string | undefined): string | undefined;\n\tupdateAutoLearnFooter(): void;\n\thandleResourcesHubAction(action: string): Promise<void>;\n}\n\nexport function showSettingsSelector(host: SettingsSelectorHost): void {\n\thost.showSelector((done) => {\n\t\tconst projectSettings = host.settingsManager.getProjectSettings();\n\t\tconst profileOptions = [\n\t\t\t{\n\t\t\t\tvalue: \"(none)\",\n\t\t\t\tlabel: \"(none)\",\n\t\t\t\tdescription: \"Use configured profile selection (session default)\",\n\t\t\t},\n\t\t\t...host.settingsManager\n\t\t\t\t.getProfileRegistry()\n\t\t\t\t.listProfiles()\n\t\t\t\t.map((profile) => ({\n\t\t\t\t\tvalue: profile.name,\n\t\t\t\t\tlabel: profile.name,\n\t\t\t\t\tdescription: profile.description ?? profile.source,\n\t\t\t\t})),\n\t\t];\n\t\tconst selector = new SettingsSelectorComponent(\n\t\t\t{\n\t\t\t\tautoCompact: host.session.autoCompactionEnabled,\n\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\tautoResizeImages: host.settingsManager.getImageAutoResize(),\n\t\t\t\tblockImages: host.settingsManager.getBlockImages(),\n\t\t\t\tenableSkillCommands: host.settingsManager.getEnableSkillCommands(),\n\t\t\t\tsteeringMode: host.session.steeringMode,\n\t\t\t\tfollowUpMode: host.session.followUpMode,\n\t\t\t\ttransport: host.settingsManager.getTransport(),\n\t\t\t\thttpIdleTimeoutMs: host.settingsManager.getHttpIdleTimeoutMs(),\n\t\t\t\tthinkingLevel: host.session.thinkingLevel,\n\t\t\t\tavailableThinkingLevels: host.session.getAvailableThinkingLevels(),\n\t\t\t\tcurrentTheme: host.settingsManager.getTheme() || \"dark\",\n\t\t\t\t// The picker offers only themes the active profile permits (no-bypass). The theme\n\t\t\t\t// registry/renderer keeps the full set, so an already-applied theme still renders\n\t\t\t\t// even if the profile would block re-selecting it.\n\t\t\t\tavailableThemes: getAvailableThemes().filter((name) =>\n\t\t\t\t\thost.settingsManager.isResourceAllowedByProfile(\"themes\", name),\n\t\t\t\t),\n\t\t\t\thideThinkingBlock: host.hideThinkingBlock,\n\t\t\t\tprojectContextFiles: host.settingsManager.getProjectContextFiles(),\n\t\t\t\tprojectContextFilesScope: host.settingsManager.getProjectContextFilesScope(),\n\t\t\t\tcollapseChangelog: host.settingsManager.getCollapseChangelog(),\n\t\t\t\tenableInstallTelemetry: host.settingsManager.getEnableInstallTelemetry(),\n\t\t\t\tdoubleEscapeAction: host.settingsManager.getDoubleEscapeAction(),\n\t\t\t\ttreeFilterMode: host.settingsManager.getTreeFilterMode(),\n\t\t\t\tshowHardwareCursor: host.settingsManager.getShowHardwareCursor(),\n\t\t\t\teditorPaddingX: host.settingsManager.getEditorPaddingX(),\n\t\t\t\tautocompleteMaxVisible: host.settingsManager.getAutocompleteMaxVisible(),\n\t\t\t\tquietStartup: host.settingsManager.getQuietStartup(),\n\t\t\t\tclearOnShrink: host.settingsManager.getClearOnShrink(),\n\t\t\t\tshowTerminalProgress: host.settingsManager.getShowTerminalProgress(),\n\t\t\t\twarnings: host.settingsManager.getWarnings(),\n\t\t\t\tselfModification: host.settingsManager.getSelfModificationSettings(),\n\t\t\t\tselfModificationScope: projectSettings.selfModification ? \"project\" : \"global\",\n\t\t\t\tautonomy: host.settingsManager.getAutonomySettings(),\n\t\t\t\tautonomyScope: projectSettings.autonomy ? \"project\" : \"global\",\n\t\t\t\tresearchLane: host.settingsManager.getResearchLaneSettings(),\n\t\t\t\tresearchLaneScope: projectSettings.researchLane ? \"project\" : \"global\",\n\t\t\t\tworkerDelegation: host.settingsManager.getWorkerDelegationSettings(),\n\t\t\t\tworkerDelegationScope: projectSettings.workerDelegation ? \"project\" : \"global\",\n\t\t\t\tcontextCuration: host.settingsManager.getContextCurationSettings(),\n\t\t\t\tcontextCurationScope: projectSettings.contextPolicy?.curation ? \"project\" : \"global\",\n\t\t\t\tlearningPolicy: host.settingsManager.getLearningPolicySettings(),\n\t\t\t\tlearningPolicyScope: projectSettings.learningPolicy ? \"project\" : \"global\",\n\t\t\t\tmodelCapability: host.settingsManager.getModelCapabilitySettings(),\n\t\t\t\tmodelCapabilityScope: projectSettings.modelCapability ? \"project\" : \"global\",\n\t\t\t\tmodelRouter: host.settingsManager.getModelRouterSettings(),\n\t\t\t\tmodelRouterScope: projectSettings.modelRouter ? \"project\" : \"global\",\n\t\t\t\tautoLearn: host.settingsManager.getAutoLearnSettings(),\n\t\t\t\tautoLearnScope: projectSettings.autoLearn ? \"project\" : \"global\",\n\t\t\t\tautoLearnModelOptions: host.getAutoLearnModelOptions(),\n\t\t\t\tresolveModelThinkingLevels: (modelPattern) => {\n\t\t\t\t\tif (!modelPattern) return host.session.getAvailableThinkingLevels();\n\t\t\t\t\tconst resolved = resolveCliModel({ cliModel: modelPattern, modelRegistry: host.session.modelRegistry });\n\t\t\t\t\treturn resolved.model ? getSupportedThinkingLevels(resolved.model) : undefined;\n\t\t\t\t},\n\t\t\t\tcontextPolicyEnforcement: host.settingsManager.getContextPromptEnforcementSettings(),\n\t\t\t\tcontextPolicyEnforcementScope: projectSettings.contextPolicy?.enforcement ? \"project\" : \"global\",\n\t\t\t\tcontextMemoryRetrieval: host.settingsManager.getMemoryRetrievalSettings(),\n\t\t\t\tcontextMemoryRetrievalScope: projectSettings.contextPolicy?.memory ? \"project\" : \"global\",\n\t\t\t\tcurrentModelPattern: host.session.model\n\t\t\t\t\t? `${host.session.model.provider}/${host.session.model.id}`\n\t\t\t\t\t: undefined,\n\t\t\t\tactiveProfileName: host.settingsManager.getActiveResourceProfileNames()[0],\n\t\t\t\tprofileOptions,\n\t\t\t\texternalResourceRoots: host.settingsManager.getExternalResourceRoots(),\n\t\t\t\ttrustedResourceRoots: host.settingsManager.getTrustedResourceRoots(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tonAutoCompactChange: (enabled) => {\n\t\t\t\t\thost.session.setAutoCompactionEnabled(enabled);\n\t\t\t\t\thost.footer.setAutoCompactEnabled(enabled);\n\t\t\t\t},\n\t\t\t\tonShowImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowImages(enabled);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ActionTranscriptComponent) {\n\t\t\t\t\t\t\tchild.setShowImages(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonImageWidthCellsChange: (width) => {\n\t\t\t\t\thost.settingsManager.setImageWidthCells(width);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof ActionTranscriptComponent) {\n\t\t\t\t\t\t\tchild.setImageWidthCells(width);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t\tonAutoResizeImagesChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setImageAutoResize(enabled);\n\t\t\t\t},\n\t\t\t\tonBlockImagesChange: (blocked) => {\n\t\t\t\t\thost.settingsManager.setBlockImages(blocked);\n\t\t\t\t},\n\t\t\t\tonEnableSkillCommandsChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableSkillCommands(enabled);\n\t\t\t\t\thost.setupAutocompleteProvider();\n\t\t\t\t},\n\t\t\t\tonSteeringModeChange: (mode) => {\n\t\t\t\t\thost.session.setSteeringMode(mode);\n\t\t\t\t},\n\t\t\t\tonFollowUpModeChange: (mode) => {\n\t\t\t\t\thost.session.setFollowUpMode(mode);\n\t\t\t\t},\n\t\t\t\tonTransportChange: (transport) => {\n\t\t\t\t\thost.settingsManager.setTransport(transport);\n\t\t\t\t\thost.session.agent.transport = transport;\n\t\t\t\t},\n\t\t\t\tonHttpIdleTimeoutMsChange: (timeoutMs) => {\n\t\t\t\t\thost.settingsManager.setHttpIdleTimeoutMs(timeoutMs);\n\t\t\t\t\tconfigureHttpDispatcher(timeoutMs);\n\t\t\t\t\thost.showStatus(`HTTP idle timeout: ${formatHttpIdleTimeoutMs(timeoutMs)}`);\n\t\t\t\t},\n\t\t\t\tonThinkingLevelChange: (level) => {\n\t\t\t\t\thost.session.setThinkingLevel(level);\n\t\t\t\t\thost.footer.invalidate();\n\t\t\t\t\thost.updateEditorBorderColor();\n\t\t\t\t},\n\t\t\t\tonThemeChange: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\thost.settingsManager.setTheme(themeName);\n\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\tif (!result.success) {\n\t\t\t\t\t\thost.showError(`Failed to load theme \"${themeName}\": ${result.error}\\nFell back to dark theme.`);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tconst result = setTheme(themeName, true);\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\thost.ui.invalidate();\n\t\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonProjectContextFilesChange: (mode, scope) => {\n\t\t\t\t\thost.settingsManager.setProjectContextFiles(mode, scope);\n\t\t\t\t\tconst where =\n\t\t\t\t\t\tscope === \"directoryProfile\"\n\t\t\t\t\t\t\t? \"this directory\"\n\t\t\t\t\t\t\t: scope === \"project\"\n\t\t\t\t\t\t\t\t? \"this project\"\n\t\t\t\t\t\t\t\t: \"all projects\";\n\t\t\t\t\tconst load = mode === \"on-demand\" ? \"lists this project's AGENTS.md\" : \"global AGENTS.md only\";\n\t\t\t\t\thost.showStatus(`Project context files: ${load} (${where}). Run /reload to apply.`);\n\t\t\t\t},\n\t\t\t\tonHideThinkingBlockChange: (hidden) => {\n\t\t\t\t\thost.hideThinkingBlock = hidden;\n\t\t\t\t\thost.settingsManager.setHideThinkingBlock(hidden);\n\t\t\t\t\tfor (const child of host.chatContainer.children) {\n\t\t\t\t\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\t\t\t\t\tchild.setHideThinkingBlock(hidden);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvoid host.rebuildChatFromMessages();\n\t\t\t\t},\n\t\t\t\tonCollapseChangelogChange: (collapsed) => {\n\t\t\t\t\thost.settingsManager.setCollapseChangelog(collapsed);\n\t\t\t\t},\n\t\t\t\tonEnableInstallTelemetryChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setEnableInstallTelemetry(enabled);\n\t\t\t\t},\n\t\t\t\tonQuietStartupChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setQuietStartup(enabled);\n\t\t\t\t},\n\t\t\t\tonDoubleEscapeActionChange: (action) => {\n\t\t\t\t\thost.settingsManager.setDoubleEscapeAction(action);\n\t\t\t\t},\n\t\t\t\tonTreeFilterModeChange: (mode) => {\n\t\t\t\t\thost.settingsManager.setTreeFilterMode(mode);\n\t\t\t\t},\n\t\t\t\tonShowHardwareCursorChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowHardwareCursor(enabled);\n\t\t\t\t\thost.ui.setShowHardwareCursor(enabled);\n\t\t\t\t},\n\t\t\t\tonEditorPaddingXChange: (padding) => {\n\t\t\t\t\thost.settingsManager.setEditorPaddingX(padding);\n\t\t\t\t\thost.defaultEditor.setPaddingX(padding);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setPaddingX !== undefined) {\n\t\t\t\t\t\thost.editor.setPaddingX(padding);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonAutocompleteMaxVisibleChange: (maxVisible) => {\n\t\t\t\t\thost.settingsManager.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\thost.defaultEditor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\tif (host.editor !== host.defaultEditor && host.editor.setAutocompleteMaxVisible !== undefined) {\n\t\t\t\t\t\thost.editor.setAutocompleteMaxVisible(maxVisible);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonClearOnShrinkChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setClearOnShrink(enabled);\n\t\t\t\t\thost.ui.setClearOnShrink(enabled);\n\t\t\t\t},\n\t\t\t\tonShowTerminalProgressChange: (enabled) => {\n\t\t\t\t\thost.settingsManager.setShowTerminalProgress(enabled);\n\t\t\t\t},\n\t\t\t\tonWarningsChange: (warnings) => {\n\t\t\t\t\thost.settingsManager.setWarnings(warnings);\n\t\t\t\t},\n\t\t\t\tonSelfModificationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setSelfModificationSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateSelfModificationSource(settings);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Self modification settings saved to ${scope}. Start a new session or /reload for system-prompt guardrails to fully refresh.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonAutonomyChange: (settings, scope) => {\n\t\t\t\t\thost.applyAutonomyMode(settings.mode ?? \"off\", scope);\n\t\t\t\t\thost.showStatus(`Autonomy mode ${settings.mode ?? \"off\"} saved to ${scope}. Use /autonomy status.`);\n\t\t\t\t},\n\t\t\t\tonResearchLaneChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setResearchLaneSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Research lane settings saved to ${scope}. Use /autonomy research or /autonomy diagnostics.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonWorkerDelegationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setWorkerDelegationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Worker delegation settings saved to ${scope}. The delegate tool uses them.`);\n\t\t\t\t},\n\t\t\t\tonLearningPolicyChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setLearningPolicySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Learning policy saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonModelCapabilityChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelCapabilitySettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Model capability mode saved to ${scope}. Applies on the next model switch or /reload.`);\n\t\t\t\t},\n\t\t\t\tonContextCurationChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextCurationSettings(settings, scope);\n\t\t\t\t\thost.showStatus(\n\t\t\t\t\t\t`Context curation settings saved to ${scope}. Run /fitness <model> first if the model is unprobed.`,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonModelRouterChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setModelRouterSettings(settings, scope);\n\t\t\t\t\tfor (const value of [settings.cheapModel, settings.expensiveModel, settings.learningModel]) {\n\t\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(value);\n\t\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\t\thost.showWarning(validationMessage.replace(\"Auto Learn model\", \"Model router model\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Model Router settings saved to ${scope}. Use /session or /usage to inspect routing.`);\n\t\t\t\t},\n\t\t\t\tonAutoLearnChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setAutoLearnSettings(settings, scope);\n\t\t\t\t\tconst validationMessage = host.validateAutoLearnModelValue(settings.model);\n\t\t\t\t\tif (validationMessage) {\n\t\t\t\t\t\thost.showWarning(validationMessage);\n\t\t\t\t\t}\n\t\t\t\t\thost.updateAutoLearnFooter();\n\t\t\t\t\thost.showStatus(`Auto Learn settings saved to ${scope}. Use /auto-learn status or /auto-learn run.`);\n\t\t\t\t},\n\t\t\t\tonContextPolicyEnforcementChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setContextPromptEnforcementSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/prompt-policy settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonContextMemoryRetrievalChange: (settings, scope) => {\n\t\t\t\t\thost.settingsManager.setMemoryRetrievalSettings(settings, scope);\n\t\t\t\t\thost.showStatus(`Context/memory-retrieval settings saved to ${scope}.`);\n\t\t\t\t},\n\t\t\t\tonResourcesHubAction: (action) => {\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid host.handleResourcesHubAction(action);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\thost.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\treturn { component: selector, focus: selector.getSettingsList() };\n\t});\n}\n"]}
|
|
@@ -7,9 +7,9 @@ UI type: dense keyboard-first terminal tool. Phase: transient-status consolidati
|
|
|
7
7
|
1. Task, goal, worker, routing, retry, compaction, queue, and tool progress used separate transcript, footer, widget, and loader paths. This duplicated truth and polluted scrollback. They now project into one event-driven horizontal line immediately above the editor.
|
|
8
8
|
2. Completed work needed feedback without becoming permanent history. The lane uses a muted active dot, holds green/red terminal feedback for two seconds, then removes it by timer event.
|
|
9
9
|
3. Resumed state could replay old terminal work as new. Session replacement primes terminal identities without displaying them; only later transitions flash.
|
|
10
|
-
4.
|
|
10
|
+
4. Tool history still used separate Bash, file, skill, task, goal, worker, and extension summaries. Every model tool invocation now contributes once to one append-only `Performing N actions` / `Performed N actions` transcript row; Ctrl+T retains the structured detail.
|
|
11
11
|
5. A terminal process did not prove a human was watching. `--session-mode user|worker` feeds the authoritative session-role contract; unattended workers do not receive approval UI, extension TUI context, widgets, footer, loaders, or activity-lane routing.
|
|
12
|
-
6. Loading session history still invoked collapsed tool-result renderers and image conversion.
|
|
12
|
+
6. Loading session history still invoked collapsed tool-result renderers and image conversion. The collapsed action transcript does not invoke per-tool renderers; retained results stay behind their payload accessor until expansion, and collapse releases the display cache.
|
|
13
13
|
|
|
14
14
|
## Acceptance battery
|
|
15
15
|
|
|
@@ -20,8 +20,8 @@ UI type: dense keyboard-first terminal tool. Phase: transient-status consolidati
|
|
|
20
20
|
| State clarity | PASS | Glyph plus text plus semantic theme color; status is never color-only. |
|
|
21
21
|
| Completion lifecycle | PASS | Event/timer driven; success/failure disappears after a bounded hold. |
|
|
22
22
|
| Resume correctness | PASS | Existing terminal identities are primed and do not replay. |
|
|
23
|
-
| History cleanliness | PASS |
|
|
24
|
-
| Failure honesty | PASS |
|
|
23
|
+
| History cleanliness | PASS | One action counter replaces category-specific cards; retained tool-result payloads are not read or rendered until Ctrl+T expands the transcript. |
|
|
24
|
+
| Failure honesty | PASS | Failed calls remain counted and marked on the action row; details stay in the transcript, while operational warnings use the transient activity lane. |
|
|
25
25
|
| Audience isolation | PASS | Worker role disables human UI capability and does not mount transient visual surfaces. |
|
|
26
26
|
| Focus and interruption | PASS | The lane never captures focus; cancellation remains on the existing interrupt binding. |
|
|
27
27
|
|
package/docs/extensions.md
CHANGED
|
@@ -2149,7 +2149,7 @@ By default, tool output is wrapped in a `Box` that handles padding and backgroun
|
|
|
2149
2149
|
|
|
2150
2150
|
Set `renderShell: "self"` when the tool should render its own shell instead of using the default `Box`. This is useful for tools that need complete control over framing or background behavior, for example large previews that must stay visually stable after the tool settles.
|
|
2151
2151
|
|
|
2152
|
-
Adjacent tool calls
|
|
2152
|
+
Adjacent model-invoked tool calls use one append-only transcript row. While calls are active it shows `Performing N actions`; after they settle it shows `Performed N actions`. Each call contributes exactly once, including pending and failed calls; later calls append and never reuse or replace earlier action history. The collapsed row hides tool details, including custom renderers; press Ctrl+T to expand the transcript and view each call's details.
|
|
2153
2153
|
|
|
2154
2154
|
```typescript
|
|
2155
2155
|
pi.registerTool({
|
|
@@ -2173,8 +2173,6 @@ pi.registerTool({
|
|
|
2173
2173
|
- `lastComponent` - the previously returned component for that slot, if any
|
|
2174
2174
|
- `invalidate()` - request a rerender of this tool row
|
|
2175
2175
|
- `toolCallId`, `cwd`, `executionStarted`, `argsComplete`, `isPartial`, `expanded`, `showImages`, `isError`
|
|
2176
|
-
- `toolGroupSummary` - true when `renderCall` is rendering a collapsed grouped-panel summary; avoid adding per-row expand hints in this mode
|
|
2177
|
-
|
|
2178
2176
|
Use `context.state` for cross-slot shared state. Keep slot-local caches on the returned component instance when you want to reuse and mutate the same component across renders.
|
|
2179
2177
|
|
|
2180
2178
|
#### renderCall
|
|
@@ -2224,18 +2222,12 @@ If a slot intentionally has no visible content, return an empty `Component` such
|
|
|
2224
2222
|
|
|
2225
2223
|
#### Keybinding Hints
|
|
2226
2224
|
|
|
2227
|
-
Use `keyHint()` to display keybinding hints that respect the active keybinding configuration:
|
|
2225
|
+
Use `keyHint()` to display keybinding hints that respect the active keybinding configuration. Tool renderers must not add their own expansion hint: the collapsed action transcript owns the Ctrl+T hint and does not invoke per-tool renderers.
|
|
2228
2226
|
|
|
2229
2227
|
```typescript
|
|
2230
2228
|
import { keyHint } from "@caupulican/pi-adaptative";
|
|
2231
2229
|
|
|
2232
|
-
|
|
2233
|
-
let text = theme.fg("success", "✓ Done");
|
|
2234
|
-
if (!expanded) {
|
|
2235
|
-
text += ` (${keyHint("app.tools.expand", "to expand")})`;
|
|
2236
|
-
}
|
|
2237
|
-
return new Text(text, 0, 0);
|
|
2238
|
-
}
|
|
2230
|
+
const confirmHint = keyHint("tui.select.confirm", "to confirm");
|
|
2239
2231
|
```
|
|
2240
2232
|
|
|
2241
2233
|
Available functions:
|
|
@@ -2244,7 +2236,7 @@ Available functions:
|
|
|
2244
2236
|
- `rawKeyHint(key, description)` - Format a raw key string
|
|
2245
2237
|
|
|
2246
2238
|
Use namespaced keybinding ids:
|
|
2247
|
-
- Coding-agent ids use the `app.*` namespace, for example `app.
|
|
2239
|
+
- Coding-agent ids use the `app.*` namespace, for example `app.transcript.open`, `app.editor.external`, `app.session.rename`
|
|
2248
2240
|
- Shared TUI ids use the `tui.*` namespace, for example `tui.select.confirm`, `tui.select.cancel`, `tui.input.tab`
|
|
2249
2241
|
|
|
2250
2242
|
For the exhaustive list of keybinding ids and defaults, see [keybindings.md](keybindings.md). `keybindings.json` uses those same namespaced ids.
|
package/docs/json.md
CHANGED
|
@@ -62,7 +62,7 @@ Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://gi
|
|
|
62
62
|
Each line is a JSON object. The first line is the session header:
|
|
63
63
|
|
|
64
64
|
```json
|
|
65
|
-
{"type":"session","version":
|
|
65
|
+
{"type":"session","version":4,"id":"uuid","timestamp":"...","cwd":"/path"}
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
Followed by events as they occur:
|
package/docs/keybindings.md
CHANGED
|
@@ -122,13 +122,14 @@ These actions apply while the built-in `ask_question` interaction has focus. The
|
|
|
122
122
|
| `app.model.cycleForward` | `ctrl+p` | Cycle to next model |
|
|
123
123
|
| `app.model.cycleBackward` | `shift+ctrl+p` | Cycle to previous model |
|
|
124
124
|
| `app.thinking.cycle` | `shift+tab` | Cycle thinking level |
|
|
125
|
-
| `app.thinking.toggle` | `
|
|
125
|
+
| `app.thinking.toggle` | `shift+pageUp` | Show or hide thinking blocks (hidden by default) |
|
|
126
126
|
|
|
127
127
|
### Display and Message Queue
|
|
128
128
|
|
|
129
129
|
| Keybinding id | Default | Description |
|
|
130
130
|
|--------|---------|-------------|
|
|
131
|
-
| `app.tools.expand` | `ctrl+o` | Expand or collapse
|
|
131
|
+
| `app.tools.expand` | `ctrl+o` | Expand or collapse non-action inline details |
|
|
132
|
+
| `app.transcript.open` | `ctrl+t` | Open transcript scrollback with action details expanded |
|
|
132
133
|
| `app.history.load` | `ctrl+shift+h` | Load deferred session history into the chat |
|
|
133
134
|
| `app.message.followUp` | `alt+enter` | Queue follow-up message |
|
|
134
135
|
| `app.message.dequeue` | `alt+up` | Restore queued messages to editor |
|