@stigmer/cli 0.1.0-dev.20261017020314.g644422724c27 → 0.1.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 (774) hide show
  1. package/README.md +5 -4
  2. package/auth/auth0.js +1 -1
  3. package/auth/auth0.js.map +1 -1
  4. package/auth/token.d.ts +26 -4
  5. package/auth/token.d.ts.map +1 -1
  6. package/auth/token.js +120 -24
  7. package/auth/token.js.map +1 -1
  8. package/client/client.d.ts.map +1 -1
  9. package/client/client.js +21 -8
  10. package/client/client.js.map +1 -1
  11. package/command-tree.d.ts +63 -0
  12. package/command-tree.d.ts.map +1 -0
  13. package/command-tree.js +128 -0
  14. package/command-tree.js.map +1 -0
  15. package/commands/access-history/index.d.ts.map +1 -1
  16. package/commands/access-history/index.js +13 -1
  17. package/commands/access-history/index.js.map +1 -1
  18. package/commands/agent-exec-flags.d.ts +2 -0
  19. package/commands/agent-exec-flags.d.ts.map +1 -1
  20. package/commands/agent-exec-flags.js +9 -5
  21. package/commands/agent-exec-flags.js.map +1 -1
  22. package/commands/apikey/duration.d.ts.map +1 -1
  23. package/commands/apikey/duration.js +1 -2
  24. package/commands/apikey/duration.js.map +1 -1
  25. package/commands/apikey/index.d.ts.map +1 -1
  26. package/commands/apikey/index.js +3 -4
  27. package/commands/apikey/index.js.map +1 -1
  28. package/commands/apply.d.ts.map +1 -1
  29. package/commands/apply.js +3 -33
  30. package/commands/apply.js.map +1 -1
  31. package/commands/auth/index.d.ts.map +1 -1
  32. package/commands/auth/index.js +7 -5
  33. package/commands/auth/index.js.map +1 -1
  34. package/commands/auth/whoami.js +1 -1
  35. package/commands/channel.js +1 -1
  36. package/commands/channel.js.map +1 -1
  37. package/commands/config/index.js +3 -3
  38. package/commands/config/kv.d.ts.map +1 -1
  39. package/commands/config/kv.js +18 -14
  40. package/commands/config/kv.js.map +1 -1
  41. package/commands/connect.d.ts.map +1 -1
  42. package/commands/connect.js +18 -2
  43. package/commands/connect.js.map +1 -1
  44. package/commands/download.d.ts.map +1 -1
  45. package/commands/download.js +81 -54
  46. package/commands/download.js.map +1 -1
  47. package/commands/eval.d.ts.map +1 -1
  48. package/commands/eval.js +17 -19
  49. package/commands/eval.js.map +1 -1
  50. package/commands/file.d.ts +3 -0
  51. package/commands/file.d.ts.map +1 -0
  52. package/commands/file.js +64 -0
  53. package/commands/file.js.map +1 -0
  54. package/commands/get.d.ts.map +1 -1
  55. package/commands/get.js +20 -13
  56. package/commands/get.js.map +1 -1
  57. package/commands/help.d.ts +15 -0
  58. package/commands/help.d.ts.map +1 -0
  59. package/commands/help.js +175 -0
  60. package/commands/help.js.map +1 -0
  61. package/commands/internal-daemon.d.ts.map +1 -1
  62. package/commands/internal-daemon.js +9 -2
  63. package/commands/internal-daemon.js.map +1 -1
  64. package/commands/list.d.ts.map +1 -1
  65. package/commands/list.js +22 -1
  66. package/commands/list.js.map +1 -1
  67. package/commands/logs.js +1 -1
  68. package/commands/logs.js.map +1 -1
  69. package/commands/mcp-server.d.ts +16 -6
  70. package/commands/mcp-server.d.ts.map +1 -1
  71. package/commands/mcp-server.js +51 -26
  72. package/commands/mcp-server.js.map +1 -1
  73. package/commands/provider-key/index.d.ts +3 -0
  74. package/commands/provider-key/index.d.ts.map +1 -0
  75. package/commands/provider-key/index.js +156 -0
  76. package/commands/provider-key/index.js.map +1 -0
  77. package/commands/push.js +8 -8
  78. package/commands/push.js.map +1 -1
  79. package/commands/resume.d.ts.map +1 -1
  80. package/commands/resume.js +20 -13
  81. package/commands/resume.js.map +1 -1
  82. package/commands/routine.d.ts +3 -0
  83. package/commands/routine.d.ts.map +1 -0
  84. package/commands/routine.js +95 -0
  85. package/commands/routine.js.map +1 -0
  86. package/commands/run.d.ts.map +1 -1
  87. package/commands/run.js +34 -15
  88. package/commands/run.js.map +1 -1
  89. package/commands/runs/approve.d.ts.map +1 -1
  90. package/commands/runs/approve.js +10 -2
  91. package/commands/runs/approve.js.map +1 -1
  92. package/commands/runs/control.d.ts.map +1 -1
  93. package/commands/runs/control.js +24 -16
  94. package/commands/runs/control.js.map +1 -1
  95. package/commands/runs/index.d.ts.map +1 -1
  96. package/commands/runs/index.js +1 -2
  97. package/commands/runs/index.js.map +1 -1
  98. package/commands/runs/logs.d.ts.map +1 -1
  99. package/commands/runs/logs.js +7 -4
  100. package/commands/runs/logs.js.map +1 -1
  101. package/commands/runs/to-eval-case.d.ts.map +1 -1
  102. package/commands/runs/to-eval-case.js +13 -4
  103. package/commands/runs/to-eval-case.js.map +1 -1
  104. package/commands/runs/trace.js +1 -1
  105. package/commands/runs/trace.js.map +1 -1
  106. package/commands/search.js +2 -3
  107. package/commands/search.js.map +1 -1
  108. package/commands/service-account/index.d.ts.map +1 -1
  109. package/commands/service-account/index.js +4 -2
  110. package/commands/service-account/index.js.map +1 -1
  111. package/commands/session-help.d.ts +5 -0
  112. package/commands/session-help.d.ts.map +1 -0
  113. package/commands/session-help.js +38 -0
  114. package/commands/session-help.js.map +1 -0
  115. package/commands/setup.js +5 -5
  116. package/commands/setup.js.map +1 -1
  117. package/commands/shared.d.ts +10 -2
  118. package/commands/shared.d.ts.map +1 -1
  119. package/commands/shared.js +30 -3
  120. package/commands/shared.js.map +1 -1
  121. package/commands/tag.d.ts.map +1 -1
  122. package/commands/tag.js +11 -6
  123. package/commands/tag.js.map +1 -1
  124. package/commands/up.d.ts.map +1 -1
  125. package/commands/up.js +51 -21
  126. package/commands/up.js.map +1 -1
  127. package/commands/validate.js +2 -2
  128. package/commands/validate.js.map +1 -1
  129. package/commands/version.d.ts.map +1 -1
  130. package/commands/version.js +8 -4
  131. package/commands/version.js.map +1 -1
  132. package/config/config.d.ts +5 -22
  133. package/config/config.d.ts.map +1 -1
  134. package/config/config.js +56 -47
  135. package/config/config.js.map +1 -1
  136. package/config/index.d.ts +2 -2
  137. package/config/index.d.ts.map +1 -1
  138. package/config/index.js +1 -1
  139. package/config/index.js.map +1 -1
  140. package/config/keys.js +4 -4
  141. package/config/keys.js.map +1 -1
  142. package/config/paths.js +2 -2
  143. package/config/paths.js.map +1 -1
  144. package/config/resolve.d.ts +12 -2
  145. package/config/resolve.d.ts.map +1 -1
  146. package/config/resolve.js +18 -8
  147. package/config/resolve.js.map +1 -1
  148. package/errors/classify.d.ts +20 -0
  149. package/errors/classify.d.ts.map +1 -1
  150. package/errors/classify.js +97 -21
  151. package/errors/classify.js.map +1 -1
  152. package/errors/command-line.d.ts +14 -0
  153. package/errors/command-line.d.ts.map +1 -0
  154. package/errors/command-line.js +90 -0
  155. package/errors/command-line.js.map +1 -0
  156. package/errors/handle.js +2 -2
  157. package/errors/handle.js.map +1 -1
  158. package/errors/index.d.ts +2 -2
  159. package/errors/index.d.ts.map +1 -1
  160. package/errors/index.js +12 -2
  161. package/errors/index.js.map +1 -1
  162. package/errors/usage-error.js +1 -1
  163. package/errors/usage-error.js.map +1 -1
  164. package/global-options.d.ts +35 -0
  165. package/global-options.d.ts.map +1 -0
  166. package/global-options.js +81 -0
  167. package/global-options.js.map +1 -0
  168. package/local/artifact.d.ts +1 -20
  169. package/local/artifact.d.ts.map +1 -1
  170. package/local/artifact.js +35 -117
  171. package/local/artifact.js.map +1 -1
  172. package/local/constants.d.ts +3 -9
  173. package/local/constants.d.ts.map +1 -1
  174. package/local/constants.js +3 -9
  175. package/local/constants.js.map +1 -1
  176. package/local/daemon/components.d.ts +18 -5
  177. package/local/daemon/components.d.ts.map +1 -1
  178. package/local/daemon/components.js +61 -23
  179. package/local/daemon/components.js.map +1 -1
  180. package/local/daemon/env.d.ts +1 -5
  181. package/local/daemon/env.d.ts.map +1 -1
  182. package/local/daemon/env.js +0 -2
  183. package/local/daemon/env.js.map +1 -1
  184. package/local/daemon/host.d.ts +5 -0
  185. package/local/daemon/host.d.ts.map +1 -1
  186. package/local/daemon/host.js +68 -21
  187. package/local/daemon/host.js.map +1 -1
  188. package/local/daemon/index.d.ts +2 -1
  189. package/local/daemon/index.d.ts.map +1 -1
  190. package/local/daemon/index.js +2 -1
  191. package/local/daemon/index.js.map +1 -1
  192. package/local/daemon/launch.d.ts +58 -9
  193. package/local/daemon/launch.d.ts.map +1 -1
  194. package/local/daemon/launch.js +210 -64
  195. package/local/daemon/launch.js.map +1 -1
  196. package/local/daemon/process.d.ts +11 -7
  197. package/local/daemon/process.d.ts.map +1 -1
  198. package/local/daemon/process.js +74 -38
  199. package/local/daemon/process.js.map +1 -1
  200. package/local/daemon/signals.d.ts +3 -0
  201. package/local/daemon/signals.d.ts.map +1 -0
  202. package/local/daemon/signals.js +19 -0
  203. package/local/daemon/signals.js.map +1 -0
  204. package/local/daemon/supervisor.d.ts +9 -2
  205. package/local/daemon/supervisor.d.ts.map +1 -1
  206. package/local/daemon/supervisor.js +81 -22
  207. package/local/daemon/supervisor.js.map +1 -1
  208. package/local/daemon/types.d.ts +6 -1
  209. package/local/daemon/types.d.ts.map +1 -1
  210. package/local/daemon/types.js +2 -3
  211. package/local/daemon/types.js.map +1 -1
  212. package/local/llm-config.d.ts +4 -2
  213. package/local/llm-config.d.ts.map +1 -1
  214. package/local/llm-config.js +15 -9
  215. package/local/llm-config.js.map +1 -1
  216. package/local/logs/view.d.ts.map +1 -1
  217. package/local/logs/view.js +5 -6
  218. package/local/logs/view.js.map +1 -1
  219. package/local/net/tcp.d.ts +8 -6
  220. package/local/net/tcp.d.ts.map +1 -1
  221. package/local/net/tcp.js +13 -8
  222. package/local/net/tcp.js.map +1 -1
  223. package/local/paths.d.ts +1 -1
  224. package/local/paths.d.ts.map +1 -1
  225. package/local/paths.js +2 -3
  226. package/local/paths.js.map +1 -1
  227. package/local/provider-reach.d.ts +18 -0
  228. package/local/provider-reach.d.ts.map +1 -0
  229. package/local/provider-reach.js +109 -0
  230. package/local/provider-reach.js.map +1 -0
  231. package/local/reset.d.ts.map +1 -1
  232. package/local/reset.js +1 -2
  233. package/local/reset.js.map +1 -1
  234. package/local/runtime/index.d.ts.map +1 -1
  235. package/local/runtime/index.js +1 -2
  236. package/local/runtime/index.js.map +1 -1
  237. package/local/runtime/node.js +1 -1
  238. package/local/runtime/runner.js +2 -2
  239. package/local/runtime/runner.js.map +1 -1
  240. package/local/runtime/runtimes-install.js +1 -1
  241. package/local/runtime/server.d.ts.map +1 -1
  242. package/local/runtime/server.js +2 -4
  243. package/local/runtime/server.js.map +1 -1
  244. package/local/runtime/which.js +1 -1
  245. package/local/runtime/which.js.map +1 -1
  246. package/local/setup/wizard.d.ts +1 -1
  247. package/local/setup/wizard.d.ts.map +1 -1
  248. package/local/setup/wizard.js +7 -5
  249. package/local/setup/wizard.js.map +1 -1
  250. package/local/state/health-state.d.ts +6 -0
  251. package/local/state/health-state.d.ts.map +1 -1
  252. package/local/state/health-state.js +6 -2
  253. package/local/state/health-state.js.map +1 -1
  254. package/local/state/lock.d.ts +3 -2
  255. package/local/state/lock.d.ts.map +1 -1
  256. package/local/state/lock.js +26 -28
  257. package/local/state/lock.js.map +1 -1
  258. package/local/state/log-rotation.d.ts.map +1 -1
  259. package/local/state/log-rotation.js +2 -3
  260. package/local/state/log-rotation.js.map +1 -1
  261. package/local/state/pidfile.d.ts +24 -1
  262. package/local/state/pidfile.d.ts.map +1 -1
  263. package/local/state/pidfile.js +54 -6
  264. package/local/state/pidfile.js.map +1 -1
  265. package/local/state/proc.d.ts +31 -0
  266. package/local/state/proc.d.ts.map +1 -1
  267. package/local/state/proc.js +98 -1
  268. package/local/state/proc.js.map +1 -1
  269. package/local/state/startup-config.d.ts +2 -2
  270. package/local/status.d.ts +2 -4
  271. package/local/status.d.ts.map +1 -1
  272. package/local/status.js +26 -41
  273. package/local/status.js.map +1 -1
  274. package/local/temporal/download.d.ts +9 -5
  275. package/local/temporal/download.d.ts.map +1 -1
  276. package/local/temporal/download.js +29 -8
  277. package/local/temporal/download.js.map +1 -1
  278. package/local/temporal/index.d.ts +1 -1
  279. package/local/temporal/index.d.ts.map +1 -1
  280. package/local/temporal/index.js +1 -1
  281. package/local/temporal/index.js.map +1 -1
  282. package/local/temporal/manager.d.ts +31 -5
  283. package/local/temporal/manager.d.ts.map +1 -1
  284. package/local/temporal/manager.js +74 -35
  285. package/local/temporal/manager.js.map +1 -1
  286. package/local/temporal/supervisor.js +1 -1
  287. package/local/temporal/supervisor.js.map +1 -1
  288. package/local/webconsole/index.d.ts +5 -2
  289. package/local/webconsole/index.d.ts.map +1 -1
  290. package/local/webconsole/index.js +8 -6
  291. package/local/webconsole/index.js.map +1 -1
  292. package/marketplace/github.js +1 -1
  293. package/marketplace/github.js.map +1 -1
  294. package/marketplace/official.js +1 -1
  295. package/marketplace/official.js.map +1 -1
  296. package/output/command-result.d.ts +6 -0
  297. package/output/command-result.d.ts.map +1 -1
  298. package/output/command-result.js +13 -2
  299. package/output/command-result.js.map +1 -1
  300. package/output/confirm.d.ts.map +1 -1
  301. package/output/confirm.js +2 -3
  302. package/output/confirm.js.map +1 -1
  303. package/output/format.d.ts.map +1 -1
  304. package/output/format.js +5 -6
  305. package/output/format.js.map +1 -1
  306. package/output/index.d.ts +2 -2
  307. package/output/index.d.ts.map +1 -1
  308. package/output/index.js +2 -2
  309. package/output/index.js.map +1 -1
  310. package/output/printable.d.ts +8 -0
  311. package/output/printable.d.ts.map +1 -0
  312. package/output/printable.js +24 -0
  313. package/output/printable.js.map +1 -0
  314. package/output/proto.d.ts.map +1 -1
  315. package/output/proto.js +3 -4
  316. package/output/proto.js.map +1 -1
  317. package/output/style.js +2 -2
  318. package/output/style.js.map +1 -1
  319. package/output/table.d.ts +20 -1
  320. package/output/table.d.ts.map +1 -1
  321. package/output/table.js +75 -17
  322. package/output/table.js.map +1 -1
  323. package/package.json +13 -10
  324. package/program.d.ts +0 -14
  325. package/program.d.ts.map +1 -1
  326. package/program.js +58 -120
  327. package/program.js.map +1 -1
  328. package/registry/aliases.d.ts.map +1 -1
  329. package/registry/aliases.js +0 -3
  330. package/registry/aliases.js.map +1 -1
  331. package/registry/index.d.ts +1 -1
  332. package/registry/index.d.ts.map +1 -1
  333. package/registry/index.js +1 -1
  334. package/registry/index.js.map +1 -1
  335. package/registry/metadata.d.ts +0 -15
  336. package/registry/metadata.d.ts.map +1 -1
  337. package/registry/metadata.js +18 -55
  338. package/registry/metadata.js.map +1 -1
  339. package/registry/registry.d.ts +1 -5
  340. package/registry/registry.d.ts.map +1 -1
  341. package/registry/registry.js +3 -11
  342. package/registry/registry.js.map +1 -1
  343. package/registry/verb-support.d.ts.map +1 -1
  344. package/registry/verb-support.js +33 -9
  345. package/registry/verb-support.js.map +1 -1
  346. package/resources/agent/quality.d.ts +10 -5
  347. package/resources/agent/quality.d.ts.map +1 -1
  348. package/resources/agent/quality.js +19 -9
  349. package/resources/agent/quality.js.map +1 -1
  350. package/resources/agent/resolve.js +3 -3
  351. package/resources/agent/resolve.js.map +1 -1
  352. package/resources/apply/apply.d.ts +4 -3
  353. package/resources/apply/apply.d.ts.map +1 -1
  354. package/resources/apply/apply.js +54 -41
  355. package/resources/apply/apply.js.map +1 -1
  356. package/resources/apply/handlers.d.ts.map +1 -1
  357. package/resources/apply/handlers.js +4 -5
  358. package/resources/apply/handlers.js.map +1 -1
  359. package/resources/channel.d.ts.map +1 -1
  360. package/resources/channel.js +3 -4
  361. package/resources/channel.js.map +1 -1
  362. package/resources/connect/connect.js +2 -2
  363. package/resources/connect/connect.js.map +1 -1
  364. package/resources/delete.d.ts.map +1 -1
  365. package/resources/delete.js +41 -7
  366. package/resources/delete.js.map +1 -1
  367. package/resources/documents.js +1 -1
  368. package/resources/documents.js.map +1 -1
  369. package/resources/download.d.ts +43 -3
  370. package/resources/download.d.ts.map +1 -1
  371. package/resources/download.js +169 -34
  372. package/resources/download.js.map +1 -1
  373. package/resources/eval-run/options.d.ts +3 -1
  374. package/resources/eval-run/options.d.ts.map +1 -1
  375. package/resources/eval-run/options.js +36 -18
  376. package/resources/eval-run/options.js.map +1 -1
  377. package/resources/eval-run/report.d.ts +4 -2
  378. package/resources/eval-run/report.d.ts.map +1 -1
  379. package/resources/eval-run/report.js +9 -7
  380. package/resources/eval-run/report.js.map +1 -1
  381. package/resources/eval-run/run.d.ts +2 -1
  382. package/resources/eval-run/run.d.ts.map +1 -1
  383. package/resources/eval-run/run.js +13 -7
  384. package/resources/eval-run/run.js.map +1 -1
  385. package/resources/file.d.ts +27 -0
  386. package/resources/file.d.ts.map +1 -0
  387. package/resources/file.js +82 -0
  388. package/resources/file.js.map +1 -0
  389. package/resources/get-bindings.d.ts.map +1 -1
  390. package/resources/get-bindings.js +21 -3
  391. package/resources/get-bindings.js.map +1 -1
  392. package/resources/git.d.ts +1 -1
  393. package/resources/git.js +1 -1
  394. package/resources/list.d.ts +21 -2
  395. package/resources/list.d.ts.map +1 -1
  396. package/resources/list.js +167 -49
  397. package/resources/list.js.map +1 -1
  398. package/resources/plugin.d.ts.map +1 -1
  399. package/resources/plugin.js +4 -0
  400. package/resources/plugin.js.map +1 -1
  401. package/resources/provider-key.d.ts +81 -0
  402. package/resources/provider-key.d.ts.map +1 -0
  403. package/resources/provider-key.js +261 -0
  404. package/resources/provider-key.js.map +1 -0
  405. package/resources/reference.d.ts +16 -22
  406. package/resources/reference.d.ts.map +1 -1
  407. package/resources/reference.js +44 -90
  408. package/resources/reference.js.map +1 -1
  409. package/resources/render.d.ts +31 -7
  410. package/resources/render.d.ts.map +1 -1
  411. package/resources/render.js +66 -38
  412. package/resources/render.js.map +1 -1
  413. package/resources/routine.d.ts +38 -0
  414. package/resources/routine.d.ts.map +1 -0
  415. package/resources/routine.js +207 -0
  416. package/resources/routine.js.map +1 -0
  417. package/resources/run/agent-exec.d.ts +12 -2
  418. package/resources/run/agent-exec.d.ts.map +1 -1
  419. package/resources/run/agent-exec.js +85 -38
  420. package/resources/run/agent-exec.js.map +1 -1
  421. package/resources/run/create.d.ts +16 -12
  422. package/resources/run/create.d.ts.map +1 -1
  423. package/resources/run/create.js +14 -15
  424. package/resources/run/create.js.map +1 -1
  425. package/resources/run/engines.d.ts +32 -0
  426. package/resources/run/engines.d.ts.map +1 -0
  427. package/resources/run/engines.js +39 -0
  428. package/resources/run/engines.js.map +1 -0
  429. package/resources/run/environment.d.ts +11 -0
  430. package/resources/run/environment.d.ts.map +1 -0
  431. package/resources/run/environment.js +30 -0
  432. package/resources/run/environment.js.map +1 -0
  433. package/resources/run/epilogue.d.ts +1 -1
  434. package/resources/run/epilogue.d.ts.map +1 -1
  435. package/resources/run/epilogue.js +18 -19
  436. package/resources/run/epilogue.js.map +1 -1
  437. package/resources/run/files.d.ts +104 -0
  438. package/resources/run/files.d.ts.map +1 -0
  439. package/resources/run/files.js +316 -0
  440. package/resources/run/files.js.map +1 -0
  441. package/resources/run/header.d.ts +11 -9
  442. package/resources/run/header.d.ts.map +1 -1
  443. package/resources/run/header.js +14 -14
  444. package/resources/run/header.js.map +1 -1
  445. package/resources/run/prepare.d.ts +31 -25
  446. package/resources/run/prepare.d.ts.map +1 -1
  447. package/resources/run/prepare.js +42 -51
  448. package/resources/run/prepare.js.map +1 -1
  449. package/resources/run/references.d.ts.map +1 -1
  450. package/resources/run/references.js +6 -5
  451. package/resources/run/references.js.map +1 -1
  452. package/resources/run/resolve.js +1 -1
  453. package/resources/run/resolve.js.map +1 -1
  454. package/resources/run/resume.d.ts +3 -1
  455. package/resources/run/resume.d.ts.map +1 -1
  456. package/resources/run/resume.js +25 -10
  457. package/resources/run/resume.js.map +1 -1
  458. package/resources/run/stream.d.ts +34 -2
  459. package/resources/run/stream.d.ts.map +1 -1
  460. package/resources/run/stream.js +92 -8
  461. package/resources/run/stream.js.map +1 -1
  462. package/resources/run/workspace.d.ts +9 -12
  463. package/resources/run/workspace.d.ts.map +1 -1
  464. package/resources/run/workspace.js +29 -36
  465. package/resources/run/workspace.js.map +1 -1
  466. package/resources/run-approve.d.ts.map +1 -1
  467. package/resources/run-approve.js +2 -11
  468. package/resources/run-approve.js.map +1 -1
  469. package/resources/run-control.d.ts +3 -3
  470. package/resources/run-control.d.ts.map +1 -1
  471. package/resources/run-control.js +4 -5
  472. package/resources/run-control.js.map +1 -1
  473. package/resources/run-format.d.ts +2 -2
  474. package/resources/run-format.d.ts.map +1 -1
  475. package/resources/run-format.js +3 -4
  476. package/resources/run-format.js.map +1 -1
  477. package/resources/run-logs.d.ts +2 -0
  478. package/resources/run-logs.d.ts.map +1 -1
  479. package/resources/run-logs.js +16 -6
  480. package/resources/run-logs.js.map +1 -1
  481. package/resources/run-scores.d.ts +6 -2
  482. package/resources/run-scores.d.ts.map +1 -1
  483. package/resources/run-scores.js +7 -4
  484. package/resources/run-scores.js.map +1 -1
  485. package/resources/run-to-eval-case.js +2 -2
  486. package/resources/run-to-eval-case.js.map +1 -1
  487. package/resources/runs.d.ts +3 -3
  488. package/resources/runs.d.ts.map +1 -1
  489. package/resources/runs.js +5 -5
  490. package/resources/runs.js.map +1 -1
  491. package/resources/search.d.ts.map +1 -1
  492. package/resources/search.js +1 -2
  493. package/resources/search.js.map +1 -1
  494. package/resources/service-account.d.ts +2 -0
  495. package/resources/service-account.d.ts.map +1 -1
  496. package/resources/service-account.js +3 -1
  497. package/resources/service-account.js.map +1 -1
  498. package/resources/session.d.ts +4 -3
  499. package/resources/session.d.ts.map +1 -1
  500. package/resources/session.js +10 -7
  501. package/resources/session.js.map +1 -1
  502. package/resources/skill.d.ts +1 -1
  503. package/resources/skill.d.ts.map +1 -1
  504. package/resources/skill.js +7 -8
  505. package/resources/skill.js.map +1 -1
  506. package/resources/stream/answer.d.ts +1 -2
  507. package/resources/stream/answer.d.ts.map +1 -1
  508. package/resources/stream/answer.js +3 -16
  509. package/resources/stream/answer.js.map +1 -1
  510. package/resources/stream/composer.d.ts +16 -0
  511. package/resources/stream/composer.d.ts.map +1 -0
  512. package/resources/stream/composer.js +171 -0
  513. package/resources/stream/composer.js.map +1 -0
  514. package/resources/stream/ink.d.ts +20 -4
  515. package/resources/stream/ink.d.ts.map +1 -1
  516. package/resources/stream/ink.js +34 -3
  517. package/resources/stream/ink.js.map +1 -1
  518. package/resources/stream/render-plaintext.d.ts +1 -0
  519. package/resources/stream/render-plaintext.d.ts.map +1 -1
  520. package/resources/stream/render-plaintext.js +21 -4
  521. package/resources/stream/render-plaintext.js.map +1 -1
  522. package/resources/stream/tty.js +1 -1
  523. package/resources/stream/tty.js.map +1 -1
  524. package/resources/tag.d.ts.map +1 -1
  525. package/resources/tag.js +7 -8
  526. package/resources/tag.js.map +1 -1
  527. package/resources/usage.d.ts +3 -2
  528. package/resources/usage.d.ts.map +1 -1
  529. package/resources/usage.js +19 -16
  530. package/resources/usage.js.map +1 -1
  531. package/resources/validate.d.ts.map +1 -1
  532. package/resources/validate.js +1 -12
  533. package/resources/validate.js.map +1 -1
  534. package/resources/version.d.ts +17 -3
  535. package/resources/version.d.ts.map +1 -1
  536. package/resources/version.js +105 -14
  537. package/resources/version.js.map +1 -1
  538. package/resources/views/agent.d.ts +3 -0
  539. package/resources/views/agent.d.ts.map +1 -0
  540. package/resources/views/agent.js +54 -0
  541. package/resources/views/agent.js.map +1 -0
  542. package/resources/views/environment.d.ts +3 -0
  543. package/resources/views/environment.d.ts.map +1 -0
  544. package/resources/views/environment.js +37 -0
  545. package/resources/views/environment.js.map +1 -0
  546. package/resources/views/index.d.ts +22 -0
  547. package/resources/views/index.d.ts.map +1 -0
  548. package/resources/views/index.js +70 -0
  549. package/resources/views/index.js.map +1 -0
  550. package/resources/views/organization.d.ts +3 -0
  551. package/resources/views/organization.d.ts.map +1 -0
  552. package/resources/views/organization.js +27 -0
  553. package/resources/views/organization.js.map +1 -0
  554. package/resources/views/routine.d.ts +3 -0
  555. package/resources/views/routine.d.ts.map +1 -0
  556. package/resources/views/routine.js +37 -0
  557. package/resources/views/routine.js.map +1 -0
  558. package/resources/views/run.d.ts +3 -0
  559. package/resources/views/run.d.ts.map +1 -0
  560. package/resources/views/run.js +45 -0
  561. package/resources/views/run.js.map +1 -0
  562. package/resources/views/session.d.ts +5 -0
  563. package/resources/views/session.d.ts.map +1 -0
  564. package/resources/views/session.js +85 -0
  565. package/resources/views/session.js.map +1 -0
  566. package/resources/views/skill.d.ts +5 -0
  567. package/resources/views/skill.d.ts.map +1 -0
  568. package/resources/views/skill.js +48 -0
  569. package/resources/views/skill.js.map +1 -0
  570. package/resources/views/view.d.ts +66 -0
  571. package/resources/views/view.d.ts.map +1 -0
  572. package/resources/views/view.js +130 -0
  573. package/resources/views/view.js.map +1 -0
  574. package/resources/views/words.d.ts +52 -0
  575. package/resources/views/words.d.ts.map +1 -0
  576. package/resources/views/words.js +190 -0
  577. package/resources/views/words.js.map +1 -0
  578. package/runtime.d.ts +22 -0
  579. package/runtime.d.ts.map +1 -1
  580. package/runtime.js +33 -2
  581. package/runtime.js.map +1 -1
  582. package/src/auth/auth0.ts +1 -1
  583. package/src/auth/token.ts +136 -26
  584. package/src/client/client.ts +23 -16
  585. package/src/command-tree.ts +152 -0
  586. package/src/commands/access-history/index.ts +15 -2
  587. package/src/commands/agent-exec-flags.ts +11 -5
  588. package/src/commands/apikey/duration.ts +1 -2
  589. package/src/commands/apikey/index.ts +3 -4
  590. package/src/commands/apply.ts +4 -23
  591. package/src/commands/auth/index.ts +7 -5
  592. package/src/commands/auth/whoami.ts +1 -1
  593. package/src/commands/channel.ts +1 -1
  594. package/src/commands/config/index.ts +3 -3
  595. package/src/commands/config/kv.ts +18 -14
  596. package/src/commands/connect.ts +21 -3
  597. package/src/commands/download.ts +106 -62
  598. package/src/commands/eval.ts +22 -21
  599. package/src/commands/file.ts +80 -0
  600. package/src/commands/get.ts +19 -13
  601. package/src/commands/help.ts +182 -0
  602. package/src/commands/internal-daemon.ts +9 -2
  603. package/src/commands/list.ts +22 -1
  604. package/src/commands/logs.ts +1 -1
  605. package/src/commands/mcp-server.ts +57 -28
  606. package/src/commands/provider-key/index.ts +192 -0
  607. package/src/commands/push.ts +8 -8
  608. package/src/commands/resume.ts +23 -14
  609. package/src/commands/routine.ts +122 -0
  610. package/src/commands/run.ts +37 -17
  611. package/src/commands/runs/approve.ts +13 -4
  612. package/src/commands/runs/control.ts +50 -27
  613. package/src/commands/runs/index.ts +1 -2
  614. package/src/commands/runs/logs.ts +9 -5
  615. package/src/commands/runs/to-eval-case.ts +18 -6
  616. package/src/commands/runs/trace.ts +1 -1
  617. package/src/commands/search.ts +2 -3
  618. package/src/commands/service-account/index.ts +7 -2
  619. package/src/commands/session-help.ts +39 -0
  620. package/src/commands/setup.ts +5 -5
  621. package/src/commands/shared.ts +32 -3
  622. package/src/commands/tag.ts +13 -7
  623. package/src/commands/up.ts +55 -21
  624. package/src/commands/validate.ts +2 -2
  625. package/src/commands/version.ts +9 -4
  626. package/src/config/config.ts +66 -69
  627. package/src/config/index.ts +1 -2
  628. package/src/config/keys.ts +4 -4
  629. package/src/config/paths.ts +2 -2
  630. package/src/config/resolve.ts +20 -8
  631. package/src/errors/classify.ts +110 -21
  632. package/src/errors/command-line.ts +95 -0
  633. package/src/errors/handle.ts +2 -2
  634. package/src/errors/index.ts +12 -2
  635. package/src/errors/usage-error.ts +1 -1
  636. package/src/global-options.ts +100 -0
  637. package/src/local/artifact.ts +46 -140
  638. package/src/local/constants.ts +3 -9
  639. package/src/local/daemon/components.ts +78 -22
  640. package/src/local/daemon/env.ts +3 -8
  641. package/src/local/daemon/host.ts +64 -19
  642. package/src/local/daemon/index.ts +2 -1
  643. package/src/local/daemon/launch.ts +251 -72
  644. package/src/local/daemon/process.ts +78 -46
  645. package/src/local/daemon/signals.ts +19 -0
  646. package/src/local/daemon/supervisor.ts +84 -21
  647. package/src/local/daemon/types.ts +8 -4
  648. package/src/local/llm-config.ts +15 -9
  649. package/src/local/logs/view.ts +5 -6
  650. package/src/local/net/tcp.ts +18 -11
  651. package/src/local/paths.ts +2 -3
  652. package/src/local/provider-reach.ts +124 -0
  653. package/src/local/reset.ts +1 -2
  654. package/src/local/runtime/index.ts +1 -2
  655. package/src/local/runtime/node.ts +1 -1
  656. package/src/local/runtime/runner.ts +2 -2
  657. package/src/local/runtime/runtimes-install.ts +1 -1
  658. package/src/local/runtime/server.ts +2 -4
  659. package/src/local/runtime/which.ts +1 -1
  660. package/src/local/setup/wizard.ts +7 -5
  661. package/src/local/state/health-state.ts +10 -2
  662. package/src/local/state/lock.ts +26 -28
  663. package/src/local/state/log-rotation.ts +2 -3
  664. package/src/local/state/pidfile.ts +61 -6
  665. package/src/local/state/proc.ts +104 -1
  666. package/src/local/state/startup-config.ts +2 -2
  667. package/src/local/status.ts +30 -41
  668. package/src/local/temporal/download.ts +31 -9
  669. package/src/local/temporal/index.ts +1 -1
  670. package/src/local/temporal/manager.ts +94 -34
  671. package/src/local/temporal/supervisor.ts +1 -1
  672. package/src/local/webconsole/index.ts +8 -5
  673. package/src/marketplace/github.ts +1 -1
  674. package/src/marketplace/official.ts +1 -1
  675. package/src/output/command-result.ts +14 -2
  676. package/src/output/confirm.ts +2 -3
  677. package/src/output/format.ts +5 -6
  678. package/src/output/index.ts +8 -1
  679. package/src/output/printable.ts +26 -0
  680. package/src/output/proto.ts +3 -4
  681. package/src/output/style.ts +2 -2
  682. package/src/output/table.ts +118 -15
  683. package/src/program.ts +59 -129
  684. package/src/registry/aliases.ts +0 -3
  685. package/src/registry/index.ts +0 -1
  686. package/src/registry/metadata.ts +18 -62
  687. package/src/registry/registry.ts +3 -13
  688. package/src/registry/verb-support.ts +33 -9
  689. package/src/resources/agent/quality.ts +29 -8
  690. package/src/resources/agent/resolve.ts +3 -3
  691. package/src/resources/apply/apply.ts +58 -49
  692. package/src/resources/apply/handlers.ts +4 -5
  693. package/src/resources/channel.ts +3 -4
  694. package/src/resources/connect/connect.ts +2 -2
  695. package/src/resources/delete.ts +47 -7
  696. package/src/resources/documents.ts +1 -1
  697. package/src/resources/download.ts +239 -43
  698. package/src/resources/eval-run/options.ts +38 -17
  699. package/src/resources/eval-run/report.ts +11 -5
  700. package/src/resources/eval-run/run.ts +13 -9
  701. package/src/resources/file.ts +114 -0
  702. package/src/resources/get-bindings.ts +21 -3
  703. package/src/resources/git.ts +1 -1
  704. package/src/resources/list.ts +197 -52
  705. package/src/resources/plugin.ts +3 -0
  706. package/src/resources/provider-key.ts +327 -0
  707. package/src/resources/reference.ts +43 -87
  708. package/src/resources/render.ts +72 -38
  709. package/src/resources/routine.ts +271 -0
  710. package/src/resources/run/agent-exec.ts +95 -44
  711. package/src/resources/run/create.ts +27 -24
  712. package/src/resources/run/engines.ts +57 -0
  713. package/src/resources/run/environment.ts +43 -0
  714. package/src/resources/run/epilogue.ts +18 -17
  715. package/src/resources/run/files.ts +433 -0
  716. package/src/resources/run/header.ts +18 -18
  717. package/src/resources/run/prepare.ts +67 -74
  718. package/src/resources/run/references.ts +6 -5
  719. package/src/resources/run/resolve.ts +1 -1
  720. package/src/resources/run/resume.ts +28 -9
  721. package/src/resources/run/stream.ts +110 -9
  722. package/src/resources/run/workspace.ts +37 -47
  723. package/src/resources/run-approve.ts +2 -14
  724. package/src/resources/run-control.ts +4 -5
  725. package/src/resources/run-format.ts +3 -4
  726. package/src/resources/run-logs.ts +17 -6
  727. package/src/resources/run-scores.ts +14 -4
  728. package/src/resources/run-to-eval-case.ts +2 -2
  729. package/src/resources/runs.ts +5 -5
  730. package/src/resources/search.ts +1 -2
  731. package/src/resources/service-account.ts +4 -1
  732. package/src/resources/session.ts +10 -7
  733. package/src/resources/skill.ts +7 -8
  734. package/src/resources/stream/answer.ts +3 -19
  735. package/src/resources/stream/composer.ts +170 -0
  736. package/src/resources/stream/ink.tsx +74 -10
  737. package/src/resources/stream/render-plaintext.ts +22 -4
  738. package/src/resources/stream/tty.ts +1 -1
  739. package/src/resources/tag.ts +7 -9
  740. package/src/resources/usage.ts +19 -15
  741. package/src/resources/validate.ts +1 -10
  742. package/src/resources/version.ts +117 -15
  743. package/src/resources/views/agent.ts +60 -0
  744. package/src/resources/views/environment.ts +41 -0
  745. package/src/resources/views/index.ts +82 -0
  746. package/src/resources/views/organization.ts +29 -0
  747. package/src/resources/views/routine.ts +39 -0
  748. package/src/resources/views/run.ts +46 -0
  749. package/src/resources/views/session.ts +91 -0
  750. package/src/resources/views/skill.ts +49 -0
  751. package/src/resources/views/view.ts +188 -0
  752. package/src/resources/views/words.ts +191 -0
  753. package/src/runtime.ts +51 -2
  754. package/commands/schedule.d.ts +0 -3
  755. package/commands/schedule.d.ts.map +0 -1
  756. package/commands/schedule.js +0 -57
  757. package/commands/schedule.js.map +0 -1
  758. package/errors/exit-codes.d.ts +0 -10
  759. package/errors/exit-codes.d.ts.map +0 -1
  760. package/errors/exit-codes.js +0 -15
  761. package/errors/exit-codes.js.map +0 -1
  762. package/resources/run/attachments.d.ts +0 -24
  763. package/resources/run/attachments.d.ts.map +0 -1
  764. package/resources/run/attachments.js +0 -237
  765. package/resources/run/attachments.js.map +0 -1
  766. package/resources/schedule.d.ts +0 -22
  767. package/resources/schedule.d.ts.map +0 -1
  768. package/resources/schedule.js +0 -116
  769. package/resources/schedule.js.map +0 -1
  770. package/src/commands/schedule.ts +0 -70
  771. package/src/errors/exit-codes.ts +0 -17
  772. package/src/resources/run/attachments.ts +0 -300
  773. package/src/resources/schedule.ts +0 -132
  774. package/src/types/marked-terminal.d.ts +0 -31
