@browserbasehq/sdk 2.19.1 → 2.21.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 (70) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/index.d.mts +9 -0
  3. package/index.d.ts +9 -0
  4. package/index.d.ts.map +1 -1
  5. package/index.js +9 -0
  6. package/index.js.map +1 -1
  7. package/index.mjs +9 -0
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/agents/agents.d.ts +4 -4
  11. package/resources/agents/runs.d.ts +24 -8
  12. package/resources/agents/runs.d.ts.map +1 -1
  13. package/resources/functions/functions.d.ts +10 -0
  14. package/resources/functions/functions.d.ts.map +1 -0
  15. package/resources/functions/functions.js +49 -0
  16. package/resources/functions/functions.js.map +1 -0
  17. package/resources/functions/functions.mjs +12 -0
  18. package/resources/functions/functions.mjs.map +1 -0
  19. package/resources/functions/index.d.ts +3 -0
  20. package/resources/functions/index.d.ts.map +1 -0
  21. package/resources/functions/index.js +9 -0
  22. package/resources/functions/index.js.map +1 -0
  23. package/resources/functions/index.mjs +4 -0
  24. package/resources/functions/index.mjs.map +1 -0
  25. package/resources/functions/secrets.d.ts +74 -0
  26. package/resources/functions/secrets.d.ts.map +1 -0
  27. package/resources/functions/secrets.js +39 -0
  28. package/resources/functions/secrets.js.map +1 -0
  29. package/resources/functions/secrets.mjs +35 -0
  30. package/resources/functions/secrets.mjs.map +1 -0
  31. package/resources/functions.d.ts +2 -0
  32. package/resources/functions.d.ts.map +1 -0
  33. package/resources/functions.js +19 -0
  34. package/resources/functions.js.map +1 -0
  35. package/resources/functions.mjs +3 -0
  36. package/resources/functions.mjs.map +1 -0
  37. package/resources/index.d.ts +3 -0
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js +7 -1
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs +3 -0
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/search.d.ts +1 -1
  44. package/resources/secrets.d.ts +142 -0
  45. package/resources/secrets.d.ts.map +1 -0
  46. package/resources/secrets.js +50 -0
  47. package/resources/secrets.js.map +1 -0
  48. package/resources/secrets.mjs +46 -0
  49. package/resources/secrets.mjs.map +1 -0
  50. package/resources/webhooks.d.ts +147 -0
  51. package/resources/webhooks.d.ts.map +1 -0
  52. package/resources/webhooks.js +57 -0
  53. package/resources/webhooks.js.map +1 -0
  54. package/resources/webhooks.mjs +53 -0
  55. package/resources/webhooks.mjs.map +1 -0
  56. package/src/index.ts +51 -0
  57. package/src/resources/agents/agents.ts +4 -4
  58. package/src/resources/agents/runs.ts +25 -8
  59. package/src/resources/functions/functions.ts +20 -0
  60. package/src/resources/functions/index.ts +4 -0
  61. package/src/resources/functions/secrets.ts +117 -0
  62. package/src/resources/functions.ts +3 -0
  63. package/src/resources/index.ts +21 -0
  64. package/src/resources/search.ts +1 -1
  65. package/src/resources/secrets.ts +196 -0
  66. package/src/resources/webhooks.ts +241 -0
  67. package/src/version.ts +1 -1
  68. package/version.d.ts +1 -1
  69. package/version.js +1 -1
  70. package/version.mjs +1 -1
