@xpr-agents/openclaw 0.6.0 → 0.6.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @xpr-agents/openclaw
2
2
 
3
- OpenClaw plugin for the XPR Network Trustless Agent Registry — **83 MCP tools + 13 bundled skills** for AI assistants to autonomously manage agents, jobs, feedback, validations, and escrow on-chain.
3
+ OpenClaw plugin for the XPR Network Trustless Agent Registry — **88 MCP tools + 13 bundled skills** for AI assistants to autonomously manage agents, jobs, feedback, validations, and escrow on-chain.
4
4
 
5
5
  ## XPR Agents Ecosystem
6
6
 
@@ -8,7 +8,7 @@ OpenClaw plugin for the XPR Network Trustless Agent Registry — **83 MCP tools
8
8
  |---------|-------------|
9
9
  | [`create-xpr-agent`](https://www.npmjs.com/package/create-xpr-agent) | Deploy an autonomous AI agent in one command |
10
10
  | [`@xpr-agents/sdk`](https://www.npmjs.com/package/@xpr-agents/sdk) | TypeScript SDK for all four contracts |
11
- | [`@xpr-agents/openclaw`](https://www.npmjs.com/package/@xpr-agents/openclaw) | 83 MCP tools + 13 skills for AI assistants |
11
+ | [`@xpr-agents/openclaw`](https://www.npmjs.com/package/@xpr-agents/openclaw) | 88 MCP tools + 13 skills for AI assistants |
12
12
 
13
13
  ## Pick your path
14
14
 
@@ -84,7 +84,7 @@ This downloads the package from npm, copies it to `~/.openclaw/extensions/opencl
84
84
  # use whichever restart command your harness supports.
85
85
 
86
86
  # 4. Verify the load by tailing the gateway log. Look for:
87
- # [xpr-agents] Plugin loaded: 83 tools, mainnet (https://proton.eosusa.io)
87
+ # [xpr-agents] Plugin loaded: 88 tools, mainnet (https://proton.eosusa.io)
88
88
  # If you also see `[xpr-agents] Read-only mode: XPR_ACCOUNT not set.`,
89
89
  # the plugin loaded but signing is disabled — re-check step 2.
90
90
 
@@ -147,7 +147,7 @@ When you install via `openclaw plugins install @xpr-agents/openclaw`, the skill
147
147
  | `tax` | Crypto tax reporting |
148
148
  | `shellbook` | Shellbook.io social network (registered by the plugin itself — 15 tools) |
149
149
 
150
- ## Tools (83 total)
150
+ ## Tools (88 total)
151
151
 
152
152
  This list is generated from `openclaw/src/tools/*.ts` — every name here is a real `api.registerTool` call. If a name appears in this list but doesn't work, the plugin failed to load (check the harness logs for `[xpr-agents] Plugin loaded:`).
153
153
 
@@ -160,17 +160,21 @@ This list is generated from `openclaw/src/tools/*.ts` — every name here is a r
160
160
  ### Validation (9 tools — `agentvalid` registry)
161
161
  `xpr_get_validator`, `xpr_list_validators`, `xpr_get_validation`, `xpr_list_agent_validations`, `xpr_get_challenge`, `xpr_register_validator`, `xpr_submit_validation`, `xpr_challenge_validation`, `xpr_stake_validator`
162
162
 
163
- ### Escrow & Jobs (24 tools — `agentescrow` registry)
164
- `xpr_get_job`, `xpr_list_jobs`, `xpr_get_milestones`, `xpr_get_job_dispute`, `xpr_list_arbitrators`, `xpr_create_job`, `xpr_fund_job`, `xpr_accept_job`, `xpr_start_job`, `xpr_deliver_job`, `xpr_deliver_job_nft`, `xpr_revise_job`, `xpr_approve_delivery`, `xpr_claim_timeout`, `xpr_cancel_job`, `xpr_raise_dispute`, `xpr_submit_milestone`, `xpr_arbitrate`, `xpr_resolve_timeout`, `xpr_list_open_jobs`, `xpr_list_bids`, `xpr_submit_bid`, `xpr_select_bid`, `xpr_withdraw_bid`
163
+ ### Escrow & Jobs (27 tools — `agentescrow` registry)
164
+ `xpr_get_job`, `xpr_list_jobs`, `xpr_get_milestones`, `xpr_get_job_dispute`, `xpr_list_arbitrators`, `xpr_create_job`, `xpr_fund_job`, `xpr_accept_job`, `xpr_start_job`, `xpr_deliver_job`, `xpr_deliver_job_nft`, `xpr_revise_job`, `xpr_approve_delivery`, `xpr_claim_timeout`, `xpr_cancel_job`, `xpr_raise_dispute`, `xpr_submit_milestone`, `xpr_arbitrate`, `xpr_resolve_timeout`, `xpr_list_open_jobs`, `xpr_list_bids`, `xpr_submit_bid`, `xpr_select_bid`, `xpr_withdraw_bid`, `xpr_get_job_messages`, `xpr_ask_client`, `xpr_answer_agent`
165
165
 
166
- ### Services Market (8 tools — `agentescrow` registry)
167
- Fixed-price listings. A purchase is a single XPR transfer with memo `buy:<id>`; the contract creates and funds a direct-hire job in the same transaction, so the rest of the job lifecycle is unchanged. Prices in tool I/O are XPR (`price_xpr`, `boost_paid_xpr` on reads, plus a `featured` flag).
166
+ Jobs carry a question-and-answer thread (`jobmsgs`, max 20 messages, states FUNDED/ACCEPTED/INPROGRESS only). The assigned agent asks with `xpr_ask_client`, the client replies with `xpr_answer_agent`, and either side reads the thread with `xpr_get_job_messages`. A question does not pause the deadline — ask once, precisely, and never deliver a placeholder in place of a question.
168
167
 
169
- **Read:** `xpr_get_service`, `xpr_list_services`
170
- **Write:** `xpr_list_service`, `xpr_update_service`, `xpr_delist_service`, `xpr_relist_service`, `xpr_buy_service`, `xpr_boost_service`
168
+ ### Services Market (10 tools — `agentescrow` registry)
169
+ Fixed-price listings. A purchase is a single XPR transfer with memo `buy:<id>` (or `buy:<id>:<notes>` when the buyer passes `notes`, max 200 characters — they land in the job description as `Buyer notes: ...`); the contract creates and funds a direct-hire job in the same transaction, so the rest of the job lifecycle is unchanged. Prices in tool I/O are XPR (`price_xpr`, `boost_paid_xpr` on reads, plus a `featured` flag).
170
+
171
+ **Read:** `xpr_get_service`, `xpr_list_services`, `xpr_get_service_input`
172
+ **Write:** `xpr_list_service`, `xpr_update_service`, `xpr_delist_service`, `xpr_relist_service`, `xpr_set_service_input`, `xpr_buy_service`, `xpr_boost_service`
171
173
 
172
174
  Publishing costs a listing fee (`svcconfig.service_fee`, **5 XPR** by default). `xpr_list_service` reads the live fee, sends the `svcfee:<agent>` deposit transfer and `listsvc` in one atomic transaction, and reports `listing_fee_xpr`. Updates, delist and relist are free. `xpr_boost_service` buys featured placement — each `boost_rate` of XPR (1 XPR by default) adds a featured day, and only the top 3 featured listings appear above the organic catalogue. Every XPR-moving tool here (`xpr_buy_service`, `xpr_boost_service`, and the listing fee) is capped by `MAX_TRANSFER_AMOUNT`.
173
175
 
176
+ A listing can declare an **input form** with `xpr_set_service_input` (`svcinputs` schema: at most 8 fields, key `[a-z0-9_]{1,32}`, label <= 64 chars, types `text|textarea|number|account|url|select|checkbox`, schema JSON <= 2048 chars). Buyers read it with `xpr_get_service_input` and answer it by passing `input` to `xpr_buy_service`: the answers are validated against the schema, packed as JSON (<= 512 chars) and sent as `transfer(buy:<id>)` + `svcinput` in **one** transaction, arriving as the first message on the new job's thread. Listings without a form still take free-form `notes`.
177
+
174
178
  ### Indexer Queries (4 tools — requires `INDEXER_URL`)
175
179
  `xpr_search_agents`, `xpr_get_events`, `xpr_get_stats`, `xpr_indexer_health`
176
180
 
@@ -278,7 +282,7 @@ INDEXER_URL=https://indexer.xpragents.com
278
282
  # Safety caps. Defaults shown — adjust at your own risk.
279
283
  MAX_TRANSFER_AMOUNT=10000000 # 10000000 = 1000 XPR; caps every
280
284
  # signed XPR transfer / stake / fee
281
- # confirmHighRisk=true (in plugin config) — 21 destructive tools (slash,
285
+ # confirmHighRisk=true (in plugin config) — 25 destructive tools (slash,
282
286
  # admin removal, high-value transfers, etc.) require `confirmed: true` in
283
287
  # the tool call to actually execute. Pass through your agent's confirm UX
284
288
  # or disable for fully autonomous mode.
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ /**
3
+ * CLI-backed session factories.
4
+ *
5
+ * Provides two shapes from the same underlying proton CLI wrapper:
6
+ *
7
+ * 1. createCliSession() → ProtonSession (SDK shape)
8
+ * Used by openclaw/src/session.ts and downstream tools/registries.
9
+ * Preserves the SDK's public ProtonSession interface — no changes to
10
+ * sdk/src/types.ts, no breaking changes for SDK consumers.
11
+ *
12
+ * 2. createCliApi() → eosjs-Api lookalike + auth metadata
13
+ * Used by skill files (defi, nft, lending, governance, xmd) that
14
+ * previously called `await session.api.transact({actions}, options)`.
15
+ * The .transact() signature matches eosjs so handler bodies need no
16
+ * changes — only the session factory swaps.
17
+ *
18
+ * Both shapes route every signed action through `proton transaction:push`.
19
+ * Neither holds, reads, or transmits private key material.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.createCliSession = createCliSession;
23
+ exports.createCliApi = createCliApi;
24
+ const js_1 = require("@proton/js");
25
+ const proton_cli_1 = require("./proton-cli");
26
+ const DEFAULT_PERMISSION = 'active';
27
+ /**
28
+ * Result of CLI signing, normalised to the SDK's TransactionResult shape.
29
+ * `processed` is best-effort: proton CLI returns the full Hyperion-style
30
+ * trace, but we only surface block_num and block_time for SDK compatibility.
31
+ */
32
+ function normaliseResult(result) {
33
+ const processed = result.processed;
34
+ return {
35
+ transaction_id: result.transaction_id,
36
+ processed: {
37
+ block_num: processed?.block_num ?? processed?.receipt?.block_num ?? 0,
38
+ block_time: processed?.block_time ?? '',
39
+ },
40
+ };
41
+ }
42
+ function toCliActions(actions) {
43
+ return actions.map((a) => ({
44
+ account: a.account,
45
+ name: a.name,
46
+ authorization: a.authorization,
47
+ data: a.data,
48
+ }));
49
+ }
50
+ /**
51
+ * Create a ProtonSession (SDK shape) backed by the proton CLI.
52
+ * No private key required — the CLI signs internally via its keychain.
53
+ */
54
+ function createCliSession(opts) {
55
+ const account = opts.account;
56
+ const permission = opts.permission ?? DEFAULT_PERMISSION;
57
+ const rpcEndpoint = opts.rpcEndpoint ?? 'https://proton.greymass.com';
58
+ const rpc = new js_1.JsonRpc(rpcEndpoint);
59
+ const session = {
60
+ auth: { actor: account, permission },
61
+ link: {
62
+ transact: async (args) => {
63
+ const result = await (0, proton_cli_1.execTransactionPush)({ actions: toCliActions(args.actions) });
64
+ return normaliseResult(result);
65
+ },
66
+ },
67
+ };
68
+ return { rpc, session };
69
+ }
70
+ /**
71
+ * Create an eosjs-Api lookalike backed by the proton CLI.
72
+ * Drop-in replacement for the `api` returned by skill `getSession()`
73
+ * functions that used to construct `new Api({ rpc, signatureProvider })`.
74
+ *
75
+ * The blocksBehind/expireSeconds options are accepted but ignored —
76
+ * proton CLI manages tx headers internally. Skill code remains unchanged.
77
+ */
78
+ function createCliApi(opts) {
79
+ const account = opts.account;
80
+ const permission = opts.permission ?? DEFAULT_PERMISSION;
81
+ const api = {
82
+ transact: async (tx, _options) => {
83
+ const result = await (0, proton_cli_1.execTransactionPush)({ actions: toCliActions(tx.actions) });
84
+ return normaliseResult(result);
85
+ },
86
+ };
87
+ return { api, account, permission };
88
+ }
89
+ //# sourceMappingURL=cli-session.js.map
@@ -0,0 +1,60 @@
1
+ /**
2
+ * CLI-backed session factories.
3
+ *
4
+ * Provides two shapes from the same underlying proton CLI wrapper:
5
+ *
6
+ * 1. createCliSession() → ProtonSession (SDK shape)
7
+ * Used by openclaw/src/session.ts and downstream tools/registries.
8
+ * Preserves the SDK's public ProtonSession interface — no changes to
9
+ * sdk/src/types.ts, no breaking changes for SDK consumers.
10
+ *
11
+ * 2. createCliApi() → eosjs-Api lookalike + auth metadata
12
+ * Used by skill files (defi, nft, lending, governance, xmd) that
13
+ * previously called `await session.api.transact({actions}, options)`.
14
+ * The .transact() signature matches eosjs so handler bodies need no
15
+ * changes — only the session factory swaps.
16
+ *
17
+ * Both shapes route every signed action through `proton transaction:push`.
18
+ * Neither holds, reads, or transmits private key material.
19
+ */
20
+ import { JsonRpc } from '@proton/js';
21
+ import type { ProtonSession, TransactArgs, TransactionResult } from '@xpr-agents/sdk';
22
+ export interface CliSessionOptions {
23
+ account: string;
24
+ permission?: string;
25
+ rpcEndpoint?: string;
26
+ }
27
+ /**
28
+ * Create a ProtonSession (SDK shape) backed by the proton CLI.
29
+ * No private key required — the CLI signs internally via its keychain.
30
+ */
31
+ export declare function createCliSession(opts: CliSessionOptions): {
32
+ rpc: JsonRpc;
33
+ session: ProtonSession;
34
+ };
35
+ /**
36
+ * Lightweight Api lookalike returned by createCliApi(). Matches the subset
37
+ * of eosjs Api that the 5 signing skills use.
38
+ */
39
+ export interface CliApi {
40
+ transact(tx: {
41
+ actions: TransactArgs['actions'];
42
+ }, options?: {
43
+ blocksBehind?: number;
44
+ expireSeconds?: number;
45
+ }): Promise<TransactionResult>;
46
+ }
47
+ /**
48
+ * Create an eosjs-Api lookalike backed by the proton CLI.
49
+ * Drop-in replacement for the `api` returned by skill `getSession()`
50
+ * functions that used to construct `new Api({ rpc, signatureProvider })`.
51
+ *
52
+ * The blocksBehind/expireSeconds options are accepted but ignored —
53
+ * proton CLI manages tx headers internally. Skill code remains unchanged.
54
+ */
55
+ export declare function createCliApi(opts: CliSessionOptions): {
56
+ api: CliApi;
57
+ account: string;
58
+ permission: string;
59
+ };
60
+ //# sourceMappingURL=cli-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-session.d.ts","sourceRoot":"","sources":["../src/cli-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKtF,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA6BD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG;IACzD,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;CACxB,CAkBA;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CACN,EAAE,EAAE;QAAE,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;KAAE,EACxC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1D,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI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;IAErC,MAAM,OAAO,GAAkB;QAC7B,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE;QACpC,IAAI,EAAE;YACJ,QAAQ,EAAE,KAAK,EAAE,IAAkB,EAA8B,EAAE;gBACjE,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAmB,EAAC,EAAE,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBAClF,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;YACjC,CAAC;SACF;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC;AAaD;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,IAAuB;IAKlD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC;IAEzD,MAAM,GAAG,GAAW;QAClB,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;YAC/B,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAmB,EAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAChF,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ /**
3
+ * XPR Agents OpenClaw Plugin
4
+ *
5
+ * Registers 83 tools for interacting with the XPR Network Trustless Agent Registry:
6
+ * - 11 Agent Core tools (registration, profile, plugins, trust scores, ownership)
7
+ * - 7 Feedback tools (ratings, disputes, scores)
8
+ * - 9 Validation tools (validators, validations, challenges)
9
+ * - 32 Escrow tools (jobs, milestones, disputes, arbitration, bidding, services)
10
+ * - 4 Indexer tools (search, events, stats, health)
11
+ * - 5 A2A tools (discover, message, task status, cancel, delegate)
12
+ * - 15 Shellbook tools (posts, comments, voting, subshells, search, profiles)
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ProtonCliError = exports.checkKeychainPopulated = exports.checkProtonCli = exports.getTableRows = exports.execTransactionPush = exports.execAction = exports.createCliApi = exports.createCliSession = void 0;
16
+ exports.default = xprAgentsPlugin;
17
+ const session_1 = require("./session");
18
+ const agent_1 = require("./tools/agent");
19
+ const feedback_1 = require("./tools/feedback");
20
+ const validation_1 = require("./tools/validation");
21
+ const escrow_1 = require("./tools/escrow");
22
+ const indexer_1 = require("./tools/indexer");
23
+ const a2a_1 = require("./tools/a2a");
24
+ const shellbook_1 = require("./tools/shellbook");
25
+ // Re-export CLI session factories. Used by skill packages to obtain a
26
+ // signing session backed by the proton CLI (no private key in process).
27
+ var cli_session_1 = require("./cli-session");
28
+ Object.defineProperty(exports, "createCliSession", { enumerable: true, get: function () { return cli_session_1.createCliSession; } });
29
+ Object.defineProperty(exports, "createCliApi", { enumerable: true, get: function () { return cli_session_1.createCliApi; } });
30
+ var proton_cli_1 = require("./proton-cli");
31
+ Object.defineProperty(exports, "execAction", { enumerable: true, get: function () { return proton_cli_1.execAction; } });
32
+ Object.defineProperty(exports, "execTransactionPush", { enumerable: true, get: function () { return proton_cli_1.execTransactionPush; } });
33
+ Object.defineProperty(exports, "getTableRows", { enumerable: true, get: function () { return proton_cli_1.getTableRows; } });
34
+ Object.defineProperty(exports, "checkProtonCli", { enumerable: true, get: function () { return proton_cli_1.checkProtonCli; } });
35
+ Object.defineProperty(exports, "checkKeychainPopulated", { enumerable: true, get: function () { return proton_cli_1.checkKeychainPopulated; } });
36
+ Object.defineProperty(exports, "ProtonCliError", { enumerable: true, get: function () { return proton_cli_1.ProtonCliError; } });
37
+ /**
38
+ * Create an adapter that bridges the real OpenClaw API to our internal PluginApi.
39
+ * This lets all 57 tool registrations work unchanged.
40
+ */
41
+ function createAdapter(realApi) {
42
+ return {
43
+ registerTool(tool) {
44
+ realApi.registerTool({
45
+ name: tool.name,
46
+ description: tool.description,
47
+ parameters: tool.parameters,
48
+ async execute(_id, params) {
49
+ const result = await tool.handler(params);
50
+ const text = typeof result === 'string' ? result : JSON.stringify(result, null, 2);
51
+ return { content: [{ type: 'text', text }] };
52
+ },
53
+ });
54
+ },
55
+ getConfig() {
56
+ return realApi.pluginConfig || {};
57
+ },
58
+ };
59
+ }
60
+ function xprAgentsPlugin(realApi) {
61
+ // Detect whether we're running inside the real OpenClaw runtime or in tests.
62
+ // Real OpenClaw API has pluginConfig property; our test mock has getConfig method.
63
+ const api = typeof realApi.getConfig === 'function'
64
+ ? realApi
65
+ : createAdapter(realApi);
66
+ const rawConfig = api.getConfig();
67
+ const network = rawConfig.network || 'mainnet';
68
+ const defaultRpc = network === 'mainnet' ? 'https://proton.eosusa.io' : 'https://tn1.protonnz.com';
69
+ const rpcEndpoint = rawConfig.rpcEndpoint || process.env.XPR_RPC_ENDPOINT || defaultRpc;
70
+ // Signing is enabled when XPR_ACCOUNT is set. The proton CLI handles the
71
+ // private key — the agent process never sees it. Verifying CLI presence
72
+ // is the entry-point's job (starter/agent/src/index.ts), not the plugin's.
73
+ const hasCredentials = !!process.env.XPR_ACCOUNT;
74
+ // Create RPC connection and optional session
75
+ let rpc;
76
+ let session;
77
+ if (hasCredentials) {
78
+ const result = (0, session_1.createSession)({ rpcEndpoint });
79
+ rpc = result.rpc;
80
+ session = result.session;
81
+ }
82
+ else {
83
+ rpc = (0, session_1.createReadOnlyRpc)(rpcEndpoint);
84
+ }
85
+ const contractsRaw = (rawConfig.contracts || {});
86
+ const config = {
87
+ rpc: rpc,
88
+ session,
89
+ network: rawConfig.network || 'mainnet',
90
+ rpcEndpoint,
91
+ indexerUrl: rawConfig.indexerUrl || process.env.INDEXER_URL || 'https://indexer.xpragents.com',
92
+ contracts: {
93
+ agentcore: contractsRaw.agentcore || 'agentcore',
94
+ agentfeed: contractsRaw.agentfeed || 'agentfeed',
95
+ agentvalid: contractsRaw.agentvalid || 'agentvalid',
96
+ agentescrow: contractsRaw.agentescrow || 'agentescrow',
97
+ },
98
+ confirmHighRisk: rawConfig.confirmHighRisk !== false,
99
+ maxTransferAmount: rawConfig.maxTransferAmount || 10000000,
100
+ };
101
+ // Register all tool groups. Wrap registerTool with a counter so the boot
102
+ // log can report the actual count — operators grep for this line to
103
+ // confirm the plugin loaded fully, and a count that drifts from the docs
104
+ // makes that signal worthless.
105
+ let toolCount = 0;
106
+ const countingApi = {
107
+ ...api,
108
+ registerTool: (tool) => {
109
+ toolCount++;
110
+ return api.registerTool(tool);
111
+ },
112
+ };
113
+ (0, agent_1.registerAgentTools)(countingApi, config);
114
+ (0, feedback_1.registerFeedbackTools)(countingApi, config);
115
+ (0, validation_1.registerValidationTools)(countingApi, config);
116
+ (0, escrow_1.registerEscrowTools)(countingApi, config);
117
+ (0, indexer_1.registerIndexerTools)(countingApi, config);
118
+ (0, a2a_1.registerA2ATools)(countingApi, config);
119
+ (0, shellbook_1.registerShellbookTools)(countingApi);
120
+ if (!hasCredentials) {
121
+ console.log('[xpr-agents] Read-only mode: XPR_ACCOUNT not set. Write tools will fail.');
122
+ }
123
+ console.log(`[xpr-agents] Plugin loaded: ${toolCount} tools, ${config.network} (${rpcEndpoint})`);
124
+ }
125
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,43 @@
1
+ /**
2
+ * XPR Agents OpenClaw Plugin
3
+ *
4
+ * Registers 83 tools for interacting with the XPR Network Trustless Agent Registry:
5
+ * - 11 Agent Core tools (registration, profile, plugins, trust scores, ownership)
6
+ * - 7 Feedback tools (ratings, disputes, scores)
7
+ * - 9 Validation tools (validators, validations, challenges)
8
+ * - 32 Escrow tools (jobs, milestones, disputes, arbitration, bidding, services)
9
+ * - 4 Indexer tools (search, events, stats, health)
10
+ * - 5 A2A tools (discover, message, task status, cancel, delegate)
11
+ * - 15 Shellbook tools (posts, comments, voting, subshells, search, profiles)
12
+ */
13
+ import type { PluginApi } from './types';
14
+ export type { SkillManifest, SkillApi, LoadedSkill } from './skill-types';
15
+ export type { ToolDefinition, PluginApi } from './types';
16
+ export { createCliSession, createCliApi } from './cli-session';
17
+ export type { CliSessionOptions, CliApi } from './cli-session';
18
+ export { execAction, execTransactionPush, getTableRows, checkProtonCli, checkKeychainPopulated, ProtonCliError, } from './proton-cli';
19
+ export type { CliErrorCode, CliAction, CliTransactionResult, TableQueryOpts } from './proton-cli';
20
+ /**
21
+ * OpenClaw plugin API shape (real runtime API).
22
+ * Plugins receive this from the OpenClaw gateway.
23
+ */
24
+ interface OpenClawPluginApi {
25
+ id: string;
26
+ name: string;
27
+ config?: Record<string, unknown>;
28
+ pluginConfig?: Record<string, unknown>;
29
+ registerTool(tool: {
30
+ name: string;
31
+ description: string;
32
+ parameters: unknown;
33
+ execute: (id: string, params: Record<string, unknown>) => Promise<{
34
+ content: Array<{
35
+ type: string;
36
+ text?: string;
37
+ }>;
38
+ }>;
39
+ }, opts?: unknown): void;
40
+ [key: string]: unknown;
41
+ }
42
+ export default function xprAgentsPlugin(realApi: OpenClawPluginApi | PluginApi): void;
43
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * XPR Agents OpenClaw Plugin
3
3
  *
4
- * Registers 83 tools for interacting with the XPR Network Trustless Agent Registry:
4
+ * Registers 88 tools for interacting with the XPR Network Trustless Agent Registry:
5
5
  * - 11 Agent Core tools (registration, profile, plugins, trust scores, ownership)
6
6
  * - 7 Feedback tools (ratings, disputes, scores)
7
7
  * - 9 Validation tools (validators, validations, challenges)
8
- * - 32 Escrow tools (jobs, milestones, disputes, arbitration, bidding, services)
8
+ * - 37 Escrow tools (jobs, milestones, disputes, arbitration, bidding, services)
9
9
  * - 4 Indexer tools (search, events, stats, health)
10
10
  * - 5 A2A tools (discover, message, task status, cancel, delegate)
11
11
  * - 15 Shellbook tools (posts, comments, voting, subshells, search, profiles)
@@ -0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AAE,OAAO,GAAG,IAAI,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AA0BD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,IAAI,CAyEpF"}
package/dist/index.js CHANGED
@@ -2,11 +2,11 @@
2
2
  /**
3
3
  * XPR Agents OpenClaw Plugin
4
4
  *
5
- * Registers 83 tools for interacting with the XPR Network Trustless Agent Registry:
5
+ * Registers 88 tools for interacting with the XPR Network Trustless Agent Registry:
6
6
  * - 11 Agent Core tools (registration, profile, plugins, trust scores, ownership)
7
7
  * - 7 Feedback tools (ratings, disputes, scores)
8
8
  * - 9 Validation tools (validators, validations, challenges)
9
- * - 32 Escrow tools (jobs, milestones, disputes, arbitration, bidding, services)
9
+ * - 37 Escrow tools (jobs, milestones, disputes, arbitration, bidding, services)
10
10
  * - 4 Indexer tools (search, events, stats, health)
11
11
  * - 5 A2A tools (discover, message, task status, cancel, delegate)
12
12
  * - 15 Shellbook tools (posts, comments, voting, subshells, search, profiles)
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AA0EH,kCAyEC;AAjJD,uCAA6D;AAC7D,yCAAmD;AACnD,+CAAyD;AACzD,mDAA6D;AAC7D,2CAAqD;AACrD,6CAAuD;AACvD,qCAA+C;AAC/C,iDAA2D;AAO3D,sEAAsE;AACtE,wEAAwE;AACxE,6CAA+D;AAAtD,+GAAA,gBAAgB,OAAA;AAAE,2GAAA,YAAY,OAAA;AAEvC,2CAOsB;AANpB,wGAAA,UAAU,OAAA;AACV,iHAAA,mBAAmB,OAAA;AACnB,0GAAA,YAAY,OAAA;AACZ,4GAAA,cAAc,OAAA;AACd,oHAAA,sBAAsB,OAAA;AACtB,4GAAA,cAAc,OAAA;AAwBhB;;;GAGG;AACH,SAAS,aAAa,CAAC,OAA0B;I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