elanous 0.2.32 → 0.2.35

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 (753) hide show
  1. package/apps/pwa/out/404/index.html +1 -1
  2. package/apps/pwa/out/404.html +1 -1
  3. package/apps/pwa/out/_next/static/{IVKr3AlRUVLKsw2fh7eXF → T1mBQqmkwKDLGtyisDCOd}/_buildManifest.js +1 -1
  4. package/apps/pwa/out/_next/static/chunks/{997ce8a5-2ad501927003b41b.js → 0368f25d-ad84af92fefee68f.js} +1 -1
  5. package/apps/pwa/out/_next/static/chunks/1165.bad13fc9151a7288.js +1 -0
  6. package/apps/pwa/out/_next/static/chunks/13.02a07436dec15f89.js +32 -0
  7. package/apps/pwa/out/_next/static/chunks/{5525.86debf231e181813.js → 1530.0e612369b6fd7ea0.js} +1 -1
  8. package/apps/pwa/out/_next/static/chunks/1540.af38731fa7c4a3e0.js +41 -0
  9. package/apps/pwa/out/_next/static/chunks/{7391.ebae168025c91b6a.js → 1674.2a65fd5668e1cc5f.js} +1 -1
  10. package/apps/pwa/out/_next/static/chunks/1850.f2b470ba5a471da0.js +24 -0
  11. package/apps/pwa/out/_next/static/chunks/193.62da94cd0b88323b.js +74 -0
  12. package/apps/pwa/out/_next/static/chunks/1975.260f6d249fac5f7c.js +1 -0
  13. package/apps/pwa/out/_next/static/chunks/1982-67cd8dfe8682325f.js +1 -0
  14. package/apps/pwa/out/_next/static/chunks/{7947-d0759430f8042240.js → 1993-c0007b7ad0c0ef41.js} +1 -1
  15. package/apps/pwa/out/_next/static/chunks/1999-bb415351c8a2846c.js +1 -0
  16. package/apps/pwa/out/_next/static/chunks/{60fb96c9.360b01d8d4927b7b.js → 1c735de4.f993a30bbd3c57c4.js} +1 -1
  17. package/apps/pwa/out/_next/static/chunks/1dc5a567.9b092bfae3d7099b.js +1 -0
  18. package/apps/pwa/out/_next/static/chunks/{5307.60f2209e809bd627.js → 2018.a741297bce759490.js} +1 -1
  19. package/apps/pwa/out/_next/static/chunks/2085.8f950b4bda1cbbc7.js +1 -0
  20. package/apps/pwa/out/_next/static/chunks/2159-6179a961376956b9.js +1 -0
  21. package/apps/pwa/out/_next/static/chunks/216.b5c2a421aa1d28a5.js +1 -0
  22. package/apps/pwa/out/_next/static/chunks/2251.49fbe369f74c372c.js +148 -0
  23. package/apps/pwa/out/_next/static/chunks/2286-2939577360d3dcc0.js +1 -0
  24. package/apps/pwa/out/_next/static/chunks/{3902.e1e71aaac850a045.js → 2625.5d870aa999f33db1.js} +1 -1
  25. package/apps/pwa/out/_next/static/chunks/2668.34d21539e62bf111.js +77 -0
  26. package/apps/pwa/out/_next/static/chunks/2833-0fe47af99ed13c29.js +1 -0
  27. package/apps/pwa/out/_next/static/chunks/2930.d0edb4f108787ef7.js +1 -0
  28. package/apps/pwa/out/_next/static/chunks/2973.77318e7d85f59477.js +62 -0
  29. package/apps/pwa/out/_next/static/chunks/3103.0df8da390948bb84.js +1 -0
  30. package/apps/pwa/out/_next/static/chunks/3123.2bee9ba15d320bd2.js +90 -0
  31. package/apps/pwa/out/_next/static/chunks/3162-6cf652bf7124d8cf.js +1 -0
  32. package/apps/pwa/out/_next/static/chunks/{4174.92ed04922709ac9e.js → 3408.21d1570602f4b6c0.js} +2 -2
  33. package/apps/pwa/out/_next/static/chunks/3577-7340009f7007a795.js +1 -0
  34. package/apps/pwa/out/_next/static/chunks/3589.5444a06bcf6e775c.js +1 -0
  35. package/apps/pwa/out/_next/static/chunks/359-2250789a2d3499e7.js +1 -0
  36. package/apps/pwa/out/_next/static/chunks/3618.f514792d6c59d7fd.js +36 -0
  37. package/apps/pwa/out/_next/static/chunks/3669.343f9119aa276001.js +1 -0
  38. package/apps/pwa/out/_next/static/chunks/{9398-6aed28f0a96d0d6f.js → 3677-4215f826f6aa68e5.js} +1 -1
  39. package/apps/pwa/out/_next/static/chunks/3736.c2efad489604cc3b.js +79 -0
  40. package/apps/pwa/out/_next/static/chunks/3817.f9aeab2bb6675d73.js +1 -0
  41. package/apps/pwa/out/_next/static/chunks/3f7c4ee5.3dde54f01a816613.js +122 -0
  42. package/apps/pwa/out/_next/static/chunks/4182-0b9b1251c29cc0cf.js +1 -0
  43. package/apps/pwa/out/_next/static/chunks/{7371.80c05c653b08e907.js → 4346.8601952e73bf5803.js} +1 -1
  44. package/apps/pwa/out/_next/static/chunks/4441-875b97f5821ed58a.js +1 -0
  45. package/apps/pwa/out/_next/static/chunks/4582.bd68683c076649e3.js +286 -0
  46. package/apps/pwa/out/_next/static/chunks/4605-6e623f55aec77422.js +1 -0
  47. package/apps/pwa/out/_next/static/chunks/4607.5cc27468628eb4bf.js +1 -0
  48. package/apps/pwa/out/_next/static/chunks/4627.f07508b3936fd6c0.js +24 -0
  49. package/apps/pwa/out/_next/static/chunks/{2940-619bfd8ef337c611.js → 4705-194e64e47ca0fbdb.js} +1 -1
  50. package/apps/pwa/out/_next/static/chunks/{1335-6731f392c35216eb.js → 4718-17d2af636796a330.js} +3 -3
  51. package/apps/pwa/out/_next/static/chunks/4747-c22262c093e46807.js +1 -0
  52. package/apps/pwa/out/_next/static/chunks/4775-178215aed0daba61.js +1 -0
  53. package/apps/pwa/out/_next/static/chunks/4815-6ffb8c3c991cc45d.js +1 -0
  54. package/apps/pwa/out/_next/static/chunks/4834-beca8b47ad29a898.js +1 -0
  55. package/apps/pwa/out/_next/static/chunks/5023-fb4802b6d2492b02.js +1 -0
  56. package/apps/pwa/out/_next/static/chunks/{7502.ccd5b8065545edd0.js → 5101.e32282718f99ed6f.js} +2 -2
  57. package/apps/pwa/out/_next/static/chunks/{2001.6c7e0fd02190886c.js → 5154.a118f3957ed14e36.js} +1 -1
  58. package/apps/pwa/out/_next/static/chunks/5210-a2e0015e3d4d5d9c.js +1 -0
  59. package/apps/pwa/out/_next/static/chunks/5356.84ac712cc15928bf.js +1 -0
  60. package/apps/pwa/out/_next/static/chunks/5401.22352141b6fd336e.js +23 -0
  61. package/apps/pwa/out/_next/static/chunks/{5173-233188df2f42c626.js → 5483-dd5d7697f6bdb106.js} +1 -1
  62. package/apps/pwa/out/_next/static/chunks/5637.281e5dec4ea6ecf1.js +94 -0
  63. package/apps/pwa/out/_next/static/chunks/5662.02eaa029af05ad46.js +1 -0
  64. package/apps/pwa/out/_next/static/chunks/{3267c0e6.d34854e7b3984a6e.js → 56d372f2.681ab4ec4c998fae.js} +1 -1
  65. package/apps/pwa/out/_next/static/chunks/5760.22456f433c6f42c0.js +1 -0
  66. package/apps/pwa/out/_next/static/chunks/5852.db1f7449f4f74612.js +287 -0
  67. package/apps/pwa/out/_next/static/chunks/5891-0f11a7d7362a9072.js +1 -0
  68. package/apps/pwa/out/_next/static/chunks/5943.264d14a44ca32513.js +1 -0
  69. package/apps/pwa/out/_next/static/chunks/604-1b3c39df083c02aa.js +1 -0
  70. package/apps/pwa/out/_next/static/chunks/6121-5f97072330738caf.js +1 -0
  71. package/apps/pwa/out/_next/static/chunks/6193.07d8ca5af4b09086.js +1 -0
  72. package/apps/pwa/out/_next/static/chunks/6203-b3fea3a60d69ff14.js +1 -0
  73. package/apps/pwa/out/_next/static/chunks/{6433.fc573af22bbc9ab7.js → 6236.e18cced2d5ba6afb.js} +17 -17
  74. package/apps/pwa/out/_next/static/chunks/6286.d638fb5953e2e757.js +8 -0
  75. package/apps/pwa/out/_next/static/chunks/630.fe5a46428d63b013.js +1 -0
  76. package/apps/pwa/out/_next/static/chunks/6301.ae0245f507e4395e.js +1 -0
  77. package/apps/pwa/out/_next/static/chunks/6673.fbbe5699f6ea5991.js +27 -0
  78. package/apps/pwa/out/_next/static/chunks/6777-f6d301efb5de828d.js +1 -0
  79. package/apps/pwa/out/_next/static/chunks/6786.423f24c88de034c7.js +93 -0
  80. package/apps/pwa/out/_next/static/chunks/6854-cef64a948c5e122d.js +1 -0
  81. package/apps/pwa/out/_next/static/chunks/6866-79aa5b4e47cac6aa.js +1 -0
  82. package/apps/pwa/out/_next/static/chunks/{6544cb48.a87fe20ddf137be2.js → 6b89c8bd.24df687a820500b3.js} +1 -1
  83. package/apps/pwa/out/_next/static/chunks/7037-fe27f001db30d323.js +1 -0
  84. package/apps/pwa/out/_next/static/chunks/7080.2d826860534fd88e.js +1 -0
  85. package/apps/pwa/out/_next/static/chunks/7118.8731be28c3ebb14b.js +1 -0
  86. package/apps/pwa/out/_next/static/chunks/7196.44241bc1df3e26fe.js +149 -0
  87. package/apps/pwa/out/_next/static/chunks/7235.c7c4e6cb5c693c2d.js +104 -0
  88. package/apps/pwa/out/_next/static/chunks/{2871.0bca6137343b3f76.js → 7385.50a308a477bdfc21.js} +1 -1
  89. package/apps/pwa/out/_next/static/chunks/{2985.39ccdecd36848b12.js → 7644.17e37ba6f1d4226e.js} +4 -4
  90. package/apps/pwa/out/_next/static/chunks/7706-58bfb1546637f217.js +1 -0
  91. package/apps/pwa/out/_next/static/chunks/7839.5b91455338c9fd3f.js +1 -0
  92. package/apps/pwa/out/_next/static/chunks/7857-31f13ee96f4011aa.js +1 -0
  93. package/apps/pwa/out/_next/static/chunks/81.f74cb60312fe4001.js +1 -0
  94. package/apps/pwa/out/_next/static/chunks/{8018.a32663f04a6fc5f9.js → 8219.baa715d1deee80e2.js} +1 -1
  95. package/apps/pwa/out/_next/static/chunks/{4111.2bfedbb233ad206b.js → 8256.e3ac8421a71f82f4.js} +1 -1
  96. package/apps/pwa/out/_next/static/chunks/8310-444a6a895c402f12.js +1 -0
  97. package/apps/pwa/out/_next/static/chunks/8423.f7dda8aca4fcaae5.js +1 -0
  98. package/apps/pwa/out/_next/static/chunks/8437-8d5492094b166cfa.js +1 -0
  99. package/apps/pwa/out/_next/static/chunks/{2213.2ccbada92c33ea0f.js → 8444.4c26b379ca2b9596.js} +17 -17
  100. package/apps/pwa/out/_next/static/chunks/8496.75649af8652c74f4.js +226 -0
  101. package/apps/pwa/out/_next/static/chunks/8557-e7898769499cd56f.js +1 -0
  102. package/apps/pwa/out/_next/static/chunks/8576.65bb654b524f3614.js +1 -0
  103. package/apps/pwa/out/_next/static/chunks/8609.558ce2f8f9aea2be.js +64 -0
  104. package/apps/pwa/out/_next/static/chunks/8614.caec96cfb91f4ae7.js +1 -0
  105. package/apps/pwa/out/_next/static/chunks/{6092.a7f99e68b188ca66.js → 8637.47f5b35afcae5e6b.js} +1 -1
  106. package/apps/pwa/out/_next/static/chunks/8714.ff0b7ce3ec3e3ae2.js +1 -0
  107. package/apps/pwa/out/_next/static/chunks/8732.367f44a916202353.js +1 -0
  108. package/apps/pwa/out/_next/static/chunks/9141-7fd1f73a5400bdc2.js +1 -0
  109. package/apps/pwa/out/_next/static/chunks/921.c4267d0d69a65404.js +1 -0
  110. package/apps/pwa/out/_next/static/chunks/{3278.2e5d15b53a4091c8.js → 9214.63a510d39178e997.js} +2 -2
  111. package/apps/pwa/out/_next/static/chunks/9261.3962c3321b047691.js +115 -0
  112. package/apps/pwa/out/_next/static/chunks/936-26efd1a0efdd44d3.js +1 -0
  113. package/apps/pwa/out/_next/static/chunks/{9221.7d22eaf353a2d4e7.js → 938.66ad1ef0e5abae1c.js} +1 -1
  114. package/apps/pwa/out/_next/static/chunks/{6157.0c9af021de4fb31b.js → 9512.5a76207a730e0491.js} +2 -2
  115. package/apps/pwa/out/_next/static/chunks/9627-4b9efe616b27e2e2.js +1 -0
  116. package/apps/pwa/out/_next/static/chunks/{69-0a2c8209c6d4a158.js → 967-2aa39b2d04b4c690.js} +1 -1
  117. package/apps/pwa/out/_next/static/chunks/9734.40eb1e558c29ccea.js +1 -0
  118. package/apps/pwa/out/_next/static/chunks/9908.3aa54f7a586a73dc.js +1 -0
  119. package/apps/pwa/out/_next/static/chunks/{7862.30a8d6482bb238eb.js → 9952.5daf5f94063a2b3e.js} +1 -1
  120. package/apps/pwa/out/_next/static/chunks/9954-ca8d29752bdbb45a.js +1 -0
  121. package/apps/pwa/out/_next/static/chunks/9974-507fa67cb94066dd.js +1 -0
  122. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-ce9e00f7fb45506a.js +1 -0
  123. package/apps/pwa/out/_next/static/chunks/app/approvals/page-fa59d6d17daa3389.js +1 -0
  124. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-53f68bbe7bd4b774.js +1 -0
  125. package/apps/pwa/out/_next/static/chunks/app/board/page-1c500fbb9f4a7a04.js +1 -0
  126. package/apps/pwa/out/_next/static/chunks/app/botlab/page-99d72673aa5c307c.js +1 -0
  127. package/apps/pwa/out/_next/static/chunks/app/bots/page-d2d5adc1e9484c88.js +1 -0
  128. package/apps/pwa/out/_next/static/chunks/app/ceo/page-c607c5aae637f1cc.js +1 -0
  129. package/apps/pwa/out/_next/static/chunks/app/chat/page-fa8c23596d555c0f.js +1 -0
  130. package/apps/pwa/out/_next/static/chunks/app/consult/page-bdab8c5e855c8416.js +1 -0
  131. package/apps/pwa/out/_next/static/chunks/app/control/{page-a27b1e5a0d1b308f.js → page-406b47745b53f269.js} +1 -1
  132. package/apps/pwa/out/_next/static/chunks/app/decisions/page-a4276386b7051f50.js +1 -0
  133. package/apps/pwa/out/_next/static/chunks/app/design-check/page-8a26bab9ad375f25.js +1 -0
  134. package/apps/pwa/out/_next/static/chunks/app/editor/page-775f48aa1dc7a2d5.js +1 -0
  135. package/apps/pwa/out/_next/static/chunks/app/exec/page-1c4dd5f959d0c558.js +1 -0
  136. package/apps/pwa/out/_next/static/chunks/app/field/page-c48938a8377c9f70.js +1 -0
  137. package/apps/pwa/out/_next/static/chunks/app/healthz/route-ce9e00f7fb45506a.js +1 -0
  138. package/apps/pwa/out/_next/static/chunks/app/inside/page-c6e7905859425aa9.js +1 -0
  139. package/apps/pwa/out/_next/static/chunks/app/intake/page-c280f4252452e830.js +1 -0
  140. package/apps/pwa/out/_next/static/chunks/app/layout-cf8c57498f20970a.js +1 -0
  141. package/apps/pwa/out/_next/static/chunks/app/live/page-ca3a17caf409fc83.js +1 -0
  142. package/apps/pwa/out/_next/static/chunks/app/live-run/page-26e6c18a1a750cf6.js +1 -0
  143. package/apps/pwa/out/_next/static/chunks/app/loops/page-3abc872cc6aeee39.js +1 -0
  144. package/apps/pwa/out/_next/static/chunks/app/market/page-f7481b7b2174fe3d.js +1 -0
  145. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-1ae7ef8077680337.js +1 -0
  146. package/apps/pwa/out/_next/static/chunks/app/morning/{page-32866485913d6a04.js → page-47c5d4db587266bd.js} +1 -1
  147. package/apps/pwa/out/_next/static/chunks/app/not-found-415f1e243c7ccb13.js +1 -0
  148. package/apps/pwa/out/_next/static/chunks/app/observatory/page-73f380f17b76f95c.js +1 -0
  149. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-2991073ad66ee2d9.js +1 -0
  150. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-1f5a60f70cb4dd0c.js +1 -0
  151. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-fbad60d1e358fb2c.js +1 -0
  152. package/apps/pwa/out/_next/static/chunks/app/outputs/page-bac7dee94e5eae4a.js +1 -0
  153. package/apps/pwa/out/_next/static/chunks/app/page-398047d6949e8ca5.js +1 -0
  154. package/apps/pwa/out/_next/static/chunks/app/reflection/page-2d33a2231540ca89.js +1 -0
  155. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-5bf1e6bf70bcb96c.js +1 -0
  156. package/apps/pwa/out/_next/static/chunks/app/sessions/page-ba59c19376a0917d.js +1 -0
  157. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-111f187139add30f.js +1 -0
  158. package/apps/pwa/out/_next/static/chunks/app/settings/page-acaae197d5be5779.js +1 -0
  159. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-0df20b0f546a0d7d.js +1 -0
  160. package/apps/pwa/out/_next/static/chunks/app/setup/layout-ce9e00f7fb45506a.js +1 -0
  161. package/apps/pwa/out/_next/static/chunks/app/setup/page-27e1202d24b8fe35.js +1 -0
  162. package/apps/pwa/out/_next/static/chunks/app/share/page-bda78c50a78363e5.js +1 -0
  163. package/apps/pwa/out/_next/static/chunks/app/showroom/page-da592691293d9c9f.js +1 -0
  164. package/apps/pwa/out/_next/static/chunks/app/tasks/page-f832994317a2e9f0.js +1 -0
  165. package/apps/pwa/out/_next/static/chunks/app/term/{page-04d00ae9b0890349.js → page-dc0a532f5b9196ec.js} +1 -1
  166. package/apps/pwa/out/_next/static/chunks/app/today/page-cfccbbeae0473404.js +1 -0
  167. package/apps/pwa/out/_next/static/chunks/app/trace/page-527e2073af84c81b.js +1 -0
  168. package/apps/pwa/out/_next/static/chunks/app/vault/page-bac86e9112671357.js +1 -0
  169. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-6d59dff410e9d76a.js +1 -0
  170. package/apps/pwa/out/_next/static/chunks/app/workflows/page-53a61f8be09f02d2.js +1 -0
  171. package/apps/pwa/out/_next/static/chunks/app/workspace/page-db8f559e763c17f9.js +1 -0
  172. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-c02aa4cc66455093.js +1 -0
  173. package/apps/pwa/out/_next/static/chunks/{7a1887c4.f36b88fba31da8fd.js → b2f6ba4d.fb56fdbbf798df33.js} +1 -1
  174. package/apps/pwa/out/_next/static/chunks/b6705a4f-b9a9047de9eecfd0.js +1 -0
  175. package/apps/pwa/out/_next/static/chunks/{b313b242.cb1265eea908db61.js → cbe38a15.5a032598e39970c6.js} +1 -1
  176. package/apps/pwa/out/_next/static/chunks/{409f1e57.d0649fc47691ebfe.js → d06f9160.a3d9062f95de8ad7.js} +1 -1
  177. package/apps/pwa/out/_next/static/chunks/{0bb0ff36.b8d418980951e5ba.js → da5176c6.6773b6c5994e1d99.js} +7 -7
  178. package/apps/pwa/out/_next/static/chunks/framework-50e6acebc630849b.js +1 -0
  179. package/apps/pwa/out/_next/static/chunks/main-7a1ae342d5ed75e6.js +1 -0
  180. package/apps/pwa/out/_next/static/chunks/main-app-7ad7d505ba1f92b4.js +1 -0
  181. package/apps/pwa/out/_next/static/chunks/pages/_app-02edba75232cb235.js +1 -0
  182. package/apps/pwa/out/_next/static/chunks/pages/_error-97d6ebae3e8eee4a.js +1 -0
  183. package/apps/pwa/out/_next/static/chunks/webpack-e986adaa429163e8.js +1 -0
  184. package/apps/pwa/out/approvals/index.html +1 -1
  185. package/apps/pwa/out/approvals/index.txt +22 -22
  186. package/apps/pwa/out/autopilot/index.html +1 -1
  187. package/apps/pwa/out/autopilot/index.txt +22 -22
  188. package/apps/pwa/out/board/index.html +1 -1
  189. package/apps/pwa/out/board/index.txt +22 -22
  190. package/apps/pwa/out/botlab/index.html +1 -1
  191. package/apps/pwa/out/botlab/index.txt +21 -21
  192. package/apps/pwa/out/bots/index.html +1 -1
  193. package/apps/pwa/out/bots/index.txt +21 -21
  194. package/apps/pwa/out/ceo/index.html +1 -1
  195. package/apps/pwa/out/ceo/index.txt +22 -22
  196. package/apps/pwa/out/chat/index.html +1 -1
  197. package/apps/pwa/out/chat/index.txt +21 -21
  198. package/apps/pwa/out/consult/index.html +1 -1
  199. package/apps/pwa/out/consult/index.txt +22 -22
  200. package/apps/pwa/out/control/index.html +1 -1
  201. package/apps/pwa/out/control/index.txt +22 -22
  202. package/apps/pwa/out/decisions/index.html +1 -1
  203. package/apps/pwa/out/decisions/index.txt +21 -21
  204. package/apps/pwa/out/design-check/index.html +1 -1
  205. package/apps/pwa/out/design-check/index.txt +22 -22
  206. package/apps/pwa/out/editor/index.html +1 -1
  207. package/apps/pwa/out/editor/index.txt +22 -22
  208. package/apps/pwa/out/exec/index.html +1 -1
  209. package/apps/pwa/out/exec/index.txt +22 -22
  210. package/apps/pwa/out/field/index.html +1 -1
  211. package/apps/pwa/out/field/index.txt +22 -22
  212. package/apps/pwa/out/healthz +1 -1
  213. package/apps/pwa/out/index.html +1 -1
  214. package/apps/pwa/out/index.txt +21 -21
  215. package/apps/pwa/out/inside/index.html +1 -1
  216. package/apps/pwa/out/inside/index.txt +21 -21
  217. package/apps/pwa/out/intake/index.html +1 -1
  218. package/apps/pwa/out/intake/index.txt +22 -22
  219. package/apps/pwa/out/live/index.html +1 -1
  220. package/apps/pwa/out/live/index.txt +22 -22
  221. package/apps/pwa/out/live-run/index.html +1 -1
  222. package/apps/pwa/out/live-run/index.txt +22 -22
  223. package/apps/pwa/out/loops/index.html +1 -1
  224. package/apps/pwa/out/loops/index.txt +21 -21
  225. package/apps/pwa/out/market/index.html +1 -1
  226. package/apps/pwa/out/market/index.txt +21 -21
  227. package/apps/pwa/out/missions/placeholder/index.html +1 -1
  228. package/apps/pwa/out/missions/placeholder/index.txt +21 -21
  229. package/apps/pwa/out/morning/index.html +1 -1
  230. package/apps/pwa/out/morning/index.txt +22 -22
  231. package/apps/pwa/out/observatory/index.html +1 -1
  232. package/apps/pwa/out/observatory/index.txt +22 -22
  233. package/apps/pwa/out/ops/checklist/index.html +1 -1
  234. package/apps/pwa/out/ops/checklist/index.txt +21 -21
  235. package/apps/pwa/out/ops/release/index.html +1 -1
  236. package/apps/pwa/out/ops/release/index.txt +21 -21
  237. package/apps/pwa/out/ops/seats/index.html +1 -1
  238. package/apps/pwa/out/ops/seats/index.txt +21 -21
  239. package/apps/pwa/out/outputs/index.html +1 -1
  240. package/apps/pwa/out/outputs/index.txt +21 -21
  241. package/apps/pwa/out/reflection/index.html +1 -1
  242. package/apps/pwa/out/reflection/index.txt +22 -22
  243. package/apps/pwa/out/scheduler/index.html +1 -1
  244. package/apps/pwa/out/scheduler/index.txt +22 -22
  245. package/apps/pwa/out/sessions/index.html +1 -1
  246. package/apps/pwa/out/sessions/index.txt +21 -21
  247. package/apps/pwa/out/settings/devices/index.html +1 -1
  248. package/apps/pwa/out/settings/devices/index.txt +22 -22
  249. package/apps/pwa/out/settings/index.html +1 -1
  250. package/apps/pwa/out/settings/index.txt +22 -22
  251. package/apps/pwa/out/setup/done/index.html +1 -1
  252. package/apps/pwa/out/setup/done/index.txt +22 -22
  253. package/apps/pwa/out/setup/index.html +1 -1
  254. package/apps/pwa/out/setup/index.txt +22 -22
  255. package/apps/pwa/out/share/index.html +1 -1
  256. package/apps/pwa/out/share/index.txt +22 -22
  257. package/apps/pwa/out/showroom/index.html +1 -1
  258. package/apps/pwa/out/showroom/index.txt +21 -21
  259. package/apps/pwa/out/tasks/index.html +1 -1
  260. package/apps/pwa/out/tasks/index.txt +22 -22
  261. package/apps/pwa/out/term/index.html +1 -1
  262. package/apps/pwa/out/term/index.txt +22 -22
  263. package/apps/pwa/out/today/index.html +1 -1
  264. package/apps/pwa/out/today/index.txt +22 -22
  265. package/apps/pwa/out/trace/index.html +1 -1
  266. package/apps/pwa/out/trace/index.txt +22 -22
  267. package/apps/pwa/out/vault/index.html +1 -1
  268. package/apps/pwa/out/vault/index.txt +22 -22
  269. package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
  270. package/apps/pwa/out/workflows/chat-ui/index.txt +22 -22
  271. package/apps/pwa/out/workflows/index.html +1 -1
  272. package/apps/pwa/out/workflows/index.txt +22 -22
  273. package/apps/pwa/out/workspace/index.html +1 -1
  274. package/apps/pwa/out/workspace/index.txt +22 -22
  275. package/apps/pwa/out/worktrees/index.html +1 -1
  276. package/apps/pwa/out/worktrees/index.txt +22 -22
  277. package/bin/elanous.mjs +10 -2
  278. package/catalog/providers/opengateway.yaml +25 -0
  279. package/docs/goal-context/01-goal-authoring-checks.md +8 -0
  280. package/docs/goal-context/03-verification-menu.md +24 -0
  281. package/docs/goal-context/04-mock-scenarios.md +100 -0
  282. package/docs/goal-context/README.md +5 -0
  283. package/graphs/catalog/catalog.yaml +1 -1
  284. package/graphs/default-loop.yaml +76 -5
  285. package/graphs/document-loop.yaml +71 -4
  286. package/graphs/implement-loop.yaml +59 -4
  287. package/graphs/journey/SCENARIOS.md +33 -0
  288. package/graphs/journey/recipes.yaml +1 -0
  289. package/graphs/journey/ta-journey.yaml +94 -0
  290. package/graphs/journey/units/author/author.yaml +20 -0
  291. package/graphs/journey/units/author/recipes.yaml +2 -0
  292. package/graphs/journey/units/author-dialogue/author-dialogue.yaml +42 -0
  293. package/graphs/journey/units/author-dialogue/observe.ts +96 -0
  294. package/graphs/journey/units/author-dialogue/recipes.yaml +10 -0
  295. package/graphs/journey/units/green/green.yaml +20 -0
  296. package/graphs/journey/units/green/recipes.yaml +2 -0
  297. package/graphs/journey/units/pr/pr.yaml +20 -0
  298. package/graphs/journey/units/pr/recipes.yaml +2 -0
  299. package/graphs/journey/units/remember/recipes.yaml +2 -0
  300. package/graphs/journey/units/remember/remember.yaml +20 -0
  301. package/graphs/operate-loop.yaml +71 -4
  302. package/graphs/overlays/stop-heal-ladder.yaml +1 -1
  303. package/graphs/release-rehearsal/recipes.yaml +1 -1
  304. package/graphs/release-rehearsal/release-rehearsal.yaml +2 -2
  305. package/graphs/research-loop.yaml +159 -4
  306. package/graphs/test-diet/test-diet.yaml +3 -0
  307. package/graphs/units/dispatch-pod/dispatch-pod.yaml +50 -0
  308. package/graphs/units/dispatch-pod/recipes.yaml +14 -0
  309. package/graphs/units/entry/entry.yaml +50 -0
  310. package/graphs/units/entry/recipes.yaml +14 -0
  311. package/graphs/units/harvest/harvest.yaml +25 -0
  312. package/graphs/units/harvest/recipes.yaml +4 -0
  313. package/graphs/units/land/land.yaml +45 -0
  314. package/graphs/units/land/recipes.yaml +3 -0
  315. package/graphs/units/recipes.yaml +7 -0
  316. package/graphs/units/recover.yaml +39 -0
  317. package/graphs/units/reflect/recipes.yaml +3 -0
  318. package/graphs/units/reflect/reflect.yaml +15 -0
  319. package/graphs/units/task-agent-recover-review.yaml +17 -0
  320. package/graphs/units/task-agent-recover-wait.yaml +17 -0
  321. package/graphs/units/verbs/make-doc.yaml +34 -0
  322. package/graphs/units/verbs/recipes.yaml +33 -0
  323. package/graphs/units/verbs/verify.yaml +55 -0
  324. package/graphs/work/recipes.yaml +2 -0
  325. package/graphs/work/research-report.yaml +28 -0
  326. package/package.json +1 -1
  327. package/scripts/ci-typecheck-changed.ts +69 -16
  328. package/scripts/coord-role-pack.ts +19 -6
  329. package/scripts/docs/generate-graph-anatomy.ts +19 -2
  330. package/scripts/graph-harvest-unit.ts +22 -0
  331. package/scripts/graph-units/journey-stub.ts +6 -0
  332. package/scripts/graph-units/land-enqueue.ts +78 -0
  333. package/scripts/graph-units/recover-plan.ts +15 -0
  334. package/scripts/graph-units/reflect-node.ts +88 -0
  335. package/scripts/graph-units/ta-journey-observe.ts +109 -0
  336. package/scripts/graph-units/verbs/headless-goal-loop.ts +152 -0
  337. package/scripts/graph-units/verbs/verify-stage.ts +75 -0
  338. package/scripts/graph-units/verbs-envelope.ts +139 -0
  339. package/scripts/hq/standby-snapshot.ts +30 -0
  340. package/scripts/public-export.ts +43 -1
  341. package/scripts/ratchets/train-side-invariants.sh +45 -0
  342. package/scripts/release-loop/auto-approve-node.ts +30 -16
  343. package/scripts/release-loop/docs-land-node.ts +21 -5
  344. package/scripts/release-loop/gate-baseline-receipt.ts +155 -0
  345. package/scripts/release-loop/gate-closure.ts +5 -1
  346. package/scripts/release-loop/gate-diff.ts +1 -1
  347. package/scripts/release-loop/gate-node.ts +675 -49
  348. package/scripts/release-loop/gate-partial.ts +68 -14
  349. package/scripts/release-loop/gate-radius-live.ts +177 -0
  350. package/scripts/release-loop/gate-radius-shadow.ts +138 -0
  351. package/scripts/release-loop/gate-traffic-mode.ts +128 -0
  352. package/scripts/release-loop/gate-triage-node.ts +5 -2
  353. package/scripts/release-loop/known-issues-0.2.33-approved.json +194 -0
  354. package/scripts/release-loop/known-issues-node.ts +77 -8
  355. package/scripts/release-loop/node-verdict.ts +12 -1
  356. package/scripts/release-loop/npm-publish-node.ts +66 -12
  357. package/scripts/release-loop/preflight.ts +93 -7
  358. package/scripts/release-loop/probe-pod-host-dirs-live.ts +5 -0
  359. package/scripts/release-loop/publish-node.ts +60 -9
  360. package/scripts/release-loop/pwa-remote.ts +166 -0
  361. package/scripts/release-loop/pwa-scenarios-node.ts +19 -3
  362. package/scripts/release-loop/resume-cap.ts +56 -0
  363. package/scripts/release-loop/resume-release.ts +155 -19
  364. package/scripts/release-loop/resume.ts +24 -1
  365. package/scripts/release-loop/tui-sim-node.ts +8 -2
  366. package/scripts/release-loop/unattended-release.ts +10 -2
  367. package/scripts/test-diet/lib.ts +6 -1
  368. package/scripts/test-diet/node.ts +194 -13
  369. package/scripts/ux-sim.ts +39 -0
  370. package/src/acp/core-turn-bridge.ts +20 -5
  371. package/src/acp/reasoning-thought-buffer.ts +45 -0
  372. package/src/agent/self-ambient-cache.ts +8 -0
  373. package/src/agent-substrate/acp-reviewer.ts +90 -15
  374. package/src/agent-substrate/pr-reviewer.ts +17 -0
  375. package/src/agent-substrate/review-finding-key.ts +53 -0
  376. package/src/agent-substrate/self-review-cli.ts +188 -18
  377. package/src/ask-user-question/pending-questions.ts +1 -1
  378. package/src/autopilot/pr-manager.ts +393 -65
  379. package/src/budget/run-usage-rollup.ts +1 -0
  380. package/src/chat/index.ts +0 -2
  381. package/src/chat/pickers/modal-runtime.ts +10 -27
  382. package/src/chat/tool-render/dispatch.ts +62 -10
  383. package/src/cli/agent-cli.ts +13 -2
  384. package/src/cli/control-cli.ts +24 -7
  385. package/src/cli/doctor-cli.ts +4 -1
  386. package/src/cli/guardian-cli.ts +10 -0
  387. package/src/cli/light-entry-route.ts +75 -0
  388. package/src/cli/llm-detect-cli.ts +23 -1
  389. package/src/cli/pod-cli.ts +77 -3
  390. package/src/cli/pr-cli.ts +81 -14
  391. package/src/cli/pr-land-base-read.ts +2 -0
  392. package/src/cli/pr-land-overlap-evidence.ts +154 -16
  393. package/src/cli/pr-land-pod-shadow-job.ts +3 -0
  394. package/src/cli/pr-land-recovery.ts +64 -0
  395. package/src/cli/pty-takeover-cli.ts +6 -5
  396. package/src/cli/release-checklist-read-cli.ts +79 -0
  397. package/src/cli/release-cli.ts +189 -132
  398. package/src/cli/release-run-if-ready.ts +29 -28
  399. package/src/cli/release-single-flight.ts +178 -0
  400. package/src/cli/remote-resolve.ts +1 -1
  401. package/src/cli/root-tui-entry.ts +48 -0
  402. package/src/cli/seat-cli.ts +37 -0
  403. package/src/cli/setup-cli.ts +40 -1
  404. package/src/cli/sim-cli.ts +22 -0
  405. package/src/cli/tasks-cli.ts +667 -14
  406. package/src/cli/usage-cli.ts +13 -11
  407. package/src/clipboard/history.ts +179 -13
  408. package/src/config.ts +8 -1
  409. package/src/control/control-status.ts +8 -3
  410. package/src/control-plane/ledger.ts +5 -3
  411. package/src/control-plane/server.ts +5 -3
  412. package/src/core-turn/short-question.ts +5 -1
  413. package/src/dashboard/chat/acp-chat.ts +8 -0
  414. package/src/dashboard/index.ts +114 -77
  415. package/src/dashboard/input/chat-main-plain-turn-runtime.ts +3 -0
  416. package/src/dashboard/input/dashboard-plain-turn-stream.ts +4 -0
  417. package/src/dashboard/input/seat-autowake.ts +56 -3
  418. package/src/dashboard/render/theme-resolver.ts +33 -4
  419. package/src/dashboard/seat-boot-preamble.ts +1 -1
  420. package/src/dashboard/slash-runtime/ask-clarification.ts +48 -0
  421. package/src/dashboard/slash-runtime/dashboard-delegated-slashes.ts +68 -0
  422. package/src/dashboard/slash-runtime/dashboard-handlers.ts +62 -322
  423. package/src/dashboard/slash-runtime/dashboard-log-slash.ts +208 -0
  424. package/src/dashboard/turn-preamble.ts +47 -1
  425. package/src/dashboard/turn-stream-formatter.ts +34 -1
  426. package/src/dashboard/turn-stream-runtime.ts +2 -0
  427. package/src/dashboard/turn-typeahead-prompt-zone.ts +67 -0
  428. package/src/domains/guardian-tick.ts +54 -2
  429. package/src/domains/outbound-alert.ts +3 -2
  430. package/src/domains/schedule-registry.ts +16 -2
  431. package/src/extractors.ts +3 -1
  432. package/src/git-fs/idle-refresh.ts +76 -0
  433. package/src/git-fs/index.ts +18 -7
  434. package/src/git-fs/retry.ts +4 -0
  435. package/src/git-fs/runner.ts +2 -0
  436. package/src/git-fs/worktree.ts +42 -4
  437. package/src/graph-kinds/registry.ts +2 -2
  438. package/src/graph-runner/runner.ts +267 -54
  439. package/src/grok/credential.ts +15 -3
  440. package/src/harness/harness-cli-command.ts +151 -38
  441. package/src/harness/harness-incidents.ts +37 -0
  442. package/src/harness/harness-pod-dispatch.ts +38 -1
  443. package/src/harness/harness-salvage-cli.ts +14 -2
  444. package/src/harness/launch-utterance-ledger.ts +208 -0
  445. package/src/impl-discipline/detector.ts +16 -4
  446. package/src/impl-discipline/system-prompt.ts +11 -0
  447. package/src/impl-discipline/types.ts +2 -2
  448. package/src/index.ts +683 -146
  449. package/src/intake-plane/already-built-hint.ts +91 -0
  450. package/src/intake-plane/requirement-funnel.ts +29 -1
  451. package/src/knowhow/pack.ts +199 -0
  452. package/src/light-cli.ts +111 -0
  453. package/src/llm/opengateway-models.ts +11 -0
  454. package/src/llm/provider-credentials.ts +14 -0
  455. package/src/llm/provider-detect.ts +8 -1
  456. package/src/llm/runtime-model-family.ts +2 -1
  457. package/src/llm.ts +268 -65
  458. package/src/loops/budget.ts +95 -0
  459. package/src/loops/msg-wake.ts +8 -2
  460. package/src/loops/orchestrator/traffic.ts +132 -1
  461. package/src/model-tier/llm-tier-map.ts +15 -1
  462. package/src/mss/logging/log-store.ts +4 -5
  463. package/src/native-tool-catalog.ts +15 -1
  464. package/src/nexus/api/graphs-api.ts +22 -3
  465. package/src/nexus/api/http-server.ts +1 -1
  466. package/src/nexus/api/loop-resources.ts +13 -1
  467. package/src/nexus/api/ops-api.ts +12 -0
  468. package/src/oauth/claude-pty-maturity.ts +66 -0
  469. package/src/oauth/codex-access-mirror.ts +55 -0
  470. package/src/oauth/codex.ts +7 -0
  471. package/src/oauth/fallback-chain.ts +1 -1
  472. package/src/onboarding/first-run.ts +5 -3
  473. package/src/onboarding/non-interactive.ts +64 -13
  474. package/src/onboarding.ts +10 -2
  475. package/src/ops/overview-collect.ts +54 -4
  476. package/src/ops/overview.ts +31 -7
  477. package/src/pr-tool/census.ts +282 -30
  478. package/src/pr-tool/inflight-registry.ts +160 -7
  479. package/src/prompt-library/gpt6-family-addendum.ts +14 -1
  480. package/src/pty-shell/herdr-agent-report.ts +442 -0
  481. package/src/pty-shell/pty-control-ipc.ts +5 -5
  482. package/src/pty-shell/pty-manifest.ts +7 -0
  483. package/src/pty-shell/pty-write-outcome.ts +24 -6
  484. package/src/pty-shell/tui-run-state.ts +117 -3
  485. package/src/release-loop/checklist.ts +103 -5
  486. package/src/release-loop/feature-store.ts +19 -2
  487. package/src/release-loop/landed-but-yellow.ts +129 -5
  488. package/src/release-loop/light-rc.ts +1 -0
  489. package/src/release-loop/placement.ts +10 -3
  490. package/src/release-loop/rehearsal.ts +205 -25
  491. package/src/release-loop/rubric.ts +16 -2
  492. package/src/repl/index.ts +174 -17
  493. package/src/repl/ops-msg-bridge.ts +32 -0
  494. package/src/self-dev/ask-launch-flow.ts +44 -5
  495. package/src/self-dev/cli-help-text.ts +17 -0
  496. package/src/self-dev/dev-cli.ts +11 -9
  497. package/src/self-dev/draft-residue.ts +37 -1
  498. package/src/self-dev/draft-sweep.ts +188 -13
  499. package/src/self-dev/draft-triage-rules.ts +107 -0
  500. package/src/self-dev/fleet-reduce.ts +3 -2
  501. package/src/self-dev/graph-front-nodes.ts +112 -0
  502. package/src/self-dev/graph-journey-nodes.ts +11 -6
  503. package/src/self-dev/graph-journey-route.ts +60 -6
  504. package/src/self-dev/harness-run-cli.ts +3 -15
  505. package/src/self-dev/orchestrate-cli-text.ts +10 -0
  506. package/src/self-dev/orchestrate.ts +79 -3
  507. package/src/self-dev/review-provider-fallback.ts +35 -1
  508. package/src/self-dev/run-supervisor.ts +107 -12
  509. package/src/self-dev/run-types.ts +5 -1
  510. package/src/self-dev/self-orchestrate-runtime.ts +1 -11
  511. package/src/self-dev/shard-aggregate.ts +42 -5
  512. package/src/self-dev/shard-run.ts +8 -1
  513. package/src/self-implement/blocked-draft-policy.ts +20 -0
  514. package/src/self-implement/classify-shadow.ts +3 -7
  515. package/src/self-implement/doctor-visit.ts +18 -1
  516. package/src/self-implement/gate-baseline.ts +95 -12
  517. package/src/self-implement/gate-cli.ts +1 -0
  518. package/src/self-implement/gate-remote.ts +40 -25
  519. package/src/self-implement/goal-author-decompose.ts +275 -47
  520. package/src/self-implement/goal-author-identity.ts +66 -0
  521. package/src/self-implement/goal-author-preservation-obligation.ts +35 -0
  522. package/src/self-implement/goal-author.ts +254 -120
  523. package/src/self-implement/goal-elaborate.ts +295 -0
  524. package/src/self-implement/goal-refine.ts +270 -0
  525. package/src/self-implement/graph-overlay-yaml.ts +28 -2
  526. package/src/self-implement/graph-unit-flatten.ts +103 -0
  527. package/src/self-implement/graph-unit-resolver.ts +107 -0
  528. package/src/self-implement/graph-yaml.ts +151 -1
  529. package/src/self-implement/headless-elanous-driver.ts +1 -0
  530. package/src/self-implement/knowhow-pack.ts +103 -0
  531. package/src/self-implement/orchestrator.ts +160 -45
  532. package/src/self-implement/pod-warm-pool-profile.ts +45 -0
  533. package/src/self-implement/review-mustfix-class.ts +203 -0
  534. package/src/self-implement/rework-budget-judgment.ts +5 -8
  535. package/src/self-implement/run-stop.ts +17 -2
  536. package/src/self-implement/running-runs.ts +29 -1
  537. package/src/self-implement/scope-adjacency.ts +113 -0
  538. package/src/self-implement/seams.ts +138 -4
  539. package/src/self-implement/stop-autoheal.ts +112 -2
  540. package/src/session/chat.ts +27 -0
  541. package/src/session-runtime/index.ts +1 -1
  542. package/src/session-runtime/retry-policy.ts +2 -1
  543. package/src/setup/llm-env-detect.ts +5 -0
  544. package/src/skills/tools/agent.ts +140 -14
  545. package/src/skills/tools/msg-ask.ts +100 -0
  546. package/src/skills/tools/ops-ledger.ts +2 -1
  547. package/src/skills/tools/schedule-wakeup.ts +66 -17
  548. package/src/steward/hold-hygiene.ts +24 -6
  549. package/src/steward/release-day.ts +7 -3
  550. package/src/steward/triage-budget.ts +194 -0
  551. package/src/steward/triage.ts +57 -7
  552. package/src/task-agent/actions.ts +69 -1
  553. package/src/task-agent/green-sweep.ts +4 -0
  554. package/src/task-agent/harvest-unit.ts +141 -0
  555. package/src/task-agent/live-moves.ts +257 -15
  556. package/src/task-agent/parent-host.ts +216 -6
  557. package/src/task-agent/postland-card.ts +80 -1
  558. package/src/task-agent/rejudge-on-head.ts +112 -26
  559. package/src/task-agent/repair-branch-cas.ts +4 -1
  560. package/src/task-agent/repair-cycle.ts +16 -3
  561. package/src/task-agent/run-identity.ts +4 -3
  562. package/src/task-agent/shadow.ts +19 -3
  563. package/src/task-agent/task-hand.ts +96 -36
  564. package/src/task-agent/tier-split.ts +127 -0
  565. package/src/task-agent/work-order-build.ts +24 -0
  566. package/src/task-agent/work-order.ts +3 -2
  567. package/src/task-orchestrator/generator-prompt.ts +60 -11
  568. package/src/task-orchestrator/surfaces/pod-account-broker.ts +72 -3
  569. package/src/task-orchestrator/surfaces/pod-child-providers.ts +1 -1
  570. package/src/task-orchestrator/surfaces/pod-command-job.ts +47 -8
  571. package/src/task-orchestrator/surfaces/pod-image-source.ts +89 -1
  572. package/src/task-orchestrator/surfaces/pod-lease.ts +17 -8
  573. package/src/task-orchestrator/surfaces/pod-lifecycle-stages.ts +86 -8
  574. package/src/task-orchestrator/surfaces/pod-manifest-test-normalize.ts +8 -2
  575. package/src/task-orchestrator/surfaces/pod-pool.ts +73 -17
  576. package/src/task-orchestrator/surfaces/pod-provenance.ts +76 -0
  577. package/src/task-orchestrator/surfaces/pod-source-receive.ts +72 -4
  578. package/src/task-orchestrator/surfaces/pod-warm-provenance.ts +81 -0
  579. package/src/task-orchestrator/surfaces/pod-warm-worker-pod.ts +32 -5
  580. package/src/task-orchestrator/surfaces/pod-warm-worker-protocol.ts +3 -0
  581. package/src/task-orchestrator/surfaces/pod-warm-worker-provider.ts +421 -0
  582. package/src/task-orchestrator/surfaces/pod-warm-worker-runtime.ts +2 -1
  583. package/src/task-orchestrator/surfaces/self-implement-pod.ts +588 -71
  584. package/src/task-orchestrator/surfaces/self-implement.ts +106 -2
  585. package/src/tool-runtime/ops-ledger-runtimes.ts +10 -2
  586. package/src/tool-runtime/truncation-store.ts +4 -0
  587. package/src/tui/README.md +2 -0
  588. package/src/tui/chat/background-job-status.ts +54 -0
  589. package/src/tui/chat/log-view.ts +80 -0
  590. package/src/tui/entry.ts +406 -0
  591. package/src/tui/input/composer.ts +144 -0
  592. package/src/tui/seat-mail-boot.ts +59 -0
  593. package/src/tui/slash/compact.ts +100 -0
  594. package/src/tui/slash/new-session.ts +35 -0
  595. package/src/tui-client/dashboard-session.ts +10 -1
  596. package/src/tui-client/local-chat-turn.ts +239 -0
  597. package/src/tui-client/local-harness-command.ts +63 -0
  598. package/src/tui-client/local-provider-command.ts +184 -0
  599. package/src/user-config/coercion.ts +36 -0
  600. package/src/user-config.ts +22 -43
  601. package/src/ux-sim/event-monkey.ts +378 -0
  602. package/src/ux-sim/fake-bin.ts +42 -7
  603. package/src/ux-sim/fault-nextmove-dispatch.ts +266 -0
  604. package/src/ux-sim/fault-pod-codex-503.ts +211 -0
  605. package/src/ux-sim/fault-scope-escape-lift.ts +189 -0
  606. package/src/ux-sim/scenario.ts +72 -13
  607. package/src/version/packed-revision.json +1 -1
  608. package/apps/pwa/out/_next/static/chunks/1034-8b639cee57b8e4a8.js +0 -1
  609. package/apps/pwa/out/_next/static/chunks/1085-6c2d35526f11f840.js +0 -1
  610. package/apps/pwa/out/_next/static/chunks/1220.1ff7d5cdc34b1ae5.js +0 -27
  611. package/apps/pwa/out/_next/static/chunks/1247.5884ec81b39fe2e7.js +0 -287
  612. package/apps/pwa/out/_next/static/chunks/1302.87681521a7a4661e.js +0 -62
  613. package/apps/pwa/out/_next/static/chunks/1324-59dae3002413623b.js +0 -1
  614. package/apps/pwa/out/_next/static/chunks/1343-f40b5870ac1eda5a.js +0 -1
  615. package/apps/pwa/out/_next/static/chunks/146-b6cd56be11dda017.js +0 -1
  616. package/apps/pwa/out/_next/static/chunks/1654.32de4b324981a188.js +0 -23
  617. package/apps/pwa/out/_next/static/chunks/1834-98b64172bc1efe77.js +0 -1
  618. package/apps/pwa/out/_next/static/chunks/1849.1ce38efa6c527d9a.js +0 -149
  619. package/apps/pwa/out/_next/static/chunks/1913.7cc6fb6055b1ed3f.js +0 -41
  620. package/apps/pwa/out/_next/static/chunks/2030.41fae98c7e907304.js +0 -1
  621. package/apps/pwa/out/_next/static/chunks/2099-08b2f2dfba742c9b.js +0 -1
  622. package/apps/pwa/out/_next/static/chunks/2112-e4efc21a6505d5bc.js +0 -1
  623. package/apps/pwa/out/_next/static/chunks/2134.ecee03a550ee7250.js +0 -1
  624. package/apps/pwa/out/_next/static/chunks/2236.66061832181cb745.js +0 -1
  625. package/apps/pwa/out/_next/static/chunks/2422.b0bd272e7020d7e6.js +0 -1
  626. package/apps/pwa/out/_next/static/chunks/2534.e85ae21ad0dac829.js +0 -1
  627. package/apps/pwa/out/_next/static/chunks/2898.fd781bc7cf01a7b7.js +0 -1
  628. package/apps/pwa/out/_next/static/chunks/3040.92ff9ffc9f971cb9.js +0 -115
  629. package/apps/pwa/out/_next/static/chunks/3144.6861096c7b4edef7.js +0 -64
  630. package/apps/pwa/out/_next/static/chunks/3541-ce3a5424ed5ad7f1.js +0 -1
  631. package/apps/pwa/out/_next/static/chunks/3583.a05e88cc8d594628.js +0 -1
  632. package/apps/pwa/out/_next/static/chunks/3771.e928edf2867d28c0.js +0 -1
  633. package/apps/pwa/out/_next/static/chunks/4063-03284b5de59965f3.js +0 -1
  634. package/apps/pwa/out/_next/static/chunks/4300-c7ec4eeabbb5f3f7.js +0 -1
  635. package/apps/pwa/out/_next/static/chunks/4483.646d5065199e1b55.js +0 -36
  636. package/apps/pwa/out/_next/static/chunks/4519.28199ff26b2fd80d.js +0 -1
  637. package/apps/pwa/out/_next/static/chunks/4581.ef2443578054544f.js +0 -1
  638. package/apps/pwa/out/_next/static/chunks/4608-8d894e9cbe4f08bf.js +0 -1
  639. package/apps/pwa/out/_next/static/chunks/4639.ae48a01d1bb50a93.js +0 -286
  640. package/apps/pwa/out/_next/static/chunks/4739.08742ac668aada67.js +0 -77
  641. package/apps/pwa/out/_next/static/chunks/4745.67d6f99c245af3f7.js +0 -226
  642. package/apps/pwa/out/_next/static/chunks/4882-16cef71d6a1a32be.js +0 -1
  643. package/apps/pwa/out/_next/static/chunks/4999.c064a4000c2a9e94.js +0 -79
  644. package/apps/pwa/out/_next/static/chunks/5260-69f35419bca263e7.js +0 -1
  645. package/apps/pwa/out/_next/static/chunks/5272.b92d1b72a15c25fe.js +0 -1
  646. package/apps/pwa/out/_next/static/chunks/5304.04d24756f242a094.js +0 -148
  647. package/apps/pwa/out/_next/static/chunks/5415-997980f828667736.js +0 -1
  648. package/apps/pwa/out/_next/static/chunks/5458-16cd7a2b51b74c8c.js +0 -1
  649. package/apps/pwa/out/_next/static/chunks/5543.a438b8ab5a13ea47.js +0 -1
  650. package/apps/pwa/out/_next/static/chunks/5572-42c9084f27ca761e.js +0 -1
  651. package/apps/pwa/out/_next/static/chunks/5661-80470aac963d9f36.js +0 -1
  652. package/apps/pwa/out/_next/static/chunks/5723.421338408b5c30c4.js +0 -74
  653. package/apps/pwa/out/_next/static/chunks/5809.64c3664267c50bce.js +0 -1
  654. package/apps/pwa/out/_next/static/chunks/6000.64bc21ac8627f2f5.js +0 -94
  655. package/apps/pwa/out/_next/static/chunks/6013.39459b9c68eabf5f.js +0 -1
  656. package/apps/pwa/out/_next/static/chunks/607-06466dff012b03ef.js +0 -1
  657. package/apps/pwa/out/_next/static/chunks/6192.a190b989b81e9743.js +0 -1
  658. package/apps/pwa/out/_next/static/chunks/6323.8672b4817a306928.js +0 -1
  659. package/apps/pwa/out/_next/static/chunks/6444.7d1fdcb9b09ae71c.js +0 -1
  660. package/apps/pwa/out/_next/static/chunks/6517.4147878ac06d584d.js +0 -90
  661. package/apps/pwa/out/_next/static/chunks/6532.e34302010b2f0b68.js +0 -32
  662. package/apps/pwa/out/_next/static/chunks/6546.74bc4ed82f19016d.js +0 -104
  663. package/apps/pwa/out/_next/static/chunks/6684-e7523ce7c2fad075.js +0 -1
  664. package/apps/pwa/out/_next/static/chunks/6726.ebdc82feb161431e.js +0 -1
  665. package/apps/pwa/out/_next/static/chunks/6739.00fb6f892e5e392b.js +0 -1
  666. package/apps/pwa/out/_next/static/chunks/6745.934c4921bf15513a.js +0 -1
  667. package/apps/pwa/out/_next/static/chunks/6767.ea607cf0c20a25af.js +0 -24
  668. package/apps/pwa/out/_next/static/chunks/6843.67bfd020da0926c5.js +0 -93
  669. package/apps/pwa/out/_next/static/chunks/6948.1062d4594652b5bf.js +0 -1
  670. package/apps/pwa/out/_next/static/chunks/7138-eaf841fc1dc03463.js +0 -1
  671. package/apps/pwa/out/_next/static/chunks/7174-cda29ee13d7790e7.js +0 -1
  672. package/apps/pwa/out/_next/static/chunks/7304-3c07583f4e405f4f.js +0 -1
  673. package/apps/pwa/out/_next/static/chunks/7557.e325503a090a4310.js +0 -8
  674. package/apps/pwa/out/_next/static/chunks/7569-9ce9432c7f10989f.js +0 -1
  675. package/apps/pwa/out/_next/static/chunks/7886-55854585fadeded1.js +0 -1
  676. package/apps/pwa/out/_next/static/chunks/8097-9530c03bcc550f02.js +0 -1
  677. package/apps/pwa/out/_next/static/chunks/8215-1661812b6e9ad71f.js +0 -1
  678. package/apps/pwa/out/_next/static/chunks/8260-19c921a51ca8ec3e.js +0 -1
  679. package/apps/pwa/out/_next/static/chunks/8440.3a5cf5c85aa76db8.js +0 -1
  680. package/apps/pwa/out/_next/static/chunks/8519-4599be2249161e68.js +0 -1
  681. package/apps/pwa/out/_next/static/chunks/8547.b028b90c5c01ace6.js +0 -1
  682. package/apps/pwa/out/_next/static/chunks/8587-cbe02a953a7f4990.js +0 -1
  683. package/apps/pwa/out/_next/static/chunks/877-2b977259c4b15655.js +0 -1
  684. package/apps/pwa/out/_next/static/chunks/9002.e5658224e3dc1b6f.js +0 -24
  685. package/apps/pwa/out/_next/static/chunks/9019-0a4b40c50c7314fb.js +0 -1
  686. package/apps/pwa/out/_next/static/chunks/9138.b6e80031afb1d973.js +0 -1
  687. package/apps/pwa/out/_next/static/chunks/9188-d36e4fc869ddc166.js +0 -1
  688. package/apps/pwa/out/_next/static/chunks/9230.44f5039e796e4ab4.js +0 -1
  689. package/apps/pwa/out/_next/static/chunks/9279-d28c5b7754d010ae.js +0 -1
  690. package/apps/pwa/out/_next/static/chunks/939.336acce73e98482c.js +0 -1
  691. package/apps/pwa/out/_next/static/chunks/9407.e49124dedf0f5e72.js +0 -1
  692. package/apps/pwa/out/_next/static/chunks/9610.c07cce4bfcc14ed7.js +0 -1
  693. package/apps/pwa/out/_next/static/chunks/9667-ce78c2ce91050ff9.js +0 -1
  694. package/apps/pwa/out/_next/static/chunks/9989.3694300e5f000b14.js +0 -1
  695. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-339fabb3499da0e1.js +0 -1
  696. package/apps/pwa/out/_next/static/chunks/app/approvals/page-504204b58c82c253.js +0 -1
  697. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-a9717a67c2eecbaf.js +0 -1
  698. package/apps/pwa/out/_next/static/chunks/app/board/page-5c9ec30aee62dfbf.js +0 -1
  699. package/apps/pwa/out/_next/static/chunks/app/botlab/page-584191533721fa16.js +0 -1
  700. package/apps/pwa/out/_next/static/chunks/app/bots/page-73c4b4bb3ac7ab5f.js +0 -1
  701. package/apps/pwa/out/_next/static/chunks/app/ceo/page-c0f1ca371f710b06.js +0 -1
  702. package/apps/pwa/out/_next/static/chunks/app/chat/page-46430d45a9e04eac.js +0 -1
  703. package/apps/pwa/out/_next/static/chunks/app/consult/page-3b2ebf1dc64ff0be.js +0 -1
  704. package/apps/pwa/out/_next/static/chunks/app/decisions/page-25654b82094f7d22.js +0 -1
  705. package/apps/pwa/out/_next/static/chunks/app/design-check/page-8ea49a4c6dd2c6e7.js +0 -1
  706. package/apps/pwa/out/_next/static/chunks/app/editor/page-ce5113aefea0a8d1.js +0 -1
  707. package/apps/pwa/out/_next/static/chunks/app/exec/page-0e5a41fac1c75396.js +0 -1
  708. package/apps/pwa/out/_next/static/chunks/app/field/page-31aaf1ed37c6df9a.js +0 -1
  709. package/apps/pwa/out/_next/static/chunks/app/healthz/route-339fabb3499da0e1.js +0 -1
  710. package/apps/pwa/out/_next/static/chunks/app/inside/page-3dcc1fa411e1f4e0.js +0 -1
  711. package/apps/pwa/out/_next/static/chunks/app/intake/page-c69247e7134d329d.js +0 -1
  712. package/apps/pwa/out/_next/static/chunks/app/layout-66dc5cd3a0999abe.js +0 -1
  713. package/apps/pwa/out/_next/static/chunks/app/live/page-26ff7ff651a7217d.js +0 -1
  714. package/apps/pwa/out/_next/static/chunks/app/live-run/page-617b3976981efa96.js +0 -1
  715. package/apps/pwa/out/_next/static/chunks/app/loops/page-d256f5d5d9552823.js +0 -1
  716. package/apps/pwa/out/_next/static/chunks/app/market/page-ce8f1907b8a6101c.js +0 -1
  717. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-33e182a316263116.js +0 -1
  718. package/apps/pwa/out/_next/static/chunks/app/not-found-7607cca9b84950c6.js +0 -1
  719. package/apps/pwa/out/_next/static/chunks/app/observatory/page-eeab86176b03dc3b.js +0 -1
  720. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-5b93dbae3432b996.js +0 -1
  721. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-77a6cb90a9cf2b10.js +0 -1
  722. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-f47e768b5b242b5a.js +0 -1
  723. package/apps/pwa/out/_next/static/chunks/app/outputs/page-eb41aa3367fc2505.js +0 -1
  724. package/apps/pwa/out/_next/static/chunks/app/page-4d13ab0b8a267e3f.js +0 -1
  725. package/apps/pwa/out/_next/static/chunks/app/reflection/page-84dad32ff0fc0831.js +0 -1
  726. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-95306f892aa2d0ee.js +0 -1
  727. package/apps/pwa/out/_next/static/chunks/app/sessions/page-940fb6c217f6b470.js +0 -1
  728. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-8c66a3b24a745630.js +0 -1
  729. package/apps/pwa/out/_next/static/chunks/app/settings/page-7b675dfd35c36fc9.js +0 -1
  730. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-8bd0d3cf7665bcfc.js +0 -1
  731. package/apps/pwa/out/_next/static/chunks/app/setup/layout-339fabb3499da0e1.js +0 -1
  732. package/apps/pwa/out/_next/static/chunks/app/setup/page-c219f2ed171131be.js +0 -1
  733. package/apps/pwa/out/_next/static/chunks/app/share/page-40f8fa21bdae955b.js +0 -1
  734. package/apps/pwa/out/_next/static/chunks/app/showroom/page-468f8313e4f1fbd9.js +0 -1
  735. package/apps/pwa/out/_next/static/chunks/app/tasks/page-7bbb8fa353a246c4.js +0 -1
  736. package/apps/pwa/out/_next/static/chunks/app/today/page-4214b855d9233ea8.js +0 -1
  737. package/apps/pwa/out/_next/static/chunks/app/trace/page-936752c7aa58762e.js +0 -1
  738. package/apps/pwa/out/_next/static/chunks/app/vault/page-ec052ad359df1797.js +0 -1
  739. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-8305570551091338.js +0 -1
  740. package/apps/pwa/out/_next/static/chunks/app/workflows/page-fad650e4793adb65.js +0 -1
  741. package/apps/pwa/out/_next/static/chunks/app/workspace/page-d90e64743826e1d8.js +0 -1
  742. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-a16bcfd49af86a32.js +0 -1
  743. package/apps/pwa/out/_next/static/chunks/e5012ffe.f727e23c231f4342.js +0 -122
  744. package/apps/pwa/out/_next/static/chunks/ea695e3c-1f1d70d740cf3031.js +0 -1
  745. package/apps/pwa/out/_next/static/chunks/ebc7d829.264a0bcb6c750b50.js +0 -1
  746. package/apps/pwa/out/_next/static/chunks/framework-906af9bd029e166c.js +0 -1
  747. package/apps/pwa/out/_next/static/chunks/main-a24847f9f684d469.js +0 -1
  748. package/apps/pwa/out/_next/static/chunks/main-app-7bdcd8aa7c8397d3.js +0 -1
  749. package/apps/pwa/out/_next/static/chunks/pages/_app-6ba46a5066fc226d.js +0 -1
  750. package/apps/pwa/out/_next/static/chunks/pages/_error-a8dc6d07591f2a25.js +0 -1
  751. package/apps/pwa/out/_next/static/chunks/webpack-f13df28c15c55eee.js +0 -1
  752. package/src/cli/g6a-registration-probe.ts +0 -16
  753. /package/apps/pwa/out/_next/static/{IVKr3AlRUVLKsw2fh7eXF → T1mBQqmkwKDLGtyisDCOd}/_ssgManifest.js +0 -0
