@stigmer/cli 0.1.3 → 0.3.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 (270) hide show
  1. package/auth/browser.d.ts +7 -0
  2. package/auth/browser.d.ts.map +1 -0
  3. package/auth/browser.js +49 -0
  4. package/auth/browser.js.map +1 -0
  5. package/auth/callback-server.d.ts +8 -3
  6. package/auth/callback-server.d.ts.map +1 -1
  7. package/auth/callback-server.js +53 -19
  8. package/auth/callback-server.js.map +1 -1
  9. package/auth/device.d.ts +23 -0
  10. package/auth/device.d.ts.map +1 -0
  11. package/auth/device.js +119 -0
  12. package/auth/device.js.map +1 -0
  13. package/auth/index.d.ts +4 -3
  14. package/auth/index.d.ts.map +1 -1
  15. package/auth/index.js +4 -3
  16. package/auth/index.js.map +1 -1
  17. package/auth/login.d.ts +49 -1
  18. package/auth/login.d.ts.map +1 -1
  19. package/auth/login.js +161 -51
  20. package/auth/login.js.map +1 -1
  21. package/auth/oidc.d.ts +67 -0
  22. package/auth/oidc.d.ts.map +1 -0
  23. package/auth/oidc.js +213 -0
  24. package/auth/oidc.js.map +1 -0
  25. package/auth/token.d.ts +17 -23
  26. package/auth/token.d.ts.map +1 -1
  27. package/auth/token.js +51 -60
  28. package/auth/token.js.map +1 -1
  29. package/client/client.d.ts.map +1 -1
  30. package/client/client.js +4 -1
  31. package/client/client.js.map +1 -1
  32. package/client/current-organization.d.ts +5 -0
  33. package/client/current-organization.d.ts.map +1 -0
  34. package/client/current-organization.js +15 -0
  35. package/client/current-organization.js.map +1 -0
  36. package/commands/apikey/index.d.ts +16 -1
  37. package/commands/apikey/index.d.ts.map +1 -1
  38. package/commands/apikey/index.js +81 -0
  39. package/commands/apikey/index.js.map +1 -1
  40. package/commands/app-handover.d.ts +17 -0
  41. package/commands/app-handover.d.ts.map +1 -0
  42. package/commands/app-handover.js +168 -0
  43. package/commands/app-handover.js.map +1 -0
  44. package/commands/auth/index.d.ts.map +1 -1
  45. package/commands/auth/index.js +15 -9
  46. package/commands/auth/index.js.map +1 -1
  47. package/commands/auth/login.d.ts +7 -2
  48. package/commands/auth/login.d.ts.map +1 -1
  49. package/commands/auth/login.js +26 -23
  50. package/commands/auth/login.js.map +1 -1
  51. package/commands/auth/whoami.d.ts +15 -0
  52. package/commands/auth/whoami.d.ts.map +1 -1
  53. package/commands/auth/whoami.js +72 -2
  54. package/commands/auth/whoami.js.map +1 -1
  55. package/commands/coding-agent.d.ts +5 -0
  56. package/commands/coding-agent.d.ts.map +1 -0
  57. package/commands/coding-agent.js +30 -0
  58. package/commands/coding-agent.js.map +1 -0
  59. package/commands/config/backend.js +20 -6
  60. package/commands/config/backend.js.map +1 -1
  61. package/commands/docs/index.d.ts +9 -0
  62. package/commands/docs/index.d.ts.map +1 -0
  63. package/commands/docs/index.js +64 -0
  64. package/commands/docs/index.js.map +1 -0
  65. package/commands/embedding.d.ts +28 -0
  66. package/commands/embedding.d.ts.map +1 -0
  67. package/commands/embedding.js +170 -0
  68. package/commands/embedding.js.map +1 -0
  69. package/commands/example.d.ts +20 -0
  70. package/commands/example.d.ts.map +1 -0
  71. package/commands/example.js +136 -0
  72. package/commands/example.js.map +1 -0
  73. package/commands/help.d.ts.map +1 -1
  74. package/commands/help.js +19 -3
  75. package/commands/help.js.map +1 -1
  76. package/commands/list.d.ts.map +1 -1
  77. package/commands/list.js +13 -1
  78. package/commands/list.js.map +1 -1
  79. package/commands/load-test/burst.d.ts +64 -0
  80. package/commands/load-test/burst.d.ts.map +1 -0
  81. package/commands/load-test/burst.js +202 -0
  82. package/commands/load-test/burst.js.map +1 -0
  83. package/commands/load-test/index.d.ts +37 -0
  84. package/commands/load-test/index.d.ts.map +1 -0
  85. package/commands/load-test/index.js +154 -0
  86. package/commands/load-test/index.js.map +1 -0
  87. package/commands/load-test/report.d.ts +98 -0
  88. package/commands/load-test/report.d.ts.map +1 -0
  89. package/commands/load-test/report.js +210 -0
  90. package/commands/load-test/report.js.map +1 -0
  91. package/commands/mcp-server.d.ts +3 -3
  92. package/commands/mcp-server.d.ts.map +1 -1
  93. package/commands/mcp-server.js +16 -7
  94. package/commands/mcp-server.js.map +1 -1
  95. package/commands/provider-key/index.d.ts.map +1 -1
  96. package/commands/provider-key/index.js +2 -2
  97. package/commands/provider-key/index.js.map +1 -1
  98. package/commands/setup.d.ts +17 -0
  99. package/commands/setup.d.ts.map +1 -1
  100. package/commands/setup.js +71 -1
  101. package/commands/setup.js.map +1 -1
  102. package/commands/status.d.ts.map +1 -1
  103. package/commands/status.js +4 -3
  104. package/commands/status.js.map +1 -1
  105. package/commands/up.d.ts.map +1 -1
  106. package/commands/up.js +67 -9
  107. package/commands/up.js.map +1 -1
  108. package/commands/usage.d.ts +15 -0
  109. package/commands/usage.d.ts.map +1 -1
  110. package/commands/usage.js +52 -2
  111. package/commands/usage.js.map +1 -1
  112. package/config/config.d.ts +14 -7
  113. package/config/config.d.ts.map +1 -1
  114. package/config/config.js +5 -1
  115. package/config/config.js.map +1 -1
  116. package/config/index.d.ts +2 -2
  117. package/config/index.d.ts.map +1 -1
  118. package/config/index.js +2 -2
  119. package/config/index.js.map +1 -1
  120. package/config/resolve.d.ts +14 -3
  121. package/config/resolve.d.ts.map +1 -1
  122. package/config/resolve.js +30 -6
  123. package/config/resolve.js.map +1 -1
  124. package/errors/classify.d.ts.map +1 -1
  125. package/errors/classify.js +10 -1
  126. package/errors/classify.js.map +1 -1
  127. package/errors/cli-exit-error.d.ts +3 -1
  128. package/errors/cli-exit-error.d.ts.map +1 -1
  129. package/errors/cli-exit-error.js +6 -2
  130. package/errors/cli-exit-error.js.map +1 -1
  131. package/errors/handle.d.ts +32 -5
  132. package/errors/handle.d.ts.map +1 -1
  133. package/errors/handle.js +67 -8
  134. package/errors/handle.js.map +1 -1
  135. package/local/daemon/components.d.ts +28 -1
  136. package/local/daemon/components.d.ts.map +1 -1
  137. package/local/daemon/components.js +64 -2
  138. package/local/daemon/components.js.map +1 -1
  139. package/local/daemon/host.d.ts.map +1 -1
  140. package/local/daemon/host.js +6 -2
  141. package/local/daemon/host.js.map +1 -1
  142. package/local/daemon/launch.d.ts +12 -4
  143. package/local/daemon/launch.d.ts.map +1 -1
  144. package/local/daemon/launch.js +49 -16
  145. package/local/daemon/launch.js.map +1 -1
  146. package/local/daemon/types.d.ts +9 -1
  147. package/local/daemon/types.d.ts.map +1 -1
  148. package/local/key-check.d.ts +20 -0
  149. package/local/key-check.d.ts.map +1 -0
  150. package/local/key-check.js +45 -0
  151. package/local/key-check.js.map +1 -0
  152. package/local/model-key-step.d.ts +63 -0
  153. package/local/model-key-step.d.ts.map +1 -0
  154. package/local/model-key-step.js +133 -0
  155. package/local/model-key-step.js.map +1 -0
  156. package/local/runtime/node.d.ts +12 -4
  157. package/local/runtime/node.d.ts.map +1 -1
  158. package/local/runtime/node.js +73 -27
  159. package/local/runtime/node.js.map +1 -1
  160. package/local/setup/prompt.d.ts.map +1 -1
  161. package/local/setup/prompt.js +22 -18
  162. package/local/setup/prompt.js.map +1 -1
  163. package/local/setup/wizard.d.ts +10 -0
  164. package/local/setup/wizard.d.ts.map +1 -1
  165. package/local/setup/wizard.js +40 -17
  166. package/local/setup/wizard.js.map +1 -1
  167. package/local/state/lock.d.ts.map +1 -1
  168. package/local/state/lock.js +123 -36
  169. package/local/state/lock.js.map +1 -1
  170. package/local/state/pidfile.d.ts +4 -0
  171. package/local/state/pidfile.d.ts.map +1 -1
  172. package/local/state/pidfile.js +12 -3
  173. package/local/state/pidfile.js.map +1 -1
  174. package/local/status.d.ts.map +1 -1
  175. package/local/status.js +62 -4
  176. package/local/status.js.map +1 -1
  177. package/package.json +13 -10
  178. package/program.d.ts.map +1 -1
  179. package/program.js +12 -0
  180. package/program.js.map +1 -1
  181. package/resources/get.js +1 -1
  182. package/resources/get.js.map +1 -1
  183. package/resources/provider-key.d.ts +7 -2
  184. package/resources/provider-key.d.ts.map +1 -1
  185. package/resources/provider-key.js +18 -3
  186. package/resources/provider-key.js.map +1 -1
  187. package/resources/run/stream.d.ts.map +1 -1
  188. package/resources/run/stream.js +2 -1
  189. package/resources/run/stream.js.map +1 -1
  190. package/resources/runs.d.ts +10 -3
  191. package/resources/runs.d.ts.map +1 -1
  192. package/resources/runs.js +22 -4
  193. package/resources/runs.js.map +1 -1
  194. package/resources/stream/render-plaintext.d.ts +3 -0
  195. package/resources/stream/render-plaintext.d.ts.map +1 -1
  196. package/resources/stream/render-plaintext.js +20 -2
  197. package/resources/stream/render-plaintext.js.map +1 -1
  198. package/resources/usage.d.ts +8 -0
  199. package/resources/usage.d.ts.map +1 -1
  200. package/resources/usage.js +37 -0
  201. package/resources/usage.js.map +1 -1
  202. package/resources/views/agent.d.ts.map +1 -1
  203. package/resources/views/agent.js +18 -2
  204. package/resources/views/agent.js.map +1 -1
  205. package/runtime.d.ts +9 -0
  206. package/runtime.d.ts.map +1 -1
  207. package/runtime.js +12 -1
  208. package/runtime.js.map +1 -1
  209. package/src/auth/browser.ts +57 -0
  210. package/src/auth/callback-server.ts +58 -22
  211. package/src/auth/device.ts +151 -0
  212. package/src/auth/index.ts +4 -3
  213. package/src/auth/login.ts +243 -67
  214. package/src/auth/oidc.ts +270 -0
  215. package/src/auth/token.ts +53 -90
  216. package/src/client/client.ts +4 -1
  217. package/src/client/current-organization.ts +27 -0
  218. package/src/commands/apikey/index.ts +85 -0
  219. package/src/commands/app-handover.ts +202 -0
  220. package/src/commands/auth/index.ts +16 -10
  221. package/src/commands/auth/login.ts +30 -23
  222. package/src/commands/auth/whoami.ts +80 -1
  223. package/src/commands/coding-agent.ts +33 -0
  224. package/src/commands/config/backend.ts +20 -6
  225. package/src/commands/docs/index.ts +65 -0
  226. package/src/commands/embedding.ts +209 -0
  227. package/src/commands/example.ts +157 -0
  228. package/src/commands/help.ts +19 -3
  229. package/src/commands/list.ts +14 -1
  230. package/src/commands/load-test/burst.ts +291 -0
  231. package/src/commands/load-test/index.ts +183 -0
  232. package/src/commands/load-test/report.ts +302 -0
  233. package/src/commands/mcp-server.ts +16 -8
  234. package/src/commands/provider-key/index.ts +7 -1
  235. package/src/commands/setup.ts +76 -2
  236. package/src/commands/status.ts +4 -3
  237. package/src/commands/up.ts +76 -10
  238. package/src/commands/usage.ts +55 -2
  239. package/src/config/config.ts +18 -8
  240. package/src/config/index.ts +2 -0
  241. package/src/config/resolve.ts +31 -6
  242. package/src/errors/classify.ts +10 -1
  243. package/src/errors/cli-exit-error.ts +6 -2
  244. package/src/errors/handle.ts +74 -8
  245. package/src/local/daemon/components.ts +66 -2
  246. package/src/local/daemon/host.ts +6 -2
  247. package/src/local/daemon/launch.ts +51 -16
  248. package/src/local/daemon/types.ts +9 -1
  249. package/src/local/key-check.ts +61 -0
  250. package/src/local/model-key-step.ts +164 -0
  251. package/src/local/runtime/node.ts +95 -30
  252. package/src/local/setup/prompt.ts +22 -18
  253. package/src/local/setup/wizard.ts +45 -18
  254. package/src/local/state/lock.ts +116 -35
  255. package/src/local/state/pidfile.ts +14 -3
  256. package/src/local/status.ts +69 -4
  257. package/src/program.ts +12 -0
  258. package/src/resources/get.ts +1 -1
  259. package/src/resources/provider-key.ts +24 -3
  260. package/src/resources/run/stream.ts +2 -1
  261. package/src/resources/runs.ts +36 -4
  262. package/src/resources/stream/render-plaintext.ts +20 -2
  263. package/src/resources/usage.ts +42 -0
  264. package/src/resources/views/agent.ts +19 -2
  265. package/src/runtime.ts +17 -1
  266. package/auth/auth0.d.ts +0 -19
  267. package/auth/auth0.d.ts.map +0 -1
  268. package/auth/auth0.js +0 -39
  269. package/auth/auth0.js.map +0 -1
  270. package/src/auth/auth0.ts +0 -43
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-key-step.d.ts","sourceRoot":"","sources":["../src/local/model-key-step.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAiB,KAAK,QAAQ,EA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AC7B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,8FAA8F;IAC9F,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AAOD;;;;GAIG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,cAAc,GAAG,OAAO,GAAG,OAAO,CAAC,GAClE,OAAO,CAAC;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,GAAG,SAAS,CAAC,CAoBzE;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAkCzF"}
@@ -0,0 +1,133 @@
1
+ // The model key step `stigmer up` and `stigmer setup` share: which key the
2
+ // local runner will send to Anthropic and where, whether Anthropic takes it,
3
+ // and, on a terminal, asking for one when there is none or the saved one is
4
+ // refused. It says why first, the same words the console's key step says
5
+ // (sdk/react's provider-presentation.ts), so a person meets one explanation on
6
+ // every face.
7
+ //
8
+ // Only a key Stigmer can judge is checked: the key the runner sends on the
9
+ // "key" route, or to a gateway that was handed one. A gateway with no key, a
10
+ // cloud backend (Vertex, Bedrock, Foundry) or the proxy authenticates some
11
+ // other way, and stays as before. The key checked is the one the runner gets:
12
+ // an exported ANTHROPIC_API_KEY wins over the saved one (llm-config.ts), so
13
+ // an exported key Anthropic refuses is never prompted over (a pasted key
14
+ // would not reach the runner); one line says what to do instead.
15
+ //
16
+ // Nothing is asked off a terminal or under `--json` and `--quiet` (CLI-05):
17
+ // there the check still runs, and the card says what it found.
18
+ import { resolveApiKey, setLlm } from "./llm-config.js";
19
+ import { providerReach } from "./provider-reach.js";
20
+ /** Where a person gets an Anthropic key (the console's link says the same). */
21
+ export const ANTHROPIC_KEYS_URL = "https://console.anthropic.com/settings/keys";
22
+ /** Why Stigmer asks for the key, then where to get one: the prompt's first lines. */
23
+ export const KEY_REASON_LINES = [
24
+ "Your agents think with a model. Stigmer uses your own Anthropic key,",
25
+ `so you pay Anthropic directly. Get one at ${ANTHROPIC_KEYS_URL}`,
26
+ ];
27
+ /** The prompt's own question. */
28
+ export const KEY_QUESTION = "Anthropic API key (Enter to skip)";
29
+ /** Cloud's sentence for a refused key, with what to do. */
30
+ export const KEY_REJECTED = "Anthropic rejected this key. Check that it is a valid, active API key";
31
+ /** Said on a terminal while a key already set is checked, which can take up to the check's timeout. */
32
+ export const KEY_CHECKING_SAVED = "Checking the Anthropic key with Anthropic…\n";
33
+ /** Said when Anthropic did not answer the check: the key is kept anyway. */
34
+ export const KEY_UNCHECKED = "Anthropic didn't answer, so the key is saved but not checked.";
35
+ /** Said once for an exported key Anthropic refuses, which no prompt can replace. */
36
+ export const ENV_KEY_REJECTED = "Anthropic rejected the key in ANTHROPIC_API_KEY. Export a working key, or unset it and run stigmer setup.";
37
+ /**
38
+ * Where the runner with environment `env` sends its Anthropic key, or null
39
+ * when it sends none Stigmer can judge (no key, a cloud backend, the proxy,
40
+ * or a gateway with no key).
41
+ */
42
+ export function anthropicKeyTarget(env) {
43
+ const anthropic = providerReach(env).find((entry) => entry.provider === "anthropic");
44
+ if (anthropic === undefined)
45
+ return null;
46
+ const key = env.ANTHROPIC_API_KEY?.trim() ?? "";
47
+ if (key === "")
48
+ return null;
49
+ if (anthropic.via === "key")
50
+ return { baseUrl: "" };
51
+ if (anthropic.via === "gateway")
52
+ return { baseUrl: env.ANTHROPIC_BASE_URL?.trim() ?? "" };
53
+ return null;
54
+ }
55
+ /** The environment the runner will get once `key` is the resolved Anthropic key. */
56
+ function withKey(env, key) {
57
+ return { ...env, ANTHROPIC_API_KEY: key };
58
+ }
59
+ /**
60
+ * Ask for a key until Anthropic takes it, does not answer, or the person
61
+ * presses Enter. Prints the reason and the link first, then one line per
62
+ * answer. Returns the key and its check, or undefined for a skip.
63
+ */
64
+ export async function askForKey(deps) {
65
+ deps.write(`\n${KEY_REASON_LINES.join("\n")}\n\n`);
66
+ for (;;) {
67
+ const key = (await deps.promptSecret(KEY_QUESTION)).trim();
68
+ if (key === "")
69
+ return undefined;
70
+ // The base a pasted key goes to is the one the shell already set.
71
+ const target = anthropicKeyTarget(withKey(deps.env, key));
72
+ if (target === null)
73
+ return { key, check: "unchecked" };
74
+ deps.write("Checking with Anthropic… ");
75
+ const check = await deps.check(key, target.baseUrl);
76
+ if (check === "accepted") {
77
+ deps.write("✓ accepted\n");
78
+ return { key, check };
79
+ }
80
+ if (check === "unchecked") {
81
+ deps.write(`\n${KEY_UNCHECKED}\n`);
82
+ return { key, check };
83
+ }
84
+ deps.write(`\n✗ ${KEY_REJECTED}, then paste it again, or press Enter to skip.\n`);
85
+ }
86
+ }
87
+ /**
88
+ * `stigmer up`'s step, run before the daemon starts on a terminal (so a key
89
+ * entered here reaches the runner in this start) and beside the start off
90
+ * one. Returns the check's outcome, or undefined when no key Stigmer can
91
+ * judge is set (the card then says what it says today).
92
+ */
93
+ export async function modelKeyStep(deps) {
94
+ const config = deps.loadConfig();
95
+ const key = resolveApiKey(config, deps.env);
96
+ const fromEnvironment = key !== "" && key === deps.env.ANTHROPIC_API_KEY;
97
+ const target = anthropicKeyTarget(withKey(deps.env, key));
98
+ let saved;
99
+ if (target !== null) {
100
+ // The check can take up to its timeout: a terminal says what it waits on.
101
+ if (deps.interactive)
102
+ deps.write(KEY_CHECKING_SAVED);
103
+ const check = await deps.check(key, target.baseUrl);
104
+ saved = { check, fromEnvironment };
105
+ if (check !== "rejected")
106
+ return saved;
107
+ if (fromEnvironment) {
108
+ if (deps.interactive)
109
+ deps.write(`${ENV_KEY_REJECTED}\n`);
110
+ return saved;
111
+ }
112
+ if (!deps.interactive)
113
+ return saved;
114
+ deps.write("\nAnthropic rejected the saved key.");
115
+ }
116
+ else {
117
+ // Ask only where a key would make Anthropic reachable and nothing reaches
118
+ // it yet: not over a keyless gateway, a cloud backend or the proxy, not
119
+ // over an exported key, and never off a terminal.
120
+ const reached = providerReach(withKey(deps.env, key)).some((entry) => entry.provider === "anthropic");
121
+ const keyWouldServe = !reached && anthropicKeyTarget(withKey(deps.env, "sk-ant-probe")) !== null;
122
+ if (!deps.interactive || key !== "" || !keyWouldServe)
123
+ return undefined;
124
+ }
125
+ const answer = await askForKey(deps);
126
+ if (answer === undefined)
127
+ return saved;
128
+ // The same section `stigmer setup` writes, read by the launch that follows.
129
+ deps.saveConfig(setLlm(deps.loadConfig(), { provider: "anthropic", api_key: answer.key }));
130
+ deps.write("Saved for this computer's agents.\n\n");
131
+ return { check: answer.check, fromEnvironment: false };
132
+ }
133
+ //# sourceMappingURL=model-key-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-key-step.js","sourceRoot":"","sources":["../src/local/model-key-step.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,+EAA+E;AAC/E,cAAc;AACd,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AACzE,iEAAiE;AACjE,EAAE;AACF,4EAA4E;AAC5E,+DAA+D;AAG/D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAiB,MAAM,qBAAqB,CAAC;AAEnE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,6CAA6C,CAAC;AAEhF,qFAAqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,sEAAsE;IACtE,6CAA6C,kBAAkB,EAAE;CACzD,CAAC;AAEX,iCAAiC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AAEhE,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAG,uEAAuE,CAAC;AAEpG,uGAAuG;AACvG,MAAM,CAAC,MAAM,kBAAkB,GAAG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AAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACpD,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AACzD,CAAC"}
@@ -6,12 +6,20 @@
6
6
  * runner-launch paths only (ensureRunner), never on ordinary CLI commands.
