@codexhost/cli-win32-arm64 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +94 -8
  4. package/app/console-web.js +537 -146
  5. package/app/desktop-controller.mjs +108 -12
  6. package/app/host-runtime.mjs +847 -235
  7. package/app/plugins/antigravity/plugin.mjs +143 -20
  8. package/app/plugins/claude-code/plugin.mjs +601 -71
  9. package/app/plugins/codebuddy/plugin.mjs +227 -30
  10. package/app/plugins/codex-usage/plugin.mjs +212 -77
  11. package/app/plugins/copilot/assets/icon.png +0 -0
  12. package/app/plugins/copilot/manifest.json +26 -0
  13. package/app/plugins/copilot/plugin.mjs +34546 -0
  14. package/app/plugins/cursor-cli/plugin.mjs +20805 -44862
  15. package/app/plugins/deepseek-harness/manifest.json +2 -2
  16. package/app/plugins/deepseek-harness/plugin.mjs +202 -21
  17. package/app/plugins/enabled.json +1 -0
  18. package/app/plugins/grok/plugin.mjs +278 -29
  19. package/app/plugins/hermes/plugin.mjs +143 -12
  20. package/app/plugins/kimi-code/plugin.mjs +140 -16
  21. package/app/plugins/kiro-cli/plugin.mjs +121 -10
  22. package/app/plugins/omp/plugin.mjs +2200 -2002
  23. package/app/plugins/opencode/plugin.mjs +137 -16
  24. package/app/plugins/pi/plugin.mjs +2563 -2282
  25. package/app/plugins/qoder/plugin.mjs +133 -14
  26. package/app/plugins/qoder-cn/plugin.mjs +133 -14
  27. package/app/plugins/workbuddy/plugin.mjs +603 -56
  28. package/app/plugins/zcode/plugin.mjs +133 -14
  29. package/app/renderer-extension.js +1171 -529
  30. package/bin/codexhost.exe +0 -0
  31. package/libexec/codexhost-node-repl.exe +0 -0
  32. package/libexec/codexhost-shim.exe +0 -0
  33. package/libexec/codexhost-updater.exe +0 -0
  34. package/package.json +1 -1
@@ -504,10 +504,13 @@ function usageSessionTitle(value) {
504
504
  return void 0;
505
505
  if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
506
506
  return normalized;
507
- const characters = [...normalized];
508
- if (characters.length <= MAX_SESSION_TITLE_LENGTH)
509
- return normalized;
510
- return `${characters.slice(0, MAX_SESSION_TITLE_LENGTH - 1).join("").trimEnd()}…`;
507
+ let title = "";
508
+ for (const character of normalized) {
509
+ if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
510
+ break;
511
+ title += character;
512
+ }
513
+ return `${title.trimEnd()}…`;
511
514
  }
512
515
  function sessionIdOk(value) {
513
516
  return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
@@ -15141,6 +15144,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
15141
15144
  initializeOnly: external_exports.boolean().optional()
15142
15145
  });
15143
15146
 
15147
+ // ../../shared-contracts/dist/harness-presentation.js
15148
+ var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
15149
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
15150
+ var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
15151
+ label: displayText(256).optional(),
15152
+ description: displayText(1024).optional()
15153
+ }).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
15154
+ var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
15155
+
15144
15156
  // ../../shared-contracts/dist/model-price-overrides.js
15145
15157
  var usdPerMillionTokens = external_exports.number().finite().nonnegative();