package/src/index.ts CHANGED
@@ -1,23 +1,13 @@
1
1
  #!/usr/bin/env bun
2
2
  // cron/launchd 최소 PATH 에서도 내부 gh/git subprocess 를 찾도록 PATH 를 먼저 보강(무음실패 근본·2026-07-25).
3
3
  import './ensure-bin-path.js';
4
+ import './instance/resolve.js';
4
5
  import { WORKFLOW_NODE_VARIANT_KEYS } from './workflow-runtime/schema.js';
5
6
  import { accessSync, constants as fsConstants, existsSync, lstatSync, readFileSync, readlinkSync, realpathSync, statSync } from 'node:fs';
6
7
  import type { SelfDevRunParticipant, SelfDevRunState } from './self-dev/run-store.js';
7
8
  import { applyConfigDirFlagFromArgv } from './cli/config-dir-flag.js';
8
9
  import { LOGS_SINCE_OPTION, registerLogsCommands } from './cli/logs-cli.js';
9
- import { registerSimCommands } from './cli/sim-cli.js';
10
- import { registerDocsCommands } from './cli/docs-cli.js';
11
- import { registerBenchCommands } from './cli/bench-cli.js';
12
- import { registerRetroCommands } from './cli/retro-cli.js';
13
- import { registerMemoryCommands } from './cli/memory-cli.js';
14
- import { registerA2ACommands } from './cli/a2a-cli.js';
15
- import { registerPluginCommands } from './cli/plugin-cli.js';
16
- import { registerMakeCommand } from './cli/make-cli.js';
17
- import { registerConnectCommand, registerSkillsCommands } from './cli/skills-cli.js';
18
- import { registerImportCommand } from './cli/import-cli.js';
19
- import { registerPersonaCommands } from './cli/persona-cli.js';
20
- import { registerFleetCommands } from './cli/fleet-cli.js';
10
+
21
11
  import { readPipedStdin } from './cli/piped-stdin.js';
