@trusty-squire/mcp 1.1.28 → 1.1.29-rc.2
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/dist/api-client.d.ts +6 -0
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js.map +1 -1
- package/dist/bot/act/act.d.ts.map +1 -1
- package/dist/bot/act/act.js +15 -11
- package/dist/bot/act/act.js.map +1 -1
- package/dist/bot/browser.d.ts +0 -29
- package/dist/bot/browser.d.ts.map +1 -1
- package/dist/bot/browser.js +2 -747
- package/dist/bot/browser.js.map +1 -1
- package/dist/bot/capture/capture.d.ts +7 -15
- package/dist/bot/capture/capture.d.ts.map +1 -1
- package/dist/bot/capture/capture.js +71 -253
- package/dist/bot/capture/capture.js.map +1 -1
- package/dist/bot/card-release-approval.d.ts.map +1 -1
- package/dist/bot/card-release-approval.js +11 -2
- package/dist/bot/card-release-approval.js.map +1 -1
- package/dist/bot/credential-capture.d.ts +10 -0
- package/dist/bot/credential-capture.d.ts.map +1 -1
- package/dist/bot/credential-capture.js +5 -0
- package/dist/bot/credential-capture.js.map +1 -1
- package/dist/bot/credential-shape.d.ts +0 -5
- package/dist/bot/credential-shape.d.ts.map +1 -1
- package/dist/bot/credential-shape.js +8 -132
- package/dist/bot/credential-shape.js.map +1 -1
- package/dist/bot/drive-feedback.d.ts +2 -8
- package/dist/bot/drive-feedback.d.ts.map +1 -1
- package/dist/bot/drive-feedback.js +7 -49
- package/dist/bot/drive-feedback.js.map +1 -1
- package/dist/bot/jev-client.d.ts +3 -0
- package/dist/bot/jev-client.d.ts.map +1 -1
- package/dist/bot/jev-client.js +14 -5
- package/dist/bot/jev-client.js.map +1 -1
- package/dist/bot/operate-drive.d.ts +13 -63
- package/dist/bot/operate-drive.d.ts.map +1 -1
- package/dist/bot/operate-drive.js +136 -592
- package/dist/bot/operate-drive.js.map +1 -1
- package/dist/bot/page-driver.js +1 -1
- package/dist/bot/page-driver.js.map +1 -1
- package/dist/bot/provision-session.d.ts +3 -1
- package/dist/bot/provision-session.d.ts.map +1 -1
- package/dist/bot/provision-session.js +1 -1
- package/dist/bot/provision-session.js.map +1 -1
- package/dist/bot/session/lifecycle.d.ts.map +1 -1
- package/dist/bot/session/lifecycle.js +14 -13
- package/dist/bot/session/lifecycle.js.map +1 -1
- package/dist/bot/skill-hint.d.ts.map +1 -1
- package/dist/bot/skill-hint.js +4 -3
- package/dist/bot/skill-hint.js.map +1 -1
- package/dist/install/broker-service.d.ts.map +1 -1
- package/dist/install/broker-service.js +13 -15
- package/dist/install/broker-service.js.map +1 -1
- package/dist/install/cli.d.ts.map +1 -1
- package/dist/install/cli.js +43 -32
- package/dist/install/cli.js.map +1 -1
- package/dist/install/connect-report.d.ts +7 -7
- package/dist/install/connect-report.d.ts.map +1 -1
- package/dist/install/connect-report.js +31 -25
- package/dist/install/connect-report.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +42 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/fetch-credential.d.ts.map +1 -1
- package/dist/tools/fetch-credential.js +3 -1
- package/dist/tools/fetch-credential.js.map +1 -1
- package/dist/tools/provision-drive-schema.d.ts +0 -1
- package/dist/tools/provision-drive-schema.d.ts.map +1 -1
- package/dist/tools/provision-drive-schema.js +125 -238
- package/dist/tools/provision-drive-schema.js.map +1 -1
- package/dist/tools/provision-drive.d.ts +217 -73
- package/dist/tools/provision-drive.d.ts.map +1 -1
- package/dist/tools/provision-drive.js +133 -180
- package/dist/tools/provision-drive.js.map +1 -1
- package/dist/tools/store-credential.d.ts.map +1 -1
- package/dist/tools/store-credential.js +5 -1
- package/dist/tools/store-credential.js.map +1 -1
- package/dist/tools/use-credential.js +2 -2
- package/package.json +1 -1
- package/dist/bot/credential-text.d.ts +0 -4
- package/dist/bot/credential-text.d.ts.map +0 -1
- package/dist/bot/credential-text.js +0 -296
- package/dist/bot/credential-text.js.map +0 -1
- package/dist/bot/extraction.d.ts +0 -18
- package/dist/bot/extraction.d.ts.map +0 -1
- package/dist/bot/extraction.js +0 -54
- package/dist/bot/extraction.js.map +0 -1
|
@@ -17,8 +17,7 @@ const proxySchema = z
|
|
|
17
17
|
});
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
if (parsed.hostname.length === 0 ||
|
|
21
|
-
!["http:", "https:", "socks5:"].includes(parsed.protocol)) {
|
|
20
|
+
if (parsed.hostname.length === 0 || !["http:", "https:", "socks5:"].includes(parsed.protocol)) {
|
|
22
21
|
ctx.addIssue({
|
|
23
22
|
code: z.ZodIssueCode.custom,
|
|
24
23
|
message: "proxy must be a valid HTTP, HTTPS, or SOCKS5 URL",
|
|
@@ -63,32 +62,19 @@ const startSchema = z.object({
|
|
|
63
62
|
// account) set this so start fails closed to a connect hand-back if no live
|
|
64
63
|
// Google session exists — rather than driving into a mid-task login wall.
|
|
65
64
|
});
|
|
66
|
-
const DOM_OBSERVATION_CONTRACT = 'With `format:"full"`,
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
"Its `safe_table` is a paged control map: each row is `[ref,role,facts?]`; role is " +
|
|
80
|
-
"b=button, l=link, t=textbox, s=select, c=checkbox, r=radio, tb=tab, m=menuitem, or f=file; other roles are literal (e.g. slider or generic for a listener container). " +
|
|
81
|
-
"facts is a `|`-joined `@label` alias followed by present s=state (c=checked, u=unchecked, d=disabled, r=required), " +
|
|
82
|
-
"v=offscreen when outside the viewport, a=action, f=field, q=choice-position/total, and x=s same-origin or x=x cross-origin frame; absent x means main frame. " +
|
|
83
|
-
"nf=1 marks a listener container that carries a field name but is not itself fillable — its fillable field is emitted separately; fill that one. " +
|
|
84
|
-
"Query matches include m=n (exact name), m=r (exact role), m=t (local text), or m=c (explicit form/fieldset/dialog context), ranked in that order. " +
|
|
85
|
-
"semantic.blocked=true and semantic.blockers report what blocks the task independently of stage; stage=browse does not mean unblocked. " +
|
|
86
|
-
"Blocker kind is challenge (verification instructions), validation (a structurally identified field error), dialog (an open modal), or error_page (a CDN/gateway block wall named from the title/headings, so a blocked body is not read as a normal page). " +
|
|
87
|
-
"A dialog blocker also carries options — a bounded list of its rendered controls in DOM order, including the close path that keeps what was entered whenever the dialog renders one; when more controls exist than fit, that dismiss path and the controls that resolve the dialog are kept ahead of anchors, so query the control map for the rest. ref names the dialog's exit, matched on a control's whole label, or is absent with target=unavailable when the dialog renders none — act on an option rather than assuming one dismisses it. A bounded detail carries the dialog's own prose. " +
|
|
88
|
-
"Cursors page an immutable snapshot and require the same query and role; document changes invalidate them. A cursorless query captures fresh controls and semantics. " +
|
|
89
|
-
"Use overflow.next_cursor to page safe_table. A cursor from hint_overflow returns `hint` and pages with hint_overflow.next_cursor. ";
|
|
90
|
-
const ACTION_FORMAT_NOTE = "The action response is the compact `browser-use-control-query` control map by default: after a compact map on the same document, `delta:true` carries changed/new controls in `safe_table` and departed refs in `removed`, never the verbatim DOM. The acted control's own current row is always included, marked `w=acted`, so a write is confirmable from its own result. " +
|
|
91
|
-
'Pass `format:"full"` to receive the `browser-use-dom` tree instead. After inject_card releases a card, its PAN (complete ordinary spellings and prefixes of at least eight digits) and security code are replaced in every normal observation; all other emitted content stays verbatim. ';
|
|
65
|
+
const DOM_OBSERVATION_CONTRACT = 'With `format:"full"`, `browser-use-dom` returns a tab-indented `dom` tree with text and `[@e:...]` controls. ' +
|
|
66
|
+
"`|SHADOW(open)|` / `|SHADOW(closed)|` mark shadow hosts; `not-targetable=true` refs are display-only. " +
|
|
67
|
+
"`*` marks a new control; `more_above` / `more_below` signal offscreen content. " +
|
|
68
|
+
"On `delta:true`, a present `dom` replaces the prior tree; otherwise keep it and remove refs in `removed`. " +
|
|
69
|
+
"Without delta, reset the view. Refs stay usable on the same document; on stale_ref, observe again. ";
|
|
70
|
+
const CONTROL_QUERY_CONTRACT = 'The default `format:"compact"` response is `browser-use-control-query`: `safe_table` pages controls, including offscreen ones, as `[ref,role,facts?]`. ' +
|
|
71
|
+
"Arbitrary page text is absent from this control map; use full format when text matters. " +
|
|
72
|
+
"Roles b/l/t/s/c/r/tb/m/f mean button/link/textbox/select/checkbox/radio/tab/menuitem/file; other roles are literal. " +
|
|
73
|
+
"`facts` joins an `@label` alias with hints: s=c/u/d/r means checked/unchecked/disabled/required, v=offscreen, a=action, f=field, q=choice-position/total, and x=s/x for same/cross-origin frame (absent x means main frame). `nf=1` is a non-fillable listener; use its separately listed field. " +
|
|
74
|
+
"Query or role filters controls; `m=n/r/t/c` marks name/role/text/context matches. " +
|
|
75
|
+
"`semantic.blocked` and `semantic.blockers` report challenges, validation, dialogs, and error pages regardless of stage. Dialog options include actionable exits; an absent exit ref has target=unavailable. " +
|
|
76
|
+
"Use `overflow.next_cursor` to page with the same query and role; `hint_overflow.next_cursor` pages hints. Document changes invalidate cursors. ";
|
|
77
|
+
const ACTION_FORMAT_NOTE = 'Returns a compact control map; `delta:true` lists changed rows in `safe_table` and departed refs in `removed`. `w=acted` marks the acted row. Use `format:"full"` for the DOM tree. ';
|
|
92
78
|
const ACTION_FORMATS = ["compact", "full"];
|
|
93
79
|
const actionFormatSchema = z.enum(ACTION_FORMATS);
|
|
94
80
|
const actionFormatJson = { type: "string", enum: [...ACTION_FORMATS] };
|
|
@@ -155,6 +141,13 @@ const captureSchema = z
|
|
|
155
141
|
.optional(),
|
|
156
142
|
})
|
|
157
143
|
.strict();
|
|
144
|
+
const captureClickSchema = captureSchema.omit({ write_id: true });
|
|
145
|
+
const captureActionSchema = captureClickSchema.extend({
|
|
146
|
+
source: captureSourceSchema.refine((source) => !("clipboard" in source), "capture.source.clipboard is only valid on operate_click"),
|
|
147
|
+
});
|
|
148
|
+
const captureExtractSchema = captureSchema.extend({
|
|
149
|
+
source: captureActionSchema.shape.source,
|
|
150
|
+
});
|
|
158
151
|
const captureJson = {
|
|
159
152
|
type: "object",
|
|
160
153
|
additionalProperties: false,
|
|
@@ -181,8 +174,20 @@ const captureJson = {
|
|
|
181
174
|
required: ["selector"],
|
|
182
175
|
not: { anyOf: [{ required: ["role"] }, { required: ["name"] }] },
|
|
183
176
|
},
|
|
177
|
+
{
|
|
178
|
+
required: ["clipboard"],
|
|
179
|
+
not: {
|
|
180
|
+
anyOf: [
|
|
181
|
+
{ required: ["role"] },
|
|
182
|
+
{ required: ["name"] },
|
|
183
|
+
{ required: ["selector"] },
|
|
184
|
+
{ required: ["container"] },
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
184
188
|
],
|
|
185
189
|
properties: {
|
|
190
|
+
clipboard: { type: "boolean", const: true },
|
|
186
191
|
selector: { type: "string", minLength: 1, maxLength: 2000 },
|
|
187
192
|
role: { type: "string", enum: ["textbox", "code"] },
|
|
188
193
|
name: { type: "string", maxLength: 200 },
|
|
@@ -197,14 +202,33 @@ const captureJson = {
|
|
|
197
202
|
},
|
|
198
203
|
},
|
|
199
204
|
},
|
|
200
|
-
write_id: {
|
|
201
|
-
type: "string",
|
|
202
|
-
minLength: 1,
|
|
203
|
-
maxLength: 128,
|
|
204
|
-
pattern: "^[a-zA-Z0-9:_-]+$",
|
|
205
|
-
},
|
|
205
|
+
write_id: { type: "string", minLength: 1, maxLength: 128, pattern: "^[a-zA-Z0-9:_-]+$" },
|
|
206
206
|
},
|
|
207
207
|
};
|
|
208
|
+
const captureJsonFor = (toolName) => {
|
|
209
|
+
const { write_id: _writeId, ...actionProperties } = captureJson.properties;
|
|
210
|
+
if (toolName === "operate_click")
|
|
211
|
+
return { ...captureJson, properties: actionProperties };
|
|
212
|
+
const { clipboard: _clipboard, ...sourceProperties } = captureJson.properties.source.properties;
|
|
213
|
+
return {
|
|
214
|
+
...captureJson,
|
|
215
|
+
properties: {
|
|
216
|
+
...(toolName === "operate_extract" ? captureJson.properties : actionProperties),
|
|
217
|
+
source: {
|
|
218
|
+
...captureJson.properties.source,
|
|
219
|
+
oneOf: captureJson.properties.source.oneOf.slice(0, 2),
|
|
220
|
+
properties: sourceProperties,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
const CAPTURE_NOTE = " Optional capture:{store,source:{role,name?,container?}|{selector,container?}} stores one revealed value after the action and returns metadata, not the value; resolved_source names the element. " +
|
|
226
|
+
"Role and value-free CSS selector sources can cross open shadow roots; a unique secret-shaped textbox can match without an id. " +
|
|
227
|
+
"capture_unresolved returns candidate_count 0 and found roles/names; capture_ambiguous means several matches. " +
|
|
228
|
+
"An unresolved capture does not block unrelated actions. Never paste a secret into a page field to read it.";
|
|
229
|
+
const CLICK_CAPTURE_NOTE = " On operate_click, source:{clipboard:true} stores only a new clipboard value written by that click; " +
|
|
230
|
+
"an unchanged or empty clipboard stores nothing and reports capture_clipboard_unchanged or capture_clipboard_empty.";
|
|
231
|
+
const EXTRACT_CAPTURE_NOTE = " Only operate_extract accepts capture.write_id to retry storage after an unresolved capture.";
|
|
208
232
|
const storeJsonProps = {
|
|
209
233
|
service: { type: "string" },
|
|
210
234
|
label: { type: "string" },
|
|
@@ -217,12 +241,11 @@ const formSelectionsSchema = z
|
|
|
217
241
|
.record(z.string().min(1).max(200), z.string().min(1).max(4096))
|
|
218
242
|
.refine((value) => Object.keys(value).length > 0, "Provide at least one selection")
|
|
219
243
|
.refine((value) => Object.keys(value).length <= 12, "At most 12 selections per call")
|
|
220
|
-
.describe("Map each current
|
|
244
|
+
.describe("Map each current control ref or @label to its visible option text.");
|
|
221
245
|
const extractSchema = z.object({
|
|
222
|
-
capture:
|
|
246
|
+
capture: captureExtractSchema.optional(),
|
|
223
247
|
session_id: z.string().min(1),
|
|
224
248
|
into_slot: z.string().min(1).max(60).optional(),
|
|
225
|
-
secret_label: z.string().min(1).max(60).optional(),
|
|
226
249
|
store: storeShape.optional(),
|
|
227
250
|
});
|
|
228
251
|
const finishDataSchema = z.record(z.union([z.string().max(4000), z.number(), z.boolean()]));
|
|
@@ -264,9 +287,6 @@ const sealVaultCredentialBaseSchema = z.object({
|
|
|
264
287
|
.describe(vaultCredentialFieldsDescription),
|
|
265
288
|
slot_prefix: z.string().min(1).max(60).default("vault"),
|
|
266
289
|
});
|
|
267
|
-
const sealVaultCredentialSchema = sealVaultCredentialBaseSchema.refine((b) => b.reference !== undefined || b.service !== undefined, {
|
|
268
|
-
message: "one of reference or service is required",
|
|
269
|
-
});
|
|
270
290
|
const loginPrepareSignupSchema = prepareLoginSchema.extend({
|
|
271
291
|
action: z.literal("prepare_signup"),
|
|
272
292
|
});
|
|
@@ -307,7 +327,7 @@ const clickSchema = z
|
|
|
307
327
|
...sessionShape,
|
|
308
328
|
ref: refSchema.optional(),
|
|
309
329
|
screenshot: screenshotPointSchema.optional(),
|
|
310
|
-
capture:
|
|
330
|
+
capture: captureClickSchema.optional(),
|
|
311
331
|
format: actionFormatSchema.optional(),
|
|
312
332
|
})
|
|
313
333
|
.refine((args) => (args.ref !== undefined) !== (args.screenshot !== undefined), {
|
|
@@ -320,7 +340,7 @@ const typeSchema = z
|
|
|
320
340
|
text: z.string().max(4096).optional(),
|
|
321
341
|
slot: z.string().min(1).max(60).optional(),
|
|
322
342
|
submit: z.boolean().optional(),
|
|
323
|
-
capture:
|
|
343
|
+
capture: captureActionSchema.optional(),
|
|
324
344
|
format: actionFormatSchema.optional(),
|
|
325
345
|
})
|
|
326
346
|
.refine((args) => (args.text !== undefined) !== (args.slot !== undefined), {
|
|
@@ -332,7 +352,7 @@ const selectSchema = z
|
|
|
332
352
|
ref: refSchema.optional(),
|
|
333
353
|
values: z.array(z.string().min(1).max(4096)).length(1).optional(),
|
|
334
354
|
selections: formSelectionsSchema.optional(),
|
|
335
|
-
capture:
|
|
355
|
+
capture: captureActionSchema.optional(),
|
|
336
356
|
country: z.string().min(1).max(60).optional(),
|
|
337
357
|
format: actionFormatSchema.optional(),
|
|
338
358
|
})
|
|
@@ -340,8 +360,7 @@ const selectSchema = z
|
|
|
340
360
|
const modes = Number(args.ref !== undefined || args.values !== undefined) +
|
|
341
361
|
Number(args.selections !== undefined) +
|
|
342
362
|
Number(args.country !== undefined);
|
|
343
|
-
if (modes !== 1 ||
|
|
344
|
-
(args.ref !== undefined) !== (args.values !== undefined)) {
|
|
363
|
+
if (modes !== 1 || (args.ref !== undefined) !== (args.values !== undefined)) {
|
|
345
364
|
ctx.addIssue({
|
|
346
365
|
code: z.ZodIssueCode.custom,
|
|
347
366
|
message: "Provide ref + values, selections, or country",
|
|
@@ -351,7 +370,7 @@ const selectSchema = z
|
|
|
351
370
|
const pressSchema = z.object({
|
|
352
371
|
...sessionShape,
|
|
353
372
|
key: z.string().min(1).max(40),
|
|
354
|
-
capture:
|
|
373
|
+
capture: captureActionSchema.optional(),
|
|
355
374
|
format: actionFormatSchema.optional(),
|
|
356
375
|
});
|
|
357
376
|
const scrollSchema = z.object({
|
|
@@ -381,13 +400,8 @@ const publicFinishSchema = z
|
|
|
381
400
|
})
|
|
382
401
|
.superRefine((args, ctx) => {
|
|
383
402
|
if (args.outcome === "credentials" && args.store === undefined)
|
|
384
|
-
ctx.addIssue({
|
|
385
|
-
|
|
386
|
-
message: "credentials outcome requires store",
|
|
387
|
-
});
|
|
388
|
-
if (args.outcome === "result" &&
|
|
389
|
-
args.summary === undefined &&
|
|
390
|
-
args.data === undefined)
|
|
403
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "credentials outcome requires store" });
|
|
404
|
+
if (args.outcome === "result" && args.summary === undefined && args.data === undefined)
|
|
391
405
|
ctx.addIssue({
|
|
392
406
|
code: z.ZodIssueCode.custom,
|
|
393
407
|
message: "result outcome requires summary or data",
|
|
@@ -420,12 +434,9 @@ export const provisionStartTool = {
|
|
|
420
434
|
CONTROL_QUERY_CONTRACT +
|
|
421
435
|
'Use `format:"full"` only when the page DOM and text are needed. A released card\'s PAN (complete ordinary spellings and prefixes of at least eight digits) and security code are masked; all other emitted content stays verbatim. ' +
|
|
422
436
|
DOM_OBSERVATION_CONTRACT +
|
|
423
|
-
"
|
|
424
|
-
"
|
|
425
|
-
"
|
|
426
|
-
"answer and/or added facts if it hands back. The primitives " +
|
|
427
|
-
"(operate_click, operate_type, operate_select, operate_navigate, operate_scroll, operate_login) " +
|
|
428
|
-
"remain for a single step the drive handed back or a task that is not a goal. " +
|
|
437
|
+
"Use operate_start when you want to inspect the first page before choosing steps. For a known multi-step goal, call operate_drive with url, goal, and facts directly. " +
|
|
438
|
+
"operate_click, operate_type, operate_select, operate_navigate, operate_scroll, and operate_login " +
|
|
439
|
+
"complete individual steps. Resume a drive handoff on the same session with answer or added facts. " +
|
|
429
440
|
"inject_card releases a saved card into pan/cvv refs and exposes masked {{pan}}/{{cvv}} per-digit tokens for operate_type placement. " +
|
|
430
441
|
"Call operate_extract when you reach the credentials. Always operate_finish when done. The " +
|
|
431
442
|
"browser has unrestricted egress.",
|
|
@@ -478,19 +489,13 @@ export const provisionObserveTool = {
|
|
|
478
489
|
};
|
|
479
490
|
export const provisionScreenshotTool = {
|
|
480
491
|
name: "operate_screenshot",
|
|
481
|
-
description: "
|
|
482
|
-
"
|
|
483
|
-
"
|
|
484
|
-
"
|
|
485
|
-
"
|
|
486
|
-
"
|
|
487
|
-
"
|
|
488
|
-
"3-D Secure ACS frame, a captcha) can be captured on its own even when it won't show clearly inside " +
|
|
489
|
-
"a full-page shot. Use this when the DOM tree from an explicitly " +
|
|
490
|
-
"selected full observation isn't enough to tell what state " +
|
|
491
|
-
"a stuck page is actually in — a challenge that never advances, an unexpected layout, a captcha you " +
|
|
492
|
-
"need to SEE. Read-only: never navigates, clicks, types, submits, or steals focus; it only reads " +
|
|
493
|
-
"pixels. After inject_card releases a card, pixels containing that card's PAN (complete ordinary spellings or prefixes of at least eight digits) or security code in injected controls and identified ordinary displayed copies are covered in the returned image; surrounding borders, labels, and errors remain visible. An active mask is never bypassed: if the mask cannot scan or composite the capture, the screenshot call fails rather than returning the unmasked image. When click_binding is present, its screenshot_id and original image width/height authorize one operate_click screenshot point for 60 seconds. Navigation, viewport/scroll or frame geometry changes invalidate it. An absent binding means this image is read-only; capture again for a coordinate click.",
|
|
492
|
+
description: "Capture rendered pixels from the viewport (or full_page:true) or one frame via frame_index or frame_url_contains. " +
|
|
493
|
+
"A screenshot costs more context than operate_observe; use it when visual state or a coordinate click matters, " +
|
|
494
|
+
"including a captcha or 3-D Secure ACS frame. During bank approval, short, non-blocking screenshots or observations " +
|
|
495
|
+
"can watch for a change. This read does not interact with the page. Released PAN and security code in injected " +
|
|
496
|
+
"controls and identified displayed copies are covered; if masking fails, capture fails. " +
|
|
497
|
+
"A click_binding authorizes one dispatched operate_click point in original image pixels for 60 seconds; " +
|
|
498
|
+
"navigation, scroll, viewport, or frame changes invalidate it. Without a binding, capture again before a coordinate click.",
|
|
494
499
|
inputSchema: screenshotSchema,
|
|
495
500
|
jsonInputSchema: {
|
|
496
501
|
type: "object",
|
|
@@ -542,18 +547,14 @@ export const provisionNetworkTool = {
|
|
|
542
547
|
};
|
|
543
548
|
export const provisionExtractTool = {
|
|
544
549
|
name: "operate_extract",
|
|
545
|
-
description: "
|
|
546
|
-
"
|
|
547
|
-
"
|
|
548
|
-
"
|
|
549
|
-
"
|
|
550
|
-
"observed hosts as allowed_hosts seed; when
|
|
551
|
-
"credential values and returns only vault
|
|
552
|
-
"
|
|
553
|
-
"With `into_slot`, a value that still looks masked is ranked behind a fully " +
|
|
554
|
-
"revealed sibling but never refused; pass " +
|
|
555
|
-
'`secret_label` (e.g. "client secret") to pick the right one when the page ' +
|
|
556
|
-
"shows several credentials.",
|
|
550
|
+
description: "Store a key by its source, never by its shape. Without capture, clicks the Copy " +
|
|
551
|
+
"button in an open key dialog and returns what it writes to the clipboard as " +
|
|
552
|
+
"{credentials: {api_key}}; page text is never scanned. When no Copy click yields a " +
|
|
553
|
+
"value, nothing is stored and `error` says to read the page with operate_observe " +
|
|
554
|
+
"and point capture at the key. Pass `store` to immediately save the value into the " +
|
|
555
|
+
"Trusty Squire vault with the session's observed hosts as allowed_hosts seed; when " +
|
|
556
|
+
"`store` is used, the response omits credential values and returns only vault " +
|
|
557
|
+
"metadata. With `into_slot`, the copied value goes into a session slot instead.",
|
|
557
558
|
inputSchema: extractSchema,
|
|
558
559
|
jsonInputSchema: {
|
|
559
560
|
type: "object",
|
|
@@ -561,7 +562,6 @@ export const provisionExtractTool = {
|
|
|
561
562
|
properties: {
|
|
562
563
|
session_id: { type: "string" },
|
|
563
564
|
into_slot: { type: "string" },
|
|
564
|
-
secret_label: { type: "string" },
|
|
565
565
|
store: {
|
|
566
566
|
type: "object",
|
|
567
567
|
required: ["service"],
|
|
@@ -580,29 +580,6 @@ export const provisionExtractTool = {
|
|
|
580
580
|
return await (await import("./provision-drive.js")).provisionExtractTool.handler(args, api, context);
|
|
581
581
|
},
|
|
582
582
|
};
|
|
583
|
-
export const operateFillCredentialTool = {
|
|
584
|
-
name: "operate_fill_credential",
|
|
585
|
-
description: "For a sign-in page, retrieve a username/password credential only if the " +
|
|
586
|
-
"current browser host is allowed for login, then seal requested fields into " +
|
|
587
|
-
"session slots. Raw values are never returned; use operate_type with slot " +
|
|
588
|
-
"with the returned slot names to fill the page.",
|
|
589
|
-
inputSchema: sealVaultCredentialSchema,
|
|
590
|
-
jsonInputSchema: {
|
|
591
|
-
type: "object",
|
|
592
|
-
required: ["session_id"],
|
|
593
|
-
anyOf: [{ required: ["reference"] }, { required: ["service"] }],
|
|
594
|
-
properties: {
|
|
595
|
-
session_id: { type: "string" },
|
|
596
|
-
reference: { type: "string" },
|
|
597
|
-
service: { type: "string" },
|
|
598
|
-
fields: vaultCredentialFieldsJson,
|
|
599
|
-
slot_prefix: { type: "string" },
|
|
600
|
-
},
|
|
601
|
-
},
|
|
602
|
-
async handler(args, api, context) {
|
|
603
|
-
return await (await import("./provision-drive.js")).operateFillCredentialTool.handler(args, api, context);
|
|
604
|
-
},
|
|
605
|
-
};
|
|
606
583
|
export const operateLoginTool = {
|
|
607
584
|
name: "operate_login",
|
|
608
585
|
description: "Log in with provider + ref using the atomic OAuth flow; awaiting-human state is returned in this call. After a dispatched timeout or error, completion may be unknown: retain session_id and call operate_observe before another action; do not repeat OAuth blindly. " +
|
|
@@ -667,7 +644,7 @@ export const operateLoginTool = {
|
|
|
667
644
|
};
|
|
668
645
|
export const operateNavigateTool = {
|
|
669
646
|
name: "operate_navigate",
|
|
670
|
-
description: "Navigate to a URL without session host restrictions.
|
|
647
|
+
description: "Navigate the session to a URL without session host restrictions.",
|
|
671
648
|
inputSchema: navigateSchema,
|
|
672
649
|
jsonInputSchema: {
|
|
673
650
|
type: "object",
|
|
@@ -713,7 +690,7 @@ export const operateClickTool = {
|
|
|
713
690
|
export const operateTypeTool = {
|
|
714
691
|
name: "operate_type",
|
|
715
692
|
description: ACTION_FORMAT_NOTE +
|
|
716
|
-
"Fill a control with text, or a session slot returned by operate_login
|
|
693
|
+
"Fill a control with text, or a session slot returned by operate_login or operate_extract. Provide exactly one of text or slot. submit presses Enter after a successful fill.",
|
|
717
694
|
inputSchema: typeSchema,
|
|
718
695
|
jsonInputSchema: {
|
|
719
696
|
type: "object",
|
|
@@ -746,40 +723,25 @@ export const operateSelectTool = {
|
|
|
746
723
|
oneOf: [
|
|
747
724
|
{
|
|
748
725
|
required: ["ref", "values"],
|
|
749
|
-
not: {
|
|
750
|
-
anyOf: [{ required: ["selections"] }, { required: ["country"] }],
|
|
751
|
-
},
|
|
726
|
+
not: { anyOf: [{ required: ["selections"] }, { required: ["country"] }] },
|
|
752
727
|
},
|
|
753
728
|
{
|
|
754
729
|
required: ["selections"],
|
|
755
730
|
not: {
|
|
756
|
-
anyOf: [
|
|
757
|
-
{ required: ["ref"] },
|
|
758
|
-
{ required: ["values"] },
|
|
759
|
-
{ required: ["country"] },
|
|
760
|
-
],
|
|
731
|
+
anyOf: [{ required: ["ref"] }, { required: ["values"] }, { required: ["country"] }],
|
|
761
732
|
},
|
|
762
733
|
},
|
|
763
734
|
{
|
|
764
735
|
required: ["country"],
|
|
765
736
|
not: {
|
|
766
|
-
anyOf: [
|
|
767
|
-
{ required: ["ref"] },
|
|
768
|
-
{ required: ["values"] },
|
|
769
|
-
{ required: ["selections"] },
|
|
770
|
-
],
|
|
737
|
+
anyOf: [{ required: ["ref"] }, { required: ["values"] }, { required: ["selections"] }],
|
|
771
738
|
},
|
|
772
739
|
},
|
|
773
740
|
],
|
|
774
741
|
properties: {
|
|
775
742
|
...sessionJson,
|
|
776
743
|
...refJson,
|
|
777
|
-
values: {
|
|
778
|
-
type: "array",
|
|
779
|
-
items: { type: "string" },
|
|
780
|
-
minItems: 1,
|
|
781
|
-
maxItems: 1,
|
|
782
|
-
},
|
|
744
|
+
values: { type: "array", items: { type: "string" }, minItems: 1, maxItems: 1 },
|
|
783
745
|
selections: { type: "object", additionalProperties: { type: "string" } },
|
|
784
746
|
country: { type: "string" },
|
|
785
747
|
format: actionFormatJson,
|
|
@@ -817,11 +779,7 @@ export const operateScrollTool = {
|
|
|
817
779
|
required: ["session_id"],
|
|
818
780
|
properties: {
|
|
819
781
|
...sessionJson,
|
|
820
|
-
direction: {
|
|
821
|
-
type: "string",
|
|
822
|
-
enum: ["down", "up", "bottom", "top"],
|
|
823
|
-
default: "down",
|
|
824
|
-
},
|
|
782
|
+
direction: { type: "string", enum: ["down", "up", "bottom", "top"], default: "down" },
|
|
825
783
|
format: actionFormatJson,
|
|
826
784
|
},
|
|
827
785
|
},
|
|
@@ -839,12 +797,7 @@ export const operateWaitTool = {
|
|
|
839
797
|
required: ["session_id"],
|
|
840
798
|
properties: {
|
|
841
799
|
...sessionJson,
|
|
842
|
-
milliseconds: {
|
|
843
|
-
type: "integer",
|
|
844
|
-
minimum: 0,
|
|
845
|
-
maximum: 30_000,
|
|
846
|
-
default: 1_000,
|
|
847
|
-
},
|
|
800
|
+
milliseconds: { type: "integer", minimum: 0, maximum: 30_000, default: 1_000 },
|
|
848
801
|
format: actionFormatJson,
|
|
849
802
|
},
|
|
850
803
|
},
|
|
@@ -854,32 +807,12 @@ export const operateWaitTool = {
|
|
|
854
807
|
};
|
|
855
808
|
export const operateReadInboxTool = {
|
|
856
809
|
name: "operate_read_inbox",
|
|
857
|
-
description: "Read
|
|
858
|
-
"
|
|
859
|
-
"
|
|
860
|
-
"
|
|
861
|
-
"a code
|
|
862
|
-
"
|
|
863
|
-
"(drive fact `email`, or `recipient`) and the service host from the session " +
|
|
864
|
-
"start URL. A verification mail that matches neither is not a candidate — " +
|
|
865
|
-
"returning another service's newest mail is worse than returning nothing. " +
|
|
866
|
-
"An IP or localhost start URL is the exception: no From address can ever " +
|
|
867
|
-
"contain it, so host scoping there would drop every mail and protect " +
|
|
868
|
-
"nothing — such a read is NOT host-scoped and the newest mail after the " +
|
|
869
|
-
"session start wins, so cross-check `source_from` before using the code. " +
|
|
870
|
-
"`sender` and `recipient` override those defaults when the caller has a " +
|
|
871
|
-
"narrower hint. The newest matching mail is the one read, cross-checked " +
|
|
872
|
-
"across the search listing AND the real-time All Mail listing (Gmail's " +
|
|
873
|
-
"search index can lag fresh mail by minutes — found:false means the mail is " +
|
|
874
|
-
"not in the mailbox, not that the search was stale). A miss reports the " +
|
|
875
|
-
"query it searched. `into_slot` " +
|
|
876
|
-
"seals a found OTP into a session slot so it is typed with operate_type slot and " +
|
|
877
|
-
"never crosses the MCP boundary; `grant_inbox_consent` overrides the session's " +
|
|
878
|
-
"inbox-read consent for this call. Returns needs_user when nothing is found yet " +
|
|
879
|
-
"— retry after a few seconds or ask the user (the session stays live). A " +
|
|
880
|
-
"needs_user carrying wall:google_session is the opposite case: the operator " +
|
|
881
|
-
"cannot read the inbox until the user runs `connect`, so retrying cannot clear " +
|
|
882
|
-
"it — don't poll and don't ask the user for a code.",
|
|
810
|
+
description: "Read verification mail in a separate tab without changing the live form. Returns {code, link, source_from} or needs_user. " +
|
|
811
|
+
"The default search uses the session recipient and service host; sender and recipient narrow it. " +
|
|
812
|
+
"For an IP or localhost start URL, host scoping is unavailable: check source_from before using the result. " +
|
|
813
|
+
"It checks search and All Mail because Gmail search can lag. A miss reports the query; retry after a few seconds. " +
|
|
814
|
+
"into_slot keeps a found code in a session slot for operate_type; grant_inbox_consent overrides consent for this call. " +
|
|
815
|
+
"If needs_user reports wall:google_session, ask the user to run connect; polling will not clear it.",
|
|
883
816
|
inputSchema: readInboxSchema,
|
|
884
817
|
jsonInputSchema: {
|
|
885
818
|
type: "object",
|
|
@@ -901,34 +834,15 @@ export const operateFinishTool = {
|
|
|
901
834
|
name: "operate_finish",
|
|
902
835
|
jsonOutputSchema: {
|
|
903
836
|
type: "object",
|
|
904
|
-
required: [
|
|
905
|
-
"session_id",
|
|
906
|
-
"operation_id",
|
|
907
|
-
"execution",
|
|
908
|
-
"mutation",
|
|
909
|
-
"cleanup",
|
|
910
|
-
"closed",
|
|
911
|
-
],
|
|
837
|
+
required: ["session_id", "operation_id", "execution", "mutation", "cleanup", "closed"],
|
|
912
838
|
properties: {
|
|
913
839
|
session_id: { type: "string" },
|
|
914
840
|
operation_id: { type: "string" },
|
|
915
|
-
execution: {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
},
|
|
919
|
-
mutation: {
|
|
920
|
-
type: "string",
|
|
921
|
-
enum: ["not_dispatched", "dispatched", "unknown"],
|
|
922
|
-
},
|
|
923
|
-
cleanup: {
|
|
924
|
-
type: "string",
|
|
925
|
-
enum: ["open", "closing", "closed", "already_closed", "unknown"],
|
|
926
|
-
},
|
|
841
|
+
execution: { type: "string", enum: ["completed", "cancelled", "pending", "unknown"] },
|
|
842
|
+
mutation: { type: "string", enum: ["not_dispatched", "dispatched", "unknown"] },
|
|
843
|
+
cleanup: { type: "string", enum: ["open", "closing", "closed", "already_closed", "unknown"] },
|
|
927
844
|
closed: { type: "boolean" },
|
|
928
|
-
data: {
|
|
929
|
-
type: "object",
|
|
930
|
-
additionalProperties: { type: ["string", "number", "boolean"] },
|
|
931
|
-
},
|
|
845
|
+
data: { type: "object", additionalProperties: { type: ["string", "number", "boolean"] } },
|
|
932
846
|
},
|
|
933
847
|
additionalProperties: true,
|
|
934
848
|
},
|
|
@@ -939,32 +853,18 @@ export const operateFinishTool = {
|
|
|
939
853
|
required: ["session_id"],
|
|
940
854
|
properties: {
|
|
941
855
|
...sessionJson,
|
|
942
|
-
outcome: {
|
|
943
|
-
|
|
944
|
-
enum: ["none", "credentials", "result"],
|
|
945
|
-
default: "none",
|
|
946
|
-
},
|
|
947
|
-
store: {
|
|
948
|
-
type: "object",
|
|
949
|
-
required: ["service"],
|
|
950
|
-
properties: storeJsonProps,
|
|
951
|
-
},
|
|
856
|
+
outcome: { type: "string", enum: ["none", "credentials", "result"], default: "none" },
|
|
857
|
+
store: { type: "object", required: ["service"], properties: storeJsonProps },
|
|
952
858
|
summary: { type: "string" },
|
|
953
859
|
data: { type: "object" },
|
|
954
860
|
},
|
|
955
861
|
allOf: [
|
|
956
862
|
{
|
|
957
|
-
if: {
|
|
958
|
-
required: ["outcome"],
|
|
959
|
-
properties: { outcome: { const: "credentials" } },
|
|
960
|
-
},
|
|
863
|
+
if: { required: ["outcome"], properties: { outcome: { const: "credentials" } } },
|
|
961
864
|
then: { required: ["store"] },
|
|
962
865
|
},
|
|
963
866
|
{
|
|
964
|
-
if: {
|
|
965
|
-
required: ["outcome"],
|
|
966
|
-
properties: { outcome: { const: "result" } },
|
|
967
|
-
},
|
|
867
|
+
if: { required: ["outcome"], properties: { outcome: { const: "result" } } },
|
|
968
868
|
then: { anyOf: [{ required: ["summary"] }, { required: ["data"] }] },
|
|
969
869
|
},
|
|
970
870
|
],
|
|
@@ -975,27 +875,17 @@ export const operateFinishTool = {
|
|
|
975
875
|
};
|
|
976
876
|
export const operateDriveTool = {
|
|
977
877
|
name: "operate_drive",
|
|
978
|
-
description: "Drive a signup, checkout, or other website goal
|
|
979
|
-
"
|
|
980
|
-
"
|
|
981
|
-
"
|
|
982
|
-
"
|
|
983
|
-
"
|
|
984
|
-
"
|
|
985
|
-
"
|
|
986
|
-
"
|
|
987
|
-
"
|
|
988
|
-
"
|
|
989
|
-
"a budget handoff is partial progress — call again on the same session to continue. " +
|
|
990
|
-
"Resume with answer (one option key from a previous handoff: a readable action slug, done, or stuck) and/or added " +
|
|
991
|
-
"facts; the loop continues from the current page. Returns a handoff, never a bare page: status, " +
|
|
992
|
-
"the current compact observation with the same stable refs, trajectory, done/remaining, and " +
|
|
993
|
-
"step/time counters. Status complete means the goal is done; needs_value names the missing field's label; " +
|
|
994
|
-
"stuck means no listed element advances the goal; " +
|
|
995
|
-
"low_confidence includes the question, options, probabilities, and confidence; " +
|
|
996
|
-
"invalid_answer is a malformed Jev choice (reason + confidence) after one same-observation retry; no_progress, budget, " +
|
|
997
|
-
"jev_unavailable, evaluate_timeout (an in-page evaluate was aborted so the broker stays serving), pending_approval (card approval URL), and card_incomplete (the card released but not every requested field landed; resume to retry the fill against the same approval_id) are resumable. Google sign-in, " +
|
|
998
|
-
"verification-email read, captcha, and card release run inside the loop. Always operate_finish when done.",
|
|
878
|
+
description: "Drive a multi-step signup, checkout, or other website goal and hand back when complete, blocked, or out of budget. " +
|
|
879
|
+
"For a known multi-step goal, pass url, goal, and all known facts directly; this skips the initial general observation. Use session_id to resume the same session. " +
|
|
880
|
+
"Identity and payment values must come from facts; a search phrase may come from the goal. " +
|
|
881
|
+
"Amount_cents is in the currency's smallest unit: USD $12.34 -> 1234; JPY ¥65,800 -> 65800 (do not multiply by 100); KRW works like JPY. " +
|
|
882
|
+
"The loop can handle Google sign-in, verification mail, captcha, and card release. " +
|
|
883
|
+
"max_steps (default 60) and max_seconds (default 45) bound a call. Resume a budget or other partial handoff on the " +
|
|
884
|
+
"same session with added facts and/or answer from its options. The handoff includes status, current compact observation, " +
|
|
885
|
+
"trajectory, done/remaining, and counters. complete means done; needs_value names a missing field; stuck and low_confidence " +
|
|
886
|
+
"need a decision. invalid_answer, no_progress, budget, evaluate_timeout, pending_approval, and " +
|
|
887
|
+
"card_incomplete are resumable. After a card_incomplete handoff, retry against the same approval_id. " +
|
|
888
|
+
"Always operate_finish when done.",
|
|
999
889
|
inputSchema: driveSchema,
|
|
1000
890
|
jsonInputSchema: {
|
|
1001
891
|
type: "object",
|
|
@@ -1031,7 +921,6 @@ export const OPERATE_TOOLS = [
|
|
|
1031
921
|
operateWaitTool,
|
|
1032
922
|
operateReadInboxTool,
|
|
1033
923
|
operateLoginTool,
|
|
1034
|
-
operateFillCredentialTool,
|
|
1035
924
|
provisionExtractTool,
|
|
1036
925
|
];
|
|
1037
926
|
const captureOutputSchema = {
|
|
@@ -1042,9 +931,7 @@ const captureOutputSchema = {
|
|
|
1042
931
|
write_id: { type: "string" },
|
|
1043
932
|
execution: { enum: ["completed", "cancelled", "pending", "unknown"] },
|
|
1044
933
|
mutation: { enum: ["not_dispatched", "dispatched", "unknown"] },
|
|
1045
|
-
cleanup: {
|
|
1046
|
-
enum: ["open", "closing", "closed", "already_closed", "unknown"],
|
|
1047
|
-
},
|
|
934
|
+
cleanup: { enum: ["open", "closing", "closed", "already_closed", "unknown"] },
|
|
1048
935
|
closed: { type: "boolean" },
|
|
1049
936
|
stored: { type: "boolean" },
|
|
1050
937
|
storage: { enum: ["stored", "unknown", "not_attempted"] },
|
|
@@ -1088,9 +975,11 @@ for (const tool of OPERATE_TOOLS) {
|
|
|
1088
975
|
continue;
|
|
1089
976
|
const properties = tool.jsonInputSchema.properties;
|
|
1090
977
|
if (properties !== null && typeof properties === "object")
|
|
1091
|
-
Object.assign(properties, { capture:
|
|
978
|
+
Object.assign(properties, { capture: captureJsonFor(tool.name) });
|
|
1092
979
|
tool.description +=
|
|
1093
|
-
|
|
980
|
+
CAPTURE_NOTE +
|
|
981
|
+
(tool.name === "operate_click" ? CLICK_CAPTURE_NOTE : "") +
|
|
982
|
+
(tool.name === "operate_extract" ? EXTRACT_CAPTURE_NOTE : "");
|
|
1094
983
|
tool.jsonOutputSchema = captureOutputSchema;
|
|
1095
984
|
}
|
|
1096
985
|
// Keep the additive click receipt discoverable alongside the shared capture result.
|
|
@@ -1104,9 +993,7 @@ operateClickTool.jsonOutputSchema = {
|
|
|
1104
993
|
properties: {
|
|
1105
994
|
dispatch: { enum: ["dispatched", "not_dispatched", "unknown"] },
|
|
1106
995
|
outcome: { const: "unknown" },
|
|
1107
|
-
retry_policy: {
|
|
1108
|
-
enum: ["observe_before_new_action", "capture_new_screenshot"],
|
|
1109
|
-
},
|
|
996
|
+
retry_policy: { enum: ["observe_before_new_action", "capture_new_screenshot"] },
|
|
1110
997
|
},
|
|
1111
998
|
},
|
|
1112
999
|
},
|