elanous 0.2.44 → 0.3.1

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 (820) hide show
  1. package/README.md +3 -3
  2. package/apps/pwa/out/404/index.html +1 -1
  3. package/apps/pwa/out/404.html +1 -1
  4. package/apps/pwa/out/_next/static/98VlBaYvL-VVnCq93_lFS/_buildManifest.js +1 -0
  5. package/apps/pwa/out/_next/static/chunks/1388-1eb6df003f29bb9c.js +1 -0
  6. package/apps/pwa/out/_next/static/chunks/1434-a2c279f005d9c501.js +1 -0
  7. package/apps/pwa/out/_next/static/chunks/1464.14588e93d2ab3190.js +24 -0
  8. package/apps/pwa/out/_next/static/chunks/1465.85f9a1708f17853a.js +1 -0
  9. package/apps/pwa/out/_next/static/chunks/156.389be47355dc94c7.js +1 -0
  10. package/apps/pwa/out/_next/static/chunks/162.c03cf23572cb4136.js +1 -0
  11. package/apps/pwa/out/_next/static/chunks/1831.25868bc1e2cc0dae.js +1 -0
  12. package/apps/pwa/out/_next/static/chunks/1896.b6c635d0c8f65727.js +1 -0
  13. package/apps/pwa/out/_next/static/chunks/1939.3fa2506ad8e585bc.js +1 -0
  14. package/apps/pwa/out/_next/static/chunks/{5790.5eb06a653ebd8571.js → 1972.a8d37aadbc59ac43.js} +1 -1
  15. package/apps/pwa/out/_next/static/chunks/{8965-135a2c9eaa2464cb.js → 1997-f22e6f9510520182.js} +1 -1
  16. package/apps/pwa/out/_next/static/chunks/2242-6edf27c6c0ae7589.js +1 -0
  17. package/apps/pwa/out/_next/static/chunks/{46.57c783fa4884714f.js → 234.f25f5b0d65f89af8.js} +2 -2
  18. package/apps/pwa/out/_next/static/chunks/2344.795de26da3261060.js +23 -0
  19. package/apps/pwa/out/_next/static/chunks/2491.9ac5bd2f48bcd60c.js +226 -0
  20. package/apps/pwa/out/_next/static/chunks/2513.e03f6479c0079b6e.js +79 -0
  21. package/apps/pwa/out/_next/static/chunks/2551-43782d8812989ae7.js +1 -0
  22. package/apps/pwa/out/_next/static/chunks/2799.12b1a3e7090e27ef.js +1 -0
  23. package/apps/pwa/out/_next/static/chunks/2806.f04d7923f2adadb1.js +1 -0
  24. package/apps/pwa/out/_next/static/chunks/2862.b8ea08cbc69a63d4.js +1 -0
  25. package/apps/pwa/out/_next/static/chunks/295-1ff35d6a06be8400.js +1 -0
  26. package/apps/pwa/out/_next/static/chunks/3161.b9eb612f66d5ff04.js +1 -0
  27. package/apps/pwa/out/_next/static/chunks/3233.46021e4acc520c03.js +1 -0
  28. package/apps/pwa/out/_next/static/chunks/325.3cfd5b7571a9f740.js +1 -0
  29. package/apps/pwa/out/_next/static/chunks/{1266.a46cc33cb6a72d75.js → 3384.d91656787bec7922.js} +2 -2
  30. package/apps/pwa/out/_next/static/chunks/3414f5fa-46ae45073dca64f0.js +1 -0
  31. package/apps/pwa/out/_next/static/chunks/3589.a9094c2bc034055c.js +287 -0
  32. package/apps/pwa/out/_next/static/chunks/{2705.9816f3c244f8b85f.js → 367.1ffe524fe1ee7803.js} +1 -1
  33. package/apps/pwa/out/_next/static/chunks/3777.1450df79d987816d.js +1 -0
  34. package/apps/pwa/out/_next/static/chunks/3877-871ea505d778a6a7.js +1 -0
  35. package/apps/pwa/out/_next/static/chunks/4021.28d034c7fb0a6732.js +1 -0
  36. package/apps/pwa/out/_next/static/chunks/{6549dad0.2740b25e51bf8f05.js → 4069a63b.a074c39997560438.js} +1 -1
  37. package/apps/pwa/out/_next/static/chunks/4212.873105c37a871421.js +1 -0
  38. package/apps/pwa/out/_next/static/chunks/423-6be27163a1bce5d7.js +1 -0
  39. package/apps/pwa/out/_next/static/chunks/4231.644cd1e23974f1f6.js +1 -0
  40. package/apps/pwa/out/_next/static/chunks/4362.1adc1412509b7bb8.js +94 -0
  41. package/apps/pwa/out/_next/static/chunks/4431.83a630154376636a.js +41 -0
  42. package/apps/pwa/out/_next/static/chunks/4506-f8439f6fbd0a8483.js +1 -0
  43. package/apps/pwa/out/_next/static/chunks/4540-993e2e4e1d485a9a.js +1 -0
  44. package/apps/pwa/out/_next/static/chunks/4719-1d04b01d4d6166fc.js +1 -0
  45. package/apps/pwa/out/_next/static/chunks/4754-bfd5e1ad9016e176.js +1 -0
  46. package/apps/pwa/out/_next/static/chunks/5001.b39bf6d792509317.js +64 -0
  47. package/apps/pwa/out/_next/static/chunks/5021.7234ae147ab0a3e1.js +77 -0
  48. package/apps/pwa/out/_next/static/chunks/5230.3e562ed2a69cbc7b.js +1 -0
  49. package/apps/pwa/out/_next/static/chunks/5279.f75fafa19de6e131.js +1 -0
  50. package/apps/pwa/out/_next/static/chunks/{5a34fb2f.52f1b4e1baebb48a.js → 52bafb67.054ec9d048116d83.js} +3 -3
  51. package/apps/pwa/out/_next/static/chunks/5325-b9c1258cc7e579f9.js +1 -0
  52. package/apps/pwa/out/_next/static/chunks/5495-37306015ec740354.js +1 -0
  53. package/apps/pwa/out/_next/static/chunks/{1694.18debfd77562e56d.js → 5536.bbb17703f46e52e7.js} +2 -2
  54. package/apps/pwa/out/_next/static/chunks/{6245.1182e007e9d230d9.js → 5571.a062963c309338b4.js} +2 -2
  55. package/apps/pwa/out/_next/static/chunks/5658.d1e61315cb865f82.js +32 -0
  56. package/apps/pwa/out/_next/static/chunks/5709.867a5086d782dd97.js +286 -0
  57. package/apps/pwa/out/_next/static/chunks/5765.5949ec61cec63eac.js +1 -0
  58. package/apps/pwa/out/_next/static/chunks/587.e6b35bcbd947c58e.js +8 -0
  59. package/apps/pwa/out/_next/static/chunks/5951-f25e14d03e72135a.js +1 -0
  60. package/apps/pwa/out/_next/static/chunks/5962-1ab68b213684716b.js +1 -0
  61. package/apps/pwa/out/_next/static/chunks/{4502.bdcc877abd437a05.js → 5998.d426273cdd00305a.js} +1 -1
  62. package/apps/pwa/out/_next/static/chunks/6352.20c708245475cf50.js +1 -0
  63. package/apps/pwa/out/_next/static/chunks/6548-a160aa580fb9a8ff.js +1 -0
  64. package/apps/pwa/out/_next/static/chunks/673-40c924b2095a05eb.js +1 -0
  65. package/apps/pwa/out/_next/static/chunks/6731-c9308c2f71a1b8e3.js +1 -0
  66. package/apps/pwa/out/_next/static/chunks/{6881.9e7955847640c7fe.js → 6747.365eefdf3b4a0226.js} +17 -17
  67. package/apps/pwa/out/_next/static/chunks/691.6ff56b5f4b6ec918.js +309 -0
  68. package/apps/pwa/out/_next/static/chunks/6932.f80f616260b74131.js +1 -0
  69. package/apps/pwa/out/_next/static/chunks/6950-5d5edab502cc208b.js +1 -0
  70. package/apps/pwa/out/_next/static/chunks/6982.e8fecbf7feb3aba5.js +1 -0
  71. package/apps/pwa/out/_next/static/chunks/7051-0dbbb2c1ce4f519e.js +1 -0
  72. package/apps/pwa/out/_next/static/chunks/{8551.f762945c2cda2e95.js → 7087.99662912e4db6255.js} +1 -1
  73. package/apps/pwa/out/_next/static/chunks/709.bd9939dbb991de9f.js +1 -0
  74. package/apps/pwa/out/_next/static/chunks/7197.7b19aa948048e19a.js +93 -0
  75. package/apps/pwa/out/_next/static/chunks/7230-6527ac6be205c096.js +1 -0
  76. package/apps/pwa/out/_next/static/chunks/7233-d93f8ce1475f730c.js +1 -0
  77. package/apps/pwa/out/_next/static/chunks/7292-a4d5c8d2fe255e06.js +1 -0
  78. package/apps/pwa/out/_next/static/chunks/7304-dae57d61a8ccccf0.js +1 -0
  79. package/apps/pwa/out/_next/static/chunks/7382.bf53ab097670a235.js +27 -0
  80. package/apps/pwa/out/_next/static/chunks/7434.99c31fb661085b6a.js +1 -0
  81. package/apps/pwa/out/_next/static/chunks/7457-9ceddd4301467503.js +1 -0
  82. package/apps/pwa/out/_next/static/chunks/{3349.b5f09ee474d9533e.js → 7479.d00f44fde98cf34e.js} +1 -1
  83. package/apps/pwa/out/_next/static/chunks/7494.d8b8d01d8dcbafe8.js +2 -0
  84. package/apps/pwa/out/_next/static/chunks/{4757.67c6d7473a038e78.js → 751.95d127a92f7817e3.js} +1 -1
  85. package/apps/pwa/out/_next/static/chunks/7554-d9cec4ac2e6d556d.js +1 -0
  86. package/apps/pwa/out/_next/static/chunks/7733-6f0d8da7a3f3ce91.js +1 -0
  87. package/apps/pwa/out/_next/static/chunks/7757-6f4b6363cc651de5.js +1 -0
  88. package/apps/pwa/out/_next/static/chunks/{5a5078f8.2099200e5ea95e16.js → 77a1aef7.ba1c04f78a1493d9.js} +1 -1
  89. package/apps/pwa/out/_next/static/chunks/787-4d1d55b1311a5019.js +1 -0
  90. package/apps/pwa/out/_next/static/chunks/7915-a755af5ea69cfcfe.js +1 -0
  91. package/apps/pwa/out/_next/static/chunks/8029-2963385667511b16.js +1 -0
  92. package/apps/pwa/out/_next/static/chunks/8090.bc2349b6133b2cd5.js +1 -0
  93. package/apps/pwa/out/_next/static/chunks/8136.8ff2113530c27083.js +1 -0
  94. package/apps/pwa/out/_next/static/chunks/819.632a2a50f814f98e.js +74 -0
  95. package/apps/pwa/out/_next/static/chunks/8328.72a79ba9b81971ad.js +1 -0
  96. package/apps/pwa/out/_next/static/chunks/8448.4e25153e035786b0.js +62 -0
  97. package/apps/pwa/out/_next/static/chunks/{7679.32c40cdd14f20b4a.js → 8469.f67afe44a0fa8af0.js} +1 -1
  98. package/apps/pwa/out/_next/static/chunks/8613.76dfc054055f06ba.js +1 -0
  99. package/apps/pwa/out/_next/static/chunks/8649-fe9165a8879fad56.js +1 -0
  100. package/apps/pwa/out/_next/static/chunks/8840-53feb140de04dcfe.js +1 -0
  101. package/apps/pwa/out/_next/static/chunks/8873.ef8a37057644f876.js +1 -0
  102. package/apps/pwa/out/_next/static/chunks/8917-46eb4e608f44bf74.js +1 -0
  103. package/apps/pwa/out/_next/static/chunks/8954.e749ad9e9c5ca512.js +115 -0
  104. package/apps/pwa/out/_next/static/chunks/9065.8134b756614cf83f.js +36 -0
  105. package/apps/pwa/out/_next/static/chunks/9089.087fcd352568af49.js +1 -0
  106. package/apps/pwa/out/_next/static/chunks/9103.bd34694d18c05083.js +1 -0
  107. package/apps/pwa/out/_next/static/chunks/9140-bfcc4075cac3c387.js +1 -0
  108. package/apps/pwa/out/_next/static/chunks/9272.787cb6d987824708.js +1 -0
  109. package/apps/pwa/out/_next/static/chunks/9361-5b10273d3f34b21d.js +1 -0
  110. package/apps/pwa/out/_next/static/chunks/9396.097c14dd4df77c43.js +1 -0
  111. package/apps/pwa/out/_next/static/chunks/9468.370ef15c86f7b141.js +1 -0
  112. package/apps/pwa/out/_next/static/chunks/{5989.7ecd362c5c44b747.js → 9531.ffbcd1e59e2c32fc.js} +17 -17
  113. package/apps/pwa/out/_next/static/chunks/963-66d3a6d98e977ae5.js +1 -0
  114. package/apps/pwa/out/_next/static/chunks/9644.a615f56876ed37b8.js +90 -0
  115. package/apps/pwa/out/_next/static/chunks/{4415-b9d6a90960920a4a.js → 9693-ab5bc28704a66601.js} +3 -3
  116. package/apps/pwa/out/_next/static/chunks/9705-bbcd00db4ffd3484.js +1 -0
  117. package/apps/pwa/out/_next/static/chunks/{7864.b1ff31d4030b8994.js → 9786.2d8c3b7368f18f1b.js} +3 -3
  118. package/apps/pwa/out/_next/static/chunks/9805.e17f9c6e3811e48b.js +24 -0
  119. package/apps/pwa/out/_next/static/chunks/9876-49a1e08c0dfe7b8c.js +1 -0
  120. package/apps/pwa/out/_next/static/chunks/9891.5995e75a99b53d4e.js +149 -0
  121. package/apps/pwa/out/_next/static/chunks/{178-4da509cd7266672a.js → 9912-2be6b6ea0321c365.js} +1 -1
  122. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-c0543429ffa9cdfb.js +1 -0
  123. package/apps/pwa/out/_next/static/chunks/app/approvals/page-39f04d88df12b3e9.js +1 -0
  124. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-e4f014aa82483cae.js +1 -0
  125. package/apps/pwa/out/_next/static/chunks/app/board/page-e86f9273877eab46.js +1 -0
  126. package/apps/pwa/out/_next/static/chunks/app/botlab/page-dbc30fbf2e8933d9.js +1 -0
  127. package/apps/pwa/out/_next/static/chunks/app/bots/page-d83a916672a8cfd3.js +1 -0
  128. package/apps/pwa/out/_next/static/chunks/app/ceo/page-22f27eaa5e6e68c7.js +1 -0
  129. package/apps/pwa/out/_next/static/chunks/app/chat/page-66477bf22d33b56e.js +1 -0
  130. package/apps/pwa/out/_next/static/chunks/app/consult/page-913f2a86ea109c65.js +1 -0
  131. package/apps/pwa/out/_next/static/chunks/app/control/page-ac51dc349381d564.js +1 -0
  132. package/apps/pwa/out/_next/static/chunks/app/decisions/page-cd09fc74dca72511.js +1 -0
  133. package/apps/pwa/out/_next/static/chunks/app/design-check/page-6c357f5b58598b67.js +1 -0
  134. package/apps/pwa/out/_next/static/chunks/app/editor/page-ab83de8c73bd2e4f.js +1 -0
  135. package/apps/pwa/out/_next/static/chunks/app/exec/page-6402ad2273b6f7b5.js +1 -0
  136. package/apps/pwa/out/_next/static/chunks/app/field/page-50d9b8d13b33f785.js +1 -0
  137. package/apps/pwa/out/_next/static/chunks/app/healthz/route-c0543429ffa9cdfb.js +1 -0
  138. package/apps/pwa/out/_next/static/chunks/app/inside/page-ffca50fc1f13759c.js +1 -0
  139. package/apps/pwa/out/_next/static/chunks/app/intake/page-3316bfc28a901722.js +1 -0
  140. package/apps/pwa/out/_next/static/chunks/app/layout-aef93e049341011e.js +1 -0
  141. package/apps/pwa/out/_next/static/chunks/app/live/page-8e67bb49fa81d4e5.js +1 -0
  142. package/apps/pwa/out/_next/static/chunks/app/live-run/page-8b8c8ac4a3edf0eb.js +1 -0
  143. package/apps/pwa/out/_next/static/chunks/app/loops/page-b5b994c9ea03f6d7.js +1 -0
  144. package/apps/pwa/out/_next/static/chunks/app/market/page-1a06f6f510439341.js +1 -0
  145. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/{page-e187ac52a95538b3.js → page-d9720f6a03f31fa7.js} +1 -1
  146. package/apps/pwa/out/_next/static/chunks/app/morning/page-d7c891d78672d771.js +1 -0
  147. package/apps/pwa/out/_next/static/chunks/app/not-found-e915872b37ca7dcf.js +1 -0
  148. package/apps/pwa/out/_next/static/chunks/app/observatory/page-43c2ec7c00978377.js +1 -0
  149. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-c2537aa89b121637.js +1 -0
  150. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-3264666f6ef99431.js +1 -0
  151. package/apps/pwa/out/_next/static/chunks/app/ops/resources/page-efe9dd7bc58d4fc6.js +1 -0
  152. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-153277343c9956b8.js +1 -0
  153. package/apps/pwa/out/_next/static/chunks/app/outputs/page-c1457829d1506ad7.js +1 -0
  154. package/apps/pwa/out/_next/static/chunks/app/page-9622573651a4b6ce.js +1 -0
  155. package/apps/pwa/out/_next/static/chunks/app/reflection/page-5aeba1aa69ec67ad.js +1 -0
  156. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-29cf1ba9ae2fdb92.js +1 -0
  157. package/apps/pwa/out/_next/static/chunks/app/sessions/page-99a060c6edd4726c.js +1 -0
  158. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-decfacd2237da403.js +1 -0
  159. package/apps/pwa/out/_next/static/chunks/app/settings/page-3650eed85a5c5c93.js +1 -0
  160. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-14077f0eddcae22f.js +1 -0
  161. package/apps/pwa/out/_next/static/chunks/app/setup/layout-c0543429ffa9cdfb.js +1 -0
  162. package/apps/pwa/out/_next/static/chunks/app/setup/page-364ee29f223bdc6b.js +1 -0
  163. package/apps/pwa/out/_next/static/chunks/app/share/page-905fb1f67c2665a7.js +1 -0
  164. package/apps/pwa/out/_next/static/chunks/app/showroom/page-79907fc36e3113f4.js +1 -0
  165. package/apps/pwa/out/_next/static/chunks/app/tasks/page-8f01867ee2a701b6.js +1 -0
  166. package/apps/pwa/out/_next/static/chunks/app/term/page-310b734167671ba8.js +1 -0
  167. package/apps/pwa/out/_next/static/chunks/app/today/page-cb1ca7ae52803603.js +1 -0
  168. package/apps/pwa/out/_next/static/chunks/app/trace/page-5491f2fb8e9376b5.js +1 -0
  169. package/apps/pwa/out/_next/static/chunks/app/vault/page-7e98befd36460b21.js +1 -0
  170. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-220923eefd5149b5.js +1 -0
  171. package/apps/pwa/out/_next/static/chunks/app/workflows/page-afdef54bb570da39.js +1 -0
  172. package/apps/pwa/out/_next/static/chunks/app/workspace/page-19f8acddbff16091.js +1 -0
  173. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-d327a7647a075184.js +1 -0
  174. package/apps/pwa/out/_next/static/chunks/bc1f8ef9.b79035bd0f565c66.js +1 -0
  175. package/apps/pwa/out/_next/static/chunks/{892fd990.456232f326cc39c2.js → c58bec24.d208786405e23259.js} +1 -1
  176. package/apps/pwa/out/_next/static/chunks/cf9ff424.b702f4a2ac70d836.js +1 -0
  177. package/apps/pwa/out/_next/static/chunks/d90ea774-d492ff408af303c1.js +1 -0
  178. package/apps/pwa/out/_next/static/chunks/{2e0f720a.a0697c08e3806a60.js → e7a93f74.aa8572069f848f17.js} +1 -1
  179. package/apps/pwa/out/_next/static/chunks/ec9064d2.691021d974525713.js +122 -0
  180. package/apps/pwa/out/_next/static/chunks/ef9d715f.186b83d00befb229.js +1 -0
  181. package/apps/pwa/out/_next/static/chunks/framework-f01b715c1ec2fb74.js +1 -0
  182. package/apps/pwa/out/_next/static/chunks/main-3267c2e627901292.js +1 -0
  183. package/apps/pwa/out/_next/static/chunks/main-app-a690bcbeac3c465d.js +1 -0
  184. package/apps/pwa/out/_next/static/chunks/pages/_app-124f11699738fd43.js +1 -0
  185. package/apps/pwa/out/_next/static/chunks/pages/_error-754b7bd073a36a5f.js +1 -0
  186. package/apps/pwa/out/_next/static/chunks/webpack-8ded1efe8121eba0.js +1 -0
  187. package/apps/pwa/out/_next/static/css/32b8e1b8996dbf5e.css +1 -0
  188. package/apps/pwa/out/_next/static/css/{62c858ad53854f47.css → 9e19f9d740cf4dcb.css} +1 -1
  189. package/apps/pwa/out/approvals/index.html +1 -1
  190. package/apps/pwa/out/approvals/index.txt +23 -23
  191. package/apps/pwa/out/autopilot/index.html +1 -1
  192. package/apps/pwa/out/autopilot/index.txt +23 -23
  193. package/apps/pwa/out/board/index.html +1 -1
  194. package/apps/pwa/out/board/index.txt +23 -23
  195. package/apps/pwa/out/botlab/index.html +1 -1
  196. package/apps/pwa/out/botlab/index.txt +22 -22
  197. package/apps/pwa/out/bots/index.html +1 -1
  198. package/apps/pwa/out/bots/index.txt +22 -22
  199. package/apps/pwa/out/ceo/index.html +1 -1
  200. package/apps/pwa/out/ceo/index.txt +23 -23
  201. package/apps/pwa/out/chat/index.html +1 -1
  202. package/apps/pwa/out/chat/index.txt +22 -22
  203. package/apps/pwa/out/consult/index.html +1 -1
  204. package/apps/pwa/out/consult/index.txt +23 -23
  205. package/apps/pwa/out/control/index.html +1 -1
  206. package/apps/pwa/out/control/index.txt +23 -23
  207. package/apps/pwa/out/decisions/index.html +1 -1
  208. package/apps/pwa/out/decisions/index.txt +22 -22
  209. package/apps/pwa/out/design-check/index.html +1 -1
  210. package/apps/pwa/out/design-check/index.txt +23 -23
  211. package/apps/pwa/out/editor/index.html +1 -1
  212. package/apps/pwa/out/editor/index.txt +24 -24
  213. package/apps/pwa/out/exec/index.html +1 -1
  214. package/apps/pwa/out/exec/index.txt +23 -23
  215. package/apps/pwa/out/field/index.html +1 -1
  216. package/apps/pwa/out/field/index.txt +23 -23
  217. package/apps/pwa/out/healthz +1 -1
  218. package/apps/pwa/out/index.html +1 -1
  219. package/apps/pwa/out/index.txt +22 -22
  220. package/apps/pwa/out/inside/index.html +1 -1
  221. package/apps/pwa/out/inside/index.txt +23 -23
  222. package/apps/pwa/out/intake/index.html +1 -1
  223. package/apps/pwa/out/intake/index.txt +23 -23
  224. package/apps/pwa/out/live/index.html +1 -1
  225. package/apps/pwa/out/live/index.txt +24 -24
  226. package/apps/pwa/out/live-run/index.html +1 -1
  227. package/apps/pwa/out/live-run/index.txt +24 -24
  228. package/apps/pwa/out/loops/index.html +1 -1
  229. package/apps/pwa/out/loops/index.txt +22 -22
  230. package/apps/pwa/out/market/index.html +1 -1
  231. package/apps/pwa/out/market/index.txt +22 -22
  232. package/apps/pwa/out/missions/placeholder/index.html +1 -1
  233. package/apps/pwa/out/missions/placeholder/index.txt +22 -22
  234. package/apps/pwa/out/morning/index.html +1 -1
  235. package/apps/pwa/out/morning/index.txt +23 -23
  236. package/apps/pwa/out/observatory/index.html +1 -1
  237. package/apps/pwa/out/observatory/index.txt +23 -23
  238. package/apps/pwa/out/ops/checklist/index.html +1 -1
  239. package/apps/pwa/out/ops/checklist/index.txt +22 -22
  240. package/apps/pwa/out/ops/release/index.html +1 -1
  241. package/apps/pwa/out/ops/release/index.txt +22 -22
  242. package/apps/pwa/out/ops/resources/index.html +1 -0
  243. package/apps/pwa/out/ops/resources/index.txt +30 -0
  244. package/apps/pwa/out/ops/seats/index.html +1 -1
  245. package/apps/pwa/out/ops/seats/index.txt +22 -22
  246. package/apps/pwa/out/outputs/index.html +1 -1
  247. package/apps/pwa/out/outputs/index.txt +22 -22
  248. package/apps/pwa/out/reflection/index.html +1 -1
  249. package/apps/pwa/out/reflection/index.txt +23 -23
  250. package/apps/pwa/out/scheduler/index.html +1 -1
  251. package/apps/pwa/out/scheduler/index.txt +23 -23
  252. package/apps/pwa/out/sessions/index.html +1 -1
  253. package/apps/pwa/out/sessions/index.txt +22 -22
  254. package/apps/pwa/out/settings/devices/index.html +1 -1
  255. package/apps/pwa/out/settings/devices/index.txt +23 -23
  256. package/apps/pwa/out/settings/index.html +1 -1
  257. package/apps/pwa/out/settings/index.txt +23 -23
  258. package/apps/pwa/out/setup/done/index.html +1 -1
  259. package/apps/pwa/out/setup/done/index.txt +23 -23
  260. package/apps/pwa/out/setup/index.html +1 -1
  261. package/apps/pwa/out/setup/index.txt +23 -23
  262. package/apps/pwa/out/share/index.html +1 -1
  263. package/apps/pwa/out/share/index.txt +23 -23
  264. package/apps/pwa/out/showroom/index.html +1 -1
  265. package/apps/pwa/out/showroom/index.txt +22 -22
  266. package/apps/pwa/out/tasks/index.html +1 -1
  267. package/apps/pwa/out/tasks/index.txt +23 -23
  268. package/apps/pwa/out/term/index.html +1 -1
  269. package/apps/pwa/out/term/index.txt +23 -23
  270. package/apps/pwa/out/today/index.html +1 -1
  271. package/apps/pwa/out/today/index.txt +23 -23
  272. package/apps/pwa/out/trace/index.html +1 -1
  273. package/apps/pwa/out/trace/index.txt +23 -23
  274. package/apps/pwa/out/vault/index.html +1 -1
  275. package/apps/pwa/out/vault/index.txt +23 -23
  276. package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
  277. package/apps/pwa/out/workflows/chat-ui/index.txt +23 -23
  278. package/apps/pwa/out/workflows/index.html +1 -1
  279. package/apps/pwa/out/workflows/index.txt +23 -23
  280. package/apps/pwa/out/workspace/index.html +1 -1
  281. package/apps/pwa/out/workspace/index.txt +23 -23
  282. package/apps/pwa/out/worktrees/index.html +1 -1
  283. package/apps/pwa/out/worktrees/index.txt +23 -23
  284. package/docs/goal-context/01-goal-authoring-checks.md +1 -0
  285. package/graphs/intake/intake-daily.yaml +5 -1
  286. package/graphs/overlays/examples/demo1104-research-arg-runtime.yaml +28 -0
  287. package/graphs/steward/README.md +9 -0
  288. package/graphs/steward/entrance-dispatch-shadow.yaml +23 -0
  289. package/graphs/steward/recipes.yaml +3 -0
  290. package/graphs/video/README.md +38 -0
  291. package/graphs/video/explainer-line.yaml +20 -7
  292. package/package.json +4 -1
  293. package/packs/b2b-sales-public/content/example-answer.md +5 -0
  294. package/packs/b2b-sales-public/content/playbook.md +11 -0
  295. package/packs/b2b-sales-public/content/proposal-template.md +13 -0
  296. package/packs/b2b-sales-public/content/questions.md +10 -0
  297. package/packs/b2b-sales-public/knowledge-pack.json +31 -0
  298. package/packs/elanous-basics/.codex-plugin/plugin.json +12 -0
  299. package/packs/elanous-basics/plugin.json +20 -0
  300. package/packs/elanous-essentials/plugin.json +24 -0
  301. package/packs/elanous-hwp/.codex-plugin/plugin.json +12 -0
  302. package/packs/elanous-hwp/NOTICE.md +13 -0
  303. package/packs/elanous-hwp/README.md +21 -0
  304. package/packs/elanous-hwp/nodes/from-md.yaml +16 -0
  305. package/packs/elanous-hwp/nodes/to-md.yaml +15 -0
  306. package/packs/elanous-hwp/plugin.json +18 -0
  307. package/packs/elanous-hwp/scripts/hwp.py +405 -0
  308. package/packs/elanous-hwp/skills/hwp-fill/SKILL.md +8 -0
  309. package/packs/elanous-hwp/skills/hwp-read/SKILL.md +8 -0
  310. package/packs/elanous-hwp/skills/hwp-write/SKILL.md +8 -0
  311. package/packs/elanous-hwp/templates/official-letter.yaml +6 -0
  312. package/packs/elanous-hwp/templates/report.yaml +6 -0
  313. package/packs/elanous-hwp/test/consumer.py +24 -0
  314. package/packs/elanous-hwp/test/verify-python-hwpx.py +12 -0
  315. package/packs/elanous-media/.codex-plugin/plugin.json +12 -0
  316. package/packs/elanous-media/plugin.json +16 -0
  317. package/packs/image-first-shorts/.codex-plugin/plugin.json +12 -0
  318. package/packs/image-first-shorts/LICENSE +76 -0
  319. package/packs/image-first-shorts/README.md +45 -0
  320. package/packs/image-first-shorts/SOURCE.md +43 -0
  321. package/packs/image-first-shorts/examples/input.json +9 -0
  322. package/packs/image-first-shorts/examples/storyboard.json +31 -0
  323. package/packs/image-first-shorts/graphs/image-first-shorts.yaml +121 -0
  324. package/packs/image-first-shorts/graphs/recipes.yaml +56 -0
  325. package/packs/image-first-shorts/graphs/run-step.ts +270 -0
  326. package/packs/image-first-shorts/plugin.json +38 -0
  327. package/packs/image-first-shorts/skills/image-first-shorts/SKILL.md +115 -0
  328. package/packs/image-first-shorts/skills/image-first-shorts/templates/examples/image_example.vars.json +7 -0
  329. package/packs/image-first-shorts/skills/image-first-shorts/templates/examples/video_example.vars.json +6 -0
  330. package/packs/image-first-shorts/skills/image-first-shorts/templates/image_blocks.json +30 -0
  331. package/packs/image-first-shorts/skills/image-first-shorts/templates/image_runner_wrapper.txt +6 -0
  332. package/packs/image-first-shorts/skills/image-first-shorts/templates/image_template.txt +1 -0
  333. package/packs/image-first-shorts/skills/image-first-shorts/templates/music_plan_template.json +13 -0
  334. package/packs/image-first-shorts/skills/image-first-shorts/templates/pricing.json +7 -0
  335. package/packs/image-first-shorts/skills/image-first-shorts/templates/tts_request_template.json +8 -0
  336. package/packs/image-first-shorts/skills/image-first-shorts/templates/tts_template.txt +1 -0
  337. package/packs/image-first-shorts/skills/image-first-shorts/templates/video_blocks.json +13 -0
  338. package/packs/image-first-shorts/skills/image-first-shorts/templates/video_template.txt +1 -0
  339. package/packs/image-first-shorts/skills/image-first-shorts/tools/analyze_music.py +41 -0
  340. package/packs/image-first-shorts/skills/image-first-shorts/tools/asr_pick.py +50 -0
  341. package/packs/image-first-shorts/skills/image-first-shorts/tools/fill.py +61 -0
  342. package/packs/image-first-shorts/skills/image-first-shorts/tools/heavy.sh +25 -0
  343. package/packs/image-first-shorts/skills/image-first-shorts/tools/imagegen_runner.py +128 -0
  344. package/packs/image-first-shorts/skills/image-first-shorts/tools/ip_guard.py +54 -0
  345. package/packs/image-first-shorts/skills/image-first-shorts/tools/keyer.py +199 -0
  346. package/packs/image-first-shorts/skills/image-first-shorts/tools/matte.sh +65 -0
  347. package/packs/image-first-shorts/skills/image-first-shorts/tools/matte_queue.sh +34 -0
  348. package/packs/release-ops/README.md +18 -0
  349. package/packs/release-ops/policy.yaml +26 -0
  350. package/packs/semiconductor-process-public/content/glossary.md +8 -0
  351. package/packs/semiconductor-process-public/content/process-overview.md +15 -0
  352. package/packs/semiconductor-process-public/content/public-source-check.md +8 -0
  353. package/packs/semiconductor-process-public/content/questions.md +5 -0
  354. package/packs/semiconductor-process-public/knowledge-pack.json +31 -0
  355. package/packs/video-broll/.codex-plugin/plugin.json +12 -0
  356. package/packs/video-broll/plugin.json +18 -0
  357. package/packs/video-explainer/.codex-plugin/plugin.json +12 -0
  358. package/packs/video-explainer/README.md +37 -0
  359. package/packs/video-explainer/nodes/explainer.yaml +17 -0
  360. package/packs/video-explainer/nodes/field-reel.yaml +17 -0
  361. package/packs/video-explainer/plugin.json +21 -0
  362. package/packs/web-publish/.codex-plugin/plugin.json +12 -0
  363. package/packs/web-publish/LICENSE +24 -0
  364. package/packs/web-publish/README.md +77 -0
  365. package/packs/web-publish/SOURCE.md +70 -0
  366. package/packs/web-publish/examples/input.json +9 -0
  367. package/packs/web-publish/graphs/recipes.yaml +72 -0
  368. package/packs/web-publish/graphs/run-step.ts +618 -0
  369. package/packs/web-publish/graphs/web-publish.yaml +157 -0
  370. package/packs/web-publish/nodes/web-publish.yaml +18 -0
  371. package/packs/web-publish/plugin.json +42 -0
  372. package/packs/web-publish/skills/business-motion-websites/SKILL.md +104 -0
  373. package/packs/web-publish/skills/business-motion-websites/agents/openai.yaml +5 -0
  374. package/packs/web-publish/skills/business-motion-websites/assets/project-brief.md +70 -0
  375. package/packs/web-publish/skills/business-motion-websites/examples/evas.md +17 -0
  376. package/packs/web-publish/skills/business-motion-websites/references/art-direction.md +59 -0
  377. package/packs/web-publish/skills/business-motion-websites/references/business-content.md +77 -0
  378. package/packs/web-publish/skills/business-motion-websites/references/media-production.md +130 -0
  379. package/packs/web-publish/skills/business-motion-websites/references/scroll-and-mobile.md +80 -0
  380. package/packs/web-publish/skills/business-motion-websites/references/verification-and-release.md +73 -0
  381. package/packs/web-publish/skills/business-motion-websites/scripts/audit-media.mjs +181 -0
  382. package/plugins/cloud-burst/README.md +7 -0
  383. package/plugins/cloud-burst/mock-runtime.ts +62 -0
  384. package/plugins/cloud-burst/plugin.json +17 -0
  385. package/plugins/cloud-burst/plugin.ts +103 -0
  386. package/plugins/cloud-burst/runtime-types.ts +7 -0
  387. package/plugins/cloud-burst/service.ts +147 -0
  388. package/scripts/generate-ux-sim-device-manual.ts +21 -0
  389. package/scripts/install-doctor-result.ts +25 -0
  390. package/scripts/install.sh +144 -75
  391. package/scripts/intake-news.ts +10 -4
  392. package/scripts/intake-social.ts +10 -4
  393. package/scripts/land-enqueue.test.sh +60 -0
  394. package/scripts/lib/intake-check-cli.ts +15 -0
  395. package/scripts/measure-git-checkout-accel.ts +232 -0
  396. package/scripts/release-loop/auto-approve-node.ts +7 -3
  397. package/scripts/release-loop/fixtures/gate-verdict-0.2.46.json +148 -0
  398. package/scripts/release-loop/gate-baseline-receipt.ts +34 -3
  399. package/scripts/release-loop/gate-node-sim.ts +5 -1
  400. package/scripts/release-loop/gate-node.ts +507 -83
  401. package/scripts/release-loop/gate-radius-live.ts +5 -4
  402. package/scripts/release-loop/gate-shard-dispatch.ts +100 -10
  403. package/scripts/release-loop/gate-shard-receipts.ts +85 -5
  404. package/scripts/release-loop/known-issues-node.ts +33 -10
  405. package/scripts/release-loop/node-verdict.ts +3 -1
  406. package/scripts/release-loop/publish-node.ts +7 -1
  407. package/scripts/release-loop/resume-release.ts +67 -10
  408. package/scripts/release-loop/resume.ts +101 -14
  409. package/scripts/sim-world-runner.ts +29 -0
  410. package/scripts/test-diet/node.ts +1 -1
  411. package/scripts/test-pod40-control-inbox-isolation.ts +39 -0
  412. package/scripts/ux/demo-rehearsal.ts +45 -12
  413. package/scripts/ux-sim-merge-driver.mjs +187 -0
  414. package/scripts/ux-sim.ts +11 -0
  415. package/scripts/video-pipeline.ts +6 -1
  416. package/scripts/warm-pool-provider-config.ts +76 -6
  417. package/scripts/zero-sim-world.sh +81 -0
  418. package/skills/explainer-video/engine/build.mjs +39 -2
  419. package/src/acp/core-turn-bridge.ts +34 -10
  420. package/src/agent/agent-output-tool.ts +33 -10
  421. package/src/agent/identity-env.ts +1 -0
  422. package/src/agent/terminal-surface.ts +248 -3
  423. package/src/agent-mission/driver.ts +26 -12
  424. package/src/agent-mission/grok-auth-status.ts +60 -23
  425. package/src/agent-mission/resource-ladder.ts +11 -4
  426. package/src/agent-substrate/pr-reviewer.ts +127 -16
  427. package/src/agent-substrate/self-review-cli.ts +348 -60
  428. package/src/auto-research/question-ladder-contract.ts +2 -0
  429. package/src/auto-research/research-turn.ts +289 -14
  430. package/src/cli/codex-device-login-wait.ts +103 -0
  431. package/src/cli/config-test-sync.ts +6 -1
  432. package/src/cli/control-cli.ts +5 -0
  433. package/src/cli/decision-list-format.ts +9 -0
  434. package/src/cli/decision-list-since.ts +13 -0
  435. package/src/cli/decisions-cli.ts +84 -24
  436. package/src/cli/decisions-list-cli.ts +32 -0
  437. package/src/cli/doctor-cli.ts +16 -6
  438. package/src/cli/doctor-fix.ts +76 -13
  439. package/src/cli/fleet-cli.ts +18 -0
  440. package/src/cli/friendly-errors.ts +4 -0
  441. package/src/cli/ingest-token-cli.ts +1 -1
  442. package/src/cli/intake-cli.ts +38 -9
  443. package/src/cli/intake-source-cli.ts +20 -4
  444. package/src/cli/light-entry-route.ts +25 -3
  445. package/src/cli/log-federation-cli.ts +29 -0
  446. package/src/cli/logs-cli.ts +12 -3
  447. package/src/cli/msg-cli.ts +5 -28
  448. package/src/cli/msg-list-cli.ts +73 -0
  449. package/src/cli/plugin-cli.ts +82 -0
  450. package/src/cli/pr-cli.ts +42 -58
  451. package/src/cli/pr-land-options.ts +34 -0
  452. package/src/cli/pr-land-overlap-evidence.ts +82 -22
  453. package/src/cli/provider-cli.ts +54 -0
  454. package/src/cli/pty-drive-cli.ts +25 -1
  455. package/src/cli/pty-takeover-cli.ts +9 -6
  456. package/src/cli/release-checklist-landed-cli.ts +273 -0
  457. package/src/cli/release-checklist-set-cli.ts +137 -0
  458. package/src/cli/release-checklist-write.ts +34 -0
  459. package/src/cli/release-cli.ts +18 -6
  460. package/src/cli/remote-eln-pty.ts +301 -0
  461. package/src/cli/resource-ledger-cli.ts +248 -0
  462. package/src/cli/runs-tree-cli.ts +256 -0
  463. package/src/cli/secret-cli.test-helpers.ts +25 -0
  464. package/src/cli/secret-cli.ts +172 -0
  465. package/src/cli/self-update.ts +1 -1
  466. package/src/cli/setup-cli.ts +45 -14
  467. package/src/cli/setup-keys.ts +80 -8
  468. package/src/cli/sim-cli.ts +116 -0
  469. package/src/cli/tasks-advance-cli.ts +185 -0
  470. package/src/cli/tasks-cli.ts +59 -92
  471. package/src/cli/tasks-read-cli.ts +32 -21
  472. package/src/cli/train-throughput.ts +71 -0
  473. package/src/cli/tui-test-cli.ts +154 -22
  474. package/src/compact/pipeline.ts +6 -1
  475. package/src/context-bus/context-day.ts +60 -11
  476. package/src/context-bus/external-events.ts +2 -2
  477. package/src/context-bus/nightly-condense.ts +8 -7
  478. package/src/control-plane/ledger.ts +1 -1
  479. package/src/core-turn/run-core-turn.ts +17 -11
  480. package/src/core-turn/run-goal-loop.ts +77 -35
  481. package/src/core-turn/seat-turn-cap.ts +8 -8
  482. package/src/core-turn/short-question.ts +27 -4
  483. package/src/dashboard/acp-boot.ts +66 -10
  484. package/src/dashboard/classic-sidetab-mission-job.ts +64 -6
  485. package/src/dashboard/classic-sidetab-mission-pair.ts +20 -7
  486. package/src/dashboard/classic-sidetab-mission-reconcile.ts +212 -0
  487. package/src/dashboard/classic-sidetab-mission-trio.ts +91 -18
  488. package/src/dashboard/classic-sidetab-mission.ts +94 -26
  489. package/src/dashboard/first-screen-band.ts +2 -2
  490. package/src/dashboard/index.ts +36 -34
  491. package/src/dashboard/input/chat-main-plain-turn-runtime.ts +5 -4
  492. package/src/dashboard/input/goal-continue.ts +10 -0
  493. package/src/dashboard/visible-mission-diagnostics.ts +1 -3
  494. package/src/decisions/decision-cards.ts +6 -1
  495. package/src/decisions/decision-ledger.ts +5 -0
  496. package/src/domains/schedule-manage-tool.ts +1 -1
  497. package/src/ensure-bin-path.ts +5 -1
  498. package/src/error-report/report.ts +139 -4
  499. package/src/execution-loop/launch-gate.ts +115 -18
  500. package/src/fleet/burst-auto-wire-ladder.ts +34 -0
  501. package/src/fleet/burst-auto-within-budget.ts +108 -0
  502. package/src/fleet/burst-ready-ladder.ts +64 -0
  503. package/src/fleet/host-doctor.ts +94 -23
  504. package/src/fleet/resource-inventory.ts +154 -0
  505. package/src/git-fs/worktree.ts +40 -16
  506. package/src/graph-runner/graph-cli.ts +3 -2
  507. package/src/graph-runner/runner.ts +23 -9
  508. package/src/grid/ssh-broker.ts +436 -0
  509. package/src/harness/browser-act.ts +11 -4
  510. package/src/harness/dispatch-backpressure.ts +184 -34
  511. package/src/harness/harness-cli-command.ts +71 -13
  512. package/src/harness/harness-pod-dispatch.ts +37 -1
  513. package/src/index.ts +218 -47
  514. package/src/intake-plane/actions.ts +19 -7
  515. package/src/intake-plane/digest.ts +30 -7
  516. package/src/intake-plane/intake-sources.ts +92 -3
  517. package/src/intake-plane/items.ts +13 -0
  518. package/src/intake-plane/linear-wish.ts +24 -1
  519. package/src/light-cli.ts +52 -5
  520. package/src/llm.ts +136 -21
  521. package/src/loops/orchestrator/tick.ts +29 -9
  522. package/src/machines/machine-ledger.ts +7 -1
  523. package/src/maturity/feature-maturity.ts +4 -3
  524. package/src/msg/msg-store.ts +5 -2
  525. package/src/mss/logging/log-federation.ts +334 -0
  526. package/src/mss/logging/log-store.ts +16 -7
  527. package/src/native-tool-catalog.ts +13 -0
  528. package/src/nexus/api/harness-api.ts +16 -6
  529. package/src/nexus/api/harness-traversal.ts +78 -5
  530. package/src/nexus/api/http-server.ts +30 -0
  531. package/src/nexus/api/ops-api.ts +69 -1
  532. package/src/nexus/api/public-routes.ts +14 -0
  533. package/src/nexus/api/resource-guardian.ts +26 -0
  534. package/src/nexus/api/resource-ledger.ts +59 -0
  535. package/src/nexus/api/rest-route-paths.ts +3 -0
  536. package/src/nexus/api/train-throughput.ts +228 -0
  537. package/src/nexus/api/ux-sim-devices.ts +67 -0
  538. package/src/nexus/index.ts +2 -0
  539. package/src/oauth/codex-seat-home.ts +231 -0
  540. package/src/oauth/codex.ts +69 -16
  541. package/src/onboarding/summary.ts +2 -0
  542. package/src/onboarding/web-first.ts +111 -47
  543. package/src/onboarding.ts +9 -0
  544. package/src/plugins/install/plugin-grounding.ts +233 -0
  545. package/src/plugins/maker/wizard-generate.ts +13 -1
  546. package/src/pty-shell/pty-manifest-query-cache.ts +18 -0
  547. package/src/pty-shell/pty-manifest.ts +76 -0
  548. package/src/pty-shell/remote-eln-inventory.ts +88 -0
  549. package/src/release-loop/gate-host-reservation.ts +19 -11
  550. package/src/release-loop/gate-shard-ledger.ts +2 -0
  551. package/src/release-loop/placement.ts +18 -8
  552. package/src/release-loop/rehearsal.ts +86 -11
  553. package/src/release-loop/release-note.ts +84 -0
  554. package/src/release-loop/stage-mail.ts +71 -0
  555. package/src/repl/index.ts +8 -1
  556. package/src/research/axis-fanout.ts +73 -23
  557. package/src/research/entity-status-table.ts +305 -0
  558. package/src/research/evidence-attribution.ts +48 -0
  559. package/src/research/gap-followup.ts +6 -1
  560. package/src/resource-ledger/guardian-reconcile.ts +172 -0
  561. package/src/resource-ledger/lease-automation.ts +112 -0
  562. package/src/resource-ledger/lease-heartbeat-worker.ts +169 -0
  563. package/src/resource-ledger/machine-pool-inventory.ts +81 -0
  564. package/src/resource-ledger/resource-ledger.ts +310 -0
  565. package/src/seat-loop/seat-loop.ts +2 -1
  566. package/src/self-dev/dev-pipeline.ts +98 -10
  567. package/src/self-dev/launch-preflight.ts +10 -4
  568. package/src/self-dev/orchestrate-cli.ts +7 -0
  569. package/src/self-dev/orchestrate-parent-dispatch.ts +44 -0
  570. package/src/self-dev/review-provider-fallback.ts +108 -10
  571. package/src/self-dev/run-supervisor.ts +26 -9
  572. package/src/self-implement/fixtures/structural-red-default-reexport.fixture.mjs +3 -0
  573. package/src/self-implement/fixtures/structural-red-export-star.fixture.mjs +3 -0
  574. package/src/self-implement/fixtures/structural-red-named-export.fixture.mjs +3 -0
  575. package/src/self-implement/gate-remote.ts +63 -10
  576. package/src/self-implement/goal-author.ts +214 -9
  577. package/src/self-implement/merge-train.ts +12 -1
  578. package/src/self-implement/off-diff-evidence.ts +223 -3
  579. package/src/self-implement/orchestrator.ts +205 -46
  580. package/src/self-implement/pod-warm-pool-profile.ts +3 -0
  581. package/src/self-implement/run-step-projection.ts +18 -4
  582. package/src/self-implement/seams.ts +42 -1
  583. package/src/session/chat.ts +29 -2
  584. package/src/session/index.ts +34 -0
  585. package/src/session/request-size-guard.ts +7 -7
  586. package/src/session/session-start.ts +17 -2
  587. package/src/session-runtime/index.ts +1 -1
  588. package/src/session-runtime/search-processor.ts +5 -2
  589. package/src/sidetab-core/model.ts +9 -6
  590. package/src/sidetab-core/visible-agent-mission.ts +108 -19
  591. package/src/sim-world-device-catalogs.json +182 -0
  592. package/src/skills/tools/shell.ts +7 -4
  593. package/src/steward/entrance-dispatch-shadow-adapter-child.ts +26 -0
  594. package/src/steward/entrance-dispatch-shadow-adapter.ts +196 -0
  595. package/src/steward/entrance-dispatch-shadow.ts +318 -0
  596. package/src/storage/short-lived-read-cache.ts +119 -0
  597. package/src/task-agent/card-evidence.ts +2 -1
  598. package/src/task-agent/entrance-shadow.ts +178 -0
  599. package/src/task-agent/mission.ts +9 -19
  600. package/src/task-agent/parent-host.ts +74 -4
  601. package/src/task-agent/repair-cycle.ts +75 -1
  602. package/src/task-agent/task-card-state.ts +161 -0
  603. package/src/task-agent/task-hand.ts +41 -141
  604. package/src/task-agent/work-order-build.ts +22 -1
  605. package/src/task-orchestrator/surfaces/gate-pod-pool-policy.ts +309 -0
  606. package/src/task-orchestrator/surfaces/pod-ledger-events.ts +194 -12
  607. package/src/task-orchestrator/surfaces/pod-pool.ts +55 -4
  608. package/src/task-orchestrator/surfaces/pod-warm-worker-provider.ts +57 -16
  609. package/src/task-orchestrator/surfaces/self-implement-pod.ts +40 -5
  610. package/src/task-orchestrator/surfaces/warm-reuse-evidence.ts +61 -0
  611. package/src/tool-runtime/agent-output-runtime.ts +1 -1
  612. package/src/tool-runtime/browser-hand-runtime.ts +41 -11
  613. package/src/tool-runtime/elanous-control-runtimes.ts +5 -2
  614. package/src/tool-runtime/elanous-ux-sim-devices-runtime.ts +43 -0
  615. package/src/tool-runtime/index.ts +2 -0
  616. package/src/tui/entry.ts +74 -24
  617. package/src/tui/sidetab/attach.ts +212 -34
  618. package/src/tui/sidetab/remote.ts +89 -0
  619. package/src/tui-client/dashboard-session.ts +2 -0
  620. package/src/tui-client/local-chat-turn.ts +9 -2
  621. package/src/user-config.ts +7 -1
  622. package/src/ux-sim/aside-feedback-loop.ts +181 -0
  623. package/src/ux-sim/author-reviewer-precheck-device.ts +78 -0
  624. package/src/ux-sim/burst-ready-ladder-sim.ts +225 -0
  625. package/src/ux-sim/codex-wire-capture.ts +26 -0
  626. package/src/ux-sim/event-monkey.ts +20 -2
  627. package/src/ux-sim/fake-bin.ts +72 -1
  628. package/src/ux-sim/fake-cloud-vm.ts +241 -0
  629. package/src/ux-sim/fake-fleet.ts +123 -0
  630. package/src/ux-sim/fake-kubectl.ts +21 -6
  631. package/src/ux-sim/fake-llm.ts +14 -1
  632. package/src/ux-sim/fake-ssh.ts +125 -0
  633. package/src/ux-sim/fake-telegram-video.ts +54 -0
  634. package/src/ux-sim/fixtures/git-worktree-accel-linux.json +239 -0
  635. package/src/ux-sim/gate-shard-host-reroute.ts +7 -3
  636. package/src/ux-sim/graph-runtime-overlay-event-path-worker.ts +79 -0
  637. package/src/ux-sim/graph-runtime-overlay-event-path.ts +102 -0
  638. package/src/ux-sim/grid-chaos-driver.ts +205 -0
  639. package/src/ux-sim/grid-ledger.ts +259 -0
  640. package/src/ux-sim/grid-ready-tiers.ts +253 -0
  641. package/src/ux-sim/heal-reauthor-materialized.ts +115 -0
  642. package/src/ux-sim/in-process-cli.ts +1 -1
  643. package/src/ux-sim/mock-device-requests.ts +189 -0
  644. package/src/ux-sim/mock-scenario-catalog.json +2934 -71
  645. package/src/ux-sim/mock-scenario-catalog.ts +139 -4
  646. package/src/ux-sim/next-tui-seat-scenarios.ts +52 -4
  647. package/src/ux-sim/release-sim-rig.ts +299 -7
  648. package/src/ux-sim/research-decision-chain.ts +220 -0
  649. package/src/ux-sim/safe-public-copy-publish.ts +89 -0
  650. package/src/ux-sim/scenario.ts +133 -14
  651. package/src/ux-sim/seminar-rehearsal.ts +108 -0
  652. package/src/ux-sim/service-key-setup.ts +37 -2
  653. package/src/ux-sim/warm-pool-reuse-sim.ts +256 -0
  654. package/src/ux-sim/world-schema.ts +216 -0
  655. package/src/ux-sim/world-store.ts +421 -0
  656. package/src/ux-sim/world.ts +524 -0
  657. package/src/version/packed-revision.json +1 -1
  658. package/src/video-pipeline/recipes/explainer.ts +237 -10
  659. package/src/video-pipeline/telegram-video-sender.ts +47 -0
  660. package/src/workflow-runtime/triggers/scheduler.ts +4 -4
  661. package/apps/pwa/out/_next/static/HMXsxdy5MIIcHPMHv1wD4/_buildManifest.js +0 -1
  662. package/apps/pwa/out/_next/static/chunks/08334415.f0e80896acbef722.js +0 -1
  663. package/apps/pwa/out/_next/static/chunks/1032-78ba4f6391258cab.js +0 -1
  664. package/apps/pwa/out/_next/static/chunks/1082-53f86a26e03d309d.js +0 -1
  665. package/apps/pwa/out/_next/static/chunks/1109-7d0e264f6f2edbc7.js +0 -1
  666. package/apps/pwa/out/_next/static/chunks/1124-7c26330402481143.js +0 -1
  667. package/apps/pwa/out/_next/static/chunks/118.2a89982fe4276880.js +0 -23
  668. package/apps/pwa/out/_next/static/chunks/1244.6c435dbf1bf21d8a.js +0 -1
  669. package/apps/pwa/out/_next/static/chunks/1252.9e665904d3aa3b1a.js +0 -32
  670. package/apps/pwa/out/_next/static/chunks/1306.967240ede9a0f757.js +0 -24
  671. package/apps/pwa/out/_next/static/chunks/1344.3b95f3bd1b77a3fe.js +0 -94
  672. package/apps/pwa/out/_next/static/chunks/1401.22dfe92640a2b1ac.js +0 -309
  673. package/apps/pwa/out/_next/static/chunks/1431-f7c78bd5be21e011.js +0 -1
  674. package/apps/pwa/out/_next/static/chunks/1451-cdd35a8a0b31834b.js +0 -1
  675. package/apps/pwa/out/_next/static/chunks/1708-f03d587b7a7545c8.js +0 -1
  676. package/apps/pwa/out/_next/static/chunks/1775-fa7152bdeff6c95f.js +0 -1
  677. package/apps/pwa/out/_next/static/chunks/1850-522de4ee34957210.js +0 -1
  678. package/apps/pwa/out/_next/static/chunks/1876-c6f6e0ddcc76c6a1.js +0 -1
  679. package/apps/pwa/out/_next/static/chunks/1976.097066b072432242.js +0 -1
  680. package/apps/pwa/out/_next/static/chunks/1978.eeb60a606dc5deac.js +0 -2
  681. package/apps/pwa/out/_next/static/chunks/2043.e233e3b5a3e790f5.js +0 -1
  682. package/apps/pwa/out/_next/static/chunks/2150.71b94e3348107c83.js +0 -1
  683. package/apps/pwa/out/_next/static/chunks/2158.ebc6fc5a10280ab7.js +0 -1
  684. package/apps/pwa/out/_next/static/chunks/2216.802962c04f40a26e.js +0 -64
  685. package/apps/pwa/out/_next/static/chunks/2294.7890edcfa046c97d.js +0 -1
  686. package/apps/pwa/out/_next/static/chunks/235.c89aaae4bcd6233a.js +0 -74
  687. package/apps/pwa/out/_next/static/chunks/239.de075467b5523469.js +0 -287
  688. package/apps/pwa/out/_next/static/chunks/249.ba7051590d603c8f.js +0 -226
  689. package/apps/pwa/out/_next/static/chunks/2571.a6ac4e26c8618403.js +0 -1
  690. package/apps/pwa/out/_next/static/chunks/2610.e149cd564a08913e.js +0 -1
  691. package/apps/pwa/out/_next/static/chunks/2801.afeb8a4dae22f85f.js +0 -1
  692. package/apps/pwa/out/_next/static/chunks/2954.bbefc95d6b20e0d8.js +0 -1
  693. package/apps/pwa/out/_next/static/chunks/3042.96ec235fe41c8d4e.js +0 -1
  694. package/apps/pwa/out/_next/static/chunks/3097-8e358f158acef46b.js +0 -1
  695. package/apps/pwa/out/_next/static/chunks/3205-93b1abe28b4fb16a.js +0 -1
  696. package/apps/pwa/out/_next/static/chunks/3273.b4434f0dcae7eb29.js +0 -1
  697. package/apps/pwa/out/_next/static/chunks/3311.9cbc43ea0c90d60c.js +0 -1
  698. package/apps/pwa/out/_next/static/chunks/3503.a47a9755fb4d97b0.js +0 -1
  699. package/apps/pwa/out/_next/static/chunks/3506-5f429b3b7e1392b0.js +0 -1
  700. package/apps/pwa/out/_next/static/chunks/3843.bad404d008893291.js +0 -77
  701. package/apps/pwa/out/_next/static/chunks/3877-4b40e530b47e3bf9.js +0 -1
  702. package/apps/pwa/out/_next/static/chunks/435-ce2958253cf7de61.js +0 -1
  703. package/apps/pwa/out/_next/static/chunks/4393.28fa5228d0eec217.js +0 -149
  704. package/apps/pwa/out/_next/static/chunks/4404.7281c847c6e10dfc.js +0 -1
  705. package/apps/pwa/out/_next/static/chunks/447-5b304de1fe098f43.js +0 -1
  706. package/apps/pwa/out/_next/static/chunks/4484-8ebea83d431e6fae.js +0 -1
  707. package/apps/pwa/out/_next/static/chunks/4599-f95790fc5c65b8df.js +0 -1
  708. package/apps/pwa/out/_next/static/chunks/463-b9114e411f33728e.js +0 -1
  709. package/apps/pwa/out/_next/static/chunks/4659.a57d1f0c5d754cd2.js +0 -36
  710. package/apps/pwa/out/_next/static/chunks/4722-a847e7a28115035f.js +0 -1
  711. package/apps/pwa/out/_next/static/chunks/4874-c86f878ec4502ad3.js +0 -1
  712. package/apps/pwa/out/_next/static/chunks/4891.3f80ba517a3b2373.js +0 -1
  713. package/apps/pwa/out/_next/static/chunks/4998.810ca8833084caa9.js +0 -62
  714. package/apps/pwa/out/_next/static/chunks/4f98febc.ea5841d4d616bfb2.js +0 -1
  715. package/apps/pwa/out/_next/static/chunks/5052.7dbb12a55d4f18f5.js +0 -1
  716. package/apps/pwa/out/_next/static/chunks/5166-ca73b3e361085a6d.js +0 -1
  717. package/apps/pwa/out/_next/static/chunks/5180-039f4a18b07ad387.js +0 -1
  718. package/apps/pwa/out/_next/static/chunks/5232.5a2ce4daf7a9e11d.js +0 -115
  719. package/apps/pwa/out/_next/static/chunks/5439.3fec6dbce29ecb36.js +0 -1
  720. package/apps/pwa/out/_next/static/chunks/5612-074d9a5e00dfac6a.js +0 -1
  721. package/apps/pwa/out/_next/static/chunks/5675-01989d524a84c505.js +0 -1
  722. package/apps/pwa/out/_next/static/chunks/5751.af641a1adf5ec697.js +0 -1
  723. package/apps/pwa/out/_next/static/chunks/5758-c6cb98714d18ab0c.js +0 -1
  724. package/apps/pwa/out/_next/static/chunks/578eded8.b582637306e16964.js +0 -122
  725. package/apps/pwa/out/_next/static/chunks/5853-4033e5bd5afbe06b.js +0 -1
  726. package/apps/pwa/out/_next/static/chunks/5904.97d70bb7f46b2db7.js +0 -1
  727. package/apps/pwa/out/_next/static/chunks/6036-c302c34ff0b3d410.js +0 -1
  728. package/apps/pwa/out/_next/static/chunks/606.ef81c313381f4264.js +0 -1
  729. package/apps/pwa/out/_next/static/chunks/616.1af54a928b1ba704.js +0 -1
  730. package/apps/pwa/out/_next/static/chunks/6201.bc936f71f613a8e9.js +0 -41
  731. package/apps/pwa/out/_next/static/chunks/6204-fdc86e0e64c4f92d.js +0 -1
  732. package/apps/pwa/out/_next/static/chunks/63699a35.17262e162bc514b2.js +0 -1
  733. package/apps/pwa/out/_next/static/chunks/6420.494801a80030160c.js +0 -27
  734. package/apps/pwa/out/_next/static/chunks/6931.fcdfb94141e67b3d.js +0 -1
  735. package/apps/pwa/out/_next/static/chunks/6991-8e081c6ce38c0ba1.js +0 -1
  736. package/apps/pwa/out/_next/static/chunks/7010.1bbd17a7f2b3e376.js +0 -1
  737. package/apps/pwa/out/_next/static/chunks/7029.d1466acf55fae2ed.js +0 -1
  738. package/apps/pwa/out/_next/static/chunks/7152-a123aa8e129c131f.js +0 -1
  739. package/apps/pwa/out/_next/static/chunks/7455.196168fffac3b9c4.js +0 -24
  740. package/apps/pwa/out/_next/static/chunks/7638.6ca4770dd1129138.js +0 -1
  741. package/apps/pwa/out/_next/static/chunks/7649-f37d76260e5e2a5a.js +0 -1
  742. package/apps/pwa/out/_next/static/chunks/7751.04bfbd16b4c6cd0a.js +0 -1
  743. package/apps/pwa/out/_next/static/chunks/7869-c47bd2c075c1fefa.js +0 -1
  744. package/apps/pwa/out/_next/static/chunks/8442.2f09ca969d631615.js +0 -1
  745. package/apps/pwa/out/_next/static/chunks/8445.2738dbd59a78c78c.js +0 -1
  746. package/apps/pwa/out/_next/static/chunks/8447.5510c439f9938c6d.js +0 -286
  747. package/apps/pwa/out/_next/static/chunks/8635-57a9d8d9db70f4f1.js +0 -1
  748. package/apps/pwa/out/_next/static/chunks/86961958-4b0689a5048f756b.js +0 -1
  749. package/apps/pwa/out/_next/static/chunks/8709.3c6019bb18f8554f.js +0 -8
  750. package/apps/pwa/out/_next/static/chunks/8759.c999528a0a907bf6.js +0 -1
  751. package/apps/pwa/out/_next/static/chunks/87f498e5-0881de09f2e44707.js +0 -1
  752. package/apps/pwa/out/_next/static/chunks/8843.c3197f904c952b81.js +0 -1
  753. package/apps/pwa/out/_next/static/chunks/8971-8d3b9c96f8a6c958.js +0 -1
  754. package/apps/pwa/out/_next/static/chunks/9059.c8598d96f8e5e9cd.js +0 -1
  755. package/apps/pwa/out/_next/static/chunks/9115.90447ae198b84eae.js +0 -1
  756. package/apps/pwa/out/_next/static/chunks/9147.d9b0a02e0babc9b4.js +0 -93
  757. package/apps/pwa/out/_next/static/chunks/9204-83075f4b70c61cdc.js +0 -1
  758. package/apps/pwa/out/_next/static/chunks/9244-c32ef14b5dc72bdf.js +0 -1
  759. package/apps/pwa/out/_next/static/chunks/930.2a9a30f964350c66.js +0 -90
  760. package/apps/pwa/out/_next/static/chunks/9398.1f56e3f17795f43f.js +0 -1
  761. package/apps/pwa/out/_next/static/chunks/9527.3e5ad31c891c5fcb.js +0 -79
  762. package/apps/pwa/out/_next/static/chunks/9571-4ac933e774d1225c.js +0 -1
  763. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-9fc644de2d8edae3.js +0 -1
  764. package/apps/pwa/out/_next/static/chunks/app/approvals/page-0c9dace2db62bee8.js +0 -1
  765. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-f5e65c3dc9d89f2a.js +0 -1
  766. package/apps/pwa/out/_next/static/chunks/app/board/page-2a9c19b9a140b7b1.js +0 -1
  767. package/apps/pwa/out/_next/static/chunks/app/botlab/page-61533ad92141adfb.js +0 -1
  768. package/apps/pwa/out/_next/static/chunks/app/bots/page-112004ced6fd0329.js +0 -1
  769. package/apps/pwa/out/_next/static/chunks/app/ceo/page-f733318c237a49d8.js +0 -1
  770. package/apps/pwa/out/_next/static/chunks/app/chat/page-51ea677d2d33bbc0.js +0 -1
  771. package/apps/pwa/out/_next/static/chunks/app/consult/page-428b41f2f9566e3c.js +0 -1
  772. package/apps/pwa/out/_next/static/chunks/app/control/page-1b29396ea90a61e5.js +0 -1
  773. package/apps/pwa/out/_next/static/chunks/app/decisions/page-cf83ec613ac904bf.js +0 -1
  774. package/apps/pwa/out/_next/static/chunks/app/design-check/page-3f4c0ecbc284bb5f.js +0 -1
  775. package/apps/pwa/out/_next/static/chunks/app/editor/page-b63c322f54f70cc6.js +0 -1
  776. package/apps/pwa/out/_next/static/chunks/app/exec/page-fe328c4ee9aac6b4.js +0 -1
  777. package/apps/pwa/out/_next/static/chunks/app/field/page-bfb855c584f0fb98.js +0 -1
  778. package/apps/pwa/out/_next/static/chunks/app/healthz/route-9fc644de2d8edae3.js +0 -1
  779. package/apps/pwa/out/_next/static/chunks/app/inside/page-47b1710c110eabd7.js +0 -1
  780. package/apps/pwa/out/_next/static/chunks/app/intake/page-42895214458bc6d2.js +0 -1
  781. package/apps/pwa/out/_next/static/chunks/app/layout-d03de0ebd8366e23.js +0 -1
  782. package/apps/pwa/out/_next/static/chunks/app/live/page-3ed6c47e4b1c61c2.js +0 -1
  783. package/apps/pwa/out/_next/static/chunks/app/live-run/page-ae653e9bf261c738.js +0 -1
  784. package/apps/pwa/out/_next/static/chunks/app/loops/page-23f3f0a0209c0ac4.js +0 -1
  785. package/apps/pwa/out/_next/static/chunks/app/market/page-88c691273aae66f9.js +0 -1
  786. package/apps/pwa/out/_next/static/chunks/app/morning/page-6e45828daed1295e.js +0 -1
  787. package/apps/pwa/out/_next/static/chunks/app/not-found-edb5d7287bb46186.js +0 -1
  788. package/apps/pwa/out/_next/static/chunks/app/observatory/page-4a7eaacd93c3f6a5.js +0 -1
  789. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-3ca073d43d74cc84.js +0 -1
  790. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-1e9fee67b1199436.js +0 -1
  791. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-df1283ea963c6816.js +0 -1
  792. package/apps/pwa/out/_next/static/chunks/app/outputs/page-19fcf8d8301ccd18.js +0 -1
  793. package/apps/pwa/out/_next/static/chunks/app/page-5ab699e0303bbb40.js +0 -1
  794. package/apps/pwa/out/_next/static/chunks/app/reflection/page-7cde0d29756984c5.js +0 -1
  795. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-9d4c598e8ee22f7a.js +0 -1
  796. package/apps/pwa/out/_next/static/chunks/app/sessions/page-cc1609a71f44ec62.js +0 -1
  797. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-7659a9a1345bfaa9.js +0 -1
  798. package/apps/pwa/out/_next/static/chunks/app/settings/page-0afef60ecc0c4af5.js +0 -1
  799. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-a3553949f8f34f5f.js +0 -1
  800. package/apps/pwa/out/_next/static/chunks/app/setup/layout-9fc644de2d8edae3.js +0 -1
  801. package/apps/pwa/out/_next/static/chunks/app/setup/page-057a69702f3c67c7.js +0 -1
  802. package/apps/pwa/out/_next/static/chunks/app/share/page-c0f0e570f3f74c73.js +0 -1
  803. package/apps/pwa/out/_next/static/chunks/app/showroom/page-1825071ae34e3b89.js +0 -1
  804. package/apps/pwa/out/_next/static/chunks/app/tasks/page-6244e3e135d8ccfc.js +0 -1
  805. package/apps/pwa/out/_next/static/chunks/app/term/page-da787e8a10b8a82e.js +0 -1
  806. package/apps/pwa/out/_next/static/chunks/app/today/page-1316d32498e2be42.js +0 -1
  807. package/apps/pwa/out/_next/static/chunks/app/trace/page-4df94572e343de2e.js +0 -1
  808. package/apps/pwa/out/_next/static/chunks/app/vault/page-708969f7475e88c1.js +0 -1
  809. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-c58add08c919a1dc.js +0 -1
  810. package/apps/pwa/out/_next/static/chunks/app/workflows/page-a24847f45e5d5bf9.js +0 -1
  811. package/apps/pwa/out/_next/static/chunks/app/workspace/page-acfec65a3a60e22e.js +0 -1
  812. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-3dfc598e6fbde245.js +0 -1
  813. package/apps/pwa/out/_next/static/chunks/framework-c658a626118411b7.js +0 -1
  814. package/apps/pwa/out/_next/static/chunks/main-4c73685fd891445b.js +0 -1
  815. package/apps/pwa/out/_next/static/chunks/main-app-6310f7e5de7dd01d.js +0 -1
  816. package/apps/pwa/out/_next/static/chunks/pages/_app-51c326bf48610be1.js +0 -1
  817. package/apps/pwa/out/_next/static/chunks/pages/_error-d0beadf754da59b0.js +0 -1
  818. package/apps/pwa/out/_next/static/chunks/webpack-acd243bfbf3f6732.js +0 -1
  819. package/apps/pwa/out/_next/static/css/d1f8bb401740a549.css +0 -1
  820. /package/apps/pwa/out/_next/static/{HMXsxdy5MIIcHPMHv1wD4 → 98VlBaYvL-VVnCq93_lFS}/_ssgManifest.js +0 -0
