@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,38 @@
1
+ import { type AgentRecoveryAuthority, type StructuredAgentSnapshot, type StructuredCapabilityContract, type StructuredRecoveryAuthority } from "../workspace-contracts/index.js";
2
+ import { StructuredEventReducer, type StructuredRuntimeView } from "./state.js";
3
+ export interface StructuredResumeProof {
4
+ readonly protocolVersion: number;
5
+ readonly agentId: string;
6
+ readonly adapterId: string;
7
+ readonly processIdentity: string;
8
+ readonly ownershipProof: string;
9
+ readonly boundary: {
10
+ readonly kind: "position";
11
+ readonly position: number;
12
+ readonly resumeToken: string;
13
+ } | {
14
+ readonly kind: "snapshot";
15
+ readonly snapshotId: string;
16
+ readonly snapshot: StructuredAgentSnapshot;
17
+ };
18
+ }
19
+ export type StructuredReconnectionResult = {
20
+ readonly kind: "accepted";
21
+ readonly boundary: StructuredRecoveryAuthority["boundary"];
22
+ readonly view: StructuredRuntimeView | null;
23
+ readonly diagnostic: string;
24
+ } | {
25
+ readonly kind: "terminated";
26
+ readonly reason: "non-reconnectable";
27
+ readonly diagnostic: string;
28
+ } | {
29
+ readonly kind: "rejected";
30
+ readonly code: string;
31
+ readonly diagnostic: string;
32
+ };
33
+ export declare class StructuredReconnectionManager {
34
+ #private;
35
+ constructor(capability: StructuredCapabilityContract);
36
+ resume(authorityValue: AgentRecoveryAuthority, proof: StructuredResumeProof, reducer?: StructuredEventReducer | null): StructuredReconnectionResult;
37
+ }
38
+ //# sourceMappingURL=reconnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconnection.d.ts","sourceRoot":"","sources":["../../../../src/foundation/structured-agent-runtime/reconnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EACb;QAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GACtF;QAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAA;KAAE,CAAC;CAC5G;AAED,MAAM,MAAM,4BAA4B,GACpC;IACA,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAC3D,QAAQ,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,GACC;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAClG;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF,qBAAa,6BAA6B;;gBAI5B,UAAU,EAAE,4BAA4B;IAKpD,MAAM,CACJ,cAAc,EAAE,sBAAsB,EACtC,KAAK,EAAE,qBAAqB,EAC5B,OAAO,GAAE,sBAAsB,GAAG,IAAW,GAC5C,4BAA4B;CAoEhC"}
@@ -0,0 +1,130 @@
1
+ import { WORKSPACE_CONTRACT_VERSION, assertRecoveryAuthority, assertStructuredAgentSnapshot, assertStructuredCapability, } from "../workspace-contracts/index.js";
2
+ import { StructuredEventReducer } from "./state.js";
3
+ export class StructuredReconnectionManager {
4
+ #capability;
5
+ #acceptedBoundaries = new Set();
6
+ constructor(capability) {
7
+ assertStructuredCapability(capability);
8
+ this.#capability = capability;
9
+ }
10
+ resume(authorityValue, proof, reducer = null) {
11
+ let authority;
12
+ try {
13
+ assertRecoveryAuthority(authorityValue);
14
+ authority = authorityValue;
15
+ }
16
+ catch (error) {
17
+ return rejected("invalid-authority", error);
18
+ }
19
+ if (authority.kind !== "structured")
20
+ return rejected("invalid-authority", new Error("structured reconnection requires structured recovery authority"));
21
+ if (this.#capability.resume === "none") {
22
+ return { kind: "terminated", reason: "non-reconnectable", diagnostic: "adapter did not negotiate reconnection; durable agent is ended after restart" };
23
+ }
24
+ if (this.#capability.resume !== authority.boundary.kind) {
25
+ return rejected("unsupported-resume", new Error(`persisted ${authority.boundary.kind} recovery is unavailable from negotiated ${this.#capability.resume} resume`));
26
+ }
27
+ const identityError = verifyIdentity(authority, proof);
28
+ if (identityError)
29
+ return identityError;
30
+ if (proof.protocolVersion !== WORKSPACE_CONTRACT_VERSION) {
31
+ return rejected("version-mismatch", new Error(`resume protocol ${proof.protocolVersion} does not match supported version ${WORKSPACE_CONTRACT_VERSION}`));
32
+ }
33
+ if (proof.boundary.kind !== authority.boundary.kind) {
34
+ return rejected("boundary-mismatch", new Error("resume proof boundary does not match the persisted recovery boundary"));
35
+ }
36
+ const boundaryKey = boundaryKeyOf(authority.boundary);
37
+ if (this.#acceptedBoundaries.has(boundaryKey)) {
38
+ return rejected("replay-detected", new Error("structured recovery boundary has already been accepted"));
39
+ }
40
+ if (authority.boundary.kind === "position") {
41
+ if (proof.boundary.kind !== "position")
42
+ return rejected("boundary-mismatch", new Error("position resume requires a position proof"));
43
+ if (proof.boundary.position !== authority.boundary.position) {
44
+ return rejected("boundary-mismatch", new Error("resume position does not match the persisted recovery boundary"));
45
+ }
46
+ if (proof.boundary.resumeToken !== authority.boundary.resumeToken) {
47
+ return rejected("stale-token", new Error("resume token does not match the persisted recovery boundary"));
48
+ }
49
+ let view = null;
50
+ if (reducer) {
51
+ const restored = restorePosition(reducer, authority.agentId, proof.boundary.position);
52
+ if (isRejected(restored))
53
+ return restored;
54
+ view = restored;
55
+ }
56
+ this.#acceptedBoundaries.add(boundaryKey);
57
+ return { kind: "accepted", boundary: authority.boundary, view, diagnostic: "structured resume position verified" };
58
+ }
59
+ if (proof.boundary.kind !== "snapshot")
60
+ return rejected("boundary-mismatch", new Error("snapshot resume requires a snapshot proof"));
61
+ if (proof.boundary.snapshotId !== authority.boundary.snapshotId) {
62
+ return rejected("stale-token", new Error("resume snapshot identity does not match the persisted recovery boundary"));
63
+ }
64
+ if (payloadBytes(proof.boundary.snapshot.payload) > this.#capability.flow.maxSnapshotBytes) {
65
+ return rejected("snapshot-too-large", new Error(`resume snapshot exceeds the negotiated ${this.#capability.flow.maxSnapshotBytes} byte limit`));
66
+ }
67
+ const snapshotResult = verifySnapshot(authority.agentId, proof.boundary.snapshotId, proof.boundary.snapshot);
68
+ if (snapshotResult)
69
+ return snapshotResult;
70
+ if (reducer) {
71
+ const applied = reducer.replaceWithSnapshot(proof.boundary.snapshot);
72
+ if (applied.kind !== "snapshot-applied") {
73
+ return rejected("snapshot-recovery-failed", new Error(`snapshot recovery failed: ${applied.kind}`));
74
+ }
75
+ this.#acceptedBoundaries.add(boundaryKey);
76
+ return { kind: "accepted", boundary: authority.boundary, view: applied.view, diagnostic: "structured snapshot recovery verified" };
77
+ }
78
+ this.#acceptedBoundaries.add(boundaryKey);
79
+ return { kind: "accepted", boundary: authority.boundary, view: null, diagnostic: "structured snapshot recovery verified" };
80
+ }
81
+ }
82
+ function verifyIdentity(authority, proof) {
83
+ if (proof.agentId !== authority.agentId)
84
+ return rejected("agent-mismatch", new Error("resume proof agent does not match the durable agent identity"));
85
+ if (proof.adapterId !== authority.adapterId)
86
+ return rejected("adapter-mismatch", new Error("resume proof adapter does not match the durable adapter identity"));
87
+ if (proof.processIdentity !== authority.processIdentity)
88
+ return rejected("process-mismatch", new Error("resume proof process does not match verified process ownership"));
89
+ if (proof.ownershipProof !== authority.ownershipProof)
90
+ return rejected("proof-mismatch", new Error("resume ownership proof does not match the persisted authority"));
91
+ return null;
92
+ }
93
+ function verifySnapshot(agentId, snapshotId, snapshot) {
94
+ try {
95
+ assertStructuredAgentSnapshot(snapshot);
96
+ }
97
+ catch (error) {
98
+ return rejected("invalid-snapshot", error);
99
+ }
100
+ if (snapshot.snapshotId !== snapshotId)
101
+ return rejected("invalid-snapshot", new Error("snapshot payload identity does not match the resume boundary"));
102
+ if (snapshot.agentId !== agentId)
103
+ return rejected("agent-mismatch", new Error("snapshot payload agent does not match the durable agent identity"));
104
+ return null;
105
+ }
106
+ function restorePosition(reducer, agentId, position) {
107
+ if (reducer.agentId !== agentId)
108
+ return rejected("agent-mismatch", new Error("resume reducer agent does not match the durable agent identity"));
109
+ try {
110
+ return reducer.restoreResumeBoundary(position);
111
+ }
112
+ catch (error) {
113
+ return rejected("invalid-authority", error);
114
+ }
115
+ }
116
+ function boundaryKeyOf(boundary) {
117
+ return boundary.kind === "position"
118
+ ? `position:${boundary.position}:${boundary.resumeToken}`
119
+ : `snapshot:${boundary.snapshotId}`;
120
+ }
121
+ function isRejected(value) {
122
+ return "kind" in value && value.kind === "rejected";
123
+ }
124
+ function payloadBytes(payload) {
125
+ return new TextEncoder().encode(JSON.stringify(payload)).byteLength;
126
+ }
127
+ function rejected(code, error) {
128
+ return { kind: "rejected", code, diagnostic: error instanceof Error ? error.message : String(error) };
129
+ }
130
+ //# sourceMappingURL=reconnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconnection.js","sourceRoot":"","sources":["../../../../src/foundation/structured-agent-runtime/reconnection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,6BAA6B,EAC7B,0BAA0B,GAK3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAA8B,MAAM,YAAY,CAAC;AAuBhF,MAAM,OAAO,6BAA6B;IAC/B,WAAW,CAA+B;IAC1C,mBAAmB,GAAG,IAAI,GAAG,EAAU,CAAC;IAEjD,YAAY,UAAwC;QAClD,0BAA0B,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,MAAM,CACJ,cAAsC,EACtC,KAA4B,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UAAU,CAAC;AACtE,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAc;IAC5C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACxG,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { type StructuredAgentSnapshot, type StructuredCapabilityContract, type WorkspaceEvent } from "../workspace-contracts/index.js";
2
+ export type StructuredAgentEvent = Extract<WorkspaceEvent, {
3
+ readonly type: "structured-event";
4
+ }>;
5
+ export interface StructuredRuntimeView {
6
+ readonly agentId: string;
7
+ readonly revision: number;
8
+ readonly lastAppliedPosition: number | null;
9
+ readonly nextEventPosition: number;
10
+ readonly appliedEventCount: number;
11
+ readonly lastEventType: string | null;
12
+ readonly lastEventPayload: unknown;
13
+ readonly snapshotId: string | null;
14
+ readonly snapshotPayload: unknown;
15
+ }
16
+ export type StructuredEventApplyResult = {
17
+ readonly kind: "applied";
18
+ readonly view: StructuredRuntimeView;
19
+ } | {
20
+ readonly kind: "duplicate";
21
+ readonly view: StructuredRuntimeView;
22
+ readonly duplicatePosition: number;
23
+ } | {
24
+ readonly kind: "resynchronization-required";
25
+ readonly view: StructuredRuntimeView;
26
+ readonly expectedPosition: number;
27
+ readonly receivedPosition: number;
28
+ readonly recovery: "snapshot" | "none";
29
+ } | {
30
+ readonly kind: "rejected";
31
+ readonly code: string;
32
+ readonly diagnostic: string;
33
+ };
34
+ export type StructuredSnapshotApplyResult = {
35
+ readonly kind: "snapshot-applied";
36
+ readonly view: StructuredRuntimeView;
37
+ } | {
38
+ readonly kind: "snapshot-stale";
39
+ readonly view: StructuredRuntimeView;
40
+ readonly currentPosition: number;
41
+ readonly snapshotPosition: number;
42
+ } | {
43
+ readonly kind: "rejected";
44
+ readonly code: string;
45
+ readonly diagnostic: string;
46
+ };
47
+ export declare class StructuredEventReducer {
48
+ #private;
49
+ readonly agentId: string;
50
+ constructor(agentId: string, capability: StructuredCapabilityContract);
51
+ applyEvent(event: StructuredAgentEvent): StructuredEventApplyResult;
52
+ replaceWithSnapshot(snapshot: StructuredAgentSnapshot): StructuredSnapshotApplyResult;
53
+ restoreResumeBoundary(position: number): StructuredRuntimeView;
54
+ nextEventPosition(): number;
55
+ view(): StructuredRuntimeView;
56
+ }
57
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/foundation/structured-agent-runtime/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAAC;AAElG,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,MAAM,0BAA0B,GAClC;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAA;CAAE,GAClE;IAAE,Q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;IA8BrF,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB;IAY9D,iBAAiB,IAAI,MAAM;IAI3B,IAAI,IAAI,qBAAqB;CAa9B"}
@@ -0,0 +1,119 @@
1
+ import { assertStructuredAgentSnapshot, assertStructuredCapability, assertWorkspaceEvent, } from "../workspace-contracts/index.js";
2
+ export class StructuredEventReducer {
3
+ agentId;
4
+ #capability;
5
+ #lastAppliedPosition = null;
6
+ #appliedEventCount = 0;
7
+ #revision = 0;
8
+ #lastEventType = null;
9
+ #lastEventPayload = null;
10
+ #snapshotId = null;
11
+ #snapshotPayload = null;
12
+ constructor(agentId, capability) {
13
+ this.agentId = agentId;
14
+ assertStructuredCapability(capability);
15
+ if (!agentId || agentId.includes("\0"))
16
+ throw new TypeError("structured reducer agent id is invalid");
17
+ this.#capability = capability;
18
+ }
19
+ applyEvent(event) {
20
+ try {
21
+ assertWorkspaceEvent(event);
22
+ }
23
+ catch (error) {
24
+ return rejected("malformed-event", error);
25
+ }
26
+ if (event.agentId !== this.agentId) {
27
+ return rejected("agent-mismatch", new Error("structured event agent does not match the reducer identity"));
28
+ }
29
+ if (!this.#capability.eventTypes.includes(event.eventType)) {
30
+ return rejected("unsupported-event-type", new Error(`structured event type is not negotiated: ${event.eventType}`));
31
+ }
32
+ if (payloadBytes(event.payload) > this.#capability.flow.maxEventBytes) {
33
+ return rejected("event-too-large", new Error(`structured event exceeds the negotiated ${this.#capability.flow.maxEventBytes} byte limit`));
34
+ }
35
+ const nextPosition = this.nextEventPosition();
36
+ if (event.position < nextPosition) {
37
+ return { kind: "duplicate", view: this.view(), duplicatePosition: event.position };
38
+ }
39
+ if (event.position > nextPosition) {
40
+ return {
41
+ kind: "resynchronization-required",
42
+ view: this.view(),
43
+ expectedPosition: nextPosition,
44
+ receivedPosition: event.position,
45
+ recovery: this.#capability.snapshots === "authoritative" ? "snapshot" : "none",
46
+ };
47
+ }
48
+ this.#lastAppliedPosition = event.position;
49
+ this.#appliedEventCount += 1;
50
+ this.#lastEventType = event.eventType;
51
+ this.#lastEventPayload = event.payload;
52
+ this.#revision += 1;
53
+ return { kind: "applied", view: this.view() };
54
+ }
55
+ replaceWithSnapshot(snapshot) {
56
+ if (this.#capability.snapshots !== "authoritative") {
57
+ return rejected("snapshots-unsupported", new Error("the negotiated adapter capability does not provide authoritative snapshots"));
58
+ }
59
+ try {
60
+ assertStructuredAgentSnapshot(snapshot);
61
+ }
62
+ catch (error) {
63
+ return rejected("malformed-snapshot", error);
64
+ }
65
+ if (snapshot.agentId !== this.agentId) {
66
+ return rejected("agent-mismatch", new Error("structured snapshot agent does not match the reducer identity"));
67
+ }
68
+ if (payloadBytes(snapshot.payload) > this.#capability.flow.maxSnapshotBytes) {
69
+ return rejected("snapshot-too-large", new Error(`structured snapshot exceeds the negotiated ${this.#capability.flow.maxSnapshotBytes} byte limit`));
70
+ }
71
+ const currentPosition = this.#lastAppliedPosition;
72
+ if (currentPosition !== null && snapshot.position < currentPosition) {
73
+ return { kind: "snapshot-stale", view: this.view(), currentPosition, snapshotPosition: snapshot.position };
74
+ }
75
+ this.#lastAppliedPosition = snapshot.position;
76
+ this.#appliedEventCount = 0;
77
+ this.#lastEventType = null;
78
+ this.#lastEventPayload = null;
79
+ this.#snapshotId = snapshot.snapshotId;
80
+ this.#snapshotPayload = snapshot.payload;
81
+ this.#revision += 1;
82
+ return { kind: "snapshot-applied", view: this.view() };
83
+ }
84
+ restoreResumeBoundary(position) {
85
+ if (!Number.isSafeInteger(position) || position < 0)
86
+ throw new RangeError("structured resume position must be a non-negative safe integer");
87
+ this.#lastAppliedPosition = position;
88
+ this.#appliedEventCount = 0;
89
+ this.#lastEventType = null;
90
+ this.#lastEventPayload = null;
91
+ this.#snapshotId = null;
92
+ this.#snapshotPayload = null;
93
+ this.#revision += 1;
94
+ return this.view();
95
+ }
96
+ nextEventPosition() {
97
+ return this.#lastAppliedPosition === null ? 0 : this.#lastAppliedPosition + 1;
98
+ }
99
+ view() {
100
+ return Object.freeze({
101
+ agentId: this.agentId,
102
+ revision: this.#revision,
103
+ lastAppliedPosition: this.#lastAppliedPosition,
104
+ nextEventPosition: this.nextEventPosition(),
105
+ appliedEventCount: this.#appliedEventCount,
106
+ lastEventType: this.#lastEventType,
107
+ lastEventPayload: this.#lastEventPayload,
108
+ snapshotId: this.#snapshotId,
109
+ snapshotPayload: this.#snapshotPayload,
110
+ });
111
+ }
112
+ }
113
+ function rejected(code, error) {
114
+ return { kind: "rejected", code, diagnostic: error instanceof Error ? error.message : String(error) };
115
+ }
116
+ function payloadBytes(payload) {
117
+ return new TextEncoder().encode(JSON.stringify(payload)).byteLength;
118
+ }
119
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/foundation/structured-agent-runtime/state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,GAIrB,MAAM,iCAAiC,CAAC;AAiCzC,MAAM,OAAO,sBAAsB;IAUZ;IATZ,WAAW,CAA+B;IACnD,oBAAoB,GAAkB,IAAI,CAAC;IAC3C,kBAAkB,GAAG,CAAC,CAAC;IACvB,SAAS,GAAG,CAAC,CAAC;IACd,cAAc,GAAkB,IAAI,CAAC;IACrC,iBAAiB,GAAY,IAAI,CAAC;IAClC,WAAW,GAAkB,IAAI,CAAC;IAClC,gBAAgB,GAAY,IAAI,CAAC;IAEjC,YAAqB,OAAe,EAAE,UAAwC;QAAzD,YAAO,GAAP,OAAO,CAAQ;QAClC,0BAA0B,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;QACtG,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,UAAU,CAAC,KAA2B;QACpC,IAAI,CAAC;YACH,oBAAoB,CAAC,KA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AAI,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,oBAAoB,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC;IAChF,CAAC;IAED,IAAI;QACF,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,mBAAmB,EAAE,IAAI,CAAC,oBAAoB;YAC9C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE;YAC3C,iBAAiB,EAAE,IAAI,CAAC,kBAAkB;YAC1C,aAAa,EAAE,IAAI,CAAC,cAAc;YAClC,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;YACxC,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,eAAe,EAAE,IAAI,CAAC,gBAAgB;SACvC,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAc;IAC5C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACxG,CAAC;AAED,SAAS,YAAY,CAAC,OAAgB;IACpC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;AACtE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./main.js";
2
+ export * from "./server.js";
3
+ export { resolveAddOnePaths, type AddOnePaths } from "../lifecycle/index.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/foundation/supervision/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./main.js";
2
+ export * from "./server.js";
3
+ export { resolveAddOnePaths } from "../lifecycle/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/foundation/supervision/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAoB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function runSupervisor(): Promise<void>;
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/foundation/supervision/main.ts"],"names":[],"mappings":"AAOA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CA8BnD"}
@@ -0,0 +1,40 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { appendFileSync, mkdirSync } from "node:fs";
3
+ import { assertImmutableExecutionRoot, readMaterializedRelease } from "../release/index.js";
4
+ import { ControlStore } from "../storage/index.js";
5
+ import { resolveAddOnePaths } from "./paths.js";
6
+ import { SupervisorServer } from "./server.js";
7
+ export async function runSupervisor() {
8
+ const paths = resolveAddOnePaths();
9
+ mkdirSync(paths.runtimeDir, { recursive: true, mode: 0o700 });
10
+ const log = (message) => appendFileSync(paths.supervisorLogPath, `${new Date().toISOString()} ${message}\n`);
11
+ const releaseRoot = process.env.ADDONE_RELEASE_ROOT;
12
+ if (!releaseRoot)
13
+ throw new Error("supervisor must be launched from a verified immutable AddOne release");
14
+ const release = await readMaterializedRelease(releaseRoot);
15
+ if (process.env.ADDONE_RELEASE_ID !== release.releaseId)
16
+ throw new Error("selected AddOne release identity does not match its verified manifest");
17
+ await assertImmutableExecutionRoot(release, paths.dataDir);
18
+ const bootNonce = randomUUID();
19
+ const store = new ControlStore(paths.databasePath, bootNonce);
20
+ const server = new SupervisorServer(store, paths, release, bootNonce);
21
+ await server.listen();
22
+ log(`supervisor ${server.id} listening at ${paths.endpoint} (pid ${process.pid})`);
23
+ let closing = false;
24
+ const close = async (signal) => {
25
+ if (closing)
26
+ return;
27
+ closing = true;
28
+ log(`received ${signal}; stopping supervised process tree`);
29
+ await server.close(true);
30
+ process.exitCode = 0;
31
+ };
32
+ process.on("SIGINT", () => void close("SIGINT"));
33
+ process.on("SIGTERM", () => void close("SIGTERM"));
34
+ process.on("uncaughtException", error => {
35
+ log(`uncaught exception: ${error.stack ?? error.message}`);
36
+ process.exitCode = 1;
37
+ });
38
+ process.on("unhandledRejection", error => log(`unhandled rejection: ${String(error)}`));
39
+ }
40
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/foundation/supervision/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAC;IACnC,SAAS,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9D,MAAM,GAAG,GA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AC;IACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE;QACtC,GAAG,CAAC,uBAAuB,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,wBAAwB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { resolveAddOnePaths, type AddOnePaths } from "../lifecycle/index.js";
2
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/foundation/supervision/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { resolveAddOnePaths } from "../lifecycle/index.js";
2
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../src/foundation/supervision/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAoB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type SupervisorSnapshot } from "../lifecycle/index.js";
2
+ import type { MaterializedRelease } from "../release/index.js";
3
+ import { ControlStore } from "../storage/index.js";
4
+ import { type AddOnePaths } from "./paths.js";
5
+ export declare class SupervisorServer {
6
+ #private;
7
+ readonly store: ControlStore;
8
+ readonly release: MaterializedRelease;
9
+ readonly terminateProcess: (code: number) => void;
10
+ readonly id: `${string}-${string}-${string}-${string}-${string}`;
11
+ readonly bootNonce: string;
12
+ readonly pidStartIdentity: string;
13
+ readonly startedAt: string;
14
+ readonly paths: AddOnePaths;
15
+ constructor(store: ControlStore, paths: AddOnePaths | undefined, release: MaterializedRelease, bootNonce?: string, terminateProcess?: (code: number) => void);
16
+ snapshot(): SupervisorSnapshot;
17
+ listen(): Promise<void>;
18
+ close(stopAgents?: boolean): Promise<void>;
19
+ closeForReleaseReplacement(stopAgents: boolean): Promise<void>;
20
+ }
21
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/foundation/supervision/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,qBAAa,gBAAgB;;IAczB,QAAQ,CAAC,KAAK,EAAE,YAAY;IAE5B,QAAQ,CAAC,OAAO,EAAE,mBAAmB;IAErC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;IAjBnD,QAAQ,CAAC,EAAE,sDAAgB;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,SAAyE;IAClG,QAAQ,CAAC,SAAS,SAA4B;IAC9C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;gBASjB,KAAK,EAAE,YAAY,EAC5B,KAAK,yBAAuB,EACnB,OAAO,EAAE,mBAAmB,EACrC,SAAS,GAAE,MAAqB,EACvB,gBAAgB,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAiC;IAOhF,QAAQ,IAAI,kBAAkB;IAIxB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBvB,KAAK,CAAC,UAAU,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxC,0BAA0B,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CA8LrE"}