15146
15158
  var modelPriceOverrideSchema = external_exports.strictObject({
@@ -15190,10 +15202,19 @@ var model = external_exports.string().min(1).max(512);
15190
15202
  var project = external_exports.string().min(1).max(4096);
15191
15203
  var usageStatisticsParamsSchema = external_exports.strictObject({
15192
15204
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
15205
+ /** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
15206
+ timeZone: external_exports.string().min(1).max(128).refine((value) => {
15207
+ try {
15208
+ new Intl.DateTimeFormat("en", { timeZone: value });
15209
+ return true;
15210
+ } catch {
15211
+ return false;
15212
+ }
15213
+ }, "Unsupported usage statistics timezone").optional(),
15193
15214
  harness: harness.optional(),
15194
15215
  model: model.nullable().optional(),
15195
15216
  project: project.nullable().optional(),
15196
- /** One local date inside the range. */
15217
+ /** One date in the query timezone inside the range. */
15197
15218
  date: localDate.optional()
15198
15219
  });
15199
15220
  var usageStatisticsTotalsSchema = external_exports.strictObject({
@@ -15229,7 +15250,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
15229
15250
  });
15230
15251
  var usageStatisticsResultSchema = external_exports.strictObject({
15231
15252
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
15232
- /** First local date of the range; null for all time. */
15253
+ /** First date in the query timezone (Host local when omitted); null for all time. */
15233
15254
  from: localDate.nullable(),
15234
15255
  to: localDate,
15235
15256
  /** The filters these figures apply, echoed so a late answer to older filters is recognised. */
@@ -15269,7 +15290,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
15269
15290
  totals: usageStatisticsTotalsSchema,
15270
15291
  /** Each date and Harness of the range: every filter except the day. */
15271
15292
  daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
15272
- /** Local weekday (0 = Sunday) and hour, all filters applied. */
15293
+ /** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
15273
15294
  hourly: external_exports.array(external_exports.strictObject({
15274
15295
  weekday: external_exports.number().int().min(0).max(6),
15275
15296
  hour: external_exports.number().int().min(0).max(23),
@@ -15329,6 +15350,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
15329
15350
  "codexhost/harness/display-settings/set",
15330
15351
  "codexhost/harness/inspect",
15331
15352
  "codexhost/harness/installation",
15353
+ "codexhost/harness/installation/start",
15354
+ "codexhost/harness/installation/status",
15332
15355
  "codexhost/harness/launch-settings/get",
15333
15356
  "codexhost/harness/launch-settings/set",
15334
15357
  "codexhost/harness/web-ui/open",
@@ -15404,7 +15427,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
15404
15427
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
15405
15428
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
15406
15429
  var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
15430
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
15431
+ var composerIndicatorsSchema = external_exports.array(external_exports.object({
15432
+ kind: external_exports.literal("countdown"),
15433
+ id: external_exports.string().min(1).max(64),
15434
+ expiresAtUnix: nonNegativeSafeIntegerSchema,
15435
+ label: indicatorTextSchema(256).optional(),
15436
+ tooltip: indicatorTextSchema(1024).optional()
15437
+ }).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
15438
+ message: "Composer indicator IDs must be unique"
15439
+ });
15407
15440
  var threadUsageSnapshotSchema = external_exports.object({
15441
+ composerIndicators: composerIndicatorsSchema.optional(),
15408
15442
  inputTokens: nonNegativeSafeIntegerSchema.optional(),
15409
15443
  cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
15410
15444
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
@@ -15477,8 +15511,24 @@ var threadUsageSnapshotSchema = external_exports.object({
15477
15511
  }
15478
15512
  });
15479
15513
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
15514
+ var accountCreditsPeriodSchema = external_exports.enum([
15515
+ "weekly",
15516
+ "monthly",
15517
+ "five_hour",
15518
+ "seven_day",
15519
+ "unknown"
15520
+ ]);
15521
+ var accountCreditsScopeSchema = external_exports.object({
15522
+ id: external_exports.string().min(1).max(256),
15523
+ label: external_exports.string().min(1).max(256),
15524
+ localizations: harnessLocalizationsSchema.optional()
15525
+ }).strict();
15480
15526
  var accountCreditsProductUsageSchema = external_exports.object({
15481
15527
  product: external_exports.string().min(1),
15528
+ /** Native period and scope, never inferred from the display name. */
15529
+ periodType: accountCreditsPeriodSchema.optional(),
15530
+ scope: accountCreditsScopeSchema.optional(),
15531
+ localizations: harnessLocalizationsSchema.optional(),
15482
15532
  used: external_exports.number().finite().nonnegative().optional(),
15483
15533
  // Zero is a real empty cap, not an absent field.
15484
15534
  limit: external_exports.number().finite().nonnegative().optional(),
@@ -15498,9 +15548,11 @@ var accountCreditsSnapshotSchema = external_exports.object({
15498
15548
  unit: external_exports.string().min(1).max(32).optional(),
15499
15549
  /** Native label when the primary limit is scoped to a model or product group. */
15500
15550
  label: external_exports.string().min(1).optional(),
15551
+ scope: accountCreditsScopeSchema.optional(),
15552
+ localizations: harnessLocalizationsSchema.optional(),
15501
15553
  usedPercent: usagePercentSchema,
15502
15554
  resetsAt: external_exports.string().min(1).optional(),
15503
- periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
15555
+ periodType: accountCreditsPeriodSchema,
15504
15556
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
15505
15557
  resetCredits: accountResetCreditsSchema.optional()
15506
15558
  }).strict();
@@ -15511,7 +15563,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
15511
15563
  var threadUsageInspectionSchema = external_exports.object({
15512
15564
  threadId: hostThreadIdSchema,
15513
15565
  usage: threadUsageSnapshotSchema.nullable(),
15514
- accountCredits: accountCreditsSnapshotSchema.optional()
15566
+ accountCredits: accountCreditsSnapshotSchema.optional(),
15567
+ /** Whether this source can provide cached account quota independently of usage. */
15568
+ accountCreditsSupported: external_exports.boolean().optional()
15515
15569
  }).strict();
15516
15570
 
15517
15571
  // ../../shared-contracts/dist/harness-accounts.js
@@ -15638,7 +15692,8 @@ var harnessPermissionModeSchema = external_exports.object({
15638
15692
  id: harnessPermissionModeIdSchema,
15639
15693
  label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
15640
15694
  description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
15641
- dangerous: external_exports.boolean().optional()
15695
+ dangerous: external_exports.boolean().optional(),
15696
+ localizations: harnessLocalizationsSchema.optional()
15642
15697
  }).strict();
15643
15698
  var harnessPermissionModeCatalogSchema = external_exports.object({
15644
15699
  modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
@@ -15791,7 +15846,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
15791
15846
  }).strict().optional(),
15792
15847
  autonomousTurns: external_exports.object({
15793
15848
  observe: external_exports.boolean()
15794
- }).strict().optional()
15849
+ }).strict().optional(),
15850
+ /** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
15851
+ steer: external_exports.boolean().optional()
15795
15852
  }).strict();
15796
15853
  var harnessConfigurationStateSchema = external_exports.object({
15797
15854
  effectiveModel: harnessModelRefSchema.optional(),
@@ -15838,7 +15895,9 @@ var harnessInspectionSchema = external_exports.union([
15838
15895
  var harnessInspectParamsSchema = external_exports.object({
15839
15896
  harnessId: harnessIdSchema,
15840
15897
  cwd: nonBlankTextSchema2.max(16384).optional(),
15841
- refresh: external_exports.boolean().optional()
15898
+ refresh: external_exports.boolean().optional(),
15899
+ /** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
15900
+ purpose: external_exports.literal("availability").optional()
15842
15901
  }).strict();
15843
15902
  var harnessWebUiOpenParamsSchema = external_exports.object({
15844
15903
  harnessId: harnessIdSchema
@@ -15921,6 +15980,15 @@ var threadOwnershipListResultSchema = external_exports.object({
15921
15980
  seen.add(thread.threadId);
15922
15981
  }
15923
15982
  });
15983
+ var threadSteeringInspectParamsSchema = external_exports.object({
15984
+ threadId: hostThreadIdSchema,
15985
+ /** The text about to be steered; a Harness command always stops and restarts. */
15986
+ text: external_exports.string().optional()
15987
+ }).strict();
15988
+ var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15989
+ var threadSteeringInspectResultSchema = external_exports.object({
15990
+ delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
15991
+ }).strict();
15924
15992
 