22
12
  import { writeStdoutJson } from './cli/stdout-json.js';
23
13
  import { writeStdoutFully } from './cli/stdout-flush.js';
@@ -29,78 +19,26 @@ import { ensureRunIdentity, getHarnessSpace, normalizeSpaceId } from './harness/
29
19
  // ⇒ «정적» import 로 올린다. 이 모듈은 부작용이 없어 부팅 비용이 사실상 0 이다.
30
20
  import { installDevCompletionGuard } from './self-dev/dev-completion-guard.js';
31
21
  import { formatOrchestrateResultLine } from './self-dev/orchestrate-summary-line.js';
32
- import { buildOrchestrateDecomposePrepareArgs, normalizeOrchestrateRequest, splitOrchestrateGoalTexts } from './self-dev/self-orchestrate-runtime.js';
22
+ import { normalizeOrchestrateRequest, splitOrchestrateGoalTexts } from './self-dev/orchestrate-cli-text.js';
23
+ import { DEV_PLAN_REPLACEMENT, formatDevPlanOptionHelp, HARNESS_RUN_DEPRECATION_HELP } from './self-dev/cli-help-text.js';
33
24
  import { CLI_ENTRANCE_BASELINE, evaluateCommandEntranceBaseline } from './self-dev/entrance-baseline.js';
