@timurproko/a1 0.1.0

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 (455) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/bin/addone-supervisor.js +7 -0
  4. package/bin/addone-ui.js +20 -0
  5. package/bin/addone.js +26 -0
  6. package/dist/src/cli/dispatch.d.ts +26 -0
  7. package/dist/src/cli/dispatch.d.ts.map +1 -0
  8. package/dist/src/cli/dispatch.js +35 -0
  9. package/dist/src/cli/dispatch.js.map +1 -0
  10. package/dist/src/cli/index.d.ts +4 -0
  11. package/dist/src/cli/index.d.ts.map +1 -0
  12. package/dist/src/cli/index.js +4 -0
  13. package/dist/src/cli/index.js.map +1 -0
  14. package/dist/src/cli/version-stats.d.ts +17 -0
  15. package/dist/src/cli/version-stats.d.ts.map +1 -0
  16. package/dist/src/cli/version-stats.js +68 -0
  17. package/dist/src/cli/version-stats.js.map +1 -0
  18. package/dist/src/cli/version.d.ts +3 -0
  19. package/dist/src/cli/version.d.ts.map +1 -0
  20. package/dist/src/cli/version.js +23 -0
  21. package/dist/src/cli/version.js.map +1 -0
  22. package/dist/src/features/launch/development-launch.d.ts +9 -0
  23. package/dist/src/features/launch/development-launch.d.ts.map +1 -0
  24. package/dist/src/features/launch/development-launch.js +27 -0
  25. package/dist/src/features/launch/development-launch.js.map +1 -0
  26. package/dist/src/features/launch/index.d.ts +8 -0
  27. package/dist/src/features/launch/index.d.ts.map +1 -0
  28. package/dist/src/features/launch/index.js +8 -0
  29. package/dist/src/features/launch/index.js.map +1 -0
  30. package/dist/src/features/launch/initialize-profile.d.ts +7 -0
  31. package/dist/src/features/launch/initialize-profile.d.ts.map +1 -0
  32. package/dist/src/features/launch/initialize-profile.js +59 -0
  33. package/dist/src/features/launch/initialize-profile.js.map +1 -0
  34. package/dist/src/features/launch/intent.d.ts +8 -0
  35. package/dist/src/features/launch/intent.d.ts.map +1 -0
  36. package/dist/src/features/launch/intent.js +5 -0
  37. package/dist/src/features/launch/intent.js.map +1 -0
  38. package/dist/src/features/launch/prepare-launch.d.ts +14 -0
  39. package/dist/src/features/launch/prepare-launch.d.ts.map +1 -0
  40. package/dist/src/features/launch/prepare-launch.js +22 -0
  41. package/dist/src/features/launch/prepare-launch.js.map +1 -0
  42. package/dist/src/features/launch/profile-paths.d.ts +16 -0
  43. package/dist/src/features/launch/profile-paths.d.ts.map +1 -0
  44. package/dist/src/features/launch/profile-paths.js +30 -0
  45. package/dist/src/features/launch/profile-paths.js.map +1 -0
  46. package/dist/src/features/launch/profiles.d.ts +13 -0
  47. package/dist/src/features/launch/profiles.d.ts.map +1 -0
  48. package/dist/src/features/launch/profiles.js +27 -0
  49. package/dist/src/features/launch/profiles.js.map +1 -0
  50. package/dist/src/features/launch/runtime-selection.d.ts +15 -0
  51. package/dist/src/features/launch/runtime-selection.d.ts.map +1 -0
  52. package/dist/src/features/launch/runtime-selection.js +14 -0
  53. package/dist/src/features/launch/runtime-selection.js.map +1 -0
  54. package/dist/src/features/owned-ui/customization.d.ts +36 -0
  55. package/dist/src/features/owned-ui/customization.d.ts.map +1 -0
  56. package/dist/src/features/owned-ui/customization.js +110 -0
  57. package/dist/src/features/owned-ui/customization.js.map +1 -0
  58. package/dist/src/features/owned-ui/diagnostics.d.ts +34 -0
  59. package/dist/src/features/owned-ui/diagnostics.d.ts.map +1 -0
  60. package/dist/src/features/owned-ui/diagnostics.js +95 -0
  61. package/dist/src/features/owned-ui/diagnostics.js.map +1 -0
  62. package/dist/src/features/owned-ui/index.d.ts +5 -0
  63. package/dist/src/features/owned-ui/index.d.ts.map +1 -0
  64. package/dist/src/features/owned-ui/index.js +5 -0
  65. package/dist/src/features/owned-ui/index.js.map +1 -0
  66. package/dist/src/features/owned-ui/pi-session-shell.d.ts +97 -0
  67. package/dist/src/features/owned-ui/pi-session-shell.d.ts.map +1 -0
  68. package/dist/src/features/owned-ui/pi-session-shell.js +1437 -0
  69. package/dist/src/features/owned-ui/pi-session-shell.js.map +1 -0
  70. package/dist/src/features/owned-ui/run.d.ts +9 -0
  71. package/dist/src/features/owned-ui/run.d.ts.map +1 -0
  72. package/dist/src/features/owned-ui/run.js +21 -0
  73. package/dist/src/features/owned-ui/run.js.map +1 -0
  74. package/dist/src/features/workspace/capabilities.d.ts +32 -0
  75. package/dist/src/features/workspace/capabilities.d.ts.map +1 -0
  76. package/dist/src/features/workspace/capabilities.js +76 -0
  77. package/dist/src/features/workspace/capabilities.js.map +1 -0
  78. package/dist/src/features/workspace/index.d.ts +7 -0
  79. package/dist/src/features/workspace/index.d.ts.map +1 -0
  80. package/dist/src/features/workspace/index.js +7 -0
  81. package/dist/src/features/workspace/index.js.map +1 -0
  82. package/dist/src/features/workspace/presentation.d.ts +31 -0
  83. package/dist/src/features/workspace/presentation.d.ts.map +1 -0
  84. package/dist/src/features/workspace/presentation.js +69 -0
  85. package/dist/src/features/workspace/presentation.js.map +1 -0
  86. package/dist/src/features/workspace/reconciliation.d.ts +16 -0
  87. package/dist/src/features/workspace/reconciliation.d.ts.map +1 -0
  88. package/dist/src/features/workspace/reconciliation.js +83 -0
  89. package/dist/src/features/workspace/reconciliation.js.map +1 -0
  90. package/dist/src/features/workspace/reducer.d.ts +43 -0
  91. package/dist/src/features/workspace/reducer.d.ts.map +1 -0
  92. package/dist/src/features/workspace/reducer.js +214 -0
  93. package/dist/src/features/workspace/reducer.js.map +1 -0
  94. package/dist/src/features/workspace/router.d.ts +32 -0
  95. package/dist/src/features/workspace/router.d.ts.map +1 -0
  96. package/dist/src/features/workspace/router.js +125 -0
  97. package/dist/src/features/workspace/router.js.map +1 -0
  98. package/dist/src/features/workspace/store.d.ts +18 -0
  99. package/dist/src/features/workspace/store.d.ts.map +1 -0
  100. package/dist/src/features/workspace/store.js +55 -0
  101. package/dist/src/features/workspace/store.js.map +1 -0
  102. package/dist/src/foundation/lifecycle/index.d.ts +3 -0
  103. package/dist/src/foundation/lifecycle/index.d.ts.map +1 -0
  104. package/dist/src/foundation/lifecycle/index.js +3 -0
  105. package/dist/src/foundation/lifecycle/index.js.map +1 -0
  106. package/dist/src/foundation/lifecycle/model.d.ts +101 -0
  107. package/dist/src/foundation/lifecycle/model.d.ts.map +1 -0
  108. package/dist/src/foundation/lifecycle/model.js +40 -0
  109. package/dist/src/foundation/lifecycle/model.js.map +1 -0
  110. package/dist/src/foundation/lifecycle/paths.d.ts +11 -0
  111. package/dist/src/foundation/lifecycle/paths.d.ts.map +1 -0
  112. package/dist/src/foundation/lifecycle/paths.js +26 -0
  113. package/dist/src/foundation/lifecycle/paths.js.map +1 -0
  114. package/dist/src/foundation/native-host-protocol/codec.d.ts +12 -0
  115. package/dist/src/foundation/native-host-protocol/codec.d.ts.map +1 -0
  116. package/dist/src/foundation/native-host-protocol/codec.js +57 -0
  117. package/dist/src/foundation/native-host-protocol/codec.js.map +1 -0
  118. package/dist/src/foundation/native-host-protocol/evidence.d.ts +68 -0
  119. package/dist/src/foundation/native-host-protocol/evidence.d.ts.map +1 -0
  120. package/dist/src/foundation/native-host-protocol/evidence.js +141 -0
  121. package/dist/src/foundation/native-host-protocol/evidence.js.map +1 -0
  122. package/dist/src/foundation/native-host-protocol/index.d.ts +5 -0
  123. package/dist/src/foundation/native-host-protocol/index.d.ts.map +1 -0
  124. package/dist/src/foundation/native-host-protocol/index.js +5 -0
  125. package/dist/src/foundation/native-host-protocol/index.js.map +1 -0
  126. package/dist/src/foundation/native-host-protocol/messages.d.ts +57 -0
  127. package/dist/src/foundation/native-host-protocol/messages.d.ts.map +1 -0
  128. package/dist/src/foundation/native-host-protocol/messages.js +149 -0
  129. package/dist/src/foundation/native-host-protocol/messages.js.map +1 -0
  130. package/dist/src/foundation/native-host-protocol/proof-gate.d.ts +14 -0
  131. package/dist/src/foundation/native-host-protocol/proof-gate.d.ts.map +1 -0
  132. package/dist/src/foundation/native-host-protocol/proof-gate.js +34 -0
  133. package/dist/src/foundation/native-host-protocol/proof-gate.js.map +1 -0
  134. package/dist/src/foundation/owned-ui-contracts/extension-ui.d.ts +303 -0
  135. package/dist/src/foundation/owned-ui-contracts/extension-ui.d.ts.map +1 -0
  136. package/dist/src/foundation/owned-ui-contracts/extension-ui.js +69 -0
  137. package/dist/src/foundation/owned-ui-contracts/extension-ui.js.map +1 -0
  138. package/dist/src/foundation/owned-ui-contracts/index.d.ts +4 -0
  139. package/dist/src/foundation/owned-ui-contracts/index.d.ts.map +1 -0
  140. package/dist/src/foundation/owned-ui-contracts/index.js +4 -0
  141. package/dist/src/foundation/owned-ui-contracts/index.js.map +1 -0
  142. package/dist/src/foundation/owned-ui-contracts/model.d.ts +242 -0
  143. package/dist/src/foundation/owned-ui-contracts/model.d.ts.map +1 -0
  144. package/dist/src/foundation/owned-ui-contracts/model.js +2 -0
  145. package/dist/src/foundation/owned-ui-contracts/model.js.map +1 -0
  146. package/dist/src/foundation/owned-ui-contracts/validation.d.ts +12 -0
  147. package/dist/src/foundation/owned-ui-contracts/validation.d.ts.map +1 -0
  148. package/dist/src/foundation/owned-ui-contracts/validation.js +396 -0
  149. package/dist/src/foundation/owned-ui-contracts/validation.js.map +1 -0
  150. package/dist/src/foundation/pi-component-adapter/components.d.ts +5 -0
  151. package/dist/src/foundation/pi-component-adapter/components.d.ts.map +1 -0
  152. package/dist/src/foundation/pi-component-adapter/components.js +65 -0
  153. package/dist/src/foundation/pi-component-adapter/components.js.map +1 -0
  154. package/dist/src/foundation/pi-component-adapter/conformance.d.ts +17 -0
  155. package/dist/src/foundation/pi-component-adapter/conformance.d.ts.map +1 -0
  156. package/dist/src/foundation/pi-component-adapter/conformance.js +63 -0
  157. package/dist/src/foundation/pi-component-adapter/conformance.js.map +1 -0
  158. package/dist/src/foundation/pi-component-adapter/index.d.ts +13 -0
  159. package/dist/src/foundation/pi-component-adapter/index.d.ts.map +1 -0
  160. package/dist/src/foundation/pi-component-adapter/index.js +13 -0
  161. package/dist/src/foundation/pi-component-adapter/index.js.map +1 -0
  162. package/dist/src/foundation/pi-component-adapter/shell-components.d.ts +7 -0
  163. package/dist/src/foundation/pi-component-adapter/shell-components.d.ts.map +1 -0
  164. package/dist/src/foundation/pi-component-adapter/shell-components.js +7 -0
  165. package/dist/src/foundation/pi-component-adapter/shell-components.js.map +1 -0
  166. package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.d.ts +12 -0
  167. package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.d.ts.map +1 -0
  168. package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +165 -0
  169. package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js.map +1 -0
  170. package/dist/src/foundation/pi-component-adapter/shell-extension-ui.d.ts +36 -0
  171. package/dist/src/foundation/pi-component-adapter/shell-extension-ui.d.ts.map +1 -0
  172. package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js +280 -0
  173. package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js.map +1 -0
  174. package/dist/src/foundation/pi-component-adapter/shell-footer-status.d.ts +8 -0
  175. package/dist/src/foundation/pi-component-adapter/shell-footer-status.d.ts.map +1 -0
  176. package/dist/src/foundation/pi-component-adapter/shell-footer-status.js +246 -0
  177. package/dist/src/foundation/pi-component-adapter/shell-footer-status.js.map +1 -0
  178. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +43 -0
  179. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts.map +1 -0
  180. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js +397 -0
  181. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js.map +1 -0
  182. package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.d.ts +106 -0
  183. package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.d.ts.map +1 -0
  184. package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js +234 -0
  185. package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js.map +1 -0
  186. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +117 -0
  187. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts.map +1 -0
  188. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js +88 -0
  189. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js.map +1 -0
  190. package/dist/src/foundation/pi-component-adapter/theme.d.ts +2 -0
  191. package/dist/src/foundation/pi-component-adapter/theme.d.ts.map +1 -0
  192. package/dist/src/foundation/pi-component-adapter/theme.js +2 -0
  193. package/dist/src/foundation/pi-component-adapter/theme.js.map +1 -0
  194. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts +423 -0
  195. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts.map +1 -0
  196. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js +297 -0
  197. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js.map +1 -0
  198. package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts +11 -0
  199. package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts.map +1 -0
  200. package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.js +30 -0
  201. package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.js.map +1 -0
  202. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts +18 -0
  203. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts.map +1 -0
  204. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js +52 -0
  205. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js.map +1 -0
  206. package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts +23 -0
  207. package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts.map +1 -0
  208. package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.js +143 -0
  209. package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.js.map +1 -0
  210. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts +5 -0
  211. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts.map +1 -0
  212. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +43 -0
  213. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js.map +1 -0
  214. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts +18 -0
  215. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts.map +1 -0
  216. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js +82 -0
  217. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js.map +1 -0
  218. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts +25 -0
  219. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts.map +1 -0
  220. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js +106 -0
  221. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js.map +1 -0
  222. package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.d.ts +3 -0
  223. package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.d.ts.map +1 -0
  224. package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.js +19 -0
  225. package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.js.map +1 -0
  226. package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.d.ts +10 -0
  227. package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.d.ts.map +1 -0
  228. package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js +78 -0
  229. package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js.map +1 -0
  230. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts +56 -0
  231. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts.map +1 -0
  232. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js +343 -0
  233. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js.map +1 -0
  234. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.d.ts +23 -0
  235. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.d.ts.map +1 -0
  236. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js +160 -0
  237. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js.map +1 -0
  238. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts +96 -0
  239. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts.map +1 -0
  240. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js +890 -0
  241. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js.map +1 -0
  242. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts +20 -0
  243. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts.map +1 -0
  244. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js +45 -0
  245. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js.map +1 -0
  246. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts +31 -0
  247. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts.map +1 -0
  248. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js +60 -0
  249. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js.map +1 -0
  250. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts +99 -0
  251. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts.map +1 -0
  252. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js +1273 -0
  253. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js.map +1 -0
  254. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts +34 -0
  255. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts.map +1 -0
  256. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js +77 -0
  257. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js.map +1 -0
  258. package/dist/src/foundation/pi-component-adapter/upstream/external-editor.d.ts +10 -0
  259. package/dist/src/foundation/pi-component-adapter/upstream/external-editor.d.ts.map +1 -0
  260. package/dist/src/foundation/pi-component-adapter/upstream/external-editor.js +40 -0
  261. package/dist/src/foundation/pi-component-adapter/upstream/external-editor.js.map +1 -0
  262. package/dist/src/foundation/pi-component-adapter/upstream/model-search.d.ts +16 -0
  263. package/dist/src/foundation/pi-component-adapter/upstream/model-search.d.ts.map +1 -0
  264. package/dist/src/foundation/pi-component-adapter/upstream/model-search.js +15 -0
  265. package/dist/src/foundation/pi-component-adapter/upstream/model-search.js.map +1 -0
  266. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.d.ts +26 -0
  267. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.d.ts.map +1 -0
  268. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.js +118 -0
  269. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.js.map +1 -0
  270. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts +54 -0
  271. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts.map +1 -0
  272. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js +311 -0
  273. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js.map +1 -0
  274. package/dist/src/foundation/pi-engine-adapter/adapter.d.ts +343 -0
  275. package/dist/src/foundation/pi-engine-adapter/adapter.d.ts.map +1 -0
  276. package/dist/src/foundation/pi-engine-adapter/adapter.js +2365 -0
  277. package/dist/src/foundation/pi-engine-adapter/adapter.js.map +1 -0
  278. package/dist/src/foundation/pi-engine-adapter/conformance.d.ts +14 -0
  279. package/dist/src/foundation/pi-engine-adapter/conformance.d.ts.map +1 -0
  280. package/dist/src/foundation/pi-engine-adapter/conformance.js +85 -0
  281. package/dist/src/foundation/pi-engine-adapter/conformance.js.map +1 -0
  282. package/dist/src/foundation/pi-engine-adapter/index.d.ts +4 -0
  283. package/dist/src/foundation/pi-engine-adapter/index.d.ts.map +1 -0
  284. package/dist/src/foundation/pi-engine-adapter/index.js +4 -0
  285. package/dist/src/foundation/pi-engine-adapter/index.js.map +1 -0
  286. package/dist/src/foundation/pi-engine-adapter/workflows.d.ts +165 -0
  287. package/dist/src/foundation/pi-engine-adapter/workflows.d.ts.map +1 -0
  288. package/dist/src/foundation/pi-engine-adapter/workflows.js +61 -0
  289. package/dist/src/foundation/pi-engine-adapter/workflows.js.map +1 -0
  290. package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts +34 -0
  291. package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts.map +1 -0
  292. package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js +485 -0
  293. package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js.map +1 -0
  294. package/dist/src/foundation/pi-tui-runtime-adapter/conformance.d.ts +14 -0
  295. package/dist/src/foundation/pi-tui-runtime-adapter/conformance.d.ts.map +1 -0
  296. package/dist/src/foundation/pi-tui-runtime-adapter/conformance.js +132 -0
  297. package/dist/src/foundation/pi-tui-runtime-adapter/conformance.js.map +1 -0
  298. package/dist/src/foundation/pi-tui-runtime-adapter/contracts.d.ts +122 -0
  299. package/dist/src/foundation/pi-tui-runtime-adapter/contracts.d.ts.map +1 -0
  300. package/dist/src/foundation/pi-tui-runtime-adapter/contracts.js +2 -0
  301. package/dist/src/foundation/pi-tui-runtime-adapter/contracts.js.map +1 -0
  302. package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts +4 -0
  303. package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts.map +1 -0
  304. package/dist/src/foundation/pi-tui-runtime-adapter/index.js +4 -0
  305. package/dist/src/foundation/pi-tui-runtime-adapter/index.js.map +1 -0
  306. package/dist/src/foundation/protocol/client.d.ts +17 -0
  307. package/dist/src/foundation/protocol/client.d.ts.map +1 -0
  308. package/dist/src/foundation/protocol/client.js +127 -0
  309. package/dist/src/foundation/protocol/client.js.map +1 -0
  310. package/dist/src/foundation/protocol/index.d.ts +3 -0
  311. package/dist/src/foundation/protocol/index.d.ts.map +1 -0
  312. package/dist/src/foundation/protocol/index.js +3 -0
  313. package/dist/src/foundation/protocol/index.js.map +1 -0
  314. package/dist/src/foundation/protocol/messages.d.ts +90 -0
  315. package/dist/src/foundation/protocol/messages.d.ts.map +1 -0
  316. package/dist/src/foundation/protocol/messages.js +99 -0
  317. package/dist/src/foundation/protocol/messages.js.map +1 -0
  318. package/dist/src/foundation/release/bootstrap.d.ts +30 -0
  319. package/dist/src/foundation/release/bootstrap.d.ts.map +1 -0
  320. package/dist/src/foundation/release/bootstrap.js +283 -0
  321. package/dist/src/foundation/release/bootstrap.js.map +1 -0
  322. package/dist/src/foundation/release/cohort-selection.d.ts +40 -0
  323. package/dist/src/foundation/release/cohort-selection.d.ts.map +1 -0
  324. package/dist/src/foundation/release/cohort-selection.js +76 -0
  325. package/dist/src/foundation/release/cohort-selection.js.map +1 -0
  326. package/dist/src/foundation/release/cohort-state.d.ts +68 -0
  327. package/dist/src/foundation/release/cohort-state.d.ts.map +1 -0
  328. package/dist/src/foundation/release/cohort-state.js +201 -0
  329. package/dist/src/foundation/release/cohort-state.js.map +1 -0
  330. package/dist/src/foundation/release/development-preview-release.d.ts +49 -0
  331. package/dist/src/foundation/release/development-preview-release.d.ts.map +1 -0
  332. package/dist/src/foundation/release/development-preview-release.js +113 -0
  333. package/dist/src/foundation/release/development-preview-release.js.map +1 -0
  334. package/dist/src/foundation/release/index.d.ts +12 -0
  335. package/dist/src/foundation/release/index.d.ts.map +1 -0
  336. package/dist/src/foundation/release/index.js +12 -0
  337. package/dist/src/foundation/release/index.js.map +1 -0
  338. package/dist/src/foundation/release/process-cleanup.d.ts +15 -0
  339. package/dist/src/foundation/release/process-cleanup.d.ts.map +1 -0
  340. package/dist/src/foundation/release/process-cleanup.js +67 -0
  341. package/dist/src/foundation/release/process-cleanup.js.map +1 -0
  342. package/dist/src/foundation/release/release-gc.d.ts +6 -0
  343. package/dist/src/foundation/release/release-gc.d.ts.map +1 -0
  344. package/dist/src/foundation/release/release-gc.js +17 -0
  345. package/dist/src/foundation/release/release-gc.js.map +1 -0
  346. package/dist/src/foundation/release/release-store.d.ts +11 -0
  347. package/dist/src/foundation/release/release-store.d.ts.map +1 -0
  348. package/dist/src/foundation/release/release-store.js +115 -0
  349. package/dist/src/foundation/release/release-store.js.map +1 -0
  350. package/dist/src/foundation/release/release.d.ts +24 -0
  351. package/dist/src/foundation/release/release.d.ts.map +1 -0
  352. package/dist/src/foundation/release/release.js +151 -0
  353. package/dist/src/foundation/release/release.js.map +1 -0
  354. package/dist/src/foundation/release/stable-release.d.ts +30 -0
  355. package/dist/src/foundation/release/stable-release.d.ts.map +1 -0
  356. package/dist/src/foundation/release/stable-release.js +38 -0
  357. package/dist/src/foundation/release/stable-release.js.map +1 -0
  358. package/dist/src/foundation/release/update-transaction.d.ts +31 -0
  359. package/dist/src/foundation/release/update-transaction.d.ts.map +1 -0
  360. package/dist/src/foundation/release/update-transaction.js +88 -0
  361. package/dist/src/foundation/release/update-transaction.js.map +1 -0
  362. package/dist/src/foundation/release/update.d.ts +55 -0
  363. package/dist/src/foundation/release/update.d.ts.map +1 -0
  364. package/dist/src/foundation/release/update.js +316 -0
  365. package/dist/src/foundation/release/update.js.map +1 -0
  366. package/dist/src/foundation/storage/control-store.d.ts +61 -0
  367. package/dist/src/foundation/storage/control-store.d.ts.map +1 -0
  368. package/dist/src/foundation/storage/control-store.js +459 -0
  369. package/dist/src/foundation/storage/control-store.js.map +1 -0
  370. package/dist/src/foundation/storage/index.d.ts +2 -0
  371. package/dist/src/foundation/storage/index.d.ts.map +1 -0
  372. package/dist/src/foundation/storage/index.js +2 -0
  373. package/dist/src/foundation/storage/index.js.map +1 -0
  374. package/dist/src/foundation/structured-agent-runtime/backpressure.d.ts +47 -0
  375. package/dist/src/foundation/structured-agent-runtime/backpressure.d.ts.map +1 -0
  376. package/dist/src/foundation/structured-agent-runtime/backpressure.js +119 -0
  377. package/dist/src/foundation/structured-agent-runtime/backpressure.js.map +1 -0
  378. package/dist/src/foundation/structured-agent-runtime/commands.d.ts +53 -0
  379. package/dist/src/foundation/structured-agent-runtime/commands.d.ts.map +1 -0
  380. package/dist/src/foundation/structured-agent-runtime/commands.js +165 -0
  381. package/dist/src/foundation/structured-agent-runtime/commands.js.map +1 -0
  382. package/dist/src/foundation/structured-agent-runtime/handshake.d.ts +42 -0
  383. package/dist/src/foundation/structured-agent-runtime/handshake.d.ts.map +1 -0
  384. package/dist/src/foundation/structured-agent-runtime/handshake.js +151 -0
  385. package/dist/src/foundation/structured-agent-runtime/handshake.js.map +1 -0
  386. package/dist/src/foundation/structured-agent-runtime/index.d.ts +6 -0
  387. package/dist/src/foundation/structured-agent-runtime/index.d.ts.map +1 -0
  388. package/dist/src/foundation/structured-agent-runtime/index.js +6 -0
  389. package/dist/src/foundation/structured-agent-runtime/index.js.map +1 -0
  390. package/dist/src/foundation/structured-agent-runtime/reconnection.d.ts +38 -0
  391. package/dist/src/foundation/structured-agent-runtime/reconnection.d.ts.map +1 -0
  392. package/dist/src/foundation/structured-agent-runtime/reconnection.js +130 -0
  393. package/dist/src/foundation/structured-agent-runtime/reconnection.js.map +1 -0
  394. package/dist/src/foundation/structured-agent-runtime/state.d.ts +57 -0
  395. package/dist/src/foundation/structured-agent-runtime/state.d.ts.map +1 -0
  396. package/dist/src/foundation/structured-agent-runtime/state.js +119 -0
  397. package/dist/src/foundation/structured-agent-runtime/state.js.map +1 -0
  398. package/dist/src/foundation/supervision/index.d.ts +4 -0
  399. package/dist/src/foundation/supervision/index.d.ts.map +1 -0
  400. package/dist/src/foundation/supervision/index.js +4 -0
  401. package/dist/src/foundation/supervision/index.js.map +1 -0
  402. package/dist/src/foundation/supervision/main.d.ts +2 -0
  403. package/dist/src/foundation/supervision/main.d.ts.map +1 -0
  404. package/dist/src/foundation/supervision/main.js +40 -0
  405. package/dist/src/foundation/supervision/main.js.map +1 -0
  406. package/dist/src/foundation/supervision/paths.d.ts +2 -0
  407. package/dist/src/foundation/supervision/paths.d.ts.map +1 -0
  408. package/dist/src/foundation/supervision/paths.js +2 -0
  409. package/dist/src/foundation/supervision/paths.js.map +1 -0
  410. package/dist/src/foundation/supervision/server.d.ts +21 -0
  411. package/dist/src/foundation/supervision/server.d.ts.map +1 -0
  412. package/dist/src/foundation/supervision/server.js +283 -0
  413. package/dist/src/foundation/supervision/server.js.map +1 -0
  414. package/dist/src/foundation/transparent-terminal/command-resolution.d.ts +14 -0
  415. package/dist/src/foundation/transparent-terminal/command-resolution.d.ts.map +1 -0
  416. package/dist/src/foundation/transparent-terminal/command-resolution.js +70 -0
  417. package/dist/src/foundation/transparent-terminal/command-resolution.js.map +1 -0
  418. package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts +33 -0
  419. package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts.map +1 -0
  420. package/dist/src/foundation/transparent-terminal/foreground-broker.js +88 -0
  421. package/dist/src/foundation/transparent-terminal/foreground-broker.js.map +1 -0
  422. package/dist/src/foundation/transparent-terminal/index.d.ts +4 -0
  423. package/dist/src/foundation/transparent-terminal/index.d.ts.map +1 -0
  424. package/dist/src/foundation/transparent-terminal/index.js +4 -0
  425. package/dist/src/foundation/transparent-terminal/index.js.map +1 -0
  426. package/dist/src/foundation/transparent-terminal/main.d.ts +10 -0
  427. package/dist/src/foundation/transparent-terminal/main.d.ts.map +1 -0
  428. package/dist/src/foundation/transparent-terminal/main.js +107 -0
  429. package/dist/src/foundation/transparent-terminal/main.js.map +1 -0
  430. package/dist/src/foundation/transparent-terminal/native-launcher.d.ts +26 -0
  431. package/dist/src/foundation/transparent-terminal/native-launcher.d.ts.map +1 -0
  432. package/dist/src/foundation/transparent-terminal/native-launcher.js +147 -0
  433. package/dist/src/foundation/transparent-terminal/native-launcher.js.map +1 -0
  434. package/dist/src/foundation/workspace-contracts/index.d.ts +3 -0
  435. package/dist/src/foundation/workspace-contracts/index.d.ts.map +1 -0
  436. package/dist/src/foundation/workspace-contracts/index.js +3 -0
  437. package/dist/src/foundation/workspace-contracts/index.js.map +1 -0
  438. package/dist/src/foundation/workspace-contracts/model.d.ts +249 -0
  439. package/dist/src/foundation/workspace-contracts/model.d.ts.map +1 -0
  440. package/dist/src/foundation/workspace-contracts/model.js +3 -0
  441. package/dist/src/foundation/workspace-contracts/model.js.map +1 -0
  442. package/dist/src/foundation/workspace-contracts/validation.d.ts +14 -0
  443. package/dist/src/foundation/workspace-contracts/validation.d.ts.map +1 -0
  444. package/dist/src/foundation/workspace-contracts/validation.js +336 -0
  445. package/dist/src/foundation/workspace-contracts/validation.js.map +1 -0
  446. package/docs/architecture/boundaries.md +46 -0
  447. package/docs/architecture/project-structure.md +81 -0
  448. package/docs/architecture/resource-and-data-policy.md +55 -0
  449. package/docs/architecture/terminal-host-proof-gate.md +32 -0
  450. package/docs/architecture/terminal-host-provenance.md +69 -0
  451. package/docs/architecture/terminal-host-spike-evidence.md +39 -0
  452. package/docs/architecture/toolchain.md +66 -0
  453. package/docs/features/launch-profiles.md +50 -0
  454. package/docs/manual-transparent-checkpoint.md +53 -0
  455. package/package.json +73 -0
