@reclaimprotocol/agent 0.1.33 → 0.1.35

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.
Files changed (117) hide show
  1. package/README.md +3 -3
  2. package/lib/authoring/backend.d.ts +13 -0
  3. package/lib/authoring/index.d.ts +1 -1
  4. package/lib/authoring/tools.js +78 -42
  5. package/lib/config/store.d.ts +10 -0
  6. package/lib/mcp/api/operations.gen.d.ts +238 -4
  7. package/lib/mcp/api/operations.gen.js +6967 -672
  8. package/lib/mcp/api/tools.js +21 -8
  9. package/lib/mcp/instructions.js +12 -12
  10. package/lib/mcp/server.d.ts +1 -1
  11. package/lib/mcp/server.js +3 -0
  12. package/lib/mcp/start.js +8 -7
  13. package/lib/mcp/success-response.js +5 -1
  14. package/lib/mcp/tools/agent/analyze.js +5 -4
  15. package/lib/mcp/tools/agent/attach.js +11 -7
  16. package/lib/mcp/tools/agent/build.js +5 -1
  17. package/lib/mcp/tools/agent/capture.d.ts +2 -2
  18. package/lib/mcp/tools/agent/capture.js +15 -11
  19. package/lib/mcp/tools/agent/check-attestor.d.ts +5 -0
  20. package/lib/mcp/tools/agent/check-attestor.js +37 -0
  21. package/lib/mcp/tools/agent/eval.js +4 -3
  22. package/lib/mcp/tools/agent/find.js +9 -10
  23. package/lib/mcp/tools/agent/how-it-works.js +1 -0
  24. package/lib/mcp/tools/agent/live-view.js +49 -22
  25. package/lib/mcp/tools/agent/pod-proof.js +7 -11
  26. package/lib/mcp/tools/agent/proof.d.ts +12 -0
  27. package/lib/mcp/tools/agent/proof.js +32 -0
  28. package/lib/mcp/tools/agent/propose.js +4 -3
  29. package/lib/mcp/tools/agent/publish.d.ts +2 -1
  30. package/lib/mcp/tools/agent/publish.js +12 -6
  31. package/lib/mcp/tools/agent/replay.js +10 -7
  32. package/lib/mcp/tools/agent/session.js +16 -8
  33. package/lib/mcp/tools/agent/shared.d.ts +2 -1
  34. package/lib/mcp/tools/agent/shared.js +29 -24
  35. package/lib/mcp/tools/agent/start-integration.d.ts +15 -0
  36. package/lib/mcp/tools/agent/start-integration.js +62 -0
  37. package/lib/mcp/tools/authenticate/authenticate.js +9 -11
  38. package/lib/mcp/tools/authenticate/build.js +2 -0
  39. package/lib/mcp/tools/authenticate/builder-access.js +1 -0
  40. package/lib/mcp/tools/authenticate/eth-key.d.ts +8 -0
  41. package/lib/mcp/tools/authenticate/eth-key.js +27 -15
  42. package/lib/mcp/tools/authenticate/import.js +18 -31
  43. package/lib/mcp/tools/authenticate/issue-org-token.d.ts +8 -0
  44. package/lib/mcp/tools/authenticate/issue-org-token.js +60 -0
  45. package/lib/mcp/tools/authenticate/issue.js +9 -9
  46. package/lib/mcp/tools/authenticate/org-key-store.d.ts +10 -0
  47. package/lib/mcp/tools/authenticate/org-key-store.js +23 -0
  48. package/lib/mcp/tools/authenticate/resolve-owner-key.js +10 -12
  49. package/lib/mcp/tools/mode/mode.js +2 -0
  50. package/lib/mcp/tools/verification/build.d.ts +3 -1
  51. package/lib/mcp/tools/verification/build.js +10 -2
  52. package/lib/mcp/tools/verification/callback-listener.d.ts +51 -0
  53. package/lib/mcp/tools/verification/callback-listener.js +163 -0
  54. package/lib/mcp/tools/verification/index.d.ts +2 -0
  55. package/lib/mcp/tools/verification/index.js +2 -0
  56. package/lib/mcp/tools/verification/proxy-callback-events.d.ts +59 -0
  57. package/lib/mcp/tools/verification/proxy-callback-events.js +300 -0
  58. package/lib/mcp/tools/verification/read-callback-events.d.ts +3 -0
  59. package/lib/mcp/tools/verification/read-callback-events.js +135 -0
  60. package/lib/mcp/tools/verification/result.d.ts +6 -0
  61. package/lib/mcp/tools/verification/result.js +11 -8
  62. package/lib/proof/check-attestor.d.ts +67 -0
  63. package/lib/proof/check-attestor.js +156 -0
  64. package/lib/tools/registry.d.ts +12 -0
  65. package/lib/tools/registry.js +1 -0
  66. package/package.json +2 -2
  67. package/skill/SKILL.builder.md +84 -75
  68. package/skill/SKILL.common.md +23 -10
  69. package/skill/builder-mode.md +140 -138
  70. package/skill/start-integration.md +74 -0
  71. package/skill/user-script.md +64 -0
  72. package/skill/verification-client-integration.md +40 -28
  73. package/src/authoring/backend.ts +15 -0
  74. package/src/authoring/index.ts +2 -0
  75. package/src/authoring/tools.ts +86 -42
  76. package/src/config/store.ts +11 -0
  77. package/src/mcp/api/operations.gen.ts +7011 -704
  78. package/src/mcp/api/tools.ts +21 -8
  79. package/src/mcp/instructions.ts +12 -12
  80. package/src/mcp/server.ts +4 -0
  81. package/src/mcp/start.ts +9 -7
  82. package/src/mcp/success-response.ts +5 -1
  83. package/src/mcp/tools/agent/analyze.ts +5 -4
  84. package/src/mcp/tools/agent/attach.ts +11 -7
  85. package/src/mcp/tools/agent/build.ts +7 -1
  86. package/src/mcp/tools/agent/capture.ts +20 -12
  87. package/src/mcp/tools/agent/check-attestor.ts +49 -0
  88. package/src/mcp/tools/agent/eval.ts +4 -3
  89. package/src/mcp/tools/agent/find.ts +9 -10
  90. package/src/mcp/tools/agent/how-it-works.ts +1 -0
  91. package/src/mcp/tools/agent/live-view.ts +49 -22
  92. package/src/mcp/tools/agent/pod-proof.ts +7 -11
  93. package/src/mcp/tools/agent/proof.ts +55 -0
  94. package/src/mcp/tools/agent/propose.ts +4 -3
  95. package/src/mcp/tools/agent/publish.ts +12 -4
  96. package/src/mcp/tools/agent/replay.ts +10 -7
  97. package/src/mcp/tools/agent/session.ts +16 -8
  98. package/src/mcp/tools/agent/shared.ts +39 -24
  99. package/src/mcp/tools/agent/start-integration.ts +84 -0
  100. package/src/mcp/tools/authenticate/authenticate.ts +9 -11
  101. package/src/mcp/tools/authenticate/build.ts +2 -0
  102. package/src/mcp/tools/authenticate/builder-access.ts +1 -0
  103. package/src/mcp/tools/authenticate/eth-key.ts +48 -18
  104. package/src/mcp/tools/authenticate/import.ts +21 -36
  105. package/src/mcp/tools/authenticate/issue-org-token.ts +84 -0
  106. package/src/mcp/tools/authenticate/issue.ts +9 -9
  107. package/src/mcp/tools/authenticate/org-key-store.ts +25 -0
  108. package/src/mcp/tools/authenticate/resolve-owner-key.ts +10 -12
  109. package/src/mcp/tools/mode/mode.ts +2 -0
  110. package/src/mcp/tools/verification/build.ts +10 -2
  111. package/src/mcp/tools/verification/callback-listener.ts +203 -0
  112. package/src/mcp/tools/verification/index.ts +2 -0
  113. package/src/mcp/tools/verification/proxy-callback-events.ts +374 -0
  114. package/src/mcp/tools/verification/read-callback-events.ts +160 -0
  115. package/src/mcp/tools/verification/result.ts +11 -8
  116. package/src/proof/check-attestor.ts +209 -0
  117. package/src/tools/registry.ts +14 -0
