@reclaimprotocol/agent 0.1.15 → 0.1.18
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/lib/authoring/index.d.ts +1 -1
- package/lib/authoring/index.js +1 -1
- package/lib/authoring/util.js +3 -0
- package/lib/config/store.d.ts +7 -0
- package/lib/consts.d.ts +15 -0
- package/lib/consts.js +35 -0
- package/lib/index.js +1 -1
- package/lib/mcp/api/operations.gen.d.ts +8 -16
- package/lib/mcp/api/operations.gen.js +428 -479
- package/lib/mcp/remap_errors.js +7 -14
- package/lib/mcp/start.js +10 -3
- package/lib/mcp/tools/agent/proof.js +3 -3
- package/lib/mcp/tools/agent/publish.js +33 -0
- package/lib/mcp/tools/authenticate/authenticate.js +178 -93
- package/lib/mcp/tools/authenticate/eth-key.js +2 -3
- package/lib/mcp/tools/index.d.ts +1 -0
- package/lib/mcp/tools/index.js +1 -0
- package/lib/mcp/tools/mode/index.d.ts +1 -0
- package/lib/mcp/tools/mode/index.js +3 -0
- package/lib/mcp/tools/mode/mode.d.ts +17 -0
- package/lib/mcp/tools/mode/mode.js +69 -0
- package/lib/old/to-register.d.ts +16 -8
- package/lib/old/to-register.js +29 -21
- package/lib/old/tools/publish.js +86 -8
- package/lib/provider/injection-doc.js +4 -3
- package/lib/provider/schema.d.ts +26 -1
- package/lib/provider/to-version.d.ts +19 -2
- package/lib/provider/to-version.js +22 -4
- package/lib/tools/registry.d.ts +6 -13
- package/lib/tools/registry.js +29 -0
- package/package.json +5 -8
- package/scripts/prepend-shebang.js +1 -1
- package/skill/builder-mode.md +2 -0
- package/skill/old-mode.md +3 -1
- package/src/authoring/index.ts +1 -0
- package/src/authoring/util.ts +3 -0
- package/src/cdp/launcher.ts +1 -1
- package/src/config/store.ts +8 -0
- package/src/consts.ts +44 -0
- package/src/index.ts +1 -1
- package/src/mcp/api/operations.gen.ts +430 -487
- package/src/mcp/remap_errors.ts +8 -15
- package/src/mcp/start.ts +11 -2
- package/src/mcp/tools/agent/proof.ts +3 -3
- package/src/mcp/tools/agent/publish.ts +42 -0
- package/src/mcp/tools/authenticate/authenticate.ts +238 -108
- package/src/mcp/tools/authenticate/eth-key.ts +7 -5
- package/src/mcp/tools/index.ts +1 -0
- package/src/mcp/tools/mode/index.ts +3 -0
- package/src/mcp/tools/mode/mode.ts +82 -0
- package/src/old/to-register.ts +50 -27
- package/src/old/tools/publish.ts +108 -8
- package/src/proof/debug-response-dump.ts +1 -1
- package/src/proof/proof-core.ts +1 -1
- package/src/proof/zk-files.ts +2 -2
- package/src/provider/dom-xpath.ts +1 -1
- package/src/provider/draft.ts +3 -3
- package/src/provider/injection-doc.ts +4 -3
- package/src/provider/schema.ts +27 -1
- package/src/provider/to-version.ts +45 -6
- package/src/tools/registry.ts +19 -0
- package/src/cli/args.ts +0 -20
- package/src/cli/commands.ts +0 -27
- package/src/cli.ts +0 -7
package/lib/authoring/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { AuthoringBackend, Draft, DraftStore, ProveOptions, SecretParams, } from './backend.ts';
|
|
2
2
|
export { makeDraftStore } from './backend.ts';
|
|
3
3
|
export { authoringTools } from './tools.ts';
|
|
4
|
-
export { defineTool, extendTool, type RegisteredTool, type ToolDefinition, } from '../tools/registry.ts';
|
|
4
|
+
export { defineTool, errorAsToolText, extendTool, type RegisteredTool, type ToolDefinition, } from '../tools/registry.ts';
|
package/lib/authoring/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { authoringTools } from "./tools.js";
|
|
|
3
3
|
// The shared tool primitive — re-exported so consumers (the cloud loop) get the
|
|
4
4
|
// RegisteredTool type/`defineTool`/`extendTool` without importing the MCP
|
|
5
5
|
// subsystem.
|
|
6
|
-
export { defineTool, extendTool, } from "../tools/registry.js";
|
|
6
|
+
export { defineTool, errorAsToolText, extendTool, } from "../tools/registry.js";
|
package/lib/authoring/util.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/** Build an `object` JSON Schema for a tool input — a small literal shortener,
|
|
2
2
|
* not a tool abstraction. */
|
|
3
3
|
export function objectSchema(properties, required) {
|
|
4
|
+
// `properties` is an untyped Record here (this is a literal shortener, not a
|
|
5
|
+
// schema validator), so it doesn't structurally match ObjectSchema's strict
|
|
6
|
+
// per-property schema type — assert the shape.
|
|
4
7
|
return {
|
|
5
8
|
type: 'object',
|
|
6
9
|
properties,
|
package/lib/config/store.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export interface ReclaimAgentConfig {
|
|
|
7
7
|
/**
|
|
8
8
|
* The single on-disk document at `~/.reclaim/config.json`. Each top-level
|
|
9
9
|
* key is an independent section owned by a different subsystem:
|
|
10
|
+
* - `mode` — persisted backend preference (old-devtools vs builder),
|
|
11
|
+
* set via the `set_devtools_mode` tool. Applied at server
|
|
12
|
+
* start; an explicit `USE_OLD_DEVTOOLS` env var overrides
|
|
13
|
+
* it (see `resolveOldMode` in consts.ts).
|
|
10
14
|
* - `browser_agent` — Chrome attach mode/port (the agent tools)
|
|
11
15
|
* - `session` — the auth bearer token (authenticate)
|
|
12
16
|
* - `old_devtools` — externally-supplied identity for OLD-devtools mode
|
|
@@ -21,10 +25,13 @@ export interface ReclaimAgentConfig {
|
|
|
21
25
|
*/
|
|
22
26
|
export interface ReclaimConfig {
|
|
23
27
|
version: 1;
|
|
28
|
+
mode?: DevtoolsMode;
|
|
24
29
|
browser_agent?: ReclaimAgentConfig;
|
|
25
30
|
session?: CachedSession;
|
|
26
31
|
old_devtools?: OldIdentity;
|
|
27
32
|
}
|
|
33
|
+
/** Which backend the MCP server targets. See `resolveOldMode` in consts.ts. */
|
|
34
|
+
export type DevtoolsMode = 'old' | 'builder';
|
|
28
35
|
/**
|
|
29
36
|
* Read/write the unified Reclaim config document. The file holds the
|
|
30
37
|
* (short-lived) session bearer token, so it is always locked to `0600` and
|
package/lib/consts.d.ts
CHANGED
|
@@ -36,6 +36,21 @@ export declare function reclaimHome(): string;
|
|
|
36
36
|
* `USE_OLD_DEVTOOLS=false`; anything else keeps old mode on.
|
|
37
37
|
*/
|
|
38
38
|
export declare function useOldDevtools(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Effective mode, layering the persisted preference under the env var:
|
|
41
|
+
* explicit `USE_OLD_DEVTOOLS` wins → persisted config `mode` → default (old).
|
|
42
|
+
* The persisted value comes from `~/.reclaim/config.json` (set via the
|
|
43
|
+
* `set_devtools_mode` tool); the caller reads it so this module needn't import
|
|
44
|
+
* `ConfigStore` (which would create an import cycle).
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveOldMode(persisted?: 'old' | 'builder'): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Where the effective mode came from — the same precedence as
|
|
49
|
+
* `resolveOldMode`: explicit `USE_OLD_DEVTOOLS` env var → persisted config
|
|
50
|
+
* `mode` → default (old). Surfaced by the `get_devtools_mode` tool so the
|
|
51
|
+
* user can tell why the server is in the mode it reports.
|
|
52
|
+
*/
|
|
53
|
+
export declare function oldModeSource(persisted?: 'old' | 'builder'): 'env' | 'config' | 'default';
|
|
39
54
|
/** `%LOCALAPPDATA%` on Windows, used to probe a per-user Chrome install. */
|
|
40
55
|
export declare function localAppData(): string | undefined;
|
|
41
56
|
/** Explicit Chrome/Edge/Chromium binary path override. */
|
package/lib/consts.js
CHANGED
|
@@ -56,6 +56,41 @@ export function reclaimHome() {
|
|
|
56
56
|
export function useOldDevtools() {
|
|
57
57
|
return (process.env.USE_OLD_DEVTOOLS ?? '').trim().toLowerCase() !== 'false';
|
|
58
58
|
}
|
|
59
|
+
/** True when `USE_OLD_DEVTOOLS` is set to a non-empty value (explicit). */
|
|
60
|
+
function oldDevtoolsEnvSet() {
|
|
61
|
+
return (process.env.USE_OLD_DEVTOOLS ?? '').trim() !== '';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Effective mode, layering the persisted preference under the env var:
|
|
65
|
+
* explicit `USE_OLD_DEVTOOLS` wins → persisted config `mode` → default (old).
|
|
66
|
+
* The persisted value comes from `~/.reclaim/config.json` (set via the
|
|
67
|
+
* `set_devtools_mode` tool); the caller reads it so this module needn't import
|
|
68
|
+
* `ConfigStore` (which would create an import cycle).
|
|
69
|
+
*/
|
|
70
|
+
export function resolveOldMode(persisted) {
|
|
71
|
+
if (oldDevtoolsEnvSet()) {
|
|
72
|
+
return useOldDevtools();
|
|
73
|
+
}
|
|
74
|
+
if (persisted) {
|
|
75
|
+
return persisted === 'old';
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Where the effective mode came from — the same precedence as
|
|
81
|
+
* `resolveOldMode`: explicit `USE_OLD_DEVTOOLS` env var → persisted config
|
|
82
|
+
* `mode` → default (old). Surfaced by the `get_devtools_mode` tool so the
|
|
83
|
+
* user can tell why the server is in the mode it reports.
|
|
84
|
+
*/
|
|
85
|
+
export function oldModeSource(persisted) {
|
|
86
|
+
if (oldDevtoolsEnvSet()) {
|
|
87
|
+
return 'env';
|
|
88
|
+
}
|
|
89
|
+
if (persisted) {
|
|
90
|
+
return 'config';
|
|
91
|
+
}
|
|
92
|
+
return 'default';
|
|
93
|
+
}
|
|
59
94
|
// ---------------------------------------------------------------------------
|
|
60
95
|
// Chrome / CDP launcher.
|
|
61
96
|
// ---------------------------------------------------------------------------
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Package entry — SDK re-exports + agent public API.
|
|
2
|
-
// The
|
|
2
|
+
// The MCP server bin lives at ./mcp-bin.ts.
|
|
3
3
|
// SDK — re-export everything from @reclaimprotocol/client so consumers
|
|
4
4
|
// only need one package for both the typed HTTP client and the agent tools.
|
|
5
5
|
export * from '@reclaimprotocol/client';
|
|
@@ -23,10 +23,6 @@ export declare const MCP_TOOLS: {
|
|
|
23
23
|
description: string;
|
|
24
24
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
25
25
|
};
|
|
26
|
-
CreateAttachSession: {
|
|
27
|
-
description: string;
|
|
28
|
-
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
29
|
-
};
|
|
30
26
|
CreateCallbackSubscription: {
|
|
31
27
|
description: string;
|
|
32
28
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -83,10 +79,6 @@ export declare const MCP_TOOLS: {
|
|
|
83
79
|
description: string;
|
|
84
80
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
85
81
|
};
|
|
86
|
-
GetAttachSession: {
|
|
87
|
-
description: string;
|
|
88
|
-
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
89
|
-
};
|
|
90
82
|
GetMe: {
|
|
91
83
|
description: string;
|
|
92
84
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -103,10 +95,6 @@ export declare const MCP_TOOLS: {
|
|
|
103
95
|
description: string;
|
|
104
96
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
105
97
|
};
|
|
106
|
-
GetOrgToken: {
|
|
107
|
-
description: string;
|
|
108
|
-
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
109
|
-
};
|
|
110
98
|
GetProvider: {
|
|
111
99
|
description: string;
|
|
112
100
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -143,6 +131,10 @@ export declare const MCP_TOOLS: {
|
|
|
143
131
|
description: string;
|
|
144
132
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
145
133
|
};
|
|
134
|
+
ListOrgTokens: {
|
|
135
|
+
description: string;
|
|
136
|
+
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
137
|
+
};
|
|
146
138
|
ListOrgVerificationSessions: {
|
|
147
139
|
description: string;
|
|
148
140
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -179,6 +171,10 @@ export declare const MCP_TOOLS: {
|
|
|
179
171
|
description: string;
|
|
180
172
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
181
173
|
};
|
|
174
|
+
RevokeOrgToken: {
|
|
175
|
+
description: string;
|
|
176
|
+
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
177
|
+
};
|
|
182
178
|
SetOrgKeypair: {
|
|
183
179
|
description: string;
|
|
184
180
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -195,10 +191,6 @@ export declare const MCP_TOOLS: {
|
|
|
195
191
|
description: string;
|
|
196
192
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
197
193
|
};
|
|
198
|
-
UpdateOrgBilling: {
|
|
199
|
-
description: string;
|
|
200
|
-
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
201
|
-
};
|
|
202
194
|
UpdateProvider: {
|
|
203
195
|
description: string;
|
|
204
196
|
inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|