@onkernel/sdk 0.25.0 → 0.26.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 (64) hide show
  1. package/CHANGELOG.md +29 -7
  2. package/README.md +2 -2
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +2 -2
  10. package/resources/agents/auth/auth.d.mts +31 -0
  11. package/resources/agents/auth/auth.d.mts.map +1 -1
  12. package/resources/agents/auth/auth.d.ts +31 -0
  13. package/resources/agents/auth/auth.d.ts.map +1 -1
  14. package/resources/agents/auth/auth.js.map +1 -1
  15. package/resources/agents/auth/auth.mjs.map +1 -1
  16. package/resources/agents/auth/invocations.d.mts +7 -1
  17. package/resources/agents/auth/invocations.d.mts.map +1 -1
  18. package/resources/agents/auth/invocations.d.ts +7 -1
  19. package/resources/agents/auth/invocations.d.ts.map +1 -1
  20. package/resources/browsers/browsers.d.mts +84 -3
  21. package/resources/browsers/browsers.d.mts.map +1 -1
  22. package/resources/browsers/browsers.d.ts +84 -3
  23. package/resources/browsers/browsers.d.ts.map +1 -1
  24. package/resources/browsers/browsers.js +13 -0
  25. package/resources/browsers/browsers.js.map +1 -1
  26. package/resources/browsers/browsers.mjs +13 -0
  27. package/resources/browsers/browsers.mjs.map +1 -1
  28. package/resources/browsers/index.d.mts +2 -2
  29. package/resources/browsers/index.d.mts.map +1 -1
  30. package/resources/browsers/index.d.ts +2 -2
  31. package/resources/browsers/index.d.ts.map +1 -1
  32. package/resources/browsers/index.js.map +1 -1
  33. package/resources/browsers/index.mjs.map +1 -1
  34. package/resources/browsers/process.d.mts +52 -1
  35. package/resources/browsers/process.d.mts.map +1 -1
  36. package/resources/browsers/process.d.ts +52 -1
  37. package/resources/browsers/process.d.ts.map +1 -1
  38. package/resources/browsers/process.js +19 -0
  39. package/resources/browsers/process.js.map +1 -1
  40. package/resources/browsers/process.mjs +19 -0
  41. package/resources/browsers/process.mjs.map +1 -1
  42. package/resources/index.d.mts +1 -1
  43. package/resources/index.d.mts.map +1 -1
  44. package/resources/index.d.ts +1 -1
  45. package/resources/index.d.ts.map +1 -1
  46. package/resources/index.js.map +1 -1
  47. package/resources/index.mjs.map +1 -1
  48. package/resources/proxies.d.mts +16 -0
  49. package/resources/proxies.d.mts.map +1 -1
  50. package/resources/proxies.d.ts +16 -0
  51. package/resources/proxies.d.ts.map +1 -1
  52. package/src/client.ts +4 -0
  53. package/src/resources/agents/auth/auth.ts +37 -0
  54. package/src/resources/agents/auth/invocations.ts +11 -1
  55. package/src/resources/browsers/browsers.ts +104 -0
  56. package/src/resources/browsers/index.ts +4 -0
  57. package/src/resources/browsers/process.ts +68 -0
  58. package/src/resources/index.ts +2 -0
  59. package/src/resources/proxies.ts +20 -0
  60. package/src/version.ts +1 -1
  61. package/version.d.mts +1 -1
  62. package/version.d.ts +1 -1
  63. package/version.js +1 -1
  64. package/version.mjs +1 -1
