@reclaimprotocol/agent 0.1.15 → 0.1.17
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 +8 -0
- package/lib/consts.js +20 -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/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 +16 -0
- package/lib/mcp/tools/mode/mode.js +49 -0
- package/lib/provider/to-version.js +4 -0
- 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/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 +24 -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/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 +58 -0
- 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/to-version.ts +4 -0
- 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
|
@@ -189,6 +189,10 @@ export function providerToCreateVersionRequest(
|
|
|
189
189
|
...providerToRequestSelection(req),
|
|
190
190
|
multiple: req.multiple ?? true,
|
|
191
191
|
required: req.required ?? true,
|
|
192
|
+
templateParamsMode: req.templateParamsMode ?? 'separate',
|
|
193
|
+
...(req.templateParams?.length
|
|
194
|
+
? { templateParams: req.templateParams }
|
|
195
|
+
: {}),
|
|
192
196
|
}))
|
|
193
197
|
const script = jsUserScripts?.trim()
|
|
194
198
|
|
package/src/tools/registry.ts
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* glue (`registerToolList` onto an `McpServer`) stays in `mcp/server.ts`, which
|
|
12
12
|
* re-exports this primitive for the MCP-side tool files.
|
|
13
13
|
*/
|
|
14
|
+
import { type Boom, isBoom } from '@hapi/boom'
|
|
15
|
+
import type { ProblemDetails } from '@reclaimprotocol/client'
|
|
14
16
|
import type { JSONSchema } from 'zod/v4/core'
|
|
15
17
|
import { toZod } from '../mcp/api/to-zod.ts'
|
|
16
18
|
|
|
@@ -51,6 +53,20 @@ export function defineTool<TArgs>(
|
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Render a tool-handler error as the text every host shows the LLM.
|
|
58
|
+
* Boom errors carrying an RFC 9457 problem include its `detail`; anything
|
|
59
|
+
* else falls back to the plain message.
|
|
60
|
+
*/
|
|
61
|
+
export function errorAsToolText(err: unknown): string {
|
|
62
|
+
if(isBoom(err) && err.output?.statusCode) {
|
|
63
|
+
const detail = (err as Boom<ProblemDetails>).data?.detail
|
|
64
|
+
return detail ? `${err.message}: ${detail}` : err.message
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return err instanceof Error ? err.message : String(err)
|
|
68
|
+
}
|
|
69
|
+
|
|
54
70
|
/**
|
|
55
71
|
* Adapt a tool to a host by WIDENING its input schema — add properties, mark
|
|
56
72
|
* some required, optionally override the description — without touching the
|
|
@@ -73,6 +89,9 @@ export function extendTool(
|
|
|
73
89
|
...(base.inputSchema.required ?? []),
|
|
74
90
|
...(extra.required ?? []),
|
|
75
91
|
]
|
|
92
|
+
// The merged `properties` spread carries the base's untyped property values,
|
|
93
|
+
// which don't structurally match ObjectSchema's strict per-property schema
|
|
94
|
+
// type — assert the merged shape.
|
|
76
95
|
const inputSchema = {
|
|
77
96
|
...base.inputSchema,
|
|
78
97
|
properties: {
|
package/src/cli/args.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { parseArgs as nodeParseArgs } from 'node:util'
|
|
2
|
-
|
|
3
|
-
// Placeholder. Final shape decided once the backend openapi stabilises and
|
|
4
|
-
// the CLI surface is fleshed out (see AGENTS.md → "CLI").
|
|
5
|
-
export function parseCliArgs(argv: string[]) {
|
|
6
|
-
return nodeParseArgs({
|
|
7
|
-
args: argv,
|
|
8
|
-
options: {
|
|
9
|
-
'base-url': { type: 'string' },
|
|
10
|
-
token: { type: 'string' },
|
|
11
|
-
param: { type: 'string', multiple: true },
|
|
12
|
-
query: { type: 'string', multiple: true },
|
|
13
|
-
body: { type: 'string' },
|
|
14
|
-
help: { type: 'boolean', short: 'h' },
|
|
15
|
-
version: { type: 'boolean', short: 'v' },
|
|
16
|
-
},
|
|
17
|
-
allowPositionals: true,
|
|
18
|
-
strict: false,
|
|
19
|
-
})
|
|
20
|
-
}
|
package/src/cli/commands.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { notImplemented } from '@hapi/boom'
|
|
2
|
-
import { DESCRIPTION, NAME, VERSION } from '../pkg.ts'
|
|
3
|
-
import { parseCliArgs } from './args.ts'
|
|
4
|
-
|
|
5
|
-
// Entry point for the `reclaim` bin. Placeholder until backend openapi
|
|
6
|
-
// finalises — `--version` and `--help` work; everything else throws.
|
|
7
|
-
export async function run(argv: string[]) {
|
|
8
|
-
const parsed = parseCliArgs(argv)
|
|
9
|
-
|
|
10
|
-
if(parsed.values['version']) {
|
|
11
|
-
process.stdout.write(`${NAME} ${VERSION}\n`)
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if(parsed.values['help']) {
|
|
16
|
-
process.stdout.write(
|
|
17
|
-
`${NAME} ${VERSION}\n${DESCRIPTION}\n\n` +
|
|
18
|
-
'Usage: reclaim call <OperationId> ' +
|
|
19
|
-
'[--param k=v] [--query k=v] [--body <json>]\n',
|
|
20
|
-
)
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
throw notImplemented(
|
|
25
|
-
'reclaim CLI: pending @reclaimprotocol/app spec finalisation',
|
|
26
|
-
)
|
|
27
|
-
}
|