@liberseek/boft-cli-win32-arm64 0.7.9 → 0.8.1

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 (57) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.txt +9 -1
  3. package/app/codexhost-distribution.json +1 -1
  4. package/app/console-server.mjs +322 -67
  5. package/app/console-web.js +9202 -5218
  6. package/app/desktop-controller.mjs +259 -42
  7. package/app/host-runtime.mjs +6250 -1689
  8. package/app/plugins/antigravity/manifest.json +18 -1
  9. package/app/plugins/antigravity/plugin.mjs +283 -42
  10. package/app/plugins/claude-code/manifest.json +28 -0
  11. package/app/plugins/claude-code/plugin.mjs +35676 -24151
  12. package/app/plugins/codebuddy/manifest.json +17 -0
  13. package/app/plugins/codebuddy/plugin.mjs +5972 -5356
  14. package/app/plugins/codex-usage/manifest.json +9 -0
  15. package/app/plugins/codex-usage/plugin.mjs +17386 -0
  16. package/app/plugins/cursor-cli/manifest.json +18 -1
  17. package/app/plugins/cursor-cli/plugin.mjs +358 -77
  18. package/app/plugins/deepseek-harness/assets/icon.svg +1 -0
  19. package/app/plugins/deepseek-harness/manifest.json +35 -2
  20. package/app/plugins/deepseek-harness/plugin.mjs +823 -242
  21. package/app/plugins/enabled.json +2 -1
  22. package/app/plugins/grok/manifest.json +21 -1
  23. package/app/plugins/grok/plugin.mjs +933 -268
  24. package/app/plugins/hermes/assets/icon.png +0 -0
  25. package/app/plugins/hermes/manifest.json +30 -2
  26. package/app/plugins/hermes/plugin.mjs +469 -73
  27. package/app/plugins/kimi-code/assets/icon.svg +5 -0
  28. package/app/plugins/kimi-code/manifest.json +25 -2
  29. package/app/plugins/kimi-code/plugin.mjs +562 -36
  30. package/app/plugins/kiro-cli/assets/kiro-agent.svg +11 -0
  31. package/app/plugins/kiro-cli/manifest.json +18 -1
  32. package/app/plugins/kiro-cli/plugin.mjs +291 -22
  33. package/app/plugins/muse/manifest.json +18 -1
  34. package/app/plugins/muse/plugin.mjs +258 -17
  35. package/app/plugins/omp/manifest.json +21 -1
  36. package/app/plugins/omp/plugin.mjs +2763 -1958
  37. package/app/plugins/opencode/manifest.json +18 -1
  38. package/app/plugins/opencode/plugin.mjs +724 -147
  39. package/app/plugins/pi/manifest.json +32 -0
  40. package/app/plugins/pi/plugin.mjs +2908 -2312
  41. package/app/plugins/qoder/manifest.json +18 -1
  42. package/app/plugins/qoder/plugin.mjs +635 -81
  43. package/app/plugins/qoder-cn/manifest.json +18 -1
  44. package/app/plugins/qoder-cn/plugin.mjs +635 -81
  45. package/app/plugins/workbuddy/manifest.json +18 -0
  46. package/app/plugins/workbuddy/plugin.mjs +6362 -5748
  47. package/app/plugins/zcode/manifest.json +19 -1
  48. package/app/plugins/zcode/plugin.mjs +1117 -278
  49. package/app/renderer-extension.js +14675 -10087
  50. package/bin/boft.exe +0 -0
  51. package/libexec/boft-node-repl.exe +0 -0
  52. package/libexec/boft-shim.exe +0 -0
  53. package/libexec/boft-updater.exe +0 -0
  54. package/licenses/Cordis-LICENSE.txt +21 -0
  55. package/licenses/Cosmokit-LICENSE.txt +21 -0
  56. package/package.json +4 -4
  57. package/app/plugins/kiro-cli/assets/icon.svg +0 -5
@@ -2220,20 +2220,20 @@ var require_resolve = __commonJS({
2220
2220
  return false;
2221
2221
  }
2222
2222
  function countKeys(schema) {
2223
- let count = 0;
2223
+ let count2 = 0;
2224
2224
  for (const key in schema) {
2225
2225
  if (key === "$ref")
2226
2226
  return Infinity;
2227
- count++;
2227
+ count2++;
2228
2228
  if (SIMPLE_INLINED.has(key))
2229
2229
  continue;
2230
2230
  if (typeof schema[key] == "object") {
2231
- (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));
2231
+ (0, util_1.eachItem)(schema[key], (sch) => count2 += countKeys(sch));
2232
2232
  }
2233
- if (count === Infinity)
2233
+ if (count2 === Infinity)
2234
2234
  return Infinity;
2235
2235
  }
2236
- return count;
2236
+ return count2;
2237
2237
  }
2238
2238
  function getFullPath(resolver, id = "", normalize) {
2239
2239
  if (normalize !== false)
@@ -5411,8 +5411,8 @@ var require_contains = __commonJS({
5411
5411
  cxt.result(valid, () => cxt.reset());
5412
5412
  function validateItemsWithCount() {
5413
5413
  const schValid = gen.name("_valid");
5414
- const count = gen.let("count", 0);
5415
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
5414
+ const count2 = gen.let("count", 0);
5415
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count2)));
5416
5416
  }
5417
5417
  function validateItems(_valid, block) {
5418
5418
  gen.forRange("i", 0, len, (i) => {
@@ -5425,16 +5425,16 @@ var require_contains = __commonJS({
5425
5425
  block();
5426
5426
  });
5427
5427
  }
5428
- function checkLimits(count) {
5429
- gen.code((0, codegen_1._)`${count}++`);
5428
+ function checkLimits(count2) {
5429
+ gen.code((0, codegen_1._)`${count2}++`);
5430
5430
  if (max === void 0) {
5431
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
5431
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true).break());
5432
5432
  } else {
5433
- gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
5433
+ gen.if((0, codegen_1._)`${count2} > ${max}`, () => gen.assign(valid, false).break());
5434
5434
  if (min === 1)
5435
5435
  gen.assign(valid, true);
5436
5436
  else
5437
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
5437
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true));
5438
5438
  }
