@timurproko/a1 0.1.8-dev.0b6d8cc → 0.1.8-dev.121

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 (387) hide show
  1. package/README.md +29 -23
  2. package/bin/cli.js +7 -7
  3. package/bin/guardian.js +1 -1
  4. package/bin/supervisor.js +1 -1
  5. package/bin/ui.js +3 -3
  6. package/dist/{src/cli → cli}/dispatch.js +14 -12
  7. package/dist/{src/cli → cli}/packages.d.ts +10 -2
  8. package/dist/{src/cli → cli}/packages.js +24 -20
  9. package/dist/{src/cli → cli}/version-stats.js +4 -4
  10. package/dist/composition/agent-engine-bridge.d.ts +3 -0
  11. package/dist/composition/agent-engine-bridge.js +108 -0
  12. package/dist/composition/index.d.ts +3 -0
  13. package/dist/composition/index.js +3 -0
  14. package/dist/composition/owned-ui.d.ts +25 -0
  15. package/dist/composition/owned-ui.js +40 -0
  16. package/dist/composition/process.d.ts +16 -0
  17. package/dist/composition/process.js +45 -0
  18. package/dist/composition/settings-route-host.d.ts +8 -0
  19. package/dist/composition/settings-route-host.js +73 -0
  20. package/dist/{src/features → features}/owned-ui/customization.d.ts +1 -1
  21. package/dist/{src/features → features}/owned-ui/customization.js +1 -1
  22. package/dist/{src/features → features}/owned-ui/diagnostics.d.ts +1 -1
  23. package/dist/{src/features → features}/owned-ui/run.d.ts +2 -2
  24. package/dist/{src/features → features}/owned-ui/settings-app.d.ts +3 -3
  25. package/dist/{src/features → features}/owned-ui/settings-app.js +1 -1
  26. package/dist/{src/features → features}/workspace/capabilities.d.ts +1 -1
  27. package/dist/{src/features → features}/workspace/reducer.d.ts +1 -1
  28. package/dist/{src/features → features}/workspace/reducer.js +1 -1
  29. package/dist/{src/features → features}/workspace/router.d.ts +1 -1
  30. package/dist/{src/features → features}/workspace/store.d.ts +1 -1
  31. package/dist/{src/foundation → foundation}/launch-guardian/main.js +8 -2
  32. package/dist/foundation/lifecycle/paths.d.ts +28 -0
  33. package/dist/{src/foundation → foundation}/lifecycle/paths.js +21 -0
  34. package/dist/{src/foundation → foundation}/native-host-protocol/messages.d.ts +1 -1
  35. package/dist/{src/foundation → foundation}/native-host-protocol/messages.js +1 -1
  36. package/dist/{src/foundation → foundation}/release/bootstrap.js +42 -10
  37. package/dist/foundation/release/endpoints.d.ts +20 -0
  38. package/dist/foundation/release/endpoints.js +50 -0
  39. package/dist/{src/foundation → foundation}/release/index.d.ts +1 -0
  40. package/dist/{src/foundation → foundation}/release/index.js +1 -0
  41. package/dist/{src/foundation → foundation}/release/release-gc.d.ts +4 -1
  42. package/dist/{src/foundation → foundation}/release/release-gc.js +9 -1
  43. package/dist/{src/foundation → foundation}/release/update.d.ts +9 -1
  44. package/dist/{src/foundation → foundation}/release/update.js +69 -35
  45. package/dist/{src/foundation → foundation}/storage/control-store.d.ts +1 -1
  46. package/dist/{src/foundation → foundation}/storage/control-store.js +1 -1
  47. package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.d.ts +1 -1
  48. package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.js +1 -1
  49. package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.d.ts +1 -1
  50. package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.js +1 -1
  51. package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.d.ts +1 -1
  52. package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.js +1 -1
  53. package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.d.ts +1 -1
  54. package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.js +1 -1
  55. package/dist/{src/foundation → foundation}/structured-agent-runtime/state.d.ts +1 -1
  56. package/dist/{src/foundation → foundation}/structured-agent-runtime/state.js +1 -1
  57. package/dist/foundation/supervision/index.d.ts +3 -0
  58. package/dist/foundation/supervision/index.js +3 -0
  59. package/dist/{src/foundation → foundation}/supervision/main.js +11 -5
  60. package/dist/foundation/supervision/paths.d.ts +1 -0
  61. package/dist/foundation/supervision/paths.js +1 -0
  62. package/dist/{src/foundation → foundation}/supervision/server.d.ts +18 -1
  63. package/dist/{src/foundation → foundation}/supervision/server.js +52 -1
  64. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.d.ts +1 -1
  65. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.js +2 -2
  66. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.d.ts +1 -1
  67. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.d.ts +1 -1
  68. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.d.ts +1 -1
  69. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.js +1 -1
  70. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.d.ts +1 -1
  71. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.d.ts +1 -1
  72. package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.d.ts +1 -1
  73. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.d.ts +2 -2
  74. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.js +113 -16
  75. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.js +2 -2
  76. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.d.ts +1 -1
  77. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.d.ts +1 -1
  78. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.js +1 -1
  79. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.d.ts +1 -1
  80. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.d.ts +1 -1
  81. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.js +1 -1
  82. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/settings-integration.d.ts +1 -1
  83. package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.d.ts +1 -1
  84. package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/route-host.d.ts +1 -1
  85. package/dist/{src/foundation/pi-owned-ui-integration/session-shell.d.ts → integrations/pi/owned-ui/session-shell-root.d.ts} +13 -46
  86. package/dist/integrations/pi/owned-ui/session-shell-root.js +722 -0
  87. package/dist/integrations/pi/owned-ui/session-shell.d.ts +46 -0
  88. package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/session-shell.js +24 -704
  89. package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.d.ts +1 -1
  90. package/dist/native/darwin-arm64/manifest.json +1 -1
  91. package/dist/native/linux-x64/manifest.json +1 -1
  92. package/dist/native/win32-x64/manifest.json +2 -2
  93. package/dist/native/win32-x64/process-guardian.exe +0 -0
  94. package/dist/{src/foundation/ui-apps → ui/apps}/contracts.d.ts +1 -1
  95. package/dist/{src/foundation/ui-apps → ui/apps}/host.d.ts +1 -1
  96. package/dist/{src/foundation/ui-apps → ui/apps}/host.js +1 -1
  97. package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.d.ts +1 -1
  98. package/docs/architecture/boundaries.md +8 -8
  99. package/docs/architecture/project-structure.md +52 -29
  100. package/docs/architecture/toolchain.md +5 -5
  101. package/docs/ci-release-runbook.md +76 -79
  102. package/docs/features/launch-profiles.md +7 -9
  103. package/docs/manual-owned-ui-checkpoint.md +52 -0
  104. package/docs/manual-terminal-colour-check.md +1 -1
  105. package/package.json +24 -22
  106. package/dist/src/composition/index.d.ts +0 -48
  107. package/dist/src/composition/index.js +0 -258
  108. package/dist/src/foundation/lifecycle/paths.d.ts +0 -10
  109. package/dist/src/foundation/supervision/index.d.ts +0 -3
  110. package/dist/src/foundation/supervision/index.js +0 -3
  111. package/dist/src/foundation/supervision/paths.d.ts +0 -1
  112. package/dist/src/foundation/supervision/paths.js +0 -1
  113. package/docs/manual-transparent-checkpoint.md +0 -53
  114. /package/dist/{src/cli → cli}/capabilities.d.ts +0 -0
  115. /package/dist/{src/cli → cli}/capabilities.js +0 -0
  116. /package/dist/{src/cli → cli}/dispatch.d.ts +0 -0
  117. /package/dist/{src/cli → cli}/index.d.ts +0 -0
  118. /package/dist/{src/cli → cli}/index.js +0 -0
  119. /package/dist/{src/cli → cli}/version-stats.d.ts +0 -0
  120. /package/dist/{src/cli → cli}/version.d.ts +0 -0
  121. /package/dist/{src/cli → cli}/version.js +0 -0
  122. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.d.ts +0 -0
  123. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.js +0 -0
  124. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.d.ts +0 -0
  125. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.js +0 -0
  126. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.d.ts +0 -0
  127. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.js +0 -0
  128. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.d.ts +0 -0
  129. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.js +0 -0
  130. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.d.ts +0 -0
  131. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.js +0 -0
  132. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.d.ts +0 -0
  133. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.js +0 -0
  134. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.d.ts +0 -0
  135. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.js +0 -0
  136. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.d.ts +0 -0
  137. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.js +0 -0
  138. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.d.ts +0 -0
  139. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.js +0 -0
  140. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.d.ts +0 -0
  141. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.js +0 -0
  142. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/index.d.ts +0 -0
  143. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/index.js +0 -0
  144. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.d.ts +0 -0
  145. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.js +0 -0
  146. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.d.ts +0 -0
  147. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.js +0 -0
  148. /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.d.ts +0 -0
  149. /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.js +0 -0
  150. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.d.ts +0 -0
  151. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.js +0 -0
  152. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.d.ts +0 -0
  153. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.js +0 -0
  154. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.d.ts +0 -0
  155. /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.js +0 -0
  156. /package/dist/{src/features → features}/launch/development-launch.d.ts +0 -0
  157. /package/dist/{src/features → features}/launch/development-launch.js +0 -0
  158. /package/dist/{src/features → features}/launch/index.d.ts +0 -0
  159. /package/dist/{src/features → features}/launch/index.js +0 -0
  160. /package/dist/{src/features → features}/launch/initialize-profile.d.ts +0 -0
  161. /package/dist/{src/features → features}/launch/initialize-profile.js +0 -0
  162. /package/dist/{src/features → features}/launch/intent.d.ts +0 -0
  163. /package/dist/{src/features → features}/launch/intent.js +0 -0
  164. /package/dist/{src/features → features}/launch/prepare-launch.d.ts +0 -0
  165. /package/dist/{src/features → features}/launch/prepare-launch.js +0 -0
  166. /package/dist/{src/features → features}/launch/profile-paths.d.ts +0 -0
  167. /package/dist/{src/features → features}/launch/profile-paths.js +0 -0
  168. /package/dist/{src/features → features}/launch/profiles.d.ts +0 -0
  169. /package/dist/{src/features → features}/launch/profiles.js +0 -0
  170. /package/dist/{src/features → features}/launch/runtime-selection.d.ts +0 -0
  171. /package/dist/{src/features → features}/launch/runtime-selection.js +0 -0
  172. /package/dist/{src/features → features}/owned-ui/diagnostics.js +0 -0
  173. /package/dist/{src/features → features}/owned-ui/index.d.ts +0 -0
  174. /package/dist/{src/features → features}/owned-ui/index.js +0 -0
  175. /package/dist/{src/features → features}/owned-ui/run.js +0 -0
  176. /package/dist/{src/features → features}/workspace/capabilities.js +0 -0
  177. /package/dist/{src/features → features}/workspace/index.d.ts +0 -0
  178. /package/dist/{src/features → features}/workspace/index.js +0 -0
  179. /package/dist/{src/features → features}/workspace/presentation.d.ts +0 -0
  180. /package/dist/{src/features → features}/workspace/presentation.js +0 -0
  181. /package/dist/{src/features → features}/workspace/reconciliation.d.ts +0 -0
  182. /package/dist/{src/features → features}/workspace/reconciliation.js +0 -0
  183. /package/dist/{src/features → features}/workspace/router.js +0 -0
  184. /package/dist/{src/features → features}/workspace/store.js +0 -0
  185. /package/dist/{src/foundation → foundation}/launch-guardian/index.d.ts +0 -0
  186. /package/dist/{src/foundation → foundation}/launch-guardian/index.js +0 -0
  187. /package/dist/{src/foundation → foundation}/launch-guardian/main.d.ts +0 -0
  188. /package/dist/{src/foundation → foundation}/lifecycle/commands.d.ts +0 -0
  189. /package/dist/{src/foundation → foundation}/lifecycle/commands.js +0 -0
  190. /package/dist/{src/foundation → foundation}/lifecycle/index.d.ts +0 -0
  191. /package/dist/{src/foundation → foundation}/lifecycle/index.js +0 -0
  192. /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.d.ts +0 -0
  193. /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.js +0 -0
  194. /package/dist/{src/foundation → foundation}/lifecycle/model.d.ts +0 -0
  195. /package/dist/{src/foundation → foundation}/lifecycle/model.js +0 -0
  196. /package/dist/{src/foundation → foundation}/native-host-protocol/codec.d.ts +0 -0
  197. /package/dist/{src/foundation → foundation}/native-host-protocol/codec.js +0 -0
  198. /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.d.ts +0 -0
  199. /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.js +0 -0
  200. /package/dist/{src/foundation → foundation}/native-host-protocol/index.d.ts +0 -0
  201. /package/dist/{src/foundation → foundation}/native-host-protocol/index.js +0 -0
  202. /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.d.ts +0 -0
  203. /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.js +0 -0
  204. /package/dist/{src/foundation → foundation}/process-containment/artifact.d.ts +0 -0
  205. /package/dist/{src/foundation → foundation}/process-containment/artifact.js +0 -0
  206. /package/dist/{src/foundation → foundation}/process-containment/contracts.d.ts +0 -0
  207. /package/dist/{src/foundation → foundation}/process-containment/contracts.js +0 -0
  208. /package/dist/{src/foundation → foundation}/process-containment/index.d.ts +0 -0
  209. /package/dist/{src/foundation → foundation}/process-containment/index.js +0 -0
  210. /package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.d.ts +0 -0
  211. /package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.js +0 -0
  212. /package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.d.ts +0 -0
  213. /package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.js +0 -0
  214. /package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.d.ts +0 -0
  215. /package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.js +0 -0
  216. /package/dist/{src/foundation → foundation}/protocol/client.d.ts +0 -0
  217. /package/dist/{src/foundation → foundation}/protocol/client.js +0 -0
  218. /package/dist/{src/foundation → foundation}/protocol/index.d.ts +0 -0
  219. /package/dist/{src/foundation → foundation}/protocol/index.js +0 -0
  220. /package/dist/{src/foundation → foundation}/protocol/messages.d.ts +0 -0
  221. /package/dist/{src/foundation → foundation}/protocol/messages.js +0 -0
  222. /package/dist/{src/foundation → foundation}/release/bootstrap.d.ts +0 -0
  223. /package/dist/{src/foundation → foundation}/release/cohort-selection.d.ts +0 -0
  224. /package/dist/{src/foundation → foundation}/release/cohort-selection.js +0 -0
  225. /package/dist/{src/foundation → foundation}/release/cohort-state.d.ts +0 -0
  226. /package/dist/{src/foundation → foundation}/release/cohort-state.js +0 -0
  227. /package/dist/{src/foundation → foundation}/release/concurrency.d.ts +0 -0
  228. /package/dist/{src/foundation → foundation}/release/concurrency.js +0 -0
  229. /package/dist/{src/foundation → foundation}/release/process-cleanup.d.ts +0 -0
  230. /package/dist/{src/foundation → foundation}/release/process-cleanup.js +0 -0
  231. /package/dist/{src/foundation → foundation}/release/release-store.d.ts +0 -0
  232. /package/dist/{src/foundation → foundation}/release/release-store.js +0 -0
  233. /package/dist/{src/foundation → foundation}/release/release.d.ts +0 -0
  234. /package/dist/{src/foundation → foundation}/release/release.js +0 -0
  235. /package/dist/{src/foundation → foundation}/release/stable-release.d.ts +0 -0
  236. /package/dist/{src/foundation → foundation}/release/stable-release.js +0 -0
  237. /package/dist/{src/foundation → foundation}/release/update-transaction.d.ts +0 -0
  238. /package/dist/{src/foundation → foundation}/release/update-transaction.js +0 -0
  239. /package/dist/{src/foundation → foundation}/storage/index.d.ts +0 -0
  240. /package/dist/{src/foundation → foundation}/storage/index.js +0 -0
  241. /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.d.ts +0 -0
  242. /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.js +0 -0
  243. /package/dist/{src/foundation → foundation}/supervision/main.d.ts +0 -0
  244. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.js +0 -0
  245. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.d.ts +0 -0
  246. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.d.ts +0 -0
  247. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.js +0 -0
  248. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.d.ts +0 -0
  249. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.js +0 -0
  250. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.d.ts +0 -0
  251. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.js +0 -0
  252. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-editor-autocomplete.d.ts +0 -0
  253. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-editor-autocomplete.js +0 -0
  254. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.js +0 -0
  255. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.js +0 -0
  256. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.js +0 -0
  257. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.js +0 -0
  258. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.d.ts +0 -0
  259. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.js +0 -0
  260. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.d.ts +0 -0
  261. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.js +0 -0
  262. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.d.ts +0 -0
  263. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.js +0 -0
  264. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.d.ts +0 -0
  265. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.js +0 -0
  266. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.d.ts +0 -0
  267. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.js +0 -0
  268. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/earendil-announcement.d.ts +0 -0
  269. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/earendil-announcement.js +0 -0
  270. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.d.ts +0 -0
  271. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.js +0 -0
  272. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.d.ts +0 -0
  273. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.js +0 -0
  274. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.d.ts +0 -0
  275. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.js +0 -0
  276. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.d.ts +0 -0
  277. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.js +0 -0
  278. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/owned-editor.d.ts +0 -0
  279. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/owned-editor.js +0 -0
  280. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.d.ts +0 -0
  281. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.js +0 -0
  282. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.js +0 -0
  283. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.d.ts +0 -0
  284. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.js +0 -0
  285. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.d.ts +0 -0
  286. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.js +0 -0
  287. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.d.ts +0 -0
  288. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.js +0 -0
  289. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.d.ts +0 -0
  290. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.js +0 -0
  291. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.d.ts +0 -0
  292. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.js +0 -0
  293. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.d.ts +0 -0
  294. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.js +0 -0
  295. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.d.ts +0 -0
  296. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.js +0 -0
  297. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.d.ts +0 -0
  298. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.js +0 -0
  299. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.d.ts +0 -0
  300. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.js +0 -0
  301. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.d.ts +0 -0
  302. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.js +0 -0
  303. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.d.ts +0 -0
  304. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.d.ts +0 -0
  305. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.js +0 -0
  306. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.js +0 -0
  307. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/pi-settings-metadata.json +0 -0
  308. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.d.ts +0 -0
  309. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.js +0 -0
  310. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.js +0 -0
  311. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.d.ts +0 -0
  312. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.js +0 -0
  313. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/settings-integration.js +0 -0
  314. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.js +0 -0
  315. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.d.ts +0 -0
  316. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.js +0 -0
  317. /package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/index.d.ts +0 -0
  318. /package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/index.js +0 -0
  319. /package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/route-host.js +0 -0
  320. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.d.ts +0 -0
  321. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.js +0 -0
  322. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.d.ts +0 -0
  323. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.js +0 -0
  324. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.d.ts +0 -0
  325. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.js +0 -0
  326. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/index.d.ts +0 -0
  327. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/index.js +0 -0
  328. /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.js +0 -0
  329. /package/dist/{src/product-identity.d.ts → product-identity.d.ts} +0 -0
  330. /package/dist/{src/product-identity.js → product-identity.js} +0 -0
  331. /package/dist/{src/product-identity.json → product-identity.json} +0 -0
  332. /package/dist/{src/foundation/ui-apps → ui/apps}/contracts.js +0 -0
  333. /package/dist/{src/foundation/ui-apps → ui/apps}/index.d.ts +0 -0
  334. /package/dist/{src/foundation/ui-apps → ui/apps}/index.js +0 -0
  335. /package/dist/{src/foundation/ui-apps → ui/apps}/registry.d.ts +0 -0
  336. /package/dist/{src/foundation/ui-apps → ui/apps}/registry.js +0 -0
  337. /package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.d.ts +0 -0
  338. /package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.js +0 -0
  339. /package/dist/{src/foundation/ui-components → ui/components}/frame.d.ts +0 -0
  340. /package/dist/{src/foundation/ui-components → ui/components}/frame.js +0 -0
  341. /package/dist/{src/foundation/ui-components → ui/components}/index.d.ts +0 -0
  342. /package/dist/{src/foundation/ui-components → ui/components}/index.js +0 -0
  343. /package/dist/{src/foundation/ui-components → ui/components}/label.d.ts +0 -0
  344. /package/dist/{src/foundation/ui-components → ui/components}/label.js +0 -0
  345. /package/dist/{src/foundation/ui-components → ui/components}/line-input.d.ts +0 -0
  346. /package/dist/{src/foundation/ui-components → ui/components}/line-input.js +0 -0
  347. /package/dist/{src/foundation/ui-components → ui/components}/list-block.d.ts +0 -0
  348. /package/dist/{src/foundation/ui-components → ui/components}/list-block.js +0 -0
  349. /package/dist/{src/foundation/ui-components → ui/components}/list-view.d.ts +0 -0
  350. /package/dist/{src/foundation/ui-components → ui/components}/list-view.js +0 -0
  351. /package/dist/{src/foundation/ui-components → ui/components}/mouse.d.ts +0 -0
  352. /package/dist/{src/foundation/ui-components → ui/components}/mouse.js +0 -0
  353. /package/dist/{src/foundation/ui-components → ui/components}/pane.d.ts +0 -0
  354. /package/dist/{src/foundation/ui-components → ui/components}/pane.js +0 -0
  355. /package/dist/{src/foundation/ui-components → ui/components}/revision.d.ts +0 -0
  356. /package/dist/{src/foundation/ui-components → ui/components}/revision.js +0 -0
  357. /package/dist/{src/foundation/ui-components → ui/components}/scrollbar.d.ts +0 -0
  358. /package/dist/{src/foundation/ui-components → ui/components}/scrollbar.js +0 -0
  359. /package/dist/{src/foundation/ui-components → ui/components}/shortcuts.d.ts +0 -0
  360. /package/dist/{src/foundation/ui-components → ui/components}/shortcuts.js +0 -0
  361. /package/dist/{src/foundation/ui-components → ui/components}/spans.d.ts +0 -0
  362. /package/dist/{src/foundation/ui-components → ui/components}/spans.js +0 -0
  363. /package/dist/{src/foundation/ui-components → ui/components}/status-line.d.ts +0 -0
  364. /package/dist/{src/foundation/ui-components → ui/components}/status-line.js +0 -0
  365. /package/dist/{src/foundation/ui-components → ui/components}/stepper.d.ts +0 -0
  366. /package/dist/{src/foundation/ui-components → ui/components}/stepper.js +0 -0
  367. /package/dist/{src/foundation/ui-components → ui/components}/surface.d.ts +0 -0
  368. /package/dist/{src/foundation/ui-components → ui/components}/surface.js +0 -0
  369. /package/dist/{src/foundation/ui-components → ui/components}/text.d.ts +0 -0
  370. /package/dist/{src/foundation/ui-components → ui/components}/text.js +0 -0
  371. /package/dist/{src/foundation/ui-components → ui/components}/theme.d.ts +0 -0
  372. /package/dist/{src/foundation/ui-components → ui/components}/theme.js +0 -0
  373. /package/dist/{src/foundation/ui-components → ui/components}/value-menu.d.ts +0 -0
  374. /package/dist/{src/foundation/ui-components → ui/components}/value-menu.js +0 -0
  375. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.d.ts +0 -0
  376. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.js +0 -0
  377. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.d.ts +0 -0
  378. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.js +0 -0
  379. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.d.ts +0 -0
  380. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.js +0 -0
  381. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.d.ts +0 -0
  382. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.js +0 -0
  383. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.d.ts +0 -0
  384. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.js +0 -0
  385. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.js +0 -0
  386. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.d.ts +0 -0
  387. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.js +0 -0
