clawmoney 0.14.6 → 0.14.8
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/dist/commands/relay.js +14 -1
- package/dist/relay/pricing.d.ts +1 -1
- package/dist/relay/pricing.js +7 -4
- package/dist/relay/provider.js +17 -1
- package/package.json +1 -1
package/dist/commands/relay.js
CHANGED
|
@@ -97,7 +97,20 @@ export async function relayRegisterCommand(options) {
|
|
|
97
97
|
const discountPct = Math.round(RELAY_DISCOUNT * 100);
|
|
98
98
|
console.log(chalk.dim(` Buyers pay ${discountPct}% of the official API price — a ${100 - discountPct}% discount applied by the Hub.`));
|
|
99
99
|
console.log("");
|
|
100
|
-
console.log(chalk.
|
|
100
|
+
console.log(chalk.bold(" Next steps"));
|
|
101
|
+
console.log(chalk.dim(` 1. Start the daemon:`));
|
|
102
|
+
console.log(chalk.dim(` clawmoney relay start`));
|
|
103
|
+
if (process.platform === "darwin") {
|
|
104
|
+
console.log(chalk.dim(` 2. (macOS) Install the daemon as a launchd user agent so it`));
|
|
105
|
+
console.log(chalk.dim(` survives logouts AND keeps macOS Keychain unlocked for`));
|
|
106
|
+
console.log(chalk.dim(` Claude API mode (SSH shells can't read a locked Keychain):`));
|
|
107
|
+
console.log(chalk.dim(` ./scripts/install-daemon-launchd.sh`));
|
|
108
|
+
console.log(chalk.dim(` (from the clawmoney-cli repo; see scripts/README for details)`));
|
|
109
|
+
}
|
|
110
|
+
console.log("");
|
|
111
|
+
console.log(chalk.dim(` Tip: the daemon now defaults to direct-API mode (execution_mode: api)`));
|
|
112
|
+
console.log(chalk.dim(` for ~10x lower latency per request. To fall back to subprocess-per-`));
|
|
113
|
+
console.log(chalk.dim(` request mode, set \`relay.execution_mode: cli\` in ~/.clawmoney/config.yaml.`));
|
|
101
114
|
}
|
|
102
115
|
catch (err) {
|
|
103
116
|
regSpinner.fail(chalk.red("Registration failed"));
|
package/dist/relay/pricing.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface ModelPricing {
|
|
|
21
21
|
}
|
|
22
22
|
export declare const API_PRICES: Record<string, ModelPricing>;
|
|
23
23
|
export declare const RELAY_DISCOUNT = 0.2;
|
|
24
|
-
export declare const PLATFORM_FEE = 0.
|
|
24
|
+
export declare const PLATFORM_FEE = 0.1;
|
|
25
25
|
export declare function getModelPricing(model: string): ModelPricing;
|
|
26
26
|
export interface CostBreakdown {
|
|
27
27
|
inputCost: number;
|
package/dist/relay/pricing.js
CHANGED
|
@@ -92,8 +92,8 @@ const DEFAULT_PRICING = { input: 5, output: 25 };
|
|
|
92
92
|
// Concretely, for a 1M-token Claude Sonnet input+output at default rates:
|
|
93
93
|
// API price = 1M × ($3 input + $15 output) = $18
|
|
94
94
|
// Buyer pays (20%) = $3.60
|
|
95
|
-
// Platform fee (
|
|
96
|
-
// Provider earns = $3.
|
|
95
|
+
// Platform fee (10%) = $0.36
|
|
96
|
+
// Provider earns = $3.24
|
|
97
97
|
//
|
|
98
98
|
// Why 20% flat across all platforms:
|
|
99
99
|
// - The Provider's subscription fee is a sunk cost; their marginal cost
|
|
@@ -107,8 +107,11 @@ const DEFAULT_PRICING = { input: 5, output: 25 };
|
|
|
107
107
|
// we can revisit and split into per-cli_type rates.
|
|
108
108
|
// Relay discount: consumers pay this fraction of API price
|
|
109
109
|
export const RELAY_DISCOUNT = 0.20; // 20% of API price (buyer saves 80%)
|
|
110
|
-
// Platform fee: this fraction of what the buyer pays goes to the platform
|
|
111
|
-
|
|
110
|
+
// Platform fee: this fraction of what the buyer pays goes to the platform.
|
|
111
|
+
// On-chain this is enforced by the PaySplitter contract (feeBps = 1000 = 10%
|
|
112
|
+
// on Base mainnet 0x998f7F6D22ac38cf1196c62f628c6a3956Ff97Db). This constant
|
|
113
|
+
// is display-only for the CLI; the real split happens in the contract.
|
|
114
|
+
export const PLATFORM_FEE = 0.10; // 10%
|
|
112
115
|
export function getModelPricing(model) {
|
|
113
116
|
return API_PRICES[model] ?? DEFAULT_PRICING;
|
|
114
117
|
}
|
package/dist/relay/provider.js
CHANGED
|
@@ -32,9 +32,25 @@ import { relayLogger as logger } from "./logger.js";
|
|
|
32
32
|
const CONFIG_DIR = join(homedir(), ".clawmoney");
|
|
33
33
|
const CONFIG_FILE = join(CONFIG_DIR, "config.yaml");
|
|
34
34
|
const PID_FILE = join(CONFIG_DIR, "relay.pid");
|
|
35
|
+
// Default execution mode is `api` as of 0.14.7. The `cli` fallback is still
|
|
36
|
+
// supported — set `relay.execution_mode: cli` in ~/.clawmoney/config.yaml
|
|
37
|
+
// or export CLAWMONEY_RELAY_EXECUTION_MODE=cli at launch — but new
|
|
38
|
+
// providers get the direct-API path by default because:
|
|
39
|
+
// - Every spawnCli() round-trip burns 2-5 seconds of cold start, which
|
|
40
|
+
// is far too much for a request/response relay where buyers expect
|
|
41
|
+
// sub-second handoff.
|
|
42
|
+
// - Each subprocess consumes its own RAM + file handles; API mode runs
|
|
43
|
+
// hundreds of concurrent calls out of one Node process.
|
|
44
|
+
// - The fingerprint gap that used to make CLI mode "safer" is now
|
|
45
|
+
// closed — 0.14.0–0.14.6 ported the real CLI's attribution hash,
|
|
46
|
+
// streaming transport, thinking config, dynamic beta header, session
|
|
47
|
+
// masking, Gemini startup warmup, and Codex per-turn prewarm. API
|
|
48
|
+
// mode now matches real-CLI wire shape on every upstream.
|
|
49
|
+
// CLI mode will be removed entirely in 0.15.0 once we've observed a
|
|
50
|
+
// week of API-mode-default in production.
|
|
35
51
|
const DEFAULT_RELAY = {
|
|
36
52
|
cli_type: "claude",
|
|
37
|
-
execution_mode: "
|
|
53
|
+
execution_mode: "api",
|
|
38
54
|
model: "claude-opus-4-6",
|
|
39
55
|
mode: "chat",
|
|
40
56
|
concurrency: 5,
|