@@ -26,6 +26,8 @@ import {
26
26
  ProcessExecResponse,
27
27
  ProcessKillParams,
28
28
  ProcessKillResponse,
29
+ ProcessResizeParams,
30
+ ProcessResizeResponse,
29
31
  ProcessSpawnParams,
30
32
  ProcessSpawnResponse,
31
33
  ProcessStatusParams,
@@ -107,6 +109,20 @@ export class Browsers extends APIResource {
107
109
  return this._client.get(path`/browsers/${id}`, options);
108
110
  }
109
111
 
112
+ /**
113
+ * Update a browser session.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * const browser = await client.browsers.update(
118
+ * 'htzv5orfit78e1m2biiifpbv',
119
+ * );
120
+ * ```
121
+ */
122
+ update(id: string, body: BrowserUpdateParams, options?: RequestOptions): APIPromise<BrowserUpdateResponse> {
123
+ return this._client.patch(path`/browsers/${id}`, { body, ...options });
124
+ }
125
+
110
126
  /**
111
127
  * List all browser sessions with pagination support. Use include_deleted=true to
112
128
  * include soft-deleted sessions in the results.
@@ -380,6 +396,82 @@ export interface BrowserRetrieveResponse {
380
396
  viewport?: Shared.BrowserViewport;
381
397
  }
382
398
 
399
+ export interface BrowserUpdateResponse {
400
+ /**
401
+ * Websocket URL for Chrome DevTools Protocol connections to the browser session
402
+ */
403
+ cdp_ws_url: string;
404
+
405
+ /**
406
+ * When the browser session was created.
407
+ */
408
+ created_at: string;
409
+
410
+ /**
411
+ * Whether the browser session is running in headless mode.
412
+ */
413
+ headless: boolean;
414
+
415
+ /**
416
+ * Unique identifier for the browser session
417
+ */
418
+ session_id: string;
419
+
420
+ /**
421
+ * Whether the browser session is running in stealth mode.
422
+ */
423
+ stealth: boolean;
424
+
425
+ /**
426
+ * The number of seconds of inactivity before the browser session is terminated.
427
+ */
428
+ timeout_seconds: number;
429
+
430
+ /**
431
+ * Remote URL for live viewing the browser session. Only available for non-headless
432
+ * browsers.
433
+ */
434
+ browser_live_view_url?: string;
435
+
436
+ /**
437
+ * When the browser session was soft-deleted. Only present for deleted sessions.
438
+ */
439
+ deleted_at?: string;
440
+
441
+ /**
442
+ * Whether the browser session is running in kiosk mode.
443
+ */
444
+ kiosk_mode?: boolean;
445
+
446
+ /**
447
+ * @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
448
+ * instead.
449
+ */
450
+ persistence?: BrowserPersistence;
451
+
452
+ /**
453
+ * Browser profile metadata.
454
+ */
455
+ profile?: Profile;
456
+
457
+ /**
458
+ * ID of the proxy associated with this browser session, if any.
459
+ */
460
+ proxy_id?: string;
461
+
462
+ /**
463
+ * Initial browser window size in pixels with optional refresh rate. If omitted,
464
+ * image defaults apply (1920x1080@25). Only specific viewport configurations are
465
+ * supported. The server will reject unsupported combinations. Supported
466
+ * resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
467
+ * 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
468
+ * automatically determined from the width and height if they match a supported
469
+ * configuration exactly. Note: Higher resolutions may affect the responsiveness of
470
+ * live view browser
471
+ */
472
+ viewport?: Shared.BrowserViewport;
473
+ }
474
+
383
475
  export interface BrowserListResponse {
384
476
  /**
385
477
  * Websocket URL for Chrome DevTools Protocol connections to the browser session
@@ -526,6 +618,14 @@ export interface BrowserCreateParams {
526
618
  viewport?: Shared.BrowserViewport;
527
619
  }
528
620
 
621
+ export interface BrowserUpdateParams {
622
+ /**
623
+ * ID of the proxy to use. Omit to leave unchanged, set to empty string to remove
624
+ * proxy.
625
+ */
626
+ proxy_id?: string | null;
627
+ }
628
+
529
629
  export interface BrowserListParams extends OffsetPaginationParams {
530
630
  /**
531
631
  * When true, includes soft-deleted browser sessions in the results alongside
@@ -576,9 +676,11 @@ export declare namespace Browsers {
576
676
  type Profile as Profile,
577
677
  type BrowserCreateResponse as BrowserCreateResponse,
578
678
  type BrowserRetrieveResponse as BrowserRetrieveResponse,
679
+ type BrowserUpdateResponse as BrowserUpdateResponse,
579
680
  type BrowserListResponse as BrowserListResponse,
580
681
  type BrowserListResponsesOffsetPagination as BrowserListResponsesOffsetPagination,
581
682
  type BrowserCreateParams as BrowserCreateParams,
683
+ type BrowserUpdateParams as BrowserUpdateParams,
582
684
  type BrowserListParams as BrowserListParams,
583
685
  type BrowserDeleteParams as BrowserDeleteParams,
584
686
  type BrowserLoadExtensionsParams as BrowserLoadExtensionsParams,
@@ -615,12 +717,14 @@ export declare namespace Browsers {
615
717
  Process as Process,
616
718
  type ProcessExecResponse as ProcessExecResponse,
617
719
  type ProcessKillResponse as ProcessKillResponse,
720
+ type ProcessResizeResponse as ProcessResizeResponse,
618
721
  type ProcessSpawnResponse as ProcessSpawnResponse,
619
722
  type ProcessStatusResponse as ProcessStatusResponse,
620
723
  type ProcessStdinResponse as ProcessStdinResponse,
621
724
  type ProcessStdoutStreamResponse as ProcessStdoutStreamResponse,
622
725
  type ProcessExecParams as ProcessExecParams,
623
726
  type ProcessKillParams as ProcessKillParams,
727
+ type ProcessResizeParams as ProcessResizeParams,
624
728
  type ProcessSpawnParams as ProcessSpawnParams,
625
729
  type ProcessStatusParams as ProcessStatusParams,
626
730
  type ProcessStdinParams as ProcessStdinParams,
@@ -6,8 +6,10 @@ export {
6
6
  type Profile,
7
7
  type BrowserCreateResponse,
8
8
  type BrowserRetrieveResponse,
9
+ type BrowserUpdateResponse,
9
10
  type BrowserListResponse,
10
11
  type BrowserCreateParams,
12
+ type BrowserUpdateParams,
11
13
  type BrowserListParams,
12
14
  type BrowserDeleteParams,
13
15
  type BrowserLoadExtensionsParams,
@@ -48,12 +50,14 @@ export {
48
50
  Process,
49
51
  type ProcessExecResponse,
50
52
  type ProcessKillResponse,
53
+ type ProcessResizeResponse,
51
54
  type ProcessSpawnResponse,
52
55
  type ProcessStatusResponse,
53
56
  type ProcessStdinResponse,
54
57
  type ProcessStdoutStreamResponse,
55
58
  type ProcessExecParams,
56
59
  type ProcessKillParams,
60
+ type ProcessResizeParams,
57
61
  type ProcessSpawnParams,
58
62
  type ProcessStatusParams,
59
63
  type ProcessStdinParams,
@@ -42,6 +42,30 @@ export class Process extends APIResource {
42
42
  return this._client.post(path`/browsers/${id}/process/${processID}/kill`, { body, ...options });
43
43
  }
44
44
 
45
+ /**
46
+ * Resize a PTY-backed process terminal
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const response = await client.browsers.process.resize(
51
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
52
+ * {
53
+ * id: 'id',
54
+ * cols: 1,
55
+ * rows: 1,
56
+ * },
57
+ * );
58
+ * ```
59
+ */
60
+ resize(
61
+ processID: string,
62
+ params: ProcessResizeParams,
63
+ options?: RequestOptions,
64
+ ): APIPromise<ProcessResizeResponse> {
65
+ const { id, ...body } = params;
66
+ return this._client.post(path`/browsers/${id}/process/${processID}/resize`, { body, ...options });
67
+ }
68
+
45
69
  /**
46
70
  * Execute a command asynchronously
47
71
  *
@@ -156,6 +180,16 @@ export interface ProcessKillResponse {
156
180
  ok: boolean;
157
181
  }
158
182
 
183
+ /**
184
+ * Generic OK response.
185
+ */
186
+ export interface ProcessResizeResponse {
187
+ /**
188
+ * Indicates success.
189
+ */
190
+ ok: boolean;
191
+ }
192
+
159
193
  /**
160
194
  * Information about a spawned process.
161
195
  */
@@ -285,12 +319,34 @@ export interface ProcessKillParams {
285
319
  signal: 'TERM' | 'KILL' | 'INT' | 'HUP';
286
320
  }
287
321
 
322
+ export interface ProcessResizeParams {
323
+ /**
324
+ * Path param: Browser session ID
325
+ */
326
+ id: string;
327
+
328
+ /**
329
+ * Body param: New terminal columns.
330
+ */
331
+ cols: number;
332
+
333
+ /**
334
+ * Body param: New terminal rows.
335
+ */
336
+ rows: number;
337
+ }
338
+
288
339
  export interface ProcessSpawnParams {
289
340
  /**
290
341
  * Executable or shell command to run.
291
342
  */
292
343
  command: string;
293
344
 
345
+ /**
346
+ * Allocate a pseudo-terminal (PTY) for interactive shells.
347
+ */
348
+ allocate_tty?: boolean;
349
+
294
350
  /**
295
351
  * Command arguments.
296
352
  */
@@ -306,6 +362,11 @@ export interface ProcessSpawnParams {
306
362
  */
307
363
  as_user?: string | null;
308
364
 
365
+ /**
366
+ * Initial terminal columns. Only used when allocate_tty is true.
367
+ */
368
+ cols?: number;
369
+
309
370
  /**
310
371
  * Working directory (absolute path) to run the command in.
311
372
  */
@@ -316,6 +377,11 @@ export interface ProcessSpawnParams {
316
377
  */
317
378
  env?: { [key: string]: string };
318
379
 
380
+ /**
381
+ * Initial terminal rows. Only used when allocate_tty is true.
382
+ */
383
+ rows?: number;
384
+
319
385
  /**
320
386
  * Maximum execution time in seconds.
321
387
  */
@@ -352,12 +418,14 @@ export declare namespace Process {
352
418
  export {
353
419
  type ProcessExecResponse as ProcessExecResponse,
354
420
  type ProcessKillResponse as ProcessKillResponse,
421
+ type ProcessResizeResponse as ProcessResizeResponse,
355
422
  type ProcessSpawnResponse as ProcessSpawnResponse,
356
423
  type ProcessStatusResponse as ProcessStatusResponse,
357
424
  type ProcessStdinResponse as ProcessStdinResponse,
358
425
  type ProcessStdoutStreamResponse as ProcessStdoutStreamResponse,
359
426
  type ProcessExecParams as ProcessExecParams,
360
427
  type ProcessKillParams as ProcessKillParams,
428
+ type ProcessResizeParams as ProcessResizeParams,
361
429
  type ProcessSpawnParams as ProcessSpawnParams,
362
430
  type ProcessStatusParams as ProcessStatusParams,
363
431
  type ProcessStdinParams as ProcessStdinParams,
@@ -25,8 +25,10 @@ export {
25
25
  type Profile,
26
26
  type BrowserCreateResponse,
27
27
  type BrowserRetrieveResponse,
28
+ type BrowserUpdateResponse,
28
29
  type BrowserListResponse,
29
30
  type BrowserCreateParams,
31
+ type BrowserUpdateParams,
30
32
  type BrowserListParams,
31
33
  type BrowserDeleteParams,
32
34
  type BrowserLoadExtensionsParams,
@@ -68,6 +68,11 @@ export interface ProxyCreateResponse {
68
68
  | ProxyCreateResponse.MobileProxyConfig
69
69
  | ProxyCreateResponse.CustomProxyConfig;
70
70
 
71
+ /**
72
+ * IP address that the proxy uses when making requests.
73
+ */
74
+ ip_address?: string;
75
+
71
76
  /**
72
77
  * Timestamp of the last health check performed on this proxy.
73
78
  */
@@ -288,6 +293,11 @@ export interface ProxyRetrieveResponse {
288
293
  | ProxyRetrieveResponse.MobileProxyConfig
289
294
  | ProxyRetrieveResponse.CustomProxyConfig;
290
295
 
296
+ /**
297
+ * IP address that the proxy uses when making requests.
298
+ */
299
+ ip_address?: string;
300
+
291
301
  /**
292
302
  * Timestamp of the last health check performed on this proxy.
293
303
  */
@@ -511,6 +521,11 @@ export namespace ProxyListResponse {
511
521
  | ProxyListResponseItem.MobileProxyConfig
512
522
  | ProxyListResponseItem.CustomProxyConfig;
513
523
 
524
+ /**
525
+ * IP address that the proxy uses when making requests.
526
+ */
527
+ ip_address?: string;
528
+
514
529
  /**
515
530
  * Timestamp of the last health check performed on this proxy.
516
531
  */
@@ -732,6 +747,11 @@ export interface ProxyCheckResponse {
732
747
  | ProxyCheckResponse.MobileProxyConfig
733
748
  | ProxyCheckResponse.CustomProxyConfig;
734
749
 
750
+ /**
751
+ * IP address that the proxy uses when making requests.
752
+ */
753
+ ip_address?: string;
754
+
735
755
  /**
736
756
  * Timestamp of the last health check performed on this proxy.
737
757
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.25.0'; // x-release-please-version
1
+ export const VERSION = '0.26.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.25.0";
1
+ export declare const VERSION = "0.26.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.25.0";
1
+ export declare const VERSION = "0.26.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.25.0'; // x-release-please-version
4
+ exports.VERSION = '0.26.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.25.0'; // x-release-please-version
1
+ export const VERSION = '0.26.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map