@@ -0,0 +1,73 @@
1
+ import { SETTINGS_APP_ID, SETTINGS_ROUTE, SettingsApp } from "../features/owned-ui/index.js";
2
+ import { piTheme } from "../integrations/pi/components/index.js";
3
+ import { UiAppHost, UiAppRegistry } from "../ui/apps/index.js";
4
+ import { faint } from "../ui/components/index.js";
5
+ /**
6
+ * Registers the A1-owned screens and adapts the app host to the shell's route
7
+ * seam. The shell mounts whatever surface it is handed and forwards keys; it
8
+ * never learns what an app is.
9
+ */
10
+ export function createOwnedRouteHost(settings) {
11
+ const registry = new UiAppRegistry();
12
+ registry.register({ id: SETTINGS_APP_ID, route: SETTINGS_ROUTE, create: () => new SettingsApp(settings) });
13
+ return {
14
+ claims: route => registry.forRoute(route) !== null,
15
+ open: route => {
16
+ const registration = registry.forRoute(route);
17
+ if (registration === null)
18
+ return null;
19
+ let size = { width: 80, height: 24 };
20
+ let frame = [];
21
+ let closed = false;
22
+ let onRender = () => undefined;
23
+ let onExit = () => undefined;
24
+ const host = new UiAppHost({
25
+ registry,
26
+ closeOnInterrupt: true,
27
+ theme: pinnedTheme(),
28
+ surface: {
29
+ size: () => size,
30
+ requestRender: () => onRender(),
31
+ exit: () => onExit(),
32
+ present: lines => {
33
+ if (lines === null)
34
+ closed = true;
35
+ else
36
+ frame = lines;
37
+ },
38
+ },
39
+ });
40
+ host.open(registration.id);
41
+ const surface = {
42
+ id: registration.id,
43
+ render: (width, height) => {
44
+ size = { width, height };
45
+ host.render();
46
+ return frame.length === height ? frame : [...frame.slice(0, height), ...Array(Math.max(0, height - frame.length)).fill("")];
47
+ },
48
+ handleInput: data => host.handleInput(data).consumed,
49
+ handleMouse: event => host.handleMouse(event).consumed,
50
+ isClosed: () => closed || !host.isPresenting,
51
+ close: () => host.close(),
52
+ onRenderRequested: listener => { onRender = listener; },
53
+ onExitRequested: listener => { onExit = listener; },
54
+ };
55
+ return surface;
56
+ },
57
+ };
58
+ }
59
+ /** Maps A1 UI tokens onto the pinned Pi theme so owned screens match the shell. */
60
+ function pinnedTheme() {
61
+ return {
62
+ fg: (token, text) => piTheme().fg(token, text),
63
+ bold: (text) => piTheme().bold(text),
64
+ // Unpainted, so a list reads against the terminal the reader actually has
65
+ // rather than against the background the configured theme was built for.
66
+ plain: (text) => text,
67
+ // Quiet, and quieter again: the terminal's own faint attribute over the
68
+ // dimmest colour the theme has.
69
+ disabled: (text) => faint(piTheme().fg("dim", text)),
70
+ highlight: (text) => `${text}`,
71
+ panel: (text) => `${text}`,
72
+ };
73
+ }
@@ -1,4 +1,4 @@
1
- import { type OwnedUiCommand, type OwnedUiCustomization, type OwnedUiSlotId, type OwnedUiTranscriptBlock } from "../../foundation/owned-ui-contracts/index.js";
1
+ import { type OwnedUiCommand, type OwnedUiCustomization, type OwnedUiSlotId, type OwnedUiTranscriptBlock } from "../../contracts/owned-ui/index.js";
2
2
  export interface OwnedUiSlotImplementation {
3
3
  readonly payload: unknown;
4
4
  render?(input: unknown, width: number): readonly string[];
@@ -1,4 +1,4 @@
1
- import { assertOwnedUiCustomization, } from "../../foundation/owned-ui-contracts/index.js";
1
+ import { assertOwnedUiCustomization, } from "../../contracts/owned-ui/index.js";
2
2
  export class OwnedCommandSurface {
3
3
  #handlers = new Map();
4
4
  #sequence = 0;
@@ -1,4 +1,4 @@
1
- import type { OwnedUiDiagnostics } from "../../foundation/owned-ui-contracts/index.js";
1
+ import type { OwnedUiDiagnostics } from "../../contracts/owned-ui/index.js";
2
2
  export interface OwnedUiFrameObservation {
3
3
  readonly requestedFrames: number;
4
4
  readonly presentedFrames: number;
@@ -1,5 +1,5 @@
1
- import type { OwnedUiApplicationPort } from "../../foundation/presentation-contracts/index.js";
2
- import type { OwnedUiSettingsSession } from "../../foundation/owned-ui-settings/index.js";
1
+ import type { OwnedUiApplicationPort } from "../../contracts/presentation/index.js";
2
+ import type { OwnedUiSettingsSession } from "../../ui/settings/index.js";
3
3
  export interface OwnedUiRunOptions {
4
4
  readonly application: OwnedUiApplicationPort;
5
5
  /**
@@ -1,6 +1,6 @@
1
- import type { AppHostServices, UiApp } from "../../foundation/ui-apps/index.js";
2
- import { ShortcutRegistry, type PaneInputResult, type PaneMouseEvent, type PaneRect } from "../../foundation/ui-components/index.js";
3
- import type { OwnedUiSettingsSession } from "../../foundation/owned-ui-settings/index.js";
1
+ import type { AppHostServices, UiApp } from "../../ui/apps/index.js";
2
+ import { ShortcutRegistry, type PaneInputResult, type PaneMouseEvent, type PaneRect } from "../../ui/components/index.js";
3
+ import type { OwnedUiSettingsSession } from "../../ui/settings/index.js";
4
4
  export declare const SETTINGS_APP_ID = "settings";
5
5
  export declare const SETTINGS_ROUTE = "settings";
6
6
  type Action = "move-up" | "move-down" | "block-up" | "block-down" | "first" | "last" | "page-up" | "page-down" | "previous-value" | "next-value" | "activate" | "open-filter" | "close" | "part-previous" | "part-next" | "part-change";
@@ -1,4 +1,4 @@
1
- import { GLOBAL_SCOPE, LineInput, PLAIN_THEME, ShortcutRegistry, PROMPT_GLYPH, blockJumpTarget, dialogValueColumn, numericValues, RAIL_COLUMNS, renderDialogPanel, renderEmptyState, renderGroupHeader, renderInputRow, renderStatusLine, renderListRow, renderNote, dialogRowAt, menuRowAt, regionAt, renderValueMenu, withScrollbarRail, stepperEnds, steppedValue, valueColumnFor, valueMenuFrame, promptRule, caretCell, blockRowSpan, displayWidth, faint, handleLineInputKey, humanizeLabel, humanizeTitle, indexOfKey, isThumbRow, layoutList, moveSelection, rowKey, scrollForSelection, scrollbarGeometry, selectableIndexes, } from "../../foundation/ui-components/index.js";
1
+ import { GLOBAL_SCOPE, LineInput, PLAIN_THEME, ShortcutRegistry, PROMPT_GLYPH, blockJumpTarget, dialogValueColumn, numericValues, RAIL_COLUMNS, renderDialogPanel, renderEmptyState, renderGroupHeader, renderInputRow, renderStatusLine, renderListRow, renderNote, dialogRowAt, menuRowAt, regionAt, renderValueMenu, withScrollbarRail, stepperEnds, steppedValue, valueColumnFor, valueMenuFrame, promptRule, caretCell, blockRowSpan, displayWidth, faint, handleLineInputKey, humanizeLabel, humanizeTitle, indexOfKey, isThumbRow, layoutList, moveSelection, rowKey, scrollForSelection, scrollbarGeometry, selectableIndexes, } from "../../ui/components/index.js";
2
2
  export const SETTINGS_APP_ID = "settings";
3
3
  export const SETTINGS_ROUTE = "settings";
4
4
  const SCOPE = SETTINGS_APP_ID;
@@ -1,4 +1,4 @@
1
- import type { ManagedAgentDescriptor } from "../../foundation/workspace-contracts/index.js";
1
+ import type { ManagedAgentDescriptor } from "../../contracts/workspace/index.js";
2
2
  export type WorkspaceCapabilityAction = {
3
3
  readonly type: "structured-command";
4
4
  readonly command: string;
@@ -1,4 +1,4 @@
1
- import { type ManagedAgentDescriptor } from "../../foundation/workspace-contracts/index.js";
1
+ import { type ManagedAgentDescriptor } from "../../contracts/workspace/index.js";
2
2
  export interface WorkspaceAgentFailure {
3
3
  readonly code: string;
4
4
  readonly message: string;
@@ -1,4 +1,4 @@
1
- import { assertManagedAgentDescriptor, } from "../../foundation/workspace-contracts/index.js";
1
+ import { assertManagedAgentDescriptor, } from "../../contracts/workspace/index.js";
2
2
  const REMOVABLE_STATES = new Set(["stopped", "failed", "discontinuous"]);
3
3
  export class WorkspaceReducer {
4
4
  workspaceId;
@@ -1,5 +1,5 @@
1
1
  import { type StructuredCommandRecord } from "../../foundation/structured-agent-runtime/index.js";
2
- import type { ManagedAgentDescriptor } from "../../foundation/workspace-contracts/index.js";
2
+ import type { ManagedAgentDescriptor } from "../../contracts/workspace/index.js";
3
3
  import { WorkspaceReducer, type WorkspaceAgentState, type WorkspaceView } from "./reducer.js";
4
4
  export interface RoutedStructuredCommand {
5
5
  readonly agentId: string;
@@ -1,4 +1,4 @@
1
- import type { AgentRecoveryAuthority, RecoveryReferenceId } from "../../foundation/workspace-contracts/index.js";
1
+ import type { AgentRecoveryAuthority, RecoveryReferenceId } from "../../contracts/workspace/index.js";
2
2
  import { WorkspaceReducer, type WorkspaceView } from "./reducer.js";
3
3
  export declare class WorkspaceStore {
4
4
  #private;
@@ -4,7 +4,7 @@ import { resolve } from "node:path";
4
4
  import { assertLaunchProfileId } from "../lifecycle/index.js";
5
5
  import { closeVerifiedContainment, LinuxNativeProcessInspector, NativeGuardianContainment, resolveProcessGuardianPath, verifyProcessGuardianArtifact, WindowsNativeProcessInspector, } from "../process-containment/index.js";
6
6
  import { SupervisorClient } from "../protocol/index.js";
7
- import { resolveProductPaths } from "../supervision/index.js";
7
+ import { resolveCohortEndpoint, resolveProductPaths } from "../supervision/index.js";
8
8
  export async function runLaunchGuardian(options) {
9
9
  assertLaunchProfileId(options.profileId);
10
10
  const environment = { ...(options.environment ?? process.env) };
@@ -17,7 +17,13 @@ export async function runLaunchGuardian(options) {
17
17
  if (!guardianIdentity)
18
18
  throw diagnosticError("launch guardian cannot verify its own native process identity", "PROCESS_IDENTITY_UNAVAILABLE");
19
19
  const client = options.control ?? new SupervisorClient(environment[PRODUCT_IDENTITY.environment.releaseId]);
20
- await client.connect(paths.endpoint);
20
+ // An instance belongs to the cohort that launched it and talks to that cohort's endpoint
21
+ // for its whole life, whatever release becomes the active one meanwhile.
22
+ const releaseId = environment[PRODUCT_IDENTITY.environment.releaseId];
23
+ const endpoint = releaseId
24
+ ? resolveCohortEndpoint(paths, releaseId, environment).endpoint
25
+ : paths.endpoint;
26
+ await client.connect(endpoint);
21
27
  const containment = options.containment ?? new NativeGuardianContainment(instanceId, helperPath, resolve(paths.runtimeDir, "launch-instances", `${instanceId}.ready.json`));
22
28
  const stop = stopRequests(client, instanceId);
23
29
  let rootIdentity = null;
@@ -0,0 +1,28 @@
1
+ export interface ProductPaths {
2
+ readonly configDir: string;
3
+ readonly dataDir: string;
4
+ readonly runtimeDir: string;
5
+ readonly databasePath: string;
6
+ /** The endpoint written by releases that predate cohort-scoped identity. */
7
+ readonly endpoint: string;
8
+ /** The metadata written by releases that predate cohort-scoped identity. */
9
+ readonly endpointMetadataPath: string;
10
+ readonly endpointsDir: string;
11
+ readonly supervisorLogPath: string;
12
+ }
13
+ /** Where one cohort listens, and where it records that it is listening. */
14
+ export interface CohortEndpointPaths {
15
+ readonly endpoint: string;
16
+ readonly endpointMetadataPath: string;
17
+ }
18
+ /**
19
+ * Endpoint identity for one release cohort. Two cohorts can be live at once — an update
20
+ * leaves a working session on the release it started on — so the name a supervisor listens
21
+ * on has to name the release as well as the runtime directory, or the two contend for one
22
+ * endpoint and replacing one means ending the other.
23
+ *
24
+ * An explicit endpoint override keeps its single endpoint: it is how an isolated run pins
25
+ * the address it is going to talk to.
26
+ */
27
+ export declare function resolveCohortEndpoint(paths: ProductPaths, releaseId: string, environment?: NodeJS.ProcessEnv, hostPlatform?: NodeJS.Platform): CohortEndpointPaths;
28
+ export declare function resolveProductPaths(environment?: NodeJS.ProcessEnv, hostPlatform?: NodeJS.Platform, fallbackHome?: string): ProductPaths;
@@ -2,6 +2,26 @@ import { createHash } from "node:crypto";
2
2
  import { homedir, platform } from "node:os";
3
3
  import { posix, win32 } from "node:path";
4
4
  import { PRODUCT_IDENTITY } from "../../product-identity.js";
5
+ /**
6
+ * Endpoint identity for one release cohort. Two cohorts can be live at once — an update
7
+ * leaves a working session on the release it started on — so the name a supervisor listens
8
+ * on has to name the release as well as the runtime directory, or the two contend for one
9
+ * endpoint and replacing one means ending the other.
10
+ *
11
+ * An explicit endpoint override keeps its single endpoint: it is how an isolated run pins
12
+ * the address it is going to talk to.
13
+ */
14
+ export function resolveCohortEndpoint(paths, releaseId, environment = process.env, hostPlatform = platform()) {
15
+ if (environment[PRODUCT_IDENTITY.environment.endpoint]) {
16
+ return { endpoint: paths.endpoint, endpointMetadataPath: paths.endpointMetadataPath };
17
+ }
18
+ const path = hostPlatform === "win32" ? win32 : posix;
19
+ const token = createHash("sha256").update(releaseId).digest("hex").slice(0, 16);
20
+ const endpoint = hostPlatform === "win32"
21
+ ? `${paths.endpoint}-${token}`
22
+ : path.join(paths.runtimeDir, `${token}-${PRODUCT_IDENTITY.endpoint.unixSocketFilename}`);
23
+ return { endpoint, endpointMetadataPath: path.join(paths.endpointsDir, `${token}.json`) };
24
+ }
5
25
  export function resolveProductPaths(environment = process.env, hostPlatform = platform(), fallbackHome = homedir()) {
6
26
  const windows = hostPlatform === "win32";
7
27
  const path = windows ? win32 : posix;
@@ -37,6 +57,7 @@ export function resolveProductPaths(environment = process.env, hostPlatform = pl
37
57
  databasePath: path.resolve(databaseOverride ?? path.join(dataDir, PRODUCT_IDENTITY.endpoint.databaseFilename)),
38
58
  endpoint,
39
59
  endpointMetadataPath: path.join(runtimeDir, PRODUCT_IDENTITY.endpoint.metadataFilename),
60
+ endpointsDir: path.join(runtimeDir, "endpoints"),
40
61
  supervisorLogPath: path.join(runtimeDir, PRODUCT_IDENTITY.endpoint.supervisorLogFilename),
41
62
  };
42
63
  }
@@ -1,4 +1,4 @@
1
- import { type CorrelationId, type NativeHostCommand, type NativeHostEvent, type NativeHostHello, type PaneId, type TerminalSessionLaunch } from "../workspace-contracts/index.js";
1
+ import { type CorrelationId, type NativeHostCommand, type NativeHostEvent, type NativeHostHello, type PaneId, type TerminalSessionLaunch } from "../../contracts/workspace/index.js";
2
2
  export declare const NATIVE_HOST_PROTOCOL_NAME: string;
3
3
  export declare const MAX_NATIVE_HOST_MESSAGE_BYTES: number;
4
4
  export type NativeHostProofMessage = {
@@ -1,4 +1,4 @@
1
- import { NATIVE_HOST_PROTOCOL_VERSION, assertNativeHostCommand, assertTerminalSessionLaunch, } from "../workspace-contracts/index.js";
1
+ import { NATIVE_HOST_PROTOCOL_VERSION, assertNativeHostCommand, assertTerminalSessionLaunch, } from "../../contracts/workspace/index.js";
2
2
  import { PRODUCT_IDENTITY } from "../../product-identity.js";
3
3
  export const NATIVE_HOST_PROTOCOL_NAME = PRODUCT_IDENTITY.protocol.nativeHostSchema;
4
4
  export const MAX_NATIVE_HOST_MESSAGE_BYTES = 1024 * 1024;
@@ -5,9 +5,10 @@ import { platform } from "node:os";
5
5
  import { resolve } from "node:path";
6
6
  import { selectCohortLaunch } from "./cohort-selection.js";
7
7
  import { CohortStateStore } from "./cohort-state.js";
8
- import { assertLaunchProfileId, resolveProductPaths } from "../lifecycle/index.js";
8
+ import { assertLaunchProfileId, resolveCohortEndpoint, resolveProductPaths } from "../lifecycle/index.js";
9
9
  import { encodeFrame, LineFrameDecoder } from "../protocol/index.js";
10
10
  import { cleanupProvenIdleOwner, processIsAlive } from "./process-cleanup.js";
11
+ import { sweepDeadEndpoints } from "./endpoints.js";
11
12
  import { consumeMaterializationProof, materializeRelease, readCertifiedReleaseManifest, readMaterializedRelease, resolveReleaseEntryPoint, verifyMaterializedRelease } from "./release-store.js";
12
13
  import { PRODUCT_IDENTITY, PRODUCT_TEXT } from "../../product-identity.js";
13
14
  export async function runBootstrap(options) {
@@ -20,7 +21,27 @@ export async function runBootstrap(options) {
20
21
  await mkdir(paths.runtimeDir, { recursive: true, mode: 0o700 });
21
22
  const stateStore = new CohortStateStore(paths.dataDir);
22
23
  let state = await stateStore.read();
23
- let endpoint = await readEndpointMetadata(paths.endpointMetadataPath);
24
+ // Records left by cohorts whose processes are gone say nothing about ownership, and there
25
+ // can now be several of them. Clearing them first keeps the decision below about what is
26
+ // actually running.
27
+ await sweepDeadEndpoints(paths).catch(() => []);
28
+ // Each cohort keeps its own endpoint, so a launch looks for the endpoint of the release it
29
+ // is about to run rather than for the one endpoint the runtime directory used to have.
30
+ const activeReleaseId = state.references.active;
31
+ let endpointPaths = activeReleaseId === null
32
+ ? { endpoint: paths.endpoint, endpointMetadataPath: paths.endpointMetadataPath }
33
+ : resolveCohortEndpoint(paths, activeReleaseId, environment);
34
+ let endpoint = await readEndpointMetadata(endpointPaths.endpointMetadataPath);
35
+ if (endpoint === null) {
36
+ // A release that predates cohort-scoped endpoints published one endpoint for the whole
37
+ // runtime directory. Recognizing it is what lets a session started by that release keep
38
+ // working through the first launch that knows about cohorts.
39
+ const legacy = await readEndpointMetadata(paths.endpointMetadataPath);
40
+ if (legacy !== null) {
41
+ endpoint = legacy;
42
+ endpointPaths = { endpoint: paths.endpoint, endpointMetadataPath: paths.endpointMetadataPath };
43
+ }
44
+ }
24
45
  let probe = endpoint ? await probeOwnership(endpoint) : "dead";
25
46
  const installedVersion = await readInstalledVersion(options.packageRoot);
26
47
  const activeId = state.references.active;
@@ -35,10 +56,11 @@ export async function runBootstrap(options) {
35
56
  }
36
57
  if (endpoint === null || probe === "dead") {
37
58
  if (endpoint)
38
- await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
59
+ await removeEndpointArtifacts(endpointPaths.endpointMetadataPath, endpointPaths.endpoint);
39
60
  const retained = await readMaterializedRelease(active.releaseRoot);
61
+ const retainedPaths = resolveCohortEndpoint(paths, retained.releaseId, environment);
40
62
  await startSupervisor(retained, environment);
41
- await waitForVerifiedEndpoint(paths.endpointMetadataPath, retained, 8_000);
63
+ await waitForVerifiedEndpoint(retainedPaths.endpointMetadataPath, retained, 8_000);
42
64
  return await launchUi(retained, environment);
43
65
  }
44
66
  }
@@ -51,7 +73,17 @@ export async function runBootstrap(options) {
51
73
  await stateStore.activate(candidate.releaseId);
52
74
  state = await stateStore.read();
53
75
  }
54
- endpoint = await readEndpointMetadata(paths.endpointMetadataPath);
76
+ // The candidate's own endpoint decides whether this launch attaches or starts a supervisor.
77
+ // A cohort other than this one is not in the way: it listens somewhere else.
78
+ endpointPaths = resolveCohortEndpoint(paths, candidate.releaseId, environment);
79
+ endpoint = await readEndpointMetadata(endpointPaths.endpointMetadataPath);
80
+ if (endpoint === null) {
81
+ const legacy = await readEndpointMetadata(paths.endpointMetadataPath);
82
+ if (legacy !== null) {
83
+ endpoint = legacy;
84
+ endpointPaths = { endpoint: paths.endpoint, endpointMetadataPath: paths.endpointMetadataPath };
85
+ }
86
+ }
55
87
  probe = endpoint ? await probeOwnership(endpoint) : "dead";
56
88
  let decision = selectCohortLaunch(candidate, state, endpoint, probe);
57
89
  if (decision.action === "blocked") {
@@ -64,11 +96,11 @@ export async function runBootstrap(options) {
64
96
  await writeFile(resolve(paths.dataDir, `cleanup-${Date.now()}.json`), JSON.stringify(diagnostics, null, 2));
65
97
  if (!diagnostics.terminated)
66
98
  throw new Error(`could not safely clean stale ${PRODUCT_TEXT.displayName} supervisor ${endpoint.pid}`);
67
- await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
99
+ await removeEndpointArtifacts(endpointPaths.endpointMetadataPath, endpointPaths.endpoint);
68
100
  decision = selectCohortLaunch(candidate, await stateStore.read(), null, "dead");
69
101
  }
70
102
  else if (endpoint && probe === "dead") {
71
- await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
103
+ await removeEndpointArtifacts(endpointPaths.endpointMetadataPath, endpointPaths.endpoint);
72
104
  }
73
105
  if (decision.action === "launch-retained-ui") {
74
106
  const retained = await verifyMaterializedRelease(decision.releaseRoot, undefined, resolve(paths.dataDir, "releases"));
@@ -94,7 +126,7 @@ export async function runBootstrap(options) {
94
126
  output.write(`${PRODUCT_TEXT.diagnostic("could not complete bounded idle cohort shutdown; the candidate remains pending.")}\n`);
95
127
  return 1;
96
128
  }
97
- await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
129
+ await removeEndpointArtifacts(endpointPaths.endpointMetadataPath, endpointPaths.endpoint);
98
130
  await stateStore.activate(candidate.releaseId);
99
131
  decision = { action: "activate-candidate", releaseId: candidate.releaseId, releaseRoot: candidate.releaseRoot, reason: "idle cohort released ownership" };
100
132
  }
@@ -113,7 +145,7 @@ export async function runBootstrap(options) {
113
145
  selected = await readMaterializedRelease(decision.releaseRoot);
114
146
  }
115
147
  await startSupervisor(selected, environment);
116
- await waitForVerifiedEndpoint(paths.endpointMetadataPath, selected, 8_000);
148
+ await waitForVerifiedEndpoint(resolveCohortEndpoint(paths, selected.releaseId, environment).endpointMetadataPath, selected, 8_000);
117
149
  return await launchUi(selected, environment);
118
150
  }
119
151
  async function readInstalledVersion(packageRoot) {
@@ -274,7 +306,7 @@ async function activatePendingAfterBlockerExit(candidate, stateStore, paths, env
274
306
  await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
275
307
  await stateStore.activate(candidate.releaseId);
276
308
  await startSupervisor(candidate, environment);
277
- await waitForVerifiedEndpoint(paths.endpointMetadataPath, candidate, 8_000);
309
+ await waitForVerifiedEndpoint(resolveCohortEndpoint(paths, candidate.releaseId, environment).endpointMetadataPath, candidate, 8_000);
278
310
  }
279
311
  export async function releaseVerifiedIdleOwner(metadata, dataDir, operations = {}) {
280
312
  try {
@@ -0,0 +1,20 @@
1
+ import type { SupervisorEndpointMetadata } from "./cohort-state.js";
2
+ import type { CohortEndpointPaths, ProductPaths } from "../lifecycle/index.js";
3
+ export interface RecordedEndpoint {
4
+ readonly metadata: SupervisorEndpointMetadata;
5
+ readonly paths: CohortEndpointPaths;
6
+ }
7
+ /**
8
+ * Every endpoint recorded under this runtime directory: one per cohort, plus the single
9
+ * endpoint published by releases that predate cohort-scoped identity. More than one can be
10
+ * live at a time, and each is validated on its own identity rather than by being the only one.
11
+ */
12
+ export declare function listRecordedEndpoints(paths: ProductPaths): Promise<readonly RecordedEndpoint[]>;
13
+ /**
14
+ * Removes the records of cohorts whose processes are gone. A record left by a cohort that
15
+ * exited without cleaning up is not evidence of ownership, and a later launch should not have
16
+ * to reason about it. Returns the release ids whose records were removed.
17
+ */
18
+ export declare function sweepDeadEndpoints(paths: ProductPaths): Promise<readonly string[]>;
19
+ /** The releases that a live cohort is running from, and so must be retained. */
20
+ export declare function liveReleaseIds(paths: ProductPaths): Promise<readonly string[]>;
@@ -0,0 +1,50 @@
1
+ import { readdir } from "node:fs/promises";
2
+ import { resolve } from "node:path";
3
+ import { readEndpointMetadata, removeEndpointArtifacts } from "./bootstrap.js";
4
+ import { processIsAlive } from "./process-cleanup.js";
5
+ /**
6
+ * Every endpoint recorded under this runtime directory: one per cohort, plus the single
7
+ * endpoint published by releases that predate cohort-scoped identity. More than one can be
8
+ * live at a time, and each is validated on its own identity rather than by being the only one.
9
+ */
10
+ export async function listRecordedEndpoints(paths) {
11
+ const recorded = [];
12
+ const legacy = await readEndpointMetadata(paths.endpointMetadataPath);
13
+ if (legacy) {
14
+ recorded.push({ metadata: legacy, paths: { endpoint: paths.endpoint, endpointMetadataPath: paths.endpointMetadataPath } });
15
+ }
16
+ const names = await readdir(paths.endpointsDir).catch(() => []);
17
+ for (const name of names) {
18
+ if (!name.endsWith(".json"))
19
+ continue;
20
+ const endpointMetadataPath = resolve(paths.endpointsDir, name);
21
+ const metadata = await readEndpointMetadata(endpointMetadataPath);
22
+ if (metadata)
23
+ recorded.push({ metadata, paths: { endpoint: metadata.endpoint, endpointMetadataPath } });
24
+ }
25
+ return recorded;
26
+ }
27
+ /**
28
+ * Removes the records of cohorts whose processes are gone. A record left by a cohort that
29
+ * exited without cleaning up is not evidence of ownership, and a later launch should not have
30
+ * to reason about it. Returns the release ids whose records were removed.
31
+ */
32
+ export async function sweepDeadEndpoints(paths) {
33
+ const swept = [];
34
+ for (const recorded of await listRecordedEndpoints(paths)) {
35
+ if (processIsAlive(recorded.metadata.pid))
36
+ continue;
37
+ await removeEndpointArtifacts(recorded.paths.endpointMetadataPath, recorded.paths.endpoint);
38
+ swept.push(recorded.metadata.releaseId);
39
+ }
40
+ return swept;
41
+ }
42
+ /** The releases that a live cohort is running from, and so must be retained. */
43
+ export async function liveReleaseIds(paths) {
44
+ const live = [];
45
+ for (const recorded of await listRecordedEndpoints(paths)) {
46
+ if (processIsAlive(recorded.metadata.pid))
47
+ live.push(recorded.metadata.releaseId);
48
+ }
49
+ return live;
50
+ }
@@ -1,6 +1,7 @@
1
1
  export * from "./bootstrap.js";
2
2
  export * from "./cohort-selection.js";
3
3
  export * from "./cohort-state.js";
4
+ export * from "./endpoints.js";
4
5
  export * from "./process-cleanup.js";
5
6
  export * from "./release.js";
6
7
  export * from "./release-gc.js";
@@ -1,6 +1,7 @@
1
1
  export * from "./bootstrap.js";
2
2
  export * from "./cohort-selection.js";
3
3
  export * from "./cohort-state.js";
4
+ export * from "./endpoints.js";
4
5
  export * from "./process-cleanup.js";
5
6
  export * from "./release.js";
6
7
  export * from "./release-gc.js";
@@ -1,5 +1,8 @@
1
1
  import { CohortStateStore } from "./cohort-state.js";
2
+ import type { ProductPaths } from "../lifecycle/index.js";
2
3
  /** Remove only a release that has no active, pending, approval, rollback,
3
4
  * retention, process, agent, or migration reference. State is detached first;
4
5
  * a filesystem failure can leave a safe orphan but never a dangling selector. */
5
- export declare function collectRelease(store: CohortStateStore, dataDir: string, releaseId: string, externalReferences: readonly string[]): Promise<void>;
6
+ export declare function collectRelease(store: CohortStateStore, dataDir: string, releaseId: string, externalReferences: readonly string[],
7
+ /** Where endpoints are recorded, so a release a live cohort runs from is retained. */
8
+ paths?: ProductPaths): Promise<void>;
@@ -1,15 +1,23 @@
1
1
  import { rm } from "node:fs/promises";
2
2
  import { resolve } from "node:path";
3
3
  import { CohortStateStore } from "./cohort-state.js";
4
+ import { liveReleaseIds } from "./endpoints.js";
4
5
  import { verifyMaterializedRelease } from "./release-store.js";
5
6
  /** Remove only a release that has no active, pending, approval, rollback,
6
7
  * retention, process, agent, or migration reference. State is detached first;
7
8
  * a filesystem failure can leave a safe orphan but never a dangling selector. */
8
- export async function collectRelease(store, dataDir, releaseId, externalReferences) {
9
+ export async function collectRelease(store, dataDir, releaseId, externalReferences,
10
+ /** Where endpoints are recorded, so a release a live cohort runs from is retained. */
11
+ paths) {
9
12
  const state = await store.read();
10
13
  const release = state.releases[releaseId];
11
14
  if (!release)
12
15
  throw new Error(`unknown release ${releaseId}`);
16
+ // A superseded cohort keeps working until its last session leaves, and it runs from this
17
+ // content while it does. Collecting it would pull the release out from under live work.
18
+ if (paths && (await liveReleaseIds(paths)).includes(releaseId)) {
19
+ throw new Error(`release ${releaseId} is still running a live cohort`);
20
+ }
13
21
  await verifyMaterializedRelease(release.releaseRoot, undefined, resolve(dataDir, "releases"));
14
22
  await store.removeUnreferencedRelease(releaseId, externalReferences);
15
23
  await rm(release.releaseRoot, { recursive: true, force: false });
@@ -33,7 +33,7 @@ export interface UpdatePerformanceEvidence {
33
33
  export interface SelfUpdateOptions {
34
34
  packageRoot: string;
35
35
  channel?: UpdateChannel;
36
- /** A specific preview to install, named by its commit or its full version. */
36
+ /** A specific preview to install, named by its development number or full version. */
37
37
  target?: string;
38
38
  environment?: NodeJS.ProcessEnv;
39
39
  fileSystem?: UpdateFileSystem;
@@ -77,6 +77,14 @@ export interface UpdateTransactionJournal {
77
77
  clearCompleted(): Promise<void>;
78
78
  }
79
79
  export declare function createNpmProcessRunner(platform?: NodeJS.Platform): UpdateProcessRunner;
80
+ export type UpdateOwnershipAction = "clean-dead-record" | "leave-running" | "end-session";
81
+ /**
82
+ * What an update does about the owner it found. A cohort running from retained immutable
83
+ * content keeps its work: the installation replaces files it does not read, and it listens on
84
+ * its own endpoint. A cohort running from the mutable installation is the one exception,
85
+ * because that installation is exactly what is about to be replaced under it.
86
+ */
87
+ export declare function planUpdateOwnership(ownership: "live-verified" | "dead", runsFromRetainedRelease: boolean): UpdateOwnershipAction;
80
88
  export declare function createUpdateLifecycleCoordinator(environment?: NodeJS.ProcessEnv, fileSystem?: UpdateFileSystem, output?: UpdateOutput): UpdateLifecycleCoordinator;
81
89
  export declare function runSelfUpdate(options: SelfUpdateOptions): Promise<number>;
82
90
  export declare function assertUpdatePerformanceBudget(evidence: UpdatePerformanceEvidence, maximumPostNpmDurationMs?: number): void;