@onkernel/sdk 0.97.0 → 0.98.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 +7 -0
  2. package/package.json +1 -1
  3. package/resources/browsers/browsers.d.mts +21 -13
  4. package/resources/browsers/browsers.d.mts.map +1 -1
  5. package/resources/browsers/browsers.d.ts +21 -13
  6. package/resources/browsers/browsers.d.ts.map +1 -1
  7. package/resources/browsers/browsers.js +23 -15
  8. package/resources/browsers/browsers.js.map +1 -1
  9. package/resources/browsers/browsers.mjs +23 -15
  10. package/resources/browsers/browsers.mjs.map +1 -1
  11. package/resources/browsers/computer.d.mts +62 -45
  12. package/resources/browsers/computer.d.mts.map +1 -1
  13. package/resources/browsers/computer.d.ts +62 -45
  14. package/resources/browsers/computer.d.ts.map +1 -1
  15. package/resources/browsers/computer.js +74 -57
  16. package/resources/browsers/computer.js.map +1 -1
  17. package/resources/browsers/computer.mjs +74 -57
  18. package/resources/browsers/computer.mjs.map +1 -1
  19. package/resources/browsers/fs/fs.d.mts +61 -47
  20. package/resources/browsers/fs/fs.d.mts.map +1 -1
  21. package/resources/browsers/fs/fs.d.ts +61 -47
  22. package/resources/browsers/fs/fs.d.ts.map +1 -1
  23. package/resources/browsers/fs/fs.js +73 -59
  24. package/resources/browsers/fs/fs.js.map +1 -1
  25. package/resources/browsers/fs/fs.mjs +73 -59
  26. package/resources/browsers/fs/fs.mjs.map +1 -1
  27. package/resources/browsers/fs/watch.d.mts +8 -8
  28. package/resources/browsers/fs/watch.d.mts.map +1 -1
  29. package/resources/browsers/fs/watch.d.ts +8 -8
  30. package/resources/browsers/fs/watch.d.ts.map +1 -1
  31. package/resources/browsers/fs/watch.js +9 -9
  32. package/resources/browsers/fs/watch.js.map +1 -1
  33. package/resources/browsers/fs/watch.mjs +9 -9
  34. package/resources/browsers/fs/watch.mjs.map +1 -1
  35. package/resources/browsers/index.d.mts +1 -0
  36. package/resources/browsers/index.d.mts.map +1 -1
  37. package/resources/browsers/index.d.ts +1 -0
  38. package/resources/browsers/index.d.ts.map +1 -1
  39. package/resources/browsers/index.js +3 -1
  40. package/resources/browsers/index.js.map +1 -1
  41. package/resources/browsers/index.mjs +1 -0
  42. package/resources/browsers/index.mjs.map +1 -1
  43. package/resources/browsers/logs.d.mts +5 -4
  44. package/resources/browsers/logs.d.mts.map +1 -1
  45. package/resources/browsers/logs.d.ts +5 -4
  46. package/resources/browsers/logs.d.ts.map +1 -1
  47. package/resources/browsers/logs.js +6 -5
  48. package/resources/browsers/logs.js.map +1 -1
  49. package/resources/browsers/logs.mjs +6 -5
  50. package/resources/browsers/logs.mjs.map +1 -1
  51. package/resources/browsers/playwright.d.mts +7 -4
  52. package/resources/browsers/playwright.d.mts.map +1 -1
  53. package/resources/browsers/playwright.d.ts +7 -4
  54. package/resources/browsers/playwright.d.ts.map +1 -1
  55. package/resources/browsers/playwright.js +8 -5
  56. package/resources/browsers/playwright.js.map +1 -1
  57. package/resources/browsers/playwright.mjs +8 -5
  58. package/resources/browsers/playwright.mjs.map +1 -1
  59. package/resources/browsers/process.d.mts +31 -23
  60. package/resources/browsers/process.d.mts.map +1 -1
  61. package/resources/browsers/process.d.ts +31 -23
  62. package/resources/browsers/process.d.ts.map +1 -1
  63. package/resources/browsers/process.js +33 -25
  64. package/resources/browsers/process.js.map +1 -1
  65. package/resources/browsers/process.mjs +33 -25
  66. package/resources/browsers/process.mjs.map +1 -1
  67. package/resources/browsers/replays.d.mts +14 -10
  68. package/resources/browsers/replays.d.mts.map +1 -1
  69. package/resources/browsers/replays.d.ts +14 -10
  70. package/resources/browsers/replays.d.ts.map +1 -1
  71. package/resources/browsers/replays.js +16 -12
  72. package/resources/browsers/replays.js.map +1 -1
  73. package/resources/browsers/replays.mjs +16 -12
  74. package/resources/browsers/replays.mjs.map +1 -1
  75. package/resources/browsers/telemetry.d.mts +4 -4
  76. package/resources/browsers/telemetry.d.mts.map +1 -1
  77. package/resources/browsers/telemetry.d.ts +4 -4
  78. package/resources/browsers/telemetry.d.ts.map +1 -1
  79. package/resources/browsers/telemetry.js +6 -6
  80. package/resources/browsers/telemetry.js.map +1 -1
  81. package/resources/browsers/telemetry.mjs +6 -6
  82. package/resources/browsers/telemetry.mjs.map +1 -1
  83. package/resources/browsers/webmcp.d.mts +148 -0
  84. package/resources/browsers/webmcp.d.mts.map +1 -0
  85. package/resources/browsers/webmcp.d.ts +148 -0
  86. package/resources/browsers/webmcp.d.ts.map +1 -0
  87. package/resources/browsers/webmcp.js +51 -0
  88. package/resources/browsers/webmcp.js.map +1 -0
  89. package/resources/browsers/webmcp.mjs +47 -0
  90. package/resources/browsers/webmcp.mjs.map +1 -0
  91. package/resources/telemetry/destinations.d.mts +23 -12
  92. package/resources/telemetry/destinations.d.mts.map +1 -1
  93. package/resources/telemetry/destinations.d.ts +23 -12
  94. package/resources/telemetry/destinations.d.ts.map +1 -1
  95. package/resources/telemetry/destinations.js +18 -8
  96. package/resources/telemetry/destinations.js.map +1 -1
  97. package/resources/telemetry/destinations.mjs +18 -8
  98. package/resources/telemetry/destinations.mjs.map +1 -1
  99. package/src/resources/browsers/browsers.ts +51 -15
  100. package/src/resources/browsers/computer.ts +78 -57
  101. package/src/resources/browsers/fs/fs.ts +93 -59
  102. package/src/resources/browsers/fs/watch.ts +13 -13
  103. package/src/resources/browsers/index.ts +12 -0
  104. package/src/resources/browsers/logs.ts +10 -5
  105. package/src/resources/browsers/playwright.ts +8 -5
  106. package/src/resources/browsers/process.ts +47 -35
  107. package/src/resources/browsers/replays.ts +20 -16
  108. package/src/resources/browsers/telemetry.ts +6 -6
  109. package/src/resources/browsers/webmcp.ts +196 -0
  110. package/src/resources/telemetry/destinations.ts +23 -12
  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
