@mokuhub/mokutab-shared 0.0.0-stage → 2.0.1
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/LICENSE +21 -0
- package/LICENSE.upstream +21 -0
- package/dist/index.d.mts +691 -0
- package/dist/index.d.ts +691 -0
- package/dist/index.js +5909 -0
- package/dist/index.mjs +5858 -0
- package/package.json +48 -3
- package/README.md +0 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,691 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
|
|
3
|
+
declare const DEFAULT_SERVER_PORT = 12306;
|
|
4
|
+
declare const HOST_NAME = "com.chromemcp.nativehost";
|
|
5
|
+
|
|
6
|
+
declare enum NativeMessageType {
|
|
7
|
+
START = "start",
|
|
8
|
+
STARTED = "started",
|
|
9
|
+
STOP = "stop",
|
|
10
|
+
STOPPED = "stopped",
|
|
11
|
+
PING = "ping",
|
|
12
|
+
PONG = "pong",
|
|
13
|
+
ERROR = "error",
|
|
14
|
+
CALL_TOOL = "call_tool",
|
|
15
|
+
CALL_TOOL_RESPONSE = "call_tool_response",
|
|
16
|
+
SERVER_STARTED = "server_started",
|
|
17
|
+
SERVER_STOPPED = "server_stopped",
|
|
18
|
+
ERROR_FROM_NATIVE_HOST = "error_from_native_host",
|
|
19
|
+
CONNECT_NATIVE = "connectNative",
|
|
20
|
+
ENSURE_NATIVE = "ensure_native",
|
|
21
|
+
PING_NATIVE = "ping_native",
|
|
22
|
+
DISCONNECT_NATIVE = "disconnect_native",
|
|
23
|
+
DEV_EXTENSION_INFO = "dev_extension_info",
|
|
24
|
+
DEV_RELOAD_EXTENSION = "dev_reload_extension",
|
|
25
|
+
AGENT_TAB_OPEN = "agent_tab_open",
|
|
26
|
+
AGENT_TAB_CLOSE = "agent_tab_close",
|
|
27
|
+
AGENT_TAB_INFO = "agent_tab_info",
|
|
28
|
+
AGENT_TAB_NAVIGATE = "agent_tab_navigate",
|
|
29
|
+
WATCH_PROBE = "watch_probe",
|
|
30
|
+
MODULES_GET = "modules_get",
|
|
31
|
+
MODULES_SET = "modules_set",
|
|
32
|
+
MODULES_STATE = "modules_state"
|
|
33
|
+
}
|
|
34
|
+
/** One installed module and whether it is on, as the bridge reports it. */
|
|
35
|
+
interface ModuleStateEntry {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** Payload of MODULES_STATE and the answer to MODULES_GET / MODULES_SET. */
|
|
41
|
+
interface ModulesStatePayload {
|
|
42
|
+
modules: ModuleStateEntry[];
|
|
43
|
+
}
|
|
44
|
+
interface NativeMessage<P = any, E = any> {
|
|
45
|
+
type?: NativeMessageType;
|
|
46
|
+
responseToRequestId?: string;
|
|
47
|
+
payload?: P;
|
|
48
|
+
error?: E;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A single element selection request from the AI.
|
|
52
|
+
*/
|
|
53
|
+
interface ElementPickerRequest {
|
|
54
|
+
/**
|
|
55
|
+
* Optional stable request id. If omitted, the extension will generate one.
|
|
56
|
+
*/
|
|
57
|
+
id?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Short label shown to the user (e.g., "Login button").
|
|
60
|
+
*/
|
|
61
|
+
name: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional longer instruction shown to the user.
|
|
64
|
+
*/
|
|
65
|
+
description?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Bounding rectangle of a picked element.
|
|
69
|
+
*/
|
|
70
|
+
interface PickedElementRect {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Center point of a picked element.
|
|
78
|
+
*/
|
|
79
|
+
interface PickedElementPoint {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A picked element that can be used with other tools (click, fill, etc.).
|
|
85
|
+
*/
|
|
86
|
+
interface PickedElement {
|
|
87
|
+
/**
|
|
88
|
+
* Element ref written into window.__claudeElementMap (frame-local).
|
|
89
|
+
* Can be used directly with chrome_click_element, chrome_fill_or_select, etc.
|
|
90
|
+
*/
|
|
91
|
+
ref: string;
|
|
92
|
+
/**
|
|
93
|
+
* Best-effort stable CSS selector.
|
|
94
|
+
*/
|
|
95
|
+
selector: string;
|
|
96
|
+
/**
|
|
97
|
+
* Selector type (currently CSS only).
|
|
98
|
+
*/
|
|
99
|
+
selectorType: 'css';
|
|
100
|
+
/**
|
|
101
|
+
* Bounding rect in the element's frame viewport coordinates.
|
|
102
|
+
*/
|
|
103
|
+
rect: PickedElementRect;
|
|
104
|
+
/**
|
|
105
|
+
* Center point in the element's frame viewport coordinates.
|
|
106
|
+
* Can be used as coordinates for chrome_computer.
|
|
107
|
+
*/
|
|
108
|
+
center: PickedElementPoint;
|
|
109
|
+
/**
|
|
110
|
+
* Optional text snippet to help verify the selection.
|
|
111
|
+
*/
|
|
112
|
+
text?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Lowercased tag name.
|
|
115
|
+
*/
|
|
116
|
+
tagName?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Chrome frameId for iframe targeting.
|
|
119
|
+
* Pass this to chrome_click_element/chrome_fill_or_select for cross-frame support.
|
|
120
|
+
*/
|
|
121
|
+
frameId: number;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Result for a single element selection request.
|
|
125
|
+
*/
|
|
126
|
+
interface ElementPickerResultItem {
|
|
127
|
+
/**
|
|
128
|
+
* The request id (matches the input request).
|
|
129
|
+
*/
|
|
130
|
+
id: string;
|
|
131
|
+
/**
|
|
132
|
+
* The request name (for reference).
|
|
133
|
+
*/
|
|
134
|
+
name: string;
|
|
135
|
+
/**
|
|
136
|
+
* The picked element, or null if not selected.
|
|
137
|
+
*/
|
|
138
|
+
element: PickedElement | null;
|
|
139
|
+
/**
|
|
140
|
+
* Error message if selection failed for this request.
|
|
141
|
+
*/
|
|
142
|
+
error?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Result of the chrome_request_element_selection tool.
|
|
146
|
+
*/
|
|
147
|
+
interface ElementPickerResult {
|
|
148
|
+
/**
|
|
149
|
+
* True if the user confirmed all selections.
|
|
150
|
+
*/
|
|
151
|
+
success: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Session identifier for this picker session.
|
|
154
|
+
*/
|
|
155
|
+
sessionId: string;
|
|
156
|
+
/**
|
|
157
|
+
* Timeout value used for this session.
|
|
158
|
+
*/
|
|
159
|
+
timeoutMs: number;
|
|
160
|
+
/**
|
|
161
|
+
* True if the user cancelled the selection.
|
|
162
|
+
*/
|
|
163
|
+
cancelled?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* True if the selection timed out.
|
|
166
|
+
*/
|
|
167
|
+
timedOut?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* List of request IDs that were not selected (for debugging).
|
|
170
|
+
*/
|
|
171
|
+
missingRequestIds?: string[];
|
|
172
|
+
/**
|
|
173
|
+
* Results for each requested element.
|
|
174
|
+
*/
|
|
175
|
+
results: ElementPickerResultItem[];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Core MCP tool names and schemas: the browser tools and the profile/bridge tools.
|
|
180
|
+
*
|
|
181
|
+
* Module tools live under ./modules; ./modules/index.ts assembles the full
|
|
182
|
+
* TOOL_NAMES / TOOL_SCHEMAS catalogue from these and every installed module.
|
|
183
|
+
*
|
|
184
|
+
* Author: Roman Chikalenko
|
|
185
|
+
* Version: 1.4.0
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
declare const CORE_TOOL_NAMES: {
|
|
189
|
+
BROWSER: {
|
|
190
|
+
GET_WINDOWS_AND_TABS: string;
|
|
191
|
+
NAVIGATE: string;
|
|
192
|
+
SCREENSHOT: string;
|
|
193
|
+
CLOSE_TABS: string;
|
|
194
|
+
SWITCH_TAB: string;
|
|
195
|
+
WEB_FETCHER: string;
|
|
196
|
+
CLICK: string;
|
|
197
|
+
FILL: string;
|
|
198
|
+
REQUEST_ELEMENT_SELECTION: string;
|
|
199
|
+
NETWORK_CAPTURE: string;
|
|
200
|
+
NETWORK_CAPTURE_START: string;
|
|
201
|
+
NETWORK_CAPTURE_STOP: string;
|
|
202
|
+
NETWORK_REQUEST: string;
|
|
203
|
+
NETWORK_DEBUGGER_START: string;
|
|
204
|
+
NETWORK_DEBUGGER_STOP: string;
|
|
205
|
+
KEYBOARD: string;
|
|
206
|
+
HISTORY: string;
|
|
207
|
+
BOOKMARK_SEARCH: string;
|
|
208
|
+
BOOKMARK_ADD: string;
|
|
209
|
+
BOOKMARK_DELETE: string;
|
|
210
|
+
JAVASCRIPT: string;
|
|
211
|
+
CONSOLE: string;
|
|
212
|
+
FILE_UPLOAD: string;
|
|
213
|
+
READ_PAGE: string;
|
|
214
|
+
COMPUTER: string;
|
|
215
|
+
HANDLE_DIALOG: string;
|
|
216
|
+
HANDLE_DOWNLOAD: string;
|
|
217
|
+
FETCH_TO_FILE: string;
|
|
218
|
+
PERFORMANCE_START_TRACE: string;
|
|
219
|
+
PERFORMANCE_STOP_TRACE: string;
|
|
220
|
+
PERFORMANCE_ANALYZE_INSIGHT: string;
|
|
221
|
+
GIF_RECORDER: string;
|
|
222
|
+
SNAPSHOT: string;
|
|
223
|
+
LEASE_TAB: string;
|
|
224
|
+
SNAPSHOT_FILL_FORM: string;
|
|
225
|
+
ACT: string;
|
|
226
|
+
SEARCH_PAGE: string;
|
|
227
|
+
FIND_ELEMENTS: string;
|
|
228
|
+
RELEASE_TAB: string;
|
|
229
|
+
WATCH_START: string;
|
|
230
|
+
WATCH_STOP: string;
|
|
231
|
+
WATCH_LIST: string;
|
|
232
|
+
WATCH_EVENTS: string;
|
|
233
|
+
FN_LIST: string;
|
|
234
|
+
FN_GET: string;
|
|
235
|
+
FN_RUN: string;
|
|
236
|
+
FN_SAVE: string;
|
|
237
|
+
FN_RUNS: string;
|
|
238
|
+
SNAPSHOT_CLICK: string;
|
|
239
|
+
SNAPSHOT_FILL: string;
|
|
240
|
+
SNAPSHOT_HOVER: string;
|
|
241
|
+
SNAPSHOT_WAIT_FOR: string;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Profile and bridge tools. Named workato_* until 2.0; the Workato module
|
|
245
|
+
* keeps those old names as aliases until 3.0 (modules/workato/aliases.ts).
|
|
246
|
+
*/
|
|
247
|
+
BRIDGE: {
|
|
248
|
+
LIST_PROFILES: string;
|
|
249
|
+
BRIDGE_INFO: string;
|
|
250
|
+
RELOAD_EXTENSION: string;
|
|
251
|
+
SWITCH_PROFILE: string;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
declare const CORE_TOOL_SCHEMAS: Tool[];
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* What every side knows about an installed module: its id, its tools and its
|
|
258
|
+
* part of the server instructions. The bridge and the extension each wrap
|
|
259
|
+
* this in their own module object (bridge hooks, extension executors).
|
|
260
|
+
*/
|
|
261
|
+
interface ToolModule {
|
|
262
|
+
/** Stable id: the key in the bridge config file, the popup switch, the refusal text. */
|
|
263
|
+
id: string;
|
|
264
|
+
/** Display name. */
|
|
265
|
+
title: string;
|
|
266
|
+
/** Tool schemas, listed only while the module is on. */
|
|
267
|
+
tools: Tool[];
|
|
268
|
+
/** Server-instructions snippet, appended to the core snippet while the module is on. */
|
|
269
|
+
instructions: string;
|
|
270
|
+
/**
|
|
271
|
+
* Old tool names this module keeps working, each mapped to the tool it now
|
|
272
|
+
* names. Listed (with that tool's schema) and routed only while the module
|
|
273
|
+
* is on.
|
|
274
|
+
*/
|
|
275
|
+
aliases?: Readonly<Record<string, string>>;
|
|
276
|
+
}
|
|
277
|
+
/** Refusal for a call to a tool whose module is switched off. Same wording on both sides. */
|
|
278
|
+
declare function moduleOffMessage(module: Pick<ToolModule, 'id' | 'title'>, tool: string): string;
|
|
279
|
+
/** How an alias is listed: a pointer at the tool it names, not a second copy of its docs. */
|
|
280
|
+
declare function aliasDescription(target: string): string;
|
|
281
|
+
/** Refusal for an alias whose module is switched off; the tool it names works regardless. */
|
|
282
|
+
declare function aliasOffMessage(module: Pick<ToolModule, 'title'>, alias: string, target: string): string;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Workato module tool names.
|
|
286
|
+
*
|
|
287
|
+
* The families keep the keys they had in TOOL_NAMES. The four profile/bridge
|
|
288
|
+
* tools are core (CORE_TOOL_NAMES.BRIDGE, chrome_* since 2.0); their 1.x
|
|
289
|
+
* workato_* names are this module's aliases (./aliases.ts).
|
|
290
|
+
*/
|
|
291
|
+
declare const WORKATO_TOOL_NAMES: {
|
|
292
|
+
WORKATO: {
|
|
293
|
+
PULL_RECIPE: string;
|
|
294
|
+
RECIPE_GREP: string;
|
|
295
|
+
RENAME_RECIPE: string;
|
|
296
|
+
SET_VERSION_COMMENT: string;
|
|
297
|
+
START_RECIPE: string;
|
|
298
|
+
STOP_RECIPE: string;
|
|
299
|
+
RECIPE_STATUS: string;
|
|
300
|
+
VERSION_DIFF: string;
|
|
301
|
+
JOB_TRACE: string;
|
|
302
|
+
REPEAT_JOB: string;
|
|
303
|
+
TEST_RECIPE: string;
|
|
304
|
+
SEARCH_RECIPES: string;
|
|
305
|
+
SEARCH_CONNECTIONS: string;
|
|
306
|
+
GET_CONNECTION: string;
|
|
307
|
+
RECIPE_CONNECTIONS: string;
|
|
308
|
+
LIST_JOBS: string;
|
|
309
|
+
RUN_QUERY: string;
|
|
310
|
+
CALL_ACTION: string;
|
|
311
|
+
SWITCH_ENVIRONMENT: string;
|
|
312
|
+
DEPLOYMENTS_LIST: string;
|
|
313
|
+
DEPLOY_PLAN: string;
|
|
314
|
+
DEPLOY_RUN: string;
|
|
315
|
+
LIST_FOLDERS: string;
|
|
316
|
+
CREATE_FOLDER: string;
|
|
317
|
+
UPDATE_FOLDER: string;
|
|
318
|
+
DELETE_FOLDER: string;
|
|
319
|
+
PROPERTIES: string;
|
|
320
|
+
MOVE_RECIPE: string;
|
|
321
|
+
COPY_RECIPE: string;
|
|
322
|
+
DELETE_RECIPE: string;
|
|
323
|
+
CREATE_PROJECT: string;
|
|
324
|
+
UPDATE_PROJECT: string;
|
|
325
|
+
ADAPTER_META: string;
|
|
326
|
+
APPS_LIST: string;
|
|
327
|
+
PICK_LIST: string;
|
|
328
|
+
STEP_SCHEMA: string;
|
|
329
|
+
RECIPE_STEP_SEARCH: string;
|
|
330
|
+
RECIPE_CALLERS: string;
|
|
331
|
+
SAVE_WITH_DEPENDENTS: string;
|
|
332
|
+
OPERATION_STATUS: string;
|
|
333
|
+
CALLABLE_SCHEMA_SET: string;
|
|
334
|
+
CALLER_BIND: string;
|
|
335
|
+
DATAPILL: string;
|
|
336
|
+
API_REQUEST: string;
|
|
337
|
+
};
|
|
338
|
+
WORKATO_UI: {
|
|
339
|
+
OPEN_RECIPE: string;
|
|
340
|
+
ENTER_EDIT_MODE: string;
|
|
341
|
+
LIST_STEPS: string;
|
|
342
|
+
FOCUS_STEP: string;
|
|
343
|
+
ADD_STEP: string;
|
|
344
|
+
SET_FIELD: string;
|
|
345
|
+
INSERT_DATAPILL: string;
|
|
346
|
+
SAVE_RECIPE: string;
|
|
347
|
+
EXIT_EDIT_MODE: string;
|
|
348
|
+
CREATE_RECIPE: string;
|
|
349
|
+
SAVE_RECIPE_CODE: string;
|
|
350
|
+
};
|
|
351
|
+
WORKATO_RECIPE: {
|
|
352
|
+
ADD_STEP: string;
|
|
353
|
+
SET_STEP_INPUT: string;
|
|
354
|
+
MAP_DATAPILL: string;
|
|
355
|
+
SET_INPUT_PATH: string;
|
|
356
|
+
DELETE_INPUT_PATH: string;
|
|
357
|
+
SET_PY_EVAL_CODE: string;
|
|
358
|
+
SET_EXTENDED_SCHEMA: string;
|
|
359
|
+
APPLY: string;
|
|
360
|
+
VALIDATE: string;
|
|
361
|
+
};
|
|
362
|
+
WORKATO_LCAP: {
|
|
363
|
+
APPS_LIST: string;
|
|
364
|
+
PAGE_GET: string;
|
|
365
|
+
PAGE_SAVE: string;
|
|
366
|
+
PAGE_VALIDATE: string;
|
|
367
|
+
WIDGET_PATCH: string;
|
|
368
|
+
PAGE_CREATE: string;
|
|
369
|
+
PAGE_DELETE: string;
|
|
370
|
+
};
|
|
371
|
+
WORKATO_LOOKUP: {
|
|
372
|
+
TABLES_LIST: string;
|
|
373
|
+
TABLE_GET: string;
|
|
374
|
+
TABLE_CREATE: string;
|
|
375
|
+
TABLE_RENAME: string;
|
|
376
|
+
TABLE_SET_COLUMNS: string;
|
|
377
|
+
TABLE_DELETE: string;
|
|
378
|
+
ROW_CREATE: string;
|
|
379
|
+
ROW_UPDATE: string;
|
|
380
|
+
ROW_DELETE: string;
|
|
381
|
+
ROW_UPSERT: string;
|
|
382
|
+
ROW_SEARCH: string;
|
|
383
|
+
IMPORT_CSV: string;
|
|
384
|
+
};
|
|
385
|
+
WORKATO_DATA_TABLE: {
|
|
386
|
+
TABLES_LIST: string;
|
|
387
|
+
TABLE_GET: string;
|
|
388
|
+
TABLE_CREATE: string;
|
|
389
|
+
TABLE_RENAME: string;
|
|
390
|
+
TABLE_DELETE: string;
|
|
391
|
+
ADD_COLUMN: string;
|
|
392
|
+
UPDATE_COLUMN: string;
|
|
393
|
+
DELETE_COLUMN: string;
|
|
394
|
+
ROW_LIST: string;
|
|
395
|
+
ROW_CREATE: string;
|
|
396
|
+
ROW_UPDATE: string;
|
|
397
|
+
ROW_DELETE: string;
|
|
398
|
+
};
|
|
399
|
+
WORKATO_SESSION: {
|
|
400
|
+
WHOAMI: string;
|
|
401
|
+
SESSION_CONTEXT: string;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Workato module tool schemas.
|
|
407
|
+
*/
|
|
408
|
+
|
|
409
|
+
declare const WORKATO_TOOL_SCHEMAS: Tool[];
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* The Workato part of the server instructions, sent at initialize while the
|
|
413
|
+
* module is on. It names tools only, never their parameters: the schema is the
|
|
414
|
+
* documentation. The budget for core plus every module is checked in the
|
|
415
|
+
* bridge (server-identity.test.ts).
|
|
416
|
+
*/
|
|
417
|
+
declare const WORKATO_INSTRUCTIONS: string;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The 1.x names of the four core profile/bridge tools, which carried the
|
|
421
|
+
* workato_ prefix until 2.0. Skills, CLAUDE.md files and permission lists
|
|
422
|
+
* still name them, so they keep working until 3.0 while this module is on:
|
|
423
|
+
* listed with the schema of the tool they now name, routed to it.
|
|
424
|
+
*/
|
|
425
|
+
declare const WORKATO_TOOL_ALIASES: Readonly<Record<string, string>>;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* The id and title on their own, for code that needs no schemas (the
|
|
429
|
+
* extension): its bundler keeps a whole object literal when one property is
|
|
430
|
+
* read, so reading WORKATO_MODULE.id would ship every Workato schema with it.
|
|
431
|
+
*/
|
|
432
|
+
declare const WORKATO_MODULE_ID = "workato";
|
|
433
|
+
declare const WORKATO_MODULE_TITLE = "Workato";
|
|
434
|
+
declare const WORKATO_MODULE: ToolModule;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Installed modules, and the full catalogue assembled from core plus every
|
|
438
|
+
* module.
|
|
439
|
+
*
|
|
440
|
+
* This is the one place outside a module folder that knows the modules. The
|
|
441
|
+
* bridge and the extension list and switch them through MODULES; TOOL_NAMES
|
|
442
|
+
* and TOOL_SCHEMAS keep their pre-module contents (every tool, whatever is
|
|
443
|
+
* switched on) for the consumers that want the whole catalogue.
|
|
444
|
+
*/
|
|
445
|
+
|
|
446
|
+
/** Every installed module, in listing order. */
|
|
447
|
+
declare const MODULES: readonly ToolModule[];
|
|
448
|
+
/**
|
|
449
|
+
* Every tool name, grouped as before the module split, plus BRIDGE: the four
|
|
450
|
+
* core profile/bridge tools, which sat in WORKATO while they carried the
|
|
451
|
+
* workato_ prefix.
|
|
452
|
+
*/
|
|
453
|
+
declare const TOOL_NAMES: {
|
|
454
|
+
BROWSER: {
|
|
455
|
+
GET_WINDOWS_AND_TABS: string;
|
|
456
|
+
NAVIGATE: string;
|
|
457
|
+
SCREENSHOT: string;
|
|
458
|
+
CLOSE_TABS: string;
|
|
459
|
+
SWITCH_TAB: string;
|
|
460
|
+
WEB_FETCHER: string;
|
|
461
|
+
CLICK: string;
|
|
462
|
+
FILL: string;
|
|
463
|
+
REQUEST_ELEMENT_SELECTION: string;
|
|
464
|
+
NETWORK_CAPTURE: string;
|
|
465
|
+
NETWORK_CAPTURE_START: string;
|
|
466
|
+
NETWORK_CAPTURE_STOP: string;
|
|
467
|
+
NETWORK_REQUEST: string;
|
|
468
|
+
NETWORK_DEBUGGER_START: string;
|
|
469
|
+
NETWORK_DEBUGGER_STOP: string;
|
|
470
|
+
KEYBOARD: string;
|
|
471
|
+
HISTORY: string;
|
|
472
|
+
BOOKMARK_SEARCH: string;
|
|
473
|
+
BOOKMARK_ADD: string;
|
|
474
|
+
BOOKMARK_DELETE: string;
|
|
475
|
+
JAVASCRIPT: string;
|
|
476
|
+
CONSOLE: string;
|
|
477
|
+
FILE_UPLOAD: string;
|
|
478
|
+
READ_PAGE: string;
|
|
479
|
+
COMPUTER: string;
|
|
480
|
+
HANDLE_DIALOG: string;
|
|
481
|
+
HANDLE_DOWNLOAD: string;
|
|
482
|
+
FETCH_TO_FILE: string;
|
|
483
|
+
PERFORMANCE_START_TRACE: string;
|
|
484
|
+
PERFORMANCE_STOP_TRACE: string;
|
|
485
|
+
PERFORMANCE_ANALYZE_INSIGHT: string;
|
|
486
|
+
GIF_RECORDER: string;
|
|
487
|
+
SNAPSHOT: string;
|
|
488
|
+
LEASE_TAB: string;
|
|
489
|
+
SNAPSHOT_FILL_FORM: string;
|
|
490
|
+
ACT: string;
|
|
491
|
+
SEARCH_PAGE: string;
|
|
492
|
+
FIND_ELEMENTS: string;
|
|
493
|
+
RELEASE_TAB: string;
|
|
494
|
+
WATCH_START: string;
|
|
495
|
+
WATCH_STOP: string;
|
|
496
|
+
WATCH_LIST: string;
|
|
497
|
+
WATCH_EVENTS: string;
|
|
498
|
+
FN_LIST: string;
|
|
499
|
+
FN_GET: string;
|
|
500
|
+
FN_RUN: string;
|
|
501
|
+
FN_SAVE: string;
|
|
502
|
+
FN_RUNS: string;
|
|
503
|
+
SNAPSHOT_CLICK: string;
|
|
504
|
+
SNAPSHOT_FILL: string;
|
|
505
|
+
SNAPSHOT_HOVER: string;
|
|
506
|
+
SNAPSHOT_WAIT_FOR: string;
|
|
507
|
+
};
|
|
508
|
+
BRIDGE: {
|
|
509
|
+
LIST_PROFILES: string;
|
|
510
|
+
BRIDGE_INFO: string;
|
|
511
|
+
RELOAD_EXTENSION: string;
|
|
512
|
+
SWITCH_PROFILE: string;
|
|
513
|
+
};
|
|
514
|
+
WORKATO: {
|
|
515
|
+
PULL_RECIPE: string;
|
|
516
|
+
RECIPE_GREP: string;
|
|
517
|
+
RENAME_RECIPE: string;
|
|
518
|
+
SET_VERSION_COMMENT: string;
|
|
519
|
+
START_RECIPE: string;
|
|
520
|
+
STOP_RECIPE: string;
|
|
521
|
+
RECIPE_STATUS: string;
|
|
522
|
+
VERSION_DIFF: string;
|
|
523
|
+
JOB_TRACE: string;
|
|
524
|
+
REPEAT_JOB: string;
|
|
525
|
+
TEST_RECIPE: string;
|
|
526
|
+
SEARCH_RECIPES: string;
|
|
527
|
+
SEARCH_CONNECTIONS: string;
|
|
528
|
+
GET_CONNECTION: string;
|
|
529
|
+
RECIPE_CONNECTIONS: string;
|
|
530
|
+
LIST_JOBS: string;
|
|
531
|
+
RUN_QUERY: string;
|
|
532
|
+
CALL_ACTION: string;
|
|
533
|
+
SWITCH_ENVIRONMENT: string;
|
|
534
|
+
DEPLOYMENTS_LIST: string;
|
|
535
|
+
DEPLOY_PLAN: string;
|
|
536
|
+
DEPLOY_RUN: string;
|
|
537
|
+
LIST_FOLDERS: string;
|
|
538
|
+
CREATE_FOLDER: string;
|
|
539
|
+
UPDATE_FOLDER: string;
|
|
540
|
+
DELETE_FOLDER: string;
|
|
541
|
+
PROPERTIES: string;
|
|
542
|
+
MOVE_RECIPE: string;
|
|
543
|
+
COPY_RECIPE: string;
|
|
544
|
+
DELETE_RECIPE: string;
|
|
545
|
+
CREATE_PROJECT: string;
|
|
546
|
+
UPDATE_PROJECT: string;
|
|
547
|
+
ADAPTER_META: string;
|
|
548
|
+
APPS_LIST: string;
|
|
549
|
+
PICK_LIST: string;
|
|
550
|
+
STEP_SCHEMA: string;
|
|
551
|
+
RECIPE_STEP_SEARCH: string;
|
|
552
|
+
RECIPE_CALLERS: string;
|
|
553
|
+
SAVE_WITH_DEPENDENTS: string;
|
|
554
|
+
OPERATION_STATUS: string;
|
|
555
|
+
CALLABLE_SCHEMA_SET: string;
|
|
556
|
+
CALLER_BIND: string;
|
|
557
|
+
DATAPILL: string;
|
|
558
|
+
API_REQUEST: string;
|
|
559
|
+
};
|
|
560
|
+
WORKATO_UI: {
|
|
561
|
+
OPEN_RECIPE: string;
|
|
562
|
+
ENTER_EDIT_MODE: string;
|
|
563
|
+
LIST_STEPS: string;
|
|
564
|
+
FOCUS_STEP: string;
|
|
565
|
+
ADD_STEP: string;
|
|
566
|
+
SET_FIELD: string;
|
|
567
|
+
INSERT_DATAPILL: string;
|
|
568
|
+
SAVE_RECIPE: string;
|
|
569
|
+
EXIT_EDIT_MODE: string;
|
|
570
|
+
CREATE_RECIPE: string;
|
|
571
|
+
SAVE_RECIPE_CODE: string;
|
|
572
|
+
};
|
|
573
|
+
WORKATO_RECIPE: {
|
|
574
|
+
ADD_STEP: string;
|
|
575
|
+
SET_STEP_INPUT: string;
|
|
576
|
+
MAP_DATAPILL: string;
|
|
577
|
+
SET_INPUT_PATH: string;
|
|
578
|
+
DELETE_INPUT_PATH: string;
|
|
579
|
+
SET_PY_EVAL_CODE: string;
|
|
580
|
+
SET_EXTENDED_SCHEMA: string;
|
|
581
|
+
APPLY: string;
|
|
582
|
+
VALIDATE: string;
|
|
583
|
+
};
|
|
584
|
+
WORKATO_LCAP: {
|
|
585
|
+
APPS_LIST: string;
|
|
586
|
+
PAGE_GET: string;
|
|
587
|
+
PAGE_SAVE: string;
|
|
588
|
+
PAGE_VALIDATE: string;
|
|
589
|
+
WIDGET_PATCH: string;
|
|
590
|
+
PAGE_CREATE: string;
|
|
591
|
+
PAGE_DELETE: string;
|
|
592
|
+
};
|
|
593
|
+
WORKATO_LOOKUP: {
|
|
594
|
+
TABLES_LIST: string;
|
|
595
|
+
TABLE_GET: string;
|
|
596
|
+
TABLE_CREATE: string;
|
|
597
|
+
TABLE_RENAME: string;
|
|
598
|
+
TABLE_SET_COLUMNS: string;
|
|
599
|
+
TABLE_DELETE: string;
|
|
600
|
+
ROW_CREATE: string;
|
|
601
|
+
ROW_UPDATE: string;
|
|
602
|
+
ROW_DELETE: string;
|
|
603
|
+
ROW_UPSERT: string;
|
|
604
|
+
ROW_SEARCH: string;
|
|
605
|
+
IMPORT_CSV: string;
|
|
606
|
+
};
|
|
607
|
+
WORKATO_DATA_TABLE: {
|
|
608
|
+
TABLES_LIST: string;
|
|
609
|
+
TABLE_GET: string;
|
|
610
|
+
TABLE_CREATE: string;
|
|
611
|
+
TABLE_RENAME: string;
|
|
612
|
+
TABLE_DELETE: string;
|
|
613
|
+
ADD_COLUMN: string;
|
|
614
|
+
UPDATE_COLUMN: string;
|
|
615
|
+
DELETE_COLUMN: string;
|
|
616
|
+
ROW_LIST: string;
|
|
617
|
+
ROW_CREATE: string;
|
|
618
|
+
ROW_UPDATE: string;
|
|
619
|
+
ROW_DELETE: string;
|
|
620
|
+
};
|
|
621
|
+
WORKATO_SESSION: {
|
|
622
|
+
WHOAMI: string;
|
|
623
|
+
SESSION_CONTEXT: string;
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
/**
|
|
627
|
+
* Every tool schema: core first, then each module's.
|
|
628
|
+
*
|
|
629
|
+
* Top-level code here must stay side-effect free for the bundler: a bare
|
|
630
|
+
* spread or loop over the schemas keeps all of them in every bundle that
|
|
631
|
+
* imports anything from this package (the extension popup and service worker
|
|
632
|
+
* need names only). Hence the pure call and the lazy owner map.
|
|
633
|
+
*/
|
|
634
|
+
declare const TOOL_SCHEMAS: Tool[];
|
|
635
|
+
/** The installed module a tool belongs to, or undefined for a core (or unknown) tool. */
|
|
636
|
+
declare function moduleOfTool(name: string): ToolModule | undefined;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Output Sanitizer — redacts sensitive values and limits output size.
|
|
640
|
+
*
|
|
641
|
+
* Provides safe processing of JavaScript execution results:
|
|
642
|
+
* 1. Sensitive-field redaction (cookie/token/password, etc.)
|
|
643
|
+
* 2. Output length capping (default 50 KB)
|
|
644
|
+
* 3. Deep object serialization
|
|
645
|
+
*
|
|
646
|
+
* Shared because both sides redact: the extension for chrome_javascript, the
|
|
647
|
+
* bridge for browser function results it assembles from raw step values.
|
|
648
|
+
*/
|
|
649
|
+
declare const DEFAULT_MAX_OUTPUT_BYTES: number;
|
|
650
|
+
interface OutputSanitizerOptions {
|
|
651
|
+
maxBytes?: number;
|
|
652
|
+
maxDepth?: number;
|
|
653
|
+
maxArrayLength?: number;
|
|
654
|
+
maxObjectKeys?: number;
|
|
655
|
+
maxStringLength?: number;
|
|
656
|
+
}
|
|
657
|
+
interface SanitizedOutput {
|
|
658
|
+
text: string;
|
|
659
|
+
truncated: boolean;
|
|
660
|
+
redacted: boolean;
|
|
661
|
+
originalBytes: number;
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Redact sensitive fields and cap output length for an arbitrary value.
|
|
665
|
+
*/
|
|
666
|
+
declare function sanitizeAndLimitOutput(value: unknown, options?: OutputSanitizerOptions): SanitizedOutput;
|
|
667
|
+
/** Cap for an unredacted value bound for a file (chrome_javascript out_file). */
|
|
668
|
+
declare const RAW_MAX_OUTPUT_BYTES: number;
|
|
669
|
+
/**
|
|
670
|
+
* Format a value for a file the caller asked for, with no redaction: a string
|
|
671
|
+
* verbatim, anything else as indented JSON. Only the size is capped. Never use
|
|
672
|
+
* this for text that goes back to the model inline.
|
|
673
|
+
*/
|
|
674
|
+
declare function formatRawOutput(value: unknown, maxBytes?: number): SanitizedOutput;
|
|
675
|
+
/**
|
|
676
|
+
* Redact sensitive information from a string.
|
|
677
|
+
* Handles Bearer tokens, JWTs, Base64/Hex credentials, cookie strings, and query strings.
|
|
678
|
+
*/
|
|
679
|
+
declare function sanitizeText(text: string): {
|
|
680
|
+
text: string;
|
|
681
|
+
redacted: boolean;
|
|
682
|
+
};
|
|
683
|
+
/**
|
|
684
|
+
* Whether a key names a secret. Markers of five letters or more match
|
|
685
|
+
* anywhere in the key, so plurals and compounds stay covered (cookies,
|
|
686
|
+
* credentials, passwordhash, sessionkey). The short ones, sid and auth, match
|
|
687
|
+
* a word of the key instead.
|
|
688
|
+
*/
|
|
689
|
+
declare function isSensitiveKey(key: string): boolean;
|
|
690
|
+
|
|
691
|
+
export { CORE_TOOL_NAMES, CORE_TOOL_SCHEMAS, DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_SERVER_PORT, type ElementPickerRequest, type ElementPickerResult, type ElementPickerResultItem, HOST_NAME, MODULES, type ModuleStateEntry, type ModulesStatePayload, type NativeMessage, NativeMessageType, type OutputSanitizerOptions, type PickedElement, type PickedElementPoint, type PickedElementRect, RAW_MAX_OUTPUT_BYTES, type SanitizedOutput, TOOL_NAMES, TOOL_SCHEMAS, type ToolModule, WORKATO_INSTRUCTIONS, WORKATO_MODULE, WORKATO_MODULE_ID, WORKATO_MODULE_TITLE, WORKATO_TOOL_ALIASES, WORKATO_TOOL_NAMES, WORKATO_TOOL_SCHEMAS, aliasDescription, aliasOffMessage, formatRawOutput, isSensitiveKey, moduleOfTool, moduleOffMessage, sanitizeAndLimitOutput, sanitizeText };
|