@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.
Files changed (213) hide show
  1. package/bin/cli.js +13 -2
  2. package/bin/ui.js +13 -0
  3. package/dist/app/session-shell/clipboard-services.d.ts +19 -0
  4. package/dist/app/session-shell/clipboard-services.js +7 -0
  5. package/dist/app/session-shell/exit-notice.d.ts +9 -5
  6. package/dist/app/session-shell/exit-notice.js +5 -5
  7. package/dist/app/session-shell/index.d.ts +3 -1
  8. package/dist/app/session-shell/index.js +1 -0
  9. package/dist/app/session-shell/paste-preparation-client.d.ts +3 -0
  10. package/dist/app/session-shell/paste-preparation-client.js +5 -2
  11. package/dist/app/session-shell/path-chip-presentation.d.ts +10 -3
  12. package/dist/app/session-shell/path-chip-presentation.js +48 -6
  13. package/dist/app/session-shell/prompt-chips.js +30 -4
  14. package/dist/app/session-shell/prompt-suggestion-controller.d.ts +5 -4
  15. package/dist/app/session-shell/prompt-suggestion-controller.js +148 -58
  16. package/dist/app/session-shell/quit-outro.d.ts +3 -1
  17. package/dist/app/session-shell/quit-outro.js +23 -8
  18. package/dist/app/session-shell/response-copy-transport.d.ts +6 -1
  19. package/dist/app/session-shell/response-copy-transport.js +8 -2
  20. package/dist/app/session-shell/session-shell-root.d.ts +22 -11
  21. package/dist/app/session-shell/session-shell-root.js +19 -12
  22. package/dist/app/session-shell/session-shell.d.ts +19 -21
  23. package/dist/app/session-shell/session-shell.js +678 -840
  24. package/dist/app/session-shell/session-viewport-controller.js +33 -21
  25. package/dist/cli/dispatch.js +5 -3
  26. package/dist/cli/session-context.d.ts +5 -1
  27. package/dist/cli/session-context.js +25 -8
  28. package/dist/composition/owned-ui.d.ts +23 -2
  29. package/dist/composition/owned-ui.js +124 -33
  30. package/dist/composition/session-info-reference.d.ts +2 -2
  31. package/dist/composition/session-info-reference.js +2 -2
  32. package/dist/composition/settings-route-host.js +2 -1
  33. package/dist/contracts/agent-engine/capability-ports.d.ts +1 -85
  34. package/dist/contracts/agent-engine/capability-ports.js +1 -35
  35. package/dist/contracts/agent-engine/index.d.ts +1 -7
  36. package/dist/contracts/agent-engine/index.js +0 -4
  37. package/dist/contracts/owned-ui/index.d.ts +9 -3
  38. package/dist/contracts/owned-ui/index.js +2 -1
  39. package/dist/contracts/owned-ui/model.d.ts +10 -0
  40. package/dist/contracts/owned-ui/session-backend.d.ts +119 -0
  41. package/dist/contracts/owned-ui/session-presenters.d.ts +55 -0
  42. package/dist/contracts/owned-ui/session-presenters.js +1 -0
  43. package/dist/contracts/owned-ui/session-workflows.d.ts +342 -0
  44. package/dist/contracts/owned-ui/session-workflows.js +30 -0
  45. package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +5 -1
  46. package/dist/contracts/owned-ui/suggestion-diagnostics.js +3 -1
  47. package/dist/contracts/owned-ui/validation.js +7 -0
  48. package/dist/features/launch/index.d.ts +1 -1
  49. package/dist/features/launch/session-context.d.ts +17 -2
  50. package/dist/features/launch/session-context.js +9 -5
  51. package/dist/features/owned-ui/settings-app.js +56 -54
  52. package/dist/features/prompt-suggestions/diagnostics.js +4 -1
  53. package/dist/foundation/lifecycle/index.d.ts +2 -2
  54. package/dist/foundation/lifecycle/index.js +1 -1
  55. package/dist/foundation/lifecycle/session-repository-context.d.ts +19 -2
  56. package/dist/foundation/lifecycle/session-repository-context.js +434 -66
  57. package/dist/foundation/process-containment/index.d.ts +1 -0
  58. package/dist/foundation/process-containment/index.js +1 -0
  59. package/dist/foundation/process-containment/native-process-inspector.d.ts +3 -0
  60. package/dist/foundation/process-containment/native-process-inspector.js +21 -0
  61. package/dist/foundation/release/bootstrap.js +1 -2
  62. package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
  63. package/dist/foundation/release/progress-palette.generated.js +2 -2
  64. package/dist/foundation/release/release-gc.js +1 -1
  65. package/dist/foundation/release/update.js +0 -4
  66. package/dist/foundation/startup/startup-descriptor.js +2 -2
  67. package/dist/foundation/storage/control-store.js +0 -12
  68. package/dist/integrations/pi/components/components.js +2 -18
  69. package/dist/integrations/pi/components/index.d.ts +4 -4
  70. package/dist/integrations/pi/components/index.js +2 -2
  71. package/dist/integrations/pi/components/modal-frame.js +3 -4
  72. package/dist/integrations/pi/components/models-dialog.js +6 -35
  73. package/dist/integrations/pi/components/prompt-input-port.d.ts +1 -0
  74. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
  75. package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
  76. package/dist/integrations/pi/components/share-operation-dialog.js +3 -3
  77. package/dist/integrations/pi/components/shell-editor-autocomplete.js +19 -16
  78. package/dist/integrations/pi/components/shell-extension-ui.d.ts +5 -3
  79. package/dist/integrations/pi/components/shell-extension-ui.js +26 -12
  80. package/dist/integrations/pi/components/shell-hotkey-sections.js +2 -2
  81. package/dist/integrations/pi/components/shell-presenters-info.js +10 -10
  82. package/dist/integrations/pi/components/shell-presenters-transcript.js +13 -13
  83. package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -6
  84. package/dist/integrations/pi/components/shell-shared-facade.d.ts +21 -1
  85. package/dist/integrations/pi/components/shell-shared-facade.js +19 -3
  86. package/dist/integrations/pi/components/skills-dialog.js +3 -3
  87. package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -3
  88. package/dist/integrations/pi/components/theme.d.ts +9 -0
  89. package/dist/integrations/pi/components/theme.js +30 -0
  90. package/dist/integrations/pi/components/tool-result-adapter.js +6 -1
  91. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  92. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  93. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  94. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  95. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  96. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  97. package/dist/integrations/pi/components/upstream/components/extension-editor.js +6 -6
  98. package/dist/integrations/pi/components/upstream/components/extension-input.js +4 -4
  99. package/dist/integrations/pi/components/upstream/components/extension-selector.js +4 -4
  100. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  101. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +5 -5
  102. package/dist/integrations/pi/components/upstream/components/owned-editor.js +8 -5
  103. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  104. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  105. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +3 -3
  106. package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
  107. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  108. package/dist/integrations/pi/components/upstream/components/session-selector.js +9 -9
  109. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +3 -2
  110. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +6 -3
  111. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  112. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  113. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  114. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  115. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  116. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +2 -2
  117. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +4 -0
  118. package/dist/integrations/pi/components/upstream/components/tool-execution.js +11 -1
  119. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +2 -2
  120. package/dist/integrations/pi/components/upstream/components/tree-selector.js +27 -18
  121. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  122. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  123. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +4 -4
  124. package/dist/integrations/pi/components/upstream/history/editor-core.js +11 -7
  125. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  126. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  127. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  128. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  129. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  130. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  131. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  132. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  133. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +31 -0
  134. package/dist/integrations/pi/components/upstream/program-status-reporter.js +89 -0
  135. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  136. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +22 -1
  137. package/dist/integrations/pi/components/upstream/theme/theme.js +225 -10
  138. package/dist/integrations/pi/engine/adapter.d.ts +44 -24
  139. package/dist/integrations/pi/engine/adapter.js +130 -22
  140. package/dist/integrations/pi/engine/command-dispatch.d.ts +2 -5
  141. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -11
  142. package/dist/integrations/pi/engine/host-ports.d.ts +20 -0
  143. package/dist/integrations/pi/engine/host-ports.js +13 -0
  144. package/dist/integrations/pi/engine/host.d.ts +70 -0
  145. package/dist/integrations/pi/engine/host.js +147 -0
  146. package/dist/integrations/pi/engine/index.d.ts +8 -4
  147. package/dist/integrations/pi/engine/index.js +3 -1
  148. package/dist/integrations/pi/engine/pi-settings-metadata.json +1 -1
  149. package/dist/integrations/pi/engine/resource-catalog.d.ts +4 -23
  150. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  151. package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -2
  152. package/dist/integrations/pi/engine/runtime-integration.js +12 -7
  153. package/dist/integrations/pi/engine/session-events.js +10 -2
  154. package/dist/integrations/pi/engine/session-integration.d.ts +3 -8
  155. package/dist/integrations/pi/engine/session-integration.js +0 -49
  156. package/dist/integrations/pi/engine/session-runtime.d.ts +18 -3
  157. package/dist/integrations/pi/engine/session-runtime.js +18 -7
  158. package/dist/integrations/pi/engine/settings-bridge.d.ts +2 -2
  159. package/dist/integrations/pi/engine/settings-bridge.js +0 -2
  160. package/dist/integrations/pi/engine/settings-port.d.ts +2 -0
  161. package/dist/integrations/pi/engine/settings-port.js +3 -5
  162. package/dist/integrations/pi/engine/transcript-projection.js +2 -1
  163. package/dist/integrations/pi/engine/workflows.d.ts +33 -260
  164. package/dist/integrations/pi/engine/workflows.js +6 -28
  165. package/dist/integrations/pi/session-presenters/index.d.ts +2 -0
  166. package/dist/integrations/pi/session-presenters/index.js +1 -0
  167. package/dist/integrations/pi/session-presenters/presenters.d.ts +16 -0
  168. package/dist/integrations/pi/session-presenters/presenters.js +341 -0
  169. package/dist/integrations/pi/startup-public.js +306 -290
  170. package/dist/integrations/pi/startup-public.manifest.json +289 -265
  171. package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -1
  172. package/dist/integrations/pi/tui-runtime/adapter.js +7 -2
  173. package/dist/integrations/pi/tui-runtime/contracts.d.ts +3 -1
  174. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +8 -1
  175. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +67 -2
  176. package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
  177. package/dist/integrations/pi/tui-runtime/index.js +1 -1
  178. package/dist/native/darwin-arm64/manifest.json +1 -1
  179. package/dist/native/linux-x64/manifest.json +1 -1
  180. package/dist/native/win32-x64/manifest.json +2 -2
  181. package/dist/native/win32-x64/process-guardian.exe +0 -0
  182. package/dist/product-identity.d.ts +2 -2
  183. package/dist/product-identity.js +2 -2
  184. package/dist/product-identity.json +3 -1
  185. package/dist/runtime-payload-inventory.json +3092 -2878
  186. package/dist/ui/components/prompt-input.d.ts +2 -0
  187. package/dist/ui/components/prompt-input.js +5 -1
  188. package/dist/ui/components/text-selection.d.ts +1 -1
  189. package/dist/ui/components/text-selection.js +3 -1
  190. package/dist/ui/components/theme.d.ts +2 -0
  191. package/dist/ui/components/transcript-viewport.d.ts +6 -4
  192. package/dist/ui/components/transcript-viewport.js +94 -16
  193. package/dist/ui/components/value-menu.d.ts +2 -0
  194. package/dist/ui/components/value-menu.js +13 -8
  195. package/dist/ui/settings/declarations.d.ts +38 -14
  196. package/dist/ui/settings/declarations.js +35 -11
  197. package/dist/ui/settings/migrations.js +23 -0
  198. package/docs/architecture/boundaries.md +9 -1
  199. package/docs/architecture/project-structure.md +7 -5
  200. package/docs/architecture/prompt-suggestions.md +14 -10
  201. package/docs/local-worktree-cleanup.md +11 -5
  202. package/docs/openspec-archive-automation.md +6 -5
  203. package/package.json +3 -3
  204. package/dist/contracts/agent-engine/model.d.ts +0 -78
  205. package/dist/contracts/agent-engine/model.js +0 -1
  206. package/dist/contracts/agent-engine/ports.d.ts +0 -18
  207. package/dist/contracts/agent-engine/serialization.d.ts +0 -7
  208. package/dist/contracts/agent-engine/serialization.js +0 -58
  209. package/dist/contracts/agent-engine/validation.d.ts +0 -5
  210. package/dist/contracts/agent-engine/validation.js +0 -128
  211. package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +0 -61
  212. package/dist/integrations/pi/components/upstream/theme/system-theme.js +0 -709
  213. /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";
