ccman 3.3.18 → 3.3.20
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/index.js +69 -56
- package/dist/templates/codex/config.toml +0 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -422,7 +422,7 @@ var init_codex = __esm({
|
|
|
422
422
|
};
|
|
423
423
|
GMN_PROVIDER_HOSTS = [
|
|
424
424
|
"gmn.chuangzuoli.com",
|
|
425
|
-
"cdn.
|
|
425
|
+
"cdn-gmn.chuangzuoli.com",
|
|
426
426
|
"gmncodex.com",
|
|
427
427
|
"gmncode.cn",
|
|
428
428
|
"cdn.gmncode.cn",
|
|
@@ -7330,63 +7330,70 @@ function pickDefaultEndpoint(results) {
|
|
|
7330
7330
|
return sortEndpointProbeResults(results)[0];
|
|
7331
7331
|
}
|
|
7332
7332
|
|
|
7333
|
-
// src/
|
|
7334
|
-
var DEFAULT_PROVIDER_NAME2 = "gmn";
|
|
7335
|
-
var VALID_PLATFORMS = ["codex", "opencode", "openclaw"];
|
|
7336
|
-
var DEFAULT_PLATFORMS = ["codex", "opencode"];
|
|
7337
|
-
var GMN_BASE_URLS = [
|
|
7338
|
-
{
|
|
7339
|
-
label: "\u539F\u59CB\u5730\u5740",
|
|
7340
|
-
url: "https://gmn.chuangzuoli.com",
|
|
7341
|
-
description: "GMN \u539F\u59CB\u5165\u53E3"
|
|
7342
|
-
},
|
|
7343
|
-
{
|
|
7344
|
-
label: "\u65E7\u57DF\u540D CDN",
|
|
7345
|
-
url: "https://cdn.gmnchuangzuoli.com",
|
|
7346
|
-
description: "CDN \u56DE\u56FD\u52A0\u901F"
|
|
7347
|
-
},
|
|
7348
|
-
{
|
|
7349
|
-
label: "\u963F\u91CC\u4E91 CDN",
|
|
7350
|
-
url: "https://gmncodex.com",
|
|
7351
|
-
description: "\u963F\u91CC\u4E91\u89E3\u6790 CDN \u56DE\u56FD\u52A0\u901F"
|
|
7352
|
-
},
|
|
7353
|
-
{
|
|
7354
|
-
label: "\u5168\u7403\u8FB9\u7F18 A",
|
|
7355
|
-
url: "https://gmncode.cn",
|
|
7356
|
-
description: "\u5168\u7403\u8FB9\u7F18\u8282\u70B9\u52A0\u901F"
|
|
7357
|
-
},
|
|
7358
|
-
{
|
|
7359
|
-
label: "CF CDN A",
|
|
7360
|
-
url: "https://cdn.gmncode.cn",
|
|
7361
|
-
description: "CF \u89E3\u6790 CDN \u56DE\u56FD\u52A0\u901F"
|
|
7362
|
-
},
|
|
7363
|
-
{
|
|
7364
|
-
label: "\u5168\u7403\u8FB9\u7F18 B",
|
|
7365
|
-
url: "https://gmn.codex.com",
|
|
7366
|
-
description: "\u5168\u7403\u8FB9\u7F18\u8282\u70B9\u52A0\u901F"
|
|
7367
|
-
},
|
|
7368
|
-
{
|
|
7369
|
-
label: "CF CDN B",
|
|
7370
|
-
url: "https://cdn.gmncode.com",
|
|
7371
|
-
description: "CF \u89E3\u6790 CDN \u56DE\u56FD\u52A0\u901F"
|
|
7372
|
-
}
|
|
7373
|
-
];
|
|
7333
|
+
// src/utils/gmn-endpoints.ts
|
|
7374
7334
|
var GMN_PROFILE = {
|
|
7375
7335
|
commandName: "gmn",
|
|
7376
7336
|
title: "GMN",
|
|
7377
|
-
|
|
7337
|
+
endpointGroupLabel: "GMN \u57DF\u540D\u7EBF\u8DEF",
|
|
7338
|
+
endpointGroupDescription: "\u4EC5\u5305\u542B\u4E3B\u57DF\u540D\u548C CDN \u7684 2 \u6761\u5730\u5740",
|
|
7339
|
+
baseUrls: [
|
|
7340
|
+
{
|
|
7341
|
+
label: "GMN \u4E3B\u7AD9",
|
|
7342
|
+
url: "https://gmn.chuangzuoli.com",
|
|
7343
|
+
description: "GMN \u4E3B\u57DF\u540D\u5165\u53E3"
|
|
7344
|
+
},
|
|
7345
|
+
{
|
|
7346
|
+
label: "GMN CDN",
|
|
7347
|
+
url: "https://cdn-gmn.chuangzuoli.com",
|
|
7348
|
+
description: "GMN CDN \u52A0\u901F\u5165\u53E3"
|
|
7349
|
+
}
|
|
7350
|
+
]
|
|
7378
7351
|
};
|
|
7379
7352
|
var GMN1_PROFILE = {
|
|
7380
7353
|
commandName: "gmn1",
|
|
7381
7354
|
title: "GMN1",
|
|
7355
|
+
endpointGroupLabel: "\u6269\u5C55\u52A0\u901F\u7EBF\u8DEF",
|
|
7356
|
+
endpointGroupDescription: "\u5305\u542B\u9664 chuangzuoli \u4E4B\u5916\u7684\u5176\u4F59 5 \u6761\u5730\u5740",
|
|
7382
7357
|
baseUrls: [
|
|
7383
7358
|
{
|
|
7384
|
-
label: "
|
|
7359
|
+
label: "\u963F\u91CC\u4E91 CDN",
|
|
7360
|
+
url: "https://gmncodex.com",
|
|
7361
|
+
description: "\u963F\u91CC\u4E91\u89E3\u6790 CDN \u56DE\u56FD\u52A0\u901F"
|
|
7362
|
+
},
|
|
7363
|
+
{
|
|
7364
|
+
label: "\u5168\u7403\u8FB9\u7F18 A",
|
|
7385
7365
|
url: "https://gmncode.cn",
|
|
7386
7366
|
description: "\u5168\u7403\u8FB9\u7F18\u8282\u70B9\u52A0\u901F"
|
|
7367
|
+
},
|
|
7368
|
+
{
|
|
7369
|
+
label: "CF CDN A",
|
|
7370
|
+
url: "https://cdn.gmncode.cn",
|
|
7371
|
+
description: "CF \u89E3\u6790 CDN \u56DE\u56FD\u52A0\u901F"
|
|
7372
|
+
},
|
|
7373
|
+
{
|
|
7374
|
+
label: "\u5168\u7403\u8FB9\u7F18 B",
|
|
7375
|
+
url: "https://gmn.codex.com",
|
|
7376
|
+
description: "\u5168\u7403\u8FB9\u7F18\u8282\u70B9\u52A0\u901F"
|
|
7377
|
+
},
|
|
7378
|
+
{
|
|
7379
|
+
label: "CF CDN B",
|
|
7380
|
+
url: "https://cdn.gmncode.com",
|
|
7381
|
+
description: "CF \u89E3\u6790 CDN \u56DE\u56FD\u52A0\u901F"
|
|
7387
7382
|
}
|
|
7388
7383
|
]
|
|
7389
7384
|
};
|
|
7385
|
+
function getEndpointHost(url) {
|
|
7386
|
+
return new URL(url).host;
|
|
7387
|
+
}
|
|
7388
|
+
function formatEndpointChoiceLabel(result, index) {
|
|
7389
|
+
const latencyText = result.latencyMs === null ? result.error || "\u6D4B\u901F\u5931\u8D25" : `${result.latencyMs} ms`;
|
|
7390
|
+
return `${index + 1}. ${result.label} | ${getEndpointHost(result.url)} | ${latencyText}`;
|
|
7391
|
+
}
|
|
7392
|
+
|
|
7393
|
+
// src/commands/gmn.ts
|
|
7394
|
+
var DEFAULT_PROVIDER_NAME2 = "gmn";
|
|
7395
|
+
var VALID_PLATFORMS = ["codex", "opencode", "openclaw"];
|
|
7396
|
+
var DEFAULT_PLATFORMS = ["codex", "opencode"];
|
|
7390
7397
|
var TOTAL_STEPS = 4;
|
|
7391
7398
|
var BASE_URL_PROBE_SAMPLE_COUNT = 3;
|
|
7392
7399
|
var BASE_URL_PROBE_TIMEOUT_MS = 2500;
|
|
@@ -7518,18 +7525,24 @@ function buildProbeCandidates(baseUrls, platforms) {
|
|
|
7518
7525
|
probeUrl: openClawOnly ? buildOpenClawBaseUrl(item.url) : item.url
|
|
7519
7526
|
}));
|
|
7520
7527
|
}
|
|
7521
|
-
function printBaseUrlProbeResults(results, platforms) {
|
|
7528
|
+
function printBaseUrlProbeResults(profile, results, platforms) {
|
|
7522
7529
|
const usingOpenClawPath = platforms.length === 1 && platforms[0] === "openclaw";
|
|
7530
|
+
console.log(chalk54.bold(`\u5F53\u524D\u6D4B\u901F\u8303\u56F4\uFF1A${profile.endpointGroupLabel}`));
|
|
7531
|
+
console.log(chalk54.gray(`${profile.endpointGroupDescription}\uFF08\u5171 ${results.length} \u6761\uFF09`));
|
|
7523
7532
|
console.log(
|
|
7524
7533
|
chalk54.gray(
|
|
7525
7534
|
`\u6D4B\u901F\u65B9\u5F0F\uFF1AHTTPS \u9996\u5305\u5EF6\u8FDF\uFF08${BASE_URL_PROBE_SAMPLE_COUNT} \u6B21\u4E2D\u4F4D\u6570\uFF09${usingOpenClawPath ? "\uFF0C\u5F53\u524D\u4EC5\u68C0\u6D4B OpenClaw \u7684 /v1 \u7AEF\u70B9" : ""}`
|
|
7526
7535
|
)
|
|
7527
7536
|
);
|
|
7528
|
-
|
|
7537
|
+
console.log();
|
|
7538
|
+
for (const [index, result] of results.entries()) {
|
|
7529
7539
|
const latencyText = result.latencyMs === null ? chalk54.red(formatLatency(result)) : chalk54.green(formatLatency(result));
|
|
7530
|
-
console.log(` ${chalk54.cyan(
|
|
7531
|
-
console.log(chalk54.gray(`
|
|
7532
|
-
console.log(chalk54.gray(`
|
|
7540
|
+
console.log(` ${chalk54.cyan(`${index + 1}. ${result.label}`)}`);
|
|
7541
|
+
console.log(chalk54.gray(` \u57DF\u540D: ${getEndpointHost(result.url)}`));
|
|
7542
|
+
console.log(chalk54.gray(` \u5730\u5740: ${result.url}`));
|
|
7543
|
+
console.log(chalk54.gray(` \u8BF4\u660E: ${result.description}`));
|
|
7544
|
+
console.log(` \u5EF6\u8FDF: ${latencyText}`);
|
|
7545
|
+
console.log();
|
|
7533
7546
|
}
|
|
7534
7547
|
}
|
|
7535
7548
|
async function resolveOpenAiBaseUrl(profile, platforms, baseUrlArg) {
|
|
@@ -7547,13 +7560,13 @@ async function resolveOpenAiBaseUrl(profile, platforms, baseUrlArg) {
|
|
|
7547
7560
|
if (probeResults.length === 0) {
|
|
7548
7561
|
throw new Error("\u6CA1\u6709\u53EF\u7528\u7684 Base URL \u5019\u9009\u9879");
|
|
7549
7562
|
}
|
|
7550
|
-
printBaseUrlProbeResults(probeResults, platforms);
|
|
7563
|
+
printBaseUrlProbeResults(profile, probeResults, platforms);
|
|
7551
7564
|
const defaultResult = pickDefaultEndpoint(probeResults) || probeResults[0];
|
|
7552
7565
|
const allFailed = probeResults.every((result) => result.latencyMs === null);
|
|
7553
7566
|
if (allFailed) {
|
|
7554
7567
|
console.log(chalk54.yellow("\u26A0\uFE0F \u6240\u6709\u5019\u9009\u5730\u5740\u6D4B\u901F\u5931\u8D25\uFF0C\u5C06\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u5730\u5740\uFF0C\u4F60\u4E5F\u53EF\u4EE5\u624B\u52A8\u5207\u6362\u3002"));
|
|
7555
7568
|
} else {
|
|
7556
|
-
console.log(chalk54.gray(`\u9ED8\u8BA4\u5DF2\u9009\u5EF6\u8FDF\
|
|
7569
|
+
console.log(chalk54.gray(`\u9ED8\u8BA4\u5DF2\u9009\u6700\u4F4E\u5EF6\u8FDF\u7EBF\u8DEF\uFF1A${defaultResult.url}`));
|
|
7557
7570
|
}
|
|
7558
7571
|
if (probeResults.length === 1) {
|
|
7559
7572
|
console.log(chalk54.green(`\u5DF2\u81EA\u52A8\u9009\u62E9: ${defaultResult.url}`));
|
|
@@ -7567,9 +7580,9 @@ async function resolveOpenAiBaseUrl(profile, platforms, baseUrlArg) {
|
|
|
7567
7580
|
{
|
|
7568
7581
|
type: "list",
|
|
7569
7582
|
name: "baseUrl",
|
|
7570
|
-
message: "\u9009\u62E9\u8981\u4F7F\u7528\u7684 Base URL\uFF08\u9ED8\u8BA4\u5DF2\u9009\u5EF6\u8FDF\
|
|
7571
|
-
choices: probeResults.map((result) => ({
|
|
7572
|
-
name:
|
|
7583
|
+
message: "\u9009\u62E9\u8981\u4F7F\u7528\u7684 Base URL\uFF08\u9ED8\u8BA4\u5DF2\u9009\u6700\u4F4E\u5EF6\u8FDF\uFF0C\u53EF\u53C2\u8003\u4E0A\u65B9\u7F16\u53F7\uFF09:",
|
|
7584
|
+
choices: probeResults.map((result, index) => ({
|
|
7585
|
+
name: formatEndpointChoiceLabel(result, index),
|
|
7573
7586
|
value: result.url
|
|
7574
7587
|
})),
|
|
7575
7588
|
default: defaultResult.url
|
|
@@ -7903,10 +7916,10 @@ sync.action(async () => {
|
|
|
7903
7916
|
});
|
|
7904
7917
|
exportCommand(program);
|
|
7905
7918
|
importCommand(program);
|
|
7906
|
-
program.command("gmn [apiKey]").description("\u914D\u7F6E GMN \u5230 Codex\u3001OpenCode\u3001OpenClaw\uFF08\
|
|
7919
|
+
program.command("gmn [apiKey]").description("\u914D\u7F6E GMN \u5230 Codex\u3001OpenCode\u3001OpenClaw\uFF08\u6D4B\u901F\u5E76\u9009\u62E9\u6700\u4F4E\u5EF6\u8FDF\u8DEF\u7EBF\uFF09").option("-p, --platform <platforms>", "\u6307\u5B9A\u5E73\u53F0 (codex,opencode,openclaw,all)").option("-n, --name <providerName>", "\u6307\u5B9A\u670D\u52A1\u5546\u540D\u79F0\uFF08\u9ED8\u8BA4: gmn\uFF09").option("-b, --base-url <baseUrl>", "\u6307\u5B9A Base URL\uFF1B\u4E0D\u6307\u5B9A\u65F6\u81EA\u52A8\u6D4B\u901F\u5E76\u53EF\u624B\u52A8\u5207\u6362").action(async (apiKey, options) => {
|
|
7907
7920
|
await gmnCommand(apiKey, options.platform, options.name, options.baseUrl);
|
|
7908
7921
|
});
|
|
7909
|
-
program.command("gmn1 [apiKey]").alias("gmncode").description("\u914D\u7F6E GMN1 \u5230 Codex\u3001OpenCode\u3001OpenClaw\uFF08\
|
|
7922
|
+
program.command("gmn1 [apiKey]").alias("gmncode").description("\u914D\u7F6E GMN1 \u5230 Codex\u3001OpenCode\u3001OpenClaw\uFF08\u6D4B\u901F\u5E76\u9009\u62E9\u6700\u4F4E\u5EF6\u8FDF\u8DEF\u7EBF\uFF09").option("-p, --platform <platforms>", "\u6307\u5B9A\u5E73\u53F0 (codex,opencode,openclaw,all)").option("-n, --name <providerName>", "\u6307\u5B9A\u670D\u52A1\u5546\u540D\u79F0\uFF08\u9ED8\u8BA4: gmn\uFF09").option("-b, --base-url <baseUrl>", "\u6307\u5B9A Base URL\uFF1B\u4E0D\u6307\u5B9A\u65F6\u81EA\u52A8\u6D4B\u901F\u5E76\u53EF\u624B\u52A8\u5207\u6362").action(async (apiKey, options) => {
|
|
7910
7923
|
await gmn1Command(apiKey, options.platform, options.name, options.baseUrl);
|
|
7911
7924
|
});
|
|
7912
7925
|
(async () => {
|