@liberseek/boft-cli-linux-x64 0.7.5 → 0.7.7

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.
@@ -3229,8 +3229,8 @@ var require_utils = __commonJS({
3229
3229
  }
3230
3230
  return ind;
3231
3231
  }
3232
- function removeDotSegments(path4) {
3233
- let input = path4;
3232
+ function removeDotSegments(path6) {
3233
+ let input = path6;
3234
3234
  const output = [];
3235
3235
  let nextSlash = -1;
3236
3236
  let len = 0;
@@ -3482,8 +3482,8 @@ var require_schemes = __commonJS({
3482
3482
  wsComponent.secure = void 0;
3483
3483
  }
3484
3484
  if (wsComponent.resourceName) {
3485
- const [path4, query] = wsComponent.resourceName.split("?");
3486
- wsComponent.path = path4 && path4 !== "/" ? path4 : void 0;
3485
+ const [path6, query] = wsComponent.resourceName.split("?");
3486
+ wsComponent.path = path6 && path6 !== "/" ? path6 : void 0;
3487
3487
  wsComponent.query = query;
3488
3488
  wsComponent.resourceName = void 0;
3489
3489
  }
@@ -12592,7 +12592,7 @@ var require_dist = __commonJS({
12592
12592
 
12593
12593
  // ../qoder/dist/qoder-adapter.js
12594
12594
  import { randomUUID as randomUUID2 } from "node:crypto";
12595
- import path3 from "node:path";
12595
+ import path5 from "node:path";
12596
12596
 
12597
12597
  // ../../../node_modules/zod/v4/classic/external.js
12598
12598
  var external_exports = {};
@@ -13360,10 +13360,10 @@ function mergeDefs(...defs) {
13360
13360
  function cloneDef(schema) {
13361
13361
  return mergeDefs(schema._zod.def);
13362
13362
  }
13363
- function getElementAtPath(obj, path4) {
13364
- if (!path4)
13363
+ function getElementAtPath(obj, path6) {
13364
+ if (!path6)
13365
13365
  return obj;
13366
- return path4.reduce((acc, key) => acc?.[key], obj);
13366
+ return path6.reduce((acc, key) => acc?.[key], obj);
13367
13367
  }
13368
13368
  function promiseAllObject(promisesObj) {
13369
13369
  const keys = Object.keys(promisesObj);
@@ -13772,11 +13772,11 @@ function explicitlyAborted(x3, startIndex = 0) {
13772
13772
  }
13773
13773
  return false;
13774
13774
  }
13775
- function prefixIssues(path4, issues) {
13775
+ function prefixIssues(path6, issues) {
13776
13776
  return issues.map((iss) => {
13777
13777
  var _a5;
13778
13778
  (_a5 = iss).path ?? (_a5.path = []);
13779
- iss.path.unshift(path4);
13779
+ iss.path.unshift(path6);
13780
13780
  return iss;
13781
13781
  });
13782
13782
  }
@@ -13923,16 +13923,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
13923
13923
  }
13924
13924
  function formatError(error51, mapper = (issue2) => issue2.message) {
13925
13925
  const fieldErrors = { _errors: [] };
13926
- const processError = (error52, path4 = []) => {
13926
+ const processError = (error52, path6 = []) => {
13927
13927
  for (const issue2 of error52.issues) {
13928
13928
  if (issue2.code === "invalid_union" && issue2.errors.length) {
13929
- issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
13929
+ issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
13930
13930
  } else if (issue2.code === "invalid_key") {
13931
- processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
13931
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
13932
13932
  } else if (issue2.code === "invalid_element") {
13933
- processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
13933
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
13934
13934
  } else {
13935
- const fullpath = [...path4, ...issue2.path];
13935
+ const fullpath = [...path6, ...issue2.path];
13936
13936
  if (fullpath.length === 0) {
13937
13937
  fieldErrors._errors.push(mapper(issue2));
13938
13938
  } else {
@@ -13959,17 +13959,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
13959
13959
  }
13960
13960
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
13961
13961
  const result = { errors: [] };
13962
- const processError = (error52, path4 = []) => {
13962
+ const processError = (error52, path6 = []) => {
13963
13963
  var _a5, _b;
13964
13964
  for (const issue2 of error52.issues) {
13965
13965
  if (issue2.code === "invalid_union" && issue2.errors.length) {
13966
- issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
13966
+ issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
13967
13967
  } else if (issue2.code === "invalid_key") {
13968
- processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
13968
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
13969
13969
  } else if (issue2.code === "invalid_element") {
13970
- processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
13970
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
13971
13971
  } else {
13972
- const fullpath = [...path4, ...issue2.path];
13972
+ const fullpath = [...path6, ...issue2.path];
13973
13973
  if (fullpath.length === 0) {
13974
13974
  result.errors.push(mapper(issue2));
13975
13975
  continue;
@@ -14001,8 +14001,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
14001
14001
  }
14002
14002
  function toDotPath(_path) {
14003
14003
  const segs = [];
14004
- const path4 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
14005
- for (const seg of path4) {
14004
+ const path6 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
14005
+ for (const seg of path6) {
14006
14006
  if (typeof seg === "number")
14007
14007
  segs.push(`[${seg}]`);
14008
14008
  else if (typeof seg === "symbol")
@@ -26694,13 +26694,13 @@ function resolveRef(ref, ctx) {
26694
26694
  if (!ref.startsWith("#")) {
26695
26695
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
26696
26696
  }
26697
- const path4 = ref.slice(1).split("/").filter(Boolean);
26698
- if (path4.length === 0) {
26697
+ const path6 = ref.slice(1).split("/").filter(Boolean);
26698
+ if (path6.length === 0) {
26699
26699
  return ctx.rootSchema;
26700
26700
  }
26701
26701
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
26702
- if (path4[0] === defsKey) {
26703
- const key = path4[1];
26702
+ if (path6[0] === defsKey) {
26703
+ const key = path6[1];
26704
26704
  if (!key || !ctx.defs[key]) {
26705
26705
  throw new Error(`Reference not found: ${ref}`);
26706
26706
  }
@@ -27163,6 +27163,123 @@ var credentialImportsParamsSchema = external_exports.object({
27163
27163
  request: credentialImportsRequestSchema
27164
27164
  }).strict();
27165
27165
 
27166
+ // ../../shared-contracts/dist/harness-display-settings.js
27167
+ var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
27168
+ agent: external_exports.string().min(1).max(128),
27169
+ section: external_exports.enum(["main", "more", "auto"])
27170
+ })).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
27171
+ var harnessDisplaySettingsSchema = external_exports.strictObject({
27172
+ entries: harnessDisplayEntriesSchema.nullable()
27173
+ });
27174
+ var harnessDisplayGetSchema = external_exports.strictObject({});
27175
+ var harnessDisplaySetSchema = external_exports.strictObject({
27176
+ entries: harnessDisplayEntriesSchema,
27177
+ /** Import legacy Desktop preferences only if no shared settings exist yet. */
27178
+ initializeOnly: external_exports.boolean().optional()
27179
+ });
27180
+
27181
+ // ../../shared-contracts/dist/ids.js
27182
+ var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
27183
+ message: "Identifier must not be empty or whitespace"
27184
+ });
27185
+ var harnessIdSchema = opaqueIdSchema.brand();
27186
+ var hostThreadIdSchema = opaqueIdSchema.brand();
27187
+ var hostTurnIdSchema = opaqueIdSchema.brand();
27188
+ var hostItemIdSchema = opaqueIdSchema.brand();
27189
+ var hostInteractionIdSchema = opaqueIdSchema.brand();
27190
+
27191
+ // ../../shared-contracts/dist/harness-plugins.js
27192
+ var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
27193
+ var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
27194
+ var HARNESS_PLUGIN_LIMIT = 128;
27195
+ var harnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).refine((id) => id !== "codex", "The official Codex identity is reserved").pipe(harnessIdSchema);
27196
+ var relativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
27197
+ var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
27198
+ var pluginPresentationShape = {
27199
+ id: harnessPluginIdSchema,
27200
+ name: external_exports.string().trim().min(1).max(128),
27201
+ version: external_exports.string().min(1).max(128),
27202
+ /** The factory accepts a persisted local entrypoint through its construction context. */
27203
+ launchCommand: external_exports.literal(true).optional(),
27204
+ links: external_exports.object({
27205
+ documentation: documentationUrlSchema.optional(),
27206
+ installation: documentationUrlSchema.optional()
27207
+ }).strict().optional()
27208
+ };
27209
+ var harnessPluginManifestSchema = external_exports.object({
27210
+ manifestVersion: external_exports.literal(1),
27211
+ ...pluginPresentationShape,
27212
+ adapterApiVersion: external_exports.number().int().positive(),
27213
+ entry: relativeResourceSchema,
27214
+ icon: relativeResourceSchema.optional()
27215
+ }).strict();
27216
+ var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
27217
+ var harnessPluginDescriptorSchema = external_exports.object({
27218
+ ...pluginPresentationShape,
27219
+ icon: harnessPluginIconSchema.optional()
27220
+ }).strict();
27221
+ var harnessPluginListParamsSchema = external_exports.object({}).strict();
27222
+ var harnessPluginListResultSchema = external_exports.object({
27223
+ plugins: external_exports.array(harnessPluginDescriptorSchema).max(HARNESS_PLUGIN_LIMIT)
27224
+ }).strict();
27225
+ var harnessPluginConfigurationSchema = external_exports.object({
27226
+ version: external_exports.literal(1),
27227
+ enabled: external_exports.array(harnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
27228
+ }).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
27229
+ message: "Enabled plugin IDs must be unique",
27230
+ path: ["enabled"]
27231
+ });
27232
+
27233
+ // ../../shared-contracts/dist/harness-long-context.js
27234
+ var HARNESS_LONG_CONTEXT_GET_METHOD = "codexhost/harness/long-context/get";
27235
+ var HARNESS_LONG_CONTEXT_SET_METHOD = "codexhost/harness/long-context/set";
27236
+ var harnessLongContextGetSchema = external_exports.object({
27237
+ harnessId: harnessPluginIdSchema
27238
+ }).strict();
27239
+ var harnessLongContextSetSchema = harnessLongContextGetSchema.extend({
27240
+ enabled: external_exports.boolean()
27241
+ });
27242
+ var harnessLongContextSchema = external_exports.object({
27243
+ enabled: external_exports.boolean()
27244
+ }).strict();
27245
+
27246
+ // ../../shared-contracts/dist/console.js
27247
+ var consoleAnnouncementSchema = external_exports.strictObject({
27248
+ title: external_exports.string().trim().min(1).max(200),
27249
+ type: external_exports.enum(["info", "warning", "danger"]),
27250
+ body: external_exports.string().trim().min(1).max(16 * 1024)
27251
+ });
27252
+ var consoleOpenParamsSchema = external_exports.strictObject({});
27253
+ var consoleOpenResultSchema = external_exports.strictObject({
27254
+ /** The console address. */
27255
+ url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
27256
+ });
27257
+ var CONSOLE_HOST_METHODS = Object.freeze([
27258
+ "codexhost/harness/plugins/list",
27259
+ "codexhost/harness/display-settings/get",
27260
+ "codexhost/harness/display-settings/set",
27261
+ "codexhost/harness/inspect",
27262
+ "codexhost/harness/installation",
27263
+ "codexhost/harness/launch-settings/get",
27264
+ "codexhost/harness/launch-settings/set",
27265
+ HARNESS_LONG_CONTEXT_GET_METHOD,
27266
+ HARNESS_LONG_CONTEXT_SET_METHOD,
27267
+ "codexhost/harness/web-ui/open",
27268
+ "codexhost/harness/accounts/sources",
27269
+ "codexhost/harness/accounts/list",
27270
+ "codexhost/harness/accounts/inspect",
27271
+ "codexhost/harness/credential-imports",
27272
+ "codexhost/harness/session-import/sources",
27273
+ "codexhost/harness/session-import/list",
27274
+ "codexhost/harness/session-import/import",
27275
+ "codexhost/account/list",
27276
+ "codexhost/account/refresh",
27277
+ "codexhost/account/usage/inspect",
27278
+ "codexhost/update/check",
27279
+ "codexhost/update/start",
27280
+ "codexhost/update/status"
27281
+ ]);
27282
+
27166
27283
  // ../../shared-contracts/dist/version.js
27167
27284
  var WORKSPACE_CONTRACT_VERSION = 1;
27168
27285
 
@@ -27206,15 +27323,11 @@ var loadedSessionsSchema = external_exports.array(external_exports.strictObject(
27206
27323
  inactiveMs: external_exports.number().nonnegative()
27207
27324
  }));
27208
27325
 
27209
- // ../../shared-contracts/dist/ids.js
27210
- var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
27211
- message: "Identifier must not be empty or whitespace"
27326
+ // ../../shared-contracts/dist/manual-compaction.js
27327
+ var threadManualCompactionStartedSchema = external_exports.strictObject({
27328
+ threadId: hostThreadIdSchema,
27329
+ turnId: hostTurnIdSchema
27212
27330
  });
27213
- var harnessIdSchema = opaqueIdSchema.brand();
27214
- var hostThreadIdSchema = opaqueIdSchema.brand();
27215
- var hostTurnIdSchema = opaqueIdSchema.brand();
27216
- var hostItemIdSchema = opaqueIdSchema.brand();
27217
- var hostInteractionIdSchema = opaqueIdSchema.brand();
27218
27331
 
27219
27332
  // ../../shared-contracts/dist/thread-usage.js
27220
27333
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
@@ -27276,6 +27389,10 @@ var threadUsageSnapshotSchema = external_exports.object({
27276
27389
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
27277
27390
  var accountCreditsProductUsageSchema = external_exports.object({
27278
27391
  product: external_exports.string().min(1),
27392
+ used: external_exports.number().finite().nonnegative().optional(),
27393
+ // Zero is a real empty cap, not an absent field.
27394
+ limit: external_exports.number().finite().nonnegative().optional(),
27395
+ unit: external_exports.string().min(1).max(32).optional(),
27279
27396
  usagePercent: usagePercentSchema,
27280
27397
  resetsAt: external_exports.string().min(1).optional()
27281
27398
  }).strict();
@@ -27285,11 +27402,14 @@ var accountResetCreditsSchema = external_exports.object({
27285
27402
  expiresAt: external_exports.array(external_exports.string().min(1)).min(1).max(32).optional()
27286
27403
  }).strict();
27287
27404
  var accountCreditsSnapshotSchema = external_exports.object({
27405
+ used: external_exports.number().finite().nonnegative().optional(),
27406
+ // Zero is a real empty cap, not an absent field.
27407
+ limit: external_exports.number().finite().nonnegative().optional(),
27408
+ unit: external_exports.string().trim().min(1).max(32).optional(),
27288
27409
  /** Native label when the primary limit is scoped to a model or product group. */
27289
27410
  label: external_exports.string().min(1).optional(),
27290
27411
  usedPercent: usagePercentSchema.optional(),
27291
27412
  remaining: external_exports.number().finite().optional(),
27292
- unit: external_exports.string().trim().min(1).max(32).optional(),
27293
27413
  resetsAt: external_exports.string().min(1).optional(),
27294
27414
  periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
27295
27415
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
@@ -27320,12 +27440,27 @@ var threadUsageInspectionSchema = external_exports.object({
27320
27440
  }).strict();
27321
27441
 
27322
27442
  // ../../shared-contracts/dist/harness-accounts.js
27323
- var harnessAccountSnapshotSchema = external_exports.object({
27443
+ var accountBalanceSnapshotSchema = external_exports.object({
27444
+ amount: external_exports.number().finite().nonnegative(),
27445
+ /** ISO 4217 code as reported by the Provider, for example `CNY`. */
27446
+ currency: external_exports.string().trim().min(1).max(8),
27447
+ /** Native label when the Harness exposes several Billing Sources. */
27448
+ label: external_exports.string().trim().min(1).max(128).optional()
27449
+ }).strict();
27450
+ var harnessAccountSnapshotObject = external_exports.object({
27324
27451
  email: external_exports.string().trim().min(1).max(320).optional(),
27325
27452
  label: external_exports.string().trim().min(1).max(256).optional(),
27326
27453
  plan: external_exports.string().trim().min(1).max(128).optional(),
27327
- credits: accountCreditsSnapshotSchema
27454
+ credits: accountCreditsSnapshotSchema.optional(),
27455
+ balance: accountBalanceSnapshotSchema.optional()
27328
27456
  }).strict();
27457
+ function requireReportedQuota(schema) {
27458
+ return schema.refine((value) => {
27459
+ const reported = value;
27460
+ return reported.credits !== void 0 || reported.balance !== void 0;
27461
+ }, { message: "Account must report either credits or a balance" });
27462
+ }
27463
+ var harnessAccountSnapshotSchema = requireReportedQuota(harnessAccountSnapshotObject);
27329
27464
  var harnessAccountIdentityShape = {
27330
27465
  harnessId: harnessIdSchema,
27331
27466
  harnessName: external_exports.string().trim().min(1).max(128)
@@ -27336,11 +27471,13 @@ var harnessAccountSourceListResultSchema = external_exports.object({ sources: ex
27336
27471
  var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
27337
27472
  var harnessAccountInspectResultSchema = external_exports.object({
27338
27473
  ...harnessAccountIdentityShape,
27339
- account: harnessAccountSnapshotSchema.nullable()
27474
+ account: harnessAccountSnapshotSchema.nullable(),
27475
+ /** Every Billing Source from one Harness; `account` remains the first for older clients. */
27476
+ accounts: external_exports.array(harnessAccountSnapshotSchema).max(8).optional()
27340
27477
  }).strict();
27341
27478
  var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
27342
27479
  var harnessAccountListResultSchema = external_exports.object({
27343
- accounts: external_exports.array(harnessAccountSnapshotSchema.extend(harnessAccountIdentityShape)).max(128)
27480
+ accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
27344
27481
  }).strict();
27345
27482
 
27346
27483
  // ../../shared-contracts/dist/json-value.js
@@ -27478,6 +27615,8 @@ var harnessModelSchema = external_exports.object({
27478
27615
  ref: harnessModelRefSchema,
27479
27616
  label: nonBlankTextSchema2.max(HARNESS_MODEL_LABEL_MAX_LENGTH),
27480
27617
  resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
27618
+ /** Optional opaque selection for this same Model with priority processing enabled. */
27619
+ fastModel: harnessModelRefSchema.optional(),
27481
27620
  supportedThinkingOptionIds: external_exports.array(harnessThinkingOptionIdSchema).optional()
27482
27621
  }).strict();
27483
27622
  var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options, context) => {
@@ -27510,6 +27649,16 @@ var harnessModelCatalogSchema = external_exports.object({
27510
27649
  });
27511
27650
  }
27512
27651
  refs.add(model.ref.id);
27652
+ if (model.fastModel) {
27653
+ if (refs.has(model.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model.fastModel?.id)) {
27654
+ context.addIssue({
27655
+ code: "custom",
27656
+ message: "Fast Model refs must be distinct and unique",
27657
+ path: ["models", index, "fastModel"]
27658
+ });
27659
+ }
27660
+ refs.add(model.fastModel.id);
27661
+ }
27513
27662
  const supportedThinkingIds = /* @__PURE__ */ new Set();
27514
27663
  for (const [optionIndex, optionId] of (model.supportedThinkingOptionIds ?? []).entries()) {
27515
27664
  if (supportedThinkingIds.has(optionId)) {
@@ -27632,11 +27781,13 @@ var threadThinkingSelectParamsSchema = external_exports.object({
27632
27781
  thinkingOptionId: harnessThinkingOptionIdSchema
27633
27782
  }).strict();
27634
27783
  var threadInspectionParamsSchema = external_exports.object({
27635
- threadId: hostThreadIdSchema
27784
+ threadId: hostThreadIdSchema,
27785
+ includeReferenceCapability: external_exports.boolean().optional()
27636
27786
  }).strict();
27637
27787
  var codexThreadInspectionSchema = external_exports.object({
27638
27788
  owner: external_exports.literal("codex"),
27639
- locked: external_exports.literal(true)
27789
+ locked: external_exports.literal(true),
27790
+ supportsThreadReferences: external_exports.literal(true).optional()
27640
27791
  }).strict();
27641
27792
  var externalThreadInspectionSchema = external_exports.object({
27642
27793
  owner: external_exports.literal("external"),
@@ -27701,48 +27852,6 @@ var threadOwnershipListResultSchema = external_exports.object({
27701
27852
  }
27702
27853
  });
27703
27854
 
27704
- // ../../shared-contracts/dist/harness-plugins.js
27705
- var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
27706
- var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
27707
- var HARNESS_PLUGIN_LIMIT = 128;
27708
- var harnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).refine((id) => id !== "codex", "The official Codex identity is reserved").pipe(harnessIdSchema);
27709
- var relativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
27710
- var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
27711
- var pluginPresentationShape = {
27712
- id: harnessPluginIdSchema,
27713
- name: external_exports.string().trim().min(1).max(128),
27714
- version: external_exports.string().min(1).max(128),
27715
- /** The factory accepts a persisted local entrypoint through its construction context. */
27716
- launchCommand: external_exports.literal(true).optional(),
27717
- links: external_exports.object({
27718
- documentation: documentationUrlSchema.optional(),
27719
- installation: documentationUrlSchema.optional()
27720
- }).strict().optional()
27721
- };
27722
- var harnessPluginManifestSchema = external_exports.object({
27723
- manifestVersion: external_exports.literal(1),
27724
- ...pluginPresentationShape,
27725
- adapterApiVersion: external_exports.number().int().positive(),
27726
- entry: relativeResourceSchema,
27727
- icon: relativeResourceSchema.optional()
27728
- }).strict();
27729
- var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
27730
- var harnessPluginDescriptorSchema = external_exports.object({
27731
- ...pluginPresentationShape,
27732
- icon: harnessPluginIconSchema.optional()
27733
- }).strict();
27734
- var harnessPluginListParamsSchema = external_exports.object({}).strict();
27735
- var harnessPluginListResultSchema = external_exports.object({
27736
- plugins: external_exports.array(harnessPluginDescriptorSchema).max(HARNESS_PLUGIN_LIMIT)
27737
- }).strict();
27738
- var harnessPluginConfigurationSchema = external_exports.object({
27739
- version: external_exports.literal(1),
27740
- enabled: external_exports.array(harnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
27741
- }).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
27742
- message: "Enabled plugin IDs must be unique",
27743
- path: ["enabled"]
27744
- });
27745
-
27746
27855
  // ../../shared-contracts/dist/harness-route.js
27747
27856
  var harnessPluginRouteSchema = external_exports.object({
27748
27857
  harnessId: harnessPluginIdSchema,
@@ -27764,10 +27873,31 @@ var harnessLaunchSettingsSchema = external_exports.object({
27764
27873
  restartRequired: external_exports.boolean()
27765
27874
  }).strict();
27766
27875
 
27876
+ // ../../shared-contracts/dist/harness-installation.js
27877
+ var harnessInstallationParamsSchema = external_exports.object({
27878
+ harnessId: harnessIdSchema,
27879
+ action: external_exports.enum(["check", "update", "install"])
27880
+ }).strict();
27881
+ var harnessInstallationStateSchema = external_exports.object({
27882
+ currentVersion: external_exports.string().min(1).max(128),
27883
+ latestVersion: external_exports.string().min(1).max(128),
27884
+ updateAvailable: external_exports.boolean(),
27885
+ canUpdate: external_exports.boolean(),
27886
+ message: external_exports.string().max(2048).optional()
27887
+ }).strict();
27888
+
27767
27889
  // ../../shared-contracts/dist/codex-accounts.js
27768
27890
  var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
27769
27891
  var nonBlankTextSchema3 = external_exports.string().trim().min(1);
27770
27892
  var codexAccountAuthKindSchema = external_exports.enum(["api", "chatgpt"]);
27893
+ var codexAccountSiteUrlPattern = /^https?:\/\/(?:\[[0-9a-fA-F:]+\]|[^/\s:@?#]+)(?::\d{1,5})?(?:[/?#][^\s]*)?$/u;
27894
+ function isCodexAccountSiteUrl(value) {
27895
+ return value.length > 0 && value.length <= 2048 && codexAccountSiteUrlPattern.test(value);
27896
+ }
27897
+ var externalUrlOpenParamsSchema = external_exports.object({
27898
+ url: external_exports.string().max(2048).refine(isCodexAccountSiteUrl, "External URL must be http(s)")
27899
+ }).strict();
27900
+ var externalUrlOpenResultSchema = external_exports.object({}).strict();
27771
27901
  var codexAccountPlanTypeSchema = external_exports.enum([
27772
27902
  "free",
27773
27903
  "go",
@@ -27793,7 +27923,8 @@ var codexAccountSchema = external_exports.object({
27793
27923
  email: external_exports.string().email().max(320).optional(),
27794
27924
  planType: codexAccountPlanTypeSchema.optional(),
27795
27925
  authKind: codexAccountAuthKindSchema.optional(),
27796
- authIdentity: nonBlankTextSchema3.max(256).optional()
27926
+ authIdentity: nonBlankTextSchema3.max(256).optional(),
27927
+ siteUrl: external_exports.string().refine(isCodexAccountSiteUrl, "Account site URL must be http(s)").optional()
27797
27928
  }).strict();
27798
27929
  var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
27799
27930
  var codexAccountListResultSchema = external_exports.object({
@@ -28070,7 +28201,7 @@ var updateStatusResultSchema = external_exports.strictObject({
28070
28201
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
28071
28202
 
28072
28203
  // ../qoder/dist/qoder-command.js
28073
- import path2 from "node:path";
28204
+ import path4 from "node:path";
28074
28205
 
28075
28206
  // ../../harness-discovery/dist/environment.js
28076
28207
  import fs from "node:fs";
@@ -28118,6 +28249,36 @@ function newestFirst(names) {
28118
28249
  return [...names].sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
28119
28250
  }
28120
28251
 
28252
+ // ../../harness-discovery/dist/invocation.js
28253
+ import path2 from "node:path";
28254
+ function commandInvocation(command, arguments_, environment, platform = process.platform) {
28255
+ const extension = path2.win32.extname(command).toLowerCase();
28256
+ if (platform !== "win32" || ![".cmd", ".bat"].includes(extension)) {
28257
+ return { command, arguments: [...arguments_], windowsVerbatimArguments: false };
28258
+ }
28259
+ const quote = (value) => `"${value.replaceAll("%", "%%").replaceAll('"', '""')}"`;
28260
+ const commandLine = [command, ...arguments_].map(quote).join(" ");
28261
+ return {
28262
+ command: environmentValue(environment, "ComSpec") ?? "cmd.exe",
28263
+ arguments: ["/d", "/v:off", "/s", "/c", `"${commandLine}"`],
28264
+ windowsVerbatimArguments: true
28265
+ };
28266
+ }
28267
+
28268
+ // ../../harness-discovery/dist/node-runtime.js
28269
+ import path3 from "node:path";
28270
+ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath, platform = process.platform) {
28271
+ const pathKey = Object.keys(environment).find((name) => name.toLowerCase() === "path") ?? "PATH";
28272
+ const delimiter = platform === "win32" ? ";" : ":";
28273
+ const runtimeDirectory = path3.dirname(runtimeExecutable);
28274
+ const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
28275
+ const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
28276
+ if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
28277
+ directories.push(runtimeDirectory);
28278
+ }
28279
+ return { ...environment, [pathKey]: directories.join(delimiter) };
28280
+ }
28281
+
28121
28282
  // ../../harness-discovery/dist/resolve.js
28122
28283
  import os from "node:os";
28123
28284
 
@@ -28281,6 +28442,170 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
28281
28442
  return void 0;
28282
28443
  }
28283
28444
 
28445
+ // ../../harness-discovery/dist/installation.js
28446
+ import { execFile } from "node:child_process";
28447
+ import { homedir } from "node:os";
28448
+ function runInstallationCommand(command, args, environment, timeout = 3e4) {
28449
+ const env = withNodeRuntimeOnPath(environment);
28450
+ const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
28451
+ return new Promise((resolve, reject) => {
28452
+ const child = execFile(invocation.command, invocation.arguments, {
28453
+ env,
28454
+ cwd: env.HOME ?? env.USERPROFILE ?? homedir(),
28455
+ encoding: "utf8",
28456
+ timeout,
28457
+ killSignal: "SIGKILL",
28458
+ maxBuffer: 1024 * 1024,
28459
+ windowsHide: true,
28460
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments
28461
+ }, (error51, stdout, stderr) => {
28462
+ if (error51)
28463
+ reject(new Error(error51.killed ? "Harness command timed out" : "Harness command failed; check the native installation and retry"));
28464
+ else
28465
+ resolve((stdout || stderr).trim());
28466
+ });
28467
+ child.stdin?.end();
28468
+ });
28469
+ }
28470
+ function installationVersion(value) {
28471
+ if (typeof value !== "string" || !/^v?\d+(?:\.\d+){1,3}(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(value.trim()))
28472
+ throw new Error("Harness returned an invalid version");
28473
+ return value.trim().replace(/^v/, "");
28474
+ }
28475
+ function versionFromOutput(output) {
28476
+ return installationVersion(output.match(/\b\d+(?:\.\d+){1,3}(?:-[\w.-]+)?(?:\+[\w.-]+)?\b/)?.[0]);
28477
+ }
28478
+ function newerInstallationVersion(current, latest) {
28479
+ const a = installationVersion(current).replace(/\+.*/, "");
28480
+ const b = installationVersion(latest).replace(/\+.*/, "");
28481
+ const coreA = a.replace(/-.*/, "").split(".").map(BigInt);
28482
+ const coreB = b.replace(/-.*/, "").split(".").map(BigInt);
28483
+ for (let i = 0; i < Math.max(coreA.length, coreB.length); i++) {
28484
+ if ((coreA[i] ?? 0n) !== (coreB[i] ?? 0n))
28485
+ return (coreB[i] ?? 0n) > (coreA[i] ?? 0n);
28486
+ }
28487
+ const preA = a.includes("-") ? a.slice(a.indexOf("-") + 1).split(".") : [];
28488
+ const preB = b.includes("-") ? b.slice(b.indexOf("-") + 1).split(".") : [];
28489
+ if (!preA.length || !preB.length)
28490
+ return !!preA.length && !preB.length;
28491
+ for (let i = 0; i < Math.max(preA.length, preB.length); i++) {
28492
+ const x3 = preA[i];
28493
+ const y = preB[i];
28494
+ if (x3 === y)
28495
+ continue;
28496
+ if (x3 === void 0 || y === void 0)
28497
+ return x3 === void 0;
28498
+ const numericX = /^\d+$/.test(x3);
28499
+ const numericY = /^\d+$/.test(y);
28500
+ if (numericX && numericY) {
28501
+ if (BigInt(x3) === BigInt(y))
28502
+ continue;
28503
+ return BigInt(y) > BigInt(x3);
28504
+ }
28505
+ if (numericX !== numericY)
28506
+ return numericX;
28507
+ return y > x3;
28508
+ }
28509
+ return false;
28510
+ }
28511
+ function createInstallationManager(options) {
28512
+ let checking;
28513
+ let updating;
28514
+ const check2 = () => checking ??= options.check().finally(() => {
28515
+ checking = void 0;
28516
+ });
28517
+ return (action) => {
28518
+ if (updating)
28519
+ return updating;
28520
+ if (action === "check")
28521
+ return check2();
28522
+ updating = (async () => {
28523
+ const before = await check2();
28524
+ if (!before.updateAvailable)
28525
+ return before;
28526
+ if (!before.canUpdate)
28527
+ throw new Error(before.message ?? "This installation cannot be updated automatically");
28528
+ await options.update(before);
28529
+ const after = await check2();
28530
+ if (after.currentVersion === before.currentVersion)
28531
+ throw new Error("The Harness version did not change; check the native updater and retry");
28532
+ return after;
28533
+ })().finally(() => {
28534
+ updating = void 0;
28535
+ });
28536
+ return updating;
28537
+ };
28538
+ }
28539
+ async function fetchInstallationText(url2) {
28540
+ const request = async () => {
28541
+ const response = await fetch(url2, { signal: AbortSignal.timeout(15e3) });
28542
+ if (!response.ok)
28543
+ throw new Error("Could not check the latest Harness version");
28544
+ return response.text();
28545
+ };
28546
+ try {
28547
+ return await request();
28548
+ } catch (error51) {
28549
+ if (error51 instanceof DOMException && (error51.name === "AbortError" || error51.name === "TimeoutError"))
28550
+ throw error51;
28551
+ return request();
28552
+ }
28553
+ }
28554
+
28555
+ // ../../harness-discovery/dist/installer.js
28556
+ import { mkdtemp, rm, writeFile } from "node:fs/promises";
28557
+ import { tmpdir } from "node:os";
28558
+ import { join } from "node:path";
28559
+ function createHarnessInstaller(environment, source) {
28560
+ return async () => {
28561
+ if (!["darwin", "linux", "win32"].includes(process.platform))
28562
+ throw new Error("Unsupported installation platform");
28563
+ const env = withNodeRuntimeOnPath(environment);
28564
+ if ("npm" in source) {
28565
+ const npm = resolveHarnessExecutable({
28566
+ id: "npm",
28567
+ command: "npm",
28568
+ installRoots: {
28569
+ posix: [
28570
+ "~/.npm-global/bin",
28571
+ "~/.local/bin",
28572
+ VERSION_MANAGER_ROOTS,
28573
+ "/opt/homebrew/bin",
28574
+ "/usr/local/bin",
28575
+ "/usr/bin"
28576
+ ],
28577
+ windows: [
28578
+ "${APPDATA}/npm",
28579
+ VERSION_MANAGER_ROOTS,
28580
+ "${ProgramFiles}/nodejs",
28581
+ "${LOCALAPPDATA}/Programs/nodejs"
28582
+ ]
28583
+ }
28584
+ }, { environment: env });
28585
+ if (!npm)
28586
+ throw new Error("Install Node.js and npm first");
28587
+ await runInstallationCommand(npm.executable, ["install", "--global", source.npm], {
28588
+ ...env,
28589
+ ...source.allowScripts ? { npm_config_allow_scripts: source.allowScripts } : {}
28590
+ }, 6e5);
28591
+ return;
28592
+ }
28593
+ const windows = process.platform === "win32";
28594
+ const url2 = windows ? source.windows : source.posix;
28595
+ if (new URL(url2).protocol !== "https:")
28596
+ throw new Error("Installer requires HTTPS");
28597
+ const script = await fetchInstallationText(url2);
28598
+ const directory = await mkdtemp(join(tmpdir(), "codexhost-installer-"));
28599
+ try {
28600
+ const file2 = join(directory, windows ? "install.ps1" : "install.sh");
28601
+ await writeFile(file2, script, { mode: 384 });
28602
+ await runInstallationCommand(windows ? "powershell.exe" : source.shell ?? "bash", windows ? ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", file2] : [file2], env, 6e5);
28603
+ } finally {
28604
+ await rm(directory, { recursive: true, force: true });
28605
+ }
28606
+ };
28607
+ }
28608
+
28284
28609
  // ../qoder/dist/qoder-command.js
28285
28610
  var QoderExecutableError = class extends Error {
28286
28611
  code = "QODER_NOT_FOUND";
@@ -28344,7 +28669,52 @@ function resolveQoderExecutable(input = {}, dependencies = {}) {
28344
28669
  }, dependencies);
28345
28670
  if (!resolution)
28346
28671
  throw new QoderExecutableError("Qoder CLI is not installed");
28347
- return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path2.resolve(resolution.executable);
28672
+ return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path4.resolve(resolution.executable);
28673
+ }
28674
+
28675
+ // ../qoder/dist/qoder-account.js
28676
+ var record2 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
28677
+ var nonnegative = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0;
28678
+ function creditAmount(used, limit, unit) {
28679
+ if (!nonnegative(used) || !nonnegative(limit))
28680
+ return void 0;
28681
+ return {
28682
+ used,
28683
+ limit,
28684
+ unit: typeof unit === "string" && unit.trim() ? unit : "credits"
28685
+ };
28686
+ }
28687
+ function projectQoderAccount(usage, identity) {
28688
+ const data = record2(usage);
28689
+ const account = record2(identity);
28690
+ const quota = record2(data.userQuota);
28691
+ const shared = record2(data.orgResourcePackage);
28692
+ const nativePercent = quota.percentage ?? data.totalUsagePercentage;
28693
+ const usedPercent = nonnegative(nativePercent) ? Math.min(100, nativePercent) : nonnegative(quota.used) && nonnegative(quota.total) && quota.total > 0 ? Math.min(100, quota.used / quota.total * 100) : void 0;
28694
+ if (usedPercent === void 0)
28695
+ return null;
28696
+ const result = harnessAccountSnapshotSchema.safeParse({
28697
+ ...typeof account.email === "string" && account.email ? { email: account.email } : {},
28698
+ ...typeof account.subscriptionType === "string" && account.subscriptionType ? { plan: account.subscriptionType } : typeof data.userType === "string" ? { plan: data.userType } : {},
28699
+ credits: {
28700
+ usedPercent,
28701
+ periodType: "unknown",
28702
+ label: "Plan credits",
28703
+ ...shared.available === true && nonnegative(shared.percentage) && nonnegative(shared.used) && nonnegative(shared.cap) && shared.cap > 0 ? {
28704
+ productUsage: [
28705
+ {
28706
+ product: "Shared resource credits",
28707
+ usagePercent: Math.min(100, shared.percentage),
28708
+ used: shared.used,
28709
+ limit: shared.cap,
28710
+ unit: typeof shared.unit === "string" ? shared.unit : "credits"
28711
+ }
28712
+ ]
28713
+ } : {},
28714
+ ...creditAmount(quota.used, quota.total, quota.unit)
28715
+ }
28716
+ });
28717
+ return result.success ? result.data : null;
28348
28718
  }
28349
28719
 
28350
28720
  // ../qoder/dist/qoder-errors.js
@@ -29849,8 +30219,8 @@ function getErrorMap2() {
29849
30219
 
29850
30220
  // ../../../node_modules/zod/v3/helpers/parseUtil.js
29851
30221
  var makeIssue = (params) => {
29852
- const { data, path: path4, errorMaps, issueData } = params;
29853
- const fullPath = [...path4, ...issueData.path || []];
30222
+ const { data, path: path6, errorMaps, issueData } = params;
30223
+ const fullPath = [...path6, ...issueData.path || []];
29854
30224
  const fullIssue = {
29855
30225
  ...issueData,
29856
30226
  path: fullPath
@@ -29965,11 +30335,11 @@ var errorUtil;
29965
30335
 
29966
30336
  // ../../../node_modules/zod/v3/types.js
29967
30337
  var ParseInputLazyPath = class {
29968
- constructor(parent, value, path4, key) {
30338
+ constructor(parent, value, path6, key) {
29969
30339
  this._cachedPath = [];
29970
30340
  this.parent = parent;
29971
30341
  this.data = value;
29972
- this._path = path4;
30342
+ this._path = path6;
29973
30343
  this._key = key;
29974
30344
  }
29975
30345
  get path() {
@@ -33496,11 +33866,11 @@ function normalizeObjectSchema(schema) {
33496
33866
  }
33497
33867
  return void 0;
33498
33868
  }
33499
- function getDotPath(path4) {
33500
- if (path4.length === 0) {
33869
+ function getDotPath(path6) {
33870
+ if (path6.length === 0) {
33501
33871
  return "object root";
33502
33872
  }
33503
- return path4.reduce((acc, seg, index) => {
33873
+ return path6.reduce((acc, seg, index) => {
33504
33874
  if (index === 0) {
33505
33875
  return String(seg);
33506
33876
  }
@@ -52103,6 +52473,40 @@ var QoderAdapter = class {
52103
52473
  this.#getAvailableModels = options.getAvailableModels;
52104
52474
  this.#resolveExecutable = options.resolveExecutable ?? ((input, dependencies) => resolveQoderExecutable({ ...input, variant: this.#variant }, dependencies));
52105
52475
  }
52476
+ async inspectAccount() {
52477
+ let probe;
52478
+ let timer;
52479
+ try {
52480
+ const executable = this.#resolveExecutable({
52481
+ ...this.#commandOverride ? { command: this.#commandOverride } : {},
52482
+ environment: this.#environment,
52483
+ platform: this.#platform
52484
+ });
52485
+ probe = this.#queryFactory({
52486
+ prompt: "",
52487
+ options: {
52488
+ cwd: process.cwd(),
52489
+ pathToQoderCLIExecutable: executable,
52490
+ ...this.#environment ? { env: this.#environment } : {},
52491
+ auth: qoderAuthForEnvironment(this.#variant, this.#environment)
52492
+ }
52493
+ });
52494
+ return await Promise.race([
52495
+ Promise.all([probe.getUsageInfo?.(), probe.accountInfo?.().catch(() => void 0)]).then(([usage, identity]) => projectQoderAccount(usage, identity)),
52496
+ new Promise((resolve) => {
52497
+ timer = setTimeout(() => resolve(null), 1e4);
52498
+ })
52499
+ ]);
52500
+ } catch {
52501
+ return null;
52502
+ } finally {
52503
+ clearTimeout(timer);
52504
+ try {
52505
+ await probe?.close();
52506
+ } catch {
52507
+ }
52508
+ }
52509
+ }
52106
52510
  async inspect(input) {
52107
52511
  const cacheKey = input?.cwd ?? "";
52108
52512
  if (input?.refresh) {
@@ -52275,7 +52679,7 @@ var QoderAdapter = class {
52275
52679
  sourceInfo = await this.#getSessionInfo(sourceRef.data.nativeSessionId, { dir: input.cwd });
52276
52680
  } catch {
52277
52681
  }
52278
- if (sourceInfo?.cwd && path3.resolve(sourceInfo.cwd) !== path3.resolve(input.cwd)) {
52682
+ if (sourceInfo?.cwd && path5.resolve(sourceInfo.cwd) !== path5.resolve(input.cwd)) {
52279
52683
  return {
52280
52684
  ok: false,
52281
52685
  error: {
@@ -52429,14 +52833,66 @@ var QoderAdapter = class {
52429
52833
  }
52430
52834
  };
52431
52835
 
52432
- // dist/plugin.js
52433
- function createHarnessAdapter2(context) {
52434
- return new QoderAdapter({
52435
- variant: "cn",
52436
- environment: { ...context.environment },
52836
+ // ../qoder/dist/installation.js
52837
+ function createQoderInstallation(environment, command, variant = "global") {
52838
+ const run = (args, timeout) => runInstallationCommand(resolveQoderExecutable({ environment, variant, ...command ? { command } : {} }), args, environment, timeout);
52839
+ return createInstallationManager({
52840
+ async check() {
52841
+ const currentVersion = versionFromOutput(await run(["--version"]));
52842
+ if (variant === "cn" && !(await run(["update", "--help"]).catch(() => "")).includes("--check"))
52843
+ return {
52844
+ currentVersion,
52845
+ latestVersion: "Unknown",
52846
+ updateAvailable: false,
52847
+ canUpdate: false,
52848
+ message: "This Qoder China release does not expose a non-installing update check. Use its original installer."
52849
+ };
52850
+ const output = await run(["update", "--check"]);
52851
+ const available = output.match(/Update available:\s*\S+\s*(?:->|\u2192)\s*(\S+)/i);
52852
+ if (available?.[1])
52853
+ return {
52854
+ currentVersion,
52855
+ latestVersion: installationVersion(available[1]),
52856
+ updateAvailable: newerInstallationVersion(currentVersion, installationVersion(available[1])),
52857
+ canUpdate: true
52858
+ };
52859
+ if (!/already\s+(?:on|at)\s+(?:the\s+)?latest|up.to.date|no updates?\s+available/i.test(output))
52860
+ throw new Error("Qoder update check returned an unknown response");
52861
+ return {
52862
+ currentVersion,
52863
+ latestVersion: currentVersion,
52864
+ updateAvailable: false,
52865
+ canUpdate: true
52866
+ };
52867
+ },
52868
+ async update() {
52869
+ await run(["update"], 3e5);
52870
+ }
52871
+ });
52872
+ }
52873
+
52874
+ // ../qoder/dist/plugin.js
52875
+ function createHarnessAdapter(context, variant = "global") {
52876
+ const environment = { ...context.environment };
52877
+ const command = environment[variant === "cn" ? CODEXHOST_QODERCN_COMMAND : CODEXHOST_QODER_COMMAND];
52878
+ return Object.assign(new QoderAdapter({
52879
+ ...command ? { commandOverride: command } : {},
52880
+ variant,
52881
+ environment,
52437
52882
  platform: context.platform
52883
+ }), {
52884
+ installation: createQoderInstallation(environment, command, variant),
52885
+ install: createHarnessInstaller(environment, variant === "cn" ? {
52886
+ posix: "https://static.qoder.com.cn/qoder-cli-cn/install.sh",
52887
+ windows: "https://static.qoder.com.cn/qoder-cli-cn/install.ps1"
52888
+ } : { posix: "https://qoder.com/install", windows: "https://qoder.com/install.ps1" })
52438
52889
  });
52439
52890
  }
52891
+
52892
+ // dist/plugin.js
52893
+ function createHarnessAdapter2(context) {
52894
+ return createHarnessAdapter(context, "cn");
52895
+ }
52440
52896
  export {
52441
52897
  createHarnessAdapter2 as createHarnessAdapter
52442
52898
  };