@@ -48,6 +46,7 @@ export class OwnedUiSessionShellRoot {
48
46
  #viewportTheme;
49
47
  #onViewportFrame;
50
48
  #onInputSurfaceChanged;
49
+ #onPromptSuggestionEligibilityChanged;
51
50
  #componentRuntime;
52
51
  #toolsExpanded = false;
53
52
  #thinkingVisible = true;
@@ -87,6 +86,7 @@ export class OwnedUiSessionShellRoot {
87
86
  constructor(view, cwd, handlers, startup = {}, agentDir, extensionRenderers = {
88
87
  getMessageRenderer: () => undefined,
89
88
  getToolRenderers: () => undefined,
89
+ getShortcuts: () => [],
90
90
  }, sessionLayout = "pinned", imageAssets) {
91
91
  this.#view = view;
92
92
  this.#customViewport = sessionLayout === "custom-viewport";
@@ -107,6 +107,7 @@ export class OwnedUiSessionShellRoot {
107
107
  this.#componentRuntime = handlers;
108
108
  this.#onViewportFrame = handlers.onViewportFrame;
109
109
  this.#onInputSurfaceChanged = handlers.onInputSurfaceChanged;
110
+ this.#onPromptSuggestionEligibilityChanged = handlers.onPromptSuggestionEligibilityChanged;
110
111
  this.#dockInputReuseEnabled = handlers.enableDockInputReuse ?? true;
111
112
  this.header = createPiShellHeader({
112
113
  ...startup,
@@ -122,6 +123,7 @@ export class OwnedUiSessionShellRoot {
122
123
  this.editor = createPiShellEditor({
123
124
  ...handlers,
124
125
  keybindingProfile: this.#customViewport ? "a1" : "pi",
126
+ ...(handlers.keybindings === undefined ? {} : { keybindings: handlers.keybindings }),
125
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),
126
128
  transformPastedContent: content => {
127
129
  try {
@@ -223,8 +225,8 @@ export class OwnedUiSessionShellRoot {
223
225
  // Invariant: colours come from the active theme, so rendered rows outlive their revision only
224
226
  // until the theme under them changes.
225
227
  this.#themeUnsubscribe = onPiThemeChange(() => {
226
- this.#renderedRows.clear();
227
- this.#documentLayouts.clear();
228
+ this.invalidate();
229
+ this.#componentRuntime.requestRender(true);
228
230
  });
229
231
  }
230
232
  setEditorPaddingX(padding) {
@@ -327,6 +329,7 @@ export class OwnedUiSessionShellRoot {
327
329
  this.editor.setPromptSuggestion(text);
328
330
  }
329
331
  update(view) {
332
+ const becameReady = this.#view.lifecycle !== "ready" && view.lifecycle === "ready";
330
333
  if (view.diagnostics.length !== this.#view.diagnostics.length
331
334
  || view.diagnostics.some((diagnostic, index) => diagnostic.sequence !== this.#view.diagnostics[index]?.sequence)) {
332
335
  this.#documentLayouts.clear();
@@ -349,6 +352,8 @@ export class OwnedUiSessionShellRoot {
349
352
  this.editor.setThinkingLevel(view.thinkingLevel);
350
353
  // Performance: semantic updates already invalidate affected transcript blocks. Chrome is a separate authority.
351
354
  this.#invalidateChrome();
355
+ if (becameReady)
356
+ this.#onPromptSuggestionEligibilityChanged?.();
352
357
  }
353
358
  /**
354
359
  * Applies one block: its component is created or updated in place and the order grows
@@ -458,13 +463,13 @@ export class OwnedUiSessionShellRoot {
458
463
  if (frame === null) {
459
464
  frame = this.#viewportController.compose({
460
465
  // Performance: do not copy the complete document on unchanged dock-only input.
461
- // Steering and Working retain their one non-selectable viewport-tail ownership.
466
+ // Steering and Working retain their one non-persistent viewport-tail ownership.
462
467
  documentRows: [...document.rows, ...steeringRows, ...statusRows],
463
468
  ...(this.#viewportController.transcriptPointerSelecting
464
469
  ? { paintDocumentRow: heldNativeHyperlinkStyle }
465
470
  : {}),
466
- // Invariant: selection and copying stop at the real document tail; Steering,
467
- // fitting alignment, and live Working remain transient presentation chrome.
471
+ // Invariant: this boundary tracks persistent transcript rows for streaming and
472
+ // geometry; transient Steering and Working rows remain complete-frame selectable.
468
473
  selectableDocumentRowCount,
469
474
  ...(document.liveTailStartRow === undefined ? {} : { liveTailStartRow: document.liveTailStartRow }),
470
475
  bottomAlignedTailRowCount: steeringRows.length + statusRows.length,
@@ -527,7 +532,7 @@ export class OwnedUiSessionShellRoot {
527
532
  cause: frame?.descriptor.cause ?? null,
528
533
  };
529
534
  }
530
- /** Visible non-selectable Steering, alignment, and Working rows, for rendering evidence. */
535
+ /** Visible non-persistent Steering, alignment, and Working rows, for rendering evidence. */
531
536
  viewportTransientTailRowCount() {
532
537
  return this.#viewportController.frame?.hits.transientTail.length ?? 0;
533
538
  }
@@ -1066,7 +1071,7 @@ export class OwnedUiSessionShellRoot {
1066
1071
  hotkeysPresentation() {
1067
1072
  return {
1068
1073
  bindings: this.editor.keybindingConfig(),
1069
- getShortcuts: bindings => this.#extensionRenderers.getShortcuts?.(bindings) ?? [],
1074
+ getShortcuts: bindings => this.#extensionRenderers.getShortcuts(bindings),
1070
1075
  profile: this.#customViewport ? "a1" : "pi",
1071
1076
  };
1072
1077
  }
@@ -1179,6 +1184,8 @@ export class OwnedUiSessionShellRoot {
1179
1184
  }
1180
1185
  setFocused(focused) {
1181
1186
  this.#inputSurface.setFocused?.(focused);
1187
+ if (focused)
1188
+ this.#onPromptSuggestionEligibilityChanged?.();
1182
1189
  }
1183
1190
  dispose() {
1184
1191
  this.#clearCopyAcknowledgement(false);
@@ -1374,7 +1381,7 @@ function layoutPort(render, invalidate, handleInput) {
1374
1381
  };
1375
1382
  }
1376
1383
  export function shellResourceEntries(backend) {
1377
- const resources = backend.nonVisualResources().map(resource => ({
1384
+ const resources = backend.extensions.nonVisualResources().map(resource => ({
1378
1385
  section: resource.kind === "skill"
1379
1386
  ? "Skills"
1380
1387
  : resource.kind === "prompt-template"
@@ -1390,7 +1397,7 @@ export function shellResourceEntries(backend) {
1390
1397
  sourcePath: resource.sourcePath,
1391
1398
  diagnostic: resource.diagnostic,
1392
1399
  }));
1393
- const extensions = backend.extensionResources().filter(extension => !extension.hidden);
1400
+ const extensions = backend.extensions.extensionResources().filter(extension => !extension.hidden);
1394
1401
  const loadedExtensions = extensions.filter(extension => extension.diagnostic === null);
1395
1402
  const extensionLabels = compactExtensionLabels(loadedExtensions);
1396
1403
  for (const extension of extensions) {
@@ -1,18 +1,16 @@
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
5
  import { type PiTuiDamageDecision } from "../../integrations/pi/tui-runtime/damage-aware-terminal.js";
8
6
  import { PiTuiRuntimeAdapter } from "../../integrations/pi/tui-runtime/adapter.js";
9
7
  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";
8
+ import { OwnedUiSessionShellRoot, type OwnedUiSessionShellOptions } from "./session-shell-root.js";
9
+ 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
10
  /** Coordinates backend, owned presentation, and Pi TUI lifecycles for one interactive session. */
13
11
  export declare class OwnedUiSessionShell {
14
12
  #private;
15
- readonly backend: OwnedUiBackendPort;
13
+ readonly backend: OwnedUiSessionBackend;
16
14
  readonly root: OwnedUiSessionShellRoot;
17
15
  readonly runtime: PiTuiRuntimeAdapter;
18
16
  constructor(options: OwnedUiSessionShellOptions);
@@ -21,19 +19,19 @@ export declare class OwnedUiSessionShell {
21
19
  start(): void;
22
20
  onView(listener: (view: OwnedUiSessionViewModel) => void): () => void;
23
21
  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>;
22
+ submit(text: string): Promise<OwnedUiCommandResult>;
23
+ clearOrExit(now?: number): Promise<OwnedUiCommandResult>;
24
+ interrupt(now?: number): Promise<OwnedUiCommandResult>;
25
+ abort(): Promise<OwnedUiCommandResult>;
26
+ retry(): Promise<OwnedUiCommandResult>;
27
+ compact(): Promise<OwnedUiCommandResult>;
28
+ newSession(): Promise<OwnedUiCommandResult>;
29
+ resumeSession(sessionPath: string): Promise<OwnedUiCommandResult>;
30
+ setModel(providerId: string, modelId: string): Promise<OwnedUiCommandResult>;
31
+ setThinkingLevel(thinkingLevel: OwnedUiThinkingLevel): Promise<OwnedUiCommandResult>;
32
+ cycleThinkingLevel(): Promise<OwnedUiCommandResult>;
33
+ cycleModel(direction: "forward" | "backward"): Promise<OwnedUiCommandResult>;
34
+ queueFollowUp(): Promise<OwnedUiCommandResult>;
37
35
  restoreQueuedInput(): void;
38
36
  showSelector(title: string, options: readonly PiShellSelectorOption[], onSelect: (id: string) => void, onCancel?: () => void): PiTuiOverlayHandle;
39
37
  showThinkingSelector(): Promise<void>;
@@ -48,8 +46,8 @@ export declare class OwnedUiSessionShell {
48
46
  showLoginProviderSelector(authType?: "oauth" | "api_key", initialSearchInput?: string): void;
49
47
  showSessionSelector(): Promise<void>;
50
48
  showSettingsSelector(): void;
51
- shutdown(): Promise<AdapterCommandResult>;
52
- runWorkflow(request: PiWorkflowRequest): Promise<AdapterCommandResult>;
49
+ shutdown(): Promise<OwnedUiCommandResult>;
50
+ runWorkflow(request: OwnedUiWorkflowRequest): Promise<OwnedUiCommandResult>;
53
51
  showTrustSelector(): void;
54
52
  showScopedModelsSelector(): void;
55
53
  /** The bare-A1 unified Models dialog: switch on Enter, scope on Space, persist on Ctrl+S, all through the engine. */