34
25
  import { CLI_HARNESS_DOGFOOD_ENTRANCE, CLI_HARNESS_ORCHESTRATE_ENTRANCE, describeEntranceCommand, listEntrancesWithModelExposure, renderLaunchEntrances, summarizeEntrances, type EntranceId } from './self-dev/entrance-registry.js';
35
26
  import { isOldDoorInternalCall, refuseOldDoor } from './self-dev/old-door.js';
36
27
  import { collectCommandEntrances, renderCommandEntrances } from './self-dev/entrance-inventory.js';
37
28
  import { isGoalAuthorFileName } from './self-implement/goal-document.js';
38
29
  import { DEV_PIPELINE_SINK_SURFACE } from './self-implement/self-cli-sink-surface.js';
39
- import { registerPrivateLedgerCommands } from './cli/private-ledger-commands.js';
40
- import { registerKnowCommand } from './cli/know-cli.js';
41
- import { registerSeatRequestsCommands } from './cli/seat-requests-cli.js';
42
- import { registerSeatBootCommands } from './cli/seat-cli.js';
30
+
43
31
  import { applyTestStateDirFlagFromArgv } from './cli/test-state-dir-flag.js';
44
32
  import { applyTestFlagFromArgv, observeTestFlagOwnership, uncoveredTestFlagPaths, staleTestFlagPaths } from './cli/test-flag.js';
45
- import { registerPtyTakeoverCommands } from './cli/pty-takeover-cli.js';
46
- import { registerPtyRecordCommand } from './cli/pty-record-cli.js';
47
- import { registerLeaderCommands } from './cli/leader-cli.js';
48
- import { registerPrCommands } from './cli/pr-cli.js';
49
- import { registerRepoCommands } from './cli/repo-cli.js';
50
- import { registerAgentCommands, runChatTurnCli, emitDetachedProgress } from './cli/agent-cli.js';
51
- export { runChatTurnCli, buildCliAgentTools, setCliAgentDispatchForTesting, emitDetachedProgress, emitHarnessFeedbackProgress } from './cli/agent-cli.js';
52
- import { registerOpsCommands } from './cli/ops-cli.js';
53
- import { registerOutputsCommands } from './cli/outputs-cli.js';
54
- import { registerPublishCommands } from './cli/publish-cli.js';
55
- import { registerAutopilotCommands } from './cli/autopilot-cli.js';
56
- import { registerRoleCommands } from './cli/role-cli.js';
57
- import { registerMachineCommands } from './cli/machine-cli.js';
33
+
58
34
  import { recordImagePinFromConfigSet, registerImageCommands } from './cli/image-cli.js';
59
- import { registerAgentEnvCommands } from './cli/agent-env-cli.js';
60
- import { registerScheduleCommands } from './cli/schedule-cli.js';
61
- import { registerGuardianCommands } from './cli/guardian-cli.js';
35
+
62
36
  export { runSchedule, scheduleCreatePlan } from './cli/schedule-cli.js';
63
37
  export type { ScheduleDispatch } from './cli/schedule-cli.js';
64
38
  import { registerReviewLoopOptions, buildReviewLoopOpts } from './agent-mission/review-loop-cli.js';
65
- import { registerCapabilitiesCommand } from './agent-mission/capabilities-cli.js';
66
- import { registerSupervisorMetricsCommand } from './agent-mission/supervisor-metrics-cli.js';
67
- import { agentBackendNames } from './agent-mission/driver.js';
68
- import { registerWhereCommand } from './cli/where-cli.js';
69
- import { registerShadowCommand } from './cli/shadow-cli.js';
70
- import { registerLlmDetectCommand } from './cli/llm-detect-cli.js';
71
- import { registerStorageDetectCommand } from './cli/storage-cli.js';
72
- import { registerPodCommands } from './cli/pod-cli.js';
73
- import { registerBrowserAnnotateCommand } from './cli/browser-annotate-cli.js';
74
- import { registerPendingQuestionsCommand } from './cli/pending-questions-cli.js';
75
- import { registerUsageCommand } from './cli/usage-cli.js';
76
- import { registerUsageDailyCommand } from './cli/usage-daily-cli.js';
77
- import { registerLiveCommands } from './cli/live-cli.js';
78
- import { registerResearchCommand } from './cli/research-cli.js';
79
- import { registerReleaseCommands } from './cli/release-cli.js';
80
- import { registerFreezeCommands } from './cli/freeze-cli.js';
81
- import { registerFlowCommands } from './cli/flow-cli.js';
82
- import { registerModelWatchCommand } from './cli/model-watch-cli.js';
83
- import { registerIntakeCommands } from './cli/intake-cli.js';
84
- import { registerTasksCommands } from './cli/tasks-cli.js';
85
- import { registerBriefCommands } from './cli/brief-cli.js';
86
- import { registerNotifyCommand } from './cli/notify-cli.js';
87
- import { registerAwayCommand } from './cli/away-cli.js';
88
- import { registerLabelsCommands } from './cli/labels-cli.js';
89
- import { registerMsgCommands } from './cli/msg-cli.js';
90
- import { registerDoctorCommand } from './cli/doctor-cli.js';
91
- import { registerProviderCommands } from './cli/provider-cli.js';
39
+
92
40
  export { buildCodexAccountImportGuidance, setCodexAccountLogSinkModuleForTesting } from './cli/provider-cli.js';
93
- import { registerControlCommands } from './cli/control-cli.js';
94
- import { registerHooksCommands } from './cli/hooks-cli.js';
95
- import { registerSetupCommand } from './cli/setup-cli.js';
96
- import { registerStartCommand } from './cli/start-cli.js';
97
- import { registerGroundingSourcesCli } from './grounding/sources-cli.js';
98
- import { registerGraphCommands } from './graph-runner/graph-cli.js';
99
- import { registerLoopCommands } from './loops/loop-cli.js';
100
- import { registerResourceCommands } from './cli/resource-cli.js';
101
- import { registerHqMovePlanCommand } from './hq/hq.js';
102
- import { registerCardCommand } from './task-cards/card-cli.js';
103
- import { registerLaunchHeadCommands } from './launch-head/launch-head-cli.js';
41
+
104
42
  import { acpServerHelpText } from './boot/acp-server-help.js';
105
43
  // IMPORTANT: parse `--config-dir <dir>` + `--test-state-dir <dir>`
106
44
  // BEFORE Commander loads — the resolvers are read at module-init
@@ -118,54 +56,310 @@ applyTestFlagFromArgv();
118
56
  // test-instance default so scoped storage commands stay inside that directory.
119
57
  applyConfigDirFlagFromArgv();
120
58
 
