@liberseek/boft-cli-win32-arm64 0.8.4 → 0.8.5

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.
@@ -3401,10 +3401,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3401
3401
  const shape = def.shape;
3402
3402
  const propValues = {};
3403
3403
  for (const key in shape) {
3404
- const field = shape[key]._zod;
3405
- if (field.values) {
3404
+ const field2 = shape[key]._zod;
3405
+ if (field2.values) {
3406
3406
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3407
- for (const v of field.values)
3407
+ for (const v of field2.values)
3408
3408
  propValues[key].add(v);
3409
3409
  }
3410
3410
  }
@@ -15044,6 +15044,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
15044
15044
  cachedInputTokens: count,
15045
15045
  cacheWriteInputTokens: count,
15046
15046
  cacheKnownInputTokens: count,
15047
+ cacheHitCachedInputTokens: count,
15048
+ cacheHitInputTokens: count,
15047
15049
  outputTokens: count,
15048
15050
  reasoningOutputTokens: count,
15049
15051
  /** USD at the public price, summed over the priced requests only. */
@@ -15151,6 +15153,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
15151
15153
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
15152
15154
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
15153
15155
 
15156
+ // ../../shared-contracts/dist/thread-questions.js
15157
+ var field = external_exports.discriminatedUnion("type", [
15158
+ external_exports.object({
15159
+ id: external_exports.string().min(1),
15160
+ type: external_exports.literal("choice"),
15161
+ prompt: external_exports.string(),
15162
+ options: external_exports.array(external_exports.object({
15163
+ value: external_exports.string().min(1),
15164
+ label: external_exports.string(),
15165
+ description: external_exports.string().optional()
15166
+ })).min(1),
15167
+ multiple: external_exports.boolean(),
15168
+ allowOther: external_exports.boolean(),
15169
+ optional: external_exports.boolean()
15170
+ }),
15171
+ external_exports.object({
15172
+ id: external_exports.string().min(1),
15173
+ type: external_exports.literal("text"),
15174
+ prompt: external_exports.string(),
15175
+ multiline: external_exports.boolean(),
15176
+ secret: external_exports.literal(false),
15177
+ optional: external_exports.boolean(),
15178
+ placeholder: external_exports.string().optional(),
15179
+ prefill: external_exports.string().optional()
15180
+ })
15181
+ ]);
15182
+ var threadQuestionSchema = external_exports.object({
15183
+ interactionId: external_exports.string().min(1),
15184
+ turnId: external_exports.string().min(1),
15185
+ title: external_exports.string().optional(),
15186
+ questions: external_exports.array(field).min(1)
15187
+ }).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
15188
+ message: "Shared cards require at least one multi-select question"
15189
+ });
15190
+ var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
15191
+ var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
15192
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15193
+ threadId: external_exports.string().min(1),
15194
+ turnId: external_exports.string().min(1),
15195
+ interactionId: external_exports.string().min(1),
15196
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15197
+ cancelled: external_exports.boolean().default(false)
15198
+ });
15199
+ var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
15200
+
15154
15201
  // ../../shared-contracts/dist/harness-plugins.js
15155
15202
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
15156
15203
  var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
@@ -15920,7 +15967,10 @@ var harnessPluginRouteSchema = external_exports.object({
15920
15967
  harnessId: harnessPluginIdSchema,
15921
15968
  model: harnessModelRefSchema.optional(),
15922
15969
  thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
15923
- permissionModeId: harnessPermissionModeIdSchema.optional()
15970
+ permissionModeId: harnessPermissionModeIdSchema.optional(),
15971
+ /** A draft prewarm create: stays unsubmitted until the user's first Turn.
15972
+ * Desktop forwards only the Model of a main-process prewarm to thread/start. */
15973
+ prewarm: external_exports.literal(true).optional()
15924
15974
  }).strict();
15925
15975
 
15926
15976
  // ../../shared-contracts/dist/harness-launch-settings.js
@@ -16548,26 +16598,26 @@ function parseHostUsage(value) {
16548
16598
  }
16549
16599
  }