7
7
  */
8
8
  export declare function resolveNode(): string;
9
+ /** The server's supported Node range as npm's `engines` writes it: `>=22.19.0 <23 || >=24`. */
10
+ export declare const SERVER_NODE_RANGE: string;
11
+ /** The same range in words: "Node.js 22 (22.19 or newer) or Node.js 24 or newer". */
12
+ export declare const SERVER_NODE_FLOOR: string;
13
+ /** Whether `version` (`v22.19.0` or `22.19.0`) is on a line the server runs on. */
14
+ export declare function serverRunsOn(version: string): boolean;
9
15
  /**
10
16
  * Resolve the Node binary to launch the TS server with. Same
11
- * STIGMER_NODE_BIN/execPath resolution as {@link resolveNode}, but probes for
12
- * `node:sqlite` WITH FTS5 — the server's search index needs it and some Node
13
- * builds (e.g. 23.4) ship node:sqlite without it. Runs on server-launch paths
14
- * only (ensureServer).
17
+ * STIGMER_NODE_BIN/execPath resolution as {@link resolveNode}, but checks
18
+ * the binary's version against the server's supported lines first (a Node
19
+ * outside them is refused naming the version to install), then probes for
20
+ * `node:sqlite` WITH FTS5 — the server's search index needs it, and a Node
21
+ * build can ship node:sqlite without it. Runs on server-launch paths only
22
+ * (ensureServer).
15
23
  */
