@timurproko/a1 0.1.8-dev.3b54f21 → 0.1.8-dev.407

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 (643) hide show
  1. package/README.md +159 -65
  2. package/bin/cli.js +28 -10
  3. package/bin/guardian.js +12 -6
  4. package/bin/module-identity.js +69 -35
  5. package/bin/pi-tui.d.ts +6 -0
  6. package/bin/pi-tui.js +28 -0
  7. package/bin/release-cleanup.js +8 -0
  8. package/bin/supervisor.js +2 -2
  9. package/bin/sync-pi-tui-proxy.js +97 -0
  10. package/bin/ui.js +62 -21
  11. package/bin/update-recovery.js +274 -0
  12. package/bin/warmup.js +27 -0
  13. package/dist/cli/capabilities.d.ts +6 -0
  14. package/dist/{src/cli → cli}/capabilities.js +1 -1
  15. package/dist/{src/cli → cli}/dispatch.d.ts +15 -1
  16. package/dist/cli/dispatch.js +261 -0
  17. package/dist/cli/package-messages.d.ts +26 -0
  18. package/dist/cli/package-messages.js +71 -0
  19. package/dist/{src/cli → cli}/packages.d.ts +11 -2
  20. package/dist/{src/cli → cli}/packages.js +24 -27
  21. package/dist/{src/cli → cli}/version-stats.d.ts +6 -0
  22. package/dist/cli/version-stats.js +112 -0
  23. package/dist/composition/agent-engine-bridge.d.ts +3 -0
  24. package/dist/composition/agent-engine-bridge.js +108 -0
  25. package/dist/composition/index.d.ts +3 -0
  26. package/dist/composition/index.js +3 -0
  27. package/dist/composition/owned-ui.d.ts +35 -0
  28. package/dist/composition/owned-ui.js +118 -0
  29. package/dist/composition/process.d.ts +16 -0
  30. package/dist/composition/process.js +45 -0
  31. package/dist/composition/settings-route-host.d.ts +8 -0
  32. package/dist/composition/settings-route-host.js +75 -0
  33. package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.d.ts +2 -2
  34. package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.js +22 -4
  35. package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.d.ts +17 -0
  36. package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.d.ts +6 -0
  37. package/dist/contracts/owned-ui/image-attachments.d.ts +36 -0
  38. package/dist/contracts/owned-ui/image-attachments.js +67 -0
  39. package/dist/contracts/owned-ui/index.d.ts +8 -0
  40. package/dist/contracts/owned-ui/index.js +8 -0
  41. package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.d.ts +123 -0
  42. package/dist/contracts/owned-ui/prompt-history.d.ts +55 -0
  43. package/dist/contracts/owned-ui/prompt-history.js +23 -0
  44. package/dist/contracts/owned-ui/prompt-suggestions.d.ts +3 -0
  45. package/dist/contracts/owned-ui/prompt-suggestions.js +44 -0
  46. package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +22 -0
  47. package/dist/contracts/owned-ui/suggestion-diagnostics.js +9 -0
  48. package/dist/contracts/owned-ui/transcript-lifecycle.d.ts +5 -0
  49. package/dist/contracts/owned-ui/transcript-lifecycle.js +33 -0
  50. package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.d.ts +5 -1
  51. package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.js +129 -4
  52. package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.d.ts +8 -0
  53. package/dist/{src/features → features}/launch/development-launch.js +11 -3
  54. package/dist/{src/features → features}/launch/index.d.ts +0 -1
  55. package/dist/{src/features → features}/launch/index.js +0 -1
  56. package/dist/features/launch/intent.d.ts +10 -0
  57. package/dist/features/launch/intent.js +8 -0
  58. package/dist/{src/features → features}/launch/prepare-launch.d.ts +0 -2
  59. package/dist/{src/features → features}/launch/prepare-launch.js +2 -9
  60. package/dist/{src/features → features}/launch/profile-paths.d.ts +3 -2
  61. package/dist/{src/features → features}/launch/profile-paths.js +13 -8
  62. package/dist/{src/features → features}/launch/runtime-selection.d.ts +2 -5
  63. package/dist/{src/features → features}/owned-ui/customization.d.ts +3 -1
  64. package/dist/{src/features → features}/owned-ui/customization.js +3 -1
  65. package/dist/{src/features → features}/owned-ui/diagnostics.d.ts +2 -1
  66. package/dist/{src/features → features}/owned-ui/diagnostics.js +1 -0
  67. package/dist/{src/features → features}/owned-ui/index.d.ts +2 -0
  68. package/dist/{src/features → features}/owned-ui/index.js +2 -0
  69. package/dist/features/owned-ui/project-trust-prompt.d.ts +25 -0
  70. package/dist/features/owned-ui/project-trust-prompt.js +149 -0
  71. package/dist/{src/features → features}/owned-ui/run.d.ts +2 -2
  72. package/dist/features/owned-ui/run.js +32 -0
  73. package/dist/features/owned-ui/session-fork-prompt.d.ts +8 -0
  74. package/dist/features/owned-ui/session-fork-prompt.js +34 -0
  75. package/dist/{src/features → features}/owned-ui/settings-app.d.ts +3 -3
  76. package/dist/{src/features → features}/owned-ui/settings-app.js +105 -56
  77. package/dist/features/prompt-history/image-sidecar.d.ts +32 -0
  78. package/dist/features/prompt-history/image-sidecar.js +130 -0
  79. package/dist/features/prompt-history/index.d.ts +4 -0
  80. package/dist/features/prompt-history/index.js +3 -0
  81. package/dist/features/prompt-history/paths.d.ts +5 -0
  82. package/dist/features/prompt-history/paths.js +17 -0
  83. package/dist/features/prompt-history/service.d.ts +54 -0
  84. package/dist/features/prompt-history/service.js +425 -0
  85. package/dist/features/prompt-history/store.d.ts +16 -0
  86. package/dist/features/prompt-history/store.js +223 -0
  87. package/dist/features/prompt-history/worker.d.ts +9 -0
  88. package/dist/features/prompt-history/worker.js +45 -0
  89. package/dist/features/prompt-suggestions/diagnostics.d.ts +18 -0
  90. package/dist/features/prompt-suggestions/diagnostics.js +82 -0
  91. package/dist/features/prompt-suggestions/index.d.ts +1 -0
  92. package/dist/features/prompt-suggestions/index.js +1 -0
  93. package/dist/{src/features → features}/workspace/capabilities.d.ts +1 -1
  94. package/dist/{src/features → features}/workspace/reducer.d.ts +2 -1
  95. package/dist/{src/features → features}/workspace/reducer.js +2 -1
  96. package/dist/{src/features → features}/workspace/router.d.ts +2 -1
  97. package/dist/{src/features → features}/workspace/router.js +1 -0
  98. package/dist/{src/features → features}/workspace/store.d.ts +2 -1
  99. package/dist/{src/features → features}/workspace/store.js +1 -0
  100. package/dist/foundation/launch-context/index.d.ts +59 -0
  101. package/dist/foundation/launch-context/index.js +136 -0
  102. package/dist/{src/foundation → foundation}/launch-guardian/main.d.ts +2 -0
  103. package/dist/{src/foundation → foundation}/launch-guardian/main.js +23 -8
  104. package/dist/{src/foundation → foundation}/lifecycle/index.d.ts +2 -0
  105. package/dist/{src/foundation → foundation}/lifecycle/index.js +2 -0
  106. package/dist/{src/foundation → foundation}/lifecycle/model.d.ts +1 -1
  107. package/dist/{src/foundation → foundation}/lifecycle/model.js +1 -1
  108. package/dist/foundation/lifecycle/paths.d.ts +30 -0
  109. package/dist/{src/foundation → foundation}/lifecycle/paths.js +29 -1
  110. package/dist/foundation/lifecycle/session-selection.d.ts +9 -0
  111. package/dist/foundation/lifecycle/session-selection.js +39 -0
  112. package/dist/foundation/lifecycle/supervisor-startup.d.ts +30 -0
  113. package/dist/foundation/lifecycle/supervisor-startup.js +106 -0
  114. package/dist/{src/foundation → foundation}/native-host-protocol/codec.d.ts +2 -0
  115. package/dist/{src/foundation → foundation}/native-host-protocol/codec.js +2 -0
  116. package/dist/{src/foundation → foundation}/native-host-protocol/messages.d.ts +1 -1
  117. package/dist/{src/foundation → foundation}/native-host-protocol/messages.js +1 -1
  118. package/dist/foundation/process-containment/darwin-process-inspector.d.ts +5 -0
  119. package/dist/foundation/process-containment/darwin-process-inspector.js +7 -0
  120. package/dist/{src/foundation → foundation}/process-containment/index.d.ts +1 -0
  121. package/dist/{src/foundation → foundation}/process-containment/index.js +1 -0
  122. package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.d.ts +1 -0
  123. package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.js +1 -0
  124. package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.d.ts +1 -0
  125. package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.js +1 -0
  126. package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.d.ts +3 -1
  127. package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.js +5 -2
  128. package/dist/{src/foundation → foundation}/protocol/client.d.ts +1 -0
  129. package/dist/{src/foundation → foundation}/protocol/client.js +1 -0
  130. package/dist/{src/foundation → foundation}/protocol/messages.d.ts +1 -0
  131. package/dist/{src/foundation → foundation}/protocol/messages.js +1 -0
  132. package/dist/foundation/release/bootstrap.d.ts +55 -0
  133. package/dist/{src/foundation → foundation}/release/bootstrap.js +219 -46
  134. package/dist/foundation/release/cohort-state.d.ts +157 -0
  135. package/dist/foundation/release/cohort-state.js +472 -0
  136. package/dist/foundation/release/dependency-certification-retention.d.ts +7 -0
  137. package/dist/foundation/release/dependency-certification-retention.js +88 -0
  138. package/dist/foundation/release/dependency-certification.d.ts +24 -0
  139. package/dist/foundation/release/dependency-certification.js +266 -0
  140. package/dist/foundation/release/dependency-layer.d.ts +81 -0
  141. package/dist/foundation/release/dependency-layer.js +466 -0
  142. package/dist/foundation/release/endpoints.d.ts +20 -0
  143. package/dist/foundation/release/endpoints.js +50 -0
  144. package/dist/foundation/release/immutable-platform.d.ts +6 -0
  145. package/dist/foundation/release/immutable-platform.js +13 -0
  146. package/dist/{src/foundation → foundation}/release/index.d.ts +6 -0
  147. package/dist/{src/foundation → foundation}/release/index.js +6 -0
  148. package/dist/foundation/release/release-gc.d.ts +71 -0
  149. package/dist/foundation/release/release-gc.js +764 -0
  150. package/dist/{src/foundation → foundation}/release/release-store.d.ts +9 -3
  151. package/dist/{src/foundation → foundation}/release/release-store.js +74 -14
  152. package/dist/{src/foundation → foundation}/release/release.d.ts +6 -1
  153. package/dist/{src/foundation → foundation}/release/release.js +15 -4
  154. package/dist/foundation/release/restart-certification.d.ts +68 -0
  155. package/dist/foundation/release/restart-certification.js +227 -0
  156. package/dist/foundation/release/update-launch.d.ts +6 -0
  157. package/dist/foundation/release/update-launch.js +17 -0
  158. package/dist/foundation/release/update-recovery.d.ts +76 -0
  159. package/dist/foundation/release/update-recovery.js +356 -0
  160. package/dist/{src/foundation → foundation}/release/update-transaction.d.ts +11 -0
  161. package/dist/{src/foundation → foundation}/release/update-transaction.js +13 -1
  162. package/dist/{src/foundation → foundation}/release/update.d.ts +40 -4
  163. package/dist/{src/foundation → foundation}/release/update.js +196 -78
  164. package/dist/foundation/release/warmup.d.ts +3 -0
  165. package/dist/foundation/release/warmup.js +47 -0
  166. package/dist/foundation/startup/index.d.ts +1 -0
  167. package/dist/foundation/startup/index.js +1 -0
  168. package/dist/foundation/startup/startup-runtime.d.ts +36 -0
  169. package/dist/foundation/startup/startup-runtime.js +142 -0
  170. package/dist/{src/foundation → foundation}/storage/control-store.d.ts +2 -1
  171. package/dist/{src/foundation → foundation}/storage/control-store.js +39 -4
  172. package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.d.ts +2 -1
  173. package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.js +2 -1
  174. package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.d.ts +2 -1
  175. package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.js +2 -1
  176. package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.d.ts +1 -1
  177. package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.js +1 -1
  178. package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.d.ts +2 -1
  179. package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.js +2 -1
  180. package/dist/{src/foundation → foundation}/structured-agent-runtime/state.d.ts +2 -1
  181. package/dist/{src/foundation → foundation}/structured-agent-runtime/state.js +2 -1
  182. package/dist/foundation/supervision/index.d.ts +3 -0
  183. package/dist/foundation/supervision/index.js +3 -0
  184. package/dist/foundation/supervision/main.d.ts +1 -0
  185. package/dist/foundation/supervision/main.js +84 -0
  186. package/dist/foundation/supervision/paths.d.ts +1 -0
  187. package/dist/foundation/supervision/paths.js +1 -0
  188. package/dist/foundation/supervision/server.d.ts +51 -0
  189. package/dist/{src/foundation → foundation}/supervision/server.js +142 -20
  190. package/dist/foundation/terminal-cleanup/fatal-exit.d.ts +12 -0
  191. package/dist/foundation/terminal-cleanup/fatal-exit.js +85 -0
  192. package/dist/foundation/terminal-cleanup/index.d.ts +2 -0
  193. package/dist/foundation/terminal-cleanup/index.js +2 -0
  194. package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +4 -0
  195. package/dist/foundation/terminal-cleanup/terminal-reset.js +40 -0
  196. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.d.ts +1 -1
  197. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.d.ts +1 -0
  198. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.js +3 -2
  199. package/dist/integrations/pi/components/editor-interaction.d.ts +38 -0
  200. package/dist/integrations/pi/components/history-editor-loader.d.ts +5 -0
  201. package/dist/integrations/pi/components/history-editor-loader.js +5 -0
  202. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.d.ts +2 -1
  203. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.js +2 -1
  204. package/dist/integrations/pi/components/owned-editor-ux.d.ts +74 -0
  205. package/dist/integrations/pi/components/owned-editor-ux.js +1093 -0
  206. package/dist/integrations/pi/components/path-word-ranges.d.ts +2 -0
  207. package/dist/integrations/pi/components/path-word-ranges.js +37 -0
  208. package/dist/integrations/pi/components/prompt-input-port.d.ts +18 -0
  209. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.d.ts +1 -0
  210. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.js +1 -0
  211. package/dist/integrations/pi/components/shell-editor-autocomplete.js +297 -0
  212. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.d.ts +1 -1
  213. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.d.ts +4 -4
  214. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.js +58 -23
  215. package/dist/integrations/pi/components/shell-presenters-info.d.ts +43 -0
  216. package/dist/integrations/pi/components/shell-presenters-info.js +114 -0
  217. package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +29 -0
  218. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.js +174 -170
  219. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.d.ts +8 -4
  220. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.js +10 -6
  221. package/dist/integrations/pi/components/shell-shared-facade.d.ts +213 -0
  222. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.js +5 -2
  223. package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +15 -0
  224. package/dist/integrations/pi/components/submitted-prompt-adapter.js +43 -0
  225. package/dist/integrations/pi/components/tool-image-presentation.d.ts +21 -0
  226. package/dist/integrations/pi/components/tool-image-presentation.js +86 -0
  227. package/dist/integrations/pi/components/tool-result-adapter.d.ts +6 -0
  228. package/dist/integrations/pi/components/tool-result-adapter.js +27 -0
  229. package/dist/integrations/pi/components/transcript-image-resolver.d.ts +7 -0
  230. package/dist/integrations/pi/components/transcript-image-resolver.js +19 -0
  231. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.d.ts +11 -2
  232. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.js +41 -3
  233. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +12 -0
  234. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +42 -0
  235. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +40 -0
  236. package/dist/integrations/pi/components/upstream/components/owned-editor.js +166 -0
  237. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.d.ts +1 -1
  238. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.js +3 -1
  239. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.d.ts +3 -2
  240. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.js +12 -7
  241. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +61 -0
  242. package/dist/integrations/pi/components/upstream/components/tool-execution.js +344 -0
  243. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +280 -0
  244. package/dist/integrations/pi/components/upstream/history/editor-core.js +2062 -0
  245. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +32 -0
  246. package/dist/integrations/pi/components/upstream/history/kill-ring.js +48 -0
  247. package/dist/integrations/pi/components/upstream/history/printable-key.d.ts +1 -0
  248. package/dist/integrations/pi/components/upstream/history/printable-key.js +40 -0
  249. package/dist/integrations/pi/components/upstream/history/text-helpers.d.ts +14 -0
  250. package/dist/integrations/pi/components/upstream/history/text-helpers.js +28 -0
  251. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +22 -0
  252. package/dist/integrations/pi/components/upstream/history/undo-stack.js +36 -0
  253. package/dist/integrations/pi/components/upstream/history/word-navigation.d.ts +24 -0
  254. package/dist/integrations/pi/components/upstream/history/word-navigation.js +100 -0
  255. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.d.ts +74 -6
  256. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.js +1340 -228
  257. package/dist/integrations/pi/engine/changelog.d.ts +2 -0
  258. package/dist/integrations/pi/engine/changelog.js +63 -0
  259. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.d.ts +4 -2
  260. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.js +15 -5
  261. package/dist/integrations/pi/engine/http-dispatcher.d.ts +4 -0
  262. package/dist/integrations/pi/engine/http-dispatcher.js +25 -0
  263. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.d.ts +4 -0
  264. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.js +4 -0
  265. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.d.ts +2 -1
  266. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.js +1 -0
  267. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.d.ts +1 -1
  268. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.js +32 -26
  269. package/dist/integrations/pi/engine/pending-delivery.d.ts +30 -0
  270. package/dist/integrations/pi/engine/pending-delivery.js +158 -0
  271. package/dist/integrations/pi/engine/project-trust-preflight.d.ts +22 -0
  272. package/dist/integrations/pi/engine/project-trust-preflight.js +50 -0
  273. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.d.ts +2 -1
  274. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.js +1 -0
  275. package/dist/integrations/pi/engine/resources/changelog.json +12 -0
  276. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.d.ts +19 -1
  277. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.js +56 -5
  278. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.d.ts +4 -2
  279. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.js +19 -4
  280. package/dist/integrations/pi/engine/session-selection.d.ts +28 -0
  281. package/dist/integrations/pi/engine/session-selection.js +90 -0
  282. package/dist/integrations/pi/engine/settings-effects.d.ts +66 -0
  283. package/dist/integrations/pi/engine/settings-effects.js +249 -0
  284. package/dist/integrations/pi/engine/settings-integration.d.ts +43 -0
  285. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/settings-integration.js +102 -108
  286. package/dist/integrations/pi/engine/tool-rendering.d.ts +13 -0
  287. package/dist/integrations/pi/engine/tool-rendering.js +145 -0
  288. package/dist/integrations/pi/engine/transcript-image-assets.d.ts +11 -0
  289. package/dist/integrations/pi/engine/transcript-image-assets.js +86 -0
  290. package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +21 -0
  291. package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +55 -0
  292. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.d.ts +3 -2
  293. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.js +1 -0
  294. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.d.ts +19 -2
  295. package/dist/integrations/pi/session-ui/clipboard-diagnostics.d.ts +16 -0
  296. package/dist/integrations/pi/session-ui/clipboard-diagnostics.js +65 -0
  297. package/dist/integrations/pi/session-ui/clipboard-image.d.ts +11 -0
  298. package/dist/integrations/pi/session-ui/clipboard-image.js +38 -0
  299. package/dist/integrations/pi/session-ui/editor-hyperlink-budget.d.ts +9 -0
  300. package/dist/integrations/pi/session-ui/editor-hyperlink-budget.js +23 -0
  301. package/dist/integrations/pi/session-ui/image-preparation-client.d.ts +20 -0
  302. package/dist/integrations/pi/session-ui/image-preparation-client.js +145 -0
  303. package/dist/integrations/pi/session-ui/image-preparation.d.ts +18 -0
  304. package/dist/integrations/pi/session-ui/image-preparation.js +126 -0
  305. package/dist/integrations/pi/session-ui/image-source.d.ts +13 -0
  306. package/dist/integrations/pi/session-ui/image-source.js +171 -0
  307. package/dist/integrations/pi/session-ui/image-worker.d.ts +17 -0
  308. package/dist/integrations/pi/session-ui/image-worker.js +23 -0
  309. package/dist/integrations/pi/session-ui/index.d.ts +5 -0
  310. package/dist/integrations/pi/session-ui/index.js +5 -0
  311. package/dist/integrations/pi/session-ui/paste-executor.d.ts +10 -0
  312. package/dist/integrations/pi/session-ui/paste-executor.js +232 -0
  313. package/dist/integrations/pi/session-ui/paste-helper.d.ts +1 -0
  314. package/dist/integrations/pi/session-ui/paste-helper.js +173 -0
  315. package/dist/integrations/pi/session-ui/paste-preparation-client.d.ts +16 -0
  316. package/dist/integrations/pi/session-ui/paste-preparation-client.js +159 -0
  317. package/dist/integrations/pi/session-ui/paste-protocol.d.ts +78 -0
  318. package/dist/integrations/pi/session-ui/paste-protocol.js +18 -0
  319. package/dist/integrations/pi/session-ui/paste-text-preparation.d.ts +20 -0
  320. package/dist/integrations/pi/session-ui/paste-text-preparation.js +134 -0
  321. package/dist/integrations/pi/session-ui/paste-text-worker.d.ts +1 -0
  322. package/dist/integrations/pi/session-ui/paste-text-worker.js +12 -0
  323. package/dist/integrations/pi/session-ui/path-chip-presentation.d.ts +7 -0
  324. package/dist/integrations/pi/session-ui/path-chip-presentation.js +24 -0
  325. package/dist/integrations/pi/session-ui/prompt-chips.d.ts +72 -0
  326. package/dist/integrations/pi/session-ui/prompt-chips.js +503 -0
  327. package/dist/integrations/pi/session-ui/prompt-history-controller.d.ts +36 -0
  328. package/dist/integrations/pi/session-ui/prompt-history-controller.js +170 -0
  329. package/dist/integrations/pi/session-ui/prompt-suggestion-controller.d.ts +35 -0
  330. package/dist/integrations/pi/session-ui/prompt-suggestion-controller.js +207 -0
  331. package/dist/integrations/pi/session-ui/response-copy-coordinator.d.ts +27 -0
  332. package/dist/integrations/pi/session-ui/response-copy-coordinator.js +189 -0
  333. package/dist/integrations/pi/session-ui/response-copy-helper.d.ts +1 -0
  334. package/dist/integrations/pi/session-ui/response-copy-helper.js +122 -0
  335. package/dist/integrations/pi/session-ui/response-copy-protocol.d.ts +56 -0
  336. package/dist/integrations/pi/session-ui/response-copy-protocol.js +5 -0
  337. package/dist/integrations/pi/session-ui/response-copy-transport.d.ts +31 -0
  338. package/dist/integrations/pi/session-ui/response-copy-transport.js +187 -0
  339. package/dist/integrations/pi/session-ui/route-host.d.ts +5 -0
  340. package/dist/integrations/pi/session-ui/route-host.js +1 -0
  341. package/dist/integrations/pi/session-ui/session-shell-root.d.ts +221 -0
  342. package/dist/integrations/pi/session-ui/session-shell-root.js +1305 -0
  343. package/dist/integrations/pi/session-ui/session-shell.d.ts +55 -0
  344. package/dist/integrations/pi/session-ui/session-shell.js +1792 -0
  345. package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +56 -0
  346. package/dist/integrations/pi/session-ui/session-viewport-controller.js +569 -0
  347. package/dist/integrations/pi/session-ui/stream-presentation-coalescer.d.ts +29 -0
  348. package/dist/integrations/pi/session-ui/stream-presentation-coalescer.js +79 -0
  349. package/dist/integrations/pi/session-ui/system-clipboard.d.ts +20 -0
  350. package/dist/integrations/pi/session-ui/system-clipboard.js +156 -0
  351. package/dist/integrations/pi/session-ui/text-paste.d.ts +5 -0
  352. package/dist/integrations/pi/session-ui/text-paste.js +16 -0
  353. package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.d.ts +10 -1
  354. package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.js +255 -11
  355. package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.d.ts +32 -6
  356. package/dist/integrations/pi/tui-runtime/contracts.js +1 -0
  357. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +81 -0
  358. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +424 -0
  359. package/dist/integrations/pi/tui-runtime/index.d.ts +7 -0
  360. package/dist/integrations/pi/tui-runtime/index.js +7 -0
  361. package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +39 -0
  362. package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.js +139 -0
  363. package/dist/integrations/pi/tui-runtime/mouse-report-input.d.ts +13 -0
  364. package/dist/integrations/pi/tui-runtime/mouse-report-input.js +59 -0
  365. package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +32 -0
  366. package/dist/integrations/pi/tui-runtime/overlay-geometry.js +159 -0
  367. package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.d.ts +1 -1
  368. package/dist/native/darwin-arm64/manifest.json +4 -4
  369. package/dist/native/darwin-arm64/process-guardian +0 -0
  370. package/dist/native/linux-x64/manifest.json +3 -3
  371. package/dist/native/linux-x64/process-guardian +0 -0
  372. package/dist/native/win32-x64/manifest.json +3 -3
  373. package/dist/native/win32-x64/process-guardian.exe +0 -0
  374. package/dist/{src/product-identity.d.ts → product-identity.d.ts} +4 -4
  375. package/dist/{src/product-identity.js → product-identity.js} +7 -38
  376. package/dist/{src/product-identity.json → product-identity.json} +13 -27
  377. package/dist/runtime-payload-inventory.json +122333 -0
  378. package/dist/{src/foundation/ui-apps → ui/apps}/contracts.d.ts +23 -1
  379. package/dist/{src/foundation/ui-apps → ui/apps}/host.d.ts +1 -1
  380. package/dist/{src/foundation/ui-apps → ui/apps}/host.js +14 -10
  381. package/dist/{src/foundation/ui-apps → ui/apps}/registry.d.ts +1 -0
  382. package/dist/{src/foundation/ui-apps → ui/apps}/registry.js +1 -0
  383. package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.js +5 -3
  384. package/dist/{src/foundation/ui-components → ui/components}/frame.d.ts +1 -0
  385. package/dist/{src/foundation/ui-components → ui/components}/frame.js +1 -0
  386. package/dist/{src/foundation/ui-components → ui/components}/index.d.ts +7 -0
  387. package/dist/{src/foundation/ui-components → ui/components}/index.js +7 -0
  388. package/dist/{src/foundation/ui-components → ui/components}/line-input.d.ts +2 -8
  389. package/dist/{src/foundation/ui-components → ui/components}/line-input.js +7 -28
  390. package/dist/{src/foundation/ui-components → ui/components}/list-view.d.ts +0 -6
  391. package/dist/{src/foundation/ui-components → ui/components}/list-view.js +14 -7
  392. package/dist/{src/foundation/ui-components → ui/components}/mouse.d.ts +10 -0
  393. package/dist/{src/foundation/ui-components → ui/components}/mouse.js +24 -0
  394. package/dist/ui/components/progress-status.d.ts +2 -0
  395. package/dist/ui/components/progress-status.js +4 -0
  396. package/dist/ui/components/prompt-input.d.ts +32 -0
  397. package/dist/ui/components/prompt-input.js +54 -0
  398. package/dist/ui/components/prompt-row.d.ts +14 -0
  399. package/dist/ui/components/prompt-row.js +20 -0
  400. package/dist/{src/foundation/ui-components → ui/components}/scrollbar.d.ts +26 -0
  401. package/dist/{src/foundation/ui-components → ui/components}/scrollbar.js +35 -0
  402. package/dist/ui/components/selection-copy.d.ts +24 -0
  403. package/dist/ui/components/selection-copy.js +39 -0
  404. package/dist/{src/foundation/ui-components → ui/components}/shortcuts.d.ts +1 -0
  405. package/dist/{src/foundation/ui-components → ui/components}/shortcuts.js +1 -0
  406. package/dist/ui/components/spans.d.ts +28 -0
  407. package/dist/ui/components/spans.js +266 -0
  408. package/dist/ui/components/submitted-prompt.d.ts +23 -0
  409. package/dist/ui/components/submitted-prompt.js +50 -0
  410. package/dist/{src/foundation/ui-components → ui/components}/surface.d.ts +0 -5
  411. package/dist/{src/foundation/ui-components → ui/components}/surface.js +1 -5
  412. package/dist/ui/components/text-selection.d.ts +62 -0
  413. package/dist/ui/components/text-selection.js +210 -0
  414. package/dist/{src/foundation/ui-components → ui/components}/text.d.ts +14 -0
  415. package/dist/{src/foundation/ui-components → ui/components}/text.js +67 -5
  416. package/dist/ui/components/transcript-viewport.d.ts +173 -0
  417. package/dist/ui/components/transcript-viewport.js +753 -0
  418. package/dist/ui/components/visible-hyperlinks.d.ts +26 -0
  419. package/dist/ui/components/visible-hyperlinks.js +97 -0
  420. package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.d.ts +8 -1
  421. package/dist/ui/settings/declarations.js +94 -0
  422. package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.d.ts +1 -1
  423. package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.js +28 -2
  424. package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.d.ts +6 -19
  425. package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.js +41 -22
  426. package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.d.ts +9 -17
  427. package/dist/ui/settings/session.js +164 -0
  428. package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.d.ts +1 -0
  429. package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.js +2 -1
  430. package/docs/architecture/boundaries.md +14 -10
  431. package/docs/architecture/code-documentation.md +77 -0
  432. package/docs/architecture/history-editor-provenance.md +100 -0
  433. package/docs/architecture/internal-naming.md +91 -0
  434. package/docs/architecture/process-guardian-provenance.md +3 -1
  435. package/docs/architecture/project-structure.md +69 -30
  436. package/docs/architecture/prompt-suggestions.md +68 -0
  437. package/docs/architecture/resource-and-data-policy.md +28 -2
  438. package/docs/architecture/response-copy-delivery.md +83 -0
  439. package/docs/architecture/tool-image-presentation.md +62 -0
  440. package/docs/architecture/toolchain.md +24 -10
  441. package/docs/architecture/ui-reference-provenance.md +59 -5
  442. package/docs/ci-release-runbook.md +236 -79
  443. package/docs/features/launch-profiles.md +24 -17
  444. package/docs/features/modal-content-interaction.md +37 -0
  445. package/docs/features/prompt-history.md +149 -0
  446. package/docs/local-worktree-cleanup.md +128 -0
  447. package/docs/manual-code-streaming-cleanup.md +88 -0
  448. package/docs/manual-ghost-link-baseline.md +89 -0
  449. package/docs/manual-launch-instance-acceptance.md +12 -35
  450. package/docs/manual-owned-ui-checkpoint.md +78 -0
  451. package/docs/manual-pi-boundary-candidate.md +4 -5
  452. package/docs/manual-terminal-colour-check.md +4 -3
  453. package/docs/openspec-archive-automation.md +128 -0
  454. package/docs/repository-governance-live-acceptance.md +77 -0
  455. package/package.json +45 -28
  456. package/dist/src/cli/capabilities.d.ts +0 -15
  457. package/dist/src/cli/dispatch.js +0 -142
  458. package/dist/src/cli/version-stats.js +0 -72
  459. package/dist/src/composition/index.d.ts +0 -48
  460. package/dist/src/composition/index.js +0 -258
  461. package/dist/src/features/launch/intent.d.ts +0 -7
  462. package/dist/src/features/launch/intent.js +0 -4
  463. package/dist/src/features/launch/profiles.d.ts +0 -12
  464. package/dist/src/features/launch/profiles.js +0 -26
  465. package/dist/src/features/owned-ui/run.js +0 -15
  466. package/dist/src/foundation/lifecycle/paths.d.ts +0 -10
  467. package/dist/src/foundation/owned-ui-contracts/index.d.ts +0 -3
  468. package/dist/src/foundation/owned-ui-contracts/index.js +0 -3
  469. package/dist/src/foundation/owned-ui-settings/declarations.js +0 -39
  470. package/dist/src/foundation/owned-ui-settings/session.js +0 -145
  471. package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +0 -162
  472. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +0 -57
  473. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +0 -116
  474. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +0 -19
  475. package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.d.ts +0 -18
  476. package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.js +0 -55
  477. package/dist/src/foundation/pi-engine-adapter/settings-integration.d.ts +0 -55
  478. package/dist/src/foundation/pi-owned-ui-integration/index.d.ts +0 -2
  479. package/dist/src/foundation/pi-owned-ui-integration/index.js +0 -2
  480. package/dist/src/foundation/pi-owned-ui-integration/route-host.d.ts +0 -29
  481. package/dist/src/foundation/pi-owned-ui-integration/session-shell.d.ts +0 -106
  482. package/dist/src/foundation/pi-owned-ui-integration/session-shell.js +0 -1518
  483. package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts +0 -4
  484. package/dist/src/foundation/pi-tui-runtime-adapter/index.js +0 -4
  485. package/dist/src/foundation/release/bootstrap.d.ts +0 -29
  486. package/dist/src/foundation/release/cohort-state.d.ts +0 -70
  487. package/dist/src/foundation/release/cohort-state.js +0 -202
  488. package/dist/src/foundation/release/release-gc.d.ts +0 -5
  489. package/dist/src/foundation/release/release-gc.js +0 -16
  490. package/dist/src/foundation/supervision/index.d.ts +0 -3
  491. package/dist/src/foundation/supervision/index.js +0 -3
  492. package/dist/src/foundation/supervision/main.d.ts +0 -1
  493. package/dist/src/foundation/supervision/main.js +0 -41
  494. package/dist/src/foundation/supervision/paths.d.ts +0 -1
  495. package/dist/src/foundation/supervision/paths.js +0 -1
  496. package/dist/src/foundation/supervision/server.d.ts +0 -22
  497. package/dist/src/foundation/ui-components/spans.d.ts +0 -7
  498. package/dist/src/foundation/ui-components/spans.js +0 -59
  499. package/docs/manual-transparent-checkpoint.md +0 -53
  500. /package/dist/{src/cli → cli}/index.d.ts +0 -0
  501. /package/dist/{src/cli → cli}/index.js +0 -0
  502. /package/dist/{src/cli → cli}/version.d.ts +0 -0
  503. /package/dist/{src/cli → cli}/version.js +0 -0
  504. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.js +0 -0
  505. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.d.ts +0 -0
  506. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.js +0 -0
  507. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.d.ts +0 -0
  508. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.js +0 -0
  509. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.d.ts +0 -0
  510. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.js +0 -0
  511. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.js +0 -0
  512. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.d.ts +0 -0
  513. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.js +0 -0
  514. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.d.ts +0 -0
  515. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.js +0 -0
  516. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.d.ts +0 -0
  517. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.js +0 -0
  518. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.d.ts +0 -0
  519. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.js +0 -0
  520. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.js +0 -0
  521. /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.js +0 -0
  522. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.d.ts +0 -0
  523. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.js +0 -0
  524. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.d.ts +0 -0
  525. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.js +0 -0
  526. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.d.ts +0 -0
  527. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.js +0 -0
  528. /package/dist/{src/features → features}/launch/development-launch.d.ts +0 -0
  529. /package/dist/{src/features → features}/launch/initialize-profile.d.ts +0 -0
  530. /package/dist/{src/features → features}/launch/initialize-profile.js +0 -0
  531. /package/dist/{src/features → features}/launch/runtime-selection.js +0 -0
  532. /package/dist/{src/features → features}/workspace/capabilities.js +0 -0
  533. /package/dist/{src/features → features}/workspace/index.d.ts +0 -0
  534. /package/dist/{src/features → features}/workspace/index.js +0 -0
  535. /package/dist/{src/features → features}/workspace/presentation.d.ts +0 -0
  536. /package/dist/{src/features → features}/workspace/presentation.js +0 -0
  537. /package/dist/{src/features → features}/workspace/reconciliation.d.ts +0 -0
  538. /package/dist/{src/features → features}/workspace/reconciliation.js +0 -0
  539. /package/dist/{src/foundation → foundation}/launch-guardian/index.d.ts +0 -0
  540. /package/dist/{src/foundation → foundation}/launch-guardian/index.js +0 -0
  541. /package/dist/{src/foundation → foundation}/lifecycle/commands.d.ts +0 -0
  542. /package/dist/{src/foundation → foundation}/lifecycle/commands.js +0 -0
  543. /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.d.ts +0 -0
  544. /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.js +0 -0
  545. /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.d.ts +0 -0
  546. /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.js +0 -0
  547. /package/dist/{src/foundation → foundation}/native-host-protocol/index.d.ts +0 -0
  548. /package/dist/{src/foundation → foundation}/native-host-protocol/index.js +0 -0
  549. /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.d.ts +0 -0
  550. /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.js +0 -0
  551. /package/dist/{src/foundation → foundation}/process-containment/artifact.d.ts +0 -0
  552. /package/dist/{src/foundation → foundation}/process-containment/artifact.js +0 -0
  553. /package/dist/{src/foundation → foundation}/process-containment/contracts.d.ts +0 -0
  554. /package/dist/{src/foundation → foundation}/process-containment/contracts.js +0 -0
  555. /package/dist/{src/foundation → foundation}/protocol/index.d.ts +0 -0
  556. /package/dist/{src/foundation → foundation}/protocol/index.js +0 -0
  557. /package/dist/{src/foundation → foundation}/release/cohort-selection.d.ts +0 -0
  558. /package/dist/{src/foundation → foundation}/release/cohort-selection.js +0 -0
  559. /package/dist/{src/foundation → foundation}/release/concurrency.d.ts +0 -0
  560. /package/dist/{src/foundation → foundation}/release/concurrency.js +0 -0
  561. /package/dist/{src/foundation → foundation}/release/process-cleanup.d.ts +0 -0
  562. /package/dist/{src/foundation → foundation}/release/process-cleanup.js +0 -0
  563. /package/dist/{src/foundation → foundation}/release/stable-release.d.ts +0 -0
  564. /package/dist/{src/foundation → foundation}/release/stable-release.js +0 -0
  565. /package/dist/{src/foundation → foundation}/storage/index.d.ts +0 -0
  566. /package/dist/{src/foundation → foundation}/storage/index.js +0 -0
  567. /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.d.ts +0 -0
  568. /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.js +0 -0
  569. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.js +0 -0
  570. /package/dist/{src/foundation/pi-owned-ui-integration/route-host.js → integrations/pi/components/editor-interaction.js} +0 -0
  571. /package/dist/{src/foundation/pi-tui-runtime-adapter/contracts.js → integrations/pi/components/prompt-input-port.js} +0 -0
  572. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.d.ts +0 -0
  573. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.js +0 -0
  574. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-editor-autocomplete.d.ts +0 -0
  575. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.js +0 -0
  576. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.d.ts +0 -0
  577. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.js +0 -0
  578. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.d.ts +0 -0
  579. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.js +0 -0
  580. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.d.ts +0 -0
  581. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.js +0 -0
  582. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.d.ts +0 -0
  583. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.js +0 -0
  584. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/earendil-announcement.d.ts +0 -0
  585. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.d.ts +0 -0
  586. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.js +0 -0
  587. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.d.ts +0 -0
  588. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.js +0 -0
  589. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.d.ts +0 -0
  590. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.js +0 -0
  591. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.d.ts +0 -0
  592. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.js +0 -0
  593. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.d.ts +0 -0
  594. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.js +0 -0
  595. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.d.ts +0 -0
  596. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.js +0 -0
  597. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.d.ts +0 -0
  598. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.js +0 -0
  599. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.d.ts +0 -0
  600. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.js +0 -0
  601. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.d.ts +0 -0
  602. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.js +0 -0
  603. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.d.ts +0 -0
  604. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.js +0 -0
  605. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.d.ts +0 -0
  606. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.js +0 -0
  607. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.d.ts +0 -0
  608. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.js +0 -0
  609. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.d.ts +0 -0
  610. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.js +0 -0
  611. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.d.ts +0 -0
  612. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.js +0 -0
  613. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/pi-settings-metadata.json +0 -0
  614. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.d.ts +0 -0
  615. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.js +0 -0
  616. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.js +0 -0
  617. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.d.ts +0 -0
  618. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.js +0 -0
  619. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.js +0 -0
  620. /package/dist/{src/foundation/ui-apps → ui/apps}/contracts.js +0 -0
  621. /package/dist/{src/foundation/ui-apps → ui/apps}/index.d.ts +0 -0
  622. /package/dist/{src/foundation/ui-apps → ui/apps}/index.js +0 -0
  623. /package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.d.ts +0 -0
  624. /package/dist/{src/foundation/ui-components → ui/components}/label.d.ts +0 -0
  625. /package/dist/{src/foundation/ui-components → ui/components}/label.js +0 -0
  626. /package/dist/{src/foundation/ui-components → ui/components}/list-block.d.ts +0 -0
  627. /package/dist/{src/foundation/ui-components → ui/components}/list-block.js +0 -0
  628. /package/dist/{src/foundation/ui-components → ui/components}/pane.d.ts +0 -0
  629. /package/dist/{src/foundation/ui-components → ui/components}/pane.js +0 -0
  630. /package/dist/{src/foundation/ui-components → ui/components}/revision.d.ts +0 -0
  631. /package/dist/{src/foundation/ui-components → ui/components}/revision.js +0 -0
  632. /package/dist/{src/foundation/ui-components → ui/components}/status-line.d.ts +0 -0
  633. /package/dist/{src/foundation/ui-components → ui/components}/status-line.js +0 -0
  634. /package/dist/{src/foundation/ui-components → ui/components}/stepper.d.ts +0 -0
  635. /package/dist/{src/foundation/ui-components → ui/components}/stepper.js +0 -0
  636. /package/dist/{src/foundation/ui-components → ui/components}/theme.d.ts +0 -0
  637. /package/dist/{src/foundation/ui-components → ui/components}/theme.js +0 -0
  638. /package/dist/{src/foundation/ui-components → ui/components}/value-menu.d.ts +0 -0
  639. /package/dist/{src/foundation/ui-components → ui/components}/value-menu.js +0 -0
  640. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.d.ts +0 -0
  641. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.js +0 -0
  642. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.d.ts +0 -0
  643. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.js +0 -0
