@onkernel/sdk 0.22.0 → 0.24.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 (115) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +15 -19
  3. package/client.d.mts +8 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +8 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +6 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +6 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/agents/agents.d.mts +10 -0
  13. package/resources/agents/agents.d.mts.map +1 -0
  14. package/resources/agents/agents.d.ts +10 -0
  15. package/resources/agents/agents.d.ts.map +1 -0
  16. package/resources/agents/agents.js +17 -0
  17. package/resources/agents/agents.js.map +1 -0
  18. package/resources/agents/agents.mjs +12 -0
  19. package/resources/agents/agents.mjs.map +1 -0
  20. package/resources/agents/auth/auth.d.mts +392 -0
  21. package/resources/agents/auth/auth.d.mts.map +1 -0
  22. package/resources/agents/auth/auth.d.ts +392 -0
  23. package/resources/agents/auth/auth.d.ts.map +1 -0
  24. package/resources/agents/auth/auth.js +97 -0
  25. package/resources/agents/auth/auth.js.map +1 -0
  26. package/resources/agents/auth/auth.mjs +92 -0
  27. package/resources/agents/auth/auth.mjs.map +1 -0
  28. package/resources/agents/auth/index.d.mts +3 -0
  29. package/resources/agents/auth/index.d.mts.map +1 -0
  30. package/resources/agents/auth/index.d.ts +3 -0
  31. package/resources/agents/auth/index.d.ts.map +1 -0
  32. package/resources/agents/auth/index.js +9 -0
  33. package/resources/agents/auth/index.js.map +1 -0
  34. package/resources/agents/auth/index.mjs +4 -0
  35. package/resources/agents/auth/index.mjs.map +1 -0
  36. package/resources/agents/auth/invocations.d.mts +130 -0
  37. package/resources/agents/auth/invocations.d.mts.map +1 -0
  38. package/resources/agents/auth/invocations.d.ts +130 -0
  39. package/resources/agents/auth/invocations.d.ts.map +1 -0
  40. package/resources/agents/auth/invocations.js +94 -0
  41. package/resources/agents/auth/invocations.js.map +1 -0
  42. package/resources/agents/auth/invocations.mjs +90 -0
  43. package/resources/agents/auth/invocations.mjs.map +1 -0
  44. package/resources/agents/auth.d.mts +2 -0
  45. package/resources/agents/auth.d.mts.map +1 -0
  46. package/resources/agents/auth.d.ts +2 -0
  47. package/resources/agents/auth.d.ts.map +1 -0
  48. package/resources/agents/auth.js +6 -0
  49. package/resources/agents/auth.js.map +1 -0
  50. package/resources/agents/auth.mjs +3 -0
  51. package/resources/agents/auth.mjs.map +1 -0
  52. package/resources/agents/index.d.mts +3 -0
  53. package/resources/agents/index.d.mts.map +1 -0
  54. package/resources/agents/index.d.ts +3 -0
  55. package/resources/agents/index.d.ts.map +1 -0
  56. package/resources/agents/index.js +9 -0
  57. package/resources/agents/index.js.map +1 -0
  58. package/resources/agents/index.mjs +4 -0
  59. package/resources/agents/index.mjs.map +1 -0
  60. package/resources/agents.d.mts +2 -0
  61. package/resources/agents.d.mts.map +1 -0
  62. package/resources/agents.d.ts +2 -0
  63. package/resources/agents.d.ts.map +1 -0
  64. package/resources/agents.js +6 -0
  65. package/resources/agents.js.map +1 -0
  66. package/resources/agents.mjs +3 -0
  67. package/resources/agents.mjs.map +1 -0
  68. package/resources/browser-pools.d.mts +81 -115
  69. package/resources/browser-pools.d.mts.map +1 -1
  70. package/resources/browser-pools.d.ts +81 -115
  71. package/resources/browser-pools.d.ts.map +1 -1
  72. package/resources/browsers/browsers.d.mts +38 -38
  73. package/resources/browsers/browsers.d.mts.map +1 -1
  74. package/resources/browsers/browsers.d.ts +38 -38
  75. package/resources/browsers/browsers.d.ts.map +1 -1
  76. package/resources/browsers/browsers.js +3 -7
  77. package/resources/browsers/browsers.js.map +1 -1
  78. package/resources/browsers/browsers.mjs +3 -7
  79. package/resources/browsers/browsers.mjs.map +1 -1
  80. package/resources/credentials.d.mts +163 -0
  81. package/resources/credentials.d.mts.map +1 -0
  82. package/resources/credentials.d.ts +163 -0
  83. package/resources/credentials.d.ts.map +1 -0
  84. package/resources/credentials.js +82 -0
  85. package/resources/credentials.js.map +1 -0
  86. package/resources/credentials.mjs +78 -0
  87. package/resources/credentials.mjs.map +1 -0
  88. package/resources/index.d.mts +3 -1
  89. package/resources/index.d.mts.map +1 -1
  90. package/resources/index.d.ts +3 -1
  91. package/resources/index.d.ts.map +1 -1
  92. package/resources/index.js +5 -1
  93. package/resources/index.js.map +1 -1
  94. package/resources/index.mjs +2 -0
  95. package/resources/index.mjs.map +1 -1
  96. package/resources/shared.d.mts +5 -5
  97. package/resources/shared.d.ts +5 -5
  98. package/src/client.ts +28 -8
  99. package/src/resources/agents/agents.ts +43 -0
  100. package/src/resources/agents/auth/auth.ts +509 -0
  101. package/src/resources/agents/auth/index.ts +25 -0
  102. package/src/resources/agents/auth/invocations.ts +174 -0
  103. package/src/resources/agents/auth.ts +3 -0
  104. package/src/resources/agents/index.ts +18 -0
  105. package/src/resources/agents.ts +3 -0
  106. package/src/resources/browser-pools.ts +90 -132
  107. package/src/resources/browsers/browsers.ts +38 -38
  108. package/src/resources/credentials.ts +205 -0
  109. package/src/resources/index.ts +11 -4
  110. package/src/resources/shared.ts +5 -5
  111. package/src/version.ts +1 -1
  112. package/version.d.mts +1 -1
  113. package/version.d.ts +1 -1
  114. package/version.js +1 -1
  115. package/version.mjs +1 -1