16
24
  export declare function resolveServerNode(): string;
17
25
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/local/runtime/node.ts"],"names":[],"mappings":"AA8DA;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAapC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAc1C"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/local/runtime/node.ts"],"names":[],"mappings":"AAoEA;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAapC;AAiBD,+FAA+F;AAC/F,eAAO,MAAM,iBAAiB,QAMhB,CAAC;AAEf,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,QAMhB,CAAC;AAEf,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAKrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CA8B1C"}
@@ -2,32 +2,38 @@
2
2
  // subprocesses.
3
3
  //
4
4
  // We reuse the very Node that is running the CLI (process.execPath). The CLI is
5
- // itself an npm package with `engines: node >= 22.13`, so a suitable Node is
6
- // always present by construction — there is deliberately no hermetic Node
7
- // download (keep the base install lean: nothing to acquire that the host
8
- // already guarantees). This is exactly what the conformance harness does
9
- // (`spawn(process.execPath, ...)`). An explicit STIGMER_NODE_BIN override is
10
- // honored and capability-checked for advanced/multi-runtime setups.
5
+ // itself an npm package whose `engines` is the server's range (Node 22 from
6
+ // 22.19, or 24 and later), so npm warns at install on a Node that cannot run
7
+ // the server — there is deliberately no hermetic Node download (keep the base
8
+ // install lean: nothing to acquire that the host already provides). This is
9
+ // exactly what the conformance harness does (`spawn(process.execPath, ...)`).
10
+ // An explicit STIGMER_NODE_BIN override is honored and checked the same way
11
+ // for advanced/multi-runtime setups.
11
12
  //
