@ora-ai/cli 0.23.0 → 0.25.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 (194) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +44 -13
  3. package/dist/agent-skills/skills-command.d.ts.map +1 -1
  4. package/dist/agent-skills/skills-command.js +2 -2
  5. package/dist/agent-skills/skills-command.js.map +1 -1
  6. package/dist/auth-commands.d.ts +25 -9
  7. package/dist/auth-commands.d.ts.map +1 -1
  8. package/dist/auth-commands.js +59 -49
  9. package/dist/auth-commands.js.map +1 -1
  10. package/dist/core/auth.d.ts +2 -2
  11. package/dist/core/auth.d.ts.map +1 -1
  12. package/dist/core/auth.js +5 -4
  13. package/dist/core/auth.js.map +1 -1
  14. package/dist/core/cli-arguments.d.ts +21 -0
  15. package/dist/core/cli-arguments.d.ts.map +1 -0
  16. package/dist/core/cli-arguments.js +53 -0
  17. package/dist/core/cli-arguments.js.map +1 -0
  18. package/dist/core/config.d.ts +10 -5
  19. package/dist/core/config.d.ts.map +1 -1
  20. package/dist/core/config.js +10 -7
  21. package/dist/core/config.js.map +1 -1
  22. package/dist/core/credentials/api-key-credential.d.ts +29 -0
  23. package/dist/core/credentials/api-key-credential.d.ts.map +1 -0
  24. package/dist/core/credentials/api-key-credential.js +58 -0
  25. package/dist/core/credentials/api-key-credential.js.map +1 -0
  26. package/dist/core/credentials/ci-oidc-credential.d.ts +44 -0
  27. package/dist/core/credentials/ci-oidc-credential.d.ts.map +1 -0
  28. package/dist/core/credentials/ci-oidc-credential.js +82 -0
  29. package/dist/core/credentials/ci-oidc-credential.js.map +1 -0
  30. package/dist/core/credentials/credential-chain.d.ts +25 -0
  31. package/dist/core/credentials/credential-chain.d.ts.map +1 -0
  32. package/dist/core/credentials/credential-chain.js +39 -0
  33. package/dist/core/credentials/credential-chain.js.map +1 -0
  34. package/dist/core/credentials/credential.d.ts +73 -0
  35. package/dist/core/credentials/credential.d.ts.map +1 -0
  36. package/dist/core/credentials/credential.js +9 -0
  37. package/dist/core/credentials/credential.js.map +1 -0
  38. package/dist/core/credentials/device-session-credential.d.ts +27 -0
  39. package/dist/core/credentials/device-session-credential.d.ts.map +1 -0
  40. package/dist/core/credentials/device-session-credential.js +78 -0
  41. package/dist/core/credentials/device-session-credential.js.map +1 -0
  42. package/dist/core/credentials/identity-lines.d.ts +14 -0
  43. package/dist/core/credentials/identity-lines.d.ts.map +1 -0
  44. package/dist/core/credentials/identity-lines.js +45 -0
  45. package/dist/core/credentials/identity-lines.js.map +1 -0
  46. package/dist/core/credentials/refusal-words.d.ts +15 -0
  47. package/dist/core/credentials/refusal-words.d.ts.map +1 -0
  48. package/dist/core/credentials/refusal-words.js +56 -0
  49. package/dist/core/credentials/refusal-words.js.map +1 -0
  50. package/dist/core/credentials/sign-in-areas.d.ts +18 -0
  51. package/dist/core/credentials/sign-in-areas.d.ts.map +1 -0
  52. package/dist/core/credentials/sign-in-areas.js +22 -0
  53. package/dist/core/credentials/sign-in-areas.js.map +1 -0
  54. package/dist/core/http.d.ts +10 -4
  55. package/dist/core/http.d.ts.map +1 -1
  56. package/dist/core/http.js +7 -5
  57. package/dist/core/http.js.map +1 -1
  58. package/dist/core/identity.d.ts +11 -0
  59. package/dist/core/identity.d.ts.map +1 -0
  60. package/dist/core/identity.js +21 -0
  61. package/dist/core/identity.js.map +1 -0
  62. package/dist/core/limit-story.d.ts +11 -0
  63. package/dist/core/limit-story.d.ts.map +1 -0
  64. package/dist/core/limit-story.js +16 -0
  65. package/dist/core/limit-story.js.map +1 -0
  66. package/dist/core/login.d.ts +5 -3
  67. package/dist/core/login.d.ts.map +1 -1
  68. package/dist/core/login.js +5 -3
  69. package/dist/core/login.js.map +1 -1
  70. package/dist/core/oauth/metadata.d.ts +24 -0
  71. package/dist/core/oauth/metadata.d.ts.map +1 -0
  72. package/dist/core/oauth/metadata.js +99 -0
  73. package/dist/core/oauth/metadata.js.map +1 -0
  74. package/dist/core/oauth/oauth-client.d.ts +70 -0
  75. package/dist/core/oauth/oauth-client.d.ts.map +1 -0
  76. package/dist/core/oauth/oauth-client.js +136 -0
  77. package/dist/core/oauth/oauth-client.js.map +1 -0
  78. package/dist/core/oauth/oauth-error.d.ts +18 -0
  79. package/dist/core/oauth/oauth-error.d.ts.map +1 -0
  80. package/dist/core/oauth/oauth-error.js +31 -0
  81. package/dist/core/oauth/oauth-error.js.map +1 -0
  82. package/dist/core/oauth/sign-in-error.d.ts +15 -0
  83. package/dist/core/oauth/sign-in-error.d.ts.map +1 -0
  84. package/dist/core/oauth/sign-in-error.js +21 -0
  85. package/dist/core/oauth/sign-in-error.js.map +1 -0
  86. package/dist/core/oauth/sign-in-target.d.ts +31 -0
  87. package/dist/core/oauth/sign-in-target.d.ts.map +1 -0
  88. package/dist/core/oauth/sign-in-target.js +44 -0
  89. package/dist/core/oauth/sign-in-target.js.map +1 -0
  90. package/dist/core/output.d.ts +14 -3
  91. package/dist/core/output.d.ts.map +1 -1
  92. package/dist/core/output.js +38 -38
  93. package/dist/core/output.js.map +1 -1
  94. package/dist/core/retry-after.d.ts +8 -0
  95. package/dist/core/retry-after.d.ts.map +1 -0
  96. package/dist/core/retry-after.js +18 -0
  97. package/dist/core/retry-after.js.map +1 -0
  98. package/dist/core/run-operation.d.ts +26 -10
  99. package/dist/core/run-operation.d.ts.map +1 -1
  100. package/dist/core/run-operation.js +40 -21
  101. package/dist/core/run-operation.js.map +1 -1
  102. package/dist/core/session/device-session-auth.d.ts +29 -0
  103. package/dist/core/session/device-session-auth.d.ts.map +1 -0
  104. package/dist/core/session/device-session-auth.js +92 -0
  105. package/dist/core/session/device-session-auth.js.map +1 -0
  106. package/dist/core/session/file-lock.d.ts +33 -0
  107. package/dist/core/session/file-lock.d.ts.map +1 -0
  108. package/dist/core/session/file-lock.js +145 -0
  109. package/dist/core/session/file-lock.js.map +1 -0
  110. package/dist/core/session/session-refusals.d.ts +22 -0
  111. package/dist/core/session/session-refusals.d.ts.map +1 -0
  112. package/dist/core/session/session-refusals.js +23 -0
  113. package/dist/core/session/session-refusals.js.map +1 -0
  114. package/dist/core/session/session-store.d.ts +53 -0
  115. package/dist/core/session/session-store.d.ts.map +1 -0
  116. package/dist/core/session/session-store.js +71 -0
  117. package/dist/core/session/session-store.js.map +1 -0
  118. package/dist/core/sign-in.d.ts +2 -2
  119. package/dist/core/sign-in.js +2 -2
  120. package/dist/core/token-expiry.d.ts +9 -0
  121. package/dist/core/token-expiry.d.ts.map +1 -0
  122. package/dist/core/token-expiry.js +11 -0
  123. package/dist/core/token-expiry.js.map +1 -0
  124. package/dist/core/url.d.ts +5 -0
  125. package/dist/core/url.d.ts.map +1 -0
  126. package/dist/core/url.js +17 -0
  127. package/dist/core/url.js.map +1 -0
  128. package/dist/generated/operations.d.ts +2 -1
  129. package/dist/generated/operations.d.ts.map +1 -1
  130. package/dist/generated/operations.js +32 -5
  131. package/dist/generated/operations.js.map +1 -1
  132. package/dist/generated/types.d.ts +584 -0
  133. package/dist/generated/types.d.ts.map +1 -1
  134. package/dist/generated/types.js +1 -1
  135. package/dist/interactive/menu.d.ts.map +1 -1
  136. package/dist/interactive/menu.js +4 -2
  137. package/dist/interactive/menu.js.map +1 -1
  138. package/dist/interactive/session.d.ts.map +1 -1
  139. package/dist/interactive/session.js +17 -8
  140. package/dist/interactive/session.js.map +1 -1
  141. package/dist/login/browser-opener.d.ts +20 -0
  142. package/dist/login/browser-opener.d.ts.map +1 -0
  143. package/dist/login/browser-opener.js +43 -0
  144. package/dist/login/browser-opener.js.map +1 -0
  145. package/dist/login/device-flow.d.ts +60 -0
  146. package/dist/login/device-flow.d.ts.map +1 -0
  147. package/dist/login/device-flow.js +98 -0
  148. package/dist/login/device-flow.js.map +1 -0
  149. package/dist/login/device-login.d.ts +27 -0
  150. package/dist/login/device-login.d.ts.map +1 -0
  151. package/dist/login/device-login.js +148 -0
  152. package/dist/login/device-login.js.map +1 -0
  153. package/dist/login/device-presenter.d.ts +24 -0
  154. package/dist/login/device-presenter.d.ts.map +1 -0
  155. package/dist/login/device-presenter.js +69 -0
  156. package/dist/login/device-presenter.js.map +1 -0
  157. package/dist/login/login-command.d.ts +14 -0
  158. package/dist/login/login-command.d.ts.map +1 -0
  159. package/dist/login/login-command.js +73 -0
  160. package/dist/login/login-command.js.map +1 -0
  161. package/dist/login/login-deps.d.ts +17 -0
  162. package/dist/login/login-deps.d.ts.map +1 -0
  163. package/dist/login/login-deps.js +18 -0
  164. package/dist/login/login-deps.js.map +1 -0
  165. package/dist/login/piped-input.d.ts +23 -0
  166. package/dist/login/piped-input.d.ts.map +1 -0
  167. package/dist/login/piped-input.js +36 -0
  168. package/dist/login/piped-input.js.map +1 -0
  169. package/dist/login/requested-scopes.d.ts +22 -0
  170. package/dist/login/requested-scopes.d.ts.map +1 -0
  171. package/dist/login/requested-scopes.js +43 -0
  172. package/dist/login/requested-scopes.js.map +1 -0
  173. package/dist/program.d.ts +16 -5
  174. package/dist/program.d.ts.map +1 -1
  175. package/dist/program.js +35 -10
  176. package/dist/program.js.map +1 -1
  177. package/dist/study-ci/ci-command.d.ts.map +1 -1
  178. package/dist/study-ci/ci-command.js +2 -2
  179. package/dist/study-ci/ci-command.js.map +1 -1
  180. package/dist/study-ci/ci-rehearse-command.d.ts.map +1 -1
  181. package/dist/study-ci/ci-rehearse-command.js +2 -2
  182. package/dist/study-ci/ci-rehearse-command.js.map +1 -1
  183. package/dist/tunnel/connection-end.d.ts +30 -0
  184. package/dist/tunnel/connection-end.d.ts.map +1 -0
  185. package/dist/tunnel/connection-end.js +29 -0
  186. package/dist/tunnel/connection-end.js.map +1 -0
  187. package/dist/tunnel-command.d.ts.map +1 -1
  188. package/dist/tunnel-command.js +24 -8
  189. package/dist/tunnel-command.js.map +1 -1
  190. package/package.json +3 -2
  191. package/dist/core/credential-sources.d.ts +0 -45
  192. package/dist/core/credential-sources.d.ts.map +0 -1
  193. package/dist/core/credential-sources.js +0 -65
  194. package/dist/core/credential-sources.js.map +0 -1