@@ -12,23 +12,26 @@ export class Playwright extends APIResource {
12
12
  /**
13
13
  * Execute arbitrary Playwright code in a fresh execution context against the
14
14
  * browser. The code runs in the same VM as the browser, minimizing latency and
15
- * maximizing throughput. It has access to 'page', 'context', and 'browser'
16
- * variables. It can `return` a value, and this value is returned in the response.
15
+ * maximizing throughput. It has access to 'page', 'context', 'browser', and
16
+ * 'webmcp' variables. Use 'webmcp.listTools()' to discover browser-wide WebMCP
17
+ * tools and 'webmcp.invokeTool(toolRef, input?, { timeoutSec? })' to invoke an
18
+ * exact registration. It can `return` a value, and this value is returned in the
19
+ * response.
17
20
  *
18
21
  * @example
19
22
  * ```ts
20
23
  * const response = await client.browsers.playwright.execute(
21
- * 'id',
24
+ * 'htzv5orfit78e1m2biiifpbv',
22
25
  * { code: 'code' },
23
26
  * );
24
27
  * ```
25
28
  */
26
29
  execute(
27
- id: string,
30
+ idOrName: string,
28
31
  body: PlaywrightExecuteParams,
29
32
  options?: RequestOptions,
30
33
  ): APIPromise<PlaywrightExecuteResponse> {
31
- return this._client.post(path`/browsers/${id}/playwright/execute`, { body, ...options });
34
+ return this._client.post(path`/browsers/${idOrName}/playwright/execute`, { body, ...options });
32
35
  }
33
36
  }
