@codexhost/cli-darwin-x64 0.13.3 → 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.
@@ -15138,10 +15138,19 @@ var model = external_exports.string().min(1).max(512);
15138
15138
  var project = external_exports.string().min(1).max(4096);
15139
15139
  var usageStatisticsParamsSchema = external_exports.strictObject({
15140
15140
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
15141
+ /** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
15142
+ timeZone: external_exports.string().min(1).max(128).refine((value) => {
15143
+ try {
15144
+ new Intl.DateTimeFormat("en", { timeZone: value });
15145
+ return true;
15146
+ } catch {
15147
+ return false;
15148
+ }
15149
+ }, "Unsupported usage statistics timezone").optional(),
15141
15150
  harness: harness.optional(),
15142
15151
  model: model.nullable().optional(),
15143
15152
  project: project.nullable().optional(),
15144
- /** One local date inside the range. */
15153
+ /** One date in the query timezone inside the range. */
15145
15154
  date: localDate.optional()
15146
15155
  });
15147
15156
  var usageStatisticsTotalsSchema = external_exports.strictObject({
@@ -15177,7 +15186,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
15177
15186
  });
15178
15187
  var usageStatisticsResultSchema = external_exports.strictObject({
15179
15188
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
15180
- /** First local date of the range; null for all time. */
15189
+ /** First date in the query timezone (Host local when omitted); null for all time. */
15181
15190
  from: localDate.nullable(),
15182
15191
  to: localDate,
15183
15192
  /** The filters these figures apply, echoed so a late answer to older filters is recognised. */
@@ -15217,7 +15226,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
15217
15226
  totals: usageStatisticsTotalsSchema,
15218
15227
  /** Each date and Harness of the range: every filter except the day. */
15219
15228
  daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
15220
- /** Local weekday (0 = Sunday) and hour, all filters applied. */
15229
+ /** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
15221
15230
  hourly: external_exports.array(external_exports.strictObject({
15222
15231
  weekday: external_exports.number().int().min(0).max(6),
15223
15232
  hour: external_exports.number().int().min(0).max(23),
@@ -15277,6 +15286,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
15277
15286
  "codexhost/harness/display-settings/set",
15278
15287
  "codexhost/harness/inspect",
15279
15288
  "codexhost/harness/installation",
15289
+ "codexhost/harness/installation/start",
15290
+ "codexhost/harness/installation/status",
15280
15291
  "codexhost/harness/launch-settings/get",
15281
15292
  "codexhost/harness/launch-settings/set",
15282
15293
  "codexhost/harness/web-ui/open",
@@ -15352,7 +15363,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
15352
15363
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
15353
15364
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
15354
15365
  var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
15366
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
15367
+ var composerIndicatorsSchema = external_exports.array(external_exports.object({
15368
+ kind: external_exports.literal("countdown"),
15369
+ id: external_exports.string().min(1).max(64),
15370
+ expiresAtUnix: nonNegativeSafeIntegerSchema,
15371
+ label: indicatorTextSchema(256).optional(),
15372
+ tooltip: indicatorTextSchema(1024).optional()
15373
+ }).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
15374
+ message: "Composer indicator IDs must be unique"
15375
+ });
15355
15376
  var threadUsageSnapshotSchema = external_exports.object({
15377
+ composerIndicators: composerIndicatorsSchema.optional(),
15356
15378
  inputTokens: nonNegativeSafeIntegerSchema.optional(),
15357
15379
  cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
15358
15380
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
@@ -15760,7 +15782,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
15760
15782
  }).strict().optional(),
15761
15783
  autonomousTurns: external_exports.object({
15762
15784
  observe: external_exports.boolean()
15763
- }).strict().optional()
15785
+ }).strict().optional(),
15786
+ /** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
15787
+ steer: external_exports.boolean().optional()
15764
15788
  }).strict();
15765
15789
  var harnessConfigurationStateSchema = external_exports.object({
15766
15790
  effectiveModel: harnessModelRefSchema.optional(),
@@ -15807,7 +15831,9 @@ var harnessInspectionSchema = external_exports.union([
15807
15831
  var harnessInspectParamsSchema = external_exports.object({
15808
15832
  harnessId: harnessIdSchema,
15809
15833
  cwd: nonBlankTextSchema2.max(16384).optional(),
15810
- refresh: external_exports.boolean().optional()
15834
+ refresh: external_exports.boolean().optional(),
15835
+ /** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
15836
+ purpose: external_exports.literal("availability").optional()
15811
15837
  }).strict();
15812
15838
  var harnessWebUiOpenParamsSchema = external_exports.object({
15813
15839
  harnessId: harnessIdSchema
@@ -15890,6 +15916,15 @@ var threadOwnershipListResultSchema = external_exports.object({
15890
15916
  seen.add(thread.threadId);
15891
15917
  }
15892
15918
  });
15919
+ var threadSteeringInspectParamsSchema = external_exports.object({
15920
+ threadId: hostThreadIdSchema,
15921
+ /** The text about to be steered; a Harness command always stops and restarts. */
15922
+ text: external_exports.string().optional()
15923
+ }).strict();
15924
+ var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15925
+ var threadSteeringInspectResultSchema = external_exports.object({
15926
+ delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
15927
+ }).strict();
15893
15928
 
