@timurproko/a1 0.2.7-dev.1252 → 0.2.7-dev.1264

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 (296) hide show
  1. package/bin/ui.js +3 -3
  2. package/dist/app/session-shell/clipboard-diagnostics.d.ts +2 -2
  3. package/dist/app/session-shell/clipboard-image.d.ts +0 -1
  4. package/dist/app/session-shell/clipboard-image.js +1 -1
  5. package/dist/app/session-shell/dialog-coordinator.d.ts +6 -5
  6. package/dist/app/session-shell/dialog-coordinator.js +3 -4
  7. package/dist/app/session-shell/dock-chrome.d.ts +11 -6
  8. package/dist/app/session-shell/dock-chrome.js +5 -8
  9. package/dist/app/session-shell/editor-hyperlink-budget.d.ts +0 -2
  10. package/dist/app/session-shell/editor-hyperlink-budget.js +1 -1
  11. package/dist/app/session-shell/exit-notice.d.ts +2 -2
  12. package/dist/app/session-shell/exit-notice.js +1 -1
  13. package/dist/app/session-shell/extension-surface.d.ts +8 -7
  14. package/dist/app/session-shell/helper-pool.d.ts +3 -4
  15. package/dist/app/session-shell/helper-pool.js +1 -1
  16. package/dist/app/session-shell/image-preparation-client.d.ts +4 -3
  17. package/dist/app/session-shell/image-preparation.d.ts +0 -2
  18. package/dist/app/session-shell/image-preparation.js +2 -2
  19. package/dist/app/session-shell/image-source.d.ts +2 -3
  20. package/dist/app/session-shell/image-source.js +2 -2
  21. package/dist/app/session-shell/input-surface-switch.d.ts +9 -7
  22. package/dist/app/session-shell/input-surface-switch.js +1 -2
  23. package/dist/app/session-shell/login-interaction.d.ts +5 -4
  24. package/dist/app/session-shell/login-interaction.js +2 -3
  25. package/dist/app/session-shell/paste-executor.d.ts +4 -8
  26. package/dist/app/session-shell/paste-executor.js +2 -2
  27. package/dist/app/session-shell/paste-protocol.d.ts +2 -2
  28. package/dist/app/session-shell/path-chip-presentation.d.ts +0 -5
  29. package/dist/app/session-shell/path-chip-presentation.js +3 -3
  30. package/dist/app/session-shell/prompt-chips.d.ts +8 -7
  31. package/dist/app/session-shell/prompt-history-controller.d.ts +3 -3
  32. package/dist/app/session-shell/prompt-submission.d.ts +5 -2
  33. package/dist/app/session-shell/prompt-submission.js +13 -14
  34. package/dist/app/session-shell/quit-outro-effects.d.ts +3 -3
  35. package/dist/app/session-shell/quit-outro-effects.js +1 -4
  36. package/dist/app/session-shell/quit-outro.d.ts +9 -12
  37. package/dist/app/session-shell/quit-outro.js +11 -11
  38. package/dist/app/session-shell/resource-labels.d.ts +2 -0
  39. package/dist/app/session-shell/resource-labels.js +158 -0
  40. package/dist/app/session-shell/response-copy-protocol.d.ts +3 -2
  41. package/dist/app/session-shell/response-copy-transport.d.ts +2 -14
  42. package/dist/app/session-shell/response-copy-transport.js +1 -1
  43. package/dist/app/session-shell/session-lifecycle.d.ts +2 -1
  44. package/dist/app/session-shell/session-prompt-history.d.ts +29 -0
  45. package/dist/app/session-shell/session-prompt-history.js +80 -0
  46. package/dist/app/session-shell/session-selectors.d.ts +46 -0
  47. package/dist/app/session-shell/session-selectors.js +269 -0
  48. package/dist/app/session-shell/session-shell-root.d.ts +76 -113
  49. package/dist/app/session-shell/session-shell-root.js +103 -329
  50. package/dist/app/session-shell/session-shell.d.ts +14 -37
  51. package/dist/app/session-shell/session-shell.js +177 -612
  52. package/dist/app/session-shell/session-viewport-controller.d.ts +9 -16
  53. package/dist/app/session-shell/session-viewport-controller.js +42 -320
  54. package/dist/app/session-shell/settings-bindings.d.ts +25 -3
  55. package/dist/app/session-shell/settings-bindings.js +26 -2
  56. package/dist/app/session-shell/share-operation.d.ts +3 -3
  57. package/dist/app/session-shell/share-operation.js +4 -6
  58. package/dist/app/session-shell/shell-clipboard.d.ts +59 -0
  59. package/dist/app/session-shell/shell-clipboard.js +119 -0
  60. package/dist/app/session-shell/shell-editor-factory.d.ts +8 -4
  61. package/dist/app/session-shell/shell-editor-factory.js +13 -15
  62. package/dist/app/session-shell/shell-host.d.ts +16 -17
  63. package/dist/app/session-shell/shell-host.js +18 -19
  64. package/dist/app/session-shell/shell-layout.d.ts +2 -2
  65. package/dist/app/session-shell/shell-prompt-suggestions.d.ts +26 -0
  66. package/dist/app/session-shell/shell-prompt-suggestions.js +48 -0
  67. package/dist/app/session-shell/suggestion-surface.d.ts +1 -6
  68. package/dist/app/session-shell/suggestion-surface.js +1 -1
  69. package/dist/app/session-shell/system-clipboard.d.ts +2 -14
  70. package/dist/app/session-shell/system-clipboard.js +2 -7
  71. package/dist/app/session-shell/transcript-document.d.ts +11 -8
  72. package/dist/app/session-shell/transcript-document.js +13 -14
  73. package/dist/app/session-shell/viewport-layout.d.ts +2 -2
  74. package/dist/app/session-shell/viewport-pointer.d.ts +83 -0
  75. package/dist/app/session-shell/viewport-pointer.js +361 -0
  76. package/dist/app/session-shell/workflow-output.d.ts +5 -3
  77. package/dist/app/session-shell/workflow-output.js +13 -15
  78. package/dist/cli/package-messages.d.ts +0 -1
  79. package/dist/cli/package-messages.js +1 -1
  80. package/dist/cli/session-context.d.ts +1 -1
  81. package/dist/cli/uninstall.d.ts +3 -2
  82. package/dist/composition/owned-settings.d.ts +2 -1
  83. package/dist/composition/owned-settings.js +0 -3
  84. package/dist/composition/owned-ui.d.ts +1 -1
  85. package/dist/composition/owned-ui.js +77 -73
  86. package/dist/composition/reference-selection-options.d.ts +1 -1
  87. package/dist/composition/reference-selection-options.js +1 -1
  88. package/dist/composition/session-runtime-registry.d.ts +2 -1
  89. package/dist/composition/settings-route-host.js +3 -10
  90. package/dist/composition/settings-search-input.d.ts +2 -1
  91. package/dist/composition/startup-route.d.ts +2 -2
  92. package/dist/composition/startup-route.js +2 -2
  93. package/dist/contracts/owned-ui/extension-ui.d.ts +2 -1
  94. package/dist/contracts/owned-ui/index.d.ts +2 -1
  95. package/dist/contracts/owned-ui/index.js +1 -1
  96. package/dist/contracts/owned-ui/session-presenters.d.ts +3 -0
  97. package/dist/contracts/owned-ui/shell-components.d.ts +543 -0
  98. package/dist/contracts/owned-ui/validation.d.ts +1 -11
  99. package/dist/contracts/owned-ui/validation.js +8 -104
  100. package/dist/contracts/presentation/component.d.ts +17 -0
  101. package/dist/contracts/presentation/component.js +8 -0
  102. package/dist/contracts/presentation/index.d.ts +6 -15
  103. package/dist/contracts/presentation/index.js +2 -0
  104. package/dist/contracts/presentation/terminal.d.ts +284 -0
  105. package/dist/contracts/presentation/terminal.js +1 -0
  106. package/dist/contracts/presentation/theme.d.ts +46 -0
  107. package/dist/contracts/presentation/theme.js +1 -0
  108. package/dist/features/launch/development-launch.js +1 -1
  109. package/dist/features/launch/runtime-selection.d.ts +2 -2
  110. package/dist/features/launch/runtime-selection.js +2 -2
  111. package/dist/features/owned-ui/project-trust-prompt.d.ts +2 -2
  112. package/dist/features/owned-ui/project-trust-prompt.js +1 -1
  113. package/dist/features/owned-ui/release-note-state.d.ts +2 -1
  114. package/dist/features/owned-ui/settings-app.js +49 -425
  115. package/dist/features/owned-ui/settings-edits.d.ts +31 -0
  116. package/dist/features/owned-ui/settings-edits.js +139 -0
  117. package/dist/features/owned-ui/settings-model-dialog.d.ts +41 -0
  118. package/dist/features/owned-ui/settings-model-dialog.js +194 -0
  119. package/dist/features/owned-ui/settings-scroll-rail.d.ts +29 -0
  120. package/dist/features/owned-ui/settings-scroll-rail.js +79 -0
  121. package/dist/features/owned-ui/settings-search-input.d.ts +2 -1
  122. package/dist/features/prompt-history/service.d.ts +3 -2
  123. package/dist/foundation/lifecycle/claim-gate.d.ts +2 -1
  124. package/dist/foundation/release/automatic-update.d.ts +5 -14
  125. package/dist/foundation/release/automatic-update.js +15 -22
  126. package/dist/foundation/release/bootstrap.js +4 -4
  127. package/dist/foundation/release/dependency-certification.d.ts +0 -1
  128. package/dist/foundation/release/dependency-certification.js +1 -1
  129. package/dist/foundation/release/dependency-layer.js +3 -3
  130. package/dist/foundation/release/early-accent.d.ts +2 -2
  131. package/dist/foundation/release/early-accent.js +1 -1
  132. package/dist/foundation/release/index.d.ts +2 -2
  133. package/dist/foundation/release/index.js +1 -1
  134. package/dist/foundation/release/latest-release.d.ts +3 -18
  135. package/dist/foundation/release/latest-release.js +11 -11
  136. package/dist/foundation/release/managed-path.d.ts +10 -0
  137. package/dist/foundation/release/managed-path.js +26 -0
  138. package/dist/foundation/release/ordinary-launch-selection.d.ts +1 -1
  139. package/dist/foundation/release/ordinary-launch-selection.js +1 -1
  140. package/dist/foundation/release/release-gc.d.ts +3 -3
  141. package/dist/foundation/release/release-gc.js +10 -12
  142. package/dist/foundation/release/{cohort-state.d.ts → release-state.d.ts} +23 -23
  143. package/dist/foundation/release/{cohort-state.js → release-state.js} +8 -8
  144. package/dist/foundation/release/restart-certification.js +3 -4
  145. package/dist/foundation/release/update-activation.js +3 -3
  146. package/dist/foundation/release/update-execution-lease.d.ts +2 -3
  147. package/dist/foundation/release/update-execution-lease.js +2 -8
  148. package/dist/foundation/release/update-installer.d.ts +45 -0
  149. package/dist/foundation/release/update-installer.js +57 -0
  150. package/dist/foundation/release/update-launch.d.ts +2 -2
  151. package/dist/foundation/release/update-recovery.js +2 -9
  152. package/dist/foundation/release/update.d.ts +4 -25
  153. package/dist/foundation/release/update.js +164 -183
  154. package/dist/foundation/startup/startup-budget.d.ts +5 -5
  155. package/dist/foundation/startup/startup-budget.js +2 -2
  156. package/dist/integrations/pi/components/bracketed-paste.d.ts +33 -0
  157. package/dist/integrations/pi/components/bracketed-paste.js +123 -0
  158. package/dist/integrations/pi/components/editor-interaction.d.ts +4 -12
  159. package/dist/integrations/pi/components/index.d.ts +15 -9
  160. package/dist/integrations/pi/components/index.js +9 -5
  161. package/dist/integrations/pi/components/lazy-selectors.d.ts +2 -10
  162. package/dist/integrations/pi/components/lazy-selectors.js +1 -1
  163. package/dist/integrations/pi/components/modal-frame.d.ts +5 -22
  164. package/dist/integrations/pi/components/modal-frame.js +3 -23
  165. package/dist/integrations/pi/components/owned-editor-ux.d.ts +4 -3
  166. package/dist/integrations/pi/components/owned-editor-ux.js +46 -140
  167. package/dist/integrations/pi/components/prompt-input-port.d.ts +2 -19
  168. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -1
  169. package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +3 -2
  170. package/dist/integrations/pi/components/shell-footer-status.d.ts +2 -2
  171. package/dist/integrations/pi/components/shell-footer-status.js +3 -2
  172. package/dist/integrations/pi/components/shell-presenters-info.d.ts +6 -5
  173. package/dist/integrations/pi/components/shell-presenters-info.js +2 -1
  174. package/dist/integrations/pi/components/shell-session-info-reference.d.ts +2 -1
  175. package/dist/integrations/pi/components/shell-shared-facade.d.ts +33 -227
  176. package/dist/integrations/pi/components/shell-shared-facade.js +8 -1
  177. package/dist/integrations/pi/components/skills-command.d.ts +1 -9
  178. package/dist/integrations/pi/components/skills-command.js +5 -5
  179. package/dist/integrations/pi/components/theme.d.ts +9 -2
  180. package/dist/integrations/pi/components/theme.js +17 -2
  181. package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +2 -1
  182. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +2 -2
  183. package/dist/integrations/pi/engine/adapter.d.ts +4 -13
  184. package/dist/integrations/pi/engine/adapter.js +9 -61
  185. package/dist/integrations/pi/engine/changelog.d.ts +2 -2
  186. package/dist/integrations/pi/engine/changelog.js +3 -3
  187. package/dist/integrations/pi/engine/compaction-progress.d.ts +2 -3
  188. package/dist/integrations/pi/engine/compaction-progress.js +1 -1
  189. package/dist/integrations/pi/engine/conformance.d.ts +2 -1
  190. package/dist/integrations/pi/engine/default-model-setting.d.ts +0 -2
  191. package/dist/integrations/pi/engine/default-model-setting.js +1 -2
  192. package/dist/integrations/pi/engine/event-delivery.d.ts +2 -1
  193. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
  194. package/dist/integrations/pi/engine/host.js +3 -3
  195. package/dist/integrations/pi/engine/message-values.d.ts +0 -1
  196. package/dist/integrations/pi/engine/message-values.js +1 -1
  197. package/dist/integrations/pi/engine/pending-delivery.d.ts +0 -4
  198. package/dist/integrations/pi/engine/pending-delivery.js +3 -3
  199. package/dist/integrations/pi/engine/ports.d.ts +7 -1
  200. package/dist/integrations/pi/engine/ports.js +4 -0
  201. package/dist/integrations/pi/engine/project-trust-preflight.d.ts +2 -1
  202. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +3 -2
  203. package/dist/integrations/pi/engine/provider-authentication.d.ts +1 -1
  204. package/dist/integrations/pi/engine/public-main-entry.d.ts +1 -5
  205. package/dist/integrations/pi/engine/public-main-entry.js +1 -1
  206. package/dist/integrations/pi/engine/repository-metadata.d.ts +49 -0
  207. package/dist/integrations/pi/engine/repository-metadata.js +189 -0
  208. package/dist/integrations/pi/engine/repository-pr-rest.d.ts +1 -9
  209. package/dist/integrations/pi/engine/repository-pr-rest.js +2 -2
  210. package/dist/integrations/pi/engine/repository-pr.d.ts +1 -3
  211. package/dist/integrations/pi/engine/repository-pr.js +1 -1
  212. package/dist/integrations/pi/engine/resource-catalog.d.ts +2 -1
  213. package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
  214. package/dist/integrations/pi/engine/session-runtime.d.ts +7 -12
  215. package/dist/integrations/pi/engine/session-runtime.js +21 -178
  216. package/dist/integrations/pi/engine/settings-bridge.d.ts +0 -2
  217. package/dist/integrations/pi/engine/settings-bridge.js +1 -1
  218. package/dist/integrations/pi/engine/settings-port.d.ts +3 -2
  219. package/dist/integrations/pi/engine/transcript-projection.d.ts +2 -1
  220. package/dist/integrations/pi/engine/view-state.d.ts +21 -2
  221. package/dist/integrations/pi/engine/view-state.js +129 -1
  222. package/dist/integrations/pi/engine/workflow-contexts.d.ts +1 -1
  223. package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -2
  224. package/dist/integrations/pi/engine/workflow-runner.js +254 -365
  225. package/dist/integrations/pi/engine/workflow-share.d.ts +9 -0
  226. package/dist/integrations/pi/engine/workflow-share.js +168 -0
  227. package/dist/integrations/pi/engine/workflow-support.d.ts +0 -20
  228. package/dist/integrations/pi/engine/workflow-support.js +4 -65
  229. package/dist/integrations/pi/engine/workflows.d.ts +5 -5
  230. package/dist/integrations/pi/session-presenters/components.d.ts +3 -0
  231. package/dist/integrations/pi/session-presenters/components.js +75 -0
  232. package/dist/integrations/pi/session-presenters/index.d.ts +1 -0
  233. package/dist/integrations/pi/session-presenters/index.js +1 -0
  234. package/dist/integrations/pi/session-presenters/presentation.d.ts +3 -0
  235. package/dist/integrations/pi/session-presenters/presentation.js +10 -0
  236. package/dist/integrations/pi/session-presenters/presenters.d.ts +2 -1
  237. package/dist/integrations/pi/session-presenters/presenters.js +3 -1
  238. package/dist/integrations/pi/tui-runtime/adapter.d.ts +9 -19
  239. package/dist/integrations/pi/tui-runtime/adapter.js +56 -174
  240. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +9 -44
  241. package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
  242. package/dist/integrations/pi/tui-runtime/index.js +1 -0
  243. package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +4 -6
  244. package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +4 -10
  245. package/dist/integrations/pi/tui-runtime/overlay-geometry.js +3 -9
  246. package/dist/integrations/pi/tui-runtime/presentation-adapter.d.ts +2 -2
  247. package/dist/integrations/pi/tui-runtime/runtime-factory.d.ts +3 -0
  248. package/dist/integrations/pi/tui-runtime/runtime-factory.js +11 -0
  249. package/dist/ui/components/index.d.ts +2 -2
  250. package/dist/ui/components/index.js +1 -1
  251. package/dist/ui/components/selection-copy.d.ts +0 -1
  252. package/dist/ui/components/selection-copy.js +0 -12
  253. package/dist/ui/components/theme.d.ts +4 -19
  254. package/dist/ui/components/theme.js +6 -0
  255. package/dist/ui/components/transcript-viewport-frame.d.ts +120 -0
  256. package/dist/ui/components/transcript-viewport-frame.js +314 -0
  257. package/dist/ui/components/transcript-viewport-types.d.ts +147 -0
  258. package/dist/ui/components/transcript-viewport-types.js +1 -0
  259. package/dist/ui/components/transcript-viewport.d.ts +2 -147
  260. package/dist/ui/components/transcript-viewport.js +87 -315
  261. package/dist/ui/settings/declarations.d.ts +2 -3
  262. package/dist/ui/settings/declarations.js +2 -3
  263. package/dist/ui/settings/early-accent.js +1 -1
  264. package/dist/ui/settings/index.d.ts +3 -5
  265. package/dist/ui/settings/index.js +2 -3
  266. package/dist/ui/settings/manager.d.ts +0 -4
  267. package/dist/ui/settings/manager.js +6 -62
  268. package/dist/ui/settings/resolution.d.ts +6 -18
  269. package/dist/ui/settings/resolution.js +4 -103
  270. package/dist/ui/settings/sections.d.ts +0 -4
  271. package/dist/ui/settings/sections.js +1 -1
  272. package/docs/architecture/boundaries.md +2 -2
  273. package/docs/architecture/internal-naming.md +2 -0
  274. package/docs/architecture/project-structure.md +4 -2
  275. package/docs/validation.md +1 -1
  276. package/package.json +3 -4
  277. package/dist/integrations/pi/components/components.d.ts +0 -4
  278. package/dist/integrations/pi/components/components.js +0 -48
  279. package/dist/integrations/pi/components/conformance.d.ts +0 -18
  280. package/dist/integrations/pi/components/conformance.js +0 -70
  281. package/dist/integrations/pi/components/shell-components.d.ts +0 -7
  282. package/dist/integrations/pi/components/shell-components.js +0 -7
  283. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +0 -33
  284. package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -114
  285. package/dist/integrations/pi/engine/diagnostics-state.d.ts +0 -9
  286. package/dist/integrations/pi/engine/diagnostics-state.js +0 -34
  287. package/dist/integrations/pi/engine/usage-view.d.ts +0 -4
  288. package/dist/integrations/pi/engine/usage-view.js +0 -56
  289. package/dist/integrations/pi/tui-runtime/contracts.d.ts +0 -166
  290. package/dist/ui/settings/migrations.d.ts +0 -19
  291. package/dist/ui/settings/migrations.js +0 -225
  292. package/dist/ui/settings/progress-palette.generated.d.ts +0 -139
  293. package/dist/ui/settings/progress-palette.generated.js +0 -139
  294. /package/dist/{integrations/pi/tui-runtime/contracts.js → contracts/owned-ui/shell-components.js} +0 -0
  295. /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.d.ts +0 -0
  296. /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.js +0 -0