12
- // The gates are CAPABILITY probes, not version checks. Two probes, because the
13
- // two children need different sqlite capabilities:
13
+ // The runner's gate is a CAPABILITY probe; the server's is its declared
14
+ // version range, then a capability probe:
14
15
  //
15
16
  // - The RUNNER's durable local checkpointer imports Node's built-in
16
17
  // `node:sqlite`, available unflagged from 22.13 in the 22.x line and only
17
18
  // from 23.4 in the 23.x line — a gap (23.0–23.3) that a previous
18
19
  // version-table gate here missed, letting those Nodes through to crash at
19
- // runner boot with a raw ERR_UNKNOWN_BUILTIN_MODULE.
20
- // - The SERVER additionally needs `node:sqlite` compiled WITH FTS5 (its
21
- // search index; migration v3 creates an fts5 virtual table at boot). Node
22
- // 23.4 PROVIDES node:sqlite but its sqlite build LACKS FTS5 — the reason
23
- // the module-presence probe alone is insufficient
24
- // for the server. Probing "can this binary create an fts5 table?" directly
25
- // cannot drift; the version floors survive only in the error messages,
26
- // where staleness is harmless.
20
+ // runner boot with a raw ERR_UNKNOWN_BUILTIN_MODULE. Probing the module
21
+ // cannot drift; the runner's floors survive only in its error copy.
22
+ // - The SERVER declares the Nodes it runs on in its own `engines`
23
+ // (`backend/services/stigmer-server/package.json`), above the runner's:
24
+ // its outbound dialer loads undici, whose floor is 22.19, and the server
25
+ // supports 22.x and 24+. undici's need has no capability this resolver
26
+ // could probe without loading undici, so here the gate IS a version check,
27
+ // against `SERVER_NODE_LINES`, which a test holds equal to the server's
28
+ // declared range and to this package's own `engines`, so the two cannot
29
+ // drift apart. The server ALSO needs `node:sqlite` compiled WITH FTS5 (its
30
+ // search index; migration v3 creates an fts5 virtual table at boot), and
31
+ // that stays a capability probe: a Node in range whose sqlite build lacks
32
+ // FTS5 is refused by what it cannot do.
27
33
  //