5439
5439
  }
5440
5440
  }
@@ -8933,20 +8933,20 @@ var require_resolve2 = __commonJS({
8933
8933
  return false;
8934
8934
  }
8935
8935
  function countKeys(schema) {
8936
- let count = 0;
8936
+ let count2 = 0;
8937
8937
  for (const key in schema) {
8938
8938
  if (key === "$ref")
8939
8939
  return Infinity;
8940
- count++;
8940
+ count2++;
8941
8941
  if (SIMPLE_INLINED.has(key))
8942
8942
  continue;
8943
8943
  if (typeof schema[key] == "object") {
8944
- (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));
8944
+ (0, util_1.eachItem)(schema[key], (sch) => count2 += countKeys(sch));
8945
8945
  }
8946
- if (count === Infinity)
8946
+ if (count2 === Infinity)
8947
8947
  return Infinity;
8948
8948
  }
8949
- return count;
8949
+ return count2;
8950
8950
  }
8951
8951
  function getFullPath(resolver, id = "", normalize) {
8952
8952
  if (normalize !== false)
@@ -11309,8 +11309,8 @@ var require_contains2 = __commonJS({
11309
11309
  cxt.result(valid, () => cxt.reset());
11310
11310
  function validateItemsWithCount() {
11311
11311
  const schValid = gen.name("_valid");
11312
- const count = gen.let("count", 0);
11313
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
11312
+ const count2 = gen.let("count", 0);
11313
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count2)));
11314
11314
  }
11315
11315
  function validateItems(_valid, block) {
11316
11316
  gen.forRange("i", 0, len, (i) => {
@@ -11323,16 +11323,16 @@ var require_contains2 = __commonJS({
11323
11323
  block();
11324
11324
  });
11325
11325
  }
11326
- function checkLimits(count) {
11327
- gen.code((0, codegen_1._)`${count}++`);
11326
+ function checkLimits(count2) {
11327
+ gen.code((0, codegen_1._)`${count2}++`);
11328
11328
  if (max === void 0) {
11329
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
11329
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true).break());
11330
11330
  } else {
11331
- gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
11331
+ gen.if((0, codegen_1._)`${count2} > ${max}`, () => gen.assign(valid, false).break());
11332
11332
  if (min === 1)
11333
11333
  gen.assign(valid, true);
11334
11334
  else
11335
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
11335
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true));
11336
11336
  }
11337
11337
  }
11338
11338
  }