package/README.md CHANGED
@@ -25,7 +25,7 @@ This package **is** the Reclaim MCP server (bin: `reclaim-mcp-server`). It depen
25
25
  - **Node 20 or later.** Any line works, including non-LTS ones such as 25, but a current LTS line (22 or 24) is recommended.
26
26
  - **A local Chrome, Chromium, or Edge**, used for capture and for the dashboard login.
27
27
  - **Docker** — only for `attach_browser`'s `container` mode, which runs the Reclaim browser runtime (the same image the hosted browser uses) and gives you a link you can send to whoever holds the account. It is the free way to get that link; the hosted remote browser is the other, and it is chargeable. Not needed if you are doing the work yourself. The image is amd64, so Apple Silicon runs it translated. OrbStack handles that itself; Docker Desktop needs Rosetta enabled. `RECLAIM_BROWSER_RUNTIME_IMAGE` overrides the pinned digest.
28
- - **`cloudflared`** — only to share a `container` browser with someone remote. The MCP server does not run or install it: `share_browser_view` returns the command, and the agent runs `cloudflared tunnel --url http://localhost:<port>` itself, so install it yourself first.
28
+ - **`cloudflared`** — only to share a `container` browser with someone remote. The MCP server does not run or install it: `share_browser_view` returns the command, and the developer chooses to run `cloudflared tunnel --url http://localhost:<port>` themselves (recommended) or approve the agent running it. Install it first.
29
29
 