@@ -0,0 +1,336 @@
1
+ import { NATIVE_HOST_PROTOCOL_VERSION, WORKSPACE_CONTRACT_VERSION } from "./model.js";
2
+ const MAX_ID_LENGTH = 128;
3
+ const MAX_LABEL_LENGTH = 256;
4
+ const MAX_COLLECTION_LENGTH = 10_000;
5
+ const MAX_ENVIRONMENT_ENTRIES = 512;
6
+ const MAX_ARGUMENTS = 1_024;
7
+ const MAX_POSITION = Number.MAX_SAFE_INTEGER;
8
+ const MAX_LIMIT = 1_000_000_000;
9
+ export function assertManagedAgentDescriptor(agent) {
10
+ assertId(agent.id, "agent id");
11
+ assertText(agent.displayName, "agent display name", MAX_LABEL_LENGTH);
12
+ assertId(agent.adapterId, "adapter id");
13
+ assertIsoDate(agent.createdAt, "agent creation time");
14
+ if (agent.recoveryReferenceId !== null)
15
+ assertId(agent.recoveryReferenceId, "recovery reference id");
16
+ assertAgentCapability(agent.capability);
17
+ if (agent.runtime !== agent.capability.kind)
18
+ throw new TypeError("agent runtime must match its capability kind");
19
+ }
20
+ export function assertAgentCapability(capability) {
21
+ if (capability.kind === "structured") {
22
+ assertStructuredCapability(capability);
23
+ return;
24
+ }
25
+ assertComposedTerminalCapability(capability);
26
+ }
27
+ export function assertStructuredCapability(capability) {
28
+ if (capability.protocolVersion !== WORKSPACE_CONTRACT_VERSION)
29
+ throw new TypeError("unsupported structured protocol version");
30
+ assertId(capability.adapterId, "structured adapter id");
31
+ assertUniqueText(capability.commands, "structured commands");
32
+ assertUniqueText(capability.eventTypes, "structured event types");
33
+ assertUniqueText(capability.attachmentTypes, "structured attachment types");
34
+ if (capability.resume === "position" && capability.snapshots === "none") {
35
+ throw new TypeError("position resume requires authoritative snapshots for gap recovery");
36
+ }
37
+ if (capability.resume === "snapshot" && capability.snapshots !== "authoritative") {
38
+ throw new TypeError("snapshot resume requires authoritative snapshots");
39
+ }
40
+ for (const [name, value] of Object.entries(capability.flow))
41
+ assertBoundedPositiveInteger(value, `structured flow ${name}`);
42
+ }
43
+ export function assertComposedTerminalCapability(capability) {
44
+ if (capability.protocolVersion !== NATIVE_HOST_PROTOCOL_VERSION)
45
+ throw new TypeError("unsupported native-host protocol version");
46
+ assertId(capability.hostInstanceId, "native host instance id");
47
+ assertRevision(capability.topologyRevision, "topology revision");
48
+ }
49
+ export function assertWorkspaceSnapshot(snapshot) {
50
+ if (snapshot.contractVersion !== WORKSPACE_CONTRACT_VERSION)
51
+ throw new TypeError("unsupported workspace contract version");
52
+ assertId(snapshot.workspaceId, "workspace id");
53
+ assertRevision(snapshot.revision, "workspace revision");
54
+ assertCollection(snapshot.agents, "workspace agents");
55
+ const ids = new Set();
56
+ for (const agent of snapshot.agents) {
57
+ assertManagedAgentDescriptor(agent);
58
+ if (ids.has(agent.id))
59
+ throw new TypeError(`duplicate agent id: ${agent.id}`);
60
+ ids.add(agent.id);
61
+ }
62
+ if (snapshot.selectedAgentId !== null && !ids.has(snapshot.selectedAgentId)) {
63
+ throw new TypeError("selected agent must exist in the workspace snapshot");
64
+ }
65
+ }
66
+ export function assertWorkspaceCommand(command) {
67
+ assertId(command.correlationId, "command correlation id");
68
+ switch (command.type) {
69
+ case "create-agent":
70
+ assertManagedAgentDescriptor(command.agent);
71
+ return;
72
+ case "select-agent":
73
+ case "stop-agent":
74
+ case "restart-agent":
75
+ case "remove-agent":
76
+ assertId(command.agentId, "command agent id");
77
+ return;
78
+ case "rename-agent":
79
+ assertId(command.agentId, "command agent id");
80
+ assertText(command.displayName, "agent display name", MAX_LABEL_LENGTH);
81
+ return;
82
+ case "structured-command":
83
+ assertId(command.agentId, "command agent id");
84
+ assertId(command.command, "structured command name");
85
+ assertJsonValue(command.payload, "structured command payload");
86
+ return;
87
+ case "cancel-structured-command":
88
+ assertId(command.agentId, "command agent id");
89
+ assertId(command.targetCorrelationId, "target command correlation id");
90
+ }
91
+ }
92
+ export function assertWorkspaceEvent(event) {
93
+ assertId(event.agentId, "event agent id");
94
+ switch (event.type) {
95
+ case "agent-lifecycle":
96
+ assertPosition(event.position, "lifecycle event position");
97
+ return;
98
+ case "structured-event":
99
+ assertPosition(event.position, "structured event position");
100
+ assertId(event.eventType, "structured event type");
101
+ assertJsonValue(event.payload, "structured event payload");
102
+ return;
103
+ case "command-outcome":
104
+ assertId(event.correlationId, "command correlation id");
105
+ return;
106
+ case "terminal-topology":
107
+ assertTerminalTopologySnapshot(event.topology);
108
+ return;
109
+ case "recovery-discontinuity":
110
+ assertText(event.reason, "recovery discontinuity reason", 4_096);
111
+ }
112
+ }
113
+ export function assertStructuredAgentSnapshot(snapshot) {
114
+ if (snapshot.contractVersion !== WORKSPACE_CONTRACT_VERSION)
115
+ throw new TypeError("unsupported structured snapshot contract version");
116
+ assertId(snapshot.agentId, "structured snapshot agent id");
117
+ assertId(snapshot.snapshotId, "structured snapshot id");
118
+ assertPosition(snapshot.position, "structured snapshot position");
119
+ if (snapshot.authoritative !== true)
120
+ throw new TypeError("structured snapshot must be authoritative");
121
+ assertJsonValue(snapshot.payload, "structured snapshot payload");
122
+ }
123
+ export function assertTerminalTopologySnapshot(topology) {
124
+ assertId(topology.hostInstanceId, "native host instance id");
125
+ assertRevision(topology.revision, "topology revision");
126
+ assertCollection(topology.windows, "terminal windows");
127
+ assertCollection(topology.sessions, "terminal sessions");
128
+ const sessionIds = new Set();
129
+ for (const session of topology.sessions) {
130
+ assertTerminalSessionLaunch(session);
131
+ if (sessionIds.has(session.id))
132
+ throw new TypeError(`duplicate terminal session id: ${session.id}`);
133
+ sessionIds.add(session.id);
134
+ }
135
+ const windowIds = new Set();
136
+ const paneIds = new Set();
137
+ for (const window of topology.windows) {
138
+ assertId(window.id, "terminal window id");
139
+ if (windowIds.has(window.id))
140
+ throw new TypeError(`duplicate terminal window id: ${window.id}`);
141
+ windowIds.add(window.id);
142
+ assertCollection(window.tabs, "terminal tabs");
143
+ if (!window.tabs.some(tab => tab.id === window.activeTabId))
144
+ throw new TypeError("active tab must exist in its window");
145
+ const tabIds = new Set();
146
+ for (const tab of window.tabs) {
147
+ if (tabIds.has(tab.id))
148
+ throw new TypeError(`duplicate terminal tab id in window: ${tab.id}`);
149
+ tabIds.add(tab.id);
150
+ assertTerminalTab(tab, sessionIds, paneIds);
151
+ }
152
+ }
153
+ }
154
+ export function assertNativeHostCommand(command) {
155
+ assertId(command.correlationId, "native-host correlation id");
156
+ if (command.type === "apply-topology") {
157
+ assertRevision(command.expectedRevision, "expected topology revision");
158
+ assertTerminalTopologySnapshot(command.topology);
159
+ if (command.topology.revision !== command.expectedRevision) {
160
+ throw new TypeError("applied topology snapshot revision must equal the expected revision");
161
+ }
162
+ return;
163
+ }
164
+ if (command.type === "focus-pane" || command.type === "close-pane") {
165
+ assertRevision(command.expectedRevision, "expected topology revision");
166
+ assertId(command.paneId, "terminal pane id");
167
+ }
168
+ }
169
+ export function assertRecoveryAuthority(authority) {
170
+ assertId(authority.referenceId, "recovery reference id");
171
+ assertId(authority.agentId, "recovery agent id");
172
+ assertText(authority.processIdentity, "recovery process identity", 1_024);
173
+ if (authority.kind === "structured") {
174
+ assertId(authority.adapterId, "recovery adapter id");
175
+ assertText(authority.ownershipProof, "recovery ownership proof", 4_096);
176
+ if (authority.boundary.kind === "position") {
177
+ assertPosition(authority.boundary.position, "resume position");
178
+ assertText(authority.boundary.resumeToken, "resume token", 4_096);
179
+ }
180
+ else {
181
+ assertId(authority.boundary.snapshotId, "recovery snapshot id");
182
+ }
183
+ return;
184
+ }
185
+ assertId(authority.hostInstanceId, "recovery host instance id");
186
+ assertText(authority.hostBuildId, "recovery host build id", 1_024);
187
+ assertText(authority.pseudoterminalIdentity, "recovery pseudoterminal identity", 1_024);
188
+ assertText(authority.retainedStateIdentity, "recovery retained-state identity", 1_024);
189
+ assertRevision(authority.topologyRevision, "recovery topology revision");
190
+ assertPosition(authority.streamPosition, "recovery stream position");
191
+ }
192
+ export function assertTerminalSessionLaunch(session) {
193
+ assertId(session.id, "terminal session id");
194
+ assertText(session.executable, "terminal executable", 32_768);
195
+ assertText(session.cwd, "terminal working directory", 32_768);
196
+ if (session.executable.includes("\0") || session.cwd.includes("\0"))
197
+ throw new TypeError("terminal launch paths contain a null byte");
198
+ assertCollection(session.arguments, "terminal arguments", MAX_ARGUMENTS);
199
+ if (session.arguments.some(argument => typeof argument !== "string" || argument.includes("\0"))) {
200
+ throw new TypeError("terminal arguments contain an invalid value");
201
+ }
202
+ const entries = Object.entries(session.environment);
203
+ assertCollection(entries, "terminal environment", MAX_ENVIRONMENT_ENTRIES);
204
+ if (entries.some(([name, value]) => !name || name.includes("=") || name.includes("\0") || typeof value !== "string" || value.includes("\0"))) {
205
+ throw new TypeError("terminal environment contains an invalid name or value");
206
+ }
207
+ assertTerminalDimensions(session.dimensions);
208
+ }
209
+ function assertTerminalDimensions(dimensions) {
210
+ assertIntegerInRange(dimensions.columns, 2, 500, "terminal columns");
211
+ assertIntegerInRange(dimensions.rows, 1, 300, "terminal rows");
212
+ assertIntegerInRange(dimensions.widthPixels, 1, 100_000, "terminal pixel width");
213
+ assertIntegerInRange(dimensions.heightPixels, 1, 100_000, "terminal pixel height");
214
+ }
215
+ function assertTerminalTab(tab, sessionIds, globalPaneIds) {
216
+ assertId(tab.id, "terminal tab id");
217
+ assertCollection(tab.nodes, "terminal topology nodes");
218
+ assertCollection(tab.panes, "terminal panes");
219
+ const paneIds = new Set();
220
+ for (const pane of tab.panes) {
221
+ assertId(pane.id, "terminal pane id");
222
+ assertId(pane.sessionId, "terminal pane session id");
223
+ if (paneIds.has(pane.id) || globalPaneIds.has(pane.id))
224
+ throw new TypeError(`duplicate terminal pane id: ${pane.id}`);
225
+ if (!sessionIds.has(pane.sessionId))
226
+ throw new TypeError(`terminal pane references missing session: ${pane.sessionId}`);
227
+ paneIds.add(pane.id);
228
+ globalPaneIds.add(pane.id);
229
+ }
230
+ if (!paneIds.has(tab.focusedPaneId))
231
+ throw new TypeError("focused pane must exist in its tab");
232
+ const nodes = new Map();
233
+ for (const node of tab.nodes) {
234
+ assertId(node.id, "terminal topology node id");
235
+ if (nodes.has(node.id))
236
+ throw new TypeError(`duplicate terminal topology node id: ${node.id}`);
237
+ if (node.kind === "leaf") {
238
+ if (!paneIds.has(node.paneId))
239
+ throw new TypeError(`terminal leaf references missing pane: ${node.paneId}`);
240
+ }
241
+ else {
242
+ if (!(node.ratio > 0 && node.ratio < 1 && Number.isFinite(node.ratio)))
243
+ throw new RangeError("terminal split ratio must be between zero and one");
244
+ if (node.first === node.second || node.id === node.first || node.id === node.second)
245
+ throw new TypeError("terminal split cannot reference itself or duplicate a child");
246
+ }
247
+ nodes.set(node.id, node);
248
+ }
249
+ if (!nodes.has(tab.rootNodeId))
250
+ throw new TypeError("terminal tab root node is missing");
251
+ const visited = new Set();
252
+ const visiting = new Set();
253
+ const reachedPanes = new Set();
254
+ visitNode(tab.rootNodeId, nodes, visited, visiting, reachedPanes);
255
+ if (visited.size !== nodes.size)
256
+ throw new TypeError("terminal tab contains unreachable topology nodes");
257
+ if (reachedPanes.size !== paneIds.size || [...paneIds].some(paneId => !reachedPanes.has(paneId))) {
258
+ throw new TypeError("each terminal pane must appear exactly once in the split tree");
259
+ }
260
+ }
261
+ function visitNode(id, nodes, visited, visiting, reachedPanes) {
262
+ const node = nodes.get(id);
263
+ if (!node)
264
+ throw new TypeError(`terminal split references missing node: ${id}`);
265
+ if (visiting.has(id))
266
+ throw new TypeError("terminal topology contains a cycle");
267
+ if (visited.has(id))
268
+ throw new TypeError("terminal topology node has multiple parents");
269
+ visiting.add(id);
270
+ if (node.kind === "leaf") {
271
+ if (reachedPanes.has(node.paneId))
272
+ throw new TypeError("terminal pane appears more than once in the split tree");
273
+ reachedPanes.add(node.paneId);
274
+ }
275
+ else {
276
+ visitNode(node.first, nodes, visited, visiting, reachedPanes);
277
+ visitNode(node.second, nodes, visited, visiting, reachedPanes);
278
+ }
279
+ visiting.delete(id);
280
+ visited.add(id);
281
+ }
282
+ function assertUniqueText(values, name) {
283
+ assertCollection(values, name);
284
+ const seen = new Set();
285
+ for (const value of values) {
286
+ assertId(value, name);
287
+ if (seen.has(value))
288
+ throw new TypeError(`${name} contains a duplicate: ${value}`);
289
+ seen.add(value);
290
+ }
291
+ }
292
+ function assertJsonValue(value, name) {
293
+ try {
294
+ const encoded = JSON.stringify(value);
295
+ if (encoded === undefined)
296
+ throw new TypeError();
297
+ }
298
+ catch {
299
+ throw new TypeError(`${name} must be JSON serializable`);
300
+ }
301
+ }
302
+ function assertCollection(value, name, maximum = MAX_COLLECTION_LENGTH) {
303
+ if (!Array.isArray(value) || value.length > maximum)
304
+ throw new RangeError(`${name} exceeds its maximum length`);
305
+ }
306
+ function assertId(value, name) {
307
+ assertText(value, name, MAX_ID_LENGTH);
308
+ if (!/^[A-Za-z0-9][A-Za-z0-9._:-]*$/.test(value))
309
+ throw new TypeError(`${name} contains unsupported characters`);
310
+ }
311
+ function assertText(value, name, maximum) {
312
+ if (typeof value !== "string" || value.length === 0 || value.length > maximum || value.includes("\0")) {
313
+ throw new TypeError(`${name} is invalid`);
314
+ }
315
+ }
316
+ function assertIsoDate(value, name) {
317
+ assertText(value, name, 64);
318
+ if (!Number.isFinite(Date.parse(value)))
319
+ throw new TypeError(`${name} is not an ISO timestamp`);
320
+ }
321
+ function assertRevision(value, name) {
322
+ if (!Number.isSafeInteger(value) || value < 0)
323
+ throw new RangeError(`${name} must be a non-negative safe integer`);
324
+ }
325
+ function assertPosition(value, name) {
326
+ assertIntegerInRange(value, 0, MAX_POSITION, name);
327
+ }
328
+ function assertBoundedPositiveInteger(value, name) {
329
+ assertIntegerInRange(value, 1, MAX_LIMIT, name);
330
+ }
331
+ function assertIntegerInRange(value, minimum, maximum, name) {
332
+ if (!Number.isSafeInteger(value) || value < minimum || value > maximum) {
333
+ throw new RangeError(`${name} must be an integer from ${minimum} to ${maximum}`);
334
+ }
335
+ }
336
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/foundation/workspace-contracts/validation.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAEtF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,aAAa,GAAG,KAAK,CAAC;AAC5B,MAAM,YAAY,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC7C,MAAM,SAAS,GAAG,aAAa,CAAC;AAEhC,MAAM,UAAU,4BAA4B,CAAC,KAA6B;IACxE,QAAQ,CAAC,KAAK,CAAC,E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Y;IACjD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,sCAAsC,CAAC,CAAC;AACrH,CAAC;AAED,SAAS,cAAc,CAAC,KAAa,EAAE,IAAY;IACjD,oBAAoB,CAAC,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,4BAA4B,CAAC,KAAa,EAAE,IAAY;IAC/D,oBAAoB,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe,EAAE,IAAY;IACzF,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,OAAO,IAAI,KAAK,GAAG,OAAO,EAAE,CAAC;QACvE,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,4BAA4B,OAAO,OAAO,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
@@ -0,0 +1,46 @@
1
+ # Architecture boundaries
2
+
3
+ ## Terminal ownership
4
+
5
+ The current interactive path is:
6
+
7
+ ```text
8
+ mutable a1 entry
9
+ -> verified immutable release
10
+ -> foreground lease and broker
11
+ -> child with inherited physical terminal handles
12
+ ```
13
+
14
+ After handoff, AddOne does not read ordinary terminal input, parse child output, render cells, infer frames, synthesize terminal responses, or emit display control. The child and physical terminal own terminal behavior. AddOne owns validated launch intent, one exclusive foreground lease, native process identity, lifecycle outcome, and bounded cleanup.
15
+
16
+ Transparent mode has no AddOne-authoritative terminal surface, internal pane, virtual scrollback, inactive resident tab, or visual reconnection. A future feature that requires those properties must introduce and certify a separate composed-terminal authority; it must not weaken or silently intercept transparent mode.
17
+
18
+ ## Current module responsibilities
19
+
20
+ - `domain`: dependency-free transparent launch, process identity, lifecycle, and lease contracts.
21
+ - `workspace-contracts`: dependency-free multi-agent identity, capability, command/event/snapshot, terminal window/tab/pane/session topology, terminal-host, and recovery contracts.
22
+ - `structured-agent-runtime`: planned typed event/command/snapshot runtime. It must not infer semantics from terminal text, own pseudoterminals, or reconstruct screens.
23
+ - `native-host-protocol`: bounded typed local boundary for terminal-host identity, topology revisions, lifecycle, and recovery. Terminal bytes, per-event child input, and rendered cells are forbidden across it.
24
+ - `protocol`: additive control handshake, bounded line framing, request identity, snapshots, command results, and foreground-lease messages. Terminal bytes and reconstructed display state are forbidden.
25
+ - `storage`: SQLite migrations, old-generation reconciliation, and exclusive foreground-lease persistence. Historical schema tables remain readable for installed-state compatibility but do not authorize legacy product behavior.
26
+ - `supervisor`: endpoint identity, cohort ownership, foreground leases, and release shutdown coordination. It owns no terminal surface.
27
+ - `transparent`: generic command resolution, foreground broker, and native attached launchers.
28
+ - release/update/bootstrap: package-derived immutable release identity, cohort selection, durable update transactions, rollback, and dependency-light command entry.
29
+
30
+ ## Dependency direction
31
+
32
+ Terminal boundaries are application-agnostic. They may not select behavior from executable names, arguments, CLI-specific environment variables, or visible text. Production code may not import private Pi distribution APIs or use a Pi-specific terminal workaround.
33
+
34
+ The repository has no production PTY or terminal-emulator dependency. Reintroducing `node-pty`, xterm state, custom input encoders, mode/query trackers, cadence-derived frame inference, or renderer/projection code requires an approved capability change and cannot enter transparent mode.
35
+
36
+ `scripts/check-architecture.mjs` enforces the structural parts of these boundaries. Cross-cutting rationale belongs here; implementation history belongs in Git and archived OpenSpec changes.
37
+
38
+ ## Planned multi-agent boundaries
39
+
40
+ The workspace feature may depend on workspace contracts and the structured/terminal-host foundations. Those foundations may depend only on dependency-free workspace contracts, never on product features, launch profiles, or each other unless an approved capability adds the dependency. Explicit launch profiles and transparent fallback may not import, initialize, launch, or connect to composed terminal-host infrastructure.
41
+
42
+ The structured-agent runtime uses a versioned adapter hello and feature negotiation before readiness. Runtime state must use typed events, commands, snapshots, cancellation, and recovery evidence. It must not infer structured semantics from terminal text, terminal timing, or visual content and must not own pseudoterminals or renderer state.
43
+
44
+ The terminal-host protocol boundary may carry only bounded typed control and semantic lifecycle messages. Pseudoterminal bytes, per-event child input, rendered cells, cell grids, framebuffers, and screen buffers are forbidden across it. Console host executables and packaging live outside the current JavaScript production owners and remain unavailable until the isolated in-terminal 2×2 proof passes; replacing them with a lightweight custom parser/renderer is forbidden. A desktop-native window and GPU application shell are postponed and are not required for the terminal-hosted product.
45
+
46
+ Resource queues, retained state, evidence, logs, and diagnostics follow `docs/architecture/resource-and-data-policy.md`. Terminal content and authentication material are never control-store records. Unknown data is potentially sensitive by default and must be rejected or redacted before persistence.
@@ -0,0 +1,81 @@
1
+ # Project structure
2
+
3
+ Every production module has one named owner. The executable owner map and allowed dependencies live in `scripts/project-structure-policy.mjs`; this document explains the conventions behind it.
4
+
5
+ ## Production owners
6
+
7
+ ```text
8
+ src/
9
+ cli/ public command helpers and dispatch
10
+ features/
11
+ launch/ product launch profiles and profile settings
12
+ workspace/ multi-agent workspace presentation, reducer state, and persistence orchestration
13
+ foundation/
14
+ lifecycle/ dependency-free launch/lifecycle contracts and paths
15
+ protocol/ control framing and client contracts
16
+ release/ immutable releases, cohorts, update, rollback, cleanup
17
+ storage/ control-store persistence
18
+ structured-agent-runtime/ structured/RPC handshake, event, command, and recovery semantics
19
+ native-host-protocol/ bounded terminal-host identity, topology, lifecycle, and proof protocol
20
+ supervision/ endpoint and foreground-lease ownership
21
+ workspace-contracts/ dependency-free workspace, adapter, topology, host, and recovery contracts
22
+ transparent-terminal/ exact command resolution and native attachment
23
+ ```
24
+
25
+ Each owner exposes `index.ts`. Imports within one owner may use private files. Imports crossing owners must use the provider's `index.ts` and follow the declared dependency DAG. Foundation modules never import product features.
26
+
27
+ `src/cli` is a thin public entry layer. Product policy belongs in a named feature. Shared code moves to foundation only when it is product-agnostic, has a precise contract, and has more than one real consumer. Do not create `core`, `common`, `utils`, or `misc` dumping grounds.
28
+
29
+ ## Feature ownership
30
+
31
+ A feature owns:
32
+
33
+ - its production behavior under `src/features/<name>`;
34
+ - its public contract in `index.ts`;
35
+ - its settings schema/defaults and path policy;
36
+ - its tests under `test/features/<name>`;
37
+ - user-facing feature documentation under `docs/features/<name>.md` when the behavior needs more than README coverage.
38
+
39
+ Settings files are not mandatory for every feature. Add one only when the feature owns mutable policy. User settings, credentials, sessions, caches, downloaded packages, logs, and generated files never live in source folders.
40
+
41
+ ## Test ownership
42
+
43
+ Tests mirror their production owner:
44
+
45
+ ```text
46
+ test/
47
+ cli/
48
+ features/<name>/
49
+ foundation/<name>/
50
+ repository-governance/
51
+ ```
52
+
53
+ Use `.test.ts` for deterministic owner-level contracts. Use `.integration.test.ts` when the contract crosses real process, filesystem, registry, or release boundaries. Prefer the smallest independent boundary that proves the observable result; do not duplicate a stronger test or preserve historical bug-story names after the cause has a current invariant.
54
+
55
+ Physical desktop automation is not an ordinary integration test. It requires a separately authorized certification change and isolated disposable infrastructure.
56
+
57
+ ## Repository authority
58
+
59
+ The repository has one root `package.json`, `package-lock.json`, TypeScript configuration, Vitest configuration, and dependency installation. Nested manifests, lockfiles, `node_modules`, vendored package caches, logs, sessions, browser profiles, generated output, and runtime state are forbidden under production and feature trees.
60
+
61
+ Build output belongs in ignored `dist/`; release/test evidence belongs in ignored `artifacts/`. Package contents are selected by the root manifest. Native proof code lives under `native/terminal-host/`; its Cargo build output and vendored Zig build output are ignored, and it remains a console terminal host rather than a desktop application.
62
+
63
+ ## Documentation and comments
64
+
65
+ - README explains installation, commands, and current limitations.
66
+ - `docs/architecture` explains cross-cutting ownership and irreversible constraints.
67
+ - `docs/architecture/resource-and-data-policy.md` defines bounded queues, data classes, redaction, terminal-content non-persistence, and proof acceptance rules.
68
+ - `docs/architecture/terminal-host-provenance.md` records pinned terminal-component revisions, retained components, patch policy, and artifact provenance requirements.
69
+ - `docs/architecture/terminal-host-spike-evidence.md` defines the mandatory in-terminal 2×2 proof workloads, measurements, and acceptance invariants.
70
+ - `docs/architecture/terminal-host-proof-gate.md` defines the non-waivable stop/go acceptance policy and current pending record.
71
+ - `docs/features` explains maintained user-facing feature behavior.
72
+ - OpenSpec and Git carry planning and implementation history.
73
+ - Source comments explain only non-obvious rationale, safety/security invariants, platform constraints, or public semantic contracts. Names, types, and decomposition explain normal control flow.
74
+
75
+ ## Terminal capability boundary
76
+
77
+ Transparent terminal attachment owns one foreground child and no AddOne surface. It cannot retain inactive terminal state or switch among arbitrary interactive CLIs inside AddOne. Bare-`a1` multi-agent UX may use structured/RPC surfaces without terminal emulation, but arbitrary-CLI tabs require a separate composed-terminal capability with PTY, authoritative terminal state, rendering, input routing, inactive-surface lifecycle, reconnection, and cross-platform certification. That future capability must not silently intercept or replace the transparent path. Explicit launch profiles and transparent fallback must not import, initialize, launch, or connect to composed terminal-host infrastructure.
78
+
79
+ Composed terminals use a console terminal host that runs inside the user's existing terminal. The host owns pseudoterminal bytes, retained terminal state, keyboard/text/mouse/IME encoding, frame scheduling, and presentation to the containing terminal. AddOne's JavaScript control plane may exchange typed identity, topology revision, capability, lifecycle, status, and recovery messages only; it must not relay terminal output, per-event child input, or rendered cells. A desktop-native window, GPU renderer, Ghostty GUI runtime, Winghostty Win32 runtime, Metal, GTK, and AppKit are postponed and are not required for the in-terminal product.
80
+
81
+ A tab owns a revisioned split tree. Each leaf pane references one PTY-backed terminal session. Structured/RPC agents remain semantically separate and may not derive state from ANSI text, terminal timing, or screen content. Native source ownership lives outside `src/` when introduced; packaged host selection is governed by release/package owners. Existing architecture tests reject terminal-host hot-path bytes in JavaScript protocol code, terminal inference in structured runtime code, composed imports from explicit launch modes, and replacement lightweight terminal parsers/renderers.
@@ -0,0 +1,55 @@
1
+ # Multi-agent resource and data policy
2
+
3
+ This policy is mandatory for the multi-agent workspace. It prevents one adapter, terminal pane, recovery record, or proof artifact from exhausting the workspace and prevents accidental persistence of credentials or terminal streams.
4
+
5
+ ## Resource budgets
6
+
7
+ Budgets are minimum defaults, not promises of capacity. An implementation may lower them per agent, adapter, pane, host, or platform, but may not silently remove a limit.
8
+
9
+ | Resource | Default budget | Required outcome on breach |
10
+ |---|---:|---|
11
+ | Structured event payload | 64 KiB | Reject only that event and preserve diagnostics |
12
+ | Structured snapshot payload | 1 MiB | Reject resynchronization and mark the agent degraded |
13
+ | Structured attachment payload | 2 MiB | Reject only that attachment |
14
+ | Queued structured events per agent | 256 | Apply negotiated pause, rejection, compaction, or disconnect |
15
+ | Concurrent structured commands per agent | 4 | Reject or queue deterministically with a capability explanation |
16
+ | Reconnect replay per adapter | 1,024 events | Stop replay, request a snapshot if available, or mark discontinuity |
17
+ | Native-host control message | 1 MiB | Close the incompatible protocol channel without touching panes |
18
+ | Native topology nodes per tab | 1,024 | Reject the topology mutation atomically |
19
+ | Terminal sessions per host | 64 | Reject additional sessions as unsupported capacity |
20
+ | Terminal launch arguments | 1,024 | Reject that launch request |
21
+ | Terminal environment entries | 512 | Reject that launch request |
22
+ | Retained terminal model per pane | Host-defined, always bounded | Apply documented compaction, backpressure, pause, or termination |
23
+ | Scrollback per pane | Host-defined, always bounded | Compact from oldest data first without cross-pane mutation |
24
+ | Proof evidence file | 16 MiB | Reject and request summarized evidence |
25
+ | Diagnostic payload | 256 KiB | Redact, truncate, and retain enough evidence for the failed operation |
26
+
27
+ Every asynchronous consumer must implement a finite queue or window. Backpressure must isolate the offending agent/pane and must not block unrelated identities.
28
+
29
+ ## Data classification
30
+
31
+ | Class | Examples | Storage policy |
32
+ |---|---|---|
33
+ | Workspace metadata | IDs, names, lifecycle, capability versions, topology revisions, recovery references | May persist in the control store |
34
+ | Structured payloads | Messages, tool calls, snapshots, attachments | Bound and process; persist only under a future typed retention policy |
35
+ | Terminal content | PTY bytes, scrollback, selection, rendered cells | Never persist in AddOne's control store or diagnostics |
36
+ | Host topology metadata | Window/tab/pane/session IDs, layout shape, dimensions, revision | May persist; not terminal content |
37
+ | Native proof evidence | Artifact hashes, source revisions, workloads, latency/resource measurements, paint diagnostics | May persist in versioned evidence files without terminal content |
38
+ | Environment values | `PATH`, profile overrides, arbitrary launch environment | Do not persist; treat as potentially sensitive |
39
+ | Credentials and tokens | API keys, OAuth tokens, cookies, auth files, passwords | Never copy, log, or persist outside the owning agent/profile |
40
+ | Authentication state | Pi profile auth, provider sessions, platform keychains | Owned only by the selected agent/profile |
41
+ | Logs and diagnostics | Failure codes, bounded lifecycle evidence, sanitized status | May persist after classification and redaction |
42
+
43
+ Sanitization must classify before logging or storing. Unknown or untyped values are potentially sensitive by default and must not be persisted. Terminal bytes must never be written to logs as a debugging shortcut.
44
+
45
+ ## Required architectural outcomes
46
+
47
+ - Structured/RPC semantics must not be inferred from ANSI text, terminal timing, or visual content.
48
+ - Native-host protocol code must not carry PTY bytes, per-event child input, rendered cells, cell grids, framebuffers, or screen buffers.
49
+ - `a1 pi` and `a1 sandbox` must not import, initialize, launch, or connect to composed terminal-host infrastructure.
50
+ - Transparent direct attachment must remain independent of composed infrastructure and must not relay terminal data.
51
+ - Recovery records store identity and bounded references, not terminal streams, authentication material, or arbitrary environment values.
52
+ - A failed in-terminal 2×2 proof cannot be waived to merge composed infrastructure.
53
+ - Proof automation must not launch, focus, drive, resize, or close terminal applications on an active workstation.
54
+
55
+ The executable repository policy tests cover these invariants alongside the architecture checker.
@@ -0,0 +1,32 @@
1
+ # In-terminal 2×2 proof gate
2
+
3
+ The composed-terminal proof is a stop/go gate. AddOne must not merge or productize composed terminal panes until the exact in-terminal spike artifact passes both technical and physical acceptance.
4
+
5
+ ## Go criteria
6
+
7
+ A `go` decision requires all of the following:
8
+
9
+ 1. Every mandatory workload in the terminal-host evidence schema passes.
10
+ 2. The proof runs inside an existing terminal without creating a desktop window.
11
+ 3. The exact artifact is tied to pinned AddOne and terminal-component revisions.
12
+ 4. Automated evidence came from an isolated worker.
13
+ 5. The physical verdict is `accepted` through user-controlled manual validation or an attested isolated disposable worker.
14
+ 6. Input-to-process p95 latency is at most 16 ms.
15
+ 7. Output-to-present p95 latency is at most 33 ms.
16
+ 8. Missed frames are zero.
17
+ 9. Resize paint gaps are zero.
18
+ 10. No active-workstation terminal automation occurred.
19
+ 11. The recorded evidence schema validates without contradictory summaries.
20
+
21
+ ## Stop criteria
22
+
23
+ Any failed, missing, incomplete, contradictory, physically unverified, or threshold-exceeding result is `stop`. A `stop` result:
24
+
25
+ - forbids production composed-terminal integration;
26
+ - forbids milestone merge for composed-terminal work;
27
+ - cannot be waived by changing thresholds after evidence collection;
28
+ - preserves structured-agent and transparent-mode work as independently usable;
29
+ - stops composed-terminal work instead of starting a custom rendering/input remediation loop;
30
+ - prevents investment in a postponed desktop-native application shell.
31
+
32
+ The executable decision is `evaluateNativeSpikeGate` in `src/foundation/native-host-protocol/proof-gate.ts`. The current acceptance record is `openspec/changes/evolve-bare-a1-into-multi-agent-workspace/evidence/terminal-spike-acceptance-record.json`; it remains pending until task 5.6 records a physical verdict for exact artifact bytes.