@namzu/cli 26.2.0 → 27.0.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 (342) hide show
  1. package/CHANGELOG.md +312 -0
  2. package/README.md +49 -34
  3. package/dist/bin.js +7 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/checkpoints/store.d.ts +17 -4
  6. package/dist/checkpoints/store.d.ts.map +1 -1
  7. package/dist/checkpoints/store.js +20 -5
  8. package/dist/checkpoints/store.js.map +1 -1
  9. package/dist/cli.js +2 -2
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/acp.d.ts +23 -1
  12. package/dist/commands/acp.d.ts.map +1 -1
  13. package/dist/commands/acp.js +41 -2
  14. package/dist/commands/acp.js.map +1 -1
  15. package/dist/commands/drain.d.ts +69 -2
  16. package/dist/commands/drain.d.ts.map +1 -1
  17. package/dist/commands/drain.js +214 -134
  18. package/dist/commands/drain.js.map +1 -1
  19. package/dist/commands/eval.js +1 -1
  20. package/dist/commands/eval.js.map +1 -1
  21. package/dist/commands/provider-wait.d.ts +5 -5
  22. package/dist/commands/provider-wait.d.ts.map +1 -1
  23. package/dist/commands/provider-wait.js +2 -2
  24. package/dist/commands/resident.d.ts.map +1 -1
  25. package/dist/commands/resident.js +2 -1
  26. package/dist/commands/resident.js.map +1 -1
  27. package/dist/commands/run-flags.d.ts +7 -7
  28. package/dist/commands/run-flags.js +4 -4
  29. package/dist/commands/run-stream.d.ts +16 -12
  30. package/dist/commands/run-stream.d.ts.map +1 -1
  31. package/dist/commands/run-stream.js +142 -98
  32. package/dist/commands/run-stream.js.map +1 -1
  33. package/dist/commands/run.d.ts +6 -4
  34. package/dist/commands/run.d.ts.map +1 -1
  35. package/dist/commands/run.js +129 -45
  36. package/dist/commands/run.js.map +1 -1
  37. package/dist/commands/serve.js +2 -2
  38. package/dist/commands/serve.js.map +1 -1
  39. package/dist/commands/state.js +8 -8
  40. package/dist/commands/state.js.map +1 -1
  41. package/dist/config/load.d.ts +1 -1
  42. package/dist/config/load.d.ts.map +1 -1
  43. package/dist/config/load.js +17 -5
  44. package/dist/config/load.js.map +1 -1
  45. package/dist/config/run-limits.d.ts +20 -8
  46. package/dist/config/run-limits.d.ts.map +1 -1
  47. package/dist/config/run-limits.js +28 -46
  48. package/dist/config/run-limits.js.map +1 -1
  49. package/dist/config/schema.d.ts +44 -19
  50. package/dist/config/schema.d.ts.map +1 -1
  51. package/dist/config/schema.js.map +1 -1
  52. package/dist/config/tool-result-screens.js +1 -1
  53. package/dist/context/directories.d.ts +37 -0
  54. package/dist/context/directories.d.ts.map +1 -0
  55. package/dist/context/directories.js +69 -0
  56. package/dist/context/directories.js.map +1 -0
  57. package/dist/context/environment.d.ts +55 -0
  58. package/dist/context/environment.d.ts.map +1 -1
  59. package/dist/context/environment.js +96 -0
  60. package/dist/context/environment.js.map +1 -1
  61. package/dist/context/project-tracker.d.ts +3 -3
  62. package/dist/context/project-tracker.d.ts.map +1 -1
  63. package/dist/context/project-tracker.js +3 -3
  64. package/dist/context/project-tracker.js.map +1 -1
  65. package/dist/context/project.d.ts +1 -1
  66. package/dist/context/project.js +1 -1
  67. package/dist/context/sandbox.d.ts +22 -3
  68. package/dist/context/sandbox.d.ts.map +1 -1
  69. package/dist/context/sandbox.js +42 -4
  70. package/dist/context/sandbox.js.map +1 -1
  71. package/dist/doctor/checks/chain.d.ts +1 -1
  72. package/dist/doctor/checks/chain.js +5 -5
  73. package/dist/doctor/checks/chain.js.map +1 -1
  74. package/dist/doctor/checks/invariants.d.ts +2 -2
  75. package/dist/doctor/checks/invariants.js +5 -5
  76. package/dist/doctor/checks/invariants.js.map +1 -1
  77. package/dist/doctor/checks/logging.js +1 -1
  78. package/dist/doctor/checks/logging.js.map +1 -1
  79. package/dist/doctor/checks/sandbox.js +1 -1
  80. package/dist/doctor/checks/sandbox.js.map +1 -1
  81. package/dist/doctor/checks/session-export.d.ts +1 -1
  82. package/dist/doctor/checks/session-export.js +2 -2
  83. package/dist/doctor/checks/session-export.js.map +1 -1
  84. package/dist/doctor/checks/telemetry.d.ts +1 -1
  85. package/dist/doctor/checks/telemetry.js +1 -1
  86. package/dist/doctor/registry.js +2 -2
  87. package/dist/doctor/registry.js.map +1 -1
  88. package/dist/exit-codes.d.ts +2 -2
  89. package/dist/exit-codes.js +2 -2
  90. package/dist/integrations/mcp/servers.d.ts +1 -1
  91. package/dist/integrations/providers/chain-capabilities.d.ts +6 -6
  92. package/dist/integrations/providers/chain-capabilities.js +8 -8
  93. package/dist/integrations/providers/chain-capabilities.js.map +1 -1
  94. package/dist/integrations/providers/index.d.ts +1 -1
  95. package/dist/integrations/providers/index.d.ts.map +1 -1
  96. package/dist/integrations/providers/index.js +1 -1
  97. package/dist/integrations/providers/index.js.map +1 -1
  98. package/dist/integrations/providers/register.d.ts +1 -1
  99. package/dist/integrations/providers/register.js +1 -1
  100. package/dist/integrations/providers/registry.d.ts +74 -1
  101. package/dist/integrations/providers/registry.d.ts.map +1 -1
  102. package/dist/integrations/providers/registry.js +75 -0
  103. package/dist/integrations/providers/registry.js.map +1 -1
  104. package/dist/integrations/resident/inspection.d.ts +4 -1
  105. package/dist/integrations/resident/inspection.d.ts.map +1 -1
  106. package/dist/integrations/resident/inspection.js +53 -34
  107. package/dist/integrations/resident/inspection.js.map +1 -1
  108. package/dist/integrations/resident/learning-storage.d.ts +7 -2
  109. package/dist/integrations/resident/learning-storage.d.ts.map +1 -1
  110. package/dist/integrations/resident/learning-storage.js +12 -8
  111. package/dist/integrations/resident/learning-storage.js.map +1 -1
  112. package/dist/integrations/resident/runner-store.d.ts +1 -1
  113. package/dist/integrations/resident/runner-store.d.ts.map +1 -1
  114. package/dist/integrations/resident/runner-store.js +5 -2
  115. package/dist/integrations/resident/runner-store.js.map +1 -1
  116. package/dist/integrations/resident/runner-worker.js +1 -0
  117. package/dist/integrations/resident/runner-worker.js.map +1 -1
  118. package/dist/integrations/resident/session-log-reads.d.ts +37 -0
  119. package/dist/integrations/resident/session-log-reads.d.ts.map +1 -0
  120. package/dist/integrations/resident/session-log-reads.js +125 -0
  121. package/dist/integrations/resident/session-log-reads.js.map +1 -0
  122. package/dist/integrations/resident/session-step.d.ts +2 -0
  123. package/dist/integrations/resident/session-step.d.ts.map +1 -1
  124. package/dist/integrations/resident/session-step.js +15 -13
  125. package/dist/integrations/resident/session-step.js.map +1 -1
  126. package/dist/integrations/resident/storage.d.ts +23 -1
  127. package/dist/integrations/resident/storage.d.ts.map +1 -1
  128. package/dist/integrations/resident/storage.js +60 -17
  129. package/dist/integrations/resident/storage.js.map +1 -1
  130. package/dist/integrations/resident/tool-evidence.d.ts +4 -2
  131. package/dist/integrations/resident/tool-evidence.d.ts.map +1 -1
  132. package/dist/integrations/resident/tool-evidence.js +36 -30
  133. package/dist/integrations/resident/tool-evidence.js.map +1 -1
  134. package/dist/integrations/resident/verification.d.ts +2 -2
  135. package/dist/integrations/resident/verification.d.ts.map +1 -1
  136. package/dist/integrations/resident/verification.js +4 -4
  137. package/dist/integrations/resident/verification.js.map +1 -1
  138. package/dist/integrations/sessions/checkpoint-view.d.ts +13 -0
  139. package/dist/integrations/sessions/checkpoint-view.d.ts.map +1 -0
  140. package/dist/integrations/sessions/checkpoint-view.js +48 -0
  141. package/dist/integrations/sessions/checkpoint-view.js.map +1 -0
  142. package/dist/integrations/sessions/context-inventory.js +1 -1
  143. package/dist/integrations/sessions/context-inventory.js.map +1 -1
  144. package/dist/integrations/sessions/conversation-search.d.ts +16 -20
  145. package/dist/integrations/sessions/conversation-search.d.ts.map +1 -1
  146. package/dist/integrations/sessions/conversation-search.js +305 -731
  147. package/dist/integrations/sessions/conversation-search.js.map +1 -1
  148. package/dist/integrations/sessions/evidence-page-validation.d.ts +4 -4
  149. package/dist/integrations/sessions/evidence-page-validation.d.ts.map +1 -1
  150. package/dist/integrations/sessions/evidence-page-validation.js +1 -1
  151. package/dist/integrations/sessions/evidence-page-validation.js.map +1 -1
  152. package/dist/integrations/sessions/evidence-recall.d.ts +40 -2
  153. package/dist/integrations/sessions/evidence-recall.d.ts.map +1 -1
  154. package/dist/integrations/sessions/evidence-recall.js +41 -97
  155. package/dist/integrations/sessions/evidence-recall.js.map +1 -1
  156. package/dist/integrations/sessions/store.d.ts +153 -85
  157. package/dist/integrations/sessions/store.d.ts.map +1 -1
  158. package/dist/integrations/sessions/store.js +414 -484
  159. package/dist/integrations/sessions/store.js.map +1 -1
  160. package/dist/integrations/sessions/task-context.d.ts +15 -2
  161. package/dist/integrations/sessions/task-context.d.ts.map +1 -1
  162. package/dist/integrations/sessions/task-context.js +34 -11
  163. package/dist/integrations/sessions/task-context.js.map +1 -1
  164. package/dist/integrations/sessions/transcript-export.d.ts +13 -6
  165. package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
  166. package/dist/integrations/sessions/transcript-export.js +148 -263
  167. package/dist/integrations/sessions/transcript-export.js.map +1 -1
  168. package/dist/integrations/state/home.d.ts +4 -16
  169. package/dist/integrations/state/home.d.ts.map +1 -1
  170. package/dist/integrations/state/home.js +6 -42
  171. package/dist/integrations/state/home.js.map +1 -1
  172. package/dist/integrations/state/project.d.ts +6 -7
  173. package/dist/integrations/state/project.d.ts.map +1 -1
  174. package/dist/integrations/state/project.js +7 -9
  175. package/dist/integrations/state/project.js.map +1 -1
  176. package/dist/integrations/state/report.d.ts +27 -41
  177. package/dist/integrations/state/report.d.ts.map +1 -1
  178. package/dist/integrations/state/report.js +172 -464
  179. package/dist/integrations/state/report.js.map +1 -1
  180. package/dist/integrations/state/retention.d.ts +18 -0
  181. package/dist/integrations/state/retention.d.ts.map +1 -0
  182. package/dist/integrations/state/retention.js +18 -0
  183. package/dist/integrations/state/retention.js.map +1 -0
  184. package/dist/integrations/subagents/activity.d.ts +36 -31
  185. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  186. package/dist/integrations/subagents/activity.js +27 -23
  187. package/dist/integrations/subagents/activity.js.map +1 -1
  188. package/dist/integrations/subagents/batches.d.ts +91 -0
  189. package/dist/integrations/subagents/batches.d.ts.map +1 -0
  190. package/dist/integrations/subagents/batches.js +172 -0
  191. package/dist/integrations/subagents/batches.js.map +1 -0
  192. package/dist/integrations/subagents/parent.d.ts +26 -11
  193. package/dist/integrations/subagents/parent.d.ts.map +1 -1
  194. package/dist/integrations/subagents/parent.js +13 -28
  195. package/dist/integrations/subagents/parent.js.map +1 -1
  196. package/dist/integrations/subagents/policy.d.ts +2 -2
  197. package/dist/integrations/subagents/policy.d.ts.map +1 -1
  198. package/dist/integrations/subagents/policy.js +2 -2
  199. package/dist/integrations/subagents/policy.js.map +1 -1
  200. package/dist/integrations/subagents/replay.d.ts +91 -26
  201. package/dist/integrations/subagents/replay.d.ts.map +1 -1
  202. package/dist/integrations/subagents/replay.js +216 -114
  203. package/dist/integrations/subagents/replay.js.map +1 -1
  204. package/dist/integrations/subagents/runtime.d.ts +50 -26
  205. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  206. package/dist/integrations/subagents/runtime.js +132 -126
  207. package/dist/integrations/subagents/runtime.js.map +1 -1
  208. package/dist/integrations/subagents/saved-agents.d.ts +57 -0
  209. package/dist/integrations/subagents/saved-agents.d.ts.map +1 -0
  210. package/dist/integrations/subagents/saved-agents.js +102 -0
  211. package/dist/integrations/subagents/saved-agents.js.map +1 -0
  212. package/dist/integrations/subagents/slash.d.ts +55 -0
  213. package/dist/integrations/subagents/slash.d.ts.map +1 -0
  214. package/dist/integrations/subagents/slash.js +45 -0
  215. package/dist/integrations/subagents/slash.js.map +1 -0
  216. package/dist/integrations/telemetry/session-export.d.ts +6 -6
  217. package/dist/integrations/telemetry/session-export.d.ts.map +1 -1
  218. package/dist/integrations/telemetry/session-export.js +2 -2
  219. package/dist/memory/presentation.d.ts +11 -0
  220. package/dist/memory/presentation.d.ts.map +1 -1
  221. package/dist/memory/presentation.js +25 -0
  222. package/dist/memory/presentation.js.map +1 -1
  223. package/dist/memory/store.d.ts +13 -7
  224. package/dist/memory/store.d.ts.map +1 -1
  225. package/dist/memory/store.js +37 -11
  226. package/dist/memory/store.js.map +1 -1
  227. package/dist/memory/typed.d.ts +116 -0
  228. package/dist/memory/typed.d.ts.map +1 -0
  229. package/dist/memory/typed.js +336 -0
  230. package/dist/memory/typed.js.map +1 -0
  231. package/dist/permissions/checks.d.ts +1 -1
  232. package/dist/permissions/checks.js +1 -1
  233. package/dist/permissions/headless-trust.d.ts +2 -2
  234. package/dist/permissions/headless-trust.d.ts.map +1 -1
  235. package/dist/permissions/headless-trust.js +3 -3
  236. package/dist/permissions/headless-trust.js.map +1 -1
  237. package/dist/permissions/mode.d.ts +4 -4
  238. package/dist/permissions/mode.js +1 -1
  239. package/dist/permissions/rules.d.ts +1 -1
  240. package/dist/permissions/rules.js +1 -1
  241. package/dist/termination.d.ts +75 -0
  242. package/dist/termination.d.ts.map +1 -0
  243. package/dist/termination.js +143 -0
  244. package/dist/termination.js.map +1 -0
  245. package/dist/tui/AgentExplorer.d.ts +2 -2
  246. package/dist/tui/AgentExplorer.js +4 -4
  247. package/dist/tui/AgentExplorer.js.map +1 -1
  248. package/dist/tui/App.d.ts +9 -1
  249. package/dist/tui/App.d.ts.map +1 -1
  250. package/dist/tui/App.js +458 -304
  251. package/dist/tui/App.js.map +1 -1
  252. package/dist/tui/LiveActivity.d.ts +1 -1
  253. package/dist/tui/LiveActivity.d.ts.map +1 -1
  254. package/dist/tui/PermissionOverlay.d.ts +8 -0
  255. package/dist/tui/PermissionOverlay.d.ts.map +1 -1
  256. package/dist/tui/PermissionOverlay.js +25 -2
  257. package/dist/tui/PermissionOverlay.js.map +1 -1
  258. package/dist/tui/Picker.d.ts +14 -1
  259. package/dist/tui/Picker.d.ts.map +1 -1
  260. package/dist/tui/Picker.js +598 -132
  261. package/dist/tui/Picker.js.map +1 -1
  262. package/dist/tui/agent.d.ts +208 -132
  263. package/dist/tui/agent.d.ts.map +1 -1
  264. package/dist/tui/agent.js +523 -313
  265. package/dist/tui/agent.js.map +1 -1
  266. package/dist/tui/conversation-evidence-view.js +3 -3
  267. package/dist/tui/conversation-evidence-view.js.map +1 -1
  268. package/dist/tui/conversation-history.d.ts +4 -21
  269. package/dist/tui/conversation-history.d.ts.map +1 -1
  270. package/dist/tui/conversation-history.js +4 -28
  271. package/dist/tui/conversation-history.js.map +1 -1
  272. package/dist/tui/index.d.ts.map +1 -1
  273. package/dist/tui/index.js +27 -1
  274. package/dist/tui/index.js.map +1 -1
  275. package/dist/tui/log-pane.js +1 -1
  276. package/dist/tui/markdownParser.d.ts +1 -1
  277. package/dist/tui/markdownParser.js +1 -1
  278. package/dist/tui/model-choices.d.ts.map +1 -1
  279. package/dist/tui/model-choices.js +20 -1
  280. package/dist/tui/model-choices.js.map +1 -1
  281. package/dist/tui/permission-review.d.ts +16 -0
  282. package/dist/tui/permission-review.d.ts.map +1 -1
  283. package/dist/tui/permission-review.js +25 -2
  284. package/dist/tui/permission-review.js.map +1 -1
  285. package/dist/tui/provider-list.d.ts +206 -41
  286. package/dist/tui/provider-list.d.ts.map +1 -1
  287. package/dist/tui/provider-list.js +248 -52
  288. package/dist/tui/provider-list.js.map +1 -1
  289. package/dist/tui/slashCommands.d.ts +29 -40
  290. package/dist/tui/slashCommands.d.ts.map +1 -1
  291. package/dist/tui/slashCommands.js +70 -61
  292. package/dist/tui/slashCommands.js.map +1 -1
  293. package/dist/tui/terminal-choice-text.d.ts +22 -0
  294. package/dist/tui/terminal-choice-text.d.ts.map +1 -1
  295. package/dist/tui/terminal-choice-text.js +81 -0
  296. package/dist/tui/terminal-choice-text.js.map +1 -1
  297. package/dist/tui/{run-interruption.d.ts → turn-interruption.d.ts} +4 -4
  298. package/dist/tui/turn-interruption.d.ts.map +1 -0
  299. package/dist/tui/{run-interruption.js → turn-interruption.js} +20 -20
  300. package/dist/tui/turn-interruption.js.map +1 -0
  301. package/dist/tui/turn-limits-settings.d.ts +39 -0
  302. package/dist/tui/turn-limits-settings.d.ts.map +1 -0
  303. package/dist/tui/{run-limits-settings.js → turn-limits-settings.js} +18 -18
  304. package/dist/tui/turn-limits-settings.js.map +1 -0
  305. package/dist/tui/types.d.ts +3 -3
  306. package/dist/tui/types.d.ts.map +1 -1
  307. package/dist/user-commands/store.d.ts +1 -1
  308. package/dist/user-commands/store.js +1 -1
  309. package/package.json +8 -8
  310. package/dist/integrations/sessions/compaction-evidence.d.ts +0 -5
  311. package/dist/integrations/sessions/compaction-evidence.d.ts.map +0 -1
  312. package/dist/integrations/sessions/compaction-evidence.js +0 -59
  313. package/dist/integrations/sessions/compaction-evidence.js.map +0 -1
  314. package/dist/integrations/sessions/database.d.ts +0 -5
  315. package/dist/integrations/sessions/database.d.ts.map +0 -1
  316. package/dist/integrations/sessions/database.js +0 -34
  317. package/dist/integrations/sessions/database.js.map +0 -1
  318. package/dist/integrations/sessions/paths.d.ts +0 -7
  319. package/dist/integrations/sessions/paths.d.ts.map +0 -1
  320. package/dist/integrations/sessions/paths.js +0 -14
  321. package/dist/integrations/sessions/paths.js.map +0 -1
  322. package/dist/integrations/sessions/run-discovery.d.ts +0 -24
  323. package/dist/integrations/sessions/run-discovery.d.ts.map +0 -1
  324. package/dist/integrations/sessions/run-discovery.js +0 -142
  325. package/dist/integrations/sessions/run-discovery.js.map +0 -1
  326. package/dist/integrations/sessions/turn-evidence.d.ts +0 -129
  327. package/dist/integrations/sessions/turn-evidence.d.ts.map +0 -1
  328. package/dist/integrations/sessions/turn-evidence.js +0 -517
  329. package/dist/integrations/sessions/turn-evidence.js.map +0 -1
  330. package/dist/integrations/subagents/history.d.ts +0 -26
  331. package/dist/integrations/subagents/history.d.ts.map +0 -1
  332. package/dist/integrations/subagents/history.js +0 -76
  333. package/dist/integrations/subagents/history.js.map +0 -1
  334. package/dist/integrations/subagents/runs.d.ts +0 -72
  335. package/dist/integrations/subagents/runs.d.ts.map +0 -1
  336. package/dist/integrations/subagents/runs.js +0 -155
  337. package/dist/integrations/subagents/runs.js.map +0 -1
  338. package/dist/tui/run-interruption.d.ts.map +0 -1
  339. package/dist/tui/run-interruption.js.map +0 -1
  340. package/dist/tui/run-limits-settings.d.ts +0 -39
  341. package/dist/tui/run-limits-settings.d.ts.map +0 -1
  342. package/dist/tui/run-limits-settings.js.map +0 -1
