@timurproko/a1 0.2.6-dev.734 → 0.2.6

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.
Files changed (45) hide show
  1. package/dist/app/session-shell/index.d.ts +2 -2
  2. package/dist/app/session-shell/index.js +1 -1
  3. package/dist/app/session-shell/session-shell-root.d.ts +9 -1
  4. package/dist/app/session-shell/session-shell-root.js +56 -47
  5. package/dist/app/session-shell/session-shell.d.ts +37 -9
  6. package/dist/app/session-shell/session-shell.js +266 -446
  7. package/dist/app/session-shell/shell-host.d.ts +105 -0
  8. package/dist/app/session-shell/shell-host.js +523 -0
  9. package/dist/cli/session-context.js +6 -3
  10. package/dist/composition/owned-ui.js +45 -25
  11. package/dist/contracts/owned-ui/index.d.ts +1 -1
  12. package/dist/contracts/owned-ui/session-presenters.d.ts +35 -8
  13. package/dist/features/launch/index.d.ts +1 -1
  14. package/dist/features/launch/index.js +1 -1
  15. package/dist/features/launch/session-context.d.ts +1 -0
  16. package/dist/features/launch/session-context.js +1 -0
  17. package/dist/features/owned-ui/resources/release-notes.json +4 -0
  18. package/dist/features/owned-ui/settings-app.js +3 -3
  19. package/dist/foundation/lifecycle/index.d.ts +1 -1
  20. package/dist/foundation/lifecycle/index.js +1 -1
  21. package/dist/foundation/lifecycle/session-repository-context.d.ts +8 -2
  22. package/dist/foundation/lifecycle/session-repository-context.js +200 -65
  23. package/dist/foundation/release/cohort-state.js +5 -2
  24. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +11 -0
  25. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +18 -2
  26. package/dist/native/darwin-arm64/manifest.json +1 -1
  27. package/dist/native/linux-x64/manifest.json +1 -1
  28. package/dist/native/win32-x64/manifest.json +2 -2
  29. package/dist/native/win32-x64/process-guardian.exe +0 -0
  30. package/dist/ui/components/value-menu.d.ts +6 -3
  31. package/dist/ui/components/value-menu.js +6 -5
  32. package/docs/architecture/boundaries.md +1 -1
  33. package/docs/architecture/evidence/terminal-host-spike/manual-one-pane-terminal-host.md +70 -0
  34. package/docs/architecture/evidence/terminal-host-spike/manual-two-by-two-basic-terminal-host.md +32 -0
  35. package/docs/architecture/evidence/terminal-host-spike/milestone-baseline.json +115 -0
  36. package/docs/architecture/evidence/terminal-host-spike/owned-ui-foundation-prerequisite.json +48 -0
  37. package/docs/architecture/evidence/terminal-host-spike/terminal-host-provenance.json +125 -0
  38. package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-1.json +56 -0
  39. package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-3.json +174 -0
  40. package/docs/architecture/evidence/terminal-host-spike/terminal-spike-acceptance-record.json +18 -0
  41. package/docs/architecture/terminal-host-proof-gate.md +1 -1
  42. package/docs/architecture/terminal-host-spike-evidence.md +1 -1
  43. package/docs/architecture/ui-reference-provenance.md +1 -1
  44. package/docs/releases/0.2.6.md +44 -0
  45. package/package.json +1 -1
@@ -3,7 +3,7 @@ export { createOwnedUiClipboardServices } from "./clipboard-services.js";
3
3
  export type { OwnedUiClipboardServices, OwnedUiClipboardServicesOptions } from "./clipboard-services.js";
4
4
  export { ContextualPromptSuggestionController, samePromptSuggestionIdentity } from "./prompt-suggestion-controller.js";
5
5
  export type { ContextualPromptSuggestionControllerOptions, ContextualPromptSuggestionSurface } from "./prompt-suggestion-controller.js";
