@onkernel/sdk 0.110.0 → 0.112.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 +25 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/auth/connections.d.mts +26 -8
- package/resources/auth/connections.d.mts.map +1 -1
- package/resources/auth/connections.d.ts +26 -8
- package/resources/auth/connections.d.ts.map +1 -1
- package/resources/browser-pools.d.mts +8 -1
- package/resources/browser-pools.d.mts.map +1 -1
- package/resources/browser-pools.d.ts +8 -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 +34 -16
- package/resources/browsers/telemetry.d.mts.map +1 -1
- package/resources/browsers/telemetry.d.ts +34 -16
- 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/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.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/contents.d.mts +267 -0
- package/resources/search/contents.d.mts.map +1 -0
- package/resources/search/contents.d.ts +267 -0
- package/resources/search/contents.d.ts.map +1 -0
- package/resources/search/contents.js +31 -0
- package/resources/search/contents.js.map +1 -0
- package/resources/search/contents.mjs +27 -0
- package/resources/search/contents.mjs.map +1 -0
- package/resources/search/index.d.mts +4 -0
- package/resources/search/index.d.mts.map +1 -0
- package/resources/search/index.d.ts +4 -0
- package/resources/search/index.d.ts.map +1 -0
- package/resources/search/index.js +11 -0
- package/resources/search/index.js.map +1 -0
- package/resources/search/index.mjs +5 -0
- package/resources/search/index.mjs.map +1 -0
- package/resources/search/providers.d.mts +141 -0
- package/resources/search/providers.d.mts.map +1 -0
- package/resources/search/providers.d.ts +141 -0
- package/resources/search/providers.d.ts.map +1 -0
- package/resources/search/providers.js +25 -0
- package/resources/search/providers.js.map +1 -0
- package/resources/search/providers.mjs +21 -0
- package/resources/search/providers.mjs.map +1 -0
- package/resources/search/search.d.mts +1187 -0
- package/resources/search/search.d.mts.map +1 -0
- package/resources/search/search.d.ts +1187 -0
- package/resources/search/search.d.ts.map +1 -0
- package/resources/search/search.js +58 -0
- package/resources/search/search.js.map +1 -0
- package/resources/search/search.mjs +53 -0
- package/resources/search/search.mjs.map +1 -0
- package/resources/search.d.mts +2 -0
- package/resources/search.d.mts.map +1 -0
- package/resources/search.d.ts +2 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +6 -0
- package/resources/search.js.map +1 -0
- package/resources/search.mjs +3 -0
- package/resources/search.mjs.map +1 -0
- package/resources/vaults/items.d.mts +21 -14
- package/resources/vaults/items.d.mts.map +1 -1
- package/resources/vaults/items.d.ts +21 -14
- package/resources/vaults/items.d.ts.map +1 -1
- package/src/client.ts +30 -0
- package/src/resources/auth/connections.ts +28 -7
- package/src/resources/browser-pools.ts +9 -1
- package/src/resources/browsers/browsers.ts +65 -13
- package/src/resources/browsers/index.ts +4 -1
- package/src/resources/browsers/telemetry.ts +68 -16
- 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/index.ts +12 -0
- package/src/resources/organization/entitlements.ts +17 -0
- package/src/resources/search/contents.ts +327 -0
- package/src/resources/search/index.ts +16 -0
- package/src/resources/search/providers.ts +197 -0
- package/src/resources/search/search.ts +1496 -0
- package/src/resources/search.ts +3 -0
- package/src/resources/vaults/items.ts +27 -14
- 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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as WebmcpAPI from "./webmcp.mjs";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Discover and invoke native page tools across the browser instance.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CustomTools extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns every registered custom tool with its generated ID, namespace, matcher,
|
|
11
|
+
* and MCP tool metadata.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const customToolsResponse =
|
|
16
|
+
* await client.browsers.webmcp.customTools.list(
|
|
17
|
+
* 'id_or_name',
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(idOrName: string, options?: RequestOptions): APIPromise<CustomToolsResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Add a namespaced batch of custom tools. A custom tool can be page-backed or
|
|
24
|
+
* CDP-backed. Page-backed tools execute in the page via JavaScript. CDP-backed
|
|
25
|
+
* tools execute via CDP and can use all browser REPL tools (see `/repl`). The
|
|
26
|
+
* source must evaluate to a non-empty array of definitions with URL matchers, tool
|
|
27
|
+
* metadata (including an optional output schema), and execute functions. The batch
|
|
28
|
+
* is added atomically. Matchers apply to top-level documents and nested frames,
|
|
29
|
+
* including out-of-process iframes; each matching tool is exposed once on the
|
|
30
|
+
* tab's top-level document and appears in the WebMCP tool snapshot.
|
|
31
|
+
*
|
|
32
|
+
* To update one tool, list the tools, delete its ID, and add its replacement. Set
|
|
33
|
+
* force_overwrite_namespace to replace every existing tool in the namespace
|
|
34
|
+
* atomically; omitted or false adds tools without replacing existing ones.
|
|
35
|
+
* Existing invocations continue.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const customToolsResponse =
|
|
40
|
+
* await client.browsers.webmcp.customTools.add(
|
|
41
|
+
* 'id_or_name',
|
|
42
|
+
* { namespace: 'namespace', source: 'source' },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
add(idOrName: string, body: CustomToolAddParams, options?: RequestOptions): APIPromise<CustomToolsResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Removes one custom tool by generated ID. An invocation already in progress is
|
|
49
|
+
* not canceled.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* await client.browsers.webmcp.customTools.remove(
|
|
54
|
+
* 'ct_n10b9798ad53ecc4y69z31e1',
|
|
55
|
+
* { id_or_name: 'id_or_name' },
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
remove(id: string, params: CustomToolRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
60
|
+
}
|
|
61
|
+
export interface AddRequest {
|
|
62
|
+
namespace: string;
|
|
63
|
+
/**
|
|
64
|
+
* JavaScript expression that evaluates to a non-empty array of custom tool
|
|
65
|
+
* definitions. Limited to 8,000,000 bytes when UTF-8 encoded, so multi-byte
|
|
66
|
+
* characters reduce the allowed character count.
|
|
67
|
+
*/
|
|
68
|
+
source: string;
|
|
69
|
+
/**
|
|
70
|
+
* Atomically replace all existing tools in this namespace with this batch when
|
|
71
|
+
* true.
|
|
72
|
+
*/
|
|
73
|
+
force_overwrite_namespace?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface CustomToolsResponse {
|
|
76
|
+
tools: Array<Definition>;
|
|
77
|
+
}
|
|
78
|
+
export interface Definition {
|
|
79
|
+
id: string;
|
|
80
|
+
kind: string;
|
|
81
|
+
match: Match;
|
|
82
|
+
namespace: string;
|
|
83
|
+
/**
|
|
84
|
+
* Tool metadata follows the
|
|
85
|
+
* [MCP Tool definition](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool)
|
|
86
|
+
* and the
|
|
87
|
+
* [WebMCP RegisteredTool definition](https://webmachinelearning.github.io/webmcp/#dictdef-registeredtool).
|
|
88
|
+
* outputSchema is optional for page and custom tools.
|
|
89
|
+
*/
|
|
90
|
+
tool: WebmcpAPI.ToolMetadata;
|
|
91
|
+
}
|
|
92
|
+
export interface Match {
|
|
93
|
+
url_patterns: Array<string>;
|
|
94
|
+
}
|
|
95
|
+
export interface CustomToolAddParams {
|
|
96
|
+
namespace: string;
|
|
97
|
+
/**
|
|
98
|
+
* JavaScript expression that evaluates to a non-empty array of custom tool
|
|
99
|
+
* definitions. Limited to 8,000,000 bytes when UTF-8 encoded, so multi-byte
|
|
100
|
+
* characters reduce the allowed character count.
|
|
101
|
+
*/
|
|
102
|
+
source: string;
|
|
103
|
+
/**
|
|
104
|
+
* Atomically replace all existing tools in this namespace with this batch when
|
|
105
|
+
* true.
|
|
106
|
+
*/
|
|
107
|
+
force_overwrite_namespace?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface CustomToolRemoveParams {
|
|
110
|
+
/**
|
|
111
|
+
* Browser session ID or name
|
|
112
|
+
*/
|
|
113
|
+
id_or_name: string;
|
|
114
|
+
}
|
|
115
|
+
export declare namespace CustomTools {
|
|
116
|
+
export { type AddRequest as AddRequest, type CustomToolsResponse as CustomToolsResponse, type Definition as Definition, type Match as Match, type CustomToolAddParams as CustomToolAddParams, type CustomToolRemoveParams as CustomToolRemoveParams, };
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=custom-tools.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-tools.d.mts","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/custom-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EAAE,UAAU,EAAE,sCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAIjF;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CACD,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAO/F;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,KAAK,CAAC;IAEb,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC;CAC9B;AAED,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as WebmcpAPI from "./webmcp.js";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Discover and invoke native page tools across the browser instance.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CustomTools extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns every registered custom tool with its generated ID, namespace, matcher,
|
|
11
|
+
* and MCP tool metadata.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const customToolsResponse =
|
|
16
|
+
* await client.browsers.webmcp.customTools.list(
|
|
17
|
+
* 'id_or_name',
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(idOrName: string, options?: RequestOptions): APIPromise<CustomToolsResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Add a namespaced batch of custom tools. A custom tool can be page-backed or
|
|
24
|
+
* CDP-backed. Page-backed tools execute in the page via JavaScript. CDP-backed
|
|
25
|
+
* tools execute via CDP and can use all browser REPL tools (see `/repl`). The
|
|
26
|
+
* source must evaluate to a non-empty array of definitions with URL matchers, tool
|
|
27
|
+
* metadata (including an optional output schema), and execute functions. The batch
|
|
28
|
+
* is added atomically. Matchers apply to top-level documents and nested frames,
|
|
29
|
+
* including out-of-process iframes; each matching tool is exposed once on the
|
|
30
|
+
* tab's top-level document and appears in the WebMCP tool snapshot.
|
|
31
|
+
*
|
|
32
|
+
* To update one tool, list the tools, delete its ID, and add its replacement. Set
|
|
33
|
+
* force_overwrite_namespace to replace every existing tool in the namespace
|
|
34
|
+
* atomically; omitted or false adds tools without replacing existing ones.
|
|
35
|
+
* Existing invocations continue.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const customToolsResponse =
|
|
40
|
+
* await client.browsers.webmcp.customTools.add(
|
|
41
|
+
* 'id_or_name',
|
|
42
|
+
* { namespace: 'namespace', source: 'source' },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
add(idOrName: string, body: CustomToolAddParams, options?: RequestOptions): APIPromise<CustomToolsResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Removes one custom tool by generated ID. An invocation already in progress is
|
|
49
|
+
* not canceled.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* await client.browsers.webmcp.customTools.remove(
|
|
54
|
+
* 'ct_n10b9798ad53ecc4y69z31e1',
|
|
55
|
+
* { id_or_name: 'id_or_name' },
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
remove(id: string, params: CustomToolRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
60
|
+
}
|
|
61
|
+
export interface AddRequest {
|
|
62
|
+
namespace: string;
|
|
63
|
+
/**
|
|
64
|
+
* JavaScript expression that evaluates to a non-empty array of custom tool
|
|
65
|
+
* definitions. Limited to 8,000,000 bytes when UTF-8 encoded, so multi-byte
|
|
66
|
+
* characters reduce the allowed character count.
|
|
67
|
+
*/
|
|
68
|
+
source: string;
|
|
69
|
+
/**
|
|
70
|
+
* Atomically replace all existing tools in this namespace with this batch when
|
|
71
|
+
* true.
|
|
72
|
+
*/
|
|
73
|
+
force_overwrite_namespace?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface CustomToolsResponse {
|
|
76
|
+
tools: Array<Definition>;
|
|
77
|
+
}
|
|
78
|
+
export interface Definition {
|
|
79
|
+
id: string;
|
|
80
|
+
kind: string;
|
|
81
|
+
match: Match;
|
|
82
|
+
namespace: string;
|
|
83
|
+
/**
|
|
84
|
+
* Tool metadata follows the
|
|
85
|
+
* [MCP Tool definition](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool)
|
|
86
|
+
* and the
|
|
87
|
+
* [WebMCP RegisteredTool definition](https://webmachinelearning.github.io/webmcp/#dictdef-registeredtool).
|
|
88
|
+
* outputSchema is optional for page and custom tools.
|
|
89
|
+
*/
|
|
90
|
+
tool: WebmcpAPI.ToolMetadata;
|
|
91
|
+
}
|
|
92
|
+
export interface Match {
|
|
93
|
+
url_patterns: Array<string>;
|
|
94
|
+
}
|
|
95
|
+
export interface CustomToolAddParams {
|
|
96
|
+
namespace: string;
|
|
97
|
+
/**
|
|
98
|
+
* JavaScript expression that evaluates to a non-empty array of custom tool
|
|
99
|
+
* definitions. Limited to 8,000,000 bytes when UTF-8 encoded, so multi-byte
|
|
100
|
+
* characters reduce the allowed character count.
|
|
101
|
+
*/
|
|
102
|
+
source: string;
|
|
103
|
+
/**
|
|
104
|
+
* Atomically replace all existing tools in this namespace with this batch when
|
|
105
|
+
* true.
|
|
106
|
+
*/
|
|
107
|
+
force_overwrite_namespace?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface CustomToolRemoveParams {
|
|
110
|
+
/**
|
|
111
|
+
* Browser session ID or name
|
|
112
|
+
*/
|
|
113
|
+
id_or_name: string;
|
|
114
|
+
}
|
|
115
|
+
export declare namespace CustomTools {
|
|
116
|
+
export { type AddRequest as AddRequest, type CustomToolsResponse as CustomToolsResponse, type Definition as Definition, type Match as Match, type CustomToolAddParams as CustomToolAddParams, type CustomToolRemoveParams as CustomToolRemoveParams, };
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=custom-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-tools.d.ts","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/custom-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,SAAS,oBAAiB;AACtC,OAAO,EAAE,UAAU,EAAE,qCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAIjF;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CACD,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAO/F;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,KAAK,CAAC;IAEb,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC;CAC9B;AAED,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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.CustomTools = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Discover and invoke native page tools across the browser instance.
|
|
10
|
+
*/
|
|
11
|
+
class CustomTools extends resource_1.APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Returns every registered custom tool with its generated ID, namespace, matcher,
|
|
14
|
+
* and MCP tool metadata.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const customToolsResponse =
|
|
19
|
+
* await client.browsers.webmcp.customTools.list(
|
|
20
|
+
* 'id_or_name',
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
list(idOrName, options) {
|
|
25
|
+
return this._client.get((0, path_1.path) `/browsers/${idOrName}/webmcp/custom-tools`, options);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Add a namespaced batch of custom tools. A custom tool can be page-backed or
|
|
29
|
+
* CDP-backed. Page-backed tools execute in the page via JavaScript. CDP-backed
|
|
30
|
+
* tools execute via CDP and can use all browser REPL tools (see `/repl`). The
|
|
31
|
+
* source must evaluate to a non-empty array of definitions with URL matchers, tool
|
|
32
|
+
* metadata (including an optional output schema), and execute functions. The batch
|
|
33
|
+
* is added atomically. Matchers apply to top-level documents and nested frames,
|
|
34
|
+
* including out-of-process iframes; each matching tool is exposed once on the
|
|
35
|
+
* tab's top-level document and appears in the WebMCP tool snapshot.
|
|
36
|
+
*
|
|
37
|
+
* To update one tool, list the tools, delete its ID, and add its replacement. Set
|
|
38
|
+
* force_overwrite_namespace to replace every existing tool in the namespace
|
|
39
|
+
* atomically; omitted or false adds tools without replacing existing ones.
|
|
40
|
+
* Existing invocations continue.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const customToolsResponse =
|
|
45
|
+
* await client.browsers.webmcp.customTools.add(
|
|
46
|
+
* 'id_or_name',
|
|
47
|
+
* { namespace: 'namespace', source: 'source' },
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
add(idOrName, body, options) {
|
|
52
|
+
return this._client.post((0, path_1.path) `/browsers/${idOrName}/webmcp/custom-tools`, { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Removes one custom tool by generated ID. An invocation already in progress is
|
|
56
|
+
* not canceled.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* await client.browsers.webmcp.customTools.remove(
|
|
61
|
+
* 'ct_n10b9798ad53ecc4y69z31e1',
|
|
62
|
+
* { id_or_name: 'id_or_name' },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
remove(id, params, options) {
|
|
67
|
+
const { id_or_name } = params;
|
|
68
|
+
return this._client.delete((0, path_1.path) `/browsers/${id_or_name}/webmcp/custom-tools/${id}`, {
|
|
69
|
+
...options,
|
|
70
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.CustomTools = CustomTools;
|
|
75
|
+
//# sourceMappingURL=custom-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-tools.js","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/custom-tools.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAAgB,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,QAAQ,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CACD,QAAgB,EAChB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,QAAQ,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAU,EAAE,MAA8B,EAAE,OAAwB;QACzE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,wBAAwB,EAAE,EAAE,EAAE;YAClF,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AApED,kCAoEC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
4
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Discover and invoke native page tools across the browser instance.
|
|
7
|
+
*/
|
|
8
|
+
export class CustomTools extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns every registered custom tool with its generated ID, namespace, matcher,
|
|
11
|
+
* and MCP tool metadata.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const customToolsResponse =
|
|
16
|
+
* await client.browsers.webmcp.customTools.list(
|
|
17
|
+
* 'id_or_name',
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(idOrName, options) {
|
|
22
|
+
return this._client.get(path `/browsers/${idOrName}/webmcp/custom-tools`, options);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Add a namespaced batch of custom tools. A custom tool can be page-backed or
|
|
26
|
+
* CDP-backed. Page-backed tools execute in the page via JavaScript. CDP-backed
|
|
27
|
+
* tools execute via CDP and can use all browser REPL tools (see `/repl`). The
|
|
28
|
+
* source must evaluate to a non-empty array of definitions with URL matchers, tool
|
|
29
|
+
* metadata (including an optional output schema), and execute functions. The batch
|
|
30
|
+
* is added atomically. Matchers apply to top-level documents and nested frames,
|
|
31
|
+
* including out-of-process iframes; each matching tool is exposed once on the
|
|
32
|
+
* tab's top-level document and appears in the WebMCP tool snapshot.
|
|
33
|
+
*
|
|
34
|
+
* To update one tool, list the tools, delete its ID, and add its replacement. Set
|
|
35
|
+
* force_overwrite_namespace to replace every existing tool in the namespace
|
|
36
|
+
* atomically; omitted or false adds tools without replacing existing ones.
|
|
37
|
+
* Existing invocations continue.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const customToolsResponse =
|
|
42
|
+
* await client.browsers.webmcp.customTools.add(
|
|
43
|
+
* 'id_or_name',
|
|
44
|
+
* { namespace: 'namespace', source: 'source' },
|
|
45
|
+
* );
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
add(idOrName, body, options) {
|
|
49
|
+
return this._client.post(path `/browsers/${idOrName}/webmcp/custom-tools`, { body, ...options });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Removes one custom tool by generated ID. An invocation already in progress is
|
|
53
|
+
* not canceled.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* await client.browsers.webmcp.customTools.remove(
|
|
58
|
+
* 'ct_n10b9798ad53ecc4y69z31e1',
|
|
59
|
+
* { id_or_name: 'id_or_name' },
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
remove(id, params, options) {
|
|
64
|
+
const { id_or_name } = params;
|
|
65
|
+
return this._client.delete(path `/browsers/${id_or_name}/webmcp/custom-tools/${id}`, {
|
|
66
|
+
...options,
|
|
67
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=custom-tools.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-tools.mjs","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/custom-tools.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAAgB,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,QAAQ,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CACD,QAAgB,EAChB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,QAAQ,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAU,EAAE,MAA8B,EAAE,OAAwB;QACzE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,UAAU,wBAAwB,EAAE,EAAE,EAAE;YAClF,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { CustomTools, type AddRequest, type CustomToolsResponse, type Definition, type Match, type CustomToolAddParams, type CustomToolRemoveParams, } from "./custom-tools.mjs";
|
|
2
|
+
export { Webmcp, type CustomToolSource, type InvocationFailure, type InvocationResult, type InvokeRequest, type Tool, type ToolAnnotations, type ToolFrame, type ToolMetadata, type ToolSource, type ToolsResponse, type WebmcpInvokeToolParams, type WebmcpListToolsParams, } from "./webmcp.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,2BAAuB;AACxB,OAAO,EACL,MAAM,EACN,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,qBAAiB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { CustomTools, type AddRequest, type CustomToolsResponse, type Definition, type Match, type CustomToolAddParams, type CustomToolRemoveParams, } from "./custom-tools.js";
|
|
2
|
+
export { Webmcp, type CustomToolSource, type InvocationFailure, type InvocationResult, type InvokeRequest, type Tool, type ToolAnnotations, type ToolFrame, type ToolMetadata, type ToolSource, type ToolsResponse, type WebmcpInvokeToolParams, type WebmcpListToolsParams, } from "./webmcp.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,0BAAuB;AACxB,OAAO,EACL,MAAM,EACN,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,oBAAiB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Webmcp = exports.CustomTools = void 0;
|
|
5
|
+
var custom_tools_1 = require("./custom-tools.js");
|
|
6
|
+
Object.defineProperty(exports, "CustomTools", { enumerable: true, get: function () { return custom_tools_1.CustomTools; } });
|
|
7
|
+
var webmcp_1 = require("./webmcp.js");
|
|
8
|
+
Object.defineProperty(exports, "Webmcp", { enumerable: true, get: function () { return webmcp_1.Webmcp; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAQwB;AAPtB,2GAAA,WAAW,OAAA;AAQb,sCAckB;AAbhB,gGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,WAAW,GAOZ,2BAAuB;AACxB,OAAO,EACL,MAAM,GAaP,qBAAiB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as CustomToolsAPI from "./custom-tools.mjs";
|
|
3
|
+
import { AddRequest, CustomToolAddParams, CustomToolRemoveParams, CustomTools, CustomToolsResponse, Definition, Match } from "./custom-tools.mjs";
|
|
4
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
5
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Discover and invoke native page tools across the browser instance.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Webmcp extends APIResource {
|
|
10
|
+
customTools: CustomToolsAPI.CustomTools;
|
|
11
|
+
/**
|
|
12
|
+
* Invokes the exact live registration identified by tool_ref. Non-autosubmit
|
|
13
|
+
* declarative form tools return after their fields are populated with an
|
|
14
|
+
* awaiting_submission status. Other tools wait for a terminal result, including
|
|
15
|
+
* across navigation. Inspect a populated form, obtain any required confirmation,
|
|
16
|
+
* then submit through Playwright or computer interaction without invoking the tool
|
|
17
|
+
* again. If the tab or embedded frame disappears, or the request times out after
|
|
18
|
+
* invocation begins, the response reports outcome_unknown and the tool is not
|
|
19
|
+
* retried. CDP-backed custom tool outputs above 240 KiB return an error rather
|
|
20
|
+
* than a truncated result.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const invocationResult =
|
|
25
|
+
* await client.browsers.webmcp.invokeTool(
|
|
26
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
27
|
+
* {
|
|
28
|
+
* input: { foo: 'bar' },
|
|
29
|
+
* tool_ref: 'x',
|
|
30
|
+
* },
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
invokeTool(idOrName: string, body: WebmcpInvokeToolParams, options?: RequestOptions): APIPromise<InvocationResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Returns a snapshot of native and custom WebMCP tools available across every open
|
|
37
|
+
* tab and embedded frame in the browser. Each tool includes an opaque tool_ref for
|
|
38
|
+
* invoking that exact live registration, nested tool metadata, and source
|
|
39
|
+
* information. Custom tools include their generated ID, namespace, and CDP
|
|
40
|
+
* target_id in source. Tools disappear when their document closes or navigates
|
|
41
|
+
* away. Use exclude_custom to return only page-provided tools.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const toolsResponse =
|
|
46
|
+
* await client.browsers.webmcp.listTools(
|
|
47
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
listTools(idOrName: string, query?: WebmcpListToolsParams | null | undefined, options?: RequestOptions): APIPromise<ToolsResponse>;
|
|
52
|
+
}
|
|
53
|
+
export interface CustomToolSource {
|
|
54
|
+
id: string;
|
|
55
|
+
namespace: string;
|
|
56
|
+
}
|
|
57
|
+
export interface InvocationFailure {
|
|
58
|
+
code: 'outcome_unknown';
|
|
59
|
+
message: string;
|
|
60
|
+
invocation_id?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface InvocationResult {
|
|
63
|
+
invocation_id: string;
|
|
64
|
+
/**
|
|
65
|
+
* awaiting_submission means a non-autosubmit declarative form was populated but
|
|
66
|
+
* not submitted. Inspect the form, obtain any required confirmation, then submit
|
|
67
|
+
* through Playwright or computer interaction without invoking the tool again. The
|
|
68
|
+
* other statuses are terminal results.
|
|
69
|
+
*/
|
|
70
|
+
status: 'completed' | 'canceled' | 'error' | 'awaiting_submission';
|
|
71
|
+
error_text?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Untrusted page-provided output. Callers must treat it as potentially malicious
|
|
74
|
+
* input.
|
|
75
|
+
*/
|
|
76
|
+
output?: unknown;
|
|
77
|
+
}
|
|
78
|
+
export interface InvokeRequest {
|
|
79
|
+
/**
|
|
80
|
+
* Tool input, limited to 1 MiB after JSON serialization.
|
|
81
|
+
*/
|
|
82
|
+
input: {
|
|
83
|
+
[key: string]: unknown;
|
|
84
|
+
};
|
|
85
|
+
tool_ref: string;
|
|
86
|
+
timeout_sec?: number;
|
|
87
|
+
}
|
|
88
|
+
export interface Tool {
|
|
89
|
+
source: ToolSource;
|
|
90
|
+
/**
|
|
91
|
+
* Tool metadata follows the
|
|
92
|
+
* [MCP Tool definition](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool)
|
|
93
|
+
* and the
|
|
94
|
+
* [WebMCP RegisteredTool definition](https://webmachinelearning.github.io/webmcp/#dictdef-registeredtool).
|
|
95
|
+
* outputSchema is optional for page and custom tools.
|
|
96
|
+
*/
|
|
97
|
+
tool: ToolMetadata;
|
|
98
|
+
/**
|
|
99
|
+
* Opaque reference for invoking this exact live registration. It becomes invalid
|
|
100
|
+
* when its document or browser process is replaced.
|
|
101
|
+
*/
|
|
102
|
+
tool_ref: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Tool-provided behavioral hints from the
|
|
106
|
+
* [MCP tool specification](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool)
|
|
107
|
+
* and the
|
|
108
|
+
* [WebMCP ToolAnnotations definition](https://webmachinelearning.github.io/webmcp/#dictdef-toolannotations).
|
|
109
|
+
* These hints are untrusted and are not enforced by Kernel.
|
|
110
|
+
*/
|
|
111
|
+
export interface ToolAnnotations {
|
|
112
|
+
autosubmit?: boolean;
|
|
113
|
+
consequentialHint?: boolean;
|
|
114
|
+
destructiveHint?: boolean;
|
|
115
|
+
idempotentHint?: boolean;
|
|
116
|
+
openWorldHint?: boolean;
|
|
117
|
+
readOnlyHint?: boolean;
|
|
118
|
+
untrustedContentHint?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface ToolFrame {
|
|
121
|
+
/**
|
|
122
|
+
* Monotonically increasing identifier for this embedded frame during the current
|
|
123
|
+
* browser process.
|
|
124
|
+
*/
|
|
125
|
+
frame_id: number;
|
|
126
|
+
/**
|
|
127
|
+
* Current frame URL with the fragment omitted.
|
|
128
|
+
*/
|
|
129
|
+
url: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Tool metadata follows the
|
|
133
|
+
* [MCP Tool definition](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool)
|
|
134
|
+
* and the
|
|
135
|
+
* [WebMCP RegisteredTool definition](https://webmachinelearning.github.io/webmcp/#dictdef-registeredtool).
|
|
136
|
+
* outputSchema is optional for page and custom tools.
|
|
137
|
+
*/
|
|
138
|
+
export interface ToolMetadata {
|
|
139
|
+
description: string;
|
|
140
|
+
inputSchema: {
|
|
141
|
+
[key: string]: unknown;
|
|
142
|
+
};
|
|
143
|
+
name: string;
|
|
144
|
+
/**
|
|
145
|
+
* Tool-provided behavioral hints from the
|
|
146
|
+
* [MCP tool specification](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool)
|
|
147
|
+
* and the
|
|
148
|
+
* [WebMCP ToolAnnotations definition](https://webmachinelearning.github.io/webmcp/#dictdef-toolannotations).
|
|
149
|
+
* These hints are untrusted and are not enforced by Kernel.
|
|
150
|
+
*/
|
|
151
|
+
annotations?: ToolAnnotations;
|
|
152
|
+
outputSchema?: {
|
|
153
|
+
[key: string]: unknown;
|
|
154
|
+
};
|
|
155
|
+
title?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface ToolSource {
|
|
158
|
+
/**
|
|
159
|
+
* Embedded frame that registered the tool, or null when the top-level page
|
|
160
|
+
* registered it.
|
|
161
|
+
*/
|
|
162
|
+
frame: ToolFrame | null;
|
|
163
|
+
/**
|
|
164
|
+
* Current title of the top-level page.
|
|
165
|
+
*/
|
|
166
|
+
page_title: string;
|
|
167
|
+
/**
|
|
168
|
+
* Current URL of the top-level page with the fragment omitted.
|
|
169
|
+
*/
|
|
170
|
+
page_url: string;
|
|
171
|
+
/**
|
|
172
|
+
* Monotonically increasing identifier for the tab during the current browser
|
|
173
|
+
* process.
|
|
174
|
+
*/
|
|
175
|
+
tab_id: number;
|
|
176
|
+
/**
|
|
177
|
+
* Monotonically increasing identifier for the browser window during the current
|
|
178
|
+
* browser process.
|
|
179
|
+
*/
|
|
180
|
+
window_id: number;
|
|
181
|
+
custom?: CustomToolSource;
|
|
182
|
+
/**
|
|
183
|
+
* CDP target ID for a custom tool's registration tab; omitted for page-provided
|
|
184
|
+
* tools.
|
|
185
|
+
*/
|
|
186
|
+
target_id?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface ToolsResponse {
|
|
189
|
+
tools: Array<Tool>;
|
|
190
|
+
}
|
|
191
|
+
export interface WebmcpInvokeToolParams {
|
|
192
|
+
/**
|
|
193
|
+
* Tool input, limited to 1 MiB after JSON serialization.
|
|
194
|
+
*/
|
|
195
|
+
input: {
|
|
196
|
+
[key: string]: unknown;
|
|
197
|
+
};
|
|
198
|
+
tool_ref: string;
|
|
199
|
+
timeout_sec?: number;
|
|
200
|
+
}
|
|
201
|
+
export interface WebmcpListToolsParams {
|
|
202
|
+
/**
|
|
203
|
+
* Exclude custom tools when true.
|
|
204
|
+
*/
|
|
205
|
+
exclude_custom?: boolean;
|
|
206
|
+
}
|
|
207
|
+
export declare namespace Webmcp {
|
|
208
|
+
export { type CustomToolSource as CustomToolSource, type InvocationFailure as InvocationFailure, type InvocationResult as InvocationResult, type InvokeRequest as InvokeRequest, type Tool as Tool, type ToolAnnotations as ToolAnnotations, type ToolFrame as ToolFrame, type ToolMetadata as ToolMetadata, type ToolSource as ToolSource, type ToolsResponse as ToolsResponse, type WebmcpInvokeToolParams as WebmcpInvokeToolParams, type WebmcpListToolsParams as WebmcpListToolsParams, };
|
|
209
|
+
export { CustomTools as CustomTools, type AddRequest as AddRequest, type CustomToolsResponse as CustomToolsResponse, type Definition as Definition, type Match as Match, type CustomToolAddParams as CustomToolAddParams, type CustomToolRemoveParams as CustomToolRemoveParams, };
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=webmcp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webmcp.d.mts","sourceRoot":"","sources":["../../../src/resources/browsers/webmcp/webmcp.ts"],"names":[],"mappings":"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"}
|