59
+ // Only unambiguous root commands take the small registrar path. Root help,
60
+ // unknown commands and unrecognized global flags keep the complete tree.
61
+ const INDEX_FAST_ROOTS = new Set(['a2a', 'agent-env', 'away', 'bench', 'brief', 'card', 'connect', 'control', 'docs', 'doctor', 'fleet', 'flow', 'freeze', 'graph', 'guardian', 'import', 'intake', 'know', 'labels', 'launch-head', 'leader', 'live', 'llm', 'loop', 'machine', 'make', 'memory', 'msg', 'notify', 'ops', 'outputs', 'plugin', 'pod', 'provider', 'pty', 'publish', 'questions', 'relay', 'release', 'repo', 'research', 'resource', 'retro', 'role', 'schedule', 'seat', 'shadow', 'skills', 'start', 'storage', 'tasks', 'where']);
62
+ function selectedIndexFastRoot(args: readonly string[]): string | undefined {
63
+ if (process.env.ELANOUS_TEST_FLAG_AUDIT === '1') return undefined;
64
+ let index = 0;
65
+ while (index < args.length && args[index]?.startsWith('-')) {
66
+ const flag = args[index]!;
67
+ index++;
68
+ if (flag === '--test' || flag.startsWith('--test=')) continue;
69
+ if (flag === '--config-dir' || flag === '--test-state-dir') {
70
+ if (!args[index] || args[index]!.startsWith('-')) return undefined;
71
+ index++;
72
+ continue;
73
+ }
74
+ if (flag.startsWith('--config-dir=') || flag.startsWith('--test-state-dir=')) continue;
75
+ return undefined;
76
+ }
77
+ const root = args[index];
78
+ // We cannot know every registrar's local options before it is loaded. Keep
79
+ // only universally recognized help (and where's measured JSON action) on
80
+ // the small path; all other options take the complete parser.
81
+ const fastOptions = new Set(root === 'where' ? ['--help', '-h', '--json'] : ['--help', '-h']);
82
+ if (args.slice(index + 1).some((arg) => arg.startsWith('-') && !fastOptions.has(arg))) return undefined;
83
+ return root && INDEX_FAST_ROOTS.has(root) ? root : undefined;
84
+ }
85
+ // An explicit `--tui next` launch does not dispatch a CLI subcommand. Keep command
86
+ // registrars out of the first-frame path while retaining the full tree for
87
+ // help, unknown commands and unrecognized global flags.
88
+ function selectedIndexNextTuiRoot(args: readonly string[]): '__tui_next__' | undefined {
89
+ const rootTui = extractRootTuiEntry(args);
90
+ if (rootTui.error || rootTui.entry !== 'next') return undefined;
91
+ const remaining = rootTui.args.filter((arg) => arg !== '--test' && !arg.startsWith('--test='));
92
+ return remaining.length === 0 ? '__tui_next__' : undefined;
93
+ }
94
+ // Test files import this module to inspect the complete Commander tree. An
95
+ // empty test-runner argv also looks like a bare next launch, so only the real
96
+ // CLI entry may take the next-only registrar path.
97
+ const isCliEntry = import.meta.main || /[\\/]bin[\\/]elanous\.mjs$/.test(process.argv[1] ?? '');
98
+ const INDEX_FAST_ROOT = selectedIndexFastRoot(process.argv.slice(2))
99
+ ?? (isCliEntry ? selectedIndexNextTuiRoot(process.argv.slice(2)) : undefined);
100
+ // Keep the historical index exports without forcing the agent engine into
101
+ // unrelated CLI commands at module load time.
102
+ export const runChatTurnCli: typeof import('./cli/agent-cli.js').runChatTurnCli =
103
+ async (...args) => (await import('./cli/agent-cli.js')).runChatTurnCli(...args);
104
+ export const buildCliAgentTools: typeof import('./cli/agent-cli.js').buildCliAgentTools =
105
+ (...args) => (require('./cli/agent-cli.js') as typeof import('./cli/agent-cli.js')).buildCliAgentTools(...args);
106
+ export const setCliAgentDispatchForTesting: typeof import('./cli/agent-cli.js').setCliAgentDispatchForTesting =
107
+ (...args) => (require('./cli/agent-cli.js') as typeof import('./cli/agent-cli.js')).setCliAgentDispatchForTesting(...args);
108
+ export const emitDetachedProgress: typeof import('./cli/agent-cli.js').emitDetachedProgress =
109
+ (...args) => (require('./cli/agent-cli.js') as typeof import('./cli/agent-cli.js')).emitDetachedProgress(...args);
110
+ export const emitHarnessFeedbackProgress: typeof import('./cli/agent-cli.js').emitHarnessFeedbackProgress =
111
+ (...args) => (require('./cli/agent-cli.js') as typeof import('./cli/agent-cli.js')).emitHarnessFeedbackProgress(...args);
112
+
113
+ // Selected root imports only its registrar; complete help and unknown routes load all.
114
+ const registerDocsCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'docs'
115
+ ? (() => undefined)
116
+ : (require('./cli/docs-cli.js') as typeof import('./cli/docs-cli.js')).registerDocsCommands) as typeof import('./cli/docs-cli.js').registerDocsCommands;
117
+ const registerBenchCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'bench'
118
+ ? (() => undefined)
119
+ : (require('./cli/bench-cli.js') as typeof import('./cli/bench-cli.js')).registerBenchCommands) as typeof import('./cli/bench-cli.js').registerBenchCommands;
120
+ const registerRetroCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'retro'
121
+ ? (() => undefined)
122
+ : (require('./cli/retro-cli.js') as typeof import('./cli/retro-cli.js')).registerRetroCommands) as typeof import('./cli/retro-cli.js').registerRetroCommands;
123
+ const registerMemoryCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'memory'
124
+ ? (() => undefined)
125
+ : (require('./cli/memory-cli.js') as typeof import('./cli/memory-cli.js')).registerMemoryCommands) as typeof import('./cli/memory-cli.js').registerMemoryCommands;
126
+ const registerA2ACommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'a2a'
127
+ ? (() => undefined)
128
+ : (require('./cli/a2a-cli.js') as typeof import('./cli/a2a-cli.js')).registerA2ACommands) as typeof import('./cli/a2a-cli.js').registerA2ACommands;
129
+ const registerPluginCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'plugin'
130
+ ? (() => undefined)
131
+ : (await import('./cli/plugin-cli.js')).registerPluginCommands) as typeof import('./cli/plugin-cli.js').registerPluginCommands;
132
+ const registerMakeCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'make'
133
+ ? (() => undefined)
134
+ : (require('./cli/make-cli.js') as typeof import('./cli/make-cli.js')).registerMakeCommand) as typeof import('./cli/make-cli.js').registerMakeCommand;
135
+ const registerConnectCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'connect'
136
+ ? (() => undefined)
137
+ : (require('./cli/skills-cli.js') as typeof import('./cli/skills-cli.js')).registerConnectCommand) as typeof import('./cli/skills-cli.js').registerConnectCommand;
138
+ const registerSkillsCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'skills'
139
+ ? (() => undefined)
140
+ : (require('./cli/skills-cli.js') as typeof import('./cli/skills-cli.js')).registerSkillsCommands) as typeof import('./cli/skills-cli.js').registerSkillsCommands;
141
+ const registerImportCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'import'
142
+ ? (() => undefined)
143
+ : (require('./cli/import-cli.js') as typeof import('./cli/import-cli.js')).registerImportCommand) as typeof import('./cli/import-cli.js').registerImportCommand;
144
+ const registerPersonaCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
145
+ ? (() => undefined)
146
+ : (await import('./cli/persona-cli.js')).registerPersonaCommands) as typeof import('./cli/persona-cli.js').registerPersonaCommands;
147
+ const registerFleetCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'fleet'
148
+ ? (() => undefined)
149
+ : (require('./cli/fleet-cli.js') as typeof import('./cli/fleet-cli.js')).registerFleetCommands) as typeof import('./cli/fleet-cli.js').registerFleetCommands;
150
+ const registerPrivateLedgerCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
151
+ ? (() => undefined)
152
+ : (require('./cli/private-ledger-commands.js') as typeof import('./cli/private-ledger-commands.js')).registerPrivateLedgerCommands) as typeof import('./cli/private-ledger-commands.js').registerPrivateLedgerCommands;
153
+ const registerKnowCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'know'
154
+ ? (() => undefined)
155
+ : (require('./cli/know-cli.js') as typeof import('./cli/know-cli.js')).registerKnowCommand) as typeof import('./cli/know-cli.js').registerKnowCommand;
156
+ const registerSeatRequestsCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'seat'
157
+ ? (() => undefined)
158
+ : (require('./cli/seat-requests-cli.js') as typeof import('./cli/seat-requests-cli.js')).registerSeatRequestsCommands) as typeof import('./cli/seat-requests-cli.js').registerSeatRequestsCommands;
159
+ const registerSeatBootCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'seat'
160
+ ? (() => undefined)
161
+ : (require('./cli/seat-cli.js') as typeof import('./cli/seat-cli.js')).registerSeatBootCommands) as typeof import('./cli/seat-cli.js').registerSeatBootCommands;
162
+ const registerPtyTakeoverCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'pty'
163
+ ? (() => undefined)
164
+ : (require('./cli/pty-takeover-cli.js') as typeof import('./cli/pty-takeover-cli.js')).registerPtyTakeoverCommands) as typeof import('./cli/pty-takeover-cli.js').registerPtyTakeoverCommands;
165
+ const registerPtyRecordCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'pty'
166
+ ? (() => undefined)
167
+ : (require('./cli/pty-record-cli.js') as typeof import('./cli/pty-record-cli.js')).registerPtyRecordCommand) as typeof import('./cli/pty-record-cli.js').registerPtyRecordCommand;
168
+ const registerLeaderCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'leader'
169
+ ? (() => undefined)
170
+ : (require('./cli/leader-cli.js') as typeof import('./cli/leader-cli.js')).registerLeaderCommands) as typeof import('./cli/leader-cli.js').registerLeaderCommands;
171
+ const registerRepoCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'repo'
172
+ ? (() => undefined)
173
+ : (require('./cli/repo-cli.js') as typeof import('./cli/repo-cli.js')).registerRepoCommands) as typeof import('./cli/repo-cli.js').registerRepoCommands;
174
+ const registerOpsCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'ops'
175
+ ? (() => undefined)
176
+ : (require('./cli/ops-cli.js') as typeof import('./cli/ops-cli.js')).registerOpsCommands) as typeof import('./cli/ops-cli.js').registerOpsCommands;
177
+ const registerOutputsCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'outputs'
178
+ ? (() => undefined)
179
+ : (require('./cli/outputs-cli.js') as typeof import('./cli/outputs-cli.js')).registerOutputsCommands) as typeof import('./cli/outputs-cli.js').registerOutputsCommands;
180
+ const registerPublishCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'publish'
181
+ ? (() => undefined)
182
+ : (require('./cli/publish-cli.js') as typeof import('./cli/publish-cli.js')).registerPublishCommands) as typeof import('./cli/publish-cli.js').registerPublishCommands;
183
+ const registerAutopilotCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
184
+ ? (() => undefined)
185
+ : (require('./cli/autopilot-cli.js') as typeof import('./cli/autopilot-cli.js')).registerAutopilotCommands) as typeof import('./cli/autopilot-cli.js').registerAutopilotCommands;
186
+ const registerRoleCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'role'
187
+ ? (() => undefined)
188
+ : (require('./cli/role-cli.js') as typeof import('./cli/role-cli.js')).registerRoleCommands) as typeof import('./cli/role-cli.js').registerRoleCommands;
189
+ const registerMachineCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'machine'
190
+ ? (() => undefined)
191
+ : (require('./cli/machine-cli.js') as typeof import('./cli/machine-cli.js')).registerMachineCommands) as typeof import('./cli/machine-cli.js').registerMachineCommands;
192
+ const registerAgentEnvCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'agent-env'
193
+ ? (() => undefined)
194
+ : (require('./cli/agent-env-cli.js') as typeof import('./cli/agent-env-cli.js')).registerAgentEnvCommands) as typeof import('./cli/agent-env-cli.js').registerAgentEnvCommands;
195
+ const registerScheduleCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'schedule'
196
+ ? (() => undefined)
197
+ : (require('./cli/schedule-cli.js') as typeof import('./cli/schedule-cli.js')).registerScheduleCommands) as typeof import('./cli/schedule-cli.js').registerScheduleCommands;
198
+ const registerGuardianCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'guardian'
199
+ ? (() => undefined)
200
+ : (require('./cli/guardian-cli.js') as typeof import('./cli/guardian-cli.js')).registerGuardianCommands) as typeof import('./cli/guardian-cli.js').registerGuardianCommands;
201
+ const registerCapabilitiesCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
202
+ ? (() => undefined)
203
+ : (require('./agent-mission/capabilities-cli.js') as typeof import('./agent-mission/capabilities-cli.js')).registerCapabilitiesCommand) as typeof import('./agent-mission/capabilities-cli.js').registerCapabilitiesCommand;
204
+ const registerSupervisorMetricsCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
205
+ ? (() => undefined)
206
+ : (require('./agent-mission/supervisor-metrics-cli.js') as typeof import('./agent-mission/supervisor-metrics-cli.js')).registerSupervisorMetricsCommand) as typeof import('./agent-mission/supervisor-metrics-cli.js').registerSupervisorMetricsCommand;
207
+ const registerWhereCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'where'
208
+ ? (() => undefined)
209
+ : (require('./cli/where-cli.js') as typeof import('./cli/where-cli.js')).registerWhereCommand) as typeof import('./cli/where-cli.js').registerWhereCommand;
210
+ const registerShadowCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'shadow'
211
+ ? (() => undefined)
212
+ : (require('./cli/shadow-cli.js') as typeof import('./cli/shadow-cli.js')).registerShadowCommand) as typeof import('./cli/shadow-cli.js').registerShadowCommand;
213
+ const registerLlmDetectCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'llm'
214
+ ? (() => undefined)
215
+ : (require('./cli/llm-detect-cli.js') as typeof import('./cli/llm-detect-cli.js')).registerLlmDetectCommand) as typeof import('./cli/llm-detect-cli.js').registerLlmDetectCommand;
216
+ const registerStorageDetectCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'storage'
217
+ ? (() => undefined)
218
+ : (require('./cli/storage-cli.js') as typeof import('./cli/storage-cli.js')).registerStorageDetectCommand) as typeof import('./cli/storage-cli.js').registerStorageDetectCommand;
219
+ const registerPodCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'pod'
220
+ ? (() => undefined)
221
+ : (require('./cli/pod-cli.js') as typeof import('./cli/pod-cli.js')).registerPodCommands) as typeof import('./cli/pod-cli.js').registerPodCommands;
222
+ const registerBrowserAnnotateCommand = (require('./cli/browser-annotate-cli.js') as typeof import('./cli/browser-annotate-cli.js')).registerBrowserAnnotateCommand;
223
+ const registerPendingQuestionsCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'questions'
224
+ ? (() => undefined)
225
+ : (require('./cli/pending-questions-cli.js') as typeof import('./cli/pending-questions-cli.js')).registerPendingQuestionsCommand) as typeof import('./cli/pending-questions-cli.js').registerPendingQuestionsCommand;
226
+ const registerUsageCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
227
+ ? (() => undefined)
228
+ : (require('./cli/usage-cli.js') as typeof import('./cli/usage-cli.js')).registerUsageCommand) as typeof import('./cli/usage-cli.js').registerUsageCommand;
229
+ const registerUsageDailyCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
230
+ ? (() => undefined)
231
+ : (require('./cli/usage-daily-cli.js') as typeof import('./cli/usage-daily-cli.js')).registerUsageDailyCommand) as typeof import('./cli/usage-daily-cli.js').registerUsageDailyCommand;
232
+ const registerLiveCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'live'
233
+ ? (() => undefined)
234
+ : (require('./cli/live-cli.js') as typeof import('./cli/live-cli.js')).registerLiveCommands) as typeof import('./cli/live-cli.js').registerLiveCommands;
235
+ const registerResearchCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'research'
236
+ ? (() => undefined)
237
+ : (require('./cli/research-cli.js') as typeof import('./cli/research-cli.js')).registerResearchCommand) as typeof import('./cli/research-cli.js').registerResearchCommand;
238
+ const registerReleaseCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'release'
239
+ ? (() => undefined)
240
+ : (require('./cli/release-cli.js') as typeof import('./cli/release-cli.js')).registerReleaseCommands) as typeof import('./cli/release-cli.js').registerReleaseCommands;
241
+ const registerFreezeCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'freeze'
242
+ ? (() => undefined)
243
+ : (require('./cli/freeze-cli.js') as typeof import('./cli/freeze-cli.js')).registerFreezeCommands) as typeof import('./cli/freeze-cli.js').registerFreezeCommands;
244
+ const registerFlowCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'flow'
245
+ ? (() => undefined)
246
+ : (require('./cli/flow-cli.js') as typeof import('./cli/flow-cli.js')).registerFlowCommands) as typeof import('./cli/flow-cli.js').registerFlowCommands;
247
+ const registerModelWatchCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
248
+ ? (() => undefined)
249
+ : (require('./cli/model-watch-cli.js') as typeof import('./cli/model-watch-cli.js')).registerModelWatchCommand) as typeof import('./cli/model-watch-cli.js').registerModelWatchCommand;
250
+ const registerIntakeCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'intake'
251
+ ? (() => undefined)
252
+ : (require('./cli/intake-cli.js') as typeof import('./cli/intake-cli.js')).registerIntakeCommands) as typeof import('./cli/intake-cli.js').registerIntakeCommands;
253
+ const registerTasksCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'tasks'
254
+ ? (() => undefined)
255
+ : (require('./cli/tasks-cli.js') as typeof import('./cli/tasks-cli.js')).registerTasksCommands) as typeof import('./cli/tasks-cli.js').registerTasksCommands;
256
+ const registerBriefCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'brief'
257
+ ? (() => undefined)
258
+ : (await import('./cli/brief-cli.js')).registerBriefCommands) as typeof import('./cli/brief-cli.js').registerBriefCommands;
259
+ const registerNotifyCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'notify'
260
+ ? (() => undefined)
261
+ : (require('./cli/notify-cli.js') as typeof import('./cli/notify-cli.js')).registerNotifyCommand) as typeof import('./cli/notify-cli.js').registerNotifyCommand;
262
+ const registerAwayCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'away'
263
+ ? (() => undefined)
264
+ : (await import('./cli/away-cli.js')).registerAwayCommand) as typeof import('./cli/away-cli.js').registerAwayCommand;
265
+ const registerLabelsCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'labels'
266
+ ? (() => undefined)
267
+ : (require('./cli/labels-cli.js') as typeof import('./cli/labels-cli.js')).registerLabelsCommands) as typeof import('./cli/labels-cli.js').registerLabelsCommands;
268
+ const registerMsgCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'msg'
269
+ ? (() => undefined)
270
+ : (require('./cli/msg-cli.js') as typeof import('./cli/msg-cli.js')).registerMsgCommands) as typeof import('./cli/msg-cli.js').registerMsgCommands;
271
+ const registerDoctorCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'doctor'
272
+ ? (() => undefined)
273
+ : (require('./cli/doctor-cli.js') as typeof import('./cli/doctor-cli.js')).registerDoctorCommand) as typeof import('./cli/doctor-cli.js').registerDoctorCommand;
274
+ const registerProviderCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'provider'
275
+ ? (() => undefined)
276
+ : (require('./cli/provider-cli.js') as typeof import('./cli/provider-cli.js')).registerProviderCommands) as typeof import('./cli/provider-cli.js').registerProviderCommands;
277
+ const registerAgentCommands = (INDEX_FAST_ROOT
278
+ ? (() => undefined)
279
+ : (require('./cli/agent-cli.js') as typeof import('./cli/agent-cli.js')).registerAgentCommands) as typeof import('./cli/agent-cli.js').registerAgentCommands;
280
+ const registerControlCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'control'
281
+ ? (() => undefined)
282
+ : (require('./cli/control-cli.js') as typeof import('./cli/control-cli.js')).registerControlCommands) as typeof import('./cli/control-cli.js').registerControlCommands;
283
+ const registerHooksCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
284
+ ? (() => undefined)
285
+ : (require('./cli/hooks-cli.js') as typeof import('./cli/hooks-cli.js')).registerHooksCommands) as typeof import('./cli/hooks-cli.js').registerHooksCommands;
286
+ const registerSetupCommand = (INDEX_FAST_ROOT === '__tui_next__'
287
+ ? (() => undefined)
288
+ : (require('./cli/setup-cli.js') as typeof import('./cli/setup-cli.js')).registerSetupCommand) as typeof import('./cli/setup-cli.js').registerSetupCommand;
289
+ const registerStartCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'start'
290
+ ? (() => undefined)
291
+ : (require('./cli/start-cli.js') as typeof import('./cli/start-cli.js')).registerStartCommand) as typeof import('./cli/start-cli.js').registerStartCommand;
292
+ const registerGroundingSourcesCli = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
293
+ ? (() => undefined)
294
+ : (require('./grounding/sources-cli.js') as typeof import('./grounding/sources-cli.js')).registerGroundingSourcesCli) as typeof import('./grounding/sources-cli.js').registerGroundingSourcesCli;
295
+ const registerGraphCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'graph'
296
+ ? (() => undefined)
297
+ : (require('./graph-runner/graph-cli.js') as typeof import('./graph-runner/graph-cli.js')).registerGraphCommands) as typeof import('./graph-runner/graph-cli.js').registerGraphCommands;
298
+ const registerLoopCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'loop'
299
+ ? (() => undefined)
300
+ : (require('./loops/loop-cli.js') as typeof import('./loops/loop-cli.js')).registerLoopCommands) as typeof import('./loops/loop-cli.js').registerLoopCommands;
301
+ const registerResourceCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'resource'
302
+ ? (() => undefined)
303
+ : (require('./cli/resource-cli.js') as typeof import('./cli/resource-cli.js')).registerResourceCommands) as typeof import('./cli/resource-cli.js').registerResourceCommands;
304
+ const registerHqMovePlanCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
305
+ ? (() => undefined)
306
+ : (require('./hq/hq.js') as typeof import('./hq/hq.js')).registerHqMovePlanCommand) as typeof import('./hq/hq.js').registerHqMovePlanCommand;
307
+ const registerCardCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'card'
308
+ ? (() => undefined)
309
+ : (require('./task-cards/card-cli.js') as typeof import('./task-cards/card-cli.js')).registerCardCommand) as typeof import('./task-cards/card-cli.js').registerCardCommand;
310
+ const registerLaunchHeadCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'launch-head'
311
+ ? (() => undefined)
312
+ : (require('./launch-head/launch-head-cli.js') as typeof import('./launch-head/launch-head-cli.js')).registerLaunchHeadCommands) as typeof import('./launch-head/launch-head-cli.js').registerLaunchHeadCommands;
313
+ const registerIngestTokenCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
314
+ ? (() => undefined)
315
+ : (require('./cli/ingest-token-cli.js') as typeof import('./cli/ingest-token-cli.js')).registerIngestTokenCommands) as typeof import('./cli/ingest-token-cli.js').registerIngestTokenCommands;
316
+ const registerMcpGatewayCommands = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== '__full__'
317
+ ? (() => undefined)
318
+ : (require('./cli/mcp-gateway-cli.js') as typeof import('./cli/mcp-gateway-cli.js')).registerMcpGatewayCommands) as typeof import('./cli/mcp-gateway-cli.js').registerMcpGatewayCommands;
319
+ const registerRelayCommand = (INDEX_FAST_ROOT && INDEX_FAST_ROOT !== 'relay'
320
+ ? (() => undefined)
321
+ : (require('./relay/relay-cli.js') as typeof import('./relay/relay-cli.js')).registerRelayCommand) as typeof import('./relay/relay-cli.js').registerRelayCommand;
322
+
323
+
121
324
  import { Command, Option } from 'commander';
122
325
  import { filterCliRootHelp } from './maturity/cli-maturity.js';
123
326
  import type { AdPipelinePlan, AdPipelineResult } from './ad-pipeline/run.js';
124
327
  import type { AcpPermissionApprover } from './acp/client.js';
125
328
  import { runGitCommand } from './git-fs/runner.js';
126
329
  import { debug, redactSecretText, redactSecrets } from './debug/log.js';
127
- import { installHarnessCliCommand, type HarnessAskSayChildLlmOptions, type HarnessAskSayOptions, type HarnessPlanOptions } from './harness/harness-cli-command.js';
330
+ import type { HarnessAskSayChildLlmOptions, HarnessAskSayOptions, HarnessPlanOptions } from './harness/harness-cli-command.js';
128
331
  import { CliUserError, formatCliUserError, isCliUserError } from './cli/cli-user-error.js';
129
332
  import { classifyFriendlyError, formatFriendlyError } from './cli/friendly-errors.js';
130
333
  import { detectLocale } from './expression/locale.js';
131
- import { dispatchSolveMission } from './skills/tools/solve-mission.js';
132
334
  import { performBrowserAction, type BrowserActionDeps, type BrowserActionResult } from './harness/browser-act.js';
133
335
  import { decideTypeAction, type TypeActionDecision, type TypeTarget } from './harness/browser-act-type.js';
134
- import { resolveSelfSendTarget } from './harness/self-send-target.js';
135
336
  import { awaitGlobalPersonaLoad, describeMissingPersona, getGlobalPersonaRegistry } from './persona/global-registry.js';
136
- import { HARNESS_RUN_DEPRECATION_HELP } from './self-dev/harness-run-cli.js';
137
- import { DEV_PLAN_REPLACEMENT, formatDevPlanOptionHelp } from './self-dev/dev-cli.js';
138
337
  import type { InventoryMeta, SortKey } from './llm/local-manager/benchmark/scores.js';
139
338
  import { syncServers, SERVICE_NAMES } from './config.js';
140
339
  import { getLocalSkills, executeSync } from './sync.js';
141
- import { showSyncSelector, showSyncProgress } from './selector.js'; // kept for CLI sync subcommand
142
340
  import { inspectRemote } from './inspect.js';
143
341
  import { showRecentHistory, showSessionDetail, showSkillDetail, showTargetDetail, showStatus } from './history.js';
144
- import { showDashboard } from './dashboard/index.js';
145
342
  import { initTui, closeTui } from './tui.js';
343
+ import { effectiveRootTuiEntry, extractRootTuiEntry } from './cli/root-tui-entry.js';
146
344
  import * as ui from './ui.js';
147
- import { DEFAULT_REVIEW_BACKEND } from './agent-substrate/acp-reviewer.js';
148
345
  import type { ReviewResult } from './agent-substrate/pr-reviewer.js';
149
346
  import type { ReviewVerdict } from './agent-mission/review-loop.js';
150
347
  import type { SyncMode } from './types.js';
151
- import { runOnboarding, runOnboardingStep, runOnboardingNonInteractive, needsOnboarding, needsFirstRun, handleOnboardingRefusal, type OnboardingStepId } from './onboarding.js';
152
- import { firstChatGate } from './onboarding/first-chat-gate.js';
348
+ import type { OnboardingStepId } from './onboarding.js';
153
349
  import {
154
350
  getUserConfig, reloadUserConfig, userConfigPath, saveUserConfig,
155
351
  backupUserConfig, backupConfigPath, addRotationEntry, type RotationEntry,
156
352
  resolveRoleLlm,
157
353
  } from './user-config.js';
158
354
  import { reviewReasoningEffort } from './model-tier/review-effort.js';
159
- import { isKeylessProvider, resolveProviderCredential } from './llm/provider-credentials.js';
355
+ import { configuredOpenGatewayKeys, isKeylessProvider, resolveProviderCredential } from './llm/provider-credentials.js';
160
356
  import {
161
357
  listSessions, loadSession, deleteSession, resolveSessionId,
162
358
  setActiveSessionId, getActiveSessionId,
163
359
  lastConversationMessage, isSessionSource,
164
360
  } from './session/index.js';
165
361
  import { requestSessionTurnControl } from './session/session-turn-control.js';
166
- import { ensureCliSession, sessionBudget } from './session/chat.js';
167
362
  import { suggestProjectForFolder } from './project/project-store.js';
168
- import { botFromConfig, TelegramBot } from './telegram.js';
169
363
  import { acquireTelegramLock, TelegramLockError, defaultLockPath, safeReadLock } from './telegram-lock.js';
170
364
  import { basename, join as _joinPath, resolve } from 'node:path';
171
365
  import * as nodeReadline from 'node:readline/promises';
@@ -191,14 +385,13 @@ import { renderKeyHelp, CONTEXT_LABELS, type KeyContext } from './keybindings.js
191
385
  import { auditKeybindings, renderKeymapAudit } from './keymap-audit.js';
192
386
  import { runCodexSetup } from './codex/setup.js';
193
387
  import { renderAllModels } from './codex/models.js';
194
- import { realIO } from './onboarding.js';
195
388
  import { inspectActiveProvider, oneLineProvider } from './provider-summary.js';
196
389
  import { renderStatusLines, renderPrimaryStatus, renderSecondaryStatus } from './status/bar.js';
197
390
  import { initSessionWorkingDir } from './session/working-dir.js';
198
391
  import { rewriteBareNexusToStatus } from './cli/nexus-entry.js';
199
- import { registerIngestTokenCommands } from './cli/ingest-token-cli.js';
200
- import { registerMcpGatewayCommands } from './cli/mcp-gateway-cli.js';
201
- import { registerRelayCommand } from './relay/relay-cli.js';
392
+
393
+
394
+
202
395
  import type { ReviewImage } from './agent-substrate/pr-reviewer.js';