6
- export { OwnedUiSessionShell, OwnedUiSessionShellRoot, formatSessionResumeCommand, quoteCommandArgument } from "./session-shell.js";
7
- export type { OwnedUiSessionShellOptions, OwnedUiShellDiagnosticOptions, OwnedUiShellEngineOptions, OwnedUiShellHistoryOptions, OwnedUiShellPresentationOptions, OwnedUiShellPromptImagesOptions, OwnedUiShellSharedServices, OwnedUiShellSkillsOptions, OwnedUiShellSuggestionOptions, SessionResumeCommandMetadata, } from "./session-shell.js";
6
+ export { OwnedUiSessionPresenter, OwnedUiSessionShell, OwnedUiSessionShellRoot, OwnedUiTerminalHost, formatSessionResumeCommand, quoteCommandArgument, sessionTerminalHostOptions, } from "./session-shell.js";
7
+ export type { OwnedUiSessionShellOptions, OwnedUiTerminalHostOptions, OwnedUiShellDiagnosticOptions, OwnedUiShellEngineOptions, OwnedUiShellHistoryOptions, OwnedUiShellPresentationOptions, OwnedUiShellPromptImagesOptions, OwnedUiShellSharedServices, OwnedUiShellSkillsOptions, OwnedUiShellSuggestionOptions, SessionResumeCommandMetadata, } from "./session-shell.js";
8
8
  export { STREAM_PRESENTATION_INTERVAL_MS, StreamPresentationCoalescer } from "./stream-presentation-coalescer.js";
9
9
  export type { StreamPresentationScheduler } from "./stream-presentation-coalescer.js";
@@ -1,5 +1,5 @@
1
1
  export { ClipboardDiagnosticCapture } from "./clipboard-diagnostics.js";
2
2
  export { createOwnedUiClipboardServices } from "./clipboard-services.js";
3
3
  export { ContextualPromptSuggestionController, samePromptSuggestionIdentity } from "./prompt-suggestion-controller.js";
4
- export { OwnedUiSessionShell, OwnedUiSessionShellRoot, formatSessionResumeCommand, quoteCommandArgument } from "./session-shell.js";
4
+ export { OwnedUiSessionPresenter, OwnedUiSessionShell, OwnedUiSessionShellRoot, OwnedUiTerminalHost, formatSessionResumeCommand, quoteCommandArgument, sessionTerminalHostOptions, } from "./session-shell.js";
5
5
  export { STREAM_PRESENTATION_INTERVAL_MS, StreamPresentationCoalescer } from "./stream-presentation-coalescer.js";
@@ -272,7 +272,8 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
272
272
  viewportInputGeometryReady(width: number, height: number): boolean;
273
273
  handleViewportPreInput(data: string, allowWheel?: boolean, now?: number, editorActive?: boolean): SessionViewportInputResult;
274
274
  dismissNotice(): void;
275
- layoutRoot(): PiTuiLayoutNode;
275
+ /** The pinned-profile layout regions of this session; the terminal host arranges them with `pinnedLayoutRoot`. */
276
+ layoutParts(): PinnedLayoutParts;
276
277
  transcriptComponent(id: string): PiShellTranscriptComponentPort | undefined;
277
278
  exitTranscript(width: number): string;
278
279
  appendWorkflowStatus(message: string): void;
@@ -306,5 +307,12 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
306
307
  setFocused(focused: boolean): void;
307
308
  dispose(): void;
308
309
  }
310
+ export type PinnedLayoutPart = "document" | "queued" | "aboveWidgets" | "status" | "editor" | "belowWidgets" | "footer";
311
+ export type PinnedLayoutParts = Readonly<Record<PinnedLayoutPart, PiTuiComponentPort>>;
312
+ /**
313
+ * The pinned-profile screen: a followed transcript scroll above the dock. The runtime mounts one such layout,
314
+ * so its single `transcript` scroll view is shared by whichever session the parts currently resolve to.
315
+ */
316
+ export declare function pinnedLayoutRoot(parts: PinnedLayoutParts): PiTuiLayoutNode;
309
317
  export declare function shellResourceEntries(backend: OwnedUiSessionBackend): readonly PiShellResourceEntry[];