30
30
  The first time you call `run_proof`, the agent downloads the ZK circuit files it needs (about 280 MB), so allow a moment for that first proof. The download is deferred to the first proof rather than run at install time, so the MCP server itself starts immediately.
31
31
 
@@ -120,7 +120,7 @@ These capture/synthesis/proof tools are backend-independent and registered in bo
120
120
  | `create_provider_version_from_capture` | Publish a draft as a new immutable semantic version (patch by default) |
121
121
  | `authenticate_builder` | In old-devtools mode only, sign in to Builder for remote-browser allocation |
122
122
  | `list_builder_organizations` | In old-devtools mode only, list organization ids for a quota-accounted Builder browser |
123
- | `share_browser_view` | Share the `container` browser's own live view with someone elsewhere. Returns the local viewer port and the `cloudflared tunnel` command for the agent to run; call it again with the printed `https://*.trycloudflare.com` URL as `publicUrl` to get the link to relay. Container mode only: a `builder` browser already returns a hosted `liveViewUrl`, and a plain local browser has no view to share |
123
+ | `share_browser_view` | Share the `container` browser's own live view with someone elsewhere. Returns the local viewer port and the `cloudflared tunnel` command; the developer runs it or approves the agent running it; call it again with the printed `https://*.trycloudflare.com` URL as `publicUrl` to get the link to relay. Container mode only: a `builder` browser already returns a hosted `liveViewUrl`, and a plain local browser has no view to share |
124
124
  | `dispose_browser` | Stop captures, disconnect CDP, and immediately release a Builder-hosted browser |
125
125
  | `get_session`, `reset_session` | Session state |
126
126
 
@@ -134,7 +134,7 @@ The MCP server targets one of two backends. An explicit `USE_OLD_DEVTOOLS` setti
134
134
  - `get_me_providers` — list the providers you own (the only provider-listing tool in this mode).
135
135
  - `session_analytics_logs` — the milestone events for a verification session, which show how far it got.
136
136
  - `session_logs` — the log entries the in-app SDK emitted during that session, each with its event type, log level, and logger name. Filter by event type, level, or substring, page with `limit` and `offset`, or set `saveTo` to write every matching entry to an NDJSON file. The backend searches only the last 3 days unless you pass `startTime` and `endTime`, and it deletes entries after 30 days.