16550
16600
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16551
- for (const field of [
16601
+ for (const field2 of [
16552
16602
  "totalCredits",
16553
16603
  "contextUsagePercent",
16554
16604
  "apiOutputTokensPerSecond"
16555
16605
  ]) {
16556
- const candidate = value[field];
16606
+ const candidate = value[field2];
16557
16607
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16558
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
16608
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16559
16609
  }
16560
16610
  }
16561
- for (const field of tokenFields) {
16562
- const candidate = value[field];
16611
+ for (const field2 of tokenFields) {
16612
+ const candidate = value[field2];
16563
16613
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16564
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16614
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16565
16615
  }
16566
16616
  }
16567
- for (const field of safeIntegerFields) {
16568
- const candidate = value[field];
16617
+ for (const field2 of safeIntegerFields) {
16618
+ const candidate = value[field2];
16569
16619
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16570
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16620
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16571
16621
  }
16572
16622
  }
16573
16623
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -16576,16 +16626,16 @@ function parseHostUsage(value) {
16576
16626
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
16577
16627
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
16578
16628
  }
16579
- for (const field of ["totalCredits", "contextUsagePercent"]) {
16580
- const candidate = value[field];
16629
+ for (const field2 of ["totalCredits", "contextUsagePercent"]) {
16630
+ const candidate = value[field2];
16581
16631
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16582
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
16632
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16583
16633
  }
16584
16634
  }
16585
- for (const field of percentFields) {
16586
- const candidate = value[field];
16635
+ for (const field2 of percentFields) {
16636
+ const candidate = value[field2];
16587
16637
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
16588
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
16638
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
16589
16639
  }
16590
16640
  }
16591
16641
  if (value.sessionCacheUsage !== void 0) {
@@ -17072,8 +17122,8 @@ function protobufBytes(data) {
17072
17122
  const fields = /* @__PURE__ */ new Map();
17073
17123
  while (offset < data.length) {
17074
17124
  const tag = varint();
17075
- const field = Math.floor(tag / 8), wire = tag % 8;
17076
- if (!Number.isSafeInteger(tag) || field === 0)
17125
+ const field2 = Math.floor(tag / 8), wire = tag % 8;
17126
+ if (!Number.isSafeInteger(tag) || field2 === 0)
17077
17127
  throw new Error("Invalid Cursor native field");
17078
17128
  if (wire === 0) {
17079
17129
  varint();
@@ -17083,16 +17133,16 @@ function protobufBytes(data) {
17083
17133
  if (!Number.isSafeInteger(length) || length < 0 || offset + length > data.length)
17084
17134
  throw new Error("Unsupported Cursor native record");
17085
17135
  if (wire === 2) {
17086
- const values = fields.get(field) ?? [];
17136
+ const values = fields.get(field2) ?? [];
17087
17137
  values.push(Buffer.from(data.subarray(offset, offset + length)));
17088
- fields.set(field, values);
17138
+ fields.set(field2, values);
17089
17139
  }
17090
17140
  offset += length;
17091
17141
  }
17092
17142
  return fields;
17093
17143
  }
17094
- function one(fields, field) {
17095
- const values = fields.get(field);
17144
+ function one(fields, field2) {
17145
+ const values = fields.get(field2);
17096
17146
  if (values?.length !== 1 || !values[0])
17097
17147
  throw new Error("Cursor native history identity is missing or ambiguous");
17098
17148
  return values[0];
@@ -23986,30 +24036,6 @@ function consumeBrokerFrames(socket, onFrame, onError) {
23986
24036
  });
23987
24037
  }
23988
24038
 
23989
- // ../../harness-broker/dist/paths.js
23990
- import os4 from "node:os";
23991
- import path10 from "node:path";
23992
- var HARNESS_BROKER_DESCRIPTOR_ENV = "CODEXHOST_CLAUDE_BROKER_DESCRIPTOR";
23993
- var HARNESS_BROKER_DESCRIPTOR_FILE = "claude-code-broker-v1.json";
23994
- function defaultHarnessBrokerDirectory(environment = process.env) {
23995
- const home = environment.HOME || os4.homedir();
23996
- return path10.join(home, ".codexhost", "harness-broker");
23997
- }
23998
- function defaultHarnessBrokerDescriptorPath(environment = process.env, harnessId = "claude-code") {
23999
- harnessPluginIdSchema.parse(harnessId);
24000
- if (harnessId !== "claude-code")
24001
- return path10.join(defaultHarnessBrokerDirectory(environment), `${harnessId}-broker-v1.json`);
24002
- return environment[HARNESS_BROKER_DESCRIPTOR_ENV] ?? path10.join(defaultHarnessBrokerDirectory(environment), HARNESS_BROKER_DESCRIPTOR_FILE);
24003
- }
24004
- function harnessBrokerLaunchAgentLabel(harnessId = "claude-code") {
24005
- harnessPluginIdSchema.parse(harnessId);
24006
- return harnessId === "claude-code" ? "ai.bytepioneer.codexhost.native-harness-broker" : `ai.bytepioneer.codexhost.${harnessId}-broker`;
24007
- }
24008
- function harnessBrokerLaunchAgentPlistPath(environment = process.env, harnessId = "claude-code") {
24009
- const home = environment.HOME || os4.homedir();
24010
- return path10.join(home, "Library", "LaunchAgents", `${harnessBrokerLaunchAgentLabel(harnessId)}.plist`);
24011
- }
24012
-
24013
24039
  // ../../harness-broker/dist/validation.js
24014
24040
  var cwdSchema = external_exports.string().min(1).max(16384);
24015
24041
  var brokerEnvironmentSchema = external_exports.object({
@@ -24060,7 +24086,11 @@ var brokerOpenInputSchema = external_exports.discriminatedUnion("kind", [
24060
24086
  forkSchema,
24061
24087
  rollbackSchema
24062
24088
  ]);
24063
- var brokerInspectInputSchema = external_exports.object({ cwd: cwdSchema.optional(), refresh: external_exports.boolean().optional() }).strict();
24089
+ var brokerInspectInputSchema = external_exports.object({
24090
+ cwd: cwdSchema.optional(),
24091
+ refresh: external_exports.boolean().optional(),
24092
+ purpose: external_exports.literal("availability").optional()
24093
+ }).strict();
24064
24094
  var brokerSessionImportListParamsSchema = external_exports.object({
24065
24095
  offset: external_exports.number().int().nonnegative().safe(),
24066
24096
  limit: external_exports.number().int().min(1).max(HARNESS_BROKER_SESSION_IMPORT_PAGE_SIZE)
@@ -24075,10 +24105,10 @@ var brokerSessionImportSourceSchema = external_exports.object({
24075
24105
  candidate: harnessSessionImportCandidateSchema,
24076
24106
  nativeRef: nativeSessionRefSchema
24077
24107
  }).strict().superRefine((source, context) => {
24078
- if (source.nativeRef.harnessId !== "claude-code" || source.nativeRef.nativeSessionId !== source.candidate.nativeSessionId) {
24108
+ if (source.nativeRef.nativeSessionId !== source.candidate.nativeSessionId) {
24079
24109
  context.addIssue({
24080
24110
  code: "custom",
24081
- message: "Claude Session import source identity does not match"
24111
+ message: "Session import source identity does not match"
24082
24112
  });
24083
24113
  }
24084
24114
  });
@@ -24252,6 +24282,107 @@ var harnessOutputSchema = external_exports.custom((value) => {
24252
24282
  return false;
24253
24283
  });
24254
24284
 
24285
+ // ../../harness-broker/dist/session-import-client.js
24286
+ function createBrokerSessionImportCapability(input) {
24287
+ let listing = null;
24288
+ const closed = () => ({
24289
+ ok: false,
24290
+ error: { code: "invalidState", message: "Harness broker adapter is closed", retryable: false }
24291
+ });
24292
+ const invalid = () => ({
24293
+ ok: false,
24294
+ error: {
24295
+ code: "protocolError",
24296
+ message: "Harness broker returned invalid Session import metadata",
24297
+ retryable: false
24298
+ }
24299
+ });
24300
+ const list = async () => {
24301
+ try {
24302
+ const candidates = [];
24303
+ const identities = /* @__PURE__ */ new Set();
24304
+ let total;
24305
+ for (; ; ) {
24306
+ if (input.isClosed())
24307
+ return closed();
24308
+ const result = await input.request("adapter.sessionImport.list", {
24309
+ offset: candidates.length,
24310
+ limit: HARNESS_BROKER_SESSION_IMPORT_PAGE_SIZE
24311
+ });
24312
+ if (input.isClosed())
24313
+ return closed();
24314
+ if (!result.ok)
24315
+ return result;
24316
+ const page = brokerSessionImportPageSchema.safeParse(result.value);
24317
+ if (!page.success || total !== void 0 && total !== page.data.total || page.data.total < candidates.length + page.data.candidates.length || page.data.candidates.length === 0 && candidates.length < page.data.total)
24318
+ return invalid();
24319
+ total = page.data.total;
24320
+ for (const candidate of page.data.candidates) {
24321
+ if (identities.has(candidate.nativeSessionId))
24322
+ return invalid();
24323
+ identities.add(candidate.nativeSessionId);
24324
+ candidates.push(candidate);
24325
+ }
24326
+ if (candidates.length === total)
24327
+ return { ok: true, value: candidates };
24328
+ }
24329
+ } catch (error51) {
24330
+ return { ok: false, error: input.error(error51) };
24331
+ }
24332
+ };
24333
+ return {
24334
+ listCandidates() {
24335
+ if (input.isClosed())
24336
+ return Promise.resolve(closed());
24337
+ listing ??= list().finally(() => {
24338
+ listing = null;
24339
+ });
24340
+ return listing;
24341
+ },
24342
+ async resolveCandidate(nativeSessionId) {
24343
+ if (input.isClosed())
24344
+ return closed();
24345
+ try {
24346
+ const result = await input.request("adapter.sessionImport.resolve", { nativeSessionId });
24347
+ if (input.isClosed())
24348
+ return closed();
24349
+ if (!result.ok)
24350
+ return result;
24351
+ const source = brokerSessionImportSourceSchema.safeParse(result.value);
24352
+ if (!source.success || source.data.nativeRef.harnessId !== input.harnessId || source.data.candidate.nativeSessionId !== nativeSessionId)
24353
+ return invalid();
24354
+ return { ok: true, value: source.data };
24355
+ } catch (error51) {
24356
+ return { ok: false, error: input.error(error51) };
24357
+ }
24358
+ }
24359
+ };
24360
+ }
24361
+
24362
+ // ../../harness-broker/dist/paths.js
24363
+ import os4 from "node:os";
24364
+ import path10 from "node:path";
24365
+ var HARNESS_BROKER_DESCRIPTOR_ENV = "CODEXHOST_CLAUDE_BROKER_DESCRIPTOR";
24366
+ var HARNESS_BROKER_DESCRIPTOR_FILE = "claude-code-broker-v1.json";
24367
+ function defaultHarnessBrokerDirectory(environment = process.env) {
24368
+ const home = environment.HOME || os4.homedir();
24369
+ return path10.join(home, ".codexhost", "harness-broker");
24370
+ }
24371
+ function defaultHarnessBrokerDescriptorPath(environment = process.env, harnessId = "claude-code") {
24372
+ harnessPluginIdSchema.parse(harnessId);
24373
+ if (harnessId !== "claude-code")
24374
+ return path10.join(defaultHarnessBrokerDirectory(environment), `${harnessId}-broker-v1.json`);
24375
+ return environment[HARNESS_BROKER_DESCRIPTOR_ENV] ?? path10.join(defaultHarnessBrokerDirectory(environment), HARNESS_BROKER_DESCRIPTOR_FILE);
24376
+ }
24377
+ function harnessBrokerLaunchAgentLabel(harnessId = "claude-code") {
24378
+ harnessPluginIdSchema.parse(harnessId);
24379
+ return harnessId === "claude-code" ? "ai.bytepioneer.codexhost.native-harness-broker" : `ai.bytepioneer.codexhost.${harnessId}-broker`;
24380
+ }
24381
+ function harnessBrokerLaunchAgentPlistPath(environment = process.env, harnessId = "claude-code") {
24382
+ const home = environment.HOME || os4.homedir();
24383
+ return path10.join(home, "Library", "LaunchAgents", `${harnessBrokerLaunchAgentLabel(harnessId)}.plist`);
24384
+ }
24385
+
24255
24386
  // ../../harness-broker/dist/client.js
24256
24387
  function unavailable(message, retryable = true) {
24257
24388
  return { code: "unavailable", message, retryable, stage: "harnessBroker" };
@@ -24788,6 +24919,7 @@ var BrokeredHarnessAdapter = class {
24788
24919
  commandCatalog;
24789
24920
  liveCommandCatalog;
24790
24921
  harnessId;
24922
+ sessionImport;
24791
24923
  credits;
24792
24924
  refreshCredits;
24793
24925
  #descriptorPath;
@@ -24797,7 +24929,6 @@ var BrokeredHarnessAdapter = class {
24797
24929
  #startTimeoutMs;
24798
24930
  #connection = null;
24799
24931
  #closed = false;
24800
- #sessionImportListing = null;
24801
24932
  #credits = null;
24802
24933
  #creditsRefresh = null;
24803
24934
  subagents = {
@@ -24809,86 +24940,16 @@ var BrokeredHarnessAdapter = class {
24809
24940
  }
24810
24941
  }
24811
24942
  };
24812
- sessionImport = Object.freeze({
24813
- listCandidates: () => {
24814
- this.#sessionImportListing ??= this.#listSessionImportCandidates().finally(() => {
24815
- this.#sessionImportListing = null;
24816
- });
24817
- return this.#sessionImportListing;
24818
- },
24819
- resolveCandidate: async (nativeSessionId) => {
24820
- if (this.#closed) {
24821
- return {
24822
- ok: false,
24823
- error: unavailable("Claude Aqua broker adapter is closed", false)
24824
- };
24825
- }
24826
- try {
24827
- const result = parseHarnessResult(await (await this.#connect()).request("adapter.sessionImport.resolve", {
24828
- nativeSessionId
24829
- }));
24830
- if (!result.ok)
24831
- return result;
24832
- const parsed = brokerSessionImportSourceSchema.safeParse(result.value);
24833
- if (!parsed.success || parsed.data.candidate.nativeSessionId !== nativeSessionId) {
24834
- return {
24835
- ok: false,
24836
- error: {
24837
- ...unavailable("Harness broker returned an invalid Session source", false),
24838
- code: "protocolError"
24839
- }
24840
- };
24841
- }
24842
- return { ok: true, value: parsed.data };
24843
- } catch (error51) {
24844
- this.#connection = null;
24845
- return {
24846
- ok: false,
24847
- error: unavailable(error51 instanceof Error ? error51.message : String(error51))
24848
- };
24849
- }
24850
- }
24851
- });
24852
- async #listSessionImportCandidates() {
24853
- if (this.#closed) {
24854
- return {
24855
- ok: false,
24856
- error: unavailable("Claude Aqua broker adapter is closed", false)
24857
- };
24858
- }
24859
- try {
24860
- const candidates = [];
24861
- for (; ; ) {
24862
- const result = parseHarnessResult(await (await this.#connect()).request("adapter.sessionImport.list", {
24863
- offset: candidates.length,
24864
- limit: HARNESS_BROKER_SESSION_IMPORT_PAGE_SIZE
24865
- }));
24866
- if (!result.ok)
24867
- return result;
24868
- const parsed = brokerSessionImportPageSchema.safeParse(result.value);
24869
- if (!parsed.success || parsed.data.total < candidates.length + parsed.data.candidates.length || parsed.data.candidates.length === 0 && candidates.length < parsed.data.total) {
24870
- return {
24871
- ok: false,
24872
- error: {
24873
- ...unavailable("Harness broker returned invalid Session candidates", false),
24874
- code: "protocolError"
24875
- }
24876
- };
24877
- }
24878
- candidates.push(...parsed.data.candidates);
24879
- if (candidates.length === parsed.data.total)
24880
- return { ok: true, value: candidates };
24881
- }
24882
- } catch (error51) {
24883
- this.#connection = null;
24884
- return {
24885
- ok: false,
24886
- error: unavailable(error51 instanceof Error ? error51.message : String(error51))
24887
- };
24888
- }
24889
- }
24890
24943
  constructor(input = {}) {
24891
24944
  this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
24945
+ if (input.sessionImport) {
24946
+ this.sessionImport = createBrokerSessionImportCapability({
24947
+ harnessId: this.harnessId,
24948
+ request: async (method, params) => parseHarnessResult(await this.#request(method, params, method === "adapter.sessionImport.resolve")),
24949
+ isClosed: () => this.#closed,
24950
+ error: (error51) => this.#error(error51)
24951
+ });
24952
+ }
24892
24953
  if (input.accountCredits !== false) {
24893
24954
  this.credits = () => this.#credits;
24894
24955
  this.refreshCredits = () => this.#refreshAccountCredits();
@@ -25076,6 +25137,7 @@ function createHarnessAdapter(context) {
25076
25137
  if (context.platform === "darwin" && context.managedRemoteHost) {
25077
25138
  const environment2 = { ...context.environment };
25078
25139
  return new BrokeredHarnessAdapter({
25140
+ sessionImport: true,
25079
25141
  accountCredits: false,
25080
25142
  harnessId: "cursor-cli",
25081
25143
  forwardDelegationEnvironment: true,