310
318
  export {};
@@ -680,54 +680,16 @@ export class OwnedUiSessionShellRoot {
680
680
  #renderQueued(width) {
681
681
  return this.#view.editor.queuedSubmissions.length === 0 ? [] : this.#queued.render(width);
682
682
  }
683
- layoutRoot() {
684
- const document = layoutPort(width => this.#renderDocument(width), () => this.invalidate());
685
- const queued = layoutPort(width => this.#view.editor.queuedSubmissions.length === 0 ? [] : this.#queued.render(width), () => this.#queued.invalidate());
686
- const aboveWidgets = layoutPort(width => this.#renderWidgets("aboveEditor", width), () => this.#invalidateExtensions());
687
- const status = layoutPort(width => this.#renderStatus(width), () => this.#status.invalidate());
688
- const editor = layoutPort(width => this.#inputSurface.render(width), () => this.#inputSurface.invalidate(), data => this.#inputSurface.handleInput?.(data));
689
- const belowWidgets = layoutPort(width => this.#renderWidgets("belowEditor", width), () => this.#invalidateExtensions());
690
- const footer = layoutPort(width => this.#renderFooter(width), () => (this.#extensionFooter ?? this.#footer).invalidate());
683
+ /** The pinned-profile layout regions of this session; the terminal host arranges them with `pinnedLayoutRoot`. */
684
+ layoutParts() {
691
685
  return {
692
- type: "stack",
693
- direction: "vertical",
694
- children: [
695
- {
696
- basis: 0,
697
- grow: 1,
698
- shrink: 1,
699
- minSize: 1,
700
- node: {
701
- type: "scroll",
702
- id: "transcript",
703
- follow: "end",
704
- primary: true,
705
- overscroll: "chain",
706
- scrollbar: "auto",
707
- scrollbarTrackStyle: text => piTheme().fg("scrollbarTrack", text),
708
- scrollbarThumbStyle: text => piTheme().fg("scrollbarThumb", text),
709
- child: { type: "component", component: document },
710
- },
711
- },
712
- {
713
- basis: "auto",
714
- grow: 0,
715
- shrink: 1,
716
- minSize: 1,
717
- node: {
718
- type: "stack",
719
- direction: "vertical",
720
- children: [
721
- { shrink: 1, minSize: 0, node: { type: "component", component: queued } },
722
- { shrink: 1, minSize: 0, node: { type: "component", component: status } },
723
- { shrink: 1, minSize: 0, node: { type: "component", component: aboveWidgets } },
724
- { shrink: 1, minSize: 3, node: { type: "component", component: editor } },
725
- { shrink: 1, minSize: 0, node: { type: "component", component: belowWidgets } },
726
- { shrink: 1, minSize: 1, node: { type: "component", component: footer } },
727
- ],
728
- },
729
- },
730
- ],
686
+ document: layoutPort(width => this.#renderDocument(width), () => this.invalidate()),
687
+ queued: layoutPort(width => this.#view.editor.queuedSubmissions.length === 0 ? [] : this.#queued.render(width), () => this.#queued.invalidate()),
688
+ aboveWidgets: layoutPort(width => this.#renderWidgets("aboveEditor", width), () => this.#invalidateExtensions()),
689
+ status: layoutPort(width => this.#renderStatus(width), () => this.#status.invalidate()),
690
+ editor: layoutPort(width => this.#inputSurface.render(width), () => this.#inputSurface.invalidate(), data => this.#inputSurface.handleInput?.(data)),
691
+ belowWidgets: layoutPort(width => this.#renderWidgets("belowEditor", width), () => this.#invalidateExtensions()),
692
+ footer: layoutPort(width => this.#renderFooter(width), () => (this.#extensionFooter ?? this.#footer).invalidate()),
731
693
  };
732
694
  }
733
695
  #renderDocument(width) {
@@ -1373,6 +1335,53 @@ function pinnedPromptSourceRow(block, sourceRow, width) {
1373
1335
  return sourceRow;
1374
1336
  return overlaySpan(sourceRow, rowWidth - timestampWidth, rowWidth, paintPiSubmittedPromptTimestamp(timestamp));
1375
1337
  }
1338
+ /**
1339
+ * The pinned-profile screen: a followed transcript scroll above the dock. The runtime mounts one such layout,
1340
+ * so its single `transcript` scroll view is shared by whichever session the parts currently resolve to.
1341
+ */
1342
+ export function pinnedLayoutRoot(parts) {
1343
+ return {
1344
+ type: "stack",
1345
+ direction: "vertical",
1346
+ children: [
1347
+ {
1348
+ basis: 0,
1349
+ grow: 1,
1350
+ shrink: 1,
1351
+ minSize: 1,
1352
+ node: {
1353
+ type: "scroll",
1354
+ id: "transcript",
1355
+ follow: "end",
1356
+ primary: true,
1357
+ overscroll: "chain",
1358
+ scrollbar: "auto",
1359
+ scrollbarTrackStyle: text => piTheme().fg("scrollbarTrack", text),
1360
+ scrollbarThumbStyle: text => piTheme().fg("scrollbarThumb", text),
1361
+ child: { type: "component", component: parts.document },
1362
+ },
1363
+ },
1364
+ {
1365
+ basis: "auto",
1366
+ grow: 0,
1367
+ shrink: 1,
1368
+ minSize: 1,
1369
+ node: {
1370
+ type: "stack",
1371
+ direction: "vertical",
1372
+ children: [
1373
+ { shrink: 1, minSize: 0, node: { type: "component", component: parts.queued } },
1374
+ { shrink: 1, minSize: 0, node: { type: "component", component: parts.status } },
1375
+ { shrink: 1, minSize: 0, node: { type: "component", component: parts.aboveWidgets } },
1376
+ { shrink: 1, minSize: 3, node: { type: "component", component: parts.editor } },
1377
+ { shrink: 1, minSize: 0, node: { type: "component", component: parts.belowWidgets } },
1378
+ { shrink: 1, minSize: 1, node: { type: "component", component: parts.footer } },
1379
+ ],
1380
+ },
1381
+ },
1382
+ ],
1383
+ };
1384
+ }
1376
1385
  function layoutPort(render, invalidate, handleInput) {
1377
1386
  return {
1378
1387
  render,
@@ -2,20 +2,35 @@ import type { OwnedUiCommandResult, OwnedUiSessionBackend, OwnedUiSessionViewMod
2
2
  import { type PiShellSkillSummary } from "../../integrations/pi/components/skills-command.js";
3
3
  import { type PiShellHotkeysPresentation } from "../../integrations/pi/components/shell-presenters-info.js";
4
4
  import type { PiShellSelectorOption } from "../../integrations/pi/components/shell-shared-facade.js";
5
- import { type PiTuiDamageDecision } from "../../integrations/pi/tui-runtime/damage-aware-terminal.js";
6
- import { PiTuiRuntimeAdapter } from "../../integrations/pi/tui-runtime/adapter.js";
7
- import type { PiTuiOverlayHandle } from "../../integrations/pi/tui-runtime/contracts.js";
8
- import { OwnedUiSessionShellRoot, type OwnedUiSessionShellOptions } from "./session-shell-root.js";
5
+ import type { PiTuiDamageDecision } from "../../integrations/pi/tui-runtime/damage-aware-terminal.js";
6
+ import type { PiTuiRuntimeAdapter } from "../../integrations/pi/tui-runtime/adapter.js";
7
+ import type { PiTuiInputSurfaceKind } from "../../integrations/pi/tui-runtime/input-presentation-coordinator.js";
8
+ import type { PiTuiComponentPort, PiTuiInputListenerResult, PiTuiOverlayHandle, PiTuiPointerSurface } from "../../integrations/pi/tui-runtime/contracts.js";
9
+ import { OwnedUiTerminalHost, type OwnedUiHostedPresenter, type OwnedUiPresenterRelease } from "./shell-host.js";
10
+ import { OwnedUiSessionShellRoot, type OwnedUiSessionShellOptions, type PinnedLayoutPart } from "./session-shell-root.js";
9
11
  export { OwnedUiSessionShellRoot, type OwnedUiSessionShellOptions, type OwnedUiShellDiagnosticOptions, type OwnedUiShellEngineOptions, type OwnedUiShellHistoryOptions, type OwnedUiShellPresentationOptions, type OwnedUiShellPromptImagesOptions, type OwnedUiShellSharedServices, type OwnedUiShellSkillsOptions, type OwnedUiShellSuggestionOptions, } from "./session-shell-root.js";
10
- /** Coordinates backend, owned presentation, and Pi TUI lifecycles for one interactive session. */
11
- export declare class OwnedUiSessionShell {
12
+ export { OwnedUiTerminalHost, sessionTerminalHostOptions, type OwnedUiTerminalHostOptions } from "./shell-host.js";
13
+ /**
14
+ * Presents one engine session: its transcript root, editor, controllers, submission, workflows, and dialogs.
15
+ * It reaches the terminal only through its terminal host's handle, and paints only while it is attached.
16
+ */
17
+ export declare class OwnedUiSessionPresenter implements OwnedUiHostedPresenter {
12
18
  #private;
13
19
  readonly backend: OwnedUiSessionBackend;
14
20
  readonly root: OwnedUiSessionShellRoot;
15
- readonly runtime: PiTuiRuntimeAdapter;
16
- constructor(options: OwnedUiSessionShellOptions);
21
+ constructor(host: OwnedUiTerminalHost, options: OwnedUiSessionShellOptions);
17
22
  view(): OwnedUiSessionViewModel;
18
- damagePresentationDecision(): PiTuiDamageDecision | null;
23
+ get terminalHost(): OwnedUiTerminalHost;
24
+ render(width: number): readonly string[];
25
+ handleInput(data: string): void;
26
+ invalidate(): void;
27
+ setFocused(focused: boolean): void;
28
+ inputCoordinationSurface(): PiTuiInputSurfaceKind;
29
+ setOverlaySurfaces(surfaces: readonly PiTuiPointerSurface[] | null): void;
30
+ noteImmediatePresentation(): void;
31
+ layoutPart(part: PinnedLayoutPart): PiTuiComponentPort;
32
+ activated(): void;
33
+ handleViewportInput(data: string): PiTuiInputListenerResult | undefined;
19
34
  start(): void;
20
35
  onView(listener: (view: OwnedUiSessionViewModel) => void): () => void;
21
36
  waitUntilStopped(): Promise<void>;
@@ -53,8 +68,21 @@ export declare class OwnedUiSessionShell {
53
68
  /** The bare-A1 unified Models dialog: switch on Enter, scope on Space, persist on Ctrl+S, all through the engine. */
54
69
  showModelsDialog(initialQuery?: string): void;
55
70
  dispose(): Promise<void>;
71
+ release(terminal: {
72
+ readonly mode: "regular" | "fullscreen";
73
+ readonly columns: number;
74
+ }): OwnedUiPresenterRelease;
56
75
  hotkeysPresentation(): PiShellHotkeysPresentation;
57
76
  }
77
+ /**
78
+ * One session on a terminal of its own: a terminal host with this presenter attached. Disposing it ends the
79
+ * terminal, as quitting the single-session product does.
80
+ */
81
+ export declare class OwnedUiSessionShell extends OwnedUiSessionPresenter {
82
+ constructor(options: OwnedUiSessionShellOptions);
83
+ get runtime(): PiTuiRuntimeAdapter;
84
+ damagePresentationDecision(): PiTuiDamageDecision | null;
85
+ }
58
86
  export interface SessionResumeCommandMetadata {
59
87
  readonly sessionId: string;
60
88
  readonly sessionDir: string;