15925
15993
  // ../../shared-contracts/dist/harness-plugins.js
15926
15994
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
@@ -16022,11 +16090,31 @@ var harnessInstallationStateSchema = external_exports.object({
16022
16090
  latestVersion: external_exports.string().min(1).max(128),
16023
16091
  updateAvailable: external_exports.boolean(),
16024
16092
  canUpdate: external_exports.boolean(),
16093
+ /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
16094
+ versionKind: external_exports.enum(["cli", "application"]).optional(),
16095
+ /** Official download opened by the user; does not imply an automatic installation. */
16096
+ manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
16025
16097
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
16026
16098
  message: external_exports.string().max(2048).optional(),
16027
16099
  messageCode: external_exports.string().min(1).max(128).optional(),
16100
+ /** Safe plugin-owned explanation, distinct from raw diagnostic message. */
16101
+ notice: harnessLocalizedTextSchema.optional(),
16028
16102
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
16029
16103
  }).strict();
16104
+ var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
16105
+ var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
16106
+ external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
16107
+ external_exports.object({
16108
+ taskId: external_exports.string().uuid(),
16109
+ status: external_exports.literal("succeeded"),
16110
+ result: harnessInstallationStateSchema
16111
+ }).strict(),
16112
+ external_exports.object({
16113
+ taskId: external_exports.string().uuid(),
16114
+ status: external_exports.literal("failed"),
16115
+ error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
16116
+ }).strict()
16117
+ ]);
16030
16118
 
