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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"node": ">=22.12.0"
},
"exports": {
"./openclaw": "./src/openclaw/index.ts",
"./client": "./src/client/index.ts",
"./client": "./src/client/consumer/index.ts",
"./setup": "./src/config/setup-programmatic.ts",
"./start": "./src/start-programmatic.ts"
},
Expand All @@ -25,6 +24,8 @@
"dependencies": {
"@clack/prompts": "^1.0.1",
"@coinbase/cdp-sdk": "^1.44.1",
"@mariozechner/pi-ai": "0.53.0",
"@mariozechner/pi-coding-agent": "0.53.0",
"jose": "^6.1.3",
"open": "^11.0.0",
"viem": "^2.45.3",
Expand Down
2,765 changes: 2,694 additions & 71 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/cli/setup-non-interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
*
* Required env vars:
* SIXERR_WALLET_TYPE — "coinbase" | "local" | "imported"
* SIXERR_AGENT_NAME — Display name for the provider
* SIXERR_AGENT_NAME — Display name for the supplier
*
* Conditional env vars:
* CDP_API_KEY_ID — Required when walletType=coinbase
Expand All @@ -22,7 +22,7 @@ import {
* SIXERR_KEYSTORE_PASSWORD — Required when walletType=local|imported
*
* Optional env vars:
* SIXERR_AGENT_DESCRIPTION — Provider description
* SIXERR_AGENT_DESCRIPTION — Supplier description
* SIXERR_AGENT_ID — Explicit agentId (defaults to wallet address)
* SIXERR_IDENTITY_SOURCE — "erc8004" | "local" (default: "local")
* SIXERR_INPUT_TOKEN_PRICE — Atomic USDC per input token (default: "1")
Expand Down
4 changes: 2 additions & 2 deletions src/cli/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ export async function runSetup(): Promise<void> {

const nameInput = await text({
message: "Agent display name:",
placeholder: "My Sixerr Provider",
placeholder: "My Sixerr Supplier",
validate: (v) => (!v ? "Name is required" : undefined),
});
handleCancel(nameInput);
agentName = nameInput;

const descInput = await text({
message: "Agent description:",
placeholder: "Fast inference provider running Claude",
placeholder: "Fast inference supplier running Claude",
});
handleCancel(descInput);
agentDescription = descInput;
Expand Down
21 changes: 14 additions & 7 deletions src/cli/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import { createCdpSigner } from "../wallet/cdp-signer.js";
import { createLocalSigner } from "../wallet/local-signer.js";
import { decryptKeystore } from "../wallet/keystore.js";
import type { KeystoreV3 } from "../wallet/keystore.js";
import { authenticateProgrammatic } from "../auth/programmatic.js";
import { authenticateProgrammatic } from "../client/auth/programmatic.js";
import { startPlugin } from "../plugin.js";
import type { WalletSigner } from "../wallet/types.js";
import { SixerrClient, createLocalPaymentSigner, createCdpPaymentSigner } from "../client/index.js";
import { SixerrClient, createLocalPaymentSigner, createCdpPaymentSigner } from "../client/consumer/index.js";
import { createHttpProxy } from "../proxy/http-proxy.js";
import type { PaymentSigner } from "../client/types.js";
import type { PaymentSigner } from "../client/consumer/types.js";
import { resolveInferenceConfig } from "../client/supplier/inference/model-resolver.js";

// ---------------------------------------------------------------------------
// Start Command
Expand Down Expand Up @@ -48,7 +49,14 @@ export async function runStart(): Promise<void> {
log.info(`Server: ${config.serverUrl}`);

// -------------------------------------------------------------------------
// 2. Resolve wallet signer (BEFORE challenge fetch — nonce expiry safe)
// 2. Resolve LLM inference configuration (fail fast before auth/connect)
// -------------------------------------------------------------------------

const inferenceConfig = resolveInferenceConfig();
log.info(`Model: ${inferenceConfig.provider}/${inferenceConfig.model}`);

// -------------------------------------------------------------------------
// 3. Resolve wallet signer (BEFORE challenge fetch — nonce expiry safe)
// -------------------------------------------------------------------------

let signer: WalletSigner;
Expand Down Expand Up @@ -124,7 +132,7 @@ export async function runStart(): Promise<void> {
log.info(`Agent ID: ${authResult.agentId}`);
}

// Persist JWT to config for OpenClaw provider registration
// Persist JWT to config for OpenClaw supplier registration
await saveConfig({ ...config, jwt: authJwt });
} catch (err) {
authSpinner.stop("Authentication failed");
Expand Down Expand Up @@ -163,8 +171,7 @@ export async function runStart(): Promise<void> {
const handle = startPlugin({
serverUrl: wsUrl,
jwt: authJwt,
openClawToken: config.openClawToken,
openClawUrl: config.openClawUrl,
inferenceConfig,
pricing: config.pricing,
agentName: config.agentCard?.name,
agentDescription: config.agentCard?.description,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WalletSigner } from "../wallet/types.js";
import type { WalletSigner } from "../../wallet/types.js";

// ---------------------------------------------------------------------------
// Types
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ export class SixerrClient {
}

/**
* List available providers from the server catalog.
* List available suppliers from the server catalog.
*/
async listProviders(): Promise<unknown> {
const res = await fetch(`${this.serverUrl}/v1/providers`);
async listSuppliers(): Promise<unknown> {
const res = await fetch(`${this.serverUrl}/v1/suppliers`);
if (!res.ok) {
throw new Error(`Failed to fetch providers (${res.status})`);
throw new Error(`Failed to fetch suppliers (${res.status})`);
}
return res.json();
}
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions src/client/supplier/inference/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { handleIncomingRequest } from "./inference-handler.js";
export { resolveInferenceConfig, resolveAgentDir } from "./model-resolver.js";
export type { InferenceConfig } from "./types.js";
Loading