Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions dist/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -82069,6 +82069,13 @@ function printSetupSummary(address2, email) {
lines.push(c(ANSI.dim, "Email ") + email);
}
lines.push(c(ANSI.dim, "Signing ") + "OKX TEE " + c(ANSI.dim, "(no local private key)"));
lines.push("");
lines.push(
c(ANSI.dim, "Fund ") + "send " + c(ANSI.bold, "USDC on Base") + " to the address above"
);
lines.push(
c(ANSI.dim, " ") + c(ANSI.dim, "(free models work at $0; $5 unlocks paid tier)")
);
const width = Math.max(...lines.map((l2) => stripAnsi(l2).length));
const horiz = "\u2500".repeat(width + 2);
console.log(" \u250C" + horiz + "\u2510");
Expand Down Expand Up @@ -82452,9 +82459,7 @@ ClawRouter Partner APIs (v${VERSION})
wallet = await resolveOrGenerateWalletKey();
} catch (err2) {
if (err2 instanceof OnchainOsRequiredError) {
console.error(
"[XClawRouter] Setup completed but the wallet still isn't detected."
);
console.error("[XClawRouter] Setup completed but the wallet still isn't detected.");
console.error(
"[XClawRouter] Diagnose with: onchainos wallet status (and re-run setup if needed)"
);
Expand Down
2 changes: 1 addition & 1 deletion dist/cli.js.map

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,19 @@ type OpenClawPluginDefinition = {
name?: string;
description?: string;
version?: string;
/**
* OpenClaw 2026.5.7+ capability contracts. The gateway's plugin loader
* validates that every tool/middleware/factory the plugin tries to
* register is declared here upfront; anything undeclared is silently
* dropped and a diagnostic is recorded (visible via
* `openclaw plugins doctor`). Keep `tools` in sync with the names
* passed to `api.registerTool()`.
*/
contracts?: {
tools?: string[];
embeddedExtensionFactories?: string[];
agentToolResultMiddleware?: string[];
};
register?: (api: OpenClawPluginApi) => void | Promise<void>;
activate?: (api: OpenClawPluginApi) => void | Promise<void>;
deactivate?: (api: OpenClawPluginApi) => void | Promise<void>;
Expand Down
38 changes: 35 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83363,10 +83363,42 @@ Run \`openclaw plugins install @blockrun/xclawrouter\` to generate a wallet.`,
};
}
var plugin = {
id: "clawrouter",
// MUST match openclaw.plugin.json's `id` field. OpenClaw's plugin loader
// validates the two match; a mismatch makes the gateway silently refuse to
// load the plugin (visible only via `openclaw plugins doctor`). The manifest
// declares "xclawrouter", so this must too.
id: "xclawrouter",
name: "XClawRouter",
description: "Smart LLM router \u2014 55+ models, x402 micropayments, 78% cost savings",
version: VERSION,
// OpenClaw 2026.5.7+ requires plugins to declare upfront every tool name
// they will register via `api.registerTool()`. The gateway's
// capability-registry validates each registered tool against this list and
// silently drops any undeclared tool — taking the whole plugin's gateway
// load with it (see `bundled-capability-runtime` in openclaw/dist). Keep
// this in sync with the `id` values in src/partners/registry.ts; the
// partner tools surface under the `blockrun_` prefix.
contracts: {
tools: [
"blockrun_predexon_events",
"blockrun_predexon_leaderboard",
"blockrun_predexon_markets",
"blockrun_predexon_smart_money",
"blockrun_predexon_smart_activity",
"blockrun_predexon_wallet",
"blockrun_predexon_wallet_pnl",
"blockrun_predexon_matching_markets",
"blockrun_stock_price",
"blockrun_stock_history",
"blockrun_stock_list",
"blockrun_crypto_price",
"blockrun_fx_price",
"blockrun_commodity_price",
"blockrun_image_generation",
"blockrun_image_edit",
"blockrun_video_generation"
]
},
register(api) {
const isDisabled = process["env"].CLAWROUTER_DISABLED === "true" || process["env"].CLAWROUTER_DISABLED === "1";
if (isDisabled) {
Expand Down Expand Up @@ -83722,13 +83754,13 @@ ${errText}`
delete config.models.providers.blockrun;
}
removeManagedBlockrunMcpServerConfig(config);
for (const key of ["clawrouter", "XClawRouter", "@blockrun/xclawrouter"]) {
for (const key of ["xclawrouter", "clawrouter", "XClawRouter", "@blockrun/xclawrouter"]) {
if (config.plugins?.entries?.[key]) delete config.plugins.entries[key];
if (config.plugins?.installs?.[key]) delete config.plugins.installs[key];
}
if (Array.isArray(config.plugins?.allow)) {
config.plugins.allow = config.plugins.allow.filter(
(p) => p !== "clawrouter" && p !== "XClawRouter" && p !== "@blockrun/xclawrouter"
(p) => p !== "xclawrouter" && p !== "clawrouter" && p !== "XClawRouter" && p !== "@blockrun/xclawrouter"
);
}
if (config.agents?.defaults?.models) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions openclaw.plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
"name": "XClawRouter",
"description": "Smart LLM router for OKX — agentic wallet, 55+ models, x402 micropayments on Base + Solana",
"skills": ["./skills"],
"contracts": {
"tools": [
"blockrun_predexon_events",
"blockrun_predexon_leaderboard",
"blockrun_predexon_markets",
"blockrun_predexon_smart_money",
"blockrun_predexon_smart_activity",
"blockrun_predexon_wallet",
"blockrun_predexon_wallet_pnl",
"blockrun_predexon_matching_markets",
"blockrun_stock_price",
"blockrun_stock_history",
"blockrun_stock_list",
"blockrun_crypto_price",
"blockrun_fx_price",
"blockrun_commodity_price",
"blockrun_image_generation",
"blockrun_image_edit",
"blockrun_video_generation"
],
"webSearchProviders": ["blockrun-exa"],
"imageGenerationProviders": ["blockrun"],
"videoGenerationProviders": ["blockrun"],
"musicGenerationProviders": ["blockrun"]
},
"configSchema": {
"type": "object",
"properties": {
Expand Down
13 changes: 13 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,19 @@ function printSetupSummary(address: string, email: string | undefined): void {
}
lines.push(c(ANSI.dim, "Signing ") + "OKX TEE " + c(ANSI.dim, "(no local private key)"));

// Funding hint. OKX onchainos x402 signing currently only supports Base
// (Solana support hasn't shipped yet — see src/proxy.ts warning). USDC on
// Base is the only thing that actually unlocks paid models, so name the
// chain explicitly instead of saying "USDC" alone, which led users to
// bridge to the wrong network.
lines.push("");
lines.push(
c(ANSI.dim, "Fund ") + "send " + c(ANSI.bold, "USDC on Base") + " to the address above",
);
lines.push(
c(ANSI.dim, " ") + c(ANSI.dim, "(free models work at $0; $5 unlocks paid tier)"),
);

const width = Math.max(...lines.map((l) => stripAnsi(l).length));
const horiz = "─".repeat(width + 2);
console.log(" ┌" + horiz + "┐");
Expand Down
46 changes: 42 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1587,11 +1587,44 @@ function createWalletCommand(api?: OpenClawPluginApi): OpenClawPluginCommandDefi
}

const plugin: OpenClawPluginDefinition = {
id: "clawrouter",
// MUST match openclaw.plugin.json's `id` field. OpenClaw's plugin loader
// validates the two match; a mismatch makes the gateway silently refuse to
// load the plugin (visible only via `openclaw plugins doctor`). The manifest
// declares "xclawrouter", so this must too.
id: "xclawrouter",
name: "XClawRouter",
description: "Smart LLM router — 55+ models, x402 micropayments, 78% cost savings",
version: VERSION,

// OpenClaw 2026.5.7+ requires plugins to declare upfront every tool name
// they will register via `api.registerTool()`. The gateway's
// capability-registry validates each registered tool against this list and
// silently drops any undeclared tool — taking the whole plugin's gateway
// load with it (see `bundled-capability-runtime` in openclaw/dist). Keep
// this in sync with the `id` values in src/partners/registry.ts; the
// partner tools surface under the `blockrun_` prefix.
contracts: {
tools: [
"blockrun_predexon_events",
"blockrun_predexon_leaderboard",
"blockrun_predexon_markets",
"blockrun_predexon_smart_money",
"blockrun_predexon_smart_activity",
"blockrun_predexon_wallet",
"blockrun_predexon_wallet_pnl",
"blockrun_predexon_matching_markets",
"blockrun_stock_price",
"blockrun_stock_history",
"blockrun_stock_list",
"blockrun_crypto_price",
"blockrun_fx_price",
"blockrun_commodity_price",
"blockrun_image_generation",
"blockrun_image_edit",
"blockrun_video_generation",
],
},

register(api: OpenClawPluginApi) {
// Check if XClawRouter is disabled via environment variable
// Usage: CLAWROUTER_DISABLED=true openclaw gateway start
Expand Down Expand Up @@ -2072,8 +2105,10 @@ const plugin: OpenClawPluginDefinition = {
// Remove managed BlockRun MCP server config, but preserve any user-managed override.
removeManagedBlockrunMcpServerConfig(config as OpenClawConfig);

// Remove plugin entries (all case variants)
for (const key of ["clawrouter", "XClawRouter", "@blockrun/xclawrouter"]) {
// Remove plugin entries (all case variants + legacy id "clawrouter"
// from when this package shipped under that id, before the rename
// to "xclawrouter" matching the npm package name).
for (const key of ["xclawrouter", "clawrouter", "XClawRouter", "@blockrun/xclawrouter"]) {
if (config.plugins?.entries?.[key]) delete config.plugins.entries[key];
if (config.plugins?.installs?.[key]) delete config.plugins.installs[key];
}
Expand All @@ -2082,7 +2117,10 @@ const plugin: OpenClawPluginDefinition = {
if (Array.isArray(config.plugins?.allow)) {
config.plugins.allow = config.plugins.allow.filter(
(p: string) =>
p !== "clawrouter" && p !== "XClawRouter" && p !== "@blockrun/xclawrouter",
p !== "xclawrouter" &&
p !== "clawrouter" &&
p !== "XClawRouter" &&
p !== "@blockrun/xclawrouter",
);
}

Expand Down
13 changes: 13 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,19 @@ export type OpenClawPluginDefinition = {
name?: string;
description?: string;
version?: string;
/**
* OpenClaw 2026.5.7+ capability contracts. The gateway's plugin loader
* validates that every tool/middleware/factory the plugin tries to
* register is declared here upfront; anything undeclared is silently
* dropped and a diagnostic is recorded (visible via
* `openclaw plugins doctor`). Keep `tools` in sync with the names
* passed to `api.registerTool()`.
*/
contracts?: {
tools?: string[];
embeddedExtensionFactories?: string[];
agentToolResultMiddleware?: string[];
};
register?: (api: OpenClawPluginApi) => void | Promise<void>;
activate?: (api: OpenClawPluginApi) => void | Promise<void>;
deactivate?: (api: OpenClawPluginApi) => void | Promise<void>;
Expand Down
Loading