@reclaimprotocol/agent 0.1.23 → 0.1.24
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 +55 -20
- package/lib/authoring/backend.d.ts +5 -4
- package/lib/authoring/tools.js +30 -30
- package/lib/cdp/browser-proxy.d.ts +78 -0
- package/lib/cdp/browser-proxy.js +186 -0
- package/lib/cdp/capture-engine.js +8 -7
- package/lib/cdp/client.d.ts +10 -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/page.d.ts +20 -0
- package/lib/live/page.js +134 -0
- package/lib/live/tunnel.d.ts +23 -0
- package/lib/live/tunnel.js +120 -0
- package/lib/live/viewer.d.ts +28 -0
- package/lib/live/viewer.js +232 -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 +101 -38
- package/lib/mcp/start.js +4 -3
- package/lib/mcp/tools/agent/analyze.js +5 -1
- package/lib/mcp/tools/agent/attach.d.ts +8 -1
- package/lib/mcp/tools/agent/attach.js +166 -22
- package/lib/mcp/tools/agent/build.d.ts +13 -8
- package/lib/mcp/tools/agent/build.js +22 -11
- 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/live-view.d.ts +21 -0
- package/lib/mcp/tools/agent/live-view.js +153 -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/proxy.d.ts +3 -0
- package/lib/mcp/tools/agent/proxy.js +199 -0
- package/lib/mcp/tools/agent/publish.js +47 -77
- package/lib/mcp/tools/agent/session.d.ts +2 -1
- package/lib/mcp/tools/agent/session.js +26 -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 +323 -97
- package/skill/SKILL.old.md +340 -155
- package/skill/builder-mode.md +58 -17
- package/skill/hash-validation.md +170 -0
- package/skill/interception.md +235 -0
- package/skill/js-sdk-integration.md +13 -7
- package/skill/old-mode.md +60 -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/client.ts +8 -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/page.ts +145 -0
- package/src/live/tunnel.ts +157 -0
- package/src/live/viewer.ts +293 -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 +121 -48
- package/src/mcp/start.ts +4 -3
- package/src/mcp/tools/agent/analyze.ts +5 -1
- package/src/mcp/tools/agent/attach.ts +194 -22
- package/src/mcp/tools/agent/build.ts +26 -15
- 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/live-view.ts +198 -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 +26 -5
- 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
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive live view of one attached tab, over a public URL.
|
|
3
|
+
*
|
|
4
|
+
* Two halves:
|
|
5
|
+
* - OUT: CDP `Page.startScreencast` pushes JPEG frames; each is forwarded to
|
|
6
|
+
* every connected browser as a Server-Sent Event and acked back to CDP.
|
|
7
|
+
* - IN: the viewer POSTs pointer and key events, which are replayed into the
|
|
8
|
+
* page with `Input.dispatch*`.
|
|
9
|
+
*
|
|
10
|
+
* Only ever bound to 127.0.0.1. Reaching it from outside is the tunnel's job
|
|
11
|
+
* (see `tunnel.ts`), and because a quick tunnel is unauthenticated, EVERY
|
|
12
|
+
* route sits behind an unguessable token in the path. A request without it
|
|
13
|
+
* gets a flat 404 — not a 401, which would confirm the server exists.
|
|
14
|
+
*
|
|
15
|
+
* Interactivity is the caller's choice. `interactive: false` still streams,
|
|
16
|
+
* but the input route refuses, which is the right setting for showing someone
|
|
17
|
+
* a run rather than handing them the wheel.
|
|
18
|
+
*/
|
|
19
|
+
import { randomBytes } from 'node:crypto';
|
|
20
|
+
import { createServer, } from 'node:http';
|
|
21
|
+
import { LOGGER } from "../logger.js";
|
|
22
|
+
import { renderViewerPage } from "./page.js";
|
|
23
|
+
/** JPEG quality for streamed frames. 60 keeps a text-heavy page readable
|
|
24
|
+
* while staying small enough for a tunnel's uplink. */
|
|
25
|
+
const FRAME_QUALITY = 60;
|
|
26
|
+
/** Cap the streamed frame size. Screencast scales to fit, so this bounds
|
|
27
|
+
* bandwidth without changing the page's own layout viewport. */
|
|
28
|
+
const MAX_FRAME_WIDTH = 1280;
|
|
29
|
+
const MAX_FRAME_HEIGHT = 800;
|
|
30
|
+
/** Bytes accepted on an input POST. Events are tiny; anything larger is
|
|
31
|
+
* either a bug or someone probing. */
|
|
32
|
+
const MAX_INPUT_BYTES = 4096;
|
|
33
|
+
/**
|
|
34
|
+
* Start the loopback live-view server for `tab`. Resolves once it is
|
|
35
|
+
* listening; the screencast starts with the first viewer and stops with the
|
|
36
|
+
* last, so an idle share costs the page nothing.
|
|
37
|
+
*/
|
|
38
|
+
export async function startLiveView(opts) {
|
|
39
|
+
const token = randomBytes(24).toString('base64url');
|
|
40
|
+
const path = `/v/${token}`;
|
|
41
|
+
const clients = new Set();
|
|
42
|
+
let streaming = false;
|
|
43
|
+
let unsubscribe;
|
|
44
|
+
const startScreencast = async () => {
|
|
45
|
+
if (streaming) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
streaming = true;
|
|
49
|
+
unsubscribe = opts.tab.subscribe('Page.screencastFrame', (frame) => {
|
|
50
|
+
// Ack first: CDP sends at most one un-acked frame, so a slow or failed
|
|
51
|
+
// write must not stall the stream.
|
|
52
|
+
void opts.tab
|
|
53
|
+
.send('Page.screencastFrameAck', { sessionId: frame.sessionId })
|
|
54
|
+
.catch(() => { });
|
|
55
|
+
const payload = JSON.stringify({ data: frame.data });
|
|
56
|
+
for (const res of clients) {
|
|
57
|
+
res.write(`event: frame\ndata: ${payload}\n\n`);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
await opts.tab.send('Page.enable');
|
|
61
|
+
await opts.tab.send('Page.startScreencast', {
|
|
62
|
+
format: 'jpeg',
|
|
63
|
+
quality: FRAME_QUALITY,
|
|
64
|
+
maxWidth: MAX_FRAME_WIDTH,
|
|
65
|
+
maxHeight: MAX_FRAME_HEIGHT,
|
|
66
|
+
everyNthFrame: 1,
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
const stopScreencast = async () => {
|
|
70
|
+
if (!streaming) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
streaming = false;
|
|
74
|
+
unsubscribe?.();
|
|
75
|
+
unsubscribe = undefined;
|
|
76
|
+
await opts.tab.send('Page.stopScreencast').catch(() => { });
|
|
77
|
+
};
|
|
78
|
+
const server = createServer((req, res) => {
|
|
79
|
+
const url = req.url ?? '/';
|
|
80
|
+
// Constant prefix check: everything is scoped under the token, so an
|
|
81
|
+
// unmatched path is indistinguishable from a server that isn't there.
|
|
82
|
+
if (!url.startsWith(path)) {
|
|
83
|
+
res.writeHead(404).end('not found');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const route = url.slice(path.length) || '/';
|
|
87
|
+
if (req.method === 'GET' && (route === '/' || route.startsWith('/?'))) {
|
|
88
|
+
const body = renderViewerPage({
|
|
89
|
+
base: path,
|
|
90
|
+
interactive: opts.interactive,
|
|
91
|
+
title: opts.title ?? 'Attached tab',
|
|
92
|
+
});
|
|
93
|
+
res.writeHead(200, {
|
|
94
|
+
'content-type': 'text/html; charset=utf-8',
|
|
95
|
+
// A share URL must never be cached or indexed by anything between
|
|
96
|
+
// the viewer and here.
|
|
97
|
+
'cache-control': 'no-store',
|
|
98
|
+
'referrer-policy': 'no-referrer',
|
|
99
|
+
}).end(body);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (req.method === 'GET' && route === '/stream') {
|
|
103
|
+
res.writeHead(200, {
|
|
104
|
+
'content-type': 'text/event-stream',
|
|
105
|
+
'cache-control': 'no-store',
|
|
106
|
+
connection: 'keep-alive',
|
|
107
|
+
// Defeat proxy buffering, which would otherwise hold frames back.
|
|
108
|
+
'x-accel-buffering': 'no',
|
|
109
|
+
});
|
|
110
|
+
res.write(': connected\n\n');
|
|
111
|
+
clients.add(res);
|
|
112
|
+
void startScreencast().catch((err) => {
|
|
113
|
+
LOGGER.warn({ err }, 'live view: screencast failed to start');
|
|
114
|
+
});
|
|
115
|
+
req.on('close', () => {
|
|
116
|
+
clients.delete(res);
|
|
117
|
+
if (!clients.size) {
|
|
118
|
+
void stopScreencast();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (req.method === 'POST' && route === '/input') {
|
|
124
|
+
if (!opts.interactive) {
|
|
125
|
+
res.writeHead(403).end('view only');
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
readJson(req, MAX_INPUT_BYTES)
|
|
129
|
+
.then((body) => dispatchInput(opts.tab, body))
|
|
130
|
+
.then(() => res.writeHead(204).end())
|
|
131
|
+
.catch((err) => {
|
|
132
|
+
LOGGER.debug({ err }, 'live view: input rejected');
|
|
133
|
+
res.writeHead(400).end('bad input');
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
res.writeHead(404).end('not found');
|
|
138
|
+
});
|
|
139
|
+
await new Promise((resolve) => {
|
|
140
|
+
server.listen(0, '127.0.0.1', resolve);
|
|
141
|
+
});
|
|
142
|
+
const port = server.address().port;
|
|
143
|
+
return {
|
|
144
|
+
localUrl: `http://127.0.0.1:${port}`,
|
|
145
|
+
port,
|
|
146
|
+
token,
|
|
147
|
+
path,
|
|
148
|
+
viewers: () => clients.size,
|
|
149
|
+
stop: async () => {
|
|
150
|
+
await stopScreencast();
|
|
151
|
+
for (const res of clients) {
|
|
152
|
+
res.end();
|
|
153
|
+
}
|
|
154
|
+
clients.clear();
|
|
155
|
+
await closeServer(server);
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function closeServer(server) {
|
|
160
|
+
return new Promise((resolve) => {
|
|
161
|
+
server.close(() => resolve());
|
|
162
|
+
// A held-open SSE response would otherwise keep the server alive.
|
|
163
|
+
server.closeAllConnections?.();
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function readJson(req, limit) {
|
|
167
|
+
return new Promise((resolve, reject) => {
|
|
168
|
+
let size = 0;
|
|
169
|
+
const chunks = [];
|
|
170
|
+
req.on('data', (chunk) => {
|
|
171
|
+
size += chunk.length;
|
|
172
|
+
if (size > limit) {
|
|
173
|
+
reject(new Error('input too large'));
|
|
174
|
+
req.destroy();
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
chunks.push(chunk);
|
|
178
|
+
});
|
|
179
|
+
req.on('end', () => {
|
|
180
|
+
try {
|
|
181
|
+
resolve(JSON.parse(Buffer.concat(chunks).toString('utf8')));
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
reject(err instanceof Error ? err : new Error('bad json'));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
req.on('error', reject);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/** Replay one viewer event into the page. Unknown shapes throw, so the route
|
|
191
|
+
* answers 400 rather than forwarding something arbitrary to CDP. */
|
|
192
|
+
async function dispatchInput(tab, body) {
|
|
193
|
+
const num = (v) => (typeof v === 'number' && Number.isFinite(v)
|
|
194
|
+
? v
|
|
195
|
+
: 0);
|
|
196
|
+
if (body.kind === 'mouse') {
|
|
197
|
+
const type = String(body.type);
|
|
198
|
+
if (!['mousePressed', 'mouseReleased', 'mouseMoved', 'mouseWheel']
|
|
199
|
+
.includes(type)) {
|
|
200
|
+
throw new Error(`unsupported mouse type ${type}`);
|
|
201
|
+
}
|
|
202
|
+
await tab.send('Input.dispatchMouseEvent', {
|
|
203
|
+
type,
|
|
204
|
+
x: num(body.x),
|
|
205
|
+
y: num(body.y),
|
|
206
|
+
button: type === 'mouseWheel' ? 'none' : 'left',
|
|
207
|
+
clickCount: type === 'mouseWheel' ? 0 : 1,
|
|
208
|
+
...(type === 'mouseWheel'
|
|
209
|
+
? { deltaX: num(body.deltaX), deltaY: num(body.deltaY) }
|
|
210
|
+
: {}),
|
|
211
|
+
});
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (body.kind === 'key') {
|
|
215
|
+
const type = String(body.type);
|
|
216
|
+
if (type !== 'keyDown' && type !== 'keyUp') {
|
|
217
|
+
throw new Error(`unsupported key type ${type}`);
|
|
218
|
+
}
|
|
219
|
+
const key = String(body.key ?? '');
|
|
220
|
+
// A single printable character needs `text` as well, or the page sees the
|
|
221
|
+
// keypress but no character is inserted.
|
|
222
|
+
const text = key.length === 1 ? key : undefined;
|
|
223
|
+
await tab.send('Input.dispatchKeyEvent', {
|
|
224
|
+
type,
|
|
225
|
+
key,
|
|
226
|
+
code: String(body.code ?? ''),
|
|
227
|
+
...(text && type === 'keyDown' ? { text } : {}),
|
|
228
|
+
});
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
throw new Error('unknown event kind');
|
|
232
|
+
}
|
|
@@ -440,7 +440,7 @@ export const MCP_TOOLS = {
|
|
|
440
440
|
}),
|
|
441
441
|
},
|
|
442
442
|
"CreateProvider": {
|
|
443
|
-
description: "Create a provider\n\nCreate a new Reclaim provider. Use this only after `providers` returned nothing useful for the domain. The caller must be an active member of the target organization.\nCreates a new provider in the specified organization. `visibility` is coerced to `PRIVATE` at creation regardless of what's sent; the author may toggle to `PUBLIC` later via `PATCH /providers/{id}`. While `PRIVATE`, versions go
|
|
443
|
+
description: "Create a provider\n\nCreate a new Reclaim provider. Use this only after `providers` returned nothing useful for the domain. The caller must be an active member of the target organization.\nCreates a new provider in the specified organization. `visibility` is coerced to `PRIVATE` at creation regardless of what's sent; the author may toggle to `PUBLIC` later via `PATCH /providers/{id}`. While `PRIVATE`, versions go live freely; once `PUBLIC`, non-admin versions need admin review. See `Provider.visibility`.\nThe server also seeds an initial `0.1.0` version on the `draft` branch in the same transaction so the provider is immediately editable. Its `initialUrl` defaults to `https://<domain>`; all other version fields fall back to their schema-declared defaults (a `structured` verificationType, empty requests, empty web settings). `Provider.latestVersion` stays `null` until the draft is promoted to the live channel.",
|
|
444
444
|
inputSchema: toZod({
|
|
445
445
|
"type": "object",
|
|
446
446
|
"properties": {
|
|
@@ -467,7 +467,7 @@ export const MCP_TOOLS = {
|
|
|
467
467
|
"format": "uuid"
|
|
468
468
|
},
|
|
469
469
|
"domain": {
|
|
470
|
-
"description": "Canonical root domain (
|
|
470
|
+
"description": "Canonical root domain (for example, `github.com`). No scheme, no port, no path.",
|
|
471
471
|
"type": "string",
|
|
472
472
|
"format": "hostname",
|
|
473
473
|
"minLength": 1,
|
|
@@ -526,12 +526,12 @@ export const MCP_TOOLS = {
|
|
|
526
526
|
"brandUrl": {
|
|
527
527
|
"type": "string",
|
|
528
528
|
"format": "uri",
|
|
529
|
-
"description": "Canonical homepage of the brand (
|
|
529
|
+
"description": "Canonical homepage of the brand (for example, `https://google.com`). Used in brand-link cards and JSON-LD.",
|
|
530
530
|
"maxLength": 2000
|
|
531
531
|
},
|
|
532
532
|
"primaryDataPoint": {
|
|
533
533
|
"type": "string",
|
|
534
|
-
"description": "Headline data point — the single most-important variable this provider can verify (
|
|
534
|
+
"description": "Headline data point — the single most-important variable this provider can verify (for example, `subscriber count`). Used in the provider's SEO title.",
|
|
535
535
|
"maxLength": 200
|
|
536
536
|
},
|
|
537
537
|
"dataPoints": {
|
|
@@ -636,10 +636,11 @@ export const MCP_TOOLS = {
|
|
|
636
636
|
},
|
|
637
637
|
"branch": {
|
|
638
638
|
"type": "string",
|
|
639
|
-
"description": "Branch (lifecycle stage) of this provider version.\n\n- `ai`: changes authored by the AI assistant live on this branch.\n\n- `draft`: a human is actively editing the version.\n\n- `in_review`: the author has submitted the version to be made\n public and it is awaiting review. On approval the branch tag\n is cleared (the version is promoted to the live channel and becomes\n public).\n\n- `rejected`: review concluded with a rejection. When the author\n addresses the feedback the branch transitions back to\n `in_review`.",
|
|
639
|
+
"description": "Branch (lifecycle stage) of this provider version.\n\n- `ai`: changes authored by the AI assistant live on this branch.\n\n- `draft`: a human is actively editing the version.\n\n- `fixed`: a proven AI repair. It remains pinned to its explicit\n version and does not replace the live trunk version.\n\n- `in_review`: the author has submitted the version to be made\n public and it is awaiting review. On approval the branch tag\n is cleared (the version is promoted to the live channel and becomes\n public).\n\n- `rejected`: review concluded with a rejection. When the author\n addresses the feedback the branch transitions back to\n `in_review`.",
|
|
640
640
|
"enum": [
|
|
641
641
|
"ai",
|
|
642
642
|
"draft",
|
|
643
|
+
"fixed",
|
|
643
644
|
"in_review",
|
|
644
645
|
"rejected"
|
|
645
646
|
]
|
|
@@ -775,7 +776,7 @@ export const MCP_TOOLS = {
|
|
|
775
776
|
"items": {
|
|
776
777
|
"type": "object",
|
|
777
778
|
"additionalProperties": false,
|
|
778
|
-
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (
|
|
779
|
+
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (that is, \"HTTP/1.1 200 OK\")",
|
|
779
780
|
"properties": {
|
|
780
781
|
"xPath": {
|
|
781
782
|
"type": "string",
|
|
@@ -783,7 +784,7 @@ export const MCP_TOOLS = {
|
|
|
783
784
|
},
|
|
784
785
|
"jsonPath": {
|
|
785
786
|
"type": "string",
|
|
786
|
-
"description": "expect a JSON response, retrieve the item at this path using dot notation for
|
|
787
|
+
"description": "expect a JSON response, retrieve the item at this path using dot notation, for example 'email.addresses.0'."
|
|
787
788
|
},
|
|
788
789
|
"regex": {
|
|
789
790
|
"type": "string",
|
|
@@ -926,7 +927,7 @@ export const MCP_TOOLS = {
|
|
|
926
927
|
"items": {
|
|
927
928
|
"type": "object",
|
|
928
929
|
"additionalProperties": false,
|
|
929
|
-
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (
|
|
930
|
+
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (that is, \"HTTP/1.1 200 OK\")",
|
|
930
931
|
"properties": {
|
|
931
932
|
"xPath": {
|
|
932
933
|
"type": "string",
|
|
@@ -934,7 +935,7 @@ export const MCP_TOOLS = {
|
|
|
934
935
|
},
|
|
935
936
|
"jsonPath": {
|
|
936
937
|
"type": "string",
|
|
937
|
-
"description": "expect a JSON response, retrieve the item at this path using dot notation for
|
|
938
|
+
"description": "expect a JSON response, retrieve the item at this path using dot notation, for example 'email.addresses.0'."
|
|
938
939
|
},
|
|
939
940
|
"regex": {
|
|
940
941
|
"type": "string",
|
|
@@ -991,8 +992,8 @@ export const MCP_TOOLS = {
|
|
|
991
992
|
"properties": {
|
|
992
993
|
"geoLocation": {
|
|
993
994
|
"type": "string",
|
|
994
|
-
"description": "Geographic location
|
|
995
|
-
"maxLength":
|
|
995
|
+
"description": "Geographic location the verification should appear to originate from: a 2-letter ISO country code, or a parameter the attestor resolves at proof time. `{{DYNAMIC_GEO}}` and `{{DYNAMIC_GEO_SECRET}}` are the Verification Client's standard names for the end-user's own country — the `_SECRET` one is delivered as a secret param, so the attestor never learns which country the proof egressed from.",
|
|
996
|
+
"maxLength": 64,
|
|
996
997
|
"default": "{{DYNAMIC_GEO}}"
|
|
997
998
|
},
|
|
998
999
|
"clientOptions": {
|
|
@@ -1386,7 +1387,7 @@ export const MCP_TOOLS = {
|
|
|
1386
1387
|
}),
|
|
1387
1388
|
},
|
|
1388
1389
|
"DeleteProviderVersion": {
|
|
1389
|
-
description: "Delete a provider version\n\nSoft-archives a version on the `draft`, `ai`, or `rejected` branch — sets `status` to `ARCHIVED` so history is preserved.
|
|
1390
|
+
description: "Delete a provider version\n\nSoft-archives a version on the `draft`, `ai`, or `rejected` branch — sets `status` to `ARCHIVED` so history is preserved. `fixed`, trunk (live), and `in_review` versions cannot be archived this way; archive the parent provider instead. Supports optimistic concurrency via `If-Match`.",
|
|
1390
1391
|
inputSchema: toZod({
|
|
1391
1392
|
"type": "object",
|
|
1392
1393
|
"properties": {
|
|
@@ -1706,7 +1707,7 @@ export const MCP_TOOLS = {
|
|
|
1706
1707
|
}),
|
|
1707
1708
|
},
|
|
1708
1709
|
"GetProviderVersion": {
|
|
1709
|
-
description: "Get a specific provider version",
|
|
1710
|
+
description: "Get a specific provider version\n\nFetches one exact canonical version. Trunk is public when the provider is public. Non-trunk versions are visible to admins and members of the provider's organization. A member of the organization that paid for a successful AI repair may also read only the exact `fixed` version created by that repair.",
|
|
1710
1711
|
inputSchema: toZod({
|
|
1711
1712
|
"type": "object",
|
|
1712
1713
|
"properties": {
|
|
@@ -2061,7 +2062,7 @@ export const MCP_TOOLS = {
|
|
|
2061
2062
|
}),
|
|
2062
2063
|
},
|
|
2063
2064
|
"ListProviderVersions": {
|
|
2064
|
-
description: "List a provider's versions\n\nLists versions visible to the caller. Non-public branches (`ai`, `draft`, `in_review`, `rejected`) are only visible to members of the provider's owning organization.",
|
|
2065
|
+
description: "List a provider's versions\n\nLists versions visible to the caller. Non-public branches (`ai`, `draft`, `fixed`, `in_review`, `rejected`) are only visible to members of the provider's owning organization.",
|
|
2065
2066
|
inputSchema: toZod({
|
|
2066
2067
|
"type": "object",
|
|
2067
2068
|
"properties": {
|
|
@@ -2210,7 +2211,7 @@ export const MCP_TOOLS = {
|
|
|
2210
2211
|
}),
|
|
2211
2212
|
},
|
|
2212
2213
|
"Providers": {
|
|
2213
|
-
description: "Search providers\n\nSearch
|
|
2214
|
+
description: "Search providers\n\nSearch Reclaim providers by domain or data point. A provider is the recipe an end-user follows to prove something about themselves, such as \"I have N followers on Twitter\".\nCall this BEFORE `create_provider` — most popular domains already have a public provider you can reuse, and creating another one just stacks duplicates.\nReturns a paginated list of the providers the caller can see: public providers to everyone, private providers only to members of the owning organization.",
|
|
2214
2215
|
inputSchema: toZod({
|
|
2215
2216
|
"type": "object",
|
|
2216
2217
|
"properties": {
|
|
@@ -2567,7 +2568,7 @@ export const MCP_TOOLS = {
|
|
|
2567
2568
|
"properties": {
|
|
2568
2569
|
"notes": {
|
|
2569
2570
|
"type": "string",
|
|
2570
|
-
"description": "Optional note from the author to reviewers (changelog, areas to focus on,
|
|
2571
|
+
"description": "Optional note from the author to reviewers (changelog, areas to focus on, and so on).",
|
|
2571
2572
|
"maxLength": 10000
|
|
2572
2573
|
}
|
|
2573
2574
|
}
|
|
@@ -2724,6 +2725,13 @@ export const MCP_TOOLS = {
|
|
|
2724
2725
|
"minLength": 1,
|
|
2725
2726
|
"maxLength": 200
|
|
2726
2727
|
},
|
|
2728
|
+
"region": {
|
|
2729
|
+
"type": "string",
|
|
2730
|
+
"nullable": true,
|
|
2731
|
+
"description": "Confirm or override the provider's region. Send `null` to clear it so the provider applies to every region. See `Provider.region`.",
|
|
2732
|
+
"pattern": "^[a-z]{2}(-[a-z]{2})?$",
|
|
2733
|
+
"maxLength": 5
|
|
2734
|
+
},
|
|
2727
2735
|
"title": {
|
|
2728
2736
|
"type": "string",
|
|
2729
2737
|
"minLength": 1,
|
|
@@ -2776,12 +2784,12 @@ export const MCP_TOOLS = {
|
|
|
2776
2784
|
"brandUrl": {
|
|
2777
2785
|
"type": "string",
|
|
2778
2786
|
"format": "uri",
|
|
2779
|
-
"description": "Canonical homepage of the brand (
|
|
2787
|
+
"description": "Canonical homepage of the brand (for example, `https://google.com`). Used in brand-link cards and JSON-LD.",
|
|
2780
2788
|
"maxLength": 2000
|
|
2781
2789
|
},
|
|
2782
2790
|
"primaryDataPoint": {
|
|
2783
2791
|
"type": "string",
|
|
2784
|
-
"description": "Headline data point — the single most-important variable this provider can verify (
|
|
2792
|
+
"description": "Headline data point — the single most-important variable this provider can verify (for example, `subscriber count`). Used in the provider's SEO title.",
|
|
2785
2793
|
"maxLength": 200
|
|
2786
2794
|
},
|
|
2787
2795
|
"dataPoints": {
|
|
@@ -2817,7 +2825,7 @@ export const MCP_TOOLS = {
|
|
|
2817
2825
|
}),
|
|
2818
2826
|
},
|
|
2819
2827
|
"UpdateProviderVersion": {
|
|
2820
|
-
description: "Update a provider version\n\nMutable only while the version is on the `draft` or `rejected` branch. Versions on `in_review
|
|
2828
|
+
description: "Update a provider version\n\nMutable only while the version is on the `draft` or `rejected` branch. Versions on `fixed`, `in_review`, or the live channel reject all writes here. Caller must be a member of the provider's owning organization. Supports optimistic concurrency via `If-Match`.",
|
|
2821
2829
|
inputSchema: toZod({
|
|
2822
2830
|
"type": "object",
|
|
2823
2831
|
"properties": {
|
|
@@ -2857,7 +2865,7 @@ export const MCP_TOOLS = {
|
|
|
2857
2865
|
"body": {
|
|
2858
2866
|
"type": "object",
|
|
2859
2867
|
"additionalProperties": false,
|
|
2860
|
-
"description": "Partial update of a provider version. Mutable only while the version is on the `draft` or `rejected` branch; versions on `in_review
|
|
2868
|
+
"description": "Partial update of a provider version. Mutable only while the version is on the `draft` or `rejected` branch; versions on `fixed`, `in_review`, or the live channel reject all writes here. The semver does not change on update — `build_number` increments instead, giving callers a monotonic revision counter without touching the (major, minor, patch) PK. `verificationType` and `prompt` may be updated; omit either to carry the prior build's value forward.",
|
|
2861
2869
|
"properties": {
|
|
2862
2870
|
"initialUrl": {
|
|
2863
2871
|
"type": "string",
|
|
@@ -2996,7 +3004,7 @@ export const MCP_TOOLS = {
|
|
|
2996
3004
|
"items": {
|
|
2997
3005
|
"type": "object",
|
|
2998
3006
|
"additionalProperties": false,
|
|
2999
|
-
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (
|
|
3007
|
+
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (that is, \"HTTP/1.1 200 OK\")",
|
|
3000
3008
|
"properties": {
|
|
3001
3009
|
"xPath": {
|
|
3002
3010
|
"type": "string",
|
|
@@ -3004,7 +3012,7 @@ export const MCP_TOOLS = {
|
|
|
3004
3012
|
},
|
|
3005
3013
|
"jsonPath": {
|
|
3006
3014
|
"type": "string",
|
|
3007
|
-
"description": "expect a JSON response, retrieve the item at this path using dot notation for
|
|
3015
|
+
"description": "expect a JSON response, retrieve the item at this path using dot notation, for example 'email.addresses.0'."
|
|
3008
3016
|
},
|
|
3009
3017
|
"regex": {
|
|
3010
3018
|
"type": "string",
|
|
@@ -3146,7 +3154,7 @@ export const MCP_TOOLS = {
|
|
|
3146
3154
|
"items": {
|
|
3147
3155
|
"type": "object",
|
|
3148
3156
|
"additionalProperties": false,
|
|
3149
|
-
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (
|
|
3157
|
+
"description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (that is, \"HTTP/1.1 200 OK\")",
|
|
3150
3158
|
"properties": {
|
|
3151
3159
|
"xPath": {
|
|
3152
3160
|
"type": "string",
|
|
@@ -3154,7 +3162,7 @@ export const MCP_TOOLS = {
|
|
|
3154
3162
|
},
|
|
3155
3163
|
"jsonPath": {
|
|
3156
3164
|
"type": "string",
|
|
3157
|
-
"description": "expect a JSON response, retrieve the item at this path using dot notation for
|
|
3165
|
+
"description": "expect a JSON response, retrieve the item at this path using dot notation, for example 'email.addresses.0'."
|
|
3158
3166
|
},
|
|
3159
3167
|
"regex": {
|
|
3160
3168
|
"type": "string",
|
|
@@ -3211,8 +3219,8 @@ export const MCP_TOOLS = {
|
|
|
3211
3219
|
"properties": {
|
|
3212
3220
|
"geoLocation": {
|
|
3213
3221
|
"type": "string",
|
|
3214
|
-
"description": "Geographic location
|
|
3215
|
-
"maxLength":
|
|
3222
|
+
"description": "Geographic location the verification should appear to originate from: a 2-letter ISO country code, or a parameter the attestor resolves at proof time. `{{DYNAMIC_GEO}}` and `{{DYNAMIC_GEO_SECRET}}` are the Verification Client's standard names for the end-user's own country — the `_SECRET` one is delivered as a secret param, so the attestor never learns which country the proof egressed from.",
|
|
3223
|
+
"maxLength": 64,
|
|
3216
3224
|
"default": "{{DYNAMIC_GEO}}"
|
|
3217
3225
|
},
|
|
3218
3226
|
"clientOptions": {
|
package/lib/mcp/api/to-zod.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { JSONSchema } from 'zod/v4/core';
|
|
|
5
5
|
*
|
|
6
6
|
* The generator (`packages/app/scripts/mcp-tools-gen.ts`) inlines `$ref`s it
|
|
7
7
|
* walks through `properties`/`items`, but it does NOT recurse into `allOf` /
|
|
8
|
-
* `anyOf` / `oneOf`. So a schema composed with `allOf` (
|
|
8
|
+
* `anyOf` / `oneOf`. So a schema composed with `allOf` (for example,
|
|
9
9
|
* `RequestSelectionTemplate =
|
|
10
10
|
* allOf[ RequestSelection, { multiple, required } ]`,
|
|
11
11
|
* surfaced by the proof tools' `allowedJsRequests`) can carry a dangling
|
package/lib/mcp/api/to-zod.js
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
*
|
|
5
5
|
* The generator (`packages/app/scripts/mcp-tools-gen.ts`) inlines `$ref`s it
|
|
6
6
|
* walks through `properties`/`items`, but it does NOT recurse into `allOf` /
|
|
7
|
-
* `anyOf` / `oneOf`. So a schema composed with `allOf` (
|
|
7
|
+
* `anyOf` / `oneOf`. So a schema composed with `allOf` (for example,
|
|
8
8
|
* `RequestSelectionTemplate =
|
|
9
9
|
* allOf[ RequestSelection, { multiple, required } ]`,
|
|
10
10
|
* surfaced by the proof tools' `allowedJsRequests`) can carry a dangling
|
package/lib/mcp/api/tools.js
CHANGED
|
@@ -2,7 +2,7 @@ import { remapErrorAsResponse } from "../remap_errors.js";
|
|
|
2
2
|
import { MCP_TOOLS } from "./operations.gen.js";
|
|
3
3
|
/**
|
|
4
4
|
* The generated `MCP_TOOLS` are keyed by OpenAPI `operationId` (PascalCase,
|
|
5
|
-
*
|
|
5
|
+
* For example, `GetMe`). MCP tools are conventionally snake_case, matching the
|
|
6
6
|
* hand-written tools in this server. Convert the public tool name here while
|
|
7
7
|
* still dispatching to the API with the original operationId — doing this in
|
|
8
8
|
* the (non-generated) registration keeps it from being reverted on regen.
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
export declare const BUILDER_MODE_INSTRUCTIONS: string;
|
|
2
|
-
export declare const
|
|
3
|
-
export
|
|
2
|
+
export declare const OLD_MODE_INSTRUCTIONS: string;
|
|
3
|
+
export interface Guide {
|
|
4
|
+
/** Topic name → its markdown, in document order. */
|
|
5
|
+
topics: Map<string, string>;
|
|
6
|
+
/** `{ topic, summary }` for every topic this mode has. */
|
|
7
|
+
index: Array<{
|
|
8
|
+
topic: string;
|
|
9
|
+
summary: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** Every topic concatenated — the whole guide, as it used to be served. */
|
|
12
|
+
full: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const GUIDE_BUILDER: Guide;
|
|
15
|
+
export declare const GUIDE_OLD: Guide;
|
|
16
|
+
export declare function guideFor(oldMode: boolean): Guide;
|