@timurproko/a1 0.2.7-dev.1252 → 0.2.7-dev.1255
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/ui.js +3 -3
- package/dist/app/session-shell/clipboard-diagnostics.d.ts +2 -2
- package/dist/app/session-shell/clipboard-image.d.ts +0 -1
- package/dist/app/session-shell/clipboard-image.js +1 -1
- package/dist/app/session-shell/dialog-coordinator.d.ts +6 -5
- package/dist/app/session-shell/dialog-coordinator.js +3 -4
- package/dist/app/session-shell/dock-chrome.d.ts +11 -6
- package/dist/app/session-shell/dock-chrome.js +5 -8
- package/dist/app/session-shell/editor-hyperlink-budget.d.ts +0 -2
- package/dist/app/session-shell/editor-hyperlink-budget.js +1 -1
- package/dist/app/session-shell/exit-notice.d.ts +2 -2
- package/dist/app/session-shell/exit-notice.js +1 -1
- package/dist/app/session-shell/extension-surface.d.ts +8 -7
- package/dist/app/session-shell/helper-pool.d.ts +3 -4
- package/dist/app/session-shell/helper-pool.js +1 -1
- package/dist/app/session-shell/image-preparation-client.d.ts +4 -3
- package/dist/app/session-shell/image-preparation.d.ts +0 -2
- package/dist/app/session-shell/image-preparation.js +2 -2
- package/dist/app/session-shell/image-source.d.ts +2 -3
- package/dist/app/session-shell/image-source.js +2 -2
- package/dist/app/session-shell/input-surface-switch.d.ts +9 -7
- package/dist/app/session-shell/input-surface-switch.js +1 -2
- package/dist/app/session-shell/login-interaction.d.ts +5 -4
- package/dist/app/session-shell/login-interaction.js +2 -3
- package/dist/app/session-shell/paste-executor.d.ts +4 -8
- package/dist/app/session-shell/paste-executor.js +2 -2
- package/dist/app/session-shell/paste-protocol.d.ts +2 -2
- package/dist/app/session-shell/path-chip-presentation.d.ts +0 -5
- package/dist/app/session-shell/path-chip-presentation.js +3 -3
- package/dist/app/session-shell/prompt-chips.d.ts +8 -7
- package/dist/app/session-shell/prompt-history-controller.d.ts +3 -3
- package/dist/app/session-shell/prompt-submission.d.ts +5 -2
- package/dist/app/session-shell/prompt-submission.js +4 -5
- package/dist/app/session-shell/quit-outro-effects.d.ts +3 -3
- package/dist/app/session-shell/quit-outro-effects.js +1 -4
- package/dist/app/session-shell/quit-outro.d.ts +9 -12
- package/dist/app/session-shell/quit-outro.js +11 -11
- package/dist/app/session-shell/response-copy-protocol.d.ts +3 -2
- package/dist/app/session-shell/response-copy-transport.d.ts +2 -14
- package/dist/app/session-shell/response-copy-transport.js +1 -1
- package/dist/app/session-shell/session-lifecycle.d.ts +2 -1
- package/dist/app/session-shell/session-shell-root.d.ts +74 -89
- package/dist/app/session-shell/session-shell-root.js +81 -113
- package/dist/app/session-shell/session-shell.d.ts +13 -16
- package/dist/app/session-shell/session-shell.js +144 -268
- package/dist/app/session-shell/session-viewport-controller.d.ts +7 -6
- package/dist/app/session-shell/session-viewport-controller.js +2 -2
- package/dist/app/session-shell/settings-bindings.d.ts +24 -2
- package/dist/app/session-shell/settings-bindings.js +24 -0
- package/dist/app/session-shell/share-operation.d.ts +3 -3
- package/dist/app/session-shell/share-operation.js +4 -6
- package/dist/app/session-shell/shell-clipboard.d.ts +59 -0
- package/dist/app/session-shell/shell-clipboard.js +119 -0
- package/dist/app/session-shell/shell-editor-factory.d.ts +8 -4
- package/dist/app/session-shell/shell-editor-factory.js +13 -15
- package/dist/app/session-shell/shell-host.d.ts +16 -17
- package/dist/app/session-shell/shell-host.js +18 -19
- package/dist/app/session-shell/shell-layout.d.ts +2 -2
- package/dist/app/session-shell/shell-prompt-suggestions.d.ts +26 -0
- package/dist/app/session-shell/shell-prompt-suggestions.js +48 -0
- package/dist/app/session-shell/suggestion-surface.d.ts +1 -6
- package/dist/app/session-shell/suggestion-surface.js +1 -1
- package/dist/app/session-shell/system-clipboard.d.ts +2 -14
- package/dist/app/session-shell/system-clipboard.js +2 -7
- package/dist/app/session-shell/transcript-document.d.ts +11 -8
- package/dist/app/session-shell/transcript-document.js +13 -14
- package/dist/app/session-shell/viewport-layout.d.ts +2 -2
- package/dist/app/session-shell/workflow-output.d.ts +5 -3
- package/dist/app/session-shell/workflow-output.js +13 -15
- package/dist/cli/package-messages.d.ts +0 -1
- package/dist/cli/package-messages.js +1 -1
- package/dist/cli/session-context.d.ts +1 -1
- package/dist/cli/uninstall.d.ts +3 -2
- package/dist/composition/owned-settings.d.ts +2 -1
- package/dist/composition/owned-settings.js +0 -3
- package/dist/composition/owned-ui.d.ts +1 -1
- package/dist/composition/owned-ui.js +27 -27
- package/dist/composition/reference-selection-options.d.ts +1 -1
- package/dist/composition/reference-selection-options.js +1 -1
- package/dist/composition/session-runtime-registry.d.ts +2 -1
- package/dist/composition/settings-route-host.js +3 -10
- package/dist/composition/settings-search-input.d.ts +2 -1
- package/dist/composition/startup-route.d.ts +2 -2
- package/dist/composition/startup-route.js +2 -2
- package/dist/contracts/owned-ui/extension-ui.d.ts +2 -1
- package/dist/contracts/owned-ui/index.d.ts +1 -0
- package/dist/contracts/owned-ui/session-presenters.d.ts +3 -0
- package/dist/contracts/owned-ui/shell-components.d.ts +543 -0
- package/dist/contracts/owned-ui/shell-components.js +1 -0
- package/dist/contracts/presentation/component.d.ts +17 -0
- package/dist/contracts/presentation/component.js +8 -0
- package/dist/contracts/presentation/index.d.ts +6 -15
- package/dist/contracts/presentation/index.js +2 -0
- package/dist/contracts/presentation/terminal.d.ts +290 -0
- package/dist/contracts/presentation/terminal.js +1 -0
- package/dist/contracts/presentation/theme.d.ts +46 -0
- package/dist/contracts/presentation/theme.js +1 -0
- package/dist/features/launch/development-launch.js +1 -1
- package/dist/features/launch/runtime-selection.d.ts +2 -2
- package/dist/features/launch/runtime-selection.js +2 -2
- package/dist/features/owned-ui/project-trust-prompt.d.ts +2 -2
- package/dist/features/owned-ui/project-trust-prompt.js +1 -1
- package/dist/features/owned-ui/release-note-state.d.ts +2 -1
- package/dist/features/owned-ui/settings-app.js +38 -219
- package/dist/features/owned-ui/settings-edits.d.ts +31 -0
- package/dist/features/owned-ui/settings-edits.js +139 -0
- package/dist/features/owned-ui/settings-scroll-rail.d.ts +29 -0
- package/dist/features/owned-ui/settings-scroll-rail.js +79 -0
- package/dist/features/owned-ui/settings-search-input.d.ts +2 -1
- package/dist/features/prompt-history/service.d.ts +3 -2
- package/dist/foundation/lifecycle/claim-gate.d.ts +2 -1
- package/dist/foundation/release/automatic-update.d.ts +5 -14
- package/dist/foundation/release/automatic-update.js +14 -14
- package/dist/foundation/release/bootstrap.js +4 -4
- package/dist/foundation/release/dependency-certification.d.ts +0 -1
- package/dist/foundation/release/dependency-certification.js +1 -1
- package/dist/foundation/release/early-accent.d.ts +2 -2
- package/dist/foundation/release/early-accent.js +1 -1
- package/dist/foundation/release/index.d.ts +2 -2
- package/dist/foundation/release/index.js +1 -1
- package/dist/foundation/release/latest-release.d.ts +3 -18
- package/dist/foundation/release/latest-release.js +10 -10
- package/dist/foundation/release/ordinary-launch-selection.d.ts +1 -1
- package/dist/foundation/release/ordinary-launch-selection.js +1 -1
- package/dist/foundation/release/release-gc.d.ts +3 -3
- package/dist/foundation/release/release-gc.js +4 -4
- package/dist/foundation/release/{cohort-state.d.ts → release-state.d.ts} +23 -23
- package/dist/foundation/release/{cohort-state.js → release-state.js} +8 -8
- package/dist/foundation/release/update-activation.js +2 -2
- package/dist/foundation/release/update-execution-lease.d.ts +2 -3
- package/dist/foundation/release/update-execution-lease.js +1 -1
- package/dist/foundation/release/update-launch.d.ts +2 -2
- package/dist/foundation/release/update.d.ts +0 -2
- package/dist/foundation/release/update.js +14 -14
- package/dist/foundation/startup/startup-budget.d.ts +5 -5
- package/dist/foundation/startup/startup-budget.js +2 -2
- package/dist/integrations/pi/components/editor-interaction.d.ts +4 -12
- package/dist/integrations/pi/components/index.d.ts +15 -9
- package/dist/integrations/pi/components/index.js +9 -5
- package/dist/integrations/pi/components/lazy-selectors.d.ts +2 -10
- package/dist/integrations/pi/components/lazy-selectors.js +1 -1
- package/dist/integrations/pi/components/modal-frame.d.ts +5 -22
- package/dist/integrations/pi/components/modal-frame.js +3 -23
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +4 -3
- package/dist/integrations/pi/components/prompt-input-port.d.ts +2 -19
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +3 -2
- package/dist/integrations/pi/components/shell-footer-status.d.ts +2 -2
- package/dist/integrations/pi/components/shell-footer-status.js +3 -2
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +6 -5
- package/dist/integrations/pi/components/shell-presenters-info.js +2 -1
- package/dist/integrations/pi/components/shell-session-info-reference.d.ts +2 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +33 -227
- package/dist/integrations/pi/components/shell-shared-facade.js +8 -1
- package/dist/integrations/pi/components/skills-command.d.ts +1 -9
- package/dist/integrations/pi/components/skills-command.js +5 -5
- package/dist/integrations/pi/components/theme.d.ts +9 -2
- package/dist/integrations/pi/components/theme.js +17 -2
- package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +2 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +2 -2
- package/dist/integrations/pi/engine/adapter.d.ts +3 -5
- package/dist/integrations/pi/engine/adapter.js +3 -12
- package/dist/integrations/pi/engine/changelog.d.ts +2 -2
- package/dist/integrations/pi/engine/changelog.js +3 -3
- package/dist/integrations/pi/engine/compaction-progress.d.ts +2 -3
- package/dist/integrations/pi/engine/compaction-progress.js +1 -1
- package/dist/integrations/pi/engine/conformance.d.ts +2 -1
- package/dist/integrations/pi/engine/default-model-setting.d.ts +0 -2
- package/dist/integrations/pi/engine/default-model-setting.js +1 -2
- package/dist/integrations/pi/engine/event-delivery.d.ts +2 -1
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
- package/dist/integrations/pi/engine/host.js +2 -2
- package/dist/integrations/pi/engine/message-values.d.ts +0 -1
- package/dist/integrations/pi/engine/message-values.js +1 -1
- package/dist/integrations/pi/engine/pending-delivery.d.ts +0 -4
- package/dist/integrations/pi/engine/pending-delivery.js +3 -3
- package/dist/integrations/pi/engine/ports.d.ts +7 -1
- package/dist/integrations/pi/engine/ports.js +4 -0
- package/dist/integrations/pi/engine/project-trust-preflight.d.ts +2 -1
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +3 -2
- package/dist/integrations/pi/engine/provider-authentication.d.ts +1 -1
- package/dist/integrations/pi/engine/public-main-entry.d.ts +1 -5
- package/dist/integrations/pi/engine/public-main-entry.js +1 -1
- package/dist/integrations/pi/engine/repository-pr-rest.d.ts +1 -9
- package/dist/integrations/pi/engine/repository-pr-rest.js +2 -2
- package/dist/integrations/pi/engine/repository-pr.d.ts +1 -3
- package/dist/integrations/pi/engine/repository-pr.js +1 -1
- package/dist/integrations/pi/engine/resource-catalog.d.ts +2 -1
- package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/session-runtime.d.ts +4 -3
- package/dist/integrations/pi/engine/settings-bridge.d.ts +0 -2
- package/dist/integrations/pi/engine/settings-bridge.js +1 -1
- package/dist/integrations/pi/engine/settings-port.d.ts +3 -2
- package/dist/integrations/pi/engine/transcript-projection.d.ts +2 -1
- package/dist/integrations/pi/engine/workflow-contexts.d.ts +1 -1
- package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -1
- package/dist/integrations/pi/engine/workflow-support.d.ts +0 -6
- package/dist/integrations/pi/engine/workflow-support.js +4 -18
- package/dist/integrations/pi/engine/workflows.d.ts +5 -5
- package/dist/integrations/pi/session-presenters/components.d.ts +3 -0
- package/dist/integrations/pi/session-presenters/components.js +75 -0
- package/dist/integrations/pi/session-presenters/index.d.ts +1 -0
- package/dist/integrations/pi/session-presenters/index.js +1 -0
- package/dist/integrations/pi/session-presenters/presentation.d.ts +3 -0
- package/dist/integrations/pi/session-presenters/presentation.js +10 -0
- package/dist/integrations/pi/session-presenters/presenters.d.ts +2 -1
- package/dist/integrations/pi/session-presenters/presenters.js +3 -1
- package/dist/integrations/pi/tui-runtime/adapter.js +21 -30
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +22 -166
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +5 -40
- package/dist/integrations/pi/tui-runtime/index.d.ts +1 -0
- package/dist/integrations/pi/tui-runtime/index.js +1 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +4 -6
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +2 -8
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +3 -9
- package/dist/integrations/pi/tui-runtime/runtime-factory.d.ts +3 -0
- package/dist/integrations/pi/tui-runtime/runtime-factory.js +11 -0
- package/dist/ui/components/index.d.ts +2 -2
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/selection-copy.d.ts +0 -1
- package/dist/ui/components/selection-copy.js +0 -12
- package/dist/ui/components/theme.d.ts +4 -19
- package/dist/ui/components/theme.js +6 -0
- package/dist/ui/settings/declarations.d.ts +2 -3
- package/dist/ui/settings/declarations.js +2 -3
- package/dist/ui/settings/early-accent.js +1 -1
- package/dist/ui/settings/index.d.ts +3 -5
- package/dist/ui/settings/index.js +2 -3
- package/dist/ui/settings/manager.d.ts +0 -4
- package/dist/ui/settings/manager.js +6 -62
- package/dist/ui/settings/resolution.d.ts +6 -18
- package/dist/ui/settings/resolution.js +4 -103
- package/dist/ui/settings/sections.d.ts +0 -4
- package/dist/ui/settings/sections.js +1 -1
- package/docs/architecture/boundaries.md +2 -2
- package/docs/architecture/internal-naming.md +2 -0
- package/docs/architecture/project-structure.md +4 -2
- package/docs/validation.md +1 -1
- package/package.json +3 -4
- package/dist/integrations/pi/components/components.d.ts +0 -4
- package/dist/integrations/pi/components/components.js +0 -48
- package/dist/integrations/pi/components/conformance.d.ts +0 -18
- package/dist/integrations/pi/components/conformance.js +0 -70
- package/dist/integrations/pi/components/shell-components.d.ts +0 -7
- package/dist/integrations/pi/components/shell-components.js +0 -7
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +0 -33
- package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -114
- package/dist/ui/settings/migrations.d.ts +0 -19
- package/dist/ui/settings/migrations.js +0 -225
- package/dist/ui/settings/progress-palette.generated.d.ts +0 -139
- package/dist/ui/settings/progress-palette.generated.js +0 -139
- /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.d.ts +0 -0
- /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.js +0 -0
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
readonly innerWidth: number;
|
|
4
|
-
readonly paddingX: number;
|
|
5
|
-
readonly contentWidth: number;
|
|
6
|
-
readonly layoutWidth: number;
|
|
7
|
-
}
|
|
8
|
-
export interface PiShellPromptInputBody {
|
|
9
|
-
readonly rows: readonly string[];
|
|
10
|
-
readonly topRule?: string | undefined;
|
|
11
|
-
readonly bottomRule?: string | undefined;
|
|
12
|
-
readonly after?: readonly string[];
|
|
13
|
-
readonly afterIndent?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface PiShellPromptInputPresentation {
|
|
16
|
-
geometry(width: number, padding?: number): PiShellPromptInputGeometry;
|
|
17
|
-
styleRule(text: string): string;
|
|
18
|
-
render(width: number, body: (innerWidth: number) => PiShellPromptInputBody, ruled?: boolean, padding?: number): string[];
|
|
19
|
-
}
|
|
1
|
+
import type { OwnedUiShellPromptInputPresentation } from "../../../contracts/owned-ui/index.js";
|
|
2
|
+
export type PiShellPromptInputPresentation = OwnedUiShellPromptInputPresentation;
|
|
@@ -151,5 +151,6 @@ export declare const BUILTIN_THEME_RESOURCES: Readonly<{
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
}>;
|
|
154
|
-
|
|
154
|
+
type BuiltinThemeName = keyof typeof BUILTIN_THEME_RESOURCES;
|
|
155
155
|
export declare function isBuiltinThemeName(name: string): name is BuiltinThemeName;
|
|
156
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type OwnedUiShellEditorOptions } from "../../../contracts/owned-ui/index.js";
|
|
2
|
+
import { type PiShellEditorPort } from "./shell-shared-facade.js";
|
|
2
3
|
export declare const PINNED_PI_BUILTIN_SLASH_COMMANDS: ({
|
|
3
4
|
readonly name: "thinking";
|
|
4
5
|
readonly description: "Set thinking level";
|
|
@@ -20,4 +21,4 @@ export declare const OWNED_BUILTIN_SLASH_COMMANDS: ({
|
|
|
20
21
|
name: string;
|
|
21
22
|
description: string;
|
|
22
23
|
})[];
|
|
23
|
-
export declare function createPiShellEditor(options:
|
|
24
|
+
export declare function createPiShellEditor(options: OwnedUiShellEditorOptions): PiShellEditorPort;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { OwnedUiShellKeybindings } from "../../../contracts/owned-ui/index.js";
|
|
1
2
|
import type { OwnedUiSessionViewModel } from "../../../contracts/owned-ui/index.js";
|
|
2
|
-
import { type KeybindingsConfig } from "./upstream/adjacent/core/keybindings.js";
|
|
3
3
|
import { type PiShellViewComponentPort, type PiShellStatusPort, type PiShellProgressStatusPresentation, type PiShellQueuedInputPort, type PiShellHeaderPort, type PiShellResourceEntry, type PiShellLoadedResourcesPort, type PiShellHeaderOptions, type PiShellEditorOptions } from "./shell-shared-facade.js";
|
|
4
4
|
export declare function createPiShellHeader(options?: PiShellHeaderOptions): PiShellHeaderPort;
|
|
5
5
|
export declare function createPiShellLoadedResources(resources: readonly PiShellResourceEntry[], initialExpanded?: boolean): PiShellLoadedResourcesPort;
|
|
6
6
|
export declare function createPiShellStatus(view: OwnedUiSessionViewModel, progressStatus: PiShellProgressStatusPresentation, runtime?: Pick<PiShellEditorOptions, "getColumns" | "getRows" | "requestRender">): PiShellStatusPort;
|
|
7
7
|
export declare function createPiShellFooter(view: OwnedUiSessionViewModel, cwd: string, profile?: "pi" | "a1", showLevel?: () => boolean): PiShellViewComponentPort;
|
|
8
|
-
export declare function createPiQueuedInputStatus(submissions: readonly string[], presentation?: "pinned" | "custom-viewport", getKeybindings?: () =>
|
|
8
|
+
export declare function createPiQueuedInputStatus(submissions: readonly string[], presentation?: "pinned" | "custom-viewport", getKeybindings?: () => OwnedUiShellKeybindings): PiShellQueuedInputPort;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { piKeybindings } from "./shell-shared-facade.js";
|
|
1
2
|
import { rawKeyHint, VERSION } from "../startup-public.js";
|
|
2
3
|
import { Spacer, Text, } from "@earendil-works/pi-tui";
|
|
3
4
|
import { SessionFooter } from "./upstream/components/session-footer.js";
|
|
@@ -263,7 +264,7 @@ function queuedInputText(submissions, presentation, bindings) {
|
|
|
263
264
|
return submissions.map(submission => theme.fg("muted", `Steering: ${submission.replaceAll("\n", " ⏎ ")}`)).join("\n");
|
|
264
265
|
}
|
|
265
266
|
const messages = submissions.map(submission => theme.fg("dim", `Steering: ${submission.replaceAll("\n", " ⏎ ")}`));
|
|
266
|
-
const keys = KeybindingsManager.fromOwnedBindings(bindings).getKeys("app.message.dequeue");
|
|
267
|
+
const keys = KeybindingsManager.fromOwnedBindings(piKeybindings(bindings)).getKeys("app.message.dequeue");
|
|
267
268
|
const label = keys.length === 0 ? "Unbound" : keys.map(displayKeybinding).join("/");
|
|
268
269
|
const dequeueHint = theme.fg("dim", `↳ ${label} to edit all queued messages`);
|
|
269
270
|
// Compatibility: the custom viewport matches Pi's interactive queue presentation while the
|
|
@@ -290,7 +291,7 @@ function compactHeaderText() {
|
|
|
290
291
|
return `${headerWithLogo(instructions)}\n${compactOnboarding}\n\n${onboarding}`;
|
|
291
292
|
}
|
|
292
293
|
function expandedHeaderText(bindings) {
|
|
293
|
-
const keys = bindings === undefined ? undefined : KeybindingsManager.fromOwnedBindings(bindings);
|
|
294
|
+
const keys = bindings === undefined ? undefined : KeybindingsManager.fromOwnedBindings(piKeybindings(bindings));
|
|
294
295
|
const instructions = [
|
|
295
296
|
rawKeyHint("escape", "to interrupt"),
|
|
296
297
|
rawKeyHint("ctrl+c", "to clear"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { OwnedUiShellKeybindings } from "../../../contracts/owned-ui/index.js";
|
|
2
2
|
import { type PiShellComponentPort, type PiShellExtensionRendererResolver } from "./shell-shared-facade.js";
|
|
3
3
|
export interface PiShellSessionInfoPresentation {
|
|
4
4
|
readonly sessionName?: string;
|
|
@@ -31,7 +31,7 @@ export interface PiShellSessionInfoPresentation {
|
|
|
31
31
|
}[];
|
|
32
32
|
readonly cacheWarming: PiShellCacheWarmingPresentation;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
interface PiShellCacheWarmingPresentation {
|
|
35
35
|
readonly mode: string;
|
|
36
36
|
readonly status?: {
|
|
37
37
|
readonly state: "inactive" | "scheduled" | "refreshing";
|
|
@@ -65,14 +65,14 @@ export declare function createPiShellChangelog(markdown: string): PiShellCompone
|
|
|
65
65
|
export declare function renderPiShellChangelogLines(markdown: string, width: number): readonly string[];
|
|
66
66
|
/** What the hotkeys presenters render: the editor bindings and the extension shortcuts declared over them. */
|
|
67
67
|
export interface PiShellHotkeysPresentation {
|
|
68
|
-
readonly bindings?:
|
|
68
|
+
readonly bindings?: OwnedUiShellKeybindings;
|
|
69
69
|
readonly getShortcuts?: NonNullable<PiShellExtensionRendererResolver["getShortcuts"]>;
|
|
70
70
|
readonly profile?: "pi" | "a1";
|
|
71
71
|
}
|
|
72
|
-
export declare function createPiShellHotkeys(bindings?:
|
|
72
|
+
export declare function createPiShellHotkeys(bindings?: OwnedUiShellKeybindings, getShortcuts?: NonNullable<PiShellExtensionRendererResolver["getShortcuts"]>, profile?: "pi" | "a1"): PiShellComponentPort;
|
|
73
73
|
/** The keyboard-shortcut document rows the feed presenter shows, without its spacer, borders, and heading. */
|
|
74
74
|
export declare function renderPiShellHotkeysLines(presentation: PiShellHotkeysPresentation, width: number): readonly string[];
|
|
75
|
-
export declare function hotkeysMarkdown(bindings:
|
|
75
|
+
export declare function hotkeysMarkdown(bindings: OwnedUiShellKeybindings | undefined, getShortcuts: NonNullable<PiShellExtensionRendererResolver["getShortcuts"]>, profile: "pi" | "a1"): string;
|
|
76
76
|
/**
|
|
77
77
|
* Pinned Pi's `showPackageUpdateNotification` banner: warning-coloured dynamic
|
|
78
78
|
* borders around a bold warning title, the muted update instruction with the
|
|
@@ -109,3 +109,4 @@ export declare function renderPiShellReleaseUpdateBanner(release: {
|
|
|
109
109
|
readonly command: string;
|
|
110
110
|
readonly changelogUrl: string | null;
|
|
111
111
|
}, width: number, closeHovered: boolean): PiShellReleaseUpdateBanner;
|
|
112
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { piKeybindings } from "./shell-shared-facade.js";
|
|
1
2
|
import { DynamicBorder } from "../startup-public.js";
|
|
2
3
|
import { Container, getCapabilities, hyperlink, Markdown, Spacer, Text, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
4
|
import { PRODUCT_TEXT } from "../../../product-identity.js";
|
|
@@ -168,7 +169,7 @@ function hotkeysMarkdownComponent(markdown) {
|
|
|
168
169
|
return new Markdown(markdown, 1, 1, getPiHotkeysMarkdownTheme());
|
|
169
170
|
}
|
|
170
171
|
export function hotkeysMarkdown(bindings, getShortcuts, profile) {
|
|
171
|
-
const keys = profile === "a1" ? KeybindingsManager.fromOwnedBindings(bindings) : new KeybindingsManager(bindings);
|
|
172
|
+
const keys = profile === "a1" ? KeybindingsManager.fromOwnedBindings(piKeybindings(bindings)) : new KeybindingsManager(piKeybindings(bindings));
|
|
172
173
|
// Compatibility: the owned viewport consumes these physical chords before editor actions.
|
|
173
174
|
const display = (action) => keys.getKeys(action)
|
|
174
175
|
.filter(key => profile !== "a1" || (key !== "ctrl+home" && key !== "ctrl+end"))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PiShellSessionInfoPresentation } from "./shell-presenters-info.js";
|
|
2
|
-
|
|
2
|
+
interface PiShellSessionInfoReferenceDocument {
|
|
3
3
|
readonly preamble: readonly string[];
|
|
4
4
|
readonly sections: readonly {
|
|
5
5
|
readonly title: string;
|
|
@@ -8,3 +8,4 @@ export interface PiShellSessionInfoReferenceDocument {
|
|
|
8
8
|
}
|
|
9
9
|
/** Renders the pinned report values while leaving group names semantic for the owned screen. */
|
|
10
10
|
export declare function renderPiShellSessionInfoReferenceDocument(presentation: PiShellSessionInfoPresentation, width: number): PiShellSessionInfoReferenceDocument;
|
|
11
|
+
export {};
|
|
@@ -1,242 +1,48 @@
|
|
|
1
1
|
import { visibleWidth, type AutocompleteProvider, type Component, type KeybindingsConfig, type TUI } from "@earendil-works/pi-tui";
|
|
2
|
-
import type { OwnedUiImageAttachment, OwnedUiSessionViewModel, OwnedUiThinkingLevel, OwnedUiTranscriptBlock, SuggestionDecision } from "../../../contracts/owned-ui/index.js";
|
|
3
2
|
import type { HistoryEditorConstructor } from "./history-editor-loader.js";
|
|
4
|
-
import type {
|
|
5
|
-
import type { EditorRecallPort } from "./editor-interaction.js";
|
|
6
|
-
import type { PresentationComponentPort } from "../../../contracts/presentation/index.js";
|
|
3
|
+
import type { OwnedUiShellAutocompleteCommand, OwnedUiShellClipboardContent, OwnedUiShellComponentPort, OwnedUiShellEditorBodyGeometry, OwnedUiShellEditorOptions, OwnedUiShellKeybindings, OwnedUiShellEditorPointerEvent, OwnedUiShellEditorPort, OwnedUiShellEditorTextRange, OwnedUiShellExtensionRendererResolver, OwnedUiShellHeaderOptions, OwnedUiShellHeaderPort, OwnedUiShellImageAssetResolver, OwnedUiShellLoadedResourcesPort, OwnedUiShellPasteReservation, OwnedUiShellProgressPresentationMode, OwnedUiShellProgressStatusPresentation, OwnedUiShellQueuedInputPort, OwnedUiShellResourceEntry, OwnedUiShellResourceSection, OwnedUiShellSelectorOption, OwnedUiShellSelectorOptions, OwnedUiShellStartupNotice, OwnedUiShellStatusPlacement, OwnedUiShellStatusPort, OwnedUiShellTranscriptComponentPort, OwnedUiShellViewComponentPort } from "../../../contracts/owned-ui/index.js";
|
|
7
4
|
import { KeybindingsManager } from "./upstream/adjacent/core/keybindings.js";
|
|
8
5
|
/** Terminal-cell width authority used by Pi-rendered component rows. */
|
|
9
6
|
export declare const piShellVisibleWidth: typeof visibleWidth;
|
|
10
7
|
export declare const piShellTruncateToWidth: (text: string, width: number) => string;
|
|
11
|
-
export declare const INSTALLED_UPDATE_STATUS_TEXT = "Update installed, restart to update";
|
|
12
8
|
/** Shared green restart notice for the pinned status and bare-A1 prompt overlay. */
|
|
13
9
|
export declare function renderPiShellInstalledUpdateStatus(width: number): string;
|
|
14
10
|
/** A clickable URL in pinned Pi's grammar: an OSC 8 link where the terminal supports one, the plain URL otherwise. */
|
|
15
11
|
export declare const piShellHyperlink: (url: string, text?: string) => string;
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
export type
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/** Restores the shared manager if anything replaced pi-tui's registry; a no-op when it is already active. */
|
|
49
|
-
activateKeybindings(): void;
|
|
50
|
-
keybindingConfig(): KeybindingsConfig;
|
|
51
|
-
reloadKeybindings(): void;
|
|
52
|
-
/** Uses Pi's terminal decoder rather than assuming one terminal escape spelling. */
|
|
53
|
-
matchesTerminalKey(data: string, key: "home" | "end" | "pageUp" | "pageDown" | "ctrl+home" | "ctrl+end" | "alt+home" | "ctrl+v"): boolean;
|
|
54
|
-
getText(): string;
|
|
55
|
-
setText(text: string): void;
|
|
56
|
-
insertText(text: string): void;
|
|
57
|
-
addToHistory(text: string): void;
|
|
58
|
-
setSubmitEnabled(enabled: boolean): void;
|
|
59
|
-
setSubmitHandler(handler: (text: string) => void): void;
|
|
60
|
-
setInterruptHandler(handler: () => void): void;
|
|
61
|
-
setAutocompleteCommands(commands: readonly PiShellAutocompleteCommand[]): void;
|
|
62
|
-
setPaddingX(padding: number): void;
|
|
63
|
-
setAutocompleteMaxVisible(maxVisible: number): void;
|
|
64
|
-
addAutocompleteProvider(factory: unknown): void;
|
|
65
|
-
setThinkingLevel(level: OwnedUiThinkingLevel): void;
|
|
66
|
-
setPromptSuggestion(text: string | null): void;
|
|
67
|
-
canPresentPromptSuggestion(): boolean;
|
|
68
|
-
promptSuggestionBlockReason?(): SuggestionDecision;
|
|
69
|
-
hasSelection(): boolean;
|
|
70
|
-
/** Exact expanded semantic editor selection without mutating or collapsing it. */
|
|
71
|
-
selectedText?(): string | undefined;
|
|
72
|
-
ownsPointer(): boolean;
|
|
73
|
-
handlePointer(event: PiShellEditorPointerEvent): boolean;
|
|
74
|
-
pasteClipboard(): boolean;
|
|
75
|
-
cancelPendingPastes?(): void;
|
|
76
|
-
}
|
|
77
|
-
export interface PiShellAutocompleteCommand {
|
|
78
|
-
readonly name: string;
|
|
79
|
-
readonly description?: string;
|
|
80
|
-
readonly argumentHint?: string;
|
|
81
|
-
readonly argumentOptions?: readonly PiShellSelectorOption[];
|
|
82
|
-
/** Built-in entries decorate the active profile's catalog; everything else is a discovered resource. */
|
|
83
|
-
readonly source?: "builtin" | "prompt" | "skill" | "extension";
|
|
84
|
-
}
|
|
85
|
-
export interface PiShellViewComponentPort extends PiShellComponentPort {
|
|
86
|
-
update(view: OwnedUiSessionViewModel): void;
|
|
87
|
-
}
|
|
88
|
-
export type PiShellStatusPlacement = "live" | "dock" | "hidden";
|
|
89
|
-
export type PiShellProgressPresentationMode = "pinned" | "custom-viewport";
|
|
90
|
-
export interface PiShellProgressStatusPresentation {
|
|
91
|
-
readonly text: (message: string, mode: PiShellProgressPresentationMode) => string;
|
|
92
|
-
readonly frame: (message: string, phase: number, styles: {
|
|
93
|
-
readonly muted: (text: string) => string;
|
|
94
|
-
readonly highlight: (text: string) => string;
|
|
95
|
-
}) => string;
|
|
96
|
-
}
|
|
97
|
-
export interface PiShellStatusPort extends PiShellViewComponentPort {
|
|
98
|
-
/** `active` owns a live operation before the engine lifecycle itself becomes busy. */
|
|
99
|
-
setWorkingOverride(message: string | undefined, active?: boolean): void;
|
|
100
|
-
setOutputPad(padding: 0 | 1): void;
|
|
101
|
-
/** Bare A1 shows engine-measured progress beside the working word; the pinned route keeps the bare word. */
|
|
102
|
-
setProgressPresentation(presentation: PiShellProgressPresentationMode): void;
|
|
103
|
-
/** Semantic row placement; callers must not inspect rendered text. */
|
|
104
|
-
placement(): PiShellStatusPlacement;
|
|
105
|
-
renderDock(width: number): readonly string[];
|
|
106
|
-
renderLive(width: number): readonly string[];
|
|
107
|
-
}
|
|
108
|
-
export interface PiShellQueuedInputPort extends PiShellComponentPort {
|
|
109
|
-
update(submissions: readonly string[]): void;
|
|
110
|
-
}
|
|
111
|
-
export interface PiShellHeaderPort extends PiShellComponentPort {
|
|
112
|
-
readonly expanded: boolean;
|
|
113
|
-
setExpanded(expanded: boolean): void;
|
|
114
|
-
}
|
|
115
|
-
export type PiShellResourceSection = "Context" | "Skills" | "Prompts" | "Extensions" | "Themes";
|
|
116
|
-
export interface PiShellResourceEntry {
|
|
117
|
-
readonly section: PiShellResourceSection;
|
|
118
|
-
readonly label: string;
|
|
119
|
-
readonly sourcePath: string | null;
|
|
120
|
-
readonly diagnostic?: string | null;
|
|
121
|
-
}
|
|
122
|
-
export interface PiShellLoadedResourcesPort extends PiShellComponentPort {
|
|
123
|
-
setExpanded(expanded: boolean): void;
|
|
124
|
-
}
|
|
125
|
-
export interface PiShellImageAssetResolver {
|
|
126
|
-
resolve(assetId: string): OwnedUiImageAttachment | null;
|
|
127
|
-
}
|
|
128
|
-
export interface PiShellExtensionRendererResolver {
|
|
129
|
-
getMessageRenderer(customType: string): unknown;
|
|
130
|
-
getToolRenderers(toolName: string): unknown;
|
|
131
|
-
getShortcuts?(bindings: KeybindingsConfig): readonly {
|
|
132
|
-
readonly key: string;
|
|
133
|
-
readonly description: string;
|
|
134
|
-
}[];
|
|
135
|
-
}
|
|
136
|
-
export interface PiShellTranscriptComponentPort extends PiShellComponentPort {
|
|
137
|
-
readonly id: string;
|
|
138
|
-
readonly revision: number;
|
|
139
|
-
readonly presentationRevision?: number;
|
|
140
|
-
update(block: OwnedUiTranscriptBlock): void;
|
|
141
|
-
setExpanded(expanded: boolean): void;
|
|
142
|
-
setOutputPad(padding: 0 | 1): void;
|
|
143
|
-
setHideThinkingBlock(hidden: boolean): void;
|
|
144
|
-
setMermaidRenderingMode(mode: "off" | "final" | "streaming"): void;
|
|
145
|
-
setImagePresentation(showImages: boolean, imageWidthCells: number): void;
|
|
146
|
-
}
|
|
147
|
-
export interface PiShellStartupNotice {
|
|
148
|
-
readonly kind: "info" | "warning" | "error";
|
|
149
|
-
readonly message: string;
|
|
150
|
-
}
|
|
151
|
-
export interface PiShellHeaderOptions {
|
|
152
|
-
readonly getKeybindings?: () => KeybindingsConfig;
|
|
153
|
-
readonly quiet?: boolean;
|
|
154
|
-
readonly expanded?: boolean;
|
|
155
|
-
readonly notices?: readonly PiShellStartupNotice[];
|
|
156
|
-
readonly resources?: readonly PiShellResourceEntry[];
|
|
157
|
-
}
|
|
158
|
-
/** An owned paste reserves its edit immediately and acknowledges completion only after insertion. */
|
|
159
|
-
export interface PiShellPasteReservation {
|
|
160
|
-
readonly marker: string;
|
|
161
|
-
readonly result: Promise<string>;
|
|
162
|
-
complete?(): void;
|
|
163
|
-
isCurrent?(): boolean;
|
|
164
|
-
}
|
|
165
|
-
export interface PiShellEditorOptions {
|
|
166
|
-
readonly persistentHistory?: boolean;
|
|
167
|
-
/** Configures the shared interactive input for a caller narrower than the agent prompt. */
|
|
168
|
-
readonly inputCapabilities?: {
|
|
169
|
-
readonly singleLine?: boolean;
|
|
170
|
-
readonly paste?: boolean;
|
|
171
|
-
readonly autocomplete?: boolean;
|
|
172
|
-
readonly placeholder?: string;
|
|
173
|
-
};
|
|
12
|
+
export type PiShellComponentPort = OwnedUiShellComponentPort;
|
|
13
|
+
export type PiShellClipboardContent = OwnedUiShellClipboardContent;
|
|
14
|
+
export type PiShellEditorTextRange = OwnedUiShellEditorTextRange;
|
|
15
|
+
export type PiShellEditorPointerEvent = OwnedUiShellEditorPointerEvent;
|
|
16
|
+
export type PiShellEditorBodyGeometry = OwnedUiShellEditorBodyGeometry;
|
|
17
|
+
export type PiShellEditorPort = OwnedUiShellEditorPort;
|
|
18
|
+
export type PiShellAutocompleteCommand = OwnedUiShellAutocompleteCommand;
|
|
19
|
+
export type PiShellViewComponentPort = OwnedUiShellViewComponentPort;
|
|
20
|
+
export type PiShellStatusPlacement = OwnedUiShellStatusPlacement;
|
|
21
|
+
export type PiShellProgressPresentationMode = OwnedUiShellProgressPresentationMode;
|
|
22
|
+
export type PiShellProgressStatusPresentation = OwnedUiShellProgressStatusPresentation;
|
|
23
|
+
export type PiShellStatusPort = OwnedUiShellStatusPort;
|
|
24
|
+
export type PiShellQueuedInputPort = OwnedUiShellQueuedInputPort;
|
|
25
|
+
export type PiShellHeaderPort = OwnedUiShellHeaderPort;
|
|
26
|
+
export type PiShellResourceSection = OwnedUiShellResourceSection;
|
|
27
|
+
export type PiShellResourceEntry = OwnedUiShellResourceEntry;
|
|
28
|
+
export type PiShellLoadedResourcesPort = OwnedUiShellLoadedResourcesPort;
|
|
29
|
+
export type PiShellImageAssetResolver = OwnedUiShellImageAssetResolver;
|
|
30
|
+
export type PiShellExtensionRendererResolver = OwnedUiShellExtensionRendererResolver;
|
|
31
|
+
export type PiShellTranscriptComponentPort = OwnedUiShellTranscriptComponentPort;
|
|
32
|
+
export type PiShellStartupNotice = OwnedUiShellStartupNotice;
|
|
33
|
+
export type PiShellHeaderOptions = OwnedUiShellHeaderOptions;
|
|
34
|
+
export type PiShellPasteReservation = OwnedUiShellPasteReservation;
|
|
35
|
+
export type PiShellSelectorOption = OwnedUiShellSelectorOption;
|
|
36
|
+
export type PiShellSelectorOptions = OwnedUiShellSelectorOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Restores Pi's keybinding type to bindings the shell carried through the neutral contract. They were read from
|
|
39
|
+
* Pi's keybinding manager in the first place, so the narrowing loses nothing.
|
|
40
|
+
*/
|
|
41
|
+
export declare function piKeybindings(bindings: OwnedUiShellKeybindings | undefined): KeybindingsConfig | undefined;
|
|
42
|
+
/** The editor factory's options with the opaque history editor and keybindings narrowed to their Pi types. */
|
|
43
|
+
export interface PiShellEditorOptions extends Omit<OwnedUiShellEditorOptions, "historyEditor" | "keybindings"> {
|
|
174
44
|
readonly historyEditor?: HistoryEditorConstructor;
|
|
175
|
-
/** Bare A1 adds ergonomic aliases while comparison profiles retain Pi defaults. */
|
|
176
|
-
readonly keybindingProfile?: "pi" | "a1";
|
|
177
|
-
/** The process's shared keybindings; its profile must match `keybindingProfile`. */
|
|
178
45
|
readonly keybindings?: PiKeybindingsHost;
|
|
179
|
-
readonly getColumns: () => number;
|
|
180
|
-
readonly getRows: () => number;
|
|
181
|
-
readonly requestRender: () => void;
|
|
182
|
-
readonly onSubmit: (text: string) => void;
|
|
183
|
-
readonly onChange?: (text: string) => void;
|
|
184
|
-
readonly onInterrupt?: () => void;
|
|
185
|
-
readonly onClear?: () => void;
|
|
186
|
-
readonly onExit?: () => void;
|
|
187
|
-
readonly onSuspend?: () => void;
|
|
188
|
-
readonly onExternalEditor?: () => void;
|
|
189
|
-
readonly onPasteImage?: () => void;
|
|
190
|
-
readonly onExtensionShortcut?: (data: string) => boolean;
|
|
191
|
-
readonly onModelSelect?: () => void;
|
|
192
|
-
readonly onModelCycle?: ((direction: "forward" | "backward") => void) | undefined;
|
|
193
|
-
readonly onThinkingCycle?: (() => void) | undefined;
|
|
194
|
-
readonly onThinkingToggle?: (() => void) | undefined;
|
|
195
|
-
readonly onToolsExpand?: (() => void) | undefined;
|
|
196
|
-
readonly onMessageCopy?: (() => void) | undefined;
|
|
197
|
-
readonly onFollowUp?: (() => void) | undefined;
|
|
198
|
-
readonly onDequeue?: (() => void) | undefined;
|
|
199
|
-
readonly onPromptSuggestionAccepted?: (text: string) => void;
|
|
200
|
-
readonly onCopyText?: (text: string, cut: boolean) => void;
|
|
201
|
-
readonly readClipboardContent?: (signal?: AbortSignal) => Promise<PiShellClipboardContent | null>;
|
|
202
|
-
readonly beginClipboardPaste?: () => PiShellPasteReservation;
|
|
203
|
-
readonly beginTextPaste?: (text: string) => PiShellPasteReservation;
|
|
204
|
-
readonly deferTextPaste?: (text: string) => boolean;
|
|
205
|
-
readonly onPasteRejected?: (error: unknown) => void;
|
|
206
|
-
readonly onPasteInput?: (bytes: number, phase: "framing" | "inserting" | "settled") => void;
|
|
207
|
-
readonly editorHiddenRanges?: (line: string) => readonly PiShellEditorTextRange[];
|
|
208
|
-
readonly transformPastedContent?: (content: PiShellClipboardContent) => string;
|
|
209
|
-
readonly editorAtomicRanges?: (line: string) => readonly PiShellEditorTextRange[];
|
|
210
|
-
readonly expandCopiedEditorText?: (text: string) => string;
|
|
211
|
-
readonly paintEditorSelection?: (line: string, from: number, to: number, atomic: boolean) => string;
|
|
212
|
-
/** Row indices restart at zero for each complete owned editor decoration pass. */
|
|
213
|
-
readonly decorateEditorRow?: (row: string, width: number, rowIndex: number) => string;
|
|
214
|
-
readonly cwd?: string;
|
|
215
|
-
readonly agentDir?: string;
|
|
216
|
-
readonly autocompleteCommands?: readonly PiShellAutocompleteCommand[];
|
|
217
|
-
/**
|
|
218
|
-
* Bare A1's skills presentation, read at every command-list installation. `collapse` replaces the
|
|
219
|
-
* `skill:<name>` entries with one `skills` command and its tunnel; absent or `expand` keeps the
|
|
220
|
-
* pinned per-skill entries. Comparison profiles ignore it.
|
|
221
|
-
*/
|
|
222
|
-
readonly skillsPresentation?: () => "collapse" | "expand";
|
|
223
|
-
readonly promptPresentation?: {
|
|
224
|
-
readonly input: PiShellPromptInputPresentation;
|
|
225
|
-
readonly styleSuggestion: (text: string) => string;
|
|
226
|
-
readonly styleSuggestionCaret: (text: string) => string;
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
export interface PiShellSelectorOption {
|
|
230
|
-
readonly id: string;
|
|
231
|
-
readonly label: string;
|
|
232
|
-
readonly description?: string;
|
|
233
|
-
}
|
|
234
|
-
export interface PiShellSelectorOptions {
|
|
235
|
-
readonly title?: string;
|
|
236
|
-
readonly options: readonly PiShellSelectorOption[];
|
|
237
|
-
readonly maxVisible?: number;
|
|
238
|
-
readonly onSelect?: (id: string) => void;
|
|
239
|
-
readonly onCancel?: () => void;
|
|
240
46
|
}
|
|
241
47
|
export declare function createTuiFacade(options: Pick<PiShellEditorOptions, "getColumns" | "getRows" | "requestRender"> & {
|
|
242
48
|
readonly onSubmit?: (text: string) => void;
|
|
@@ -4,7 +4,7 @@ import { ensurePiTheme, piTheme, } from "./theme.js";
|
|
|
4
4
|
/** Terminal-cell width authority used by Pi-rendered component rows. */
|
|
5
5
|
export const piShellVisibleWidth = visibleWidth;
|
|
6
6
|
export const piShellTruncateToWidth = (text, width) => truncateToWidth(text, width, "");
|
|
7
|
-
|
|
7
|
+
const INSTALLED_UPDATE_STATUS_TEXT = "Update installed, restart to update";
|
|
8
8
|
/** Shared green restart notice for the pinned status and bare-A1 prompt overlay. */
|
|
9
9
|
export function renderPiShellInstalledUpdateStatus(width) {
|
|
10
10
|
if (width <= 0)
|
|
@@ -14,6 +14,13 @@ export function renderPiShellInstalledUpdateStatus(width) {
|
|
|
14
14
|
}
|
|
15
15
|
/** A clickable URL in pinned Pi's grammar: an OSC 8 link where the terminal supports one, the plain URL otherwise. */
|
|
16
16
|
export const piShellHyperlink = (url, text = url) => hyperlink(url, text);
|
|
17
|
+
/**
|
|
18
|
+
* Restores Pi's keybinding type to bindings the shell carried through the neutral contract. They were read from
|
|
19
|
+
* Pi's keybinding manager in the first place, so the narrowing loses nothing.
|
|
20
|
+
*/
|
|
21
|
+
export function piKeybindings(bindings) {
|
|
22
|
+
return bindings;
|
|
23
|
+
}
|
|
17
24
|
// Provenance: pinned from packages/coding-agent/src/core/slash-commands.ts at 914cf14.
|
|
18
25
|
export function createTuiFacade(options) {
|
|
19
26
|
const children = [];
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AutocompleteProvider } from "@earendil-works/pi-tui";
|
|
2
2
|
import type { PiShellAutocompleteCommand } from "./shell-shared-facade.js";
|
|
3
3
|
/** The collapsed bare-A1 replacement for the per-skill command listing. */
|
|
4
4
|
export declare const SKILLS_COMMAND_NAME = "skills";
|
|
5
|
-
export declare const SKILLS_COMMAND_DESCRIPTION = "Browse, search, and apply a skill";
|
|
6
|
-
/** Pi's own command prefix; the engine expands `/skill:<name>` regardless of how the menu presents it. */
|
|
7
|
-
export declare const SKILL_COMMAND_PREFIX = "skill:";
|
|
8
5
|
export interface PiShellSkillSummary {
|
|
9
6
|
readonly name: string;
|
|
10
7
|
readonly description: string;
|
|
@@ -16,8 +13,6 @@ export interface PiShellCollapsedSkillCommands {
|
|
|
16
13
|
/** The skills withheld from the top-level menu, in the engine's discovery order. */
|
|
17
14
|
readonly skills: readonly PiShellSkillSummary[];
|
|
18
15
|
}
|
|
19
|
-
/** One line of description, as the v2 extension shows it beside a row. */
|
|
20
|
-
export declare function oneLineSkillDescription(description: string): string;
|
|
21
16
|
/** The skills the engine registered as `skill:<name>` commands, in its order. */
|
|
22
17
|
export declare function skillsFromCommands(commands: readonly PiShellAutocompleteCommand[]): readonly PiShellSkillSummary[];
|
|
23
18
|
/**
|
|
@@ -37,9 +32,6 @@ export declare function skillPrompt(name: string, args?: string): string;
|
|
|
37
32
|
* returned unchanged so ordinary prompts, `/skills <name>`, and `/skill:` input keep their text.
|
|
38
33
|
*/
|
|
39
34
|
export declare function rewriteSkillsTunnelSubmission(text: string): string;
|
|
40
|
-
/** The tunnel query when single-line content before the cursor is exactly `/skills:<query>`. */
|
|
41
|
-
export declare function skillsTunnelQuery(lines: readonly string[], cursorLine: number, cursorCol: number): string | null;
|
|
42
|
-
export declare function skillsTunnelItems(skills: readonly PiShellSkillSummary[], query: string): AutocompleteItem[];
|
|
43
35
|
/**
|
|
44
36
|
* Wrap the pinned combined provider with the `skills` tunnel: `/skills:<query>` lists matching
|
|
45
37
|
* skills as `skills:<name>` rows and shows nothing when none match; every other request, the
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** The collapsed bare-A1 replacement for the per-skill command listing. */
|
|
2
2
|
export const SKILLS_COMMAND_NAME = "skills";
|
|
3
|
-
|
|
3
|
+
const SKILLS_COMMAND_DESCRIPTION = "Browse, search, and apply a skill";
|
|
4
4
|
/** Pi's own command prefix; the engine expands `/skill:<name>` regardless of how the menu presents it. */
|
|
5
|
-
|
|
5
|
+
const SKILL_COMMAND_PREFIX = "skill:";
|
|
6
6
|
const SKILLS_TUNNEL_PREFIX = `${SKILLS_COMMAND_NAME}:`;
|
|
7
7
|
/** The tunnel form follows v2: a name without whitespace right after the colon. */
|
|
8
8
|
const SKILLS_TUNNEL_INPUT = /^\/skills:(\S*)$/u;
|
|
9
9
|
const SKILLS_TUNNEL_SUBMISSION = /^\/skills:([A-Za-z0-9][A-Za-z0-9_-]*)(\s[\s\S]*)?$/u;
|
|
10
10
|
/** One line of description, as the v2 extension shows it beside a row. */
|
|
11
|
-
|
|
11
|
+
function oneLineSkillDescription(description) {
|
|
12
12
|
return description.replace(/\s+/gu, " ").trim();
|
|
13
13
|
}
|
|
14
14
|
/** The skills the engine registered as `skill:<name>` commands, in its order. */
|
|
@@ -82,13 +82,13 @@ export function rewriteSkillsTunnelSubmission(text) {
|
|
|
82
82
|
return `/${SKILL_COMMAND_PREFIX}${match[1]}${match[2] ?? ""}`;
|
|
83
83
|
}
|
|
84
84
|
/** The tunnel query when single-line content before the cursor is exactly `/skills:<query>`. */
|
|
85
|
-
|
|
85
|
+
function skillsTunnelQuery(lines, cursorLine, cursorCol) {
|
|
86
86
|
if (cursorLine !== 0 || lines.length !== 1)
|
|
87
87
|
return null;
|
|
88
88
|
const match = SKILLS_TUNNEL_INPUT.exec((lines[0] ?? "").slice(0, cursorCol));
|
|
89
89
|
return match === null ? null : match[1] ?? "";
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
function skillsTunnelItems(skills, query) {
|
|
92
92
|
return skills.filter(skill => skillMatchesQuery(skill, query)).map(skill => ({
|
|
93
93
|
value: `${SKILLS_TUNNEL_PREFIX}${skill.name}`,
|
|
94
94
|
label: `${SKILLS_TUNNEL_PREFIX}${skill.name}`,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel, type SemanticShortcutHint } from "../../../contracts/presentation/index.js";
|
|
1
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel, type SemanticShortcutHint, type ThemeSource, type UiTheme } from "../../../contracts/presentation/index.js";
|
|
2
2
|
import { type MarkdownTheme, type SelectListTheme } from "@earendil-works/pi-tui";
|
|
3
|
-
export
|
|
3
|
+
export { PINNED_PI_LAYOUT, applyPiTheme, applyPiThemeInstance, currentPiThemeName, ensurePiTheme, getAvailablePiThemes, loadPiTheme, piCanvasBackgroundAnsi, piTheme, setPiAccentColor, setPiPackageBorderProjectionEnabled, } from "./upstream/theme/theme.js";
|
|
4
|
+
type Paint = (text: string) => string;
|
|
5
|
+
/** The live Pi theme in neutral roles; `panel` and `disabled` default to plain and dim. */
|
|
6
|
+
export declare function piUiTheme(options?: {
|
|
7
|
+
readonly panel?: Paint;
|
|
8
|
+
readonly disabled?: Paint;
|
|
9
|
+
}): UiTheme;
|
|
10
|
+
export declare const PI_THEME_SOURCE: ThemeSource;
|
|
4
11
|
export type PiModalShortcutHint = SemanticShortcutHint;
|
|
5
12
|
export { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel };
|
|
6
13
|
/** Resolves dialog rules through the live A1 projection instead of Pi's package-global theme. */
|
|
@@ -1,8 +1,23 @@
|
|
|
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
3
|
import { getMarkdownTheme } from "../startup-public.js";
|
|
4
|
-
import { piTheme } from "./upstream/theme/theme.js";
|
|
5
|
-
export
|
|
4
|
+
import { onPiThemeChange, piTheme, renderPiAccentPreview } from "./upstream/theme/theme.js";
|
|
5
|
+
export { PINNED_PI_LAYOUT, applyPiTheme, applyPiThemeInstance, currentPiThemeName, ensurePiTheme, getAvailablePiThemes, loadPiTheme, piCanvasBackgroundAnsi, piTheme, setPiAccentColor, setPiPackageBorderProjectionEnabled, } from "./upstream/theme/theme.js";
|
|
6
|
+
/** The live Pi theme in neutral roles; `panel` and `disabled` default to plain and dim. */
|
|
7
|
+
export function piUiTheme(options = {}) {
|
|
8
|
+
return {
|
|
9
|
+
fg: (token, text) => piTheme().fg(token, text),
|
|
10
|
+
bold: text => piTheme().bold(text),
|
|
11
|
+
plain: text => text,
|
|
12
|
+
accentPreview: (color, text) => renderPiAccentPreview(color, text),
|
|
13
|
+
disabled: options.disabled ?? (text => piTheme().fg("dim", text)),
|
|
14
|
+
highlight: text => piTheme().bg("selectedBg", text),
|
|
15
|
+
panel: options.panel ?? (text => text),
|
|
16
|
+
background: (token, text) => piTheme().bg(token, text),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const PI_UI_THEME = Object.freeze(piUiTheme());
|
|
20
|
+
export const PI_THEME_SOURCE = Object.freeze({ current: () => PI_UI_THEME, onChange: (listener) => onPiThemeChange(listener) });
|
|
6
21
|
export { DIALOG_CLOSE_SHORTCUT_HINT, displayShortcutKeyLabel };
|
|
7
22
|
/** Resolves dialog rules through the live A1 projection instead of Pi's package-global theme. */
|
|
8
23
|
export function paintPiBorder(text) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ThinkingSelectorLevel } from "./upstream/components/thinking-selector.js";
|
|
2
2
|
import { type PiShellComponentPort } from "./shell-shared-facade.js";
|
|
3
|
-
|
|
3
|
+
interface PiShellThinkingSelectorPresentation {
|
|
4
4
|
readonly profile: "bare";
|
|
5
5
|
readonly cycleBinding: string | readonly string[];
|
|
6
6
|
}
|
|
7
7
|
/** Lazily loaded because thinking-selector code does not belong to the startup graph before `/thinking` opens. */
|
|
8
8
|
export declare function createPiShellThinkingSelector(currentLevel: ThinkingSelectorLevel, availableLevels: readonly ThinkingSelectorLevel[], onSelect: (level: ThinkingSelectorLevel) => void, onCancel: () => void, onSelectAsDefault?: (level: ThinkingSelectorLevel) => void, defaultLevel?: ThinkingSelectorLevel, presentation?: PiShellThinkingSelectorPresentation): PiShellComponentPort;
|
|
9
|
+
export {};
|
|
@@ -73,7 +73,7 @@ declare module "@earendil-works/pi-tui" {
|
|
|
73
73
|
}
|
|
74
74
|
export declare const KEYBINDINGS: {
|
|
75
75
|
readonly "tui.editor.undo": {
|
|
76
|
-
readonly defaultKeys: "
|
|
76
|
+
readonly defaultKeys: "alt+z" | "ctrl+z" | "ctrl+-";
|
|
77
77
|
readonly description: "Undo";
|
|
78
78
|
};
|
|
79
79
|
readonly "tui.altScreen.previousPrompt": {
|
|
@@ -153,7 +153,7 @@ export declare const KEYBINDINGS: {
|
|
|
153
153
|
readonly description: "Restore queued messages";
|
|
154
154
|
};
|
|
155
155
|
readonly "app.clipboard.pasteImage": {
|
|
156
|
-
readonly defaultKeys: "
|
|
156
|
+
readonly defaultKeys: "ctrl+v" | "alt+v";
|
|
157
157
|
readonly description: "Paste files on macOS, images, or text from clipboard";
|
|
158
158
|
};
|
|
159
159
|
readonly "app.session.new": {
|
|
@@ -6,7 +6,7 @@ import type { PiSessionForkPrompt, PiSessionSelection } from "./session-selectio
|
|
|
6
6
|
import { type AdapterCommandResult } from "./command-dispatch.js";
|
|
7
7
|
import { type PiEnginePackageUpdateProbe, type PiEngineRuntimeFactory, type PiRepositoryContextReader } from "./session-runtime.js";
|
|
8
8
|
import { type PiEngineHostSessionPorts } from "./host-ports.js";
|
|
9
|
-
import { type PiSessionPresentationSource } from "./ports.js";
|
|
9
|
+
import { type PiEngineAnnouncements, type PiSessionPresentationSource } from "./ports.js";
|
|
10
10
|
export type { OwnedPiExtensionResourceSummary, OwnedPiExtensionSourceSummary, OwnedPiResourceSummary } from "./resource-catalog.js";
|
|
11
11
|
export type { PiEngineRuntimeFactory, PiEngineRuntimeFactoryInput } from "./session-runtime.js";
|
|
12
12
|
export type { AdapterCommandResult } from "./command-dispatch.js";
|
|
@@ -56,16 +56,14 @@ export declare class PiEngineAdapter implements OwnedUiSessionBackend, OwnedUiPr
|
|
|
56
56
|
get settings(): OwnedUiSessionSettingsPort;
|
|
57
57
|
get catalog(): OwnedUiSessionCatalogPort;
|
|
58
58
|
get extensions(): OwnedUiExtensionPort;
|
|
59
|
+
/** Pinned Pi's changelog since the profile's last seen version and extension package updates; the host announces each once per process. */
|
|
60
|
+
get announcements(): PiEngineAnnouncements;
|
|
59
61
|
/** The Pi objects behind pinned selectors and renderers, for the session presenters owner only. */
|
|
60
62
|
presentationSource(): PiSessionPresentationSource;
|
|
61
63
|
setWorkflowInteractionHost(interaction: PiWorkflowInteractionHost): void;
|
|
62
64
|
suggestionReasoningPolicy(): OwnedUiPromptSuggestionReasoning;
|
|
63
65
|
generate(request: OwnedUiPromptSuggestionRequest): Promise<OwnedUiPromptSuggestionResult>;
|
|
64
66
|
start(): Promise<OwnedUiSessionViewModel>;
|
|
65
|
-
/** Announce pinned Pi's changelog since the profile's last seen version; the host calls this once per process. */
|
|
66
|
-
announceStartupChangelog(): Promise<void>;
|
|
67
|
-
/** Probe extension packages for updates and announce them; the host calls this once per process. */
|
|
68
|
-
announcePackageUpdates(): Promise<void>;
|
|
69
67
|
onEvent(listener: (event: OwnedUiEvent) => void): () => void;
|
|
70
68
|
/** Developer-only pressure evidence; never mirrored into visible diagnostic/status arrays. */
|
|
71
69
|
deliveryDiagnostics(): {
|