137
- - **Builder (default).** Registers the auto-generated HTTP-API tools, including `create_org`, `issue_org_token`, and `create_org_callback_subscription`, plus authentication/credential tools and `get_verification_result`. `issue_credentials` creates a local proof-owner key; `issue_org_token` issues the organization's API secret.
137
+ - **Builder (default).** Registers the auto-generated HTTP-API tools, including `create_org`, `issue_org_token`, and `create_org_callback_subscription`, plus authentication/credential tools, `get_verification_result`, `read_callback_events` (read the org's pull-listener events), `proxy_callback_events` (forward them to a localhost callback route; the pull listener lives only while the MCP server runs), and `check_attestor`. `issue_credentials` creates a local proof-owner key; `issue_org_token` issues the organization's API secret.
138
138
 
139
139
  Relevant env vars: `RECLAIM_OLD_API_URL` (default `https://devapi.reclaimprotocol.org`), `RECLAIM_OLD_API_TOKEN` / `RECLAIM_OLD_ETH_UID` (headless identity), `RECLAIM_OLD_LOGIN_URL` (default `https://dev.reclaimprotocol.org`); builder mode uses `RECLAIM_API_URL` / `RECLAIM_API_TOKEN`.
140
140
 
@@ -21,6 +21,16 @@ export interface Draft {
21
21
  * validate each against its own selector. */
22
22
  extractions: Extraction[];
23
23
  }
24
+ /** A navigation script installed for every later page load of the authoring
25
+ * session. `identifier` is the CDP registration, so it can be removed. */
26
+ export interface KeptScript {
27
+ script: string;
28
+ identifier?: string;
29
+ }
30
+ /** Holds the session's kept script, replaced by each `keep` call. */
31
+ export interface KeptScriptRef {
32
+ keptScript?: KeptScript;
33
+ }
24
34
  /** Per-session draft store: `propose` puts, `replay`/`run_proof` get by id. */
25
35
  export interface DraftStore {
26
36
  put(draft: Draft): string;
@@ -46,6 +56,9 @@ export interface AuthoringBackend {
46
56
  * out. Cloud authoring enables this; local MCP keeps its existing
47
57
  * behavior. */
48
58
  readonly readOnlyPageEval?: boolean;
59
+ /** Where `test_user_script` keeps its script. Absent for hosts that do not
60
+ * publish it (the cloud loop synthesizes its own navigation script). */
61
+ readonly kept?: KeptScriptRef;
49
62
  /** Send a raw CDP command scoped to this session's page. */
50
63
  sendCdp(method: string, params?: Record<string, unknown>): Promise<unknown>;
51
64
  /** Resolve once `method` (a CDP event) fires on this session's page, or
@@ -1,4 +1,4 @@
1
- export type { AuthoringBackend, Draft, DraftStore, ProveOptions, SecretParams, } from './backend.ts';
1
+ export type { AuthoringBackend, Draft, DraftStore, KeptScript, KeptScriptRef, ProveOptions, SecretParams, } from './backend.ts';
2
2
  export { makeDraftStore } from './backend.ts';
3
3
  export { authoringTools } from './tools.ts';
4
4
  export { defineTool, errorAsToolText, extendTool, type RegisteredTool, type ToolDefinition, } from '../tools/registry.ts';
@@ -14,6 +14,7 @@
14
14
  * draft (recipe + secrets) is held server-side; the model only sees an opaque
15
15
  * `draftId` and the secret-free provider.
16
16
  */
17
+ import assert from 'node:assert';
17
18
  import { findTool } from "../mcp/tools/agent/find.js";
18
19
  import { proposeTool } from "../mcp/tools/agent/propose.js";
19
20
  import { replayTool } from "../mcp/tools/agent/replay.js";
@@ -80,10 +81,12 @@ export function authoringTools(resolveBackend) {
80
81
  return [
81
82
  defineTool({
82
83
  name: 'navigate',
83
- description: 'Navigate the captured tab to a URL and wait for its load event. '
84
- + 'Returns the URL the tab actually landed on, so you can detect a '
85
- + 'redirect to a login page.',
84
+ description: 'Navigates the captured tab to a URL and waits for its load event. '
85
+ + 'Returns the URL the tab landed on, to detect a redirect to a '
86
+ + 'sign-in page. Any navigation script kept by `test_user_script` '
87
+ + 'runs on the page.',
86
88
  inputSchema: objectSchema({ url: { type: 'string' }, timeoutMs: { type: 'number' } }, ['url']),
89
+ annotations: { openWorldHint: true, destructiveHint: false },
87
90
  }, async (args) => {
88
91
  const backend = resolveBackend(args);
89
92
  const timeoutMs = Number(args.timeoutMs) || 30000;
@@ -100,19 +103,24 @@ export function authoringTools(resolveBackend) {
100
103
  }),
101
104
  defineTool({
102
105
  name: 'eval_in_page',
103
- description: 'Evaluate a JavaScript expression in the page and return its value. '
104
- + 'Use it to read the value being proven out of the DOM, to check '
105
- + 'login state, or to trigger the target request (for example, '
106
- + '`location.reload()`).',
106
+ description: 'Evaluates a JavaScript expression in the page of the remote '
107
+ + 'authoring browser, not on this machine, and returns its value. '
108
+ + 'Use it to read a data point from the DOM, check sign-in state, '
109
+ + 'or trigger the target request (for example, `location.reload()`). '
110
+ + 'The page cannot reach files or processes on this machine. Return '
111
+ + 'only the values you need, never cookies or tokens.',
107
112
  inputSchema: objectSchema({ expression: { type: 'string' } }, ['expression']),
113
+ annotations: { openWorldHint: true, destructiveHint: false },
108
114
  }, (args) => evalInPage(resolveBackend(args), String(args.expression))),
109
115
  defineTool({
110
116
  name: 'wait_for_page',
111
- description: 'Poll a JavaScript expression once a second until it is truthy or '
112
- + 'the timeout elapses. Use it to wait for content to appear. To '
113
- + 'wait for a login, use wait_for_login instead — page JavaScript '
114
- + 'cannot see the httpOnly session cookie.',
117
+ description: 'Evaluates a JavaScript expression in the remote authoring browser '
118
+ + 'once a second until it is truthy or the timeout elapses. Returns '
119
+ + '{ ready }. Use it to wait for content to appear. To wait for a '
120
+ + 'sign-in, use `wait_for_login`: page JavaScript cannot see the '
121
+ + 'httpOnly session cookie.',
115
122
  inputSchema: objectSchema({ expression: { type: 'string' }, timeoutMs: { type: 'number' } }, ['expression']),
123
+ annotations: { readOnlyHint: true, openWorldHint: true },
116
124
  }, async (args) => {
117
125
  const backend = resolveBackend(args);
118
126
  const expr = String(args.expression);
@@ -128,24 +136,30 @@ export function authoringTools(resolveBackend) {
128
136
  }),
129
137
  defineTool({
130
138
  name: 'test_user_script',
131
- description: 'Dry-run a USER SCRIPT (the `jsUserScripts` / `customInjection` '
132
- + 'field) in the LIVE attached tab while authoring or after provider '
133
- + 'creation. Installs '
134
- + '`script` via CDP so it runs on the next navigation exactly as '
135
- + 'the real field would, then reports whether it ran and what it '
136
- + 'threw. With `navigateUrl`, it navigates there and removes the '
137
- + 'script once the result is read — self-cleaning, safe to repeat. '
138
- + 'WITHOUT `navigateUrl` the script stays installed (navigate '
139
- + 'yourself, then re-call this tool or read '
140
- + '`window.__reclaimUserScriptResult` via eval_in_page) and keeps '
141
- + 'running on every later navigation until a call WITH '
142
- + '`navigateUrl` removes it — so don\'t stack manual-mode calls. '
143
- + 'Guide: how_it_works({ topic: "user-script" }).',
139
+ description: 'Installs a navigation script (the `jsUserScripts` field) in the '
140
+ + 'remote authoring browser, not on this machine, so it runs before '
141
+ + 'each page load, as it does at verification. Reports whether it '
142
+ + 'ran and what it threw. With `navigateUrl`, navigates there and '
143
+ + 'removes the script after reading the result, unless `keep` is '
144
+ + 'true. Without `navigateUrl`, the script stays installed for '
145
+ + 'later navigations until a call with `navigateUrl` removes it. '
146
+ + 'With `keep: true`, the script stays installed for every later '
147
+ + 'navigation in this session, replaces any earlier kept script, and '
148
+ + '`create_provider_version_from_capture` publishes it as '
149
+ + '`jsUserScripts` unless that call passes its own. '
150
+ + 'See how_it_works({ topic: "user-script" }).',
144
151
  inputSchema: objectSchema({
145
152
  script: { type: 'string' },
146
153
  navigateUrl: { type: 'string' },
147
154
  timeoutMs: { type: 'number' },
155
+ keep: {
156
+ type: 'boolean',
157
+ description: 'Keep the script installed for every later navigation in '
158
+ + 'this session and use it as the published navigation '
159
+ + 'script.',
160
+ },
148
161
  }, ['script']),
162
+ annotations: { openWorldHint: true, destructiveHint: false },
149
163
  }, async (args) => {
150
164
  const backend = resolveBackend(args);
151
165
  const script = String(args.script);
@@ -169,10 +183,27 @@ export function authoringTools(resolveBackend) {
169
183
  );
170
184
  }
171
185
  `;
186
+ const keep = args.keep === true;
187
+ const kept = keep ? backend.kept : undefined;
188
+ assert(!keep || kept, new Error('This host does not support `keep`.'));
189
+ // Replace, never stack: only one kept script runs.
190
+ const previous = kept?.keptScript?.identifier;
191
+ if (previous) {
192
+ await backend.sendCdp('Page.removeScriptToEvaluateOnNewDocument', { identifier: previous }).catch(() => { });
193
+ }
172
194
  const installed = (await backend.sendCdp('Page.addScriptToEvaluateOnNewDocument', { source: wrapped }));
195
+ if (kept) {
196
+ kept.keptScript = {
197
+ script,
198
+ ...(installed.identifier
199
+ ? { identifier: installed.identifier }
200
+ : {}),
201
+ };
202
+ }
173
203
  if (typeof args.navigateUrl !== 'string') {
174
204
  return {
175
205
  installed: true,
206
+ ...(keep ? { kept: true } : {}),
176
207
  note: 'Installed for the NEXT navigation only — it did not run on '
177
208
  + 'the current page, and stays installed (runs on every later '
178
209
  + 'navigation too) until a follow-up call with navigateUrl '
@@ -198,6 +229,7 @@ export function authoringTools(resolveBackend) {
198
229
  const result = value;
199
230
  return {
200
231
  installed: true,
232
+ ...(keep ? { kept: true } : {}),
201
233
  navigated: true,
202
234
  ran: result?.ran ?? false,
203
235
  errors: result?.errors ?? [],
@@ -206,20 +238,21 @@ export function authoringTools(resolveBackend) {
206
238
  finally {
207
239
  // One-shot test: remove it so it doesn't keep running (and
208
240
  // potentially redirecting the tab) on every later navigation.
209
- if (installed.identifier) {
241
+ if (installed.identifier && !keep) {
210
242
  await backend.sendCdp('Page.removeScriptToEvaluateOnNewDocument', { identifier: installed.identifier });
211
243
  }
212
244
  }
213
245
  }),
214
246
  defineTool({
215
247
  name: 'get_cookies',
216
- description: 'List the NAMES of cookies currently set for the page (values are '
217
- + 'NEVER returned). The most reliable, language- and DOM-independent '
218
- + 'login signal: after the user logs in, an auth/session cookie '
219
- + 'appears (for example, session, sid, token, auth, jwt, _user, '
220
- + 'logged_in). '
221
- + 'Includes httpOnly cookies the page JS cannot see.',
248
+ description: 'Returns the names, domains, and flags of the cookies set in the '
249
+ + 'remote authoring browser. Values are never returned; they stay '
250
+ + 'in the browser and on the server. A new auth or session cookie '
251
+ + '(for example, session, sid, auth, jwt) is a reliable sign-in '
252
+ + 'signal that does not depend on the page language or DOM. '
253
+ + 'Includes httpOnly cookies that page JavaScript cannot see.',
222
254
  inputSchema: objectSchema({}),
255
+ annotations: { readOnlyHint: true, openWorldHint: true },
223
256
  }, async (args) => {
224
257
  const backend = resolveBackend(args);
225
258
  const res = (await backend.sendCdp('Network.getCookies'));
@@ -243,6 +276,7 @@ export function authoringTools(resolveBackend) {
243
276
  + 'navigating to the login page. Does NOT navigate (never yanks '
244
277
  + 'the user off login/2FA). Returns { loggedIn, newCookies }.',
245
278
  inputSchema: objectSchema({ timeoutMs: { type: 'number' } }),
279
+ annotations: { readOnlyHint: true, openWorldHint: true },
246
280
  }, async (args) => {
247
281
  const backend = resolveBackend(args);
248
282
  const deadline = Date.now() + (Number(args.timeoutMs) || 180000);
@@ -299,9 +333,10 @@ export function authoringTools(resolveBackend) {
299
333
  }),
300
334
  defineTool({
301
335
  name: 'list_requests',
302
- description: 'List captured network requests (method/url/status/size), newest '
303
- + 'last. Optionally filter by method / urlGlob / status range / '
304
- + 'contentType / graphqlOp. Metadata only — secrets never included.',
336
+ description: 'Lists captured network requests (method, URL, status, size), '
337
+ + 'newest last. Filter by method, urlGlob, status range, '
338
+ + 'contentType, or graphqlOp. Returns metadata only, never '
339
+ + 'secrets.',
305
340
  inputSchema: objectSchema({
306
341
  filter: {
307
342
  type: 'object',
@@ -315,6 +350,7 @@ export function authoringTools(resolveBackend) {
315
350
  },
316
351
  },
317
352
  }),
353
+ annotations: { readOnlyHint: true, openWorldHint: false },
318
354
  }, async (args) => {
319
355
  const backend = resolveBackend(args);
320
356
  const filter = (args.filter ?? {});
@@ -327,15 +363,15 @@ export function authoringTools(resolveBackend) {
327
363
  replayTool(resolveBackend),
328
364
  defineTool({
329
365
  name: 'run_proof',
330
- description: 'Prove the drafted recipe (zkTLS). Only call after replay_request '
331
- + 'looks right. Returns the proof result. NOTE: unlike '
332
- + 'replay_request (which re-issues from inside the live attached '
333
- + 'browser tab), the ATTESTOR calls the target from its OWN '
334
- + 'network/IP, separate from the browser\'s. A request that '
335
- + 'replayed fine can still fail here for geo/IP-bound content '
336
- + '(country-locked pages, IP-allowlisted APIs) — if that happens, '
337
- + 'it\'s a property of the site, not a bug in the draft.',
366
+ description: 'Proves the drafted recipe (zkTLS). Call it after `replay_request` '
367
+ + 'looks right. Returns the proof result. Unlike `replay_request`, '
368
+ + 'which re-sends from inside the attached browser tab, the '
369
+ + 'attestor calls the target from its own network and IP. A request '
370
+ + 'that replayed can still fail here for geo- or IP-bound content '
371
+ + '(country-locked pages, IP-allowlisted APIs); that is a property '
372
+ + 'of the site, not a bug in the draft.',
338
373
  inputSchema: objectSchema({ draftId: { type: 'string' } }, ['draftId']),
374
+ annotations: { openWorldHint: true, destructiveHint: false },
339
375
  },
340
376
  // The backend shapes its own result: the cloud returns a lean,
341
377
  // secret-free summary (and records the proven recipe for publish); the
@@ -16,6 +16,8 @@ export interface ReclaimAgentConfig {
16
16
  * - `old_devtools` — externally-supplied identity for OLD-devtools mode
17
17
  * (USE_OLD_DEVTOOLS); independent of `session`'s
18
18
  * builder token. Deletable with the rest of `src/old/`.
19
+ * - `org_keys` — organization API keys saved by `issue_org_token`, so
20
+ * the org-key tools work without the key in a transcript
19
21
  * Sections are persisted independently via `ConfigStore.write`, which
20
22
  * merges rather than replaces, so one subsystem never clobbers another's.
21
23
  *
@@ -29,6 +31,14 @@ export interface ReclaimConfig {
29
31
  browser_agent?: ReclaimAgentConfig;
30
32
  session?: CachedSession;
31
33
  old_devtools?: OldIdentity;
34
+ org_keys?: SavedOrgKeys;
35
+ }
36
+ /** Organization API keys (`rorg_…`) saved by `issue_org_token`. */
37
+ export interface SavedOrgKeys {
38
+ /** Key by organization ID. */
39
+ byOrg: Record<string, string>;
40
+ /** The organization whose key was saved last. */
41
+ recent?: string;
32
42
  }
33
43
  /** Which backend the MCP server targets. See `resolveOldMode` in consts.ts. */
34
44
  export type DevtoolsMode = 'old' | 'builder';