@@ -0,0 +1,24 @@
1
+ /**
2
+ * How a device code reaches the person, per output mode (chosen once, by the factory below):
3
+ *
4
+ * - text (rich/plain): the link and the code, a note when an expired code was replaced, the one rule of approving
5
+ * (only a sign-in you started), and the browser opened on this machine when that can be the person's;
6
+ * - json: one JSON line per code on stdout — `{"event":"device_authorization", …}` — so an agent driving the CLI
7
+ * can show the link and code to the person it acts for, then wait for the command to finish.
8
+ *
9
+ * The code itself is not a secret (it is useless without the person's approval in their own signed-in browser),
10
+ * so printing it is the protocol, not a leak. What it must never be is approved by someone who did not ask for it:
11
+ * a link and code sent by anyone else signs THEIR terminal in as you — hence the rule, shown with every code.
12
+ */
13
+ import type { OutputMode } from "../render/mode.js";
14
+ import type { DevicePresenter } from "./device-flow.js";
15
+ /** Shown with every code. The approval page says the same on its side. */
16
+ export declare const APPROVE_ONLY_YOUR_OWN = "Approve only a sign-in you started yourself.";
17
+ export interface PresenterDeps {
18
+ out: (text: string) => void;
19
+ now: () => number;
20
+ /** Opens the link in a browser when allowed; returns whether it launched anything. */
21
+ open?: (url: string) => boolean;
22
+ }
23
+ export declare function devicePresenter(mode: OutputMode, deps: PresenterDeps): DevicePresenter;
24
+ //# sourceMappingURL=device-presenter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-presenter.d.ts","sourceRoot":"","sources":["../../src/login/device-presenter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,kBAAkB,CAAC;AAEtE,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,iDAAiD,CAAC;AAEpF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,sFAAsF;IACtF,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACjC;AAyDD,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,eAAe,CAEtF"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * How a device code reaches the person, per output mode (chosen once, by the factory below):
3
+ *
4
+ * - text (rich/plain): the link and the code, a note when an expired code was replaced, the one rule of approving
5
+ * (only a sign-in you started), and the browser opened on this machine when that can be the person's;
6
+ * - json: one JSON line per code on stdout — `{"event":"device_authorization", …}` — so an agent driving the CLI
7
+ * can show the link and code to the person it acts for, then wait for the command to finish.
8
+ *
9
+ * The code itself is not a secret (it is useless without the person's approval in their own signed-in browser),
10
+ * so printing it is the protocol, not a leak. What it must never be is approved by someone who did not ask for it:
11
+ * a link and code sent by anyone else signs THEIR terminal in as you — hence the rule, shown with every code.
12
+ */
13
+ import chalk from "chalk";
14
+ /** Shown with every code. The approval page says the same on its side. */
15
+ export const APPROVE_ONLY_YOUR_OWN = "Approve only a sign-in you started yourself.";
16
+ function minutesLeft(prompt, now) {
17
+ return Math.max(1, Math.round((prompt.expiresAt - now) / 60_000));
18
+ }
19
+ class TextPresenter {
20
+ deps;
21
+ constructor(deps) {
22
+ this.deps = deps;
23
+ }
24
+ show(prompt) {
25
+ const { out } = this.deps;
26
+ out(prompt.attempt === 1 ? "To sign in, open this link and confirm the code:" : "Here is a new code:");
27
+ out("");
28
+ out(` ${chalk.underline(prompt.link)}`);
29
+ out("");
30
+ out(` Code: ${chalk.bold(prompt.userCode)} ${chalk.dim(`(valid for ${minutesLeft(prompt, this.deps.now())} minutes)`)}`);
31
+ out("");
32
+ out(APPROVE_ONLY_YOUR_OWN);
33
+ const opened = this.deps.open?.(prompt.link) ?? false;
34
+ out(chalk.dim(opened ? "Opened your browser. Waiting for you to approve…" : "Waiting for you to approve in the browser…"));
35
+ }
36
+ expired() {
37
+ this.deps.out(chalk.yellow("That code expired before it was approved."));
38
+ }
39
+ approved() {
40
+ this.deps.out(chalk.green("Approved."));
41
+ }
42
+ }
43
+ class JsonPresenter {
44
+ deps;
45
+ constructor(deps) {
46
+ this.deps = deps;
47
+ }
48
+ show(prompt) {
49
+ this.deps.out(JSON.stringify({
50
+ event: "device_authorization",
51
+ userCode: prompt.userCode,
52
+ verificationUri: prompt.verificationUri,
53
+ verificationUriComplete: prompt.link,
54
+ expiresIn: Math.max(0, Math.round((prompt.expiresAt - this.deps.now()) / 1000)),
55
+ renewed: prompt.attempt > 1,
56
+ }));
57
+ this.deps.open?.(prompt.link);
58
+ }
59
+ expired(prompt) {
60
+ this.deps.out(JSON.stringify({ event: "device_code_expired", userCode: prompt.userCode }));
61
+ }
62
+ approved() {
63
+ // The caller's own success line follows; nothing to add.
64
+ }
65
+ }
66
+ export function devicePresenter(mode, deps) {
67
+ return mode === "json" ? new JsonPresenter(deps) : new TextPresenter(deps);
68
+ }
69
+ //# sourceMappingURL=device-presenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-presenter.js","sourceRoot":"","sources":["../../src/login/device-presenter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;AASpF,SAAS,WAAW,CAAC,MAAoB,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,aAAa;IACY;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,IAAI,CAAC,MAAoB;QACvB,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,GAAG,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC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M,CAAC,eAAe;YACvC,uBAAuB,EAAE,MAAM,CAAC,IAAI;YACpC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YAC/E,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,CAAC;SAC5B,CAAC,CACH,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,MAAoB;QAC1B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ;QACN,yDAAyD;IAC3D,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,IAAgB,EAAE,IAAmB;IACnE,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `ora login` — two ways in, one command:
3
+ *
4
+ * - a person at a terminal: browser sign-in (the device flow, RFC 8628). The browser opens Ora's sign-in page (a
5
+ * new person signs up there), they approve the CLI, and the CLI stays signed in, refreshing on its own.
6
+ * - CI and scripts: an api key, as before — `--api-key ora_sk_…`, `--api-key` alone (paste it masked), a key
7
+ * piped on stdin (`echo $KEY | ora login`), or `ORA_API_KEY` in the environment.
8
+ *
9
+ * A key always wins: the browser sign-in starts only when none was given any of those ways.
10
+ */
11
+ import type { Command } from "commander";
12
+ import type { ResolvedDeps } from "../program.js";
13
+ export declare function attachLogin(program: Command, deps: ResolvedDeps): void;
14
+ //# sourceMappingURL=login-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-command.d.ts","sourceRoot":"","sources":["../../src/login/login-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA8ClD,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAyBtE"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * `ora login` — two ways in, one command:
3
+ *
4
+ * - a person at a terminal: browser sign-in (the device flow, RFC 8628). The browser opens Ora's sign-in page (a
5
+ * new person signs up there), they approve the CLI, and the CLI stays signed in, refreshing on its own.
6
+ * - CI and scripts: an api key, as before — `--api-key ora_sk_…`, `--api-key` alone (paste it masked), a key
7
+ * piped on stdin (`echo $KEY | ora login`), or `ORA_API_KEY` in the environment.
8
+ *
9
+ * A key always wins: the browser sign-in starts only when none was given any of those ways.
10
+ */
11
+ import { performLogin } from "../auth-commands.js";
12
+ import { promptForKey } from "../core/login.js";
13
+ import { resolveOutputMode } from "../render/mode.js";
14
+ import { performDeviceLogin } from "./device-login.js";
15
+ const HELP = [
16
+ "",
17
+ "Signs you in through your browser. A new person signs up on the same page.",
18
+ "The CLI stays signed in on this machine until `ora logout`.",
19
+ "",
20
+ "Examples:",
21
+ " ora login # sign in with your browser",
22
+ " ora login --no-browser # print the link instead of opening it",
23
+ " ora login --read-only # ask for read permissions only",
24
+ " ora login --api-key ora_sk_… # an api key (CI, scripts)",
25
+ " ORA_API_KEY=ora_sk_… ora login # non-interactive (CI)",
26
+ " echo \"$KEY\" | ora login # a key piped on stdin",
27
+ " ora login --api-url http://api.ora.localhost:8081 # dev cluster",
28
+ ].join("\n");
29
+ /** Flags only a browser sign-in takes. With one of them the person asked for the browser, so stdin is left alone. */
30
+ const asksForBrowser = (opts) => Boolean(opts.json) || opts.browser === false || Boolean(opts.readOnly) || opts.authUrl !== undefined;
31
+ /**
32
+ * The api key this login was given, if any: the flag's value, a pasted one for a bare `--api-key`, the env's, or one
33
+ * piped on stdin. The pipe is read only when stdin is not a terminal and no browser flag was passed; a stdin that
34
+ * ends empty is no key, and the browser sign-in follows (piped-input.ts).
35
+ */
36
+ async function apiKeyOf(opts, deps) {
37
+ if (opts.apiKey === true)
38
+ return promptForKey();
39
+ const given = opts.apiKey ?? deps.env.ORA_API_KEY;
40
+ if (given !== undefined)
41
+ return given;
42
+ if (deps.stdinIsTty || asksForBrowser(opts))
43
+ return undefined;
44
+ const piped = await deps.login.readPipedInput();
45
+ return piped === "" ? undefined : piped;
46
+ }
47
+ export function attachLogin(program, deps) {
48
+ program
49
+ .command("login")
50
+ .description("Sign in through your browser, or store an api key (--api-key, ORA_API_KEY, or piped on stdin)")
51
+ .option("--api-key [key]", "sign in with an ora_sk_… api key instead (paste it when no value is given)")
52
+ .option("--api-url <url>", "override the API base URL")
53
+ .option("--auth-url <url>", "the sign-in server (default: account.<domain> of the API URL)")
54
+ .option("--read-only", "ask for read permissions only")
55
+ .option("--no-browser", "don't open a browser; print the link")
56
+ .option("--json", "JSON lines on stdout: the code to show, then who signed in (for agents)")
57
+ .addHelpText("after", HELP)
58
+ .action(async (opts) => {
59
+ const key = await apiKeyOf(opts, deps);
60
+ if (key !== undefined) {
61
+ await performLogin(deps, { apiKey: key, apiUrl: opts.apiUrl });
62
+ return;
63
+ }
64
+ await performDeviceLogin(deps, {
65
+ ...(opts.apiUrl ? { apiUrl: opts.apiUrl } : {}),
66
+ ...(opts.authUrl ? { authUrl: opts.authUrl } : {}),
67
+ readOnly: Boolean(opts.readOnly),
68
+ browser: opts.browser !== false,
69
+ mode: resolveOutputMode({ json: Boolean(opts.json) }, deps.env, deps.stdoutIsTty),
70
+ });
71
+ });
72
+ }
73
+ //# sourceMappingURL=login-command.js.map
@@ -0,0 +1 @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iBAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC;SAClF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The device sign-in's outside world, as one injectable seam: the network, the clock, waiting, and the browser.
3
+ * Tests replace any member (ProgramDeps.login); the CLI uses the real ones.
4
+ */
5
+ export interface LoginDeps {
6
+ fetchFn: typeof fetch;
7
+ now: () => number;
8
+ sleep: (ms: number) => Promise<void>;
9
+ /** Best effort; false when nothing was launched (the link is printed regardless). */
10
+ openUrl: (url: string) => boolean;
11
+ /** How many codes one sign-in shows before giving up: the first, plus renewals of expired ones. */
12
+ maxCodes: number;
13
+ /** What was piped into a bare `ora login` on a stdin that is not a terminal; "" when nothing was (piped-input.ts). */
14
+ readPipedInput: () => Promise<string>;
15
+ }
16
+ export declare function realLoginDeps(): LoginDeps;
17
+ //# sourceMappingURL=login-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-deps.d.ts","sourceRoot":"","sources":["../../src/login/login-deps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,KAAK,CAAC;IACtB,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,qFAAqF;IACrF,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAClC,mGAAmG;IACnG,QAAQ,EAAE,MAAM,CAAC;IACjB,sHAAsH;IACtH,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACvC;AAED,wBAAgB,aAAa,IAAI,SAAS,CAUzC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The device sign-in's outside world, as one injectable seam: the network, the clock, waiting, and the browser.
3
+ * Tests replace any member (ProgramDeps.login); the CLI uses the real ones.
4
+ */
5
+ import { openInBrowser } from "./browser-opener.js";
6
+ import { readPipedInput } from "./piped-input.js";
7
+ export function realLoginDeps() {
8
+ return {
9
+ // Late-bound, so a test that stubs the global fetch still reaches this.
10
+ fetchFn: (input, init) => fetch(input, init),
11
+ now: Date.now,
12
+ sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
13
+ openUrl: (url) => openInBrowser(url),
14
+ maxCodes: 4,
15
+ readPipedInput: () => readPipedInput(),
16
+ };
17
+ }
18
+ //# sourceMappingURL=login-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-deps.js","sourceRoot":"","sources":["../../src/login/login-deps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAclD,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,wEAAwE;QACxE,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC;QAC5C,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAChE,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,CAAC;QACX,cAAc,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE;KACvC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What was piped into a bare `ora login`. `echo $KEY | ora login` has always stored that key, and still does.
3
+ *
4
+ * A stdin that is not a terminal is read to its end. What it holds is the key. A stdin that ends empty (closed, or
5
+ * /dev/null: what CI and most agent harnesses hand a command) means nothing was piped, and the caller signs in
6
+ * through the browser instead.
7
+ *
8
+ * A stdin that stays open and silent cannot be told from a slow pipe (`a-secret-manager | ora login` may take
9
+ * seconds), so the read keeps waiting, as it always has. After a moment it says so on stderr, with the flag that
10
+ * skips the wait. The wait is never cut short: a deadline here would drop a slow producer's key and start a browser
11
+ * sign-in nobody is there to approve.
12
+ */
13
+ export declare const WAITING_FOR_PIPED_KEY = "Waiting for an api key on stdin. To sign in through the browser instead, run: ora login --no-browser";
14
+ /** The readable half of stdin this needs (`process.stdin`, or a stream a test feeds). */
15
+ export type PipedSource = Pick<NodeJS.ReadableStream, "on" | "setEncoding">;
16
+ export interface PipedInputOptions {
17
+ /** Where the "still waiting" line goes (stderr). */
18
+ hint?: (line: string) => void;
19
+ hintAfterMs?: number;
20
+ }
21
+ /** Everything `input` holds, trimmed; "" when it ends without a byte, or cannot be read at all. */
22
+ export declare function readPipedInput(input?: PipedSource, opts?: PipedInputOptions): Promise<string>;
23
+ //# sourceMappingURL=piped-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piped-input.d.ts","sourceRoot":"","sources":["../../src/login/piped-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,qBAAqB,yGACsE,CAAC;AAIzG,yFAAyF;AACzF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,GAAG,aAAa,CAAC,CAAC;AAE5E,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAAC,KAAK,GAAE,WAA2B,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBhH"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * What was piped into a bare `ora login`. `echo $KEY | ora login` has always stored that key, and still does.
3
+ *
4
+ * A stdin that is not a terminal is read to its end. What it holds is the key. A stdin that ends empty (closed, or
5
+ * /dev/null: what CI and most agent harnesses hand a command) means nothing was piped, and the caller signs in
6
+ * through the browser instead.
7
+ *
8
+ * A stdin that stays open and silent cannot be told from a slow pipe (`a-secret-manager | ora login` may take
9
+ * seconds), so the read keeps waiting, as it always has. After a moment it says so on stderr, with the flag that
10
+ * skips the wait. The wait is never cut short: a deadline here would drop a slow producer's key and start a browser
11
+ * sign-in nobody is there to approve.
12
+ */
13
+ export const WAITING_FOR_PIPED_KEY = "Waiting for an api key on stdin. To sign in through the browser instead, run: ora login --no-browser";
14
+ const HINT_AFTER_MS = 2_000;
15
+ /** Everything `input` holds, trimmed; "" when it ends without a byte, or cannot be read at all. */
16
+ export function readPipedInput(input = process.stdin, opts = {}) {
17
+ const hint = opts.hint ?? ((line) => void process.stderr.write(`${line}\n`));
18
+ return new Promise((resolve) => {
19
+ let received = "";
20
+ const waiting = setTimeout(() => hint(WAITING_FOR_PIPED_KEY), opts.hintAfterMs ?? HINT_AFTER_MS);
21
+ const settle = (value) => {
22
+ clearTimeout(waiting);
23
+ resolve(value);
24
+ };
25
+ input.setEncoding("utf8");
26
+ input.on("data", (chunk) => {
27
+ // Something is arriving, so nobody needs telling what this waits for.
28
+ clearTimeout(waiting);
29
+ received += String(chunk);
30
+ });
31
+ input.on("end", () => settle(received.trim()));
32
+ // A stdin that cannot be read (closed before the command started) is a stdin with no key on it.
33
+ input.on("error", () => settle(received.trim()));
34
+ });
35
+ }
36
+ //# sourceMappingURL=piped-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piped-input.js","sourceRoot":"","sources":["../../src/login/piped-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAChC,sGAAsG,CAAC;AAEzG,MAAM,aAAa,G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and
3
+ * list that drifts from the API. The person allows them on the approval page, which may grant fewer (it offers only
4
+ * what their organization and role allow), so asking for all of them is asking for "what this CLI can do", no more.
5
+ *
6
+ * - default: every scope an operation declares, plus the few no operation can declare (below);
7
+ * - `--read-only`: only the scopes ending in `:read`.
8
+ *
9
+ * `openid` names the person; `offline_access` asks for the refresh token that keeps the CLI signed in. The request
10
+ * string is sorted and free of duplicates, so the same CLI always asks for the same thing.
11
+ */
12
+ export interface ScopeSource {
13
+ /** The operation's id (`experiment.runs.list`); absent in a source that is only a scope. */
14
+ id?: string;
15
+ scope: string | null;
16
+ }
17
+ /** Every scope a sign-in of this CLI can use: what its operations declare plus the undeclared ones — once each, sorted. */
18
+ export declare function cliScopes(operations: readonly ScopeSource[]): string[];
19
+ export declare function requestedScope(operations: readonly ScopeSource[], opts: {
20
+ readOnly: boolean;
21
+ }): string;
22
+ //# sourceMappingURL=requested-scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requested-scopes.d.ts","sourceRoot":"","sources":["../../src/login/requested-scopes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH,MAAM,WAAW,WAAW;IAC1B,4FAA4F;IAC5F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AASD,2HAA2H;AAC3H,wBAAgB,SAAS,CAAC,UAAU,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,EAAE,CAMtE;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAItG"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The permissions browser sign-in asks for, DERIVED from the operations this CLI was generated from — never a hand
3
+ * list that drifts from the API. The person allows them on the approval page, which may grant fewer (it offers only
4
+ * what their organization and role allow), so asking for all of them is asking for "what this CLI can do", no more.
5
+ *
6
+ * - default: every scope an operation declares, plus the few no operation can declare (below);
7
+ * - `--read-only`: only the scopes ending in `:read`.
8
+ *
9
+ * `openid` names the person; `offline_access` asks for the refresh token that keeps the CLI signed in. The request
10
+ * string is sorted and free of duplicates, so the same CLI always asks for the same thing.
11
+ */
12
+ import { operationTakesSignIn } from "../core/credentials/sign-in-areas.js";
13
+ const OPENID_SCOPES = ["openid", "offline_access"];
14
+ /**
15
+ * Scopes the CLI uses that no HTTP operation declares.
16
+ * - `tunnels:connect` gates the tunnel WebSocket (`ora tunnel <port>`), which is not an operation in the API
17
+ * document.
18
+ * - `secrets:bind` lets a command attach a stored secret to what it creates (an add-on of a run or a session). The
19
+ * API checks it inside the operation, beside the operation's own scope, so no operation declares it either.
20
+ * Without it the refusal names a permission the approval page was never asked to offer.
21
+ */
22
+ const UNDECLARED_SCOPES = ["secrets:bind", "tunnels:connect"];
23
+ const READ_SUFFIX = ":read";
24
+ /**
25
+ * Areas that do not take a browser sign-in yet (core/credentials/sign-in-areas.ts) are left out: their permissions
26
+ * are not asked for, so the approval page never offers what would not work. A scope another area's operation also
27
+ * declares is still asked for.
28
+ */
29
+ const takesSignIn = (operation) => operationTakesSignIn(operation.id);
30
+ /** Every scope a sign-in of this CLI can use: what its operations declare plus the undeclared ones — once each, sorted. */
31
+ export function cliScopes(operations) {
32
+ const declared = operations
33
+ .filter(takesSignIn)
34
+ .map((operation) => operation.scope)
35
+ .filter((scope) => scope !== null);
36
+ return [...new Set([...declared, ...UNDECLARED_SCOPES])].sort();
37
+ }
38
+ export function requestedScope(operations, opts) {
39
+ const scopes = cliScopes(operations);
40
+ const asked = opts.readOnly ? scopes.filter((scope) => scope.endsWith(READ_SUFFIX)) : scopes;
41
+ return [...OPENID_SCOPES, ...asked].join(" ");
42
+ }
43
+ //# sourceMappingURL=requested-scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requested-scopes.js","sourceRoot":"","sources":["../../src/login/requested-scopes.ts"],"names":[],"mappings":"AAAA;;;;;;;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the generated OPERATIONS
3
3
  * manifest and builds every command (a data Registry — adding a public op to
4
4
  * the platform changes the generated manifest, never this file), plus the
