@timurproko/a1 0.2.6-dev.717 → 0.2.6-dev.734
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/bin/cli.js +13 -2
- package/bin/ui.js +13 -0
- package/dist/app/session-shell/clipboard-services.d.ts +19 -0
- package/dist/app/session-shell/clipboard-services.js +7 -0
- package/dist/app/session-shell/exit-notice.d.ts +9 -5
- package/dist/app/session-shell/exit-notice.js +5 -5
- package/dist/app/session-shell/index.d.ts +3 -1
- package/dist/app/session-shell/index.js +1 -0
- package/dist/app/session-shell/paste-preparation-client.d.ts +3 -0
- package/dist/app/session-shell/paste-preparation-client.js +5 -2
- package/dist/app/session-shell/path-chip-presentation.d.ts +10 -3
- package/dist/app/session-shell/path-chip-presentation.js +48 -6
- package/dist/app/session-shell/prompt-chips.js +30 -4
- package/dist/app/session-shell/prompt-suggestion-controller.d.ts +5 -4
- package/dist/app/session-shell/prompt-suggestion-controller.js +148 -58
- package/dist/app/session-shell/quit-outro.d.ts +3 -1
- package/dist/app/session-shell/quit-outro.js +23 -8
- package/dist/app/session-shell/response-copy-transport.d.ts +6 -1
- package/dist/app/session-shell/response-copy-transport.js +8 -2
- package/dist/app/session-shell/session-shell-root.d.ts +22 -11
- package/dist/app/session-shell/session-shell-root.js +19 -12
- package/dist/app/session-shell/session-shell.d.ts +19 -21
- package/dist/app/session-shell/session-shell.js +678 -840
- package/dist/app/session-shell/session-viewport-controller.js +33 -21
- package/dist/cli/dispatch.js +5 -3
- package/dist/cli/session-context.d.ts +5 -1
- package/dist/cli/session-context.js +25 -8
- package/dist/composition/owned-ui.d.ts +23 -2
- package/dist/composition/owned-ui.js +124 -33
- package/dist/composition/session-info-reference.d.ts +2 -2
- package/dist/composition/session-info-reference.js +2 -2
- package/dist/composition/settings-route-host.js +2 -1
- package/dist/contracts/agent-engine/capability-ports.d.ts +1 -85
- package/dist/contracts/agent-engine/capability-ports.js +1 -35
- package/dist/contracts/agent-engine/index.d.ts +1 -7
- package/dist/contracts/agent-engine/index.js +0 -4
- package/dist/contracts/owned-ui/index.d.ts +9 -3
- package/dist/contracts/owned-ui/index.js +2 -1
- package/dist/contracts/owned-ui/model.d.ts +10 -0
- package/dist/contracts/owned-ui/session-backend.d.ts +119 -0
- package/dist/contracts/owned-ui/session-presenters.d.ts +55 -0
- package/dist/contracts/owned-ui/session-presenters.js +1 -0
- package/dist/contracts/owned-ui/session-workflows.d.ts +342 -0
- package/dist/contracts/owned-ui/session-workflows.js +30 -0
- package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +5 -1
- package/dist/contracts/owned-ui/suggestion-diagnostics.js +3 -1
- package/dist/contracts/owned-ui/validation.js +7 -0
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/session-context.d.ts +17 -2
- package/dist/features/launch/session-context.js +9 -5
- package/dist/features/owned-ui/settings-app.js +56 -54
- package/dist/features/prompt-suggestions/diagnostics.js +4 -1
- package/dist/foundation/lifecycle/index.d.ts +2 -2
- package/dist/foundation/lifecycle/index.js +1 -1
- package/dist/foundation/lifecycle/session-repository-context.d.ts +19 -2
- package/dist/foundation/lifecycle/session-repository-context.js +434 -66
- package/dist/foundation/process-containment/index.d.ts +1 -0
- package/dist/foundation/process-containment/index.js +1 -0
- package/dist/foundation/process-containment/native-process-inspector.d.ts +3 -0
- package/dist/foundation/process-containment/native-process-inspector.js +21 -0
- package/dist/foundation/release/bootstrap.js +1 -2
- package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
- package/dist/foundation/release/progress-palette.generated.js +2 -2
- package/dist/foundation/release/release-gc.js +1 -1
- package/dist/foundation/release/update.js +0 -4
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/foundation/storage/control-store.js +0 -12
- package/dist/integrations/pi/components/components.js +2 -18
- package/dist/integrations/pi/components/index.d.ts +4 -4
- package/dist/integrations/pi/components/index.js +2 -2
- package/dist/integrations/pi/components/modal-frame.js +3 -4
- package/dist/integrations/pi/components/models-dialog.js +6 -35
- package/dist/integrations/pi/components/prompt-input-port.d.ts +1 -0
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
- package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
- package/dist/integrations/pi/components/share-operation-dialog.js +3 -3
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +19 -16
- package/dist/integrations/pi/components/shell-extension-ui.d.ts +5 -3
- package/dist/integrations/pi/components/shell-extension-ui.js +26 -12
- package/dist/integrations/pi/components/shell-hotkey-sections.js +2 -2
- package/dist/integrations/pi/components/shell-presenters-info.js +10 -10
- package/dist/integrations/pi/components/shell-presenters-transcript.js +13 -13
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -6
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +21 -1
- package/dist/integrations/pi/components/shell-shared-facade.js +19 -3
- package/dist/integrations/pi/components/skills-dialog.js +3 -3
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -3
- package/dist/integrations/pi/components/theme.d.ts +9 -0
- package/dist/integrations/pi/components/theme.js +30 -0
- package/dist/integrations/pi/components/tool-result-adapter.js +6 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +6 -6
- package/dist/integrations/pi/components/upstream/components/extension-input.js +4 -4
- package/dist/integrations/pi/components/upstream/components/extension-selector.js +4 -4
- package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +5 -5
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +8 -5
- package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +3 -3
- package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +9 -9
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +3 -2
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +6 -3
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +2 -2
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +4 -0
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +11 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +27 -18
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +4 -4
- package/dist/integrations/pi/components/upstream/history/editor-core.js +11 -7
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
- package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
- package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +31 -0
- package/dist/integrations/pi/components/upstream/program-status-reporter.js +89 -0
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +22 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +225 -10
- package/dist/integrations/pi/engine/adapter.d.ts +44 -24
- package/dist/integrations/pi/engine/adapter.js +130 -22
- package/dist/integrations/pi/engine/command-dispatch.d.ts +2 -5
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -11
- package/dist/integrations/pi/engine/host-ports.d.ts +20 -0
- package/dist/integrations/pi/engine/host-ports.js +13 -0
- package/dist/integrations/pi/engine/host.d.ts +70 -0
- package/dist/integrations/pi/engine/host.js +147 -0
- package/dist/integrations/pi/engine/index.d.ts +8 -4
- package/dist/integrations/pi/engine/index.js +3 -1
- package/dist/integrations/pi/engine/pi-settings-metadata.json +1 -1
- package/dist/integrations/pi/engine/resource-catalog.d.ts +4 -23
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -2
- package/dist/integrations/pi/engine/runtime-integration.js +12 -7
- package/dist/integrations/pi/engine/session-events.js +10 -2
- package/dist/integrations/pi/engine/session-integration.d.ts +3 -8
- package/dist/integrations/pi/engine/session-integration.js +0 -49
- package/dist/integrations/pi/engine/session-runtime.d.ts +18 -3
- package/dist/integrations/pi/engine/session-runtime.js +18 -7
- package/dist/integrations/pi/engine/settings-bridge.d.ts +2 -2
- package/dist/integrations/pi/engine/settings-bridge.js +0 -2
- package/dist/integrations/pi/engine/settings-port.d.ts +2 -0
- package/dist/integrations/pi/engine/settings-port.js +3 -5
- package/dist/integrations/pi/engine/transcript-projection.js +2 -1
- package/dist/integrations/pi/engine/workflows.d.ts +33 -260
- package/dist/integrations/pi/engine/workflows.js +6 -28
- package/dist/integrations/pi/session-presenters/index.d.ts +2 -0
- package/dist/integrations/pi/session-presenters/index.js +1 -0
- package/dist/integrations/pi/session-presenters/presenters.d.ts +16 -0
- package/dist/integrations/pi/session-presenters/presenters.js +341 -0
- package/dist/integrations/pi/startup-public.js +306 -290
- package/dist/integrations/pi/startup-public.manifest.json +289 -265
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -1
- package/dist/integrations/pi/tui-runtime/adapter.js +7 -2
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +3 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +8 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +67 -2
- package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/index.js +1 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/product-identity.d.ts +2 -2
- package/dist/product-identity.js +2 -2
- package/dist/product-identity.json +3 -1
- package/dist/runtime-payload-inventory.json +3092 -2878
- package/dist/ui/components/prompt-input.d.ts +2 -0
- package/dist/ui/components/prompt-input.js +5 -1
- package/dist/ui/components/text-selection.d.ts +1 -1
- package/dist/ui/components/text-selection.js +3 -1
- package/dist/ui/components/theme.d.ts +2 -0
- package/dist/ui/components/transcript-viewport.d.ts +6 -4
- package/dist/ui/components/transcript-viewport.js +94 -16
- package/dist/ui/components/value-menu.d.ts +2 -0
- package/dist/ui/components/value-menu.js +13 -8
- package/dist/ui/settings/declarations.d.ts +38 -14
- package/dist/ui/settings/declarations.js +35 -11
- package/dist/ui/settings/migrations.js +23 -0
- package/docs/architecture/boundaries.md +9 -1
- package/docs/architecture/project-structure.md +7 -5
- package/docs/architecture/prompt-suggestions.md +14 -10
- package/docs/local-worktree-cleanup.md +11 -5
- package/docs/openspec-archive-automation.md +6 -5
- package/package.json +3 -3
- package/dist/contracts/agent-engine/model.d.ts +0 -78
- package/dist/contracts/agent-engine/model.js +0 -1
- package/dist/contracts/agent-engine/ports.d.ts +0 -18
- package/dist/contracts/agent-engine/serialization.d.ts +0 -7
- package/dist/contracts/agent-engine/serialization.js +0 -58
- package/dist/contracts/agent-engine/validation.d.ts +0 -5
- package/dist/contracts/agent-engine/validation.js +0 -128
- package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +0 -61
- package/dist/integrations/pi/components/upstream/theme/system-theme.js +0 -709
- /package/dist/contracts/{agent-engine/ports.js → owned-ui/session-backend.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DynamicBorder
|
|
1
|
+
import { DynamicBorder } from "../startup-public.js";
|
|
2
2
|
import { Container, getCapabilities, hyperlink, Markdown, Spacer, Text, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
3
|
import { PRODUCT_TEXT } from "../../../product-identity.js";
|
|
4
4
|
import { KeybindingsManager } from "./upstream/adjacent/core/keybindings.js";
|
|
5
|
-
import { PINNED_PI_LAYOUT, piTheme } from "./theme.js";
|
|
5
|
+
import { getPiHotkeysMarkdownTheme, getPiMarkdownTheme, paintPiBorder, PINNED_PI_LAYOUT, piTheme } from "./theme.js";
|
|
6
6
|
import { componentPort, ensureTheme, formatSessionTokens } from "./shell-shared-facade.js";
|
|
7
7
|
export function renderPiShellStatusText(message, width, outputPad = PINNED_PI_LAYOUT.outputPad) {
|
|
8
8
|
ensureTheme();
|
|
@@ -116,20 +116,20 @@ export function createPiShellCollapsedChangelog() {
|
|
|
116
116
|
ensureTheme();
|
|
117
117
|
const container = new Container();
|
|
118
118
|
container.addChild(new Spacer(1));
|
|
119
|
-
container.addChild(new DynamicBorder());
|
|
119
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
120
120
|
container.addChild(new Text(`${piTheme().bold(piTheme().fg("accent", "What's New"))}\n${piTheme().fg("muted", "Run /changelog to view the full release notes.")}`, 1, 0));
|
|
121
|
-
container.addChild(new DynamicBorder());
|
|
121
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
122
122
|
return componentPort(container);
|
|
123
123
|
}
|
|
124
124
|
export function createPiShellChangelog(markdown) {
|
|
125
125
|
ensureTheme();
|
|
126
126
|
const container = new Container();
|
|
127
127
|
container.addChild(new Spacer(1));
|
|
128
|
-
container.addChild(new DynamicBorder());
|
|
128
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
129
129
|
container.addChild(new Text(piTheme().bold(piTheme().fg("accent", "What's New")), 1, 0));
|
|
130
130
|
container.addChild(new Spacer(1));
|
|
131
131
|
container.addChild(changelogMarkdown(markdown));
|
|
132
|
-
container.addChild(new DynamicBorder());
|
|
132
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
133
133
|
return componentPort(container);
|
|
134
134
|
}
|
|
135
135
|
/** The changelog document rows the feed presenter shows, without its spacer, borders, and heading. */
|
|
@@ -138,7 +138,7 @@ export function renderPiShellChangelogLines(markdown, width) {
|
|
|
138
138
|
return changelogMarkdown(markdown).render(width);
|
|
139
139
|
}
|
|
140
140
|
function changelogMarkdown(markdown) {
|
|
141
|
-
return new Markdown(markdown.trim() || "No changelog entries found.", 1, 1,
|
|
141
|
+
return new Markdown(markdown.trim() || "No changelog entries found.", 1, 1, getPiMarkdownTheme());
|
|
142
142
|
}
|
|
143
143
|
function shortcutDisplay(key) {
|
|
144
144
|
// Platform: pinned Pi labels Alt as Option on macOS, including extension shortcuts.
|
|
@@ -152,11 +152,11 @@ export function createPiShellHotkeys(bindings, getShortcuts = () => [], profile
|
|
|
152
152
|
const markdown = hotkeysMarkdown(bindings, getShortcuts, profile);
|
|
153
153
|
const container = new Container();
|
|
154
154
|
container.addChild(new Spacer(1));
|
|
155
|
-
container.addChild(new DynamicBorder());
|
|
155
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
156
156
|
container.addChild(new Text(piTheme().bold(piTheme().fg("accent", "Keyboard Shortcuts")), 1, 0));
|
|
157
157
|
container.addChild(new Spacer(1));
|
|
158
158
|
container.addChild(hotkeysMarkdownComponent(markdown));
|
|
159
|
-
container.addChild(new DynamicBorder());
|
|
159
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
160
160
|
return componentPort(container);
|
|
161
161
|
}
|
|
162
162
|
/** The keyboard-shortcut document rows the feed presenter shows, without its spacer, borders, and heading. */
|
|
@@ -165,7 +165,7 @@ export function renderPiShellHotkeysLines(presentation, width) {
|
|
|
165
165
|
return hotkeysMarkdownComponent(hotkeysMarkdown(presentation.bindings, presentation.getShortcuts ?? (() => []), presentation.profile ?? "pi")).render(width);
|
|
166
166
|
}
|
|
167
167
|
function hotkeysMarkdownComponent(markdown) {
|
|
168
|
-
return new Markdown(markdown, 1, 1,
|
|
168
|
+
return new Markdown(markdown, 1, 1, getPiHotkeysMarkdownTheme());
|
|
169
169
|
}
|
|
170
170
|
export function hotkeysMarkdown(bindings, getShortcuts, profile) {
|
|
171
171
|
const keys = profile === "a1" ? KeybindingsManager.fromOwnedBindings(bindings) : new KeybindingsManager(bindings);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssistantMessageComponent, BashExecutionComponent, CompactionSummaryMessageComponent, CustomMessageComponent,
|
|
1
|
+
import { AssistantMessageComponent, BashExecutionComponent, CompactionSummaryMessageComponent, CustomMessageComponent, parseSkillBlock, UserMessageComponent, } from "../startup-public.js";
|
|
2
2
|
import { ToolExecutionComponent } from "./upstream/components/tool-execution.js";
|
|
3
3
|
import { SkillInvocationMessageComponent } from "./upstream/components/skill-invocation-message.js";
|
|
4
4
|
import { piToolArguments as toolArguments, updatePiToolResult as updateToolResult } from "./tool-result-adapter.js";
|
|
@@ -7,8 +7,8 @@ import { createMermaidMarkdownTransformer } from "./upstream/components/mermaid.
|
|
|
7
7
|
import { Container, Image, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
8
8
|
import { createPiSubmittedPromptComponent, isPiPromptStyleCompaction, } from "./submitted-prompt-adapter.js";
|
|
9
9
|
export { isPiPromptStyleCompaction, paintPiSubmittedPromptTimestamp } from "./submitted-prompt-adapter.js";
|
|
10
|
-
import { PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
|
|
11
|
-
import {
|
|
10
|
+
import { getPiMarkdownTheme, PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
|
|
11
|
+
import { createTuiFacade, ensureTheme, isRecord, } from "./shell-shared-facade.js";
|
|
12
12
|
export function createPiShellTranscriptComponent(initial, cwd, extensions, submittedPrompt, initialOutputPad = PINNED_PI_LAYOUT.outputPad, initialHideThinkingBlock = false, initialMermaidRenderingMode = "off", initialShowImages = true, initialImageWidthCells = 80, imageAssets, presentation) {
|
|
13
13
|
ensureTheme();
|
|
14
14
|
let block = initial;
|
|
@@ -146,7 +146,7 @@ function withTranscriptImages(component, block, assets, showImages, imageWidthCe
|
|
|
146
146
|
}
|
|
147
147
|
function renderWithOutputPad(component, kind, width, outputPad) {
|
|
148
148
|
const rows = component.render(width);
|
|
149
|
-
if (outputPad !== 0 ||
|
|
149
|
+
if (outputPad !== 0 || kind !== "bash")
|
|
150
150
|
return rows;
|
|
151
151
|
return rows.map(row => row.startsWith(" ") ? row.slice(1) : row);
|
|
152
152
|
}
|
|
@@ -177,7 +177,7 @@ function transcriptComponent(block, cwd, expanded, extensions, submittedPrompt,
|
|
|
177
177
|
const skill = parseSkillBlock(visibleBlock.text);
|
|
178
178
|
if (!skill)
|
|
179
179
|
return submittedPrompt ? createPiSubmittedPromptComponent(visibleBlock, submittedPrompt) : new UserMessageComponent(visibleBlock.text);
|
|
180
|
-
const invocation = new SkillInvocationMessageComponent(skill,
|
|
180
|
+
const invocation = new SkillInvocationMessageComponent(skill, getPiMarkdownTheme(), outputPad);
|
|
181
181
|
invocation.setExpanded(expanded);
|
|
182
182
|
if (!skill.userMessage)
|
|
183
183
|
return invocation;
|
|
@@ -192,7 +192,7 @@ function transcriptComponent(block, cwd, expanded, extensions, submittedPrompt,
|
|
|
192
192
|
return assistantComponent(block, outputPad, hideThinkingBlock, mermaidRenderingMode);
|
|
193
193
|
case "tool-call":
|
|
194
194
|
case "tool-result": {
|
|
195
|
-
const component = toolComponent(block, cwd, extensions, showImages, imageWidthCells, imageAssets, tui);
|
|
195
|
+
const component = toolComponent(block, cwd, extensions, outputPad, showImages, imageWidthCells, imageAssets, tui);
|
|
196
196
|
component.setExpanded(expanded);
|
|
197
197
|
return component;
|
|
198
198
|
}
|
|
@@ -206,7 +206,7 @@ function transcriptComponent(block, cwd, expanded, extensions, submittedPrompt,
|
|
|
206
206
|
summary: block.text,
|
|
207
207
|
tokensBefore: numericPayload(block, "tokensBefore"),
|
|
208
208
|
timestamp: numericPayload(block, "timestamp") || 0,
|
|
209
|
-
},
|
|
209
|
+
}, getPiMarkdownTheme());
|
|
210
210
|
component.setExpanded(expanded);
|
|
211
211
|
return component;
|
|
212
212
|
}
|
|
@@ -219,7 +219,7 @@ function transcriptComponent(block, cwd, expanded, extensions, submittedPrompt,
|
|
|
219
219
|
case "custom":
|
|
220
220
|
return customMessageComponent(block, expanded, extensions, outputPad);
|
|
221
221
|
case "bash":
|
|
222
|
-
return bashExecutionComponent(block,
|
|
222
|
+
return bashExecutionComponent(block, expanded, tui);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
function updateTranscriptComponent(component, previous, next, expanded, imageAssets) {
|
|
@@ -256,7 +256,7 @@ function updateTranscriptComponent(component, previous, next, expanded, imageAss
|
|
|
256
256
|
}
|
|
257
257
|
function assistantComponent(block, outputPad, hideThinkingBlock, mermaidRenderingMode) {
|
|
258
258
|
const transformer = createMermaidMarkdownTransformer({ getMode: () => mermaidRenderingMode, theme: piTheme() });
|
|
259
|
-
const component = new AssistantMessageComponent(undefined, hideThinkingBlock,
|
|
259
|
+
const component = new AssistantMessageComponent(undefined, hideThinkingBlock, getPiMarkdownTheme(), undefined, outputPad, [transformer]);
|
|
260
260
|
component.updateContent(validatedAssistantMessage(block), block.status === "live");
|
|
261
261
|
return component;
|
|
262
262
|
}
|
|
@@ -328,12 +328,12 @@ function validatedMessageRenderer(value) {
|
|
|
328
328
|
function isPiMessageRenderer(value) {
|
|
329
329
|
return typeof value === "function";
|
|
330
330
|
}
|
|
331
|
-
function toolComponent(block, cwd, extensions, showImages, imageWidthCells, imageAssets, tui) {
|
|
331
|
+
function toolComponent(block, cwd, extensions, outputPad, showImages, imageWidthCells, imageAssets, tui) {
|
|
332
332
|
const payload = blockPayload(block);
|
|
333
333
|
const toolCallId = stringPayload(payload, "toolCallId") ?? block.id;
|
|
334
334
|
const toolName = stringPayload(payload, "toolName") ?? block.title ?? "tool";
|
|
335
335
|
const argumentsPayload = toolArguments(block);
|
|
336
|
-
const component = new ToolExecutionComponent(toolName, toolCallId, argumentsPayload, { showImages, imageWidthCells }, validatedToolRenderers(extensions?.getToolRenderers(toolName)), tui ?? createTuiFacade({ getColumns: () => 80, getRows: () => 24, requestRender() { } }), cwd);
|
|
336
|
+
const component = new ToolExecutionComponent(toolName, toolCallId, argumentsPayload, { showImages, imageWidthCells, outputPad }, validatedToolRenderers(extensions?.getToolRenderers(toolName)), tui ?? createTuiFacade({ getColumns: () => 80, getRows: () => 24, requestRender() { } }), cwd);
|
|
337
337
|
applyToolState(component, block);
|
|
338
338
|
updateToolResult(component, block, imageAssets);
|
|
339
339
|
return component;
|
|
@@ -360,11 +360,11 @@ function customMessageComponent(block, expanded, extensions, outputPad) {
|
|
|
360
360
|
timestamp: numericPayload(block, "timestamp") || 0,
|
|
361
361
|
};
|
|
362
362
|
const renderer = validatedMessageRenderer(extensions?.getMessageRenderer(message.customType));
|
|
363
|
-
const component = new CustomMessageComponent(message, renderer,
|
|
363
|
+
const component = new CustomMessageComponent(message, renderer, getPiMarkdownTheme(), outputPad);
|
|
364
364
|
component.setExpanded(expanded);
|
|
365
365
|
return component;
|
|
366
366
|
}
|
|
367
|
-
function bashExecutionComponent(block,
|
|
367
|
+
function bashExecutionComponent(block, expanded, tui) {
|
|
368
368
|
const payload = blockPayload(block);
|
|
369
369
|
const component = new BashExecutionComponent(stringPayload(payload, "command") ?? block.title ?? "", tui ?? createTuiFacade({ getColumns: () => 80, getRows: () => 24, requestRender() { } }), payload.excludeFromContext === true);
|
|
370
370
|
if (block.text)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArminComponent, DynamicBorder,
|
|
1
|
+
import { ArminComponent, DynamicBorder, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, SettingsSelectorComponent, ShowImagesSelectorComponent, ThemeSelectorComponent, UserMessageSelectorComponent, } from "../startup-public.js";
|
|
2
2
|
import { EarendilAnnouncementComponent } from "./upstream/components/earendil-announcement.js";
|
|
3
3
|
import { ExtensionSelectorComponent } from "./upstream/components/extension-selector.js";
|
|
4
4
|
import { Box, Container, SelectList, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
@@ -6,13 +6,13 @@ import { ScopedModelsSelectorComponent } from "./upstream/components/scoped-mode
|
|
|
6
6
|
import { addPiModalSelectFooter, adoptPiModalFrame, adoptPiModalHeader } from "./modal-frame.js";
|
|
7
7
|
import { ModelsDialogComponent } from "./models-dialog.js";
|
|
8
8
|
import { TrustSelectorComponent } from "./upstream/components/trust-selector.js";
|
|
9
|
-
import { canonicalizePiSettingsHint, DIALOG_CLOSE_SHORTCUT_HINT, PINNED_PI_LAYOUT, piTheme, renderPiModalShortcutHints, } from "./theme.js";
|
|
9
|
+
import { canonicalizePiSettingsHint, DIALOG_CLOSE_SHORTCUT_HINT, PINNED_PI_LAYOUT, getPiSelectListTheme, paintPiBorder, piTheme, renderPiModalShortcutHints, } from "./theme.js";
|
|
10
10
|
import { componentFromPort, componentPort, createTuiFacade, ensureTheme, isRecord, } from "./shell-shared-facade.js";
|
|
11
11
|
export { createPiShellSkillsSelector } from "./skills-dialog.js";
|
|
12
12
|
export function createPiShellSelector(options) {
|
|
13
13
|
ensureTheme();
|
|
14
14
|
const items = options.options.map(toSelectItem);
|
|
15
|
-
const list = new SelectList(items, options.maxVisible ?? Math.min(PINNED_PI_LAYOUT.selectorMaxVisible, Math.max(1, items.length)),
|
|
15
|
+
const list = new SelectList(items, options.maxVisible ?? Math.min(PINNED_PI_LAYOUT.selectorMaxVisible, Math.max(1, items.length)), getPiSelectListTheme());
|
|
16
16
|
if (options.onSelect !== undefined)
|
|
17
17
|
list.onSelect = item => options.onSelect?.(item.value);
|
|
18
18
|
if (options.onCancel !== undefined)
|
|
@@ -214,12 +214,11 @@ export function createPiShellEarendilAnnouncement() {
|
|
|
214
214
|
export function createPiShellReloadBox() {
|
|
215
215
|
ensureTheme();
|
|
216
216
|
const container = new Container();
|
|
217
|
-
|
|
218
|
-
container.addChild(new DynamicBorder(borderColor));
|
|
217
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
219
218
|
container.addChild(new Spacer(1));
|
|
220
219
|
container.addChild(new Text(piTheme().fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 0, 0));
|
|
221
220
|
container.addChild(new Spacer(1));
|
|
222
|
-
container.addChild(new DynamicBorder(
|
|
221
|
+
container.addChild(new DynamicBorder(paintPiBorder));
|
|
223
222
|
adoptPiModalFrame(container, { topIndex: 0, bottomIndex: container.children.length - 1 });
|
|
224
223
|
return componentPort(container);
|
|
225
224
|
}
|
|
@@ -4,6 +4,7 @@ import type { HistoryEditorConstructor } from "./history-editor-loader.js";
|
|
|
4
4
|
import type { PiShellPromptInputPresentation } from "./prompt-input-port.js";
|
|
5
5
|
import type { EditorRecallPort } from "./editor-interaction.js";
|
|
6
6
|
import type { PresentationComponentPort } from "../../../contracts/presentation/index.js";
|
|
7
|
+
import { KeybindingsManager } from "./upstream/adjacent/core/keybindings.js";
|
|
7
8
|
/** Terminal-cell width authority used by Pi-rendered component rows. */
|
|
8
9
|
export declare const piShellVisibleWidth: typeof visibleWidth;
|
|
9
10
|
export declare const piShellTruncateToWidth: (text: string, width: number) => string;
|
|
@@ -41,7 +42,7 @@ export interface PiShellEditorPort extends PiShellComponentPort {
|
|
|
41
42
|
bodyGeometry?(): PiShellEditorBodyGeometry;
|
|
42
43
|
readonly recall?: EditorRecallPort;
|
|
43
44
|
readonly historyReplacement?: typeof import("../../../contracts/owned-ui/index.js").PROMPT_HISTORY_EDITOR_REPLACEMENT;
|
|
44
|
-
/** Restores
|
|
45
|
+
/** Restores the shared manager if anything replaced pi-tui's registry; a no-op when it is already active. */
|
|
45
46
|
activateKeybindings(): void;
|
|
46
47
|
keybindingConfig(): KeybindingsConfig;
|
|
47
48
|
reloadKeybindings(): void;
|
|
@@ -161,6 +162,8 @@ export interface PiShellEditorOptions {
|
|
|
161
162
|
readonly historyEditor?: HistoryEditorConstructor;
|
|
162
163
|
/** Bare A1 adds ergonomic aliases while comparison profiles retain Pi defaults. */
|
|
163
164
|
readonly keybindingProfile?: "pi" | "a1";
|
|
165
|
+
/** The process's shared keybindings; its profile must match `keybindingProfile`. */
|
|
166
|
+
readonly keybindings?: PiKeybindingsHost;
|
|
164
167
|
readonly getColumns: () => number;
|
|
165
168
|
readonly getRows: () => number;
|
|
166
169
|
readonly requestRender: () => void;
|
|
@@ -233,4 +236,21 @@ export declare function componentFromPort(port: PiShellComponentPort): Component
|
|
|
233
236
|
export declare function formatSessionTokens(count: number): string;
|
|
234
237
|
export declare function isAutocompleteProvider(value: unknown): value is AutocompleteProvider;
|
|
235
238
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
239
|
+
/**
|
|
240
|
+
* Applies theme state. The keybinding registry belongs to the process's `PiKeybindingsHost`; only when no
|
|
241
|
+
* A1 manager was ever applied (a presenter built outside composition) does this install Pi's defaults once.
|
|
242
|
+
*/
|
|
236
243
|
export declare function ensureTheme(): void;
|
|
244
|
+
/** The process's one keybinding manager and the only writer of pi-tui's global keybinding registry. */
|
|
245
|
+
export interface PiKeybindingsHost {
|
|
246
|
+
readonly manager: KeybindingsManager;
|
|
247
|
+
/** Installs the manager in the registry unless it is already the active one. */
|
|
248
|
+
ensureActive(): void;
|
|
249
|
+
/** Re-reads the user's keybindings file into the shared manager and keeps it active. */
|
|
250
|
+
reload(): void;
|
|
251
|
+
}
|
|
252
|
+
/** Composition creates one host per process; bare A1 uses the owned-input aliases, comparison profiles keep Pi's. */
|
|
253
|
+
export declare function createPiKeybindingsHost(options: {
|
|
254
|
+
readonly profile: "pi" | "a1";
|
|
255
|
+
readonly agentDir?: string;
|
|
256
|
+
}): PiKeybindingsHost;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hyperlink, matchesKey, setKeybindings, visibleWidth, truncateToWidth, } from "@earendil-works/pi-tui";
|
|
1
|
+
import { getKeybindings, hyperlink, matchesKey, setKeybindings, visibleWidth, truncateToWidth, } from "@earendil-works/pi-tui";
|
|
2
2
|
import { KeybindingsManager, } from "./upstream/adjacent/core/keybindings.js";
|
|
3
3
|
import { ensurePiTheme, } from "./theme.js";
|
|
4
4
|
/** Terminal-cell width authority used by Pi-rendered component rows. */
|
|
@@ -14,7 +14,7 @@ export function createTuiFacade(options) {
|
|
|
14
14
|
get columns() { return Math.max(1, options.getColumns()); },
|
|
15
15
|
get rows() { return Math.max(1, options.getRows()); },
|
|
16
16
|
get kittyProtocolActive() { return false; },
|
|
17
|
-
moveBy() { }, hideCursor() { }, showCursor() { }, clearLine() { }, clearFromCursor() { }, clearScreen() { }, setTitle() { }, setProgress() { },
|
|
17
|
+
moveBy() { }, hideCursor() { }, showCursor() { }, clearLine() { }, clearFromCursor() { }, clearScreen() { }, setTitle() { }, setProgress() { }, setProgramStatus() { },
|
|
18
18
|
};
|
|
19
19
|
return {
|
|
20
20
|
mode: "regular",
|
|
@@ -97,7 +97,23 @@ export function isAutocompleteProvider(value) {
|
|
|
97
97
|
export function isRecord(value) {
|
|
98
98
|
return typeof value === "object" && value !== null;
|
|
99
99
|
}
|
|
100
|
+
let fallbackKeybindings;
|
|
101
|
+
/**
|
|
102
|
+
* Applies theme state. The keybinding registry belongs to the process's `PiKeybindingsHost`; only when no
|
|
103
|
+
* A1 manager was ever applied (a presenter built outside composition) does this install Pi's defaults once.
|
|
104
|
+
*/
|
|
100
105
|
export function ensureTheme() {
|
|
101
106
|
ensurePiTheme();
|
|
102
|
-
|
|
107
|
+
if (!(getKeybindings() instanceof KeybindingsManager))
|
|
108
|
+
setKeybindings(fallbackKeybindings ??= KeybindingsManager.create());
|
|
109
|
+
}
|
|
110
|
+
/** Composition creates one host per process; bare A1 uses the owned-input aliases, comparison profiles keep Pi's. */
|
|
111
|
+
export function createPiKeybindingsHost(options) {
|
|
112
|
+
const manager = options.profile === "a1"
|
|
113
|
+
? KeybindingsManager.createForOwnedInput(options.agentDir)
|
|
114
|
+
: KeybindingsManager.create(options.agentDir);
|
|
115
|
+
const ensureActive = () => { if (getKeybindings() !== manager)
|
|
116
|
+
setKeybindings(manager); };
|
|
117
|
+
ensureActive();
|
|
118
|
+
return { manager, ensureActive, reload: () => { manager.reload(); setKeybindings(manager); } };
|
|
103
119
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicBorder } from "../startup-public.js";
|
|
2
2
|
import { Container, getKeybindings, Input, Spacer, Text } from "@earendil-works/pi-tui";
|
|
3
3
|
import { addPiModalHeader, adoptPiModalFrame } from "./modal-frame.js";
|
|
4
|
-
import { DIALOG_CLOSE_SHORTCUT_HINT, PINNED_PI_LAYOUT, piTheme, renderPiModalListRow, renderPiModalShortcutHints, } from "./theme.js";
|
|
4
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, PINNED_PI_LAYOUT, piTheme, renderPiModalListRow, renderPiModalShortcutHints, } from "./theme.js";
|
|
5
5
|
import { componentPort, ensureTheme, piShellTruncateToWidth, piShellVisibleWidth } from "./shell-shared-facade.js";
|
|
6
6
|
import { skillMatchesQuery } from "./skills-command.js";
|
|
7
7
|
/** A single line clipped at the viewport width: no wrap, no ellipsis, padded to the full width. */
|
|
@@ -48,7 +48,7 @@ class SkillsSelectorComponent extends Container {
|
|
|
48
48
|
this.#onSelect = options.onSelect;
|
|
49
49
|
this.#onCancel = options.onCancel;
|
|
50
50
|
this.#searchInput.onSubmit = () => this.#selectCurrent();
|
|
51
|
-
const header = addPiModalHeader(this, new DynamicBorder(), new Text(piTheme().fg("accent", piTheme().bold("Skills")), 0, 0));
|
|
51
|
+
const header = addPiModalHeader(this, new DynamicBorder(paintPiBorder), new Text(piTheme().fg("accent", piTheme().bold("Skills")), 0, 0));
|
|
52
52
|
this.addChild(new Spacer(1));
|
|
53
53
|
this.addChild(this.#searchInput);
|
|
54
54
|
this.addChild(new Spacer(1));
|
|
@@ -61,7 +61,7 @@ class SkillsSelectorComponent extends Container {
|
|
|
61
61
|
{ key: bindings.getKeys("tui.select.confirm").join("/"), action: "select" },
|
|
62
62
|
DIALOG_CLOSE_SHORTCUT_HINT,
|
|
63
63
|
]), 0, 0));
|
|
64
|
-
this.addChild(new DynamicBorder());
|
|
64
|
+
this.addChild(new DynamicBorder(paintPiBorder));
|
|
65
65
|
adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1, header });
|
|
66
66
|
this.#updateList();
|
|
67
67
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { getMarkdownTheme } from "../startup-public.js";
|
|
2
1
|
import { Box, Markdown, Text } from "@earendil-works/pi-tui";
|
|
3
2
|
import { protectPiPromptChipPresentation } from "./prompt-chip-presentation.js";
|
|
4
|
-
import { piTheme } from "./theme.js";
|
|
3
|
+
import { getPiMarkdownTheme, piTheme } from "./theme.js";
|
|
5
4
|
/** Branch summaries share the block kind but do not participate in prompt navigation. */
|
|
6
5
|
export function isPiPromptStyleCompaction(block) {
|
|
7
6
|
return block.kind === "compaction" && block.status === "finalized"
|
|
@@ -20,7 +19,7 @@ export function createPiSubmittedPromptComponent(block, composer, heading) {
|
|
|
20
19
|
// Invariant: presentation-only chrome stays outside the summary's Markdown parser and stored text.
|
|
21
20
|
const header = heading === undefined ? undefined : new Text(heading, 0, 0);
|
|
22
21
|
let chipWrapping;
|
|
23
|
-
const markdown = new Markdown(block.text, 0, 0,
|
|
22
|
+
const markdown = new Markdown(block.text, 0, 0, getPiMarkdownTheme(), { color: content => piTheme().fg("userMessageText", content) }, {
|
|
24
23
|
preserveOrderedListMarkers: true,
|
|
25
24
|
preserveBackslashEscapes: true,
|
|
26
25
|
...(block.kind === "user" ? { transform: (text, width) => {
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel, type SemanticShortcutHint } from "../../../contracts/presentation/index.js";
|
|
2
|
+
import { type MarkdownTheme, type SelectListTheme } from "@earendil-works/pi-tui";
|
|
2
3
|
export * from "./upstream/theme/theme.js";
|
|
3
4
|
export type PiModalShortcutHint = SemanticShortcutHint;
|
|
4
5
|
export { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel };
|
|
6
|
+
/** Resolves dialog rules through the live A1 projection instead of Pi's package-global theme. */
|
|
7
|
+
export declare function paintPiBorder(text: string): string;
|
|
8
|
+
/** Markdown keeps Pi's complete base treatment while resolving list markers through A1's accent. */
|
|
9
|
+
export declare function getPiMarkdownTheme(): MarkdownTheme;
|
|
10
|
+
/** Hotkey key spans share the live secondary/filter tone without changing general Markdown code. */
|
|
11
|
+
export declare function getPiHotkeysMarkdownTheme(): MarkdownTheme;
|
|
12
|
+
/** Select-list roles resolved through A1's active theme rather than Pi's package-global base theme. */
|
|
13
|
+
export declare function getPiSelectListTheme(): SelectListTheme;
|
|
5
14
|
/** Paint one selected bare-A1 list item with the standard blue selection surface. */
|
|
6
15
|
export declare function renderPiListSelection(content: string): string;
|
|
7
16
|
/** One standard bare-A1 modal row, clipped before its item-bounded selection is painted. */
|
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel, renderSemanticShortcutHints, } from "../../../contracts/presentation/index.js";
|
|
2
2
|
import { stripTerminalSequences, truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
|
+
import { getMarkdownTheme } from "../startup-public.js";
|
|
3
4
|
import { piTheme } from "./upstream/theme/theme.js";
|
|
4
5
|
export * from "./upstream/theme/theme.js";
|
|
5
6
|
export { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel };
|
|
7
|
+
/** Resolves dialog rules through the live A1 projection instead of Pi's package-global theme. */
|
|
8
|
+
export function paintPiBorder(text) {
|
|
9
|
+
return piTheme().fg("border", text);
|
|
10
|
+
}
|
|
11
|
+
/** Markdown keeps Pi's complete base treatment while resolving list markers through A1's accent. */
|
|
12
|
+
export function getPiMarkdownTheme() {
|
|
13
|
+
return {
|
|
14
|
+
...getMarkdownTheme(),
|
|
15
|
+
heading: text => piTheme().fg("mdHeading", text),
|
|
16
|
+
listBullet: text => piTheme().fg("mdListBullet", text),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Hotkey key spans share the live secondary/filter tone without changing general Markdown code. */
|
|
20
|
+
export function getPiHotkeysMarkdownTheme() {
|
|
21
|
+
return {
|
|
22
|
+
...getPiMarkdownTheme(),
|
|
23
|
+
code: text => piTheme().fg("mdHeading", text),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Select-list roles resolved through A1's active theme rather than Pi's package-global base theme. */
|
|
27
|
+
export function getPiSelectListTheme() {
|
|
28
|
+
return {
|
|
29
|
+
selectedPrefix: text => piTheme().fg("accent", text),
|
|
30
|
+
selectedText: text => piTheme().fg("accent", text),
|
|
31
|
+
description: text => piTheme().fg("muted", text),
|
|
32
|
+
scrollInfo: text => piTheme().fg("muted", text),
|
|
33
|
+
noMatch: text => piTheme().fg("muted", text),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
6
36
|
/** Paint one selected bare-A1 list item with the standard blue selection surface. */
|
|
7
37
|
export function renderPiListSelection(content) {
|
|
8
38
|
return piTheme().bg("selectedBg", content);
|
|
@@ -16,7 +16,12 @@ export function updatePiToolResult(component, block, assets) {
|
|
|
16
16
|
? [{ type: "text", text: block.text }, ...(block.imageReferences ?? []).map((_, index) => image(index))]
|
|
17
17
|
: result.content.map(part => part.type === "text"
|
|
18
18
|
? { type: "text", text: block.text.slice(part.start, part.end) } : image(part.imageIndex));
|
|
19
|
-
component.updateResult({
|
|
19
|
+
component.updateResult({
|
|
20
|
+
content,
|
|
21
|
+
details: result?.details,
|
|
22
|
+
isError: payload.isError === true,
|
|
23
|
+
...(typeof payload.durationMs === "number" ? { durationMs: payload.durationMs } : {}),
|
|
24
|
+
}, block.status === "live");
|
|
20
25
|
}
|
|
21
26
|
export function piToolArguments(block) {
|
|
22
27
|
if (block.toolRendering !== undefined)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/core/keybindings.ts.
|
|
4
4
|
* Modifications: Mechanical source port with Node import prefixes, public package-root agent-directory
|
|
5
5
|
* resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling, unbound model
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/core/keybindings.ts.
|
|
4
4
|
* Modifications: Mechanical source port with Node import prefixes, public package-root agent-directory
|
|
5
5
|
* resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling, unbound model
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sourcePackage": "@earendil-works/pi-coding-agent",
|
|
3
|
-
"sourceVersion": "1.0
|
|
3
|
+
"sourceVersion": "1.1.0",
|
|
4
4
|
"upstreamRepository": "https://github.com/earendil-works/pi.git",
|
|
5
|
-
"upstreamCommit": "
|
|
5
|
+
"upstreamCommit": "abe508e1b89912adde45528136c3221eb69acdd7",
|
|
6
6
|
"sourcePath": "dist/modes/interactive/assets/clankolas.png",
|
|
7
7
|
"sourceSha256": "169acd0dfe6fbb8d8742ed24a3fc654fd0b2e2d4223c733249c5493723f1b72d",
|
|
8
8
|
"license": "MIT",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/countdown-timer.ts.
|
|
4
4
|
* Modifications: Mechanical source port with ECMAScript private fields; imports remain on the public
|
|
5
5
|
* Pi TUI package root.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/earendil-announcement.ts.
|
|
4
4
|
* Modifications: Mechanical pinned source port with private imports remapped to public package-root
|
|
5
5
|
* types/APIs and A1-owned theme boundaries. The unchanged image is loaded lazily from its attributed,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-editor.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap pi-tui to the root public singleton, use owned
|
|
5
5
|
* keybindings/theme and external-editor seams, preserve editor layout, hints, focus, submission,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-editor.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap pi-tui to the root public singleton, use owned
|
|
5
5
|
* keybindings/theme and external-editor seams, preserve editor layout, hints, focus, submission,
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* Deviations: owned-modal-shortcut-hints.
|
|
9
9
|
*/
|
|
10
10
|
import { Container, Editor, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
11
|
-
import { DynamicBorder
|
|
11
|
+
import { DynamicBorder } from "../../../startup-public.js";
|
|
12
12
|
import { editInExternalEditor } from "../external-editor.js";
|
|
13
13
|
import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
|
|
14
|
-
import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
14
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, getPiSelectListTheme, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
15
15
|
export class ExtensionEditorComponent extends Container {
|
|
16
16
|
#editor;
|
|
17
17
|
#tui;
|
|
@@ -36,7 +36,7 @@ export class ExtensionEditorComponent extends Container {
|
|
|
36
36
|
|| process.env.EDITOR
|
|
37
37
|
|| (process.platform === "win32" ? "notepad" : "nano");
|
|
38
38
|
const { description, ...editorOptions } = options ?? {};
|
|
39
|
-
const header = addPiModalHeader(this, new DynamicBorder(), new Text(piTheme().fg("accent", title), 0, 0));
|
|
39
|
+
const header = addPiModalHeader(this, new DynamicBorder(paintPiBorder), new Text(piTheme().fg("accent", title), 0, 0));
|
|
40
40
|
if (description) {
|
|
41
41
|
this.addChild(new Spacer(1));
|
|
42
42
|
this.addChild(new Text(piTheme().fg("text", description), 0, 0));
|
|
@@ -44,7 +44,7 @@ export class ExtensionEditorComponent extends Container {
|
|
|
44
44
|
this.addChild(new Spacer(1));
|
|
45
45
|
this.#editor = new Editor(tui, {
|
|
46
46
|
borderColor: text => piTheme().fg("borderMuted", text),
|
|
47
|
-
selectList:
|
|
47
|
+
selectList: getPiSelectListTheme(),
|
|
48
48
|
}, editorOptions);
|
|
49
49
|
if (prefill)
|
|
50
50
|
this.#editor.setText(prefill);
|
|
@@ -59,7 +59,7 @@ export class ExtensionEditorComponent extends Container {
|
|
|
59
59
|
]);
|
|
60
60
|
this.addChild(new Text(hint, 0, 0));
|
|
61
61
|
this.addChild(new Spacer(1));
|
|
62
|
-
this.addChild(new DynamicBorder());
|
|
62
|
+
this.addChild(new DynamicBorder(paintPiBorder));
|
|
63
63
|
adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1, header });
|
|
64
64
|
}
|
|
65
65
|
handleInput(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-input.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
|
|
5
5
|
* bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { DynamicBorder } from "../../../startup-public.js";
|
|
11
11
|
import { Container, getKeybindings, Input, Spacer, Text } from "@earendil-works/pi-tui";
|
|
12
12
|
import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
|
|
13
|
-
import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
13
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
14
14
|
import { CountdownTimer } from "./countdown-timer.js";
|
|
15
15
|
/** Bare-A1 extension text input using the common modal shortcut row. */
|
|
16
16
|
export class ExtensionInputComponent extends Container {
|
|
@@ -33,7 +33,7 @@ export class ExtensionInputComponent extends Container {
|
|
|
33
33
|
this.#baseTitle = title;
|
|
34
34
|
const theme = piTheme();
|
|
35
35
|
this.#titleText = new Text(theme.fg("accent", theme.bold(title)), 0, 0);
|
|
36
|
-
const header = addPiModalHeader(this, new DynamicBorder(), this.#titleText);
|
|
36
|
+
const header = addPiModalHeader(this, new DynamicBorder(paintPiBorder), this.#titleText);
|
|
37
37
|
if (opts?.description) {
|
|
38
38
|
this.addChild(new Spacer(1));
|
|
39
39
|
this.addChild(new Text(theme.fg("text", opts.description), 0, 0));
|
|
@@ -54,7 +54,7 @@ export class ExtensionInputComponent extends Container {
|
|
|
54
54
|
{ key: keys.getKeys("tui.select.confirm").join("/"), action: "submit" },
|
|
55
55
|
DIALOG_CLOSE_SHORTCUT_HINT,
|
|
56
56
|
]), 0, 0));
|
|
57
|
-
this.addChild(new DynamicBorder());
|
|
57
|
+
this.addChild(new DynamicBorder(paintPiBorder));
|
|
58
58
|
adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1, header });
|
|
59
59
|
}
|
|
60
60
|
handleInput(keyData) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-selector.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
|
|
5
5
|
* bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { DynamicBorder } from "../../../startup-public.js";
|
|
11
11
|
import { Container, getKeybindings, Spacer, Text } from "@earendil-works/pi-tui";
|
|
12
12
|
import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
|
|
13
|
-
import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
13
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
14
14
|
import { CountdownTimer } from "./countdown-timer.js";
|
|
15
15
|
/** Bare-A1 extension selector using the common modal shortcut row. */
|
|
16
16
|
export class ExtensionSelectorComponent extends Container {
|
|
@@ -32,7 +32,7 @@ export class ExtensionSelectorComponent extends Container {
|
|
|
32
32
|
this.#onToggleToolsExpanded = opts?.onToggleToolsExpanded;
|
|
33
33
|
const theme = piTheme();
|
|
34
34
|
this.#titleText = new Text(theme.fg("accent", theme.bold(title)), 0, 0);
|
|
35
|
-
const header = addPiModalHeader(this, new DynamicBorder(), this.#titleText);
|
|
35
|
+
const header = addPiModalHeader(this, new DynamicBorder(paintPiBorder), this.#titleText);
|
|
36
36
|
if (opts?.description) {
|
|
37
37
|
this.addChild(new Spacer(1));
|
|
38
38
|
this.addChild(new Text(theme.fg("text", opts.description), 0, 0));
|
|
@@ -52,7 +52,7 @@ export class ExtensionSelectorComponent extends Container {
|
|
|
52
52
|
{ key: keys.getKeys("tui.select.confirm").join("/"), action: "select" },
|
|
53
53
|
DIALOG_CLOSE_SHORTCUT_HINT,
|
|
54
54
|
]), 0, 0));
|
|
55
|
-
this.addChild(new DynamicBorder());
|
|
55
|
+
this.addChild(new DynamicBorder(paintPiBorder));
|
|
56
56
|
adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1, header });
|
|
57
57
|
this.#updateList();
|
|
58
58
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/mermaid.ts.
|
|
4
4
|
* Modifications: Mechanical pinned source port with private imports remapped to public package-root
|
|
5
5
|
* types/APIs and A1-owned theme boundaries; behavior remains acceptance-tested.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.0
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/custom-editor.ts.
|
|
4
4
|
* Modifications: A1-owned class name and synchronized A1 keybinding contract replace the nominal
|
|
5
5
|
* private upstream keybinding constructor dependency; bare A1 injects the shared Settings/agent input
|
|
6
6
|
* frame, transient contextual-suggestion branch, and explicit body geometry for selection and
|
|
7
|
-
* above-prompt autocomplete. Bare A1 also clears a sole top-level
|
|
8
|
-
*
|
|
9
|
-
* tunnel rows, and synchronously retains then refreshes an exact top-level
|
|
10
|
-
* applies its row.
|
|
7
|
+
* above-prompt autocomplete with a one-cell outer gutter. Bare A1 also clears a sole top-level
|
|
8
|
+
* slash-command search on Escape and completes a selected or exact completed tunnel command with `:`
|
|
9
|
+
* and reopens the menu on its tunnel rows, and synchronously retains then refreshes an exact top-level
|
|
10
|
+
* command menu after Tab applies its row.
|
|
11
11
|
* Deviations: owned-shared-input-frame, above-prompt-autocomplete-placement,
|
|
12
12
|
* clear-command-search-on-escape, command-tunnel-colon-completion, keep-command-menu-open-after-tab.
|
|
13
13
|
*/
|