@wrongstack/cli 0.284.0 → 0.285.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (547) hide show
  1. package/README.md +4 -4
  2. package/data/providers.json +5 -3
  3. package/dist/acp-registry-cache.d.ts +33 -0
  4. package/dist/acp-registry-cache.d.ts.map +1 -0
  5. package/dist/acp-server-agent.d.ts +66 -0
  6. package/dist/acp-server-agent.d.ts.map +1 -0
  7. package/dist/arg-parser.d.ts +41 -0
  8. package/dist/arg-parser.d.ts.map +1 -0
  9. package/dist/auth-menu/add-provider.d.ts +15 -0
  10. package/dist/auth-menu/add-provider.d.ts.map +1 -0
  11. package/dist/auth-menu/anthropic-oauth.d.ts +43 -0
  12. package/dist/auth-menu/anthropic-oauth.d.ts.map +1 -0
  13. package/dist/auth-menu/auth-menu-audit.d.ts +175 -0
  14. package/dist/auth-menu/auth-menu-audit.d.ts.map +1 -0
  15. package/dist/auth-menu/direct.d.ts +15 -0
  16. package/dist/auth-menu/direct.d.ts.map +1 -0
  17. package/dist/auth-menu/github-copilot-oauth.d.ts +73 -0
  18. package/dist/auth-menu/github-copilot-oauth.d.ts.map +1 -0
  19. package/dist/auth-menu/helpers.d.ts +7 -0
  20. package/dist/auth-menu/helpers.d.ts.map +1 -0
  21. package/dist/auth-menu/index.d.ts +8 -0
  22. package/dist/auth-menu/index.d.ts.map +1 -0
  23. package/dist/auth-menu/local-presets.d.ts +36 -0
  24. package/dist/auth-menu/local-presets.d.ts.map +1 -0
  25. package/dist/auth-menu/local.d.ts +138 -0
  26. package/dist/auth-menu/local.d.ts.map +1 -0
  27. package/dist/auth-menu/oauth-menu.d.ts +10 -0
  28. package/dist/auth-menu/oauth-menu.d.ts.map +1 -0
  29. package/dist/auth-menu/openai-codex-oauth.d.ts +167 -0
  30. package/dist/auth-menu/openai-codex-oauth.d.ts.map +1 -0
  31. package/dist/auth-menu/panel-service.d.ts +32 -0
  32. package/dist/auth-menu/panel-service.d.ts.map +1 -0
  33. package/dist/auth-menu/provider-menu.d.ts +7 -0
  34. package/dist/auth-menu/provider-menu.d.ts.map +1 -0
  35. package/dist/auth-menu/shared.d.ts +32 -0
  36. package/dist/auth-menu/shared.d.ts.map +1 -0
  37. package/dist/auth-menu/top-menu.d.ts +11 -0
  38. package/dist/auth-menu/top-menu.d.ts.map +1 -0
  39. package/dist/auth-menu/types.d.ts +42 -0
  40. package/dist/auth-menu/types.d.ts.map +1 -0
  41. package/dist/auth-menu.d.ts +7 -0
  42. package/dist/auth-menu.d.ts.map +1 -0
  43. package/dist/autophase-host.d.ts +103 -0
  44. package/dist/autophase-host.d.ts.map +1 -0
  45. package/dist/boot/auto-discover-providers.d.ts +20 -0
  46. package/dist/boot/auto-discover-providers.d.ts.map +1 -0
  47. package/dist/boot/brain-decision-log.d.ts +38 -0
  48. package/dist/boot/brain-decision-log.d.ts.map +1 -0
  49. package/dist/boot/container-wiring.d.ts +34 -0
  50. package/dist/boot/container-wiring.d.ts.map +1 -0
  51. package/dist/boot/dispatch-singleshot.d.ts +35 -0
  52. package/dist/boot/dispatch-singleshot.d.ts.map +1 -0
  53. package/dist/boot/dispatch-webui.d.ts +82 -0
  54. package/dist/boot/dispatch-webui.d.ts.map +1 -0
  55. package/dist/boot/event-wiring.d.ts +22 -0
  56. package/dist/boot/event-wiring.d.ts.map +1 -0
  57. package/dist/boot/short-circuit-desktop.d.ts +3 -0
  58. package/dist/boot/short-circuit-desktop.d.ts.map +1 -0
  59. package/dist/boot/short-circuit-flags.d.ts +9 -0
  60. package/dist/boot/short-circuit-flags.d.ts.map +1 -0
  61. package/dist/boot/short-circuit-hq.d.ts +16 -0
  62. package/dist/boot/short-circuit-hq.d.ts.map +1 -0
  63. package/dist/boot/system-prompt-builder.d.ts +91 -0
  64. package/dist/boot/system-prompt-builder.d.ts.map +1 -0
  65. package/dist/boot/system-prompt.d.ts +66 -0
  66. package/dist/boot/system-prompt.d.ts.map +1 -0
  67. package/dist/boot/tool-registry.d.ts +42 -0
  68. package/dist/boot/tool-registry.d.ts.map +1 -0
  69. package/dist/boot/tui-autophase-wiring.d.ts +23 -0
  70. package/dist/boot/tui-autophase-wiring.d.ts.map +1 -0
  71. package/dist/boot/tui-coordinator-setup.d.ts +38 -0
  72. package/dist/boot/tui-coordinator-setup.d.ts.map +1 -0
  73. package/dist/boot/tui-debug-stream.d.ts +18 -0
  74. package/dist/boot/tui-debug-stream.d.ts.map +1 -0
  75. package/dist/boot/tui-live-sessions.d.ts +39 -0
  76. package/dist/boot/tui-live-sessions.d.ts.map +1 -0
  77. package/dist/boot/tui-project-picker-callback.d.ts +30 -0
  78. package/dist/boot/tui-project-picker-callback.d.ts.map +1 -0
  79. package/dist/boot/tui-project-spawn.d.ts +19 -0
  80. package/dist/boot/tui-project-spawn.d.ts.map +1 -0
  81. package/dist/boot/tui-project-switch.d.ts +26 -0
  82. package/dist/boot/tui-project-switch.d.ts.map +1 -0
  83. package/dist/boot/tui-runtime-state.d.ts +83 -0
  84. package/dist/boot/tui-runtime-state.d.ts.map +1 -0
  85. package/dist/boot/tui-sdd-callback.d.ts +20 -0
  86. package/dist/boot/tui-sdd-callback.d.ts.map +1 -0
  87. package/dist/boot/tui-session-resume.d.ts +21 -0
  88. package/dist/boot/tui-session-resume.d.ts.map +1 -0
  89. package/dist/boot/tui-settings-adapter.d.ts +23 -0
  90. package/dist/boot/tui-settings-adapter.d.ts.map +1 -0
  91. package/dist/boot-config.d.ts +26 -0
  92. package/dist/boot-config.d.ts.map +1 -0
  93. package/dist/boot.d.ts +30 -0
  94. package/dist/boot.d.ts.map +1 -0
  95. package/dist/cli-bundled-prompts.d.ts +12 -0
  96. package/dist/cli-bundled-prompts.d.ts.map +1 -0
  97. package/dist/cli-bundled-skills.d.ts +13 -0
  98. package/dist/cli-bundled-skills.d.ts.map +1 -0
  99. package/dist/cli-context.d.ts +30 -0
  100. package/dist/cli-context.d.ts.map +1 -0
  101. package/dist/cli-entry-point.d.ts +2 -0
  102. package/dist/cli-entry-point.d.ts.map +1 -0
  103. package/dist/cli-eternal-flag.d.ts +66 -0
  104. package/dist/cli-eternal-flag.d.ts.map +1 -0
  105. package/dist/cli-main.d.ts +13 -0
  106. package/dist/cli-main.d.ts.map +1 -0
  107. package/dist/cli-recovery-prompt.d.ts +19 -0
  108. package/dist/cli-recovery-prompt.d.ts.map +1 -0
  109. package/dist/cli-update-notice.d.ts +3 -0
  110. package/dist/cli-update-notice.d.ts.map +1 -0
  111. package/dist/config-doctor.d.ts +39 -0
  112. package/dist/config-doctor.d.ts.map +1 -0
  113. package/dist/config-history.d.ts +54 -0
  114. package/dist/config-history.d.ts.map +1 -0
  115. package/dist/context-limit.d.ts +51 -0
  116. package/dist/context-limit.d.ts.map +1 -0
  117. package/dist/context-overflow-diagnostic.d.ts +3 -0
  118. package/dist/context-overflow-diagnostic.d.ts.map +1 -0
  119. package/dist/diff-renderer.d.ts +2 -0
  120. package/dist/diff-renderer.d.ts.map +1 -0
  121. package/dist/execute-deps.d.ts +239 -0
  122. package/dist/execute-deps.d.ts.map +1 -0
  123. package/dist/execution.d.ts +99 -0
  124. package/dist/execution.d.ts.map +1 -0
  125. package/dist/first-run-auth-gate.d.ts +18 -0
  126. package/dist/first-run-auth-gate.d.ts.map +1 -0
  127. package/dist/fleet/host.d.ts +533 -0
  128. package/dist/fleet/host.d.ts.map +1 -0
  129. package/dist/fleet/routing.d.ts +8 -0
  130. package/dist/fleet/routing.d.ts.map +1 -0
  131. package/dist/fleet/status-broadcast.d.ts +42 -0
  132. package/dist/fleet/status-broadcast.d.ts.map +1 -0
  133. package/dist/fleet/supervisor-registry.d.ts +16 -0
  134. package/dist/fleet/supervisor-registry.d.ts.map +1 -0
  135. package/dist/fleet-statusline.d.ts +71 -0
  136. package/dist/fleet-statusline.d.ts.map +1 -0
  137. package/dist/hooks-wiring.d.ts +26 -0
  138. package/dist/hooks-wiring.d.ts.map +1 -0
  139. package/dist/hq-command-controller.d.ts +52 -0
  140. package/dist/hq-command-controller.d.ts.map +1 -0
  141. package/dist/hq-dashboard-html.d.ts +2 -0
  142. package/dist/hq-dashboard-html.d.ts.map +1 -0
  143. package/dist/hq-publisher.d.ts +16 -0
  144. package/dist/hq-publisher.d.ts.map +1 -0
  145. package/dist/hq-server.d.ts +56 -0
  146. package/dist/hq-server.d.ts.map +1 -0
  147. package/dist/hq-static-serve.d.ts +26 -0
  148. package/dist/hq-static-serve.d.ts.map +1 -0
  149. package/dist/index.d.ts +3 -5
  150. package/dist/index.d.ts.map +1 -0
  151. package/dist/index.js +6025 -3952
  152. package/dist/index.js.map +7 -1
  153. package/dist/input-reader.d.ts +45 -0
  154. package/dist/input-reader.d.ts.map +1 -0
  155. package/dist/launch-hints.d.ts +46 -0
  156. package/dist/launch-hints.d.ts.map +1 -0
  157. package/dist/mailbox-bridge-bootstrap.d.ts +85 -0
  158. package/dist/mailbox-bridge-bootstrap.d.ts.map +1 -0
  159. package/dist/mcp-serve.d.ts +23 -0
  160. package/dist/mcp-serve.d.ts.map +1 -0
  161. package/dist/multi-agent.d.ts +4 -0
  162. package/dist/multi-agent.d.ts.map +1 -0
  163. package/dist/next-task-predictor.d.ts +45 -0
  164. package/dist/next-task-predictor.d.ts.map +1 -0
  165. package/dist/permission-prompt.d.ts +11 -0
  166. package/dist/permission-prompt.d.ts.map +1 -0
  167. package/dist/picker.d.ts +86 -0
  168. package/dist/picker.d.ts.map +1 -0
  169. package/dist/plugin-api-factory.d.ts +3 -0
  170. package/dist/plugin-api-factory.d.ts.map +1 -0
  171. package/dist/plugin-management.d.ts +43 -0
  172. package/dist/plugin-management.d.ts.map +1 -0
  173. package/dist/pre-launch/indexing-question.d.ts +28 -0
  174. package/dist/pre-launch/indexing-question.d.ts.map +1 -0
  175. package/dist/pre-launch/launch-prompts.d.ts +52 -0
  176. package/dist/pre-launch/launch-prompts.d.ts.map +1 -0
  177. package/dist/pre-launch/project-check.d.ts +25 -0
  178. package/dist/pre-launch/project-check.d.ts.map +1 -0
  179. package/dist/pre-launch.d.ts +4 -0
  180. package/dist/pre-launch.d.ts.map +1 -0
  181. package/dist/preflight.d.ts +58 -0
  182. package/dist/preflight.d.ts.map +1 -0
  183. package/dist/project-picker.d.ts +56 -0
  184. package/dist/project-picker.d.ts.map +1 -0
  185. package/dist/provider-config-utils.d.ts +58 -0
  186. package/dist/provider-config-utils.d.ts.map +1 -0
  187. package/dist/provider-helpers.d.ts +53 -0
  188. package/dist/provider-helpers.d.ts.map +1 -0
  189. package/dist/renderer.d.ts +76 -0
  190. package/dist/renderer.d.ts.map +1 -0
  191. package/dist/repl.d.ts +162 -0
  192. package/dist/repl.d.ts.map +1 -0
  193. package/dist/services/project-facts.d.ts +17 -0
  194. package/dist/services/project-facts.d.ts.map +1 -0
  195. package/dist/session-event-wiring.d.ts +48 -0
  196. package/dist/session-event-wiring.d.ts.map +1 -0
  197. package/dist/session-stats.d.ts +38 -0
  198. package/dist/session-stats.d.ts.map +1 -0
  199. package/dist/settings-menu.d.ts +87 -0
  200. package/dist/settings-menu.d.ts.map +1 -0
  201. package/dist/shutdown-cleanup.d.ts +44 -0
  202. package/dist/shutdown-cleanup.d.ts.map +1 -0
  203. package/dist/slash-commands/acp.d.ts +23 -0
  204. package/dist/slash-commands/acp.d.ts.map +1 -0
  205. package/dist/slash-commands/agents.d.ts +16 -0
  206. package/dist/slash-commands/agents.d.ts.map +1 -0
  207. package/dist/slash-commands/audit.d.ts +11 -0
  208. package/dist/slash-commands/audit.d.ts.map +1 -0
  209. package/dist/slash-commands/auth.d.ts +20 -0
  210. package/dist/slash-commands/auth.d.ts.map +1 -0
  211. package/dist/slash-commands/autonomy.d.ts +5 -0
  212. package/dist/slash-commands/autonomy.d.ts.map +1 -0
  213. package/dist/slash-commands/autophase.d.ts +13 -0
  214. package/dist/slash-commands/autophase.d.ts.map +1 -0
  215. package/dist/slash-commands/brain.d.ts +4 -0
  216. package/dist/slash-commands/brain.d.ts.map +1 -0
  217. package/dist/slash-commands/btw.d.ts +13 -0
  218. package/dist/slash-commands/btw.d.ts.map +1 -0
  219. package/dist/slash-commands/clear.d.ts +4 -0
  220. package/dist/slash-commands/clear.d.ts.map +1 -0
  221. package/dist/slash-commands/codebase-reindex.d.ts +11 -0
  222. package/dist/slash-commands/codebase-reindex.d.ts.map +1 -0
  223. package/dist/slash-commands/collab.d.ts +26 -0
  224. package/dist/slash-commands/collab.d.ts.map +1 -0
  225. package/dist/slash-commands/commit-llm.d.ts +41 -0
  226. package/dist/slash-commands/commit-llm.d.ts.map +1 -0
  227. package/dist/slash-commands/compact.d.ts +4 -0
  228. package/dist/slash-commands/compact.d.ts.map +1 -0
  229. package/dist/slash-commands/context.d.ts +4 -0
  230. package/dist/slash-commands/context.d.ts.map +1 -0
  231. package/dist/slash-commands/coordinator.d.ts +4 -0
  232. package/dist/slash-commands/coordinator.d.ts.map +1 -0
  233. package/dist/slash-commands/delegate.d.ts +17 -0
  234. package/dist/slash-commands/delegate.d.ts.map +1 -0
  235. package/dist/slash-commands/design.d.ts +16 -0
  236. package/dist/slash-commands/design.d.ts.map +1 -0
  237. package/dist/slash-commands/dev.d.ts +9 -0
  238. package/dist/slash-commands/dev.d.ts.map +1 -0
  239. package/dist/slash-commands/diag-stats.d.ts +5 -0
  240. package/dist/slash-commands/diag-stats.d.ts.map +1 -0
  241. package/dist/slash-commands/dispatch-llm.d.ts +12 -0
  242. package/dist/slash-commands/dispatch-llm.d.ts.map +1 -0
  243. package/dist/slash-commands/doctor.d.ts +13 -0
  244. package/dist/slash-commands/doctor.d.ts.map +1 -0
  245. package/dist/slash-commands/enhance.d.ts +13 -0
  246. package/dist/slash-commands/enhance.d.ts.map +1 -0
  247. package/dist/slash-commands/ensemble.d.ts +17 -0
  248. package/dist/slash-commands/ensemble.d.ts.map +1 -0
  249. package/dist/slash-commands/f-keys.d.ts +18 -0
  250. package/dist/slash-commands/f-keys.d.ts.map +1 -0
  251. package/dist/slash-commands/fallback.d.ts +20 -0
  252. package/dist/slash-commands/fallback.d.ts.map +1 -0
  253. package/dist/slash-commands/fix-classifier.d.ts +28 -0
  254. package/dist/slash-commands/fix-classifier.d.ts.map +1 -0
  255. package/dist/slash-commands/fix.d.ts +4 -0
  256. package/dist/slash-commands/fix.d.ts.map +1 -0
  257. package/dist/slash-commands/fleet.d.ts +20 -0
  258. package/dist/slash-commands/fleet.d.ts.map +1 -0
  259. package/dist/slash-commands/gitid.d.ts +22 -0
  260. package/dist/slash-commands/gitid.d.ts.map +1 -0
  261. package/dist/slash-commands/goal-refiner.d.ts +22 -0
  262. package/dist/slash-commands/goal-refiner.d.ts.map +1 -0
  263. package/dist/slash-commands/goal.d.ts +4 -0
  264. package/dist/slash-commands/goal.d.ts.map +1 -0
  265. package/dist/slash-commands/help.d.ts +4 -0
  266. package/dist/slash-commands/help.d.ts.map +1 -0
  267. package/dist/slash-commands/helpers.d.ts +33 -0
  268. package/dist/slash-commands/helpers.d.ts.map +1 -0
  269. package/dist/slash-commands/hq.d.ts +4 -0
  270. package/dist/slash-commands/hq.d.ts.map +1 -0
  271. package/dist/slash-commands/index.d.ts +524 -0
  272. package/dist/slash-commands/index.d.ts.map +1 -0
  273. package/dist/slash-commands/init.d.ts +4 -0
  274. package/dist/slash-commands/init.d.ts.map +1 -0
  275. package/dist/slash-commands/interrupt.d.ts +15 -0
  276. package/dist/slash-commands/interrupt.d.ts.map +1 -0
  277. package/dist/slash-commands/kanban.d.ts +4 -0
  278. package/dist/slash-commands/kanban.d.ts.map +1 -0
  279. package/dist/slash-commands/mailbox-demo.d.ts +19 -0
  280. package/dist/slash-commands/mailbox-demo.d.ts.map +1 -0
  281. package/dist/slash-commands/mailbox-serve.d.ts +20 -0
  282. package/dist/slash-commands/mailbox-serve.d.ts.map +1 -0
  283. package/dist/slash-commands/mailbox.d.ts +28 -0
  284. package/dist/slash-commands/mailbox.d.ts.map +1 -0
  285. package/dist/slash-commands/mcp-utils.d.ts +24 -0
  286. package/dist/slash-commands/mcp-utils.d.ts.map +1 -0
  287. package/dist/slash-commands/mcp.d.ts +19 -0
  288. package/dist/slash-commands/mcp.d.ts.map +1 -0
  289. package/dist/slash-commands/memory.d.ts +4 -0
  290. package/dist/slash-commands/memory.d.ts.map +1 -0
  291. package/dist/slash-commands/mode.d.ts +6 -0
  292. package/dist/slash-commands/mode.d.ts.map +1 -0
  293. package/dist/slash-commands/modelcaps.d.ts +4 -0
  294. package/dist/slash-commands/modelcaps.d.ts.map +1 -0
  295. package/dist/slash-commands/models.d.ts +23 -0
  296. package/dist/slash-commands/models.d.ts.map +1 -0
  297. package/dist/slash-commands/mouse.d.ts +14 -0
  298. package/dist/slash-commands/mouse.d.ts.map +1 -0
  299. package/dist/slash-commands/next.d.ts +21 -0
  300. package/dist/slash-commands/next.d.ts.map +1 -0
  301. package/dist/slash-commands/plugin.d.ts +4 -0
  302. package/dist/slash-commands/plugin.d.ts.map +1 -0
  303. package/dist/slash-commands/project-utils.d.ts +51 -0
  304. package/dist/slash-commands/project-utils.d.ts.map +1 -0
  305. package/dist/slash-commands/project.d.ts +4 -0
  306. package/dist/slash-commands/project.d.ts.map +1 -0
  307. package/dist/slash-commands/prune.d.ts +4 -0
  308. package/dist/slash-commands/prune.d.ts.map +1 -0
  309. package/dist/slash-commands/review.d.ts +4 -0
  310. package/dist/slash-commands/review.d.ts.map +1 -0
  311. package/dist/slash-commands/sdd/project-context.d.ts +7 -0
  312. package/dist/slash-commands/sdd/project-context.d.ts.map +1 -0
  313. package/dist/slash-commands/sdd/rendering.d.ts +2 -0
  314. package/dist/slash-commands/sdd/rendering.d.ts.map +1 -0
  315. package/dist/slash-commands/sdd/spec-detection.d.ts +21 -0
  316. package/dist/slash-commands/sdd/spec-detection.d.ts.map +1 -0
  317. package/dist/slash-commands/sdd/state.d.ts +40 -0
  318. package/dist/slash-commands/sdd/state.d.ts.map +1 -0
  319. package/dist/slash-commands/sdd/task-manager.d.ts +37 -0
  320. package/dist/slash-commands/sdd/task-manager.d.ts.map +1 -0
  321. package/dist/slash-commands/sdd.d.ts +15 -0
  322. package/dist/slash-commands/sdd.d.ts.map +1 -0
  323. package/dist/slash-commands/security.d.ts +4 -0
  324. package/dist/slash-commands/security.d.ts.map +1 -0
  325. package/dist/slash-commands/session.d.ts +7 -0
  326. package/dist/slash-commands/session.d.ts.map +1 -0
  327. package/dist/slash-commands/setmodel.d.ts +20 -0
  328. package/dist/slash-commands/setmodel.d.ts.map +1 -0
  329. package/dist/slash-commands/settings.d.ts +12 -0
  330. package/dist/slash-commands/settings.d.ts.map +1 -0
  331. package/dist/slash-commands/shadow.d.ts +28 -0
  332. package/dist/slash-commands/shadow.d.ts.map +1 -0
  333. package/dist/slash-commands/slash-deep-help.d.ts +51 -0
  334. package/dist/slash-commands/slash-deep-help.d.ts.map +1 -0
  335. package/dist/slash-commands/spawn-agents.d.ts +6 -0
  336. package/dist/slash-commands/spawn-agents.d.ts.map +1 -0
  337. package/dist/slash-commands/statusline.d.ts +67 -0
  338. package/dist/slash-commands/statusline.d.ts.map +1 -0
  339. package/dist/slash-commands/suggest.d.ts +4 -0
  340. package/dist/slash-commands/suggest.d.ts.map +1 -0
  341. package/dist/slash-commands/suggestion-store.d.ts +29 -0
  342. package/dist/slash-commands/suggestion-store.d.ts.map +1 -0
  343. package/dist/slash-commands/supervisor.d.ts +18 -0
  344. package/dist/slash-commands/supervisor.d.ts.map +1 -0
  345. package/dist/slash-commands/surfaces.d.ts +4 -0
  346. package/dist/slash-commands/surfaces.d.ts.map +1 -0
  347. package/dist/slash-commands/tasks.d.ts +4 -0
  348. package/dist/slash-commands/tasks.d.ts.map +1 -0
  349. package/dist/slash-commands/techstack.d.ts +4 -0
  350. package/dist/slash-commands/techstack.d.ts.map +1 -0
  351. package/dist/slash-commands/telegram-settings.d.ts +4 -0
  352. package/dist/slash-commands/telegram-settings.d.ts.map +1 -0
  353. package/dist/slash-commands/telegram-setup.d.ts +11 -0
  354. package/dist/slash-commands/telegram-setup.d.ts.map +1 -0
  355. package/dist/slash-commands/todos.d.ts +4 -0
  356. package/dist/slash-commands/todos.d.ts.map +1 -0
  357. package/dist/slash-commands/tool.d.ts +4 -0
  358. package/dist/slash-commands/tool.d.ts.map +1 -0
  359. package/dist/slash-commands/tools.d.ts +4 -0
  360. package/dist/slash-commands/tools.d.ts.map +1 -0
  361. package/dist/slash-commands/tuneup.d.ts +15 -0
  362. package/dist/slash-commands/tuneup.d.ts.map +1 -0
  363. package/dist/slash-commands/working-dir.d.ts +14 -0
  364. package/dist/slash-commands/working-dir.d.ts.map +1 -0
  365. package/dist/slash-commands/worktree.d.ts +8 -0
  366. package/dist/slash-commands/worktree.d.ts.map +1 -0
  367. package/dist/slash-commands/yolo.d.ts +4 -0
  368. package/dist/slash-commands/yolo.d.ts.map +1 -0
  369. package/dist/spinner.d.ts +44 -0
  370. package/dist/spinner.d.ts.map +1 -0
  371. package/dist/subcommands/handlers/acp.d.ts +15 -0
  372. package/dist/subcommands/handlers/acp.d.ts.map +1 -0
  373. package/dist/subcommands/handlers/audit.d.ts +12 -0
  374. package/dist/subcommands/handlers/audit.d.ts.map +1 -0
  375. package/dist/subcommands/handlers/auth-local-help.d.ts +69 -0
  376. package/dist/subcommands/handlers/auth-local-help.d.ts.map +1 -0
  377. package/dist/subcommands/handlers/auth.d.ts +3 -0
  378. package/dist/subcommands/handlers/auth.d.ts.map +1 -0
  379. package/dist/subcommands/handlers/bench-run-help.d.ts +145 -0
  380. package/dist/subcommands/handlers/bench-run-help.d.ts.map +1 -0
  381. package/dist/subcommands/handlers/bench.d.ts +13 -0
  382. package/dist/subcommands/handlers/bench.d.ts.map +1 -0
  383. package/dist/subcommands/handlers/config-history.d.ts +10 -0
  384. package/dist/subcommands/handlers/config-history.d.ts.map +1 -0
  385. package/dist/subcommands/handlers/diag-doctor.d.ts +4 -0
  386. package/dist/subcommands/handlers/diag-doctor.d.ts.map +1 -0
  387. package/dist/subcommands/handlers/export.d.ts +3 -0
  388. package/dist/subcommands/handlers/export.d.ts.map +1 -0
  389. package/dist/subcommands/handlers/helpers.d.ts +2 -0
  390. package/dist/subcommands/handlers/helpers.d.ts.map +1 -0
  391. package/dist/subcommands/handlers/hq.d.ts +3 -0
  392. package/dist/subcommands/handlers/hq.d.ts.map +1 -0
  393. package/dist/subcommands/handlers/init.d.ts +7 -0
  394. package/dist/subcommands/handlers/init.d.ts.map +1 -0
  395. package/dist/subcommands/handlers/mailbox-serve.d.ts +3 -0
  396. package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -0
  397. package/dist/subcommands/handlers/mcp.d.ts +3 -0
  398. package/dist/subcommands/handlers/mcp.d.ts.map +1 -0
  399. package/dist/subcommands/handlers/modeldiag.d.ts +3 -0
  400. package/dist/subcommands/handlers/modeldiag.d.ts.map +1 -0
  401. package/dist/subcommands/handlers/models-add-help.d.ts +142 -0
  402. package/dist/subcommands/handlers/models-add-help.d.ts.map +1 -0
  403. package/dist/subcommands/handlers/per-subcommand-help.d.ts +136 -0
  404. package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +1 -0
  405. package/dist/subcommands/handlers/plugin-usage.d.ts +4 -0
  406. package/dist/subcommands/handlers/plugin-usage.d.ts.map +1 -0
  407. package/dist/subcommands/handlers/projects.d.ts +3 -0
  408. package/dist/subcommands/handlers/projects.d.ts.map +1 -0
  409. package/dist/subcommands/handlers/providers-models.d.ts +4 -0
  410. package/dist/subcommands/handlers/providers-models.d.ts.map +1 -0
  411. package/dist/subcommands/handlers/quick.d.ts +14 -0
  412. package/dist/subcommands/handlers/quick.d.ts.map +1 -0
  413. package/dist/subcommands/handlers/replay.d.ts +12 -0
  414. package/dist/subcommands/handlers/replay.d.ts.map +1 -0
  415. package/dist/subcommands/handlers/rewind.d.ts +3 -0
  416. package/dist/subcommands/handlers/rewind.d.ts.map +1 -0
  417. package/dist/subcommands/handlers/sessions-config.d.ts +4 -0
  418. package/dist/subcommands/handlers/sessions-config.d.ts.map +1 -0
  419. package/dist/subcommands/handlers/sessions-fleet.d.ts +15 -0
  420. package/dist/subcommands/handlers/sessions-fleet.d.ts.map +1 -0
  421. package/dist/subcommands/handlers/tools-skills.d.ts +4 -0
  422. package/dist/subcommands/handlers/tools-skills.d.ts.map +1 -0
  423. package/dist/subcommands/handlers/update.d.ts +7 -0
  424. package/dist/subcommands/handlers/update.d.ts.map +1 -0
  425. package/dist/subcommands/handlers/version-help.d.ts +4 -0
  426. package/dist/subcommands/handlers/version-help.d.ts.map +1 -0
  427. package/dist/subcommands/index.d.ts +26 -0
  428. package/dist/subcommands/index.d.ts.map +1 -0
  429. package/dist/theme.d.ts +12 -0
  430. package/dist/theme.d.ts.map +1 -0
  431. package/dist/tui-thinking-word.d.ts +5 -0
  432. package/dist/tui-thinking-word.d.ts.map +1 -0
  433. package/dist/tuneup.d.ts +162 -0
  434. package/dist/tuneup.d.ts.map +1 -0
  435. package/dist/update-check.d.ts +22 -0
  436. package/dist/update-check.d.ts.map +1 -0
  437. package/dist/utils/delay-format.d.ts +5 -0
  438. package/dist/utils/delay-format.d.ts.map +1 -0
  439. package/dist/utils/win32-cmd.d.ts +7 -0
  440. package/dist/utils/win32-cmd.d.ts.map +1 -0
  441. package/dist/utils.d.ts +58 -0
  442. package/dist/utils.d.ts.map +1 -0
  443. package/dist/version.d.ts +4 -0
  444. package/dist/version.d.ts.map +1 -0
  445. package/dist/webui-server/client-registration.d.ts +41 -0
  446. package/dist/webui-server/client-registration.d.ts.map +1 -0
  447. package/dist/webui-server/connection-handler.d.ts +59 -0
  448. package/dist/webui-server/connection-handler.d.ts.map +1 -0
  449. package/dist/webui-server/context-breakdown.d.ts +57 -0
  450. package/dist/webui-server/context-breakdown.d.ts.map +1 -0
  451. package/dist/webui-server/cost-helpers.d.ts +29 -0
  452. package/dist/webui-server/cost-helpers.d.ts.map +1 -0
  453. package/dist/webui-server/lifecycle.d.ts +108 -0
  454. package/dist/webui-server/lifecycle.d.ts.map +1 -0
  455. package/dist/webui-server/logger-shim.d.ts +10 -0
  456. package/dist/webui-server/logger-shim.d.ts.map +1 -0
  457. package/dist/webui-server/message-router.d.ts +39 -0
  458. package/dist/webui-server/message-router.d.ts.map +1 -0
  459. package/dist/webui-server/prefs-seeding.d.ts +57 -0
  460. package/dist/webui-server/prefs-seeding.d.ts.map +1 -0
  461. package/dist/webui-server/provider-config.d.ts +61 -0
  462. package/dist/webui-server/provider-config.d.ts.map +1 -0
  463. package/dist/webui-server/session-start-payload.d.ts +20 -0
  464. package/dist/webui-server/session-start-payload.d.ts.map +1 -0
  465. package/dist/webui-server/session-status-poll.d.ts +14 -0
  466. package/dist/webui-server/session-status-poll.d.ts.map +1 -0
  467. package/dist/webui-server/setup-events.d.ts +45 -0
  468. package/dist/webui-server/setup-events.d.ts.map +1 -0
  469. package/dist/webui-server/static-serve.d.ts +70 -0
  470. package/dist/webui-server/static-serve.d.ts.map +1 -0
  471. package/dist/webui-server/stream-coalescer.d.ts +41 -0
  472. package/dist/webui-server/stream-coalescer.d.ts.map +1 -0
  473. package/dist/webui-server/ws-handlers/agent-config.d.ts +47 -0
  474. package/dist/webui-server/ws-handlers/agent-config.d.ts.map +1 -0
  475. package/dist/webui-server/ws-handlers/brain.d.ts +36 -0
  476. package/dist/webui-server/ws-handlers/brain.d.ts.map +1 -0
  477. package/dist/webui-server/ws-handlers/connection.d.ts +50 -0
  478. package/dist/webui-server/ws-handlers/connection.d.ts.map +1 -0
  479. package/dist/webui-server/ws-handlers/context.d.ts +55 -0
  480. package/dist/webui-server/ws-handlers/context.d.ts.map +1 -0
  481. package/dist/webui-server/ws-handlers/index.d.ts +60 -0
  482. package/dist/webui-server/ws-handlers/index.d.ts.map +1 -0
  483. package/dist/webui-server/ws-handlers/introspection.d.ts +35 -0
  484. package/dist/webui-server/ws-handlers/introspection.d.ts.map +1 -0
  485. package/dist/webui-server/ws-handlers/kanban.d.ts +41 -0
  486. package/dist/webui-server/ws-handlers/kanban.d.ts.map +1 -0
  487. package/dist/webui-server/ws-handlers/mailbox.d.ts +51 -0
  488. package/dist/webui-server/ws-handlers/mailbox.d.ts.map +1 -0
  489. package/dist/webui-server/ws-handlers/oauth.d.ts +16 -0
  490. package/dist/webui-server/ws-handlers/oauth.d.ts.map +1 -0
  491. package/dist/webui-server/ws-handlers/prefs.d.ts +32 -0
  492. package/dist/webui-server/ws-handlers/prefs.d.ts.map +1 -0
  493. package/dist/webui-server/ws-handlers/process.d.ts +6 -0
  494. package/dist/webui-server/ws-handlers/process.d.ts.map +1 -0
  495. package/dist/webui-server/ws-handlers/projects.d.ts +44 -0
  496. package/dist/webui-server/ws-handlers/projects.d.ts.map +1 -0
  497. package/dist/webui-server/ws-handlers/providers.d.ts +36 -0
  498. package/dist/webui-server/ws-handlers/providers.d.ts.map +1 -0
  499. package/dist/webui-server/ws-handlers/sessions.d.ts +38 -0
  500. package/dist/webui-server/ws-handlers/sessions.d.ts.map +1 -0
  501. package/dist/webui-server/ws-handlers/worklist.d.ts +49 -0
  502. package/dist/webui-server/ws-handlers/worklist.d.ts.map +1 -0
  503. package/dist/webui-server.d.ts +160 -0
  504. package/dist/webui-server.d.ts.map +1 -0
  505. package/dist/wiring/brain-and-orchestration.d.ts +63 -0
  506. package/dist/wiring/brain-and-orchestration.d.ts.map +1 -0
  507. package/dist/wiring/codebase-index.d.ts +33 -0
  508. package/dist/wiring/codebase-index.d.ts.map +1 -0
  509. package/dist/wiring/controllers.d.ts +46 -0
  510. package/dist/wiring/controllers.d.ts.map +1 -0
  511. package/dist/wiring/dep-watcher.d.ts +23 -0
  512. package/dist/wiring/dep-watcher.d.ts.map +1 -0
  513. package/dist/wiring/design-studio.d.ts +17 -0
  514. package/dist/wiring/design-studio.d.ts.map +1 -0
  515. package/dist/wiring/director-setup.d.ts +51 -0
  516. package/dist/wiring/director-setup.d.ts.map +1 -0
  517. package/dist/wiring/hq-telemetry.d.ts +42 -0
  518. package/dist/wiring/hq-telemetry.d.ts.map +1 -0
  519. package/dist/wiring/lifecycle-plugins.d.ts +58 -0
  520. package/dist/wiring/lifecycle-plugins.d.ts.map +1 -0
  521. package/dist/wiring/mailbox-bridge-bootstrap.d.ts +53 -0
  522. package/dist/wiring/mailbox-bridge-bootstrap.d.ts.map +1 -0
  523. package/dist/wiring/metrics.d.ts +21 -0
  524. package/dist/wiring/metrics.d.ts.map +1 -0
  525. package/dist/wiring/pipeline.d.ts +96 -0
  526. package/dist/wiring/pipeline.d.ts.map +1 -0
  527. package/dist/wiring/plugins.d.ts +108 -0
  528. package/dist/wiring/plugins.d.ts.map +1 -0
  529. package/dist/wiring/provider-runtime-setup.d.ts +47 -0
  530. package/dist/wiring/provider-runtime-setup.d.ts.map +1 -0
  531. package/dist/wiring/provider-runtime.d.ts +57 -0
  532. package/dist/wiring/provider-runtime.d.ts.map +1 -0
  533. package/dist/wiring/provider.d.ts +13 -0
  534. package/dist/wiring/provider.d.ts.map +1 -0
  535. package/dist/wiring/replay.d.ts +32 -0
  536. package/dist/wiring/replay.d.ts.map +1 -0
  537. package/dist/wiring/session.d.ts +56 -0
  538. package/dist/wiring/session.d.ts.map +1 -0
  539. package/dist/wiring/slash-commands.d.ts +74 -0
  540. package/dist/wiring/slash-commands.d.ts.map +1 -0
  541. package/dist/wiring/super-memory.d.ts +9 -0
  542. package/dist/wiring/super-memory.d.ts.map +1 -0
  543. package/dist/wiring/to-execute-deps.d.ts +11 -0
  544. package/dist/wiring/to-execute-deps.d.ts.map +1 -0
  545. package/dist/wiring/tools.d.ts +41 -0
  546. package/dist/wiring/tools.d.ts.map +1 -0
  547. package/package.json +20 -20