5
- * three handwritten auth commands: login / logout / whoami (auth-commands.ts).
5
+ * three handwritten auth commands: login (login/login-command.ts — browser
6
+ * sign-in or an api key) and logout / whoami (auth-commands.ts).
6
7
  * The manifest-op execution core (credentials, path/query/body derivation,
7
8
  * runOperation) lives in core/run-operation.ts — this file only wires
8
9
  * commander around it.
@@ -12,12 +13,15 @@
12
13
  * user uses.
13
14
  */
14
15
  import { Command } from "commander";
15
- import { TokenExchangeAuth } from "./core/auth.js";
16
+ import type { CredentialAuth } from "./core/credentials/credential.js";
16
17
  import type { HttpClient } from "./core/http.js";
17
- import { type Credentials } from "./core/run-operation.js";
18
+ import { type CallerCredentials } from "./core/run-operation.js";
19
+ import { type LoginDeps } from "./login/login-deps.js";
18
20
  export interface ProgramDeps {
19
- makeClient?: (opts: Credentials) => Pick<HttpClient, "call" | "open">;
20
- makeAuth?: (opts: Credentials) => Pick<TokenExchangeAuth, "forceRefresh" | "clearCache" | "getToken">;
21
+ /** An API client that signs with the caller's credential (an api key's traded token, a sign-in's access token). */
22
+ makeClient?: (opts: CallerCredentials) => Pick<HttpClient, "call" | "open">;
23
+ /** The caller's credential as a token source: what the tunnel connects with, and what an api key is verified by. */
24
+ makeAuth?: (opts: CallerCredentials) => CredentialAuth;
21
25
  out?: (text: string) => void;
22
26
  errOut?: (text: string) => void;
23
27
  env?: NodeJS.ProcessEnv;
@@ -41,6 +45,12 @@ export interface ProgramDeps {
41
45
  * tests with a fake to drive the root action without a real terminal.
42
46
  */
43
47
  session?: (deps: ResolvedDeps) => Promise<void>;
48
+ /**
49
+ * The outside world as one seam (login/login-deps.ts): the network — the sign-in server, an api key's exchange
50
+ * and the default API client all fetch through it — the clock, waiting, and the browser. Faked in tests; any
51
+ * member left out is the real one.
52
+ */
53
+ login?: Partial<LoginDeps>;
44
54
  }
45
55
  export interface ResolvedDeps {
46
56
  makeClient: NonNullable<ProgramDeps["makeClient"]>;
@@ -54,6 +64,7 @@ export interface ResolvedDeps {
54
64
  now: () => number;
55
65
  stdinIsTty: boolean;
56
66
  session: (deps: ResolvedDeps) => Promise<void>;
67
+ login: LoginDeps;
57
68
  }
58
69
  export declare function cliVersion(): string;
59
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD,OAAO,EAAsC,KAAK,WAAW,EAAkB,MAAM,yBAAyB,CAAC;AAO/G,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACtE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC,CAAC;IACtG,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oGAAoG;IACpG,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4KAA4K;IAC5K,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,mGAAmG;IACnG,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,kHAAkH;IAClH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;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M,KAAK,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,KAAK,EAAE,SAAS,CAAC;CAClB;AAwCD,wBAAgB,UAAU,IAAI,MAAM,CAOnC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAE7F;AAED,wBAAgB,YAAY,CAAC,MAAM,GAAE,WAAgB,GAAG,OAAO,CA6D9D"}
package/dist/program.js CHANGED
@@ -2,7 +2,8 @@
2
2
  * The commander program. ONE registrar walks the generated OPERATIONS
3
3
  * manifest and builds every command (a data Registry — adding a public op to
4
4
  * the platform changes the generated manifest, never this file), plus the
5
- * three handwritten auth commands: login / logout / whoami (auth-commands.ts).
5
+ * three handwritten auth commands: login (login/login-command.ts — browser
6
+ * sign-in or an api key) and logout / whoami (auth-commands.ts).
6
7
  * The manifest-op execution core (credentials, path/query/body derivation,
7
8
  * runOperation) lives in core/run-operation.ts — this file only wires
8
9
  * commander around it.
@@ -13,28 +14,35 @@
13
14
  */
14
15
  import { attachSkillsAdd } from "./agent-skills/skills-command.js";
15
16
  import { createRequire } from "node:module";
16
- import { Command } from "commander";
17
- import { TokenExchangeAuth } from "./core/auth.js";
17
+ import { Command, Option } from "commander";
18
18
  import { configDir } from "./core/config.js";
19
19
  import { HttpClient as RealHttpClient } from "./core/http.js";
20
20
  import { attachTunnelCommand } from "./tunnel-command.js";
21
21
  import { attachStudyCi } from "./study-ci/ci-command.js";
22
22
  import { attachMcp } from "./mcp/mcp-command.js";
23
+ import { argumentFlag, argumentValues, excessArgumentsMessage } from "./core/cli-arguments.js";
23
24
  import { buildQuery, readBody, runOperation } from "./core/run-operation.js";
24
25
  import { renderError } from "./core/output.js";
25
- import { attachLogin, attachLogout, attachWhoami } from "./auth-commands.js";
26
+ import { attachLogout, attachWhoami } from "./auth-commands.js";
26
27
  import { COMMAND_GROUPS, OPERATIONS, SPEC } from "./generated/operations.js";
28
+ import { attachLogin } from "./login/login-command.js";
29
+ import { realLoginDeps } from "./login/login-deps.js";
27
30
  import { resolveOutputMode } from "./render/mode.js";
28
31
  import { helpEpilog } from "./watch.js";
29
32
  function resolveDeps(deps) {
30
- const dir = deps.configDirPath ?? configDir(deps.env ?? process.env);
33
+ const env = deps.env ?? process.env;
34
+ const dir = deps.configDirPath ?? configDir(env);
35
+ const login = { ...realLoginDeps(), ...deps.login };
36
+ // Each credential builds its own token source (a Strategy, credentials/credential.ts): an api key the exchange
37
+ // it has always used (core/auth.ts), a browser sign-in its refreshing access token.
38
+ const authOf = ({ apiUrl, credential }) => credential.createAuth({ apiUrl, dir, env, fetchFn: login.fetchFn, now: login.now });
31
39
  return {
32
40
  makeClient: deps.makeClient ??
33
- (({ apiUrl, signIn }) => new RealHttpClient({ apiUrl, auth: new TokenExchangeAuth({ apiUrl, signIn, dir }) })),
34
- makeAuth: deps.makeAuth ?? (({ apiUrl, signIn }) => new TokenExchangeAuth({ apiUrl, signIn, dir })),
41
+ ((creds) => new RealHttpClient({ apiUrl: creds.apiUrl, auth: authOf(creds), fetchFn: login.fetchFn })),
42
+ makeAuth: deps.makeAuth ?? authOf,
35
43
  out: deps.out ?? ((text) => process.stdout.write(`${text}\n`)),
36
44
  errOut: deps.errOut ?? ((text) => process.stderr.write(`${text}\n`)),
37
- env: deps.env ?? process.env,
45
+ env,
38
46
  dir,
39
47
  stdoutIsTty: deps.stdoutIsTty ?? process.stdout.isTTY === true,
40
48
  rawOut: deps.rawOut ?? ((text) => process.stdout.write(text)),
@@ -52,6 +60,7 @@ function resolveDeps(deps) {
52
60
  ]);
53
61
  await runSession({ prompter: new InquirerPrompter(), deps: resolved });
54
62
  }),
63
+ login,
55
64
  };