@@ -1,19 +1,47 @@
1
1
  /**
2
- * The rows the provider picker lists: what this machine already has, then what
3
- * it could have if the operator supplied a credential.
2
+ * The rows the provider picker lists: one per vendor, each saying what this
3
+ * machine can currently do with it.
4
4
  *
5
- * The second half is the point. The picker used to list only what discovery
6
- * found, so the one provider an operator had SAVED and held a key for — but had
7
- * not yet exported as an environment variable — appeared nowhere on a screen
8
- * that exists to choose a provider. There was no row to select and therefore no
9
- * way to type its key: a list that showed four providers had no fifth row for
10
- * the fifth one, and the screen's other exit (a sign-in) is a different kind of
11
- * credential entirely.
5
+ * ## One vendor is one row
6
+ *
7
+ * The screen used to draw a row per provider id, so one vendor could be two
8
+ * rows: the session on the device under the subscription's own label, and below
9
+ * it the same vendor's name asking for the key it did not need. The operator
10
+ * holding the key had to work out which of the two rows was theirs.
11
+ *
12
+ * Rows are grouped by `ProviderRegistryEntry.vendor` — a field on the registry
13
+ * rather than a table here, because which ids are one vendor is a fact about
14
+ * the providers and the picker is only the first surface to need it; see
15
+ * `VENDOR_NAMES` for that field and for which ids are one vendor. A vendor
16
+ * whose ids reach the same service through different credentials is one row,
17
+ * which is the shape one entry in this registry has had all along: a single id
18
+ * taking an API key, a token variable, or a signed-in session. A vendor with
19
+ * two catalogues keeps two rows, because merging those would put a product
20
+ * decision inside a screen about credentials.
21
+ *
22
+ * ## What a row says, and what it holds
23
+ *
24
+ * The second column is what the machine has, not what the ideal setup is: the
25
+ * source of a session discovery found (`Codex session · this device`), or — when
26
+ * nothing was found for that vendor — the variable that would set it up
27
+ * (`needs OPENAI_API_KEY`). The variable is named rather than "not configured"
28
+ * because it is the one action that both makes the provider work now and keeps
29
+ * it working after a restart.
30
+ *
31
+ * Every way in that this build can offer is below in `paths`, in the order the
32
+ * screen offers them: what is already detected, then the API key, then — where
33
+ * nothing works yet — a sign-in the registry declares. A row with ONE way in
34
+ * leads straight to that way's flow, exactly as it did before this file grouped
35
+ * anything — Enter on an unconfigured row opens its paste field, Enter on a
36
+ * detected one opens its models. A row with SEVERAL cannot answer Enter by
37
+ * itself, so the screen asks how the operator means to use it; that is the only
38
+ * place this change added a step to, and it is a count of WAYS rather than of
39
+ * ids — see `rowNeedsChoice` and `vendorPaths`.
12
40
  *
13
41
  * ## What is added, and what is deliberately not
14
42
  *
15
- * A provider joins the list only when **this build can construct it** and it
16
- * **takes a credential the operator can type** — the registry's
43
+ * A vendor joins the list only when **this build can construct something in it**
44
+ * and it **takes a credential the operator can type** — the registry's
17
45
  * `constructible` and `acceptsTypedCredential` flags, read together and read
18
46
  * from the registry rather than listed here. Entering a key for anything else
19
47
  * produces a row that leads nowhere, which is worse than an absent row:
@@ -22,58 +50,189 @@
22
50
  * region, a session token, or a role the SDK assumes) rather than one
23
51
  * string. A single API-key field cannot express it, so the picker does not
24
52
  * offer it.
25
- * - `http` is a generic endpoint whose base URL is half the
26
- * credential. A key with nowhere to send it is not a setup.
27
- * - `lmstudio` cannot be constructed by this build at all.
28
- * - `ollama` needs a local server, not a secret.
29
- * - `codex` needs a device-code sign-in, which this screen already offers
30
- * with `l` and names on the sign-in screen. It is skipped here so that one
31
- * provider is not offered two different ways to be set up.
53
+ * - `http` is a generic endpoint whose base URL is half the credential. A key
54
+ * with nowhere to send it is not a setup.
55
+ * - `lmstudio` cannot be constructed by this build at all. Discovery may still
56
+ * find it, and a row for something genuinely on the machine stays on the
57
+ * machine's list — it just refuses, with the reason, when accepted.
58
+ * - `ollama` needs a local server, not a secret. A running server is how
59
+ * discovery finds it, and that is the only way it is listed.
60
+ *
61
+ * The sign-in inside a vendor row is not a second way to set that vendor up
62
+ * beside the first; it is the same path `l` reaches today, offered where the
63
+ * operator is already looking. Nothing here starts a credential flow of its
64
+ * own: a path names a provider the rest of the screen already knows how to
65
+ * handle.
32
66
  *
33
67
  * `provider-list.test.ts` asserts that exclusion list by NAME, so a registry
34
68
  * flag that flips turns the test red instead of silently adding or dropping a
35
69
  * row.
36
70
  */
