elanous 0.2.18 → 0.2.20

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 (350) 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/chunks/{1307-30dff22c9e1f3073.js → 1307-77fad80cf54477c6.js} +1 -1
  4. package/apps/pwa/out/_next/static/chunks/1612-f60c0c93ec773f81.js +1 -0
  5. package/apps/pwa/out/_next/static/chunks/2116-6429c188eb846ab8.js +1 -0
  6. package/apps/pwa/out/_next/static/chunks/224-e7be8f762fe74986.js +1 -0
  7. package/apps/pwa/out/_next/static/chunks/2489-ff55a35b202c0f94.js +1 -0
  8. package/apps/pwa/out/_next/static/chunks/2549-89c518a4c8ed4d00.js +1 -0
  9. package/apps/pwa/out/_next/static/chunks/3857-995ea9f5ef33d71e.js +1 -0
  10. package/apps/pwa/out/_next/static/chunks/4144-fad095b48a1862ee.js +1 -0
  11. package/apps/pwa/out/_next/static/chunks/5755-ea7ed88eb956f47b.js +1 -0
  12. package/apps/pwa/out/_next/static/chunks/5977-94ed6f78e9814b2b.js +1 -0
  13. package/apps/pwa/out/_next/static/chunks/7748-6e51bfe927019f5c.js +25 -0
  14. package/apps/pwa/out/_next/static/chunks/8401-35e94e9091f5eb8d.js +1 -0
  15. package/apps/pwa/out/_next/static/chunks/9247-c1753a059e7bac08.js +1 -0
  16. package/apps/pwa/out/_next/static/chunks/a9f2b54d-33c0689b70ed8cf3.js +1 -0
  17. package/apps/pwa/out/_next/static/chunks/app/approvals/{page-d92f7ee3994e84c7.js → page-c855c24de7db74fe.js} +1 -1
  18. package/apps/pwa/out/_next/static/chunks/app/autopilot/{page-4733c967b56a4277.js → page-85b316bb4235980b.js} +1 -1
  19. package/apps/pwa/out/_next/static/chunks/app/board/{page-d22fd849cc22f104.js → page-9b2b26a33cb2cd42.js} +1 -1
  20. package/apps/pwa/out/_next/static/chunks/app/botlab/{page-bb742f995c6769e7.js → page-c9955fde67b1bcb5.js} +1 -1
  21. package/apps/pwa/out/_next/static/chunks/app/bots/{page-02b073a2ac793b83.js → page-7a852956c74015a3.js} +1 -1
  22. package/apps/pwa/out/_next/static/chunks/app/ceo/page-c5a5c621be0e04ae.js +1 -0
  23. package/apps/pwa/out/_next/static/chunks/app/chat/{page-8a9b3594bc23289b.js → page-4ba4abe096b6c2a8.js} +1 -1
  24. package/apps/pwa/out/_next/static/chunks/app/consult/page-575d4a8b4f7becb2.js +1 -0
  25. package/apps/pwa/out/_next/static/chunks/app/control/{page-308111abadf35670.js → page-f5d56ff5f45ad164.js} +1 -1
  26. package/apps/pwa/out/_next/static/chunks/app/decisions/page-2260e9eef0357421.js +1 -0
  27. package/apps/pwa/out/_next/static/chunks/app/design-check/{page-5d97b2901e0d1ea6.js → page-7c058069c5e7fa63.js} +1 -1
  28. package/apps/pwa/out/_next/static/chunks/app/editor/page-dc5da0b8a2edb8a4.js +1 -0
  29. package/apps/pwa/out/_next/static/chunks/app/exec/{page-8c3d8e63ae2e1c98.js → page-466bf0ee16ad1432.js} +1 -1
  30. package/apps/pwa/out/_next/static/chunks/app/field/{page-9b72a07d424701c6.js → page-a23bc71713bcc08f.js} +1 -1
  31. package/apps/pwa/out/_next/static/chunks/app/inside/page-ed4a6f799f005d09.js +1 -0
  32. package/apps/pwa/out/_next/static/chunks/app/intake/{page-a572f58cd3ca5864.js → page-9cd565005b93aca6.js} +1 -1
  33. package/apps/pwa/out/_next/static/chunks/app/layout-55f0f40c6db95f15.js +1 -0
  34. package/apps/pwa/out/_next/static/chunks/app/live/{page-be5ea965a07fbc41.js → page-474cb5888ea0e8f3.js} +1 -1
  35. package/apps/pwa/out/_next/static/chunks/app/loops/page-35bfec2e631d3eae.js +1 -0
  36. package/apps/pwa/out/_next/static/chunks/app/market/{page-fa244bd146a00ae8.js → page-9ca21f9ad3208a61.js} +1 -1
  37. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/{page-44d56d6391965a6a.js → page-f9ccb1b1adbea14d.js} +1 -1
  38. package/apps/pwa/out/_next/static/chunks/app/morning/{page-83a700d4c754d802.js → page-ec102c9b8b691e37.js} +1 -1
  39. package/apps/pwa/out/_next/static/chunks/app/{not-found-7b3170f374f77b9d.js → not-found-a9c2cfa8dda922a5.js} +1 -1
  40. package/apps/pwa/out/_next/static/chunks/app/observatory/page-6da35144878feb6d.js +1 -0
  41. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-f6055495e9ed7ea8.js +1 -0
  42. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-25204694fa9984a5.js +1 -0
  43. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-a60e035f151d84d3.js +1 -0
  44. package/apps/pwa/out/_next/static/chunks/app/outputs/page-189c587f36874538.js +1 -0
  45. package/apps/pwa/out/_next/static/chunks/app/page-c56634bde705a65d.js +1 -0
  46. package/apps/pwa/out/_next/static/chunks/app/reflection/{page-1467047104141297.js → page-db03ae3589a81c9e.js} +1 -1
  47. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-4a6463b97f0ad94f.js +1 -0
  48. package/apps/pwa/out/_next/static/chunks/app/sessions/{page-102310930791197a.js → page-75bffecc9aa1004e.js} +1 -1
  49. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-a8d2fe0c669e0de4.js +1 -0
  50. package/apps/pwa/out/_next/static/chunks/app/settings/{page-6ed0b73bae8351d8.js → page-31d5b875760bb62d.js} +1 -1
  51. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-c26fa10aac6c21c4.js +1 -0
  52. package/apps/pwa/out/_next/static/chunks/app/setup/{page-43336055451f6e37.js → page-68793c6e10331d66.js} +1 -1
  53. package/apps/pwa/out/_next/static/chunks/app/share/{page-3cc47dca0922ab9a.js → page-46d5201d2207a511.js} +1 -1
  54. package/apps/pwa/out/_next/static/chunks/app/showroom/{page-a77ee355a2304ff0.js → page-d81c07a7b4f618ae.js} +1 -1
  55. package/apps/pwa/out/_next/static/chunks/app/tasks/{page-b17cd46cf0e9b8cf.js → page-be1c4e8697f22360.js} +1 -1
  56. package/apps/pwa/out/_next/static/chunks/app/term/page-cf0a4b4abead71ea.js +1 -0
  57. package/apps/pwa/out/_next/static/chunks/app/today/page-a4717e2c4bf7a28f.js +1 -0
  58. package/apps/pwa/out/_next/static/chunks/app/trace/{page-7bf54c9bb9274af8.js → page-0fd895fab9b62c1b.js} +1 -1
  59. package/apps/pwa/out/_next/static/chunks/app/vault/page-8b6c1454a8e8f306.js +1 -0
  60. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-c6e4364d9de8f717.js +1 -0
  61. package/apps/pwa/out/_next/static/chunks/app/workflows/page-0acc8e198f7b0dfb.js +1 -0
  62. package/apps/pwa/out/_next/static/chunks/app/workspace/{page-134da468538baf48.js → page-34882c84f84021c5.js} +1 -1
  63. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-0506a1e0e4bdb2f5.js +1 -0
  64. package/apps/pwa/out/_next/static/chunks/{webpack-c2782b330447ffb6.js → webpack-c260571513bf43c2.js} +1 -1
  65. package/apps/pwa/out/_next/static/css/{e99e3cff94ced78a.css → 599369d853c61df7.css} +1 -1
  66. package/apps/pwa/out/_next/static/css/c23d959d3ee15e57.css +1 -0
  67. package/apps/pwa/out/_next/static/css/d3427996da11e480.css +1 -0
  68. package/apps/pwa/out/approvals/index.html +1 -1
  69. package/apps/pwa/out/approvals/index.txt +14 -14
  70. package/apps/pwa/out/autopilot/index.html +1 -1
  71. package/apps/pwa/out/autopilot/index.txt +14 -14
  72. package/apps/pwa/out/board/index.html +1 -1
  73. package/apps/pwa/out/board/index.txt +14 -14
  74. package/apps/pwa/out/botlab/index.html +1 -1
  75. package/apps/pwa/out/botlab/index.txt +14 -14
  76. package/apps/pwa/out/bots/index.html +1 -1
  77. package/apps/pwa/out/bots/index.txt +14 -14
  78. package/apps/pwa/out/ceo/index.html +1 -1
  79. package/apps/pwa/out/ceo/index.txt +14 -14
  80. package/apps/pwa/out/chat/index.html +1 -1
  81. package/apps/pwa/out/chat/index.txt +14 -14
  82. package/apps/pwa/out/consult/index.html +1 -1
  83. package/apps/pwa/out/consult/index.txt +14 -14
  84. package/apps/pwa/out/control/index.html +1 -1
  85. package/apps/pwa/out/control/index.txt +14 -14
  86. package/apps/pwa/out/decisions/index.html +1 -1
  87. package/apps/pwa/out/decisions/index.txt +14 -14
  88. package/apps/pwa/out/design-check/index.html +1 -1
  89. package/apps/pwa/out/design-check/index.txt +14 -14
  90. package/apps/pwa/out/editor/index.html +1 -1
  91. package/apps/pwa/out/editor/index.txt +16 -15
  92. package/apps/pwa/out/exec/index.html +1 -1
  93. package/apps/pwa/out/exec/index.txt +14 -14
  94. package/apps/pwa/out/field/index.html +1 -1
  95. package/apps/pwa/out/field/index.txt +14 -14
  96. package/apps/pwa/out/healthz +1 -1
  97. package/apps/pwa/out/index.html +1 -1
  98. package/apps/pwa/out/index.txt +14 -14
  99. package/apps/pwa/out/inside/index.html +1 -1
  100. package/apps/pwa/out/inside/index.txt +16 -15
  101. package/apps/pwa/out/intake/index.html +1 -1
  102. package/apps/pwa/out/intake/index.txt +14 -14
  103. package/apps/pwa/out/live/index.html +1 -1
  104. package/apps/pwa/out/live/index.txt +14 -14
  105. package/apps/pwa/out/loops/index.html +1 -1
  106. package/apps/pwa/out/loops/index.txt +24 -23
  107. package/apps/pwa/out/market/index.html +1 -1
  108. package/apps/pwa/out/market/index.txt +14 -14
  109. package/apps/pwa/out/missions/placeholder/index.html +1 -1
  110. package/apps/pwa/out/missions/placeholder/index.txt +14 -14
  111. package/apps/pwa/out/morning/index.html +1 -1
  112. package/apps/pwa/out/morning/index.txt +14 -14
  113. package/apps/pwa/out/observatory/index.html +1 -1
  114. package/apps/pwa/out/observatory/index.txt +14 -14
  115. package/apps/pwa/out/ops/checklist/index.html +1 -1
  116. package/apps/pwa/out/ops/checklist/index.txt +14 -14
  117. package/apps/pwa/out/ops/release/index.html +1 -1
  118. package/apps/pwa/out/ops/release/index.txt +14 -14
  119. package/apps/pwa/out/ops/seats/index.html +1 -1
  120. package/apps/pwa/out/ops/seats/index.txt +14 -14
  121. package/apps/pwa/out/outputs/index.html +1 -1
  122. package/apps/pwa/out/outputs/index.txt +14 -14
  123. package/apps/pwa/out/reflection/index.html +1 -1
  124. package/apps/pwa/out/reflection/index.txt +15 -15
  125. package/apps/pwa/out/scheduler/index.html +1 -1
  126. package/apps/pwa/out/scheduler/index.txt +14 -14
  127. package/apps/pwa/out/sessions/index.html +1 -1
  128. package/apps/pwa/out/sessions/index.txt +14 -14
  129. package/apps/pwa/out/settings/devices/index.html +1 -1
  130. package/apps/pwa/out/settings/devices/index.txt +14 -14
  131. package/apps/pwa/out/settings/index.html +1 -1
  132. package/apps/pwa/out/settings/index.txt +14 -14
  133. package/apps/pwa/out/setup/done/index.html +1 -1
  134. package/apps/pwa/out/setup/done/index.txt +14 -14
  135. package/apps/pwa/out/setup/index.html +1 -1
  136. package/apps/pwa/out/setup/index.txt +14 -14
  137. package/apps/pwa/out/share/index.html +1 -1
  138. package/apps/pwa/out/share/index.txt +14 -14
  139. package/apps/pwa/out/showroom/index.html +1 -1
  140. package/apps/pwa/out/showroom/index.txt +14 -14
  141. package/apps/pwa/out/tasks/index.html +1 -1
  142. package/apps/pwa/out/tasks/index.txt +14 -14
  143. package/apps/pwa/out/term/index.html +1 -1
  144. package/apps/pwa/out/term/index.txt +14 -14
  145. package/apps/pwa/out/today/index.html +1 -1
  146. package/apps/pwa/out/today/index.txt +14 -14
  147. package/apps/pwa/out/trace/index.html +1 -1
  148. package/apps/pwa/out/trace/index.txt +14 -14
  149. package/apps/pwa/out/vault/index.html +1 -1
  150. package/apps/pwa/out/vault/index.txt +14 -14
  151. package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
  152. package/apps/pwa/out/workflows/chat-ui/index.txt +14 -14
  153. package/apps/pwa/out/workflows/index.html +1 -1
  154. package/apps/pwa/out/workflows/index.txt +14 -14
  155. package/apps/pwa/out/workspace/index.html +1 -1
  156. package/apps/pwa/out/workspace/index.txt +14 -14
  157. package/apps/pwa/out/worktrees/index.html +1 -1
  158. package/apps/pwa/out/worktrees/index.txt +14 -14
  159. package/graphs/demo/editor-recipes.yaml +22 -0
  160. package/graphs/ops/guardian.yaml +26 -0
  161. package/graphs/ops/recipes.yaml +3 -0
  162. package/graphs/retro/daily.yaml +25 -0
  163. package/graphs/retro/recipes.yaml +24 -0
  164. package/package.json +1 -1
  165. package/scripts/ask-marker-check.ts +3 -1
  166. package/scripts/coord-channel-watch.sh +2 -2
  167. package/scripts/discord-seat-probe.ts +3 -1
  168. package/scripts/land-global-checks.ts +89 -0
  169. package/scripts/lib/pch-regress-map.ts +24 -0
  170. package/scripts/morning-report.ts +18 -4
  171. package/scripts/pch-regress.ts +88 -0
  172. package/scripts/release-loop/gate-diff.ts +18 -0
  173. package/scripts/release-loop/gate-node.ts +628 -65
  174. package/scripts/release-loop/gate-partial.ts +106 -0
  175. package/scripts/release-loop/gate-timing.ts +229 -0
  176. package/scripts/release-loop/preflight.ts +6 -4
  177. package/scripts/release-loop/publish-window.ts +141 -0
  178. package/scripts/release-loop/release-docs.ts +1 -4
  179. package/scripts/release-loop/release-universe.ts +38 -0
  180. package/scripts/release-loop/resume-release.ts +67 -5
  181. package/scripts/release-loop/shard-plan.ts +65 -0
  182. package/scripts/release-loop/unattended-release.ts +12 -2
  183. package/scripts/release-story/draft.ts +5 -1
  184. package/scripts/retro/shadow-compare.ts +71 -0
  185. package/scripts/rhythm/daily.ts +6 -1
  186. package/scripts/video/scene-table.ts +159 -0
  187. package/src/acp/core-turn-bridge.ts +39 -2
  188. package/src/agent-mission/driver.ts +34 -6
  189. package/src/autopilot/build/llm-conflict-merge.ts +132 -7
  190. package/src/autopilot/build/merge-intent.ts +135 -7
  191. package/src/away/presence.ts +40 -0
  192. package/src/away/release-watch.ts +272 -0
  193. package/src/chat/index.ts +2 -1
  194. package/src/chat/short-question.ts +3 -40
  195. package/src/cli/away-cli.ts +68 -0
  196. package/src/cli/config-drift.ts +513 -0
  197. package/src/cli/guardian-cli.ts +49 -0
  198. package/src/cli/intake-cli.ts +13 -7
  199. package/src/cli/log-event-names.ts +5 -0
  200. package/src/cli/pod-cli.ts +5 -1
  201. package/src/cli/pr-cli.ts +20 -0
  202. package/src/cli/pty-drive-cli.ts +14 -3
  203. package/src/cli/release-cli.ts +52 -12
  204. package/src/cli/retro-cli.ts +78 -0
  205. package/src/cli/setup-cli.ts +31 -1
  206. package/src/cli/tasks-cli.ts +193 -14
  207. package/src/context-bus/context-now-public.ts +1 -1
  208. package/src/context-bus/context-now-surfaces.ts +16 -6
  209. package/src/context-bus/context-now.ts +97 -3
  210. package/src/core-turn/short-question.ts +100 -0
  211. package/src/dashboard/dashboard-status-lines.ts +24 -4
  212. package/src/dashboard/index.ts +50 -5
  213. package/src/dashboard/input/slash-executor.ts +6 -2
  214. package/src/dashboard/slash-runtime/dashboard-handlers.ts +68 -40
  215. package/src/dashboard/slash-runtime/decide-slash.ts +60 -0
  216. package/src/dashboard/slash-runtime/help-from-registry.ts +62 -23
  217. package/src/dashboard/slash-runtime/help-groups.ts +44 -0
  218. package/src/dashboard/slash-runtime/model-choices.ts +125 -0
  219. package/src/domains/guardian-tick.ts +138 -0
  220. package/src/domains/outbound-alert.ts +44 -13
  221. package/src/domains/outbound-log-probe.ts +6 -1
  222. package/src/domains/schedule-registry.ts +23 -0
  223. package/src/domains/telegram-kind-route.ts +39 -0
  224. package/src/domains/watch-default-scheduler.ts +95 -0
  225. package/src/esc-abort-gate.ts +44 -0
  226. package/src/graph-runner/graph-run-api.ts +205 -0
  227. package/src/graph-runner/runner.ts +36 -6
  228. package/src/harness/harness-cli-command.ts +420 -51
  229. package/src/harness/harness-queue.ts +315 -25
  230. package/src/harness/harness-salvage-cli.ts +140 -0
  231. package/src/harness/harness-worktree-add.ts +68 -0
  232. package/src/harness/ledger-write-guard.ts +6 -16
  233. package/src/hq/fence-outcomes.ts +63 -0
  234. package/src/hq/fence-wrapper.ts +33 -0
  235. package/src/hq/hq.ts +17 -2
  236. package/src/index.ts +118 -6
  237. package/src/instance/test-write-guard-spy-first.fixture.ts +13 -0
  238. package/src/instance/test-write-guard.ts +200 -0
  239. package/src/intake-plane/digest.ts +39 -15
  240. package/src/intake-plane/harness-target.ts +4 -3
  241. package/src/intake-plane/intake-sources.ts +1 -0
  242. package/src/intake-plane/items.ts +1 -0
  243. package/src/loops/orchestrator/degradation.ts +57 -0
  244. package/src/loops/orchestrator/finish-rate.ts +33 -3
  245. package/src/loops/orchestrator/tick.ts +166 -45
  246. package/src/maturity/feature-maturity.ts +6 -4
  247. package/src/maturity/tui-slash-maturity.ts +1 -0
  248. package/src/mss/logging/log-store.ts +3 -0
  249. package/src/nexus/api/graph-kinds.ts +10 -4
  250. package/src/nexus/api/graphs-api.ts +178 -6
  251. package/src/nexus/api/http-server.ts +54 -8
  252. package/src/nexus/api/loop-edges.ts +292 -17
  253. package/src/nexus/api/ops-api.ts +112 -29
  254. package/src/nexus/api/ops-board-route.ts +48 -0
  255. package/src/nexus/index.ts +7 -0
  256. package/src/onboarding/entry-hints.ts +5 -0
  257. package/src/onboarding.ts +24 -6
  258. package/src/release-loop/checklist.ts +2 -0
  259. package/src/release-loop/feature-store.ts +68 -18
  260. package/src/release-loop/gate-shards.ts +158 -0
  261. package/src/release-loop/light-rc.ts +173 -0
  262. package/src/release-loop/placement.ts +51 -17
  263. package/src/release-loop/release-schedule.ts +6 -2
  264. package/src/release-loop/rubric.ts +57 -1
  265. package/src/retro/daily.ts +372 -0
  266. package/src/seat-loop/op-decide.ts +173 -0
  267. package/src/seat-loop/seat-loop.ts +60 -3
  268. package/src/seat-loop/seat-report.ts +58 -3
  269. package/src/self-dev/ask-launch-flow.ts +5 -4
  270. package/src/self-dev/ask-launch-io.ts +49 -1
  271. package/src/self-dev/ask-path-candidates.ts +40 -2
  272. package/src/self-dev/dev-cli.ts +36 -0
  273. package/src/self-dev/draft-sweep.ts +371 -16
  274. package/src/self-dev/draft-triage-rules.ts +19 -4
  275. package/src/self-dev/orchestrate.ts +1 -0
  276. package/src/self-dev/pr-preview.ts +247 -0
  277. package/src/self-dev/shard-run.ts +23 -7
  278. package/src/self-implement/blocked-draft-policy.ts +101 -0
  279. package/src/self-implement/execution-clarification.ts +11 -0
  280. package/src/self-implement/gate-cli.ts +29 -8
  281. package/src/self-implement/gate-env-retry.ts +83 -0
  282. package/src/self-implement/goal-author-clarification.ts +88 -13
  283. package/src/self-implement/goal-clarification-escalation.ts +2 -0
  284. package/src/self-implement/orchestrator.ts +220 -6
  285. package/src/self-implement/run-stop.ts +123 -0
  286. package/src/self-implement/run-ttl.ts +258 -0
  287. package/src/self-implement/salvage-branches.ts +254 -0
  288. package/src/self-implement/salvage-retention.ts +123 -0
  289. package/src/self-implement/seams.ts +4 -0
  290. package/src/self-implement/self-implement-cli.ts +2 -0
  291. package/src/self-implement/sibling-resync.ts +223 -0
  292. package/src/self-implement/stop-autoheal.ts +204 -0
  293. package/src/task-agent/actions.ts +63 -2
  294. package/src/task-agent/board.ts +132 -0
  295. package/src/task-agent/card-evidence.ts +292 -0
  296. package/src/task-agent/completion-evidence.ts +126 -0
  297. package/src/task-agent/judge.ts +25 -0
  298. package/src/task-agent/live-moves.ts +276 -0
  299. package/src/task-agent/mission.ts +33 -7
  300. package/src/task-agent/shadow.ts +192 -15
  301. package/src/task-agent/task-hand.ts +124 -17
  302. package/src/task-orchestrator/surfaces/pod-command-job.ts +82 -8
  303. package/src/task-orchestrator/surfaces/pod-failure-reason.ts +4 -0
  304. package/src/task-orchestrator/surfaces/pod-install-slots.ts +89 -0
  305. package/src/task-orchestrator/surfaces/pod-lease.ts +233 -21
  306. package/src/task-orchestrator/surfaces/pod-pool.ts +155 -34
  307. package/src/task-orchestrator/surfaces/self-implement-pod.ts +21 -5
  308. package/src/telegram-away-command.ts +38 -0
  309. package/src/telegram-commands.ts +52 -0
  310. package/src/telegram-report-log-probe.ts +21 -0
  311. package/src/telegram-report.ts +27 -3
  312. package/src/testing/real-cli-spawn.ts +106 -0
  313. package/src/tui-client/dashboard-session.ts +1 -0
  314. package/src/user-config.ts +190 -5
  315. package/src/version/packed-revision.json +1 -1
  316. package/apps/pwa/out/_next/static/chunks/224-798346143007ff65.js +0 -1
  317. package/apps/pwa/out/_next/static/chunks/3857-4f936cdb30322aa6.js +0 -1
  318. package/apps/pwa/out/_next/static/chunks/4144-a0041c8dc3be57ac.js +0 -1
  319. package/apps/pwa/out/_next/static/chunks/4554-5761612531d0146b.js +0 -1
  320. package/apps/pwa/out/_next/static/chunks/5977-a11f37254196b659.js +0 -1
  321. package/apps/pwa/out/_next/static/chunks/5994-ae92c0de046ab9ba.js +0 -1
  322. package/apps/pwa/out/_next/static/chunks/8401-8615a660c84cdb03.js +0 -1
  323. package/apps/pwa/out/_next/static/chunks/8868-10a3a4440fb0ccd8.js +0 -25
  324. package/apps/pwa/out/_next/static/chunks/9247-269e4464cc4b491c.js +0 -1
  325. package/apps/pwa/out/_next/static/chunks/a9f2b54d-7865aba0f4d2ee49.js +0 -1
  326. package/apps/pwa/out/_next/static/chunks/app/ceo/page-60c3da708f9a0ccc.js +0 -1
  327. package/apps/pwa/out/_next/static/chunks/app/consult/page-a0eb02638b1e6f31.js +0 -1
  328. package/apps/pwa/out/_next/static/chunks/app/decisions/page-6eaf7bac37830c21.js +0 -1
  329. package/apps/pwa/out/_next/static/chunks/app/editor/page-c39554c321576982.js +0 -1
  330. package/apps/pwa/out/_next/static/chunks/app/inside/page-bd5d586429167fea.js +0 -1
  331. package/apps/pwa/out/_next/static/chunks/app/layout-59b7834d497c2255.js +0 -1
  332. package/apps/pwa/out/_next/static/chunks/app/loops/page-c130b63862437814.js +0 -1
  333. package/apps/pwa/out/_next/static/chunks/app/observatory/page-5f23d0c66a3b4793.js +0 -1
  334. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-a3c58f5c72a5f3f9.js +0 -1
  335. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-a2c4625596f8d69c.js +0 -1
  336. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-0e9099531d239f11.js +0 -1
  337. package/apps/pwa/out/_next/static/chunks/app/outputs/page-e8e1ecaea7cd71d2.js +0 -1
  338. package/apps/pwa/out/_next/static/chunks/app/page-a1b7ffed710a93e0.js +0 -1
  339. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-2da6f9b8a38c6978.js +0 -1
  340. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-f331e38fefc00393.js +0 -1
  341. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-44d5f767491692bf.js +0 -1
  342. package/apps/pwa/out/_next/static/chunks/app/term/page-61553851aa606146.js +0 -1
  343. package/apps/pwa/out/_next/static/chunks/app/today/page-a1f585e154e61c59.js +0 -1
  344. package/apps/pwa/out/_next/static/chunks/app/vault/page-5150ef17b5383a57.js +0 -1
  345. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-b9d8ce70792c1672.js +0 -1
  346. package/apps/pwa/out/_next/static/chunks/app/workflows/page-a5a3de231f2cc7d5.js +0 -1
  347. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-31ac4afa2dcd915c.js +0 -1
  348. package/apps/pwa/out/_next/static/css/7fa358fec7da7c47.css +0 -1
  349. /package/apps/pwa/out/_next/static/{P6YTVgzuZz5oTZhY4Din_ → Bam1YziK2iH9bN4K0utGk}/_buildManifest.js +0 -0
  350. /package/apps/pwa/out/_next/static/{P6YTVgzuZz5oTZhY4Din_ → Bam1YziK2iH9bN4K0utGk}/_ssgManifest.js +0 -0
