@timurproko/a1 0.2.6-dev.727 → 0.2.6-dev.736

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 (116) hide show
  1. package/dist/app/session-shell/clipboard-services.d.ts +19 -0
  2. package/dist/app/session-shell/clipboard-services.js +7 -0
  3. package/dist/app/session-shell/exit-notice.d.ts +9 -5
  4. package/dist/app/session-shell/exit-notice.js +5 -5
  5. package/dist/app/session-shell/index.d.ts +4 -2
  6. package/dist/app/session-shell/index.js +2 -1
  7. package/dist/app/session-shell/paste-preparation-client.d.ts +3 -0
  8. package/dist/app/session-shell/paste-preparation-client.js +5 -2
  9. package/dist/app/session-shell/path-chip-presentation.d.ts +10 -3
  10. package/dist/app/session-shell/path-chip-presentation.js +48 -6
  11. package/dist/app/session-shell/prompt-chips.js +30 -4
  12. package/dist/app/session-shell/quit-outro.d.ts +3 -1
  13. package/dist/app/session-shell/quit-outro.js +23 -8
  14. package/dist/app/session-shell/response-copy-transport.d.ts +6 -1
  15. package/dist/app/session-shell/response-copy-transport.js +8 -2
  16. package/dist/app/session-shell/session-shell-root.d.ts +29 -11
  17. package/dist/app/session-shell/session-shell-root.js +62 -53
  18. package/dist/app/session-shell/session-shell.d.ts +55 -29
  19. package/dist/app/session-shell/session-shell.js +748 -1132
  20. package/dist/app/session-shell/shell-host.d.ts +105 -0
  21. package/dist/app/session-shell/shell-host.js +523 -0
  22. package/dist/cli/session-context.js +6 -3
  23. package/dist/composition/owned-ui.d.ts +20 -2
  24. package/dist/composition/owned-ui.js +107 -56
  25. package/dist/composition/session-info-reference.d.ts +2 -2
  26. package/dist/composition/session-info-reference.js +2 -2
  27. package/dist/contracts/agent-engine/capability-ports.d.ts +1 -85
  28. package/dist/contracts/agent-engine/capability-ports.js +1 -35
  29. package/dist/contracts/agent-engine/index.d.ts +1 -7
  30. package/dist/contracts/agent-engine/index.js +0 -4
  31. package/dist/contracts/owned-ui/index.d.ts +5 -1
  32. package/dist/contracts/owned-ui/index.js +1 -0
  33. package/dist/contracts/owned-ui/model.d.ts +6 -0
  34. package/dist/contracts/owned-ui/session-backend.d.ts +119 -0
  35. package/dist/contracts/owned-ui/session-presenters.d.ts +82 -0
  36. package/dist/contracts/owned-ui/session-presenters.js +1 -0
  37. package/dist/contracts/owned-ui/session-workflows.d.ts +342 -0
  38. package/dist/contracts/owned-ui/session-workflows.js +30 -0
  39. package/dist/features/launch/index.d.ts +1 -1
  40. package/dist/features/launch/index.js +1 -1
  41. package/dist/features/launch/session-context.d.ts +1 -0
  42. package/dist/features/launch/session-context.js +1 -0
  43. package/dist/features/owned-ui/settings-app.js +35 -15
  44. package/dist/foundation/lifecycle/index.d.ts +1 -1
  45. package/dist/foundation/lifecycle/index.js +1 -1
  46. package/dist/foundation/lifecycle/session-repository-context.d.ts +8 -2
  47. package/dist/foundation/lifecycle/session-repository-context.js +200 -65
  48. package/dist/foundation/release/bootstrap.js +1 -2
  49. package/dist/foundation/release/release-gc.js +1 -1
  50. package/dist/foundation/release/update.js +0 -4
  51. package/dist/foundation/storage/control-store.js +0 -12
  52. package/dist/integrations/pi/components/components.js +0 -16
  53. package/dist/integrations/pi/components/index.d.ts +3 -3
  54. package/dist/integrations/pi/components/index.js +2 -2
  55. package/dist/integrations/pi/components/models-dialog.js +1 -30
  56. package/dist/integrations/pi/components/shell-editor-autocomplete.js +11 -9
  57. package/dist/integrations/pi/components/shell-extension-ui.d.ts +3 -3
  58. package/dist/integrations/pi/components/shell-extension-ui.js +6 -2
  59. package/dist/integrations/pi/components/shell-presenters-transcript.js +4 -4
  60. package/dist/integrations/pi/components/shell-shared-facade.d.ts +21 -1
  61. package/dist/integrations/pi/components/shell-shared-facade.js +18 -2
  62. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +5 -1
  63. package/dist/integrations/pi/components/upstream/theme/theme.js +20 -2
  64. package/dist/integrations/pi/engine/adapter.d.ts +44 -24
  65. package/dist/integrations/pi/engine/adapter.js +130 -22
  66. package/dist/integrations/pi/engine/command-dispatch.d.ts +2 -5
  67. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -11
  68. package/dist/integrations/pi/engine/host-ports.d.ts +20 -0
  69. package/dist/integrations/pi/engine/host-ports.js +13 -0
  70. package/dist/integrations/pi/engine/host.d.ts +70 -0
  71. package/dist/integrations/pi/engine/host.js +147 -0
  72. package/dist/integrations/pi/engine/index.d.ts +8 -4
  73. package/dist/integrations/pi/engine/index.js +3 -1
  74. package/dist/integrations/pi/engine/resource-catalog.d.ts +4 -23
  75. package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -2
  76. package/dist/integrations/pi/engine/runtime-integration.js +12 -7
  77. package/dist/integrations/pi/engine/session-integration.d.ts +3 -8
  78. package/dist/integrations/pi/engine/session-integration.js +0 -49
  79. package/dist/integrations/pi/engine/session-runtime.d.ts +18 -3
  80. package/dist/integrations/pi/engine/session-runtime.js +18 -7
  81. package/dist/integrations/pi/engine/settings-bridge.d.ts +2 -2
  82. package/dist/integrations/pi/engine/settings-bridge.js +0 -2
  83. package/dist/integrations/pi/engine/settings-port.d.ts +2 -0
  84. package/dist/integrations/pi/engine/settings-port.js +3 -5
  85. package/dist/integrations/pi/engine/workflows.d.ts +33 -260
  86. package/dist/integrations/pi/engine/workflows.js +6 -28
  87. package/dist/integrations/pi/session-presenters/index.d.ts +2 -0
  88. package/dist/integrations/pi/session-presenters/index.js +1 -0
  89. package/dist/integrations/pi/session-presenters/presenters.d.ts +16 -0
  90. package/dist/integrations/pi/session-presenters/presenters.js +341 -0
  91. package/dist/integrations/pi/tui-runtime/adapter.js +0 -2
  92. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +18 -0
  93. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +84 -3
  94. package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
  95. package/dist/integrations/pi/tui-runtime/index.js +1 -1
  96. package/dist/native/darwin-arm64/manifest.json +1 -1
  97. package/dist/native/linux-x64/manifest.json +1 -1
  98. package/dist/native/win32-x64/manifest.json +2 -2
  99. package/dist/native/win32-x64/process-guardian.exe +0 -0
  100. package/dist/ui/settings/declarations.d.ts +13 -1
  101. package/dist/ui/settings/declarations.js +12 -1
  102. package/dist/ui/settings/migrations.js +7 -0
  103. package/docs/architecture/boundaries.md +9 -1
  104. package/docs/architecture/project-structure.md +3 -2
  105. package/docs/architecture/ui-reference-provenance.md +1 -1
  106. package/package.json +1 -1
  107. package/dist/contracts/agent-engine/model.d.ts +0 -78
  108. package/dist/contracts/agent-engine/model.js +0 -1
  109. package/dist/contracts/agent-engine/ports.d.ts +0 -18
  110. package/dist/contracts/agent-engine/serialization.d.ts +0 -7
  111. package/dist/contracts/agent-engine/serialization.js +0 -58
  112. package/dist/contracts/agent-engine/validation.d.ts +0 -5
  113. package/dist/contracts/agent-engine/validation.js +0 -128
  114. package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +0 -61
  115. package/dist/integrations/pi/components/upstream/theme/system-theme.js +0 -709
  116. /package/dist/contracts/{agent-engine/ports.js → owned-ui/session-backend.js} +0 -0