34
37
 
@@ -16,13 +16,14 @@ export class Process extends APIResource {
16
16
  *
17
17
  * @example
18
18
  * ```ts
19
- * const response = await client.browsers.process.exec('id', {
20
- * command: 'command',
21
- * });
19
+ * const response = await client.browsers.process.exec(
20
+ * 'htzv5orfit78e1m2biiifpbv',
21
+ * { command: 'command' },
22
+ * );
22
23
  * ```
23
24
  */
24
- exec(id: string, body: ProcessExecParams, options?: RequestOptions): APIPromise<ProcessExecResponse> {
25
- return this._client.post(path`/browsers/${id}/process/exec`, { body, ...options });
25
+ exec(idOrName: string, body: ProcessExecParams, options?: RequestOptions): APIPromise<ProcessExecResponse> {
26
+ return this._client.post(path`/browsers/${idOrName}/process/exec`, { body, ...options });
26
27
  }
27
28
 
28
29
  /**
@@ -32,7 +33,10 @@ export class Process extends APIResource {
32
33
  * ```ts
33
34
  * const response = await client.browsers.process.kill(
34
35
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
35
- * { id: 'id', signal: 'TERM' },
36
+ * {
37
+ * id_or_name: 'htzv5orfit78e1m2biiifpbv',
38
+ * signal: 'TERM',
39
+ * },
36
40
  * );
37
41
  * ```
38
42
  */
@@ -41,8 +45,8 @@ export class Process extends APIResource {
41
45
  params: ProcessKillParams,
42
46
  options?: RequestOptions,
43
47
  ): APIPromise<ProcessKillResponse> {
44
- const { id, ...body } = params;
45
- return this._client.post(path`/browsers/${id}/process/${processID}/kill`, { body, ...options });
48
+ const { id_or_name, ...body } = params;
49
+ return this._client.post(path`/browsers/${id_or_name}/process/${processID}/kill`, { body, ...options });
46
50
  }
47
51
 
48
52
  /**
@@ -53,7 +57,7 @@ export class Process extends APIResource {
53
57
  * const response = await client.browsers.process.resize(
54
58
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
55
59
  * {
56
- * id: 'id',
60
+ * id_or_name: 'htzv5orfit78e1m2biiifpbv',
57
61
  * cols: 1,
58
62
  * rows: 1,
59
63
  * },
@@ -65,8 +69,8 @@ export class Process extends APIResource {
65
69
  params: ProcessResizeParams,
66
70
  options?: RequestOptions,
67
71
  ): APIPromise<ProcessResizeResponse> {
68
- const { id, ...body } = params;
69
- return this._client.post(path`/browsers/${id}/process/${processID}/resize`, { body, ...options });
72
+ const { id_or_name, ...body } = params;
73
+ return this._client.post(path`/browsers/${id_or_name}/process/${processID}/resize`, { body, ...options });
70
74
  }
71
75
 
72
76
  /**
@@ -74,13 +78,18 @@ export class Process extends APIResource {
74
78
  *
75
79
  * @example
76
80
  * ```ts
77
- * const response = await client.browsers.process.spawn('id', {
78
- * command: 'command',
79
- * });
81
+ * const response = await client.browsers.process.spawn(
82
+ * 'htzv5orfit78e1m2biiifpbv',
83
+ * { command: 'command' },
84
+ * );
80
85
  * ```
81
86
  */
82
- spawn(id: string, body: ProcessSpawnParams, options?: RequestOptions): APIPromise<ProcessSpawnResponse> {
83
- return this._client.post(path`/browsers/${id}/process/spawn`, { body, ...options });
87
+ spawn(
88
+ idOrName: string,
89
+ body: ProcessSpawnParams,
90
+ options?: RequestOptions,
91
+ ): APIPromise<ProcessSpawnResponse> {
92
+ return this._client.post(path`/browsers/${idOrName}/process/spawn`, { body, ...options });
84
93
  }
85
94
 
86
95
  /**
@@ -90,7 +99,7 @@ export class Process extends APIResource {
90
99
  * ```ts
91
100
  * const response = await client.browsers.process.status(
92
101
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
93
- * { id: 'id' },
102
+ * { id_or_name: 'htzv5orfit78e1m2biiifpbv' },
94
103
  * );
95
104
  * ```
96
105
  */
@@ -99,8 +108,8 @@ export class Process extends APIResource {
99
108
  params: ProcessStatusParams,
100
109
  options?: RequestOptions,
101
110
  ): APIPromise<ProcessStatusResponse> {
102
- const { id } = params;
103
- return this._client.get(path`/browsers/${id}/process/${processID}/status`, options);
111
+ const { id_or_name } = params;
112
+ return this._client.get(path`/browsers/${id_or_name}/process/${processID}/status`, options);
104
113
  }
105
114
 
106
115
  /**
@@ -110,7 +119,10 @@ export class Process extends APIResource {
110
119
  * ```ts
111
120
  * const response = await client.browsers.process.stdin(
112
121
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
113
- * { id: 'id', data_b64: 'data_b64' },
122
+ * {
123
+ * id_or_name: 'htzv5orfit78e1m2biiifpbv',
124
+ * data_b64: 'data_b64',
125
+ * },
114
126
  * );
115
127
  * ```
116
128
  */
@@ -119,8 +131,8 @@ export class Process extends APIResource {
119
131
  params: ProcessStdinParams,
120
132
  options?: RequestOptions,
121
133
  ): APIPromise<ProcessStdinResponse> {
122
- const { id, ...body } = params;
123
- return this._client.post(path`/browsers/${id}/process/${processID}/stdin`, { body, ...options });
134
+ const { id_or_name, ...body } = params;
135
+ return this._client.post(path`/browsers/${id_or_name}/process/${processID}/stdin`, { body, ...options });
124
136
  }
125
137
 
126
138
  /**
@@ -130,7 +142,7 @@ export class Process extends APIResource {
130
142
  * ```ts
131
143
  * const response = await client.browsers.process.stdoutStream(
132
144
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
133
- * { id: 'id' },
145
+ * { id_or_name: 'htzv5orfit78e1m2biiifpbv' },
134
146
  * );
135
147
  * ```
136
148
  */
@@ -139,8 +151,8 @@ export class Process extends APIResource {
139
151
  params: ProcessStdoutStreamParams,
140
152
  options?: RequestOptions,
141
153
  ): APIPromise<Stream<ProcessStdoutStreamResponse>> {
142
- const { id } = params;
143
- return this._client.get(path`/browsers/${id}/process/${processID}/stdout/stream`, {
154
+ const { id_or_name } = params;
155
+ return this._client.get(path`/browsers/${id_or_name}/process/${processID}/stdout/stream`, {
144
156
  ...options,
145
157
  headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
146
158
  stream: true,
@@ -312,9 +324,9 @@ export interface ProcessExecParams {
312
324
 
313
325
  export interface ProcessKillParams {
314
326
  /**
315
- * Path param: Browser session ID
327
+ * Path param: Browser session ID or name
316
328
  */
317
- id: string;
329
+ id_or_name: string;
318
330
 
319
331
  /**
320
332
  * Body param: Signal to send.
@@ -324,9 +336,9 @@ export interface ProcessKillParams {
324
336
 
325
337
  export interface ProcessResizeParams {
326
338
  /**
327
- * Path param: Browser session ID
339
+ * Path param: Browser session ID or name
328
340
  */
329
- id: string;
341
+ id_or_name: string;
330
342
 
331
343
  /**
332
344
  * Body param: New terminal columns.
@@ -393,16 +405,16 @@ export interface ProcessSpawnParams {
393
405
 
394
406
  export interface ProcessStatusParams {
395
407
  /**
396
- * Browser session ID
408
+ * Browser session ID or name
397
409
  */
398
- id: string;
410
+ id_or_name: string;
399
411
  }
400
412
 
401
413
  export interface ProcessStdinParams {
402
414
  /**
403
- * Path param: Browser session ID
415
+ * Path param: Browser session ID or name
404
416
  */
405
- id: string;
417
+ id_or_name: string;
406
418
 
407
419
  /**
408
420
  * Body param: Base64-encoded data to write.
@@ -412,9 +424,9 @@ export interface ProcessStdinParams {
412
424
 
413
425
  export interface ProcessStdoutStreamParams {
414
426
  /**
415
- * Browser session ID
427
+ * Browser session ID or name
416
428
  */
417
- id: string;
429
+ id_or_name: string;
418
430
  }
419
431
 
420
432
  export declare namespace Process {
@@ -15,11 +15,13 @@ export class Replays extends APIResource {
15
15
  *
16
16
  * @example
17
17
  * ```ts
18
- * const replays = await client.browsers.replays.list('id');
18
+ * const replays = await client.browsers.replays.list(
19
+ * 'htzv5orfit78e1m2biiifpbv',
20
+ * );
19
21
  * ```
20
22
  */
21
- list(id: string, options?: RequestOptions): APIPromise<ReplayListResponse> {
22
- return this._client.get(path`/browsers/${id}/replays`, options);
23
+ list(idOrName: string, options?: RequestOptions): APIPromise<ReplayListResponse> {
24
+ return this._client.get(path`/browsers/${idOrName}/replays`, options);
23
25
  }
24
26
 
25
27
  /**
@@ -29,7 +31,7 @@ export class Replays extends APIResource {
29
31
  * ```ts
30
32
  * const response = await client.browsers.replays.download(
31
33
  * 'replay_id',
32
- * { id: 'id' },
34
+ * { id_or_name: 'htzv5orfit78e1m2biiifpbv' },
33
35
  * );
34
36
  *
35
37
  * const content = await response.blob();
@@ -37,8 +39,8 @@ export class Replays extends APIResource {
37
39
  * ```
38
40
  */
39
41
  download(replayID: string, params: ReplayDownloadParams, options?: RequestOptions): APIPromise<Response> {
40
- const { id } = params;
41
- return this._client.get(path`/browsers/${id}/replays/${replayID}`, {
42
+ const { id_or_name } = params;
43
+ return this._client.get(path`/browsers/${id_or_name}/replays/${replayID}`, {
42
44
  ...options,
43
45
  headers: buildHeaders([{ Accept: 'video/mp4' }, options?.headers]),
44
46
  __binaryResponse: true,
@@ -50,15 +52,17 @@ export class Replays extends APIResource {
50
52
  *
51
53
  * @example
52
54
  * ```ts
53
- * const response = await client.browsers.replays.start('id');
55
+ * const response = await client.browsers.replays.start(
56
+ * 'htzv5orfit78e1m2biiifpbv',
57
+ * );
54
58
  * ```
55
59
  */
56
60
  start(
57
- id: string,
61
+ idOrName: string,
58
62
  body: ReplayStartParams | null | undefined = {},
59
63
  options?: RequestOptions,
60
64
  ): APIPromise<ReplayStartResponse> {
61
- return this._client.post(path`/browsers/${id}/replays`, { body, ...options });
65
+ return this._client.post(path`/browsers/${idOrName}/replays`, { body, ...options });
62
66
  }
63
67
 
64
68
  /**
@@ -67,13 +71,13 @@ export class Replays extends APIResource {
67
71
  * @example
68
72
  * ```ts
69
73
  * await client.browsers.replays.stop('replay_id', {
70
- * id: 'id',
74
+ * id_or_name: 'htzv5orfit78e1m2biiifpbv',
71
75
  * });
72
76
  * ```
73
77
  */
74
78
  stop(replayID: string, params: ReplayStopParams, options?: RequestOptions): APIPromise<void> {
75
- const { id } = params;
76
- return this._client.post(path`/browsers/${id}/replays/${replayID}/stop`, {
79
+ const { id_or_name } = params;
80
+ return this._client.post(path`/browsers/${id_or_name}/replays/${replayID}/stop`, {
77
81
  ...options,
78
82
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
79
83
  });
@@ -136,9 +140,9 @@ export interface ReplayStartResponse {
136
140
 
137
141
  export interface ReplayDownloadParams {
138
142
  /**
139
- * Browser session ID
143
+ * Browser session ID or name
140
144
  */
141
- id: string;
145
+ id_or_name: string;
142
146
  }
143
147
 
144
148
  export interface ReplayStartParams {
@@ -162,9 +166,9 @@ export interface ReplayStartParams {
162
166
 
163
167
  export interface ReplayStopParams {
164
168
  /**
165
- * Browser session ID
169
+ * Browser session ID or name
166
170
  */
167
- id: string;
171
+ id_or_name: string;
168
172
  }
169
173
 
170
174
  export declare namespace Replays {
@@ -23,19 +23,19 @@ export class Telemetry extends APIResource {
23
23
  * ```ts
24
24
  * // Automatically fetches more pages as needed.
25
25
  * for await (const telemetryEventsResponse of client.browsers.telemetry.events(
26
- * 'id',
26
+ * 'htzv5orfit78e1m2biiifpbv',
27
27
  * )) {
28
28
  * // ...
29
29
  * }
30
30
  * ```
31
31
  */
32
32
  events(
33
- id: string,
33
+ idOrName: string,
34
34
  query: TelemetryEventsParams | null | undefined = {},
35
35
  options?: RequestOptions,
36
36
  ): PagePromise<TelemetryEventsResponsesOffsetPagination, TelemetryEventsResponse> {
37
37
  return this._client.getAPIList(
38
- path`/browsers/${id}/telemetry/events`,
38
+ path`/browsers/${idOrName}/telemetry/events`,
39
39
  OffsetPagination<TelemetryEventsResponse>,
40
40
  { query, ...options },
41
41
  );
@@ -55,17 +55,17 @@ export class Telemetry extends APIResource {
55
55
  * @example
56
56
  * ```ts
57
57
  * const response = await client.browsers.telemetry.stream(
58
- * 'id',
58
+ * 'htzv5orfit78e1m2biiifpbv',
59
59
  * );
60
60
  * ```
61
61
  */
62
62
  stream(
63
- id: string,
63
+ idOrName: string,
64
64
  params: TelemetryStreamParams | undefined = {},
65
65
  options?: RequestOptions,
66
66
  ): APIPromise<Stream<TelemetryStreamResponse>> {
67
67
  const { 'Last-Event-ID': lastEventID, ...query } = params ?? {};
68
- return this._client.get(path`/browsers/${id}/telemetry/stream`, {
68
+ return this._client.get(path`/browsers/${idOrName}/telemetry/stream`, {
69
69
  query,
70
70
  ...options,
71
71
  headers: buildHeaders([
@@ -0,0 +1,196 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ /**
9
+ * Discover and invoke native page tools across the browser instance.
10
+ */
11
+ export class Webmcp extends APIResource {
12
+ /**
13
+ * Invokes the exact live registration identified by tool_ref and waits
14
+ * synchronously for its result. Navigation during execution is allowed. If the tab
15
+ * or embedded frame disappears, or the request times out after invocation begins,
16
+ * the response reports outcome_unknown and the tool is not retried.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const invocationResult =
21
+ * await client.browsers.webmcp.invokeTool(
22
+ * 'htzv5orfit78e1m2biiifpbv',
23
+ * {
24
+ * input: { foo: 'bar' },
25
+ * tool_ref: 'x',
26
+ * },
27
+ * );
28
+ * ```
29
+ */
30
+ invokeTool(
31
+ idOrName: string,
32
+ body: WebmcpInvokeToolParams,
33
+ options?: RequestOptions,
34
+ ): APIPromise<InvocationResult> {
35
+ return this._client.post(path`/browsers/${idOrName}/webmcp/invoke`, { body, ...options });
36
+ }
37
+
38
+ /**
39
+ * Returns a snapshot of native WebMCP tools available across every open tab and
40
+ * embedded frame in the browser. Each tool includes an opaque tool_ref for
41
+ * invoking that exact live registration. Tools disappear when their document
42
+ * closes or navigates away.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const toolsResponse =
47
+ * await client.browsers.webmcp.listTools(
48
+ * 'htzv5orfit78e1m2biiifpbv',
49
+ * );
50
+ * ```
51
+ */
52
+ listTools(idOrName: string, options?: RequestOptions): APIPromise<ToolsResponse> {
53
+ return this._client.get(path`/browsers/${idOrName}/webmcp/tools`, options);
54
+ }
55
+ }
56
+
57
+ export interface InvocationFailure {
58
+ code: 'outcome_unknown';
59
+
60
+ message: string;
61
+
62
+ invocation_id?: string;
63
+ }
64
+
65
+ export interface InvocationResult {
66
+ invocation_id: string;
67
+
68
+ status: 'completed' | 'canceled' | 'error';
69
+
70
+ error_text?: string;
71
+
72
+ /**
73
+ * Untrusted page-provided output. Callers must treat it as potentially malicious
74
+ * input.
75
+ */
76
+ output?: unknown;
77
+ }
78
+
79
+ export interface InvokeRequest {
80
+ /**
81
+ * Tool input, limited to 1 MiB after JSON serialization.
82
+ */
83
+ input: { [key: string]: unknown };
84
+
85
+ tool_ref: string;
86
+
87
+ timeout_sec?: number;
88
+ }
89
+
90
+ export interface Tool {
91
+ description: string;
92
+
93
+ input_schema: { [key: string]: unknown };
94
+
95
+ name: string;
96
+
97
+ source: ToolSource;
98
+
99
+ /**
100
+ * Opaque reference for invoking this exact live registration. It becomes invalid
101
+ * when its document or browser process is replaced.
102
+ */
103
+ tool_ref: string;
104
+
105
+ /**
106
+ * Page-provided behavioral hints. These values are untrusted and are not enforced
107
+ * by Kernel.
108
+ */
109
+ annotations?: ToolAnnotations;
110
+ }
111
+
112
+ /**
113
+ * Page-provided behavioral hints. These values are untrusted and are not enforced
114
+ * by Kernel.
115
+ */
116
+ export interface ToolAnnotations {
117
+ autosubmit: boolean;
118
+
119
+ consequential: boolean;
120
+
121
+ read_only: boolean;
122
+
123
+ untrusted_content: boolean;
124
+ }
125
+
126
+ export interface ToolFrame {
127
+ /**
128
+ * Monotonically increasing identifier for this embedded frame during the current
129
+ * browser process.
130
+ */
131
+ frame_id: number;
132
+
133
+ /**
134
+ * Current frame URL with the fragment omitted.
135
+ */
136
+ url: string;
137
+ }
138
+
139
+ export interface ToolSource {
140
+ /**
141
+ * Embedded frame that registered the tool, or null when the top-level page
142
+ * registered it.
143
+ */
144
+ frame: ToolFrame | null;
145
+
146
+ /**
147
+ * Current title of the top-level page.
148
+ */
149
+ page_title: string;
150
+
151
+ /**
152
+ * Current URL of the top-level page with the fragment omitted.
153
+ */
154
+ page_url: string;
155
+
156
+ /**
157
+ * Monotonically increasing identifier for the tab during the current browser
158
+ * process.
159
+ */
160
+ tab_id: number;
161
+
162
+ /**
163
+ * Monotonically increasing identifier for the browser window during the current
164
+ * browser process.
165
+ */
166
+ window_id: number;
167
+ }
168
+
169
+ export interface ToolsResponse {
170
+ tools: Array<Tool>;
171
+ }
172
+
173
+ export interface WebmcpInvokeToolParams {
174
+ /**
175
+ * Tool input, limited to 1 MiB after JSON serialization.
176
+ */
177
+ input: { [key: string]: unknown };
178
+
179
+ tool_ref: string;
180
+
181
+ timeout_sec?: number;
182
+ }
183
+
184
+ export declare namespace Webmcp {
185
+ export {
186
+ type InvocationFailure as InvocationFailure,
187
+ type InvocationResult as InvocationResult,
188
+ type InvokeRequest as InvokeRequest,
189
+ type Tool as Tool,
190
+ type ToolAnnotations as ToolAnnotations,
191
+ type ToolFrame as ToolFrame,
192
+ type ToolSource as ToolSource,
193
+ type ToolsResponse as ToolsResponse,
194
+ type WebmcpInvokeToolParams as WebmcpInvokeToolParams,
195
+ };
196
+ }
@@ -12,15 +12,19 @@ import { path } from '../../internal/utils/path';
12
12
  */
13
13
  export class Destinations extends APIResource {
14
14
  /**
15
- * Create an OTLP export destination in the resolved project. Names must be unique
16
- * within the project.
15
+ * Create an OTLP export destination in the authenticated organization. Names must
16
+ * be unique within the organization. Requires an organization-scoped credential or
17
+ * dashboard authentication; project-scoped credentials receive a 403.
17
18
  */
18
19
  create(body: DestinationCreateParams, options?: RequestOptions): APIPromise<OtlpDestination> {
19
20
  return this._client.post('/telemetry/destinations', { body, ...options });
20
21
  }
21
22
 
22
23
  /**
23
- * Retrieve a single OTLP destination in the resolved project by its ID or name.
24
+ * Retrieve a customer-visible OTLP destination in the authenticated organization
25
+ * by its ID or name. Project-scoped credentials can retrieve these destinations
26
+ * for selection by workloads in their project. Non-dashboard reads return header
27
+ * values redacted.
24
28
  */
25
29
  retrieve(idOrName: string, options?: RequestOptions): APIPromise<OtlpDestination> {
26
30
  return this._client.get(path`/telemetry/destinations/${idOrName}`, options);
@@ -31,10 +35,11 @@ export class Destinations extends APIResource {
31
35
  * values without restarting, which makes this the way to rotate credentials
32
36
  * without interrupting export.
33
37
  *
34
- * Names must be unique within the project. Renaming is refused with a 409 while a
35
- * managed auth connection selects this destination by name, since that connection
36
- * resolves the name on every login. Every other field, including `headers`, stays
37
- * editable.
38
+ * Names must be unique within the organization. Renaming is refused with a 409
39
+ * while a managed auth connection selects this destination by name, since that
40
+ * connection resolves the name on every login. Every other field, including
41
+ * `headers`, stays editable. Requires an organization-scoped credential or
42
+ * dashboard authentication; project-scoped credentials receive a 403.
38
43
  */
39
44
  update(
40
45
  idOrName: string,
@@ -45,7 +50,10 @@ export class Destinations extends APIResource {
45
50
  }
46
51
 
47
52
  /**
48
- * List OTLP export destinations in the resolved project.
53
+ * List customer-visible OTLP export destinations in the authenticated
54
+ * organization. Project-scoped credentials can list these destinations for
55
+ * selection by workloads in their project. Non-dashboard reads return header
56
+ * values redacted.
49
57
  */
50
58
  list(
51
59
  query: DestinationListParams | null | undefined = {},
@@ -63,6 +71,8 @@ export class Destinations extends APIResource {
63
71
  * end or delete them first. It is refused the same way while a managed auth
64
72
  * connection still selects it, because that connection re-resolves the destination
65
73
  * on every login, and while a managed auth login using it is still in progress.
74
+ * Requires an organization-scoped credential or dashboard authentication;
75
+ * project-scoped credentials receive a 403.
66
76
  */
67
77
  delete(idOrName: string, options?: RequestOptions): APIPromise<void> {
68
78
  return this._client.delete(path`/telemetry/destinations/${idOrName}`, {
@@ -91,13 +101,14 @@ export interface OtlpDestination {
91
101
 
92
102
  /**
93
103
  * Headers sent with each export request. Names are returned in canonical form
94
- * (`Authorization`, not `authorization`). Values are returned redacted as empty
95
- * strings, so the keys are visible but the credentials are not.
104
+ * (`Authorization`, not `authorization`). Non-dashboard reads return values
105
+ * redacted as empty strings, so the keys are visible but the credentials are not.
106
+ * Dashboard reads return the stored values.
96
107
  */
97
108
  headers: { [key: string]: string };
98
109
 
99
110
  /**
100
- * Unique within the project. Usable in place of the ID when selecting a
111
+ * Unique within the organization. Usable in place of the ID when selecting a
101
112
  * destination, so it cannot be shaped like an ID.
102
113
  */
103
114
  name: string;
@@ -124,7 +135,7 @@ export interface DestinationCreateParams {
124
135
  endpoint: string;
125
136
 
126
137
  /**
127
- * Unique within the project.
138
+ * Unique within the organization.
128
139
  */
129
140
  name: string;
130
141
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.97.0'; // x-release-please-version
1
+ export const VERSION = '0.98.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.97.0";
1
+ export declare const VERSION = "0.98.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.97.0";
1
+ export declare const VERSION = "0.98.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.97.0'; // x-release-please-version
4
+ exports.VERSION = '0.98.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.97.0'; // x-release-please-version
1
+ export const VERSION = '0.98.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map