203
396
  import {
204
397
  describeMissionRouting,
@@ -220,6 +413,8 @@ function resolveCliDirOption(dir: string): string {
220
413
  import { cliVersion, setInstallMetadataRootForTesting } from './version/code-revision.js';
221
414
  export { cliVersion, setInstallMetadataRootForTesting };
222
415
 
416
+
417
+
223
418
  export const program = new Command();
224
419
  program.enablePositionalOptions();
225
420
 
@@ -381,8 +576,12 @@ async function runDefaultAskFileLaunchFlow(
381
576
  import('node:path'),
382
577
  import('./self-dev/entrance-registry.js'),
383
578
  ]);
384
- const askText = readFileSync(askPath, 'utf8');
579
+ // Read the source bytes ONCE: the same bytes feed the ledger and the launch flow (a read failure → launch 0).
580
+ const askBytes = readFileSync(askPath);
581
+ const askText = askBytes.toString('utf8');
385
582
  if (!askText.trim()) throw new Error('--ask 파일 입력이 비었다');
583
+ const { newLaunchUtteranceId, recordLaunchUtterance } = await import('./harness/launch-utterance-ledger.js');
584
+ recordLaunchUtterance({ source: 'ask-file', utterance: askText, rawBytes: askBytes, launchId: newLaunchUtteranceId() });
386
585
  const askIo = await import('./self-dev/ask-launch-io.js');
387
586
  const askLogRows = await askIo.readAskPreflightLogRows();
388
587
  const askLaunchPrep = (await import('./self-dev/launch-preflight.js')).prepareAskLaunch(
@@ -403,7 +602,7 @@ async function runDefaultAskFileLaunchFlow(
403
602
  print: (line) => console.error(line),
404
603
  log: (event, data, level) => debug.log('dev-pipeline', event, data, { level }),
405
604
  readLine: (prompt) => readStdinLine(prompt),
406
- readFile: (file) => readFileSync(file, 'utf8'),
605
+ readFile: (file) => file === askPath ? askText : readFileSync(file, 'utf8'),
407
606
  writeFile: (file, data) => writeFileSync(file, data, 'utf8'),
408
607
  cwd: () => process.cwd(),
409
608
  now: () => Date.now(),
@@ -917,7 +1116,114 @@ async function runDevSayFromWords(
917
1116
 
918
1117
  registerPtyTakeoverCommands(program);
919
1118
  registerPtyRecordCommand(program.commands.find((command) => command.name() === 'pty')!);
920
- registerPrCommands(program);
1119
+ // Keep the public PR help slot but defer its large CI/landing import graph
1120
+ // until the PR command is actually selected (including direct Commander use).
1121
+ const prCommandOrder = program.commands.length;
1122
+ const prShell = program.command('pr').description('PR landing commands');
1123
+ // The exported Commander tree is also the public entrance inventory. Keep its
1124
+ // lightweight declarations visible without importing the CI/landing graph.
1125
+ prShell.command('supersede-drafts').description('확인된 병합 PR의 명시 Supersedes 같은 칸 draft만 정리')
1126
+ .requiredOption('--pr <number>', '병합 PR 번호')
1127
+ .option('--cwd <path>', '저장소 경로');
1128
+ prShell.command('census').description('열린 PR 전체·골 문서만·2일 무커밋 draft·미닫힌 superseded 집계').option('--cwd <path>', '저장소 경로');
1129
+ prShell.command('open-guard').description('새 PR 전에 같은 파일 OPEN PR·골 문서만·자리별 상한 검사')
1130
+ .option('--cwd <path>', '작업 트리 경로').option('--base <ref>', '비교 base ref', 'origin/main')
1131
+ .option('--seat <seat>', 'PR 소유 자리(OP|TC|MK|UX)').option('--cell <id>', '릴리스 칸 id (같은 칸 OPEN PR 검사)')
1132
+ .option('--seat-cap <number>', '자리별 열린 PR 경고 상한', '30');
1133
+ const prQueueShell = prShell.command('queue').description('Shadow merge queue (never lands PRs)');
1134
+ prQueueShell.command('status').description('Show pending PRs and shadow verdicts');
1135
+ prQueueShell.command('enqueue <pr>').description('Pin a ready PR at the tail of the shadow queue');
1136
+ prQueueShell.command('run').description('Evaluate the first PR without merging').requiredOption('--shadow', 'Only evaluate; never land');
1137
+ prShell.command('land').description('현재 브랜치 PR을 생성 또는 갱신해 ready 상태로 만들고 squash merge')
1138
+ .option('--base <branch>', 'PR base branch').option('--cwd <path>', '작업 트리 경로')
1139
+ .option('--pr <number>', '기존 PR 번호 고정 (--expected-head 와 함께)')
1140
+ .option('--expected-head <sha>', '리뷰된 PR 머리 SHA 고정 (--pr 와 함께)')
1141
+ .option('--heavy-remote', '머리 고정 착지의 무거운 게이트를 node-b·node-c 중 빈 호스트에서 실행; head⊕main 증거가 없거나 실패하면 거부(로컬 폴백 없음)')
1142
+ .option('--heavy-on-pod-shadow', '--heavy-remote 판정을 유지하고 같은 head/main의 Pod 타입·변경 시험 결과를 비교만 한다')
1143
+ .option('--dry-run', '변경 없이 landing 계획만 출력').option('--hold', 'PR을 생성 또는 갱신한 뒤 병합하지 않고 쌓아 둔다')
1144
+ .option('--title <title>', 'PR title').option('--title-file <path>', 'PR title file')
1145
+ .option('--body <body>', 'PR body').option('--body-file <path>', 'PR body file')
1146
+ .option('--commit-message <message>', 'upsert commit message')
1147
+ .option('--commit-message-file <path>', 'upsert commit message file (takes precedence over --commit-message)')
1148
+ .option('--include-active-run-files', '도는 런 파일을 이번 착지에 포함 (기본 동작)')
1149
+ .option('--exclude-active-run-files', '도는 런과 겹친 파일을 이번 착지에서 제외')
1150
+ .option('--exclude-active-run-sources', '⚠ 위험: --exclude-active-run-files 가 골 문서가 아닌 파일(소스)을 빼도 착지를 강행')
1151
+ .option('--land-reason <text>', '권고를 보고도 지금 내는 이유(예: 남이 기다리는 차단 해제)')
1152
+ .option('--force-freeze <reason>', '동결을 넘겨 병합할 명시적 이유(필수)')
1153
+ .option('--allow-public-leak', '바뀐 파일이 공개본에 사적 흔적을 실어도 착지(이유는 --land-reason)')
1154
+ .option('--overlap-evidence <file>', '머리 고정 착지 전용: 비대화형 겹침 승인을 대신할 증거 JSON {pr, head, gate:{head,baseCommit,passed}, reviewResult} — 재기반·재게이트·리뷰를 CLI 가 다시 잰다(겹친 착지가 전부 머리의 조상이면 리뷰만 · gate 생략 가능)');
1155
+ prShell.command('granularity').description('로컬 git log 로 최근 착지 단위(파일 중복·단일 파일 비율)를 센다')
1156
+ .option('--since <window>', 'git log --since 창', '1 day ago')
1157
+ .option('--cwd <path>', '작업 트리 경로').option('--base <branch>', '착지 집계에 쓸 base 브랜치')
1158
+ .option('--with-source', 'PR 번호로 브랜치를 조회해 하니스↔사람 갈래를 함께 낸다 (gh 필요)');
1159
+ const parseBeforePrRegistration = program.parse.bind(program);
1160
+ const parseAsyncBeforePrRegistration = program.parseAsync.bind(program);
1161
+ let prRegistered = false;
1162
+ function ensurePrRegistered(): void {
1163
+ if (prRegistered) return;
1164
+ const { registerPrCommands } = require('./cli/pr-cli.js') as typeof import('./cli/pr-cli.js');
1165
+ // Commander exposes this array as readonly in types, while registration still mutates it at runtime.
1166
+ const commands = program.commands as Command[];
1167
+ commands.splice(prCommandOrder, 1);
1168
+ registerPrCommands(program);
1169
+ const registered = commands.pop()!;
1170
+ commands.splice(prCommandOrder, 0, registered);
1171
+ prRegistered = true;
1172
+ }
1173
+ // Consumers may hold a reference to the exported PR subtree and parse that
1174
+ // command directly, bypassing program.parse. Keep those references executable
1175
+ // without loading the PR registrar until a direct parse actually occurs.
1176
+ function deferPrSubtreeParse(shell: Command, path: number[] = []): void {
1177
+ const selected = () => {
1178
+ ensurePrRegistered();
1179
+ let command = program.commands[prCommandOrder]!;
1180
+ for (const index of path) command = command.commands[index]!;
1181
+ return command;
1182
+ };
1183
+ shell.parse = (...args: Parameters<Command['parse']>) => selected().parse(...args);
1184
+ shell.parseAsync = (...args: Parameters<Command['parseAsync']>) => selected().parseAsync(...args);
1185
+ shell.commands.forEach((child, index) => deferPrSubtreeParse(child, [...path, index]));
1186
+ }
1187
+ deferPrSubtreeParse(prShell);
1188
+ function selectedRootArgs(argv: readonly string[] | undefined, from?: string): { command: string | undefined; next: string | undefined; rootHelp: boolean } {
1189
+ const args = (argv ?? process.argv).slice(from === 'user' ? 0 : from === 'electron' ? 1 : 2);
1190
+ // parseOptions() emits Commander option events, so do not run it before the
1191
+ // real parse. Only inspect leading root options; a subcommand owns the rest.
1192
+ let position = 0;
1193
+ let rootHelp = args.length === 0;
1194
+ while (position < args.length) {
1195
+ const token = args[position];
1196
+ if (token === '--') { position++; break; }
1197
+ if (token === '--help' || token === '-h' || token === '--help-all') {
1198
+ rootHelp = true;
1199
+ position++;
1200
+ continue;
1201
+ }
1202
+ const option = program.options.find((item) => token === item.long || token === item.short
1203
+ || (item.long && token.startsWith(`${item.long}=`)));
1204
+ if (!option) {
1205
+ if (token.startsWith('-')) { position++; continue; }
1206
+ break;
1207
+ }
1208
+ position++;
1209
+ if (option.required && !token.includes('=')) position++;
1210
+ else if (option.optional && position < args.length && !args[position].startsWith('-')) position++;
1211
+ }
1212
+ return { command: args[position], next: args[position + 1], rootHelp };
1213
+ }
1214
+ function prSelectedForParse(argv: readonly string[] | undefined, from?: string): boolean {
1215
+ const { command, next, rootHelp } = selectedRootArgs(argv, from);
1216
+ return command === 'pr' || (command === 'help' && (!next || next === 'pr'))
1217
+ || (!command && rootHelp);
1218
+ }
1219
+ program.parse = (...args: Parameters<typeof program.parse>) => {
1220
+ if (prSelectedForParse(args[0], args[1]?.from)) ensurePrRegistered();
1221
+ return parseBeforePrRegistration(...args);
1222
+ };
1223
+ program.parseAsync = (...args: Parameters<typeof program.parseAsync>) => {
1224
+ if (prSelectedForParse(args[0], args[1]?.from)) ensurePrRegistered();
1225
+ return parseAsyncBeforePrRegistration(...args);
1226
+ };
921
1227
  registerRepoCommands(program);
922
1228
  registerRoleCommands(program);
923
1229
  registerMachineCommands(program);
@@ -1278,14 +1584,16 @@ registerDoctorCommand(program);
1278
1584
  registerControlCommands(program);
1279
1585
  registerHooksCommands(program);
1280
1586
  registerSetupCommand(program);
1281
- program.commands.find(command => command.name() === 'setup')!
1282
- .option('--terminal', 'Run the terminal onboarding wizard')
1283
- .hook('preAction', async (_command, action) => {
1284
- if (action.name() === 'setup' && action.opts().terminal) {
1285
- const completed = await runOnboardingForCli();
1286
- process.exit(completed ? 0 : (process.exitCode || 2));
1287
- }
1288
- });
1587
+ if (INDEX_FAST_ROOT !== '__tui_next__') {
1588
+ program.commands.find(command => command.name() === 'setup')!
1589
+ .option('--terminal', 'Run the terminal onboarding wizard')
1590
+ .hook('preAction', async (_command, action) => {
1591
+ if (action.name() === 'setup' && action.opts().terminal) {
1592
+ const completed = await runOnboardingForCli();
1593
+ process.exit(completed ? 0 : (process.exitCode || 2));
1594
+ }
1595
+ });
1596
+ }
1289
1597
  registerStartCommand(program);
1290
1598
  registerGroundingSourcesCli(program);
1291
1599
  registerGraphCommands(program);
@@ -1496,6 +1804,8 @@ program
1496
1804
  )
1497
1805
  // Documentation-only — `readDashboardNameFlag` 가 Commander «전»에 argv 에서 걷어낸다.
1498
1806
  .option('--name <name>', '대시보드 TUI 의 PTY 행(tui:<pid>)에 별명을 달고 뜬다 — `elanous pty list` 에 보이고 `pty snapshot <name>` 으로 부른다. 뜬 뒤 바꾸려면 `elanous pty rename <ref> <name>`.')
1807
+ .option('--legacy', '기존 대시보드 TUI로 시작한다(--tui classic 의 짧은 표기). 기본 진입도 기존 대시보드이며 새 TUI는 --tui next 로만 연다.')
1808
+ .option('--tui <mode>', '루트 TUI를 명시한다(classic|next). 기본은 classic이고 새 TUI는 --tui next 로 연다. --legacy는 classic의 짧은 표기다.')
1499
1809
  .option('--help-all', '시스템 명령을 제외한 모든 최상위 명령 표시');
1500
1810
  program.addHelpText('after', acpServerHelpText());
1501
1811
 
@@ -2325,7 +2635,8 @@ async function runHarnessMissionLoop(
2325
2635
  }
2326
2636
  }
2327
2637
 
2328
- const harnessCmd = installHarnessCliCommand(program, {
2638
+ const harnessCmd = (INDEX_FAST_ROOT ? new Command('harness')
2639
+ : (require('./harness/harness-cli-command.js') as typeof import('./harness/harness-cli-command.js')).installHarnessCliCommand(program, {
2329
2640
  registerSink: async (surface) => { await (await import('./domains/standalone-log-sink.js')).registerStandaloneLogSink(surface); },
2330
2641
  resolveSurface: async () => {
2331
2642
  const { getHarnessSpace, harnessSpaceSurface } = await import('./harness/harness-space.js');
@@ -2339,9 +2650,65 @@ const harnessCmd = installHarnessCliCommand(program, {
2339
2650
  // (그 함수는 planStaged dispatch → 대표 2026-09-04 은퇴한 staged 하니스로 간다).
2340
2651
  // ⇒ 즉 이 «한 줄»이 은퇴를 되돌린다. 주입 자리는 시험용으로 남는다.
2341
2652
  mission: async (missionId, opts) => {
2342
- await dispatchSolveMission({ mission_id: missionId, ...opts });
2653
+ await (await import('./skills/tools/solve-mission.js')).dispatchSolveMission({ mission_id: missionId, ...opts });
2343
2654
  },
2344
2655
  missionLoop: runHarnessMissionLoop,
2656
+ }));
2657
+
2658
+ let podAskSnapshot: string | undefined;
2659
+ let podAskSnapshotCleanup: (() => void) | undefined;
2660
+ harnessCmd.hook('preAction', async (_parent, action) => {
2661
+ if (action.name() === 'ask' && action.opts().substrate === 'pod' && typeof action.args[0] === 'string' && !isGoalAuthorFileName(basename(action.args[0]))) {
2662
+ // Read the source once; onPod and its orchestrator consume the same private snapshot.
2663
+ const askBytes = readFileSync(action.args[0]!);
2664
+ const askText = askBytes.toString('utf8');
2665
+ if (!askText.trim()) throw new Error('--ask 파일 입력이 비었다');
2666
+ const { mkdtempSync, writeFileSync, rmSync } = await import('node:fs');
2667
+ const { tmpdir } = await import('node:os');
2668
+ const { join } = await import('node:path');
2669
+ const snapshotDir = mkdtempSync(join(tmpdir(), 'elanous-ask-snapshot-'));
2670
+ try {
2671
+ const snapshot = join(snapshotDir, basename(action.args[0]!));
2672
+ writeFileSync(snapshot, askBytes, { mode: 0o600 });
2673
+ podAskSnapshot = snapshotDir;
2674
+ podAskSnapshotCleanup = () => {
2675
+ try { rmSync(snapshotDir, { recursive: true, force: true }); }
2676
+ catch (error) { console.error(`[launch-utterance] snapshot cleanup failed: ${String(error)}`); }
2677
+ };
2678
+ process.once('exit', podAskSnapshotCleanup);
2679
+ action.processedArgs[0] = snapshot;
2680
+ } catch (error) {
2681
+ rmSync(snapshotDir, { recursive: true, force: true });
2682
+ throw error;
2683
+ }
2684
+ const { newLaunchUtteranceId, recordLaunchUtterance } = await import('./harness/launch-utterance-ledger.js');
2685
+ recordLaunchUtterance({ source: 'ask-file', utterance: askText, rawBytes: askBytes, launchId: newLaunchUtteranceId() });
2686
+ return;
2687
+ }
2688
+ if (action.name() !== 'say') return;
2689
+ try {
2690
+ const { consumeHandLaunchId, recordLaunchUtterance } = await import('./harness/launch-utterance-ledger.js');
2691
+ const argv = (action.args as string[]).map(String);
2692
+ if (argv.length === 0) return; // nothing was received — no empty start row
2693
+ // New ID per process; only the explicit hand→say pair (same sentence sha ⊕ same run) inherits, once —
2694
+ // and then records the hand's exact original text (recovers a failed hand-parent append in this instance).
2695
+ const { launchId, utterance } = consumeHandLaunchId(argv.join(' '), process.env);
2696
+ recordLaunchUtterance({ source: 'say', utterance, argv, launchId, dryRun: action.opts().dryRun === true });
2697
+ } catch (error) {
2698
+ try { debug.log('harness.launch-utterance', 'prepare-failed', { operation: 'say-hook', reason: String(error) }, { level: 'warn' }); } catch { /* fail-soft */ }
2699
+ }
2700
+ });
2701
+ harnessCmd.hook('postAction', async (_parent, action) => {
2702
+ if (action.name() !== 'ask' || !podAskSnapshot) return;
2703
+ try {
2704
+ const { rmSync } = await import('node:fs');
2705
+ rmSync(podAskSnapshot, { recursive: true, force: true });
2706
+ if (podAskSnapshotCleanup) process.removeListener('exit', podAskSnapshotCleanup);
2707
+ podAskSnapshot = undefined;
2708
+ podAskSnapshotCleanup = undefined;
2709
+ } catch (error) {
2710
+ console.error(`[launch-utterance] snapshot cleanup failed: ${String(error)}`);
2711
+ }
2345
2712
  });
2346
2713
 
2347
2714
  // (internal) 데몬이 dev-harness 를 subprocess 로 위임(#24 A) — 하니스 동기 op 가 데몬 이벤트루프를
@@ -2379,6 +2746,7 @@ harnessCmd
2379
2746
  try { process.stdout.write(line, () => process.exit(code)); }
2380
2747
  catch { process.exit(code); }
2381
2748
  };
2749
+ const { emitDetachedProgress } = await import('./cli/agent-cli.js');
2382
2750
  const detachedCtx = {
2383
2751
  cwd: process.cwd(),
2384
2752
  signal: new AbortController().signal,
@@ -3111,6 +3479,7 @@ export async function runHarnessOrchestrateExecution(
3111
3479
  const { prepareOrchestrateDecomposeGoals } = await import('./self-dev/self-orchestrate-runtime.js');
3112
3480
  return prepareOrchestrateDecomposeGoals(input as never) as Promise<HarnessOrchestratePreparedGoals>;
3113
3481
  });
3482
+ const { buildOrchestrateDecomposePrepareArgs } = await import('./self-dev/self-orchestrate-runtime.js');
3114
3483
  const prepared = await prepareGoals(buildOrchestrateDecomposePrepareArgs({
3115
3484
  request,
3116
3485
  goals,
@@ -4341,7 +4710,7 @@ selfCmd
4341
4710
  .option('--fixed-shard-distribution', '--shards N 과 함께만: RSS 사전 측정 없이 정렬된 파일을 N 조각에 라운드로빈 고정 배정한다(opt-in · 메모리 보증 아님 · 조각 타임아웃/OOM = unmeasured)')
4342
4711
  .option('--include-importers', '변경 모듈을 가져오는 importer 시험도 실행한다 (기본 caller 한도 밖까지)')
4343
4712
  .option('--remote [host]', 'GATE-REMOTE — 같은 커밋을 원격 호스트(기본 config gateRemote.host=node-b)에서 돌리고 결과만 가져온다(깨끗한 트리 · --pr 은 로컬)')
4344
- .option('--local', '원격 자동 분배(로컬 1분 부하 > gateRemote.loadThreshold=20)를 끄고 로컬에서 돌린다')
4713
+ .option('--local', '원격 실행을 끄고 명시적으로 로컬에서 돌린다')
4345
4714
  .option('--artifact-dir <dir>', '조각별 지금/기준 JUnit ⊕ summary.json 을 이 디렉토리에 남긴다(판정 불변 · JUnit 은 --shards 경로만 · 원격 실행이면 그 호스트에서 가져온다)')
4346
4715
  .action(async (opts: { changed?: boolean; base?: string; pr?: string; shards?: string | boolean; fixedShardDistribution?: boolean; includeImporters?: boolean; remote?: string | boolean; local?: boolean; artifactDir?: string }) => {
4347
4716
  if (!opts.changed && opts.shards === undefined) { ui.error('self gate requires --changed or --shards'); process.exitCode = 2; return; }
@@ -4377,8 +4746,8 @@ selfCmd
4377
4746
  if (topLevel.status !== 0) throw new Error(`git rev-parse --show-toplevel failed: ${topLevel.stderr.trim() || `rc=${topLevel.status}`}`);
4378
4747
  const repo = topLevel.stdout.trim();
4379
4748
  // Only a committed --base range is reproducible on another host: the default mode measures uncommitted files, --pr
4380
- // reads files through gh on this host, and the remote checkout runs from the repository root — automatic placement
4381
- // falls back locally; an explicit --remote reports that this check was not measured.
4749
+ // reads files through gh on this host, and the remote checkout runs from the repository root — these cases
4750
+ // fall back locally for automatic placement; an explicitly requested remote run is unmeasured.
4382
4751
  const { realpathSync } = await import('node:fs');
4383
4752
  const localOnlyReason = opts.pr ? 'self gate --pr reads PR files through gh on this host'
4384
4753
  : !opts.base ? 'self gate without --base measures uncommitted files on this host'
@@ -4411,7 +4780,7 @@ selfCmd
4411
4780
  if (outcome.kind === 'ran') {
4412
4781
  target.fetch = fetchRemoteGateArtifacts({ host, remoteDir: target.dir, localDir: resolveArtifactDir(opts.artifactDir!, process.cwd()), ssh: runner.ssh });
4413
4782
  } else if (outcome.kind === 'infra') {
4414
- // The run may have started before it broke — remove the host-side dir; automatic placement's local fallback writes its own.
4783
+ // The run may have started before it broke — remove the host-side dir; remote failure stays unmeasured.
4415
4784
  try { runner.ssh(host, remoteArtifactCleanupScript(target.dir), 30_000); } catch { /* best effort */ }
4416
4785
  }
4417
4786
  }) satisfies NonNullable<import('./self-implement/gate-remote.js').DispatchOptions['onRemoteOutcome']>,
@@ -4419,12 +4788,14 @@ selfCmd
4419
4788
  });
4420
4789
  } catch (error) {
4421
4790
  const reason = error instanceof Error ? error.message : String(error);
4422
- if (opts.remote !== undefined) {
4423
- ui.error(`self gate remote unmeasured — ${reason.replace(/\s+/g, ' ').trim()}`);
4424
- process.exitCode = 1;
4425
- } else {
4791
+ if (opts.local) {
4426
4792
  ui.error(`self gate dispatch failed: ${reason}`);
4427
4793
  process.exitCode = runLocal();
4794
+ } else {
4795
+ ui.error(opts.remote !== undefined
4796
+ ? `self gate remote unmeasured — ${reason.replace(/\s+/g, ' ').trim()}`
4797
+ : `self gate dispatch failed: ${reason}`);
4798
+ process.exitCode = 1;
4428
4799
  }
4429
4800
  }
4430
4801
  // 원격에서 돌았으면 그 호스트의 산출을 가져와 같은 꼴로 썼다 — 못 가져왔으면 «조용히» 비우지 않고 summary 에 이유를 적는다(판정 불변).
@@ -4651,7 +5022,7 @@ const selfOrchestrateCmd = selfCmd
4651
5022
  .option('--no-pod-rebuild', 'pod: 이미지 판(elanous.commit)이 HEAD 와 달라도 다시 굽지 않는다 — 측정은 «이미지 판»을 잰다')
4652
5023
  .option('--pod-pass-env <keys>', 'pod: 호스트 env 에서 Pod 로 넘길 키(쉼표) — 예 OPENROUTER_API_KEY,ANTHROPIC_API_KEY(벤치마크 과금 경로)')
4653
5024
  .option('--bench-arms <spec>', 'pod 벤치마크: 골 1개를 팔마다 «라벨 한 줄만 다르게» 복제해 동시에 — "id=provider[:model][@KEY+KEY];…" (예 codex=openai-codex;or-kimi=openrouter:openrouter/moonshotai/kimi-k3@OPENROUTER_API_KEY) · --auto-merge 거부 · RFC fleet 슈퍼바이저 §A3')
4654
- .addOption(new Option('--child-llm-provider <id>', 'pod: 구현 자식 LLM provider(openai-codex|grok|openrouter|anthropic|bedrock|glm) — 하니스 --child-llm-provider 가 이 자리로 온다(10-05)').hideHelp())
5025
+ .addOption(new Option('--child-llm-provider <id>', 'pod: 구현 자식 LLM provider(openai-codex|grok|openrouter|opengateway|anthropic|bedrock|glm) — 하니스 --child-llm-provider 가 이 자리로 온다(10-05)').hideHelp())
4655
5026
  .addOption(new Option('--child-llm-model <id>', 'pod: 구현 자식 LLM model(--child-llm-provider 와 함께)').hideHelp())
4656
5027
  .addOption(new Option('--child-llm-effort <level>', 'pod: 구현 자식 추론 노력(--child-llm-provider 와 함께)').hideHelp())
4657
5028
  .option('--help-all', '모든 orchestrate 옵션 표시')
@@ -4729,7 +5100,7 @@ const selfOrchestrateCmd = selfCmd
4729
5100
  let parentRequest: string | undefined;
4730
5101
  const request = normalizeOrchestrateRequest(joined);
4731
5102
  if (opts.decompose) parentRequest = request;
4732
- const { prepareOrchestrateDecomposeGoals } = await import('./self-dev/self-orchestrate-runtime.js');
5103
+ const { prepareOrchestrateDecomposeGoals, buildOrchestrateDecomposePrepareArgs } = await import('./self-dev/self-orchestrate-runtime.js');
4733
5104
  const prepared = await prepareOrchestrateDecomposeGoals(buildOrchestrateDecomposePrepareArgs({
4734
5105
  request,
4735
5106
  goals: goalTexts.map((feature) => ({ feature, ...promoteDefaults })),
@@ -4941,6 +5312,35 @@ const selfOrchestrateCmd = selfCmd
4941
5312
  const grokKeyNames = ['XAI_API_KEY', 'GROK_API_KEY', 'GROK_CODE_XAI_API_KEY'];
4942
5313
  // 명시 계정은 사람의 선택 — 공급자 폴백과 계정 브로커를 우회한다.
4943
5314
  const explicitPodAccount = (opts as { podAccount?: string }).podAccount;
5315
+ const ownerMirrorRaw = process.env.ELANOUS_REMOTE_CODEX_ACCOUNTS;
5316
+ let ownerMirrorAccounts: import('./task-orchestrator/surfaces/pod-account-broker.js').OwnerCodexMirrorAccount[] | undefined;
5317
+ if (ownerMirrorRaw !== undefined) {
5318
+ try { ownerMirrorAccounts = (await import('./task-orchestrator/surfaces/pod-account-broker.js')).parseOwnerCodexMirrorAccounts(ownerMirrorRaw); }
5319
+ catch { ui.error('pod: HQ Codex 미러 계정 목록이 유효하지 않다'); process.exit(2); }
5320
+ const { freshOwnerCodexMirrorAccounts } = await import('./task-orchestrator/surfaces/pod-account-broker.js');
5321
+ const fresh = freshOwnerCodexMirrorAccounts(ownerMirrorAccounts);
5322
+ for (const { account } of ownerMirrorAccounts.filter(({ account }) => !fresh.some((item) => item.account === account))) {
5323
+ debug.log('self-implement.pod', 'owner-access-mirror-excluded', { account, reason: 'access-expiring' });
5324
+ }
5325
+ ownerMirrorAccounts = fresh;
5326
+ if (fresh.length === 0) { ui.error('pod: HQ Codex 미러 access token 이 모두 3시간 안에 만료된다'); process.exit(2); }
5327
+ }
5328
+ const ownerMirrorAccount = ownerMirrorAccounts?.[0]?.account ?? process.env.ELANOUS_REMOTE_CODEX_ACCOUNT?.trim();
5329
+ const childProvider = opts as { childLlmProvider?: string };
5330
+ const requestedChildProvider = childProvider.childLlmProvider?.trim();
5331
+ if (ownerMirrorAccount && explicitPodAccount && !(ownerMirrorAccounts?.some(({ account }) => account === explicitPodAccount) ?? explicitPodAccount === ownerMirrorAccount)) {
5332
+ ui.error(`pod: HQ 미러 계정 목록에 --pod-account ${explicitPodAccount} 이 없다`);
5333
+ process.exit(2);
5334
+ }
5335
+ if (ownerMirrorAccount && requestedChildProvider && requestedChildProvider !== 'openai-codex') {
5336
+ const reason = `pod: HQ 미러 계정 ${ownerMirrorAccount} 은 openai-codex 전용이라 --child-llm-provider ${requestedChildProvider} 을 사용할 수 없다`;
5337
+ ui.error(reason);
5338
+ debug.log('self-implement.pod', 'child-provider-refused', { provider: requestedChildProvider, reason });
5339
+ process.exit(2);
5340
+ }
5341
+ // An owner mirror pins the Pod child to that access-only Codex account; do not let a configured
5342
+ // podChildDefault route the child to an unrelated provider.
5343
+ if (ownerMirrorAccount && !requestedChildProvider) childProvider.childLlmProvider = 'openai-codex';
4944
5344
  let accountBroker: (() => string) | undefined;
4945
5345
  let rotationAccounts: readonly string[] | undefined;
4946
5346
  let podProvider: import('./task-orchestrator/surfaces/pod-child-providers.js').PodChildProvider = 'openai-codex';
@@ -4980,7 +5380,7 @@ const selfOrchestrateCmd = selfCmd
4980
5380
  ? 'pod: --child-llm-model/--child-llm-effort 는 --child-llm-provider 와 함께'
4981
5381
  : named && benchArms
4982
5382
  ? 'pod: --child-llm-provider 는 --bench-arms 와 함께 못 쓴다(팔마다 모델이 하나다)'
4983
- : (named === 'grok' || named === 'openrouter' || named === 'anthropic' || named === 'bedrock' || named === 'glm') && explicitPodAccount
5383
+ : (named === 'grok' || named === 'openrouter' || named === 'opengateway' || named === 'anthropic' || named === 'bedrock' || named === 'glm') && explicitPodAccount
4984
5384
  ? `pod: --child-llm-provider ${named} 은 --pod-account 와 함께 못 쓴다(그것은 codex 계정을 고정한다)`
4985
5385
  : undefined;
4986
5386
  if (refuse) { ui.error(refuse); debug.log('self-implement.pod', 'child-provider-refused', { provider: named ?? null, reason: refuse }); process.exit(2); }
@@ -5032,7 +5432,8 @@ const selfOrchestrateCmd = selfCmd
5032
5432
  }
5033
5433
  }
5034
5434
  // 10-05 PODPROVIDER: a launch that named the child provider gets it, or is refused — never a silent codex.
5035
- const namedChild = (opts as { childLlmProvider?: string }).childLlmProvider?.trim();
5435
+ const explicitChild = (opts as { childLlmProvider?: string }).childLlmProvider?.trim();
5436
+ const namedChild = ownerMirrorAccount && !explicitChild ? 'openai-codex' : explicitChild;
5036
5437
  const { podNamedChildProvider, podFallbackCredentials, podGrokSubscriptionUsable: namedGrokUsable } = await import('./task-orchestrator/surfaces/self-implement-pod.js');
5037
5438
  const { readFileSync: readPodKeyFile } = await import('node:fs');
5038
5439
  const { homedir: podHome } = await import('node:os');
@@ -5041,23 +5442,48 @@ const selfOrchestrateCmd = selfCmd
5041
5442
  if (namedChild === 'openrouter' && !openrouterKeyPresent) {
5042
5443
  try { openrouterKeyPresent = Boolean(readPodKeyFile(podJoin(podHome(), '.cache', 'openrouter_api_key'), 'utf8').trim()); } catch { /* missing host cache */ }
5043
5444
  }
5445
+ const openGatewayKeyPresent = namedChild === 'opengateway' && Boolean(
5446
+ (await import('./config.js')).getOpenGatewayApiKey()?.trim()
5447
+ || configuredOpenGatewayKeys(getUserConfig().llm).length);
5044
5448
  // POD-ANTHROPIC-PROVIDER — 제품 자격 해석(`getAnthropicApiKey` · 키 캐시 → env)으로 «있나»만 본다(값은 안 싣는다).
5045
5449
  const anthropicKeyPresent = namedChild === 'anthropic' && Boolean((await import('./config.js')).getAnthropicApiKey()?.trim());
5046
5450
  const namedChildDecision = podNamedChildProvider(namedChild, {
5047
5451
  grokSubscription: namedChild === 'grok' && credential?.kind === 'subscription' && (grokSubscriptionUsable || namedGrokUsable().usable),
5048
5452
  grokApiKey: credential?.kind === 'api_key' && grokApiKeyOptIn,
5049
5453
  openrouterKey: openrouterKeyPresent,
5454
+ openGatewayKey: openGatewayKeyPresent,
5050
5455
  anthropicKey: anthropicKeyPresent,
5051
5456
  }, (opts as { childLlmModel?: string }).childLlmModel);
5052
5457
  if (namedChildDecision.refuse) { ui.error(namedChildDecision.refuse); debug.log('self-implement.pod', 'child-provider-refused', { provider: namedChild, reason: namedChildDecision.refuse }); process.exit(2); }
5053
5458
  // A named codex child must stay codex — the plan may not fall back to grok (post-review must-fix).
5054
5459
  const namedCodex = namedChildDecision.provider === 'openai-codex';
5055
- const plan: import('./task-orchestrator/surfaces/pod-account-broker.js').PodProviderPlan | null = namedChildDecision.provider === 'openrouter' || namedChildDecision.provider === 'anthropic' || namedChildDecision.provider === 'bedrock' || namedChildDecision.provider === 'glm' ? null : namedChildDecision.provider === 'grok'
5460
+ let planCandidates = inspectCodexRotation().candidates;
5461
+ if (ownerMirrorAccounts) {
5462
+ const { selectOwnerCodexMirrorCandidates } = await import('./task-orchestrator/surfaces/pod-account-broker.js');
5463
+ try { planCandidates = selectOwnerCodexMirrorCandidates(planCandidates, ownerMirrorAccounts); }
5464
+ catch { ui.error('pod: HQ Codex 미러 계정 일부가 원격 auth-store 후보에 없다'); process.exit(2); }
5465
+ } else if (ownerMirrorAccount) {
5466
+ const used = process.env.ELANOUS_REMOTE_CODEX_USED_PERCENT;
5467
+ const parsedUsed = used && used !== 'unknown' ? Number(used) : undefined;
5468
+ const threshold = Number(process.env.ELANOUS_REMOTE_CODEX_THRESHOLD_PERCENT);
5469
+ if (!Number.isFinite(threshold) || threshold <= 0 || threshold > 100) {
5470
+ ui.error('pod: HQ Codex 미러의 유효 임계 표지가 없어 발사를 거부한다');
5471
+ process.exit(2);
5472
+ }
5473
+ const { ownerCodexMirrorCandidate } = await import('./task-orchestrator/surfaces/pod-account-broker.js');
5474
+ planCandidates = ownerCodexMirrorCandidate(planCandidates, ownerMirrorAccount, parsedUsed !== undefined && Number.isFinite(parsedUsed) ? parsedUsed : undefined);
5475
+ if (planCandidates.length === 0) { ui.error(`pod: HQ Codex 미러 계정 ${ownerMirrorAccount} 이 원격 auth-store 후보에 없다`); process.exit(2); }
5476
+ }
5477
+ const plan: import('./task-orchestrator/surfaces/pod-account-broker.js').PodProviderPlan | null = namedChildDecision.provider === 'openrouter' || namedChildDecision.provider === 'opengateway' || namedChildDecision.provider === 'anthropic' || namedChildDecision.provider === 'bedrock' || namedChildDecision.provider === 'glm' ? null : namedChildDecision.provider === 'grok'
5056
5478
  ? { provider: 'grok', excluded: [], grokSubscriptionEligible: credential?.kind === 'subscription' }
5057
5479
  : planPodProvider({
5058
- codexCandidates: inspectCodexRotation().candidates,
5480
+ codexCandidates: planCandidates,
5059
5481
  // Per-account caps (대표 default:97) override the Pod default cap — without them default was dropped at 60%.
5060
- thresholdPercentByAccount: launchPolicy.llm?.codexAccountRotationThresholdPercentByAccount,
5482
+ thresholdPercentByAccount: ownerMirrorAccounts
5483
+ ? Object.fromEntries(ownerMirrorAccounts.map(({ account, thresholdPercent }) => [account, thresholdPercent]))
5484
+ : ownerMirrorAccount
5485
+ ? { [ownerMirrorAccount]: Number(process.env.ELANOUS_REMOTE_CODEX_THRESHOLD_PERCENT) }
5486
+ : launchPolicy.llm?.codexAccountRotationThresholdPercentByAccount,
5061
5487
  // 대표 한도 정책 한 값(`llm.codexQuotaPolicy`) — 크레딧·폴백을 같이 정한다.
5062
5488
  creditsAllowed: codexPolicyAllowsCredits(quotaPolicy),
5063
5489
  // SUBSCRIPTION-EXHAUST-REROUTE — 예비분 이하 잔액(«알려진» 값)의 계정은 크레딧으로 쓰지 않는다.
@@ -5076,7 +5502,7 @@ const selfOrchestrateCmd = selfCmd
5076
5502
  })() } : {}),
5077
5503
  });
5078
5504
  if (plan?.provider === null) { ui.error(`pod: 쓸 codex 계정이 없다 — ${plan.reasons.join(' · ')}${namedCodex ? ' · child provider 를 openai-codex 로 지정해 grok 으로 넘기지 않는다' : ''} · 계정을 명시하려면 --pod-account <이름>`); process.exit(2); }
5079
- podProvider = namedChildDecision.provider === 'openrouter' || namedChildDecision.provider === 'anthropic' || namedChildDecision.provider === 'bedrock' || namedChildDecision.provider === 'glm' ? namedChildDecision.provider : plan!.provider!;
5505
+ podProvider = namedChildDecision.provider === 'openrouter' || namedChildDecision.provider === 'opengateway' || namedChildDecision.provider === 'anthropic' || namedChildDecision.provider === 'bedrock' || namedChildDecision.provider === 'glm' ? namedChildDecision.provider : plan!.provider!;
5080
5506
  if (plan?.provider === 'openai-codex') {
5081
5507
  accountBroker = makePodAccountBroker({ usable: plan.accounts, excluded: plan.excluded });
5082
5508
  rotationAccounts = plan.accounts;
@@ -5089,6 +5515,10 @@ const selfOrchestrateCmd = selfCmd
5089
5515
  const model = (opts as { childLlmModel?: string }).childLlmModel!.trim();
5090
5516
  debug.log('self-implement.pod', 'provider-named', { provider: 'openrouter', model, openrouterKeyPresent: true });
5091
5517
  if (!opts.json) ui.info(`[pod] child provider = openrouter(모델 ${model}) — 발사 인자로 지정됨`);
5518
+ } else if (namedChildDecision.provider === 'opengateway') {
5519
+ const model = (opts as { childLlmModel?: string }).childLlmModel!.trim();
5520
+ debug.log('self-implement.pod', 'provider-named', { provider: 'opengateway', model, openGatewayKeyPresent: true, billing: 'api-key' });
5521
+ if (!opts.json) ui.info(`[pod] child provider = opengateway(모델 ${model}) — 발사 인자로 지정됨 · API 키 과금`);
5092
5522
  } else if (namedChildDecision.provider === 'anthropic') {
5093
5523
  const model = (opts as { childLlmModel?: string }).childLlmModel?.trim() || null;
5094
5524
  // ⓔ 과금 관측 — anthropic 은 API 키 과금(구독 아님). 새 예산 체계는 없다 · 관측 한 줄만.
@@ -5117,7 +5547,7 @@ const selfOrchestrateCmd = selfCmd
5117
5547
  if (!opts.json) ui.info(`[pod] 쓸 codex 계정 없음(${plan.excluded.map((x) => `${x.name}: ${x.why}`).join(' · ')}) → grok 으로(모델 ${model})`);
5118
5548
  }
5119
5549
  }
5120
- const passEnv = podProvider === 'grok' ? requestedPassEnv.filter((key) => !grokKeyNames.includes(key)) : podProvider === 'openrouter' ? [...new Set([...requestedPassEnv, 'OPENROUTER_API_KEY'])] : podProvider === 'anthropic' ? [...new Set([...requestedPassEnv, 'ANTHROPIC_API_KEY'])] : requestedPassEnv;
5550
+ const passEnv = podProvider === 'grok' ? requestedPassEnv.filter((key) => !grokKeyNames.includes(key)) : podProvider === 'openrouter' ? [...new Set([...requestedPassEnv, 'OPENROUTER_API_KEY'])] : podProvider === 'opengateway' ? [...new Set([...requestedPassEnv, 'OPENGATEWAY_API_KEY'])] : podProvider === 'anthropic' ? [...new Set([...requestedPassEnv, 'ANTHROPIC_API_KEY'])] : requestedPassEnv;
5121
5551
  const podSourceSpec = (opts as { podSource?: string }).podSource;
5122
5552
  const repairBaseHead = (opts as { repairCommitOnly?: string }).repairCommitOnly;
5123
5553
  if (repairBaseHead && (!/^pr:[1-9]\d*$/.test(podSourceSpec ?? '') || !/^[0-9a-f]{40}$/.test(repairBaseHead) || opts.autoMerge || opts.openPr || goalTexts.length !== 1)) {
@@ -5426,7 +5856,7 @@ selfCmd
5426
5856
  .action(async (space: string | undefined, opts: { stop?: boolean; memo?: string; run?: string; includeStale?: boolean; readWait?: string }) => {
5427
5857
  const { classifyRunScreenMissing, queryRunScreenKey, listRunLedgers } = await import('./self-implement/run-ledger.js');
5428
5858
  const { getPtyManifest, listPtyManifestRows } = await import('./pty-shell/pty-manifest.js');
5429
- const { readPodFragment, podFragmentFinished, listPodFragmentsForRun, dispatchPodSelfSend } = await import('./harness/self-send-target.js');
5859
+ const { readPodFragment, podFragmentFinished, listPodFragmentsForRun, dispatchPodSelfSend, resolveSelfSendTarget } = await import('./harness/self-send-target.js');
5430
5860
  const { listHarnessScreens, readHarnessHeartbeat } = await import('./harness/harness-screen.js');
5431
5861
  const decision = decideSelfSend({ space, opts, now: Date.now() }, {
5432
5862
  resolveRunScreen: (runId) => {
@@ -5755,12 +6185,13 @@ selfCmd
5755
6185
  .option('--acp', '⭐ ACP(독립 프로세스)로 리뷰 — API 대신 선택한 ACP 백엔드로 독립 리뷰')
5756
6186
  .option('--acp-model <alias>', 'ACP 모델 tier (지정 시 고정, 생략 시 선택한 백엔드 기본값)')
5757
6187
  .option('--acp-backend <id>', 'ACP 백엔드 id (기본: 설정 acp.reviewBackend, 없으면 공유 기본값)')
5758
- .option('--acp-timeout <sec>', 'ACP 리뷰 1턴 최대 대기 초(초과 시 cancel·기본 300)', '300')
6188
+ .option('--acp-timeout <sec>', 'ACP 리뷰 1턴 최대 대기 초(초과 시 cancel·기본 claude 600 · 그 외 300)')
5759
6189
  .option('--context <path>', '리뷰어가 함께 판단할 레포 상대 파일 경로(반복 가능)', (value: string, previous: string[] = []) => [...previous, value])
5760
6190
  .option('--context-text <text>', '리뷰어가 함께 판단할 텍스트(반복 가능)', (value: string, previous: string[] = []) => [...previous, value])
5761
6191
  .option('--json', '구조화 출력 {pr, verdict, mustFix, shouldFix, reviewed}')
5762
6192
  .option('--save <name>', '리뷰 결과를 상태 디렉터리의 review-results/<name>-<PR>-<head12>.json에 저장')
5763
- .action(async (prParts: string[], opts: { intent?: string; model?: string; acp?: boolean; acpModel?: string; acpBackend?: string; acpTimeout?: string; context?: string[]; contextText?: string[]; json?: boolean; save?: string }) => {
6193
+ .option('--over-cap-reason <reason>', '저장 리뷰 r5 상한 이후 이번 호출 1회 예외 사유(doctor.review cap-override 기록)')
6194
+ .action(async (prParts: string[], opts: { intent?: string; model?: string; acp?: boolean; acpModel?: string; acpBackend?: string; acpTimeout?: string; context?: string[]; contextText?: string[]; json?: boolean; save?: string; overCapReason?: string }) => {
5764
6195
  const prArgs = prParts.flatMap((p) => String(p).split(/[,\s]+/).filter(Boolean)); // 번호/#번호/URL·콤마목록.
5765
6196
  if (!prArgs.length) { ui.error('PR 필요: elanous self review <번호|URL> [..]'); process.exit(2); }
5766
6197
  // ⭐ 본문은 seam(`runSelfReviewCliCommand`)에 있다 — 이 액션은 **의존 배선만** 한다.
@@ -5770,10 +6201,10 @@ selfCmd
5770
6201
  const { spawnSync } = await import('node:child_process');
5771
6202
  const { reviewPullRequest, renderReview } = await import('./agent-substrate/pr-reviewer.js');
5772
6203
  const { createRepositoryReferencedFileReader } = await import('./self-implement/goal-file-reader.js');
5773
- const { streamLLM, getProvider } = await import('./llm.js');
6204
+ const { streamLLM, getProvider, getProviderForConfig } = await import('./llm.js');
5774
6205
  const { registerStandaloneLogSink } = await import('./domains/standalone-log-sink.js');
5775
6206
  const { debug } = await import('./debug/log.js');
5776
- const { runSelfReviewCliCommand, reviewerContextArgs, selfReviewJsonLine } = await import('./agent-substrate/self-review-cli.js');
6207
+ const { apiReviewModelFromRoleSpec, runSelfReviewCliCommand, reviewerContextArgs, selfReviewJsonLine } = await import('./agent-substrate/self-review-cli.js');
5777
6208
  const { subscriptionReviewerAvailability } = await import('./self-dev/review-provider-fallback.js');
5778
6209
  const { makeLazyAcpReviewLLM: makeRoleAcpReviewLLM } = await import('./agent-substrate/acp-reviewer.js');
5779
6210
  const { getOpenRouterApiKey: getOpenRouterApiKeyForReview } = await import('./config.js');
@@ -5784,8 +6215,12 @@ selfCmd
5784
6215
  // The seam decides whether it applies (only without an explicit reviewer flag).
5785
6216
  const { loadLlmPolicy, resolveSubscriptionReviewer } = await import('./policy/llm-policy.js');
5786
6217
  const roleReviewerSelection = resolveSubscriptionReviewer(loadLlmPolicy(), getUserConfig().roleLlm);
6218
+ const reviewRoleSpec = getUserConfig().roleLlm?.review;
6219
+ const configuredReviewModel = apiReviewModelFromRoleSpec(reviewRoleSpec);
5787
6220
  const { results, failed } = await runSelfReviewCliCommand(prArgs, {
5788
6221
  ...opts,
6222
+ ...(configuredReviewModel ? { configuredReviewModel } : {}),
6223
+ ...(configuredReviewModel && reviewRoleSpec?.provider ? { configuredReviewProvider: reviewRoleSpec.provider } : {}),
5789
6224
  ...(configuredAcpBackend ? { configuredAcpBackend } : {}),
5790
6225
  ...(roleReviewerSelection ? { roleReviewer: roleReviewerSelection.spec } : {}),
5791
6226
  ...(contextOrder.length > 0 ? { contextOrder } : {}),
@@ -5809,15 +6244,29 @@ selfCmd
5809
6244
  // 명시 `--model` 이면 provider 를 그 모델의 것으로 «고정»한다 — 라우터 폴백(grok 등)으로 조용히 넘어가지 않고 오류로 낸다.
5810
6245
  makeApiLlm: (model, o) => {
5811
6246
  const effort = reviewReasoningEffort(resolveRoleLlm('review'));
5812
- return (prompt: string) =>
5813
- streamLLM([{ role: 'user', content: prompt }], () => {}, {
6247
+ return (prompt: string) => {
6248
+ let configuredProvider;
6249
+ if (o?.providerName) {
6250
+ try {
6251
+ const config = getUserConfig();
6252
+ configuredProvider = getProviderForConfig({ ...config, llm: { ...config.llm, provider: o.providerName } }, model);
6253
+ } catch (error) {
6254
+ debug.log('self-review', 'role-review-config-provider-error', {
6255
+ provider: o.providerName, model, source: 'roleLlm.review',
6256
+ reason: error instanceof Error ? error.message : String(error),
6257
+ }, { level: 'error' });
6258
+ throw error;
6259
+ }
6260
+ }
6261
+ return streamLLM([{ role: 'user', content: prompt }], () => {}, {
5814
6262
  model,
5815
6263
  // ⛔ 어댑터 기본 2048 은 리뷰 응답을 자른다(VERDICT/MUST-FIX 줄이 잘리면 reviewed=false 로 접힌다).
5816
6264
  maxTokens: 16_000,
5817
- ...(o?.pinProvider ? { provider: getProvider(model) } : {}),
6265
+ ...(configuredProvider ? { provider: configuredProvider } : o?.pinProvider ? { provider: getProvider(model) } : {}),
5818
6266
  ...(o?.onResolved ? { onResolvedProvider: o.onResolved } : {}),
5819
6267
  ...(effort ? { reasoningEffort: effort } : {}),
5820
6268
  });
6269
+ };
5821
6270
  },
5822
6271
  makeAcpLlm: (o) => {
5823
6272
  // ⚠️ 동기 팩토리라 여기서 동적 import 를 쓸 수 없다 — 지연 로드해 첫 호출에 붙인다.
@@ -5851,6 +6300,17 @@ selfCmd
5851
6300
  roleFallbackModel: () => (getOpenRouterApiKeyForReview()?.trim() ? ROLE_REVIEWER_FALLBACK_MODEL : undefined),
5852
6301
  registerSink: async (surface) => { await registerStandaloneLogSink(surface); },
5853
6302
  log: (event, data, o) => debug.log('self-review', event, data, o ?? {}),
6303
+ observeDoctorReview: (event, data, o) => debug.log('doctor.review', event, data, o ?? {}),
6304
+ loadDoctorReviewBrief: async ({ pr, head, title, body, changedFiles }) => {
6305
+ // MK's doctor module is a separate PR. Until it lands, keep the original intent and record brief-unavailable.
6306
+ const modulePath = './self-implement/review-round-brief.js';
6307
+ const { effectiveInstanceRoot } = await import('./instance/resolve.js');
6308
+ const doctor = await import(modulePath) as {
6309
+ loadReviewRoundBrief(input: { pr: number; head: string; title: string; body: string; changedFiles: string[]; reviewResultsDir: string }): unknown;
6310
+ renderReviewBriefIntentBlock(brief: unknown): string | null;
6311
+ };
6312
+ return doctor.renderReviewBriefIntentBlock(doctor.loadReviewRoundBrief({ pr, head, title, body, changedFiles, reviewResultsDir: _joinPath(effectiveInstanceRoot(), 'review-results') }));
6313
+ },
5854
6314
  info: (t) => ui.info(t),
5855
6315
  error: (t) => ui.error(t),
5856
6316
  print: (t) => console.log(t),
@@ -6176,7 +6636,36 @@ async function loadJevAccessOrExit(): Promise<import('./decide/jev.js').JevAcces
6176
6636
  registerIntakeCommands(program);
6177
6637
 
6178
6638
  registerLogsCommands(program);
6179
- registerSimCommands(program);
6639
+ // Keep the sim command in its public slot until either CLI or direct Commander
6640
+ // parsing selects it (or asks for help). The domain registrar owns its definition.
6641
+ const simCommandOrder = program.commands.length;
6642
+ program.command('sim').description('격리 시나리오를 실행하고 화면·로그 기대값을 대조한다');
6643
+ const parseWithRegisteredCommands = program.parse.bind(program);
6644
+ const parseAsyncWithRegisteredCommands = program.parseAsync.bind(program);
6645
+ let simRegistered = false;
6646
+ function ensureSimRegistered(): void {
6647
+ if (simRegistered) return;
6648
+ const { registerSimCommands } = require('./cli/sim-cli.js') as typeof import('./cli/sim-cli.js');
6649
+ const commands = program.commands as Command[];
6650
+ commands.splice(simCommandOrder, 1);
6651
+ registerSimCommands(program);
6652
+ const registered = commands.pop()!;
6653
+ commands.splice(simCommandOrder, 0, registered);
6654
+ simRegistered = true;
6655
+ }
6656
+ function simSelectedForParse(argv: readonly string[] | undefined, from?: string): boolean {
6657
+ const { command, next, rootHelp } = selectedRootArgs(argv, from);
6658
+ return command === 'sim' || (command === 'help' && next === 'sim')
6659
+ || (!command && rootHelp);
6660
+ }
6661
+ program.parse = (...parseArgs: Parameters<typeof program.parse>) => {
6662
+ if (simSelectedForParse(parseArgs[0], parseArgs[1]?.from)) ensureSimRegistered();
6663
+ return parseWithRegisteredCommands(...parseArgs);
6664
+ };
6665
+ program.parseAsync = (...parseArgs: Parameters<typeof program.parseAsync>) => {
6666
+ if (simSelectedForParse(parseArgs[0], parseArgs[1]?.from)) ensureSimRegistered();
6667
+ return parseAsyncWithRegisteredCommands(...parseArgs);
6668
+ };
6180
6669
 
6181
6670
  // ── ad (marketing-ad pipeline entrance) ──
6182
6671
  /** ⛔ 「있다」와 「읽을 수 있는 파일이다」는 다른 값 — 디렉토리·권한 없는 파일을 실사로 읽지 않는다. */
@@ -6330,7 +6819,8 @@ program.command('env').description('환경 감지')
6330
6819
  // src/agent-mission/·관측 카테고리 agent-mission·U1 핸드오프 용어와 정합) — 최상위 `agent`(single-turn
6331
6820
  // chat-with-tools)가 이미 점유해 충돌하므로 그 이름은 못 쓴다. 기존 cron/스크립트(`elanous codex review-watch`
6332
6821
  // 등)는 commander alias 로 그대로 resolvable(하위호환 불변). 상태경로 codex-mission 은 별도로 보존(아래 락/DB).
6333
- const agentBackendHelpNames = agentBackendNames();
6822
+ const agentBackendHelpNames = INDEX_FAST_ROOT ? []
6823
+ : (require('./agent-mission/driver.js') as typeof import('./agent-mission/driver.js')).agentBackendNames();
6334
6824
  const agentBackendHelpList = agentBackendHelpNames.map((name, index) => index === 0 ? `${name}[디폴트]` : name).join('·');
6335
6825
  const agentCmd = program
6336
6826
  .command('agent-mission')
@@ -6718,7 +7208,7 @@ agentCmd
6718
7208
  let initialReviewer: ((pr: string) => Promise<{ verdict: import('./agent-mission/review-loop.js').ReviewVerdict; asks: string[] } | null>) | undefined;
6719
7209
  if (opts.autoInitialReview === true && opts.dryRun !== true) {
6720
7210
  const { reviewDiffBudgetObservation, reviewPullRequest } = await import('./agent-substrate/pr-reviewer.js');
6721
- const { makeAcpReviewLLM } = await import('./agent-substrate/acp-reviewer.js');
7211
+ const { makeAcpReviewLLM, DEFAULT_REVIEW_BACKEND } = await import('./agent-substrate/acp-reviewer.js');
6722
7212
  const { mapReviewToInjected } = await import('./agent-mission/pr-review-watch.js');
6723
7213
  const { execFileSync } = await import('node:child_process');
6724
7214
  const { lookupPrGoalAcceptance } = await import('./self-implement/run-ledger.js');
@@ -6780,6 +7270,7 @@ agentCmd
6780
7270
  .command('setup')
6781
7271
  .description('One command: OAuth / API-key auth + model picker + save config')
6782
7272
  .action(async () => {
7273
+ const { realIO } = await import('./onboarding.js');
6783
7274
  const io = realIO();
6784
7275
  try {
6785
7276
  await runCodexSetup({ io });
@@ -7580,7 +8071,7 @@ const selfDevCmd = program
7580
8071
  humanReadableOutput: !opts.json,
7581
8072
  gitResidueSnapshot: { path: gitResiduePath, observation: gitResidue },
7582
8073
  }, {
7583
- runChatTurn: (text, chat) => runChatTurnCli({
8074
+ runChatTurn: async (text, chat) => (await import('./cli/agent-cli.js')).runChatTurnCli({
7584
8075
  cfg: reloadUserConfig(),
7585
8076
  userText: text,
7586
8077
  explicitSessionId: chat.session,
@@ -8128,7 +8619,7 @@ program
8128
8619
  return;
8129
8620
  }
8130
8621
  const cfg = reloadUserConfig();
8131
- await runChatTurnCli({
8622
+ await (await import('./cli/agent-cli.js')).runChatTurnCli({
8132
8623
  cfg,
8133
8624
  userText: parts.join(' '),
8134
8625
  explicitSessionId: opts.session,
@@ -8248,6 +8739,7 @@ program
8248
8739
  .option('--config <path>', 'Load answers from a JSON answer file (overrides interactive prompts)')
8249
8740
  .option('--non-interactive', 'Run without prompts — resolve all answers from --config + env vars')
8250
8741
  .action(async (step: string | undefined, opts: { config?: string; nonInteractive?: boolean }) => {
8742
+ const { runOnboarding, runOnboardingStep, runOnboardingNonInteractive } = await import('./onboarding.js');
8251
8743
  // C-4e (cleanup ROADMAP 2026-05-08) restricted `elanous setup <step>`
8252
8744
  // to llm/skills/obsidian. Telegram/Discord setup migrated to NEXUS
8253
8745
  // — `elanous channel-setup --platform telegram|discord` (Track Q).
@@ -8521,7 +9013,8 @@ sessionCmd
8521
9013
  sessionCmd
8522
9014
  .command('new')
8523
9015
  .description('Create a fresh session and mark it active')
8524
- .action(() => {
9016
+ .action(async () => {
9017
+ const { ensureCliSession } = await import('./session/chat.js');
8525
9018
  const cfg = getUserConfig();
8526
9019
  const s = ensureCliSession(cfg);
8527
9020
  setActiveSessionId(s.id);
@@ -8550,7 +9043,8 @@ sessionCmd
8550
9043
  .command('show [prefix]')
8551
9044
  .description('Print the messages of a session (default: active)')
8552
9045
  .option('--include-tools', 'Include tool-call telemetry (role:tool · 실제 호출 도구·args·result 추적)')
8553
- .action((prefix: string | undefined, opts: { includeTools?: boolean }) => {
9046
+ .action(async (prefix: string | undefined, opts: { includeTools?: boolean }) => {
9047
+ const { sessionBudget } = await import('./session/chat.js');
8554
9048
  const id = prefix ? resolveSessionId(prefix) : getActiveSessionId();
8555
9049
  if (!id) { ui.error('no session'); process.exit(1); }
8556
9050
  const loaded = loadSession(id);
@@ -8969,6 +9463,7 @@ async function runFirstSetupForCli(cfg: ReturnType<typeof getUserConfig>, announ
8969
9463
  }
8970
9464
 
8971
9465
  async function runOnboardingForCli(): Promise<boolean> {
9466
+ const { runOnboarding, handleOnboardingRefusal } = await import('./onboarding.js');
8972
9467
  try {
8973
9468
  await runOnboarding();
8974
9469
  return true;
@@ -9013,7 +9508,7 @@ program
9013
9508
  }
9014
9509
  if (opts.tools) announceChatToolsCompatibility();
9015
9510
  const cfg = getUserConfig();
9016
- if (await firstChatGate(cfg, {
9511
+ if (await (await import('./onboarding/first-chat-gate.js')).firstChatGate(cfg, {
9017
9512
  isTTY: process.stdin.isTTY === true,
9018
9513
  runFirstRun: async (deps) => (await import('./onboarding/first-run.js')).runFirstRun(deps),
9019
9514
  runInteractive: () => {
@@ -9044,7 +9539,7 @@ program
9044
9539
  // 단일 턴 엔진(runChatTurnCli)은 cfg-바인딩 클로저로 주입(순환 회피). opts→DevChatOpts 매핑은 seam.
9045
9540
  const { runChatCliCommand } = await import('./chat/chat-cli.js');
9046
9541
  await runChatCliCommand(parts.join(' '), opts, {
9047
- runChatTurn: (text, chat) => runChatTurnCli({
9542
+ runChatTurn: async (text, chat) => (await import('./cli/agent-cli.js')).runChatTurnCli({
9048
9543
  cfg: refreshed,
9049
9544
  userText: text,
9050
9545
  explicitSessionId: chat.session,
@@ -9089,7 +9584,7 @@ program
9089
9584
  process.exit(2);
9090
9585
  }
9091
9586
  const cfg = getUserConfig();
9092
- if (needsOnboarding(cfg)) {
9587
+ if ((await import('./onboarding.js')).needsOnboarding(cfg)) {
9093
9588
  if (cfg.onboarding.webFirst === false) ui.info('No config yet — launching setup wizard first.');
9094
9589
  if (!await runFirstSetupForCli(cfg, true)) return;
9095
9590
  }
@@ -11435,6 +11930,7 @@ function writeSyncFailure(message: string): void {
11435
11930
  }
11436
11931
 
11437
11932
  async function runSyncFlow(fromDashboard: boolean): Promise<void> {
11933
+ const { showSyncSelector, showSyncProgress } = await import('./selector.js');
11438
11934
  let result: Awaited<ReturnType<typeof showSyncSelector>>;
11439
11935
  try {
11440
11936
  result = await showSyncSelector(fromDashboard);
@@ -11600,6 +12096,15 @@ async function main(): Promise<void> {
11600
12096
 
11601
12097
  let rawArgs = process.argv.slice(2);
11602
12098
 
12099
+ // The root flag can follow other launch options, but never a subcommand.
12100
+ const rootTui = extractRootTuiEntry(rawArgs);
12101
+ if (rootTui.error) {
12102
+ console.error(rootTui.error);
12103
+ process.exitCode = 1;
12104
+ return;
12105
+ }
12106
+ rawArgs = rootTui.args;
12107
+
11603
12108
  rawArgs = rewriteBareNexusToStatus({ rawArgs });
11604
12109
 
11605
12110
  // A leading --rich was a dashboard launch flag. The dashboard no longer
@@ -11743,6 +12248,9 @@ async function main(): Promise<void> {
11743
12248
  const resolved = await resolveRemoteTarget({});
11744
12249
  if (resolved) remote = resolved;
11745
12250
  }
12251
+ // Bare entry is classic. The next TUI has no remote transport yet;
12252
+ // an explicit --tui next still reports the unsupported combination below.
12253
+ const tuiEntry = effectiveRootTuiEntry(rootTui, Boolean(remote));
11746
12254
 
11747
12255
  // Root dashboard resume accepts `--resume`. Only a
11748
12256
  // leading launch flag is owned here: a subcommand's `-r` stays
@@ -11807,8 +12315,13 @@ async function main(): Promise<void> {
11807
12315
  // (e.g. `session watch --debug`), stripping them here would silently
11808
12316
  // eat that subcommand's own option before commander ever sees it.
11809
12317
  const args = filterDashboardArgs(rawArgs, resumeFlagIdx);
12318
+ if (tuiEntry === 'next' && rootTui.explicit && args.length > 0) {
12319
+ console.error('elanous: --tui next is a standalone TUI entry, not a subcommand option');
12320
+ process.exitCode = 1;
12321
+ return;
12322
+ }
11810
12323
 
11811
- // Bare `elanous` (no subcommand) → the dashboard, always. The former
12324
+ // Bare `elanous` (no subcommand) → classic dashboard; next TUI only via `--tui next`. The former
11812
12325
  // `global.entry.defaultMode` switch (which could route here to the
11813
12326
  // headless NEXUS daemon) was removed 2026-07-24: T3/T4 deleted the
11814
12327
  // NEXUS interactive TUI, so every non-dashboard route was a dead-end
@@ -11854,6 +12367,12 @@ async function main(): Promise<void> {
11854
12367
  return;
11855
12368
  }
11856
12369
  const showAll = args[0] === '--help-all';
12370
+ if (firstCommand === 'sim' || (firstCommand === 'help' && args[1] === 'sim') || showAll || firstCommand === '--help' || firstCommand === '-h') {
12371
+ await ensureSimRegistered();
12372
+ }
12373
+ // Maturity filtering mutates command visibility; register the final PR
12374
+ // object before filtering so replacing the placeholder cannot reveal it.
12375
+ if (prSelectedForParse(['node', 'elanous', ...args])) ensurePrRegistered();
11857
12376
  const role = getUserConfig().cli?.helpRole ?? 'owner';
11858
12377
  const { shown, hidden } = filterCliRootHelp(program.commands, role, showAll);
11859
12378
  debug.log('cli.maturity', 'help-filtered', { role, shown, hidden });
@@ -11864,7 +12383,7 @@ async function main(): Promise<void> {
11864
12383
  // Bare entry only requires an LLM; detailed setup stays behind `eln setup`.
11865
12384
  const firstRunStartedAt = Date.now();
11866
12385
  const cfg = getUserConfig();
11867
- if (needsFirstRun(cfg)) {
12386
+ if ((await import('./onboarding.js')).needsFirstRun(cfg)) {
11868
12387
  if (cfg.onboarding.webFirst !== false) {
11869
12388
  const { runWebFirstSetup } = await import('./onboarding/web-first.js');
11870
12389
  if (await runWebFirstSetup({ config: cfg, startedAt: firstRunStartedAt, startIfMissing: false }) === 'link-shown') return;
@@ -11941,14 +12460,32 @@ async function main(): Promise<void> {
11941
12460
  }
11942
12461
  }
11943
12462
  bootTimer.begin();
11944
- await showDashboard({
11945
- ...dashboardOpts,
11946
- onFirstFrameRendered: () => {
11947
- bootTimer.phase('show-dashboard');
11948
- bootTimer.done();
11949
- },
11950
- });
11951
- closeTui();
12463
+ if (tuiEntry === 'next') {
12464
+ if (remote) {
12465
+ console.error('elanous: --tui next currently reads local sessions only; drop it (classic is the default) for remote attach');
12466
+ process.exitCode = 1;
12467
+ return;
12468
+ }
12469
+ if ((process.stdout.columns || 0) < 20 || (process.stdout.rows || 0) < 6) {
12470
+ console.error('elanous: --tui next requires at least 20 columns and 6 rows');
12471
+ process.exitCode = 1;
12472
+ return;
12473
+ }
12474
+ const { showNextTui } = await import('./tui/entry.js');
12475
+ await showNextTui({ resumeSessionId });
12476
+ bootTimer.phase('show-next');
12477
+ bootTimer.done();
12478
+ } else {
12479
+ const { showDashboard } = await import('./dashboard/index.js');
12480
+ await showDashboard({
12481
+ ...dashboardOpts,
12482
+ onFirstFrameRendered: () => {
12483
+ bootTimer.phase('show-dashboard');
12484
+ bootTimer.done();
12485
+ },
12486
+ });
12487
+ closeTui();
12488
+ }
11952
12489
  // Force exit: the dashboard starts background timers (clipboard
11953
12490
  // poller, shimmer/blink animations) that keep the Bun event loop
11954
12491
  // alive even after the TUI tears down. Without this hard exit,