@@ -5,11 +5,9 @@ import { composeSubmittedPromptRows, formatSubmittedPromptTime, submittedPromptL
5
5
  import { backgroundSgrSpan, heldNativeHyperlinkStyle, hyperlinkSgrSpan, nativeHyperlinkStyle, overlaySpan, } from "../../ui/components/spans.js";
6
6
  import { progressStatusFrame, progressStatusText } from "../../ui/components/progress-status.js";
7
7
  import { displayWidth, faint, stripAnsi } from "../../ui/components/text.js";
8
- import { PINNED_PI_HIDDEN_COMMAND_NAMES, PINNED_PI_WORKFLOW_COMMAND_NAMES } from "../../integrations/pi/engine/workflows.js";
9
- import { createPiExtensionUiBridge } from "../../integrations/pi/components/shell-extension-ui.js";
10
8
  import { createPiShellEditor } from "../../integrations/pi/components/shell-editor-autocomplete.js";
11
9
  import { createPiQueuedInputStatus, createPiShellFooter, createPiShellHeader, createPiShellLoadedResources, createPiShellStatus, } from "../../integrations/pi/components/shell-footer-status.js";
12
- import { createPiShellArmin, createPiShellAuthProviderSelector, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellExtensionSelector, createPiShellLoginDialog, createPiShellModelSelector, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, } from "../../integrations/pi/components/shell-selectors-dialogs.js";
10
+ import { createPiShellArmin, createPiShellEarendilAnnouncement, } from "../../integrations/pi/components/shell-selectors-dialogs.js";
13
11
  import { createPiShellChangelog, createPiShellCollapsedChangelog, createPiShellHotkeys, createPiShellSessionInfo, renderPiShellCommandMessage, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateBanner, renderPiShellReleaseUpdateNotice, renderPiShellStatusText, } from "../../integrations/pi/components/shell-presenters-info.js";
14
12
  import { createPiShellTranscriptComponent, isPiPromptStyleCompaction, paintPiSubmittedPromptTimestamp, renderPiShellStartupDiagnostic, renderPiShellTranscriptBlock, } from "../../integrations/pi/components/shell-presenters-transcript.js";
15
13
  import { onPiThemeChange, PINNED_PI_LAYOUT, piTheme } from "../../integrations/pi/components/upstream/theme/theme.js";
@@ -88,6 +86,7 @@ export class OwnedUiSessionShellRoot {
88
86
  constructor(view, cwd, handlers, startup = {}, agentDir, extensionRenderers = {
89
87
  getMessageRenderer: () => undefined,
90
88
  getToolRenderers: () => undefined,
89
+ getShortcuts: () => [],
91
90
  }, sessionLayout = "pinned", imageAssets) {
92
91
  this.#view = view;
93
92
  this.#customViewport = sessionLayout === "custom-viewport";
@@ -124,6 +123,7 @@ export class OwnedUiSessionShellRoot {
124
123
  this.editor = createPiShellEditor({
125
124
  ...handlers,
126
125
  keybindingProfile: this.#customViewport ? "a1" : "pi",
126
+ ...(handlers.keybindings === undefined ? {} : { keybindings: handlers.keybindings }),
127
127
  paintEditorSelection: (line, from, to, atomic) => backgroundSgrSpan(line, from, to, atomic ? "\u001b[7m" : "\u001b[27m\u001b[48;2;38;79;120m", atomic ? "\u001b[27m" : "\u001b[49m", piShellVisibleWidth),
128
128
  transformPastedContent: content => {
129
129
  try {
@@ -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) {
@@ -1071,7 +1033,7 @@ export class OwnedUiSessionShellRoot {
1071
1033
  hotkeysPresentation() {
1072
1034
  return {
1073
1035
  bindings: this.editor.keybindingConfig(),
1074
- getShortcuts: bindings => this.#extensionRenderers.getShortcuts?.(bindings) ?? [],
1036
+ getShortcuts: bindings => this.#extensionRenderers.getShortcuts(bindings),
1075
1037
  profile: this.#customViewport ? "a1" : "pi",
1076
1038
  };
1077
1039
  }
@@ -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,
@@ -1381,7 +1390,7 @@ function layoutPort(render, invalidate, handleInput) {
1381
1390
  };
1382
1391
  }
1383
1392
  export function shellResourceEntries(backend) {
1384
- const resources = backend.nonVisualResources().map(resource => ({
1393
+ const resources = backend.extensions.nonVisualResources().map(resource => ({
1385
1394
  section: resource.kind === "skill"
1386
1395
  ? "Skills"
1387
1396
  : resource.kind === "prompt-template"
@@ -1397,7 +1406,7 @@ export function shellResourceEntries(backend) {
1397
1406
  sourcePath: resource.sourcePath,
1398
1407
  diagnostic: resource.diagnostic,
1399
1408
  }));
1400
- const extensions = backend.extensionResources().filter(extension => !extension.hidden);
1409
+ const extensions = backend.extensions.extensionResources().filter(extension => !extension.hidden);
1401
1410
  const loadedExtensions = extensions.filter(extension => extension.diagnostic === null);
1402
1411
  const extensionLabels = compactExtensionLabels(loadedExtensions);
1403
1412
  for (const extension of extensions) {
@@ -1,39 +1,52 @@
1
- import type { OwnedUiSessionViewModel, OwnedUiThinkingLevel } from "../../contracts/owned-ui/index.js";
2
- import type { AdapterCommandResult } from "../../integrations/pi/engine/adapter.js";
3
- import type { PiWorkflowRequest } from "../../integrations/pi/engine/workflows.js";
1
+ import type { OwnedUiCommandResult, OwnedUiSessionBackend, OwnedUiSessionViewModel, OwnedUiThinkingLevel, OwnedUiWorkflowRequest } from "../../contracts/owned-ui/index.js";
4
2
  import { type PiShellSkillSummary } from "../../integrations/pi/components/skills-command.js";
5
3
  import { type PiShellHotkeysPresentation } from "../../integrations/pi/components/shell-presenters-info.js";
6
4
  import type { PiShellSelectorOption } from "../../integrations/pi/components/shell-shared-facade.js";
7
- import { type PiTuiDamageDecision } from "../../integrations/pi/tui-runtime/damage-aware-terminal.js";
8
- import { PiTuiRuntimeAdapter } from "../../integrations/pi/tui-runtime/adapter.js";
9
- import type { PiTuiOverlayHandle } from "../../integrations/pi/tui-runtime/contracts.js";
10
- import { OwnedUiSessionShellRoot, type OwnedUiBackendPort, type OwnedUiSessionShellOptions } from "./session-shell-root.js";
11
- export { OwnedUiSessionShellRoot, type OwnedUiSessionShellOptions, type OwnedUiShellDiagnosticOptions, type OwnedUiShellEngineOptions, type OwnedUiShellHistoryOptions, type OwnedUiShellPresentationOptions, type OwnedUiShellPromptImagesOptions, type OwnedUiShellSkillsOptions, type OwnedUiShellSuggestionOptions, } from "./session-shell-root.js";
12
- /** Coordinates backend, owned presentation, and Pi TUI lifecycles for one interactive session. */
13
- export declare class OwnedUiSessionShell {
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";
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";
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 {
14
18
  #private;
15
- readonly backend: OwnedUiBackendPort;
19
+ readonly backend: OwnedUiSessionBackend;
16
20
  readonly root: OwnedUiSessionShellRoot;
17
- readonly runtime: PiTuiRuntimeAdapter;
18
- constructor(options: OwnedUiSessionShellOptions);
21
+ constructor(host: OwnedUiTerminalHost, options: OwnedUiSessionShellOptions);
19
22
  view(): OwnedUiSessionViewModel;
20
- 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;
21
34
  start(): void;
22
35
  onView(listener: (view: OwnedUiSessionViewModel) => void): () => void;
23
36
  waitUntilStopped(): Promise<void>;
24
- submit(text: string): Promise<AdapterCommandResult>;
25
- clearOrExit(now?: number): Promise<AdapterCommandResult>;
26
- interrupt(now?: number): Promise<AdapterCommandResult>;
27
- abort(): Promise<AdapterCommandResult>;
28
- retry(): Promise<AdapterCommandResult>;
29
- compact(): Promise<AdapterCommandResult>;
30
- newSession(): Promise<AdapterCommandResult>;
31
- resumeSession(sessionPath: string): Promise<AdapterCommandResult>;
32
- setModel(providerId: string, modelId: string): Promise<AdapterCommandResult>;
33
- setThinkingLevel(thinkingLevel: OwnedUiThinkingLevel): Promise<AdapterCommandResult>;
34
- cycleThinkingLevel(): Promise<AdapterCommandResult>;
35
- cycleModel(direction: "forward" | "backward"): Promise<AdapterCommandResult>;
36
- queueFollowUp(): Promise<AdapterCommandResult>;
37
+ submit(text: string): Promise<OwnedUiCommandResult>;
38
+ clearOrExit(now?: number): Promise<OwnedUiCommandResult>;
39
+ interrupt(now?: number): Promise<OwnedUiCommandResult>;
40
+ abort(): Promise<OwnedUiCommandResult>;
41
+ retry(): Promise<OwnedUiCommandResult>;
42
+ compact(): Promise<OwnedUiCommandResult>;
43
+ newSession(): Promise<OwnedUiCommandResult>;
44
+ resumeSession(sessionPath: string): Promise<OwnedUiCommandResult>;
45
+ setModel(providerId: string, modelId: string): Promise<OwnedUiCommandResult>;
46
+ setThinkingLevel(thinkingLevel: OwnedUiThinkingLevel): Promise<OwnedUiCommandResult>;
47
+ cycleThinkingLevel(): Promise<OwnedUiCommandResult>;
48
+ cycleModel(direction: "forward" | "backward"): Promise<OwnedUiCommandResult>;
49
+ queueFollowUp(): Promise<OwnedUiCommandResult>;
37
50
  restoreQueuedInput(): void;
38
51
  showSelector(title: string, options: readonly PiShellSelectorOption[], onSelect: (id: string) => void, onCancel?: () => void): PiTuiOverlayHandle;
39
52
  showThinkingSelector(): Promise<void>;
@@ -48,15 +61,28 @@ export declare class OwnedUiSessionShell {
48
61
  showLoginProviderSelector(authType?: "oauth" | "api_key", initialSearchInput?: string): void;
49
62
  showSessionSelector(): Promise<void>;
50
63
  showSettingsSelector(): void;
51
- shutdown(): Promise<AdapterCommandResult>;
52
- runWorkflow(request: PiWorkflowRequest): Promise<AdapterCommandResult>;
64
+ shutdown(): Promise<OwnedUiCommandResult>;
65
+ runWorkflow(request: OwnedUiWorkflowRequest): Promise<OwnedUiCommandResult>;
53
66
  showTrustSelector(): void;
54
67
  showScopedModelsSelector(): void;
55
68
  /** The bare-A1 unified Models dialog: switch on Enter, scope on Space, persist on Ctrl+S, all through the engine. */
56
69
  showModelsDialog(initialQuery?: string): void;
57
70
  dispose(): Promise<void>;
71
+ release(terminal: {
72
+ readonly mode: "regular" | "fullscreen";
73
+ readonly columns: number;
74
+ }): OwnedUiPresenterRelease;
58
75
  hotkeysPresentation(): PiShellHotkeysPresentation;
59
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
+ }
60
86
  export interface SessionResumeCommandMetadata {
61
87
  readonly sessionId: string;
62
88
  readonly sessionDir: string;