@@ -0,0 +1,57 @@
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.Webhooks = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ const core_1 = require("../core.js");
7
+ class Webhooks extends resource_1.APIResource {
8
+ /**
9
+ * Register an HTTPS endpoint to receive events for this project. The response
10
+ * includes the signing secret, which is shown only here and when the secret is
11
+ * rotated. Store it before discarding the response. An endpoint may only be
12
+ * registered once per project.
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/v1/webhooks', { body, ...options });
16
+ }
17
+ /**
18
+ * Retrieve a single webhook by ID. The signing secret is not included; it is only
19
+ * ever returned on create and rotate.
20
+ */
21
+ retrieve(id, options) {
22
+ return this._client.get(`/v1/webhooks/${id}`, options);
23
+ }
24
+ /**
25
+ * Update a webhook's endpoint URL, its subscribed event types, or both. Omitted
26
+ * fields are left unchanged. `eventTypes` replaces the existing subscription
27
+ * rather than adding to it. The signing secret is unaffected.
28
+ */
29
+ update(id, body, options) {
30
+ return this._client.patch(`/v1/webhooks/${id}`, { body, ...options });
31
+ }
32
+ list(query = {}, options) {
33
+ if ((0, core_1.isRequestOptions)(query)) {
34
+ return this.list({}, query);
35
+ }
36
+ return this._client.get('/v1/webhooks', { query, ...options });
37
+ }
38
+ /**
39
+ * Delete a webhook. Deliveries stop immediately and the signing secret is retired.
40
+ * Events that occurred before the delete are not replayed if the endpoint is
41
+ * registered again.
42
+ */
43
+ delete(id, options) {
44
+ return this._client.delete(`/v1/webhooks/${id}`, {
45
+ ...options,
46
+ headers: { Accept: '*/*', ...options?.headers },
47
+ });
48
+ }
49
+ rotateSecret(id, body = {}, options) {
50
+ if ((0, core_1.isRequestOptions)(body)) {
51
+ return this.rotateSecret(id, {}, body);
52
+ }
53
+ return this._client.post(`/v1/webhooks/${id}/secret`, { body, ...options });
54
+ }
55
+ }
56
+ exports.Webhooks = Webhooks;
57
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAG3C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;OAKG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,IAAyB,EAAE,OAA6B;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IASD,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAcD,YAAY,CACV,EAAU,EACV,OAAwD,EAAE,EAC1D,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF;AA/ED,4BA+EC"}
@@ -0,0 +1,53 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ import { isRequestOptions } from "../core.mjs";
4
+ export class Webhooks extends APIResource {
5
+ /**
6
+ * Register an HTTPS endpoint to receive events for this project. The response
7
+ * includes the signing secret, which is shown only here and when the secret is
8
+ * rotated. Store it before discarding the response. An endpoint may only be
9
+ * registered once per project.
10
+ */
11
+ create(body, options) {
12
+ return this._client.post('/v1/webhooks', { body, ...options });
13
+ }
14
+ /**
15
+ * Retrieve a single webhook by ID. The signing secret is not included; it is only
16
+ * ever returned on create and rotate.
17
+ */
18
+ retrieve(id, options) {
19
+ return this._client.get(`/v1/webhooks/${id}`, options);
20
+ }
21
+ /**
22
+ * Update a webhook's endpoint URL, its subscribed event types, or both. Omitted
23
+ * fields are left unchanged. `eventTypes` replaces the existing subscription
24
+ * rather than adding to it. The signing secret is unaffected.
25
+ */
26
+ update(id, body, options) {
27
+ return this._client.patch(`/v1/webhooks/${id}`, { body, ...options });
28
+ }
29
+ list(query = {}, options) {
30
+ if (isRequestOptions(query)) {
31
+ return this.list({}, query);
32
+ }
33
+ return this._client.get('/v1/webhooks', { query, ...options });
34
+ }
35
+ /**
36
+ * Delete a webhook. Deliveries stop immediately and the signing secret is retired.
37
+ * Events that occurred before the delete are not replayed if the endpoint is
38
+ * registered again.
39
+ */
40
+ delete(id, options) {
41
+ return this._client.delete(`/v1/webhooks/${id}`, {
42
+ ...options,
43
+ headers: { Accept: '*/*', ...options?.headers },
44
+ });
45
+ }
46
+ rotateSecret(id, body = {}, options) {
47
+ if (isRequestOptions(body)) {
48
+ return this.rotateSecret(id, {}, body);
49
+ }
50
+ return this._client.post(`/v1/webhooks/${id}/secret`, { body, ...options });
51
+ }
52
+ }
53
+ //# sourceMappingURL=webhooks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;OAKG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,IAAyB,EAAE,OAA6B;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IASD,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAcD,YAAY,CACV,EAAU,EACV,OAAwD,EAAE,EAC1D,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF"}
package/src/index.ts CHANGED
@@ -22,6 +22,26 @@ import { Extension, ExtensionCreateParams, Extensions } from './resources/extens
22
22
  import { FetchAPI, FetchAPICreateParams, FetchAPICreateResponse } from './resources/fetch-api';