package/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # @stigmer/cli
2
2
 
3
- The Stigmer command-line interface — manage agents, plugins, skills and runs
4
- from the terminal.
3
+ Command-line interface for [Stigmer](https://stigmer.ai), the open-source backend for the agents in your product:
4
+ manage agents, plugins, skills and runs from the terminal.
5
5
 
6
- This is the TypeScript CLI that replaced the Go CLI. Its shape, in brief:
6
+ Its shape, in brief:
7
7
 
8
8
  - the commander command tree (`stigmer ...`);
9
- - cross-cutting infrastructure: config, errors/exit-codes, unified output, the
9
+ - cross-cutting infrastructure: config, errors (exit codes from
10
+ `@stigmer/client/node`), unified output, the
10
11
  backend client façade, the resource-type registry, and PKCE auth with
11
12
  refresh-token support;
12
13
  - reads and writes: `get`, `list`, `validate`, `apply`, `delete`, `diff`, plus
package/auth/auth0.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // password), and PKCE removes the need for a client secret entirely. The
6
6
  // authorize/token endpoints are hardcoded because Auth0's URL structure is
7
7
  // stable ({domain}/authorize, {domain}/oauth/token), saving an OIDC-discovery
8
- // round-trip at login time. Kept byte-for-byte identical to the Go CLI.
8
+ // round-trip at login time.
9
9
  export const AUTH0_DOMAIN = "https://stigmer-prod.us.auth0.com";
10
10
  export const CLIENT_ID = "kIT6URf4HKn6YzrQVVFTFN63BrSJdTPM";
11
11
  export const AUDIENCE = "https://api.stigmer.com/";
package/auth/auth0.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth0.js","sourceRoot":"","sources":["../src/auth/auth0.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,wEAAwE;AAExE,MAAM,CAAC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AAChE,MAAM,CAAC,MAAM,SAAS,GAAG,kCAAkC,CAAC;AAC5D,MAAM,CAAC,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAE9C,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,CAAU,CAAC;AAEzE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,YAAY,YAAY,CAAC;AACzD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,YAAY,cAAc,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,UAAU,WAAW;IACzB,OAAO,oBAAoB,aAAa,GAAG,aAAa,EAAE,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAgD;IAChF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;IACnC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,CAAC,YAAY,CA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AM,aAAa,GAAG,GAAG,YAAY,YAAY,CAAC;AACzD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,YAAY,cAAc,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,UAAU,WAAW;IACzB,OAAO,oBAAoB,aAAa,GAAG,aAAa,EAAE,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAgD;IAChF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;IACnC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC,CAAC;IACpD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;IACtD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC"}
package/auth/token.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { TokenProvider } from "@stigmer/client";
1
+ import { type TokenCache, type TokenProvider } from "@stigmer/client";
2
2
  import { type Config } from "../config/index.js";
3
3
  /** Normalized result of an Auth0 token endpoint call. */
4
4
  export interface TokenSet {
@@ -26,13 +26,35 @@ export declare function refreshAccessToken(refreshToken: string): Promise<TokenS
26
26
  * expired server-side); local returns null (no auth).
27
27
  * 3. A cloud backend's non-expired access token is returned as-is.
28
28
  * 4. An expired token with a refresh token is refreshed; the new token,
29
- * rotated refresh token, and expiry are persisted INTO THE ENTRY, then
30
- * returned.
29
+ * rotated refresh token, and expiry are set INTO THE ENTRY and patched
30
+ * into that entry on disk, then returned. Calls made while a refresh is
31
+ * in flight share it, so a burst of RPCs makes one refresh request.
31
32
  * 5. Otherwise the (possibly stale) token or null is returned, letting the
32
33
  * server reject it so the error maps to a clear "please log in" exit.
33
34
  *
34
35
  * Closes over `config` so a refresh updates the same object the rest of the
35
- * command sees, and writes it through to disk.
36
+ * command sees.
36
37
  */
37
38
  export declare function createRefreshingTokenProvider(config: Config): TokenProvider;
39
+ /**
40
+ * The token source for a long-running process whose server dials one fixed
41
+ * address: the cloud backend `backendName` at `endpoint`, as they were when
42
+ * it started. Built on the SDK's token cache, so a token is kept until a
43
+ * minute before it expires, concurrent calls share one fetch, and a failed
44
+ * fetch is not kept. Each fetch:
45
+ * 1. reads the config file as it is now, so it sees a refresh, a rotated
46
+ * refresh token or a login another command saved;
47
+ * 2. answers null (no credential, never another backend's) when the entry
48
+ * is gone, is no longer a cloud backend, or now points elsewhere;
49
+ * 3. otherwise refreshes the token when it is expired, persisting it as the
50
+ * short-lived provider does;
51
+ * 4. keeps a token with no usable expiry for {@link NO_EXPIRY_REREAD_MS}.
52
+ * A dead sign-in (the refresh refused) answers the stale token with its past
53
+ * expiry, so the next call reads the file again and a `stigmer auth login` in
54
+ * another terminal takes effect on it.
55
+ *
56
+ * `STIGMER_API_KEY` is not consulted: a given key is used instead of this
57
+ * source, never through it.
58
+ */
59
+ export declare function createBackendTokenSource(backendName: string, endpoint: string): TokenCache;
38
60
  //# sourceMappingURL=token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/auth/token.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,KAAK,MAAM,EAIZ,MAAM,oBAAoB,CAAC;AAI5B,yDAAyD;AACzD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAcD,yEAAyE;AACzE,wBAAsB,YAAY,CAAC,MAAM,EAAE;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQpB;AAED,yDAAyD;AACzD,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,QAAQ,CAAC,CAMnB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAmB3E"}
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/auth/token.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAoB,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EACL,KAAK,MAAM,EAKZ,MAAM,oBAAoB,CAAC;AAK5B,yDAAyD;AACzD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAoBD,yEAAyE;AACzE,wBAAsB,YAAY,CAAC,MAAM,EAAE;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQpB;AAED,yDAAyD;AACzD,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,QAAQ,CAAC,CAMnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAyB3E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAgB1F"}
package/auth/token.js CHANGED
@@ -1,11 +1,32 @@
1
1
  // Auth0 token operations: exchange an authorization code for tokens, refresh an
2
- // expired access token, and expose a token provider that refreshes silently.
3
- import { activeBackend, save, } from "../config/index.js";
2
+ // expired access token, and expose token providers that refresh silently.
3
+ //
4
+ // Two providers share one refresh path (freshCloudToken), so they cannot drift:
5
+ // - createRefreshingTokenProvider serves a short-lived command. It reads the
6
+ // ACTIVE backend from the config the command loaded, and concurrent calls
7
+ // (a command's Promise.all of RPCs) share one refresh.
8
+ // - createBackendTokenSource serves a long-running process (`stigmer
9
+ // mcp-server`). Its server dials one fixed address, so the source is pinned
10
+ // to the backend it started with and never follows `config backend use`
11
+ // elsewhere; it re-reads the file once per token lifetime so it sees a
12
+ // refresh or a login another command wrote.
13
+ //
14
+ // A refresh is persisted by patching only that entry's token fields into the
15
+ // file as it is on disk now, never by saving a config loaded earlier, so it
16
+ // cannot undo a `backend use` or a login another command saved meanwhile.
17
+ import { createTokenCache } from "@stigmer/client";
18
+ import { activeBackend, load, save, } from "../config/index.js";
19
+ import { DEFAULT_CLOUD_ENDPOINT } from "../config/resolve.js";
4
20
  import { CliExitError, ExitCode } from "../errors/index.js";
5
21
  import { CLIENT_ID, callbackUrl, TOKEN_URL } from "./auth0.js";
6
22
  // Refresh this many ms before the real expiry so an in-flight request never
7
23
  // races the token going stale.
8
24
  const EXPIRY_SKEW_MS = 60_000;
25
+ // How long a long-running source keeps a token stored with no usable expiry (a
26
+ // pasted token) before reading the file again, so a later `stigmer auth login`
27
+ // is picked up without a restart. Shorter reads the disk more often; longer
28
+ // picks up a new sign-in later.
29
+ const NO_EXPIRY_REREAD_MS = 5 * 60_000;
9
30
  /** Exchange a PKCE authorization code for an access (+refresh) token. */
10
31
  export async function exchangeCode(params) {
11
32
  return postToken({
@@ -35,56 +56,131 @@ export async function refreshAccessToken(refreshToken) {
35
56
  * expired server-side); local returns null (no auth).
36
57
  * 3. A cloud backend's non-expired access token is returned as-is.
37
58
  * 4. An expired token with a refresh token is refreshed; the new token,
38
- * rotated refresh token, and expiry are persisted INTO THE ENTRY, then
39
- * returned.
59
+ * rotated refresh token, and expiry are set INTO THE ENTRY and patched
60
+ * into that entry on disk, then returned. Calls made while a refresh is
61
+ * in flight share it, so a burst of RPCs makes one refresh request.
40
62
  * 5. Otherwise the (possibly stale) token or null is returned, letting the
41
63
  * server reject it so the error maps to a clear "please log in" exit.
42
64
  *
43
65
  * Closes over `config` so a refresh updates the same object the rest of the
44
- * command sees, and writes it through to disk.
66
+ * command sees.
45
67
  */
46
68
  export function createRefreshingTokenProvider(config) {
69
+ let inFlight;
47
70
  return async () => {
48
71
  const envKey = process.env.STIGMER_API_KEY;
49
72
  if (envKey !== undefined && envKey !== "")
50
73
  return envKey;
51
- const { entry } = activeBackend(config);
74
+ const { name, entry } = activeBackend(config);
52
75
  if (entry === undefined)
53
76
  return null;
54
77
  if (entry.type === "selfhost")
55
78
  return entry.api_key ?? null;
56
- if (entry.token === undefined || entry.token === "") {
57
- return entry.refresh_token
58
- ? refreshAndPersist(config, entry, entry.refresh_token)
59
- : null;
79
+ if (inFlight?.entry !== entry) {
80
+ const endpoint = cloudEndpoint(entry);
81
+ const token = freshCloudToken(entry, (next) => persistRefreshedTokens(name, endpoint, next)).then((fresh) => fresh?.accessToken ?? null);
82
+ inFlight = { entry, token };
83
+ const settled = () => {
84
+ if (inFlight?.token === token)
85
+ inFlight = undefined;
86
+ };
87
+ token.then(settled, settled);
60
88
  }
61
- if (!isExpired(entry.token_expiry))
62
- return entry.token;
63
- if (entry.refresh_token === undefined || entry.refresh_token === "")
64
- return entry.token;
65
- return refreshAndPersist(config, entry, entry.refresh_token);
89
+ return inFlight.token;
66
90
  };
67
91
  }
68
- async function refreshAndPersist(config, entry, refreshToken) {
92
+ /**
93
+ * The token source for a long-running process whose server dials one fixed
94
+ * address: the cloud backend `backendName` at `endpoint`, as they were when
95
+ * it started. Built on the SDK's token cache, so a token is kept until a
96
+ * minute before it expires, concurrent calls share one fetch, and a failed
97
+ * fetch is not kept. Each fetch:
98
+ * 1. reads the config file as it is now, so it sees a refresh, a rotated
99
+ * refresh token or a login another command saved;
100
+ * 2. answers null (no credential, never another backend's) when the entry
101
+ * is gone, is no longer a cloud backend, or now points elsewhere;
102
+ * 3. otherwise refreshes the token when it is expired, persisting it as the
103
+ * short-lived provider does;
104
+ * 4. keeps a token with no usable expiry for {@link NO_EXPIRY_REREAD_MS}.
105
+ * A dead sign-in (the refresh refused) answers the stale token with its past
106
+ * expiry, so the next call reads the file again and a `stigmer auth login` in
107
+ * another terminal takes effect on it.
108
+ *
109
+ * `STIGMER_API_KEY` is not consulted: a given key is used instead of this
110
+ * source, never through it.
111
+ */
112
+ export function createBackendTokenSource(backendName, endpoint) {
113
+ return createTokenCache(async () => {
114
+ const entry = load().backends?.[backendName];
115
+ if (entry === undefined || entry.type !== "cloud" || cloudEndpoint(entry) !== endpoint) {
116
+ return null;
117
+ }
118
+ const fresh = await freshCloudToken(entry, (next) => persistRefreshedTokens(backendName, endpoint, next));
119
+ if (fresh === null)
120
+ return null;
121
+ const expiresAtMs = Date.parse(fresh.expiresAt ?? "");
122
+ return {
123
+ accessToken: fresh.accessToken,
124
+ expiresAt: Number.isNaN(expiresAtMs) ? Date.now() + NO_EXPIRY_REREAD_MS : expiresAtMs,
125
+ };
126
+ });
127
+ }
128
+ /** The address a cloud entry is dialed at: its own, else Stigmer Cloud's. */
129
+ function cloudEndpoint(entry) {
130
+ return entry.endpoint !== undefined && entry.endpoint !== ""
131
+ ? entry.endpoint
132
+ : DEFAULT_CLOUD_ENDPOINT;
133
+ }
134
+ /**
135
+ * The cloud entry's access token, refreshed first when it is missing or
136
+ * expired and a refresh token is stored. A refresh sets the new token set into
137
+ * `entry` and hands it to `persist`. A refused refresh (a revoked or expired
138
+ * sign-in) answers the current token, if any: the server rejects it and the
139
+ * person is told to sign in again.
140
+ */
141
+ async function freshCloudToken(entry, persist) {
142
+ const current = entry.token === undefined || entry.token === ""
143
+ ? null
144
+ : { accessToken: entry.token, expiresAt: entry.token_expiry };
145
+ if (current !== null && !isExpired(entry.token_expiry))
146
+ return current;
147
+ if (entry.refresh_token === undefined || entry.refresh_token === "")
148
+ return current;
69
149
  let next;
70
150
  try {
71
- next = await refreshAccessToken(refreshToken);
151
+ next = await refreshAccessToken(entry.refresh_token);
72
152
  }
73
153
  catch {
74
- // Refresh failed (revoked/expired refresh token). Fall back to the current
75
- // token if any; the server will reject it and the user is prompted to log in.
76
- return entry.token ?? null;
154
+ return current;
77
155
  }
156
+ applyTokenSet(entry, next);
157
+ persist(next);
158
+ return { accessToken: next.accessToken, expiresAt: next.expiresAt };
159
+ }
160
+ /**
161
+ * Write a refreshed token set into the file as it is on disk now, patching
162
+ * only the token fields of `backendName`, and only while that entry is still
163
+ * the cloud backend at `endpoint`: a backend removed or re-pointed meanwhile
164
+ * is left as the person left it.
165
+ */
166
+ function persistRefreshedTokens(backendName, endpoint, next) {
167
+ const config = load();
168
+ const entry = config.backends?.[backendName];
169
+ if (entry === undefined || entry.type !== "cloud" || cloudEndpoint(entry) !== endpoint)
170
+ return;
171
+ applyTokenSet(entry, next);
172
+ save(config);
173
+ }
174
+ function applyTokenSet(entry, next) {
78
175
  entry.token = next.accessToken;
79
176
  if (next.refreshToken !== undefined)
80
177
  entry.refresh_token = next.refreshToken;
81
178
  entry.token_expiry = next.expiresAt;
82
- save(config);
83
- return next.accessToken;
84
179
  }
85
180
  function isExpired(expiresAt) {
86
- // Legacy tokens persisted without an expiry are assumed valid; the server is
87
- // the ultimate authority and a 401 triggers re-login.
181
+ // A token stored without an expiry (a pasted token or key carries none) is
182
+ // assumed valid; the server is the ultimate authority and a 401 triggers
183
+ // re-login.
88
184
  if (expiresAt === undefined || expiresAt === "")
89
185
  return false;
90
186
  const expiryMs = Date.parse(expiresAt);
package/auth/token.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"token.js","sourceRoot":"","sources":["../src/auth/token.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6EAA6E;AAG7E,OAAO,EAGL,aAAa,EACb,IAAI,GACL,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAW/D,4EAA4E;AAC5E,+BAA+B;AAC/B,MAAM,cAAc,GAAG,MAAM,CAAC;AAU9B,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAGlC;IACC,OAAO,SAAS,CAAC;QACf,UAAU,EAAE,oBAAoB;QAChC,SAAS,EAAE,SAAS;QACpB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,YAAY,EAAE,WAAW,EAAE;QAC3B,aAAa,EAAE,MAAM,CAAC,YAAY;KACnC,CAAC,CAAC;AACL,CAAC;AAED,yDAAyD;AACzD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,YAAoB;IAEpB,OAAO,SAAS,CAAC;QACf,UAAU,EAAE,eAAe;QAC3B,SAAS,EAAE,SAAS;QACpB,aAAa,EAAE,YAAY;KAC5B,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,6BAA6B,CAAC,MA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KAAK,MAAM,EAAgB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AACzH,OAAO,EAEL,KAAK,UAAU,EACf,OAAO,EACP,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,KAAK,MAAM,EAIZ,MAAM,oBAAoB,CAAC;AAI5B,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,UAAU,CAAC,IAAI,SAAS,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,8EAA8E;IAC9E,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C;;;;OAIG;IACH,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC;;;;OAIG;IACH,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAChC;AAID,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,oBAAyB,GACjC,aAAa,CAkDf"}
package/client/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Backend client façade.
2
2
  //
3
- // Builds a single transport (via the SDK's createNodeTransport + the Go-parity
3
+ // Builds a single transport (via the SDK's createNodeTransport +
4
4
  // normalizeEndpoint) and exposes:
5
5
  // - `stigmer`: the high-level typed client, used by read verbs.
6
6
  // - `transport` + `controller(service)`: the raw Connect layer, so write
@@ -17,16 +17,21 @@
17
17
  //
18
18
  // This module holds no business logic: backend selection, token precedence, and
19
19
  // endpoint shape are delegated to the config layer; org resolution and verb
20
- // dispatch live with the commands and the registry.
20
+ // dispatch live with the commands and the registry. It records the address
21
+ // it dials, and where that came from, in runtime.ts, so an error names the
22
+ // address actually tried (errors/classify.ts).
21
23
  import { createClient } from "@connectrpc/connect";
22
24
  import { isResourceAvailable, Stigmer, } from "@stigmer/client";
23
25
  import { createNodeTransport, normalizeEndpoint } from "@stigmer/client/node";
24
- import { load, resolveEndpoint, resolveToken, } from "../config/index.js";
25
- import { CliExitError, ExitCode } from "../errors/index.js";
26
+ import { load, resolveServerAddress, resolveToken, } from "../config/index.js";
27
+ import { cannotConnect, CliExitError, ExitCode } from "../errors/index.js";
28
+ import { setServerAddress } from "../runtime.js";
26
29
  const DEFAULT_CONNECT_TIMEOUT_MS = 10_000;
27
30
  export function createBackendClient(options = {}) {
28
31
  const config = options.config ?? load();
29
- const baseUrl = normalizeEndpoint(resolveEndpoint(config));
32
+ const address = resolveServerAddress(config);
33
+ setServerAddress(address);
34
+ const baseUrl = normalizeEndpoint(address.address);
30
35
  // Dynamic provider: re-reads env/config on every request so a token refreshed
31
36
  // mid-session is picked up. STIGMER_API_KEY > config token precedence lives in
32
37
  // resolveToken; a caller-supplied provider (refresh-aware) takes over entirely.
@@ -56,7 +61,7 @@ export function createBackendClient(options = {}) {
56
61
  return createClient(service, transport);
57
62
  },
58
63
  async connect(timeoutMs = DEFAULT_CONNECT_TIMEOUT_MS) {
59
- await withTimeout(probeServerInfo(), timeoutMs);
64
+ await withTimeout(probeServerInfo(), timeoutMs, address);
60
65
  },
61
66
  serverInfo: probeServerInfo,
62
67
  async isResourceAvailable(kind) {
@@ -66,10 +71,18 @@ export function createBackendClient(options = {}) {
66
71
  }
67
72
  // Soft timeout: races the RPC against a timer. It cannot cancel the underlying
68
73
  // request, but the CLI exits immediately after, so the dangling call is moot.
69
- async function withTimeout(promise, timeoutMs) {
74
+ // A server that does not answer in time could not be reached: the timeout
75
+ // says so in the same words, with the address and how long it waited.
76
+ async function withTimeout(promise, timeoutMs, address) {
70
77
  let timer;
71
78
  const timeout = new Promise((_, reject) => {
72
- timer = setTimeout(() => reject(new CliExitError("Timed out connecting to the Stigmer server", ExitCode.Connection)), timeoutMs);
79
+ timer = setTimeout(() => {
80
+ const failure = cannotConnect(address);
81
+ reject(new CliExitError(failure.message, ExitCode.Connection, [
82
+ `It did not answer within ${timeoutMs / 1000} seconds.`,
83
+ ...failure.hints,
84
+ ]));
85
+ }, timeoutMs);
73
86
  });
74
87
  try {
75
88
  return await Promise.race([promise, timeout]);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client/client.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,EAAE;AACF,+EAA+E;AAC/E,kCAAkC;AAClC,kEAAkE;AAClE,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,yEAAyE;AACzE,0DAA0D;AAC1D,6EAA6E;AAC7E,uCAAuC;AACvC,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,oDAAoD;AAGpD,OAAO,EAAe,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EACL,mBAAmB,EAEnB,OAAO,GAER,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAEL,IAAI,EACJ,eAAe,EACf,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;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AAC;QACT,IAAI,KAAK,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * Whether a command is hidden from help and the docs. Commander has no
4
+ * public getter; the internal `_hidden` flag (set via
5
+ * `.command(name, { hidden: true })`) is the only signal.
6
+ */
7
+ export declare function isHidden(cmd: Command): boolean;
8
+ /**
9
+ * Whether a command runs an action of its own (`stigmer up`), rather than only
10
+ * dispatching to its subcommands (`stigmer config`). Commander keeps the
11
+ * handler in the internal `_actionHandler`, null until `.action()` is called.
12
+ */
13
+ export declare function hasOwnAction(cmd: Command): boolean;
14
+ /** A positional argument as commander registers it. */
15
+ export interface RegisteredArgument {
16
+ name(): string;
17
+ required: boolean;
18
+ variadic: boolean;
19
+ }
20
+ /**
21
+ * A command's positional arguments. They were renamed from `_args` to
22
+ * `registeredArguments` in commander v11; the public field is read first.
23
+ */
24
+ export declare function registeredArguments(cmd: Command): RegisteredArgument[];
25
+ /** A command's full path from the root, as typed: `stigmer agent versions`. */
26
+ export declare function commandPath(cmd: Command): string;
27
+ /** The root's commands a person sees, in registration order: neither hidden nor commander's own `help`. */
28
+ export declare function documentedCommands(program: Command): Command[];
29
+ /** A command's subcommands a person sees, by name. */
30
+ export declare function visibleSubcommands(cmd: Command): Command[];
31
+ /**
32
+ * Every command a person runs: each visible command with no visible
33
+ * subcommands of its own, depth first, by path. A group (`stigmer agent`)
34
+ * that only dispatches is not one; its leaves are.
35
+ */
36
+ export declare function leafCommands(program: Command): Command[];
37
+ /** Whether a command takes the long option `long` (`--output`) itself, not through its parent. */
38
+ export declare function takesOption(cmd: Command, long: string): boolean;
39
+ /**
40
+ * Every command a person can run, depth first, by path: each leaf, and each
41
+ * group with an action of its own (`stigmer up` runs, and `stigmer up
42
+ * server` is its leaf). A rule over what a command takes walks these, so a
43
+ * runnable group is held like a leaf.
44
+ */
45
+ export declare function runnableCommands(program: Command): Command[];
46
+ /** Every command in the tree, the root, hidden ones and commander's own `help` included, depth first. */
47
+ export declare function everyCommand(program: Command): Command[];
48
+ /** A command's short example for its help: the line to type, and what it does in a few words. */
49
+ export interface HelpExample {
50
+ /** What the line does, lowercase, no closing period: "get an agent by slug". */
51
+ readonly say: string;
52
+ /** The line as a person types it, starting with `stigmer`. */
53
+ readonly run: string;
54
+ }
55
+ /** Declare a command's examples, printed under "Examples:" after its options. */
56
+ export declare function examples(cmd: Command, list: readonly HelpExample[]): Command;
57
+ /** A command's declared examples; none when it declares none. */
58
+ export declare function helpExamples(cmd: Command): readonly HelpExample[];
59
+ /** The examples as help prints them: each line, then what it does beneath it. */
60
+ export declare function formatExamples(list: readonly HelpExample[]): string;
61
+ /** The help group a top-level command sits in, without the heading's colon; "" when it names none. */
62
+ export declare function helpGroupOf(cmd: Command): string;
63
+ //# sourceMappingURL=command-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-tree.d.ts","sourceRoot":"","sources":["src/command-tree.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGlD;AAED,uDAAuD;AACvD,MAAM,WAAW,kBAAkB;IACjC,IAAI,IAAI,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAGtE;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAQhD;AAED,2GAA2G;AAC3G,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAE9D;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,CAI1D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CASxD;AAED,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAS5D;AAED,yGAAyG;AACzG,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAQxD;AAED,iGAAiG;AACjG,MAAM,WAAW,WAAW;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAID,iFAAiF;AACjF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAG5E;AAED,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,WAAW,EAAE,CAEjE;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAEnE;AAED,sGAAsG;AACtG,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEhD"}
@@ -0,0 +1,128 @@
1
+ // Reads the commander command tree the CLI builds (buildProgram): which
2
+ // commands a person sees, where each sits, what arguments and options it
3
+ // takes. One walker serves every reader of the tree, the docs generator
4
+ // (scripts/gen-cli-docs.ts) and the tests that hold rules over every
5
+ // command, so a rule and the reference pages can never disagree about which
6
+ // commands exist.
7
+ //
8
+ // Commander (v15) exposes neither a command's hidden flag, nor whether a
9
+ // command has an action of its own, nor, before v11, its positional
10
+ // arguments publicly; the three readers below (`isHidden`, `hasOwnAction`,
11
+ // `registeredArguments`) are the only places that reach past its public
12
+ // surface.
13
+ /**
14
+ * Whether a command is hidden from help and the docs. Commander has no
15
+ * public getter; the internal `_hidden` flag (set via
16
+ * `.command(name, { hidden: true })`) is the only signal.
17
+ */
18
+ export function isHidden(cmd) {
19
+ return cmd._hidden === true;
20
+ }
21
+ /**
22
+ * Whether a command runs an action of its own (`stigmer up`), rather than only
23
+ * dispatching to its subcommands (`stigmer config`). Commander keeps the
24
+ * handler in the internal `_actionHandler`, null until `.action()` is called.
25
+ */
26
+ export function hasOwnAction(cmd) {
27
+ const handler = cmd._actionHandler;
28
+ return handler !== undefined && handler !== null;
29
+ }
30
+ /**
31
+ * A command's positional arguments. They were renamed from `_args` to
32
+ * `registeredArguments` in commander v11; the public field is read first.
33
+ */
34
+ export function registeredArguments(cmd) {
35
+ const c = cmd;
36
+ return c.registeredArguments ?? c._args ?? [];
37
+ }
38
+ /** A command's full path from the root, as typed: `stigmer agent versions`. */
39
+ export function commandPath(cmd) {
40
+ const parts = [];
41
+ let current = cmd;
42
+ while (current) {
43
+ parts.unshift(current.name());
44
+ current = current.parent;
45
+ }
46
+ return parts.join(" ");
47
+ }
48
+ /** The root's commands a person sees, in registration order: neither hidden nor commander's own `help`. */
49
+ export function documentedCommands(program) {
50
+ return program.commands.filter((cmd) => !isHidden(cmd) && cmd.name() !== "help");
51
+ }
52
+ /** A command's subcommands a person sees, by name. */
53
+ export function visibleSubcommands(cmd) {
54
+ return cmd.commands
55
+ .filter((sub) => !isHidden(sub) && sub.name() !== "help")
56
+ .sort((a, b) => a.name().localeCompare(b.name()));
57
+ }
58
+ /**
59
+ * Every command a person runs: each visible command with no visible
60
+ * subcommands of its own, depth first, by path. A group (`stigmer agent`)
61
+ * that only dispatches is not one; its leaves are.
62
+ */
63
+ export function leafCommands(program) {
64
+ const leaves = [];
65
+ const visit = (cmd) => {
66
+ const subs = visibleSubcommands(cmd);
67
+ if (subs.length === 0)
68
+ leaves.push(cmd);
69
+ for (const sub of subs)
70
+ visit(sub);
71
+ };
72
+ for (const cmd of documentedCommands(program))
73
+ visit(cmd);
74
+ return leaves.sort((a, b) => commandPath(a).localeCompare(commandPath(b)));
75
+ }
76
+ /** Whether a command takes the long option `long` (`--output`) itself, not through its parent. */
77
+ export function takesOption(cmd, long) {
78
+ return cmd.options.some((option) => option.long === long);
79
+ }
80
+ /**
81
+ * Every command a person can run, depth first, by path: each leaf, and each
82
+ * group with an action of its own (`stigmer up` runs, and `stigmer up
83
+ * server` is its leaf). A rule over what a command takes walks these, so a
84
+ * runnable group is held like a leaf.
85
+ */
86
+ export function runnableCommands(program) {
87
+ const runnable = [];
88
+ const visit = (cmd) => {
89
+ const subs = visibleSubcommands(cmd);
90
+ if (subs.length === 0 || hasOwnAction(cmd))
91
+ runnable.push(cmd);
92
+ for (const sub of subs)
93
+ visit(sub);
94
+ };
95
+ for (const cmd of documentedCommands(program))
96
+ visit(cmd);
97
+ return runnable.sort((a, b) => commandPath(a).localeCompare(commandPath(b)));
98
+ }
99
+ /** Every command in the tree, the root, hidden ones and commander's own `help` included, depth first. */
100
+ export function everyCommand(program) {
101
+ const all = [];
102
+ const visit = (cmd) => {
103
+ all.push(cmd);
104
+ for (const sub of cmd.commands)
105
+ visit(sub);
106
+ };
107
+ visit(program);
108
+ return all;
109
+ }
110
+ const EXAMPLES = new WeakMap();
111
+ /** Declare a command's examples, printed under "Examples:" after its options. */
112
+ export function examples(cmd, list) {
113
+ EXAMPLES.set(cmd, list);
114
+ return cmd.addHelpText("after", formatExamples(list));
115
+ }
116
+ /** A command's declared examples; none when it declares none. */
117
+ export function helpExamples(cmd) {
118
+ return EXAMPLES.get(cmd) ?? [];
119
+ }
120
+ /** The examples as help prints them: each line, then what it does beneath it. */
121
+ export function formatExamples(list) {
122
+ return ["", "Examples:", ...list.flatMap((example) => [` ${example.run}`, ` ${example.say}`])].join("\n");
123
+ }
124
+ /** The help group a top-level command sits in, without the heading's colon; "" when it names none. */
125
+ export function helpGroupOf(cmd) {
126
+ return cmd.helpGroup().replace(/:$/, "");
127
+ }
128
+ //# sourceMappingURL=command-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-tree.js","sourceRoot":"","sources":["src/command-tree.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,qEAAqE;AACrE,4EAA4E;AAC5E,kBAAkB;AAClB,EAAE;AACF,yEAAyE;AACzE,oEAAoE;AACpE,2EAA2E;AAC3E,wEAAwE;AACxE,WAAW;AAIX;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAY;IACnC,OAAQ,GAAwC,CAAC,OAAO,KAAK,IAAI,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,MAAM,OAAO,GAAI,GAA+C,CAAC,cAAc,CAAC;IAChF,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,CAAC;AACnD,CAAC;AASD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,MAAM,CAAC,GAAG,GAA8F,CAAC;IACzG,OAAO,CAAC,CAAC,mBAAmB,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAmB,GAAG,CAAC;IAClC,OAAO,OAAO,EAAE,CAAC;QACf,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC3B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAA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Q,GAAG,IAAI,OAAO,EAAmC,CAAC;AAEhE,iFAAiF;AACjF,MAAM,UAAU,QAAQ,CAAC,GAAY,EAAE,IAA4B;IACjE,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxB,OAAO,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,IAA4B;IACzD,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClH,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,OAAO,GAAG,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/access-history/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsD5D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/access-history/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0D5D"}