28
34
  // The runner performs the module-presence probe on its own boot (see
29
35
  // backend/services/runner/src/preflight.ts); the server fails at migration
30
- // time. Both probes here exist to fail at resolve time with CLI-appropriate
36
+ // time. These gates exist to fail at resolve time with CLI-appropriate
31
37
  // guidance instead of a subprocess crash.
32
38
  import { execFileSync } from "node:child_process";
33
39
  import { CliExitError } from "../../errors/cli-exit-error.js";
@@ -75,24 +81,64 @@ export function resolveNode() {
75
81
  });
76
82
  return bin;
77
83
  }
84
+ /**
85
+ * The Node lines the server runs on, lowest accepted version first: each
86
+ * entry accepts its major from `minor`, and the last accepts every later
87
+ * major too. The one source for the server's floor in the CLI: the range
88
+ * string, the sentence and the check all derive from it, and a test holds
89
+ * the range equal to the server's `engines.node` and this package's own.
90
+ */
91
+ const SERVER_NODE_LINES = [
92
+ { major: 22, minor: 19 },
93
+ { major: 24, minor: 0 },
94
+ ];
95
+ /** Whether the line at `index` is the last, which accepts every later major too. */
96
+ const isLastLine = (index) => index === SERVER_NODE_LINES.length - 1;
97
+ /** The server's supported Node range as npm's `engines` writes it: `>=22.19.0 <23 || >=24`. */
98
+ export const SERVER_NODE_RANGE = SERVER_NODE_LINES.map(({ major, minor }, i) => isLastLine(i)
99
+ ? minor === 0
100
+ ? `>=${major}`
101
+ : `>=${major}.${minor}.0`
102
+ : `>=${major}.${minor}.0 <${major + 1}`).join(" || ");
103
+ /** The same range in words: "Node.js 22 (22.19 or newer) or Node.js 24 or newer". */
104
+ export const SERVER_NODE_FLOOR = SERVER_NODE_LINES.map(({ major, minor }, i) => isLastLine(i)
105
+ ? minor === 0
106
+ ? `Node.js ${major} or newer`
107
+ : `Node.js ${major}.${minor} or newer`
108
+ : `Node.js ${major} (${major}.${minor} or newer)`).join(" or ");
109
+ /** Whether `version` (`v22.19.0` or `22.19.0`) is on a line the server runs on. */
110
+ export function serverRunsOn(version) {
111
+ const [major = Number.NaN, minor = Number.NaN] = version.replace(/^v/, "").split(".").map(Number);
112
+ return SERVER_NODE_LINES.some((line, i) => (major === line.major && minor >= line.minor) || (isLastLine(i) && major > line.major));
113
+ }
78
114
  /**
79
115
  * Resolve the Node binary to launch the TS server with. Same
80
- * STIGMER_NODE_BIN/execPath resolution as {@link resolveNode}, but probes for
81
- * `node:sqlite` WITH FTS5 — the server's search index needs it and some Node
82
- * builds (e.g. 23.4) ship node:sqlite without it. Runs on server-launch paths
83
- * only (ensureServer).
116
+ * STIGMER_NODE_BIN/execPath resolution as {@link resolveNode}, but checks
117
+ * the binary's version against the server's supported lines first (a Node
118
+ * outside them is refused naming the version to install), then probes for
119
+ * `node:sqlite` WITH FTS5 — the server's search index needs it, and a Node
120
+ * build can ship node:sqlite without it. Runs on server-launch paths only
121
+ * (ensureServer).
84
122
  */