@@ -11,13 +11,70 @@ export interface OwnedUiModelInfo {
11
11
  readonly modelId: string;
12
12
  readonly displayName: string;
13
13
  }
14
+ export interface OwnedUiPromptSuggestionIdentity {
15
+ readonly sessionId: OwnedUiSessionId;
16
+ readonly sessionGeneration: number;
17
+ readonly runSequence: number;
18
+ readonly responseSequence: number;
19
+ readonly model: OwnedUiModelInfo;
20
+ }
21
+ export interface OwnedUiPromptSuggestionRequest {
22
+ readonly identity: OwnedUiPromptSuggestionIdentity;
23
+ readonly signal: AbortSignal;
24
+ }
25
+ export type OwnedUiPromptSuggestionReasoning = "ordinary" | "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "unavailable";
26
+ export type OwnedUiPromptSuggestionResult = {
27
+ readonly identity: OwnedUiPromptSuggestionIdentity;
28
+ } & ({
29
+ readonly outcome: "candidate";
30
+ readonly text: string;
31
+ } | {
32
+ readonly outcome: "empty" | "rejected" | "provider-failure" | "unavailable" | "cancelled";
33
+ readonly text: null;
34
+ });
35
+ export type OwnedUiPromptSuggestionState = {
36
+ readonly status: "idle";
37
+ } | {
38
+ readonly status: "generating";
39
+ readonly identity: OwnedUiPromptSuggestionIdentity;
40
+ readonly settled: boolean;
41
+ } | {
42
+ readonly status: "prepared";
43
+ readonly identity: OwnedUiPromptSuggestionIdentity;
44
+ readonly text: string;
45
+ } | {
46
+ readonly status: "available";
47
+ readonly identity: OwnedUiPromptSuggestionIdentity;
48
+ readonly text: string;
49
+ };
50
+ export interface OwnedUiPromptSuggestionGeneratorPort {
51
+ /** Request-local policy; never changes the primary session's thinking setting. */
52
+ suggestionReasoningPolicy?(): OwnedUiPromptSuggestionReasoning;
53
+ generate(request: OwnedUiPromptSuggestionRequest): Promise<OwnedUiPromptSuggestionResult>;
54
+ }
14
55
  export type OwnedUiThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
