@onkernel/sdk 0.111.0 → 0.113.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.
- package/CHANGELOG.md +21 -0
- package/package.json +1 -1
- package/resources/browser-pools.d.mts +22 -1
- package/resources/browser-pools.d.mts.map +1 -1
- package/resources/browser-pools.d.ts +22 -1
- package/resources/browser-pools.d.ts.map +1 -1
- package/resources/browsers/browsers.d.mts +44 -3
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +44 -3
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js +2 -2
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +2 -2
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +1 -1
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -1
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js +2 -2
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs +1 -1
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/browsers/telemetry.d.mts +27 -18
- package/resources/browsers/telemetry.d.mts.map +1 -1
- package/resources/browsers/telemetry.d.ts +27 -18
- package/resources/browsers/telemetry.d.ts.map +1 -1
- package/resources/browsers/telemetry.js +3 -2
- package/resources/browsers/telemetry.js.map +1 -1
- package/resources/browsers/telemetry.mjs +3 -2
- package/resources/browsers/telemetry.mjs.map +1 -1
- package/resources/browsers/webmcp/custom-tools.d.mts +118 -0
- package/resources/browsers/webmcp/custom-tools.d.mts.map +1 -0
- package/resources/browsers/webmcp/custom-tools.d.ts +118 -0
- package/resources/browsers/webmcp/custom-tools.d.ts.map +1 -0
- package/resources/browsers/webmcp/custom-tools.js +75 -0
- package/resources/browsers/webmcp/custom-tools.js.map +1 -0
- package/resources/browsers/webmcp/custom-tools.mjs +71 -0
- package/resources/browsers/webmcp/custom-tools.mjs.map +1 -0
- package/resources/browsers/webmcp/index.d.mts +3 -0
- package/resources/browsers/webmcp/index.d.mts.map +1 -0
- package/resources/browsers/webmcp/index.d.ts +3 -0
- package/resources/browsers/webmcp/index.d.ts.map +1 -0
- package/resources/browsers/webmcp/index.js +9 -0
- package/resources/browsers/webmcp/index.js.map +1 -0
- package/resources/browsers/webmcp/index.mjs +4 -0
- package/resources/browsers/webmcp/index.mjs.map +1 -0
- package/resources/browsers/webmcp/webmcp.d.mts +211 -0
- package/resources/browsers/webmcp/webmcp.d.mts.map +1 -0
- package/resources/browsers/webmcp/webmcp.d.ts +211 -0
- package/resources/browsers/webmcp/webmcp.d.ts.map +1 -0
- package/resources/browsers/webmcp/webmcp.js +66 -0
- package/resources/browsers/webmcp/webmcp.js.map +1 -0
- package/resources/browsers/webmcp/webmcp.mjs +61 -0
- package/resources/browsers/webmcp/webmcp.mjs.map +1 -0
- package/resources/browsers/webmcp.d.mts +1 -157
- package/resources/browsers/webmcp.d.mts.map +1 -1
- package/resources/browsers/webmcp.d.ts +1 -157
- package/resources/browsers/webmcp.d.ts.map +1 -1
- package/resources/browsers/webmcp.js +2 -51
- package/resources/browsers/webmcp.js.map +1 -1
- package/resources/browsers/webmcp.mjs +1 -49
- package/resources/browsers/webmcp.mjs.map +1 -1
- package/resources/organization/entitlements.d.mts +15 -0
- package/resources/organization/entitlements.d.mts.map +1 -1
- package/resources/organization/entitlements.d.ts +15 -0
- package/resources/organization/entitlements.d.ts.map +1 -1
- package/resources/search/providers.d.mts +2 -1
- package/resources/search/providers.d.mts.map +1 -1
- package/resources/search/providers.d.ts +2 -1
- package/resources/search/providers.d.ts.map +1 -1
- package/src/resources/browser-pools.ts +26 -1
- package/src/resources/browsers/browsers.ts +65 -13
- package/src/resources/browsers/index.ts +4 -1
- package/src/resources/browsers/telemetry.ts +56 -17
- package/src/resources/browsers/webmcp/custom-tools.ts +160 -0
- package/src/resources/browsers/webmcp/index.ts +26 -0
- package/src/resources/browsers/webmcp/webmcp.ts +295 -0
- package/src/resources/browsers/webmcp.ts +1 -204
- package/src/resources/organization/entitlements.ts +17 -0
- package/src/resources/search/providers.ts +2 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -109,19 +109,6 @@ import {
|
|
|
109
109
|
TelemetryStreamParams,
|
|
110
110
|
TelemetryStreamResponse,
|
|
111
111
|
} from './telemetry';
|
|
112
|
-
import * as WebmcpAPI from './webmcp';
|
|
113
|
-
import {
|
|
114
|
-
InvocationFailure,
|
|
115
|
-
InvocationResult,
|
|
116
|
-
InvokeRequest,
|
|
117
|
-
Tool,
|
|
118
|
-
ToolAnnotations,
|
|
119
|
-
ToolFrame,
|
|
120
|
-
ToolSource,
|
|
121
|
-
ToolsResponse,
|
|
122
|
-
Webmcp,
|
|
123
|
-
WebmcpInvokeToolParams,
|
|
124
|
-
} from './webmcp';
|
|
125
112
|
import * as FsAPI from './fs/fs';
|
|
126
113
|
import {
|
|
127
114
|
FCreateDirectoryParams,
|
|
@@ -140,6 +127,22 @@ import {
|
|
|
140
127
|
FWriteFileParams,
|
|
141
128
|
Fs,
|
|
142
129
|
} from './fs/fs';
|
|
130
|
+
import * as WebmcpAPI from './webmcp/webmcp';
|
|
131
|
+
import {
|
|
132
|
+
CustomToolSource,
|
|
133
|
+
InvocationFailure,
|
|
134
|
+
InvocationResult,
|
|
135
|
+
InvokeRequest,
|
|
136
|
+
Tool,
|
|
137
|
+
ToolAnnotations,
|
|
138
|
+
ToolFrame,
|
|
139
|
+
ToolMetadata,
|
|
140
|
+
ToolSource,
|
|
141
|
+
ToolsResponse,
|
|
142
|
+
Webmcp,
|
|
143
|
+
WebmcpInvokeToolParams,
|
|
144
|
+
WebmcpListToolsParams,
|
|
145
|
+
} from './webmcp/webmcp';
|
|
143
146
|
import { APIPromise } from '../../core/api-promise';
|
|
144
147
|
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../core/pagination';
|
|
145
148
|
import { type Uploadable } from '../../core/uploads';
|
|
@@ -375,6 +378,52 @@ export interface BrowserNetworkConfig {
|
|
|
375
378
|
* upstream-proxy and Kernel-managed direct egress and cannot reach into a VPN.
|
|
376
379
|
*/
|
|
377
380
|
private_hosts?: Array<string>;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Per-destination proxy routes for a browser session. After setup, a destination
|
|
384
|
+
* hostname is matched against every route's hosts, regardless of port; route order
|
|
385
|
+
* does not matter. An exact hostname beats a wildcard, and a longer wildcard
|
|
386
|
+
* suffix beats a shorter one (for a.b.example.com: "a.b.example.com" >
|
|
387
|
+
* "_.b.example.com" > "_.example.com"). A host pattern may appear in only one
|
|
388
|
+
* route. "\*.example.com" matches subdomains only, not example.com. A matched
|
|
389
|
+
* request selects the route's proxy instead of the session's top-level proxy
|
|
390
|
+
* (including mode: direct); the route proxy's own bypass_hosts still apply. If the
|
|
391
|
+
* route proxy becomes unavailable, matched requests fail closed without falling
|
|
392
|
+
* back. Requests that match no route use the session's default egress from the
|
|
393
|
+
* top-level proxy field (or the browser default when proxy is omitted: stealth
|
|
394
|
+
* proxy or direct egress). Routes take effect once the session is created;
|
|
395
|
+
* start_url and other traffic during browser setup use the top-level proxy.
|
|
396
|
+
* Setting routes requires proxy v3. Not supported on browser pools.
|
|
397
|
+
*/
|
|
398
|
+
proxy_routes?: Array<BrowserNetworkConfig.ProxyRoute>;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export namespace BrowserNetworkConfig {
|
|
402
|
+
export interface ProxyRoute {
|
|
403
|
+
/**
|
|
404
|
+
* Exact hostnames or leading \*. wildcard patterns (subdomains only); patterns
|
|
405
|
+
* cannot include ports, and matching ignores the destination port. Hosts not
|
|
406
|
+
* matched by any route use the session's top-level proxy (or the browser default
|
|
407
|
+
* when proxy is omitted).
|
|
408
|
+
*/
|
|
409
|
+
hosts: Array<string>;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Select an active non-direct proxy by ID or name. Responses always use ID.
|
|
413
|
+
*/
|
|
414
|
+
proxy: ProxyRoute.Proxy;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export namespace ProxyRoute {
|
|
418
|
+
/**
|
|
419
|
+
* Select an active non-direct proxy by ID or name. Responses always use ID.
|
|
420
|
+
*/
|
|
421
|
+
export interface Proxy {
|
|
422
|
+
id?: string;
|
|
423
|
+
|
|
424
|
+
name?: string;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
378
427
|
}
|
|
379
428
|
|
|
380
429
|
/**
|
|
@@ -2019,14 +2068,17 @@ export declare namespace Browsers {
|
|
|
2019
2068
|
|
|
2020
2069
|
export {
|
|
2021
2070
|
Webmcp as Webmcp,
|
|
2071
|
+
type CustomToolSource as CustomToolSource,
|
|
2022
2072
|
type InvocationFailure as InvocationFailure,
|
|
2023
2073
|
type InvocationResult as InvocationResult,
|
|
2024
2074
|
type InvokeRequest as InvokeRequest,
|
|
2025
2075
|
type Tool as Tool,
|
|
2026
2076
|
type ToolAnnotations as ToolAnnotations,
|
|
2027
2077
|
type ToolFrame as ToolFrame,
|
|
2078
|
+
type ToolMetadata as ToolMetadata,
|
|
2028
2079
|
type ToolSource as ToolSource,
|
|
2029
2080
|
type ToolsResponse as ToolsResponse,
|
|
2030
2081
|
type WebmcpInvokeToolParams as WebmcpInvokeToolParams,
|
|
2082
|
+
type WebmcpListToolsParams as WebmcpListToolsParams,
|
|
2031
2083
|
};
|
|
2032
2084
|
}
|
|
@@ -152,13 +152,16 @@ export {
|
|
|
152
152
|
} from './telemetry';
|
|
153
153
|
export {
|
|
154
154
|
Webmcp,
|
|
155
|
+
type CustomToolSource,
|
|
155
156
|
type InvocationFailure,
|
|
156
157
|
type InvocationResult,
|
|
157
158
|
type InvokeRequest,
|
|
158
159
|
type Tool,
|
|
159
160
|
type ToolAnnotations,
|
|
160
161
|
type ToolFrame,
|
|
162
|
+
type ToolMetadata,
|
|
161
163
|
type ToolSource,
|
|
162
164
|
type ToolsResponse,
|
|
163
165
|
type WebmcpInvokeToolParams,
|
|
164
|
-
|
|
166
|
+
type WebmcpListToolsParams,
|
|
167
|
+
} from './webmcp/index';
|
|
@@ -16,8 +16,9 @@ export class Telemetry extends APIResource {
|
|
|
16
16
|
/**
|
|
17
17
|
* Reads a page of telemetry events for the browser session. To page through
|
|
18
18
|
* results, pass the X-Next-Offset value from the previous response as offset and
|
|
19
|
-
* repeat while X-Has-More is true.
|
|
20
|
-
*
|
|
19
|
+
* repeat while X-Has-More is true. The category and type filters apply within each
|
|
20
|
+
* page, so a filtered page may be empty while X-Has-More is true. Returns an empty
|
|
21
|
+
* list when telemetry data is unavailable.
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
24
|
* ```ts
|
|
@@ -2979,7 +2980,14 @@ export interface BrowserEventContext {
|
|
|
2979
2980
|
/**
|
|
2980
2981
|
* CDP target type of the page that produced the event.
|
|
2981
2982
|
*/
|
|
2982
|
-
target_type?:
|
|
2983
|
+
target_type?:
|
|
2984
|
+
| 'page'
|
|
2985
|
+
| 'iframe'
|
|
2986
|
+
| 'worker'
|
|
2987
|
+
| 'background_page'
|
|
2988
|
+
| 'service_worker'
|
|
2989
|
+
| 'shared_worker'
|
|
2990
|
+
| 'other';
|
|
2983
2991
|
|
|
2984
2992
|
/**
|
|
2985
2993
|
* URL relevant to this event — page URL for navigation and page events, request
|
|
@@ -3283,8 +3291,12 @@ export namespace BrowserLiveViewDisconnectEvent {
|
|
|
3283
3291
|
|
|
3284
3292
|
/**
|
|
3285
3293
|
* The CDP connection to Chrome was lost. Telemetry events may be dropped until
|
|
3286
|
-
* monitor_reconnected arrives.
|
|
3287
|
-
*
|
|
3294
|
+
* monitor_reconnected arrives. In-progress computed state is discarded rather than
|
|
3295
|
+
* paused, so computed events still pending for the current navigation
|
|
3296
|
+
* (network_idle, page_layout_settled, page_navigation_settled) never fire.
|
|
3297
|
+
* monitor_reconnected does not restore them. After reattachment a fresh state
|
|
3298
|
+
* machine starts, so computed events can resume before the next navigation and
|
|
3299
|
+
* carry empty navigation context until one occurs.
|
|
3288
3300
|
*/
|
|
3289
3301
|
export interface BrowserMonitorDisconnectedEvent {
|
|
3290
3302
|
category: 'monitor';
|
|
@@ -3769,7 +3781,14 @@ export namespace BrowserPageCrashedEvent {
|
|
|
3769
3781
|
/**
|
|
3770
3782
|
* CDP target type of the page that produced the event.
|
|
3771
3783
|
*/
|
|
3772
|
-
target_type:
|
|
3784
|
+
target_type:
|
|
3785
|
+
| 'page'
|
|
3786
|
+
| 'iframe'
|
|
3787
|
+
| 'worker'
|
|
3788
|
+
| 'background_page'
|
|
3789
|
+
| 'service_worker'
|
|
3790
|
+
| 'shared_worker'
|
|
3791
|
+
| 'other';
|
|
3773
3792
|
|
|
3774
3793
|
/**
|
|
3775
3794
|
* URL the page was on when its renderer process crashed.
|
|
@@ -4135,7 +4154,14 @@ export namespace BrowserPageNavigationEvent {
|
|
|
4135
4154
|
/**
|
|
4136
4155
|
* CDP target type of the page that produced the event.
|
|
4137
4156
|
*/
|
|
4138
|
-
target_type?:
|
|
4157
|
+
target_type?:
|
|
4158
|
+
| 'page'
|
|
4159
|
+
| 'iframe'
|
|
4160
|
+
| 'worker'
|
|
4161
|
+
| 'background_page'
|
|
4162
|
+
| 'service_worker'
|
|
4163
|
+
| 'shared_worker'
|
|
4164
|
+
| 'other';
|
|
4139
4165
|
|
|
4140
4166
|
/**
|
|
4141
4167
|
* URL navigated to.
|
|
@@ -4222,7 +4248,14 @@ export namespace BrowserPageTabOpenedEvent {
|
|
|
4222
4248
|
/**
|
|
4223
4249
|
* CDP target type of the page that produced the event.
|
|
4224
4250
|
*/
|
|
4225
|
-
target_type?:
|
|
4251
|
+
target_type?:
|
|
4252
|
+
| 'page'
|
|
4253
|
+
| 'iframe'
|
|
4254
|
+
| 'worker'
|
|
4255
|
+
| 'background_page'
|
|
4256
|
+
| 'service_worker'
|
|
4257
|
+
| 'shared_worker'
|
|
4258
|
+
| 'other';
|
|
4226
4259
|
|
|
4227
4260
|
/**
|
|
4228
4261
|
* Initial page title of the new tab.
|
|
@@ -4337,15 +4370,16 @@ export namespace BrowserProxyErrorEvent {
|
|
|
4337
4370
|
/**
|
|
4338
4371
|
* Proxy-layer error code: the X-Kernel-Proxy-Error response header value from a
|
|
4339
4372
|
* branded 5xx error page served by the metro egress host-proxy. Values mirror what
|
|
4340
|
-
* the proxy emits: destination_blocked,
|
|
4341
|
-
* provider_unreachable, provider_rejected,
|
|
4342
|
-
* origin_response_incomplete, proxy_unavailable,
|
|
4343
|
-
* upstream_timeout, upstream_dns_failure,
|
|
4344
|
-
* the browser image does not recognize is
|
|
4345
|
-
* value in raw_code.
|
|
4373
|
+
* the proxy emits: destination_blocked, destination_route_unavailable,
|
|
4374
|
+
* provider_blacklisted, provider_unreachable, provider_rejected,
|
|
4375
|
+
* origin_tls_timeout, origin_response_incomplete, proxy_unavailable,
|
|
4376
|
+
* restricted_route_unavailable, upstream_timeout, upstream_dns_failure,
|
|
4377
|
+
* upstream_connect_failed. A header value the browser image does not recognize is
|
|
4378
|
+
* reported as unknown, with the header value in raw_code.
|
|
4346
4379
|
*/
|
|
4347
4380
|
code:
|
|
4348
4381
|
| 'destination_blocked'
|
|
4382
|
+
| 'destination_route_unavailable'
|
|
4349
4383
|
| 'provider_blacklisted'
|
|
4350
4384
|
| 'provider_unreachable'
|
|
4351
4385
|
| 'provider_rejected'
|
|
@@ -4830,9 +4864,7 @@ export interface TelemetryEventsParams extends OffsetPaginationParams {
|
|
|
4830
4864
|
* Read direction. asc (default) reads oldest first, starting from since or the
|
|
4831
4865
|
* offset cursor. desc reads newest first: each request returns one page of up to
|
|
4832
4866
|
* limit records ending at the offset cursor (or until, or the newest archived
|
|
4833
|
-
* event); combining desc with since is rejected with a 400.
|
|
4834
|
-
* the category filter applies within the page, so a filtered page may be empty
|
|
4835
|
-
* while X-Has-More is true.
|
|
4867
|
+
* event); combining desc with since is rejected with a 400.
|
|
4836
4868
|
*/
|
|
4837
4869
|
order?: string;
|
|
4838
4870
|
|
|
@@ -4842,6 +4874,13 @@ export interface TelemetryEventsParams extends OffsetPaginationParams {
|
|
|
4842
4874
|
*/
|
|
4843
4875
|
since?: string;
|
|
4844
4876
|
|
|
4877
|
+
/**
|
|
4878
|
+
* Restrict results to these event types, such as page_crashed or
|
|
4879
|
+
* captcha_challenge_result. Repeat the parameter for multiple values. Combines
|
|
4880
|
+
* with category: when both are set an event must match both.
|
|
4881
|
+
*/
|
|
4882
|
+
type?: Array<string>;
|
|
4883
|
+
|
|
4845
4884
|
/**
|
|
4846
4885
|
* End of the window (exclusive): an RFC-3339 timestamp, or a duration like 5m
|
|
4847
4886
|
* meaning that long ago.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as WebmcpAPI from './webmcp';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
8
|
+
import { path } from '../../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Discover and invoke native page tools across the browser instance.
|
|
12
|
+
*/
|
|
13
|
+
export class CustomTools extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Returns every registered custom tool with its generated ID, namespace, matcher,
|
|
16
|
+
* and MCP tool metadata.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const customToolsResponse =
|
|
21
|
+
* await client.browsers.webmcp.customTools.list(
|
|
22
|
+
* 'id_or_name',
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
list(idOrName: string, options?: RequestOptions): APIPromise<CustomToolsResponse> {
|
|
27
|
+
return this._client.get(path`/browsers/${idOrName}/webmcp/custom-tools`, options);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Add a namespaced batch of custom tools. A custom tool can be page-backed or
|
|
32
|
+
* CDP-backed. Page-backed tools execute in the page via JavaScript. CDP-backed
|
|
33
|
+
* tools execute via CDP and can use all browser REPL tools (see `/repl`). The
|
|
34
|
+
* source must evaluate to a non-empty array of definitions with URL matchers, tool
|
|
35
|
+
* metadata (including an optional output schema), and execute functions. The batch
|
|
36
|
+
* is added atomically. Matchers apply to top-level documents and nested frames,
|
|
37
|
+
* including out-of-process iframes; each matching tool is exposed once on the
|
|
38
|
+
* tab's top-level document and appears in the WebMCP tool snapshot.
|
|
39
|
+
*
|
|
40
|
+
* To update one tool, list the tools, delete its ID, and add its replacement. Set
|
|
41
|
+
* force_overwrite_namespace to replace every existing tool in the namespace
|
|
42
|
+
* atomically; omitted or false adds tools without replacing existing ones.
|
|
43
|
+
* Existing invocations continue.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const customToolsResponse =
|
|
48
|
+
* await client.browsers.webmcp.customTools.add(
|
|
49
|
+
* 'id_or_name',
|
|
50
|
+
* { namespace: 'namespace', source: 'source' },
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
add(
|
|
55
|
+
idOrName: string,
|
|
56
|
+
body: CustomToolAddParams,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): APIPromise<CustomToolsResponse> {
|
|
59
|
+
return this._client.post(path`/browsers/${idOrName}/webmcp/custom-tools`, { body, ...options });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Removes one custom tool by generated ID. An invocation already in progress is
|
|
64
|
+
* not canceled.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* await client.browsers.webmcp.customTools.remove(
|
|
69
|
+
* 'ct_n10b9798ad53ecc4y69z31e1',
|
|
70
|
+
* { id_or_name: 'id_or_name' },
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
remove(id: string, params: CustomToolRemoveParams, options?: RequestOptions): APIPromise<void> {
|
|
75
|
+
const { id_or_name } = params;
|
|
76
|
+
return this._client.delete(path`/browsers/${id_or_name}/webmcp/custom-tools/${id}`, {
|
|
77
|
+
...options,
|
|
78
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface AddRequest {
|
|
84
|
+
namespace: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* JavaScript expression that evaluates to a non-empty array of custom tool
|
|
88
|
+
* definitions. Limited to 8,000,000 bytes when UTF-8 encoded, so multi-byte
|
|
89
|
+
* characters reduce the allowed character count.
|
|
90
|
+
*/
|
|
91
|
+
source: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Atomically replace all existing tools in this namespace with this batch when
|
|
95
|
+
* true.
|
|
96
|
+
*/
|
|
97
|
+
force_overwrite_namespace?: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface CustomToolsResponse {
|
|
101
|
+
tools: Array<Definition>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface Definition {
|
|
105
|
+
id: string;
|
|
106
|
+
|
|
107
|
+
kind: string;
|
|
108
|
+
|
|
109
|
+
match: Match;
|
|
110
|
+
|
|
111
|
+
namespace: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Tool metadata follows the
|
|
115
|
+
* [MCP Tool definition](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool)
|
|
116
|
+
* and the
|
|
117
|
+
* [WebMCP RegisteredTool definition](https://webmachinelearning.github.io/webmcp/#dictdef-registeredtool).
|
|
118
|
+
* outputSchema is optional for page and custom tools.
|
|
119
|
+
*/
|
|
120
|
+
tool: WebmcpAPI.ToolMetadata;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface Match {
|
|
124
|
+
url_patterns: Array<string>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface CustomToolAddParams {
|
|
128
|
+
namespace: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* JavaScript expression that evaluates to a non-empty array of custom tool
|
|
132
|
+
* definitions. Limited to 8,000,000 bytes when UTF-8 encoded, so multi-byte
|
|
133
|
+
* characters reduce the allowed character count.
|
|
134
|
+
*/
|
|
135
|
+
source: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Atomically replace all existing tools in this namespace with this batch when
|
|
139
|
+
* true.
|
|
140
|
+
*/
|
|
141
|
+
force_overwrite_namespace?: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface CustomToolRemoveParams {
|
|
145
|
+
/**
|
|
146
|
+
* Browser session ID or name
|
|
147
|
+
*/
|
|
148
|
+
id_or_name: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export declare namespace CustomTools {
|
|
152
|
+
export {
|
|
153
|
+
type AddRequest as AddRequest,
|
|
154
|
+
type CustomToolsResponse as CustomToolsResponse,
|
|
155
|
+
type Definition as Definition,
|
|
156
|
+
type Match as Match,
|
|
157
|
+
type CustomToolAddParams as CustomToolAddParams,
|
|
158
|
+
type CustomToolRemoveParams as CustomToolRemoveParams,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
CustomTools,
|
|
5
|
+
type AddRequest,
|
|
6
|
+
type CustomToolsResponse,
|
|
7
|
+
type Definition,
|
|
8
|
+
type Match,
|
|
9
|
+
type CustomToolAddParams,
|
|
10
|
+
type CustomToolRemoveParams,
|
|
11
|
+
} from './custom-tools';
|
|
12
|
+
export {
|
|
13
|
+
Webmcp,
|
|
14
|
+
type CustomToolSource,
|
|
15
|
+
type InvocationFailure,
|
|
16
|
+
type InvocationResult,
|
|
17
|
+
type InvokeRequest,
|
|
18
|
+
type Tool,
|
|
19
|
+
type ToolAnnotations,
|
|
20
|
+
type ToolFrame,
|
|
21
|
+
type ToolMetadata,
|
|
22
|
+
type ToolSource,
|
|
23
|
+
type ToolsResponse,
|
|
24
|
+
type WebmcpInvokeToolParams,
|
|
25
|
+
type WebmcpListToolsParams,
|
|
26
|
+
} from './webmcp';
|