@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/src/config/store.ts
CHANGED
|
@@ -18,6 +18,10 @@ export interface ReclaimAgentConfig {
|
|
|
18
18
|
/**
|
|
19
19
|
* The single on-disk document at `~/.reclaim/config.json`. Each top-level
|
|
20
20
|
* key is an independent section owned by a different subsystem:
|
|
21
|
+
* - `mode` — persisted backend preference (old-devtools vs builder),
|
|
22
|
+
* set via the `set_devtools_mode` tool. Applied at server
|
|
23
|
+
* start; an explicit `USE_OLD_DEVTOOLS` env var overrides
|
|
24
|
+
* it (see `resolveOldMode` in consts.ts).
|
|
21
25
|
* - `browser_agent` — Chrome attach mode/port (the agent tools)
|
|
22
26
|
* - `session` — the auth bearer token (authenticate)
|
|
23
27
|
* - `old_devtools` — externally-supplied identity for OLD-devtools mode
|
|
@@ -32,11 +36,15 @@ export interface ReclaimAgentConfig {
|
|
|
32
36
|
*/
|
|
33
37
|
export interface ReclaimConfig {
|
|
34
38
|
version: 1
|
|
39
|
+
mode?: DevtoolsMode
|
|
35
40
|
browser_agent?: ReclaimAgentConfig
|
|
36
41
|
session?: CachedSession
|
|
37
42
|
old_devtools?: OldIdentity
|
|
38
43
|
}
|
|
39
44
|
|
|
45
|
+
/** Which backend the MCP server targets. See `resolveOldMode` in consts.ts. */
|
|
46
|
+
export type DevtoolsMode = 'old' | 'builder'
|
|
47
|
+
|
|
40
48
|
/**
|
|
41
49
|
* Read/write the unified Reclaim config document. The file holds the
|
|
42
50
|
* (short-lived) session bearer token, so it is always locked to `0600` and
|
package/src/consts.ts
CHANGED
|
@@ -72,6 +72,50 @@ export function useOldDevtools(): boolean {
|
|
|
72
72
|
return (process.env.USE_OLD_DEVTOOLS ?? '').trim().toLowerCase() !== 'false'
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/** True when `USE_OLD_DEVTOOLS` is set to a non-empty value (explicit). */
|
|
76
|
+
function oldDevtoolsEnvSet(): boolean {
|
|
77
|
+
return (process.env.USE_OLD_DEVTOOLS ?? '').trim() !== ''
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Effective mode, layering the persisted preference under the env var:
|
|
82
|
+
* explicit `USE_OLD_DEVTOOLS` wins → persisted config `mode` → default (old).
|
|
83
|
+
* The persisted value comes from `~/.reclaim/config.json` (set via the
|
|
84
|
+
* `set_devtools_mode` tool); the caller reads it so this module needn't import
|
|
85
|
+
* `ConfigStore` (which would create an import cycle).
|
|
86
|
+
*/
|
|
87
|
+
export function resolveOldMode(persisted?: 'old' | 'builder'): boolean {
|
|
88
|
+
if(oldDevtoolsEnvSet()) {
|
|
89
|
+
return useOldDevtools()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if(persisted) {
|
|
93
|
+
return persisted === 'old'
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return true
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Where the effective mode came from — the same precedence as
|
|
101
|
+
* `resolveOldMode`: explicit `USE_OLD_DEVTOOLS` env var → persisted config
|
|
102
|
+
* `mode` → default (old). Surfaced by the `get_devtools_mode` tool so the
|
|
103
|
+
* user can tell why the server is in the mode it reports.
|
|
104
|
+
*/
|
|
105
|
+
export function oldModeSource(
|
|
106
|
+
persisted?: 'old' | 'builder',
|
|
107
|
+
): 'env' | 'config' | 'default' {
|
|
108
|
+
if(oldDevtoolsEnvSet()) {
|
|
109
|
+
return 'env'
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if(persisted) {
|
|
113
|
+
return 'config'
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return 'default'
|
|
117
|
+
}
|
|
118
|
+
|
|
75
119
|
// ---------------------------------------------------------------------------
|
|
76
120
|
// Chrome / CDP launcher.
|
|
77
121
|
// ---------------------------------------------------------------------------
|
package/src/index.ts
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
|
|
|
4
4
|
// SDK — re-export everything from @reclaimprotocol/client so consumers
|
|
5
5
|
// only need one package for both the typed HTTP client and the agent tools.
|