@timurproko/a1 0.2.7-dev.810 → 0.2.7-dev.828
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/bin/automatic-update.js +7 -0
- package/bin/tab-launch-context.d.ts +1 -0
- package/bin/tab-launch-context.js +3 -3
- package/bin/ui.js +96 -66
- package/dist/app/session-shell/resident-tab-coordinator.d.ts +6 -9
- package/dist/app/session-shell/resident-tab-coordinator.js +9 -52
- package/dist/app/session-shell/session-shell-root.d.ts +14 -8
- package/dist/app/session-shell/session-shell-root.js +9 -5
- package/dist/app/session-shell/session-shell.js +70 -20
- package/dist/app/session-shell/session-viewport-controller.js +6 -4
- package/dist/app/session-shell/shell-host.js +6 -3
- package/dist/app/session-shell/transcript-document.js +1 -1
- package/dist/cli/tabs.d.ts +1 -1
- package/dist/cli/tabs.js +10 -14
- package/dist/composition/owned-settings.d.ts +12 -0
- package/dist/composition/owned-settings.js +36 -0
- package/dist/composition/owned-ui.d.ts +5 -14
- package/dist/composition/owned-ui.js +93 -64
- package/dist/composition/resident-tab-bridge.d.ts +10 -1
- package/dist/composition/resident-tab-bridge.js +21 -0
- package/dist/composition/settings-route-host.d.ts +12 -2
- package/dist/composition/settings-route-host.js +27 -9
- package/dist/composition/settings-search-input.d.ts +9 -0
- package/dist/composition/settings-search-input.js +58 -0
- package/dist/composition/utility-tab.d.ts +28 -0
- package/dist/composition/utility-tab.js +242 -0
- package/dist/contracts/owned-ui/session-backend.d.ts +2 -0
- package/dist/contracts/owned-ui/session-workflows.d.ts +7 -3
- package/dist/contracts/presentation/index.d.ts +11 -0
- package/dist/contracts/presentation/index.js +12 -0
- package/dist/features/launch/development-launch.js +6 -0
- package/dist/features/launch/profile-paths.js +4 -0
- package/dist/features/owned-ui/plus-menu-dialog.d.ts +22 -0
- package/dist/features/owned-ui/plus-menu-dialog.js +76 -0
- package/dist/features/owned-ui/project-trust-dialog.d.ts +1 -1
- package/dist/features/owned-ui/project-trust-dialog.js +6 -8
- package/dist/features/owned-ui/project-trust-prompt.d.ts +1 -0
- package/dist/features/owned-ui/project-trust-prompt.js +7 -3
- package/dist/features/owned-ui/reference-screen-app.d.ts +2 -0
- package/dist/features/owned-ui/reference-screen-app.js +12 -2
- package/dist/features/owned-ui/settings-app.d.ts +10 -3
- package/dist/features/owned-ui/settings-app.js +98 -45
- package/dist/features/owned-ui/settings-search-input.d.ts +29 -0
- package/dist/features/owned-ui/settings-search-input.js +1 -0
- package/dist/features/prompt-history/index.d.ts +1 -1
- package/dist/features/prompt-history/paths.d.ts +2 -1
- package/dist/features/prompt-history/paths.js +10 -2
- package/dist/features/prompt-history/service.d.ts +5 -0
- package/dist/features/prompt-history/service.js +1 -1
- package/dist/features/resident-tab/shortcut-declarations.d.ts +1 -1
- package/dist/features/resident-tab/shortcut-declarations.js +2 -0
- package/dist/foundation/launch-context/index.d.ts +2 -0
- package/dist/foundation/launch-context/index.js +1 -0
- package/dist/foundation/lifecycle/session-repository-context.js +16 -2
- package/dist/foundation/release/automatic-update.d.ts +37 -0
- package/dist/foundation/release/automatic-update.js +265 -0
- package/dist/foundation/release/bootstrap.d.ts +1 -9
- package/dist/foundation/release/bootstrap.js +7 -3
- package/dist/foundation/release/early-accent.d.ts +12 -0
- package/dist/foundation/release/early-accent.js +59 -0
- package/dist/foundation/release/index.d.ts +1 -1
- package/dist/foundation/release/index.js +1 -1
- package/dist/foundation/release/latest-release.d.ts +3 -2
- package/dist/foundation/release/latest-release.js +1 -1
- package/dist/foundation/release/progress-palette.generated.d.ts +137 -3
- package/dist/foundation/release/progress-palette.generated.js +137 -3
- package/dist/foundation/release/release-gc.js +19 -4
- package/dist/foundation/release/update-execution-lease.d.ts +36 -0
- package/dist/foundation/release/update-execution-lease.js +145 -0
- package/dist/foundation/release/update.d.ts +9 -7
- package/dist/foundation/release/update.js +244 -175
- package/dist/foundation/resident-tabs/bridge-client.d.ts +10 -3
- package/dist/foundation/resident-tabs/bridge-client.js +20 -8
- package/dist/foundation/resident-tabs/maintenance.d.ts +2 -6
- package/dist/foundation/resident-tabs/maintenance.js +5 -23
- package/dist/foundation/resident-tabs/progress-observation-schema.d.ts +34 -0
- package/dist/foundation/resident-tabs/progress-observation-schema.js +1 -0
- package/dist/foundation/resident-tabs/progress-observation.d.ts +3 -6
- package/dist/foundation/resident-tabs/progress-observation.js +43 -12
- package/dist/foundation/resident-tabs/release-holds.js +3 -14
- package/dist/foundation/resident-tabs/routes.d.ts +5 -0
- package/dist/foundation/resident-tabs/routes.js +5 -0
- package/dist/foundation/resident-tabs/settings.d.ts +0 -1
- package/dist/foundation/resident-tabs/settings.js +0 -2
- package/dist/integrations/pi/components/editor-interaction.d.ts +2 -0
- package/dist/integrations/pi/components/modal-frame.d.ts +17 -1
- package/dist/integrations/pi/components/modal-frame.js +48 -9
- package/dist/integrations/pi/components/models-dialog.js +4 -52
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +3 -0
- package/dist/integrations/pi/components/owned-editor-ux.js +75 -4
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +57 -37
- package/dist/integrations/pi/components/shell-footer-status.js +19 -3
- package/dist/integrations/pi/components/shell-presenters-transcript.js +4 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +4 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +9 -2
- package/dist/integrations/pi/components/skills-dialog.js +2 -2
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +7 -5
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +15 -8
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +3 -3
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +2 -2
- package/dist/integrations/pi/components/upstream/components/session-footer.js +26 -23
- package/dist/integrations/pi/components/upstream/components/session-selector.js +7 -6
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +7 -6
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +9 -8
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +6 -4
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +8 -8
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +10 -10
- package/dist/integrations/pi/components/upstream/history/editor-core.js +2 -0
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +2 -0
- package/dist/integrations/pi/components/upstream/theme/theme.js +5 -1
- package/dist/integrations/pi/engine/adapter.js +7 -2
- package/dist/integrations/pi/engine/offline-settings-port.d.ts +23 -0
- package/dist/integrations/pi/engine/offline-settings-port.js +53 -0
- package/dist/integrations/pi/engine/ports.d.ts +1 -1
- package/dist/integrations/pi/engine/ports.js +4 -0
- package/dist/integrations/pi/engine/settings-bridge.d.ts +5 -0
- package/dist/integrations/pi/engine/settings-bridge.js +13 -0
- package/dist/integrations/pi/engine/settings-port.js +1 -14
- package/dist/integrations/pi/engine/workflow-runner.js +9 -2
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/darwin-arm64/terminal-host.manifest.json +3 -3
- package/dist/native/darwin-arm64/terminal-host.node +0 -0
- package/dist/native/darwin-x64/manifest.json +1 -1
- package/dist/native/darwin-x64/terminal-host.manifest.json +3 -3
- package/dist/native/darwin-x64/terminal-host.node +0 -0
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/linux-x64/terminal-host.manifest.json +3 -3
- package/dist/native/linux-x64/terminal-host.node +0 -0
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.node +0 -0
- package/dist/native/win32-x64/terminal-host.manifest.json +3 -3
- package/dist/native/win32-x64/terminal-host.node +0 -0
- package/dist/product-identity.d.ts +1 -1
- package/dist/product-identity.js +2 -2
- package/dist/product-identity.json +2 -0
- package/dist/ui/apps/host.d.ts +2 -0
- package/dist/ui/apps/host.js +7 -1
- package/dist/ui/components/dialog-panel.js +35 -30
- package/dist/ui/components/line-input.d.ts +3 -0
- package/dist/ui/components/line-input.js +3 -1
- package/dist/ui/components/prompt-input.d.ts +5 -4
- package/dist/ui/components/prompt-input.js +8 -6
- package/dist/ui/components/spans.js +2 -2
- package/dist/ui/components/submitted-prompt.d.ts +2 -2
- package/dist/ui/components/submitted-prompt.js +3 -3
- package/dist/ui/components/surface.js +4 -2
- package/dist/ui/components/text.d.ts +3 -6
- package/dist/ui/components/text.js +6 -8
- package/dist/ui/components/transcript-viewport.d.ts +1 -1
- package/dist/ui/components/transcript-viewport.js +141 -24
- package/dist/ui/settings/declarations.d.ts +67 -17
- package/dist/ui/settings/declarations.js +47 -15
- package/dist/ui/settings/early-accent.d.ts +81 -0
- package/dist/ui/settings/early-accent.js +50 -0
- package/dist/ui/settings/manager.js +7 -3
- package/dist/ui/settings/migrations.js +22 -0
- package/dist/ui/settings/progress-palette.generated.d.ts +139 -0
- package/dist/ui/settings/progress-palette.generated.js +139 -0
- package/dist/ui/settings/sections.d.ts +4 -0
- package/dist/ui/settings/sections.js +9 -3
- package/docs/architecture/resident-tabs.md +52 -21
- package/docs/architecture/tool-image-presentation.md +2 -1
- package/docs/features/prompt-history.md +41 -20
- package/docs/validation.md +25 -5
- package/package.json +1 -1
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/footer.ts.
|
|
4
|
-
* Modifications:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* surfaces may suppress a thinking level they already present; a resident tab whose chip already shows
|
|
9
|
-
* the session name may suppress its path-row suffix.
|
|
10
|
-
* Deviations: owned-status-level-color, owned-pull-request-badge, owned-resident-session-name.
|
|
4
|
+
* Modifications: Owned UI/routing; A1 level color, linked PRs, resident names, dim ellipsis and model
|
|
5
|
+
* priority; Pi unchanged.
|
|
6
|
+
* Deviations: owned-status-level-color, owned-pull-request-badge, owned-resident-session-name,
|
|
7
|
+
* owned-footer-ellipsis, owned-footer-model-priority.
|
|
11
8
|
*/
|
|
12
9
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
13
10
|
import { hyperlink, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
@@ -31,6 +28,7 @@ export class SessionFooter {
|
|
|
31
28
|
const view = this.getView();
|
|
32
29
|
const usage = view.status.usage;
|
|
33
30
|
const theme = piTheme();
|
|
31
|
+
const dimEllipsis = theme.fg("dim", this.profile === "a1" ? "…" : "...");
|
|
34
32
|
const input = usage?.input ?? 0;
|
|
35
33
|
const output = usage?.output ?? 0;
|
|
36
34
|
const cacheRead = usage?.cacheRead ?? 0;
|
|
@@ -38,8 +36,8 @@ export class SessionFooter {
|
|
|
38
36
|
const cost = usage?.cost ?? 0;
|
|
39
37
|
const contextWindow = usage?.contextWindow ?? 0;
|
|
40
38
|
const contextPercentValue = usage?.contextPercent ?? 0;
|
|
41
|
-
const
|
|
42
|
-
|
|
39
|
+
const contextPercent = usage?.contextAvailable !== false && usage?.contextPercent === null
|
|
40
|
+
? "?" : contextPercentValue.toFixed(1);
|
|
43
41
|
const repositoryPath = this.profile === "a1" ? view.status.footer?.repositoryPath ?? this.cwd : this.cwd;
|
|
44
42
|
let pwd = formatCwd(repositoryPath, process.env.HOME || process.env.USERPROFILE);
|
|
45
43
|
const branch = view.status.footer?.branch;
|
|
@@ -48,7 +46,7 @@ export class SessionFooter {
|
|
|
48
46
|
const sessionName = this.showSessionName ? view.status.footer?.sessionName : null;
|
|
49
47
|
const pullRequest = this.profile === "a1" ? view.status.footer?.pullRequest : null;
|
|
50
48
|
let pathRow;
|
|
51
|
-
if (pullRequest
|
|
49
|
+
if (pullRequest == null) {
|
|
52
50
|
pathRow = theme.fg("dim", sessionName ? `${pwd} • ${sessionName}` : pwd);
|
|
53
51
|
}
|
|
54
52
|
else {
|
|
@@ -59,12 +57,10 @@ export class SessionFooter {
|
|
|
59
57
|
if (visibleWidth(full) <= width)
|
|
60
58
|
pathRow = full;
|
|
61
59
|
else if (visibleWidth(badge) <= width) {
|
|
62
|
-
|
|
63
|
-
const path = pathWidth === 0 ? "" : truncateToWidth(theme.fg("dim", pwd), pathWidth, theme.fg("dim", "..."));
|
|
64
|
-
pathRow = path + badge;
|
|
60
|
+
pathRow = truncateToWidth(theme.fg("dim", pwd), width - visibleWidth(badge), dimEllipsis) + badge;
|
|
65
61
|
}
|
|
66
62
|
else {
|
|
67
|
-
pathRow = truncateToWidth(badge, width,
|
|
63
|
+
pathRow = truncateToWidth(badge, width, dimEllipsis);
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
const parts = [];
|
|
@@ -88,7 +84,7 @@ export class SessionFooter {
|
|
|
88
84
|
let left = parts.join(" ");
|
|
89
85
|
let leftWidth = visibleWidth(left);
|
|
90
86
|
if (leftWidth > width) {
|
|
91
|
-
left = truncateToWidth(left, width, "...");
|
|
87
|
+
left = truncateToWidth(left, width, this.profile === "a1" ? dimEllipsis : "...");
|
|
92
88
|
leftWidth = visibleWidth(left);
|
|
93
89
|
}
|
|
94
90
|
const modelName = view.activeModel?.modelId ?? "no-model";
|
|
@@ -96,6 +92,7 @@ export class SessionFooter {
|
|
|
96
92
|
? view.activeModel === null || !this.show() ? theme.fg("dim", modelName)
|
|
97
93
|
: theme.fg("dim", `${modelName} • `) + theme.getThinkingBorderColor(view.thinkingLevel)(view.thinkingLevel)
|
|
98
94
|
: view.activeModel === null || view.thinkingLevel === "off" || !this.show() ? modelName : `${modelName} • ${view.thinkingLevel}`;
|
|
95
|
+
const modelLevel = rightWithoutProvider;
|
|
99
96
|
const routed = view.routedModel;
|
|
100
97
|
if (routed) {
|
|
101
98
|
const level = routed.thinkingLevel === undefined ? "" : ` • ${routed.thinkingLevel}`;
|
|
@@ -109,9 +106,18 @@ export class SessionFooter {
|
|
|
109
106
|
if (leftWidth + 2 + visibleWidth(right) > width)
|
|
110
107
|
right = rightWithoutProvider;
|
|
111
108
|
}
|
|
109
|
+
if (this.profile === "a1" && leftWidth + 2 + visibleWidth(right) > width) {
|
|
110
|
+
right = [rightWithoutProvider, modelLevel].find(value => visibleWidth(value) + 2 <= width)
|
|
111
|
+
?? truncateToWidth(theme.fg("dim", modelName), width, dimEllipsis);
|
|
112
|
+
left = truncateToWidth(left, Math.max(0, width - visibleWidth(right) - 2), dimEllipsis);
|
|
113
|
+
leftWidth = visibleWidth(left);
|
|
114
|
+
}
|
|
112
115
|
const rightWidth = visibleWidth(right);
|
|
113
116
|
let line;
|
|
114
|
-
if (
|
|
117
|
+
if (this.profile === "a1" && leftWidth === 0) {
|
|
118
|
+
line = " ".repeat(Math.max(0, width - rightWidth)) + right;
|
|
119
|
+
}
|
|
120
|
+
else if (leftWidth + 2 + rightWidth <= width) {
|
|
115
121
|
line = left + " ".repeat(width - leftWidth - rightWidth) + right;
|
|
116
122
|
}
|
|
117
123
|
else {
|
|
@@ -124,13 +130,13 @@ export class SessionFooter {
|
|
|
124
130
|
line = left;
|
|
125
131
|
}
|
|
126
132
|
const lines = [
|
|
127
|
-
truncateToWidth(pathRow, width,
|
|
133
|
+
truncateToWidth(pathRow, width, dimEllipsis),
|
|
128
134
|
theme.fg("dim", left) + (this.profile === "a1" ? line.slice(left.length) : theme.fg("dim", line.slice(left.length))),
|
|
129
135
|
];
|
|
130
136
|
const statuses = view.status.footer?.extensionStatuses ?? [];
|
|
131
137
|
if (statuses.length > 0) {
|
|
132
138
|
const status = [...statuses].sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey)).map(([, text]) => sanitize(text)).join(" ");
|
|
133
|
-
lines.push(truncateToWidth(status, width,
|
|
139
|
+
lines.push(truncateToWidth(status, width, dimEllipsis));
|
|
134
140
|
}
|
|
135
141
|
return lines;
|
|
136
142
|
}
|
|
@@ -150,11 +156,8 @@ function formatTokens(count) {
|
|
|
150
156
|
function formatCwd(cwd, home) {
|
|
151
157
|
if (!home)
|
|
152
158
|
return cwd;
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
const relativeToHome = relative(resolvedHome, resolvedCwd);
|
|
156
|
-
const inside = relativeToHome === "" || (relativeToHome !== ".." && !relativeToHome.startsWith(`..${sep}`) && !isAbsolute(relativeToHome));
|
|
157
|
-
if (!inside)
|
|
159
|
+
const relativeToHome = relative(resolve(home), resolve(cwd));
|
|
160
|
+
if (isAbsolute(relativeToHome) || relativeToHome === ".." || relativeToHome.startsWith(`..${sep}`))
|
|
158
161
|
return cwd;
|
|
159
162
|
return relativeToHome === "" ? "~" : `~${sep}${relativeToHome}`;
|
|
160
163
|
}
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
* keybindings/theme, canonical path handling, reverse-Tab scope cycling, and the shared bare-A1 modal
|
|
8
8
|
* frame with standalone title, standard outer rules, stable filter/status row, progressive result
|
|
9
9
|
* paging, aligned result columns, Session Tree selection roles, quiet in-field query syntax guidance,
|
|
10
|
-
* and one-line bottom dynamic feedback and searchable-dialog shortcut
|
|
11
|
-
* use the blue selection surface while preserving title and metadata
|
|
12
|
-
* title uses success green independently of keyboard selection, with
|
|
10
|
+
* an accent dialog-search marker, and one-line bottom dynamic feedback and searchable-dialog shortcut
|
|
11
|
+
* footer. Selected session rows use the blue selection surface while preserving title and metadata
|
|
12
|
+
* foregrounds; the active session title uses success green independently of keyboard selection, with
|
|
13
|
+
* ordinary text weight.
|
|
13
14
|
* Deviations: owned-modal-shortcut-hints, owned-resume-session-dialog,
|
|
14
|
-
* owned-standard-dialog-selection.
|
|
15
|
+
* owned-standard-dialog-selection, owned-dialog-search-marker.
|
|
15
16
|
*/
|
|
16
17
|
import { spawnSync } from "node:child_process";
|
|
17
18
|
import { existsSync, realpathSync } from "node:fs";
|
|
@@ -20,7 +21,7 @@ import * as os from "node:os";
|
|
|
20
21
|
import { Container, getKeybindings, Input, matchesKey, sliceByColumn, Spacer, Text, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
|
|
21
22
|
import { KeybindingsManager } from "../adjacent/core/keybindings.js";
|
|
22
23
|
import { DynamicBorder } from "../../../startup-public.js";
|
|
23
|
-
import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
|
|
24
|
+
import { addPiModalHeader, adoptPiModalFrame, renderPiModalSearchInput } from "../../modal-frame.js";
|
|
24
25
|
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
25
26
|
const theme = new Proxy({}, {
|
|
26
27
|
get(_target, property) {
|
|
@@ -408,7 +409,7 @@ class SessionList {
|
|
|
408
409
|
render(width) {
|
|
409
410
|
const lines = [];
|
|
410
411
|
// Render search input
|
|
411
|
-
lines.push(...this.searchInput
|
|
412
|
+
lines.push(...renderPiModalSearchInput(this.searchInput, width));
|
|
412
413
|
lines.push(""); // Blank line after search
|
|
413
414
|
if (this.filteredSessions.length === 0) {
|
|
414
415
|
let emptyMessage;
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
* levels, and rendering exclusive radio-style default markers before level names, an item-adjacent
|
|
9
9
|
* active checkmark, and aligned muted descriptions. Bare A1 persists defaults immediately on Space,
|
|
10
10
|
* closes through the implicit Ctrl+C-capable selection-cancel action, and uses the shared compact
|
|
11
|
-
* semantic shortcut row with Type/search guidance
|
|
12
|
-
* colors use the owned theme and its explicit color mode. Selected rows use
|
|
13
|
-
* selection surface only around the rendered item span, with the existing
|
|
14
|
-
* level, and preserved current/default/description roles. The comparison
|
|
15
|
-
* pinned component.
|
|
11
|
+
* semantic shortcut row with Type/search guidance and an accent search marker without advertising that
|
|
12
|
+
* alias. All list and border colors use the owned theme and its explicit color mode. Selected rows use
|
|
13
|
+
* the shared bare-A1 blue selection surface only around the rendered item span, with the existing
|
|
14
|
+
* accent arrow, normal-text level, and preserved current/default/description roles. The comparison
|
|
15
|
+
* profile retains the public pinned component.
|
|
16
16
|
* Deviations: owned-modal-shortcut-hints, owned-level-cycle-shortcut, owned-thinking-selector-heading,
|
|
17
|
-
* owned-thinking-selector-controls, owned-dialog-ctrl-c-cancel, owned-standard-dialog-selection
|
|
17
|
+
* owned-thinking-selector-controls, owned-dialog-ctrl-c-cancel, owned-standard-dialog-selection,
|
|
18
|
+
* owned-dialog-search-marker.
|
|
18
19
|
*/
|
|
19
20
|
import { Container, type Focusable, SelectList } from "@earendil-works/pi-tui";
|
|
20
21
|
export type ThinkingSelectorLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
@@ -8,17 +8,18 @@
|
|
|
8
8
|
* levels, and rendering exclusive radio-style default markers before level names, an item-adjacent
|
|
9
9
|
* active checkmark, and aligned muted descriptions. Bare A1 persists defaults immediately on Space,
|
|
10
10
|
* closes through the implicit Ctrl+C-capable selection-cancel action, and uses the shared compact
|
|
11
|
-
* semantic shortcut row with Type/search guidance
|
|
12
|
-
* colors use the owned theme and its explicit color mode. Selected rows use
|
|
13
|
-
* selection surface only around the rendered item span, with the existing
|
|
14
|
-
* level, and preserved current/default/description roles. The comparison
|
|
15
|
-
* pinned component.
|
|
11
|
+
* semantic shortcut row with Type/search guidance and an accent search marker without advertising that
|
|
12
|
+
* alias. All list and border colors use the owned theme and its explicit color mode. Selected rows use
|
|
13
|
+
* the shared bare-A1 blue selection surface only around the rendered item span, with the existing
|
|
14
|
+
* accent arrow, normal-text level, and preserved current/default/description roles. The comparison
|
|
15
|
+
* profile retains the public pinned component.
|
|
16
16
|
* Deviations: owned-modal-shortcut-hints, owned-level-cycle-shortcut, owned-thinking-selector-heading,
|
|
17
|
-
* owned-thinking-selector-controls, owned-dialog-ctrl-c-cancel, owned-standard-dialog-selection
|
|
17
|
+
* owned-thinking-selector-controls, owned-dialog-ctrl-c-cancel, owned-standard-dialog-selection,
|
|
18
|
+
* owned-dialog-search-marker.
|
|
18
19
|
*/
|
|
19
20
|
import { Container, fuzzyFilter, getKeybindings, Input, SelectList, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
20
21
|
import { DynamicBorder } from "../../../startup-public.js";
|
|
21
|
-
import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
|
|
22
|
+
import { addPiModalHeader, addPiModalSearchInput, adoptPiModalFrame } from "../../modal-frame.js";
|
|
22
23
|
import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalListRow, renderPiModalShortcutHints } from "../../theme.js";
|
|
23
24
|
const THINKING_SELECT_LIST_LAYOUT = {
|
|
24
25
|
minPrimaryColumnWidth: 12,
|
|
@@ -88,7 +89,7 @@ export class OwnedThinkingSelectorComponent extends Container {
|
|
|
88
89
|
this.addChild(new Spacer(1));
|
|
89
90
|
this.searchInput = new Input();
|
|
90
91
|
this.searchInput.onSubmit = () => this.selectList.handleInput("\r");
|
|
91
|
-
|
|
92
|
+
addPiModalSearchInput(this, this.searchInput);
|
|
92
93
|
this.addChild(new Spacer(1));
|
|
93
94
|
const initialList = this.buildSelectList(this.allItems, currentLevel);
|
|
94
95
|
this.selectList = initialList.list;
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/tool-execution.ts.
|
|
4
4
|
* Modifications: Retain pinned shell/public renderers. Own image conversion; replace private APIs with
|
|
5
5
|
* public/local equivalents. Use bare-A1 secondary-accent read ranges and concise collapse shortcut
|
|
6
|
-
* hints. Restore the enclosing default-shell background after nested renderer resets.
|
|
6
|
+
* hints. Restore the enclosing default-shell background after nested renderer resets. Omit
|
|
7
|
+
* non-actionable image fallback rows when the terminal has no image protocol. See
|
|
7
8
|
* docs/architecture/tool-image-presentation.md.
|
|
8
9
|
* Deviations: current-tool-image-conversion-ownership, read-range-secondary-accent,
|
|
9
|
-
* concise-tool-expand-shortcut-hint, default-shell-background-reset-scoping
|
|
10
|
+
* concise-tool-expand-shortcut-hint, default-shell-background-reset-scoping,
|
|
11
|
+
* unsupported-image-fallback-omission.
|
|
10
12
|
*/
|
|
11
13
|
import { stripVTControlCharacters } from "node:util";
|
|
12
|
-
import { Box, Container,
|
|
14
|
+
import { Box, Container, getImageDimensions, imageFallback, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
|
|
13
15
|
import { createReadToolDefinition, createBashToolDefinition, createEditToolDefinition, createWriteToolDefinition, createGrepToolDefinition, createFindToolDefinition, createLsToolDefinition, keyHint, keyText, } from "../../../startup-public.js";
|
|
14
16
|
import { renderPiModalShortcutHints } from "../../theme.js";
|
|
15
17
|
import { isPiAccentProjectionEnabled, piTheme } from "../theme/theme.js";
|
|
@@ -379,7 +381,7 @@ export class ToolExecutionComponent extends Container {
|
|
|
379
381
|
if (!this.result)
|
|
380
382
|
return "";
|
|
381
383
|
const text = this.result.content.filter(part => part.type === "text").map(part => stripVTControlCharacters(part.text ?? "").replace(/[\u0000-\u0008\u000b-\u001f\ufff9-\ufffb]/gu, "")).join("\n");
|
|
382
|
-
if (
|
|
384
|
+
if (this.showImages)
|
|
383
385
|
return text;
|
|
384
386
|
const indicators = this.result.content.filter(part => part.type === "image").map(part => imageFallback(part.mimeType ?? "image/unknown", part.data && part.mimeType ? getImageDimensions(part.data, part.mimeType) ?? undefined : undefined)).join("\n");
|
|
385
387
|
return text && indicators ? `${text}\n${indicators}` : text || indicators;
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* Modifications: Port remaps public types/components plus owned keybindings/theme helpers while
|
|
5
5
|
* preserving tree behavior; bare A1 uses compact modal chrome and label editing, four-mode
|
|
6
6
|
* Models-style filter status with Tab/Shift+Tab directional cycling and concise all-first presentation
|
|
7
|
-
* excluding internal bookkeeping, standard search input, blue full-row menu-arrow
|
|
8
|
-
* preserves per-entry semantic foregrounds and has no path bullets, accent entry
|
|
9
|
-
* timestamps, numeric result counters without duplicate label-time status, and a
|
|
10
|
-
* shortcut, semantic role colors with session naming for the system root,
|
|
11
|
-
* paging/first-last/non-root containing-branch folding keys with a permanently expanded
|
|
12
|
-
* entry even behind hidden metadata, single-character ellipses on both clipped edges
|
|
13
|
-
* bracket-delimiter preservation and selected-fragment highlighting, and Models-ordered semantic
|
|
7
|
+
* excluding internal bookkeeping, a standard accent-marked search input, blue full-row menu-arrow
|
|
8
|
+
* selection that preserves per-entry semantic foregrounds and has no path bullets, accent entry
|
|
9
|
+
* labels, bracketed timestamps, numeric result counters without duplicate label-time status, and a
|
|
10
|
+
* stateful time on/off shortcut, semantic role colors with session naming for the system root,
|
|
11
|
+
* standard paging/first-last/non-root containing-branch folding keys with a permanently expanded
|
|
12
|
+
* system session entry even behind hidden metadata, single-character ellipses on both clipped edges
|
|
13
|
+
* with bracket-delimiter preservation and selected-fragment highlighting, and Models-ordered semantic
|
|
14
14
|
* Type/search shortcut footers without a redundant select hint.
|
|
15
|
-
* Deviations: owned-modal-shortcut-hints, owned-session-tree-dialog.
|
|
15
|
+
* Deviations: owned-modal-shortcut-hints, owned-session-tree-dialog, owned-dialog-search-marker.
|
|
16
16
|
*/
|
|
17
17
|
import { type Component, Container, type Focusable } from "@earendil-works/pi-tui";
|
|
18
18
|
import { type SessionTreeNode } from "@earendil-works/pi-coding-agent";
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
* Modifications: Port remaps public types/components plus owned keybindings/theme helpers while
|
|
5
5
|
* preserving tree behavior; bare A1 uses compact modal chrome and label editing, four-mode
|
|
6
6
|
* Models-style filter status with Tab/Shift+Tab directional cycling and concise all-first presentation
|
|
7
|
-
* excluding internal bookkeeping, standard search input, blue full-row menu-arrow
|
|
8
|
-
* preserves per-entry semantic foregrounds and has no path bullets, accent entry
|
|
9
|
-
* timestamps, numeric result counters without duplicate label-time status, and a
|
|
10
|
-
* shortcut, semantic role colors with session naming for the system root,
|
|
11
|
-
* paging/first-last/non-root containing-branch folding keys with a permanently expanded
|
|
12
|
-
* entry even behind hidden metadata, single-character ellipses on both clipped edges
|
|
13
|
-
* bracket-delimiter preservation and selected-fragment highlighting, and Models-ordered semantic
|
|
7
|
+
* excluding internal bookkeeping, a standard accent-marked search input, blue full-row menu-arrow
|
|
8
|
+
* selection that preserves per-entry semantic foregrounds and has no path bullets, accent entry
|
|
9
|
+
* labels, bracketed timestamps, numeric result counters without duplicate label-time status, and a
|
|
10
|
+
* stateful time on/off shortcut, semantic role colors with session naming for the system root,
|
|
11
|
+
* standard paging/first-last/non-root containing-branch folding keys with a permanently expanded
|
|
12
|
+
* system session entry even behind hidden metadata, single-character ellipses on both clipped edges
|
|
13
|
+
* with bracket-delimiter preservation and selected-fragment highlighting, and Models-ordered semantic
|
|
14
14
|
* Type/search shortcut footers without a redundant select hint.
|
|
15
|
-
* Deviations: owned-modal-shortcut-hints, owned-session-tree-dialog.
|
|
15
|
+
* Deviations: owned-modal-shortcut-hints, owned-session-tree-dialog, owned-dialog-search-marker.
|
|
16
16
|
*/
|
|
17
17
|
import { Container, Input, matchesKey, Spacer, sliceByColumn, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui";
|
|
18
18
|
import { DynamicBorder, formatReadLineRange } from "../../../startup-public.js";
|
|
19
19
|
import { KeybindingsManager } from "../adjacent/core/keybindings.js";
|
|
20
|
-
import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
|
|
20
|
+
import { addPiModalHeader, adoptPiModalFrame, renderPiModalSearchInput } from "../../modal-frame.js";
|
|
21
21
|
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
22
22
|
const theme = new Proxy({}, {
|
|
23
23
|
get(_target, property) {
|
|
@@ -1077,7 +1077,7 @@ class TreeSearchInput {
|
|
|
1077
1077
|
this.input.handleInput(query);
|
|
1078
1078
|
this.renderedQuery = query;
|
|
1079
1079
|
}
|
|
1080
|
-
return this.input
|
|
1080
|
+
return renderPiModalSearchInput(this.input, width);
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
1083
|
/** Models-style summary of the active tree filter. */
|
|
@@ -287,6 +287,8 @@ export class HistoryEditorCore {
|
|
|
287
287
|
delete this.onHistoryChange; };
|
|
288
288
|
},
|
|
289
289
|
reset: () => this.resetHistoryBrowsing(),
|
|
290
|
+
restoreDraft: () => { while (this.historyIndex >= 0)
|
|
291
|
+
this.navigateHistory(1); },
|
|
290
292
|
};
|
|
291
293
|
persistentHistory = false;
|
|
292
294
|
styleHistoryLabel;
|
|
@@ -43,6 +43,8 @@ export interface PiAccentProjection {
|
|
|
43
43
|
readonly selectedBg: Color;
|
|
44
44
|
readonly userMessageBg: Color;
|
|
45
45
|
}
|
|
46
|
+
/** Canonical named color used by both the interactive theme and pre-load palette generation. */
|
|
47
|
+
export declare function namedPiAccent(color: UiAccentColor, appearance: PiTerminalTheme): Color;
|
|
46
48
|
/** Derive the complete semantic family from any primary accent, including future custom colors. */
|
|
47
49
|
export declare function derivePiAccentProjection(accent: Color, appearance: PiTerminalTheme): PiAccentProjection;
|
|
48
50
|
declare let packageBorderProjectionEnabled: boolean;
|
|
@@ -46,6 +46,10 @@ const ACCENT_PALETTE = Object.freeze({
|
|
|
46
46
|
orange: Object.freeze({ dark: okhslColor(48, 0.75, 0.67), light: okhslColor(48, 0.90, 0.47) }),
|
|
47
47
|
pink: Object.freeze({ dark: okhslColor(337, 0.72, 0.67), light: okhslColor(337, 0.75, 0.48) }),
|
|
48
48
|
});
|
|
49
|
+
/** Canonical named color used by both the interactive theme and pre-load palette generation. */
|
|
50
|
+
export function namedPiAccent(color, appearance) {
|
|
51
|
+
return ACCENT_PALETTE[color][appearance];
|
|
52
|
+
}
|
|
49
53
|
function clamp(value, minimum, maximum) {
|
|
50
54
|
return Math.max(minimum, Math.min(maximum, value));
|
|
51
55
|
}
|
|
@@ -75,7 +79,7 @@ let activeBaseTheme;
|
|
|
75
79
|
let activeTheme;
|
|
76
80
|
let activeThemeName;
|
|
77
81
|
let activeThemeMode;
|
|
78
|
-
let activeAccentColor = "
|
|
82
|
+
let activeAccentColor = "blue";
|
|
79
83
|
let packageBorderProjectionEnabled = true;
|
|
80
84
|
let themeWatcher;
|
|
81
85
|
let themeReloadTimer;
|
|
@@ -211,8 +211,13 @@ export class PiEngineAdapter {
|
|
|
211
211
|
#announceReleaseUpdate(release) {
|
|
212
212
|
if (this.#disposed)
|
|
213
213
|
return;
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
if (release.status === "installed") {
|
|
215
|
+
this.#addDiagnostic("info", "release-update-installed", `Update ${release.version} installed; restart to update.`, true);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
const changelog = release.changelogUrl === null ? "" : `\nChangelog: ${release.changelogUrl}`;
|
|
219
|
+
this.#addDiagnostic("info", "release-update", `New version ${release.version} is available. Run ${release.command}${changelog}`, true);
|
|
220
|
+
}
|
|
216
221
|
this.#emitView();
|
|
217
222
|
}
|
|
218
223
|
suggestionReasoningPolicy() {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { resolvePiProjectTrustPreflight } from "./project-trust-preflight.js";
|
|
2
|
+
import { PiSettingsBridge, type PiSettingKey } from "./settings-bridge.js";
|
|
3
|
+
import { ModelRuntime, SettingsManager } from "../startup-public.js";
|
|
4
|
+
export interface OfflinePiSettingsPortOptions {
|
|
5
|
+
readonly cwd: string;
|
|
6
|
+
readonly agentDir: string;
|
|
7
|
+
readonly resolveTrust?: typeof resolvePiProjectTrustPreflight;
|
|
8
|
+
readonly createSettingsManager?: (cwd: string, agentDir: string, projectTrusted: boolean) => SettingsManager;
|
|
9
|
+
readonly createModelRuntime?: (options: Parameters<typeof ModelRuntime.create>[0]) => Promise<Pick<ModelRuntime, "getAvailableSnapshot">>;
|
|
10
|
+
}
|
|
11
|
+
export interface OfflinePiSettingsPort {
|
|
12
|
+
readonly port: PiSettingsBridge;
|
|
13
|
+
readonly manager: SettingsManager;
|
|
14
|
+
/** Resolves after the local auth/model catalog has populated the per-model choices. */
|
|
15
|
+
readonly modelsReady: Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Pi settings for the resident Settings utility tab. It reads the same persisted manager as an
|
|
19
|
+
* Agent, but every bound live effect is persistence-only because each Agent process owns its effect.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createOfflinePiSettingsPort(options: OfflinePiSettingsPortOptions): Promise<OfflinePiSettingsPort>;
|
|
22
|
+
/** Keys the slim Settings port intentionally binds and exposes in bare mode. */
|
|
23
|
+
export declare function offlinePiSettingKeys(): readonly PiSettingKey[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { resolvePiProjectTrustPreflight } from "./project-trust-preflight.js";
|
|
3
|
+
import { PI_SETTING_EFFECTS, PiSettingsBridge, supportedThinkingLevels, } from "./settings-bridge.js";
|
|
4
|
+
import { ModelRuntime, SettingsManager } from "../startup-public.js";
|
|
5
|
+
const PERSIST_ONLY_OWNERS = ["shell", "startup", "agent", "terminal"];
|
|
6
|
+
/**
|
|
7
|
+
* Pi settings for the resident Settings utility tab. It reads the same persisted manager as an
|
|
8
|
+
* Agent, but every bound live effect is persistence-only because each Agent process owns its effect.
|
|
9
|
+
*/
|
|
10
|
+
export async function createOfflinePiSettingsPort(options) {
|
|
11
|
+
let modelRuntime = null;
|
|
12
|
+
const createModelRuntime = options.createModelRuntime ?? (input => ModelRuntime.create(input));
|
|
13
|
+
const modelsReady = createModelRuntime({
|
|
14
|
+
authPath: join(options.agentDir, "auth.json"),
|
|
15
|
+
modelsPath: join(options.agentDir, "models.json"),
|
|
16
|
+
allowModelNetwork: false,
|
|
17
|
+
}).then(runtime => { modelRuntime = runtime; }, () => undefined);
|
|
18
|
+
const trust = await (options.resolveTrust ?? resolvePiProjectTrustPreflight)({
|
|
19
|
+
cwd: options.cwd,
|
|
20
|
+
agentDir: options.agentDir,
|
|
21
|
+
});
|
|
22
|
+
const manager = (options.createSettingsManager
|
|
23
|
+
?? ((cwd, agentDir, projectTrusted) => SettingsManager.create(cwd, agentDir, { projectTrusted })))(options.cwd, options.agentDir, trust.trusted);
|
|
24
|
+
const port = new PiSettingsBridge(manager, {
|
|
25
|
+
productMode: "bare",
|
|
26
|
+
models: () => modelChoices(modelRuntime?.getAvailableSnapshot() ?? [], manager.getAllModelThinkingLevels?.() ?? {}),
|
|
27
|
+
});
|
|
28
|
+
for (const owner of PERSIST_ONLY_OWNERS)
|
|
29
|
+
port.bindOwner(owner, persistOnlyHandlers(owner));
|
|
30
|
+
return { port, manager, modelsReady };
|
|
31
|
+
}
|
|
32
|
+
function persistOnlyHandlers(owner) {
|
|
33
|
+
return Object.fromEntries(Object.entries(PI_SETTING_EFFECTS)
|
|
34
|
+
.filter(([, definition]) => definition.owner === owner && definition.hiddenInBare !== true)
|
|
35
|
+
.map(([key]) => [key, { apply() { } }]));
|
|
36
|
+
}
|
|
37
|
+
function modelChoices(models, overrides) {
|
|
38
|
+
return models.map(model => {
|
|
39
|
+
const key = `${model.provider}/${model.id}`;
|
|
40
|
+
return {
|
|
41
|
+
key,
|
|
42
|
+
label: `${model.id} [${model.provider}]`,
|
|
43
|
+
description: overrides[key] === undefined ? "global default" : `override: ${overrides[key]}`,
|
|
44
|
+
levels: supportedThinkingLevels(model),
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Keys the slim Settings port intentionally binds and exposes in bare mode. */
|
|
49
|
+
export function offlinePiSettingKeys() {
|
|
50
|
+
return Object.entries(PI_SETTING_EFFECTS)
|
|
51
|
+
.filter(([, definition]) => PERSIST_ONLY_OWNERS.includes(definition.owner) && definition.hiddenInBare !== true)
|
|
52
|
+
.map(([key]) => key);
|
|
53
|
+
}
|
|
@@ -37,7 +37,7 @@ export interface PiEngineAdapterPorts {
|
|
|
37
37
|
export interface EnginePortParts {
|
|
38
38
|
readonly sessionId: string;
|
|
39
39
|
readonly agentDir: string;
|
|
40
|
-
readonly engine: Pick<PiEngineRuntime, "cwd" | "generation" | "bindingGeneration" | "currentSessionResumeMetadata" | "currentSessionFile">;
|
|
40
|
+
readonly engine: Pick<PiEngineRuntime, "cwd" | "generation" | "bindingGeneration" | "currentSessionResumeMetadata" | "currentSessionFile" | "session">;
|
|
41
41
|
readonly contexts: PiWorkflowContexts;
|
|
42
42
|
readonly workflows: PiWorkflowRunner;
|
|
43
43
|
readonly settings: PiEngineSettings;
|
|
@@ -11,6 +11,10 @@ export function createEnginePorts(parts) {
|
|
|
11
11
|
get disposed() { return parts.disposed(); },
|
|
12
12
|
currentSessionResumeMetadata: () => engine.currentSessionResumeMetadata(),
|
|
13
13
|
currentSessionFile: () => engine.currentSessionFile(),
|
|
14
|
+
currentHistorySessionId: () => {
|
|
15
|
+
const id = engine.session?.sessionManager?.getSessionId?.();
|
|
16
|
+
return typeof id === "string" && id.length > 0 && id.length <= 256 && !id.includes("\0") ? id : null;
|
|
17
|
+
},
|
|
14
18
|
},
|
|
15
19
|
session: parts.session,
|
|
16
20
|
workflows: {
|
|
@@ -80,6 +80,11 @@ export interface PiSettingsModelChoice {
|
|
|
80
80
|
readonly description: string;
|
|
81
81
|
readonly levels: readonly string[];
|
|
82
82
|
}
|
|
83
|
+
/** The engine's rule: no reasoning means "off" only; xhigh and max exist only where the model maps them. */
|
|
84
|
+
export declare function supportedThinkingLevels(model: {
|
|
85
|
+
readonly reasoning?: boolean;
|
|
86
|
+
readonly thinkingLevelMap?: Readonly<Record<string, unknown>>;
|
|
87
|
+
}): readonly string[];
|
|
83
88
|
/** The choice that clears a per-model override; the engine then applies its global default. */
|
|
84
89
|
export declare const MODEL_THINKING_DEFAULT = "default";
|
|
85
90
|
export declare const AUTOMATIC_THEME = "automatic";
|
|
@@ -252,6 +252,19 @@ function outcome(status, application, storedValue, effectiveValue, failure, limi
|
|
|
252
252
|
function describe(error) {
|
|
253
253
|
return error instanceof Error ? error.message : String(error);
|
|
254
254
|
}
|
|
255
|
+
/** The engine's rule: no reasoning means "off" only; xhigh and max exist only where the model maps them. */
|
|
256
|
+
export function supportedThinkingLevels(model) {
|
|
257
|
+
if (!model.reasoning)
|
|
258
|
+
return ["off"];
|
|
259
|
+
return ["off", "minimal", "low", "medium", "high", "xhigh", "max"].filter(level => {
|
|
260
|
+
const mapped = model.thinkingLevelMap?.[level];
|
|
261
|
+
if (mapped === null)
|
|
262
|
+
return false;
|
|
263
|
+
if (level === "xhigh" || level === "max")
|
|
264
|
+
return mapped !== undefined;
|
|
265
|
+
return true;
|
|
266
|
+
});
|
|
267
|
+
}
|
|
255
268
|
/** The choice that clears a per-model override; the engine then applies its global default. */
|
|
256
269
|
export const MODEL_THINKING_DEFAULT = "default";
|
|
257
270
|
export const AUTOMATIC_THEME = "automatic";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isRecord, readThinkingLevel, stringProperty } from "./message-values.js";
|
|
2
2
|
import { collectionResult } from "./resource-catalog.js";
|
|
3
|
-
import { MODEL_THINKING_DEFAULT, PiSettingsBridge } from "./settings-bridge.js";
|
|
3
|
+
import { MODEL_THINKING_DEFAULT, PiSettingsBridge, supportedThinkingLevels } from "./settings-bridge.js";
|
|
4
4
|
import { workflowResult } from "./workflow-support.js";
|
|
5
5
|
import { PINNED_PI_SETTINGS_CALLBACKS } from "./workflows.js";
|
|
6
6
|
/**
|
|
@@ -361,19 +361,6 @@ function agentJsonValue(value) {
|
|
|
361
361
|
function isThinkingLevel(value) {
|
|
362
362
|
return typeof value === "string" && ["off", "minimal", "low", "medium", "high", "xhigh", "max"].includes(value);
|
|
363
363
|
}
|
|
364
|
-
/** The engine's own rule: no reasoning means "off" only; xhigh and max exist only where the model maps them. */
|
|
365
|
-
function supportedThinkingLevels(model) {
|
|
366
|
-
if (!model.reasoning)
|
|
367
|
-
return ["off"];
|
|
368
|
-
return ["off", "minimal", "low", "medium", "high", "xhigh", "max"].filter(level => {
|
|
369
|
-
const mapped = model.thinkingLevelMap?.[level];
|
|
370
|
-
if (mapped === null)
|
|
371
|
-
return false;
|
|
372
|
-
if (level === "xhigh" || level === "max")
|
|
373
|
-
return mapped !== undefined;
|
|
374
|
-
return true;
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
364
|
function settingLabel(callback) {
|
|
378
365
|
return callback
|
|
379
366
|
.replace(/^on/, "")
|
|
@@ -456,8 +456,8 @@ export class PiWorkflowRunner {
|
|
|
456
456
|
: workflowResult(request.command, "failed", "Usage: /name <name>", undefined, "warning");
|
|
457
457
|
}
|
|
458
458
|
requireCapability(session.setSessionName, "setSessionName").call(session, argument);
|
|
459
|
-
|
|
460
|
-
const actual =
|
|
459
|
+
this.#ports.emitView();
|
|
460
|
+
const actual = sessionNameOr(manager?.getSessionName(), argument);
|
|
461
461
|
return workflowResult(request.command, "completed", `Session name set: ${actual}`, actual === argument ? undefined : `Session name was normalized from ${JSON.stringify(argument)} to ${JSON.stringify(actual)}`);
|
|
462
462
|
}
|
|
463
463
|
case "session": {
|
|
@@ -597,3 +597,10 @@ export class PiWorkflowRunner {
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
+
/**
|
|
601
|
+
* The name the session normalized the request to, or the request when it reports none. `/name`
|
|
602
|
+
* publishes a view right after setting it, so a resident tab takes the name as its tab name.
|
|
603
|
+
*/
|
|
604
|
+
function sessionNameOr(normalized, requested) {
|
|
605
|
+
return typeof normalized === "string" ? normalized : requested;
|
|
606
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"platform": "darwin",
|
|
8
8
|
"architecture": "arm64",
|
|
9
9
|
"capability": "supported",
|
|
10
|
-
"builtAt": "2026-10-
|
|
10
|
+
"builtAt": "2026-10-27T13:50:09.001Z",
|
|
11
11
|
"artifact": {
|
|
12
12
|
"filename": "process-guardian.node",
|
|
13
13
|
"sha256": "a87eaaffcd986b624c8b044b756446cc1bdaf4334a1775b97820542fe34f9fb7",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"architecture": "arm64",
|
|
10
10
|
"target": "aarch64-apple-darwin",
|
|
11
11
|
"capability": "supported",
|
|
12
|
-
"builtAt": "2026-10-
|
|
12
|
+
"builtAt": "2026-10-27T13:53:57.855Z",
|
|
13
13
|
"artifact": {
|
|
14
14
|
"filename": "terminal-host.node",
|
|
15
|
-
"sha256": "
|
|
16
|
-
"size":
|
|
15
|
+
"sha256": "2e31d2b83999aec568d7b892e71b5590034d8322c574d773f347c494fc8fe2b8",
|
|
16
|
+
"size": 6001616
|
|
17
17
|
},
|
|
18
18
|
"entry": {
|
|
19
19
|
"filename": "dist/foundation/resident-tabs/host-entry.js",
|
|
Binary file
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"platform": "darwin",
|
|
8
8
|
"architecture": "x64",
|
|
9
9
|
"capability": "supported",
|
|
10
|
-
"builtAt": "2026-10-
|
|
10
|
+
"builtAt": "2026-10-27T13:50:17.798Z",
|
|
11
11
|
"artifact": {
|
|
12
12
|
"filename": "process-guardian.node",
|
|
13
13
|
"sha256": "783a65f0de287a1c02cd5429dbe97bc8633f4cc8a7b92e3e961180b9bdcff814",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"architecture": "x64",
|
|
10
10
|
"target": "x86_64-apple-darwin",
|
|
11
11
|
"capability": "supported",
|
|
12
|
-
"builtAt": "2026-10-
|
|
12
|
+
"builtAt": "2026-10-27T13:56:22.634Z",
|
|
13
13
|
"artifact": {
|
|
14
14
|
"filename": "terminal-host.node",
|
|
15
|
-
"sha256": "
|
|
16
|
-
"size":
|
|
15
|
+
"sha256": "84ec54e9cc77f0f2b75f52e3618a5c2d02bbecdfa417d52ee1dc99243ea1fe5d",
|
|
16
|
+
"size": 6548664
|
|
17
17
|
},
|
|
18
18
|
"entry": {
|
|
19
19
|
"filename": "dist/foundation/resident-tabs/host-entry.js",
|
|
Binary file
|