@@ -3,7 +3,7 @@
3
3
  // installId = 무작위 UUID · email/telegramUser 는 «신원도 함께» 동의 때만 · nexus.instance 는 해시 12자 · dedupe 는 수신기가 만든다.
4
4
  // 규칙: 비밀·홈 경로를 지운 뒤에만 보낸다 · 실패하면 한 부만 남겨 다음 시작 때 한 번(하루 최대 한 번) · 절대 던지지 않는다.
5
5
  import { createHash, randomUUID } from 'node:crypto';
6
- import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
6
+ import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
7
7
  import { arch, homedir, platform } from 'node:os';
8
8
  import { join } from 'node:path';
9
9
  import { debug } from '../debug/log.js';
@@ -166,7 +166,7 @@ export async function reportError(input: ErrorReportInput, deps: ErrorReportDeps
166
166
  }
167
167
  }
168
168
 
169
- async function post(report: ErrorReport, configDir: string, deps: ErrorReportDeps): Promise<ReportOutcome> {
169
+ async function post(report: ErrorReport, configDir: string, deps: ErrorReportDeps, keepForRetry = true): Promise<ReportOutcome> {
170
170
  try {
171
171
  const response = await (deps.fetchImpl ?? fetch)(ERROR_REPORT_URL, {
172
172
  method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(report), signal: AbortSignal.timeout(SEND_TIMEOUT_MS),
@@ -177,11 +177,11 @@ async function post(report: ErrorReport, configDir: string, deps: ErrorReportDep
177
177
  debug.log('error-report', 'sent', { code: report.code, surface: report.app.surface, ...(reportId ? { reportId } : {}) });
178
178
  return { sent: true, ...(reportId ? { reportId } : {}) };
179
179
  }
180
- keepPending(report, configDir, deps);
180
+ if (keepForRetry) keepPending(report, configDir, deps);
181
181
  debug.log('error-report', 'not-sent', { code: report.code, status: response.status });
182
182
  return { sent: false, reason: `http-${response.status}` };
183
183
  } catch (error) {
184
- keepPending(report, configDir, deps);
184
+ if (keepForRetry) keepPending(report, configDir, deps);
185
185
  debug.log('error-report', 'not-sent', { code: report.code, reason: error instanceof Error ? error.name : 'network' });
186
186
  return { sent: false, reason: 'network' };
187
187
  }
@@ -197,6 +197,141 @@ function keepPending(report: ErrorReport, configDir: string, deps: ErrorReportDe
197
197
  } catch { /* nothing else to do */ }
198
198
  }
199
199
 
200
+ const CRASH_QUEUE_MAX = 20;
201
+ const CRASH_QUEUE_MAX_AGE_MS = 7 * 24 * 60 * 60_000;
202
+ const CRASH_QUEUE_RETRY_MS = 60_000;
203
+ const crashQueueDir = (configDir: string): string => join(configDir, 'crash');
204
+
205
+ /** Drop records whose filename timestamp is outside the retention window. */
206
+ function pruneCrashQueue(dir: string, now: number): string[] {
207
+ const files = readdirSync(dir).filter((name) => name.endsWith('.json')).sort();
208
+ for (const name of files) {
209
+ const timestamp = Number(name.match(/^(\d+)-/)?.[1]);
210
+ if (!Number.isFinite(timestamp) || now - timestamp > CRASH_QUEUE_MAX_AGE_MS) {
211
+ rmSync(join(dir, name), { force: true });
212
+ }
213
+ }
214
+ return readdirSync(dir).filter((name) => name.endsWith('.json')).sort();
215
+ }
216
+
217
+ /** Persist a sanitized fatal error synchronously; this function is safe to call during process shutdown. */
218
+ export function captureFatal(error: unknown, options: { surface: ReportSurface } & ErrorReportDeps): void {
219
+ try {
220
+ const configDir = (options.configDir ?? getElanousConfigDir)();
221
+ const settings = (options.settings ?? defaultSettings)();
222
+ const dir = crashQueueDir(configDir);
223
+ mkdirSync(dir, { recursive: true, mode: 0o700 });
224
+ const now = (options.now ?? Date.now)();
225
+ const files = pruneCrashQueue(dir, now);
226
+ const source = error instanceof Error ? error : new Error(String(error));
227
+ const report = settings.enabled && settings.consented === true && (options.enabledByEnvironment ?? defaultEnabledByEnvironment)()
228
+ ? buildErrorReport({ code: 'fatal-error', message: `${source.name}: ${source.message}`, ...(source.stack ? { stack: source.stack } : {}), surface: options.surface }, {
229
+ installId: installId(configDir), settings, nexus: { alive: false }, at: new Date(now).toISOString(),
230
+ })
231
+ : undefined;
232
+ const filename = join(dir, `${now}-${randomUUID()}.json`);
233
+ const record = report ? { consented: true, report } : { consented: false };
234
+ const content = JSON.stringify(record);
235
+ if (Buffer.byteLength(content) > MAX_BYTES) return;
236
+ writeFileSync(filename, content, { mode: 0o600, flag: 'wx' });
237
+ for (const stale of files.slice(0, Math.max(0, files.length + 1 - CRASH_QUEUE_MAX))) rmSync(join(dir, stale), { force: true });
238
+ } catch { /* fatal recording must never replace the original failure */ }
239
+ }
240
+
241
+ /** Install process-level fatal hooks while retaining the runtime's normal non-zero termination. */
242
+ export function installFatalErrorHandlers(surface: ReportSurface): () => void {
243
+ const token = Symbol(surface);
244
+ fatalHandlerSurfaces.set(token, surface);
245
+ if (!fatalHandlersInstalled) {
246
+ fatalHandlersInstalled = true;
247
+ process.on('uncaughtExceptionMonitor', onUncaughtException);
248
+ process.on('unhandledRejection', onUnhandledRejection);
249
+ }
250
+ return () => {
251
+ fatalHandlerSurfaces.delete(token);
252
+ if (fatalHandlerSurfaces.size === 0 && fatalHandlersInstalled) {
253
+ process.off('uncaughtExceptionMonitor', onUncaughtException);
254
+ process.off('unhandledRejection', onUnhandledRejection);
255
+ fatalHandlersInstalled = false;
256
+ }
257
+ };
258
+ }
259
+
260
+ const fatalHandlerSurfaces = new Map<symbol, ReportSurface>();
261
+ let fatalHandlersInstalled = false;
262
+ function activeFatalSurface(): ReportSurface { return [...fatalHandlerSurfaces.values()].at(-1) ?? 'cli'; }
263
+ function onUncaughtException(error: Error): void { captureFatal(error, { surface: activeFatalSurface() }); }
264
+ function onUnhandledRejection(reason: unknown): void {
265
+ // A rejection listener otherwise suppresses runtimes' normal fatal behavior. Re-throw on the next
266
+ // microtask so the runtime prints its usual diagnostic/exits; uncaughtExceptionMonitor records it.
267
+ queueMicrotask(() => { throw reason; });
268
+ }
269
+
270
+ /** Send only consented crash records using the existing ER1 POST contract. */
271
+ type CrashQueueFlushResult = { sent: number; skipped: number; consentSkipped: number; disabledSkipped: number };
272
+ const crashQueueFlushes = new Map<string, Promise<CrashQueueFlushResult>>();
273
+
274
+ export function flushCrashQueue(deps: ErrorReportDeps = {}): Promise<CrashQueueFlushResult> {
275
+ try {
276
+ if (!(deps.enabledByEnvironment ?? defaultEnabledByEnvironment)()) return Promise.resolve(emptyCrashQueueFlush());
277
+ const configDir = (deps.configDir ?? getElanousConfigDir)();
278
+ const running = crashQueueFlushes.get(configDir);
279
+ if (running) return running;
280
+ const task = flushCrashQueueUnlocked(configDir, deps).finally(() => {
281
+ if (crashQueueFlushes.get(configDir) === task) crashQueueFlushes.delete(configDir);
282
+ });
283
+ crashQueueFlushes.set(configDir, task);
284
+ return task;
285
+ } catch { return Promise.resolve(emptyCrashQueueFlush()); }
286
+ }
287
+
288
+ function emptyCrashQueueFlush(): CrashQueueFlushResult { return { sent: 0, skipped: 0, consentSkipped: 0, disabledSkipped: 0 }; }
289
+
290
+ async function flushCrashQueueUnlocked(configDir: string, deps: ErrorReportDeps): Promise<CrashQueueFlushResult> {
291
+ let sent = 0;
292
+ let skipped = 0;
293
+ let consentSkipped = 0;
294
+ let disabledSkipped = 0;
295
+ try {
296
+ const dir = crashQueueDir(configDir);
297
+ if (!existsSync(dir)) return emptyCrashQueueFlush();
298
+ const files = pruneCrashQueue(dir, (deps.now ?? Date.now)());
299
+ const settings = (deps.settings ?? defaultSettings)();
300
+ if (!settings.enabled) return { sent, skipped: files.length, consentSkipped, disabledSkipped: files.length };
301
+ if (settings.consented !== true) return { sent, skipped: files.length, consentSkipped: files.length, disabledSkipped };
302
+ for (const name of files) {
303
+ const file = join(dir, name);
304
+ try {
305
+ const record = JSON.parse(readFileSync(file, 'utf8')) as { consented?: boolean; report?: ErrorReport };
306
+ if (record.consented !== true) { skipped++; consentSkipped++; continue; }
307
+ if (!record.report) { skipped++; continue; }
308
+ if (Buffer.byteLength(JSON.stringify(record.report)) > MAX_BYTES) { skipped++; continue; }
309
+ // Current settings govern identity at send time; queued reports never retain a revoked address.
310
+ const report: ErrorReport = { ...record.report, who: {
311
+ installId: record.report.who.installId,
312
+ ...(settings.identity && settings.email ? { email: settings.email } : {}),
313
+ ...(settings.identity && settings.telegramUser ? { telegramUser: settings.telegramUser } : {}),
314
+ } };
315
+ const outcome = await post(report, configDir, deps, false);
316
+ if (!outcome.sent) { scheduleCrashQueueRetry(deps); break; }
317
+ rmSync(file, { force: true });
318
+ sent++;
319
+ } catch { skipped++; }
320
+ }
321
+ } catch { /* reporting is best-effort */ }
322
+ return { sent, skipped, consentSkipped, disabledSkipped };
323
+ }
324
+
325
+ let crashQueueRetryTimer: ReturnType<typeof setTimeout> | undefined;
326
+ function scheduleCrashQueueRetry(deps: ErrorReportDeps): void {
327
+ if (crashQueueRetryTimer) return;
328
+ crashQueueRetryTimer = setTimeout(() => {
329
+ crashQueueRetryTimer = undefined;
330
+ void flushCrashQueue(deps);
331
+ }, CRASH_QUEUE_RETRY_MS);
332
+ crashQueueRetryTimer.unref?.();
333
+ }
334
+
200
335
  /** At start-up: retry the one kept report, at most once a day. */
201
336
  export async function retryPendingErrorReport(deps: ErrorReportDeps = {}): Promise<ReportOutcome> {
202
337
  try {
@@ -9,6 +9,36 @@ import { loadRunLedger } from '../self-implement/run-ledger.js';
9
9
  import { queryRunningRuns, type QueriedRunningRunsResult } from '../self-implement/running-runs.js';
10
10
  import { CODEX_PROVIDER, GROK_PROVIDER, decideLaunchBudget, type BudgetAction, type BudgetDecision, type BudgetInputs } from '../self-implement/budget-gate.js';
11
11
  import { DEFAULT_FALLBACK_CHAIN } from '../oauth/fallback-chain.js';
12
+ import type { LaunchStamp } from '../harness/launch-stamp.js';
13
+
14
+ export interface LaunchDoorEnv {
15
+ readonly mode: 'shadow' | 'enforce';
16
+ readonly modeSource: 'default' | 'env' | 'invalid';
17
+ readonly permission: 'allow' | 'deny';
18
+ readonly signal: 'green' | 'red' | 'unknown';
19
+ }
20
+
21
+ /** Environment interpretation stays at this adapter; the launch decision itself remains pure. */
22
+ export function resolveLaunchDoorEnv(env: Readonly<Record<string, string | undefined>> = process.env): LaunchDoorEnv {
23
+ const rawMode = env.ELANOUS_LAUNCH_DOOR_MODE;
24
+ const modeSource = rawMode === undefined || rawMode === '' ? 'default' : rawMode === 'enforce' || rawMode === 'shadow' ? 'env' : 'invalid';
25
+ return {
26
+ mode: rawMode === 'enforce' ? 'enforce' : 'shadow',
27
+ modeSource,
28
+ permission: env.ELANOUS_LAUNCH_DOOR_PERMISSION === 'allow' ? 'allow' : 'deny',
29
+ signal: env.ELANOUS_LAUNCH_DOOR_SIGNAL === 'green' || env.ELANOUS_LAUNCH_DOOR_SIGNAL === 'red'
30
+ ? env.ELANOUS_LAUNCH_DOOR_SIGNAL : 'unknown',
31
+ };
32
+ }
33
+
34
+ export function decideLaunchDoor(stamp: LaunchStamp, input: LaunchDoorEnv): { readonly allowed: boolean; readonly reason: string } {
35
+ if (!['harness-say', 'harness-ask', 'queue-tick'].includes(stamp.entrance)) {
36
+ return { allowed: false, reason: `entrance ${stamp.entrance} not authorized` };
37
+ }
38
+ if (input.permission !== 'allow') return { allowed: false, reason: `permission ${input.permission}` };
39
+ if (input.signal !== 'green') return { allowed: false, reason: `signal ${input.signal}` };
40
+ return { allowed: true, reason: 'entrance, permission and signal authorized' };
41
+ }
12
42
 
13
43
  export type ActiveRunsForGoal = readonly string[] | 'unknown';
14
44
 
@@ -303,6 +333,12 @@ export interface LaunchRequestLedgerRow {
303
333
  readonly source?: string;
304
334
  readonly receiptId?: string;
305
335
  readonly reason?: string;
336
+ /** Optional launch context; never contains the request body itself. */
337
+ readonly seat?: string;
338
+ readonly cell?: string;
339
+ readonly originalRef?: string;
340
+ /** Explicit retry-family key; absent for independent direct requests. */
341
+ readonly retryGroup?: string;
306
342
  }
307
343
 
308
344
  /** requestId 단위 소비 영수증 — 최초 1회만 발급된다(O_EXCL 파일이 곧 영수증이다). */
@@ -323,7 +359,7 @@ export type LaunchRequestConsumption =
323
359
  /** 발사 요청의 단일 문 — 원장 append · 단일 소비 · 실패 기록 · 원장 조회. */
324
360
  export interface LaunchRequestDoor {
325
361
  /** 요청 한 건을 원장에 append 하고 그 requestId 를 돌려준다(중복 재요청도 매번 append 된다). */
326
- requestId(ask: string): string;
362
+ requestId(ask: string, context?: { readonly seat?: string; readonly cell?: string; readonly originalRef?: string; readonly retryGroup?: string; readonly reason?: string }): string;
327
363
  /** requestId 단위 단일 소비 — 영수증은 최초 1회만 발급된다(두 번째는 기존 영수증과 사유로 거절). */
328
364
  consume(requestId: string, opts?: { readonly force?: boolean; readonly inheritedReceipt?: string }): LaunchRequestConsumption;
329
365
  /** 발사 실패 사유를 원장에 append 한다(관측 — 발사를 막지 않는다). */
@@ -332,6 +368,64 @@ export interface LaunchRequestDoor {
332
368
  rows(requestId?: string): readonly LaunchRequestLedgerRow[];
333
369
  }
334
370
 
371
+ export interface LaunchRequestLedgerSummary {
372
+ readonly requests: number;
373
+ readonly uniqueRequests: number;
374
+ readonly unconsumed: number;
375
+ readonly consumed: number;
376
+ readonly retries: number;
377
+ readonly failed: number;
378
+ readonly refused: number;
379
+ readonly doorUnavailable: number;
380
+ }
381
+
382
+ /** A read-only count over append-only request rows. */
383
+ export function summarizeLaunchRequestRows(all: readonly LaunchRequestLedgerRow[]): LaunchRequestLedgerSummary {
384
+ const byId = new Map<string, {
385
+ readonly events: Set<LaunchRequestLedgerEvent>;
386
+ requestedCount: number;
387
+ firstRequest?: LaunchRequestLedgerRow;
388
+ }>();
389
+ let requests = 0;
390
+ for (const row of all) {
391
+ let request = byId.get(row.requestId);
392
+ if (!request) {
393
+ request = { events: new Set(), requestedCount: 0 };
394
+ byId.set(row.requestId, request);
395
+ }
396
+ request.events.add(row.event);
397
+ if (row.event === 'requested') {
398
+ requests += 1;
399
+ request.requestedCount += 1;
400
+ request.firstRequest ??= row;
401
+ }
402
+ }
403
+ let unconsumed = 0;
404
+ let consumed = 0;
405
+ let failed = 0;
406
+ let refused = 0;
407
+ let doorUnavailable = 0;
408
+ let retries = 0;
409
+ const logicalRequests = new Map<string, number>();
410
+ for (const request of byId.values()) {
411
+ if (request.events.has('consumed')) consumed += 1;
412
+ else if (request.events.has('requested')) unconsumed += 1;
413
+ if (request.events.has('launch-failed')) failed += 1;
414
+ if (request.events.has('refused-duplicate')) refused += 1;
415
+ if (request.events.has('door-unavailable')) doorUnavailable += 1;
416
+ const requestRow = request.firstRequest;
417
+ if (requestRow) {
418
+ const logicalId = requestRow.retryGroup
419
+ ? `${requestRow.source ?? '-'}:${requestRow.retryGroup}`
420
+ : requestRow.requestId;
421
+ logicalRequests.set(logicalId, (logicalRequests.get(logicalId) ?? 0) + request.requestedCount);
422
+ }
423
+ }
424
+ for (const count of logicalRequests.values()) retries += Math.max(0, count - 1);
425
+ return { requests, uniqueRequests: byId.size,
426
+ unconsumed, consumed, retries, failed, refused, doorUnavailable };
427
+ }
428
+
335
429
  /** 단일문 deps — 원장 뿌리(기본 = 이 우주의 실효 인스턴스 루트)·시계·요청 출처 표지. */
336
430
  export interface LaunchRequestDoorDeps {
337
431
  readonly root?: string;
@@ -388,9 +482,12 @@ export function openLaunchRequestDoor(deps: LaunchRequestDoorDeps = {}): LaunchR
388
482
  } catch { return null; }
389
483
  };
390
484
 
391
- const requestId = (ask: string): string => {
485
+ const requestId = (ask: string, context: { readonly seat?: string; readonly cell?: string; readonly originalRef?: string; readonly retryGroup?: string; readonly reason?: string } = {}): string => {
392
486
  const id = launchRequestId(ask);
393
- appendRow({ event: 'requested', requestId: id, at: now().toISOString(), ...(source ? { source } : {}) });
487
+ appendRow({ event: 'requested', requestId: id, at: now().toISOString(), ...(source ? { source } : {}),
488
+ ...(context.seat ? { seat: context.seat } : {}), ...(context.cell ? { cell: context.cell } : {}),
489
+ ...(context.originalRef ? { originalRef: context.originalRef } : {}), ...(context.retryGroup ? { retryGroup: context.retryGroup } : {}),
490
+ ...(context.reason ? { reason: context.reason } : {}) });
394
491
  return id;
395
492
  };
396
493
 
@@ -457,26 +554,26 @@ export function openLaunchRequestDoor(deps: LaunchRequestDoorDeps = {}): LaunchR
457
554
  const rows = (requestId?: string): readonly LaunchRequestLedgerRow[] => {
458
555
  const result: LaunchRequestLedgerRow[] = [];
459
556
  let names: string[];
460
- try {
461
- assertLedgerPathPolicy(dir);
462
- names = readdirSync(dir);
463
- } catch { return result; }
557
+ assertLedgerPathPolicy(dir);
558
+ try { names = readdirSync(dir); }
559
+ catch (error) {
560
+ if ((error as NodeJS.ErrnoException)?.code === 'ENOENT') return result;
561
+ throw error;
562
+ }
464
563
  for (const name of names.filter((candidate) => LAUNCH_REQUEST_DATE_FILE.test(candidate)).sort()) {
564
+ const fd = openSync(join(dir, name), constants.O_RDONLY | constants.O_NOFOLLOW);
465
565
  let text: string;
466
566
  try {
467
- const fd = openSync(join(dir, name), constants.O_RDONLY | constants.O_NOFOLLOW);
468
- try {
469
- if (!fstatSync(fd).isFile()) continue;
470
- text = readFileSync(fd, 'utf8');
471
- } finally { closeSync(fd); }
472
- } catch { continue; }
567
+ if (!fstatSync(fd).isFile()) throw new Error(`launch request ledger entry is not a regular file: ${name}`);
568
+ text = readFileSync(fd, 'utf8');
569
+ } finally { closeSync(fd); }
473
570
  for (const line of text.split('\n')) {
474
571
  if (!line) continue;
475
- try {
476
- const row = JSON.parse(line) as LaunchRequestLedgerRow;
477
- if (row && typeof row === 'object' && typeof row.event === 'string' && typeof row.requestId === 'string'
478
- && typeof row.at === 'string' && (requestId === undefined || row.requestId === requestId)) result.push(row);
479
- } catch { /* 찢어진 줄은 건너뛴다 */ }
572
+ const row = JSON.parse(line) as LaunchRequestLedgerRow;
573
+ if (!row || typeof row !== 'object' || typeof row.event !== 'string' || typeof row.requestId !== 'string' || typeof row.at !== 'string') {
574
+ throw new Error(`invalid launch request ledger row in ${name}`);
575
+ }
576
+ if (requestId === undefined || row.requestId === requestId) result.push(row);
480
577
  }
481
578
  }
482
579
  return result;
@@ -0,0 +1,34 @@
1
+ import {
2
+ decideBurstWithinBudget,
3
+ type BurstBudgetDecision,
4
+ type BurstBudgetInput,
5
+ type BurstPlanLedger,
6
+ } from './burst-auto-within-budget.js';
7
+ import { planBurstReadyLadder, type BurstReadyLadderPlan } from './burst-ready-ladder.js';
8
+
9
+ export interface BurstAutoWireResult<T> {
10
+ readonly decision: BurstBudgetDecision;
11
+ /** Validated plans for the preparation stage; this function never creates VMs. */
12
+ readonly ladderPlans: readonly BurstReadyLadderPlan[];
13
+ readonly prepared: readonly T[];
14
+ }
15
+
16
+ /** Apply budget, validate every ladder plan, then hand approved plans to the preparation adapter. */
17
+ export function prepareBudgetedBurstReadyLadders<T>(
18
+ input: BurstBudgetInput,
19
+ dependencies: { ledger?: BurstPlanLedger; prepare: (plan: BurstReadyLadderPlan) => T },
20
+ ): BurstAutoWireResult<T> {
21
+ const ladderPlans: BurstReadyLadderPlan[] = [];
22
+ const decision = decideBurstWithinBudget(input, {
23
+ ...(dependencies.ledger ? { ledger: dependencies.ledger } : {}),
24
+ planLadder: (requests) => {
25
+ const validated = requests.map((request) => planBurstReadyLadder(request));
26
+ ladderPlans.push(...validated);
27
+ return validated;
28
+ },
29
+ });
30
+ // decideBurstWithinBudget validates the full batch before it records a decision. Only then
31
+ // may the preparation adapter be called; a denial therefore cannot occupy a pool slot.
32
+ const prepared = decision.status === 'planned' ? ladderPlans.map(dependencies.prepare) : [];
33
+ return { decision, ladderPlans, prepared };
34
+ }
@@ -0,0 +1,108 @@
1
+ import { ResourceLedger, type ResourceRecord } from '../control-plane/ledger.js';
2
+ import { debug } from '../debug/log.js';
3
+ import { mkdirSync } from 'node:fs';
4
+ import { dirname } from 'node:path';
5
+ import { withFileLockSync } from '../storage/file-lock.js';
6
+
7
+ export const CLOUD_MONTHLY_BUDGET_KRW = 2_000_000;
8
+ export const BURST_PURPOSES = ['gate', 'implementation', 'execution'] as const;
9
+ export type BurstPurpose = typeof BURST_PURPOSES[number];
10
+ export type BurstTtlHours = 2 | 4;
11
+
12
+ export interface BurstPressure { readonly queued: number; readonly blocked: number }
13
+ export interface BurstBudgetInput {
14
+ readonly requestId: string;
15
+ readonly owner: string;
16
+ readonly now: number;
17
+ readonly imageDigest: string;
18
+ readonly pressures: Readonly<Record<BurstPurpose, BurstPressure>>;
19
+ readonly hourlyCostKrw: Readonly<Record<BurstPurpose, number>>;
20
+ readonly ttlHours: BurstTtlHours;
21
+ readonly maxMachinesPerPurpose: number;
22
+ }
23
+ export interface BurstPlan { readonly requestId: string; readonly purpose: BurstPurpose; readonly count: number; readonly ttlHours: BurstTtlHours; readonly estimatedCostKrw: number }
24
+ export interface BurstBudgetDecision { readonly status: 'planned' | 'budget-blocked' | 'no-demand'; readonly spentThisMonthKrw: number; readonly remainingKrw: number; readonly plans: readonly BurstPlan[]; readonly reason?: string }
25
+ export interface BurstPlanLedger {
26
+ readonly path: string;
27
+ list(filter?: { kind?: string }, now?: number): readonly ResourceRecord[];
28
+ register(record: ResourceRecord, owner: string): ResourceRecord;
29
+ }
30
+ /** Pure planner batch; it must not provision or persist before the budget decision is committed. */
31
+ export type BurstLadderPlanner = (requests: readonly { requestId: string; purpose: BurstPurpose; imageDigest: string; admissionAt: number; ttlHours: BurstTtlHours }[]) => readonly unknown[];
32
+
33
+ function monthSpend(rows: readonly ResourceRecord[], from: number, to: number): number {
34
+ return rows.reduce((sum, row) => {
35
+ if (!(row.attrs.inventory === true || row.attrs.inventory === 'archived')) return sum;
36
+ const rate = row.attrs.hourlyCost;
37
+ if (typeof rate !== 'number' || !Number.isFinite(rate) || rate < 0) return sum;
38
+ const started = Number(row.attrs.startSignedAt) || row.observedAt;
39
+ const ended = row.attrs.inventory === 'archived' ? Number(row.attrs.stoppedAt) || to : to;
40
+ return sum + Math.max(0, Math.min(to, ended) - Math.max(from, started)) / 3_600_000 * rate;
41
+ }, 0);
42
+ }
43
+
44
+ /** Budget gate and NEXUS decision record only. It never provisions resources. */
45
+ export function decideBurstWithinBudget(
46
+ input: BurstBudgetInput,
47
+ dependencies: { ledger?: BurstPlanLedger; planLadder: BurstLadderPlanner },
48
+ ): BurstBudgetDecision {
49
+ if (!/^[A-Za-z0-9._-]{1,32}$/.test(input.requestId)) throw new Error('requestId must be a safe identifier of at most 32 characters');
50
+ if (!input.owner.trim()) throw new Error('owner is required');
51
+ if (!/^sha256:[a-f0-9]{64}$/.test(input.imageDigest)) throw new Error('a pinned sha256 imageDigest is required');
52
+ if (!Number.isFinite(input.now) || input.now <= 0) throw new Error('now must be a positive epoch timestamp');
53
+ if (input.ttlHours !== 2 && input.ttlHours !== 4) throw new Error('ttlHours must be 2 or 4');
54
+ if (!Number.isInteger(input.maxMachinesPerPurpose) || input.maxMachinesPerPurpose < 1) throw new Error('maxMachinesPerPurpose must be a positive integer');
55
+
56
+ const demandByPurpose = new Map<BurstPurpose, number>();
57
+ for (const purpose of BURST_PURPOSES) {
58
+ const pressure = input.pressures[purpose]; const rate = input.hourlyCostKrw[purpose];
59
+ if (!Number.isInteger(pressure.queued) || pressure.queued < 0 || !Number.isInteger(pressure.blocked) || pressure.blocked < 0) throw new Error(`invalid pressure: ${purpose}`);
60
+ if (!Number.isFinite(rate) || rate <= 0) throw new Error(`hourly cost must be positive: ${purpose}`);
61
+ demandByPurpose.set(purpose, Math.min(input.maxMachinesPerPurpose, Math.max(pressure.queued, pressure.blocked)));
62
+ }
63
+
64
+ const ledger = dependencies.ledger ?? new ResourceLedger();
65
+ mkdirSync(dirname(ledger.path), { recursive: true, mode: 0o700 });
66
+ return withFileLockSync(`${ledger.path}.burst-budget.lock`, () => {
67
+ const recordId = `fleet-burst-decision:${input.requestId}`;
68
+ const prior = ledger.list({ kind: 'universe' }, input.now).find(row => row.id === recordId);
69
+ if (prior) {
70
+ if (prior.owner !== input.owner) throw new Error('burst request id is owned by another seat');
71
+ return prior.attrs.decision as BurstBudgetDecision;
72
+ }
73
+ const monthStart = Date.UTC(new Date(input.now).getUTCFullYear(), new Date(input.now).getUTCMonth(), 1);
74
+ const rows = ledger.list({}, input.now);
75
+ const spentThisMonthKrw = monthSpend(rows.filter(row => row.kind === 'fleet-resource'), monthStart, input.now);
76
+ const pendingReservationsKrw = rows
77
+ .filter(row => row.kind === 'universe' && row.attrs.type === 'burst-auto-budget-decision' && row.attrs.status === 'planned' && row.observedAt >= monthStart)
78
+ .reduce((sum, row) => sum + Math.max(0, Number(row.attrs.reservedKrw) || 0), 0);
79
+ const remainingKrw = Math.max(0, CLOUD_MONTHLY_BUDGET_KRW - spentThisMonthKrw - pendingReservationsKrw);
80
+ const plans: BurstPlan[] = []; let committed = 0;
81
+ for (const purpose of BURST_PURPOSES) {
82
+ const demand = demandByPurpose.get(purpose)!; if (!demand) continue;
83
+ const perMachine = input.hourlyCostKrw[purpose] * input.ttlHours;
84
+ const count = Math.min(demand, Math.floor((remainingKrw - committed) / perMachine));
85
+ if (count < 1) continue;
86
+ plans.push({ requestId: input.requestId, purpose, count, ttlHours: input.ttlHours, estimatedCostKrw: count * perMachine });
87
+ committed += count * perMachine;
88
+ }
89
+ const ladderRequests = plans.flatMap(plan => Array.from({ length: plan.count }, (_, index) => ({
90
+ requestId: `${input.requestId}-${plan.purpose}-${index + 1}`, purpose: plan.purpose, imageDigest: input.imageDigest,
91
+ ttlHours: input.ttlHours, admissionAt: input.now + 60 * 60 * 1000,
92
+ })));
93
+ // Validate/build every ladder plan before publishing the reservation decision.
94
+ dependencies.planLadder(ladderRequests);
95
+ const hasDemand = [...demandByPurpose.values()].some(Boolean);
96
+ const status = plans.length ? 'planned' : hasDemand ? 'budget-blocked' : 'no-demand';
97
+ const decision: BurstBudgetDecision = { status, spentThisMonthKrw, remainingKrw, plans,
98
+ ...(status === 'budget-blocked' ? { reason: 'monthly budget exhausted or next machine exceeds remaining budget' } : {}) };
99
+ const record: ResourceRecord = {
100
+ id: recordId, kind: 'universe', machine: 'nexus', name: 'burst-auto-budget-decision', owner: input.owner,
101
+ attrs: { type: 'burst-auto-budget-decision', requestId: input.requestId, status, monthlyBudgetKrw: CLOUD_MONTHLY_BUDGET_KRW, spentThisMonthKrw, pendingReservationsKrw, reservedKrw: committed, remainingKrw, decision, realResourcesCreated: 0 },
102
+ observedAt: input.now, ttlMs: 90 * 24 * 60 * 60 * 1000,
103
+ };
104
+ ledger.register(record, input.owner);
105
+ debug.log('fleet.burst', 'budget-decision', { requestId: input.requestId, status, spentThisMonthKrw, plans: plans.length, realResourcesCreated: 0 });
106
+ return decision;
107
+ });
108
+ }
@@ -0,0 +1,64 @@
1
+ const HOUR_MS = 60 * 60 * 1000;
2
+
3
+ export const BURST_READY_PURPOSES = ['gate', 'implementation', 'execution'] as const;
4
+ export type BurstReadyPurpose = typeof BURST_READY_PURPOSES[number];
5
+ export type BurstReadyTtlHours = 2 | 4;
6
+
7
+ export interface BurstReadyLadderRequest {
8
+ readonly requestId: string;
9
+ readonly purpose: BurstReadyPurpose;
10
+ readonly imageDigest: string;
11
+ /** Requested work admission time, in Unix milliseconds. */
12
+ readonly admissionAt: number;
13
+ readonly ttlHours: BurstReadyTtlHours;
14
+ }
15
+
16
+ export interface BurstReadyLadderPlan extends BurstReadyLadderRequest {
17
+ readonly prepareAt: number;
18
+ readonly ttlMs: number;
19
+ readonly stopAfterAt: number;
20
+ }
21
+
22
+ /** Refuse admission until the scheduled start and at/after TTL expiry. */
23
+ export function assertBurstAdmissionWindow(plan: BurstReadyLadderPlan, now: number): void {
24
+ if (!Number.isFinite(now)) throw new Error('burst-ready-ladder: now must be a finite epoch');
25
+ if (now < plan.admissionAt) {
26
+ throw new Error(`burst-ready-ladder: admission refused before scheduled time ${plan.admissionAt}`);
27
+ }
28
+ if (now >= plan.stopAfterAt) {
29
+ throw new Error(`burst-ready-ladder: admission refused at or after TTL expiry ${plan.stopAfterAt}`);
30
+ }
31
+ }
32
+
33
+ /** Put the time-window check directly around the lease-opening operation. */
34
+ export function openBurstReadyLease<T>(plan: BurstReadyLadderPlan, now: number, openLease: () => T): T {
35
+ assertBurstAdmissionWindow(plan, now);
36
+ return openLease();
37
+ }
38
+
39
+ /** Plan the warm-up boundary and a TTL that starts at admission, not at preparation. */
40
+ export function planBurstReadyLadder(request: BurstReadyLadderRequest): BurstReadyLadderPlan {
41
+ if (!/^[A-Za-z0-9._-]{1,64}$/.test(request.requestId)) {
42
+ throw new Error('burst-ready-ladder: requestId must be 1-64 safe identifier characters');
43
+ }
44
+ if (!(BURST_READY_PURPOSES as readonly string[]).includes(request.purpose)) {
45
+ throw new Error('burst-ready-ladder: purpose must be gate, implementation, or execution');
46
+ }
47
+ if (!/^sha256:[a-f0-9]{64}$/.test(request.imageDigest)) {
48
+ throw new Error('burst-ready-ladder: pinned sha256 imageDigest is required');
49
+ }
50
+ if (!Number.isFinite(request.admissionAt) || request.admissionAt <= HOUR_MS) {
51
+ throw new Error('burst-ready-ladder: admissionAt must be a positive Unix-millisecond epoch');
52
+ }
53
+ if (request.ttlHours !== 2 && request.ttlHours !== 4) {
54
+ throw new Error('burst-ready-ladder: ttlHours must be 2 or 4');
55
+ }
56
+
57
+ const ttlMs = request.ttlHours * HOUR_MS;
58
+ const prepareAt = request.admissionAt - HOUR_MS;
59
+ const stopAfterAt = request.admissionAt + ttlMs;
60
+ if (!Number.isFinite(stopAfterAt) || stopAfterAt <= request.admissionAt) {
61
+ throw new Error('burst-ready-ladder: stopAfterAt is outside the supported epoch range');
62
+ }
63
+ return { ...request, prepareAt, ttlMs, stopAfterAt };
64
+ }