@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
@@ -44,7 +44,6 @@ const SLOT_IDS = new Set([
44
44
  "overlay",
45
45
  "layout",
46
46
  ]);
47
- const OUTCOMES = new Set(["accepted", "rejected", "completed", "failed", "timed-out", "cancelled"]);
48
47
  const FOCUSED_REGIONS = new Set(["transcript", "editor", "dialog", "overlay", "status"]);
49
48
  const DIALOG_KINDS = new Set(["choice", "editor", "settings", "confirmation"]);
50
49
  const OVERLAY_PLACEMENTS = new Set(["bottom", "center"]);
@@ -94,89 +93,7 @@ export function assertOwnedUiCommand(command) {
94
93
  throw new TypeError("owned-UI command type is unknown");
95
94
  }
96
95
  }
97
- export function assertOwnedUiEvent(event) {
98
- assertId(event.sessionId, "owned-UI event session id");
99
- assertNonNegativeInteger(event.sequence, "owned-UI event sequence");
100
- switch (event.type) {
101
- case "session-lifecycle":
102
- assertEnum(event.lifecycle, LIFECYCLES, "owned-UI lifecycle");
103
- assertOptionalText(event.reason, "owned-UI lifecycle reason", MAX_MESSAGE_LENGTH);
104
- return;
105
- case "session-view":
106
- assertOwnedUiSessionViewModel(event.view);
107
- assertViewSession(event.view, event.sessionId);
108
- return;
109
- case "transcript-block":
110
- assertOwnedUiTranscriptBlock(event.block);
111
- return;
112
- case "assistant-message-completed":
113
- assertNonNegativeInteger(event.sessionGeneration, "owned-UI assistant response session generation");
114
- assertNonNegativeInteger(event.runSequence, "owned-UI assistant response run sequence");
115
- assertNonNegativeInteger(event.responseSequence, "owned-UI assistant response sequence");
116
- assertNonNegativeInteger(event.assistantMessageCount, "owned-UI assistant response count");
117
- if (event.model !== null)
118
- assertOwnedUiModelInfo(event.model);
119
- if (typeof event.successful !== "boolean")
120
- throw new TypeError("owned-UI assistant response success state is invalid");
121
- assertOptionalText(event.stopReason, "owned-UI assistant response stop reason", MAX_LABEL_LENGTH);
122
- if (typeof event.toolContinuation !== "boolean")
123
- throw new TypeError("owned-UI assistant response tool-continuation state is invalid");
124
- return;
125
- case "agent-run-started":
126
- return;
127
- case "agent-run-settled":
128
- assertNonNegativeInteger(event.sessionGeneration, "owned-UI settlement session generation");
129
- assertNonNegativeInteger(event.runSequence, "owned-UI settlement run sequence");
130
- assertNonNegativeInteger(event.responseSequence, "owned-UI settlement response sequence");
131
- assertNonNegativeInteger(event.assistantMessageCount, "owned-UI settlement assistant message count");
132
- if (event.model !== null)
133
- assertOwnedUiModelInfo(event.model);
134
- if (typeof event.successful !== "boolean")
135
- throw new TypeError("owned-UI settlement success state is invalid");
136
- if (event.stopReason === undefined)
137
- throw new TypeError("owned-UI settlement stop reason is missing");
138
- assertOptionalText(event.stopReason, "owned-UI settlement stop reason", MAX_LABEL_LENGTH);
139
- if (typeof event.toolContinuation !== "boolean")
140
- throw new TypeError("owned-UI settlement tool-continuation state is invalid");
141
- if (typeof event.aborted !== "boolean")
142
- throw new TypeError("owned-UI settlement aborted state is invalid");
143
- return;
144
- case "editor-state":
145
- assertOwnedUiEditorState(event.editor);
146
- return;
147
- case "status":
148
- assertOwnedUiStatusView(event.status);
149
- return;
150
- case "dialog":
151
- if (event.dialog !== null)
152
- assertOwnedUiDialog(event.dialog);
153
- return;
154
- case "overlay":
155
- if (event.overlay !== null)
156
- assertOwnedUiOverlay(event.overlay);
157
- return;
158
- case "command-outcome":
159
- assertId(event.correlationId, "owned-UI outcome correlation id");
160
- assertEnum(event.outcome, OUTCOMES, "owned-UI command outcome");
161
- assertOptionalText(event.diagnostic, "owned-UI command diagnostic", MAX_MESSAGE_LENGTH);
162
- return;
163
- case "customization":
164
- assertCollection(event.customizations, "owned-UI customizations", MAX_CUSTOMIZATIONS);
165
- assertUniqueCustomizations(event.customizations);
166
- for (const customization of event.customizations)
167
- assertOwnedUiCustomization(customization);
168
- return;
169
- case "terminal-surface":
170
- assertOwnedUiTerminalSurface(event.surface);
171
- return;
172
- case "diagnostic":
173
- assertOwnedUiDiagnostics(event.diagnostic);
174
- return;
175
- default:
176
- throw new TypeError("owned-UI event type is unknown");
177
- }
178
- }
179
- export function assertOwnedUiPromptSuggestionIdentity(identity) {
96
+ function assertOwnedUiPromptSuggestionIdentity(identity) {
180
97
  assertId(identity.sessionId, "prompt-suggestion session id");
181
98
  assertNonNegativeInteger(identity.sessionGeneration, "prompt-suggestion session generation");
182
99
  assertNonNegativeInteger(identity.runSequence, "prompt-suggestion run sequence");
@@ -202,20 +119,7 @@ export function assertOwnedUiPromptSuggestionResult(result) {
202
119
  throw new TypeError("prompt-suggestion outcome is invalid");
203
120
  }
204
121
  }
205
- export function assertOwnedUiPromptSuggestionState(state) {
206
- if (state.status === "idle")
207
- return;
208
- if (state.status !== "generating" && state.status !== "prepared" && state.status !== "available") {
209
- throw new TypeError("prompt-suggestion state is invalid");
210
- }
211
- assertOwnedUiPromptSuggestionIdentity(state.identity);
212
- if (state.status === "generating" && typeof state.settled !== "boolean") {
213
- throw new TypeError("prompt-suggestion settlement state is invalid");
214
- }
215
- if (state.status === "prepared" || state.status === "available")
216
- assertPromptSuggestionText(state.text, false);
217
- }
218
- export function assertOwnedUiSessionViewModel(view) {
122
+ function assertOwnedUiSessionViewModel(view) {
219
123
  if (view.contractVersion !== OWNED_UI_CONTRACT_VERSION) {
220
124
  throw new TypeError("unsupported owned-UI contract version");
221
125
  }
@@ -270,7 +174,7 @@ export function assertOwnedUiSnapshot(snapshot) {
270
174
  assertViewSession(snapshot.view, snapshot.sessionId);
271
175
  assertJsonBytes(snapshot, "owned-UI snapshot", MAX_SESSION_VIEW_BYTES);
272
176
  }
273
- export function assertOwnedUiCustomization(customization) {
177
+ function assertOwnedUiCustomization(customization) {
274
178
  assertId(customization.id, "owned-UI customization id");
275
179
  assertEnum(customization.slot, SLOT_IDS, "owned-UI customization slot");
276
180
  assertIntegerInRange(customization.version, 1, Number.MAX_SAFE_INTEGER, "owned-UI customization version");
@@ -278,7 +182,7 @@ export function assertOwnedUiCustomization(customization) {
278
182
  assertBoundedText(customization.label, "owned-UI customization label", MAX_LABEL_LENGTH);
279
183
  assertJsonObject(customization.payload, "owned-UI customization payload", MAX_PAYLOAD_BYTES);
280
184
  }
281
- export function assertOwnedUiTranscriptBlock(block) {
185
+ function assertOwnedUiTranscriptBlock(block) {
282
186
  assertId(block.id, "owned-UI transcript block id");
283
187
  assertEnum(block.kind, BLOCK_KINDS, "owned-UI transcript block kind");
284
188
  assertEnum(block.status, BLOCK_STATUSES, "owned-UI transcript block status");
@@ -337,7 +241,7 @@ export function assertOwnedUiTranscriptBlock(block) {
337
241
  }
338
242
  }
339
243
  }
340
- export function assertOwnedUiEditorState(editor) {
244
+ function assertOwnedUiEditorState(editor) {
341
245
  assertPossiblyEmptyText(editor.text, "owned-UI editor text", MAX_TEXT_BYTES);
342
246
  assertCollection(editor.queuedSubmissions, "owned-UI queued submissions", MAX_QUEUE);
343
247
  let queuedBytes = 0;
@@ -356,7 +260,7 @@ export function assertOwnedUiEditorState(editor) {
356
260
  assertIntegerInRange(editor.selection.end, editor.selection.start, editor.text.length, "owned-UI selection end");
357
261
  }
358
262
  }
359
- export function assertOwnedUiStatusView(status) {
263
+ function assertOwnedUiStatusView(status) {
360
264
  assertBoundedText(status.title, "owned-UI status title", MAX_LABEL_LENGTH);
361
265
  assertOptionalText(status.workingMessage, "owned-UI working message", MAX_MESSAGE_LENGTH);
362
266
  if (status.workingProgress !== undefined && status.workingProgress !== null) {
@@ -427,14 +331,14 @@ export function assertOwnedUiStatusView(status) {
427
331
  }
428
332
  }
429
333
  }
430
- export function assertOwnedUiTerminalSurface(surface) {
334
+ function assertOwnedUiTerminalSurface(surface) {
431
335
  assertIntegerInRange(surface.columns, 20, 500, "owned-UI terminal columns");
432
336
  assertIntegerInRange(surface.rows, 8, 300, "owned-UI terminal rows");
433
337
  assertEnum(surface.focusedRegion, FOCUSED_REGIONS, "owned-UI focused region");
434
338
  if (typeof surface.hardwareCursor !== "boolean")
435
339
  throw new TypeError("owned-UI hardware-cursor state is invalid");
436
340
  }
437
- export function assertOwnedUiDiagnostics(diagnostic) {
341
+ function assertOwnedUiDiagnostics(diagnostic) {
438
342
  assertNonNegativeInteger(diagnostic.sequence, "owned-UI diagnostic sequence");
439
343
  assertId(diagnostic.code, "owned-UI diagnostic code");
440
344
  assertEnum(diagnostic.severity, SEVERITIES, "owned-UI diagnostic severity");
@@ -0,0 +1,17 @@
1
+ export interface PresentationComponentPort {
2
+ render(width: number): readonly string[];
3
+ invalidate(): void;
4
+ handleInput?(data: string): void;
5
+ setFocused?(focused: boolean): void;
6
+ dispose?(): void;
7
+ }
8
+ /** A painted input surface in terminal coordinates (one-based, inclusive bounds). */
9
+ export interface PresentationPointerSurface {
10
+ readonly component: PresentationComponentPort;
11
+ readonly columnStart: number;
12
+ readonly columnEnd: number;
13
+ readonly rowStart: number;
14
+ readonly rowEnd: number;
15
+ }
16
+ /** Compares only geometry and ownership, never animation content or transcript position. */
17
+ export declare function samePointerSurfaces(a: readonly PresentationPointerSurface[], b: readonly PresentationPointerSurface[]): boolean;
@@ -0,0 +1,8 @@
1
+ /** Compares only geometry and ownership, never animation content or transcript position. */
2
+ export function samePointerSurfaces(a, b) {
3
+ return a.length === b.length && a.every((surface, index) => {
4
+ const other = b[index];
5
+ return surface.component === other.component && surface.columnStart === other.columnStart
6
+ && surface.columnEnd === other.columnEnd && surface.rowStart === other.rowStart && surface.rowEnd === other.rowEnd;
7
+ });
8
+ }
@@ -1,3 +1,9 @@
1
+ import type { PresentationComponentPort } from "./component.js";
2
+ export type { PresentationComponentPort, PresentationPointerSurface } from "./component.js";
3
+ export { samePointerSurfaces } from "./component.js";
4
+ export type { CanvasBackgroundStyle, ShellPresentationPorts, ThemeSource, UiTheme, UiThemeBackground, UiThemeToken } from "./theme.js";
5
+ export type { TerminalComponentPort, TerminalDamageDecision, TerminalDamageDecisionReason, TerminalDamageFrameDescriptor, TerminalDamageFrameSafety, TerminalDamageOptions, TerminalDamagePort, TerminalHyperlinkInspection, TerminalInputCoordinationDecision, TerminalInputCoordinationScheduler, TerminalInputDiagnosticsEvent, TerminalInputDiagnosticsPhase, TerminalInputListener, TerminalInputListenerResult, TerminalInputSurfaceKind, TerminalLayoutEntry, TerminalLayoutNode, TerminalOverlayAnchor, TerminalOverlayHandle, TerminalOverlayMargin, TerminalOverlayOptions, TerminalOverlayUnfocusOptions, TerminalPointerSurface, TerminalPort, TerminalPreInputListener, TerminalProgramStatus, TerminalRuntimeFactory, TerminalRuntimeOptions, TerminalRuntimePort, TerminalRuntimeState, TerminalSizeValue, TerminalStopOptions, TerminalViewport, TerminalWheelScrollLines, } from "./terminal.js";
6
+ export { SHARED_PROGRESS_ACCENT_ANSI, SHARED_PROGRESS_PALETTE } from "./progress-palette.generated.js";
1
7
  export type PresentationRuntimeState = "idle" | "running" | "stopping" | "stopped" | "failed";
2
8
  export interface SemanticShortcutHint {
3
9
  readonly key?: string;
@@ -33,21 +39,6 @@ export interface ShortcutHintRoles {
33
39
  export declare function displayShortcutKeyLabel(label: string): string;
34
40
  /** Renders the canonical semantic shortcut row independently of either presentation framework. */
35
41
  export declare function renderSemanticShortcutHints(entries: readonly SemanticShortcutHint[], roles: ShortcutHintRoles, indent?: number, separator?: string): string;
36
- export interface PresentationComponentPort {
37
- render(width: number): readonly string[];
38
- invalidate(): void;
39
- handleInput?(data: string): void;
40
- setFocused?(focused: boolean): void;
41
- dispose?(): void;
42
- }
43
- /** A painted input surface in terminal coordinates (one-based, inclusive bounds). */
44
- export interface PresentationPointerSurface {
45
- readonly component: PresentationComponentPort;
46
- readonly columnStart: number;
47
- readonly columnEnd: number;
48
- readonly rowStart: number;
49
- readonly rowEnd: number;
50
- }
51
42
  export interface PresentationEditorPort extends PresentationComponentPort {
52
43
  getText(): string;
53
44
  setText(text: string): void;
@@ -1,3 +1,5 @@
1
+ export { samePointerSurfaces } from "./component.js";
2
+ export { SHARED_PROGRESS_ACCENT_ANSI, SHARED_PROGRESS_PALETTE } from "./progress-palette.generated.js";
1
3
  /** Canonical dismissal guidance for every A1-rendered dialog surface. */
2
4
  export const DIALOG_CLOSE_SHORTCUT_HINT = Object.freeze({ key: "esc", action: "close" });
3
5
  /** Canonical return guidance for a nested step within a dialog surface. */
@@ -0,0 +1,284 @@
1
+ import type { PresentationComponentPort, PresentationPointerSurface } from "./component.js";
2
+ /** A program-status report for terminals that show one (OSC 9;4 style); `clear` removes it. */
3
+ export interface TerminalProgramStatus {
4
+ state: "idle" | "working" | "blocked" | "done" | "error" | "clear";
5
+ app?: string;
6
+ kind?: "permission" | "question" | "auth";
7
+ }
8
+ /** Lines one wheel notch scrolls, or `auto` to follow wheel velocity. */
9
+ export type TerminalWheelScrollLines = number | "auto";
10
+ /** Whether queued input may be applied immediately or must wait for the current presentation. */
11
+ export type TerminalInputCoordinationDecision = "safe" | "barrier";
12
+ /** What kind of surface owns the keyboard when input arrives. */
13
+ export type TerminalInputSurfaceKind = "editor" | "owned" | "opaque";
14
+ export interface TerminalInputCoordinationScheduler {
15
+ scheduleImmediate(callback: () => void): ReturnType<typeof setImmediate>;
16
+ cancelImmediate(handle: ReturnType<typeof setImmediate>): void;
17
+ }
18
+ export type TerminalRuntimeState = "idle" | "running" | "stopping" | "stopped" | "failed";
19
+ export interface TerminalViewport {
20
+ readonly columns: number;
21
+ readonly rows: number;
22
+ }
23
+ export type TerminalPointerSurface = PresentationPointerSurface;
24
+ export interface TerminalComponentPort extends PresentationComponentPort {
25
+ readonly wantsKeyRelease?: boolean;
26
+ }
27
+ export interface TerminalPort {
28
+ start(onInput: (data: string) => void, onResize: () => void): void;
29
+ stop(): void;
30
+ drainInput(maxMs?: number, idleMs?: number): Promise<void>;
31
+ write(data: string): void;
32
+ readonly columns: number;
33
+ readonly rows: number;
34
+ readonly kittyProtocolActive: boolean;
35
+ moveBy(lines: number): void;
36
+ hideCursor(): void;
37
+ showCursor(): void;
38
+ clearLine(): void;
39
+ clearFromCursor(): void;
40
+ clearScreen(): void;
41
+ setTitle(title: string): void;
42
+ setProgress(active: boolean): void;
43
+ /** Optional for neutral test/decorator ports; the vendor adapter always supplies it. */
44
+ setProgramStatus?(status: TerminalProgramStatus): void;
45
+ /**
46
+ * Optional synchronous last-resort mode restore that the runtime invokes from a process `exit` handler when
47
+ * `stop()` did not run; the runtime adapter binds it to the undecorated terminal, so decorators need not forward it.
48
+ */
49
+ restoreOnExit?(before: string, after: string): void;
50
+ }
51
+ export type TerminalSizeValue = number | `${number}%`;
52
+ export type TerminalOverlayAnchor = "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center" | "left-center" | "right-center";
53
+ export interface TerminalOverlayMargin {
54
+ readonly top?: number;
55
+ readonly right?: number;
56
+ readonly bottom?: number;
57
+ readonly left?: number;
58
+ }
59
+ export interface TerminalOverlayOptions {
60
+ readonly width?: TerminalSizeValue;
61
+ readonly minWidth?: number;
62
+ readonly maxHeight?: TerminalSizeValue;
63
+ readonly anchor?: TerminalOverlayAnchor;
64
+ readonly offsetX?: number;
65
+ readonly offsetY?: number;
66
+ readonly row?: TerminalSizeValue;
67
+ readonly col?: TerminalSizeValue;
68
+ readonly margin?: TerminalOverlayMargin | number;
69
+ readonly visible?: (columns: number, rows: number) => boolean;
70
+ readonly nonCapturing?: boolean;
71
+ /** A1-owned input scheduling declaration; omitted extension overlays fail closed. */
72
+ readonly inputCoordination?: Exclude<TerminalInputSurfaceKind, "editor">;
73
+ }
74
+ export interface TerminalOverlayUnfocusOptions {
75
+ readonly target: TerminalComponentPort | null;
76
+ }
77
+ export interface TerminalOverlayHandle {
78
+ hide(): void;
79
+ setHidden(hidden: boolean): void;
80
+ isHidden(): boolean;
81
+ focus(): void;
82
+ unfocus(options?: TerminalOverlayUnfocusOptions): void;
83
+ isFocused(): boolean;
84
+ /** The most recently rendered terminal-relative rectangle of a visible overlay. */
85
+ getBounds(): {
86
+ readonly row: number;
87
+ readonly col: number;
88
+ readonly width: number;
89
+ readonly height: number;
90
+ } | undefined;
91
+ }
92
+ export interface TerminalInputListenerResult {
93
+ readonly consume?: boolean;
94
+ readonly data?: string;
95
+ }
96
+ export type TerminalInputListener = (data: string) => TerminalInputListenerResult | undefined;
97
+ /** Runs at the terminal bridge before the runtime receives physical input. */
98
+ export type TerminalPreInputListener = TerminalInputListener;
99
+ export interface TerminalLayoutEntry {
100
+ readonly node: TerminalLayoutNode;
101
+ readonly basis?: number | "auto";
102
+ readonly grow?: number;
103
+ readonly shrink?: number;
104
+ readonly minSize?: number;
105
+ readonly maxSize?: number;
106
+ readonly visible?: (viewport: TerminalViewport) => boolean;
107
+ }
108
+ export type TerminalLayoutNode = {
109
+ readonly type: "component";
110
+ readonly component: TerminalComponentPort;
111
+ } | {
112
+ readonly type: "stack";
113
+ readonly direction: "vertical" | "horizontal";
114
+ readonly children: readonly TerminalLayoutEntry[];
115
+ readonly gap?: number;
116
+ readonly align?: "stretch" | "start" | "center" | "end";
117
+ } | {
118
+ readonly type: "scroll";
119
+ readonly id: string;
120
+ readonly child: TerminalLayoutNode;
121
+ readonly follow?: "none" | "end";
122
+ readonly primary?: boolean;
123
+ readonly overscroll?: "chain" | "contain";
124
+ readonly scrollbar?: "hidden" | "auto" | "always";
125
+ /** Styles the scrollbar track; the pinned runtime draws it as foreground text. */
126
+ readonly scrollbarTrackStyle?: (text: string) => string;
127
+ /** Styles the scrollbar thumb; the pinned runtime draws it as foreground text. */
128
+ readonly scrollbarThumbStyle?: (text: string) => string;
129
+ readonly scrollbarHideDelayMs?: number;
130
+ };
131
+ export type TerminalInputDiagnosticsPhase = "receipt" | "semantic-start" | "semantic-end" | "composition-start" | "composition-end" | "write-start" | "write-end";
132
+ export interface TerminalInputDiagnosticsEvent {
133
+ readonly phase: TerminalInputDiagnosticsPhase;
134
+ readonly revision: number;
135
+ readonly atMs: number;
136
+ readonly pendingDepth: number;
137
+ readonly pendingPresentationDepth: 0 | 1;
138
+ readonly appliedRevision: number;
139
+ }
140
+ export interface TerminalRuntimeOptions {
141
+ readonly root: TerminalComponentPort;
142
+ /** Bare viewport only: painted overlays in back-to-front order; null while geometry is stale. */
143
+ readonly onOverlayGeometry?: (surfaces: readonly TerminalPointerSurface[] | null) => void;
144
+ readonly mode?: "regular" | "fullscreen";
145
+ readonly layoutRoot?: TerminalLayoutNode;
146
+ readonly terminal?: TerminalPort;
147
+ /** A1-owned public-boundary decorator; comparison paths omit it. */
148
+ readonly decorateTerminal?: (terminal: TerminalPort) => TerminalPort;
149
+ /** Bare-custom-viewport scheduling policy; comparison paths omit it. */
150
+ readonly inputCoordination?: {
151
+ readonly classify: (data: string, focusedOverlay?: Exclude<TerminalInputSurfaceKind, "editor">) => TerminalInputCoordinationDecision;
152
+ readonly onReceipt?: () => void;
153
+ readonly scheduler?: TerminalInputCoordinationScheduler;
154
+ };
155
+ /** Optional bounded evidence hook. Production composition omits it. */
156
+ readonly inputDiagnostics?: {
157
+ readonly onEvent: (event: TerminalInputDiagnosticsEvent) => void;
158
+ readonly now?: () => number;
159
+ };
160
+ readonly hardwareCursor?: boolean;
161
+ readonly mouse?: boolean;
162
+ /** Consume residual SGR mouse reports after every pre-input listener has run. */
163
+ readonly consumeUnhandledMouse?: boolean;
164
+ readonly wheelScrollLines?: TerminalWheelScrollLines;
165
+ readonly openUrl?: (url: string) => void;
166
+ readonly onRightClickPaste?: () => void;
167
+ readonly logDirectory?: string;
168
+ }
169
+ export interface TerminalStopOptions {
170
+ readonly preserveScreen?: boolean;
171
+ readonly drainInput?: boolean;
172
+ readonly drainMaxMs?: number;
173
+ readonly drainIdleMs?: number;
174
+ }
175
+ export interface TerminalDamageFrameDescriptor {
176
+ /**
177
+ * Frame ids are compared only within one presentation epoch; absent means the current epoch. A
178
+ * presenter switch starts a new epoch, because each presenter numbers its own frames.
179
+ */
180
+ readonly epoch?: number;
181
+ readonly frameId: number;
182
+ readonly width: number;
183
+ readonly height: number;
184
+ readonly transcript: {
185
+ readonly rowStart: number;
186
+ readonly rowEnd: number;
187
+ } | null;
188
+ readonly dock: {
189
+ readonly rowStart: number;
190
+ readonly rowEnd: number;
191
+ } | null;
192
+ /**
193
+ * Visible rows owned by the block that is currently streaming. A live block repaints
194
+ * every row it owns when it reflows, so the allowed damage follows the declared tail
195
+ * instead of assuming a one-row tail.
196
+ */
197
+ readonly liveTailRows?: number;
198
+ readonly verticalShiftRows: number;
199
+ readonly safeVerticalShift: boolean;
200
+ readonly cause: string;
201
+ }
202
+ export interface TerminalDamageFrameSafety {
203
+ readonly overlayActive: boolean;
204
+ readonly selectionActive: boolean;
205
+ readonly replacementSurfaceActive: boolean;
206
+ }
207
+ export type TerminalDamageDecisionReason = "transformed" | "suppressed-redundant-clear" | "hyperlink-cleanup" | "pending-hyperlink-cleanup" | "not-armed" | "unsafe-frame" | "stale-frame" | "unsupported-region-scroll" | "geometry-mismatch" | "grammar-mismatch" | "unsafe-terminal-content" | "incomplete-prior-frame" | "excessive-real-damage";
208
+ export interface TerminalDamageDecision {
209
+ readonly frameId: number | null;
210
+ readonly transformed: boolean;
211
+ readonly reason: TerminalDamageDecisionReason;
212
+ readonly shiftRows: number;
213
+ readonly paintedRows: readonly number[];
214
+ }
215
+ /** What the shell's hyperlink analysis reports for one visible row. */
216
+ export interface TerminalHyperlinkInspection {
217
+ readonly ranges: readonly unknown[];
218
+ readonly hasExplicitLink: boolean;
219
+ readonly signature: string;
220
+ readonly replaySafe: boolean;
221
+ readonly width: number;
222
+ }
223
+ export interface TerminalDamageOptions {
224
+ readonly regionalScroll: boolean;
225
+ /** The shell supplies visible-row analysis; the terminal layer owns no UI parser. */
226
+ readonly inspectHyperlinks: (content: string) => TerminalHyperlinkInspection;
227
+ readonly onResize?: () => void;
228
+ readonly onHyperlinkCleanupRequired?: () => void;
229
+ }
230
+ /** A terminal decorator that repaints only the rows a frame declares changed. */
231
+ export interface TerminalDamagePort extends TerminalPort {
232
+ readonly lastDecision: TerminalDamageDecision;
233
+ readonly canvasBackgroundAnsi: string | null;
234
+ readonly presentationEpoch: number;
235
+ invalidatePresentation(): void;
236
+ /** Returns true when the background changed and a full repaint is needed. */
237
+ setCanvasBackground(ansi: string | null): boolean;
238
+ presentedRows(): readonly string[];
239
+ requestHyperlinkCleanup(rows?: readonly number[]): void;
240
+ arm(descriptor: TerminalDamageFrameDescriptor, safety: TerminalDamageFrameSafety): void;
241
+ }
242
+ /** The terminal runtime the shell drives: one root, overlays, input listeners, and modes. */
243
+ export interface TerminalRuntimePort {
244
+ readonly state: TerminalRuntimeState;
245
+ readonly active: boolean;
246
+ readonly mode: "regular" | "fullscreen";
247
+ /** Full repaints since start, for rendering evidence. */
248
+ readonly fullRedraws: number;
249
+ readonly presentationHeld: boolean;
250
+ viewport(): TerminalViewport;
251
+ start(): void;
252
+ showOverlay(component: TerminalComponentPort, options?: TerminalOverlayOptions): TerminalOverlayHandle;
253
+ hasOverlay(): boolean;
254
+ hasFocusedOverlay(): boolean;
255
+ writeControl(data: string): void;
256
+ freezePresentation(): void;
257
+ beginPresentationHold(): () => void;
258
+ addPreInputListener(listener: TerminalPreInputListener): () => void;
259
+ addInputListener(listener: TerminalInputListener): () => void;
260
+ switchMode(mode: "regular" | "fullscreen"): boolean;
261
+ setHardwareCursor(enabled: boolean): void;
262
+ setClearOnShrink(enabled: boolean): void;
263
+ setWheelScrollLines(lines: TerminalWheelScrollLines): void;
264
+ setTerminalProgress(active: boolean): void;
265
+ setProgramStatus(status: TerminalProgramStatus): void;
266
+ setTitle(title: string): void;
267
+ writeAfterStop(text: string): void;
268
+ invalidate(): void;
269
+ requestRender(force?: boolean): void;
270
+ renderNow(force?: boolean): void;
271
+ stop(options?: TerminalStopOptions): Promise<void>;
272
+ dispose(options?: TerminalStopOptions): Promise<void>;
273
+ }
274
+ /** Builds the terminal runtime and its helpers; the vendor TUI adapter implements it. */
275
+ export interface TerminalRuntimeFactory {
276
+ createRuntime(options: TerminalRuntimeOptions): TerminalRuntimePort;
277
+ createDamageTerminal(terminal: TerminalPort, options: TerminalDamageOptions): TerminalDamagePort;
278
+ /** Whether input on a surface may be applied before the current presentation completes. */
279
+ classifyInput(data: string, surface: TerminalInputSurfaceKind): TerminalInputCoordinationDecision;
280
+ /** Decodes an enhanced-keyboard sequence to the legacy byte form, or "" for a key release. */
281
+ legacyKeyInput(data: string): string;
282
+ /** Rebases a painted row's default background onto the given background sequence. */
283
+ rebaseDefaultBackground(content: string, backgroundAnsi: string): string;
284
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ /** Foreground roles a vendor-neutral surface paints with. */
2
+ export type UiThemeToken = "accent" | "mdHeading" | "mdLink" | "text" | "muted" | "dim" | "border" | "error" | "success" | "scrollbarTrack" | "scrollbarThumb";
3
+ /** Background roles for a selected row and for a row whose work is still pending. */
4
+ export type UiThemeBackground = "selectedBg" | "toolPendingBg";
5
+ export interface UiTheme {
6
+ fg(token: UiThemeToken, text: string): string;
7
+ bold(text: string): string;
8
+ /**
9
+ * The terminal's own foreground, left unpainted. What a list's own text is:
10
+ * a theme built for a light background would otherwise write near-black rows
11
+ * into a dark terminal, which is how the engine leaves its lists too.
12
+ */
13
+ plain(text: string): string;
14
+ /** Optional palette preview used by controls that choose the active accent. */
15
+ accentPreview?(color: string, text: string): string | null;
16
+ /** Selection background for an active list item or floating-surface row. */
17
+ highlight(text: string): string;
18
+ /** A control that is present but cannot act: quieter than quiet text. */
19
+ disabled(text: string): string;
20
+ /** Background for a floating surface, so it reads as above the content. */
21
+ panel(text: string): string;
22
+ /** Paints a declared background role behind already painted text. */
23
+ background(token: UiThemeBackground, text: string): string;
24
+ }
25
+ /**
26
+ * The active theme and its change notifications. The vendor adapter supplies it, so a surface paints
27
+ * from the live theme without importing the vendor's theme module.
28
+ */
29
+ export interface ThemeSource {
30
+ /** The live theme; its painters read the current palette on every call. */
31
+ current(): UiTheme;
32
+ /** Calls `listener` after the active theme changes; returns the unsubscribe function. */
33
+ onChange(listener: () => void): () => void;
34
+ }
35
+ import type { TerminalRuntimeFactory } from "./terminal.js";
36
+ /** How the full-screen canvas behind the session is painted. */
37
+ export type CanvasBackgroundStyle = "transparent" | "accent" | "dark";
38
+ /** What the application shell receives from the vendor presentation adapter. */
39
+ export interface ShellPresentationPorts {
40
+ readonly theme: ThemeSource;
41
+ /** The terminal background sequence for a canvas style in the active theme, or null to leave the terminal's own. */
42
+ canvasBackground(style: CanvasBackgroundStyle): string | null;
43
+ /** Columns the pinned comparison layout pads command output with. */
44
+ readonly pinnedOutputPad: 0 | 1;
45
+ readonly terminalRuntime: TerminalRuntimeFactory;
46
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -19,7 +19,7 @@ export function resolveDevelopmentLaunchEnvironment(canonicalPackageRoot, releas
19
19
  ? join(developmentRoot, "config")
20
20
  : join(checkoutRoot, "config");
21
21
  const dataDir = resolve(source[PRODUCT_IDENTITY.environment.dataDir] ?? join(developmentRoot, "data"));
22
- // Rationale: solo processes keep isolated control state but must see the same history
22
+ // Rationale: development processes keep isolated control state but must see the same history
23
23
  // after selecting Shared; use a checkout-wide root across rebuilds unless overridden.
24
24
  const historyDataDir = resolve(source[PRODUCT_IDENTITY.environment.developmentHistoryDataDir]
25
25
  ?? source[PRODUCT_IDENTITY.environment.dataDir]
@@ -7,10 +7,10 @@ export type OwnedUiProfileId = LaunchProfileId;
7
7
  export interface InteractiveRuntimeSelection {
8
8
  readonly kind: "owned-ui";
9
9
  readonly profileId: OwnedUiProfileId;
10
- readonly ownedSurfaces: "on" | "off";
10
+ readonly productMode: "bare" | "comparison";
11
11
  }
12
12
  export interface InteractiveRuntimeRunners {
13
- readonly ownedUi: (profileId: OwnedUiProfileId, ownedSurfaces: "on" | "off") => Promise<number>;
13
+ readonly ownedUi: (profileId: OwnedUiProfileId, productMode: "bare" | "comparison") => Promise<number>;
14
14
  }
15
15
  export declare function selectInteractiveRuntime(profileId: string): InteractiveRuntimeSelection;
16
16
  export declare function runSelectedInteractiveRuntime(profileId: string, runners: InteractiveRuntimeRunners): Promise<number>;
@@ -4,10 +4,10 @@ export function selectInteractiveRuntime(profileId) {
4
4
  return Object.freeze({
5
5
  kind: "owned-ui",
6
6
  profileId,
7
- ownedSurfaces: profileId === "a1" ? "on" : "off",
7
+ productMode: profileId === "a1" ? "bare" : "comparison",
8
8
  });
9
9
  }
10
10
  export async function runSelectedInteractiveRuntime(profileId, runners) {
11
11
  const selection = selectInteractiveRuntime(profileId);
12
- return await runners.ownedUi(selection.profileId, selection.ownedSurfaces);
12
+ return await runners.ownedUi(selection.profileId, selection.productMode);
13
13
  }
@@ -1,5 +1,5 @@
1
1
  import type { Readable, Writable } from "node:stream";
2
- export type OwnedProjectTrustChoiceId = "trust" | "trust-parent" | "trust-session" | "deny" | "deny-session";
2
+ type OwnedProjectTrustChoiceId = "trust" | "trust-parent" | "trust-session" | "deny" | "deny-session";
3
3
  export interface OwnedProjectTrustPromptRequest {
4
4
  readonly cwd: string;
5
5
  readonly defaultDecision: "ask" | "always" | "never";
@@ -21,7 +21,7 @@ export interface ConsoleProjectTrustPromptOptions {
21
21
  readonly columns?: number;
22
22
  readonly rows?: number;
23
23
  };
24
- readonly presentation?: "bare" | "comparison";
24
+ readonly productMode?: "bare" | "comparison";
25
25
  readonly environment?: NodeJS.ProcessEnv;
26
26
  }
27
27
  /** Fixed pre-resource selector; no project resource is available. */
@@ -34,7 +34,7 @@ export function createConsoleProjectTrustPrompt(options = {}) {
34
34
  }
35
35
  if (choices.length === 0)
36
36
  throw new Error("project trust choices are unavailable");
37
- const comparison = options.presentation === "comparison";
37
+ const comparison = options.productMode === "comparison";
38
38
  const renderBareDialog = comparison ? undefined : (await import("./project-trust-dialog.js")).renderProjectTrustDialog;
39
39
  const palette = comparison ? null : trustPaletteOptions(options.environment ?? process.env);
40
40
  const wasRaw = input.isRaw === true;
@@ -3,7 +3,7 @@ export interface ReleaseNoteClaim {
3
3
  acknowledge(): Promise<void>;
4
4
  release(): Promise<void>;
5
5
  }
6
- export interface ReleaseNoteStateOptions {
6
+ interface ReleaseNoteStateOptions {
7
7
  readonly configDir: string;
8
8
  readonly profileId: string;
9
9
  readonly version: string;
@@ -11,3 +11,4 @@ export interface ReleaseNoteStateOptions {
11
11
  }
12
12
  /** Claims one stable note across concurrent sessions and acknowledges it only after presentation closes. */
13
13
  export declare function claimReleaseNote(options: ReleaseNoteStateOptions): Promise<ReleaseNoteClaim | null>;
14
+ export {};