@onkernel/sdk 0.29.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 (127) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/client.d.mts +10 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +14 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +3 -2
  17. package/resources/agents/auth/auth.d.mts +115 -46
  18. package/resources/agents/auth/auth.d.mts.map +1 -1
  19. package/resources/agents/auth/auth.d.ts +115 -46
  20. package/resources/agents/auth/auth.d.ts.map +1 -1
  21. package/resources/agents/auth/auth.js +15 -30
  22. package/resources/agents/auth/auth.js.map +1 -1
  23. package/resources/agents/auth/auth.mjs +15 -30
  24. package/resources/agents/auth/auth.mjs.map +1 -1
  25. package/resources/agents/auth/invocations.d.mts +18 -47
  26. package/resources/agents/auth/invocations.d.mts.map +1 -1
  27. package/resources/agents/auth/invocations.d.ts +18 -47
  28. package/resources/agents/auth/invocations.d.ts.map +1 -1
  29. package/resources/agents/auth/invocations.js +16 -45
  30. package/resources/agents/auth/invocations.js.map +1 -1
  31. package/resources/agents/auth/invocations.mjs +16 -45
  32. package/resources/agents/auth/invocations.mjs.map +1 -1
  33. package/resources/auth/auth.d.mts +10 -0
  34. package/resources/auth/auth.d.mts.map +1 -0
  35. package/resources/auth/auth.d.ts +10 -0
  36. package/resources/auth/auth.d.ts.map +1 -0
  37. package/resources/auth/auth.js +17 -0
  38. package/resources/auth/auth.js.map +1 -0
  39. package/resources/auth/auth.mjs +12 -0
  40. package/resources/auth/auth.mjs.map +1 -0
  41. package/resources/auth/connections.d.mts +688 -0
  42. package/resources/auth/connections.d.mts.map +1 -0
  43. package/resources/auth/connections.d.ts +688 -0
  44. package/resources/auth/connections.d.ts.map +1 -0
  45. package/resources/auth/connections.js +123 -0
  46. package/resources/auth/connections.js.map +1 -0
  47. package/resources/auth/connections.mjs +119 -0
  48. package/resources/auth/connections.mjs.map +1 -0
  49. package/resources/auth/index.d.mts +3 -0
  50. package/resources/auth/index.d.mts.map +1 -0
  51. package/resources/auth/index.d.ts +3 -0
  52. package/resources/auth/index.d.ts.map +1 -0
  53. package/resources/auth/index.js +9 -0
  54. package/resources/auth/index.js.map +1 -0
  55. package/resources/auth/index.mjs +4 -0
  56. package/resources/auth/index.mjs.map +1 -0
  57. package/resources/auth.d.mts +2 -0
  58. package/resources/auth.d.mts.map +1 -0
  59. package/resources/auth.d.ts +2 -0
  60. package/resources/auth.d.ts.map +1 -0
  61. package/resources/auth.js +6 -0
  62. package/resources/auth.js.map +1 -0
  63. package/resources/auth.mjs +3 -0
  64. package/resources/auth.mjs.map +1 -0
  65. package/resources/browsers/browsers.d.mts +2 -2
  66. package/resources/browsers/browsers.d.mts.map +1 -1
  67. package/resources/browsers/browsers.d.ts +2 -2
  68. package/resources/browsers/browsers.d.ts.map +1 -1
  69. package/resources/browsers/browsers.js.map +1 -1
  70. package/resources/browsers/browsers.mjs.map +1 -1
  71. package/resources/browsers/computer.d.mts +199 -1
  72. package/resources/browsers/computer.d.mts.map +1 -1
  73. package/resources/browsers/computer.d.ts +199 -1
  74. package/resources/browsers/computer.d.ts.map +1 -1
  75. package/resources/browsers/computer.js +31 -0
  76. package/resources/browsers/computer.js.map +1 -1
  77. package/resources/browsers/computer.mjs +31 -0
  78. package/resources/browsers/computer.mjs.map +1 -1
  79. package/resources/browsers/index.d.mts +1 -1
  80. package/resources/browsers/index.d.mts.map +1 -1
  81. package/resources/browsers/index.d.ts +1 -1
  82. package/resources/browsers/index.d.ts.map +1 -1
  83. package/resources/browsers/index.js.map +1 -1
  84. package/resources/browsers/index.mjs.map +1 -1
  85. package/resources/credential-providers.d.mts +66 -1
  86. package/resources/credential-providers.d.mts.map +1 -1
  87. package/resources/credential-providers.d.ts +66 -1
  88. package/resources/credential-providers.d.ts.map +1 -1
  89. package/resources/credential-providers.js +21 -6
  90. package/resources/credential-providers.js.map +1 -1
  91. package/resources/credential-providers.mjs +21 -6
  92. package/resources/credential-providers.mjs.map +1 -1
  93. package/resources/index.d.mts +3 -2
  94. package/resources/index.d.mts.map +1 -1
  95. package/resources/index.d.ts +3 -2
  96. package/resources/index.d.ts.map +1 -1
  97. package/resources/index.js +3 -1
  98. package/resources/index.js.map +1 -1
  99. package/resources/index.mjs +1 -0
  100. package/resources/index.mjs.map +1 -1
  101. package/resources/invocations.d.mts +81 -1
  102. package/resources/invocations.d.mts.map +1 -1
  103. package/resources/invocations.d.ts +81 -1
  104. package/resources/invocations.d.ts.map +1 -1
  105. package/resources/invocations.js +13 -0
  106. package/resources/invocations.js.map +1 -1
  107. package/resources/invocations.mjs +13 -0
  108. package/resources/invocations.mjs.map +1 -1
  109. package/src/client.ts +28 -5
  110. package/src/internal/parse.ts +6 -0
  111. package/src/resources/agents/auth/auth.ts +121 -46
  112. package/src/resources/agents/auth/invocations.ts +18 -47
  113. package/src/resources/auth/auth.ts +43 -0
  114. package/src/resources/auth/connections.ts +848 -0
  115. package/src/resources/auth/index.ts +18 -0
  116. package/src/resources/auth.ts +3 -0
  117. package/src/resources/browsers/browsers.ts +4 -0
  118. package/src/resources/browsers/computer.ts +257 -0
  119. package/src/resources/browsers/index.ts +2 -0
  120. package/src/resources/credential-providers.ts +88 -6
  121. package/src/resources/index.ts +4 -0
  122. package/src/resources/invocations.ts +98 -0
  123. package/src/version.ts +1 -1
  124. package/version.d.mts +1 -1
  125. package/version.d.ts +1 -1
  126. package/version.js +1 -1
  127. package/version.mjs +1 -1
@@ -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
+ }