@@ -0,0 +1,272 @@
1
+ import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { debug } from '../debug/log.js';
4
+ import { deliver, inQuietHours, sendOutbound } from '../domains/outbound-alert.js';
5
+ import { effectiveInstanceRoot } from '../instance/resolve.js';
6
+ import { readReleaseRuns, type ReleaseRunNodeView, type ReleaseRunView } from '../nexus/api/ops-api.js';
7
+ import { shardsLine } from '../release-loop/gate-shards.js';
8
+ import { readPresence, type Presence } from './presence.js';
9
+
10
+ /** AWAY-MODE-1 — 외출 중 발행 현황 공백 0. 발행 런 원장(`/v1/ops/release/runs` 와 같은 판정)을 직전에 본 것과 견주어
11
+ * «새로 생긴 전이»만 텔레그램 한 통으로 보낸다. 같은 전이는 두 번 안 보낸다(보낸 뒤에만 기준을 옮긴다). */
12
+
13
+ export const RELEASE_SCREEN_URL = 'https://op.elanous.ai/app/ops/release';
14
+ /** 발행 중 이 간격 동안 새 전이가 없으면 «생존» 한 줄. */
15
+ export const ALIVE_EVERY_MS = 60 * 60_000;
16
+ /** 이보다 오래된 런은 따라가지 않는다 — 외출을 켠 순간 지난 판이 쏟아지지 않게. */
17
+ export const FOLLOW_WINDOW_MS = 36 * 3600_000;
18
+
19
+ export interface RunMark {
20
+ status: string;
21
+ /** 끝난(ok 가 정해진) 노드 수. */
22
+ ended: number;
23
+ /** 지금 도는 노드(있으면). */
24
+ running?: string;
25
+ /** 이 런에 대해 마지막으로 보낸 시각(ISO) — 생존 줄 간격의 기준. */
26
+ sentAt: string;
27
+ /** GATE-LIVE-OBS — 마지막으로 본 잘림·실패 조각 수. 늘면 한 줄. */
28
+ shardsBad?: number;
29
+ }
30
+
31
+ const shardsBad = (run: ReleaseRunView): number | undefined => {
32
+ const counts = run.gateShards?.summary.counts;
33
+ return counts ? counts.timeout + counts.failed : undefined;
34
+ };
35
+
36
+ export interface WatchState { runs: Record<string, RunMark> }
37
+
38
+ export interface WatchMessage { text: string; urgent: boolean }
39
+
40
+ const BLOCKED = new Set(['failed', 'budget-exceeded', 'awaiting-approval']);
41
+
42
+ const clean = (text: string, max: number): string => {
43
+ const one = text.replace(/[\r\n\t]+/g, ' ').replace(/\s+/g, ' ').trim();
44
+ return one.length > max ? `${one.slice(0, max - 1)}…` : one;
45
+ };
46
+
47
+ const label = (run: ReleaseRunView): string => run.version ?? run.runId.slice(0, 8);
48
+
49
+ /** 그래프의 종결 자리표 — 노드가 아니라 끝을 표시한다(런 상태로 따로 말한다). */
50
+ const TERMINAL = new Set(['done', 'failed']);
51
+
52
+ function endedNodes(run: ReleaseRunView): ReleaseRunNodeView[] {
53
+ return run.nodes.filter((node) => node.ok !== null && !TERMINAL.has(node.nodeId));
54
+ }
55
+
56
+ function runningNode(run: ReleaseRunView): ReleaseRunNodeView | undefined {
57
+ return run.status === 'running' ? run.nodes.find((node) => node.ok === null) : undefined;
58
+ }
59
+
60
+ function minutesSince(iso: string | undefined, now: number): number | null {
61
+ if (!iso) return null;
62
+ const at = Date.parse(iso);
63
+ return Number.isFinite(at) ? Math.max(0, Math.round((now - at) / 60_000)) : null;
64
+ }
65
+
66
+ /** 노드 하나가 끝났을 때의 한 줄. 게이트는 도입 수·면제를 꼭 말한다(«통과»만으로는 면제를 못 읽는다). */
67
+ export function nodeLine(node: ReleaseRunNodeView): string {
68
+ const mark = node.ok ? '✅' : '❌';
69
+ const facts = node.facts ?? {};
70
+ const parts: string[] = [`${mark} ${node.nodeId}`];
71
+ if (facts.introduced !== undefined) parts.push(`도입 ${facts.introduced}${facts.preexisting !== undefined ? ` · 기존 ${facts.preexisting}` : ''}`);
72
+ if (node.summary) parts.push(clean(node.summary, 120));
73
+ else if (facts.verdict) parts.push(facts.verdict);
74
+ let line = parts.join(' · ');
75
+ if (facts.waiver) line += `\n ⚠️ 면제 적용: ${clean(facts.waiver, 140)}`;
76
+ return line;
77
+ }
78
+
79
+ function blockedLine(run: ReleaseRunView): string {
80
+ const last = endedNodes(run).at(-1);
81
+ const where = last ? `${last.nodeId}${last.ok === false ? ' 실패' : ''}` : '노드 기록 없음';
82
+ const why = last?.summary ? ` — ${clean(last.summary, 140)}` : '';
83
+ if (run.status === 'awaiting-approval') {
84
+ return `⏸ ${label(run)} 발행 승인 대기 · ${where}${why}\n 다음 수: 승인 권한자(OP·대표)가 승인해야 다음 노드로 간다`;
85
+ }
86
+ const kind = run.status === 'budget-exceeded' ? '예산 초과로 멈춤' : '막힘';
87
+ return `⛔ ${label(run)} 발행 ${kind} · ${where}${why}\n 다음 수: 담당 자리(TC·OP)가 재개 또는 면제를 판단한다 — 결정이 오면 이 채널로 알린다`;
88
+ }
89
+
90
+ /** 직전 표지와 지금 런을 견주어 보낼 줄을 만든다. 순수 함수 — 시험이 이것을 문다. */
91
+ export function diffRun(prev: RunMark | undefined, run: ReleaseRunView, now: number): { lines: string[]; urgent: boolean; changed: boolean } {
92
+ const ended = endedNodes(run);
93
+ const running = runningNode(run);
94
+ const lines: string[] = [];
95
+ let urgent = false;
96
+ if (!prev) {
97
+ // 이미 끝난 판은 조용히 기준만 잡는다 — 외출을 켤 때 지난 판이 쏟아지지 않게.
98
+ if (run.status === 'done') return { lines, urgent, changed: true };
99
+ // 처음 보는 런 — 지난 노드를 다시 쏟지 않고 «지금 어디인가» 한 줄로 시작한다.
100
+ const total = run.path.filter((step) => !TERMINAL.has(step)).length || run.nodes.length;
101
+ const where = run.status === 'running'
102
+ ? `지금 ${running?.nodeId ?? '다음 노드 준비'}${running?.startedAt ? `(${minutesSince(running.startedAt, now)}분째)` : ''}`
103
+ : `상태 ${run.status}`;
104
+ lines.push(`📦 ${label(run)} 발행 따라가기 시작 · 끝난 노드 ${ended.length}${total ? `/${total}` : ''} · ${where}`);
105
+ if (BLOCKED.has(run.status)) { lines.push(blockedLine(run)); urgent = true; }
106
+ return { lines, urgent, changed: true };
107
+ }
108
+ for (const node of ended.slice(prev.ended)) {
109
+ lines.push(nodeLine(node));
110
+ if (node.ok === false) urgent = true;
111
+ }
112
+ if (running && running.nodeId !== prev.running && running.nodeId === 'gate') {
113
+ lines.push(`▶ gate 시작${running.startedAt ? ` · ${new Date(running.startedAt).toLocaleTimeString('ko-KR', { timeZone: 'Asia/Seoul', hour: '2-digit', minute: '2-digit', hour12: false })} KST` : ''}`);
114
+ }
115
+ const bad = shardsBad(run);
116
+ if (run.gateShards && bad !== undefined && bad > (prev.shardsBad ?? 0)) {
117
+ lines.push(`⚠️ gate 조각 잘림·실패 ${bad} · ${shardsLine(run.gateShards.summary)}`);
118
+ }
119
+ if (run.status !== prev.status) {
120
+ if (run.status === 'done') {
121
+ const took = minutesSince(run.startedAt, now);
122
+ lines.push(`🎉 ${label(run)} 발행 완료 · 노드 ${ended.length}${took !== null ? ` · ${Math.floor(took / 60)}시간 ${took % 60}분` : ''}`);
123
+ } else if (BLOCKED.has(run.status)) {
124
+ lines.push(blockedLine(run));
125
+ urgent = true;
126
+ } else if (run.status === 'running' && BLOCKED.has(prev.status)) {
127
+ lines.push(`▶ ${label(run)} 발행 재개`);
128
+ }
129
+ }
130
+ if (!lines.length && run.status === 'running' && now - Date.parse(prev.sentAt) >= ALIVE_EVERY_MS) {
131
+ const mins = minutesSince(running?.startedAt, now);
132
+ lines.push(`💓 ${label(run)} 발행 진행 중 · 지금 ${running?.nodeId ?? '다음 노드 준비'}${mins !== null ? `(${mins}분째)` : ''} · 끝난 노드 ${ended.length}/${run.path.filter((step) => !TERMINAL.has(step)).length || ended.length}`
133
+ + (run.gateShards ? `\n ${shardsLine(run.gateShards.summary)}` : ''));
134
+ }
135
+ const changed = lines.length > 0 || prev.ended !== ended.length || prev.status !== run.status || prev.running !== running?.nodeId
136
+ || (bad !== undefined && bad !== prev.shardsBad);
137
+ return { lines, urgent, changed };
138
+ }
139
+
140
+ export function markOf(run: ReleaseRunView, sentAt: string): RunMark {
141
+ const running = runningNode(run);
142
+ const bad = shardsBad(run);
143
+ return { status: run.status, ended: endedNodes(run).length, ...(running ? { running: running.nodeId } : {}), sentAt,
144
+ ...(bad !== undefined ? { shardsBad: bad } : {}) };
145
+ }
146
+
147
+ /** 따라갈 런 — 최근 36시간 안에 시작한 것만. 원장엔 «running» 인 채 버려진 옛 런이 있어 상태로 고르면 매시간 생존 줄이 샌다. */
148
+ export function followedRuns(runs: ReleaseRunView[], now: number): ReleaseRunView[] {
149
+ return runs.filter((run) => now - Date.parse(run.startedAt) <= FOLLOW_WINDOW_MS);
150
+ }
151
+
152
+ export function composeMessage(lines: string[]): string {
153
+ return [...lines, `↗ ${RELEASE_SCREEN_URL}`].join('\n');
154
+ }
155
+
156
+ export function watchStatePath(root: string = effectiveInstanceRoot()): string {
157
+ return join(root, 'away', 'release-watch.json');
158
+ }
159
+
160
+ export function readWatchState(path: string = watchStatePath()): WatchState {
161
+ try {
162
+ const value: unknown = JSON.parse(readFileSync(path, 'utf8'));
163
+ const runs = value && typeof value === 'object' ? (value as { runs?: unknown }).runs : undefined;
164
+ return { runs: runs && typeof runs === 'object' ? runs as Record<string, RunMark> : {} };
165
+ } catch { return { runs: {} }; }
166
+ }
167
+
168
+ export function writeWatchState(state: WatchState, path: string = watchStatePath()): void {
169
+ mkdirSync(dirname(path), { recursive: true });
170
+ const tmp = `${path}.${process.pid}.tmp`;
171
+ writeFileSync(tmp, `${JSON.stringify(state)}\n`);
172
+ renameSync(tmp, path);
173
+ }
174
+
175
+ export interface TickDeps {
176
+ presence?: () => Presence;
177
+ runs?: () => ReleaseRunView[] | 'unavailable';
178
+ readState?: () => WatchState;
179
+ writeState?: (state: WatchState) => void;
180
+ /** 보통 줄 — 야간 무음이면 아침까지 보류된다. */
181
+ send?: (text: string) => boolean;
182
+ /** 막힘·실패 — 야간 무음을 뚫는다. */
183
+ sendUrgent?: (text: string) => boolean;
184
+ now?: () => number;
185
+ }
186
+
187
+ export type TickOutcome =
188
+ | { outcome: 'present' }
189
+ | { outcome: 'unavailable' }
190
+ | { outcome: 'quiet'; followed: number }
191
+ | { outcome: 'sent'; followed: number; lines: number; urgent: boolean }
192
+ | { outcome: 'send-failed'; followed: number; lines: number; urgent: boolean };
193
+
194
+ export interface UrgentIo {
195
+ quiet: () => boolean;
196
+ outbound: (text: string, kind: string) => boolean;
197
+ deliver: (text: string, kind: string) => 'daemon' | 'direct' | false;
198
+ }
199
+
200
+ /** 막힘·실패 차선 — 야간 무음이면 보류 큐를 건너뛰고 바로 보낸다(`deliver`), 아니면 평소 길(`sendOutbound`). */
201
+ export function makeUrgentSender(io: UrgentIo = { quiet: () => inQuietHours(), outbound: sendOutbound, deliver: (t, k) => deliver(t, k) }): (text: string) => boolean {
202
+ return (text) => io.quiet() ? io.deliver(text, 'ops-alert') !== false : io.outbound(text, 'ops-alert');
203
+ }
204
+
205
+ const defaultSendUrgent = makeUrgentSender();
206
+
207
+ /** 한 번 본다. 자리에 있으면 아무것도 안 한다(기준도 지운다 — 다음 외출이 지난 일을 다시 보내지 않게). */
208
+ export function releaseWatchTick(deps: TickDeps = {}): TickOutcome {
209
+ const presence = (deps.presence ?? readPresence)();
210
+ const writeState = deps.writeState ?? ((state: WatchState) => writeWatchState(state));
211
+ if (!presence.away) {
212
+ const state = (deps.readState ?? readWatchState)();
213
+ if (Object.keys(state.runs).length) writeState({ runs: {} });
214
+ return { outcome: 'present' };
215
+ }
216
+ const all = (deps.runs ?? (() => readReleaseRuns(null, undefined, { facts: true })))();
217
+ if (all === 'unavailable') {
218
+ try { debug.log('away.release-watch', 'runs-unavailable', {}); } catch { /* fail-open */ }
219
+ return { outcome: 'unavailable' };
220
+ }
221
+ const now = (deps.now ?? Date.now)();
222
+ const nowIso = new Date(now).toISOString();
223
+ const state = (deps.readState ?? readWatchState)();
224
+ const runs = followedRuns(all, now);
225
+ const lines: string[] = [];
226
+ let urgent = false;
227
+ const next: WatchState = { runs: {} };
228
+ let changed = false;
229
+ for (const run of [...runs].reverse()) {
230
+ const prev = state.runs[run.runId];
231
+ const diff = diffRun(prev, run, now);
232
+ lines.push(...diff.lines);
233
+ urgent ||= diff.urgent;
234
+ changed ||= diff.changed;
235
+ next.runs[run.runId] = diff.lines.length ? markOf(run, nowIso) : { ...markOf(run, prev?.sentAt ?? nowIso) };
236
+ }
237
+ if (Object.keys(state.runs).some((id) => !next.runs[id])) changed = true;
238
+ if (!lines.length) {
239
+ if (changed) writeState(next);
240
+ return { outcome: 'quiet', followed: runs.length };
241
+ }
242
+ const text = composeMessage(lines);
243
+ const ok = urgent ? (deps.sendUrgent ?? defaultSendUrgent)(text) : (deps.send ?? ((t: string) => sendOutbound(t, 'op-report')))(text);
244
+ try { debug.log('away.release-watch', ok ? 'sent' : 'send-failed', { followed: runs.length, lines: lines.length, urgent }); } catch { /* fail-open */ }
245
+ // 못 보냈으면 기준을 옮기지 않는다 — 다음 틱이 같은 줄을 다시 시도한다(중복 대신 누락을 막는 쪽).
246
+ if (ok) writeState(next);
247
+ return { outcome: ok ? 'sent' : 'send-failed', followed: runs.length, lines: lines.length, urgent };
248
+ }
249
+
250
+ /** /release · away status 가 쓰는 «지금» 요약 — 가장 최근 런 하나. */
251
+ export function releaseNowText(runs: ReleaseRunView[] | 'unavailable', now: number = Date.now()): string {
252
+ if (runs === 'unavailable') return '발행 런 원장을 못 읽었다(권한·디스크) — 「없다」가 아니다';
253
+ const run = runs[0];
254
+ if (!run) return `발행 런 기록 없음\n↗ ${RELEASE_SCREEN_URL}`;
255
+ const ended = endedNodes(run);
256
+ const running = runningNode(run);
257
+ const total = run.path.filter((step) => !TERMINAL.has(step)).length || run.nodes.length;
258
+ const head = `📦 ${label(run)} · ${run.status} · 끝난 노드 ${ended.length}${total ? `/${total}` : ''}`;
259
+ const lines = [head];
260
+ if (running) {
261
+ const mins = minutesSince(running.startedAt, now);
262
+ lines.push(`지금: ${running.nodeId}${mins !== null ? ` (${mins}분째)` : ''}`);
263
+ if (run.gateShards) lines.push(` ${shardsLine(run.gateShards.summary)}`);
264
+ }
265
+ const last = ended.at(-1);
266
+ if (last) lines.push(`마지막: ${nodeLine(last)}`);
267
+ if (BLOCKED.has(run.status)) lines.push(blockedLine(run));
268
+ const started = minutesSince(run.startedAt, now);
269
+ if (started !== null) lines.push(`시작 ${Math.floor(started / 60)}시간 ${started % 60}분 전`);
270
+ lines.push(`↗ ${RELEASE_SCREEN_URL}`);
271
+ return lines.join('\n');
272
+ }
package/src/chat/index.ts CHANGED
@@ -434,7 +434,7 @@ export interface SlashCommand {
434
434
  export const SLASH_COMMANDS: SlashCommand[] = [
435
435
  { name: 'help', aliases: ['?'], description: '명령과 키 보기' },
436
436
  { name: 'resume', aliases: [], description: '지난 대화 이어 가기 · /resume <id 앞자리>' },
437
- { name: 'model', aliases: ['m'], description: '모델 바꾸기 — /model <codex|terra|sol|luna|opus|sonnet|grok> (list + current when no arg). OpenAI 는 Codex(Responses API)만. effort 는 /reasoning.', subcommands: ['codex', 'terra', 'sol', 'luna', 'opus', 'sonnet', 'grok'] },
437
+ { name: 'model', aliases: ['m'], description: '모델 바꾸기 — /model 빠름|보통|깊음 (코드명도 됨)', subcommands: ['빠름', '보통', '깊음', 'codex', 'terra', 'sol', 'luna', 'opus', 'sonnet', 'grok'] },
438
438
  { name: 'clear', aliases: ['cls'], description: '대화 기록 지우기' },
439
439
  { name: 'status', aliases: ['st'], description: '지금 상태 — 모델 · 연결 · 계정' },
440
440
  { name: 'now', aliases: [], description: '현재 맥락과 출처 표 — /now [주제]' },
@@ -448,6 +448,7 @@ export const SLASH_COMMANDS: SlashCommand[] = [
448
448
  // and the PWA `/design-check` panel. Listed (not baselined as hidden) on
449
449
  // purpose: a surface nobody can discover is not a surface.
450
450
  { name: 'design', aliases: ['design-check'], description: 'Design rulebooks this repository declares · /design [--declared] · /design pick [number|id] to choose a design direction', subcommands: ['--declared', 'pick'] },
451
+ { name: 'decide', aliases: ['dec'], description: '열린 결정 카드 보기·답하기 — /decide [번호] [선택지 키] [확인]' },
451
452
  { name: 'provider', aliases: ['p'], description: 'LLM providers — /provider (list) · next (cycle, also Alt+M / pill click) · use <name> · pick (visual picker) · reset', subcommands: ['next', 'use', 'pick', 'picker', 'menu', 'reset', 'list'] },
452
453
  { name: 'reasoning', aliases: ['r', 'think'], description: 'Reasoning level (codex effort + summary, anthropic extended-thinking budget) — /reasoning [off|low|medium|high|xhigh] (cycle when no arg · xhigh 는 모델 상한이 xhigh 이상일 때만 wire 에 실린다, 아니면 high 로 깎인다)', subcommands: ['off', 'low', 'medium', 'high', 'xhigh'] },
453
454
  { name: 'local', aliases: ['ll'], description: 'Local OpenAI-compatible LLM — ping / models / test / use', subcommands: ['ping', 'models', 'test', 'use', 'status'] },
@@ -1,40 +1,3 @@
1
- // B1(UX · 0.2.7) — 짧은 «물음»은 도구 없이 빠른 경로로(첫 글자 ≤2초 · 내부 문서 `EVAL-bot-chat-vs-grok-2026-09-30`).
2
- // 허용 방식(골 ASK-bot-short-question-fast-path-b1b): 아래가 «모두» 참일 때만 fast — 하나라도 거짓이면 fast 아님(보수 쪽).
3
- // ⓐ 한 줄 · 80자 이하 · 첨부 없음 ⓑ 인사이거나 «물음 꼴» ⓒ 요청·작업 표지 · 경로·URL·코드 꼴 · 실시간 낱말이 없다.
4
- // 거부 목록으로 변형을 다 막을 수는 없다 — 오분류 비용은 «확인해 볼까요?» 한 줄로 막힌다(도구가 안 실릴 뿐 대화는 이어진다).
5
- // 판정 표본 = src/chat/short-question.test.ts 의 고정 표 20개(⊕ 리뷰가 든 변형).
6
-
7
- export interface ShortQuestionContext {
8
- hasAttachments?: boolean;
9
- }
10
- export interface ShortQuestionVerdict {
11
- fast: boolean;
12
- reason: string;
13
- }
14
-
15
- const GREETING = /^(?:안녕(?:하세요|하십니까)?|반가워(?:요)?|고마워(?:요)?|감사합니다|하이|hi|hello|hey|thanks|thank you)[!?.~\s]*$/i;
16
- // «한 줄로» 같은 짧은 꼬리를 떼고 본다.
17
- const TAIL = /\s*(?:한\s*줄로|짧게|간단히|briefly|in one line)[.!]?\s*$/i;
18
- const KO_QUESTION_END = /(?:\?|까|니|나요|냐|야|어때|뭐|몇|언제|어디|누구|왜|인가|일까)[?.!~]*$/;
19
- const EN_QUESTION = /^(?:what|why|how|who|where|when|which|is|are|does|do)\b.*\?$/i;
20
- const REQUEST_KO = /(?:해\s*줘|해\s*주세요|줘(?:요)?(?=[?.!\s]|$)|주세요|줄래|할래|볼래|줄\s*수\s*있|돌려|실행|고쳐|만들어\s*줘|찾아|검색|확인해|열어|보내|올려|지워|써\s*줘|작성해|요약해|정리해|분석해)/;
21
- const REQUEST_EN = /\b(?:please|can you|could you|would you|run|test|tests|fix|build|open|search|check|send|create|write|deploy|install|summarize)\b/i;
22
- const TASK = /(?:작업|파일|폴더|디렉터리|레포|저장소|커밋|브랜치|\bPR\b|코드|스크립트|테스트|빌드|배포|설치|설정|명령어|로그|버그|이슈)/i;
23
- const PATH_OR_CODE = /(?:https?:\/\/|www\.|[\w.-]+\/[\w./-]+|\.(?:ts|tsx|js|py|md|json|yaml|swift|kt)\b|[`{};=<>])/i;
24
- const LIVE = /(?:오늘\s*(?:날짜|며칠|무슨\s*요일)|지금\s*몇\s*시|최신|뉴스|속보|주가|시세|환율|날씨|today'?s|latest|news|stock|weather|right now)/i;
25
-
26
- export function classifyShortQuestion(text: string, ctx: ShortQuestionContext = {}): ShortQuestionVerdict {
27
- const q = text.trim();
28
- if (!q) return { fast: false, reason: 'empty' };
29
- if (ctx.hasAttachments) return { fast: false, reason: 'attachment' };
30
- if (/[\r\n\u2028\u2029]/.test(q)) return { fast: false, reason: 'multiline' };
31
- if ([...q].length > 80) return { fast: false, reason: 'long' };
32
- if (PATH_OR_CODE.test(q)) return { fast: false, reason: 'path-or-code' };
33
- if (LIVE.test(q)) return { fast: false, reason: 'live' };
34
- if (REQUEST_KO.test(q) || REQUEST_EN.test(q)) return { fast: false, reason: 'request' };
35
- if (TASK.test(q)) return { fast: false, reason: 'task' };
36
- if (GREETING.test(q)) return { fast: true, reason: 'greeting' };
37
- const core = q.replace(TAIL, '').trim();
38
- if (KO_QUESTION_END.test(core) || EN_QUESTION.test(core)) return { fast: true, reason: 'question' };
39
- return { fast: false, reason: 'not-a-question' };
40
- }
1
+ // The classifier lives in core-turn so the headless ACP path (core-turn-bridge) can use it without importing
2
+ // chat code (tui-client-headless-guard). Existing chat callers keep this path.
3
+ export * from '../core-turn/short-question.js';
@@ -0,0 +1,68 @@
1
+ import type { Command } from 'commander';
2
+ import { readPresence, writePresence, type Presence } from '../away/presence.js';
3
+ import { releaseNowText, releaseWatchTick, type TickDeps, type TickOutcome } from '../away/release-watch.js';
4
+ import { sendOutbound } from '../domains/outbound-alert.js';
5
+ import { readReleaseRuns } from '../nexus/api/ops-api.js';
6
+
7
+ export interface AwayCliDeps {
8
+ read?: () => Presence;
9
+ write?: (away: boolean, by: string) => Presence;
10
+ tick?: (deps?: TickDeps) => TickOutcome;
11
+ now?: () => string;
12
+ send?: (text: string) => boolean;
13
+ output?: (line: string) => void;
14
+ setExitCode?: (code: number) => void;
15
+ }
16
+
17
+ /** AWAY-MODE-1 — `elanous away on|off|status|tick`. 켜고 끄는 순간 텔레그램에 한 줄을 보내 «받는 길이 산다»를 바로 본다. */
18
+ export function registerAwayCommand(program: Command, deps: AwayCliDeps = {}): void {
19
+ const read = deps.read ?? (() => readPresence());
20
+ const write = deps.write ?? ((away: boolean, by: string) => writePresence(away, by));
21
+ const tick = deps.tick ?? releaseWatchTick;
22
+ const now = deps.now ?? (() => releaseNowText(readReleaseRuns(null, undefined, { facts: true })));
23
+ const send = deps.send ?? ((text: string) => sendOutbound(text, 'op-report'));
24
+ const output = deps.output ?? ((line: string) => console.log(line));
25
+ const setExitCode = deps.setExitCode ?? ((code: number) => { process.exitCode = code; });
26
+
27
+ const away = program.command('away').description('외출 모드 — 켜면 발행 현황을 텔레그램으로 따라간다(노드 전이 · 막힘 즉시 · 60분 생존 줄)');
28
+
29
+ away.command('on')
30
+ .description('외출 모드 켜기 — 지금 발행 현황 한 통을 보내고 그 뒤 전이를 따라간다')
31
+ .action(() => {
32
+ write(true, 'cli');
33
+ const ok = send(`🚶 외출 모드 켬 — 발행 현황을 여기로 보낸다(끄기: /away off)\n${now()}`);
34
+ const result = tick();
35
+ output(`외출 모드 켬 · 확인 한 통 ${ok ? '보냄' : '못 보냄'} · 첫 확인 ${result.outcome}`);
36
+ if (!ok) output('⚠️ 텔레그램 발송 실패 — elanous logs --category outbound.send 로 확인');
37
+ setExitCode(ok ? 0 : 1);
38
+ });
39
+
40
+ away.command('off')
41
+ .description('외출 모드 끄기')
42
+ .action(() => {
43
+ write(false, 'cli');
44
+ tick();
45
+ const ok = send('🏠 외출 모드 끔 — 발행 알림은 평소대로');
46
+ output(`외출 모드 끔 · 확인 한 통 ${ok ? '보냄' : '못 보냄'}`);
47
+ setExitCode(ok ? 0 : 1);
48
+ });
49
+
50
+ away.command('status')
51
+ .description('지금 외출 모드인가 ⊕ 발행 현황')
52
+ .option('--json', 'JSON 한 줄')
53
+ .action((opts: { json?: boolean }) => {
54
+ const presence = read();
55
+ if (opts.json) { output(JSON.stringify(presence)); return; }
56
+ output(`${presence.away ? '🚶 외출 중' : '🏠 자리에 있음'}${presence.since ? ` · ${presence.since}` : ''}${presence.by ? ` · ${presence.by}` : ''}`);
57
+ output(now());
58
+ });
59
+
60
+ away.command('tick')
61
+ .description('발행 현황을 한 번 보고 새 전이만 보낸다(주기 실행용 · 자리에 있으면 아무것도 안 함)')
62
+ .option('--json', 'JSON 한 줄')
63
+ .action((opts: { json?: boolean }) => {
64
+ const result = tick();
65
+ output(opts.json ? JSON.stringify(result) : `away tick: ${result.outcome}`);
66
+ setExitCode(result.outcome === 'send-failed' || result.outcome === 'unavailable' ? 1 : 0);
67
+ });
68
+ }