@timurproko/a1 0.2.6-dev.717 → 0.2.6-dev.734
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +13 -2
- package/bin/ui.js +13 -0
- package/dist/app/session-shell/clipboard-services.d.ts +19 -0
- package/dist/app/session-shell/clipboard-services.js +7 -0
- package/dist/app/session-shell/exit-notice.d.ts +9 -5
- package/dist/app/session-shell/exit-notice.js +5 -5
- package/dist/app/session-shell/index.d.ts +3 -1
- package/dist/app/session-shell/index.js +1 -0
- package/dist/app/session-shell/paste-preparation-client.d.ts +3 -0
- package/dist/app/session-shell/paste-preparation-client.js +5 -2
- package/dist/app/session-shell/path-chip-presentation.d.ts +10 -3
- package/dist/app/session-shell/path-chip-presentation.js +48 -6
- package/dist/app/session-shell/prompt-chips.js +30 -4
- package/dist/app/session-shell/prompt-suggestion-controller.d.ts +5 -4
- package/dist/app/session-shell/prompt-suggestion-controller.js +148 -58
- package/dist/app/session-shell/quit-outro.d.ts +3 -1
- package/dist/app/session-shell/quit-outro.js +23 -8
- package/dist/app/session-shell/response-copy-transport.d.ts +6 -1
- package/dist/app/session-shell/response-copy-transport.js +8 -2
- package/dist/app/session-shell/session-shell-root.d.ts +22 -11
- package/dist/app/session-shell/session-shell-root.js +19 -12
- package/dist/app/session-shell/session-shell.d.ts +19 -21
- package/dist/app/session-shell/session-shell.js +678 -840
- package/dist/app/session-shell/session-viewport-controller.js +33 -21
- package/dist/cli/dispatch.js +5 -3
- package/dist/cli/session-context.d.ts +5 -1
- package/dist/cli/session-context.js +25 -8
- package/dist/composition/owned-ui.d.ts +23 -2
- package/dist/composition/owned-ui.js +124 -33
- package/dist/composition/session-info-reference.d.ts +2 -2
- package/dist/composition/session-info-reference.js +2 -2
- package/dist/composition/settings-route-host.js +2 -1
- package/dist/contracts/agent-engine/capability-ports.d.ts +1 -85
- package/dist/contracts/agent-engine/capability-ports.js +1 -35
- package/dist/contracts/agent-engine/index.d.ts +1 -7
- package/dist/contracts/agent-engine/index.js +0 -4
- package/dist/contracts/owned-ui/index.d.ts +9 -3
- package/dist/contracts/owned-ui/index.js +2 -1
- package/dist/contracts/owned-ui/model.d.ts +10 -0
- package/dist/contracts/owned-ui/session-backend.d.ts +119 -0
- package/dist/contracts/owned-ui/session-presenters.d.ts +55 -0
- package/dist/contracts/owned-ui/session-presenters.js +1 -0
- package/dist/contracts/owned-ui/session-workflows.d.ts +342 -0
- package/dist/contracts/owned-ui/session-workflows.js +30 -0
- package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +5 -1
- package/dist/contracts/owned-ui/suggestion-diagnostics.js +3 -1
- package/dist/contracts/owned-ui/validation.js +7 -0
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/session-context.d.ts +17 -2
- package/dist/features/launch/session-context.js +9 -5
- package/dist/features/owned-ui/settings-app.js +56 -54
- package/dist/features/prompt-suggestions/diagnostics.js +4 -1
- package/dist/foundation/lifecycle/index.d.ts +2 -2
- package/dist/foundation/lifecycle/index.js +1 -1
- package/dist/foundation/lifecycle/session-repository-context.d.ts +19 -2
- package/dist/foundation/lifecycle/session-repository-context.js +434 -66
- package/dist/foundation/process-containment/index.d.ts +1 -0
- package/dist/foundation/process-containment/index.js +1 -0
- package/dist/foundation/process-containment/native-process-inspector.d.ts +3 -0
- package/dist/foundation/process-containment/native-process-inspector.js +21 -0
- package/dist/foundation/release/bootstrap.js +1 -2
- package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
- package/dist/foundation/release/progress-palette.generated.js +2 -2
- package/dist/foundation/release/release-gc.js +1 -1
- package/dist/foundation/release/update.js +0 -4
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/foundation/storage/control-store.js +0 -12
- package/dist/integrations/pi/components/components.js +2 -18
- package/dist/integrations/pi/components/index.d.ts +4 -4
- package/dist/integrations/pi/components/index.js +2 -2
- package/dist/integrations/pi/components/modal-frame.js +3 -4
- package/dist/integrations/pi/components/models-dialog.js +6 -35
- package/dist/integrations/pi/components/prompt-input-port.d.ts +1 -0
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
- package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
- package/dist/integrations/pi/components/share-operation-dialog.js +3 -3
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +19 -16
- package/dist/integrations/pi/components/shell-extension-ui.d.ts +5 -3
- package/dist/integrations/pi/components/shell-extension-ui.js +26 -12
- package/dist/integrations/pi/components/shell-hotkey-sections.js +2 -2
- package/dist/integrations/pi/components/shell-presenters-info.js +10 -10
- package/dist/integrations/pi/components/shell-presenters-transcript.js +13 -13
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -6
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +21 -1
- package/dist/integrations/pi/components/shell-shared-facade.js +19 -3
- package/dist/integrations/pi/components/skills-dialog.js +3 -3
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -3
- package/dist/integrations/pi/components/theme.d.ts +9 -0
- package/dist/integrations/pi/components/theme.js +30 -0
- package/dist/integrations/pi/components/tool-result-adapter.js +6 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +6 -6
- package/dist/integrations/pi/components/upstream/components/extension-input.js +4 -4
- package/dist/integrations/pi/components/upstream/components/extension-selector.js +4 -4
- package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +5 -5
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +8 -5
- package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +3 -3
- package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +9 -9
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +3 -2
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +6 -3
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +2 -2
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +4 -0
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +11 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +27 -18
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +4 -4
- package/dist/integrations/pi/components/upstream/history/editor-core.js +11 -7
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
- package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
- package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +31 -0
- package/dist/integrations/pi/components/upstream/program-status-reporter.js +89 -0
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +22 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +225 -10
- package/dist/integrations/pi/engine/adapter.d.ts +44 -24
- package/dist/integrations/pi/engine/adapter.js +130 -22
- package/dist/integrations/pi/engine/command-dispatch.d.ts +2 -5
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -11
- package/dist/integrations/pi/engine/host-ports.d.ts +20 -0
- package/dist/integrations/pi/engine/host-ports.js +13 -0
- package/dist/integrations/pi/engine/host.d.ts +70 -0
- package/dist/integrations/pi/engine/host.js +147 -0
- package/dist/integrations/pi/engine/index.d.ts +8 -4
- package/dist/integrations/pi/engine/index.js +3 -1
- package/dist/integrations/pi/engine/pi-settings-metadata.json +1 -1
- package/dist/integrations/pi/engine/resource-catalog.d.ts +4 -23
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -2
- package/dist/integrations/pi/engine/runtime-integration.js +12 -7
- package/dist/integrations/pi/engine/session-events.js +10 -2
- package/dist/integrations/pi/engine/session-integration.d.ts +3 -8
- package/dist/integrations/pi/engine/session-integration.js +0 -49
- package/dist/integrations/pi/engine/session-runtime.d.ts +18 -3
- package/dist/integrations/pi/engine/session-runtime.js +18 -7
- package/dist/integrations/pi/engine/settings-bridge.d.ts +2 -2
- package/dist/integrations/pi/engine/settings-bridge.js +0 -2
- package/dist/integrations/pi/engine/settings-port.d.ts +2 -0
- package/dist/integrations/pi/engine/settings-port.js +3 -5
- package/dist/integrations/pi/engine/transcript-projection.js +2 -1
- package/dist/integrations/pi/engine/workflows.d.ts +33 -260
- package/dist/integrations/pi/engine/workflows.js +6 -28
- package/dist/integrations/pi/session-presenters/index.d.ts +2 -0
- package/dist/integrations/pi/session-presenters/index.js +1 -0
- package/dist/integrations/pi/session-presenters/presenters.d.ts +16 -0
- package/dist/integrations/pi/session-presenters/presenters.js +341 -0
- package/dist/integrations/pi/startup-public.js +306 -290
- package/dist/integrations/pi/startup-public.manifest.json +289 -265
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -1
- package/dist/integrations/pi/tui-runtime/adapter.js +7 -2
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +3 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +8 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +67 -2
- package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/index.js +1 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/product-identity.d.ts +2 -2
- package/dist/product-identity.js +2 -2
- package/dist/product-identity.json +3 -1
- package/dist/runtime-payload-inventory.json +3092 -2878
- package/dist/ui/components/prompt-input.d.ts +2 -0
- package/dist/ui/components/prompt-input.js +5 -1
- package/dist/ui/components/text-selection.d.ts +1 -1
- package/dist/ui/components/text-selection.js +3 -1
- package/dist/ui/components/theme.d.ts +2 -0
- package/dist/ui/components/transcript-viewport.d.ts +6 -4
- package/dist/ui/components/transcript-viewport.js +94 -16
- package/dist/ui/components/value-menu.d.ts +2 -0
- package/dist/ui/components/value-menu.js +13 -8
- package/dist/ui/settings/declarations.d.ts +38 -14
- package/dist/ui/settings/declarations.js +35 -11
- package/dist/ui/settings/migrations.js +23 -0
- package/docs/architecture/boundaries.md +9 -1
- package/docs/architecture/project-structure.md +7 -5
- package/docs/architecture/prompt-suggestions.md +14 -10
- package/docs/local-worktree-cleanup.md +11 -5
- package/docs/openspec-archive-automation.md +6 -5
- package/package.json +3 -3
- package/dist/contracts/agent-engine/model.d.ts +0 -78
- package/dist/contracts/agent-engine/model.js +0 -1
- package/dist/contracts/agent-engine/ports.d.ts +0 -18
- package/dist/contracts/agent-engine/serialization.d.ts +0 -7
- package/dist/contracts/agent-engine/serialization.js +0 -58
- package/dist/contracts/agent-engine/validation.d.ts +0 -5
- package/dist/contracts/agent-engine/validation.js +0 -128
- package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +0 -61
- package/dist/integrations/pi/components/upstream/theme/system-theme.js +0 -709
- /package/dist/contracts/{agent-engine/ports.js → owned-ui/session-backend.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type WheelScrollLines } from "@earendil-works/pi-tui";
|
|
1
|
+
import { type ProgramStatus, type WheelScrollLines } from "@earendil-works/pi-tui";
|
|
2
2
|
import type { PiTuiComponentPort, PiTuiInputListener, PiTuiOverlayHandle, PiTuiOverlayOptions, PiTuiPreInputListener, PiTuiRuntimeAdapterOptions, PiTuiRuntimeState, PiTuiScrollState, PiTuiStopOptions, PiTuiViewport } from "./contracts.js";
|
|
3
3
|
export type PiTuiRuntimeErrorStage = "construction" | "start" | "input-drain" | "restoration";
|
|
4
4
|
/** Identifies the Pi TUI lifecycle stage that failed while preserving the original cause. */
|
|
@@ -54,6 +54,7 @@ export declare class PiTuiRuntimeAdapter {
|
|
|
54
54
|
setWheelScrollLines(lines: WheelScrollLines): void;
|
|
55
55
|
getClearOnShrink(): boolean;
|
|
56
56
|
setTerminalProgress(active: boolean): void;
|
|
57
|
+
setProgramStatus(status: ProgramStatus): void;
|
|
57
58
|
setTitle(title: string): void;
|
|
58
59
|
/** Shows a bounded fullscreen acknowledgement without changing root layout geometry. */
|
|
59
60
|
showFlash(message: string, durationMs?: number): void;
|
|
@@ -95,7 +95,6 @@ export class PiTuiRuntimeAdapter {
|
|
|
95
95
|
#terminal;
|
|
96
96
|
#tuiTerminal;
|
|
97
97
|
#tui;
|
|
98
|
-
#root;
|
|
99
98
|
#layoutRoot;
|
|
100
99
|
#tuiOptions;
|
|
101
100
|
#logDirectory;
|
|
@@ -120,7 +119,6 @@ export class PiTuiRuntimeAdapter {
|
|
|
120
119
|
#presentationFrozen = false;
|
|
121
120
|
#presentationHolds = new Set();
|
|
122
121
|
constructor(options) {
|
|
123
|
-
this.#root = options.root;
|
|
124
122
|
this.#overlayGeometry = options.onOverlayGeometry === undefined ? undefined : new OverlayGeometryTracker(options.onOverlayGeometry);
|
|
125
123
|
this.#terminal = options.terminal ?? new ProcessTerminal();
|
|
126
124
|
this.#consumeUnhandledMouse = options.consumeUnhandledMouse ?? false;
|
|
@@ -415,6 +413,9 @@ export class PiTuiRuntimeAdapter {
|
|
|
415
413
|
this.#terminal.setProgress(active);
|
|
416
414
|
this.#terminalProgress = active;
|
|
417
415
|
}
|
|
416
|
+
setProgramStatus(status) {
|
|
417
|
+
this.#terminal.setProgramStatus?.(status);
|
|
418
|
+
}
|
|
418
419
|
setTitle(title) {
|
|
419
420
|
this.#terminal.setTitle(title);
|
|
420
421
|
}
|
|
@@ -704,6 +705,7 @@ function coordinatedInputTerminal(terminal, coordinator, setSink, frameMouse) {
|
|
|
704
705
|
clearScreen: () => terminal.clearScreen(),
|
|
705
706
|
setTitle: title => terminal.setTitle(title),
|
|
706
707
|
setProgress: active => terminal.setProgress(active),
|
|
708
|
+
setProgramStatus: status => terminal.setProgramStatus?.(status),
|
|
707
709
|
};
|
|
708
710
|
}
|
|
709
711
|
function diagnosticTerminal(terminal, trace) {
|
|
@@ -731,6 +733,7 @@ function diagnosticTerminal(terminal, trace) {
|
|
|
731
733
|
clearScreen: () => terminal.clearScreen(),
|
|
732
734
|
setTitle: title => terminal.setTitle(title),
|
|
733
735
|
setProgress: active => terminal.setProgress(active),
|
|
736
|
+
setProgramStatus: status => terminal.setProgramStatus?.(status),
|
|
734
737
|
};
|
|
735
738
|
}
|
|
736
739
|
function frozenGateTerminal(terminal, frozen) {
|
|
@@ -757,6 +760,7 @@ function frozenGateTerminal(terminal, frozen) {
|
|
|
757
760
|
terminal.clearScreen(); },
|
|
758
761
|
setTitle: title => terminal.setTitle(title),
|
|
759
762
|
setProgress: active => terminal.setProgress(active),
|
|
763
|
+
setProgramStatus: status => terminal.setProgramStatus?.(status),
|
|
760
764
|
};
|
|
761
765
|
}
|
|
762
766
|
function preInputTerminal(terminal, route, frameMouse) {
|
|
@@ -788,6 +792,7 @@ function preInputTerminal(terminal, route, frameMouse) {
|
|
|
788
792
|
clearScreen: () => terminal.clearScreen(),
|
|
789
793
|
setTitle: title => terminal.setTitle(title),
|
|
790
794
|
setProgress: active => terminal.setProgress(active),
|
|
795
|
+
setProgramStatus: status => terminal.setProgramStatus?.(status),
|
|
791
796
|
};
|
|
792
797
|
}
|
|
793
798
|
function toOverlayOptions(options) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PresentationComponentPort, PresentationPointerSurface } from "../../../contracts/presentation/index.js";
|
|
2
|
-
import type { WheelScrollLines } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { ProgramStatus, WheelScrollLines } from "@earendil-works/pi-tui";
|
|
3
3
|
import type { PiTuiInputCoordinationDecision, PiTuiInputCoordinationScheduler, PiTuiInputSurfaceKind } from "./input-presentation-coordinator.js";
|
|
4
4
|
export type PiTuiRuntimeState = "idle" | "running" | "stopping" | "stopped" | "failed";
|
|
5
5
|
export interface PiTuiViewport {
|
|
@@ -32,6 +32,8 @@ export interface PiTuiTerminalPort {
|
|
|
32
32
|
clearScreen(): void;
|
|
33
33
|
setTitle(title: string): void;
|
|
34
34
|
setProgress(active: boolean): void;
|
|
35
|
+
/** Optional for neutral test/decorator ports; the Pi-facing adapter always supplies it. */
|
|
36
|
+
setProgramStatus?(status: ProgramStatus): void;
|
|
35
37
|
}
|
|
36
38
|
export type PiTuiSizeValue = number | `${number}%`;
|
|
37
39
|
export type PiTuiOverlayAnchor = "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center" | "left-center" | "right-center";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PiTuiTerminalPort } from "./contracts.js";
|
|
2
|
-
export declare const PINNED_PI_TUI_DAMAGE_GRAMMAR = "@earendil-works/pi-tui@1.0
|
|
2
|
+
export declare const PINNED_PI_TUI_DAMAGE_GRAMMAR = "@earendil-works/pi-tui@1.1.0:tui-alt-screen-one-write-v1";
|
|
3
3
|
export interface PiTuiDamageFrameDescriptor {
|
|
4
4
|
readonly frameId: number;
|
|
5
5
|
readonly width: number;
|
|
@@ -63,6 +63,9 @@ export declare class DamageAwareTerminalAdapter implements PiTuiTerminalPort {
|
|
|
63
63
|
get kittyProtocolActive(): boolean;
|
|
64
64
|
get lastDecision(): PiTuiDamageDecision;
|
|
65
65
|
get hyperlinkCleanupPending(): boolean;
|
|
66
|
+
get canvasBackgroundAnsi(): string | null;
|
|
67
|
+
/** Invalidates remembered terminal cells before the shell forces one complete canvas repaint. */
|
|
68
|
+
setCanvasBackground(ansi: string | null): boolean;
|
|
66
69
|
/**
|
|
67
70
|
* The rows as last forwarded to the terminal, top to bottom, with styling
|
|
68
71
|
* intact. A row the adapter has not seen since its last invalidation is empty.
|
|
@@ -86,3 +89,7 @@ export declare class DamageAwareTerminalAdapter implements PiTuiTerminalPort {
|
|
|
86
89
|
setTitle(title: string): void;
|
|
87
90
|
setProgress(active: boolean): void;
|
|
88
91
|
}
|
|
92
|
+
/** Makes SGR background resets return to A1's canvas while preserving explicit backgrounds. */
|
|
93
|
+
export declare function rebaseTerminalDefaultBackground(content: string, backgroundAnsi: string): string;
|
|
94
|
+
/** Paints only synchronized fullscreen rows; clipboard/title/progress controls remain byte-identical. */
|
|
95
|
+
export declare function paintTerminalCanvasFrame(data: string, backgroundAnsi: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const PINNED_PI_TUI_DAMAGE_GRAMMAR = "@earendil-works/pi-tui@1.0
|
|
1
|
+
export const PINNED_PI_TUI_DAMAGE_GRAMMAR = "@earendil-works/pi-tui@1.1.0:tui-alt-screen-one-write-v1";
|
|
2
2
|
const BEGIN_SYNCHRONIZED_OUTPUT = "\u001b[?2026h";
|
|
3
3
|
const END_SYNCHRONIZED_OUTPUT = "\u001b[?2026l";
|
|
4
4
|
const ROW_MARKER = /\u001b\[(\d+);1H\u001b\[2K/gu;
|
|
@@ -8,6 +8,7 @@ const ROW_MARKER = /\u001b\[(\d+);1H\u001b\[2K/gu;
|
|
|
8
8
|
const ROW_CONTENT_CURSOR = /\u001b\[\d+;1H/u;
|
|
9
9
|
const CURSOR_SUFFIX = /(?:\u001b\[(\d+);(\d+)H)?\u001b\[\?25[hl]\u001b\[\?2026l$/u;
|
|
10
10
|
const OUT_OF_BAND = /^(?:\u001b\](?:0|2|9|52);[^\u0007\u001b]*(?:\u0007|\u001b\\)|\u001b\[\?25[hl])+$/u;
|
|
11
|
+
const SGR_SEQUENCE = /\u001b\[([0-9:;]*)m/gu;
|
|
11
12
|
/**
|
|
12
13
|
* A fail-closed adapter for one pinned Pi fullscreen write grammar. Semantic
|
|
13
14
|
* viewport metadata authorizes a shift; bytes are inspected only to validate
|
|
@@ -26,6 +27,7 @@ export class DamageAwareTerminalAdapter {
|
|
|
26
27
|
#lastConsumedFrameId = 0;
|
|
27
28
|
#cacheWidth = 0;
|
|
28
29
|
#cacheHeight = 0;
|
|
30
|
+
#canvasBackgroundAnsi = null;
|
|
29
31
|
#decision = {
|
|
30
32
|
frameId: null,
|
|
31
33
|
transformed: false,
|
|
@@ -41,6 +43,15 @@ export class DamageAwareTerminalAdapter {
|
|
|
41
43
|
get kittyProtocolActive() { return this.inner.kittyProtocolActive; }
|
|
42
44
|
get lastDecision() { return this.#decision; }
|
|
43
45
|
get hyperlinkCleanupPending() { return this.#cleanupRevision > this.#cleanedRevision; }
|
|
46
|
+
get canvasBackgroundAnsi() { return this.#canvasBackgroundAnsi; }
|
|
47
|
+
/** Invalidates remembered terminal cells before the shell forces one complete canvas repaint. */
|
|
48
|
+
setCanvasBackground(ansi) {
|
|
49
|
+
if (this.#canvasBackgroundAnsi === ansi)
|
|
50
|
+
return false;
|
|
51
|
+
this.#canvasBackgroundAnsi = ansi;
|
|
52
|
+
this.#invalidatePresentation();
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
44
55
|
/**
|
|
45
56
|
* The rows as last forwarded to the terminal, top to bottom, with styling
|
|
46
57
|
* intact. A row the adapter has not seen since its last invalidation is empty.
|
|
@@ -140,7 +151,10 @@ export class DamageAwareTerminalAdapter {
|
|
|
140
151
|
output = buildDamageWrite(parsed, armed.descriptor, new Set(decision.paintedRows), this.#rows);
|
|
141
152
|
}
|
|
142
153
|
}
|
|
143
|
-
this
|
|
154
|
+
const forwarded = this.#canvasBackgroundAnsi === null
|
|
155
|
+
? output
|
|
156
|
+
: paintTerminalCanvasFrame(output, this.#canvasBackgroundAnsi);
|
|
157
|
+
this.inner.write(forwarded);
|
|
144
158
|
if (epoch !== this.#epoch
|
|
145
159
|
|| (armed !== undefined && this.#lastConsumedFrameId !== armed.descriptor.frameId))
|
|
146
160
|
return;
|
|
@@ -363,6 +377,57 @@ export class DamageAwareTerminalAdapter {
|
|
|
363
377
|
this.#cacheHeight = 0;
|
|
364
378
|
}
|
|
365
379
|
}
|
|
380
|
+
/** Makes SGR background resets return to A1's canvas while preserving explicit backgrounds. */
|
|
381
|
+
export function rebaseTerminalDefaultBackground(content, backgroundAnsi) {
|
|
382
|
+
return content.replace(SGR_SEQUENCE, (sequence, parameters) => (sgrLeavesDefaultBackground(parameters) ? `${sequence}${backgroundAnsi}` : sequence));
|
|
383
|
+
}
|
|
384
|
+
/** Paints only synchronized fullscreen rows; clipboard/title/progress controls remain byte-identical. */
|
|
385
|
+
export function paintTerminalCanvasFrame(data, backgroundAnsi) {
|
|
386
|
+
if (!data.startsWith(BEGIN_SYNCHRONIZED_OUTPUT) || !data.endsWith(END_SYNCHRONIZED_OUTPUT)
|
|
387
|
+
|| !ROW_MARKER.test(data)) {
|
|
388
|
+
ROW_MARKER.lastIndex = 0;
|
|
389
|
+
return data;
|
|
390
|
+
}
|
|
391
|
+
ROW_MARKER.lastIndex = 0;
|
|
392
|
+
const rows = data.replace(ROW_MARKER, (_marker, row) => (`\u001b[${row};1H${backgroundAnsi}\u001b[2K${backgroundAnsi}`));
|
|
393
|
+
ROW_MARKER.lastIndex = 0;
|
|
394
|
+
const rebased = rebaseTerminalDefaultBackground(rows, backgroundAnsi);
|
|
395
|
+
return `${rebased.slice(0, -END_SYNCHRONIZED_OUTPUT.length)}\u001b[49m${END_SYNCHRONIZED_OUTPUT}`;
|
|
396
|
+
}
|
|
397
|
+
function sgrLeavesDefaultBackground(parameters) {
|
|
398
|
+
if (parameters.length === 0)
|
|
399
|
+
return true;
|
|
400
|
+
const values = parameters.split(";");
|
|
401
|
+
let defaultBackground;
|
|
402
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
403
|
+
const token = values[index];
|
|
404
|
+
const code = Number.parseInt(token.split(":", 1)[0] || "0", 10);
|
|
405
|
+
if (!Number.isFinite(code))
|
|
406
|
+
continue;
|
|
407
|
+
if (code === 0 || code === 49) {
|
|
408
|
+
defaultBackground = true;
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
if (code >= 40 && code <= 47 || code >= 100 && code <= 107) {
|
|
412
|
+
defaultBackground = false;
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (code !== 38 && code !== 48 && code !== 58)
|
|
416
|
+
continue;
|
|
417
|
+
if (code === 48)
|
|
418
|
+
defaultBackground = false;
|
|
419
|
+
if (token.includes(":"))
|
|
420
|
+
continue;
|
|
421
|
+
const mode = Number.parseInt(values[index + 1] ?? "", 10);
|
|
422
|
+
if (mode === 5)
|
|
423
|
+
index += 2;
|
|
424
|
+
else if (mode === 2)
|
|
425
|
+
index += 4;
|
|
426
|
+
else
|
|
427
|
+
index += 1;
|
|
428
|
+
}
|
|
429
|
+
return defaultBackground === true;
|
|
430
|
+
}
|
|
366
431
|
function parsePinnedFullscreenWrite(data) {
|
|
367
432
|
if (!data.startsWith(BEGIN_SYNCHRONIZED_OUTPUT) || !data.endsWith(END_SYNCHRONIZED_OUTPUT))
|
|
368
433
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { PiTuiComponentPort, PiTuiInputDiagnosticsEvent, PiTuiInputDiagnosticsPhase, PiTuiInputListener, PiTuiInputListenerResult, PiTuiLayoutEntry, PiTuiLayoutNode, PiTuiOverlayAnchor, PiTuiOverlayHandle, PiTuiOverlayMargin, PiTuiOverlayOptions, PiTuiOverlayUnfocusOptions, PiTuiPointerSurface, PiTuiPreInputListener, PiTuiRuntimeAdapterOptions, PiTuiRuntimeState, PiTuiScrollState, PiTuiSizeValue, PiTuiStopOptions, PiTuiTerminalPort, PiTuiViewport, } from "./contracts.js";
|
|
2
2
|
export { samePointerSurfaces } from "./overlay-geometry.js";
|
|
3
|
-
export { DamageAwareTerminalAdapter, PINNED_PI_TUI_DAMAGE_GRAMMAR } from "./damage-aware-terminal.js";
|
|
3
|
+
export { DamageAwareTerminalAdapter, PINNED_PI_TUI_DAMAGE_GRAMMAR, paintTerminalCanvasFrame, rebaseTerminalDefaultBackground, } from "./damage-aware-terminal.js";
|
|
4
4
|
export type { DamageAwareTerminalOptions, PiTuiDamageDecision, PiTuiDamageDecisionReason, PiTuiDamageFrameDescriptor, PiTuiDamageFrameSafety, } from "./damage-aware-terminal.js";
|
|
5
5
|
export { InputPresentationCoordinator, classifyPiTuiInput } from "./input-presentation-coordinator.js";
|
|
6
6
|
export type { InputPresentationCoordinatorOptions, PiTuiInputCoordinationDecision, PiTuiInputCoordinationScheduler, PiTuiInputCoordinationTrace, PiTuiInputSurfaceKind, } from "./input-presentation-coordinator.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { samePointerSurfaces } from "./overlay-geometry.js";
|
|
2
|
-
export { DamageAwareTerminalAdapter, PINNED_PI_TUI_DAMAGE_GRAMMAR } from "./damage-aware-terminal.js";
|
|
2
|
+
export { DamageAwareTerminalAdapter, PINNED_PI_TUI_DAMAGE_GRAMMAR, paintTerminalCanvasFrame, rebaseTerminalDefaultBackground, } from "./damage-aware-terminal.js";
|
|
3
3
|
export { InputPresentationCoordinator, classifyPiTuiInput } from "./input-presentation-coordinator.js";
|
|
4
4
|
export { PiTuiRuntimeAdapter, PiTuiRuntimeError } from "./adapter.js";
|
|
5
5
|
export { createPiPresentationRuntime, createPiTerminalBridge } from "./presentation-adapter.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"platform": "darwin",
|
|
6
6
|
"architecture": "arm64",
|
|
7
7
|
"capability": "supported",
|
|
8
|
-
"builtAt": "2026-10-
|
|
8
|
+
"builtAt": "2026-10-10T06:00:13.890Z",
|
|
9
9
|
"artifact": {
|
|
10
10
|
"filename": "process-guardian",
|
|
11
11
|
"sha256": "51b0b2dc1c9ae577f2586c4217066929278726c2c15308d9144eb6f538e118ff",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"platform": "linux",
|
|
6
6
|
"architecture": "x64",
|
|
7
7
|
"capability": "supported",
|
|
8
|
-
"builtAt": "2026-10-
|
|
8
|
+
"builtAt": "2026-10-10T06:00:04.832Z",
|
|
9
9
|
"artifact": {
|
|
10
10
|
"filename": "process-guardian",
|
|
11
11
|
"sha256": "ef62679e83bc1fad3d38f9f21675d9256f08d20e67fd4791571032115ca1b0e9",
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"platform": "win32",
|
|
6
6
|
"architecture": "x64",
|
|
7
7
|
"capability": "supported",
|
|
8
|
-
"builtAt": "2026-10-
|
|
8
|
+
"builtAt": "2026-10-10T06:00:51.067Z",
|
|
9
9
|
"artifact": {
|
|
10
10
|
"filename": "process-guardian.exe",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "e9c6d7e4596a7cd2634bb74b67925499fe6817cbfb667b574d27ff1b7cb33d93",
|
|
12
12
|
"size": 288256
|
|
13
13
|
},
|
|
14
14
|
"provenance": {
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const ENVIRONMENT_KEYS: readonly ["clipboardDiagnostics", "configDir", "dataDir", "databasePath", "developmentInstanceId", "developmentRoot", "endpoint", "exitNoticePath", "paneId", "probeTrace", "processGuardianPath", "prFooterPreview", "profileHome", "runtimeDir", "skipVersionCheck", "startupTrace", "suggestionDiagnostics", "terminalSessionId"];
|
|
1
|
+
declare const ENVIRONMENT_KEYS: readonly ["clipboardDiagnostics", "configDir", "dataDir", "databasePath", "developmentInstanceId", "developmentRoot", "endpoint", "exitNoticePath", "paneId", "probeTrace", "processGuardianPath", "prFooterPreview", "profileHome", "runtimeDir", "sessionRuntimeId", "skipVersionCheck", "startupTrace", "suggestionDiagnostics", "terminalSessionId"];
|
|
2
2
|
declare const FILESYSTEM_KEYS: readonly ["slug", "windowsDirectory", "unixDirectory", "temporaryPrefix"];
|
|
3
|
-
declare const STATE_KEYS: readonly ["windowsControlDirectory", "unixControlDirectory", "developmentDirectory", "piAgentProfile", "piVanillaProfile", "sessionRepositoryDirectory"];
|
|
3
|
+
declare const STATE_KEYS: readonly ["windowsControlDirectory", "unixControlDirectory", "developmentDirectory", "piAgentProfile", "piVanillaProfile", "sessionRepositoryDirectory", "sessionWorktreeClaimDirectory"];
|
|
4
4
|
declare const ENDPOINT_KEYS: readonly ["windowsPipeStem", "unixSocketFilename", "metadataFilename", "supervisorLogFilename", "databaseFilename"];
|
|
5
5
|
declare const MANIFEST_KEYS: readonly ["releaseFilename", "packageFilename"];
|
|
6
6
|
declare const PROTOCOL_KEYS: readonly ["namespace", "controlEnvelope", "supervisorSchema", "nativeHostSchema", "structuredAgentSchema", "controlStoreSchema", "promptHistorySchema", "releaseCohortSchema", "updateJournalSchema"];
|
package/dist/product-identity.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import rawIdentity from "./product-identity.json" with { type: "json" };
|
|
2
2
|
const ENVIRONMENT_KEYS = [
|
|
3
3
|
"clipboardDiagnostics", "configDir", "dataDir", "databasePath", "developmentInstanceId", "developmentRoot", "endpoint", "exitNoticePath",
|
|
4
|
-
"paneId", "probeTrace", "processGuardianPath", "prFooterPreview", "profileHome", "runtimeDir", "skipVersionCheck", "startupTrace", "suggestionDiagnostics", "terminalSessionId",
|
|
4
|
+
"paneId", "probeTrace", "processGuardianPath", "prFooterPreview", "profileHome", "runtimeDir", "sessionRuntimeId", "skipVersionCheck", "startupTrace", "suggestionDiagnostics", "terminalSessionId",
|
|
5
5
|
];
|
|
6
6
|
const FILESYSTEM_KEYS = ["slug", "windowsDirectory", "unixDirectory", "temporaryPrefix"];
|
|
7
|
-
const STATE_KEYS = ["windowsControlDirectory", "unixControlDirectory", "developmentDirectory", "piAgentProfile", "piVanillaProfile", "sessionRepositoryDirectory"];
|
|
7
|
+
const STATE_KEYS = ["windowsControlDirectory", "unixControlDirectory", "developmentDirectory", "piAgentProfile", "piVanillaProfile", "sessionRepositoryDirectory", "sessionWorktreeClaimDirectory"];
|
|
8
8
|
const ENDPOINT_KEYS = ["windowsPipeStem", "unixSocketFilename", "metadataFilename", "supervisorLogFilename", "databaseFilename"];
|
|
9
9
|
const MANIFEST_KEYS = ["releaseFilename", "packageFilename"];
|
|
10
10
|
const PROTOCOL_KEYS = ["namespace", "controlEnvelope", "supervisorSchema", "nativeHostSchema", "structuredAgentSchema", "controlStoreSchema", "promptHistorySchema", "releaseCohortSchema", "updateJournalSchema"];
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"prFooterPreview": "A1_PR_FOOTER_PREVIEW",
|
|
25
25
|
"profileHome": "A1_PROFILE_HOME",
|
|
26
26
|
"runtimeDir": "A1_RUNTIME_DIR",
|
|
27
|
+
"sessionRuntimeId": "A1_SESSION_RUNTIME_ID",
|
|
27
28
|
"skipVersionCheck": "A1_SKIP_VERSION_CHECK",
|
|
28
29
|
"startupTrace": "A1_STARTUP_TRACE",
|
|
29
30
|
"suggestionDiagnostics": "A1_SUGGESTION_DIAGNOSTICS",
|
|
@@ -35,7 +36,8 @@
|
|
|
35
36
|
"developmentDirectory": "a1-development",
|
|
36
37
|
"piAgentProfile": ".a1/agent",
|
|
37
38
|
"piVanillaProfile": ".pi/agent",
|
|
38
|
-
"sessionRepositoryDirectory": "session-repositories"
|
|
39
|
+
"sessionRepositoryDirectory": "session-repositories",
|
|
40
|
+
"sessionWorktreeClaimDirectory": "session-worktree-claims"
|
|
39
41
|
},
|
|
40
42
|
"endpoint": {
|
|
41
43
|
"windowsPipeStem": "a1",
|