clawmoney 0.15.57 → 0.15.59
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.
|
@@ -11,6 +11,7 @@ import { setupCommand } from "./setup.js";
|
|
|
11
11
|
import { API_PRICES, PLATFORM_FEE } from "../relay/pricing.js";
|
|
12
12
|
import { hasClaudeFingerprint, bootstrapClaudeFingerprint, } from "../relay/upstream/claude-bootstrap.js";
|
|
13
13
|
import { hasGeminiFingerprint, bootstrapGeminiFingerprint, } from "../relay/upstream/gemini-bootstrap.js";
|
|
14
|
+
import { hasCodexFingerprint, bootstrapCodexFingerprint, } from "../relay/upstream/codex-bootstrap.js";
|
|
14
15
|
// ── Per-cli_type model catalogs ──
|
|
15
16
|
//
|
|
16
17
|
// `RECOMMENDED_MODELS` is what gets registered when the user picks "all
|
|
@@ -222,11 +223,10 @@ export async function relaySetupCommand() {
|
|
|
222
223
|
})));
|
|
223
224
|
}
|
|
224
225
|
if (selectedClis.includes("gemini") && !hasGeminiFingerprint()) {
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
tasks.push(bootstrapGeminiFingerprint({ timeoutMs: 25_000 })
|
|
226
|
+
// Gemini's capture typically completes in 5-15s on a working
|
|
227
|
+
// network. 45s is generous headroom for token refresh
|
|
228
|
+
// round-trips through a slow HTTPS_PROXY.
|
|
229
|
+
tasks.push(bootstrapGeminiFingerprint({ timeoutMs: 45_000 })
|
|
230
230
|
.then((fp) => ({
|
|
231
231
|
cli: "gemini",
|
|
232
232
|
ok: true,
|
|
@@ -238,7 +238,24 @@ export async function relaySetupCommand() {
|
|
|
238
238
|
error: err.message,
|
|
239
239
|
})));
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
if (selectedClis.includes("codex") && !hasCodexFingerprint()) {
|
|
242
|
+
// Codex fingerprint is technically optional (codex-api.ts
|
|
243
|
+
// falls back to safe DEFAULT_ORIGINATOR / DEFAULT_OPENAI_BETA
|
|
244
|
+
// when the file is missing), but the daemon logs a WARN on
|
|
245
|
+
// every start. Capturing once during setup silences the
|
|
246
|
+
// warning and gives per-machine accuracy for anti-ban.
|
|
247
|
+
tasks.push(bootstrapCodexFingerprint({ timeoutMs: 60_000 })
|
|
248
|
+
.then(() => ({
|
|
249
|
+
cli: "codex",
|
|
250
|
+
ok: true,
|
|
251
|
+
summary: "from chatgpt.com WS upgrade",
|
|
252
|
+
}))
|
|
253
|
+
.catch((err) => ({
|
|
254
|
+
cli: "codex",
|
|
255
|
+
ok: false,
|
|
256
|
+
error: err.message,
|
|
257
|
+
})));
|
|
258
|
+
}
|
|
242
259
|
if (tasks.length === 0)
|
|
243
260
|
return [];
|
|
244
261
|
return Promise.all(tasks);
|
|
@@ -274,10 +291,9 @@ export async function relaySetupCommand() {
|
|
|
274
291
|
// fingerprint file.
|
|
275
292
|
const startLine = `${chalk.gray("◇")} Configuring providers`;
|
|
276
293
|
process.stdout.write(startLine);
|
|
277
|
-
const tickEvery = 500;
|
|
278
294
|
const ticker = setInterval(() => {
|
|
279
295
|
process.stdout.write(chalk.dim("."));
|
|
280
|
-
},
|
|
296
|
+
}, 1200);
|
|
281
297
|
const results = await runAllBootstraps();
|
|
282
298
|
clearInterval(ticker);
|
|
283
299
|
try {
|
|
@@ -276,22 +276,17 @@ export async function bootstrapClaudeFingerprint(opts = {}) {
|
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
278
|
const port = addr.port;
|
|
279
|
-
//
|
|
280
|
-
//
|
|
281
|
-
//
|
|
282
|
-
//
|
|
279
|
+
// Inherit HTTPS_PROXY so claude can reach sso.anthropic.com
|
|
280
|
+
// for OAuth refresh if its cached token is near expiry —
|
|
281
|
+
// same reason gemini-bootstrap keeps it. NO_PROXY=127.0.0.1
|
|
282
|
+
// keeps claude's call to our local listener from tunneling
|
|
283
|
+
// through the proxy.
|
|
283
284
|
const childEnv = {
|
|
284
285
|
...process.env,
|
|
285
286
|
ANTHROPIC_BASE_URL: `http://127.0.0.1:${port}`,
|
|
286
287
|
NO_PROXY: "127.0.0.1,localhost",
|
|
287
288
|
no_proxy: "127.0.0.1,localhost",
|
|
288
289
|
};
|
|
289
|
-
delete childEnv.HTTPS_PROXY;
|
|
290
|
-
delete childEnv.https_proxy;
|
|
291
|
-
delete childEnv.HTTP_PROXY;
|
|
292
|
-
delete childEnv.http_proxy;
|
|
293
|
-
delete childEnv.ALL_PROXY;
|
|
294
|
-
delete childEnv.all_proxy;
|
|
295
290
|
// Launch `claude -p "hi"` — same command the manual capture
|
|
296
291
|
// script documents. `-p` is non-interactive print mode; in
|
|
297
292
|
// recent claude versions it skips the trust dialog for
|
|
@@ -158,22 +158,23 @@ export async function bootstrapCodexFingerprint(opts = {}) {
|
|
|
158
158
|
resolve();
|
|
159
159
|
}
|
|
160
160
|
}, 500);
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
161
|
+
// DO inherit HTTPS_PROXY — codex CLI may need it to refresh
|
|
162
|
+
// its OAuth token via chatgpt.com's auth endpoint. Same
|
|
163
|
+
// reasoning as claude/gemini (see gemini-bootstrap.ts).
|
|
164
|
+
// NO_PROXY=127.0.0.1 keeps the ws upgrade to our local
|
|
165
|
+
// capture proxy from being tunneled through HTTPS_PROXY.
|
|
164
166
|
const childEnv = {
|
|
165
167
|
...process.env,
|
|
166
168
|
OPENAI_BASE_URL: `http://127.0.0.1:${CAPTURE_PORT}/v1`,
|
|
167
169
|
NO_PROXY: "127.0.0.1,localhost",
|
|
168
170
|
no_proxy: "127.0.0.1,localhost",
|
|
169
171
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
codexChild = spawn("codex", ["-p", "hi"], {
|
|
172
|
+
// Codex CLI uses `codex exec <prompt>` for non-interactive
|
|
173
|
+
// runs. `-p` is --profile (and `hi` is a profile name that
|
|
174
|
+
// doesn't exist → code 1 before any request goes out).
|
|
175
|
+
// --skip-git-repo-check avoids codex bailing if the cwd
|
|
176
|
+
// isn't inside a git repo.
|
|
177
|
+
codexChild = spawn("codex", ["exec", "--skip-git-repo-check", "say ok"], {
|
|
177
178
|
env: childEnv,
|
|
178
179
|
stdio: ["ignore", "pipe", "pipe"],
|
|
179
180
|
shell: process.platform === "win32",
|
|
@@ -152,20 +152,18 @@ export async function bootstrapGeminiFingerprint(opts = {}) {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}, 500);
|
|
155
|
-
//
|
|
156
|
-
//
|
|
155
|
+
// DO inherit HTTPS_PROXY — gemini CLI needs it to reach
|
|
156
|
+
// oauth2.googleapis.com for token refresh (see gemini-api.ts
|
|
157
|
+
// line 184). NO_PROXY=127.0.0.1 makes gemini bypass the proxy
|
|
158
|
+
// for our local capture listener, so HTTPS_PROXY + NO_PROXY
|
|
159
|
+
// together give gemini proxy access to Google AND direct
|
|
160
|
+
// access to our listener.
|
|
157
161
|
const childEnv = {
|
|
158
162
|
...process.env,
|
|
159
163
|
CODE_ASSIST_ENDPOINT: `http://127.0.0.1:${CAPTURE_PORT}`,
|
|
160
164
|
NO_PROXY: "127.0.0.1,localhost",
|
|
161
165
|
no_proxy: "127.0.0.1,localhost",
|
|
162
166
|
};
|
|
163
|
-
delete childEnv.HTTPS_PROXY;
|
|
164
|
-
delete childEnv.https_proxy;
|
|
165
|
-
delete childEnv.HTTP_PROXY;
|
|
166
|
-
delete childEnv.http_proxy;
|
|
167
|
-
delete childEnv.ALL_PROXY;
|
|
168
|
-
delete childEnv.all_proxy;
|
|
169
167
|
geminiChild = spawn("gemini", ["-p", "hi"], {
|
|
170
168
|
env: childEnv,
|
|
171
169
|
stdio: ["ignore", "pipe", "pipe"],
|