85
123
  export function resolveServerNode() {
86
124
  const bin = nodeCandidate();
125
+ const version = probeNodeVersion(bin);
126
+ if (version === null) {
127
+ throw new CliExitError(`could not run ${bin} to verify the stigmer server's Node requirements`, ExitCode.General, [`Ensure ${bin} is a working ${SERVER_NODE_FLOOR} runtime.`]);
128
+ }
129
+ if (!serverRunsOn(version)) {
130
+ throw new CliExitError(`Node at ${bin} (${version}) cannot run the stigmer server: it needs ${SERVER_NODE_FLOOR}`, ExitCode.General, [
131
+ "These are the Node lines the server is built and tested for; on 22.x its network client needs 22.19 or newer.",
132
+ `Install ${SERVER_NODE_FLOOR}, or point STIGMER_NODE_BIN at one.`,
133
+ ]);
134
+ }
87
135
  assertCapability(bin, NODE_SQLITE_FTS5_PROBE, {
88
136
  subject: "the stigmer server",
89
137
  capability: "the built-in node:sqlite module with FTS5",
90
- floor: "Node 22.13+ in the 22.x line (23.x builds lack FTS5)",
138
+ floor: SERVER_NODE_FLOOR,
91
139
  detail: [
92
- "The server's search index requires node:sqlite compiled with FTS5.",
93
- "The 22.x line from 22.13 is known-good; 23.x builds ship node:sqlite",
94
- "WITHOUT FTS5 and cannot run the server. Newer majors work if their",
95
- "sqlite build includes FTS5 — this probe is the authority.",
140
+ "The server's search index requires node:sqlite compiled with FTS5,",
141
+ "and this Node's sqlite build lacks it.",
96
142
  ],
97
143
  });
98
144
  return bin;
@@ -103,7 +149,7 @@ function nodeCandidate() {
103
149
  ? override
104
150
  : process.execPath;
105
151
  }
106
- /** Best-effort `--version` for error messages only; null when the spawn fails. */
152
+ /** The binary's `--version` (`v22.19.0`); null when the spawn fails. */
107
153
  function probeNodeVersion(bin) {
108
154
  try {
109
155
  const out = execFileSync(bin, ["--version"], {
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/local/runtime/node.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,gBAAgB;AAChB,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7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,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5D;AAED;uCACuC;AACvC,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C9D"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/local/setup/prompt.ts"],"names":[],"mappings":"AAMA,iFAAiF;AACjF,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGhE;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5D;AAED;uCACuC;AACvC,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgD9D"}
@@ -36,25 +36,29 @@ export function promptSecret(question) {
36
36
  process.stderr.write("\n");
37
37
  resolve(value);
38
38
  };
39
+ // One chunk can hold many keys: a paste, or a terminal driver typing a
40
+ // whole answer in one write, arrives with its Enter in the same chunk,
41
+ // so each character is read on its own and the first Enter finishes.
39
42
  const onData = (chunk) => {
40
- const char = chunk.toString("utf8");
41
- switch (char) {
42
- case "\n":
43
- case "\r":
44
- case "\u0004": // Ctrl-D
45
- finish();
46
- break;
47
- case "\u0003": // Ctrl-C
48
- stdin.setRawMode(false);
49
- process.stderr.write("\n");
50
- process.exit(130);
51
- break;
52
- case "\u007f": // Backspace
53
- case "\b":
54
- value = value.slice(0, -1);
55
- break;
56
- default:
57
- value += char;
43
+ for (const char of chunk.toString("utf8")) {
44
+ switch (char) {
45
+ case "\n":
46
+ case "\r":
47
+ case "\u0004": // Ctrl-D
48
+ finish();
49
+ return;
50
+ case "\u0003": // Ctrl-C
51
+ stdin.setRawMode(false);
52
+ process.stderr.write("\n");
53
+ process.exit(130);
54
+ return;
55
+ case "\u007f": // Backspace
56
+ case "\b":
57
+ value = value.slice(0, -1);
58
+ break;
59
+ default:
60
+ value += char;
61
+ }
58
62
  }
59
63
  };
60
64
  stdin.on("data", onData);
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/local/setup/prompt.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iFAAiF;AACjF,uEAAuE;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,QAAgB;IAC5C,MAAM,MAAM,GAAG,CAAC,MAAM,UAAU,CAAC,GAAG,QAAQ,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7E,OAAO,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,KAAK,CAAC;AAC5C,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;YAC/B,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;uCACuC;AACvC,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QACnE,OAAO,UAAU,CAAC,GAAG,QAAQ,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,MA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AAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Config } from "../../config/config.js";
2
2
  import { type LlmSettings } from "../llm-config.js";
3
+ import { type KeyStepDeps } from "../model-key-step.js";
3
4
  import { type OperatorSettings } from "../operator-config.js";
4
5
  /**
5
6
  * The providers `stigmer setup` accepts. This is the single source of truth
@@ -40,4 +41,13 @@ export declare function applyOperatorIdentity(config: Config, email: string, nam
40
41
  * env precedence makes a copy redundant); an empty entry is an explicit skip.
41
42
  */
42
43
  export declare function runInteractiveWizard(config: Config, env?: NodeJS.ProcessEnv): Promise<Config>;
44
+ /** What the interactive key step needs: the terminal and the check, which tests replace. */
45
+ export type WizardKeyDeps = Pick<KeyStepDeps, "env" | "promptSecret" | "write" | "check">;
46
+ /**
47
+ * The interactive key step: an exported key is used without prompting (and
48
+ * never persisted, env precedence makes a copy redundant), checked, and its
49
+ * answer said; otherwise the shared prompt asks until Anthropic takes a key,
50
+ * does not answer, or the person presses Enter, which skips.
51
+ */
52
+ export declare function runKeyStep(config: Config, deps: WizardKeyDeps): Promise<Config>;
43
53
  //# sourceMappingURL=wizard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../../src/local/setup/wizard.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,KAAK,WAAW,EAAU,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,uBAAuB,CAAC;AAG/B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,gCAAiC,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,MAAM,WAA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BAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,GAAE,eAAoB,GAAG,WAAW,GAAG,SAAS,CAK/G;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAE,eAAoB,GAAG,MAAM,CAExG;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAShG;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGzF;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhH;AAED,4FAA4F;AAC5F,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,cAAc,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC;AAE1F;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBrF"}
@@ -7,13 +7,17 @@
7
7
  // Setup saves the one key the Stigmer and Claude engines run the catalog's
8
8
  // models on, Anthropic's, so the interactive flow is a single API-key prompt
9
9
  // rather than a provider menu, followed by the skippable operator-identity
10
- // prompt (oss#796). The runner reaches the other providers (OpenAI, and
10
+ // prompt (oss#796). The key prompt is `stigmer up`'s (local/model-key-step.ts):
11
+ // it says why, checks the key with Anthropic, and asks again when Anthropic
12
+ // refuses it; an exported key is checked and its answer said. The runner reaches the other providers (OpenAI, and
11
13
  // Anthropic through Vertex, Bedrock, Foundry or a gateway) by settings
12
14
  // exported in the shell; local/provider-reach.ts says which it reaches. There
13
15
  // is no model concept here at all: the platform model registry owns the
14
16
  // execution default, and per-run overrides belong to `stigmer run --model`
15
17
  // (oss#314 removed the dead setup-level pin).
16
18
  import { setLlm } from "../llm-config.js";
19
+ import { checkAnthropicKey } from "../key-check.js";
20
+ import { anthropicKeyTarget, askForKey, ENV_KEY_REJECTED } from "../model-key-step.js";
17
21
  import { setOperator, validateOperatorIdentity, } from "../operator-config.js";
18
22
  import { promptLine, promptSecret } from "./prompt.js";
19
23
  /**
@@ -73,25 +77,44 @@ export function applyOperatorIdentity(config, email, name) {
73
77
  * env precedence makes a copy redundant); an empty entry is an explicit skip.
74
78
  */
75
79
  export async function runInteractiveWizard(config, env = process.env) {
76
- process.stderr.write("\nStigmer runs local agents on Anthropic Claude models.\n");
77
- process.stderr.write("The model is chosen automatically from the platform model registry.\n\n");
78
- let updated;
79
- if (env.ANTHROPIC_API_KEY) {
80
- process.stderr.write("Using ANTHROPIC_API_KEY from environment\n");
81
- updated = applyChoice(config, "anthropic");
80
+ const updated = await runKeyStep(config, {
81
+ env,
82
+ promptSecret,
83
+ write: (text) => process.stderr.write(text),
84
+ check: (key, baseUrl) => checkAnthropicKey(key, baseUrl),
85
+ });
86
+ return runOperatorIdentityStep(updated, env);
87
+ }
88
+ /**
89
+ * The interactive key step: an exported key is used without prompting (and
90
+ * never persisted, env precedence makes a copy redundant), checked, and its
91
+ * answer said; otherwise the shared prompt asks until Anthropic takes a key,
92
+ * does not answer, or the person presses Enter, which skips.
93
+ */
94
+ export async function runKeyStep(config, deps) {
95
+ deps.write("\nThe model is chosen automatically from the platform model registry.\n");
96
+ const exported = deps.env.ANTHROPIC_API_KEY ?? "";
97
+ if (exported !== "") {
98
+ const target = anthropicKeyTarget(deps.env);
99
+ const check = target === null ? undefined : await deps.check(exported, target.baseUrl);
100
+ deps.write(`Using ANTHROPIC_API_KEY from environment${check === undefined ? "" : ENV_CHECK_WORDS[check]}\n`);
101
+ if (check === "rejected")
102
+ deps.write(`${ENV_KEY_REJECTED}\n`);
103
+ return applyChoice(config, "anthropic");
82
104
  }
83
- else {
84
- const key = (await promptSecret("Enter your Anthropic API key (press Enter to skip)")).trim();
85
- if (key === "") {
86
- process.stderr.write("Skipped. Agents won't execute until a provider is configured (stigmer setup).\n");
87
- updated = applyChoice(config, "skip");
88
- }
89
- else {
90
- updated = applyChoice(config, "anthropic", { apiKey: key });
91
- }
105
+ const answer = await askForKey(deps);
106
+ if (answer === undefined) {
107
+ deps.write("Skipped. Agents won't execute until a provider is configured (stigmer setup).\n");
108
+ return applyChoice(config, "skip");
92
109
  }
93
- return runOperatorIdentityStep(updated, env);
110
+ return applyChoice(config, "anthropic", { apiKey: answer.key });
94
111
  }
112
+ /** What an exported key's check adds to its "Using" line. */
113
+ const ENV_CHECK_WORDS = {
114
+ accepted: " (checked with Anthropic just now)",
115
+ rejected: " (rejected by Anthropic)",
116
+ unchecked: " (not checked: Anthropic didn't answer)",
117
+ };
95
118
  /**
96
119
  * The operator-identity step (oss#796): opt-in, skippable, and env-aware in
97
120
  * the same way the API-key step is — an env-provided identity is used without
@@ -1 +1 @@
1
- {"version":3,"file":"wizard.js","sourceRoot":"","sources":["../../src/local/setup/wizard.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,wEAAwE;AACxE,uEAAuE;AACvE,8EAA8E;AAC9E,wEAAwE;AACxE,2EAA2E;AAC3E,8CAA8C;AAG9C,OAAO,EAAoB,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAEL,WAAW,EACX,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,MAAM,C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CAAC;IAClF,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,UAAU,CAAC,oCAAoC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE7E,IAAI,CAAC;QACH,OAAO,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,cAAc,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CACjG,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/local/state/lock.ts"],"names":[],"mappings":"AAmBA,0DAA0D;AAC1D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;CACjB;AAQD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAmBzD"}
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/local/state/lock.ts"],"names":[],"mappings":"AAyCA,0DAA0D;AAC1D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;CACjB;AAWD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAkCzD"}