23
23
  import { Project, ProjectListResponse, ProjectUsage, Projects } from './resources/projects';
24
24
  import { Search, SearchWebParams, SearchWebResponse } from './resources/search';
25
+ import {
26
+ Secret,
27
+ SecretCreateParams,
28
+ SecretListParams,
29
+ SecretListResponse,
30
+ SecretUpdateParams,
31
+ Secrets,
32
+ SecretsKeypair,
33
+ } from './resources/secrets';
34
+ import {
35
+ Webhook,
36
+ WebhookCreateParams,
37
+ WebhookCreateResponse,
38
+ WebhookListParams,
39
+ WebhookListResponse,
40
+ WebhookRotateSecretParams,
41
+ WebhookRotateSecretResponse,
42
+ WebhookUpdateParams,
43
+ Webhooks,
44
+ } from './resources/webhooks';
25
45
  import {
26
46
  AgentCreateParams,
27
47
  AgentCreateResponse,
@@ -32,6 +52,7 @@ import {
32
52
  AgentUpdateResponse,
33
53
  Agents,
34
54
  } from './resources/agents/agents';
55
+ import { Functions } from './resources/functions/functions';
35
56
  import {
36
57
  Session,
37
58
  SessionCreateParams,
@@ -179,10 +200,13 @@ export class Browserbase extends Core.APIClient {
179
200
  contexts: API.Contexts = new API.Contexts(this);
180
201
  extensions: API.Extensions = new API.Extensions(this);
181
202
  fetchAPI: API.FetchAPI = new API.FetchAPI(this);
203
+ functions: API.Functions = new API.Functions(this);
182
204
  projects: API.Projects = new API.Projects(this);
183
205
  search: API.Search = new API.Search(this);
206
+ secrets: API.Secrets = new API.Secrets(this);
184
207
  sessions: API.Sessions = new API.Sessions(this);
185
208
  agents: API.Agents = new API.Agents(this);
209
+ webhooks: API.Webhooks = new API.Webhooks(this);
186
210
 
187
211
  /**
188
212
  * Check whether the base URL is set to its default.
@@ -231,10 +255,13 @@ Browserbase.Certificates = Certificates;
231
255
  Browserbase.Contexts = Contexts;
232
256
  Browserbase.Extensions = Extensions;
233
257
  Browserbase.FetchAPI = FetchAPI;
258
+ Browserbase.Functions = Functions;
234
259
  Browserbase.Projects = Projects;
235
260
  Browserbase.Search = Search;
261
+ Browserbase.Secrets = Secrets;
236
262
  Browserbase.Sessions = Sessions;
237
263
  Browserbase.Agents = Agents;
264
+ Browserbase.Webhooks = Webhooks;
238
265
 
239
266
  export declare namespace Browserbase {
240
267
  export type RequestOptions = Core.RequestOptions;
@@ -266,6 +293,8 @@ export declare namespace Browserbase {
266
293
  type FetchAPICreateParams as FetchAPICreateParams,
267
294
  };
268
295
 
296
+ export { Functions as Functions };
297
+
269
298
  export {
270
299
  Projects as Projects,
271
300
  type Project as Project,
@@ -279,6 +308,16 @@ export declare namespace Browserbase {
279
308
  type SearchWebParams as SearchWebParams,
280
309
  };
281
310
 
311
+ export {
312
+ Secrets as Secrets,
313
+ type Secret as Secret,
314
+ type SecretsKeypair as SecretsKeypair,
315
+ type SecretListResponse as SecretListResponse,
316
+ type SecretCreateParams as SecretCreateParams,
317
+ type SecretUpdateParams as SecretUpdateParams,
318
+ type SecretListParams as SecretListParams,
319
+ };
320
+
282
321
  export {
283
322
  Sessions as Sessions,
284
323
  type Session as Session,
@@ -302,6 +341,18 @@ export declare namespace Browserbase {
302
341
  type AgentUpdateParams as AgentUpdateParams,
303
342
  type AgentListParams as AgentListParams,
304
343
  };
344
+
345
+ export {
346
+ Webhooks as Webhooks,
347
+ type Webhook as Webhook,
348
+ type WebhookCreateResponse as WebhookCreateResponse,
349
+ type WebhookListResponse as WebhookListResponse,
350
+ type WebhookRotateSecretResponse as WebhookRotateSecretResponse,
351
+ type WebhookCreateParams as WebhookCreateParams,
352
+ type WebhookUpdateParams as WebhookUpdateParams,
353
+ type WebhookListParams as WebhookListParams,
354
+ type WebhookRotateSecretParams as WebhookRotateSecretParams,
355
+ };
305
356
  }
306
357
 
307
358
  export { toFile, fileFromPath } from './uploads';
@@ -292,8 +292,8 @@ export interface AgentListParams {
292
292
  cursor?: string;
293
293
 
294
294
  /**
295
- * Only return agents created on or before this timestamp (inclusive). ISO 8601 /
296
- * RFC 3339, e.g. 2026-01-20T00:00:00Z.
295
+ * Only return agents created on or before this timestamp (inclusive). RFC 3339,
296
+ * e.g. 2026-01-20T00:00:00Z.
297
297
  */
298
298
  endAt?: string;
299
299
 
@@ -303,8 +303,8 @@ export interface AgentListParams {
303
303
  limit?: number;
304
304
 
305
305
  /**
306
- * Only return agents created on or after this timestamp (inclusive). ISO 8601 /
307
- * RFC 3339, e.g. 2026-01-19T00:00:00Z.
306
+ * Only return agents created on or after this timestamp (inclusive). RFC 3339,
307
+ * e.g. 2026-01-19T00:00:00Z.
308
308
  */
309
309
  startAt?: string;
310
310
  }
@@ -85,8 +85,10 @@ export interface RunCreateResponse {
85
85
  * - `FAILED` - agent has failed the run
86
86
  * - `STOPPED` - run was stopped by the user
87
87
  * - `TIMED_OUT` - run exceeded maximum time
88
+ * - `PAUSED` - run is paused awaiting input from the caller; the agent's request
89
+ * is the trailing `pause` tool call in the run's messages
88
90
  */
89
- status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
91
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT' | 'PAUSED';
90
92
 
91
93
  /**
92
94
  * The original task description.
@@ -165,8 +167,10 @@ export interface RunRetrieveResponse {
165
167
  * - `FAILED` - agent has failed the run
166
168
  * - `STOPPED` - run was stopped by the user
167
169
  * - `TIMED_OUT` - run exceeded maximum time
170
+ * - `PAUSED` - run is paused awaiting input from the caller; the agent's request
171
+ * is the trailing `pause` tool call in the run's messages
168
172
  */
169
- status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
173
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT' | 'PAUSED';
170
174
 
171
175
  /**
172
176
  * The original task description.
@@ -267,8 +271,10 @@ export namespace RunListResponse {
267
271
  * - `FAILED` - agent has failed the run
268
272
  * - `STOPPED` - run was stopped by the user
269
273
  * - `TIMED_OUT` - run exceeded maximum time
274
+ * - `PAUSED` - run is paused awaiting input from the caller; the agent's request
275
+ * is the trailing `pause` tool call in the run's messages
270
276
  */
271
- status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
277
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT' | 'PAUSED';
272
278
 
273
279
  /**
274
280
  * The original task description.
@@ -414,6 +420,15 @@ export interface RunCreateParams {
414
420
  */
415
421
  browserSettings?: RunCreateParams.BrowserSettings;
416
422
 
423
+ /**
424
+ * Optional description of when the agent should pause and wait for input from your
425
+ * application (e.g. a verification code, an approval, or an answer from another
426
+ * system). When set, the agent is given a `pause` tool; calling it transitions the
427
+ * run to `PAUSED` (the agent's request is the trailing `pause` tool call in the
428
+ * run's messages) until it is resumed via the resume endpoint.
429
+ */
430
+ pauseWhen?: string;
431
+
417
432
  /**
418
433
  * An optional [JSON Schema](https://json-schema.org/specification) object. If
419
434
  * provided, the agent will aim to return a `result` that conforms to this schema
@@ -580,8 +595,8 @@ export interface RunListParams {
580
595
  cursor?: string;
581
596
 
582
597
  /**
583
- * Only return runs created on or before this timestamp (inclusive). ISO 8601 / RFC
584
- * 3339, e.g. 2026-01-20T00:00:00Z.
598
+ * Only return runs created on or before this timestamp (inclusive). RFC 3339, e.g.
599
+ * 2026-01-20T00:00:00Z.
585
600
  */
586
601
  endAt?: string;
587
602
 
@@ -591,8 +606,8 @@ export interface RunListParams {
591
606
  limit?: number;
592
607
 
593
608
  /**
594
- * Only return runs created on or after this timestamp (inclusive). ISO 8601 / RFC
595
- * 3339, e.g. 2026-01-19T00:00:00Z.
609
+ * Only return runs created on or after this timestamp (inclusive). RFC 3339, e.g.
610
+ * 2026-01-19T00:00:00Z.
596
611
  */
597
612
  startAt?: string;
598
613
 
@@ -605,8 +620,10 @@ export interface RunListParams {
605
620
  * - `FAILED` - agent has failed the run
606
621
  * - `STOPPED` - run was stopped by the user
607
622
  * - `TIMED_OUT` - run exceeded maximum time
623
+ * - `PAUSED` - run is paused awaiting input from the caller; the agent's request
624
+ * is the trailing `pause` tool call in the run's messages
608
625
  */
609
- status?: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
626
+ status?: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT' | 'PAUSED';
610
627
  }
611
628
 
612
629
  export interface RunListMessagesParams {
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as SecretsAPI from './secrets';
5
+ import { SecretAttachParams, SecretListParams, SecretListResponse, Secrets } from './secrets';
6
+
7
+ export class Functions extends APIResource {
8
+ secrets: SecretsAPI.Secrets = new SecretsAPI.Secrets(this._client);
9
+ }
10
+
11
+ Functions.Secrets = Secrets;
12
+
13
+ export declare namespace Functions {
14
+ export {
15
+ Secrets as Secrets,
16
+ type SecretListResponse as SecretListResponse,
17
+ type SecretListParams as SecretListParams,
18
+ type SecretAttachParams as SecretAttachParams,
19
+ };
20
+ }
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Functions } from './functions';
4
+ export { Secrets, type SecretListResponse, type SecretListParams, type SecretAttachParams } from './secrets';
@@ -0,0 +1,117 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import { isRequestOptions } from '../../core';
5
+ import * as Core from '../../core';
6
+ import * as SecretsAPI from '../secrets';
7
+
8
+ export class Secrets extends APIResource {
9
+ /**
10
+ * List secrets attached to a function. Supports filtering by secret creation time.
11
+ * Returns metadata only.
12
+ */
13
+ list(
14
+ id: string,
15
+ query?: SecretListParams,
16
+ options?: Core.RequestOptions,
17
+ ): Core.APIPromise<SecretListResponse>;
18
+ list(id: string, options?: Core.RequestOptions): Core.APIPromise<SecretListResponse>;
19
+ list(
20
+ id: string,
21
+ query: SecretListParams | Core.RequestOptions = {},
22
+ options?: Core.RequestOptions,
23
+ ): Core.APIPromise<SecretListResponse> {
24
+ if (isRequestOptions(query)) {
25
+ return this.list(id, {}, query);
26
+ }
27
+ return this._client.get(`/v1/functions/${id}/secrets`, { query, ...options });
28
+ }
29
+
30
+ /**
31
+ * Attach a secret to a Function, taking effect on the Function's next invocation.
32
+ * Note: Attaching a secret that is already attached succeeds to support
33
+ * idempotency.
34
+ */
35
+ attach(id: string, body: SecretAttachParams, options?: Core.RequestOptions): Core.APIPromise<void> {
36
+ return this._client.post(`/v1/functions/${id}/secrets`, {
37
+ body,
38
+ ...options,
39
+ headers: { Accept: '*/*', ...options?.headers },
40
+ });
41
+ }
42
+
43
+ /**
44
+ * Detach a secret from a Function, taking effect on the Function's next
45
+ * invocation. Note: Detaching a secret that is not attached succeeds to support
46
+ * idempotency.
47
+ */
48
+ detach(id: string, secretId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
49
+ return this._client.delete(`/v1/functions/${id}/secrets/${secretId}`, {
50
+ ...options,
51
+ headers: { Accept: '*/*', ...options?.headers },
52
+ });
53
+ }
54
+ }
55
+
56
+ /**
57
+ * A page of secrets.
58
+ */
59
+ export interface SecretListResponse {
60
+ /**
61
+ * The page of matching secrets.
62
+ */
63
+ data: Array<SecretsAPI.Secret>;
64
+
65
+ /**
66
+ * The maximum number of results returned in this page.
67
+ */
68
+ limit: number;
69
+
70
+ /**
71
+ * Cursor for the next page. Pass it back as `cursor` on the next request to
72
+ * continue paging. null when there are no more results.
73
+ */
74
+ nextCursor: string | null;
75
+ }
76
+
77
+ export interface SecretListParams {
78
+ /**
79
+ * Pagination cursor. Pass the nextCursor from the previous response to fetch the
80
+ * next page. Keep the same filters across pages. Omit to start from the first
81
+ * page.
82
+ */
83
+ cursor?: string;
84
+
85
+ /**
86
+ * Only return secrets created on or before this timestamp (inclusive). RFC 3339,
87
+ * e.g. 2026-01-20T00:00:00Z.
88
+ */
89
+ endAt?: string;
90
+
91
+ /**
92
+ * Maximum number of results to return.
93
+ */
94
+ limit?: number;
95
+
96
+ /**
97
+ * Only return secrets created on or after this timestamp (inclusive). RFC 3339,
98
+ * e.g. 2026-01-19T00:00:00Z.
99
+ */
100
+ startAt?: string;
101
+ }
102
+
103
+ export interface SecretAttachParams {
104
+ /**
105
+ * The id of the project secret to attach (the `id` returned by POST /v1/secrets).
106
+ * Idempotent: re-attaching an already-attached secret succeeds.
107
+ */
108
+ secretId: string;
109
+ }
110
+
111
+ export declare namespace Secrets {
112
+ export {
113
+ type SecretListResponse as SecretListResponse,
114
+ type SecretListParams as SecretListParams,
115
+ type SecretAttachParams as SecretAttachParams,
116
+ };
117
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './functions/index';
@@ -25,8 +25,18 @@ export {
25
25
  } from './contexts';
26
26
  export { Extensions, type Extension, type ExtensionCreateParams } from './extensions';
27
27
  export { FetchAPI, type FetchAPICreateResponse, type FetchAPICreateParams } from './fetch-api';
28
+ export { Functions } from './functions/functions';
28
29
  export { Projects, type Project, type ProjectUsage, type ProjectListResponse } from './projects';
29
30
  export { Search, type SearchWebResponse, type SearchWebParams } from './search';
31
+ export {
32
+ Secrets,
33
+ type Secret,
34
+ type SecretsKeypair,
35
+ type SecretListResponse,
36
+ type SecretCreateParams,
37
+ type SecretUpdateParams,
38
+ type SecretListParams,
39
+ } from './secrets';
30
40
  export {
31
41
  Sessions,
32
42
  type Session,
@@ -39,3 +49,14 @@ export {
39
49
  type SessionListParams,
40
50
  type SessionDebugParams,
41
51
  } from './sessions/sessions';
52
+ export {
53
+ Webhooks,
54
+ type Webhook,
55
+ type WebhookCreateResponse,
56
+ type WebhookListResponse,
57
+ type WebhookRotateSecretResponse,
58
+ type WebhookCreateParams,
59
+ type WebhookUpdateParams,
60
+ type WebhookListParams,
61
+ type WebhookRotateSecretParams,
62
+ } from './webhooks';
@@ -62,7 +62,7 @@ export namespace SearchWebResponse {
62
62
  image?: string;
63
63
 
64
64
  /**
65
- * Publication date in ISO 8601 format
65
+ * Publication date in RFC 3339 format
66
66
  */
67
67
  publishedDate?: string;
68
68
  }