15894
15929
  // ../../shared-contracts/dist/harness-plugins.js
15895
15930
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
@@ -15991,6 +16026,10 @@ var harnessInstallationStateSchema = external_exports.object({
15991
16026
  latestVersion: external_exports.string().min(1).max(128),
15992
16027
  updateAvailable: external_exports.boolean(),
15993
16028
  canUpdate: external_exports.boolean(),
16029
+ /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
16030
+ versionKind: external_exports.enum(["cli", "application"]).optional(),
16031
+ /** Official download opened by the user; does not imply an automatic installation. */
16032
+ manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
15994
16033
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
15995
16034
  message: external_exports.string().max(2048).optional(),
15996
16035
  messageCode: external_exports.string().min(1).max(128).optional(),
@@ -15998,6 +16037,20 @@ var harnessInstallationStateSchema = external_exports.object({
15998
16037
  notice: harnessLocalizedTextSchema.optional(),
15999
16038
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
16000
16039
  }).strict();
16040
+ var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
16041
+ var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
16042
+ external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
16043
+ external_exports.object({
16044
+ taskId: external_exports.string().uuid(),
16045
+ status: external_exports.literal("succeeded"),
16046
+ result: harnessInstallationStateSchema
16047
+ }).strict(),
16048
+ external_exports.object({
16049
+ taskId: external_exports.string().uuid(),
16050
+ status: external_exports.literal("failed"),
16051
+ error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
16052
+ }).strict()
16053
+ ]);
16001
16054
 
16002
16055
  // ../../shared-contracts/dist/codex-accounts.js
16003
16056
  var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
@@ -16500,6 +16553,18 @@ function sanitizeDiagnosticTail(value) {
16500
16553
  return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
16501
16554
  }
16502
16555
 
16556
+ // ../../harness-adapter/dist/steer.js
16557
+ function unsupportedSteer(harnessLabel) {
16558
+ return {
16559
+ ok: false,
16560
+ error: {
16561
+ code: "unsupported",
16562
+ message: `${harnessLabel} cannot steer an active Turn natively`,
16563
+ retryable: false
16564
+ }
16565
+ };
16566
+ }
16567
+
16503
16568
  // ../../harness-adapter/dist/usage.js