@@ -0,0 +1,138 @@
1
+ /**
2
+ * `wstack auth local` — quick-add shortcut for local-LLM servers.
3
+ *
4
+ * Three servers are first-class: Ollama, vLLM, LM Studio. They share an
5
+ * OpenAI-compatible wire format at `/v1/chat/completions`, so each entry
6
+ * here just declares the defaults that the matching wire preset
7
+ * (see `@wrongstack/providers/src/presets/local-llm.ts`) expects.
8
+ *
9
+ * Difference that matters at the config layer:
10
+ * - Ollama → no auth (the server rejects any Authorization header).
11
+ * - vLLM → optional Bearer auth; key is left blank when auth is
12
+ * disabled on the server, so the prompt is "Enter to skip".
13
+ * - LM Studio → same as vLLM (optional Bearer).
14
+ *
15
+ * Selection is interactive by default — the user picks `1/2/3` from a
16
+ * numbered list. A direct path is also exposed for scripting via the
17
+ * `--name <ollama|vllm|lmstudio>` flag.
18
+ *
19
+ * Before saving, the shortcut runs a health probe (`GET /v1/models`)
20
+ * to verify the server is actually reachable. The probe is opt-out via
21
+ * `--no-probe`; failures are non-fatal by default — the user is asked
22
+ * whether to save anyway. Every log line is run through the shared
23
+ * `SecretScrubber` before reaching the renderer, so a Bearer token
24
+ * accidentally captured in a probe log can never echo to the terminal
25
+ * in plaintext.
26
+ */
27
+ import { type SecretScrubber } from '@wrongstack/core';
28
+ import { LOCAL_LLM_PRESETS, type LocalLlmPresetEntry } from './local-presets.js';
29
+ import { suggestLabel } from './shared.js';
30
+ import type { AuthMenuDeps } from './types.js';
31
+ import { probeLocalLlm } from '@wrongstack/runtime/probe';
32
+ import type { ProbeOptions, ProbeResult } from '@wrongstack/runtime/probe';
33
+ import { type AuthAuditLogger } from './auth-menu-audit.js';
34
+ export { probeLocalLlm, type ProbeOptions, type ProbeResult };
35
+ export { LOCAL_LLM_PRESETS, type LocalLlmPresetEntry };
36
+ export interface RunAuthLocalOptions {
37
+ /**
38
+ * Direct pick: skip the interactive menu and configure this preset.
39
+ * `wstack auth local --name ollama` maps to `{ name: 'ollama' }`.
40
+ */
41
+ name?: string | undefined;
42
+ /**
43
+ * Override the default base URL. Empty / undefined falls back to the
44
+ * preset's `defaultBaseUrl`.
45
+ */
46
+ baseUrl?: string | undefined;
47
+ /**
48
+ * Optional key to save. When omitted, the shortcut prompts the user
49
+ * (unless the preset is `noAuth: true`).
50
+ */
51
+ apiKey?: string | undefined;
52
+ /**
53
+ * Optional label for the saved key. Defaults to "default" (matching
54
+ * `addKeyForProvider` and `runAuthDirect`).
55
+ */
56
+ label?: string | undefined;
57
+ /**
58
+ * Force-skip the key prompt even for presets that normally accept a
59
+ * key. Useful for scripting `wstack auth local --name ollama --no-key`
60
+ * so no TTY input is required.
61
+ */
62
+ skipKey?: boolean | undefined;
63
+ /**
64
+ * Skip the reachability probe entirely. Use for scripting when the
65
+ * local server may not be running yet (e.g. CI installing Ollama in
66
+ * the background) but the user still wants the config in place.
67
+ */
68
+ noProbe?: boolean | undefined;
69
+ /**
70
+ * Run the probe and report, but don't save. Useful for re-checking a
71
+ * previously-saved local provider.
72
+ */
73
+ probeOnly?: boolean | undefined;
74
+ /**
75
+ * Inject a custom `fetch` (test seam). Defaults to the global one.
76
+ */
77
+ fetchImpl?: typeof fetch | undefined;
78
+ /**
79
+ * Probe timeout override (test seam). Defaults to {@link PROBE_TIMEOUT_MS}.
80
+ */
81
+ probeTimeoutMs?: number | undefined;
82
+ /**
83
+ * Pre-populate `providers[id].models` so the user can launch
84
+ * `wstack --provider <id> --model <picked>` right after the shortcut
85
+ * completes. Four shapes are accepted:
86
+ *
87
+ * - `undefined` (or omitted) → don't touch `cfg.models`.
88
+ * - `'first'` → take the first model id from the probe.
89
+ * - `<N>` (a positive integer string) → take the first N ids.
90
+ * Caps at the available list size.
91
+ * - Anything else → treated as a literal comma-separated list of
92
+ * model ids. Used verbatim, ignoring the probe result.
93
+ *
94
+ * When the probe didn't run (`noProbe: true`) or failed, only the
95
+ * literal-list shape is meaningful — the count-based shapes return
96
+ * an empty list and the shortcut proceeds without writing models.
97
+ */
98
+ models?: string | undefined;
99
+ /**
100
+ * Audit logger (test seam). When supplied, the function emits
101
+ * structured `auth.local.*` events for the save lifecycle:
102
+ * `add` / `clear` / `undo` / `probe_skip` / `probe_failed_save`.
103
+ * The default is a no-op logger (production usage in
104
+ * `wstack auth local` doesn't currently wire one — the WS server
105
+ * is the source of truth for the dedicated `provider.*` message
106
+ * types on the WebUI side; this option exists so the
107
+ * integration test can capture the CLI flow's events for
108
+ * end-to-end verification).
109
+ */
110
+ audit?: AuthAuditLogger | undefined;
111
+ }
112
+ /**
113
+ * Quick-add entry point. Returns 0 on success, 1 on a hard error.
114
+ *
115
+ * The exit-code semantics are:
116
+ * - 0 → provider saved (or `probeOnly` ran successfully / user
117
+ * canceled with no state change / user declined save after
118
+ * probe failure)
119
+ * - 1 → hard failure: unknown --name, mutate threw, etc.
120
+ */
121
+ export declare function runAuthLocal(deps: AuthMenuDeps, opts?: RunAuthLocalOptions): Promise<number>;
122
+ /**
123
+ * Resolve the user-supplied `models` option against the probe result.
124
+ *
125
+ * - `undefined` → null (don't write `cfg.models`)
126
+ * - `'first'` → first probe id, or null if probe failed
127
+ * - `<positive int>` → first N probe ids, or null if probe failed
128
+ * - literal csv → parsed list, ignoring the probe (the
129
+ * user knows exactly which ids they want)
130
+ *
131
+ * Returns the resolved id list, or null when no `models` should be
132
+ * written. Each entry is scrubbed before return — the user's literal
133
+ * list could in theory contain a credential if they pasted it from
134
+ * a config dump; better to scrub once here than risk echoing it back.
135
+ */
136
+ export declare function resolveModelList(models: string | undefined, probe: ProbeResult | undefined, scrubber: SecretScrubber): string[] | null;
137
+ export { suggestLabel };
138
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/auth-menu/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,KAAK,cAAc,EAAgC,MAAM,kBAAkB,CAAC;AAQrF,OAAO,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,KA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
+ /** Render subscription OAuth login choices shared by the top menu and add flow. */
3
+ export declare function renderOAuthLoginOptions(deps: AuthMenuDeps, indent?: string): void;
4
+ /** Run an OAuth login for a normalized menu choice. Returns true when handled. */
5
+ export declare function runOAuthLoginChoice(deps: AuthMenuDeps, choice: string, opts?: {
6
+ allowNumeric?: boolean;
7
+ }): Promise<boolean>;
8
+ /** Sub-menu: pick a subscription to sign in with (OAuth). */
9
+ export declare function runOAuthLoginMenu(deps: AuthMenuDeps): Promise<void>;
10
+ //# sourceMappingURL=oauth-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-menu.d.ts","sourceRoot":"","sources":["../../src/auth-menu/oauth-menu.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,mFAAmF;AACnF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,SAAS,GAAG,IAAI,CAOjF;AAED,kFAAkF;AAClF,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO,GACpC,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED,6DAA6D;AAC7D,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAYzE"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * OpenAI Codex — "Sign in with ChatGPT" OAuth (Authorization Code + PKCE).
3
+ *
4
+ * This is the ONLY login flow that actually works for using a ChatGPT
5
+ * Plus/Pro/Team subscription programmatically. It mirrors the real Codex CLI:
6
+ *
7
+ * 1. Generate a PKCE verifier/challenge (S256) + CSRF state.
8
+ * 2. Start a loopback HTTP server on http://localhost:1455/auth/callback.
9
+ * 3. Open the browser to https://auth.openai.com/oauth/authorize.
10
+ * 4. The browser redirects back to the loopback with `?code=...&state=...`.
11
+ * 5. Exchange the code at https://auth.openai.com/oauth/token for an
12
+ * access_token + refresh_token (and an id_token carrying the account id).
13
+ * 6. Store the tokens in the vault as an `oauth` ProviderApiKey.
14
+ *
15
+ * The resulting access token is a JWT whose `https://api.openai.com/auth`
16
+ * claim contains `chatgpt_account_id`. Requests then go to the ChatGPT
17
+ * backend (`chatgpt.com/backend-api/codex/responses`) — NOT api.openai.com —
18
+ * which is what the `openai-codex` wire family handles. The standard
19
+ * API-key flow (`family: openai` → api.openai.com/chat/completions) is left
20
+ * completely untouched.
21
+ *
22
+ * NOTE: a ChatGPT web *session cookie* is NOT an API token. The old
23
+ * device-code + cookie-scraping attempts could never produce a usable
24
+ * credential; this module replaces them.
25
+ */
26
+ import { type ModelsRegistry } from '@wrongstack/core';
27
+ import type { AuthMenuDeps } from './types.js';
28
+ /** Canonical provider id under which ChatGPT-login credentials are stored. */
29
+ export declare const CODEX_PROVIDER_ID = "openai-codex";
30
+ /** Default ChatGPT backend base. The wire family appends `/codex/responses`. */
31
+ export declare const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
32
+ /**
33
+ * Fallback model list used when BOTH the live backend AND the models.dev
34
+ * catalog are unreachable. This should never happen in practice — the
35
+ * catalog is cached locally and the only scenario where both fail is a
36
+ * fresh install with no network on first login.
37
+ *
38
+ * The primary resolution order in `resolveCodexModels()` is:
39
+ * 1. Live backend (`GET /models`)
40
+ * 2. models.dev catalog (`family: gpt-codex*` under `openai` provider)
41
+ * 3. This inline fallback
42
+ */
43
+ export interface CodexTokens {
44
+ access: string;
45
+ refresh: string;
46
+ /** Absolute expiry in epoch milliseconds. */
47
+ expires: number;
48
+ idToken?: string | undefined;
49
+ }
50
+ export interface Pkce {
51
+ verifier: string;
52
+ challenge: string;
53
+ }
54
+ /** Generate a PKCE verifier + S256 challenge. */
55
+ export declare function generatePkce(): Pkce;
56
+ /** Build the full authorize URL with all Codex-required query params. */
57
+ export declare function buildAuthorizeUrl(challenge: string, state: string, port?: number): string;
58
+ /**
59
+ * Extract `chatgpt_account_id` from an access/id token JWT. Returns null when
60
+ * the token isn't a JWT or lacks the claim (the caller decides whether that
61
+ * is fatal — for login it is; for a cached display value it isn't).
62
+ */
63
+ export declare function extractAccountId(token: string): string | null;
64
+ /**
65
+ * Recommended Codex models for ChatGPT sign-in. Live backend discovery
66
+ * wins; these values are only used when the backend/catalog cannot
67
+ * provide a list. Derived from `CODEX_MODELS` in core (the single source of
68
+ * truth for Codex id/name/description) — used both by OAuth login
69
+ * (resolveCodexModels → tier 3) and by the provider-boot synthesis
70
+ * path (wiring/provider.ts when the catalog is unavailable).
71
+ */
72
+ export declare const FALLBACK_CODEX_MODELS: ReadonlyArray<{
73
+ id: string;
74
+ name: string;
75
+ }>;
76
+ /** Families in the models.dev catalog that indicate Codex / Responses API compatibility. */
77
+ export declare const CODEX_CATALOG_FAMILIES: Set<string>;
78
+ export declare function fallbackCodexModelIds(): string[];
79
+ export declare function fallbackCodexProviderModels(): Array<{
80
+ id: string;
81
+ name: string;
82
+ }>;
83
+ /**
84
+ * Filter a list of available model ids down to the ones that are still
85
+ * current for ChatGPT sign-in (i.e. present in FALLBACK_CODEX_MODELS).
86
+ * Used by both OAuth login (to drop deprecated ids from the live /models
87
+ * response) and by the provider-boot synthesis (to pick current ids out
88
+ * of the models.dev catalog).
89
+ */
90
+ export declare function filterCurrentCodexModelIds(ids: Iterable<string>): string[];
91
+ export declare function isCodexCatalogModel(model: {
92
+ family?: string | undefined;
93
+ }): boolean;
94
+ /**
95
+ * Resolve the list of available Codex models using a 3-tier fallback chain:
96
+ *
97
+ * 1. **Live backend** — `fetchCodexModels()` hits `GET <baseUrl>/models`
98
+ * and keeps only current Codex model ids.
99
+ * 2. **models.dev catalog** — queries the `openai` provider in the cached
100
+ * models.dev registry and picks models whose `family` is `gpt-codex` or
101
+ * `gpt-codex-spark` and whose ids are current for ChatGPT sign-in.
102
+ * 3. **Inline fallback** — a minimal list of documented mainstream models
103
+ * (`gpt-5.6-sol`, `gpt-5.5`, `gpt-5.6-terra`, `gpt-5.6-luna`,
104
+ * `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.3-codex-spark`).
105
+ *
106
+ * The live/catalog tiers gate account availability, while the shared current
107
+ * model list filters out deprecated ChatGPT sign-in ids before config is saved.
108
+ */
109
+ export declare function resolveCodexModels(modelsRegistry: ModelsRegistry, accessToken: Promise<string> | string, baseUrl?: string | undefined, signal?: AbortSignal): Promise<string[]>;
110
+ /**
111
+ * Fetch the account's available Codex model ids live from the ChatGPT backend.
112
+ *
113
+ * Hits `GET <baseUrl>/models` — the standard OpenAI-compatible model listing
114
+ * endpoint, which the Codex backend may expose. Best-effort: returns an empty
115
+ * array on any failure so login still succeeds with the hardcoded fallback.
116
+ */
117
+ export declare function fetchCodexModels(accessToken: string, baseUrl?: string | undefined, signal?: AbortSignal): Promise<string[]>;
118
+ /** Exchange an authorization code (+ PKCE verifier) for tokens. */
119
+ export declare function exchangeAuthorizationCode(code: string, verifier: string, signal?: AbortSignal, port?: number): Promise<CodexTokens>;
120
+ /**
121
+ * Refresh an expired access token using the stored refresh token. Exported for
122
+ * the `openai-codex` provider, which calls it transparently before requests.
123
+ */
124
+ export declare function refreshCodexToken(refreshToken: string, signal?: AbortSignal): Promise<CodexTokens>;
125
+ interface LoopbackServer {
126
+ /** Resolves with the authorization code, or null if cancelled/failed to bind. */
127
+ waitForCode(): Promise<string | null>;
128
+ close(): void;
129
+ /** True when the server bound to a registered callback port; false means all ports were busy. */
130
+ readonly bound: boolean;
131
+ /** The actual callback port, matching the authorize URL and token exchange redirect_uri. */
132
+ readonly port: number;
133
+ }
134
+ /**
135
+ * Start the loopback server. Resolves once it is listening (or has failed to
136
+ * bind, in which case `bound` is false and the caller falls back to manual
137
+ * paste).
138
+ *
139
+ * When `signal` aborts (e.g. the user pressed Ctrl+C), the pending
140
+ * `waitForCode()` promise resolves to `null` and the underlying HTTP server is
141
+ * torn down — without this, the caller's `await waitForCode()` would never
142
+ * settle and the terminal would hang with no way out.
143
+ */
144
+ export declare function startLoopbackServer(state: string, signal?: AbortSignal): Promise<LoopbackServer>;
145
+ /** Parse a pasted authorization code or full redirect URL into { code, state }. */
146
+ export declare function parseAuthorizationInput(input: string): {
147
+ code?: string | undefined;
148
+ state?: string | undefined;
149
+ };
150
+ export interface CodexLoginOptions {
151
+ /** Storage provider id. Defaults to the canonical `openai-codex`. */
152
+ providerId?: string;
153
+ /**
154
+ * External cancellation signal (e.g. the TUI auth panel's Esc). When
155
+ * provided, the flow does NOT install its own SIGINT handler — the
156
+ * caller owns cancellation, and a raw `process.exit` from inside a
157
+ * mounted Ink tree would corrupt the terminal.
158
+ */
159
+ signal?: AbortSignal | undefined;
160
+ }
161
+ /**
162
+ * Run the "Sign in with ChatGPT" flow and persist the resulting OAuth tokens.
163
+ * Returns 0 on success, 1 on cancel/error.
164
+ */
165
+ export declare function runCodexOAuthLogin(deps: AuthMenuDeps, opts?: CodexLoginOptions): Promise<number>;
166
+ export {};
167
+ //# sourceMappingURL=openai-codex-oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai-codex-oauth.d.ts","sourceRoot":"","sources":["../../src/auth-menu/openai-codex-oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAKL,KAAK,cAAc,EAGpB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiB/C,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,gFAAgF;AAChF,eAAO,MAAM,cAAc,oCAAoC,CAAC;AAEhE;;;;;;;;;;GAUG;AAGH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAeD,MAAM,WA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,MAAM,CAAC,CA0IjB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * TUI auth-panel host — the structured, UI-agnostic surface behind the
3
+ * interactive `/auth` panel in the Ink TUI.
4
+ *
5
+ * Two kinds of operations:
6
+ *
7
+ * - **Direct mutations** (set active key, delete key, remove provider):
8
+ * plain async methods that mutate the config atomically and return an
9
+ * error string or `null`.
10
+ *
11
+ * - **Flows** (add key, add from catalog, add custom, add local, OAuth
12
+ * sign-in, field edits): the existing battle-tested readline flows from
13
+ * this package, driven through an {@link AuthFlowIo} bridge. The bridge
14
+ * adapts `renderer.write*` → panel log lines (ANSI-stripped) and
15
+ * `reader.readLine/readSecret` → the panel's modal prompt. A rejected
16
+ * prompt (TUI Esc) aborts the flow before anything is saved.
17
+ *
18
+ * Secrets never cross into the TUI: key values are masked here, and the
19
+ * modal prompt sends the plaintext only INTO the flow (never back out).
20
+ */
21
+ import type { ModelsRegistry, SecretScrubber, SecretVault } from '@wrongstack/core';
22
+ import type { AuthPanelHost } from '@wrongstack/tui';
23
+ export interface AuthPanelServiceDeps {
24
+ vault: SecretVault;
25
+ modelsRegistry: ModelsRegistry;
26
+ globalConfigPath: string;
27
+ secretScrubber?: SecretScrubber | undefined;
28
+ }
29
+ /** Plain (color-free) key mask: first 4 + last 4 characters. */
30
+ export declare function plainMaskedKey(key: string): string;
31
+ export declare function createAuthPanelHost(deps: AuthPanelServiceDeps): AuthPanelHost;
32
+ //# sourceMappingURL=panel-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel-service.d.ts","sourceRoot":"","sources":["../../src/auth-menu/panel-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAkB,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,KAAK,EAOV,aAAa,EAEd,MAAM,iBAAiB,CAAC;AAkBzB,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,WAAW,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C;AAqED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlD;AAID,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa,CA0S7E"}
@@ -0,0 +1,7 @@
1
+ import type { AuthMenuDeps } from './types.js';
2
+ /**
3
+ * Interactive submenu for managing a single provider's keys and settings.
4
+ * Loops until the user goes back or quits.
5
+ */
6
+ export declare function manageProvider(providerId: string, deps: AuthMenuDeps): Promise<void>;
7
+ //# sourceMappingURL=provider-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-menu.d.ts","sourceRoot":"","sources":["../../src/auth-menu/provider-menu.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B1F"}
@@ -0,0 +1,32 @@
1
+ import { type ProviderApiKey, type ProviderConfig, type WireFamily } from '@wrongstack/core';
2
+ import type { AuthMenuDeps } from './types.js';
3
+ /** Render a provider entry line in the top-level listing. */
4
+ export declare function renderProviderLine(renderer: AuthMenuDeps['renderer'], id: string, cfg: ProviderConfig, idx: number): void;
5
+ /** Render the header for the provider management submenu. */
6
+ export declare function renderProviderHeader(renderer: AuthMenuDeps['renderer'], providerId: string, cfg: ProviderConfig): void;
7
+ /** Render a single key entry line. */
8
+ export declare function renderKeyLine(renderer: AuthMenuDeps['renderer'], key: ProviderApiKey, idx: number, active: string | undefined): void;
9
+ /** Render action shortcuts. */
10
+ export declare function renderActions(renderer: AuthMenuDeps['renderer'], keysLength: number): void;
11
+ /** Render the top-level menu header. */
12
+ export declare function renderTopMenu(renderer: AuthMenuDeps['renderer'], providers: Record<string, ProviderConfig>): void;
13
+ /** Prompt for a hidden API key. Returns undefined on empty input. */
14
+ export declare function readKeyInput(deps: {
15
+ reader: AuthMenuDeps['reader'];
16
+ renderer: AuthMenuDeps['renderer'];
17
+ }, intent: string): Promise<string | undefined>;
18
+ /**
19
+ * Ask a yes/no confirmation. Returns:
20
+ * true → user confirmed (y/yes)
21
+ * false → user declined (n/no)
22
+ * null → user cancelled (q)
23
+ */
24
+ export declare function confirm(deps: {
25
+ reader: AuthMenuDeps['reader'];
26
+ renderer: AuthMenuDeps['renderer'];
27
+ }, question: string): Promise<boolean | null>;
28
+ /** Suggest a default label that doesn't conflict with existing keys. */
29
+ export declare function suggestLabel(usedLabels: Set<string>): string;
30
+ /** Validate a wire family string. Returns the WireFamily or null. */
31
+ export declare function validateFamily(raw: string): WireFamily | null;
32
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/auth-menu/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,EAClC,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,MAAM,GACV,IAAI,CAwBN;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,cAAc,GAClB,IAAI,CAgCN;AAED,sCAAsC;AACtC,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,EAClC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,IAAI,CAMN;AAED,+BAA+B;AAC/B,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAc1F;AAED,wCAAwC;AACxC,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACxC,IAAI,CAqCN;AAMD,qEAAqE;AACrE,wBAAsB,YAAY,CAChC,IAAI,EAAE;IAAE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;CAAE,EAC5E,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAW7B;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE;IAAE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;CAAE,EAC5E,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAQzB;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAM5D;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAG7D"}
@@ -0,0 +1,11 @@
1
+ import type { AuthMenuDeps } from './types.js';
2
+ /**
3
+ * Interactive auth manager. Shows saved providers + keys, lets the user
4
+ * add/manage providers, and loops until they exit.
5
+ *
6
+ * The legacy single-key `apiKey` field is migrated to `apiKeys[]` lazily
7
+ * on first edit, so users who set up under the old schema upgrade
8
+ * transparently the first time they open this menu.
9
+ */
10
+ export declare function runTopMenu(deps: AuthMenuDeps): Promise<number>;
11
+ //# sourceMappingURL=top-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-menu.d.ts","sourceRoot":"","sources":["../../src/auth-menu/top-menu.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAyDpE"}
@@ -0,0 +1,42 @@
1
+ import type { ModelsRegistry, SecretScrubber, SecretVault } from '@wrongstack/core';
2
+ /**
3
+ * Minimal output surface the auth-menu flows need. `TerminalRenderer`
4
+ * satisfies this structurally, and so does the TUI auth-panel adapter
5
+ * (which forwards each line into the panel's flow log) — keeping the
6
+ * flows reusable from both the readline CLI and the Ink TUI.
7
+ */
8
+ export interface AuthMenuRenderer {
9
+ write(input: string): void;
10
+ writeInfo(text: string): void;
11
+ writeWarning(text: string): void;
12
+ writeError(text: string): void;
13
+ }
14
+ /**
15
+ * Minimal input surface the auth-menu flows need. `ReadlineInputReader`
16
+ * satisfies this structurally; the TUI adapter resolves both from the
17
+ * panel's modal prompt (masked for `readSecret`). Implementations may
18
+ * REJECT to cancel the surrounding flow (the TUI does this on Esc) —
19
+ * every flow treats a thrown prompt as user-cancel.
20
+ */
21
+ export interface AuthMenuReader {
22
+ readLine(prompt?: string): Promise<string>;
23
+ readSecret(prompt: string): Promise<string>;
24
+ }
25
+ /**
26
+ * Dependencies shared across all auth-menu modules.
27
+ * Kept deliberately light — each sub-module takes only the subset it needs.
28
+ */
29
+ export interface AuthMenuDeps {
30
+ renderer: AuthMenuRenderer;
31
+ reader: AuthMenuReader;
32
+ modelsRegistry: ModelsRegistry;
33
+ vault: SecretVault;
34
+ globalConfigPath: string;
35
+ /**
36
+ * Optional scrubber used by `wstack auth local` to redact Bearer
37
+ * tokens from probe logs before they reach the renderer. Falls back
38
+ * to a fresh {@link DefaultSecretScrubber} when not supplied.
39
+ */
40
+ secretScrubber?: SecretScrubber | undefined;
41
+ }
42
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Backward-compatible re-export. All functionality has moved to
3
+ * `auth-menu/index.ts` and its submodules. This file exists so
4
+ * existing imports don't break during the transition.
5
+ */
6
+ export { type AuthMenuDeps, runAuthDirect, runAuthMenu } from './auth-menu/index.js';
7
+ //# sourceMappingURL=auth-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-menu.d.ts","sourceRoot":"","sources":["../src/auth-menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * AutoPhase host wiring for the CLI.
3
+ *
4
+ * Turns a free-text goal into a real, LLM-driven phase run:
5
+ * 1. PLAN — a one-shot subagent generates a phase-by-phase plan where each
6
+ * phase carries many concrete todos (AutoPhasePlanner).
7
+ * 2. BUILD — PhaseGraphBuilder materializes the plan into a PhaseGraph with a
8
+ * populated TaskGraph per phase, persisted as per-project JSON.
9
+ * 3. RUN — PhaseOrchestrator drives the graph in the background; every task
10
+ * is executed by a fresh subagent (full tool access). Phase/task
11
+ * events flow on the shared EventBus so the TUI PhaseMonitor stays
12
+ * live, and the graph is re-persisted as phases complete.
13
+ *
14
+ * This is "SDD logic but different": phased, persisted task-lists like SDD, but
15
+ * driven by the autonomous orchestrator + concurrent subagents rather than
16
+ * single-thread turn injection.
17
+ */
18
+ import { type BrainArbiter, type Config, type EventBus, type PhaseGraph, type PhaseProgress, type TaskNode } from '@wrongstack/core';
19
+ import type { MultiAgentHost } from './multi-agent.js';
20
+ /**
21
+ * Extend/trim the autonomous autophase command allowlist from the user's exec
22
+ * policy. Mirrors `configureExecPolicy` but keeps autophase's narrower base.
23
+ * Idempotent (always rebuilt from the base).
24
+ */
25
+ export declare function configureAutophasePolicy(opts?: {
26
+ allow?: readonly string[] | undefined;
27
+ deny?: readonly string[] | undefined;
28
+ }): void;
29
+ /** Reset the autophase allowlist to its built-in base (tests / re-init). */
30
+ export declare function resetAutophasePolicy(): void;
31
+ /** Whether `cmd` may run in autonomous autophase verification. */
32
+ export declare function isAutophaseCommandAllowed(cmd: string): boolean;
33
+ export interface AutoPhaseHostDeps {
34
+ multiAgentHost: MultiAgentHost;
35
+ /** Read the *current* Config lazily (it may be patched, e.g. YOLO toggles). */
36
+ getConfig: () => Config;
37
+ /** Shared app EventBus — orchestrator events feed the TUI PhaseMonitor. */
38
+ events: EventBus;
39
+ /** Current parent session id for worktree lifecycle events. */
40
+ getSessionId?: (() => string | undefined) | undefined;
41
+ /** Directory for per-project phase-graph JSON (wpaths.projectAutophase). */
42
+ storeDir: string;
43
+ /** Project root — base for git-worktree isolation. */
44
+ projectRoot: string;
45
+ /**
46
+ * Enable per-phase git-worktree isolation (default true). When on and the
47
+ * project is a git repo, parallelizable phases run in isolated worktrees and
48
+ * merge back sequentially. Disable with WRONGSTACK_AUTOPHASE_WORKTREES=0.
49
+ */
50
+ worktrees?: boolean | undefined;
51
+ /** Max parallel phases when worktrees are active (default 4). */
52
+ maxConcurrentPhases?: number | undefined;
53
+ /** Optional global Brain arbiter for AutoPhase policy decisions. */
54
+ brain?: BrainArbiter | undefined;
55
+ /** Optional progress logger (rendered to the user during start). */
56
+ log?: ((line: string) => void) | undefined;
57
+ }
58
+ /** A live, read-only view of the running AutoPhase, exposed to slash commands. */
59
+ export interface AutoPhaseRunnerView {
60
+ graph: PhaseGraph;
61
+ getProgress: () => PhaseProgress | null;
62
+ isRunning: () => boolean;
63
+ }
64
+ export type AutoPhaseStartResult = {
65
+ ok: true;
66
+ graph: PhaseGraph;
67
+ } | {
68
+ ok: false;
69
+ error: string;
70
+ };
71
+ export interface AutoPhaseHostHooks {
72
+ onAutoPhaseStart: (opts: {
73
+ goal: string;
74
+ projectContext?: string | undefined;
75
+ }) => Promise<AutoPhaseStartResult>;
76
+ onAutoPhasePause: () => void;
77
+ onAutoPhaseResume: () => void;
78
+ /**
79
+ * Resume a persisted PhaseGraph. The graph must already have been loaded
80
+ * from the PhaseStore. Creates a fresh orchestrator and starts executing
81
+ * pending tasks.
82
+ */
83
+ onAutoPhaseResumeFromGraph: (graph: PhaseGraph) => Promise<AutoPhaseStartResult>;
84
+ onAutoPhaseStop: () => void;
85
+ getAutoPhaseRunner: () => AutoPhaseRunnerView | null;
86
+ /** Interactive board: move a task to another phase. */
87
+ onAutoPhaseMoveTask: (taskId: string, toPhaseId: string) => boolean;
88
+ /** Interactive board: (re)assign a task to a specific agent (clear with both omitted). */
89
+ onAutoPhaseAssignTask: (taskId: string, agentId?: string, agentName?: string) => boolean;
90
+ /** Interactive board: add a new task to a phase. Returns the new task id. */
91
+ onAutoPhaseAddTask: (phaseId: string, spec: {
92
+ title: string;
93
+ description?: string;
94
+ type?: TaskNode['type'];
95
+ priority?: TaskNode['priority'];
96
+ }) => string | null;
97
+ /** Interactive board: requeue a task to pending so it (re)runs. */
98
+ onAutoPhaseRetryTask: (taskId: string) => boolean;
99
+ /** Backs the /worktree slash command (list / merge / prune / clean). */
100
+ onWorktree: (action: 'list' | 'merge' | 'prune' | 'clean', target?: string) => Promise<string>;
101
+ }
102
+ export declare function createAutoPhaseHost(deps: AutoPhaseHostDeps): AutoPhaseHostHooks;
103
+ //# sourceMappingURL=autophase-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autophase-host.d.ts","sourceRoot":"","sources":["../src/autophase-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,OAAO,EAGL,KAAK,YAAY,EAEjB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,UAAU,EAGf,KAAK,aAAa,EAElB,KAAK,QAAQ,EAEd,MAAM,kBAAkB,CAAC;AAY1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAmEvD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;CAAO,GACzF,IAAI,CAQN;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,kEAAkE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AC;IACpC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B;;;;OAIG;IACH,0BAA0B,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjF,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,kBAAkB,EAAE,MAAM,mBAAmB,GAAG,IAAI,CAAC;IACrD,uDAAuD;IACvD,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IACpE,0FAA0F;IAC1F,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACzF,6EAA6E;IAC7E,kBAAkB,EAAE,CAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;KACjC,KACE,MAAM,GAAG,IAAI,CAAC;IACnB,mEAAmE;IACnE,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAClD,wEAAwE;IACxE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAChG;AAgBD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,CAmkB/E"}
@@ -0,0 +1,20 @@
1
+ import type { Config, Logger } from '@wrongstack/core';
2
+ import type { DefaultModelsRegistry } from '@wrongstack/core';
3
+ /**
4
+ * Fetch model lists for every auto-discovery provider in the config and merge
5
+ * them into the catalog. Best-effort end to end: a down server or missing key
6
+ * falls back to the last cached list (any age — a local proxy being offline at
7
+ * boot shouldn't wipe its models), and any failure is a logged no-op so boot
8
+ * never breaks.
9
+ *
10
+ * Caches the most recent successful fetch per provider+baseUrl so the models
11
+ * survive a restart while the server is briefly unavailable.
12
+ */
13
+ export declare function discoverAndMergeProviders(opts: {
14
+ config: Config;
15
+ registry: DefaultModelsRegistry;
16
+ cacheDir: string;
17
+ logger?: Logger | undefined;
18
+ fetchImpl?: typeof fetch | undefined;
19
+ }): Promise<void>;
20
+ //# sourceMappingURL=auto-discover-providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-discover-providers.d.ts","sourceRoot":"","sources":["../../src/boot/auto-discover-providers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAqC,MAAM,kBAAkB,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAiD9D;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,qBAAqB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAC;CACtC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDhB"}