56
65
  }
57
66
  export function cliVersion() {
@@ -153,12 +162,16 @@ function attachOperationAt(program, path, meta, deps) {
153
162
  const leaf = node.command(path.at(-1) ?? meta.id).description(meta.summary);
154
163
  for (const p of meta.pathParams)
155
164
  leaf.argument(`<${p.name}>`, `${p.name} path parameter`);
165
+ for (const name of meta.cliArguments ?? []) {
166
+ leaf.argument(`[${name}]`, meta.bodyFields?.find((f) => f.name === name)?.description ?? `${name} body field`);
167
+ }
156
168
  for (const q of meta.queryParams) {
157
169
  const spec = q.kind === "boolean" ? `--${q.flag}` : `--${q.flag} <value>`;
158
170
  leaf.option(spec, q.description ?? `${q.name} query parameter`);
159
171
  }
160
172
  if (meta.hasBody) {
161
- leaf.option("--file <path>", `JSON request body file, or "-" for stdin${meta.bodyRequired ? " (required)" : ""}`);
173
+ const required = meta.bodyRequired && !meta.cliArguments?.length ? " (required)" : "";
174
+ leaf.option("--file <path>", `JSON request body file, or "-" for stdin${required}`);
162
175
  }
163
176
  leaf.option("--json", "print the raw JSON response");
164
177
  leaf.option("--plain", "force plain non-visual output");
@@ -166,6 +179,11 @@ function attachOperationAt(program, path, meta, deps) {
166
179
  if (meta.watchable) {
167
180
  leaf.option("-w, --watch", "after the call, stream the created resource's live events (server-provided streamUrl) until the stream closes");
168
181
  }
182
+ for (const name of meta.cliArguments ?? []) {
183
+ const long = `--${argumentFlag(name)}`;
184
+ if (!leaf.options.some((o) => o.long === long))
185
+ leaf.addOption(new Option(`${long} <value>`).hideHelp());
186
+ }
169
187
  leaf.addHelpText("after", helpEpilog(meta));
170
188
  leaf.action(async (...actionArgs) => {
171
189
  const positionals = actionArgs.slice(0, meta.pathParams.length);
@@ -174,7 +192,14 @@ function attachOperationAt(program, path, meta, deps) {
174
192
  if (meta.hasBody) {
175
193
  // The same pure decision runOperation makes, so an unreadable --file under --json is a JSON line too.
176
194
  const mode = resolveOutputMode({ json: Boolean(opts.json), plain: Boolean(opts.plain) }, deps.env, deps.stdoutIsTty);
177
- const r = readBody(opts.file, meta, deps, mode);
195
+ const declared = meta.pathParams.length + (meta.cliArguments?.length ?? 0);
196
+ if (meta.cliArguments?.length && leaf.args.length > declared) {
197
+ deps.errOut(renderError(new Error(excessArgumentsMessage(meta)), { mode }));
198
+ process.exitCode = 2;
199
+ return;
200
+ }
201
+ const given = argumentValues(meta, actionArgs.slice(meta.pathParams.length), opts);
202
+ const r = readBody(opts.file, meta, deps, mode, given);
178
203
  if (r.kind === "error")
179
204
  return; // readBody already reported + set exitCode
180
205
  body = r.body;
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAoC,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE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