@rebasepro/cli 0.30.0 → 0.30.1

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.
@@ -10,6 +10,8 @@ export declare const LOGIN_FLAGS: {
10
10
  readonly "--email": StringConstructor;
11
11
  readonly "--password": StringConstructor;
12
12
  readonly "--code": BooleanConstructor;
13
+ readonly "--web": BooleanConstructor;
14
+ readonly "--no-browser": BooleanConstructor;
13
15
  readonly "-e": "--email";
14
16
  };
15
17
  /**
@@ -26,12 +26,41 @@ export interface PendingSecondFactor {
26
26
  * could finish. The same reading the console's login view makes.
27
27
  */
28
28
  export declare function readMfaRequired(error: unknown): PendingSecondFactor | null;
29
+ type AuthConfig = Awaited<ReturnType<CloudAuth["getAuthConfig"]>>;
30
+ /**
31
+ * The control plane's `/auth/config`, or null when it cannot be read. Read
32
+ * once per login: it says both whether codes are mailed and whether device
33
+ * sign-in is offered.
34
+ */
35
+ export declare function readAuthConfig(auth: CloudAuth): Promise<AuthConfig | null>;
29
36
  /**
30
37
  * Whether the control plane mails sign-in codes, as its `/auth/config` says.
31
38
  * `false` when it cannot be asked: an older control plane has no such door,
32
39
  * and offering one that 404s is worse than not offering it.
33
40
  */
34
- export declare function offersSignInCodes(auth: CloudAuth): Promise<boolean>;
41
+ export declare function offersSignInCodes(config: AuthConfig | null): boolean;
42
+ /** Whether the control plane signs a terminal in through a browser, as its `/auth/config` says. */
43
+ export declare function offersBrowserSignIn(config: AuthConfig | null): boolean;
44
+ /** What the browser sign-in does outside this process. An object so tests can replace it. */
45
+ export declare const BROWSER_SIGN_IN_IO: {
46
+ sleep: (ms: number) => Promise<void>;
47
+ open: (url: string) => void;
48
+ };
49
+ /** What the approval page calls this terminal. */
50
+ export declare function browserSignInClientName(): string;
51
+ /**
52
+ * Sign in through a browser: ask for a pending sign-in, show its link and
53
+ * code, open the browser when there is a person at a terminal to look at it,
54
+ * and poll until it is approved, denied or expired.
55
+ *
56
+ * Without a terminal — piped, or `--json` — the link and code still go to
57
+ * stderr and the polling still happens: whoever runs this (an agent, a
58
+ * script with a person nearby) has what to open and is told what it is
59
+ * waiting for.
60
+ */
61
+ export declare function signInWithBrowser(auth: CloudAuth, options: {
62
+ openBrowser: boolean;
63
+ }): Promise<SignedIn>;
35
64
  /** Ask "password or code?" at a terminal. */
36
65
  export declare function askSignInMethod(): Promise<"password" | "code">;
37
66
  /** Refuse a code step with no terminal to type it at. Never returns when there is none. */
package/dist/index.es.js CHANGED
@@ -126,7 +126,7 @@ async function commandVocabulary(command) {
126
126
  aliases: {}
127
127
  };
128
128
  case "cloud": {
129
- const cloud = await import("./cloud-Cj5ey3l_.js");
129
+ const cloud = await import("./cloud-DtADfWwn.js");
130
130
  return {
131
131
  subcommands: cloud.CLOUD_GROUP_NAMES,
132
132
  aliases: cloud.GROUP_ALIASES
@@ -386,7 +386,7 @@ async function dispatch(command, effectiveSubcommand, args, parsedArgs, namespac
386
386
  break;
387
387
  }
388
388
  case "cloud": {
389
- const { cloudCommand } = await import("./cloud-Cj5ey3l_.js");
389
+ const { cloudCommand } = await import("./cloud-DtADfWwn.js");
390
390
  await cloudCommand(effectiveSubcommand, args);
391
391
  break;
392
392
  }
@@ -395,7 +395,7 @@ async function dispatch(command, effectiveSubcommand, args, parsedArgs, namespac
395
395
  await telemetryCommand(args);
396
396
  break;
397
397
  }
398
- default: unknownCommand(command, namespacedCommands, "", { cloud: (await import("./cloud-Cj5ey3l_.js")).CLOUD_GROUP_NAMES });
398
+ default: unknownCommand(command, namespacedCommands, "", { cloud: (await import("./cloud-DtADfWwn.js")).CLOUD_GROUP_NAMES });
399
399
  }
400
400
  }
401
401
  /** The global help. Exported so its Options block can be held against {@link ROOT_FLAGS}. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/cli",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "description": "Developer tools for Rebase projects",
5
5
  "keywords": [
6
6
  "cli",
@@ -44,13 +44,13 @@
44
44
  "inquirer": "14.0.2",
45
45
  "jiti": "^2.7.0",
46
46
  "pg": "^8.22.0",
47
- "@rebasepro/agent-skills": "0.30.0",
48
- "@rebasepro/client": "0.30.0",
49
- "@rebasepro/server": "0.30.0",
50
- "@rebasepro/codegen": "0.30.0",
51
- "@rebasepro/types": "0.30.0",
52
- "@rebasepro/rls-check": "0.30.0",
53
- "@rebasepro/server-postgres": "0.30.0"
47
+ "@rebasepro/agent-skills": "0.30.1",
48
+ "@rebasepro/codegen": "0.30.1",
49
+ "@rebasepro/client": "0.30.1",
50
+ "@rebasepro/rls-check": "0.30.1",
51
+ "@rebasepro/server-postgres": "0.30.1",
52
+ "@rebasepro/types": "0.30.1",
53
+ "@rebasepro/server": "0.30.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^26.1.2",