codexuse-cli 3.0.2 → 3.1.0
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 +32 -19
- package/dist/index.js.map +1 -1
- package/dist/server/index.mjs +423 -79
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -2212,6 +2212,7 @@ async function runDaemonStart(options) {
|
|
|
2212
2212
|
T3CODE_AUTH_TOKEN: authToken,
|
|
2213
2213
|
T3CODE_STATE_DIR: stateDir,
|
|
2214
2214
|
T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD: projectPath ? "1" : "0",
|
|
2215
|
+
CODEXUSE_TELEGRAM_RUNTIME_OWNER: "daemon",
|
|
2215
2216
|
...telegramBotToken ? {
|
|
2216
2217
|
CODEXUSE_TELEGRAM_BOT_TOKEN: telegramBotToken,
|
|
2217
2218
|
CODEXUSE_TELEGRAM_BRIDGE_ENABLED: "1"
|
|
@@ -3292,21 +3293,24 @@ function getActiveOffer() {
|
|
|
3292
3293
|
checkoutBaseUrl: "https://hweihwang.gumroad.com/l/codex-use"
|
|
3293
3294
|
};
|
|
3294
3295
|
}
|
|
3295
|
-
function buildCheckoutUrl(offer2,
|
|
3296
|
+
function buildCheckoutUrl(offer2, options) {
|
|
3296
3297
|
const base = offer2.checkoutBaseUrl;
|
|
3297
3298
|
const withCoupon = offer2.isActive && offer2.couponCode ? `${base}/${offer2.couponCode}` : base;
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3299
|
+
const url = new URL(withCoupon);
|
|
3300
|
+
if (options?.directCheckout) {
|
|
3301
|
+
url.searchParams.set("wanted", "true");
|
|
3302
|
+
}
|
|
3303
|
+
if (!options?.source || !options?.medium) {
|
|
3304
|
+
return url.toString();
|
|
3305
|
+
}
|
|
3306
|
+
url.searchParams.set("utm_source", options.source);
|
|
3307
|
+
url.searchParams.set("utm_medium", options.medium);
|
|
3308
|
+
if (options.campaign) {
|
|
3309
|
+
url.searchParams.set("utm_campaign", options.campaign);
|
|
3306
3310
|
} else if (offer2.campaign) {
|
|
3307
|
-
|
|
3311
|
+
url.searchParams.set("utm_campaign", offer2.campaign);
|
|
3308
3312
|
}
|
|
3309
|
-
return
|
|
3313
|
+
return url.toString();
|
|
3310
3314
|
}
|
|
3311
3315
|
|
|
3312
3316
|
// ../../packages/runtime-profiles/src/license/service.ts
|
|
@@ -3314,6 +3318,7 @@ var offer = getActiveOffer();
|
|
|
3314
3318
|
var PRODUCT_PERMALINK = offer.productPermalink;
|
|
3315
3319
|
var PRODUCT_ID = "3_CcyVEXt2FOMiEpPx8xzw==";
|
|
3316
3320
|
var PRODUCT_URL = buildCheckoutUrl(offer);
|
|
3321
|
+
var CHECKOUT_URL = buildCheckoutUrl(offer, { directCheckout: true });
|
|
3317
3322
|
var LICENSE_PRICE_DISPLAY = offer.isActive ? offer.salePriceDisplay : offer.basePriceDisplay;
|
|
3318
3323
|
var BASE_PRICE_DISPLAY = offer.basePriceDisplay;
|
|
3319
3324
|
var PROMO_CODE = offer.couponCode;
|
|
@@ -3475,6 +3480,7 @@ function toLicenseStatus(stored, overrides = {}) {
|
|
|
3475
3480
|
message: null,
|
|
3476
3481
|
error: stored?.lastVerificationError ?? null,
|
|
3477
3482
|
productUrl: PRODUCT_URL,
|
|
3483
|
+
checkoutUrl: CHECKOUT_URL,
|
|
3478
3484
|
productId: PRODUCT_ID,
|
|
3479
3485
|
productPermalink: PRODUCT_PERMALINK,
|
|
3480
3486
|
priceDisplay: LICENSE_PRICE_DISPLAY,
|
|
@@ -7913,6 +7919,9 @@ function asString3(value) {
|
|
|
7913
7919
|
const trimmed = value.trim();
|
|
7914
7920
|
return trimmed.length > 0 ? trimmed : null;
|
|
7915
7921
|
}
|
|
7922
|
+
function isMissingPathError(error) {
|
|
7923
|
+
return error.code === "ENOENT";
|
|
7924
|
+
}
|
|
7916
7925
|
function resolveHomeDir2() {
|
|
7917
7926
|
const home = process.env.HOME || process.env.USERPROFILE || import_node_os5.default.homedir();
|
|
7918
7927
|
if (!home) {
|
|
@@ -8388,10 +8397,12 @@ async function cleanupLegacyCanonicalSources() {
|
|
|
8388
8397
|
}
|
|
8389
8398
|
}
|
|
8390
8399
|
} catch (error) {
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8400
|
+
if (!isMissingPathError(error)) {
|
|
8401
|
+
logWarn("Failed cleaning legacy profile metadata:", {
|
|
8402
|
+
profileHomesRoot,
|
|
8403
|
+
error: error instanceof Error ? error.message : String(error)
|
|
8404
|
+
});
|
|
8405
|
+
}
|
|
8395
8406
|
}
|
|
8396
8407
|
const skillsRoot = resolveLegacyPath(LEGACY_SKILLS_DIR);
|
|
8397
8408
|
try {
|
|
@@ -8403,10 +8414,12 @@ async function cleanupLegacyCanonicalSources() {
|
|
|
8403
8414
|
await removeIfExists(import_node_path12.default.join(skillsRoot, entry.name, LEGACY_SKILL_MANIFEST));
|
|
8404
8415
|
}
|
|
8405
8416
|
} catch (error) {
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8417
|
+
if (!isMissingPathError(error)) {
|
|
8418
|
+
logWarn("Failed cleaning legacy skills metadata:", {
|
|
8419
|
+
skillsRoot,
|
|
8420
|
+
error: error instanceof Error ? error.message : String(error)
|
|
8421
|
+
});
|
|
8422
|
+
}
|
|
8410
8423
|
}
|
|
8411
8424
|
}
|
|
8412
8425
|
async function runStorageMigrationV1() {
|