@reclaimprotocol/agent 0.1.23 → 0.1.25
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/README.md +56 -20
- package/lib/authoring/backend.d.ts +5 -4
- package/lib/authoring/tools.js +30 -30
- package/lib/cdp/capture-engine.js +8 -7
- package/lib/cdp/claims.d.ts +21 -0
- package/lib/cdp/claims.js +129 -0
- package/lib/cdp/container.d.ts +85 -0
- package/lib/cdp/container.js +481 -0
- package/lib/cdp/geo.d.ts +10 -0
- package/lib/cdp/geo.js +36 -0
- package/lib/cdp/index.d.ts +1 -0
- package/lib/cdp/index.js +1 -0
- package/lib/live/cloudflared.d.ts +15 -0
- package/lib/live/cloudflared.js +268 -0
- package/lib/live/tunnel.d.ts +26 -0
- package/lib/live/tunnel.js +160 -0
- package/lib/mcp/api/operations.gen.js +34 -26
- package/lib/mcp/api/to-zod.d.ts +1 -1
- package/lib/mcp/api/to-zod.js +1 -1
- package/lib/mcp/api/tools.js +1 -1
- package/lib/mcp/instructions.d.ts +15 -2
- package/lib/mcp/instructions.js +102 -38
- package/lib/mcp/start.js +62 -6
- package/lib/mcp/tools/agent/analyze.js +5 -1
- package/lib/mcp/tools/agent/attach.d.ts +29 -2
- package/lib/mcp/tools/agent/attach.js +310 -24
- package/lib/mcp/tools/agent/build.d.ts +18 -8
- package/lib/mcp/tools/agent/build.js +30 -12
- package/lib/mcp/tools/agent/capture.js +5 -1
- package/lib/mcp/tools/agent/eval.js +3 -1
- package/lib/mcp/tools/agent/find.js +6 -5
- package/lib/mcp/tools/agent/how-it-works.d.ts +15 -7
- package/lib/mcp/tools/agent/how-it-works.js +57 -17
- package/lib/mcp/tools/agent/index.d.ts +1 -2
- package/lib/mcp/tools/agent/index.js +1 -1
- package/lib/mcp/tools/agent/live-view.d.ts +17 -0
- package/lib/mcp/tools/agent/live-view.js +146 -0
- package/lib/mcp/tools/agent/pod-proof.d.ts +8 -0
- package/lib/mcp/tools/agent/pod-proof.js +64 -0
- package/lib/mcp/tools/agent/propose.js +4 -2
- package/lib/mcp/tools/agent/publish.js +47 -77
- package/lib/mcp/tools/agent/session.d.ts +16 -1
- package/lib/mcp/tools/agent/session.js +32 -7
- package/lib/mcp/tools/authenticate/authenticate.js +26 -13
- package/lib/mcp/tools/mode/mode.d.ts +1 -1
- package/lib/mcp/tools/mode/mode.js +10 -22
- package/lib/old/client.d.ts +1 -1
- package/lib/old/client.js +1 -1
- package/lib/old/instructions.d.ts +9 -1
- package/lib/old/instructions.js +4 -6
- package/lib/old/login-cdp.d.ts +2 -2
- package/lib/old/login-cdp.js +46 -6
- package/lib/old/to-register.d.ts +3 -2
- package/lib/old/to-register.js +1 -1
- package/lib/old/tools/authenticate.js +9 -1
- package/lib/old/tools/get-provider-info.js +6 -5
- package/lib/old/tools/issue-app-credentials.js +3 -2
- package/lib/old/tools/publish.d.ts +1 -1
- package/lib/old/tools/publish.js +90 -131
- package/lib/old/tools/update-provider-metadata.d.ts +1 -1
- package/lib/old/tools/update-provider-metadata.js +1 -1
- package/lib/old/tools/verify-sdk-setup.js +1 -1
- package/lib/proof/attestor.d.ts +3 -3
- package/lib/proof/debug-response-dump.js +4 -4
- package/lib/proof/index.d.ts +1 -0
- package/lib/proof/index.js +1 -0
- package/lib/proof/page-replay.d.ts +1 -1
- package/lib/proof/page-replay.js +1 -1
- package/lib/proof/pod-prover.d.ts +47 -0
- package/lib/proof/pod-prover.js +155 -0
- package/lib/provider/dom-xpath.js +11 -9
- package/lib/provider/draft.d.ts +10 -7
- package/lib/provider/draft.js +11 -9
- package/lib/provider/injection-doc.d.ts +23 -1
- package/lib/provider/injection-doc.js +34 -21
- package/lib/provider/match-redaction-warning.d.ts +2 -2
- package/lib/provider/match-redaction-warning.js +3 -3
- package/lib/provider/matcher.js +13 -12
- package/lib/provider/secrets.d.ts +3 -3
- package/lib/provider/secrets.js +3 -3
- package/lib/provider/to-version.d.ts +7 -6
- package/lib/provider/to-version.js +3 -3
- package/lib/tools/registry.d.ts +5 -5
- package/lib/tools/registry.js +5 -5
- package/package.json +3 -3
- package/samples/demo-server/README.md +7 -6
- package/skill/SKILL.builder.md +356 -189
- package/skill/SKILL.common.md +400 -97
- package/skill/SKILL.old.md +340 -155
- package/skill/builder-mode.md +60 -17
- package/skill/hash-validation.md +170 -0
- package/skill/interception.md +236 -0
- package/skill/js-sdk-integration.md +13 -7
- package/skill/old-mode.md +62 -21
- package/skill/user-script.md +61 -0
- package/src/authoring/backend.ts +5 -4
- package/src/authoring/tools.ts +31 -30
- package/src/cdp/capture-engine.ts +8 -7
- package/src/cdp/claims.ts +153 -0
- package/src/cdp/container.ts +593 -0
- package/src/cdp/geo.ts +52 -0
- package/src/cdp/index.ts +1 -0
- package/src/consts.ts +1 -0
- package/src/live/cloudflared.ts +348 -0
- package/src/live/tunnel.ts +208 -0
- package/src/mcp/api/operations.gen.ts +34 -26
- package/src/mcp/api/to-zod.ts +1 -1
- package/src/mcp/api/tools.ts +1 -1
- package/src/mcp/instructions.ts +122 -48
- package/src/mcp/start.ts +69 -5
- package/src/mcp/tools/agent/analyze.ts +5 -1
- package/src/mcp/tools/agent/attach.ts +367 -26
- package/src/mcp/tools/agent/build.ts +35 -16
- package/src/mcp/tools/agent/capture.ts +5 -1
- package/src/mcp/tools/agent/eval.ts +4 -1
- package/src/mcp/tools/agent/find.ts +6 -5
- package/src/mcp/tools/agent/how-it-works.ts +62 -21
- package/src/mcp/tools/agent/index.ts +6 -2
- package/src/mcp/tools/agent/live-view.ts +182 -0
- package/src/mcp/tools/agent/pod-proof.ts +90 -0
- package/src/mcp/tools/agent/propose.ts +4 -2
- package/src/mcp/tools/agent/publish.ts +52 -77
- package/src/mcp/tools/agent/session.ts +33 -6
- package/src/mcp/tools/authenticate/authenticate.ts +28 -13
- package/src/mcp/tools/mode/mode.ts +10 -22
- package/src/old/client.ts +2 -2
- package/src/old/instructions.ts +4 -10
- package/src/old/login-cdp.ts +50 -6
- package/src/old/to-register.ts +3 -2
- package/src/old/tools/authenticate.ts +9 -1
- package/src/old/tools/get-provider-info.ts +6 -5
- package/src/old/tools/issue-app-credentials.ts +3 -2
- package/src/old/tools/publish.ts +95 -131
- package/src/old/tools/update-provider-metadata.ts +1 -1
- package/src/old/tools/verify-sdk-setup.ts +1 -1
- package/src/proof/attestor.ts +3 -3
- package/src/proof/debug-response-dump.ts +4 -4
- package/src/proof/index.ts +8 -0
- package/src/proof/page-replay.ts +1 -1
- package/src/proof/pod-prover.ts +231 -0
- package/src/provider/dom-xpath.ts +11 -9
- package/src/provider/draft.ts +13 -10
- package/src/provider/injection-doc.ts +37 -24
- package/src/provider/match-redaction-warning.ts +3 -3
- package/src/provider/matcher.ts +13 -12
- package/src/provider/secrets.ts +3 -3
- package/src/provider/to-version.ts +11 -9
- package/src/tools/registry.ts +5 -5
- package/skill/injection-api.md +0 -364
package/src/old/tools/publish.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Boom, isBoom } from '@hapi/boom'
|
|
2
2
|
import { defineTool, type RegisteredTool } from '../../mcp/server.ts'
|
|
3
3
|
import type { AttachState } from '../../mcp/tools/agent/attach.ts'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ALLOWED_REQUESTS_HINT,
|
|
6
|
+
USER_SCRIPT_HINT,
|
|
7
|
+
} from '../../provider/injection-doc.ts'
|
|
5
8
|
import {
|
|
6
9
|
countsFor,
|
|
7
10
|
matchRedactionWarnings,
|
|
@@ -35,8 +38,8 @@ function extractProviderId(resp: unknown): string | undefined {
|
|
|
35
38
|
* `providerId` for a public provider (or anyone else's) comes back as
|
|
36
39
|
* 401/403/404 — the dev's likely intent is to publish their OWN version of that
|
|
37
40
|
* site, which on this backend means registering a separate copy. Rethrow those
|
|
38
|
-
* failures with that actionable suggestion; leave other errors (
|
|
39
|
-
* version collision) untouched so their real detail surfaces.
|
|
41
|
+
* failures with that actionable suggestion; leave other errors (for example, a
|
|
42
|
+
* 400 version collision) untouched so their real detail surfaces.
|
|
40
43
|
*/
|
|
41
44
|
function rethrowOwnershipError(err: unknown, providerId: string): never {
|
|
42
45
|
const status = isBoom(err) ? err.output.statusCode : undefined
|
|
@@ -62,7 +65,7 @@ function rethrowOwnershipError(err: unknown, providerId: string): never {
|
|
|
62
65
|
/**
|
|
63
66
|
* Publish a drafted provider to the OLD devtools backend. Keeps the builder
|
|
64
67
|
* tool NAME (`create_provider_version_from_capture`) so the skill flow is
|
|
65
|
-
* unchanged, but the
|
|
68
|
+
* unchanged, but the behavior differs:
|
|
66
69
|
*
|
|
67
70
|
* - WITHOUT `providerId` → `POST /api/providers/register`: creates a
|
|
68
71
|
* brand-new provider + version 1.0.0. Re-running creates a DUPLICATE.
|
|
@@ -100,67 +103,43 @@ export function createVersionFromCaptureTool(
|
|
|
100
103
|
useIncognitoWebview?: boolean
|
|
101
104
|
extensionConfig?: unknown
|
|
102
105
|
injectionType?: 'NONE' | 'MSWJS' | 'XHOOK' | 'CDP' | 'HAWKEYE'
|
|
106
|
+
disableRequestReplay?: boolean
|
|
103
107
|
}>(
|
|
104
108
|
{
|
|
105
109
|
name: 'create_provider_version_from_capture',
|
|
106
110
|
description:
|
|
107
|
-
'Publish drafted ReclaimProvider(s) to the devtools backend. '
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
'
|
|
111
|
-
'
|
|
112
|
-
'`
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'`
|
|
117
|
-
'
|
|
118
|
-
'(
|
|
119
|
-
'
|
|
120
|
-
'
|
|
121
|
-
'
|
|
122
|
-
'
|
|
123
|
-
'
|
|
124
|
-
'
|
|
125
|
-
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
'
|
|
137
|
-
'
|
|
138
|
-
'
|
|
139
|
-
'`provider`/`providers`). Anything you OMIT is published blank/' +
|
|
140
|
-
'default in the new version, NOT preserved. To change one field ' +
|
|
141
|
-
'while keeping the rest, first read the current version with ' +
|
|
142
|
-
'get_provider_info, then pass the full desired config (the existing ' +
|
|
143
|
-
'values plus your change) back into this call. ' +
|
|
144
|
-
'`allowedInjectedRequestData`/`useIncognitoWebview`/' +
|
|
145
|
-
'`extensionConfig` only take effect on add-version — the register ' +
|
|
146
|
-
'endpoint (no `providerId`) ignores them, so on a fresh register ' +
|
|
147
|
-
'this tool automatically follows up with an add-version call that ' +
|
|
148
|
-
'applies them (also where document replay gets force-disabled — ' +
|
|
149
|
-
'see below). Per-request fields you may set on ' +
|
|
150
|
-
'`provider`/`providers`: `credentials` (omit/same-origin/include, ' +
|
|
151
|
-
'default include), `urlType` (REGEX/CONSTANT/TEMPLATE, default ' +
|
|
152
|
-
'derived from {{placeholders}}), and `isOptional` on each ' +
|
|
153
|
-
'responseMatch (default false). \n\n' +
|
|
154
|
-
'Captured requests must be GET/POST. OPRF redactions are supported. ' +
|
|
155
|
-
'Document replay — the HAWKEYE-level flag controlling whether the ' +
|
|
156
|
-
'page\'s own document/navigation request gets genuinely re-sent ' +
|
|
157
|
-
'through the interceptor at verification time — is ALWAYS ' +
|
|
158
|
-
'published disabled (`disableRequestReplay: true`); there is no ' +
|
|
159
|
-
'way to enable it here. ' +
|
|
160
|
-
'On success, if a browser is still attached, the response\'s ' +
|
|
161
|
-
'`_notes` reminds you to confirm with the developer before ' +
|
|
162
|
-
'calling `dispose_browser` — never close it unprompted, they ' +
|
|
163
|
-
'may want it for further edits.',
|
|
111
|
+
'Publish drafted ReclaimProvider(s) to the devtools backend. Needs '
|
|
112
|
+
+ 'its OWN reclaim_authenticate login — authenticate_builder does NOT '
|
|
113
|
+
+ 'authorize this call. Pass the `provider` object(s) from '
|
|
114
|
+
+ 'propose_provider VERBATIM, plus the `initialUrl` the user landed '
|
|
115
|
+
+ 'on (the login/landing page, NOT the API url). Exactly one of '
|
|
116
|
+
+ '`provider` (one request) or `providers` (a multi-request '
|
|
117
|
+
+ 'provider — every entry becomes a parallel requestData entry, all '
|
|
118
|
+
+ 'verified together). Captured requests must be GET/POST; OPRF '
|
|
119
|
+
+ 'redactions are supported.\n\n'
|
|
120
|
+
+ 'Omit `providerId` to REGISTER A NEW provider (creates it + '
|
|
121
|
+
+ 'version 1.0.0 — re-running creates a DUPLICATE). Pass '
|
|
122
|
+
+ '`providerId` (from get_me_providers) to add a NEW VERSION to it; '
|
|
123
|
+
+ 'the patch auto-bumps. You can only version a provider YOU own — '
|
|
124
|
+
+ 'to publish your own take on one you don\'t own, omit '
|
|
125
|
+
+ '`providerId` to register your own copy.\n\n'
|
|
126
|
+
+ 'THIS BACKEND ONLY EVER CREATES A NEW VERSION — there is no '
|
|
127
|
+
+ 'partial-patch endpoint, and this tool carries NOTHING forward '
|
|
128
|
+
+ 'from the previous version: every version replaces the WHOLE '
|
|
129
|
+
+ 'providerConfig with exactly what you pass in THIS call. Any '
|
|
130
|
+
+ 'field you want to survive must be re-supplied here '
|
|
131
|
+
+ '(`customInjection`, `userAgent`, `pageTitle`, '
|
|
132
|
+
+ '`allowedInjectedRequestData`, `stepsToFollow`, '
|
|
133
|
+
+ '`useIncognitoWebview`, `extensionConfig`, `requestData`); '
|
|
134
|
+
+ 'anything omitted is published blank. To change one field, read '
|
|
135
|
+
+ 'the current config with get_provider_info first and pass it back '
|
|
136
|
+
+ 'with your edit. `allowedInjectedRequestData`/'
|
|
137
|
+
+ '`useIncognitoWebview`/`extensionConfig` apply on add-version '
|
|
138
|
+
+ 'only, so a fresh register auto-follows with an add-version call '
|
|
139
|
+
+ 'that applies them (and disables document replay — see '
|
|
140
|
+
+ '`disableRequestReplay`).\n\n'
|
|
141
|
+
+ 'Always read the response\'s `_notes`. '
|
|
142
|
+
+ 'Full walkthrough: how_it_works({ topic: "publish" }).',
|
|
164
143
|
inputSchema: {
|
|
165
144
|
type: 'object',
|
|
166
145
|
properties: {
|
|
@@ -272,15 +251,11 @@ export function createVersionFromCaptureTool(
|
|
|
272
251
|
customInjection: {
|
|
273
252
|
type: 'string',
|
|
274
253
|
description:
|
|
275
|
-
|
|
276
|
-
'
|
|
277
|
-
'
|
|
278
|
-
'(window.
|
|
279
|
-
'
|
|
280
|
-
'only for rare edge cases, not navigation. The backend rejects ' +
|
|
281
|
-
'a few deprecated injection APIs (e.g. window.payloadData, ' +
|
|
282
|
-
'window.ReclaimInjected) with a 400. Guide:\n\n' +
|
|
283
|
-
INJECTION_GUIDE,
|
|
254
|
+
USER_SCRIPT_HINT
|
|
255
|
+
+ ' Old-devtools\' name for what the builder calls '
|
|
256
|
+
+ 'webSettings.jsUserScripts. The backend rejects a few '
|
|
257
|
+
+ 'deprecated injection APIs (window.payloadData, '
|
|
258
|
+
+ 'window.ReclaimInjected) with a 400.',
|
|
284
259
|
},
|
|
285
260
|
userAgent: {
|
|
286
261
|
type: 'object',
|
|
@@ -299,39 +274,15 @@ export function createVersionFromCaptureTool(
|
|
|
299
274
|
allowedInjectedRequestData: {
|
|
300
275
|
type: 'array',
|
|
301
276
|
description:
|
|
302
|
-
'Extra requests the customInjection script is allowed to '
|
|
303
|
-
'fire (
|
|
304
|
-
'
|
|
305
|
-
'
|
|
306
|
-
|
|
307
|
-
'
|
|
308
|
-
'
|
|
309
|
-
'
|
|
310
|
-
|
|
311
|
-
'the "bodySniff" section of the customInjection field\'s guide ' +
|
|
312
|
-
'for the exact mechanics and a worked example. ' +
|
|
313
|
-
'⚠️ BEFORE populating this to gate ' +
|
|
314
|
-
'`verifyProof(proof, { providerId })`: this whole entry (url, ' +
|
|
315
|
-
'method, body, responseMatches, responseRedactions) feeds a ' +
|
|
316
|
-
'client-side hash-equality check, and `url` is hashed VERBATIM ' +
|
|
317
|
-
'— no regex/template resolution, even with `urlType: REGEX` or ' +
|
|
318
|
-
'`TEMPLATE`. If the real captured URL contains ANY per-session ' +
|
|
319
|
-
'part (a tracking nonce, CSRF token, cache-busting timestamp), ' +
|
|
320
|
-
'no declared spec can EVER hash-match a real proof, no matter ' +
|
|
321
|
-
'how correct the rest of this entry is — populating' +
|
|
322
|
-
'it for such ' +
|
|
323
|
-
'a provider makes verifyProof reject every real proof,' +
|
|
324
|
-
'which is ' +
|
|
325
|
-
'worse than leaving this field empty. Diff the same endpoint\'s' +
|
|
326
|
-
' captured URL across two separate sessions before wiring this ' +
|
|
327
|
-
'up. If provider-hash validation keeps causing problems ' +
|
|
328
|
-
'(unstable url, or any other persistent mismatch), the ' +
|
|
329
|
-
'fallback on the verifying side is `verifyProof(proof, { ' +
|
|
330
|
-
'dangerouslyDisableContentValidation: true })` — trusts only ' +
|
|
331
|
-
'the attestor\'s signature, skips the hash-equality check ' +
|
|
332
|
-
'entirely; see the "Provider-hash validation" section of the ' +
|
|
333
|
-
'customInjection field\'s guide for the full mechanics and ' +
|
|
334
|
-
'when to reach for it.',
|
|
277
|
+
'Extra requests the customInjection user script is allowed to '
|
|
278
|
+
+ 'fire (for example, pagination) — add-version ONLY, the '
|
|
279
|
+
+ 'register '
|
|
280
|
+
+ 'endpoint ignores it. Each item has the same shape as '
|
|
281
|
+
+ '`provider`, plus `multiple`/`required` (default true). Set '
|
|
282
|
+
+ '`body` whenever the request has one (see its own description '
|
|
283
|
+
+ 'below). The builder calls the same concept '
|
|
284
|
+
+ '`allowedJsRequests`. '
|
|
285
|
+
+ ALLOWED_REQUESTS_HINT,
|
|
335
286
|
items: {
|
|
336
287
|
type: 'object',
|
|
337
288
|
properties: {
|
|
@@ -353,7 +304,8 @@ export function createVersionFromCaptureTool(
|
|
|
353
304
|
'body at all (skip only for a genuinely bodyless ' +
|
|
354
305
|
'request, typically GET). If the real body is FIXED ' +
|
|
355
306
|
'(identical for every user/run), put that literal body ' +
|
|
356
|
-
'text here verbatim. If only PART of it varies (
|
|
307
|
+
'text here verbatim. If only PART of it varies (for ' +
|
|
308
|
+
'example, ' +
|
|
357
309
|
'`{"request":1,"type":"user_info","id":"12345"}` where ' +
|
|
358
310
|
'only `id` differs per user), template ONLY that part: ' +
|
|
359
311
|
'`{"request":1,"type":"user_info",' +
|
|
@@ -376,7 +328,7 @@ export function createVersionFromCaptureTool(
|
|
|
376
328
|
'reproduces the real captured request body ' +
|
|
377
329
|
'byte-for-byte. Fallback if per-field templating keeps ' +
|
|
378
330
|
'mismatching (more fields vary than expected, unstable ' +
|
|
379
|
-
'key order,
|
|
331
|
+
'key order, and so on) and you can\'t pin down every ' +
|
|
380
332
|
'variable field: template the WHOLE body as one ' +
|
|
381
333
|
'placeholder instead, `{{REQ_BODY_GRD}}` — the `GRD` ' +
|
|
382
334
|
'suffix makes it a greedy match (captures everything) ' +
|
|
@@ -394,7 +346,7 @@ export function createVersionFromCaptureTool(
|
|
|
394
346
|
'`value` must literally appear (or match, if `regex`) ' +
|
|
395
347
|
'somewhere in the response body for the claim to be ' +
|
|
396
348
|
'accepted; it commonly embeds one or more ' +
|
|
397
|
-
'`{{paramName}}` extraction placeholders (
|
|
349
|
+
'`{{paramName}}` extraction placeholders (for example, ' +
|
|
398
350
|
'`"name":"{{name_0}}"`) whose real value is redacted ' +
|
|
399
351
|
'out and supplied separately as a witness/extracted ' +
|
|
400
352
|
'param. Use `${var}` (not `{{var}}`) inside this string ' +
|
|
@@ -410,7 +362,8 @@ export function createVersionFromCaptureTool(
|
|
|
410
362
|
'Each item: `{ jsonPath?: string, xPath?: string, ' +
|
|
411
363
|
'regex?: string, hash?: string }`. Identifies WHICH ' +
|
|
412
364
|
'part of the response the matching `{{paramName}}` in ' +
|
|
413
|
-
'`responseMatches` actually redacts
|
|
365
|
+
'`responseMatches` actually redacts or extracts — for ' +
|
|
366
|
+
'example, ' +
|
|
414
367
|
'`jsonPath: "$.data.items[0].name"` for a JSON response. ' +
|
|
415
368
|
'Order/count should line up with `responseMatches`\' ' +
|
|
416
369
|
'placeholders one-to-one for a typical claim.',
|
|
@@ -475,17 +428,28 @@ export function createVersionFromCaptureTool(
|
|
|
475
428
|
'unset — the devtools backend\'s own column default ' +
|
|
476
429
|
'(`HAWKEYE`) applies, which is inert and harmless for the ' +
|
|
477
430
|
'standard capture→replay flow with no interceptor script ' +
|
|
478
|
-
'installed. Only set
|
|
479
|
-
'
|
|
480
|
-
'that calls ' +
|
|
431
|
+
'installed. Only set `HAWKEYE`/`MSWJS`/`XHOOK` when you are ' +
|
|
432
|
+
'ALSO supplying a `customInjection` script that calls ' +
|
|
481
433
|
'`window.reclaimInterceptor.addResponseMiddleware(...)` for ' +
|
|
482
|
-
'genuine live interception, or set `NONE` explicitly
|
|
483
|
-
'
|
|
484
|
-
'
|
|
485
|
-
'
|
|
486
|
-
'
|
|
487
|
-
'
|
|
488
|
-
|
|
434
|
+
'genuine live interception, or set `NONE` explicitly to be ' +
|
|
435
|
+
'certain none is configured. Builder calls the equivalent ' +
|
|
436
|
+
'concept `interceptorType` (no `NONE` there — omitting the ' +
|
|
437
|
+
'whole `interceptorOptions` object is its no-interception ' +
|
|
438
|
+
'signal instead). What each value actually does: ' +
|
|
439
|
+
'how_it_works({ topic: "interception" }).',
|
|
440
|
+
},
|
|
441
|
+
disableRequestReplay: {
|
|
442
|
+
type: 'boolean',
|
|
443
|
+
description:
|
|
444
|
+
'Whether the page\'s own document/navigation request is ' +
|
|
445
|
+
'skipped (constructed locally) instead of genuinely replayed ' +
|
|
446
|
+
'through the interceptor. Defaults to `true` (disabled) when ' +
|
|
447
|
+
'omitted. Only meaningful for `injectionType` ' +
|
|
448
|
+
'HAWKEYE/MSWJS/XHOOK — pass `false` to enable real document ' +
|
|
449
|
+
'replay for those (for example, the target value is embedded ' +
|
|
450
|
+
'in the page\'s own HTML). Inert when `injectionType` is ' +
|
|
451
|
+
'`CDP` or ' +
|
|
452
|
+
'unset.',
|
|
489
453
|
},
|
|
490
454
|
},
|
|
491
455
|
required: ['initialUrl'],
|
|
@@ -529,9 +493,9 @@ export function createVersionFromCaptureTool(
|
|
|
529
493
|
// column default applies when omitted, same as before this field
|
|
530
494
|
// existed at all.
|
|
531
495
|
injectionType: args.injectionType,
|
|
532
|
-
//
|
|
533
|
-
//
|
|
534
|
-
disableRequestReplay: true,
|
|
496
|
+
// Author-settable; defaults to disabled (see tool description).
|
|
497
|
+
// Only meaningful for HAWKEYE/MSWJS/XHOOK — inert for CDP.
|
|
498
|
+
disableRequestReplay: args.disableRequestReplay ?? true,
|
|
535
499
|
allowedInjectedRequestData: args.allowedInjectedRequestData
|
|
536
500
|
? injectedRequestDataFrom(
|
|
537
501
|
args.allowedInjectedRequestData,
|
|
@@ -584,12 +548,12 @@ export function createVersionFromCaptureTool(
|
|
|
584
548
|
)
|
|
585
549
|
}
|
|
586
550
|
|
|
587
|
-
// disableRequestReplay is honored ONLY on add-version
|
|
588
|
-
//
|
|
589
|
-
//
|
|
590
|
-
// an explicit injectionType, when passed —
|
|
591
|
-
// register persists it — and any other
|
|
592
|
-
// caller passed).
|
|
551
|
+
// disableRequestReplay is honored ONLY on add-version — so every
|
|
552
|
+
// register is immediately followed by an add-version call that
|
|
553
|
+
// actually applies it (whatever value — default or author-set;
|
|
554
|
+
// which also lands an explicit injectionType, when passed —
|
|
555
|
+
// unverified whether register persists it — and any other
|
|
556
|
+
// register-ignored fields the caller passed).
|
|
593
557
|
const REGISTER_IGNORED_KEYS = [
|
|
594
558
|
'allowedInjectedRequestData',
|
|
595
559
|
'useIncognitoWebview',
|
|
@@ -603,8 +567,8 @@ export function createVersionFromCaptureTool(
|
|
|
603
567
|
`${ignoredOnRegister.length > 1 ? 'are' : 'is'} ` +
|
|
604
568
|
'ignored on register (no providerId) — the devtools backend only ' +
|
|
605
569
|
'reads them when adding a version. They were applied by the ' +
|
|
606
|
-
'automatic follow-up version this tool always creates to ' +
|
|
607
|
-
'
|
|
570
|
+
'automatic follow-up version this tool always creates to apply ' +
|
|
571
|
+
'disableRequestReplay.',
|
|
608
572
|
)
|
|
609
573
|
}
|
|
610
574
|
|
|
@@ -633,7 +597,7 @@ export function createVersionFromCaptureTool(
|
|
|
633
597
|
await client.updateProviderConfig(newProviderId, configBody)
|
|
634
598
|
notes.push(
|
|
635
599
|
`Created an automatic follow-up version (${followVersion}) to ` +
|
|
636
|
-
|
|
600
|
+
`apply disableRequestReplay (${opts.disableRequestReplay})` +
|
|
637
601
|
(opts.injectionType !== undefined
|
|
638
602
|
? ` and set injectionType (${opts.injectionType})`
|
|
639
603
|
: '') +
|
|
@@ -657,7 +621,7 @@ export function createVersionFromCaptureTool(
|
|
|
657
621
|
}
|
|
658
622
|
} else {
|
|
659
623
|
notes.push(
|
|
660
|
-
'Could not
|
|
624
|
+
'Could not apply disableRequestReplay: the ' +
|
|
661
625
|
'register response did not include the new providerId. Call ' +
|
|
662
626
|
'this tool again WITH `providerId` to create a version that ' +
|
|
663
627
|
'applies them.',
|
|
@@ -668,7 +632,7 @@ export function createVersionFromCaptureTool(
|
|
|
668
632
|
}
|
|
669
633
|
|
|
670
634
|
// New version of an existing provider — pick the next patch above
|
|
671
|
-
// the highest existing version. A provider you don't own (
|
|
635
|
+
// the highest existing version. A provider you don't own (for example, a
|
|
672
636
|
// public one) fails here with 401/403/404; surface the register-a-copy
|
|
673
637
|
// workaround instead of a bare permission error.
|
|
674
638
|
const providerId = args.providerId
|
|
@@ -8,7 +8,7 @@ import type { ReclaimOldClient, UpdateProviderMetadataBody } from '../client.ts'
|
|
|
8
8
|
* `create_provider_version_from_capture` paths: it does NOT touch
|
|
9
9
|
* `providerConfig`/versions at all, and only the fields you pass here
|
|
10
10
|
* change — everything else on the provider is left untouched (no need to
|
|
11
|
-
* re-supply `requestData`/`customInjection
|
|
11
|
+
* re-supply `requestData`/`customInjection`, and so on, and
|
|
12
12
|
* no new version is created).
|
|
13
13
|
*
|
|
14
14
|
* The backend 403s if you don't own the provider (and aren't an admin) —
|
|
@@ -122,7 +122,7 @@ export function verifySdkSetupTool(client: ReclaimOldClient): RegisteredTool {
|
|
|
122
122
|
: 'PUBLIC_URL not set — fine if you only read the proof from the ' +
|
|
123
123
|
'frontend flow, but the async webhook callback needs a ' +
|
|
124
124
|
'publicly-reachable URL or it will never fire. Get one via a ' +
|
|
125
|
-
'tunnel (
|
|
125
|
+
'tunnel (for example, `ngrok http <port>`) or by deploying to a ' +
|
|
126
126
|
'dev/staging server you already have — ask the user which they ' +
|
|
127
127
|
'prefer.',
|
|
128
128
|
})
|
package/src/proof/attestor.ts
CHANGED
|
@@ -53,13 +53,13 @@ export interface RunAttestorProofOptions {
|
|
|
53
53
|
/** When resolving the key from env/.env/file, the address the caller expects
|
|
54
54
|
* to sign with (sanity check). Ignored when `ownerPrivateKey` is given. */
|
|
55
55
|
ownerAddress?: string
|
|
56
|
-
/** Sign with this key directly (
|
|
57
|
-
* instead of resolving from env/.env/file. */
|
|
56
|
+
/** Sign with this key directly (for example, the app or VC's ephemeral
|
|
57
|
+
* per-session key) instead of resolving from env/.env/file. */
|
|
58
58
|
ownerPrivateKey?: string
|
|
59
59
|
/** ZK engine for `createClaimOnAttestor`. Defaults to `'stwo'` — a pure-WASM
|
|
60
60
|
* prover that runs everywhere (no native shared library, so it works on
|
|
61
61
|
* Windows where `'gnark'` fails to load its `.dll`). Server-side paths that
|
|
62
|
-
* want gnark's speed pin it explicitly (
|
|
62
|
+
* want gnark's speed pin it explicitly (for example, the verify runner). */
|
|
63
63
|
zkEngine?: 'gnark' | 'snarkjs' | 'stwo'
|
|
64
64
|
/** Extract the structured {@link AttestorClaim} (claim + attestor signature)
|
|
65
65
|
* onto the result for nested-proof construction. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Debug helper (gated by RECLAIM_AGENT_DUMP_RESPONSE): capture the EXACT
|
|
2
2
|
// response bytes the attestor validates a claim against, plus a per-match
|
|
3
3
|
// presence check. A "Response does not contain X" failure means the attestor's
|
|
4
|
-
// server-side re-fetch differs from what the browser (replay) saw —
|
|
5
|
-
// embeds nav/userMenu data for browser requests but not for the
|
|
6
|
-
// fetch. Seeing the attestor's actual response is the only way
|
|
7
|
-
// really returned.
|
|
4
|
+
// server-side re-fetch differs from what the browser (replay) saw — for
|
|
5
|
+
// example, GitHub embeds nav/userMenu data for browser requests but not for the
|
|
6
|
+
// attestor's raw fetch. Seeing the attestor's actual response is the only way
|
|
7
|
+
// to tell what it really returned.
|
|
8
8
|
//
|
|
9
9
|
// On each getResponseRedactions call it writes the response to
|
|
10
10
|
// `attestor-last-response.html` in the process CWD and logs the byte count +,
|
package/src/proof/index.ts
CHANGED
|
@@ -15,6 +15,14 @@ export {
|
|
|
15
15
|
parseClaim,
|
|
16
16
|
resolveAttestorUrl,
|
|
17
17
|
} from './proof-core.ts'
|
|
18
|
+
export {
|
|
19
|
+
type HttpParams,
|
|
20
|
+
type HttpSecretParams,
|
|
21
|
+
type PopcornProveOptions,
|
|
22
|
+
popcornProve,
|
|
23
|
+
popcornValidateExtraction,
|
|
24
|
+
type ValidateExtractionResult,
|
|
25
|
+
} from './pod-prover.ts'
|
|
18
26
|
export { ensureZkFiles } from './zk-files.ts'
|
|
19
27
|
// Re-exported attestor-core claim primitive so the agent is the single
|
|
20
28
|
// integration point with @reclaimprotocol/attestor-core across the builder.
|
package/src/proof/page-replay.ts
CHANGED
|
@@ -102,7 +102,7 @@ function authenticatedPageFetch(
|
|
|
102
102
|
* (`authenticatedPageFetch`) so cookies are the real browser's, which a
|
|
103
103
|
* detached call could never reproduce without manually re-deriving them.
|
|
104
104
|
* WITH `withoutSecrets` (the auth-bound check — "does this still work with
|
|
105
|
-
* no credentials,
|
|
105
|
+
* no credentials, that is, is it actually public"), replay instead through the
|
|
106
106
|
* detached Node-side `replayProvider`: the whole point of that check is to
|
|
107
107
|
* prove NO secret rides along, and the live page's own global `fetch` can't
|
|
108
108
|
* give that guarantee — a site (or a script installed via test_user_script)
|