16031
16119
  // ../../shared-contracts/dist/codex-accounts.js
16032
16120
  var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
@@ -16151,6 +16239,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
16151
16239
  invocation: commandInvocationSchema,
16152
16240
  label: commandLabelSchema,
16153
16241
  description: commandDescriptionSchema.optional(),
16242
+ localizations: harnessLocalizationsSchema.optional(),
16154
16243
  argumentMode: external_exports.enum(["none", "text"]),
16155
16244
  /**
16156
16245
  * Native distinction reported by the Harness. Omitted when the Harness does
@@ -16511,6 +16600,18 @@ function sanitizeDiagnosticTail(value) {
16511
16600
  return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
16512
16601
  }
16513
16602
 
16603
+ // ../../harness-adapter/dist/steer.js
16604
+ function unsupportedSteer(harnessLabel) {
16605
+ return {
16606
+ ok: false,
16607
+ error: {
16608
+ code: "unsupported",
16609
+ message: `${harnessLabel} cannot steer an active Turn natively`,
16610
+ retryable: false
16611
+ }
16612
+ };
16613
+ }
16614
+
16514
16615
  // ../../harness-adapter/dist/usage.js
16515
16616
  var tokenFields = [
16516
16617
  "inputTokens",
@@ -16538,6 +16639,7 @@ var usageFields = /* @__PURE__ */ new Set([
16538
16639
  ...safeIntegerFields,
16539
16640
  ...percentFields,
16540
16641
  "sessionCacheUsage",
16642
+ "composerIndicators",
16541
16643
  "totalCostUsd",
16542
16644
  "totalCredits",
16543
16645
  "contextUsagePercent",
@@ -16560,6 +16662,7 @@ function parseHostUsage(value) {
16560
16662
  throw new Error(`Harness Usage contains unknown field '${key}'`);
16561
16663
  }
16562
16664
  }
16665
+ const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16563
16666
  for (const field of [
16564
16667
  "totalCredits",
16565
16668
  "contextUsagePercent",
@@ -16630,9 +16733,9 @@ function parseHostUsage(value) {
16630
16733
  if (value.costSource !== "publicPrice") {
16631
16734
  throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
16632
16735
  }
16633
- return { ...value, unpricedModels: [...models] };
16736
+ return { ...value, ...indicators, unpricedModels: [...models] };
16634
16737
  }
16635
- return { ...value };
16738
+ return { ...value, ...indicators };
16636
16739
  }
16637
16740
  var requestTokenFields = [
16638
16741
  "inputTokens",
@@ -17197,16 +17300,25 @@ var OPENCODE_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse(
17197
17300
  {
17198
17301
  id: "default",
17199
17302
  label: "Default",
17303
+ localizations: {
17304
+ "zh-CN": { label: "默认", description: "使用 OpenCode 已配置的权限规则。" }
17305
+ },
17200
17306
  description: "Use OpenCode's configured permission rules."
17201
17307
  },
17202
17308
  {
17203
17309
  id: "ask",
17204
17310
  label: "Ask",
17311
+ localizations: {
17312
+ "zh-CN": { label: "询问", description: "执行受保护的 OpenCode 操作前询问。" }
17313
+ },
17205
17314
  description: "Ask before protected OpenCode actions."
17206
17315
  },
17207
17316
  {
17208
17317
  id: "allow",
17209
17318
  label: "Allow all",
17319
+ localizations: {
17320
+ "zh-CN": { label: "全部允许", description: "允许 OpenCode 操作,无需批准提示。" }
17321
+ },
17210
17322
  description: "Allow OpenCode actions without approval prompts.",
17211
17323
  dangerous: true
17212
17324
  }
@@ -23613,6 +23725,7 @@ var openCodeCommandCatalog = harnessCommandCatalogSchema.parse({
23613
23725
  {
23614
23726
  id: COMPACT_COMMAND_ID,
23615
23727
  invocation: "/compact",
23728
+ localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } },
23616
23729
  label: "Compact context",
23617
23730
  description: "Compact the current OpenCode Session context",
23618
23731
  argumentMode: "none"
@@ -23738,6 +23851,8 @@ var OpenCodeHarnessSession = class {
23738
23851
  if (this.#phase !== "open") {
23739
23852
  return { ok: false, error: invalidState("OpenCode Session is not open") };
23740
23853
  }
23854
+ if (command.type === "turn.steer")
23855
+ return unsupportedSteer("OpenCode");
23741
23856
  if (command.type === "turn.cancel")
23742
23857
  return this.#cancel(command);
23743
23858
  if (command.type === "interaction.respond")
@@ -24175,7 +24290,7 @@ var OpenCodeHarnessSession = class {
24175
24290
  }
24176
24291
  #projectPart(active, part) {
24177
24292
  if (part.type === "text" || part.type === "reasoning") {
24178
- if (part.type === "text" && part.ignored || !part.text)
24293
+ if (part.type === "text" && part.ignored)
24179
24294
  return;
24180
24295
  const existing = active.items.get(part.id);
24181
24296
  if (!existing) {
@@ -25049,11 +25164,15 @@ function v2State(session, catalog, policy) {
25049
25164
  ...entry ? {
25050
25165
  resolvedModelLabel: entry.resolvedModelLabel ?? entry.label,
25051
25166
  availableThinkingOptions: catalog.thinkingOptions.filter((v) => entry.supportedThinkingOptionIds?.includes(v.id)),
25052
- effectiveThinkingOptionId: encodeOpenCodeVariant(session.model?.variant)
25167
+ effectiveThinkingOptionId: effectiveVariant(session.model?.variant, entry)
25053
25168
  } : {},
25054
25169
  effectivePermissionModeId: decodeMode(mode?.effect)
25055
25170
  };
25056
25171
  }
25172
+ function effectiveVariant(variant, entry) {
25173
+ const id = encodeOpenCodeVariant(variant);
25174
+ return variant === "default" && !entry.supportedThinkingOptionIds?.includes(id) ? encodeOpenCodeVariant(void 0) : id;
25175
+ }
25057
25176
  function decodeMode(effect) {
25058
25177
  return effect === "allow" || effect === "ask" ? harnessPermissionModeIdSchema.parse(effect) : harnessPermissionModeIdSchema.parse("default");
25059
25178
  }
@@ -27414,6 +27533,8 @@ var V2Session = class {
27414
27533
  async execute(command) {
27415
27534
  if (this.#closed)
27416
27535
  return { ok: false, error: failure("OpenCode Session is closed", "invalidState") };
27536
+ if (command.type === "turn.steer")
27537
+ return unsupportedSteer("OpenCode");
27417
27538
  if (command.type === "turn.start")
27418
27539
  return this.#start(command, false);
27419
27540
  if (command.type === "turn.cancel") {