@@ -0,0 +1,130 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as AuthAPI from "./auth.mjs";
3
+ import { APIPromise } from "../../../core/api-promise.mjs";
4
+ import { RequestOptions } from "../../../internal/request-options.mjs";
5
+ export declare class Invocations extends APIResource {
6
+ /**
7
+ * Creates a new authentication invocation for the specified auth agent. This
8
+ * starts the auth flow and returns a hosted URL for the user to complete
9
+ * authentication.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const authAgentInvocationCreateResponse =
14
+ * await client.agents.auth.invocations.create({
15
+ * auth_agent_id: 'abc123xyz',
16
+ * });
17
+ * ```
18
+ */
19
+ create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<AuthAPI.AuthAgentInvocationCreateResponse>;
20
+ /**
21
+ * Returns invocation details including app_name and target_domain. Uses the JWT
22
+ * returned by the exchange endpoint, or standard API key or JWT authentication.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const agentAuthInvocationResponse =
27
+ * await client.agents.auth.invocations.retrieve(
28
+ * 'invocation_id',
29
+ * );
30
+ * ```
31
+ */
32
+ retrieve(invocationID: string, options?: RequestOptions): APIPromise<AuthAPI.AgentAuthInvocationResponse>;
33
+ /**
34
+ * Inspects the target site to detect logged-in state or discover required fields.
35
+ * Returns 200 with success: true when fields are found, or 4xx/5xx for failures.
36
+ * Requires the JWT returned by the exchange endpoint.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const agentAuthDiscoverResponse =
41
+ * await client.agents.auth.invocations.discover(
42
+ * 'invocation_id',
43
+ * );
44
+ * ```
45
+ */
46
+ discover(invocationID: string, body?: InvocationDiscoverParams | null | undefined, options?: RequestOptions): APIPromise<AuthAPI.AgentAuthDiscoverResponse>;
47
+ /**
48
+ * Validates the handoff code and returns a JWT token for subsequent requests. No
49
+ * authentication required (the handoff code serves as the credential).
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const response =
54
+ * await client.agents.auth.invocations.exchange(
55
+ * 'invocation_id',
56
+ * { code: 'abc123xyz' },
57
+ * );
58
+ * ```
59
+ */
60
+ exchange(invocationID: string, body: InvocationExchangeParams, options?: RequestOptions): APIPromise<InvocationExchangeResponse>;
61
+ /**
62
+ * Submits field values for the discovered login form and may return additional
63
+ * auth fields or success. Requires the JWT returned by the exchange endpoint.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const agentAuthSubmitResponse =
68
+ * await client.agents.auth.invocations.submit(
69
+ * 'invocation_id',
70
+ * {
71
+ * field_values: {
72
+ * email: 'user@example.com',
73
+ * password: '********',
74
+ * },
75
+ * },
76
+ * );
77
+ * ```
78
+ */
79
+ submit(invocationID: string, body: InvocationSubmitParams, options?: RequestOptions): APIPromise<AuthAPI.AgentAuthSubmitResponse>;
80
+ }
81
+ /**
82
+ * Response from exchange endpoint
83
+ */
84
+ export interface InvocationExchangeResponse {
85
+ /**
86
+ * Invocation ID
87
+ */
88
+ invocation_id: string;
89
+ /**
90
+ * JWT token with invocation_id claim (30 minute TTL)
91
+ */
92
+ jwt: string;
93
+ }
94
+ export interface InvocationCreateParams {
95
+ /**
96
+ * ID of the auth agent to create an invocation for
97
+ */
98
+ auth_agent_id: string;
99
+ /**
100
+ * If provided, saves the submitted credentials under this name upon successful
101
+ * login. The credential will be linked to the auth agent for automatic
102
+ * re-authentication.
103
+ */
104
+ save_credential_as?: string;
105
+ }
106
+ export interface InvocationDiscoverParams {
107
+ /**
108
+ * Optional login page URL. If provided, will override the stored login URL for
109
+ * this discovery invocation and skip Phase 1 discovery.
110
+ */
111
+ login_url?: string;
112
+ }
113
+ export interface InvocationExchangeParams {
114
+ /**
115
+ * Handoff code from start endpoint
116
+ */
117
+ code: string;
118
+ }
119
+ export interface InvocationSubmitParams {
120
+ /**
121
+ * Values for the discovered login fields
122
+ */
123
+ field_values: {
124
+ [key: string]: string;
125
+ };
126
+ }
127
+ export declare namespace Invocations {
128
+ export { type InvocationExchangeResponse as InvocationExchangeResponse, type InvocationCreateParams as InvocationCreateParams, type InvocationDiscoverParams as InvocationDiscoverParams, type InvocationExchangeParams as InvocationExchangeParams, type InvocationSubmitParams as InvocationSubmitParams, };
129
+ }
130
+ //# sourceMappingURL=invocations.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocations.d.mts","sourceRoot":"","sources":["../../../src/resources/agents/auth/invocations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,OAAO,CAAC,iCAAiC,CAAC;IAIxD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,2BAA2B,CAAC;IAIzG;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,OAAO,CAAC,yBAAyB,CAAC;IAIhD;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;IAIzC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,OAAO,CAAC,uBAAuB,CAAC;CAG/C;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACzC;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,130 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as AuthAPI from "./auth.js";
3
+ import { APIPromise } from "../../../core/api-promise.js";
4
+ import { RequestOptions } from "../../../internal/request-options.js";
5
+ export declare class Invocations extends APIResource {
6
+ /**
7
+ * Creates a new authentication invocation for the specified auth agent. This
8
+ * starts the auth flow and returns a hosted URL for the user to complete
9
+ * authentication.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const authAgentInvocationCreateResponse =
14
+ * await client.agents.auth.invocations.create({
15
+ * auth_agent_id: 'abc123xyz',
16
+ * });
17
+ * ```
18
+ */
19
+ create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<AuthAPI.AuthAgentInvocationCreateResponse>;
20
+ /**
21
+ * Returns invocation details including app_name and target_domain. Uses the JWT
22
+ * returned by the exchange endpoint, or standard API key or JWT authentication.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const agentAuthInvocationResponse =
27
+ * await client.agents.auth.invocations.retrieve(
28
+ * 'invocation_id',
29
+ * );
30
+ * ```
31
+ */
32
+ retrieve(invocationID: string, options?: RequestOptions): APIPromise<AuthAPI.AgentAuthInvocationResponse>;
33
+ /**
34
+ * Inspects the target site to detect logged-in state or discover required fields.
35
+ * Returns 200 with success: true when fields are found, or 4xx/5xx for failures.
36
+ * Requires the JWT returned by the exchange endpoint.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const agentAuthDiscoverResponse =
41
+ * await client.agents.auth.invocations.discover(
42
+ * 'invocation_id',
43
+ * );
44
+ * ```
45
+ */
46
+ discover(invocationID: string, body?: InvocationDiscoverParams | null | undefined, options?: RequestOptions): APIPromise<AuthAPI.AgentAuthDiscoverResponse>;
47
+ /**
48
+ * Validates the handoff code and returns a JWT token for subsequent requests. No
49
+ * authentication required (the handoff code serves as the credential).
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const response =
54
+ * await client.agents.auth.invocations.exchange(
55
+ * 'invocation_id',
56
+ * { code: 'abc123xyz' },
57
+ * );
58
+ * ```
59
+ */
60
+ exchange(invocationID: string, body: InvocationExchangeParams, options?: RequestOptions): APIPromise<InvocationExchangeResponse>;
61
+ /**
62
+ * Submits field values for the discovered login form and may return additional
63
+ * auth fields or success. Requires the JWT returned by the exchange endpoint.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const agentAuthSubmitResponse =
68
+ * await client.agents.auth.invocations.submit(
69
+ * 'invocation_id',
70
+ * {
71
+ * field_values: {
72
+ * email: 'user@example.com',
73
+ * password: '********',
74
+ * },
75
+ * },
76
+ * );
77
+ * ```
78
+ */
79
+ submit(invocationID: string, body: InvocationSubmitParams, options?: RequestOptions): APIPromise<AuthAPI.AgentAuthSubmitResponse>;
80
+ }
81
+ /**
82
+ * Response from exchange endpoint
83
+ */
84
+ export interface InvocationExchangeResponse {
85
+ /**
86
+ * Invocation ID
87
+ */
88
+ invocation_id: string;
89
+ /**
90
+ * JWT token with invocation_id claim (30 minute TTL)
91
+ */
92
+ jwt: string;
93
+ }
94
+ export interface InvocationCreateParams {
95
+ /**
96
+ * ID of the auth agent to create an invocation for
97
+ */
98
+ auth_agent_id: string;
99
+ /**
100
+ * If provided, saves the submitted credentials under this name upon successful
101
+ * login. The credential will be linked to the auth agent for automatic
102
+ * re-authentication.
103
+ */
104
+ save_credential_as?: string;
105
+ }
106
+ export interface InvocationDiscoverParams {
107
+ /**
108
+ * Optional login page URL. If provided, will override the stored login URL for
109
+ * this discovery invocation and skip Phase 1 discovery.
110
+ */
111
+ login_url?: string;
112
+ }
113
+ export interface InvocationExchangeParams {
114
+ /**
115
+ * Handoff code from start endpoint
116
+ */
117
+ code: string;
118
+ }
119
+ export interface InvocationSubmitParams {
120
+ /**
121
+ * Values for the discovered login fields
122
+ */
123
+ field_values: {
124
+ [key: string]: string;
125
+ };
126
+ }
127
+ export declare namespace Invocations {
128
+ export { type InvocationExchangeResponse as InvocationExchangeResponse, type InvocationCreateParams as InvocationCreateParams, type InvocationDiscoverParams as InvocationDiscoverParams, type InvocationExchangeParams as InvocationExchangeParams, type InvocationSubmitParams as InvocationSubmitParams, };
129
+ }
130
+ //# sourceMappingURL=invocations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocations.d.ts","sourceRoot":"","sources":["../../../src/resources/agents/auth/invocations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,OAAO,CAAC,iCAAiC,CAAC;IAIxD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,2BAA2B,CAAC;IAIzG;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,OAAO,CAAC,yBAAyB,CAAC;IAIhD;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;IAIzC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,OAAO,CAAC,uBAAuB,CAAC;CAG/C;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACzC;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Invocations = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const path_1 = require("../../../internal/utils/path.js");
7
+ class Invocations extends resource_1.APIResource {
8
+ /**
9
+ * Creates a new authentication invocation for the specified auth agent. This
10
+ * starts the auth flow and returns a hosted URL for the user to complete
11
+ * authentication.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const authAgentInvocationCreateResponse =
16
+ * await client.agents.auth.invocations.create({
17
+ * auth_agent_id: 'abc123xyz',
18
+ * });
19
+ * ```
20
+ */
21
+ create(body, options) {
22
+ return this._client.post('/agents/auth/invocations', { body, ...options });
23
+ }
24
+ /**
25
+ * Returns invocation details including app_name and target_domain. Uses the JWT
26
+ * returned by the exchange endpoint, or standard API key or JWT authentication.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const agentAuthInvocationResponse =
31
+ * await client.agents.auth.invocations.retrieve(
32
+ * 'invocation_id',
33
+ * );
34
+ * ```
35
+ */
36
+ retrieve(invocationID, options) {
37
+ return this._client.get((0, path_1.path) `/agents/auth/invocations/${invocationID}`, options);
38
+ }
39
+ /**
40
+ * Inspects the target site to detect logged-in state or discover required fields.
41
+ * Returns 200 with success: true when fields are found, or 4xx/5xx for failures.
42
+ * Requires the JWT returned by the exchange endpoint.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const agentAuthDiscoverResponse =
47
+ * await client.agents.auth.invocations.discover(
48
+ * 'invocation_id',
49
+ * );
50
+ * ```
51
+ */
52
+ discover(invocationID, body = {}, options) {
53
+ return this._client.post((0, path_1.path) `/agents/auth/invocations/${invocationID}/discover`, { body, ...options });
54
+ }
55
+ /**
56
+ * Validates the handoff code and returns a JWT token for subsequent requests. No
57
+ * authentication required (the handoff code serves as the credential).
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const response =
62
+ * await client.agents.auth.invocations.exchange(
63
+ * 'invocation_id',
64
+ * { code: 'abc123xyz' },
65
+ * );
66
+ * ```
67
+ */
68
+ exchange(invocationID, body, options) {
69
+ return this._client.post((0, path_1.path) `/agents/auth/invocations/${invocationID}/exchange`, { body, ...options });
70
+ }
71
+ /**
72
+ * Submits field values for the discovered login form and may return additional
73
+ * auth fields or success. Requires the JWT returned by the exchange endpoint.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const agentAuthSubmitResponse =
78
+ * await client.agents.auth.invocations.submit(
79
+ * 'invocation_id',
80
+ * {
81
+ * field_values: {
82
+ * email: 'user@example.com',
83
+ * password: '********',
84
+ * },
85
+ * },
86
+ * );
87
+ * ```
88
+ */
89
+ submit(invocationID, body, options) {
90
+ return this._client.post((0, path_1.path) `/agents/auth/invocations/${invocationID}/submit`, { body, ...options });
91
+ }
92
+ }
93
+ exports.Invocations = Invocations;
94
+ //# sourceMappingURL=invocations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocations.js","sourceRoot":"","sources":["../../../src/resources/agents/auth/invocations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,0DAAoD;AAEpD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,4BAA4B,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAoB,EACpB,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,4BAA4B,YAAY,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAoB,EACpB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,4BAA4B,YAAY,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,YAAoB,EACpB,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,4BAA4B,YAAY,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxG,CAAC;CACF;AAxGD,kCAwGC"}
@@ -0,0 +1,90 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { path } from "../../../internal/utils/path.mjs";
4
+ export class Invocations extends APIResource {
5
+ /**
6
+ * Creates a new authentication invocation for the specified auth agent. This
7
+ * starts the auth flow and returns a hosted URL for the user to complete
8
+ * authentication.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const authAgentInvocationCreateResponse =
13
+ * await client.agents.auth.invocations.create({
14
+ * auth_agent_id: 'abc123xyz',
15
+ * });
16
+ * ```
17
+ */
18
+ create(body, options) {
19
+ return this._client.post('/agents/auth/invocations', { body, ...options });
20
+ }
21
+ /**
22
+ * Returns invocation details including app_name and target_domain. Uses the JWT
23
+ * returned by the exchange endpoint, or standard API key or JWT authentication.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const agentAuthInvocationResponse =
28
+ * await client.agents.auth.invocations.retrieve(
29
+ * 'invocation_id',
30
+ * );
31
+ * ```
32
+ */
33
+ retrieve(invocationID, options) {
34
+ return this._client.get(path `/agents/auth/invocations/${invocationID}`, options);
35
+ }
36
+ /**
37
+ * Inspects the target site to detect logged-in state or discover required fields.
38
+ * Returns 200 with success: true when fields are found, or 4xx/5xx for failures.
39
+ * Requires the JWT returned by the exchange endpoint.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const agentAuthDiscoverResponse =
44
+ * await client.agents.auth.invocations.discover(
45
+ * 'invocation_id',
46
+ * );
47
+ * ```
48
+ */
49
+ discover(invocationID, body = {}, options) {
50
+ return this._client.post(path `/agents/auth/invocations/${invocationID}/discover`, { body, ...options });
51
+ }
52
+ /**
53
+ * Validates the handoff code and returns a JWT token for subsequent requests. No
54
+ * authentication required (the handoff code serves as the credential).
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const response =
59
+ * await client.agents.auth.invocations.exchange(
60
+ * 'invocation_id',
61
+ * { code: 'abc123xyz' },
62
+ * );
63
+ * ```
64
+ */
65
+ exchange(invocationID, body, options) {
66
+ return this._client.post(path `/agents/auth/invocations/${invocationID}/exchange`, { body, ...options });
67
+ }
68
+ /**
69
+ * Submits field values for the discovered login form and may return additional
70
+ * auth fields or success. Requires the JWT returned by the exchange endpoint.
71
+ *
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
+ * ```
85
+ */
86
+ submit(invocationID, body, options) {
87
+ return this._client.post(path `/agents/auth/invocations/${invocationID}/submit`, { body, ...options });
88
+ }
89
+ }
90
+ //# sourceMappingURL=invocations.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocations.mjs","sourceRoot":"","sources":["../../../src/resources/agents/auth/invocations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,4BAA4B,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAoB,EACpB,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,4BAA4B,YAAY,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,YAAoB,EACpB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,4BAA4B,YAAY,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,YAAoB,EACpB,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,4BAA4B,YAAY,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxG,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from "./auth/index.mjs";
2
+ //# sourceMappingURL=auth.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.mts","sourceRoot":"","sources":["../../src/resources/agents/auth.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./auth/index.js";
2
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/resources/agents/auth.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./auth/index.js"), exports);
6
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/resources/agents/auth.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0DAA6B"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./auth/index.mjs";
3
+ //# sourceMappingURL=auth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.mjs","sourceRoot":"","sources":["../../src/resources/agents/auth.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -0,0 +1,3 @@
1
+ export { Agents } from "./agents.mjs";
2
+ export { Auth, type AgentAuthDiscoverResponse, type AgentAuthInvocationResponse, type AgentAuthSubmitResponse, type AuthAgent, type AuthAgentCreateRequest, type AuthAgentInvocationCreateRequest, type AuthAgentInvocationCreateResponse, type DiscoveredField, type ReauthResponse, type AuthCreateParams, type AuthListParams, type AuthAgentsOffsetPagination, } from "./auth/index.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/agents/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE;OACV,EACL,IAAI,EACJ,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,0BAA0B,GAChC"}
@@ -0,0 +1,3 @@
1
+ export { Agents } from "./agents.js";
2
+ export { Auth, type AgentAuthDiscoverResponse, type AgentAuthInvocationResponse, type AgentAuthSubmitResponse, type AuthAgent, type AuthAgentCreateRequest, type AuthAgentInvocationCreateRequest, type AuthAgentInvocationCreateResponse, type DiscoveredField, type ReauthResponse, type AuthCreateParams, type AuthListParams, type AuthAgentsOffsetPagination, } from "./auth/index.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/agents/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE;OACV,EACL,IAAI,EACJ,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,0BAA0B,GAChC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Auth = exports.Agents = void 0;
5
+ var agents_1 = require("./agents.js");
6
+ Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
7
+ var index_1 = require("./auth/index.js");
8
+ Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return index_1.Auth; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/agents/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yCAcsB;AAbpB,6FAAA,IAAI,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Agents } from "./agents.mjs";
3
+ export { Auth, } from "./auth/index.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/agents/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAAE;OACV,EACL,IAAI,GAaL"}
@@ -0,0 +1,2 @@
1
+ export * from "./agents/index.mjs";
2
+ //# sourceMappingURL=agents.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.mts","sourceRoot":"","sources":["../src/resources/agents.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./agents/index.js";
2
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/resources/agents.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./agents/index.js"), exports);
6
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/resources/agents.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./agents/index.mjs";
3
+ //# sourceMappingURL=agents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.mjs","sourceRoot":"","sources":["../src/resources/agents.ts"],"names":[],"mappings":"AAAA,sFAAsF"}