56
+ export interface OwnedUiViewportSettings {
57
+ readonly scrollbarAppearance: "auto" | "always" | "hidden";
58
+ readonly scrollbarStyle: "thin" | "thick";
59
+ /** normal is baseline; fast is 2x normal; high is normal plus fast. */
60
+ readonly scrollbarSpeed: "normal" | "fast" | "high";
61
+ }
62
+ /** Narrow live settings boundary consumed by the bare-A1 shell composition. */
63
+ export interface OwnedUiViewportSettingsPort {
64
+ snapshot(): OwnedUiViewportSettings;
65
+ onChange(listener: (settings: OwnedUiViewportSettings) => void): () => void;
66
+ }
15
67
  export interface OwnedUiTerminalSurface {
16
68
  readonly columns: number;
17
69
  readonly rows: number;
18
70
  readonly focusedRegion: "transcript" | "editor" | "dialog" | "overlay" | "status";
19
71
  readonly hardwareCursor: boolean;
20
72
  }
73
+ export interface OwnedUiImageAttachment {
74
+ readonly type: "image";
75
+ readonly data: string;
76
+ readonly mimeType: string;
77
+ }
21
78
  export interface OwnedUiEditorState {
22
79
  readonly text: string;
23
80
  readonly queuedSubmissions: readonly string[];
@@ -75,6 +132,35 @@ export interface OwnedUiOverlay {
75
132
  readonly modal: boolean;
76
133
  readonly payload: unknown;
77
134
  }
135
+ export interface OwnedUiTranscriptImageReference {
136
+ readonly assetId: OwnedUiEntityId;
137
+ readonly mimeType: string;
138
+ readonly byteLength: number;
139
+ readonly source: "user" | "tool-result";
140
+ }
141
+ /** Argument generation and execution have distinct completion boundaries on one invocation. */
142
+ export interface OwnedUiToolState {
143
+ readonly argsComplete: boolean;
144
+ readonly execution: "pending" | "running" | "succeeded" | "failed" | "aborted";
145
+ }
146
+ /** Vendor-neutral rendering metadata; text and image bytes are not duplicated here. */
147
+ export type OwnedUiToolResultPart = {
148
+ readonly type: "text";
149
+ readonly start: number;
150
+ readonly end: number;
151
+ } | {
152
+ readonly type: "image";
153
+ readonly imageIndex: number;
154
+ };
155
+ export interface OwnedUiToolRendering {
156
+ readonly arguments: unknown;
157
+ readonly result?: {
158
+ readonly content: readonly OwnedUiToolResultPart[];
159
+ readonly details?: unknown;
160
+ };
161
+ /** Visible bounded fallback, never a substitute operation outcome. */
162
+ readonly unavailable?: string;
163
+ }
78
164
  export interface OwnedUiTranscriptBlock {
79
165
  readonly id: OwnedUiEntityId;
80
166
  readonly kind: OwnedUiTranscriptBlockKind;
@@ -83,6 +169,12 @@ export interface OwnedUiTranscriptBlock {
83
169
  readonly title: string | null;
84
170
  readonly text: string;
85
171
  readonly payload: unknown;
172
+ /** Tool-call message completion alone must not settle execution. */
173
+ readonly toolState?: OwnedUiToolState;
174
+ /** Authoritative renderer inputs, separate from diagnostic payloads. */
175
+ readonly toolRendering?: OwnedUiToolRendering;
176
+ /** Bounded opaque references; image bytes remain in the session-scoped engine asset store. */
177
+ readonly imageReferences?: readonly OwnedUiTranscriptImageReference[];
86
178
  }
87
179
  export type OwnedUiSlotId = "theme" | "transcript-block" | "tool-card" | "editor" | "status" | "command" | "selector" | "dialog" | "overlay" | "layout";
88
180
  export interface OwnedUiCustomization {
@@ -122,11 +214,13 @@ export type OwnedUiCommand = {
122
214
  readonly correlationId: OwnedUiCorrelationId;
123
215
  readonly sessionId: OwnedUiSessionId;
124
216
  readonly text: string;
217
+ readonly images?: readonly OwnedUiImageAttachment[];
125
218
  } | {
126
219
  readonly type: "steer" | "follow-up";
127
220
  readonly correlationId: OwnedUiCorrelationId;
128
221
  readonly sessionId: OwnedUiSessionId;
129
222
  readonly text: string;
223
+ readonly images?: readonly OwnedUiImageAttachment[];
130
224
  } | {
131
225
  readonly type: "abort" | "retry" | "compact" | "shutdown";
132
226
  readonly correlationId: OwnedUiCorrelationId;
@@ -189,6 +283,35 @@ export type OwnedUiEvent = {
189
283
  readonly sessionId: OwnedUiSessionId;
190
284
  readonly sequence: number;
191
285
  readonly block: OwnedUiTranscriptBlock;
286
+ } | {
287
+ /** One completed assistant reply; never a tool row or transcript rebuild. */
288
+ readonly type: "assistant-message-completed";
289
+ readonly sessionId: OwnedUiSessionId;
290
+ readonly sequence: number;
291
+ readonly sessionGeneration: number;
292
+ readonly runSequence: number;
293
+ readonly responseSequence: number;
294
+ readonly model: OwnedUiModelInfo | null;
295
+ readonly assistantMessageCount: number;
296
+ readonly successful: boolean;
297
+ readonly stopReason: string | null;
298
+ readonly toolContinuation: boolean;
299
+ } | {
300
+ /** A fresh agent run has started, used by follow-mode surfaces. */
301
+ readonly type: "agent-run-started";
302
+ readonly sessionId: OwnedUiSessionId;
303
+ readonly sequence: number;
304
+ } | {
305
+ /** The final settlement of one run, after authoritative transcript reconciliation. */
306
+ readonly type: "agent-run-settled";
307
+ readonly sessionId: OwnedUiSessionId;
308
+ readonly sequence: number;
309
+ readonly sessionGeneration: number;
310
+ readonly runSequence: number;
311
+ readonly responseSequence: number;
312
+ readonly model: OwnedUiModelInfo | null;
313
+ readonly assistantMessageCount: number;
314
+ readonly successful: boolean;
192
315
  } | {
193
316
  readonly type: "editor-state";
194
317
  readonly sessionId: OwnedUiSessionId;
@@ -0,0 +1,55 @@
1
+ export declare const PROMPT_HISTORY_EDITOR_REPLACEMENT: Readonly<{
2
+ readonly id: "persistent-prompt-history";
3
+ readonly kind: "replacement";
4
+ readonly slot: "editor";
5
+ readonly replaces: readonly string[];
6
+ }>;
7
+ export type PromptHistoryKind = "prompt" | "steer" | "follow-up" | "bash" | "slash";
8
+ export interface PromptHistorySubmission {
9
+ readonly id: string;
10
+ readonly text: string;
11
+ readonly timestamp: number;
12
+ readonly kind: PromptHistoryKind;
13
+ readonly cwd?: string;
14
+ readonly sessionId?: string;
15
+ }
16
+ export interface PromptHistorySnapshot {
17
+ readonly revision: number;
18
+ readonly limit: number;
19
+ readonly entries: readonly {
20
+ readonly text: string;
21
+ readonly submissionId: string;
22
+ }[];
23
+ }
24
+ export type PromptHistoryFailure = "unavailable" | "busy" | "capacity" | "oversized" | "schema" | "corrupt" | "shutdown";
25
+ export type PromptHistoryResult = "committed" | "skipped";
26
+ export interface PromptHistoryPort {
27
+ start(): void;
28
+ record(submission: PromptHistorySubmission): Promise<PromptHistoryResult>;
29
+ refresh(): void;
30
+ onSnapshot(listener: (snapshot: PromptHistorySnapshot) => void): () => void;
31
+ onFailure(listener: (code: PromptHistoryFailure) => void): () => void;
32
+ close(): Promise<void>;
33
+ }
34
+ export interface PromptHistoryImageSidecarAttachment {
35
+ readonly type: "image";
36
+ readonly data: string;
37
+ readonly mimeType: string;
38
+ }
39
+ export interface PromptHistoryImageSidecarRecord {
40
+ readonly tag: string;
41
+ readonly data: string;
42
+ readonly mimeType: string;
43
+ readonly savedAt: string;
44
+ }
45
+ /** Per-profile durable payload store for image chip attachments referenced by history text.
46
+ * Writes MUST be idempotent and MUST NOT block a history row commit on failure; reads MUST
47
+ * treat every failure as "attachment unavailable" so rehydration silently strips the chip. */
48
+ export interface PromptHistoryImageSidecarPort {
49
+ write(id: string, record: PromptHistoryImageSidecarRecord): void;
50
+ readAttachment(id: string): PromptHistoryImageSidecarAttachment | null;
51
+ }
52
+ export declare const PROMPT_HISTORY_MAX_ENTRY_BYTES: number;
53
+ export declare const PROMPT_HISTORY_MAX_TEXT_BYTES: number;
54
+ export declare const PROMPT_HISTORY_MAX_PENDING = 32;
55
+ export declare function assertPromptHistorySubmission(value: unknown): asserts value is PromptHistorySubmission;
@@ -0,0 +1,23 @@
1
+ export const PROMPT_HISTORY_EDITOR_REPLACEMENT = Object.freeze({
2
+ id: "persistent-prompt-history",
3
+ kind: "replacement",
4
+ slot: "editor",
5
+ replaces: Object.freeze(["current-session-history-source", "adjacent-duplicate-policy", "recall-caret-placement", "history-border"]),
6
+ });
7
+ export const PROMPT_HISTORY_MAX_ENTRY_BYTES = 1024 * 1024;
8
+ export const PROMPT_HISTORY_MAX_TEXT_BYTES = 8 * 1024 * 1024;
9
+ export const PROMPT_HISTORY_MAX_PENDING = 32;
10
+ export function assertPromptHistorySubmission(value) {
11
+ if (typeof value !== "object" || value === null || Array.isArray(value))
12
+ throw new TypeError("Invalid history submission");
13
+ const item = value;
14
+ const allowed = new Set(["id", "text", "timestamp", "kind", "cwd", "sessionId"]);
15
+ if (Object.keys(item).some(key => !allowed.has(key))
16
+ || typeof item.id !== "string" || !/^[a-zA-Z0-9-]{1,128}$/.test(item.id)
17
+ || typeof item.text !== "string" || !item.text.trim() || item.text !== item.text.trim()
18
+ || typeof item.timestamp !== "number" || !Number.isSafeInteger(item.timestamp) || item.timestamp < 0
19
+ || typeof item.kind !== "string" || !["prompt", "steer", "follow-up", "bash", "slash"].includes(item.kind)
20
+ || item.cwd !== undefined && typeof item.cwd !== "string"
21
+ || item.sessionId !== undefined && typeof item.sessionId !== "string")
22
+ throw new TypeError("Invalid history submission");
23
+ }
@@ -0,0 +1,3 @@
1
+ export declare const CONTEXTUAL_PROMPT_SUGGESTION_INSTRUCTION = "[NEXT USER INPUT]\nPredict the one short response the user is most likely to type next.\nUse the user's recent intent and writing style. Prefer a concrete continuation such as approving an offered action, choosing an offered option, running a requested check, committing, or pushing.\nPrefer a clearly offered next action consistent with the user's recent intent. An optional alternative alone does not make that continuation unclear.\nFor example, after the user accepted merged work, \"Say archive it\" with an optional \"let me test\" alternative favors: archive it.\nDo not favor archival if the user required testing first and that testing remains outstanding. Do not invent approval or select the first of equally unresolved choices.\nReturn nothing when the next input is genuinely unclear, the previous response failed, or required assessment or correction remains outstanding.\nDo not answer as the assistant. Do not add a label, explanation, quotation marks, Markdown, or multiple sentences.\nReturn only 2-12 words, except a natural one-word command or answer is allowed.";
2
+ /** Converts untrusted model output into one inert, bounded user-voice candidate. */
3
+ export declare function normalizePromptSuggestionCandidate(candidate: string | null | undefined): string | null;
@@ -0,0 +1,44 @@
1
+ export const CONTEXTUAL_PROMPT_SUGGESTION_INSTRUCTION = `[NEXT USER INPUT]
2
+ Predict the one short response the user is most likely to type next.
3
+ Use the user's recent intent and writing style. Prefer a concrete continuation such as approving an offered action, choosing an offered option, running a requested check, committing, or pushing.
4
+ Prefer a clearly offered next action consistent with the user's recent intent. An optional alternative alone does not make that continuation unclear.
5
+ For example, after the user accepted merged work, "Say archive it" with an optional "let me test" alternative favors: archive it.
6
+ Do not favor archival if the user required testing first and that testing remains outstanding. Do not invent approval or select the first of equally unresolved choices.
7
+ Return nothing when the next input is genuinely unclear, the previous response failed, or required assessment or correction remains outstanding.
8
+ Do not answer as the assistant. Do not add a label, explanation, quotation marks, Markdown, or multiple sentences.
9
+ Return only 2-12 words, except a natural one-word command or answer is allowed.`;
10
+ const ALLOWED_SINGLE_WORDS = new Set([
11
+ "yes", "yeah", "yep", "sure", "ok", "okay", "no",
12
+ "continue", "apply", "commit", "push", "deploy", "test", "check", "stop", "exit", "quit",
13
+ ]);
14
+ /** Converts untrusted model output into one inert, bounded user-voice candidate. */
15
+ export function normalizePromptSuggestionCandidate(candidate) {
16
+ if (typeof candidate !== "string")
17
+ return null;
18
+ const suggestion = candidate.trim();
19
+ if (suggestion.length === 0 || [...suggestion].length >= 100)
20
+ return null;
21
+ if (/[\p{C}\r\n\t]/u.test(suggestion))
22
+ return null;
23
+ if (/[\*`#]|__|~~/.test(suggestion))
24
+ return null;
25
+ if (/[.!?]\s+\S/u.test(suggestion))
26
+ return null;
27
+ const lower = suggestion.toLowerCase();
28
+ if (/^(api error:|prompt is too long|request timed out|invalid api key|image was too large)/.test(lower))
29
+ return null;
30
+ if (lower === "done" || /^(nothing to suggest|no suggestion|stay silent|silence\b)/.test(lower))
31
+ return null;
32
+ if (/^\w+:\s/u.test(suggestion))
33
+ return null;
34
+ if (/^(let me|i(?:'|’)ll|i(?:'|’)ve|i(?:'|’)m|i can|i would|i think|here(?:'|’)s|here is|here are|you can|you should|you could|sure,|of course|certainly)\b/i.test(suggestion))
35
+ return null;
36
+ if (/\b(thanks|thank you|looks good|sounds good|that works|that worked|nice|great|perfect|awesome|excellent)\b/i.test(suggestion))
37
+ return null;
38
+ const words = suggestion.split(/\s+/u);
39
+ if (words.length > 12)
40
+ return null;
41
+ if (words.length === 1 && !suggestion.startsWith("/") && !ALLOWED_SINGLE_WORDS.has(lower))
42
+ return null;
43
+ return suggestion;
44
+ }
@@ -0,0 +1,22 @@
1
+ import type { OwnedUiPromptSuggestionReasoning } from "./model.js";
2
+ export declare const SUGGESTION_DECISION_REASONS: readonly ["disabled", "disposed", "early-conversation", "no-model", "failed-response", "incomplete-response", "tool-continuation", "replacement-input", "modal", "draft", "not-ready", "not-focused", "autocomplete", "prompt-mode", "presentation-unavailable", "ineligible", "stale-identity"];
3
+ export type SuggestionDecisionReason = typeof SUGGESTION_DECISION_REASONS[number];
4
+ export type SuggestionDecision = SuggestionDecisionReason | null;
5
+ export declare const SUGGESTION_DIAGNOSTIC_EVENTS: readonly ["skipped", "started", "displayed", "empty", "rejected", "provider-failure", "unavailable", "timeout", "cancelled", "stale-result", "presentation-blocked", "late-result-discarded"];
6
+ export type SuggestionDiagnosticEvent = typeof SUGGESTION_DIAGNOSTIC_EVENTS[number];
7
+ /** Metadata only: never carry a session path, prompt, candidate, or raw error. */
8
+ export interface SuggestionDiagnosticRecord {
9
+ readonly event: SuggestionDiagnosticEvent;
10
+ readonly reason?: SuggestionDecisionReason;
11
+ readonly session: number;
12
+ readonly run: number;
13
+ readonly response: number;
14
+ readonly request: number;
15
+ readonly provider: string;
16
+ readonly model: string;
17
+ readonly reasoning: OwnedUiPromptSuggestionReasoning;
18
+ readonly elapsedMs: number;
19
+ }
20
+ export interface SuggestionDiagnosticObserver {
21
+ record(record: SuggestionDiagnosticRecord): void;
22
+ }
@@ -0,0 +1,9 @@
1
+ export const SUGGESTION_DECISION_REASONS = [
2
+ "disabled", "disposed", "early-conversation", "no-model", "failed-response", "incomplete-response",
3
+ "tool-continuation", "replacement-input", "modal", "draft", "not-ready", "not-focused",
4
+ "autocomplete", "prompt-mode", "presentation-unavailable", "ineligible", "stale-identity",
5
+ ];
6
+ export const SUGGESTION_DIAGNOSTIC_EVENTS = [
7
+ "skipped", "started", "displayed", "empty", "rejected", "provider-failure", "unavailable",
8
+ "timeout", "cancelled", "stale-result", "presentation-blocked", "late-result-discarded",
9
+ ];
@@ -0,0 +1,5 @@
1
+ import type { OwnedUiToolState, OwnedUiTranscriptBlock } from "./model.js";
2
+ /** Compatibility for existing owned components/fixtures without explicit execution state. */
3
+ export declare function transcriptToolState(block: OwnedUiTranscriptBlock): OwnedUiToolState | undefined;
4
+ /** Within a session generation, reject obsolete phases as well as obsolete revisions. */
5
+ export declare function acceptsTranscriptUpdate(current: OwnedUiTranscriptBlock, next: OwnedUiTranscriptBlock): boolean;
@@ -0,0 +1,33 @@
1
+ /** Compatibility for existing owned components/fixtures without explicit execution state. */
2
+ export function transcriptToolState(block) {
3
+ if (block.kind !== "tool-call" && block.kind !== "tool-result")
4
+ return undefined;
5
+ if (block.toolState !== undefined)
6
+ return block.toolState;
7
+ const payload = typeof block.payload === "object" && block.payload !== null ? block.payload : {};
8
+ const isError = "isError" in payload && payload.isError === true;
9
+ const partial = "partialResult" in payload && payload.partialResult === true;
10
+ return {
11
+ argsComplete: block.status === "finalized" || "argsComplete" in payload && payload.argsComplete === true,
12
+ execution: block.kind === "tool-result"
13
+ ? block.status === "live" ? "running" : isError ? "failed" : "succeeded"
14
+ : partial ? "running" : "pending",
15
+ };
16
+ }
17
+ /** Within a session generation, reject obsolete phases as well as obsolete revisions. */
18
+ export function acceptsTranscriptUpdate(current, next) {
19
+ if (current.id !== next.id || current.revision > next.revision)
20
+ return false;
21
+ const before = transcriptToolState(current);
22
+ const after = transcriptToolState(next);
23
+ if (before !== undefined && after !== undefined) {
24
+ const rank = (state) => state.execution === "pending" ? 0 : state.execution === "running" ? 1 : 2;
25
+ if (rank(after) < rank(before))
26
+ return false;
27
+ if (before.argsComplete && !after.argsComplete && rank(after) < 2)
28
+ return false;
29
+ // Compatibility: a legacy finalized call declaration only closed arguments. Actual result finality is a barrier.
30
+ return !(current.status === "finalized" && next.status === "live" && before.execution !== "pending");
31
+ }
32
+ return !(current.status === "finalized" && next.status === "live");
33
+ }
@@ -1,6 +1,10 @@
1
- import { type OwnedUiCommand, type OwnedUiCustomization, type OwnedUiDiagnostics, type OwnedUiEditorState, type OwnedUiEvent, type OwnedUiSessionViewModel, type OwnedUiSnapshot, type OwnedUiStatusView, type OwnedUiTerminalSurface, type OwnedUiTranscriptBlock } from "./model.js";
1
+ import { type OwnedUiCommand, type OwnedUiCustomization, type OwnedUiDiagnostics, type OwnedUiEditorState, type OwnedUiEvent, type OwnedUiPromptSuggestionIdentity, type OwnedUiPromptSuggestionRequest, type OwnedUiPromptSuggestionResult, type OwnedUiPromptSuggestionState, type OwnedUiSessionViewModel, type OwnedUiSnapshot, type OwnedUiStatusView, type OwnedUiTerminalSurface, type OwnedUiTranscriptBlock } from "./model.js";
2
2
  export declare function assertOwnedUiCommand(command: OwnedUiCommand): void;
3
3
  export declare function assertOwnedUiEvent(event: OwnedUiEvent): void;
4
+ export declare function assertOwnedUiPromptSuggestionIdentity(identity: OwnedUiPromptSuggestionIdentity): void;
5
+ export declare function assertOwnedUiPromptSuggestionRequest(request: OwnedUiPromptSuggestionRequest): void;
6
+ export declare function assertOwnedUiPromptSuggestionResult(result: OwnedUiPromptSuggestionResult): void;
7
+ export declare function assertOwnedUiPromptSuggestionState(state: OwnedUiPromptSuggestionState): void;
4
8
  export declare function assertOwnedUiSessionViewModel(view: OwnedUiSessionViewModel): void;
5
9
  export declare function assertOwnedUiSnapshot(snapshot: OwnedUiSnapshot): void;
6
10
  export declare function assertOwnedUiCustomization(customization: OwnedUiCustomization): void;
@@ -1,4 +1,5 @@
1
1
  import { OWNED_UI_CONTRACT_VERSION, } from "./model.js";
2
+ import { assertPromptImages } from "./image-attachments.js";
2
3
  const MAX_ID_LENGTH = 128;
3
4
  const MAX_LABEL_LENGTH = 256;
4
5
  const MAX_MESSAGE_LENGTH = 4_096;
@@ -12,6 +13,8 @@ const MAX_QUEUE = 32;
12
13
  const MAX_BADGES = 32;
13
14
  const MAX_STATUS_DIAGNOSTICS = 32;
14
15
  const MAX_ACTIVE_COMMANDS = 64;
16
+ const IMAGE_REFERENCE_SOURCES = new Set(["user", "tool-result"]);
17
+ const TOOL_EXECUTIONS = new Set(["pending", "running", "succeeded", "failed", "aborted"]);
15
18
  const BLOCK_KINDS = new Set([
16
19
  "user",
17
20
  "assistant",
@@ -53,6 +56,9 @@ export function assertOwnedUiCommand(command) {
53
56
  case "steer":
54
57
  case "follow-up":
55
58
  assertBoundedText(command.text, "owned-UI prompt text", MAX_TEXT_BYTES);
59
+ if (command.images !== undefined) {
60
+ assertPromptImages(command.images);
61
+ }
56
62
  return;
57
63
  case "abort":
58
64
  case "retry":
@@ -103,6 +109,31 @@ export function assertOwnedUiEvent(event) {
103
109
  case "transcript-block":
104
110
  assertOwnedUiTranscriptBlock(event.block);
105
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
+ return;
106
137
  case "editor-state":
107
138
  assertOwnedUiEditorState(event.editor);
108
139
  return;
@@ -138,6 +169,45 @@ export function assertOwnedUiEvent(event) {
138
169
  throw new TypeError("owned-UI event type is unknown");
139
170
  }
140
171
  }
172
+ export function assertOwnedUiPromptSuggestionIdentity(identity) {
173
+ assertId(identity.sessionId, "prompt-suggestion session id");
174
+ assertNonNegativeInteger(identity.sessionGeneration, "prompt-suggestion session generation");
175
+ assertNonNegativeInteger(identity.runSequence, "prompt-suggestion run sequence");
176
+ assertNonNegativeInteger(identity.responseSequence, "prompt-suggestion response sequence");
177
+ assertOwnedUiModelInfo(identity.model);
178
+ }
179
+ export function assertOwnedUiPromptSuggestionRequest(request) {
180
+ assertOwnedUiPromptSuggestionIdentity(request.identity);
181
+ if (typeof request.signal !== "object" || request.signal === null
182
+ || typeof request.signal.aborted !== "boolean"
183
+ || typeof request.signal.addEventListener !== "function") {
184
+ throw new TypeError("prompt-suggestion abort signal is invalid");
185
+ }
186
+ }
187
+ export function assertOwnedUiPromptSuggestionResult(result) {
188
+ assertOwnedUiPromptSuggestionIdentity(result.identity);
189
+ if (result.outcome === "candidate") {
190
+ assertPromptSuggestionText(result.text, false);
191
+ if (!result.text.trim())
192
+ throw new TypeError("prompt-suggestion candidate is empty");
193
+ }
194
+ else if (!["empty", "rejected", "provider-failure", "unavailable", "cancelled"].includes(result.outcome) || result.text !== null) {
195
+ throw new TypeError("prompt-suggestion outcome is invalid");
196
+ }
197
+ }
198
+ export function assertOwnedUiPromptSuggestionState(state) {
199
+ if (state.status === "idle")
200
+ return;
201
+ if (state.status !== "generating" && state.status !== "prepared" && state.status !== "available") {
202
+ throw new TypeError("prompt-suggestion state is invalid");
203
+ }
204
+ assertOwnedUiPromptSuggestionIdentity(state.identity);
205
+ if (state.status === "generating" && typeof state.settled !== "boolean") {
206
+ throw new TypeError("prompt-suggestion settlement state is invalid");
207
+ }
208
+ if (state.status === "prepared" || state.status === "available")
209
+ assertPromptSuggestionText(state.text, false);
210
+ }
141
211
  export function assertOwnedUiSessionViewModel(view) {
142
212
  if (view.contractVersion !== OWNED_UI_CONTRACT_VERSION) {
143
213
  throw new TypeError("unsupported owned-UI contract version");
@@ -149,9 +219,7 @@ export function assertOwnedUiSessionViewModel(view) {
149
219
  assertOwnedUiStatusView(view.status);
150
220
  assertOwnedUiTerminalSurface(view.terminal);
151
221
  if (view.activeModel !== null) {
152
- assertId(view.activeModel.providerId, "owned-UI provider id");
153
- assertId(view.activeModel.modelId, "owned-UI model id");
154
- assertBoundedText(view.activeModel.displayName, "owned-UI model display name", MAX_LABEL_LENGTH);
222
+ assertOwnedUiModelInfo(view.activeModel);
155
223
  }
156
224
  assertEnum(view.thinkingLevel, THINKING_LEVELS, "owned-UI thinking level");
157
225
  assertCollection(view.activeCommandIds, "owned-UI active commands", MAX_ACTIVE_COMMANDS);
@@ -210,7 +278,52 @@ export function assertOwnedUiTranscriptBlock(block) {
210
278
  assertNonNegativeInteger(block.revision, "owned-UI transcript block revision");
211
279
  assertOptionalText(block.title, "owned-UI transcript block title", MAX_LABEL_LENGTH);
212
280
  assertPossiblyEmptyText(block.text, "owned-UI transcript block text", MAX_TEXT_BYTES);
213
- assertJsonValue(block.payload, "owned-UI transcript block payload", MAX_PAYLOAD_BYTES);
281
+ assertJsonValue(block.toolRendering === undefined ? block.payload : {
282
+ payload: block.payload, toolRendering: block.toolRendering,
283
+ }, "owned-UI transcript block payload", MAX_PAYLOAD_BYTES);
284
+ if (block.toolRendering !== undefined) {
285
+ if (block.kind !== "tool-call" && block.kind !== "tool-result")
286
+ throw new TypeError("owned-UI tool rendering requires a tool block");
287
+ assertJsonValue(block.toolRendering.arguments, "owned-UI tool arguments", MAX_PAYLOAD_BYTES);
288
+ if (block.toolRendering.unavailable !== undefined) {
289
+ assertBoundedText(block.toolRendering.unavailable, "owned-UI rendering fallback", MAX_MESSAGE_LENGTH);
290
+ }
291
+ if (block.toolRendering.result !== undefined) {
292
+ const result = block.toolRendering.result;
293
+ assertCollection(result.content, "owned-UI tool result parts", MAX_PAYLOAD_BYTES);
294
+ for (const part of result.content) {
295
+ if (part.type === "text") {
296
+ assertIntegerInRange(part.start, 0, block.text.length, "owned-UI tool text start");
297
+ assertIntegerInRange(part.end, part.start, block.text.length, "owned-UI tool text end");
298
+ }
299
+ else if (part.type === "image") {
300
+ assertIntegerInRange(part.imageIndex, 0, (block.imageReferences?.length ?? 0) - 1, "owned-UI tool image index");
301
+ }
302
+ else
303
+ throw new TypeError("owned-UI tool result part is invalid");
304
+ }
305
+ }
306
+ }
307
+ if (block.toolState !== undefined) {
308
+ if (block.kind !== "tool-call" && block.kind !== "tool-result")
309
+ throw new TypeError("owned-UI tool state requires a tool block");
310
+ if (typeof block.toolState.argsComplete !== "boolean")
311
+ throw new TypeError("owned-UI tool argument completion is invalid");
312
+ assertEnum(block.toolState.execution, TOOL_EXECUTIONS, "owned-UI tool execution state");
313
+ const settled = block.toolState.execution !== "pending" && block.toolState.execution !== "running";
314
+ if (settled !== (block.status === "finalized"))
315
+ throw new TypeError("owned-UI tool execution finality is inconsistent");
316
+ }
317
+ if (block.imageReferences !== undefined) {
318
+ assertCollection(block.imageReferences, "owned-UI transcript image references", 16);
319
+ for (const reference of block.imageReferences) {
320
+ assertId(reference.assetId, "owned-UI transcript image asset id");
321
+ if (!/^image\/[a-z0-9.+-]+$/i.test(reference.mimeType))
322
+ throw new TypeError("owned-UI transcript image MIME type is invalid");
323
+ assertIntegerInRange(reference.byteLength, 1, 20 * 1024 * 1024, "owned-UI transcript image byte length");
324
+ assertEnum(reference.source, IMAGE_REFERENCE_SOURCES, "owned-UI transcript image source");
325
+ }
326
+ }
214
327
  }
215
328
  export function assertOwnedUiEditorState(editor) {
216
329
  assertPossiblyEmptyText(editor.text, "owned-UI editor text", MAX_TEXT_BYTES);
@@ -306,6 +419,11 @@ export function assertOwnedUiDiagnostics(diagnostic) {
306
419
  if (typeof diagnostic.recoverable !== "boolean")
307
420
  throw new TypeError("owned-UI diagnostic recoverability is invalid");
308
421
  }
422
+ function assertOwnedUiModelInfo(model) {
423
+ assertId(model.providerId, "owned-UI provider id");
424
+ assertId(model.modelId, "owned-UI model id");
425
+ assertBoundedText(model.displayName, "owned-UI model display name", MAX_LABEL_LENGTH);
426
+ }
309
427
  function assertOwnedUiDialog(dialog) {
310
428
  assertId(dialog.id, "owned-UI dialog id");
311
429
  assertBoundedText(dialog.title, "owned-UI dialog title", MAX_LABEL_LENGTH);
@@ -356,6 +474,13 @@ function assertOptionalText(value, name, maximumBytes) {
356
474
  return;
357
475
  assertBoundedText(value, name, maximumBytes);
358
476
  }
477
+ function assertPromptSuggestionText(value, allowEmpty) {
478
+ if (value === null)
479
+ return;
480
+ if (typeof value !== "string" || value.includes("\0") || (!allowEmpty && value.length === 0) || [...value].length >= 100) {
481
+ throw new TypeError("prompt-suggestion text is invalid");
482
+ }
483
+ }
359
484
  function assertCollection(value, name, maximum) {
360
485
  if (!Array.isArray(value) || value.length > maximum)
361
486
  throw new RangeError(`${name} exceeds its maximum length`);
@@ -6,6 +6,14 @@ export interface PresentationComponentPort {
6
6
  setFocused?(focused: boolean): void;
7
7
  dispose?(): void;
8
8
  }
9
+ /** A painted input surface in terminal coordinates (one-based, inclusive bounds). */
10
+ export interface PresentationPointerSurface {
11
+ readonly component: PresentationComponentPort;
12
+ readonly columnStart: number;
13
+ readonly columnEnd: number;
14
+ readonly rowStart: number;
15
+ readonly rowEnd: number;
16
+ }
9
17
  export interface PresentationEditorPort extends PresentationComponentPort {
10
18
  getText(): string;
11
19
  setText(text: string): void;
@@ -8,8 +8,16 @@ export function resolveDevelopmentLaunchEnvironment(canonicalPackageRoot, releas
8
8
  const instanceId = selectedInstanceId
9
9
  ? createHash("sha256").update(selectedInstanceId).digest("hex").slice(0, 16)
10
10
  : randomUUID().replaceAll("-", "").slice(0, 16);
11
- const developmentRoot = resolve(source[PRODUCT_IDENTITY.environment.developmentRoot]
12
- ?? join(temporaryDirectory, PRODUCT_IDENTITY.state.developmentDirectory, checkoutId, releaseId, "instances", instanceId));
11
+ const checkoutRoot = resolve(temporaryDirectory, PRODUCT_IDENTITY.state.developmentDirectory, checkoutId);
12
+ const selectedDevelopmentRoot = source[PRODUCT_IDENTITY.environment.developmentRoot];
13
+ const developmentRoot = resolve(selectedDevelopmentRoot
14
+ ?? join(checkoutRoot, releaseId, "instances", instanceId));
15
+ // Rationale: runtime/data remain instance-isolated, but product settings are user
16
+ // preferences and must survive a fresh local launch (and a rebuilt candidate).
17
+ // An explicit development root retains its historical self-contained policy.
18
+ const persistentConfigDir = selectedDevelopmentRoot
19
+ ? join(developmentRoot, "config")
20
+ : join(checkoutRoot, "config");
13
21
  const dataDir = resolve(source[PRODUCT_IDENTITY.environment.dataDir] ?? join(developmentRoot, "data"));
14
22
  return {
15
23
  checkoutId,
@@ -19,7 +27,7 @@ export function resolveDevelopmentLaunchEnvironment(canonicalPackageRoot, releas
19
27
  environment: {
20
28
  ...source,
21
29
  [PRODUCT_IDENTITY.environment.developmentInstanceId]: instanceId,
22
- [PRODUCT_IDENTITY.environment.configDir]: resolve(source[PRODUCT_IDENTITY.environment.configDir] ?? join(developmentRoot, "config")),
30
+ [PRODUCT_IDENTITY.environment.configDir]: resolve(source[PRODUCT_IDENTITY.environment.configDir] ?? persistentConfigDir),
23
31
  [PRODUCT_IDENTITY.environment.dataDir]: dataDir,
24
32
  [PRODUCT_IDENTITY.environment.runtimeDir]: resolve(source[PRODUCT_IDENTITY.environment.runtimeDir] ?? join(developmentRoot, "runtime")),
25
33
  [PRODUCT_IDENTITY.environment.databasePath]: resolve(source[PRODUCT_IDENTITY.environment.databasePath] ?? join(dataDir, PRODUCT_IDENTITY.endpoint.databaseFilename)),
@@ -3,5 +3,4 @@ export * from "./initialize-profile.js";
3
3
  export * from "./intent.js";
4
4
  export * from "./profile-paths.js";
5
5
  export * from "./prepare-launch.js";
6
- export * from "./profiles.js";
7
6
  export * from "./runtime-selection.js";
@@ -3,5 +3,4 @@ export * from "./initialize-profile.js";
3
3
  export * from "./intent.js";
4
4
  export * from "./profile-paths.js";
5
5
  export * from "./prepare-launch.js";
6
- export * from "./profiles.js";
7
6
  export * from "./runtime-selection.js";