run402-mcp 2.40.0 → 2.41.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402-mcp",
3
- "version": "2.40.0",
3
+ "version": "2.41.0",
4
4
  "description": "MCP server for Run402 — AI-native Postgres databases with REST API, auth, storage, and row-level security. Pay with x402 USDC micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/sdk/README.md CHANGED
@@ -81,7 +81,7 @@ The `CredentialsProvider` interface has two required methods (`getAuth`, `getPro
81
81
  | `allowance` | `status`, `create`, `export`, `faucet` |
82
82
  | `service` | `status`, `health` (no auth, no setup — works on a fresh install) |
83
83
  | `admin` | Operator/admin endpoints: messages/contact, per-project finance (`getProjectFinance`) |
84
- | `operator` | **The human / email principal** — the *operator session*, distinct from the agent's per-wallet SIWX identity (and from platform-`admin`). `deviceStart`, `devicePoll`, `overview({ token })`, `revoke({ token })`: browser-delegated device-authorization (RFC 8628, the `aws sso login` model). `overview` returns the email-union across every wallet that verified the email; a single wallet's own view stays `run402 status`. Drives `run402 operator login/overview/whoami/logout`. No MCP tool by design — MCP authenticates as the agent, not the human. |
84
+ | `operator` | **The human / email principal** — distinct from the agent's per-wallet SIWX identity (and from platform-`admin`). Read session: `deviceStart`, `devicePoll`, `overview({ token })`, `revoke({ token })` browser-delegated device-authorization (RFC 8628, the `aws sso login` model); `overview` returns the email-union across every wallet that verified the email. Write session (v1.78): `buildCliAuthorizeUrl`/`exchangeCliToken` (loopback-PKCE CLI login) + the hosted `operator.session.*` surface (email magic-link / passkey / OAuth login, `whoami`/`refresh`/`revoke`, step-up, authenticators, recovery) — carry a minted session SDK-wide with `controlPlaneSessionCredentials({ token })`. Drives `run402 operator login[/--loopback]/overview/whoami/logout`. No MCP tool by design — MCP authenticates as the agent, not the human. |
85
85
 
86
86
  CLI-style aliases are available for agent ergonomics: `r.image` aliases `r.ai`,
87
87
  and common command names such as `r.billing.balance`, `r.auth.magicLink`,
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Control-plane **session** credential provider (gateway v1.78). Carries a
3
+ * write-capable `control_plane_session` bearer so the whole SDK authenticates as
4
+ * the human principal — the token is "accepted everywhere a SIWX wallet is", so
5
+ * `r.org.*`, `r.admin.transfers.*`, and `r.operator.session.*` all act as that
6
+ * principal.
7
+ *
8
+ * Isomorphic — no Node APIs. Mint a session with `r.operator.session.verifyEmail`
9
+ * / `passkeyVerify` / the loopback-PKCE `exchangeCliToken`, then:
10
+ *
11
+ * const r = run402({ credentials: controlPlaneSessionCredentials({ token }) });
12
+ * await r.org.whoami(); // resolves the principal + memberships
13
+ *
14
+ * High-stakes writes still require a fresh passkey — an `email`/`oauth` session
15
+ * gets {@link StepUpRequiredError}; run the step-up ceremony
16
+ * (`r.operator.session.stepUpOptions`/`stepUpVerify`) and retry.
17
+ *
18
+ * This credential authenticates control-plane operations only; it carries no
19
+ * project anon/service keys, so {@link CredentialsProvider.getProject} returns
20
+ * null (project-key operations need the keystore/wallet).
21
+ */
22
+ import type { CredentialsProvider } from "./credentials.js";
23
+ /** Brand marking a provider as control-plane-session-backed. */
24
+ export declare const CONTROL_PLANE_SESSION_CREDENTIALS: unique symbol;
25
+ export interface ControlPlaneSessionMarkedCredentialsProvider extends CredentialsProvider {
26
+ readonly [CONTROL_PLANE_SESSION_CREDENTIALS]: true;
27
+ }
28
+ export interface ControlPlaneSessionCredentialsOptions {
29
+ /** A `control_plane_session` bearer token. Provide this OR `getToken`. */
30
+ token?: string;
31
+ /**
32
+ * Lazily resolve the current token (e.g. read a cache, or rotate via
33
+ * `r.operator.session.refresh`). Called before every authenticated request.
34
+ */
35
+ getToken?: () => string | Promise<string>;
36
+ }
37
+ /** True if `credentials` was created by {@link controlPlaneSessionCredentials}. */
38
+ export declare function isControlPlaneSessionCredentials(credentials: CredentialsProvider): credentials is ControlPlaneSessionMarkedCredentialsProvider;
39
+ /**
40
+ * Build a {@link CredentialsProvider} that authenticates every request with a
41
+ * `control_plane_session` bearer. Pass a static `token`, or a `getToken`
42
+ * resolver for rotation.
43
+ */
44
+ export declare function controlPlaneSessionCredentials(opts: ControlPlaneSessionCredentialsOptions): ControlPlaneSessionMarkedCredentialsProvider;
45
+ //# sourceMappingURL=control-plane-credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-plane-credentials.d.ts","sourceRoot":"","sources":["../src/control-plane-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAGzE,gEAAgE;AAChE,eAAO,MAAM,iCAAiC,eAE7C,CAAC;AAEF,MAAM,WAAW,4CAA6C,SAAQ,mBAAmB;IACvF,QAAQ,CAAC,CAAC,iCAAiC,CAAC,EAAE,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,qCAAqC;IACpD,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED,mFAAmF;AACnF,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,mBAAmB,GAC/B,WAAW,IAAI,4CAA4C,CAM7D;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,qCAAqC,GAC1C,4CAA4C,CA8B9C"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Control-plane **session** credential provider (gateway v1.78). Carries a
3
+ * write-capable `control_plane_session` bearer so the whole SDK authenticates as
4
+ * the human principal — the token is "accepted everywhere a SIWX wallet is", so
5
+ * `r.org.*`, `r.admin.transfers.*`, and `r.operator.session.*` all act as that
6
+ * principal.
7
+ *
8
+ * Isomorphic — no Node APIs. Mint a session with `r.operator.session.verifyEmail`
9
+ * / `passkeyVerify` / the loopback-PKCE `exchangeCliToken`, then:
10
+ *
11
+ * const r = run402({ credentials: controlPlaneSessionCredentials({ token }) });
12
+ * await r.org.whoami(); // resolves the principal + memberships
13
+ *
14
+ * High-stakes writes still require a fresh passkey — an `email`/`oauth` session
15
+ * gets {@link StepUpRequiredError}; run the step-up ceremony
16
+ * (`r.operator.session.stepUpOptions`/`stepUpVerify`) and retry.
17
+ *
18
+ * This credential authenticates control-plane operations only; it carries no
19
+ * project anon/service keys, so {@link CredentialsProvider.getProject} returns
20
+ * null (project-key operations need the keystore/wallet).
21
+ */
22
+ import { LocalError } from "./errors.js";
23
+ /** Brand marking a provider as control-plane-session-backed. */
24
+ export const CONTROL_PLANE_SESSION_CREDENTIALS = Symbol.for("@run402/sdk/control-plane-session-credentials");
25
+ /** True if `credentials` was created by {@link controlPlaneSessionCredentials}. */
26
+ export function isControlPlaneSessionCredentials(credentials) {
27
+ return Boolean(credentials[CONTROL_PLANE_SESSION_CREDENTIALS]);
28
+ }
29
+ /**
30
+ * Build a {@link CredentialsProvider} that authenticates every request with a
31
+ * `control_plane_session` bearer. Pass a static `token`, or a `getToken`
32
+ * resolver for rotation.
33
+ */
34
+ export function controlPlaneSessionCredentials(opts) {
35
+ if (!opts?.token && !opts?.getToken) {
36
+ throw new LocalError("controlPlaneSessionCredentials requires token or getToken", "creating control-plane session credentials");
37
+ }
38
+ const provider = {
39
+ async getAuth() {
40
+ const token = opts.getToken ? await opts.getToken() : opts.token;
41
+ if (!token) {
42
+ throw new LocalError("control-plane session credentials did not return a token", "authenticating with control-plane session");
43
+ }
44
+ return { Authorization: `Bearer ${token}` };
45
+ },
46
+ async getProject() {
47
+ // A control-plane session carries no project anon/service keys.
48
+ return null;
49
+ },
50
+ };
51
+ Object.defineProperty(provider, CONTROL_PLANE_SESSION_CREDENTIALS, {
52
+ value: true,
53
+ enumerable: false,
54
+ });
55
+ return provider;
56
+ }
57
+ //# sourceMappingURL=control-plane-credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-plane-credentials.js","sourceRoot":"","sources":["../src/control-plane-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,gEAAgE;AAChE,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,GAAG,CACzD,+CAA+C,CAChD,CAAC;AAgBF,mFAAmF;AACnF,MAAM,UAAU,gCAAgC,CAC9C,WAAgC;IAEhC,OAAO,OAAO,CACX,WAAqE,CACpE,iCAAiC,CAClC,CACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC5C,IAA2C;IAE3C,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC;QACpC,MAAM,IAAI,UAAU,CAClB,2DAA2D,EAC3D,4CAA4C,CAC7C,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAwB;QACpC,KAAK,CAAC,OAAO;YACX,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACjE,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,UAAU,CAClB,0DAA0D,EAC1D,2CAA2C,CAC5C,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC;QAC9C,CAAC;QACD,KAAK,CAAC,UAAU;YACd,gEAAgE;YAChE,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;IAEF,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,iCAAiC,EAAE;QACjE,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IACH,OAAO,QAAwD,CAAC;AAClE,CAAC"}
@@ -181,6 +181,8 @@ export type * from "./credentials.js";
181
181
  export type * from "./kernel.js";
182
182
  export { CI_SESSION_CREDENTIALS, createCiSessionCredentials, githubActionsCredentials, isCiSessionCredentials, } from "./ci-credentials.js";
183
183
  export type * from "./ci-credentials.js";
184
+ export { CONTROL_PLANE_SESSION_CREDENTIALS, controlPlaneSessionCredentials, isControlPlaneSessionCredentials, } from "./control-plane-credentials.js";
185
+ export type * from "./control-plane-credentials.js";
184
186
  export { Deploy } from "./namespaces/deploy.js";
185
187
  export { EMPTY_STATIC_MANIFEST_METADATA, ROUTE_HTTP_METHODS, buildDeployResolveSummary, isDeployResolveRouteHit, isDeployResolveStaticHit, normalizeDeployResolveRequest, normalizeStaticManifestMetadata, summarizeDeployResult, } from "./namespaces/deploy.types.js";
186
188
  export { Ci, CI_AUDIENCE, CI_GITHUB_ACTIONS_ISSUER, CI_GITHUB_ACTIONS_PROVIDER, DEFAULT_CI_DELEGATION_CHAIN_ID, V1_CI_ALLOWED_ACTIONS, V1_CI_ALLOWED_EVENTS_DEFAULT, assertCiDeployableSpec, buildCiDelegationResourceUri, buildCiDelegationStatement, normalizeCiRouteScopes, normalizeCiDelegationValues, validateCiNonce, validateCiRouteScope, validateCiSubjectMatch, } from "./namespaces/ci.js";
@@ -204,6 +206,8 @@ export type * from "./namespaces/email.js";
204
206
  export type * from "./namespaces/functions.types.js";
205
207
  export type * from "./namespaces/jobs.js";
206
208
  export type * from "./namespaces/operator.js";
209
+ export { OperatorSession } from "./namespaces/operator-session.js";
210
+ export type * from "./namespaces/operator-session.js";
207
211
  export { Org, OrgMembers, OrgInvites } from "./namespaces/org.js";
208
212
  export type * from "./namespaces/org.types.js";
209
213
  export { Grants } from "./namespaces/grants.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0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C/C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,0BAA0B,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,mBAAmB,kCAAkC,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAClE,mBAAmB,2BAA2B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,sBAAsB,CAAC"}
package/sdk/dist/index.js CHANGED
@@ -241,11 +241,13 @@ export function run402(opts) {
241
241
  export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, NotAuthorizedError, ApiError, NetworkError, LocalError, Run402DeployError, TransferFreezeError, StepUpRequiredError, isRun402Error, isPaymentRequired, isProjectNotFound, isUnauthorized, isNotAuthorized, isApiError, isNetworkError, isLocalError, isDeployError, isTransferFreezeError, isStepUpRequired, isRetryableRun402Error, getQuotaScope, } from "./errors.js";
242
242
  export { withRetry } from "./retry.js";
243
243
  export { CI_SESSION_CREDENTIALS, createCiSessionCredentials, githubActionsCredentials, isCiSessionCredentials, } from "./ci-credentials.js";
244
+ export { CONTROL_PLANE_SESSION_CREDENTIALS, controlPlaneSessionCredentials, isControlPlaneSessionCredentials, } from "./control-plane-credentials.js";
244
245
  export { Deploy } from "./namespaces/deploy.js";
245
246
  export { EMPTY_STATIC_MANIFEST_METADATA, ROUTE_HTTP_METHODS, buildDeployResolveSummary, isDeployResolveRouteHit, isDeployResolveStaticHit, normalizeDeployResolveRequest, normalizeStaticManifestMetadata, summarizeDeployResult, } from "./namespaces/deploy.types.js";
246
247
  export { Ci, CI_AUDIENCE, CI_GITHUB_ACTIONS_ISSUER, CI_GITHUB_ACTIONS_PROVIDER, DEFAULT_CI_DELEGATION_CHAIN_ID, V1_CI_ALLOWED_ACTIONS, V1_CI_ALLOWED_EVENTS_DEFAULT, assertCiDeployableSpec, buildCiDelegationResourceUri, buildCiDelegationStatement, normalizeCiRouteScopes, normalizeCiDelegationValues, validateCiNonce, validateCiRouteScope, validateCiSubjectMatch, } from "./namespaces/ci.js";
247
248
  export { ScopedRun402 } from "./scoped.js";
248
249
  export { Transfers } from "./namespaces/transfers.js";
250
+ export { OperatorSession } from "./namespaces/operator-session.js";
249
251
  export { Org, OrgMembers, OrgInvites } from "./namespaces/org.js";
250
252
  export { Grants } from "./namespaces/grants.js";
251
253
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAkC,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAA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1.78 `passkey-principals-onboarding`). The write-capable human
4
+ * principal: log in (email magic-link / passkey / Google / GitHub), manage the
5
+ * session (whoami / refresh / revoke), enrol a passkey, run a step-up ceremony,
6
+ * and manage authenticators + recovery codes.
7
+ *
8
+ * Reached as `r.operator.session.*`. Distinct from the read-only operator
9
+ * overview session (`r.operator.deviceStart`/`overview`) and from the CLI
10
+ * loopback-PKCE write-login (`r.operator.buildCliAuthorizeUrl`/`exchangeCliToken`,
11
+ * which is the headless variant of this same browser ceremony). All three are
12
+ * the one human principal; this group is the browser/console front door that the
13
+ * hosted login pages and `@run402/sdk` consumers call.
14
+ *
15
+ * Isomorphic — no Node APIs. The token model mirrors {@link Operator.overview}:
16
+ * the public *mint* methods (`email`/`verifyEmail`/`passkey*`/`consumeRecoveryCode`)
17
+ * send no auth (the body or the magic-link token IS the credential); the
18
+ * *session-bound* methods take `opts.token` to send the `control_plane_session`
19
+ * bearer explicitly, and fall back to the credential provider's default auth
20
+ * (e.g. {@link controlPlaneSessionCredentials} or a SIWX wallet) when omitted.
21
+ *
22
+ * WebAuthn option/assertion payloads are opaque passthroughs (`unknown`) — the
23
+ * browser runs the actual ceremony; a headless client cannot.
24
+ *
25
+ * High-stakes writes (invite, membership, handoff, delete) require a **fresh
26
+ * passkey** — a magic-link/OAuth session does NOT satisfy step-up, so the
27
+ * gateway returns {@link StepUpRequiredError}; `stepUpOptions`/`stepUpVerify`
28
+ * are how a long-lived session re-establishes that freshness.
29
+ */
30
+ import type { Client } from "../kernel.js";
31
+ import type { ControlPlaneSession } from "./operator.js";
32
+ import type { Principal, OrgMembership } from "./org.types.js";
33
+ /** OAuth identity providers bridged for control-plane login. */
34
+ export type ControlPlaneOAuthProvider = "google" | "github";
35
+ /** Generic, non-enumerating response from {@link OperatorSession.email}. */
36
+ export interface MagicLinkSendResult {
37
+ status: string;
38
+ message: string;
39
+ [key: string]: unknown;
40
+ }
41
+ /**
42
+ * Result of {@link OperatorSession.consumeRecoveryCode} — a minted session that
43
+ * cannot perform high-stakes ops until a passkey is enrolled
44
+ * (`must_enroll_passkey: true`). Recovery `amr` never satisfies step-up.
45
+ */
46
+ export interface RecoveryConsumeResult extends ControlPlaneSession {
47
+ must_enroll_passkey?: boolean;
48
+ note?: string;
49
+ }
50
+ /**
51
+ * Result of {@link OperatorSession.whoami} (`GET /agent/v1/control-plane/session`)
52
+ * — the live session's principal, every org membership (newly-active rows here
53
+ * are the auto-claimed invites), and the freshness substrate (`amr` + per-AMR
54
+ * `amr_times`) the step-up gate reads. Forward-compatible.
55
+ */
56
+ export interface ControlPlaneWhoAmI {
57
+ principal: Principal;
58
+ memberships: OrgMembership[];
59
+ /** Auth methods satisfied on this session, e.g. `["passkey"]`. */
60
+ amr: string[];
61
+ /** Per-AMR last-proven time (epoch ms or ISO), the step-up freshness source. */
62
+ amr_times?: Record<string, unknown>;
63
+ [key: string]: unknown;
64
+ }
65
+ /** Result of {@link OperatorSession.refresh} (`POST …/session/refresh`). */
66
+ export interface ControlPlaneRefreshResult {
67
+ control_plane_session_token: string;
68
+ token_type?: string;
69
+ expires_in?: number;
70
+ [key: string]: unknown;
71
+ }
72
+ /** WebAuthn options envelope (`{ options }`) — opaque; handed to the browser. */
73
+ export interface WebAuthnOptionsResult {
74
+ options: unknown;
75
+ [key: string]: unknown;
76
+ }
77
+ /** Result of {@link OperatorSession.enrollPasskeyVerify}. */
78
+ export interface EnrollPasskeyResult {
79
+ status: string;
80
+ credential_id: string;
81
+ [key: string]: unknown;
82
+ }
83
+ /** Result of {@link OperatorSession.stepUpVerify}. */
84
+ export interface StepUpVerifyResult {
85
+ status: string;
86
+ stepped_up: boolean;
87
+ [key: string]: unknown;
88
+ }
89
+ /** Result of {@link OperatorSession.issueRecoveryCodes} — shown ONCE. */
90
+ export interface RecoveryCodesResult {
91
+ status: string;
92
+ recovery_codes: string[];
93
+ note?: string;
94
+ [key: string]: unknown;
95
+ }
96
+ /** One active authenticator (no secret material). Forward-compatible. */
97
+ export interface Authenticator {
98
+ id: string;
99
+ kind: string;
100
+ [key: string]: unknown;
101
+ }
102
+ /** Result of {@link OperatorSession.revokeAuthenticator}. */
103
+ export interface AuthenticatorRevokeResult {
104
+ status: string;
105
+ kind: string;
106
+ [key: string]: unknown;
107
+ }
108
+ /** Options bag carrying the optional `control_plane_session` bearer. */
109
+ export interface SessionTokenOpts {
110
+ /**
111
+ * The `control_plane_session` bearer. When omitted, the request falls back to
112
+ * the credential provider's default auth (e.g. {@link controlPlaneSessionCredentials}).
113
+ */
114
+ token?: string;
115
+ }
116
+ export declare class OperatorSession {
117
+ private readonly client;
118
+ constructor(client: Client);
119
+ /**
120
+ * Send a control-plane sign-in magic link to `email`
121
+ * (`POST /agent/v1/control-plane/session/email`). Non-enumerating: an
122
+ * identical response whether or not the email can sign in. Rate-limited.
123
+ */
124
+ email(input: {
125
+ email: string;
126
+ }): Promise<MagicLinkSendResult>;
127
+ /**
128
+ * Exchange a magic-link token for a control-plane session
129
+ * (`POST …/session/email/verify`). Verifies the email, resolves/creates the
130
+ * principal, **auto-claims any pending invites**, and mints the session
131
+ * (`amr: ["email"]`).
132
+ */
133
+ verifyEmail(input: {
134
+ token: string;
135
+ }): Promise<ControlPlaneSession>;
136
+ /**
137
+ * Get WebAuthn login options for an email's passkeys
138
+ * (`POST …/session/passkey/options`). Opaque — pass `options` to the browser's
139
+ * `navigator.credentials.get`.
140
+ */
141
+ passkeyOptions(input: {
142
+ email: string;
143
+ }): Promise<WebAuthnOptionsResult>;
144
+ /**
145
+ * Verify a WebAuthn assertion and mint a session (`amr: ["passkey"]`)
146
+ * (`POST …/session/passkey/verify`). `response` is the opaque assertion from
147
+ * the browser.
148
+ */
149
+ passkeyVerify(input: {
150
+ email: string;
151
+ response: unknown;
152
+ }): Promise<ControlPlaneSession>;
153
+ /**
154
+ * Build the browser OAuth start URL for `provider`
155
+ * (`GET …/oauth/:provider/start`). Pure — no network. Open it in a browser;
156
+ * the gateway 302s to the provider, then the callback lands on the console
157
+ * with the session token in the URL fragment.
158
+ *
159
+ * Note: the live bridge can return `503` until the gateway provisions the
160
+ * provider's `CONTROL_PLANE_{GOOGLE,GITHUB}_*` client credentials.
161
+ */
162
+ oauthUrl(provider: ControlPlaneOAuthProvider): string;
163
+ /**
164
+ * Run the recovery-code ceremony (`POST …/recovery/consume`). Mints a session
165
+ * with `amr: ["recovery_code"]` which **cannot** do high-stakes ops
166
+ * (`must_enroll_passkey: true`) — enrol a passkey to restore full access.
167
+ */
168
+ consumeRecoveryCode(input: {
169
+ code: string;
170
+ }): Promise<RecoveryConsumeResult>;
171
+ /**
172
+ * Resolve the current session's principal + memberships + freshness
173
+ * (`GET /agent/v1/control-plane/session`). The `memberships` reflect any
174
+ * invites auto-claimed at login.
175
+ */
176
+ whoami(opts?: SessionTokenOpts): Promise<ControlPlaneWhoAmI>;
177
+ /** Rotate the access token (`POST …/session/refresh`). */
178
+ refresh(opts?: SessionTokenOpts): Promise<ControlPlaneRefreshResult>;
179
+ /** Sign out — revoke the session server-side (`POST …/session/revoke`). Idempotent. */
180
+ revoke(opts?: SessionTokenOpts): Promise<{
181
+ status: string;
182
+ [key: string]: unknown;
183
+ }>;
184
+ /** WebAuthn registration options for a new passkey (`POST …/passkey/enroll/options`). */
185
+ enrollPasskeyOptions(opts?: SessionTokenOpts): Promise<WebAuthnOptionsResult>;
186
+ /** Verify a passkey registration (`POST …/passkey/enroll/verify`). `label` names the authenticator. */
187
+ enrollPasskeyVerify(input: {
188
+ response: unknown;
189
+ label?: string | null;
190
+ } & SessionTokenOpts): Promise<EnrollPasskeyResult>;
191
+ /**
192
+ * WebAuthn step-up options for a high-stakes op (`POST …/step-up/options`).
193
+ * `opClass` binds the elevation, e.g. `"org.invite"` / `"org.membership"` /
194
+ * `"project.transfer"` (see {@link StepUpRequiredError.requiredAmr}).
195
+ */
196
+ stepUpOptions(input?: {
197
+ opClass?: string;
198
+ } & SessionTokenOpts): Promise<WebAuthnOptionsResult>;
199
+ /**
200
+ * Verify a step-up assertion (`POST …/step-up/verify`) → refreshes session
201
+ * passkey-freshness and records an action-bound elevation when `opClass` (and
202
+ * optionally `objectKind`/`objectId`) are given. Retry the gated write after.
203
+ */
204
+ stepUpVerify(input: {
205
+ response: unknown;
206
+ opClass?: string;
207
+ objectKind?: string | null;
208
+ objectId?: string | null;
209
+ } & SessionTokenOpts): Promise<StepUpVerifyResult>;
210
+ /** (Re)issue recovery codes — shown ONCE (`POST …/recovery/issue`). */
211
+ issueRecoveryCodes(opts?: SessionTokenOpts): Promise<RecoveryCodesResult>;
212
+ /** List my active authenticators — no secret material (`GET …/authenticators`). */
213
+ listAuthenticators(opts?: SessionTokenOpts): Promise<Authenticator[]>;
214
+ /**
215
+ * Revoke an authenticator (`DELETE …/authenticators/:id`). Step-up enforced;
216
+ * the gateway refuses to remove the last passkey of a sole org owner
217
+ * (`OWNER_NEEDS_PASSKEY`).
218
+ */
219
+ revokeAuthenticator(input: {
220
+ id: string;
221
+ } & SessionTokenOpts): Promise<AuthenticatorRevokeResult>;
222
+ }
223
+ //# sourceMappingURL=operator-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator-session.d.ts","sourceRoot":"","sources":["../../src/namespaces/operator-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/D,gEAAgE;AAChE,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5D,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,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yB,CAAC;CAOxG"}
@@ -0,0 +1,230 @@
1
+ /**
2
+ * `operator.session` — the hosted/browser control-plane **session** surface
3
+ * (gateway v1.78 `passkey-principals-onboarding`). The write-capable human
4
+ * principal: log in (email magic-link / passkey / Google / GitHub), manage the
5
+ * session (whoami / refresh / revoke), enrol a passkey, run a step-up ceremony,
6
+ * and manage authenticators + recovery codes.
7
+ *
8
+ * Reached as `r.operator.session.*`. Distinct from the read-only operator
9
+ * overview session (`r.operator.deviceStart`/`overview`) and from the CLI
10
+ * loopback-PKCE write-login (`r.operator.buildCliAuthorizeUrl`/`exchangeCliToken`,
11
+ * which is the headless variant of this same browser ceremony). All three are
12
+ * the one human principal; this group is the browser/console front door that the
13
+ * hosted login pages and `@run402/sdk` consumers call.
14
+ *
15
+ * Isomorphic — no Node APIs. The token model mirrors {@link Operator.overview}:
16
+ * the public *mint* methods (`email`/`verifyEmail`/`passkey*`/`consumeRecoveryCode`)
17
+ * send no auth (the body or the magic-link token IS the credential); the
18
+ * *session-bound* methods take `opts.token` to send the `control_plane_session`
19
+ * bearer explicitly, and fall back to the credential provider's default auth
20
+ * (e.g. {@link controlPlaneSessionCredentials} or a SIWX wallet) when omitted.
21
+ *
22
+ * WebAuthn option/assertion payloads are opaque passthroughs (`unknown`) — the
23
+ * browser runs the actual ceremony; a headless client cannot.
24
+ *
25
+ * High-stakes writes (invite, membership, handoff, delete) require a **fresh
26
+ * passkey** — a magic-link/OAuth session does NOT satisfy step-up, so the
27
+ * gateway returns {@link StepUpRequiredError}; `stepUpOptions`/`stepUpVerify`
28
+ * are how a long-lived session re-establishes that freshness.
29
+ */
30
+ export class OperatorSession {
31
+ client;
32
+ constructor(client) {
33
+ this.client = client;
34
+ }
35
+ // ── login / mint (public — no auth; the body or link token is the credential) ──
36
+ /**
37
+ * Send a control-plane sign-in magic link to `email`
38
+ * (`POST /agent/v1/control-plane/session/email`). Non-enumerating: an
39
+ * identical response whether or not the email can sign in. Rate-limited.
40
+ */
41
+ async email(input) {
42
+ return this.client.request("/agent/v1/control-plane/session/email", {
43
+ method: "POST",
44
+ body: { email: input.email },
45
+ withAuth: false,
46
+ context: "sending control-plane magic link",
47
+ });
48
+ }
49
+ /**
50
+ * Exchange a magic-link token for a control-plane session
51
+ * (`POST …/session/email/verify`). Verifies the email, resolves/creates the
52
+ * principal, **auto-claims any pending invites**, and mints the session
53
+ * (`amr: ["email"]`).
54
+ */
55
+ async verifyEmail(input) {
56
+ return this.client.request("/agent/v1/control-plane/session/email/verify", {
57
+ method: "POST",
58
+ body: { token: input.token },
59
+ withAuth: false,
60
+ context: "verifying control-plane magic link",
61
+ });
62
+ }
63
+ /**
64
+ * Get WebAuthn login options for an email's passkeys
65
+ * (`POST …/session/passkey/options`). Opaque — pass `options` to the browser's
66
+ * `navigator.credentials.get`.
67
+ */
68
+ async passkeyOptions(input) {
69
+ return this.client.request("/agent/v1/control-plane/session/passkey/options", {
70
+ method: "POST",
71
+ body: { email: input.email },
72
+ withAuth: false,
73
+ context: "requesting control-plane passkey login options",
74
+ });
75
+ }
76
+ /**
77
+ * Verify a WebAuthn assertion and mint a session (`amr: ["passkey"]`)
78
+ * (`POST …/session/passkey/verify`). `response` is the opaque assertion from
79
+ * the browser.
80
+ */
81
+ async passkeyVerify(input) {
82
+ return this.client.request("/agent/v1/control-plane/session/passkey/verify", {
83
+ method: "POST",
84
+ body: { email: input.email, response: input.response },
85
+ withAuth: false,
86
+ context: "verifying control-plane passkey login",
87
+ });
88
+ }
89
+ /**
90
+ * Build the browser OAuth start URL for `provider`
91
+ * (`GET …/oauth/:provider/start`). Pure — no network. Open it in a browser;
92
+ * the gateway 302s to the provider, then the callback lands on the console
93
+ * with the session token in the URL fragment.
94
+ *
95
+ * Note: the live bridge can return `503` until the gateway provisions the
96
+ * provider's `CONTROL_PLANE_{GOOGLE,GITHUB}_*` client credentials.
97
+ */
98
+ oauthUrl(provider) {
99
+ return `${this.client.apiBase}/agent/v1/control-plane/oauth/${encodeURIComponent(provider)}/start`;
100
+ }
101
+ /**
102
+ * Run the recovery-code ceremony (`POST …/recovery/consume`). Mints a session
103
+ * with `amr: ["recovery_code"]` which **cannot** do high-stakes ops
104
+ * (`must_enroll_passkey: true`) — enrol a passkey to restore full access.
105
+ */
106
+ async consumeRecoveryCode(input) {
107
+ return this.client.request("/agent/v1/control-plane/recovery/consume", {
108
+ method: "POST",
109
+ body: { code: input.code },
110
+ withAuth: false,
111
+ context: "consuming control-plane recovery code",
112
+ });
113
+ }
114
+ // ── session lifecycle (bearer; falls back to credential provider) ──
115
+ /**
116
+ * Resolve the current session's principal + memberships + freshness
117
+ * (`GET /agent/v1/control-plane/session`). The `memberships` reflect any
118
+ * invites auto-claimed at login.
119
+ */
120
+ async whoami(opts = {}) {
121
+ return this.client.request("/agent/v1/control-plane/session", {
122
+ ...authFor(opts),
123
+ context: "resolving control-plane session",
124
+ });
125
+ }
126
+ /** Rotate the access token (`POST …/session/refresh`). */
127
+ async refresh(opts = {}) {
128
+ return this.client.request("/agent/v1/control-plane/session/refresh", {
129
+ method: "POST",
130
+ ...authFor(opts),
131
+ context: "refreshing control-plane session",
132
+ });
133
+ }
134
+ /** Sign out — revoke the session server-side (`POST …/session/revoke`). Idempotent. */
135
+ async revoke(opts = {}) {
136
+ return this.client.request("/agent/v1/control-plane/session/revoke", {
137
+ method: "POST",
138
+ ...authFor(opts),
139
+ context: "revoking control-plane session",
140
+ });
141
+ }
142
+ // ── passkey enrollment (bearer + step-up, enforced by the gateway) ──
143
+ /** WebAuthn registration options for a new passkey (`POST …/passkey/enroll/options`). */
144
+ async enrollPasskeyOptions(opts = {}) {
145
+ return this.client.request("/agent/v1/control-plane/passkey/enroll/options", {
146
+ method: "POST",
147
+ ...authFor(opts),
148
+ context: "requesting control-plane passkey enrollment options",
149
+ });
150
+ }
151
+ /** Verify a passkey registration (`POST …/passkey/enroll/verify`). `label` names the authenticator. */
152
+ async enrollPasskeyVerify(input) {
153
+ const { token, response, label } = input;
154
+ return this.client.request("/agent/v1/control-plane/passkey/enroll/verify", {
155
+ method: "POST",
156
+ body: { response, ...(label !== undefined ? { label } : {}) },
157
+ ...authFor({ token }),
158
+ context: "verifying control-plane passkey enrollment",
159
+ });
160
+ }
161
+ // ── step-up ceremony (bearer) ──
162
+ /**
163
+ * WebAuthn step-up options for a high-stakes op (`POST …/step-up/options`).
164
+ * `opClass` binds the elevation, e.g. `"org.invite"` / `"org.membership"` /
165
+ * `"project.transfer"` (see {@link StepUpRequiredError.requiredAmr}).
166
+ */
167
+ async stepUpOptions(input = {}) {
168
+ const { token, opClass } = input;
169
+ return this.client.request("/agent/v1/control-plane/step-up/options", {
170
+ method: "POST",
171
+ body: opClass ? { op_class: opClass } : {},
172
+ ...authFor({ token }),
173
+ context: "requesting control-plane step-up options",
174
+ });
175
+ }
176
+ /**
177
+ * Verify a step-up assertion (`POST …/step-up/verify`) → refreshes session
178
+ * passkey-freshness and records an action-bound elevation when `opClass` (and
179
+ * optionally `objectKind`/`objectId`) are given. Retry the gated write after.
180
+ */
181
+ async stepUpVerify(input) {
182
+ const { token, response, opClass, objectKind, objectId } = input;
183
+ return this.client.request("/agent/v1/control-plane/step-up/verify", {
184
+ method: "POST",
185
+ body: {
186
+ response,
187
+ ...(opClass !== undefined ? { op_class: opClass } : {}),
188
+ ...(objectKind !== undefined ? { object_kind: objectKind } : {}),
189
+ ...(objectId !== undefined ? { object_id: objectId } : {}),
190
+ },
191
+ ...authFor({ token }),
192
+ context: "verifying control-plane step-up",
193
+ });
194
+ }
195
+ // ── recovery codes (bearer + step-up) ──
196
+ /** (Re)issue recovery codes — shown ONCE (`POST …/recovery/issue`). */
197
+ async issueRecoveryCodes(opts = {}) {
198
+ return this.client.request("/agent/v1/control-plane/recovery/issue", {
199
+ method: "POST",
200
+ ...authFor(opts),
201
+ context: "issuing control-plane recovery codes",
202
+ });
203
+ }
204
+ // ── authenticator management (bearer) ──
205
+ /** List my active authenticators — no secret material (`GET …/authenticators`). */
206
+ async listAuthenticators(opts = {}) {
207
+ const res = await this.client.request("/agent/v1/control-plane/authenticators", { ...authFor(opts), context: "listing control-plane authenticators" });
208
+ return res.authenticators ?? [];
209
+ }
210
+ /**
211
+ * Revoke an authenticator (`DELETE …/authenticators/:id`). Step-up enforced;
212
+ * the gateway refuses to remove the last passkey of a sole org owner
213
+ * (`OWNER_NEEDS_PASSKEY`).
214
+ */
215
+ async revokeAuthenticator(input) {
216
+ const { token, id } = input;
217
+ return this.client.request(`/agent/v1/control-plane/authenticators/${encodeURIComponent(id)}`, { method: "DELETE", ...authFor({ token }), context: "revoking control-plane authenticator" });
218
+ }
219
+ }
220
+ /**
221
+ * Build the auth half of a request: explicit `Authorization: Bearer <token>`
222
+ * (and `withAuth: false`) when a token is passed, else fall through to the
223
+ * credential provider (`withAuth` defaults true). Mirrors {@link Operator.overview}.
224
+ */
225
+ function authFor(opts) {
226
+ return opts.token
227
+ ? { headers: { Authorization: `Bearer ${opts.token}` }, withAuth: false }
228
+ : {};
229
+ }
230
+ //# sourceMappingURL=operator-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator-session.js","sourceRoot":"","sources":["../../src/namespaces/operator-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAqGH,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,kFAAkF;IAElF;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,KAAwB;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsB,uCAAuC,EAAE;YACvF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE;YAC5B,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,kCAAkC;SAC5C,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CAAC,KAAwB;QACxC,OAAO,IAAI,CAA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ACT,CAAC"}
@@ -18,6 +18,7 @@
18
18
  * Gateway contract: kychee-com/run402-private#443 (RFC 8628 device-auth bridge).
19
19
  */
20
20
  import type { Client } from "../kernel.js";
21
+ import { OperatorSession } from "./operator-session.js";
21
22
  /** RFC 8628 device-authorization start response. */
22
23
  export interface DeviceAuthStart {
23
24
  device_code: string;
@@ -115,6 +116,15 @@ export interface CliTokenExchange {
115
116
  }
116
117
  export declare class Operator {
117
118
  private readonly client;
119
+ /**
120
+ * The hosted/browser control-plane **session** surface (gateway v1.78):
121
+ * `r.operator.session.email`, `verifyEmail`, `passkeyVerify`, `whoami`,
122
+ * `refresh`, `revoke`, and the step-up / authenticator helpers.
123
+ * The write-capable human login + step-up + authenticators, distinct from the
124
+ * read-only device/overview methods on this class and the loopback-PKCE
125
+ * CLI write-login below. See {@link OperatorSession}.
126
+ */
127
+ readonly session: OperatorSession;
118
128
  constructor(client: Client);
119
129
  /**
120
130
  * Begin the device-authorization flow. Unauthenticated. Returns the codes the
@@ -1 +1 @@
1
- {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/namespaces/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5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QAAQ,CAAC,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAaxE;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpD;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM;IAWxD;;;;OAIG;IACG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAa/E"}
@@ -18,6 +18,7 @@
18
18
  * Gateway contract: kychee-com/run402-private#443 (RFC 8628 device-auth bridge).
19
19
  */
20
20
  import { ApiError, NetworkError } from "../errors.js";
21
+ import { OperatorSession } from "./operator-session.js";
21
22
  const POLL_ERROR_CODES = new Set([
22
23
  "authorization_pending",
23
24
  "slow_down",
@@ -26,8 +27,18 @@ const POLL_ERROR_CODES = new Set([
26
27
  ]);
27
28
  export class Operator {
28
29
  client;
30
+ /**
31
+ * The hosted/browser control-plane **session** surface (gateway v1.78):
32
+ * `r.operator.session.email`, `verifyEmail`, `passkeyVerify`, `whoami`,
33
+ * `refresh`, `revoke`, and the step-up / authenticator helpers.
34
+ * The write-capable human login + step-up + authenticators, distinct from the
35
+ * read-only device/overview methods on this class and the loopback-PKCE
36
+ * CLI write-login below. See {@link OperatorSession}.
37
+ */
38
+ session;
29
39
  constructor(client) {
30
40
  this.client = client;
41
+ this.session = new OperatorSession(client);
31
42
  }
32
43
  /**
33
44
  * Begin the device-authorization flow. Unauthenticated. Returns the codes the
@@ -1 +1 @@
1
- {"version":3,"file":"operator.js","sourceRoot":"","sources":["../../src/namespaces/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA+FtD,MAAM,gBAAgB,GAAG,IAAI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