@@ -12594,6 +12594,11 @@ var require_dist = __commonJS({
12594
12594
  var require_content_type = __commonJS({
12595
12595
  "../../../node_modules/content-type/index.js"(exports) {
12596
12596
  "use strict";
12597
+ /*!
12598
+ * content-type
12599
+ * Copyright(c) 2015 Douglas Christopher Wilson
12600
+ * MIT Licensed
12601
+ */
12597
12602
  var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
12598
12603
  var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
12599
12604
  var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
@@ -17697,8 +17702,8 @@ function az_default() {
17697
17702
  }
17698
17703
 
17699
17704
  // ../../../node_modules/zod/v4/locales/be.js
17700
- function getBelarusianPlural(count, one2, few, many) {
17701
- const absCount = Math.abs(count);
17705
+ function getBelarusianPlural(count2, one2, few, many) {
17706
+ const absCount = Math.abs(count2);
17702
17707
  const lastDigit = absCount % 10;
17703
17708
  const lastTwoDigits = absCount % 100;
17704
17709
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -19776,8 +19781,8 @@ function hu_default() {
19776
19781
  }
19777
19782
 
19778
19783
  // ../../../node_modules/zod/v4/locales/hy.js
19779
- function getArmenianPlural(count, one2, many) {
19780
- return Math.abs(count) === 1 ? one2 : many;
19784
+ function getArmenianPlural(count2, one2, many) {
19785
+ return Math.abs(count2) === 1 ? one2 : many;
19781
19786
  }
19782
19787
  function withDefiniteArticle(word) {
19783
19788
  if (!word)
@@ -21905,8 +21910,8 @@ function ro_default() {
21905
21910
  }
21906
21911
 
21907
21912
  // ../../../node_modules/zod/v4/locales/ru.js
21908
- function getRussianPlural(count, one2, few, many) {
21909
- const absCount = Math.abs(count);
21913
+ function getRussianPlural(count2, one2, few, many) {
21914
+ const absCount = Math.abs(count2);
21910
21915
  const lastDigit = absCount % 10;
21911
21916
  const lastTwoDigits = absCount % 100;
21912
21917
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -27575,6 +27580,15 @@ function date4(params) {
27575
27580
  // ../../../node_modules/zod/v4/classic/external.js
27576
27581
  config(en_default());
27577
27582
 
27583
+ // ../../shared-contracts/dist/delegation-read.js
27584
+ var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
27585
+ var delegationReadParamsSchema = external_exports.strictObject({
27586
+ threadId: external_exports.string().min(1).max(1024),
27587
+ view: external_exports.enum(["result", "messages"]),
27588
+ cursor: external_exports.string().min(1).max(8192).optional(),
27589
+ limit: external_exports.number().int().min(1).max(100).optional()
27590
+ });
27591
+
27578
27592
  // ../../shared-contracts/dist/credential-imports.js
27579
27593
  var credentialSourceSchema = external_exports.object({
27580
27594
  id: external_exports.string().min(1).max(256),
@@ -27645,6 +27659,160 @@ var harnessDisplaySetSchema = external_exports.strictObject({
27645
27659
  initializeOnly: external_exports.boolean().optional()
27646
27660
  });
27647
27661
 
27662
+ // ../../shared-contracts/dist/model-price-overrides.js
27663
+ var usdPerMillionTokens = external_exports.number().finite().nonnegative();
27664
+ var modelPriceOverrideSchema = external_exports.strictObject({
27665
+ input: usdPerMillionTokens,
27666
+ output: usdPerMillionTokens,
27667
+ cacheRead: usdPerMillionTokens.optional(),
27668
+ cacheWrite: usdPerMillionTokens.optional(),
27669
+ cacheWrite1h: usdPerMillionTokens.optional()
27670
+ });
27671
+ var modelPriceKeySchema = external_exports.string().max(512).refine((key) => key.trim() === key && key.length > 0, "Model ID is required");
27672
+ var modelPriceOverridesSchema = external_exports.strictObject({
27673
+ /** Absolute path of the Host's `pricing.json`. */
27674
+ path: external_exports.string(),
27675
+ entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
27676
+ /** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
27677
+ error: external_exports.string().nullable()
27678
+ });
27679
+ var modelPriceOverridesGetSchema = external_exports.strictObject({});
27680
+ var modelPriceOverridesSetSchema = external_exports.strictObject({
27681
+ key: modelPriceKeySchema,
27682
+ price: modelPriceOverrideSchema.nullable(),
27683
+ previousKey: modelPriceKeySchema.optional()
27684
+ });
27685
+ var modelPriceDefaultParamsSchema = external_exports.strictObject({
27686
+ model: modelPriceKeySchema
27687
+ });
27688
+ var modelPriceSuggestionSchema = external_exports.strictObject({
27689
+ /** Verified from catalog canonical links, not inferred from names or equal prices. */
27690
+ official: external_exports.boolean().optional(),
27691
+ canonicalModelId: external_exports.string().min(1).optional(),
27692
+ provider: external_exports.string().min(1).max(512),
27693
+ model: external_exports.string().min(1).max(512),
27694
+ price: modelPriceOverrideSchema
27695
+ });
27696
+ var modelPriceDefaultResultSchema = external_exports.strictObject({
27697
+ price: modelPriceOverrideSchema.nullable(),
27698
+ /** Local catalog suggestions only; never used automatically for pricing. */
27699
+ suggestions: external_exports.array(modelPriceSuggestionSchema).max(6).optional()
27700
+ });
27701
+
27702
+ // ../../shared-contracts/dist/usage-statistics.js
27703
+ var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
27704
+ var count = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
27705
+ var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
27706
+ var harness = external_exports.string().min(1).max(128);
27707
+ var model = external_exports.string().min(1).max(512);
27708
+ var project = external_exports.string().min(1).max(4096);
27709
+ var usageStatisticsParamsSchema = external_exports.strictObject({
27710
+ range: external_exports.enum(USAGE_STATISTICS_RANGES),
27711
+ harness: harness.optional(),
27712
+ model: model.nullable().optional(),
27713
+ project: project.nullable().optional(),
27714
+ /** One local date inside the range. */
27715
+ date: localDate.optional()
27716
+ });
27717
+ var usageStatisticsTotalsSchema = external_exports.strictObject({
27718
+ requests: count,
27719
+ inputTokens: count,
27720
+ cachedInputTokens: count,
27721
+ cacheWriteInputTokens: count,
27722
+ cacheKnownInputTokens: count,
27723
+ outputTokens: count,
27724
+ reasoningOutputTokens: count,
27725
+ /** USD at the public price, summed over the priced requests only. */
27726
+ costUsd: external_exports.number().finite().min(0),
27727
+ /** Requests without a price (or the cache data the price needs); not in `costUsd`. */
27728
+ unpricedRequests: count,
27729
+ /**
27730
+ * Requests whose storage gave no token counts: counted as requests, with neither tokens nor
27731
+ * cost, and not as unpriced.
27732
+ */
27733
+ unmeteredRequests: count
27734
+ });
27735
+ var totals = usageStatisticsTotalsSchema.shape;
27736
+ var usageStatisticsSessionSchema = external_exports.strictObject({
27737
+ harness,
27738
+ sessionId: external_exports.string().min(1).max(512),
27739
+ project: project.nullable(),
27740
+ /** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
27741
+ title: external_exports.string().min(1).max(200).optional(),
27742
+ /** Models the session used, most requests first. */
27743
+ models: external_exports.array(model).max(16),
27744
+ firstAtMs: count,
27745
+ lastAtMs: count,
27746
+ ...totals
27747
+ });
27748
+ var usageStatisticsResultSchema = external_exports.strictObject({
27749
+ range: external_exports.enum(USAGE_STATISTICS_RANGES),
27750
+ /** First local date of the range; null for all time. */
27751
+ from: localDate.nullable(),
27752
+ to: localDate,
27753
+ /** The filters these figures apply, echoed so a late answer to older filters is recognised. */
27754
+ filters: external_exports.strictObject({
27755
+ harness: harness.nullable(),
27756
+ model: model.nullable(),
27757
+ unknownModel: external_exports.boolean(),
27758
+ project: project.nullable(),
27759
+ unknownProject: external_exports.boolean(),
27760
+ date: localDate.nullable()
27761
+ }),
27762
+ /** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
27763
+ reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
27764
+ /** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
27765
+ failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
27766
+ /** Every value seen in the range, ignoring the filters, to choose filters from. */
27767
+ options: external_exports.strictObject({
27768
+ harnesses: external_exports.array(harness).max(256),
27769
+ models: external_exports.array(model.nullable()).max(4096),
27770
+ projects: external_exports.array(project.nullable()).max(4096)
27771
+ }),
27772
+ /** Current display metadata, scoped by Harness. Never a pricing or filter identity.
27773
+ * Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
27774
+ */
27775
+ modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
27776
+ /** Native credits, all filters applied, never combined across Harnesses or treated as USD.
27777
+ * Only groups with at least one reported value appear; reportedRequests exposes partial data.
27778
+ */
27779
+ credits: external_exports.array(external_exports.strictObject({
27780
+ harness,
27781
+ model: model.nullable(),
27782
+ credits: external_exports.number().finite().min(0),
27783
+ reportedRequests: count,
27784
+ requests: count
27785
+ })).max(4096).optional(),
27786
+ /** All filters applied. */
27787
+ totals: usageStatisticsTotalsSchema,
27788
+ /** Each date and Harness of the range: every filter except the day. */
27789
+ daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
27790
+ /** Local weekday (0 = Sunday) and hour, all filters applied. */
27791
+ hourly: external_exports.array(external_exports.strictObject({
27792
+ weekday: external_exports.number().int().min(0).max(6),
27793
+ hour: external_exports.number().int().min(0).max(23),
27794
+ ...totals
27795
+ })).max(168),
27796
+ byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
27797
+ byModel: external_exports.array(external_exports.strictObject({
27798
+ model: model.nullable(),
27799
+ ...totals,
27800
+ /** Requests priced by what the Harness recorded they cost, not by a price list. */
27801
+ harnessPricedRequests: count
27802
+ })).max(4096),
27803
+ byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
27804
+ /**
27805
+ * The sessions that spent the most, by cost and by tokens without cache, all filters applied;
27806
+ * requests without a native session are not listed here but count everywhere else.
27807
+ */
27808
+ sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
27809
+ /**
27810
+ * The sessions last active in the range, newest first, all filters applied. Optional for older
27811
+ * Hosts; missing is treated as no list rather than no sessions.
27812
+ */
27813
+ recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
27814
+ });
27815
+
27648
27816
  // ../../shared-contracts/dist/ids.js
27649
27817
  var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
27650
27818
  message: "Identifier must not be empty or whitespace"
@@ -27666,13 +27834,40 @@ var HARNESS_PLUGIN_LIMIT = 128;
27666
27834
  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);
27667
27835
  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");
27668
27836
  var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
27837
+ var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
27838
+ var harnessInstallationGuideSchema = external_exports.object({
27839
+ commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
27840
+ before: localizedTextSchema.optional(),
27841
+ after: localizedTextSchema.optional(),
27842
+ downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
27843
+ }).strict();
27669
27844
  var pluginPresentationShape = {
27670
27845
  id: harnessPluginIdSchema,
27671
27846
  name: external_exports.string().trim().min(1).max(128),
27672
27847
  version: external_exports.string().min(1).max(128),
27848
+ /** Capability-only plugin; omitted for existing session-capable plugins. */
27849
+ kind: external_exports.literal("usage").optional(),
27850
+ /** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
27851
+ iconStyle: external_exports.object({
27852
+ vector: external_exports.object({
27853
+ viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
27854
+ color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
27855
+ paths: external_exports.array(external_exports.object({
27856
+ d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
27857
+ fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
27858
+ fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
27859
+ }).strict()).min(1).max(32)
27860
+ }).strict().optional(),
27861
+ background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
27862
+ borderRadius: external_exports.number().min(0).max(50).optional(),
27863
+ paddingRatio: external_exports.number().min(0).max(0.25).optional()
27864
+ }).strict().optional(),
27865
+ installation: harnessInstallationGuideSchema.optional(),
27866
+ notice: localizedTextSchema.optional(),
27673
27867
  /** The factory accepts a persisted local entrypoint through its construction context. */
27674
27868
  launchCommand: external_exports.literal(true).optional(),
27675
27869
  links: external_exports.object({
27870
+ website: documentationUrlSchema.optional(),
27676
27871
  documentation: documentationUrlSchema.optional(),
27677
27872
  installation: documentationUrlSchema.optional()
27678
27873
  }).strict().optional()
@@ -27749,6 +27944,10 @@ var CONSOLE_HOST_METHODS = Object.freeze([
27749
27944
  "codexhost/account/list",
27750
27945
  "codexhost/account/refresh",
27751
27946
  "codexhost/account/usage/inspect",
27947
+ "codexhost/usage/model-prices/get",
27948
+ "codexhost/usage/model-prices/set",
27949
+ "codexhost/usage/model-prices/default",
27950
+ "codexhost/usage/statistics/get",
27752
27951
  "codexhost/update/check",
27753
27952
  "codexhost/update/start",
27754
27953
  "codexhost/update/status"
@@ -27813,6 +28012,7 @@ var threadUsageSnapshotSchema = external_exports.object({
27813
28012
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
27814
28013
  outputTokens: nonNegativeSafeIntegerSchema.optional(),
27815
28014
  outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
28015
+ apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
27816
28016
  reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
27817
28017
  totalTokens: nonNegativeSafeIntegerSchema.optional(),
27818
28018
  totalCostUsd: finiteNonNegativeNumberSchema.optional(),
@@ -27824,7 +28024,11 @@ var threadUsageSnapshotSchema = external_exports.object({
27824
28024
  planFiveHourUsedPercent: cacheHitRatePercentSchema.optional(),
27825
28025
  planFiveHourResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
27826
28026
  planSevenDayUsedPercent: cacheHitRatePercentSchema.optional(),
27827
- planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional()
28027
+ planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
28028
+ sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
28029
+ timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
28030
+ costSource: external_exports.enum(["publicPrice", "native"]).optional(),
28031
+ unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
27828
28032
  }).strict().superRefine((usage, context) => {
27829
28033
  if (Object.keys(usage).length === 0) {
27830
28034
  context.addIssue({ code: "custom", message: "Thread Usage must contain a reliable field" });
@@ -27845,6 +28049,20 @@ var threadUsageSnapshotSchema = external_exports.object({
27845
28049
  path: ["contextWindowTokens"]
27846
28050
  });
27847
28051
  }
28052
+ if (usage.costSource !== void 0 && usage.totalCostUsd === void 0) {
28053
+ context.addIssue({
28054
+ code: "custom",
28055
+ message: "Thread Usage costSource must be provided with totalCostUsd",
28056
+ path: ["costSource"]
28057
+ });
28058
+ }
28059
+ if (usage.unpricedModels !== void 0 && usage.costSource !== "publicPrice") {
28060
+ context.addIssue({
28061
+ code: "custom",
28062
+ message: "Thread Usage unpricedModels must be provided with a publicPrice cost",
28063
+ path: ["unpricedModels"]
28064
+ });
28065
+ }
27848
28066
  if (usage.planFiveHourResetsAtUnix !== void 0 && usage.planFiveHourUsedPercent === void 0) {
27849
28067
  context.addIssue({
27850
28068
  code: "custom",
@@ -28114,27 +28332,27 @@ var harnessModelCatalogSchema = external_exports.object({
28114
28332
  }).strict().superRefine((catalog, context) => {
28115
28333
  const refs = /* @__PURE__ */ new Set();
28116
28334
  const thinkingIds = new Set(catalog.thinkingOptions.map(({ id }) => id));
28117
- for (const [index, model] of catalog.models.entries()) {
28118
- if (refs.has(model.ref.id)) {
28335
+ for (const [index, model2] of catalog.models.entries()) {
28336
+ if (refs.has(model2.ref.id)) {
28119
28337
  context.addIssue({
28120
28338
  code: "custom",
28121
28339
  message: "Model Catalog refs must be unique",
28122
28340
  path: ["models", index, "ref", "id"]
28123
28341
  });
28124
28342
  }
28125
- refs.add(model.ref.id);
28126
- if (model.fastModel) {
28127
- if (refs.has(model.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model.fastModel?.id)) {
28343
+ refs.add(model2.ref.id);
28344
+ if (model2.fastModel) {
28345
+ if (refs.has(model2.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model2.fastModel?.id)) {
28128
28346
  context.addIssue({
28129
28347
  code: "custom",
28130
28348
  message: "Fast Model refs must be distinct and unique",
28131
28349
  path: ["models", index, "fastModel"]
28132
28350
  });
28133
28351
  }
28134
- refs.add(model.fastModel.id);
28352
+ refs.add(model2.fastModel.id);
28135
28353
  }
28136
28354
  const supportedThinkingIds = /* @__PURE__ */ new Set();
28137
- for (const [optionIndex, optionId] of (model.supportedThinkingOptionIds ?? []).entries()) {
28355
+ for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
28138
28356
  if (supportedThinkingIds.has(optionId)) {
28139
28357
  context.addIssue({
28140
28358
  code: "custom",
@@ -28728,6 +28946,11 @@ var codexSshDraftSchema = external_exports.strictObject({
28728
28946
  });
28729
28947
  var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
28730
28948
  external_exports.strictObject({ action: external_exports.literal("list") }),
28949
+ external_exports.strictObject({
28950
+ action: external_exports.literal("read-thread"),
28951
+ hostId: hostId.refine((id) => id !== "local"),
28952
+ input: delegationReadParamsSchema
28953
+ }),
28731
28954
  external_exports.strictObject({
28732
28955
  action: external_exports.literal("save"),
28733
28956
  draft: codexSshDraftSchema,
@@ -28876,7 +29099,6 @@ var tokenFields = [
28876
29099
  "cachedInputTokens",
28877
29100
  "cacheWriteInputTokens",
28878
29101
  "outputTokens",
28879
- "outputTokensPerSecond",
28880
29102
  "reasoningOutputTokens",
28881
29103
  "totalTokens",
28882
29104
  "contextWindowTokens",
@@ -28884,10 +29106,12 @@ var tokenFields = [
28884
29106
  ];
28885
29107
  var safeIntegerFields = [
28886
29108
  "planFiveHourResetsAtUnix",
28887
- "planSevenDayResetsAtUnix"
29109
+ "planSevenDayResetsAtUnix",
29110
+ "timeToFirstOutputMs"
28888
29111
  ];
28889
29112
  var percentFields = [
28890
29113
  "cacheHitRatePercent",
29114
+ "sessionCacheHitRatePercent",
28891
29115
  "planFiveHourUsedPercent",
28892
29116
  "planSevenDayUsedPercent"
28893
29117
  ];
@@ -28895,9 +29119,14 @@ var usageFields = /* @__PURE__ */ new Set([
28895
29119
  ...tokenFields,
28896
29120
  ...safeIntegerFields,
28897
29121
  ...percentFields,
29122
+ "sessionCacheUsage",
28898
29123
  "totalCostUsd",
28899
29124
  "totalCredits",
28900
- "contextUsagePercent"
29125
+ "contextUsagePercent",
29126
+ "outputTokensPerSecond",
29127
+ "apiOutputTokensPerSecond",
29128
+ "costSource",
29129
+ "unpricedModels"
28901
29130
  ]);
28902
29131
  function isRecord(value) {
28903
29132
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -28913,7 +29142,11 @@ function parseHostUsage(value) {
28913
29142
  throw new Error(`Harness Usage contains unknown field '${key}'`);
28914
29143
  }
28915
29144
  }
28916
- for (const field of ["totalCredits", "contextUsagePercent"]) {
29145
+ for (const field of [
29146
+ "totalCredits",
29147
+ "contextUsagePercent",
29148
+ "apiOutputTokensPerSecond"
29149
+ ]) {
28917
29150
  const candidate = value[field];
28918
29151
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
28919
29152
  throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
@@ -28949,6 +29182,12 @@ function parseHostUsage(value) {
28949
29182
  throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
28950
29183
  }
28951
29184
  }
29185
+ if (value.sessionCacheUsage !== void 0) {
29186
+ const totals2 = value.sessionCacheUsage;
29187
+ if (!isRecord(totals2) || Object.keys(totals2).some((key) => key !== "inputTokens" && key !== "cachedInputTokens") || typeof totals2.inputTokens !== "number" || !Number.isSafeInteger(totals2.inputTokens) || totals2.inputTokens < 0 || typeof totals2.cachedInputTokens !== "number" || !Number.isSafeInteger(totals2.cachedInputTokens) || totals2.cachedInputTokens < 0 || totals2.cachedInputTokens > totals2.inputTokens) {
29188
+ throw new Error("Harness Usage 'sessionCacheUsage' must contain complete bounded token totals");
29189
+ }
29190
+ }
28952
29191
  const hasContextUsed = value.contextUsedTokens !== void 0;
28953
29192
  const hasContextWindow = value.contextWindowTokens !== void 0;
28954
29193
  if (hasContextUsed !== hasContextWindow) {
@@ -28963,8 +29202,43 @@ function parseHostUsage(value) {
28963
29202
  if (value.planSevenDayResetsAtUnix !== void 0 && value.planSevenDayUsedPercent === void 0) {
28964
29203
  throw new Error("Harness Usage 'planSevenDayResetsAtUnix' must be provided with 'planSevenDayUsedPercent'");
28965
29204
  }
29205
+ if (value.costSource !== void 0) {
29206
+ if (value.costSource !== "publicPrice" && value.costSource !== "native") {
29207
+ throw new Error("Harness Usage 'costSource' must be 'publicPrice' or 'native'");
29208
+ }
29209
+ if (value.totalCostUsd === void 0) {
29210
+ throw new Error("Harness Usage 'costSource' must be provided with 'totalCostUsd'");
29211
+ }
29212
+ }
29213
+ if (value.unpricedModels !== void 0) {
29214
+ const models = value.unpricedModels;
29215
+ if (!Array.isArray(models) || models.length === 0 || !models.every((model2) => typeof model2 === "string" && model2.length > 0)) {
29216
+ throw new Error("Harness Usage 'unpricedModels' must be a non-empty list of Model IDs");
29217
+ }
29218
+ if (value.costSource !== "publicPrice") {
29219
+ throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
29220
+ }
29221
+ return { ...value, unpricedModels: [...models] };
29222
+ }
28966
29223
  return { ...value };
28967
29224
  }
29225
+ var requestTokenFields = [
29226
+ "inputTokens",
29227
+ "cachedInputTokens",
29228
+ "cacheWriteInputTokens",
29229
+ "cacheWrite1hInputTokens",
29230
+ "outputTokens",
29231
+ "reasoningOutputTokens",
29232
+ "startedAtMs",
29233
+ "completedAtMs"
29234
+ ];
29235
+ var requestFields = /* @__PURE__ */ new Set([
29236
+ ...requestTokenFields,
29237
+ "requestId",
29238
+ "historical",
29239
+ "model",
29240
+ "provider"
29241
+ ]);
28968
29242
 
28969
29243
  // ../../harness-adapter/dist/live-command-catalog.js
28970
29244
  var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
@@ -29706,14 +29980,14 @@ function cursorModels(info) {
29706
29980
  function cursorCatalog(info) {
29707
29981
  const native = cursorModels(info);
29708
29982
  const thinking = /* @__PURE__ */ new Map();
29709
- const models = native.models.map((model) => {
29710
- const config2 = model.value === native.current ? info.configOptions : info.nativeModels?.find((entry) => entry.value === model.value)?.configOptions;
29983
+ const models = native.models.map((model2) => {
29984
+ const config2 = model2.value === native.current ? info.configOptions : info.nativeModels?.find((entry) => entry.value === model2.value)?.configOptions;
29711
29985
  const options = cursorThinking(config2);
29712
29986
  for (const { id, label } of options)
29713
29987
  thinking.set(id, { id, label });
29714
29988
  return {
29715
- ref: cursorConfiguredModelRef(model.value, config2),
29716
- label: model.name,
29989
+ ref: cursorConfiguredModelRef(model2.value, config2),
29990
+ label: model2.name,
29717
29991
  supportedThinkingOptionIds: options.map(({ id }) => id)
29718
29992
  };
29719
29993
  });
@@ -29730,13 +30004,13 @@ function cursorCatalog(info) {
29730
30004
  function parseCursorNativeModels(input) {
29731
30005
  if (!Array.isArray(input.models))
29732
30006
  throw new Error("Cursor returned no parameterized model catalog");
29733
- return input.models.map((model) => {
29734
- if (typeof model !== "object" || model === null || !("value" in model) || !("name" in model) || !("configOptions" in model) || typeof model.value !== "string" || typeof model.name !== "string" || !Array.isArray(model.configOptions))
30007
+ return input.models.map((model2) => {
30008
+ if (typeof model2 !== "object" || model2 === null || !("value" in model2) || !("name" in model2) || !("configOptions" in model2) || typeof model2.value !== "string" || typeof model2.name !== "string" || !Array.isArray(model2.configOptions))
29735
30009
  throw new Error("Invalid Cursor model metadata");
29736
30010
  return {
29737
- value: model.value,
29738
- name: model.name,
29739
- configOptions: model.configOptions.map((option) => {
30011
+ value: model2.value,
30012
+ name: model2.name,
30013
+ configOptions: model2.configOptions.map((option) => {
29740
30014
  if (typeof option !== "object" || option === null || !("id" in option) || !("name" in option) || !("type" in option) || !("currentValue" in option) || !("options" in option) || typeof option.id !== "string" || typeof option.name !== "string" || option.type !== "select" || typeof option.currentValue !== "string" || !Array.isArray(option.options))
29741
30015
  throw new Error("Invalid Cursor parameter metadata");
29742
30016
  const entries = option.options.map((entry) => {
@@ -29757,7 +30031,7 @@ function parseCursorNativeModels(input) {
29757
30031
  });
29758
30032
  }
29759
30033
  function cursorModelSelection(info, ref) {
29760
- const exact = cursorModels(info).models.find((model2) => cursorModelRef(model2.value).id === ref);
30034
+ const exact = cursorModels(info).models.find((model3) => cursorModelRef(model3.value).id === ref);
29761
30035
  if (exact)
29762
30036
  return [["model", exact.value]];
29763
30037
  if (!ref.startsWith("cursor."))
@@ -29766,8 +30040,8 @@ function cursorModelSelection(info, ref) {
29766
30040
  if (cursorModelRef(decoded).id !== ref)
29767
30041
  throw new Error("Invalid Cursor model reference");
29768
30042
  const match = /^([^\[\]]+)\[([^\[\]]*)\]$/u.exec(decoded);
29769
- const model = match && info.nativeModels?.find((entry) => entry.value === match[1]);
29770
- if (!match || !model)
30043
+ const model2 = match && info.nativeModels?.find((entry) => entry.value === match[1]);
30044
+ if (!match || !model2)
29771
30045
  throw new Error("Model is not in this Cursor session's native catalog");
29772
30046
  const parameters = [];
29773
30047
  for (const parameter of match[2] ? match[2].split(",") : []) {
@@ -29775,12 +30049,12 @@ function cursorModelSelection(info, ref) {
29775
30049
  const [id, value] = pair;
29776
30050
  if (pair.length !== 2 || !id || value === void 0 || parameters.some(([key]) => key === id))
29777
30051
  throw new Error("Invalid Cursor model parameters");
29778
- const option = model.configOptions.find((option2) => option2.id === id);
30052
+ const option = model2.configOptions.find((option2) => option2.id === id);
29779
30053
  if (!option || option.type !== "select" || !option.options.flatMap((entry) => "value" in entry ? [entry] : entry.options).some((entry) => entry.value === value))
29780
30054
  throw new Error("Legacy Cursor model parameter is not selectable in the native catalog");
29781
30055
  parameters.push([id, value]);
29782
30056
  }
29783
- return [["model", model.value], ...parameters];
30057
+ return [["model", model2.value], ...parameters];
29784
30058
  }
29785
30059
  function cursorCapabilities(info) {
29786
30060
  return {
@@ -29791,9 +30065,9 @@ function cursorCapabilities(info) {
29791
30065
  }
29792
30066
  };
29793
30067
  }
29794
- function cursorConfiguredModelRef(model, options) {
30068
+ function cursorConfiguredModelRef(model2, options) {
29795
30069
  const parameters = (options ?? []).flatMap((option) => option.category === "model_config" && option.type === "select" ? [`${option.id}=${option.currentValue}`] : []);
29796
- return cursorModelRef(parameters.length ? `${model}[${parameters.join(",")}]` : model);
30070
+ return cursorModelRef(parameters.length ? `${model2}[${parameters.join(",")}]` : model2);
29797
30071
  }
29798
30072
 
29799
30073
  // dist/transport.js
@@ -32083,9 +32357,9 @@ var Connection = class {
32083
32357
  return;
32084
32358
  }
32085
32359
  const responseBatch = isResponseBatch(batch);
32086
- const responseCount = responseBatch ? 0 : batch.reduce((count, message) => count + (isNotificationMessage(message) ? 0 : 1), 0);
32360
+ const responseCount = responseBatch ? 0 : batch.reduce((count2, message) => count2 + (isNotificationMessage(message) ? 0 : 1), 0);
32087
32361
  let remaining = responseCount;
32088
- let remainingNotifications = batch.reduce((count, message) => count + (isNotificationMessage(message) ? 1 : 0), 0);
32362
+ let remainingNotifications = batch.reduce((count2, message) => count2 + (isNotificationMessage(message) ? 1 : 0), 0);
32089
32363
  let responseSent = false;
32090
32364
  const responses = [];
32091
32365
  const sendResponsesIfReady = async () => {
@@ -45390,7 +45664,7 @@ async function createCursorDelegationBridge(cwd, environment, commandTimeoutMs =
45390
45664
  server.registerTool("harness_inspect", {
45391
45665
  description: "Read a Harness's native Models and Thinking choices. Use opaque IDs only when explicitly selecting; omission retains native defaults.",
45392
45666
  inputSchema: { harness: text, cwd: text.optional() }
45393
- }, ({ harness, cwd: cwd2 }) => run(["harness", "inspect", harness, ...optional2("--cwd", cwd2)]));
45667
+ }, ({ harness: harness2, cwd: cwd2 }) => run(["harness", "inspect", harness2, ...optional2("--cwd", cwd2)]));
45394
45668
  server.registerTool("delegate_start", {
45395
45669
  description: "Start an independent task in another Harness when the user requests delegation. Returns immediately with a task link; use thread_wait for completion. Parent attribution and credentials come from this Cursor session. Do not delegate to Cursor: unattended inbound Cursor tasks are unsupported.",
45396
45670
  inputSchema: {
@@ -45401,15 +45675,15 @@ async function createCursorDelegationBridge(cwd, environment, commandTimeoutMs =
45401
45675
  thinking: text.optional(),
45402
45676
  requestId: text.optional()
45403
45677
  }
45404
- }, ({ harness, task, cwd: cwd2, model, thinking, requestId }) => run([
45678
+ }, ({ harness: harness2, task, cwd: cwd2, model: model2, thinking, requestId }) => run([
45405
45679
  "delegate",
45406
45680
  "start",
45407
45681
  "--harness",
45408
- harness,
45682
+ harness2,
45409
45683
  "--task",
45410
45684
  task,
45411
45685
  ...optional2("--cwd", cwd2),
45412
- ...optional2("--model", model),
45686
+ ...optional2("--model", model2),
45413
45687
  ...optional2("--thinking", thinking),
45414
45688
  ...optional2("--request-id", requestId)
45415
45689
  ]));
@@ -45634,7 +45908,7 @@ var CursorTransport = class {
45634
45908
  return info;
45635
45909
  const modelOption = info.configOptions?.find((option) => option.id === "model");
45636
45910
  const available = modelOption?.type === "select" ? modelOption.options.flatMap((entry) => "value" in entry ? [entry] : entry.options) : void 0;
45637
- if (this.cachedModels?.length && available?.length === this.cachedModels.length && available.every((model) => this.cachedModels?.some((cached2) => cached2.value === model.value && cached2.name === model.name)))
45911
+ if (this.cachedModels?.length && available?.length === this.cachedModels.length && available.every((model2) => this.cachedModels?.some((cached2) => cached2.value === model2.value && cached2.name === model2.name)))
45638
45912
  return { ...info, nativeModels: structuredClone(this.cachedModels) };
45639
45913
  try {
45640
45914
  const models = await this.#bounded(this.#connection.extMethod("cursor/list_available_models", {}));
@@ -46431,7 +46705,13 @@ var CursorTurnOutput = class {
46431
46705
  constructor(turnId, emit, nativeTurnIndex = 0) {
46432
46706
  this.turnId = turnId;
46433
46707
  this.emit = emit;
46434
- this.subagents = new CursorSubagents(turnId, emit, nativeTurnIndex);
46708
+ this.subagents = new CursorSubagents(turnId, (event) => {
46709
+ if (event.type === "item.started") {
46710
+ this.#flushHold();
46711
+ this.#finishText();
46712
+ }
46713
+ emit(event);
46714
+ }, nativeTurnIndex);
46435
46715
  }
46436
46716
  sawWritableIterableClosed() {
46437
46717
  return this.#writableIterableClosed || takeCursorWritableIterableClosed(this.#hold).closed;
@@ -46481,11 +46761,8 @@ var CursorTurnOutput = class {
46481
46761
  this.#text = void 0;
46482
46762
  }
46483
46763
  update(notification) {
46484
- if (this.subagents.update(notification)) {
46485
- this.#flushHold();
46486
- this.#finishText();
46764
+ if (this.subagents.update(notification))
46487
46765
  return;
46488
- }
46489
46766
  const { update } = notification;
46490
46767
  if (update.sessionUpdate === "agent_message_chunk" || update.sessionUpdate === "agent_thought_chunk") {
46491
46768
  if (update.content.type !== "text")
@@ -46501,12 +46778,12 @@ var CursorTurnOutput = class {
46501
46778
  this.#hold = hold;
46502
46779
  this.#appendText(type, emit);
46503
46780
  } else if (update.sessionUpdate === "tool_call" || update.sessionUpdate === "tool_call_update") {
46504
- this.#flushHold();
46505
- this.#finishText();
46506
46781
  if (this.#finishedTools.has(update.toolCallId))
46507
46782
  return;
46508
46783
  let tool = this.#tools.get(update.toolCallId);
46509
46784
  if (!tool) {
46785
+ this.#flushHold();
46786
+ this.#finishText();
46510
46787
  const args = jsonValueSchema.safeParse(update.rawInput ?? {});
46511
46788
  const item2 = {
46512
46789
  type: "toolExecution",
@@ -47306,7 +47583,7 @@ var CursorAdapter = class {
47306
47583
  throw staged.reason;
47307
47584
  if (!derived)
47308
47585
  throw new Error("Cursor native fork did not return a target");
47309
- const model = input.kind === "rollbackLastTurn" ? input.model ?? source?.initialState.effectiveModel : source?.initialState.effectiveModel;
47586
+ const model2 = input.kind === "rollbackLastTurn" ? input.model ?? source?.initialState.effectiveModel : source?.initialState.effectiveModel;
47310
47587
  const thinking = input.kind === "rollbackLastTurn" ? input.thinkingOptionId ?? source?.initialState.effectiveThinkingOptionId : source?.initialState.effectiveThinkingOptionId;
47311
47588
  const mode = input.kind === "rollbackLastTurn" ? input.permissionModeId ?? source?.initialState.effectivePermissionModeId : source?.initialState.effectivePermissionModeId;
47312
47589
  const opened = await this.#openSession({
@@ -47314,7 +47591,7 @@ var CursorAdapter = class {
47314
47591
  cwd: input.cwd,
47315
47592
  environment: options.environment,
47316
47593
  nativeRef: cursorNativeSessionRef(derived.sessionId, executionPolicy),
47317
- ...model ? { model } : {},
47594
+ ...model2 ? { model: model2 } : {},
47318
47595
  ...thinking ? { thinkingOptionId: thinking } : {},
47319
47596
  ...mode ? { permissionModeId: mode } : {}
47320
47597
  }, transport);
@@ -47531,9 +47808,9 @@ var CursorSession = class {
47531
47808
  if (!result.configOptions.some((option) => option.id === configId && option.currentValue === value))
47532
47809
  throw new Error("Cursor did not confirm configuration selection");
47533
47810
  this.info.configOptions = result.configOptions;
47534
- const model = result.configOptions.find((option) => option.id === "model");
47535
- if (model?.type === "select")
47536
- this.initialState.effectiveModel = cursorConfiguredModelRef(model.currentValue, result.configOptions);
47811
+ const model2 = result.configOptions.find((option) => option.id === "model");
47812
+ if (model2?.type === "select")
47813
+ this.initialState.effectiveModel = cursorConfiguredModelRef(model2.currentValue, result.configOptions);
47537
47814
  const mode = result.configOptions.find((option) => option.id === "mode");
47538
47815
  if (mode)
47539
47816
  this.initialState.effectivePermissionModeId = harnessPermissionModeIdSchema.parse(mode.currentValue);
@@ -47981,6 +48258,8 @@ var harnessSessionStateSchema = external_exports.custom((value) => {
47981
48258
  var eventKeys = /* @__PURE__ */ new Map([
47982
48259
  ["session.state.changed", /* @__PURE__ */ new Set(["type", "state"])],
47983
48260
  ["session.usage.changed", /* @__PURE__ */ new Set(["type", "usage", "observedForTurnId"])],
48261
+ ["usage.request", /* @__PURE__ */ new Set(["type", "request"])],
48262
+ ["usage.history", /* @__PURE__ */ new Set(["type", "complete"])],
47984
48263
  ["subagent.state.changed", /* @__PURE__ */ new Set(["type", "nativeSubagentId", "status", "resultSummary"])],
47985
48264
  ["subagent.transcript.changed", /* @__PURE__ */ new Set(["type", "nativeSubagentId"])],
47986
48265
  ["turn.started", /* @__PURE__ */ new Set(["type", "turnId"])],
@@ -48029,6 +48308,8 @@ var harnessOutputSchema = external_exports.custom((value) => {
48029
48308
  return harnessSessionStateSchema.safeParse(event.state).success;
48030
48309
  if (event.type === "session.faulted")
48031
48310
  return harnessErrorSchema.safeParse(event.error).success;
48311
+ if (event.type === "usage.history")
48312
+ return typeof event.complete === "boolean";
48032
48313
  return true;
48033
48314
  }
48034
48315
  if (output.kind === "interaction") {