@onkernel/sdk 0.30.0 → 0.32.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 (111) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/client.d.mts +8 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +3 -2
  11. package/resources/agents/auth/auth.d.mts +115 -46
  12. package/resources/agents/auth/auth.d.mts.map +1 -1
  13. package/resources/agents/auth/auth.d.ts +115 -46
  14. package/resources/agents/auth/auth.d.ts.map +1 -1
  15. package/resources/agents/auth/auth.js +15 -30
  16. package/resources/agents/auth/auth.js.map +1 -1
  17. package/resources/agents/auth/auth.mjs +15 -30
  18. package/resources/agents/auth/auth.mjs.map +1 -1
  19. package/resources/agents/auth/invocations.d.mts +18 -47
  20. package/resources/agents/auth/invocations.d.mts.map +1 -1
  21. package/resources/agents/auth/invocations.d.ts +18 -47
  22. package/resources/agents/auth/invocations.d.ts.map +1 -1
  23. package/resources/agents/auth/invocations.js +16 -45
  24. package/resources/agents/auth/invocations.js.map +1 -1
  25. package/resources/agents/auth/invocations.mjs +16 -45
  26. package/resources/agents/auth/invocations.mjs.map +1 -1
  27. package/resources/auth/auth.d.mts +10 -0
  28. package/resources/auth/auth.d.mts.map +1 -0
  29. package/resources/auth/auth.d.ts +10 -0
  30. package/resources/auth/auth.d.ts.map +1 -0
  31. package/resources/auth/auth.js +17 -0
  32. package/resources/auth/auth.js.map +1 -0
  33. package/resources/auth/auth.mjs +12 -0
  34. package/resources/auth/auth.mjs.map +1 -0
  35. package/resources/auth/connections.d.mts +688 -0
  36. package/resources/auth/connections.d.mts.map +1 -0
  37. package/resources/auth/connections.d.ts +688 -0
  38. package/resources/auth/connections.d.ts.map +1 -0
  39. package/resources/auth/connections.js +123 -0
  40. package/resources/auth/connections.js.map +1 -0
  41. package/resources/auth/connections.mjs +119 -0
  42. package/resources/auth/connections.mjs.map +1 -0
  43. package/resources/auth/index.d.mts +3 -0
  44. package/resources/auth/index.d.mts.map +1 -0
  45. package/resources/auth/index.d.ts +3 -0
  46. package/resources/auth/index.d.ts.map +1 -0
  47. package/resources/auth/index.js +9 -0
  48. package/resources/auth/index.js.map +1 -0
  49. package/resources/auth/index.mjs +4 -0
  50. package/resources/auth/index.mjs.map +1 -0
  51. package/resources/auth.d.mts +2 -0
  52. package/resources/auth.d.mts.map +1 -0
  53. package/resources/auth.d.ts +2 -0
  54. package/resources/auth.d.ts.map +1 -0
  55. package/resources/auth.js +6 -0
  56. package/resources/auth.js.map +1 -0
  57. package/resources/auth.mjs +3 -0
  58. package/resources/auth.mjs.map +1 -0
  59. package/resources/browsers/browsers.d.mts +2 -2
  60. package/resources/browsers/browsers.d.mts.map +1 -1
  61. package/resources/browsers/browsers.d.ts +2 -2
  62. package/resources/browsers/browsers.d.ts.map +1 -1
  63. package/resources/browsers/browsers.js.map +1 -1
  64. package/resources/browsers/browsers.mjs.map +1 -1
  65. package/resources/browsers/computer.d.mts +199 -1
  66. package/resources/browsers/computer.d.mts.map +1 -1
  67. package/resources/browsers/computer.d.ts +199 -1
  68. package/resources/browsers/computer.d.ts.map +1 -1
  69. package/resources/browsers/computer.js +31 -0
  70. package/resources/browsers/computer.js.map +1 -1
  71. package/resources/browsers/computer.mjs +31 -0
  72. package/resources/browsers/computer.mjs.map +1 -1
  73. package/resources/browsers/index.d.mts +1 -1
  74. package/resources/browsers/index.d.mts.map +1 -1
  75. package/resources/browsers/index.d.ts +1 -1
  76. package/resources/browsers/index.d.ts.map +1 -1
  77. package/resources/browsers/index.js.map +1 -1
  78. package/resources/browsers/index.mjs.map +1 -1
  79. package/resources/credential-providers.d.mts +66 -1
  80. package/resources/credential-providers.d.mts.map +1 -1
  81. package/resources/credential-providers.d.ts +66 -1
  82. package/resources/credential-providers.d.ts.map +1 -1
  83. package/resources/credential-providers.js +21 -6
  84. package/resources/credential-providers.js.map +1 -1
  85. package/resources/credential-providers.mjs +21 -6
  86. package/resources/credential-providers.mjs.map +1 -1
  87. package/resources/index.d.mts +2 -1
  88. package/resources/index.d.mts.map +1 -1
  89. package/resources/index.d.ts +2 -1
  90. package/resources/index.d.ts.map +1 -1
  91. package/resources/index.js +3 -1
  92. package/resources/index.js.map +1 -1
  93. package/resources/index.mjs +1 -0
  94. package/resources/index.mjs.map +1 -1
  95. package/src/client.ts +24 -4
  96. package/src/resources/agents/auth/auth.ts +121 -46
  97. package/src/resources/agents/auth/invocations.ts +18 -47
  98. package/src/resources/auth/auth.ts +43 -0
  99. package/src/resources/auth/connections.ts +848 -0
  100. package/src/resources/auth/index.ts +18 -0
  101. package/src/resources/auth.ts +3 -0
  102. package/src/resources/browsers/browsers.ts +4 -0
  103. package/src/resources/browsers/computer.ts +257 -0
  104. package/src/resources/browsers/index.ts +2 -0
  105. package/src/resources/credential-providers.ts +88 -6
  106. package/src/resources/index.ts +3 -0
  107. package/src/version.ts +1 -1
  108. package/version.d.mts +1 -1
  109. package/version.d.ts +1 -1
  110. package/version.js +1 -1
  111. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -34,6 +34,8 @@ import {
34
34
  CreateCredentialProviderRequest,
35
35
  CredentialProvider,
36
36
  CredentialProviderCreateParams,
37
+ CredentialProviderItem,
38
+ CredentialProviderListItemsResponse,
37
39
  CredentialProviderListResponse,
38
40
  CredentialProviderTestResult,
39
41
  CredentialProviderUpdateParams,
@@ -96,6 +98,7 @@ import {
96
98
  ProxyRetrieveResponse,
97
99
  } from './resources/proxies';
98
100
  import { Agents } from './resources/agents/agents';
101
+ import { Auth } from './resources/auth/auth';
99
102
  import {
100
103
  BrowserCreateParams,
101
104
  BrowserCreateResponse,
@@ -616,9 +619,14 @@ export class Kernel {
616
619
  getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
617
620
  path: string,
618
621
  Page: new (...args: any[]) => PageClass,
619
- opts?: RequestOptions,
622
+ opts?: PromiseOrValue<RequestOptions>,
620
623
  ): Pagination.PagePromise<PageClass, Item> {
621
- return this.requestAPIList(Page, { method: 'get', path, ...opts });
624
+ return this.requestAPIList(
625
+ Page,
626
+ opts && 'then' in opts ?
627
+ opts.then((opts) => ({ method: 'get', path, ...opts }))
628
+ : { method: 'get', path, ...opts },
629
+ );
622
630
  }
623
631
 
624
632
  requestAPIList<
@@ -626,7 +634,7 @@ export class Kernel {
626
634
  PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
627
635
  >(
628
636
  Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
629
- options: FinalRequestOptions,
637
+ options: PromiseOrValue<FinalRequestOptions>,
630
638
  ): Pagination.PagePromise<PageClass, Item> {
631
639
  const request = this.makeRequest(options, null, undefined);
632
640
  return new Pagination.PagePromise<PageClass, Item>(this as any as Kernel, request, Page);
@@ -639,7 +647,7 @@ export class Kernel {
639
647
  controller: AbortController,
640
648
  ): Promise<Response> {
641
649
  const { signal, method, ...options } = init || {};
642
- const abort = controller.abort.bind(controller);
650
+ const abort = this._makeAbort(controller);
643
651
  if (signal) signal.addEventListener('abort', abort, { once: true });
644
652
 
645
653
  const timeout = setTimeout(abort, ms);
@@ -809,6 +817,12 @@ export class Kernel {
809
817
  return headers.values;
810
818
  }
811
819
 
820
+ private _makeAbort(controller: AbortController) {
821
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
822
+ // would capture all request options, and cause a memory leak.
823
+ return () => controller.abort();
824
+ }
825
+
812
826
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
813
827
  bodyHeaders: HeadersLike;
814
828
  body: BodyInit | undefined;
@@ -880,6 +894,7 @@ export class Kernel {
880
894
  invocations: API.Invocations = new API.Invocations(this);
881
895
  browsers: API.Browsers = new API.Browsers(this);
882
896
  profiles: API.Profiles = new API.Profiles(this);
897
+ auth: API.Auth = new API.Auth(this);
883
898
  proxies: API.Proxies = new API.Proxies(this);
884
899
  extensions: API.Extensions = new API.Extensions(this);
885
900
  browserPools: API.BrowserPools = new API.BrowserPools(this);
@@ -893,6 +908,7 @@ Kernel.Apps = Apps;
893
908
  Kernel.Invocations = Invocations;
894
909
  Kernel.Browsers = Browsers;
895
910
  Kernel.Profiles = Profiles;
911
+ Kernel.Auth = Auth;
896
912
  Kernel.Proxies = Proxies;
897
913
  Kernel.Extensions = Extensions;
898
914
  Kernel.BrowserPools = BrowserPools;
@@ -968,6 +984,8 @@ export declare namespace Kernel {
968
984
  type ProfileCreateParams as ProfileCreateParams,
969
985
  };
970
986
 
987
+ export { Auth as Auth };
988
+
971
989
  export {
972
990
  Proxies as Proxies,
973
991
  type ProxyCreateResponse as ProxyCreateResponse,
@@ -1015,9 +1033,11 @@ export declare namespace Kernel {
1015
1033
  CredentialProviders as CredentialProviders,
1016
1034
  type CreateCredentialProviderRequest as CreateCredentialProviderRequest,
1017
1035
  type CredentialProvider as CredentialProvider,
1036
+ type CredentialProviderItem as CredentialProviderItem,
1018
1037
  type CredentialProviderTestResult as CredentialProviderTestResult,
1019
1038
  type UpdateCredentialProviderRequest as UpdateCredentialProviderRequest,
1020
1039
  type CredentialProviderListResponse as CredentialProviderListResponse,
1040
+ type CredentialProviderListItemsResponse as CredentialProviderListItemsResponse,
1021
1041
  type CredentialProviderCreateParams as CredentialProviderCreateParams,
1022
1042
  type CredentialProviderUpdateParams as CredentialProviderUpdateParams,
1023
1043
  };
@@ -19,46 +19,33 @@ export class Auth extends APIResource {
19
19
  invocations: InvocationsAPI.Invocations = new InvocationsAPI.Invocations(this._client);
20
20
 
21
21
  /**
22
- * Creates a new auth agent for the specified domain and profile combination, or
23
- * returns an existing one if it already exists. This is idempotent - calling with
24
- * the same domain and profile will return the same agent. Does NOT start an
25
- * invocation - use POST /agents/auth/invocations to start an auth flow.
22
+ * **Deprecated: Use POST /auth/connections instead.** Creates a new auth agent for
23
+ * the specified domain and profile combination, or returns an existing one if it
24
+ * already exists. This is idempotent - calling with the same domain and profile
25
+ * will return the same agent. Does NOT start an invocation - use POST
26
+ * /agents/auth/invocations to start an auth flow.
26
27
  *
27
- * @example
28
- * ```ts
29
- * const authAgent = await client.agents.auth.create({
30
- * domain: 'netflix.com',
31
- * profile_name: 'user-123',
32
- * });
33
- * ```
28
+ * @deprecated
34
29
  */
35
30
  create(body: AuthCreateParams, options?: RequestOptions): APIPromise<AuthAgent> {
36
31
  return this._client.post('/agents/auth', { body, ...options });
37
32
  }
38
33
 
39
34
  /**
40
- * Retrieve an auth agent by its ID. Returns the current authentication status of
41
- * the managed profile.
35
+ * **Deprecated: Use GET /auth/connections/{id} instead.** Retrieve an auth agent
36
+ * by its ID. Returns the current authentication status of the managed profile.
42
37
  *
43
- * @example
44
- * ```ts
45
- * const authAgent = await client.agents.auth.retrieve('id');
46
- * ```
38
+ * @deprecated
47
39
  */
48
40
  retrieve(id: string, options?: RequestOptions): APIPromise<AuthAgent> {
49
41
  return this._client.get(path`/agents/auth/${id}`, options);
50
42
  }
51
43
 
52
44
  /**
53
- * List auth agents with optional filters for profile_name and domain.
45
+ * **Deprecated: Use GET /auth/connections instead.** List auth agents with
46
+ * optional filters for profile_name and domain.
54
47
  *
55
- * @example
56
- * ```ts
57
- * // Automatically fetches more pages as needed.
58
- * for await (const authAgent of client.agents.auth.list()) {
59
- * // ...
60
- * }
61
- * ```
48
+ * @deprecated
62
49
  */
63
50
  list(
64
51
  query: AuthListParams | null | undefined = {},
@@ -68,16 +55,14 @@ export class Auth extends APIResource {
68
55
  }
69
56
 
70
57
  /**
71
- * Deletes an auth agent and terminates its workflow. This will:
58
+ * **Deprecated: Use DELETE /auth/connections/{id} instead.** Deletes an auth agent
59
+ * and terminates its workflow. This will:
72
60
  *
73
61
  * - Soft delete the auth agent record
74
62
  * - Gracefully terminate the agent's Temporal workflow
75
63
  * - Cancel any in-progress invocations
76
64
  *
77
- * @example
78
- * ```ts
79
- * await client.agents.auth.delete('id');
80
- * ```
65
+ * @deprecated
81
66
  */
82
67
  delete(id: string, options?: RequestOptions): APIPromise<void> {
83
68
  return this._client.delete(path`/agents/auth/${id}`, {
@@ -126,13 +111,12 @@ export interface AgentAuthInvocationResponse {
126
111
  | 'expired';
127
112
 
128
113
  /**
129
- * The invocation type:
114
+ * The session type:
130
115
  *
131
- * - login: First-time authentication
132
- * - reauth: Re-authentication for previously authenticated agents
133
- * - auto_login: Legacy type (no longer created, kept for backward compatibility)
116
+ * - login: User-initiated authentication
117
+ * - reauth: System-triggered re-authentication (via health check)
134
118
  */
135
- type: 'login' | 'auto_login' | 'reauth';
119
+ type: 'login' | 'reauth';
136
120
 
137
121
  /**
138
122
  * Error message explaining why the invocation failed (present when status=FAILED)
@@ -188,9 +172,9 @@ export namespace AgentAuthInvocationResponse {
188
172
  label: string;
189
173
 
190
174
  /**
191
- * The MFA delivery method type
175
+ * The MFA delivery method type (includes password for auth method selection pages)
192
176
  */
193
- type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'security_key';
177
+ type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'password';
194
178
 
195
179
  /**
196
180
  * Additional instructions from the site
@@ -263,6 +247,21 @@ export interface AuthAgent {
263
247
  * Additional domains that are valid for this auth agent's authentication flow
264
248
  * (besides the primary domain). Useful when login pages redirect to different
265
249
  * domains.
250
+ *
251
+ * The following SSO/OAuth provider domains are automatically allowed by default
252
+ * and do not need to be specified:
253
+ *
254
+ * - Google: accounts.google.com
255
+ * - Microsoft/Azure AD: login.microsoftonline.com, login.live.com
256
+ * - Okta: _.okta.com, _.oktapreview.com
257
+ * - Auth0: _.auth0.com, _.us.auth0.com, _.eu.auth0.com, _.au.auth0.com
258
+ * - Apple: appleid.apple.com
259
+ * - GitHub: github.com
260
+ * - Facebook/Meta: www.facebook.com
261
+ * - LinkedIn: www.linkedin.com
262
+ * - Amazon Cognito: \*.amazoncognito.com
263
+ * - OneLogin: \*.onelogin.com
264
+ * - Ping Identity: _.pingone.com, _.pingidentity.com
266
265
  */
267
266
  allowed_domains?: Array<string>;
268
267
 
@@ -273,14 +272,24 @@ export interface AuthAgent {
273
272
  can_reauth?: boolean;
274
273
 
275
274
  /**
276
- * ID of the linked credential for automatic re-authentication
275
+ * Reason why automatic re-authentication is or is not possible
277
276
  */
278
- credential_id?: string;
277
+ can_reauth_reason?: string;
279
278
 
280
279
  /**
281
- * Name of the linked credential for automatic re-authentication
280
+ * Reference to credentials for managed auth. Use one of:
281
+ *
282
+ * - { name } for Kernel credentials
283
+ * - { provider, path } for external provider item
284
+ * - { provider, auto: true } for external provider domain lookup
282
285
  */
283
- credential_name?: string;
286
+ credential?: AuthAgent.Credential;
287
+
288
+ /**
289
+ * ID of the linked Kernel credential for automatic re-authentication (deprecated,
290
+ * use credential)
291
+ */
292
+ credential_id?: string;
284
293
 
285
294
  /**
286
295
  * Whether this auth agent has stored selectors for deterministic re-authentication
@@ -299,6 +308,37 @@ export interface AuthAgent {
299
308
  post_login_url?: string;
300
309
  }
301
310
 
311
+ export namespace AuthAgent {
312
+ /**
313
+ * Reference to credentials for managed auth. Use one of:
314
+ *
315
+ * - { name } for Kernel credentials
316
+ * - { provider, path } for external provider item
317
+ * - { provider, auto: true } for external provider domain lookup
318
+ */
319
+ export interface Credential {
320
+ /**
321
+ * If true, lookup by domain from the specified provider
322
+ */
323
+ auto?: boolean;
324
+
325
+ /**
326
+ * Kernel credential name
327
+ */
328
+ name?: string;
329
+
330
+ /**
331
+ * Provider-specific path (e.g., "VaultName/ItemName" for 1Password)
332
+ */
333
+ path?: string;
334
+
335
+ /**
336
+ * External provider name (e.g., "my-1p")
337
+ */
338
+ provider?: string;
339
+ }
340
+ }
341
+
302
342
  /**
303
343
  * Request to create or find an auth agent
304
344
  */
@@ -317,6 +357,21 @@ export interface AuthAgentCreateRequest {
317
357
  * Additional domains that are valid for this auth agent's authentication flow
318
358
  * (besides the primary domain). Useful when login pages redirect to different
319
359
  * domains.
360
+ *
361
+ * The following SSO/OAuth provider domains are automatically allowed by default
362
+ * and do not need to be specified:
363
+ *
364
+ * - Google: accounts.google.com
365
+ * - Microsoft/Azure AD: login.microsoftonline.com, login.live.com
366
+ * - Okta: _.okta.com, _.oktapreview.com
367
+ * - Auth0: _.auth0.com, _.us.auth0.com, _.eu.auth0.com, _.au.auth0.com
368
+ * - Apple: appleid.apple.com
369
+ * - GitHub: github.com
370
+ * - Facebook/Meta: www.facebook.com
371
+ * - LinkedIn: www.linkedin.com
372
+ * - Amazon Cognito: \*.amazoncognito.com
373
+ * - OneLogin: \*.onelogin.com
374
+ * - Ping Identity: _.pingone.com, _.pingidentity.com
320
375
  */
321
376
  allowed_domains?: Array<string>;
322
377
 
@@ -393,13 +448,12 @@ export interface AuthAgentInvocationCreateResponse {
393
448
  invocation_id: string;
394
449
 
395
450
  /**
396
- * The invocation type:
451
+ * The session type:
397
452
  *
398
- * - login: First-time authentication
399
- * - reauth: Re-authentication for previously authenticated agents
400
- * - auto_login: Legacy type (no longer created, kept for backward compatibility)
453
+ * - login: User-initiated authentication
454
+ * - reauth: System-triggered re-authentication (via health check)
401
455
  */
402
- type: 'login' | 'auto_login' | 'reauth';
456
+ type: 'login' | 'reauth';
403
457
  }
404
458
 
405
459
  /**
@@ -426,6 +480,12 @@ export interface DiscoveredField {
426
480
  */
427
481
  type: 'text' | 'email' | 'password' | 'tel' | 'number' | 'url' | 'code' | 'totp';
428
482
 
483
+ /**
484
+ * If this field is associated with an MFA option, the type of that option (e.g.,
485
+ * password field linked to "Enter password" option)
486
+ */
487
+ linked_mfa_type?: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'password' | null;
488
+
429
489
  /**
430
490
  * Field placeholder
431
491
  */
@@ -452,6 +512,21 @@ export interface AuthCreateParams {
452
512
  * Additional domains that are valid for this auth agent's authentication flow
453
513
  * (besides the primary domain). Useful when login pages redirect to different
454
514
  * domains.
515
+ *
516
+ * The following SSO/OAuth provider domains are automatically allowed by default
517
+ * and do not need to be specified:
518
+ *
519
+ * - Google: accounts.google.com
520
+ * - Microsoft/Azure AD: login.microsoftonline.com, login.live.com
521
+ * - Okta: _.okta.com, _.oktapreview.com
522
+ * - Auth0: _.auth0.com, _.us.auth0.com, _.eu.auth0.com, _.au.auth0.com
523
+ * - Apple: appleid.apple.com
524
+ * - GitHub: github.com
525
+ * - Facebook/Meta: www.facebook.com
526
+ * - LinkedIn: www.linkedin.com
527
+ * - Amazon Cognito: \*.amazoncognito.com
528
+ * - OneLogin: \*.onelogin.com
529
+ * - Ping Identity: _.pingone.com, _.pingidentity.com
455
530
  */
456
531
  allowed_domains?: Array<string>;
457
532
 
@@ -8,17 +8,11 @@ import { path } from '../../../internal/utils/path';
8
8
 
9
9
  export class Invocations extends APIResource {
10
10
  /**
11
- * Creates a new authentication invocation for the specified auth agent. This
12
- * starts the auth flow and returns a hosted URL for the user to complete
13
- * authentication.
11
+ * **Deprecated: Use POST /auth/connections/{id}/login instead.** Creates a new
12
+ * authentication invocation for the specified auth agent. This starts the auth
13
+ * flow and returns a hosted URL for the user to complete authentication.
14
14
  *
15
- * @example
16
- * ```ts
17
- * const authAgentInvocationCreateResponse =
18
- * await client.agents.auth.invocations.create({
19
- * auth_agent_id: 'abc123xyz',
20
- * });
21
- * ```
15
+ * @deprecated
22
16
  */
23
17
  create(
24
18
  body: InvocationCreateParams,
@@ -28,33 +22,22 @@ export class Invocations extends APIResource {
28
22
  }
29
23
 
30
24
  /**
31
- * Returns invocation details including status, app_name, and domain. Supports both
32
- * API key and JWT (from exchange endpoint) authentication.
25
+ * **Deprecated: Use GET /auth/connections/{id} instead.** Returns invocation
26
+ * details including status, app_name, and domain. Supports both API key and JWT
27
+ * (from exchange endpoint) authentication.
33
28
  *
34
- * @example
35
- * ```ts
36
- * const agentAuthInvocationResponse =
37
- * await client.agents.auth.invocations.retrieve(
38
- * 'invocation_id',
39
- * );
40
- * ```
29
+ * @deprecated
41
30
  */
42
31
  retrieve(invocationID: string, options?: RequestOptions): APIPromise<AuthAPI.AgentAuthInvocationResponse> {
43
32
  return this._client.get(path`/agents/auth/invocations/${invocationID}`, options);
44
33
  }
45
34
 
46
35
  /**
47
- * Validates the handoff code and returns a JWT token for subsequent requests. No
48
- * authentication required (the handoff code serves as the credential).
36
+ * **Deprecated: Use POST /auth/connections/{id}/exchange instead.** Validates the
37
+ * handoff code and returns a JWT token for subsequent requests. No authentication
38
+ * required (the handoff code serves as the credential).
49
39
  *
50
- * @example
51
- * ```ts
52
- * const response =
53
- * await client.agents.auth.invocations.exchange(
54
- * 'invocation_id',
55
- * { code: 'abc123xyz' },
56
- * );
57
- * ```
40
+ * @deprecated
58
41
  */
59
42
  exchange(
60
43
  invocationID: string,
@@ -65,23 +48,11 @@ export class Invocations extends APIResource {
65
48
  }
66
49
 
67
50
  /**
68
- * Submits field values for the discovered login form. Returns immediately after
69
- * submission is accepted. Poll the invocation endpoint to track progress and get
70
- * results.
51
+ * **Deprecated: Use POST /auth/connections/{id}/submit instead.** Submits field
52
+ * values for the discovered login form. Returns immediately after submission is
53
+ * accepted. Poll the invocation endpoint to track progress and get results.
71
54
  *
72
- * @example
73
- * ```ts
74
- * const agentAuthSubmitResponse =
75
- * await client.agents.auth.invocations.submit(
76
- * 'invocation_id',
77
- * {
78
- * field_values: {
79
- * email: 'user@example.com',
80
- * password: '********',
81
- * },
82
- * },
83
- * );
84
- * ```
55
+ * @deprecated
85
56
  */
86
57
  submit(
87
58
  invocationID: string,
@@ -150,9 +121,9 @@ export declare namespace InvocationSubmitParams {
150
121
 
151
122
  export interface Variant2 {
152
123
  /**
153
- * The MFA delivery method type
124
+ * The MFA delivery method type (includes password for auth method selection pages)
154
125
  */
155
- selected_mfa_type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'security_key';
126
+ selected_mfa_type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'password';
156
127
  }
157
128
  }
158
129
 
@@ -0,0 +1,43 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as ConnectionsAPI from './connections';
5
+ import {
6
+ ConnectionCreateParams,
7
+ ConnectionFollowResponse,
8
+ ConnectionListParams,
9
+ ConnectionLoginParams,
10
+ ConnectionSubmitParams,
11
+ Connections,
12
+ LoginRequest,
13
+ LoginResponse,
14
+ ManagedAuth,
15
+ ManagedAuthCreateRequest,
16
+ ManagedAuthsOffsetPagination,
17
+ SubmitFieldsRequest,
18
+ SubmitFieldsResponse,
19
+ } from './connections';
20
+
21
+ export class Auth extends APIResource {
22
+ connections: ConnectionsAPI.Connections = new ConnectionsAPI.Connections(this._client);
23
+ }
24
+
25
+ Auth.Connections = Connections;
26
+
27
+ export declare namespace Auth {
28
+ export {
29
+ Connections as Connections,
30
+ type LoginRequest as LoginRequest,
31
+ type LoginResponse as LoginResponse,
32
+ type ManagedAuth as ManagedAuth,
33
+ type ManagedAuthCreateRequest as ManagedAuthCreateRequest,
34
+ type SubmitFieldsRequest as SubmitFieldsRequest,
35
+ type SubmitFieldsResponse as SubmitFieldsResponse,
36
+ type ConnectionFollowResponse as ConnectionFollowResponse,
37
+ type ManagedAuthsOffsetPagination as ManagedAuthsOffsetPagination,
38
+ type ConnectionCreateParams as ConnectionCreateParams,
39
+ type ConnectionListParams as ConnectionListParams,
40
+ type ConnectionLoginParams as ConnectionLoginParams,
41
+ type ConnectionSubmitParams as ConnectionSubmitParams,
42
+ };
43
+ }