@liberseek/boft-cli-linux-x64 0.7.5 → 0.7.6
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/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +17934 -0
- package/app/console-web.js +27017 -0
- package/app/desktop-controller.mjs +154 -14
- package/app/host-runtime.mjs +3084 -1144
- package/app/plugins/antigravity/plugin.mjs +355 -74
- package/app/plugins/claude-code/plugin.mjs +2851 -2152
- package/app/plugins/codebuddy/plugin.mjs +436 -95
- package/app/plugins/cursor-cli/manifest.json +1 -1
- package/app/plugins/cursor-cli/plugin.mjs +1089 -503
- package/app/plugins/deepseek-harness/plugin.mjs +614 -38
- package/app/plugins/grok/plugin.mjs +301 -81
- package/app/plugins/hermes/plugin.mjs +321 -87
- package/app/plugins/kimi-code/plugin.mjs +669 -76
- package/app/plugins/kiro-cli/plugin.mjs +237 -57
- package/app/plugins/muse/plugin.mjs +123 -8
- package/app/plugins/omp/plugin.mjs +310 -47
- package/app/plugins/opencode/plugin.mjs +467 -70
- package/app/plugins/pi/plugin.mjs +907 -277
- package/app/plugins/qoder/plugin.mjs +407 -48
- package/app/plugins/qoder-cn/plugin.mjs +414 -49
- package/app/plugins/workbuddy/plugin.mjs +126 -8
- package/app/renderer-extension.js +2712 -1195
- package/bin/boft +0 -0
- package/libexec/boft-shim +0 -0
- package/libexec/boft-updater +0 -0
- package/package.json +1 -1
|
@@ -4475,10 +4475,10 @@ function mergeDefs(...defs) {
|
|
|
4475
4475
|
function cloneDef(schema) {
|
|
4476
4476
|
return mergeDefs(schema._zod.def);
|
|
4477
4477
|
}
|
|
4478
|
-
function getElementAtPath(obj,
|
|
4479
|
-
if (!
|
|
4478
|
+
function getElementAtPath(obj, path8) {
|
|
4479
|
+
if (!path8)
|
|
4480
4480
|
return obj;
|
|
4481
|
-
return
|
|
4481
|
+
return path8.reduce((acc, key) => acc?.[key], obj);
|
|
4482
4482
|
}
|
|
4483
4483
|
function promiseAllObject(promisesObj) {
|
|
4484
4484
|
const keys = Object.keys(promisesObj);
|
|
@@ -4887,11 +4887,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
4887
4887
|
}
|
|
4888
4888
|
return false;
|
|
4889
4889
|
}
|
|
4890
|
-
function prefixIssues(
|
|
4890
|
+
function prefixIssues(path8, issues) {
|
|
4891
4891
|
return issues.map((iss) => {
|
|
4892
4892
|
var _a3;
|
|
4893
4893
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
4894
|
-
iss.path.unshift(
|
|
4894
|
+
iss.path.unshift(path8);
|
|
4895
4895
|
return iss;
|
|
4896
4896
|
});
|
|
4897
4897
|
}
|
|
@@ -5038,16 +5038,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
5038
5038
|
}
|
|
5039
5039
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
5040
5040
|
const fieldErrors = { _errors: [] };
|
|
5041
|
-
const processError = (error52,
|
|
5041
|
+
const processError = (error52, path8 = []) => {
|
|
5042
5042
|
for (const issue2 of error52.issues) {
|
|
5043
5043
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
5044
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
5044
|
+
issue2.errors.map((issues) => processError({ issues }, [...path8, ...issue2.path]));
|
|
5045
5045
|
} else if (issue2.code === "invalid_key") {
|
|
5046
|
-
processError({ issues: issue2.issues }, [...
|
|
5046
|
+
processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
|
|
5047
5047
|
} else if (issue2.code === "invalid_element") {
|
|
5048
|
-
processError({ issues: issue2.issues }, [...
|
|
5048
|
+
processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
|
|
5049
5049
|
} else {
|
|
5050
|
-
const fullpath = [...
|
|
5050
|
+
const fullpath = [...path8, ...issue2.path];
|
|
5051
5051
|
if (fullpath.length === 0) {
|
|
5052
5052
|
fieldErrors._errors.push(mapper(issue2));
|
|
5053
5053
|
} else {
|
|
@@ -5074,17 +5074,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
5074
5074
|
}
|
|
5075
5075
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
5076
5076
|
const result = { errors: [] };
|
|
5077
|
-
const processError = (error52,
|
|
5077
|
+
const processError = (error52, path8 = []) => {
|
|
5078
5078
|
var _a3, _b;
|
|
5079
5079
|
for (const issue2 of error52.issues) {
|
|
5080
5080
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
5081
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
5081
|
+
issue2.errors.map((issues) => processError({ issues }, [...path8, ...issue2.path]));
|
|
5082
5082
|
} else if (issue2.code === "invalid_key") {
|
|
5083
|
-
processError({ issues: issue2.issues }, [...
|
|
5083
|
+
processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
|
|
5084
5084
|
} else if (issue2.code === "invalid_element") {
|
|
5085
|
-
processError({ issues: issue2.issues }, [...
|
|
5085
|
+
processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
|
|
5086
5086
|
} else {
|
|
5087
|
-
const fullpath = [...
|
|
5087
|
+
const fullpath = [...path8, ...issue2.path];
|
|
5088
5088
|
if (fullpath.length === 0) {
|
|
5089
5089
|
result.errors.push(mapper(issue2));
|
|
5090
5090
|
continue;
|
|
@@ -5116,8 +5116,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
5116
5116
|
}
|
|
5117
5117
|
function toDotPath(_path) {
|
|
5118
5118
|
const segs = [];
|
|
5119
|
-
const
|
|
5120
|
-
for (const seg of
|
|
5119
|
+
const path8 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
5120
|
+
for (const seg of path8) {
|
|
5121
5121
|
if (typeof seg === "number")
|
|
5122
5122
|
segs.push(`[${seg}]`);
|
|
5123
5123
|
else if (typeof seg === "symbol")
|
|
@@ -17809,13 +17809,13 @@ function resolveRef(ref, ctx) {
|
|
|
17809
17809
|
if (!ref.startsWith("#")) {
|
|
17810
17810
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
17811
17811
|
}
|
|
17812
|
-
const
|
|
17813
|
-
if (
|
|
17812
|
+
const path8 = ref.slice(1).split("/").filter(Boolean);
|
|
17813
|
+
if (path8.length === 0) {
|
|
17814
17814
|
return ctx.rootSchema;
|
|
17815
17815
|
}
|
|
17816
17816
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
17817
|
-
if (
|
|
17818
|
-
const key =
|
|
17817
|
+
if (path8[0] === defsKey) {
|
|
17818
|
+
const key = path8[1];
|
|
17819
17819
|
if (!key || !ctx.defs[key]) {
|
|
17820
17820
|
throw new Error(`Reference not found: ${ref}`);
|
|
17821
17821
|
}
|
|
@@ -18278,6 +18278,55 @@ var credentialImportsParamsSchema = external_exports.object({
|
|
|
18278
18278
|
request: credentialImportsRequestSchema
|
|
18279
18279
|
}).strict();
|
|
18280
18280
|
|
|
18281
|
+
// ../../shared-contracts/dist/harness-display-settings.js
|
|
18282
|
+
var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
|
|
18283
|
+
agent: external_exports.string().min(1).max(128),
|
|
18284
|
+
section: external_exports.enum(["main", "more", "auto"])
|
|
18285
|
+
})).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
|
|
18286
|
+
var harnessDisplaySettingsSchema = external_exports.strictObject({
|
|
18287
|
+
entries: harnessDisplayEntriesSchema.nullable()
|
|
18288
|
+
});
|
|
18289
|
+
var harnessDisplayGetSchema = external_exports.strictObject({});
|
|
18290
|
+
var harnessDisplaySetSchema = external_exports.strictObject({
|
|
18291
|
+
entries: harnessDisplayEntriesSchema,
|
|
18292
|
+
/** Import legacy Desktop preferences only if no shared settings exist yet. */
|
|
18293
|
+
initializeOnly: external_exports.boolean().optional()
|
|
18294
|
+
});
|
|
18295
|
+
|
|
18296
|
+
// ../../shared-contracts/dist/console.js
|
|
18297
|
+
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
18298
|
+
title: external_exports.string().trim().min(1).max(200),
|
|
18299
|
+
type: external_exports.enum(["info", "warning", "danger"]),
|
|
18300
|
+
body: external_exports.string().trim().min(1).max(16 * 1024)
|
|
18301
|
+
});
|
|
18302
|
+
var consoleOpenParamsSchema = external_exports.strictObject({});
|
|
18303
|
+
var consoleOpenResultSchema = external_exports.strictObject({
|
|
18304
|
+
/** The console address. */
|
|
18305
|
+
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
18306
|
+
});
|
|
18307
|
+
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
18308
|
+
"codexhost/harness/plugins/list",
|
|
18309
|
+
"codexhost/harness/display-settings/get",
|
|
18310
|
+
"codexhost/harness/display-settings/set",
|
|
18311
|
+
"codexhost/harness/inspect",
|
|
18312
|
+
"codexhost/harness/launch-settings/get",
|
|
18313
|
+
"codexhost/harness/launch-settings/set",
|
|
18314
|
+
"codexhost/harness/web-ui/open",
|
|
18315
|
+
"codexhost/harness/accounts/sources",
|
|
18316
|
+
"codexhost/harness/accounts/list",
|
|
18317
|
+
"codexhost/harness/accounts/inspect",
|
|
18318
|
+
"codexhost/harness/credential-imports",
|
|
18319
|
+
"codexhost/harness/session-import/sources",
|
|
18320
|
+
"codexhost/harness/session-import/list",
|
|
18321
|
+
"codexhost/harness/session-import/import",
|
|
18322
|
+
"codexhost/account/list",
|
|
18323
|
+
"codexhost/account/refresh",
|
|
18324
|
+
"codexhost/account/usage/inspect",
|
|
18325
|
+
"codexhost/update/check",
|
|
18326
|
+
"codexhost/update/start",
|
|
18327
|
+
"codexhost/update/status"
|
|
18328
|
+
]);
|
|
18329
|
+
|
|
18281
18330
|
// ../../shared-contracts/dist/version.js
|
|
18282
18331
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
18283
18332
|
|
|
@@ -18331,6 +18380,12 @@ var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
|
18331
18380
|
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
18332
18381
|
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
18333
18382
|
|
|
18383
|
+
// ../../shared-contracts/dist/manual-compaction.js
|
|
18384
|
+
var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
18385
|
+
threadId: hostThreadIdSchema,
|
|
18386
|
+
turnId: hostTurnIdSchema
|
|
18387
|
+
});
|
|
18388
|
+
|
|
18334
18389
|
// ../../shared-contracts/dist/thread-usage.js
|
|
18335
18390
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
18336
18391
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
@@ -18391,6 +18446,10 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
18391
18446
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
18392
18447
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
18393
18448
|
product: external_exports.string().min(1),
|
|
18449
|
+
used: external_exports.number().finite().nonnegative().optional(),
|
|
18450
|
+
// Zero is a real empty cap, not an absent field.
|
|
18451
|
+
limit: external_exports.number().finite().nonnegative().optional(),
|
|
18452
|
+
unit: external_exports.string().min(1).max(32).optional(),
|
|
18394
18453
|
usagePercent: usagePercentSchema,
|
|
18395
18454
|
resetsAt: external_exports.string().min(1).optional()
|
|
18396
18455
|
}).strict();
|
|
@@ -18400,11 +18459,14 @@ var accountResetCreditsSchema = external_exports.object({
|
|
|
18400
18459
|
expiresAt: external_exports.array(external_exports.string().min(1)).min(1).max(32).optional()
|
|
18401
18460
|
}).strict();
|
|
18402
18461
|
var accountCreditsSnapshotSchema = external_exports.object({
|
|
18462
|
+
used: external_exports.number().finite().nonnegative().optional(),
|
|
18463
|
+
// Zero is a real empty cap, not an absent field.
|
|
18464
|
+
limit: external_exports.number().finite().nonnegative().optional(),
|
|
18465
|
+
unit: external_exports.string().trim().min(1).max(32).optional(),
|
|
18403
18466
|
/** Native label when the primary limit is scoped to a model or product group. */
|
|
18404
18467
|
label: external_exports.string().min(1).optional(),
|
|
18405
18468
|
usedPercent: usagePercentSchema.optional(),
|
|
18406
18469
|
remaining: external_exports.number().finite().optional(),
|
|
18407
|
-
unit: external_exports.string().trim().min(1).max(32).optional(),
|
|
18408
18470
|
resetsAt: external_exports.string().min(1).optional(),
|
|
18409
18471
|
periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
|
|
18410
18472
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
@@ -18435,12 +18497,27 @@ var threadUsageInspectionSchema = external_exports.object({
|
|
|
18435
18497
|
}).strict();
|
|
18436
18498
|
|
|
18437
18499
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
18438
|
-
var
|
|
18500
|
+
var accountBalanceSnapshotSchema = external_exports.object({
|
|
18501
|
+
amount: external_exports.number().finite().nonnegative(),
|
|
18502
|
+
/** ISO 4217 code as reported by the Provider, for example `CNY`. */
|
|
18503
|
+
currency: external_exports.string().trim().min(1).max(8),
|
|
18504
|
+
/** Native label when the Harness exposes several Billing Sources. */
|
|
18505
|
+
label: external_exports.string().trim().min(1).max(128).optional()
|
|
18506
|
+
}).strict();
|
|
18507
|
+
var harnessAccountSnapshotObject = external_exports.object({
|
|
18439
18508
|
email: external_exports.string().trim().min(1).max(320).optional(),
|
|
18440
18509
|
label: external_exports.string().trim().min(1).max(256).optional(),
|
|
18441
18510
|
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
18442
|
-
credits: accountCreditsSnapshotSchema
|
|
18511
|
+
credits: accountCreditsSnapshotSchema.optional(),
|
|
18512
|
+
balance: accountBalanceSnapshotSchema.optional()
|
|
18443
18513
|
}).strict();
|
|
18514
|
+
function requireReportedQuota(schema) {
|
|
18515
|
+
return schema.refine((value) => {
|
|
18516
|
+
const reported = value;
|
|
18517
|
+
return reported.credits !== void 0 || reported.balance !== void 0;
|
|
18518
|
+
}, { message: "Account must report either credits or a balance" });
|
|
18519
|
+
}
|
|
18520
|
+
var harnessAccountSnapshotSchema = requireReportedQuota(harnessAccountSnapshotObject);
|
|
18444
18521
|
var harnessAccountIdentityShape = {
|
|
18445
18522
|
harnessId: harnessIdSchema,
|
|
18446
18523
|
harnessName: external_exports.string().trim().min(1).max(128)
|
|
@@ -18451,11 +18528,13 @@ var harnessAccountSourceListResultSchema = external_exports.object({ sources: ex
|
|
|
18451
18528
|
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
18452
18529
|
var harnessAccountInspectResultSchema = external_exports.object({
|
|
18453
18530
|
...harnessAccountIdentityShape,
|
|
18454
|
-
account: harnessAccountSnapshotSchema.nullable()
|
|
18531
|
+
account: harnessAccountSnapshotSchema.nullable(),
|
|
18532
|
+
/** Every Billing Source from one Harness; `account` remains the first for older clients. */
|
|
18533
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema).max(8).optional()
|
|
18455
18534
|
}).strict();
|
|
18456
18535
|
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
18457
18536
|
var harnessAccountListResultSchema = external_exports.object({
|
|
18458
|
-
accounts: external_exports.array(
|
|
18537
|
+
accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
|
|
18459
18538
|
}).strict();
|
|
18460
18539
|
|
|
18461
18540
|
// ../../shared-contracts/dist/json-value.js
|
|
@@ -18593,6 +18672,8 @@ var harnessModelSchema = external_exports.object({
|
|
|
18593
18672
|
ref: harnessModelRefSchema,
|
|
18594
18673
|
label: nonBlankTextSchema2.max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
18595
18674
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
18675
|
+
/** Optional opaque selection for this same Model with priority processing enabled. */
|
|
18676
|
+
fastModel: harnessModelRefSchema.optional(),
|
|
18596
18677
|
supportedThinkingOptionIds: external_exports.array(harnessThinkingOptionIdSchema).optional()
|
|
18597
18678
|
}).strict();
|
|
18598
18679
|
var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options, context) => {
|
|
@@ -18625,6 +18706,16 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
18625
18706
|
});
|
|
18626
18707
|
}
|
|
18627
18708
|
refs.add(model.ref.id);
|
|
18709
|
+
if (model.fastModel) {
|
|
18710
|
+
if (refs.has(model.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model.fastModel?.id)) {
|
|
18711
|
+
context.addIssue({
|
|
18712
|
+
code: "custom",
|
|
18713
|
+
message: "Fast Model refs must be distinct and unique",
|
|
18714
|
+
path: ["models", index, "fastModel"]
|
|
18715
|
+
});
|
|
18716
|
+
}
|
|
18717
|
+
refs.add(model.fastModel.id);
|
|
18718
|
+
}
|
|
18628
18719
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
18629
18720
|
for (const [optionIndex, optionId] of (model.supportedThinkingOptionIds ?? []).entries()) {
|
|
18630
18721
|
if (supportedThinkingIds.has(optionId)) {
|
|
@@ -18747,11 +18838,13 @@ var threadThinkingSelectParamsSchema = external_exports.object({
|
|
|
18747
18838
|
thinkingOptionId: harnessThinkingOptionIdSchema
|
|
18748
18839
|
}).strict();
|
|
18749
18840
|
var threadInspectionParamsSchema = external_exports.object({
|
|
18750
|
-
threadId: hostThreadIdSchema
|
|
18841
|
+
threadId: hostThreadIdSchema,
|
|
18842
|
+
includeReferenceCapability: external_exports.boolean().optional()
|
|
18751
18843
|
}).strict();
|
|
18752
18844
|
var codexThreadInspectionSchema = external_exports.object({
|
|
18753
18845
|
owner: external_exports.literal("codex"),
|
|
18754
|
-
locked: external_exports.literal(true)
|
|
18846
|
+
locked: external_exports.literal(true),
|
|
18847
|
+
supportsThreadReferences: external_exports.literal(true).optional()
|
|
18755
18848
|
}).strict();
|
|
18756
18849
|
var externalThreadInspectionSchema = external_exports.object({
|
|
18757
18850
|
owner: external_exports.literal("external"),
|
|
@@ -18879,10 +18972,31 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
18879
18972
|
restartRequired: external_exports.boolean()
|
|
18880
18973
|
}).strict();
|
|
18881
18974
|
|
|
18975
|
+
// ../../shared-contracts/dist/harness-installation.js
|
|
18976
|
+
var harnessInstallationParamsSchema = external_exports.object({
|
|
18977
|
+
harnessId: harnessIdSchema,
|
|
18978
|
+
action: external_exports.enum(["check", "update"])
|
|
18979
|
+
}).strict();
|
|
18980
|
+
var harnessInstallationStateSchema = external_exports.object({
|
|
18981
|
+
currentVersion: external_exports.string().min(1).max(128),
|
|
18982
|
+
latestVersion: external_exports.string().min(1).max(128),
|
|
18983
|
+
updateAvailable: external_exports.boolean(),
|
|
18984
|
+
canUpdate: external_exports.boolean(),
|
|
18985
|
+
message: external_exports.string().max(2048).optional()
|
|
18986
|
+
}).strict();
|
|
18987
|
+
|
|
18882
18988
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
18883
18989
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
18884
18990
|
var nonBlankTextSchema3 = external_exports.string().trim().min(1);
|
|
18885
18991
|
var codexAccountAuthKindSchema = external_exports.enum(["api", "chatgpt"]);
|
|
18992
|
+
var codexAccountSiteUrlPattern = /^https?:\/\/(?:\[[0-9a-fA-F:]+\]|[^/\s:@?#]+)(?::\d{1,5})?(?:[/?#][^\s]*)?$/u;
|
|
18993
|
+
function isCodexAccountSiteUrl(value) {
|
|
18994
|
+
return value.length > 0 && value.length <= 2048 && codexAccountSiteUrlPattern.test(value);
|
|
18995
|
+
}
|
|
18996
|
+
var externalUrlOpenParamsSchema = external_exports.object({
|
|
18997
|
+
url: external_exports.string().max(2048).refine(isCodexAccountSiteUrl, "External URL must be http(s)")
|
|
18998
|
+
}).strict();
|
|
18999
|
+
var externalUrlOpenResultSchema = external_exports.object({}).strict();
|
|
18886
19000
|
var codexAccountPlanTypeSchema = external_exports.enum([
|
|
18887
19001
|
"free",
|
|
18888
19002
|
"go",
|
|
@@ -18908,7 +19022,8 @@ var codexAccountSchema = external_exports.object({
|
|
|
18908
19022
|
email: external_exports.string().email().max(320).optional(),
|
|
18909
19023
|
planType: codexAccountPlanTypeSchema.optional(),
|
|
18910
19024
|
authKind: codexAccountAuthKindSchema.optional(),
|
|
18911
|
-
authIdentity: nonBlankTextSchema3.max(256).optional()
|
|
19025
|
+
authIdentity: nonBlankTextSchema3.max(256).optional(),
|
|
19026
|
+
siteUrl: external_exports.string().refine(isCodexAccountSiteUrl, "Account site URL must be http(s)").optional()
|
|
18912
19027
|
}).strict();
|
|
18913
19028
|
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
18914
19029
|
var codexAccountListResultSchema = external_exports.object({
|
|
@@ -19490,12 +19605,12 @@ function environmentValue(environment, name) {
|
|
|
19490
19605
|
return Object.entries(environment).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
|
|
19491
19606
|
}
|
|
19492
19607
|
function executableCandidates(command, environment) {
|
|
19493
|
-
const
|
|
19494
|
-
if (
|
|
19608
|
+
const targetPath2 = process.platform === "win32" ? path.win32 : path.posix;
|
|
19609
|
+
if (targetPath2.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
|
|
19495
19610
|
return [command];
|
|
19496
19611
|
}
|
|
19497
|
-
const extensions = process.platform === "win32" &&
|
|
19498
|
-
return (environmentValue(environment, "PATH") ?? "").split(
|
|
19612
|
+
const extensions = process.platform === "win32" && targetPath2.extname(command) === "" ? (environmentValue(environment, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((extension2) => extension2.trim()).filter(Boolean) : [""];
|
|
19613
|
+
return (environmentValue(environment, "PATH") ?? "").split(targetPath2.delimiter).map((directory) => directory.trim().replace(/^"|"$/gu, "")).filter(Boolean).flatMap((directory) => extensions.map((extension2) => targetPath2.join(directory, command + extension2)));
|
|
19499
19614
|
}
|
|
19500
19615
|
function resolveExecutable(command, environment) {
|
|
19501
19616
|
const accessMode = process.platform === "win32" ? constants.F_OK : constants.X_OK;
|
|
@@ -21614,16 +21729,16 @@ var Diff = class {
|
|
|
21614
21729
|
}
|
|
21615
21730
|
}
|
|
21616
21731
|
}
|
|
21617
|
-
addToPath(
|
|
21618
|
-
const last =
|
|
21732
|
+
addToPath(path8, added, removed, oldPosInc, options) {
|
|
21733
|
+
const last = path8.lastComponent;
|
|
21619
21734
|
if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
|
|
21620
21735
|
return {
|
|
21621
|
-
oldPos:
|
|
21736
|
+
oldPos: path8.oldPos + oldPosInc,
|
|
21622
21737
|
lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
|
|
21623
21738
|
};
|
|
21624
21739
|
} else {
|
|
21625
21740
|
return {
|
|
21626
|
-
oldPos:
|
|
21741
|
+
oldPos: path8.oldPos + oldPosInc,
|
|
21627
21742
|
lastComponent: { count: 1, added, removed, previousComponent: last }
|
|
21628
21743
|
};
|
|
21629
21744
|
}
|
|
@@ -32124,17 +32239,478 @@ function closedError2() {
|
|
|
32124
32239
|
};
|
|
32125
32240
|
}
|
|
32126
32241
|
|
|
32242
|
+
// ../../harness-discovery/dist/environment.js
|
|
32243
|
+
import fs from "node:fs";
|
|
32244
|
+
import path4 from "node:path";
|
|
32245
|
+
function targetPath(platform) {
|
|
32246
|
+
return platform === "win32" ? path4.win32 : path4.posix;
|
|
32247
|
+
}
|
|
32248
|
+
function environmentValue2(environment, name) {
|
|
32249
|
+
const lowered = name.toLowerCase();
|
|
32250
|
+
for (const [key, value] of Object.entries(environment)) {
|
|
32251
|
+
if (key.toLowerCase() === lowered)
|
|
32252
|
+
return value;
|
|
32253
|
+
}
|
|
32254
|
+
return void 0;
|
|
32255
|
+
}
|
|
32256
|
+
function pathDelimiter(platform) {
|
|
32257
|
+
return platform === "win32" ? ";" : ":";
|
|
32258
|
+
}
|
|
32259
|
+
function pathDirectories(environment, platform) {
|
|
32260
|
+
return (environmentValue2(environment, "PATH") ?? "").split(pathDelimiter(platform)).map((directory) => directory.trim().replace(/^"|"$/gu, "")).filter(Boolean);
|
|
32261
|
+
}
|
|
32262
|
+
function executableExtensions(command, platform, environment) {
|
|
32263
|
+
if (platform !== "win32")
|
|
32264
|
+
return [""];
|
|
32265
|
+
if (targetPath(platform).extname(command) !== "")
|
|
32266
|
+
return [""];
|
|
32267
|
+
return (environmentValue2(environment, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((extension2) => extension2.trim()).filter(Boolean);
|
|
32268
|
+
}
|
|
32269
|
+
function isExecutableFile(filePath, platform) {
|
|
32270
|
+
try {
|
|
32271
|
+
fs.accessSync(filePath, platform === "win32" ? fs.constants.F_OK : fs.constants.X_OK);
|
|
32272
|
+
return fs.statSync(filePath).isFile();
|
|
32273
|
+
} catch {
|
|
32274
|
+
return false;
|
|
32275
|
+
}
|
|
32276
|
+
}
|
|
32277
|
+
function subdirectoryNames(directory) {
|
|
32278
|
+
try {
|
|
32279
|
+
return fs.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
32280
|
+
} catch {
|
|
32281
|
+
return [];
|
|
32282
|
+
}
|
|
32283
|
+
}
|
|
32284
|
+
function newestFirst(names) {
|
|
32285
|
+
return [...names].sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
|
|
32286
|
+
}
|
|
32287
|
+
|
|
32288
|
+
// ../../harness-discovery/dist/invocation.js
|
|
32289
|
+
import path5 from "node:path";
|
|
32290
|
+
function commandInvocation(command, arguments_, environment, platform = process.platform) {
|
|
32291
|
+
const extension2 = path5.win32.extname(command).toLowerCase();
|
|
32292
|
+
if (platform !== "win32" || ![".cmd", ".bat"].includes(extension2)) {
|
|
32293
|
+
return { command, arguments: [...arguments_], windowsVerbatimArguments: false };
|
|
32294
|
+
}
|
|
32295
|
+
const quote = (value) => `"${value.replaceAll("%", "%%").replaceAll('"', '""')}"`;
|
|
32296
|
+
const commandLine = [command, ...arguments_].map(quote).join(" ");
|
|
32297
|
+
return {
|
|
32298
|
+
command: environmentValue2(environment, "ComSpec") ?? "cmd.exe",
|
|
32299
|
+
arguments: ["/d", "/v:off", "/s", "/c", `"${commandLine}"`],
|
|
32300
|
+
windowsVerbatimArguments: true
|
|
32301
|
+
};
|
|
32302
|
+
}
|
|
32303
|
+
|
|
32304
|
+
// ../../harness-discovery/dist/node-runtime.js
|
|
32305
|
+
import path6 from "node:path";
|
|
32306
|
+
function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath, platform = process.platform) {
|
|
32307
|
+
const pathKey = Object.keys(environment).find((name) => name.toLowerCase() === "path") ?? "PATH";
|
|
32308
|
+
const delimiter = platform === "win32" ? ";" : ":";
|
|
32309
|
+
const runtimeDirectory = path6.dirname(runtimeExecutable);
|
|
32310
|
+
const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
|
|
32311
|
+
const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
|
|
32312
|
+
if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
|
|
32313
|
+
directories.push(runtimeDirectory);
|
|
32314
|
+
}
|
|
32315
|
+
return { ...environment, [pathKey]: directories.join(delimiter) };
|
|
32316
|
+
}
|
|
32317
|
+
|
|
32318
|
+
// ../../harness-discovery/dist/resolve.js
|
|
32319
|
+
import os from "node:os";
|
|
32320
|
+
|
|
32321
|
+
// ../../harness-discovery/dist/version-managers.js
|
|
32322
|
+
function versionManagerBinaryDirectories(context) {
|
|
32323
|
+
const { platform, environment, home } = context;
|
|
32324
|
+
const list = context.subdirectories ?? subdirectoryNames;
|
|
32325
|
+
const pathFlavor = targetPath(platform);
|
|
32326
|
+
const value = (name) => environmentValue2(environment, name);
|
|
32327
|
+
const directories = [];
|
|
32328
|
+
const versioned = (root, ...tail) => {
|
|
32329
|
+
for (const version2 of newestFirst(list(root))) {
|
|
32330
|
+
directories.push(pathFlavor.join(root, version2, ...tail));
|
|
32331
|
+
}
|
|
32332
|
+
};
|
|
32333
|
+
if (platform === "win32") {
|
|
32334
|
+
const appData = value("APPDATA") ?? pathFlavor.join(home, "AppData", "Roaming");
|
|
32335
|
+
const localAppData = value("LOCALAPPDATA") ?? pathFlavor.join(home, "AppData", "Local");
|
|
32336
|
+
versioned(pathFlavor.join(appData, "nvm"));
|
|
32337
|
+
versioned(value("FNM_DIR") ?? pathFlavor.join(appData, "fnm", "node-versions"), "installation");
|
|
32338
|
+
directories.push(pathFlavor.join(localAppData, "Volta", "bin"));
|
|
32339
|
+
directories.push(pathFlavor.join(home, ".bun", "bin"));
|
|
32340
|
+
const pnpmHome2 = value("PNPM_HOME");
|
|
32341
|
+
if (pnpmHome2)
|
|
32342
|
+
directories.push(pnpmHome2);
|
|
32343
|
+
directories.push(pathFlavor.join(localAppData, "pnpm"));
|
|
32344
|
+
return directories;
|
|
32345
|
+
}
|
|
32346
|
+
versioned(pathFlavor.join(value("NVM_DIR") ?? pathFlavor.join(home, ".nvm"), "versions", "node"), "bin");
|
|
32347
|
+
const fnmRoots = [
|
|
32348
|
+
value("FNM_DIR"),
|
|
32349
|
+
pathFlavor.join(home, ".local", "share", "fnm"),
|
|
32350
|
+
pathFlavor.join(home, "Library", "Application Support", "fnm")
|
|
32351
|
+
].filter((root) => root !== void 0);
|
|
32352
|
+
for (const root of fnmRoots) {
|
|
32353
|
+
versioned(pathFlavor.join(root, "node-versions"), "installation", "bin");
|
|
32354
|
+
}
|
|
32355
|
+
const voltaHome = value("VOLTA_HOME") ?? pathFlavor.join(home, ".volta");
|
|
32356
|
+
versioned(pathFlavor.join(voltaHome, "tools", "image", "node"), "bin");
|
|
32357
|
+
directories.push(pathFlavor.join(voltaHome, "bin"));
|
|
32358
|
+
const asdfHome = value("ASDF_DATA_DIR") ?? pathFlavor.join(home, ".asdf");
|
|
32359
|
+
versioned(pathFlavor.join(asdfHome, "installs", "nodejs"), "bin");
|
|
32360
|
+
directories.push(pathFlavor.join(asdfHome, "shims"));
|
|
32361
|
+
const nodenvHome = value("NODENV_ROOT") ?? pathFlavor.join(home, ".nodenv");
|
|
32362
|
+
versioned(pathFlavor.join(nodenvHome, "versions"), "bin");
|
|
32363
|
+
directories.push(pathFlavor.join(nodenvHome, "shims"));
|
|
32364
|
+
versioned(pathFlavor.join(value("N_PREFIX") ?? "/usr/local", "n", "versions", "node"), "bin");
|
|
32365
|
+
directories.push(pathFlavor.join(home, ".bun", "bin"));
|
|
32366
|
+
const pnpmHome = value("PNPM_HOME");
|
|
32367
|
+
if (pnpmHome)
|
|
32368
|
+
directories.push(pnpmHome);
|
|
32369
|
+
directories.push(pathFlavor.join(home, "Library", "pnpm"));
|
|
32370
|
+
directories.push(pathFlavor.join(home, ".local", "share", "pnpm"));
|
|
32371
|
+
for (const prefix of ["/opt/homebrew/opt", "/usr/local/opt"]) {
|
|
32372
|
+
for (const formula of newestFirst(list(prefix).filter((name) => name.startsWith("node@")))) {
|
|
32373
|
+
directories.push(pathFlavor.join(prefix, formula, "bin"));
|
|
32374
|
+
}
|
|
32375
|
+
}
|
|
32376
|
+
return directories;
|
|
32377
|
+
}
|
|
32378
|
+
|
|
32379
|
+
// ../../harness-discovery/dist/resolve.js
|
|
32380
|
+
var VERSION_MANAGER_ROOTS = "<version-managers>";
|
|
32381
|
+
function installRootExtensions(platform) {
|
|
32382
|
+
return platform === "win32" ? [".exe", ".cmd"] : [""];
|
|
32383
|
+
}
|
|
32384
|
+
function resolveHomeDirectory(input) {
|
|
32385
|
+
return input.homeDirectory ?? environmentValue2(input.environment, "HOME") ?? environmentValue2(input.environment, "USERPROFILE") ?? os.homedir();
|
|
32386
|
+
}
|
|
32387
|
+
function templateVariables(environment, platform, home) {
|
|
32388
|
+
const pathFlavor = targetPath(platform);
|
|
32389
|
+
return {
|
|
32390
|
+
HOME: home,
|
|
32391
|
+
USERPROFILE: home,
|
|
32392
|
+
APPDATA: environmentValue2(environment, "APPDATA") ?? pathFlavor.join(home, "AppData", "Roaming"),
|
|
32393
|
+
LOCALAPPDATA: environmentValue2(environment, "LOCALAPPDATA") ?? pathFlavor.join(home, "AppData", "Local")
|
|
32394
|
+
};
|
|
32395
|
+
}
|
|
32396
|
+
function joinTemplate(platform, value) {
|
|
32397
|
+
const pathFlavor = targetPath(platform);
|
|
32398
|
+
const segments = value.split("/");
|
|
32399
|
+
const head = segments[0] ?? "";
|
|
32400
|
+
const tail = segments.slice(1);
|
|
32401
|
+
if (head === "")
|
|
32402
|
+
return pathFlavor.join(pathFlavor.sep, ...tail);
|
|
32403
|
+
return tail.length === 0 ? head : pathFlavor.join(head, ...tail);
|
|
32404
|
+
}
|
|
32405
|
+
function expandInstallRoot(template, environment, platform, home) {
|
|
32406
|
+
const variables = templateVariables(environment, platform, home);
|
|
32407
|
+
let unresolved = false;
|
|
32408
|
+
const substituted = template.replace(/^~(?=\/|$)/u, home).replace(/\$\{(\w+)\}/gu, (_match, name) => {
|
|
32409
|
+
const value = variables[name] ?? environmentValue2(environment, name);
|
|
32410
|
+
if (value === void 0 || value === "") {
|
|
32411
|
+
unresolved = true;
|
|
32412
|
+
return "";
|
|
32413
|
+
}
|
|
32414
|
+
return value;
|
|
32415
|
+
});
|
|
32416
|
+
return unresolved ? void 0 : joinTemplate(platform, substituted);
|
|
32417
|
+
}
|
|
32418
|
+
function installRootDirectories(spec, input, dependencies, platform, home) {
|
|
32419
|
+
const templates = (platform === "win32" ? spec.installRoots?.windows : spec.installRoots?.posix) ?? [];
|
|
32420
|
+
const directories = [];
|
|
32421
|
+
for (const template of templates) {
|
|
32422
|
+
if (template === VERSION_MANAGER_ROOTS) {
|
|
32423
|
+
directories.push(...versionManagerBinaryDirectories({
|
|
32424
|
+
platform,
|
|
32425
|
+
environment: input.environment,
|
|
32426
|
+
home,
|
|
32427
|
+
...dependencies.subdirectories ? { subdirectories: dependencies.subdirectories } : {}
|
|
32428
|
+
}));
|
|
32429
|
+
continue;
|
|
32430
|
+
}
|
|
32431
|
+
const directory = expandInstallRoot(template, input.environment, platform, home);
|
|
32432
|
+
if (directory !== void 0)
|
|
32433
|
+
directories.push(directory);
|
|
32434
|
+
}
|
|
32435
|
+
return directories;
|
|
32436
|
+
}
|
|
32437
|
+
function harnessCandidates(spec, input, dependencies = {}) {
|
|
32438
|
+
const platform = input.platform ?? process.platform;
|
|
32439
|
+
const pathFlavor = targetPath(platform);
|
|
32440
|
+
const configured = input.command ?? (spec.commandEnvironmentVariable ? environmentValue2(input.environment, spec.commandEnvironmentVariable) : void 0);
|
|
32441
|
+
const command = configured ?? spec.command;
|
|
32442
|
+
if (pathFlavor.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
|
|
32443
|
+
return [{ candidate: command, source: "configured" }];
|
|
32444
|
+
}
|
|
32445
|
+
const candidates = [];
|
|
32446
|
+
const extensions = executableExtensions(command, platform, input.environment);
|
|
32447
|
+
for (const directory of pathDirectories(input.environment, platform)) {
|
|
32448
|
+
for (const extension2 of extensions) {
|
|
32449
|
+
candidates.push({
|
|
32450
|
+
candidate: pathFlavor.join(directory, command + extension2),
|
|
32451
|
+
source: "path"
|
|
32452
|
+
});
|
|
32453
|
+
}
|
|
32454
|
+
}
|
|
32455
|
+
if (configured !== void 0)
|
|
32456
|
+
return candidates;
|
|
32457
|
+
const home = resolveHomeDirectory(input);
|
|
32458
|
+
for (const directory of installRootDirectories(spec, input, dependencies, platform, home)) {
|
|
32459
|
+
for (const extension2 of installRootExtensions(platform)) {
|
|
32460
|
+
candidates.push({
|
|
32461
|
+
candidate: pathFlavor.join(directory, spec.command + extension2),
|
|
32462
|
+
source: "install-root"
|
|
32463
|
+
});
|
|
32464
|
+
}
|
|
32465
|
+
}
|
|
32466
|
+
return candidates;
|
|
32467
|
+
}
|
|
32468
|
+
function resolveHarnessExecutable(spec, input, dependencies = {}) {
|
|
32469
|
+
const platform = input.platform ?? process.platform;
|
|
32470
|
+
const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
|
|
32471
|
+
const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
|
|
32472
|
+
const context = { platform, isExecutable };
|
|
32473
|
+
for (const { candidate, source } of harnessCandidates(spec, input, dependencies)) {
|
|
32474
|
+
const executable = runnable(candidate, context);
|
|
32475
|
+
if (executable !== void 0 && isExecutable(executable))
|
|
32476
|
+
return { executable, source };
|
|
32477
|
+
}
|
|
32478
|
+
return void 0;
|
|
32479
|
+
}
|
|
32480
|
+
|
|
32481
|
+
// ../../harness-discovery/dist/installation.js
|
|
32482
|
+
import { execFile } from "node:child_process";
|
|
32483
|
+
import { homedir } from "node:os";
|
|
32484
|
+
function runInstallationCommand(command, args, environment, timeout = 3e4) {
|
|
32485
|
+
const env = withNodeRuntimeOnPath(environment);
|
|
32486
|
+
const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
|
|
32487
|
+
return new Promise((resolve2, reject) => {
|
|
32488
|
+
const child = execFile(invocation.command, invocation.arguments, {
|
|
32489
|
+
env,
|
|
32490
|
+
cwd: env.HOME ?? env.USERPROFILE ?? homedir(),
|
|
32491
|
+
encoding: "utf8",
|
|
32492
|
+
timeout,
|
|
32493
|
+
killSignal: "SIGKILL",
|
|
32494
|
+
maxBuffer: 1024 * 1024,
|
|
32495
|
+
windowsHide: true,
|
|
32496
|
+
windowsVerbatimArguments: invocation.windowsVerbatimArguments
|
|
32497
|
+
}, (error51, stdout, stderr) => {
|
|
32498
|
+
if (error51)
|
|
32499
|
+
reject(new Error(error51.killed ? "Harness command timed out" : "Harness command failed; check the native installation and retry"));
|
|
32500
|
+
else
|
|
32501
|
+
resolve2((stdout || stderr).trim());
|
|
32502
|
+
});
|
|
32503
|
+
child.stdin?.end();
|
|
32504
|
+
});
|
|
32505
|
+
}
|
|
32506
|
+
function installationVersion(value) {
|
|
32507
|
+
if (typeof value !== "string" || !/^v?\d+(?:\.\d+){1,3}(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(value.trim()))
|
|
32508
|
+
throw new Error("Harness returned an invalid version");
|
|
32509
|
+
return value.trim().replace(/^v/, "");
|
|
32510
|
+
}
|
|
32511
|
+
function versionFromOutput(output) {
|
|
32512
|
+
return installationVersion(output.match(/\b\d+(?:\.\d+){1,3}(?:-[\w.-]+)?(?:\+[\w.-]+)?\b/)?.[0]);
|
|
32513
|
+
}
|
|
32514
|
+
function newerInstallationVersion(current, latest) {
|
|
32515
|
+
const a = installationVersion(current).replace(/\+.*/, "");
|
|
32516
|
+
const b = installationVersion(latest).replace(/\+.*/, "");
|
|
32517
|
+
const coreA = a.replace(/-.*/, "").split(".").map(BigInt);
|
|
32518
|
+
const coreB = b.replace(/-.*/, "").split(".").map(BigInt);
|
|
32519
|
+
for (let i = 0; i < Math.max(coreA.length, coreB.length); i++) {
|
|
32520
|
+
if ((coreA[i] ?? 0n) !== (coreB[i] ?? 0n))
|
|
32521
|
+
return (coreB[i] ?? 0n) > (coreA[i] ?? 0n);
|
|
32522
|
+
}
|
|
32523
|
+
const preA = a.includes("-") ? a.slice(a.indexOf("-") + 1).split(".") : [];
|
|
32524
|
+
const preB = b.includes("-") ? b.slice(b.indexOf("-") + 1).split(".") : [];
|
|
32525
|
+
if (!preA.length || !preB.length)
|
|
32526
|
+
return !!preA.length && !preB.length;
|
|
32527
|
+
for (let i = 0; i < Math.max(preA.length, preB.length); i++) {
|
|
32528
|
+
const x = preA[i];
|
|
32529
|
+
const y = preB[i];
|
|
32530
|
+
if (x === y)
|
|
32531
|
+
continue;
|
|
32532
|
+
if (x === void 0 || y === void 0)
|
|
32533
|
+
return x === void 0;
|
|
32534
|
+
const numericX = /^\d+$/.test(x);
|
|
32535
|
+
const numericY = /^\d+$/.test(y);
|
|
32536
|
+
if (numericX && numericY) {
|
|
32537
|
+
if (BigInt(x) === BigInt(y))
|
|
32538
|
+
continue;
|
|
32539
|
+
return BigInt(y) > BigInt(x);
|
|
32540
|
+
}
|
|
32541
|
+
if (numericX !== numericY)
|
|
32542
|
+
return numericX;
|
|
32543
|
+
return y > x;
|
|
32544
|
+
}
|
|
32545
|
+
return false;
|
|
32546
|
+
}
|
|
32547
|
+
function createInstallationManager(options) {
|
|
32548
|
+
let checking;
|
|
32549
|
+
let updating;
|
|
32550
|
+
const check2 = () => checking ??= options.check().finally(() => {
|
|
32551
|
+
checking = void 0;
|
|
32552
|
+
});
|
|
32553
|
+
return (action) => {
|
|
32554
|
+
if (updating)
|
|
32555
|
+
return updating;
|
|
32556
|
+
if (action === "check")
|
|
32557
|
+
return check2();
|
|
32558
|
+
updating = (async () => {
|
|
32559
|
+
const before = await check2();
|
|
32560
|
+
if (!before.updateAvailable)
|
|
32561
|
+
return before;
|
|
32562
|
+
if (!before.canUpdate)
|
|
32563
|
+
throw new Error(before.message ?? "This installation cannot be updated automatically");
|
|
32564
|
+
await options.update(before);
|
|
32565
|
+
const after = await check2();
|
|
32566
|
+
if (after.currentVersion === before.currentVersion)
|
|
32567
|
+
throw new Error("The Harness version did not change; check the native updater and retry");
|
|
32568
|
+
return after;
|
|
32569
|
+
})().finally(() => {
|
|
32570
|
+
updating = void 0;
|
|
32571
|
+
});
|
|
32572
|
+
return updating;
|
|
32573
|
+
};
|
|
32574
|
+
}
|
|
32575
|
+
async function fetchInstallationText(url2) {
|
|
32576
|
+
const request = async () => {
|
|
32577
|
+
const response = await fetch(url2, { signal: AbortSignal.timeout(15e3) });
|
|
32578
|
+
if (!response.ok)
|
|
32579
|
+
throw new Error("Could not check the latest Harness version");
|
|
32580
|
+
return response.text();
|
|
32581
|
+
};
|
|
32582
|
+
try {
|
|
32583
|
+
return await request();
|
|
32584
|
+
} catch (error51) {
|
|
32585
|
+
if (error51 instanceof DOMException && (error51.name === "AbortError" || error51.name === "TimeoutError"))
|
|
32586
|
+
throw error51;
|
|
32587
|
+
return request();
|
|
32588
|
+
}
|
|
32589
|
+
}
|
|
32590
|
+
|
|
32591
|
+
// ../../harness-discovery/dist/npm-installation.js
|
|
32592
|
+
import { readFile, realpath } from "node:fs/promises";
|
|
32593
|
+
import path7 from "node:path";
|
|
32594
|
+
function referencesNpmBin(shim, name, bin) {
|
|
32595
|
+
if (bin.includes(".."))
|
|
32596
|
+
return false;
|
|
32597
|
+
const target = `node_modules/${name}/${bin.replace(/^\.\//, "")}`.toLowerCase();
|
|
32598
|
+
const text = shim.replaceAll("\\", "/").toLowerCase();
|
|
32599
|
+
return text.includes(`%dp0%/${target}"`) || text.includes(`%~dp0/${target}"`);
|
|
32600
|
+
}
|
|
32601
|
+
async function npmInstallation(command, packages, environment) {
|
|
32602
|
+
let selected = await realpath(command);
|
|
32603
|
+
if (process.platform === "win32" && /\.(cmd|bat)$/i.test(selected)) {
|
|
32604
|
+
const shim = (await readFile(selected, "utf8")).replaceAll("\\", "/");
|
|
32605
|
+
const root = path7.dirname(selected);
|
|
32606
|
+
for (const name of packages) {
|
|
32607
|
+
const directory2 = path7.join(root, "node_modules", ...name.split("/"));
|
|
32608
|
+
const metadata = await readFile(path7.join(directory2, "package.json"), "utf8").then((text) => JSON.parse(text)).catch(() => null);
|
|
32609
|
+
const bins = typeof metadata?.bin === "string" ? [metadata.bin] : Object.values(metadata?.bin ?? {});
|
|
32610
|
+
const bin = bins.find((entry) => referencesNpmBin(shim, name, entry));
|
|
32611
|
+
if (bin) {
|
|
32612
|
+
selected = await realpath(path7.join(directory2, bin));
|
|
32613
|
+
break;
|
|
32614
|
+
}
|
|
32615
|
+
}
|
|
32616
|
+
}
|
|
32617
|
+
let directory = path7.dirname(selected);
|
|
32618
|
+
for (let depth = 0; depth < 8; depth++) {
|
|
32619
|
+
const metadata = await readFile(path7.join(directory, "package.json"), "utf8").then((text) => JSON.parse(text)).catch(() => null);
|
|
32620
|
+
if (metadata?.name && packages.includes(metadata.name)) {
|
|
32621
|
+
const name = metadata.name;
|
|
32622
|
+
const currentVersion = installationVersion(metadata.version);
|
|
32623
|
+
const segments = name.split("/");
|
|
32624
|
+
let modules = directory;
|
|
32625
|
+
for (let index = 0; index < segments.length; index++)
|
|
32626
|
+
modules = path7.dirname(modules);
|
|
32627
|
+
const prefix = process.platform === "win32" ? path7.dirname(modules) : path7.dirname(path7.dirname(modules));
|
|
32628
|
+
const globalRoot = process.platform === "win32" ? path7.join(prefix, "node_modules") : path7.join(prefix, "lib", "node_modules");
|
|
32629
|
+
const env = withNodeRuntimeOnPath(environment);
|
|
32630
|
+
const npm = resolveHarnessExecutable({ id: "npm", command: "npm", installRoots: { posix: [], windows: [] } }, { environment: env });
|
|
32631
|
+
let globalInstall = modules === globalRoot;
|
|
32632
|
+
if (process.platform === "win32") {
|
|
32633
|
+
const project = (await Promise.all(["package.json", "package-lock.json", "npm-shrinkwrap.json"].map((file2) => readFile(path7.join(prefix, file2), "utf8").then(() => true, (error51) => error51.code !== "ENOENT")))).some(Boolean);
|
|
32634
|
+
const bins = typeof metadata.bin === "string" ? { [name.split("/").at(-1) ?? name]: metadata.bin } : metadata.bin ?? {};
|
|
32635
|
+
const launchers = await Promise.all(Object.entries(bins).map(async ([bin, entry]) => {
|
|
32636
|
+
if (path7.basename(bin) !== bin || entry.includes(".."))
|
|
32637
|
+
return false;
|
|
32638
|
+
const target = await realpath(path7.join(directory, entry)).catch(() => "");
|
|
32639
|
+
if (target.toLowerCase() !== selected.toLowerCase())
|
|
32640
|
+
return false;
|
|
32641
|
+
const shim = await readFile(path7.join(prefix, `${bin}.cmd`), "utf8").catch(() => "");
|
|
32642
|
+
return referencesNpmBin(shim, name, entry);
|
|
32643
|
+
}));
|
|
32644
|
+
globalInstall = globalInstall && !project && launchers.some(Boolean);
|
|
32645
|
+
}
|
|
32646
|
+
const canUpdate = globalInstall && !!npm;
|
|
32647
|
+
return {
|
|
32648
|
+
prefix,
|
|
32649
|
+
currentVersion,
|
|
32650
|
+
canUpdate,
|
|
32651
|
+
latest: async () => {
|
|
32652
|
+
const data = JSON.parse(await fetchInstallationText(`https://registry.npmjs.org/${encodeURIComponent(name)}/latest`));
|
|
32653
|
+
return installationVersion(data.version);
|
|
32654
|
+
},
|
|
32655
|
+
update: async (version2) => {
|
|
32656
|
+
if (!canUpdate || !npm)
|
|
32657
|
+
throw new Error("Use the original package manager to update this installation");
|
|
32658
|
+
await runInstallationCommand(npm.executable, ["install", "--global", "--prefix", prefix, `${name}@${installationVersion(version2)}`], env, 3e5);
|
|
32659
|
+
}
|
|
32660
|
+
};
|
|
32661
|
+
}
|
|
32662
|
+
const parent = path7.dirname(directory);
|
|
32663
|
+
if (parent === directory)
|
|
32664
|
+
break;
|
|
32665
|
+
directory = parent;
|
|
32666
|
+
}
|
|
32667
|
+
return null;
|
|
32668
|
+
}
|
|
32669
|
+
|
|
32670
|
+
// dist/installation.js
|
|
32671
|
+
function createDeepSeekInstallation(environment, command) {
|
|
32672
|
+
let update;
|
|
32673
|
+
return createInstallationManager({
|
|
32674
|
+
async check() {
|
|
32675
|
+
const invocation = resolveDeepSeekCommand(command, environment);
|
|
32676
|
+
if (!invocation)
|
|
32677
|
+
throw new Error("DeepSeek Harness is not installed");
|
|
32678
|
+
const currentVersion = versionFromOutput(await runInstallationCommand(invocation.command, [...invocation.arguments, "--version"], environment));
|
|
32679
|
+
const npm = invocation.kind === "npx" ? null : await npmInstallation(invocation.command, ["@deepseek-ai/dsh"], environment);
|
|
32680
|
+
update = npm?.update;
|
|
32681
|
+
const latestVersion = npm ? await npm.latest() : "Unknown";
|
|
32682
|
+
const canUpdate = npm?.canUpdate ?? false;
|
|
32683
|
+
return {
|
|
32684
|
+
currentVersion,
|
|
32685
|
+
latestVersion,
|
|
32686
|
+
updateAvailable: !!npm && newerInstallationVersion(currentVersion, latestVersion),
|
|
32687
|
+
canUpdate,
|
|
32688
|
+
...!canUpdate ? {
|
|
32689
|
+
message: "Update with the original installer. Offline npx, Python, desktop, and project-local installations are not upgraded through global npm."
|
|
32690
|
+
} : {}
|
|
32691
|
+
};
|
|
32692
|
+
},
|
|
32693
|
+
async update(state) {
|
|
32694
|
+
if (!update)
|
|
32695
|
+
throw new Error("This DeepSeek installation requires a manual update");
|
|
32696
|
+
await update(state.latestVersion);
|
|
32697
|
+
}
|
|
32698
|
+
});
|
|
32699
|
+
}
|
|
32700
|
+
|
|
32127
32701
|
// dist/plugin.js
|
|
32128
32702
|
var DEEPSEEK_HARNESS_COMMAND_ENV = "CODEXHOST_DEEPSEEK_HARNESS_COMMAND";
|
|
32129
32703
|
var DEEPSEEK_HARNESS_ENDPOINT_ENV = "CODEXHOST_DEEPSEEK_HARNESS_ENDPOINT";
|
|
32130
32704
|
function createHarnessAdapter(context) {
|
|
32131
32705
|
const environment = { ...context.environment };
|
|
32132
32706
|
const openLocalUrl = context.openLocalUrl;
|
|
32133
|
-
return new DeepSeekHarnessAdapter({
|
|
32707
|
+
return Object.assign(new DeepSeekHarnessAdapter({
|
|
32134
32708
|
...environment[DEEPSEEK_HARNESS_COMMAND_ENV] ? { command: environment[DEEPSEEK_HARNESS_COMMAND_ENV] } : {},
|
|
32135
32709
|
...environment[DEEPSEEK_HARNESS_ENDPOINT_ENV] ? { endpoint: environment[DEEPSEEK_HARNESS_ENDPOINT_ENV] } : {},
|
|
32136
32710
|
environment,
|
|
32137
32711
|
...!context.managedRemoteHost && openLocalUrl ? { openWebUi: (url2) => openLocalUrl(url2.href) } : {}
|
|
32712
|
+
}), {
|
|
32713
|
+
installation: createDeepSeekInstallation(environment, environment[DEEPSEEK_HARNESS_COMMAND_ENV])
|
|
32138
32714
|
});
|
|
32139
32715
|
}
|
|
32140
32716
|
export {
|