37
- import { type DetectedProvider, type ProviderId, type ProviderRegistryEntry } from '../integrations/providers/index.js';
71
+ import { type DetectedProvider, type ProviderId, type ProviderRegistryEntry, type VendorId } from '../integrations/providers/index.js';
38
72
  /**
39
- * One row of the picker.
73
+ * One way this build can be set up to use a vendor.
40
74
  *
41
- * The two arms are rendered differently and behave differently on Enter, which
42
- * is why this is a union rather than a `DetectedProvider` with an optional key:
43
- * the second arm has no `source`, no `apiKey` and no alternatives, and a type
44
- * that pretended otherwise would let a caller ask a provider with no credential
45
- * what models it has.
75
+ * A union rather than a `ProviderRegistryEntry` with flags, because the three
76
+ * lead to three different places and carry three different things: a detected
77
+ * source leads to a model listing that only exists because a credential was
78
+ * found, a credential leads to the field that takes one, and a sign-in leads to
79
+ * an operation that is not a value at all. A type that flattened them would let
80
+ * a caller ask a path that has no credential what models it has.
46
81
  */
47
- export type ProviderListRow = {
82
+ export type VendorPath =
83
+ /** Something on this machine already works. */
84
+ {
48
85
  readonly kind: 'detected';
49
86
  readonly detected: DetectedProvider;
50
- } | {
51
- readonly kind: 'unconfigured';
87
+ }
88
+ /** A provider whose credential the operator can type into the paste field. */
89
+ | {
90
+ readonly kind: 'credential';
91
+ readonly entry: ProviderRegistryEntry;
92
+ }
93
+ /** A Namzu-owned sign-in — the operation `l` starts today. */
94
+ | {
95
+ readonly kind: 'sign-in';
52
96
  readonly entry: ProviderRegistryEntry;
53
97
  };
54
- /** The provider a row is about, whichever kind of row it is. */
55
- export declare function rowProviderId(row: ProviderListRow): ProviderId;
98
+ /** The provider a path is about, whichever kind of path it is. */
99
+ export declare function pathProviderId(path: VendorPath): ProviderId;
100
+ /**
101
+ * One row of the picker: a vendor, what this machine has for it, and every way
102
+ * in this build can offer.
103
+ *
104
+ * `detected` is kept beside `paths` rather than folded into it because the two
105
+ * answer different questions. `paths` is what the row can DO — and a detected
106
+ * provider this build cannot construct is therefore not a path, since following
107
+ * it only reaches a refusal — while `detected` is what the machine HAS, which
108
+ * is what the row's second column reports and what the refusal names. A row
109
+ * that dropped the second would hide a discovery that genuinely happened.
110
+ */
111
+ export interface VendorRow {
112
+ readonly vendor: VendorId;
113
+ /** What the row is called, from the registry's one name for that vendor. */
114
+ readonly label: string;
115
+ /** What this machine has for the vendor, in discovery order. */
116
+ readonly detected: readonly DetectedProvider[];
117
+ /** The ways in, in the order the screen offers them. */
118
+ readonly paths: readonly VendorPath[];
119
+ }
56
120
  /**
57
121
  * Providers this screen can set up by taking a credential from the operator.
58
122
  *
59
- * Derived from the registry, in registry order. Four of the twelve entries have
123
+ * Derived from the registry, in registry order. Five of the twelve entries have
60
124
  * a driver in this repository and are not listed here, for the reasons in the
61
- * module comment.
125
+ * module comment. `codex` is not among them either, and for a different reason:
126
+ * it takes no typed credential at all, and it is offered instead as the
127
+ * sign-in path of the vendor row it shares with the key entry beside it.
62
128
  */
63
129
  export declare function settableProviders(): readonly ProviderRegistryEntry[];
130
+ /**
131
+ * Every way one vendor can be used, in the order the screen offers them:
132
+ * what is already detected, then the API key, then — where nothing works yet —
133
+ * a sign-in the registry declares.
134
+ *
135
+ * `entries` is passed rather than looked up so this can be read by a test
136
+ * against a vendor no registry holds — the shape of the answer is a fact about
137
+ * the flags, and the alternative is a rule only checkable by editing the
138
+ * registry.
139
+ *
140
+ * ## What counts as a second way in
141
+ *
142
+ * Not a second id — a second WAY. One entry can take an API key AND be found as
143
+ * a signed-in session, and a machine in that state has two genuinely different
144
+ * ways to use it: keep using the session discovery found, or enter a key of
145
+ * one's own. The same is true of a vendor whose free catalogue works without a
146
+ * credential. So the key path is offered beside what was found whenever what was
147
+ * found is not itself a key — a signed-in session is a different way in, and a
148
+ * key that discovery already hands over is the same way twice.
149
+ *
150
+ * "Is what was found a key?" is asked with the predicate the sign-in screen
151
+ * already decides it by (`signedInSubscriptionProviders`), rather than a second
152
+ * opinion written here: an OAuth token in an environment variable is a session
153
+ * on that screen and must be one here too, or the two screens would disagree
154
+ * about the same machine.
155
+ *
156
+ * ## Why a sign-in is offered only where nothing works yet
157
+ *
158
+ * A sign-in is how a vendor with nothing becomes usable. A vendor that is
159
+ * already usable has no such gap, and the operator who wants a SECOND way in —
160
+ * a Namzu-owned session beside the key they exported — is asking for something
161
+ * else: `l` starts one from any screen, and the footer says so. Offering it
162
+ * here as well would put a question in front of every operator whose key works
163
+ * and stop them answering it, once per launch, to serve a case that has another
164
+ * door. The vendor with a signed-in session and no key still shows both, which
165
+ * is the case this row was reported for.
166
+ *
167
+ * `includeUnconfigured` is false on the signed-in-subscription screen, which
168
+ * offers only sessions that are already usable; an API key path there would
169
+ * contradict that screen's one sentence.
170
+ */
171
+ export declare function vendorPaths(entries: readonly ProviderRegistryEntry[], detected: readonly DetectedProvider[], includeUnconfigured: boolean): readonly VendorPath[];
64
172
  /**
65
173
  * The full list, detected first and in the order discovery produced.
66
174
  *
67
- * Detected rows are passed through untouched: same order, same source text,
68
- * same numbering. Appending is what keeps that promise — anything that sorted,
69
- * merged or grouped the two together would move a row the operator has already
70
- * learned the position of.
175
+ * A vendor takes the position of the first provider detected for it, so the
176
+ * detected block keeps discovery's order and one vendor never appears in it
177
+ * twice. The block below keeps registry order — the order of the entries that
178
+ * can be set up, which is the order the screen drew those rows in before
179
+ * anything was grouped.
71
180
  *
72
181
  * `includeUnconfigured` is false on the signed-in-subscription screen, which
73
- * offers only sessions that are already usable; a row needing a key contradicts
74
- * that screen's one sentence.
182
+ * offers only sessions that are already usable.
183
+ */
184
+ export declare function providerListRows(detected: readonly DetectedProvider[], includeUnconfigured?: boolean): readonly VendorRow[];
185
+ /**
186
+ * Whether anything on this row can be used at all.
187
+ *
188
+ * False means the row is a discovery this build cannot construct — the one case
189
+ * where the screen may list something it must then refuse, rather than a row
190
+ * that needs a credential first.
191
+ */
192
+ export declare function rowIsUsable(row: VendorRow): boolean;
193
+ /**
194
+ * Whether entering the row has to ask how the operator means to use it.
195
+ *
196
+ * True exactly when the row has more than one way in — by the ways that exist,
197
+ * and not by how many registry ids they come from. One id can have two ways (a
198
+ * signed-in session beside an API key) and two ids can share one way, so
199
+ * counting ids answered the wrong question in both directions: it asked nothing
200
+ * about a vendor that had a session AND a key to choose between, and it would
201
+ * have asked twice about two ids that were one and the same key.
202
+ *
203
+ * A row with ONE way is not asked. That is the common case and the one the
204
+ * owner's rule protects: nothing stands between the operator and their model
205
+ * list when there is nothing to choose, and Enter goes on meaning what it has
206
+ * always meant — the detected session's models, or the field that takes the
207
+ * credential this row is missing.
208
+ */
209
+ export declare function rowNeedsChoice(row: VendorRow): boolean;
210
+ /**
211
+ * The entry a typed credential would be taken for on this row, if there is one.
212
+ *
213
+ * Asked of the whole vendor and not of the row's paths, deliberately: `k` takes
214
+ * a credential for the provider under the cursor so it can be used for THIS
215
+ * session, which is meaningful even when that provider is already detected and
216
+ * therefore has no credential path — a detected vendor is not one whose key the
217
+ * operator may not replace for the next hour.
218
+ *
219
+ * `acceptsTypedCredential` alone, and not `constructible` beside it, because
220
+ * this is the question `k` has always asked of the highlighted row. A detected
221
+ * provider this build cannot construct still takes a typed credential, and
222
+ * answering "it does not" would be false about the provider to make a point
223
+ * about the build — which is the refusal the row itself gives when it is
224
+ * accepted, in the words `unsupportedProviderMessage` writes.
225
+ */
226
+ export declare function typedCredentialEntry(row: VendorRow | undefined): ProviderRegistryEntry | undefined;
227
+ /**
228
+ * What a row with nothing detected is missing, named as the thing to act on.
229
+ *
230
+ * Null for a vendor whose members take no typed credential — a local server, or
231
+ * a vendor this build cannot construct — because those rows have a source
232
+ * column that says something else and a sentence here would name a variable
233
+ * nobody can use.
75
234
  */
76
- export declare function providerListRows(detected: readonly DetectedProvider[], includeUnconfigured?: boolean): readonly ProviderListRow[];
235
+ export declare function rowCredentialNeed(row: VendorRow): string | null;
77
236
  /**
78
237
  * What an unconfigured row is missing, named as the thing to act on.
79
238
  *
@@ -89,6 +248,10 @@ export declare function providerListRows(detected: readonly DetectedProvider[],
89
248
  * future entry without one prints a sentence rather than "needs undefined".
90
249
  */
91
250
  export declare function credentialNeed(entry: ProviderRegistryEntry): string;
251
+ /** Whether a row is about a given provider id — detected there, or a way in. */
252
+ export declare function rowHasProvider(row: VendorRow, id: string): boolean;
253
+ /** The index of the row holding a provider, or -1 when no row does. */
254
+ export declare function rowIndexOfProvider(rows: readonly VendorRow[], id: string | null | undefined): number;
92
255
  /**
93
256
  * Where the cursor starts.
94
257
  *
@@ -100,7 +263,9 @@ export declare function credentialNeed(entry: ProviderRegistryEntry): string;
100
263
  * `detected`, so it used to fall through to row 1: the picker opened saying
101
264
  * "no credential found" for the saved provider with the cursor elsewhere. Now the
102
265
  * highlighted row IS the row that needs the key, which is also the row `k`
103
- * targets.
266
+ * targets. Both lookups ask the row, not the vendor: a saved `codex` and a
267
+ * saved subscription id and a saved key id are the same row, and either one
268
+ * lands the cursor on it.
104
269
  */
105
- export declare function initialProviderRow(rows: readonly ProviderListRow[], currentProvider: string | null | undefined, keyEntryFor: ProviderId | null | undefined): number;
270
+ export declare function initialProviderRow(rows: readonly VendorRow[], currentProvider: string | null | undefined, keyEntryFor: ProviderId | null | undefined): number;
106
271
  //# sourceMappingURL=provider-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider-list.d.ts","sourceRoot":"","sources":["../../src/tui/provider-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAEN,KAAK,gBAAgB,EAErB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,MAAM,oCAAoC,CAAA;AAE3C;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,GAClE;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAA;CAAE,CAAA;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