package/bin/ui.js CHANGED
@@ -63,12 +63,12 @@ const assertPiTuiIdentity = () => identity.assertSinglePiTuiModuleAtLaunch(
63
63
  completeRun(Promise.resolve().then(async () => {
64
64
  if (sessionSelection && profile !== "a1") throw new Error("session selection requires the normal A1 profile");
65
65
  return runSelectedInteractiveRuntime(profile, {
66
- ownedUi: async (profileId, ownedSurfaces) => {
66
+ ownedUi: async (profileId, productMode) => {
67
67
  const { application, settings } = await composeOwnedUi({
68
68
  cwd: process.cwd(),
69
69
  profileId,
70
- ownedSurfaces,
71
- projectTrustPrompt: createConsoleProjectTrustPrompt({ presentation: profile === "a1" ? "bare" : "comparison" }),
70
+ productMode,
71
+ projectTrustPrompt: createConsoleProjectTrustPrompt({ productMode }),
72
72
  sessionForkPrompt: createConsoleSessionForkPrompt(),
73
73
  ...(sessionSelection === undefined ? {} : { sessionSelection }),
74
74
  });
@@ -1,4 +1,4 @@
1
- import type { PiTuiInputDiagnosticsEvent } from "../../integrations/pi/tui-runtime/contracts.js";
1
+ import type { TerminalInputDiagnosticsEvent } from "../../contracts/presentation/index.js";
2
2
  import type { ResponseCopyEvent } from "./response-copy-protocol.js";
3
3
  import type { PasteEvent } from "./paste-protocol.js";
4
4
  /** Opt-in scalar-only snapshots, bounded to 128 rows and one pending asynchronous write. */
@@ -9,7 +9,7 @@ export declare class ClipboardDiagnosticCapture {
9
9
  constructor(destination: string, write?: (file: string, data: string) => Promise<void>);
10
10
  copy(event: ResponseCopyEvent): void;
11
11
  paste(event: PasteEvent): void;
12
- runtime(event: PiTuiInputDiagnosticsEvent): void;
12
+ runtime(event: TerminalInputDiagnosticsEvent): void;
13
13
  /** Explicit test/evidence boundary; the interactive UI never waits for disk diagnostics. */
14
14
  flush(): Promise<void>;
15
15
  dispose(): void;
@@ -8,4 +8,3 @@ export interface ClipboardImageData {
8
8
  * that Node's permissive base64 decoder would otherwise partially accept.
9
9
  */
10
10
  export declare function canonicalizeClipboardImage(image: ClipboardImageData, source?: boolean): ClipboardImageData | null;
11
- export declare function canonicalizeStandardBase64(value: string, source?: boolean): string | null;
@@ -10,7 +10,7 @@ export function canonicalizeClipboardImage(image, source = false) {
10
10
  const data = canonicalizeStandardBase64(image.data, source);
11
11
  return data === null ? null : { data, mimeType: image.mimeType };
12
12
  }
13
- export function canonicalizeStandardBase64(value, source = false) {
13
+ function canonicalizeStandardBase64(value, source = false) {
14
14
  if (typeof value !== "string" || value.length === 0)
15
15
  return null;
16
16
  const maximum = source ? Math.ceil(MAX_SOURCE_IMAGE_BYTES / 3) * 4 : MAX_IMAGE_DATA_BYTES;
@@ -1,14 +1,15 @@
1
+ import type { OwnedUiShellComponents, OwnedUiShellSelectorOption } from "../../contracts/owned-ui/index.js";
2
+ import type { TerminalOverlayHandle } from "../../contracts/presentation/index.js";
1
3
  import type { OwnedUiCommandResult, OwnedUiDialog } from "../../contracts/owned-ui/index.js";
2
4
  import type { UiRouteHost, UiRouteInput } from "../../ui/apps/contracts.js";
3
- import type { PiShellSelectorOption } from "../../integrations/pi/components/shell-shared-facade.js";
4
- import type { PiTuiOverlayHandle } from "../../integrations/pi/tui-runtime/contracts.js";
5
5
  import type { OwnedUiPresenterTerminal } from "./shell-host.js";
6
6
  import type { OwnedUiSessionShellOptions, OwnedUiSessionShellRoot } from "./session-shell-root.js";
7
7
  type StartupRoute = NonNullable<OwnedUiSessionShellOptions["engine"]["startupRoute"]>;
8
- export interface SessionDialogPorts {
8
+ interface SessionDialogPorts {
9
9
  readonly terminal: Pick<OwnedUiPresenterTerminal, "running" | "hasOverlay" | "showOverlay" | "openRoute" | "requestRender">;
10
- readonly root: Pick<OwnedUiSessionShellRoot, "dismissNotice" | "setInputSurface" | "usesDefaultInputSurface">;
10
+ readonly root: Pick<OwnedUiSessionShellRoot, "chrome" | "setInputSurface" | "usesDefaultInputSurface">;
11
11
  readonly routeHost: UiRouteHost | null;
12
+ readonly dialogs: Pick<OwnedUiShellComponents["dialogs"], "dialog" | "selector">;
12
13
  readonly disposed: () => boolean;
13
14
  /** A route, or the interrupt chord over it, asked to leave A1. */
14
15
  readonly exit: () => void;
@@ -26,7 +27,7 @@ export declare class SessionDialogCoordinator {
26
27
  constructor(ports: SessionDialogPorts);
27
28
  /** Clears the replacement input surface a selector put in the dock; the shared close action of every dock selector. */
28
29
  readonly closeInputSurface: () => void;
29
- showSelector(title: string, options: readonly PiShellSelectorOption[], onSelect: (id: string) => void, onCancel?: () => void): PiTuiOverlayHandle;
30
+ showSelector(title: string, options: readonly OwnedUiShellSelectorOption[], onSelect: (id: string) => void, onCancel?: () => void): TerminalOverlayHandle;
30
31
  /** Mirrors the backend's pending dialog; locally owned routes and selectors are left alone when it has none. */
31
32
  syncBackend(dialog: OwnedUiDialog | null): void;
32
33
  openRoute(route: string, input?: UiRouteInput, onClosed?: () => void | Promise<void>): OwnedUiCommandResult;
@@ -1,4 +1,3 @@
1
- import { createPiShellDialog, createPiShellSelector } from "../../integrations/pi/components/shell-selectors-dialogs.js";
2
1
  const OVERLAY_OPTIONS = { width: "70%", maxHeight: "80%", anchor: "center", inputCoordination: "owned" };
3
2
  const STARTUP_ROUTE_RETRY_MS = 25;
4
3
  /**
@@ -26,7 +25,7 @@ export class SessionDialogCoordinator {
26
25
  this.#handle?.hide();
27
26
  this.#source = "local";
28
27
  this.#id = undefined;
29
- const component = createPiShellSelector({
28
+ const component = this.#ports.dialogs.selector({
30
29
  title,
31
30
  options,
32
31
  onSelect: id => {
@@ -57,7 +56,7 @@ export class SessionDialogCoordinator {
57
56
  return;
58
57
  this.#handle?.hide();
59
58
  this.#source = "backend";
60
- const component = createPiShellDialog(dialog, { onSelect: () => this.#close(), onCancel: () => this.#close() });
59
+ const component = this.#ports.dialogs.dialog(dialog, { onSelect: () => this.#close(), onCancel: () => this.#close() });
61
60
  this.#handle = this.#ports.terminal.showOverlay(component, OVERLAY_OPTIONS);
62
61
  this.#id = dialog.id;
63
62
  }
@@ -67,7 +66,7 @@ export class SessionDialogCoordinator {
67
66
  return { outcome: "failed", diagnostic: `route is unavailable: ${route}` };
68
67
  if (!this.#ports.terminal.running)
69
68
  return { outcome: "failed", diagnostic: "runtime is not active" };
70
- this.#ports.root.dismissNotice();
69
+ this.#ports.root.chrome.dismissNotice();
71
70
  this.#handle?.hide();
72
71
  this.#source = "route";
73
72
  const handle = this.#ports.terminal.openRoute(surface, {
@@ -1,13 +1,17 @@
1
- import type { ImageAttachmentError, OwnedUiSessionViewModel } from "../../contracts/owned-ui/index.js";
1
+ import type { ImageAttachmentError, OwnedUiSessionViewModel, OwnedUiShellComponents, OwnedUiShellReleaseUpdateBanner } from "../../contracts/owned-ui/index.js";
2
+ import type { ThemeSource } from "../../contracts/presentation/index.js";
2
3
  import type { TranscriptViewportFrame } from "../../ui/components/transcript-viewport.js";
3
- import { type PiShellReleaseUpdateBanner } from "../../integrations/pi/components/shell-presenters-info.js";
4
4
  import type { SessionViewportController } from "./session-viewport-controller.js";
5
- export interface DockNotice {
5
+ interface DockNotice {
6
6
  readonly kind: "status" | "warning" | "error" | "new-session";
7
7
  readonly message: string;
8
8
  readonly errorCode?: ImageAttachmentError["code"];
9
9
  }
10
- export interface DockChromePorts {
10
+ interface DockChromePorts {
11
+ readonly theme: ThemeSource;
12
+ readonly components: Pick<OwnedUiShellComponents, "chrome" | "info" | "text">;
13
+ /** Columns the pinned layout pads command output with. */
14
+ readonly outputPad: 0 | 1;
11
15
  /** Chrome changed; the root invalidates its chrome components. */
12
16
  readonly invalidateChrome: () => void;
13
17
  readonly requestRender: () => void;
@@ -30,6 +34,7 @@ export declare class DockChrome {
30
34
  clearCopyAcknowledgement(requestRender: boolean): void;
31
35
  renderCopyAcknowledgement(width: number): string | undefined;
32
36
  renderPromptOverlay(diagnostics: OwnedUiSessionViewModel["diagnostics"], width: number): string | undefined;
33
- renderReleaseBanner(diagnostics: OwnedUiSessionViewModel["diagnostics"], width: number): PiShellReleaseUpdateBanner | undefined;
34
- locateReleaseClose(frame: TranscriptViewportFrame, banner: PiShellReleaseUpdateBanner | undefined, tailEnd: number, tailLength: number): void;
37
+ renderReleaseBanner(diagnostics: OwnedUiSessionViewModel["diagnostics"], width: number): OwnedUiShellReleaseUpdateBanner | undefined;
38
+ locateReleaseClose(frame: TranscriptViewportFrame, banner: OwnedUiShellReleaseUpdateBanner | undefined, tailEnd: number, tailLength: number): void;
35
39
  }
40
+ export {};
@@ -1,7 +1,4 @@
1
1
  import { COPY_ACKNOWLEDGEMENT_DURATION_MS } from "../../ui/components/selection-copy.js";
2
- import { renderPiShellCommandMessage, renderPiShellReleaseUpdateBanner, renderPiShellStatusText, } from "../../integrations/pi/components/shell-presenters-info.js";
3
- import { PINNED_PI_LAYOUT, piTheme } from "../../integrations/pi/components/upstream/theme/theme.js";
4
- import { piShellTruncateToWidth, renderPiShellInstalledUpdateStatus } from "../../integrations/pi/components/shell-shared-facade.js";
5
2
  import { parseReleaseUpdateDiagnostic } from "./transcript-document.js";
6
3
  /**
7
4
  * The transient chrome around bare A1's dock: the one command notice above the editor, the release
@@ -41,9 +38,9 @@ export class DockChrome {
41
38
  return [];
42
39
  if (notice.kind === "status") {
43
40
  // Compatibility: Pi pads its status text by one cell regardless of the output pad setting.
44
- return ["", ...renderPiShellStatusText(notice.message, width, PINNED_PI_LAYOUT.outputPad)];
41
+ return ["", ...this.#ports.components.info.statusText(notice.message, width, this.#ports.outputPad)];
45
42
  }
46
- return renderPiShellCommandMessage({
43
+ return this.#ports.components.info.commandMessage({
47
44
  kind: notice.kind === "new-session" ? "accent" : notice.kind,
48
45
  message: notice.message,
49
46
  }, width, outputPad);
@@ -78,14 +75,14 @@ export class DockChrome {
78
75
  renderCopyAcknowledgement(width) {
79
76
  if (this.#copyAcknowledgement === undefined || width <= 0)
80
77
  return undefined;
81
- return piTheme().fg("accent", piShellTruncateToWidth(this.#copyAcknowledgement, width));
78
+ return this.#ports.theme.current().fg("accent", this.#ports.components.text.truncateToWidth(this.#copyAcknowledgement, width));
82
79
  }
83
80
  renderPromptOverlay(diagnostics, width) {
84
81
  const acknowledgement = this.renderCopyAcknowledgement(width);
85
82
  if (acknowledgement !== undefined)
86
83
  return acknowledgement;
87
84
  if (diagnostics.some(diagnostic => diagnostic.code === "release-update-installed")) {
88
- return renderPiShellInstalledUpdateStatus(width) || undefined;
85
+ return this.#ports.components.chrome.installedUpdateStatus(width) || undefined;
89
86
  }
90
87
  return undefined;
91
88
  }
@@ -96,7 +93,7 @@ export class DockChrome {
96
93
  const release = diagnostic === undefined ? null : parseReleaseUpdateDiagnostic(diagnostic.message);
97
94
  if (release === null)
98
95
  return undefined;
99
- return renderPiShellReleaseUpdateBanner(release, width, this.#ports.viewport.tailControlHovered(this.#releaseCloseTarget));
96
+ return this.#ports.components.chrome.releaseUpdateBanner(release, width, this.#ports.viewport.tailControlHovered(this.#releaseCloseTarget));
100
97
  }
101
98
  locateReleaseClose(frame, banner, tailEnd, tailLength) {
102
99
  // Invariant: the tail is the document suffix, so the control's document row is fixed relative to its
@@ -1,5 +1,3 @@
1
- /** Aggregate explicit URL-chip metadata allowance for one owned editor decoration pass. */
2
- export declare const EDITOR_HYPERLINK_METADATA_BYTES: number;
3
1
  /** Accounts complete OSC 8 controls before construction, without scanning oversized backing URLs. */
4
2
  export declare class EditorHyperlinkBudget {
5
3
  #private;
@@ -1,5 +1,5 @@
1
1
  /** Aggregate explicit URL-chip metadata allowance for one owned editor decoration pass. */
2
- export const EDITOR_HYPERLINK_METADATA_BYTES = 64 * 1024;
2
+ const EDITOR_HYPERLINK_METADATA_BYTES = 64 * 1024;
3
3
  const CLOSE_BYTES = 7;
4
4
  const PAIR_BYTES = CLOSE_BYTES * 2;
5
5
  /** Accounts complete OSC 8 controls before construction, without scanning oversized backing URLs. */
@@ -10,9 +10,9 @@ export interface ExitNoticeSource {
10
10
  }) => void): () => void;
11
11
  };
12
12
  }
13
- export interface ArmedExitNotice {
13
+ interface ArmedExitNotice {
14
14
  clear(): void;
15
15
  }
16
- export declare function uncleanExitNoticeLines(resume: SessionResumeCommandMetadata | null): string[];
17
16
  /** Arms the notice and keeps its resume command following the bound session until cleared. */
18
17
  export declare function armExitNotice(source: ExitNoticeSource, path: string): ArmedExitNotice;
18
+ export {};
@@ -7,7 +7,7 @@
7
7
  import { renameSync, rmSync, writeFileSync } from "node:fs";
8
8
  import { PRODUCT_IDENTITY } from "../../product-identity.js";
9
9
  import { formatSessionResumeCommand } from "./session-lifecycle.js";
10
- export function uncleanExitNoticeLines(resume) {
10
+ function uncleanExitNoticeLines(resume) {
11
11
  return [
12
12
  `${PRODUCT_IDENTITY.displayName} was stopped unexpectedly.`,
13
13
  ...(resume === null ? [] : [`To resume this session: ${formatSessionResumeCommand(resume)}`]),
@@ -1,6 +1,6 @@
1
+ import type { OwnedUiShellComponentPort } from "../../contracts/owned-ui/index.js";
1
2
  import type { OwnedUiSessionViewModel } from "../../contracts/owned-ui/index.js";
2
- import type { PiShellComponentPort } from "../../integrations/pi/components/shell-shared-facade.js";
3
- export type ExtensionWidgetPlacement = "aboveEditor" | "belowEditor";
3
+ type ExtensionWidgetPlacement = "aboveEditor" | "belowEditor";
4
4
  /**
5
5
  * What extensions draw into the shell: a header that replaces the built-in one, a footer, widgets
6
6
  * above and below the editor, footer statuses, and a working message. It owns those components and
@@ -8,15 +8,15 @@ export type ExtensionWidgetPlacement = "aboveEditor" | "belowEditor";
8
8
  */
9
9
  export declare class ExtensionSurface {
10
10
  #private;
11
- get header(): PiShellComponentPort | null;
12
- get footer(): PiShellComponentPort | null;
11
+ get header(): OwnedUiShellComponentPort | null;
12
+ get footer(): OwnedUiShellComponentPort | null;
13
13
  get working(): {
14
14
  readonly message: string | undefined;
15
15
  readonly visible: boolean;
16
16
  };
17
- placeWidget(key: string, component: PiShellComponentPort | null, placement: ExtensionWidgetPlacement): void;
18
- replaceHeader(component: PiShellComponentPort | null): void;
19
- replaceFooter(component: PiShellComponentPort | null): void;
17
+ placeWidget(key: string, component: OwnedUiShellComponentPort | null, placement: ExtensionWidgetPlacement): void;
18
+ replaceHeader(component: OwnedUiShellComponentPort | null): void;
19
+ replaceFooter(component: OwnedUiShellComponentPort | null): void;
20
20
  setStatus(key: string, text: string | undefined): void;
21
21
  setWorking(message: string | undefined, visible: boolean): void;
22
22
  statuses(): Map<string, string>;
@@ -28,3 +28,4 @@ export declare class ExtensionSurface {
28
28
  reset(): void;
29
29
  dispose(): void;
30
30
  }
31
+ export {};
@@ -1,12 +1,10 @@
1
1
  import type { ChildProcess } from "node:child_process";
2
- /** How long an unused spare helper may idle before it is stopped so a background session holds no extra process. */
3
- export declare const HELPER_SPARE_IDLE_MS: number;
4
- export interface SpareHelper {
2
+ interface SpareHelper {
5
3
  readonly child: ChildProcess;
6
4
  /** Whether the helper already announced itself; the taker must then send the first request itself. */
7
5
  readonly ready: boolean;
8
6
  }
9
- export interface HelperPoolOptions {
7
+ interface HelperPoolOptions {
10
8
  readonly fork: () => ChildProcess;
11
9
  /** Stops a spare that is no longer wanted; the paste helper needs its process group killed on POSIX. */
12
10
  readonly stop: (child: ChildProcess) => void;
@@ -29,3 +27,4 @@ export declare class HelperPool {
29
27
  /** Stops the held spare and refuses further warming. */
30
28
  dispose(): void;
31
29
  }
30
+ export {};
@@ -1,5 +1,5 @@
1
1
  /** How long an unused spare helper may idle before it is stopped so a background session holds no extra process. */
2
- export const HELPER_SPARE_IDLE_MS = 5 * 60_000;
2
+ const HELPER_SPARE_IDLE_MS = 5 * 60_000;
3
3
  /** Holds one idle IPC helper; requests take it, and exits, expiry, or use trigger replacement. */
4
4
  export class HelperPool {
5
5
  #fork;
@@ -1,7 +1,7 @@
1
- import type { PiShellClipboardContent } from "../../integrations/pi/components/index.js";
1
+ import type { OwnedUiShellClipboardContent } from "../../contracts/owned-ui/index.js";
2
2
  import type { ImagePreparationLimits, PreparedImage } from "./image-preparation.js";
3
3
  import type { ImageWorkerRequest } from "./image-worker.js";
4
- export type PreparedClipboardContent = {
4
+ type PreparedClipboardContent = {
5
5
  readonly kind: "text";
6
6
  readonly text: string;
7
7
  } | ({
@@ -14,7 +14,8 @@ export interface ImagePasteJob {
14
14
  /** Owns bounded paste acquisition and one off-thread conversion, canceled on session disposal. */
15
15
  export declare class ImagePreparationClient {
16
16
  #private;
17
- start(read?: (signal: AbortSignal) => Promise<PiShellClipboardContent | null>, limits?: ImagePreparationLimits): ImagePasteJob;
17
+ start(read?: (signal: AbortSignal) => Promise<OwnedUiShellClipboardContent | null>, limits?: ImagePreparationLimits): ImagePasteJob;
18
18
  dispose(): Promise<void>;
19
19
  }
20
20
  export declare function runImageWorker<T>(request: ImageWorkerRequest, signal: AbortSignal): Promise<T>;
21
+ export {};
@@ -10,8 +10,6 @@ export interface PreparedImage {
10
10
  readonly height: number;
11
11
  readonly transformed: boolean;
12
12
  }
13
- export declare const IMAGE_TARGET_BASE64_BYTES: number;
14
- export declare const IMAGE_TARGET_DECODED_BYTES: number;
15
13
  export declare function prepareImage(source: {
16
14
  readonly data: string;
17
15
  readonly mimeType: string;
@@ -2,8 +2,8 @@ import { isMainThread } from "node:worker_threads";
2
2
  import { ImageAttachmentError } from "../../contracts/owned-ui/index.js";
3
3
  import { canonicalizeClipboardImage } from "./clipboard-image.js";
4
4
  import { sourceImageInfo } from "./image-source.js";
5
- export const IMAGE_TARGET_BASE64_BYTES = 4.5 * 1024 * 1024;
6
- export const IMAGE_TARGET_DECODED_BYTES = 5 * 1024 * 1024;
5
+ const IMAGE_TARGET_BASE64_BYTES = 4.5 * 1024 * 1024;
6
+ const IMAGE_TARGET_DECODED_BYTES = 5 * 1024 * 1024;
7
7
  export async function prepareImage(source, limits = {}) {
8
8
  // Performance: an async signature does not move synchronous WASM work off the interactive thread.
9
9
  if (isMainThread)
@@ -1,8 +1,6 @@
1
1
  export declare const MAX_SOURCE_IMAGE_BYTES: number;
2
- export declare const MAX_SOURCE_PIXELS = 40000000;
3
- export declare const MAX_SOURCE_DIMENSION = 32768;
4
2
  export declare const IMAGE_PREPARATION_MS = 15000;
5
- export interface ImageSourceInfo {
3
+ interface ImageSourceInfo {
6
4
  readonly width: number;
7
5
  readonly height: number;
8
6
  readonly mimeType: string;
@@ -11,3 +9,4 @@ export interface ImageSourceInfo {
11
9
  }
12
10
  export declare function assertSourceBytes(length: number): void;
13
11
  export declare function sourceImageInfo(bytes: Uint8Array, mimeType: string): ImageSourceInfo;
12
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { ImageAttachmentError } from "../../contracts/owned-ui/index.js";
2
2
  export const MAX_SOURCE_IMAGE_BYTES = 20 * 1024 * 1024;
3
- export const MAX_SOURCE_PIXELS = 40_000_000;
4
- export const MAX_SOURCE_DIMENSION = 32_768;
3
+ const MAX_SOURCE_PIXELS = 40_000_000;
4
+ const MAX_SOURCE_DIMENSION = 32_768;
5
5
  export const IMAGE_PREPARATION_MS = 15_000;
6
6
  export function assertSourceBytes(length) {
7
7
  if (length > MAX_SOURCE_IMAGE_BYTES)
@@ -1,9 +1,10 @@
1
- import type { PiShellComponentPort, PiShellEditorPort } from "../../integrations/pi/components/shell-shared-facade.js";
2
- import { type PiTuiInputSurfaceKind } from "../../integrations/pi/tui-runtime/input-presentation-coordinator.js";
1
+ import type { OwnedUiShellComponentPort, OwnedUiShellEditorPort } from "../../contracts/owned-ui/index.js";
2
+ import type { TerminalInputSurfaceKind, TerminalRuntimeFactory } from "../../contracts/presentation/index.js";
3
3
  import type { SessionViewportController } from "./session-viewport-controller.js";
4
- export interface InputSurfaceSwitchPorts {
4
+ interface InputSurfaceSwitchPorts {
5
5
  /** Whether keystrokes that cannot change the transcript may repaint the dock alone. */
6
6
  readonly dockInputReuse: boolean;
7
+ readonly classifyInput: TerminalRuntimeFactory["classifyInput"];
7
8
  readonly viewport: Pick<SessionViewportController, "invalidateInputSurface" | "presentationRevision">;
8
9
  /** The surface changed; listeners outside the root react. */
9
10
  readonly onChanged?: () => void;
@@ -15,9 +16,9 @@ export interface InputSurfaceSwitchPorts {
15
16
  */
16
17
  export declare class InputSurfaceSwitch {
17
18
  #private;
18
- constructor(editor: PiShellEditorPort, ports: InputSurfaceSwitchPorts);
19
- get surface(): PiShellComponentPort;
20
- get coordination(): PiTuiInputSurfaceKind;
19
+ constructor(editor: OwnedUiShellEditorPort, ports: InputSurfaceSwitchPorts);
20
+ get surface(): OwnedUiShellComponentPort;
21
+ get coordination(): TerminalInputSurfaceKind;
21
22
  get usesEditor(): boolean;
22
23
  get dockInputCandidate(): boolean;
23
24
  get dockInputRevision(): number | undefined;
@@ -25,7 +26,7 @@ export declare class InputSurfaceSwitch {
25
26
  * Shows `component` in the dock, or the editor for null. Returns false when the surface is
26
27
  * unchanged, in which case only its coordination kind is updated.
27
28
  */
28
- set(component: PiShellComponentPort | null, disposePrevious: boolean, coordination: Exclude<PiTuiInputSurfaceKind, "editor">): boolean;
29
+ set(component: OwnedUiShellComponentPort | null, disposePrevious: boolean, coordination: Exclude<TerminalInputSurfaceKind, "editor">): boolean;
29
30
  handleInput(data: string): void;
30
31
  /** Reads and clears the dock-only candidate for one composition. */
31
32
  takeDockInputCandidate(): boolean;
@@ -34,3 +35,4 @@ export declare class InputSurfaceSwitch {
34
35
  /** Disposes a replacement surface; the editor is disposed by its owner. */
35
36
  dispose(): void;
36
37
  }
38
+ export {};
@@ -1,4 +1,3 @@
1
- import { classifyPiTuiInput } from "../../integrations/pi/tui-runtime/input-presentation-coordinator.js";
2
1
  /**
3
2
  * Which component receives the dock's input: the prompt editor, or a selector, dialog, or prompt
4
3
  * that temporarily replaces it. It also records whether the latest keystroke is safe for a
@@ -55,7 +54,7 @@ export class InputSurfaceSwitch {
55
54
  return true;
56
55
  }
57
56
  handleInput(data) {
58
- this.#dockInputCandidate = this.#ports.dockInputReuse && classifyPiTuiInput(data, this.#coordination) === "safe";
57
+ this.#dockInputCandidate = this.#ports.dockInputReuse && this.#ports.classifyInput(data, this.#coordination) === "safe";
59
58
  this.#dockInputRevision = this.#dockInputCandidate ? this.#ports.viewport.presentationRevision : undefined;
60
59
  try {
61
60
  this.#surface.handleInput?.(data);
@@ -1,12 +1,12 @@
1
- import type { OwnedUiWorkflowInteractionRequest, OwnedUiWorkflowLoginNotification, OwnedUiWorkflowLoginStart } from "../../contracts/owned-ui/index.js";
2
- import type { ProgramStatusReporter } from "../../integrations/pi/components/upstream/program-status-reporter.js";
1
+ import type { OwnedUiShellComponents, OwnedUiShellProgramStatusReporter, OwnedUiWorkflowInteractionRequest, OwnedUiWorkflowLoginNotification, OwnedUiWorkflowLoginStart } from "../../contracts/owned-ui/index.js";
3
2
  import type { SessionConcern } from "./session-concern.js";
4
3
  import type { OwnedUiSessionShellRoot } from "./session-shell-root.js";
5
4
  import { type OwnedUiPresenterTerminal } from "./shell-host.js";
6
- export interface LoginInteractionPorts {
5
+ interface LoginInteractionPorts {
7
6
  readonly terminal: Pick<OwnedUiPresenterTerminal, "viewport" | "requestRender">;
8
7
  readonly root: Pick<OwnedUiSessionShellRoot, "setInputSurface">;
9
- readonly programStatus: Pick<ProgramStatusReporter, "setBlocked">;
8
+ readonly programStatus: Pick<OwnedUiShellProgramStatusReporter, "setBlocked">;
9
+ readonly dialogs: Pick<OwnedUiShellComponents["dialogs"], "loginDialog" | "extensionSelector">;
10
10
  /** The blocked-on-authentication state changed; the presenter republishes terminal progress. */
11
11
  readonly syncProgress: () => void;
12
12
  }
@@ -25,3 +25,4 @@ export declare class LoginInteraction implements SessionConcern {
25
25
  /** A replaced session forgets its dialog; the presenter clears the input surface as part of the same replacement. */
26
26
  onSessionReplaced(): void;
27
27
  }
28
+ export {};
@@ -1,4 +1,3 @@
1
- import { createPiShellExtensionSelector, createPiShellLoginDialog, } from "../../integrations/pi/components/shell-selectors-dialogs.js";
2
1
  import { componentRuntime } from "./shell-host.js";
3
2
  /**
4
3
  * The engine's login flow in the dock: one login dialog at a time, the prompts and selections the
@@ -12,7 +11,7 @@ export class LoginInteraction {
12
11
  }
13
12
  start(request) {
14
13
  this.finish();
15
- const dialog = createPiShellLoginDialog(componentRuntime(this.#ports.terminal), request.providerId, success => {
14
+ const dialog = this.#ports.dialogs.loginDialog(componentRuntime(this.#ports.terminal), request.providerId, success => {
16
15
  if (!success)
17
16
  this.finish();
18
17
  }, request.providerName);
@@ -39,7 +38,7 @@ export class LoginInteraction {
39
38
  this.#ports.root.setInputSurface(dialog);
40
39
  this.#ports.terminal.requestRender();
41
40
  };
42
- const selector = createPiShellExtensionSelector(request.message, labels, label => {
41
+ const selector = this.#ports.dialogs.extensionSelector(request.message, labels, label => {
43
42
  const id = options.find(option => option.label === label)?.id;
44
43
  restoreDialog();
45
44
  resolve(id ?? null);
@@ -1,5 +1,4 @@
1
- import { type ChildProcess } from "node:child_process";
2
- import type { PiShellClipboardContent } from "../../integrations/pi/components/shell-shared-facade.js";
1
+ import type { OwnedUiShellClipboardContent } from "../../contracts/owned-ui/index.js";
3
2
  import { type PreparedPaste, type PasteEvent } from "./paste-protocol.js";
4
3
  import { HelperPool } from "./helper-pool.js";
5
4
  export interface PasteExecutorJob {
@@ -7,12 +6,9 @@ export interface PasteExecutorJob {
7
6
  readonly stopped: Promise<void>;
8
7
  cancel(): void;
9
8
  }
10
- export type PastePhase = (phase: PasteEvent["phase"], bytes?: number) => void;
11
- /** Forks one paste helper: no inherited descriptors, JSON IPC only, and its own process group on POSIX. */
12
- export declare function forkPasteHelper(helper?: URL): ChildProcess;
13
- /** Kills a paste helper and everything it spawned, then lets the parent exit without waiting for it. */
14
- export declare function stopPasteHelper(child: ChildProcess): void;
9
+ type PastePhase = (phase: PasteEvent["phase"], bytes?: number) => void;
15
10
  /** A spare-of-one pool of paste helpers; `startPasteExecutor` takes its child and warms the next one after each paste. */
16
11
  export declare function createPasteHelperPool(helper?: URL, idleMs?: number): HelperPool;
17
12
  /** Streams bounded fragments through a killable child; native/codec/filesystem work never runs on the UI thread. */
18
- export declare function startPasteExecutor(content: PiShellClipboardContent | undefined, signal: AbortSignal, phase?: PastePhase, helper?: URL, pool?: HelperPool): PasteExecutorJob;
13
+ export declare function startPasteExecutor(content: OwnedUiShellClipboardContent | undefined, signal: AbortSignal, phase?: PastePhase, helper?: URL, pool?: HelperPool): PasteExecutorJob;
14
+ export {};
@@ -20,7 +20,7 @@ function permitConversion() {
20
20
  child.send({ kind: "convert" }, () => { });
21
21
  }
22
22
  /** Forks one paste helper: no inherited descriptors, JSON IPC only, and its own process group on POSIX. */
23
- export function forkPasteHelper(helper) {
23
+ function forkPasteHelper(helper) {
24
24
  const source = new URL(import.meta.url).pathname.endsWith(".ts");
25
25
  const entry = helper ?? new URL(source ? "./paste-helper.ts" : "./paste-helper.js", import.meta.url);
26
26
  const options = {
@@ -31,7 +31,7 @@ export function forkPasteHelper(helper) {
31
31
  return fork(entry, [], options);
32
32
  }
33
33
  /** Kills a paste helper and everything it spawned, then lets the parent exit without waiting for it. */
34
- export function stopPasteHelper(child) {
34
+ function stopPasteHelper(child) {
35
35
  // Concurrency: POSIX command fallbacks share this isolated process group; kill descendants too.
36
36
  if (process.platform !== "win32" && child.pid !== undefined) {
37
37
  try {
@@ -1,4 +1,4 @@
1
- import type { PiShellClipboardContent } from "../../integrations/pi/components/index.js";
1
+ import type { OwnedUiShellClipboardContent } from "../../contracts/owned-ui/index.js";
2
2
  import type { PreparedPasteText, ClipboardPath } from "./paste-text-preparation.js";
3
3
  import type { PreparedImage } from "./image-preparation.js";
4
4
  export declare const PASTE_READ_MS = 5000;
@@ -16,7 +16,7 @@ export type PasteSource = {
16
16
  readonly before?: (signal: AbortSignal) => Promise<boolean>;
17
17
  } | {
18
18
  readonly kind: "provided";
19
- readonly read: (signal: AbortSignal) => Promise<PiShellClipboardContent | null>;
19
+ readonly read: (signal: AbortSignal) => Promise<OwnedUiShellClipboardContent | null>;
20
20
  readonly before?: (signal: AbortSignal) => Promise<boolean>;
21
21
  } | {
22
22
  readonly kind: "text";
@@ -1,14 +1,9 @@
1
1
  import type { ClipboardPath, PreparedPasteText } from "./paste-types.js";
2
- export declare const PATH_CHIP_PRESENTATION_UNITS = 4096;
3
2
  /** Normalizes a path for host-filesystem identity comparisons. */
4
3
  export declare function normalizedPathIdentity(fullPath: string): string;
5
4
  /** Yields labels from the basename through the normalized rooted path, shortest first. */
6
5
  export declare function pathChipLabelCandidates(fullPath: string): Iterable<string>;
7
- /** Formats one path label with the established folder/file/image-file icon. */
8
- export declare function pathChipTag(item: ClipboardPath, label?: string): string;
9
6
  /** Yields complete deterministic tags lazily for path collision adoption. */
10
7
  export declare function pathChipTagCandidates(item: ClipboardPath): Iterable<string>;
11
- /** Returns the conservative UTF-16 presentation cost for one path occurrence. */
12
- export declare function pathChipPresentationUnits(item: ClipboardPath): number;
13
8
  /** Run in the isolated preparer: compact before path arrays become an oversized editor presentation. */
14
9
  export declare function preparePathPresentation(paths: readonly ClipboardPath[]): PreparedPasteText;
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- export const PATH_CHIP_PRESENTATION_UNITS = 4096;
2
+ const PATH_CHIP_PRESENTATION_UNITS = 4096;
3
3
  const IMAGE_EXTENSION = /\.(?:jpe?g|png|webp|gif|bmp|tiff?)$/iu;
4
4
  /** Normalizes a path for host-filesystem identity comparisons. */
5
5
  export function normalizedPathIdentity(fullPath) {
@@ -29,7 +29,7 @@ export function* pathChipLabelCandidates(fullPath) {
29
29
  yield rooted;
30
30
  }
31
31
  /** Formats one path label with the established folder/file/image-file icon. */
32
- export function pathChipTag(item, label = basePathLabel(item.fullPath)) {
32
+ function pathChipTag(item, label = basePathLabel(item.fullPath)) {
33
33
  const icon = item.kind === "folder" ? "📁" : IMAGE_EXTENSION.test(item.fullPath) ? "🖼 " : "📄";
34
34
  return `[${icon} ${label}]`;
35
35
  }
@@ -39,7 +39,7 @@ export function* pathChipTagCandidates(item) {
39
39
  yield pathChipTag(item, label);
40
40
  }
41
41
  /** Returns the conservative UTF-16 presentation cost for one path occurrence. */
42
- export function pathChipPresentationUnits(item) {
42
+ function pathChipPresentationUnits(item) {
43
43
  return pathChipTag(item, displayPath(path.normalize(item.fullPath.trim()))).length;
44
44
  }
45
45
  /** Run in the isolated preparer: compact before path arrays become an oversized editor presentation. */
@@ -1,7 +1,7 @@
1
- import type { PiShellClipboardContent, PiShellEditorTextRange } from "../../integrations/pi/components/shell-shared-facade.js";
1
+ import type { OwnedUiShellClipboardContent, OwnedUiShellEditorTextRange } from "../../contracts/owned-ui/index.js";
2
2
  import { type PastePreparationClientOptions } from "./paste-preparation-client.js";
3
3
  import type { PasteEvent, PasteSource } from "./paste-protocol.js";
4
- export interface PromptImageAttachment {
4
+ interface PromptImageAttachment {
5
5
  readonly type: "image";
6
6
  readonly data: string;
7
7
  readonly mimeType: string;
@@ -21,7 +21,7 @@ export declare class PromptChipStore {
21
21
  });
22
22
  /** Forks the spare paste helper so the session's first paste does not pay for helper startup. */
23
23
  warm(): void;
24
- beginPaste(currentText: string, read: ((signal: AbortSignal) => Promise<PiShellClipboardContent | null>) | PasteSource, onError: (error: unknown) => void, onImage?: () => void): {
24
+ beginPaste(currentText: string, read: ((signal: AbortSignal) => Promise<OwnedUiShellClipboardContent | null>) | PasteSource, onError: (error: unknown) => void, onImage?: () => void): {
25
25
  marker: string;
26
26
  result: Promise<string>;
27
27
  complete?(): void;
@@ -37,11 +37,11 @@ export declare class PromptChipStore {
37
37
  readonly limit: number;
38
38
  readonly corrected: boolean;
39
39
  };
40
- transformPastedContent(content: PiShellClipboardContent, currentText?: string): string;
40
+ transformPastedContent(content: OwnedUiShellClipboardContent, currentText?: string): string;
41
41
  /** Hide provisional clipboard identities until the read identifies an actual image. */
42
- hiddenRanges(line: string): readonly PiShellEditorTextRange[];
43
- atomicRanges(line: string): readonly PiShellEditorTextRange[];
44
- unsentRanges(line: string): readonly PiShellEditorTextRange[];
42
+ hiddenRanges(line: string): readonly OwnedUiShellEditorTextRange[];
43
+ atomicRanges(line: string): readonly OwnedUiShellEditorTextRange[];
44
+ unsentRanges(line: string): readonly OwnedUiShellEditorTextRange[];
45
45
  omitUnsentImages(text: string): string;
46
46
  hyperlinkRanges(text: string): readonly {
47
47
  start: number;
@@ -76,3 +76,4 @@ export declare class PromptChipStore {
76
76
  rehydrateHistoryText(text: string, resolveImage: (id: string) => PromptImageAttachment | null): string;
77
77
  prepareSubmission(text: string): PreparedPrompt;
78
78
  }
79
+ export {};