16504
16569
  var tokenFields = [
16505
16570
  "inputTokens",
@@ -16527,6 +16592,7 @@ var usageFields = /* @__PURE__ */ new Set([
16527
16592
  ...safeIntegerFields,
16528
16593
  ...percentFields,
16529
16594
  "sessionCacheUsage",
16595
+ "composerIndicators",
16530
16596
  "totalCostUsd",
16531
16597
  "totalCredits",
16532
16598
  "contextUsagePercent",
@@ -16549,6 +16615,7 @@ function parseHostUsage(value) {
16549
16615
  throw new Error(`Harness Usage contains unknown field '${key}'`);
16550
16616
  }
16551
16617
  }
16618
+ const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16552
16619
  for (const field of [
16553
16620
  "totalCredits",
16554
16621
  "contextUsagePercent",
@@ -16619,9 +16686,9 @@ function parseHostUsage(value) {
16619
16686
  if (value.costSource !== "publicPrice") {
16620
16687
  throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
16621
16688
  }
16622
- return { ...value, unpricedModels: [...models] };
16689
+ return { ...value, ...indicators, unpricedModels: [...models] };
16623
16690
  }
16624
- return { ...value };
16691
+ return { ...value, ...indicators };
16625
16692
  }
16626
16693
  var requestTokenFields = [
16627
16694
  "inputTokens",
@@ -16978,10 +17045,13 @@ function usageSessionTitle(value) {
16978
17045
  return void 0;
16979
17046
  if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
16980
17047
  return normalized;
16981
- const characters = [...normalized];
16982
- if (characters.length <= MAX_SESSION_TITLE_LENGTH)
16983
- return normalized;
16984
- return `${characters.slice(0, MAX_SESSION_TITLE_LENGTH - 1).join("").trimEnd()}…`;
17048
+ let title = "";
17049
+ for (const character of normalized) {
17050
+ if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
17051
+ break;
17052
+ title += character;
17053
+ }
17054
+ return `${title.trimEnd()}…`;
16985
17055
  }
16986
17056
  function sessionIdOk(value) {
16987
17057
  return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
@@ -22631,9 +22701,23 @@ var ClientSideConnection = class {
22631
22701
 
22632
22702
  // dist/copy-cleanup.js
22633
22703
  import { randomBytes } from "node:crypto";
22704
+
22705
+ // dist/acp-stdio.js
22634
22706
  import { createInterface as createInterface2 } from "node:readline";
22635
- import { stripVTControlCharacters } from "node:util";
22636
22707
  import { Readable } from "node:stream";
22708
+ import { stripVTControlCharacters } from "node:util";
22709
+ function codeBuddyAcpOutput(stdout, onLine) {
22710
+ return Readable.from((async function* () {
22711
+ for await (const line of createInterface2({ input: stdout })) {
22712
+ onLine?.(stripVTControlCharacters(line));
22713
+ if (line.trimStart().startsWith("{"))
22714
+ yield Buffer.from(`${line}
22715
+ `);
22716
+ }
22717
+ })());
22718
+ }
22719
+
22720
+ // dist/copy-cleanup.js
22637
22721
  var CodeBuddyCopyCleanup = class {
22638
22722
  copyId;
22639
22723
  cwd;
@@ -22663,17 +22747,11 @@ var CodeBuddyCopyCleanup = class {
22663
22747
  }
22664
22748
  /** Native --serve banners include its password; never pass them to the ACP parser/logs. */
22665
22749
  protocolOutput(stdout) {
22666
- return Readable.from(this.#protocolLines(stdout));
22667
- }
22668
- async *#protocolLines(stdout) {
22669
- for await (const line of createInterface2({ input: stdout })) {
22670
- const endpoint = /^\s*Endpoint\s+(http:\/\/127\.0\.0\.1:\d+)\s*$/u.exec(stripVTControlCharacters(line));
22750
+ return codeBuddyAcpOutput(stdout, (line) => {
22751
+ const endpoint = /^\s*Endpoint\s+(http:\/\/127\.0\.0\.1:\d+)\s*$/u.exec(line);
22671
22752
  if (endpoint)
22672
22753
  this.#endpoint = endpoint[1];
22673
- if (line.trimStart().startsWith("{"))
22674
- yield Buffer.from(`${line}
22675
- `);
22676
- }
22754
+ });
22677
22755
  }
22678
22756
  async remove() {
22679
22757
  if (!this.#endpoint)
@@ -22753,7 +22831,7 @@ var CodeBuddyAcpClient = class {
22753
22831
  return { outcome: "cancelled" };
22754
22832
  return options.handlers.question(params);
22755
22833
  }
22756
- }), ndJsonStream2(Writable.toWeb(this.#child.stdin), Readable2.toWeb(this.#copyCleanup?.protocolOutput(this.#child.stdout) ?? this.#child.stdout)));
22834
+ }), ndJsonStream2(Writable.toWeb(this.#child.stdin), Readable2.toWeb(this.#copyCleanup?.protocolOutput(this.#child.stdout) ?? (invocation.arguments.includes("--serve") ? codeBuddyAcpOutput(this.#child.stdout) : this.#child.stdout))));
22757
22835
  void this.#connection.closed.then(() => {
22758
22836
  this.#fault(new CodeBuddyError("processExited", "ACP connection closed"));
22759
22837
  }).catch((error51) => {
@@ -24780,6 +24858,8 @@ var CodeBuddySession = class {
24780
24858
  async #execute(command, nativeCommand = false) {
24781
24859
  if (this.#closed || this.#fault)
24782
24860
  return failure("invalidState", "Session is closed or faulted", this.profile);
24861
+ if (command.type === "turn.steer")
24862
+ return unsupportedSteer(this.profile.displayName);
24783
24863
  if (command.type === "interaction.respond")
24784
24864
  return this.#interactions.respond(command);
24785
24865
  if (command.type === "turn.cancel") {
@@ -25193,6 +25273,7 @@ var harnessBrokerMethodSchema = external_exports.enum([
25193
25273
  "adapter.open",
25194
25274
  "adapter.subagent.readSnapshot",
25195
25275
  "session.readSnapshot",
25276
+ "session.readCapabilities",
25196
25277
  "session.refreshUsage",
25197
25278
  "session.execute",
25198
25279
  "session.commands.list",
@@ -25373,6 +25454,11 @@ var turnStartSchema = external_exports.object({
25373
25454
  turnId: hostTurnIdSchema,
25374
25455
  input: external_exports.array(textInputSchema)
25375
25456
  }).strict();
25457
+ var turnSteerSchema = external_exports.object({
25458
+ type: external_exports.literal("turn.steer"),
25459
+ turnId: hostTurnIdSchema,
25460
+ input: external_exports.array(textInputSchema)
25461
+ }).strict();
25376
25462
  var turnCancelSchema = external_exports.object({ type: external_exports.literal("turn.cancel"), turnId: hostTurnIdSchema }).strict();
25377
25463
  var interactionResponseSchema = external_exports.union([
25378
25464
  external_exports.object({
@@ -25398,6 +25484,7 @@ var permissionSelectSchema = external_exports.object({
25398
25484
  }).strict();
25399
25485
  var brokerHostCommandSchema = external_exports.discriminatedUnion("type", [
25400
25486
  turnStartSchema,
25487
+ turnSteerSchema,
25401
25488
  turnCancelSchema,
25402
25489
  interactionRespondSchema,
25403
25490
  modelSelectSchema,
@@ -25590,6 +25677,7 @@ function parseSessionMetadata(value) {
25590
25677
  sessionId: candidate.sessionId,
25591
25678
  sessionGeneration: candidate.sessionGeneration,
25592
25679
  capabilities: harnessSessionCapabilitiesSchema.parse(candidate.capabilities),
25680
+ readCapabilities: candidate.readCapabilities === true,
25593
25681
  initialState: state,
25594
25682
  initialUsage: candidate.initialUsage === null ? null : parseHostUsage(candidate.initialUsage),
25595
25683
  commands: candidate.commands === true
@@ -25941,6 +26029,11 @@ var BrokeredHarnessSession = class {
25941
26029
  event: { type: "session.faulted", error: unavailable(error51.message) }
25942
26030
  });
25943
26031
  }
26032
+ async readCapabilities() {
26033
+ if (!this.#metadata.readCapabilities)
26034
+ return { ...this.capabilities, steer: false };
26035
+ return harnessSessionCapabilitiesSchema.parse(await this.#request("session.readCapabilities", {}));
26036
+ }
25944
26037
  async refreshUsage() {
25945
26038
  await this.#request("session.refreshUsage", {});
25946
26039
  }
@@ -25972,6 +26065,8 @@ var BrokeredHarnessSession = class {
25972
26065
  try {
25973
26066
  return parseHarnessResult(await this.#request("session.execute", { command }));
25974
26067
  } catch (error51) {
26068
+ if (command.type === "turn.steer")
26069
+ throw error51;
25975
26070
  return {
25976
26071
  ok: false,
25977
26072
  error: unavailable(error51 instanceof Error ? error51.message : String(error51))