Skip to content
Open
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
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Release

on:
push:
tags:
- "v*.*.*"
- "v*.*.*-alpha.*"
- "v*.*.*-beta.*"

permissions:
contents: read
id-token: write # Required for npm provenance

env:
NODE_VERSION: "22.x"

jobs:
verify-version:
name: Verify version
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract version from tag
id: tag
run: |
TAG=${GITHUB_REF#refs/tags/v}
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "Tagged version: $TAG"

- name: Read package.json version
id: package
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Package version: $VERSION"

- name: Compare versions
run: |
if [ "${{ steps.tag.outputs.version }}" != "${{ steps.package.outputs.version }}" ]; then
echo "ERROR: Tag version (${{ steps.tag.outputs.version }}) does not match package.json version (${{ steps.package.outputs.version }})"
exit 1
fi
echo "Versions match: ${{ steps.tag.outputs.version }}"

publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: verify-version
environment:
name: npm
url: https://www.npmjs.com/package/@ampersend_ai/clawrouter-core

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: package.json

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build package
run: pnpm build

- name: Determine publish tag
id: publish-tag
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
if [[ "$VERSION" == *"-alpha."* ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
echo "Publishing with tag: alpha"
elif [[ "$VERSION" == *"-beta."* ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
echo "Publishing with tag: beta"
else
echo "tag=latest" >> $GITHUB_OUTPUT
echo "Publishing with tag: latest"
fi

- name: Publish to npm
run: npm publish --access public --tag ${{ steps.publish-tag.outputs.tag }}
50 changes: 25 additions & 25 deletions RELEASE-v0.10.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,43 @@ OpenClaw 2026.2.22 added multilingual memory search for Spanish, Portuguese, Jap

### Keywords Added Across All 12 Dimensions

| Dimension | ES | PT | KO | AR |
| ---------------------- | -- | -- | -- | -- |
| codeKeywords | ✅ | ✅ | ✅ | ✅ |
| reasoningKeywords | ✅ | ✅ | ✅ | ✅ |
| simpleKeywords | ✅ | ✅ | ✅ | ✅ |
| technicalKeywords | ✅ | ✅ | ✅ | ✅ |
| creativeKeywords | ✅ | ✅ | ✅ | ✅ |
| imperativeVerbs | ✅ | ✅ | ✅ | ✅ |
| constraintIndicators | ✅ | ✅ | ✅ | ✅ |
| outputFormatKeywords | ✅ | ✅ | ✅ | ✅ |
| referenceKeywords | ✅ | ✅ | ✅ | ✅ |
| negationKeywords | ✅ | ✅ | ✅ | ✅ |
| domainSpecificKeywords | ✅ | ✅ | ✅ | ✅ |
| agenticTaskKeywords | ✅ | ✅ | ✅ | ✅ |
| Dimension | ES | PT | KO | AR |
| ---------------------- | --- | --- | --- | --- |
| codeKeywords | ✅ | ✅ | ✅ | ✅ |
| reasoningKeywords | ✅ | ✅ | ✅ | ✅ |
| simpleKeywords | ✅ | ✅ | ✅ | ✅ |
| technicalKeywords | ✅ | ✅ | ✅ | ✅ |
| creativeKeywords | ✅ | ✅ | ✅ | ✅ |
| imperativeVerbs | ✅ | ✅ | ✅ | ✅ |
| constraintIndicators | ✅ | ✅ | ✅ | ✅ |
| outputFormatKeywords | ✅ | ✅ | ✅ | ✅ |
| referenceKeywords | ✅ | ✅ | ✅ | ✅ |
| negationKeywords | ✅ | ✅ | ✅ | ✅ |
| domainSpecificKeywords | ✅ | ✅ | ✅ | ✅ |
| agenticTaskKeywords | ✅ | ✅ | ✅ | ✅ |

---

## 📝 Metadata Updates

| File | Change |
| ---------------------- | ----------------------------------- |
| `package.json` | Version 0.10.4 → 0.10.5 |
| `package.json` | Description: "41 models" → "41+" |
| File | Change |
| ---------------------- | ------------------------------------- |
| `package.json` | Version 0.10.4 → 0.10.5 |
| `package.json` | Description: "41 models" → "41+" |
| `openclaw.plugin.json` | "30+ models, 78%" → "41+ models, 92%" |
| `README.md` | All model counts: 38+/30+ → 41+ |
| `README.md` | All model counts: 38+/30+ → 41+ |

---

## 📋 OpenClaw 2026.2.22 Compatibility Notes

| OpenClaw Feature | ClawRouter Impact | Status |
| ------------------------ | ----------------- | ---------- |
| OpenClaw Feature | ClawRouter Impact | Status |
| ------------------------ | ----------------- | ---------------------------------------- |
| Mistral provider support | Add models | ⏳ Pending (blocked on BlockRun backend) |
| Multilingual memory | Keyword expansion | ✅ Done |
| Auto-updater | No impact | ✅ N/A |
| Cron parallel runs | Proxy handles it | ✅ OK |
| 40+ security fixes | No impact | ✅ N/A |
| Multilingual memory | Keyword expansion | ✅ Done |
| Auto-updater | No impact | ✅ N/A |
| Cron parallel runs | Proxy handles it | ✅ OK |
| 40+ security fixes | No impact | ✅ N/A |

---

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blockrun/clawrouter",
"name": "@ampersend_ai/clawrouter-core",
"version": "0.10.6",
"description": "Smart LLM router — save 92% on inference costs. 41+ models, one wallet, x402 micropayments.",
"type": "module",
Expand Down Expand Up @@ -65,7 +65,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/BlockRunAI/ClawRouter.git"
"url": "git+https://github.com/edgeandnode/ClawRouter.git"
},
"dependencies": {
"viem": "^2.39.3"
Expand Down
4 changes: 3 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ async function main(): Promise<void> {
console.log(` ${svc.description}`);
console.log(` Tool: blockrun_${svc.id}`);
console.log(` Method: ${svc.method} /v1${svc.proxyPath}`);
console.log(` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`);
console.log(
` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`,
);
console.log();
}

Expand Down
13 changes: 7 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,9 @@ const plugin: OpenClawPluginDefinition = {
api.registerTool(tool);
}
if (partnerTools.length > 0) {
api.logger.info(`Registered ${partnerTools.length} partner tool(s): ${partnerTools.map((t) => t.name).join(", ")}`);
api.logger.info(
`Registered ${partnerTools.length} partner tool(s): ${partnerTools.map((t) => t.name).join(", ")}`,
);
}

// Register /partners command
Expand All @@ -688,16 +690,15 @@ const plugin: OpenClawPluginDefinition = {
return { text: "No partner APIs available." };
}

const lines = [
"**Partner APIs** (paid via your ClawRouter wallet)",
"",
];
const lines = ["**Partner APIs** (paid via your ClawRouter wallet)", ""];

for (const svc of PARTNER_SERVICES) {
lines.push(`**${svc.name}** (${svc.partner})`);
lines.push(` ${svc.description}`);
lines.push(` Tool: \`${`blockrun_${svc.id}`}\``);
lines.push(` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`);
lines.push(
` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`,
);
lines.push("");
}

Expand Down
5 changes: 1 addition & 4 deletions src/partners/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export type PartnerToolDefinition = {
/**
* Build a single partner tool from a service definition.
*/
function buildTool(
service: PartnerServiceDefinition,
proxyBaseUrl: string,
): PartnerToolDefinition {
function buildTool(service: PartnerServiceDefinition, proxyBaseUrl: string): PartnerToolDefinition {
// Build JSON Schema properties from service params
const properties: Record<string, unknown> = {};
const required: string[] = [];
Expand Down
27 changes: 23 additions & 4 deletions src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,18 @@ export type ProxyOptions = {
/** Port to listen on (default: 8402) */
port?: number;
routingConfig?: Partial<RoutingConfig>;
/**
* Custom payment-enabled fetch function. When provided, replaces the built-in
* x402 payment handler. Use this to integrate alternative payment systems
* (e.g., spend limits, budget enforcement, or custom payment flows).
*
* If not provided, uses built-in createPaymentFetch with walletKey.
*/
paymentFetch?: (
input: RequestInfo | URL,
init?: RequestInit,
preAuth?: PreAuthParams,
) => Promise<Response>;
/** Request timeout in ms (default: 180000 = 3 minutes). Covers on-chain tx + LLM response. */
requestTimeoutMs?: number;
/** Skip balance checks (for testing only). Default: false */
Expand Down Expand Up @@ -970,7 +982,12 @@ async function proxyPartnerRequest(
// Forward headers (strip hop-by-hop)
const headers: Record<string, string> = {};
for (const [key, value] of Object.entries(req.headers)) {
if (key === "host" || key === "connection" || key === "transfer-encoding" || key === "content-length")
if (
key === "host" ||
key === "connection" ||
key === "transfer-encoding" ||
key === "content-length"
)
continue;
if (typeof value === "string") headers[key] = value;
}
Expand Down Expand Up @@ -1022,7 +1039,8 @@ async function proxyPartnerRequest(
baselineCost: 0,
savings: 0,
latencyMs,
partnerId: (req.url?.split("?")[0] ?? "").replace(/^\/v1\//, "").replace(/\//g, "_") || "unknown",
partnerId:
(req.url?.split("?")[0] ?? "").replace(/^\/v1\//, "").replace(/\//g, "_") || "unknown",
service: "partner",
}).catch(() => {});
}
Expand Down Expand Up @@ -1069,9 +1087,10 @@ export async function startProxy(options: ProxyOptions): Promise<ProxyHandle> {
};
}

// Create x402 payment-enabled fetch from wallet private key
// Create x402 payment-enabled fetch from wallet private key (or use custom paymentFetch)
const account = privateKeyToAccount(options.walletKey as `0x${string}`);
const { fetch: payFetch } = createPaymentFetch(options.walletKey as `0x${string}`);
const payFetch =
options.paymentFetch ?? createPaymentFetch(options.walletKey as `0x${string}`).fetch;

// Create balance monitor for pre-request checks
const balanceMonitor = new BalanceMonitor(account.address);
Expand Down
Loading