@timurproko/a1 0.2.7-dev.1270 → 0.2.7-dev.1276
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 +6 -0
- package/dist/app/session-shell/apps-dialog.d.ts +33 -0
- package/dist/app/session-shell/apps-dialog.js +62 -0
- package/dist/app/session-shell/dialog-coordinator.d.ts +12 -5
- package/dist/app/session-shell/dialog-coordinator.js +113 -15
- package/dist/app/session-shell/input-route.d.ts +23 -0
- package/dist/app/session-shell/input-route.js +59 -0
- package/dist/app/session-shell/session-selectors.d.ts +4 -4
- package/dist/app/session-shell/session-selectors.js +8 -3
- package/dist/app/session-shell/session-shell-root.js +6 -2
- package/dist/app/session-shell/session-shell.js +13 -5
- package/dist/app/session-shell/shell-host.d.ts +1 -0
- package/dist/app/session-shell/shell-host.js +22 -11
- package/dist/app/session-shell/viewport-pointer.js +5 -1
- package/dist/app/session-shell/workflow-output.js +12 -0
- package/dist/app/session-shell/workflow-router.d.ts +2 -2
- package/dist/composition/owned-ui.js +17 -13
- package/dist/composition/settings-route-host.js +1 -0
- package/dist/contracts/owned-ui/session-presenters.d.ts +1 -1
- package/dist/contracts/owned-ui/session-workflows.d.ts +3 -1
- package/dist/contracts/owned-ui/shell-components.d.ts +12 -0
- package/dist/contracts/presentation/component.d.ts +7 -0
- package/dist/contracts/presentation/index.d.ts +2 -0
- package/dist/contracts/presentation/index.js +4 -0
- package/dist/contracts/presentation/progress-palette.generated.d.ts +25 -1
- package/dist/contracts/presentation/progress-palette.generated.js +2 -135
- package/dist/contracts/presentation/terminal.d.ts +4 -0
- package/dist/contracts/presentation/theme.d.ts +2 -0
- package/dist/features/owned-ui/project-trust-dialog.d.ts +1 -1
- package/dist/features/owned-ui/project-trust-dialog.js +5 -5
- package/dist/features/owned-ui/project-trust-prompt.js +2 -2
- package/dist/features/owned-ui/reference-screen-app.d.ts +2 -0
- package/dist/features/owned-ui/reference-screen-app.js +4 -1
- package/dist/features/owned-ui/settings-app.js +6 -6
- package/dist/features/owned-ui/settings-model-dialog.js +3 -3
- package/dist/foundation/lifecycle/user-exports.d.ts +5 -0
- package/dist/foundation/lifecycle/user-exports.js +37 -0
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/integrations/pi/components/deferred-selector.d.ts +6 -0
- package/dist/integrations/pi/components/deferred-selector.js +40 -0
- package/dist/integrations/pi/components/login-dialog-loader.d.ts +3 -0
- package/dist/integrations/pi/components/login-dialog-loader.js +57 -0
- package/dist/integrations/pi/components/login-links.d.ts +6 -0
- package/dist/integrations/pi/components/login-links.js +31 -0
- package/dist/integrations/pi/components/login-text.d.ts +7 -0
- package/dist/integrations/pi/components/login-text.js +17 -0
- package/dist/integrations/pi/components/modal-frame.d.ts +5 -0
- package/dist/integrations/pi/components/modal-frame.js +30 -2
- package/dist/integrations/pi/components/models-dialog-loader.d.ts +11 -0
- package/dist/integrations/pi/components/models-dialog-loader.js +45 -0
- package/dist/integrations/pi/components/models-dialog.d.ts +2 -0
- package/dist/integrations/pi/components/models-dialog.js +13 -7
- 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/shell-editor-autocomplete.js +21 -15
- package/dist/integrations/pi/components/shell-footer-status.js +3 -2
- package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.js +3 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +13 -9
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +38 -43
- package/dist/integrations/pi/components/shell-session-info-reference.d.ts +1 -1
- package/dist/integrations/pi/components/shell-session-info-reference.js +49 -46
- package/dist/integrations/pi/components/theme.d.ts +4 -0
- package/dist/integrations/pi/components/theme.js +9 -0
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +8 -7
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +13 -7
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/auth-url.d.ts +16 -0
- package/dist/integrations/pi/components/upstream/components/auth-url.js +49 -0
- 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 +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-selector.d.ts +1 -0
- package/dist/integrations/pi/components/upstream/components/extension-selector.js +30 -12
- package/dist/integrations/pi/components/upstream/components/login-dialog.d.ts +3 -0
- package/dist/integrations/pi/components/upstream/components/login-dialog.js +216 -0
- package/dist/integrations/pi/components/upstream/components/mermaid.d.ts +2 -1
- package/dist/integrations/pi/components/upstream/components/mermaid.js +26 -21
- package/dist/integrations/pi/components/upstream/components/oauth-selector.d.ts +19 -0
- package/dist/integrations/pi/components/upstream/components/oauth-selector.js +123 -0
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
- 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/session-footer.js +17 -19
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +6 -2
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +27 -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 +1 -1
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +7 -6
- package/dist/integrations/pi/components/upstream/components/trust-selector.d.ts +2 -0
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +30 -13
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.js +2 -2
- 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 +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
- package/dist/integrations/pi/engine/adapter.d.ts +1 -1
- package/dist/integrations/pi/engine/adapter.js +3 -3
- package/dist/integrations/pi/engine/host.d.ts +1 -1
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/workflow-export.d.ts +4 -0
- package/dist/integrations/pi/engine/workflow-export.js +25 -0
- package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -0
- package/dist/integrations/pi/engine/workflow-runner.js +6 -10
- package/dist/integrations/pi/engine/workflow-support.d.ts +2 -1
- package/dist/integrations/pi/engine/workflow-support.js +28 -25
- package/dist/integrations/pi/engine/workflows.d.ts +6 -1
- package/dist/integrations/pi/engine/workflows.js +1 -1
- package/dist/integrations/pi/session-presenters/components.d.ts +1 -1
- package/dist/integrations/pi/session-presenters/components.js +8 -8
- package/dist/integrations/pi/session-presenters/presentation.js +2 -1
- package/dist/integrations/pi/session-presenters/presenters.js +24 -12
- package/dist/integrations/pi/startup-public.js +289 -240
- package/dist/integrations/pi/startup-public.manifest.json +579 -363
- package/dist/integrations/pi/tui-runtime/adapter.js +3 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +5 -2
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +12 -2
- package/dist/runtime-payload-inventory.json +8044 -6930
- package/dist/ui/components/dialog-panel.d.ts +4 -3
- package/dist/ui/components/dialog-panel.js +9 -13
- package/dist/ui/components/index.d.ts +1 -1
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/list-block.d.ts +2 -2
- package/dist/ui/components/list-block.js +4 -3
- package/dist/ui/components/spans.d.ts +7 -0
- package/dist/ui/components/spans.js +63 -1
- package/dist/ui/settings/early-accent.d.ts +24 -0
- package/docs/architecture/prompt-suggestions.md +1 -1
- package/docs/architecture/ui-reference-provenance.md +2 -1
- package/docs/features/prompt-history.md +1 -1
- package/docs/features/session-exports.md +15 -0
- package/docs/local-worktree-cleanup.md +24 -0
- package/package.json +6 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
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
|
-
* resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling,
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* labels.
|
|
9
|
-
* Deviations: keybindings-public-config-boundary, owned-level-cycle-shortcut,
|
|
5
|
+
* resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling, Ctrl+M model cycling
|
|
6
|
+
* with ordinary Enter preserved, Ctrl+P Launcher, command-only model selection, Tab tree-filter
|
|
7
|
+
* cycling, tree-local navigation aliases, cross-platform Alt+Up queued-message restoration, and an
|
|
8
|
+
* implicit Ctrl+C selection-cancel alias omitted from shortcut labels.
|
|
9
|
+
* Deviations: keybindings-public-config-boundary, owned-level-cycle-shortcut, owned-apps-shortcuts,
|
|
10
10
|
* owned-input-keybinding-aliases, owned-session-tree-dialog, owned-dialog-ctrl-c-cancel.
|
|
11
11
|
*/
|
|
12
12
|
import { Key, matchesKey, TUI_KEYBINDINGS, KeybindingsManager as TuiKeybindingsManager, } from "@earendil-works/pi-tui";
|
|
@@ -85,7 +85,7 @@ export const KEYBINDINGS = {
|
|
|
85
85
|
description: "Restore queued messages",
|
|
86
86
|
},
|
|
87
87
|
"app.clipboard.pasteImage": {
|
|
88
|
-
defaultKeys: windowsKeybindings ? "alt+v" : "ctrl+v",
|
|
88
|
+
defaultKeys: windowsKeybindings ? ["alt+v", "ctrl+v"] : "ctrl+v",
|
|
89
89
|
description: "Paste files on macOS, images, or text from clipboard",
|
|
90
90
|
},
|
|
91
91
|
"app.session.new": { defaultKeys: [], description: "Start a new session" },
|
|
@@ -186,6 +186,8 @@ const OWNED_INPUT_KEYBINDINGS = {
|
|
|
186
186
|
...KEYBINDINGS,
|
|
187
187
|
"app.thinking.cycle": { ...KEYBINDINGS["app.thinking.cycle"], defaultKeys: "ctrl+l" },
|
|
188
188
|
"app.model.select": { ...KEYBINDINGS["app.model.select"], defaultKeys: [] },
|
|
189
|
+
"app.model.cycleForward": { ...KEYBINDINGS["app.model.cycleForward"], defaultKeys: "ctrl+m" },
|
|
190
|
+
"owned.apps.open": { defaultKeys: "ctrl+p", description: "Open Launcher" },
|
|
189
191
|
"app.message.dequeue": { ...KEYBINDINGS["app.message.dequeue"], defaultKeys: "alt+up" },
|
|
190
192
|
"app.tree.filter.cycleForward": { ...KEYBINDINGS["app.tree.filter.cycleForward"], defaultKeys: "tab" },
|
|
191
193
|
"tui.editor.deleteWordBackward": {
|
|
@@ -369,6 +371,10 @@ export class KeybindingsManager extends TuiKeybindingsManager {
|
|
|
369
371
|
}
|
|
370
372
|
// Protocol: Ctrl+C is a conventional dialog escape hatch, not advertised keybinding chrome.
|
|
371
373
|
matches(data, keybinding) {
|
|
374
|
+
// Compatibility: legacy Ctrl+M is indistinguishable from Enter; never steal ordinary submission.
|
|
375
|
+
if (data === "\r" && this.getKeys(keybinding).includes("ctrl+m")) {
|
|
376
|
+
return this.getKeys(keybinding).some(key => key !== "ctrl+m" && matchesKey(data, key));
|
|
377
|
+
}
|
|
372
378
|
return keybinding === "tui.select.cancel" && matchesKey(data, "ctrl+c")
|
|
373
379
|
|| super.matches(data, keybinding);
|
|
374
380
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sourcePackage": "@earendil-works/pi-coding-agent",
|
|
3
|
-
"sourceVersion": "1.5.
|
|
3
|
+
"sourceVersion": "1.5.1",
|
|
4
4
|
"upstreamRepository": "https://github.com/earendil-works/pi.git",
|
|
5
|
-
"upstreamCommit": "
|
|
5
|
+
"upstreamCommit": "dd30101cfc5b0609411dd80b6f93adbc14db14cf",
|
|
6
6
|
"sourcePath": "dist/modes/interactive/assets/clankolas.png",
|
|
7
7
|
"sourceSha256": "169acd0dfe6fbb8d8742ed24a3fc654fd0b2e2d4223c733249c5493723f1b72d",
|
|
8
8
|
"license": "MIT",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/components/auth-url.ts.
|
|
4
|
+
* Modifications: Adapt sign-in URL/copy feedback to live semantic roles, shared zero-inset login
|
|
5
|
+
* content and canonical shortcut hints. Preserve safe hyperlinks, copy results and lifetime guards;
|
|
6
|
+
* the comparison profile keeps the public component.
|
|
7
|
+
* Deviations: shared-login-template.
|
|
8
|
+
*/
|
|
9
|
+
import { Container } from "@earendil-works/pi-tui";
|
|
10
|
+
/** A live-themed browser URL whose copy feedback stays local to the same login state. */
|
|
11
|
+
export declare class AuthUrlComponent extends Container {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(url: string, requestRender: () => void);
|
|
14
|
+
copy(): Promise<void>;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/components/auth-url.ts.
|
|
4
|
+
* Modifications: Adapt sign-in URL/copy feedback to live semantic roles, shared zero-inset login
|
|
5
|
+
* content and canonical shortcut hints. Preserve safe hyperlinks, copy results and lifetime guards;
|
|
6
|
+
* the comparison profile keeps the public component.
|
|
7
|
+
* Deviations: shared-login-template.
|
|
8
|
+
*/
|
|
9
|
+
import { Container, getKeybindings } from "@earendil-works/pi-tui";
|
|
10
|
+
import { copyToClipboard } from "../../../startup-public.js";
|
|
11
|
+
import { loginLink, loginWebUrl } from "../../login-links.js";
|
|
12
|
+
import { loginText } from "../../login-text.js";
|
|
13
|
+
import { renderPiModalShortcutHints } from "../../theme.js";
|
|
14
|
+
/** A live-themed browser URL whose copy feedback stays local to the same login state. */
|
|
15
|
+
export class AuthUrlComponent extends Container {
|
|
16
|
+
#url;
|
|
17
|
+
#render;
|
|
18
|
+
#feedback;
|
|
19
|
+
#failure = "";
|
|
20
|
+
#closed = false;
|
|
21
|
+
constructor(url, requestRender) {
|
|
22
|
+
super();
|
|
23
|
+
this.#url = loginWebUrl(url) ?? url;
|
|
24
|
+
this.#render = requestRender;
|
|
25
|
+
this.addChild(loginText(() => loginLink(this.#url), "accent"));
|
|
26
|
+
this.addChild({
|
|
27
|
+
render: width => {
|
|
28
|
+
if (this.#feedback !== undefined)
|
|
29
|
+
return loginText(this.#feedback === "copied" ? "Copied URL to clipboard" : this.#failure, this.#feedback === "copied" ? "success" : "error").render(width);
|
|
30
|
+
const click = process.platform === "darwin" ? "Cmd+click to open" : "Ctrl+click to open";
|
|
31
|
+
return loginText(() => `${loginLink(this.#url, click)} ${renderPiModalShortcutHints([{ key: getKeybindings().getKeys("app.message.copy").join("/"), action: "copy" }])}`).render(width);
|
|
32
|
+
},
|
|
33
|
+
invalidate() { },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async copy() {
|
|
37
|
+
try {
|
|
38
|
+
await copyToClipboard(this.#url);
|
|
39
|
+
this.#feedback = "copied";
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
this.#feedback = "failed";
|
|
43
|
+
this.#failure = error instanceof Error ? error.message : String(error);
|
|
44
|
+
}
|
|
45
|
+
if (!this.#closed)
|
|
46
|
+
this.#render();
|
|
47
|
+
}
|
|
48
|
+
dispose() { this.#closed = true; }
|
|
49
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
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.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
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.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
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.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
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.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
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
|
|
@@ -4,6 +4,7 @@ interface ExtensionSelectorOptions {
|
|
|
4
4
|
readonly timeout?: number;
|
|
5
5
|
readonly description?: string;
|
|
6
6
|
readonly onToggleToolsExpanded?: () => void;
|
|
7
|
+
readonly standardSelection?: boolean;
|
|
7
8
|
}
|
|
8
9
|
/** Bare-A1 extension selector using the common modal shortcut row. */
|
|
9
10
|
export declare class ExtensionSelectorComponent extends Container {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-selector.ts.
|
|
4
|
-
* Modifications: Mechanical port
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* disposal behavior.
|
|
4
|
+
* Modifications: Mechanical port with public imports, private fields, shared shortcut rows and compact
|
|
5
|
+
* framing; internal choices opt into normal labels over selected backgrounds and circular navigation
|
|
6
|
+
* while preserving extension/comparison styling, timeout, cancellation, and disposal.
|
|
8
7
|
* Deviations: owned-modal-shortcut-hints.
|
|
9
8
|
*/
|
|
9
|
+
import { wrapChoiceIndex } from "../../../../../contracts/presentation/index.js";
|
|
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, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
13
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints, renderPiModalListRow } 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 {
|
|
17
17
|
#options;
|
|
18
|
+
#standardSelection;
|
|
18
19
|
#selectedIndex = 0;
|
|
19
20
|
#listContainer = new Container();
|
|
20
21
|
#onSelect;
|
|
@@ -26,6 +27,7 @@ export class ExtensionSelectorComponent extends Container {
|
|
|
26
27
|
constructor(title, options, onSelect, onCancel, opts) {
|
|
27
28
|
super();
|
|
28
29
|
this.#options = options;
|
|
30
|
+
this.#standardSelection = opts?.standardSelection === true;
|
|
29
31
|
this.#onSelect = onSelect;
|
|
30
32
|
this.#onCancel = onCancel;
|
|
31
33
|
this.#baseTitle = title;
|
|
@@ -59,11 +61,27 @@ export class ExtensionSelectorComponent extends Container {
|
|
|
59
61
|
#updateList() {
|
|
60
62
|
this.#listContainer.clear();
|
|
61
63
|
const theme = piTheme();
|
|
62
|
-
|
|
64
|
+
const maxVisible = 10;
|
|
65
|
+
// Center the window on the selection, then clamp it to the list boundaries.
|
|
66
|
+
const startIndex = Math.max(0, Math.min(this.#selectedIndex - Math.floor(maxVisible / 2), this.#options.length - maxVisible));
|
|
67
|
+
const endIndex = Math.min(startIndex + maxVisible, this.#options.length);
|
|
68
|
+
for (let index = startIndex; index < endIndex; index += 1) {
|
|
63
69
|
const option = this.#options[index];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
const selected = index === this.#selectedIndex;
|
|
71
|
+
const content = selected
|
|
72
|
+
? theme.fg("accent", "→ ") + theme.fg(this.#standardSelection ? "text" : "accent", option)
|
|
73
|
+
: ` ${theme.fg("text", option)}`;
|
|
74
|
+
this.#listContainer.addChild(this.#standardSelection ? {
|
|
75
|
+
render: width => {
|
|
76
|
+
const current = piTheme();
|
|
77
|
+
const arrow = selected ? current.fg("accent", "→ ") : " ";
|
|
78
|
+
return [renderPiModalListRow(`${arrow}${current.fg("text", option)}`, width, selected)];
|
|
79
|
+
},
|
|
80
|
+
invalidate: () => { },
|
|
81
|
+
} : new Text(content, 0, 0));
|
|
82
|
+
}
|
|
83
|
+
if (startIndex > 0 || endIndex < this.#options.length) {
|
|
84
|
+
this.#listContainer.addChild(new Text(theme.fg("muted", ` (${this.#selectedIndex + 1}/${this.#options.length})`), 0, 0));
|
|
67
85
|
}
|
|
68
86
|
}
|
|
69
87
|
handleInput(keyData) {
|
|
@@ -71,11 +89,11 @@ export class ExtensionSelectorComponent extends Container {
|
|
|
71
89
|
if (keys.matches(keyData, "app.tools.expand"))
|
|
72
90
|
this.#onToggleToolsExpanded?.();
|
|
73
91
|
else if (keys.matches(keyData, "tui.select.up") || keyData === "k") {
|
|
74
|
-
this.#selectedIndex = Math.max(0, this.#selectedIndex - 1);
|
|
92
|
+
this.#selectedIndex = this.#standardSelection ? wrapChoiceIndex(this.#selectedIndex, -1, this.#options.length) : Math.max(0, this.#selectedIndex - 1);
|
|
75
93
|
this.#updateList();
|
|
76
94
|
}
|
|
77
95
|
else if (keys.matches(keyData, "tui.select.down") || keyData === "j") {
|
|
78
|
-
this.#selectedIndex = Math.min(this.#options.length - 1, this.#selectedIndex + 1);
|
|
96
|
+
this.#selectedIndex = this.#standardSelection ? wrapChoiceIndex(this.#selectedIndex, 1, this.#options.length) : Math.min(this.#options.length - 1, this.#selectedIndex + 1);
|
|
79
97
|
this.#updateList();
|
|
80
98
|
}
|
|
81
99
|
else if (keys.matches(keyData, "tui.select.confirm") || keyData === "\n") {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OwnedUiShellLoginDialogPort, OwnedUiShellRuntime } from "../../../../../contracts/owned-ui/index.js";
|
|
2
|
+
/** One owned login port for every provider, keeping all state methods on the shared template. */
|
|
3
|
+
export declare function createThemedLoginDialog(runtime: OwnedUiShellRuntime, providerId: string, complete: (success: boolean, message?: string) => void, providerName?: string, title?: string): OwnedUiShellLoginDialogPort;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/components/login-dialog.ts.
|
|
4
|
+
* Modifications: Adapt all provider login states to shared live-themed framing: title, immediate muted
|
|
5
|
+
* description, blank row before accent-chevron input and one-cell inset. Preserve prompt, callback,
|
|
6
|
+
* device/copy, browser, cancellation and nested lifecycle contracts through neutral runtime ports;
|
|
7
|
+
* retain the public component for comparison.
|
|
8
|
+
* Deviations: shared-login-template.
|
|
9
|
+
*/
|
|
10
|
+
import { Container, getKeybindings, Input, Spacer } from "@earendil-works/pi-tui";
|
|
11
|
+
import { copyToClipboard, DynamicBorder } from "../../../startup-public.js";
|
|
12
|
+
import { addPiModalHeader, adoptPiModalFrame, renderPiModalSearchInput } from "../../modal-frame.js";
|
|
13
|
+
import { componentPort } from "../../shell-shared-facade.js";
|
|
14
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, internalDialogTitle, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
|
|
15
|
+
import { loginLink, loginWebUrl, openLoginBrowser } from "../../login-links.js";
|
|
16
|
+
import { loginPlainText, loginText } from "../../login-text.js";
|
|
17
|
+
import { AuthUrlComponent } from "./auth-url.js";
|
|
18
|
+
/** Provider-independent login state presentation with the pinned interaction/effect contract. */
|
|
19
|
+
class LoginDialog extends Container {
|
|
20
|
+
#input = new Input();
|
|
21
|
+
#content = new Container();
|
|
22
|
+
#runtime;
|
|
23
|
+
#complete;
|
|
24
|
+
#abort = new AbortController();
|
|
25
|
+
#pending;
|
|
26
|
+
#auth;
|
|
27
|
+
#device;
|
|
28
|
+
#deviceHint;
|
|
29
|
+
#focused = false;
|
|
30
|
+
#closed = false;
|
|
31
|
+
constructor(runtime, providerId, complete, providerName, title) {
|
|
32
|
+
super();
|
|
33
|
+
this.#runtime = runtime;
|
|
34
|
+
this.#complete = complete;
|
|
35
|
+
const heading = internalDialogTitle(title ?? `Login to ${providerName ?? providerId}`);
|
|
36
|
+
const header = addPiModalHeader(this, new DynamicBorder(paintPiBorder), loginText(heading, "accent", true));
|
|
37
|
+
this.addChild(this.#content);
|
|
38
|
+
this.addChild(new Spacer(1));
|
|
39
|
+
this.addChild({
|
|
40
|
+
render: width => loginText(() => renderPiModalShortcutHints([DIALOG_CLOSE_SHORTCUT_HINT])).render(width),
|
|
41
|
+
invalidate() { },
|
|
42
|
+
});
|
|
43
|
+
this.addChild(new DynamicBorder(paintPiBorder));
|
|
44
|
+
adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1, header });
|
|
45
|
+
this.#input.onSubmit = value => {
|
|
46
|
+
const pending = this.#pending;
|
|
47
|
+
if (pending === undefined || this.#closed)
|
|
48
|
+
return;
|
|
49
|
+
this.#pending = undefined;
|
|
50
|
+
this.#content.children = this.#content.children.map(child => child === this.#inputView
|
|
51
|
+
? { render: width => loginText(() => `${piTheme().fg("accent", ">")} ${piTheme().fg("text", loginPlainText(value))}`).render(width), invalidate() { } }
|
|
52
|
+
: child);
|
|
53
|
+
pending.resolve(value);
|
|
54
|
+
this.#runtime.requestRender();
|
|
55
|
+
};
|
|
56
|
+
this.#input.onEscape = () => this.#cancel();
|
|
57
|
+
}
|
|
58
|
+
#inputView = {
|
|
59
|
+
render: width => renderPiModalSearchInput(this.#input, width),
|
|
60
|
+
invalidate: () => this.#input.invalidate(),
|
|
61
|
+
};
|
|
62
|
+
get focused() { return this.#focused; }
|
|
63
|
+
set focused(value) { this.#focused = value; this.#input.focused = value; }
|
|
64
|
+
showAuth(url, instructions) {
|
|
65
|
+
if (this.#closed)
|
|
66
|
+
return;
|
|
67
|
+
this.#clearContent();
|
|
68
|
+
if (instructions)
|
|
69
|
+
this.#content.addChild(loginText(instructions));
|
|
70
|
+
else
|
|
71
|
+
this.#content.addChild(loginText("Continue in your browser"));
|
|
72
|
+
this.#content.addChild(new Spacer(1));
|
|
73
|
+
this.#auth = new AuthUrlComponent(url, () => { if (!this.#closed)
|
|
74
|
+
this.#runtime.requestRender(); });
|
|
75
|
+
this.#content.addChild(this.#auth);
|
|
76
|
+
openLoginBrowser(url);
|
|
77
|
+
this.#runtime.requestRender();
|
|
78
|
+
}
|
|
79
|
+
showDeviceCode(info) {
|
|
80
|
+
if (this.#closed)
|
|
81
|
+
return;
|
|
82
|
+
this.#clearContent();
|
|
83
|
+
this.#content.addChild(loginText("Continue in your browser"));
|
|
84
|
+
this.#content.addChild(new Spacer(1));
|
|
85
|
+
this.#content.addChild(loginText(() => loginLink(info.verificationUri), "accent"));
|
|
86
|
+
const click = process.platform === "darwin" ? "Cmd+click to open" : "Ctrl+click to open";
|
|
87
|
+
this.#content.addChild(loginText(() => loginLink(info.verificationUri, click), "dim"));
|
|
88
|
+
this.#content.addChild(new Spacer(1));
|
|
89
|
+
this.#content.addChild(loginText(`Enter code: ${info.userCode}`, "warning"));
|
|
90
|
+
const hint = new Container();
|
|
91
|
+
hint.addChild({ render: width => loginText(() => renderPiModalShortcutHints([{ key: getKeybindings().getKeys("tui.select.confirm").join("/"), action: "open browser and copy code" }])).render(width), invalidate() { } });
|
|
92
|
+
this.#content.addChild(hint);
|
|
93
|
+
this.#device = { info, hint };
|
|
94
|
+
this.#deviceHint = hint;
|
|
95
|
+
this.#runtime.requestRender();
|
|
96
|
+
}
|
|
97
|
+
showManualInput(message) { return this.showPrompt(message); }
|
|
98
|
+
showPrompt(message, placeholder) {
|
|
99
|
+
if (this.#closed)
|
|
100
|
+
return Promise.reject(new Error("Login cancelled"));
|
|
101
|
+
this.#clearDevice();
|
|
102
|
+
const context = [...this.#content.children];
|
|
103
|
+
// Invariant: the current description is directly under the title; retained auth context follows input.
|
|
104
|
+
this.#content.clear();
|
|
105
|
+
this.#content.addChild(loginText(message));
|
|
106
|
+
if (placeholder)
|
|
107
|
+
this.#content.addChild(loginText(`e.g., ${placeholder}`, "dim"));
|
|
108
|
+
this.#content.addChild(new Spacer(1));
|
|
109
|
+
this.#input.setValue("");
|
|
110
|
+
this.#content.addChild(this.#inputView);
|
|
111
|
+
if (context.length > 0) {
|
|
112
|
+
this.#content.addChild(new Spacer(1));
|
|
113
|
+
for (const child of context)
|
|
114
|
+
this.#content.addChild(child);
|
|
115
|
+
}
|
|
116
|
+
this.#runtime.requestRender();
|
|
117
|
+
return new Promise((resolve, reject) => { this.#pending = { resolve, reject }; });
|
|
118
|
+
}
|
|
119
|
+
showDetails(lines) {
|
|
120
|
+
if (this.#closed)
|
|
121
|
+
return;
|
|
122
|
+
this.#clearContent();
|
|
123
|
+
for (const line of lines)
|
|
124
|
+
this.#content.addChild(loginText(line));
|
|
125
|
+
this.#runtime.requestRender();
|
|
126
|
+
}
|
|
127
|
+
showInfo(message, links = []) {
|
|
128
|
+
if (this.#closed)
|
|
129
|
+
return;
|
|
130
|
+
this.#appendDescription(message);
|
|
131
|
+
for (const link of links)
|
|
132
|
+
this.#content.addChild(loginText(() => loginLink(link.url, link.label ? `${link.label}: ${loginWebUrl(link.url) ?? link.url}` : undefined), "accent"));
|
|
133
|
+
this.#runtime.requestRender();
|
|
134
|
+
}
|
|
135
|
+
showWaiting(message) { if (!this.#closed) {
|
|
136
|
+
this.#appendDescription(message);
|
|
137
|
+
this.#runtime.requestRender();
|
|
138
|
+
} }
|
|
139
|
+
showProgress(message) { if (!this.#closed) {
|
|
140
|
+
this.#content.addChild(loginText(message));
|
|
141
|
+
this.#runtime.requestRender();
|
|
142
|
+
} }
|
|
143
|
+
handleInput(data) {
|
|
144
|
+
if (this.#closed)
|
|
145
|
+
return;
|
|
146
|
+
const keys = getKeybindings();
|
|
147
|
+
if (keys.matches(data, "tui.select.cancel")) {
|
|
148
|
+
this.#cancel();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (this.#auth !== undefined && keys.matches(data, "app.message.copy")) {
|
|
152
|
+
void this.#auth.copy();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (this.#device !== undefined && this.#pending === undefined && this.#focused && keys.matches(data, "tui.select.confirm")) {
|
|
156
|
+
const { info, hint } = this.#device;
|
|
157
|
+
this.#device = undefined;
|
|
158
|
+
hint.clear();
|
|
159
|
+
hint.addChild(loginText("Copying code...", "dim"));
|
|
160
|
+
openLoginBrowser(info.verificationUri);
|
|
161
|
+
void copyToClipboard(info.userCode).then(() => this.#deviceStatus(hint, "Code copied to clipboard"), () => this.#deviceStatus(hint, "Copy code manually"));
|
|
162
|
+
this.#runtime.requestRender();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
this.#input.handleInput(data);
|
|
166
|
+
}
|
|
167
|
+
dispose() {
|
|
168
|
+
if (this.#closed)
|
|
169
|
+
return;
|
|
170
|
+
this.#closed = true;
|
|
171
|
+
this.#abort.abort();
|
|
172
|
+
this.#auth?.dispose();
|
|
173
|
+
this.#pending?.reject(new Error("Login cancelled"));
|
|
174
|
+
this.#pending = undefined;
|
|
175
|
+
}
|
|
176
|
+
#cancel() { this.dispose(); this.#complete(false, "Login cancelled"); }
|
|
177
|
+
#appendDescription(message) {
|
|
178
|
+
if (this.#content.children.length > 0)
|
|
179
|
+
this.#content.addChild(new Spacer(1));
|
|
180
|
+
this.#content.addChild(loginText(message));
|
|
181
|
+
}
|
|
182
|
+
#clearDevice() {
|
|
183
|
+
if (this.#deviceHint !== undefined)
|
|
184
|
+
this.#content.removeChild(this.#deviceHint);
|
|
185
|
+
this.#deviceHint = undefined;
|
|
186
|
+
this.#device = undefined;
|
|
187
|
+
}
|
|
188
|
+
#clearContent() {
|
|
189
|
+
this.#clearDevice();
|
|
190
|
+
this.#auth?.dispose();
|
|
191
|
+
this.#auth = undefined;
|
|
192
|
+
this.#content.clear();
|
|
193
|
+
}
|
|
194
|
+
#deviceStatus(hint, message) {
|
|
195
|
+
if (this.#closed || !this.#focused || !this.#content.children.includes(hint))
|
|
196
|
+
return;
|
|
197
|
+
hint.clear();
|
|
198
|
+
hint.addChild(loginText(message, "dim"));
|
|
199
|
+
this.#runtime.requestRender();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/** One owned login port for every provider, keeping all state methods on the shared template. */
|
|
203
|
+
export function createThemedLoginDialog(runtime, providerId, complete, providerName, title) {
|
|
204
|
+
const dialog = new LoginDialog(runtime, providerId, complete, providerName, title);
|
|
205
|
+
return {
|
|
206
|
+
...componentPort(dialog),
|
|
207
|
+
showAuth: (url, instructions) => dialog.showAuth(url, instructions),
|
|
208
|
+
showDeviceCode: info => dialog.showDeviceCode(info),
|
|
209
|
+
showManualInput: message => dialog.showManualInput(message),
|
|
210
|
+
showPrompt: (message, placeholder) => dialog.showPrompt(message, placeholder),
|
|
211
|
+
showDetails: lines => dialog.showDetails(lines),
|
|
212
|
+
showInfo: (message, links) => dialog.showInfo(message, links),
|
|
213
|
+
showWaiting: message => dialog.showWaiting(message),
|
|
214
|
+
showProgress: message => dialog.showProgress(message),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { MarkdownTransformer, Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
export type MermaidRenderingMode = "off" | "final" | "streaming";
|
|
3
|
+
type MermaidTheme = Pick<Theme, "fg" | "getFgAnsi">;
|
|
3
4
|
interface MermaidTransformerOptions {
|
|
4
5
|
getMode: () => MermaidRenderingMode;
|
|
5
|
-
theme?:
|
|
6
|
+
theme?: MermaidTheme;
|
|
6
7
|
}
|
|
7
8
|
/** Create a transformer that replaces top-level Mermaid code blocks with Unicode terminal diagrams. */
|
|
8
9
|
export declare function createMermaidMarkdownTransformer(options: MermaidTransformerOptions): MarkdownTransformer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.5.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
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.
|
|
6
6
|
* Deviations: none.
|
|
7
7
|
*/
|
|
8
|
-
import { Marked } from "@earendil-works/pi-tui";
|
|
9
|
-
import { render } from "
|
|
8
|
+
import { getCapabilities, Marked } from "@earendil-works/pi-tui";
|
|
9
|
+
import { render, toAnsi } from "lovely-mermaid";
|
|
10
10
|
const markdownParser = new Marked();
|
|
11
11
|
function isMermaid(token) {
|
|
12
12
|
return token.type === "code" && token.lang?.trim().split(/\s+/, 1)[0]?.toLowerCase() === "mermaid";
|
|
@@ -30,31 +30,36 @@ function codeSpan(line) {
|
|
|
30
30
|
const padding = content.startsWith("`") || content.endsWith("`") ? " " : "";
|
|
31
31
|
return `${fence}${padding}${content}${padding}${fence}`;
|
|
32
32
|
}
|
|
33
|
-
function styleSpan(span, theme) {
|
|
34
|
-
switch (span.cls) {
|
|
35
|
-
case "border":
|
|
36
|
-
return theme.fg("borderMuted", span.text);
|
|
37
|
-
case "text":
|
|
38
|
-
return theme.fg("text", span.text);
|
|
39
|
-
case "edge":
|
|
40
|
-
return theme.fg("accent", span.text);
|
|
41
|
-
case "edgeLabel":
|
|
42
|
-
return theme.fg("muted", span.text);
|
|
43
|
-
case "title":
|
|
44
|
-
return theme.fg("accent", theme.bold(span.text));
|
|
45
|
-
case "none":
|
|
46
|
-
return span.text;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
33
|
function themedLines(art, theme) {
|
|
50
|
-
|
|
34
|
+
const foreground = (color) => theme.getFgAnsi(color).slice(2, -1);
|
|
35
|
+
const ansiTheme = {
|
|
36
|
+
border: foreground("borderMuted"),
|
|
37
|
+
text: foreground("text"),
|
|
38
|
+
edge: foreground("accent"),
|
|
39
|
+
edgeLabel: foreground("text"),
|
|
40
|
+
title: `1;${foreground("accent")}`,
|
|
41
|
+
};
|
|
42
|
+
const linkLabels = getCapabilities().hyperlinks;
|
|
43
|
+
const displayArt = {
|
|
44
|
+
...art,
|
|
45
|
+
// Only osc 8 the text, not the whole box.
|
|
46
|
+
styled: art.styled.map((row) => row.map((span) => {
|
|
47
|
+
if (span.href === undefined || (linkLabels && span.role === "text"))
|
|
48
|
+
return span;
|
|
49
|
+
const unlinked = { ...span };
|
|
50
|
+
delete unlinked.href;
|
|
51
|
+
return unlinked;
|
|
52
|
+
})),
|
|
53
|
+
};
|
|
54
|
+
return toAnsi(displayArt, ansiTheme);
|
|
51
55
|
}
|
|
52
56
|
/** Create a transformer that replaces top-level Mermaid code blocks with Unicode terminal diagrams. */
|
|
53
57
|
export function createMermaidMarkdownTransformer(options) {
|
|
54
58
|
return (markdown, context) => {
|
|
55
59
|
const mode = options.getMode();
|
|
60
|
+
// Diagrams render in user and assistant text and in model-written summaries, not in thinking or other surfaces.
|
|
56
61
|
if (mode === "off" ||
|
|
57
|
-
context.messageType
|
|
62
|
+
(context.messageType !== "user" && context.messageType !== "assistant" && context.messageType !== "summary") ||
|
|
58
63
|
(context.isStreaming && mode !== "streaming")) {
|
|
59
64
|
return markdown;
|
|
60
65
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.5.1 (MIT), commit dd30101cfc5b0609411dd80b6f93adbc14db14cf,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/components/oauth-selector.ts.
|
|
4
|
+
* Modifications: Adapt the provider controller to injected neutral options, shared framing, live
|
|
5
|
+
* roles, Title Case and circular navigation. Configured status uses a muted dot, success-green
|
|
6
|
+
* configured text and trailing checkmark without method/source qualifiers. Omit decorative
|
|
7
|
+
* preferred-partner badges while retaining filtering, paging, actions and comparison presentation.
|
|
8
|
+
* Deviations: standard-sign-in-dialog-styling.
|
|
9
|
+
*/
|
|
10
|
+
import { Container } from "@earendil-works/pi-tui";
|
|
11
|
+
import type { OwnedUiShellAuthProviderOption as Provider } from "../../../../../contracts/owned-ui/index.js";
|
|
12
|
+
/** Owned provider controller with pinned content/status semantics and circular choice navigation. */
|
|
13
|
+
export declare class AuthProviderSelector extends Container {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(mode: "login" | "logout", providers: readonly Provider[], select: (id: string) => void, cancel: () => void, query?: string);
|
|
16
|
+
get focused(): boolean;
|
|
17
|
+
set focused(value: boolean);
|
|
18
|
+
handleInput(data: string): void;
|
|
19
|
+
}
|