@liberseek/boft-cli-linux-x64 0.7.9 → 0.8.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 (56) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.txt +8 -0
  3. package/app/codexhost-distribution.json +1 -1
  4. package/app/console-server.mjs +232 -21
  5. package/app/console-web.js +9669 -5390
  6. package/app/desktop-controller.mjs +252 -42
  7. package/app/host-runtime.mjs +5361 -1491
  8. package/app/plugins/antigravity/manifest.json +18 -1
  9. package/app/plugins/antigravity/plugin.mjs +276 -42
  10. package/app/plugins/claude-code/manifest.json +28 -0
  11. package/app/plugins/claude-code/plugin.mjs +1055 -391
  12. package/app/plugins/codebuddy/manifest.json +17 -0
  13. package/app/plugins/codebuddy/plugin.mjs +5931 -5358
  14. package/app/plugins/codex-usage/manifest.json +9 -0
  15. package/app/plugins/codex-usage/plugin.mjs +16750 -0
  16. package/app/plugins/cursor-cli/manifest.json +18 -1
  17. package/app/plugins/cursor-cli/plugin.mjs +351 -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 +798 -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 +898 -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 +278 -33
  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 +555 -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 +284 -22
  33. package/app/plugins/muse/manifest.json +18 -1
  34. package/app/plugins/muse/plugin.mjs +251 -17
  35. package/app/plugins/omp/manifest.json +21 -1
  36. package/app/plugins/omp/plugin.mjs +2741 -1960
  37. package/app/plugins/opencode/manifest.json +18 -1
  38. package/app/plugins/opencode/plugin.mjs +694 -147
  39. package/app/plugins/pi/manifest.json +32 -0
  40. package/app/plugins/pi/plugin.mjs +3396 -2841
  41. package/app/plugins/qoder/manifest.json +18 -1
  42. package/app/plugins/qoder/plugin.mjs +585 -81
  43. package/app/plugins/qoder-cn/manifest.json +18 -1
  44. package/app/plugins/qoder-cn/plugin.mjs +585 -81
  45. package/app/plugins/workbuddy/manifest.json +18 -0
  46. package/app/plugins/workbuddy/plugin.mjs +6317 -5746
  47. package/app/plugins/zcode/manifest.json +19 -1
  48. package/app/plugins/zcode/plugin.mjs +1066 -260
  49. package/app/renderer-extension.js +2731 -2427
  50. package/bin/boft +0 -0
  51. package/libexec/boft-shim +0 -0
  52. package/libexec/boft-updater +0 -0
  53. package/licenses/Cordis-LICENSE.txt +21 -0
  54. package/licenses/Cosmokit-LICENSE.txt +21 -0
  55. package/package.json +1 -1
  56. package/app/plugins/kiro-cli/assets/icon.svg +0 -5
@@ -396,7 +396,7 @@ async function npmInstallation(command, packages, environment) {
396
396
  const npm = resolveHarnessExecutable({ id: "npm", command: "npm", installRoots: { posix: [], windows: [] } }, { environment: env });
397
397
  let globalInstall = modules === globalRoot;
398
398
  if (process.platform === "win32") {
399
- const project = (await Promise.all(["package.json", "package-lock.json", "npm-shrinkwrap.json"].map((file2) => readFile(path4.join(prefix, file2), "utf8").then(() => true, (error51) => error51.code !== "ENOENT")))).some(Boolean);
399
+ const project2 = (await Promise.all(["package.json", "package-lock.json", "npm-shrinkwrap.json"].map((file2) => readFile(path4.join(prefix, file2), "utf8").then(() => true, (error51) => error51.code !== "ENOENT")))).some(Boolean);
400
400
  const bins = typeof metadata.bin === "string" ? { [name.split("/").at(-1) ?? name]: metadata.bin } : metadata.bin ?? {};
401
401
  const launchers = await Promise.all(Object.entries(bins).map(async ([bin, entry]) => {
402
402
  if (path4.basename(bin) !== bin || entry.includes(".."))
@@ -407,7 +407,7 @@ async function npmInstallation(command, packages, environment) {
407
407
  const shim = await readFile(path4.join(prefix, `${bin}.cmd`), "utf8").catch(() => "");
408
408
  return referencesNpmBin(shim, name, entry);
409
409
  }));
410
- globalInstall = globalInstall && !project && launchers.some(Boolean);
410
+ globalInstall = globalInstall && !project2 && launchers.some(Boolean);
411
411
  }
412
412
  const canUpdate = globalInstall && !!npm;
413
413
  return {
@@ -5128,8 +5128,8 @@ function az_default() {
5128
5128
  }
5129
5129
 
5130
5130
  // ../../../node_modules/zod/v4/locales/be.js
5131
- function getBelarusianPlural(count, one, few, many) {
5132
- const absCount = Math.abs(count);
5131
+ function getBelarusianPlural(count2, one, few, many) {
5132
+ const absCount = Math.abs(count2);
5133
5133
  const lastDigit = absCount % 10;
5134
5134
  const lastTwoDigits = absCount % 100;
5135
5135
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -7207,8 +7207,8 @@ function hu_default() {
7207
7207
  }
7208
7208
 
7209
7209
  // ../../../node_modules/zod/v4/locales/hy.js
7210
- function getArmenianPlural(count, one, many) {
7211
- return Math.abs(count) === 1 ? one : many;
7210
+ function getArmenianPlural(count2, one, many) {
7211
+ return Math.abs(count2) === 1 ? one : many;
7212
7212
  }
7213
7213
  function withDefiniteArticle(word) {
7214
7214
  if (!word)
@@ -9336,8 +9336,8 @@ function ro_default() {
9336
9336
  }
9337
9337
 
9338
9338
  // ../../../node_modules/zod/v4/locales/ru.js
9339
- function getRussianPlural(count, one, few, many) {
9340
- const absCount = Math.abs(count);
9339
+ function getRussianPlural(count2, one, few, many) {
9340
+ const absCount = Math.abs(count2);
9341
9341
  const lastDigit = absCount % 10;
9342
9342
  const lastTwoDigits = absCount % 100;
9343
9343
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -15006,6 +15006,15 @@ function date4(params) {
15006
15006
  // ../../../node_modules/zod/v4/classic/external.js
15007
15007
  config(en_default());
15008
15008
 
15009
+ // ../../shared-contracts/dist/delegation-read.js
15010
+ var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
15011
+ var delegationReadParamsSchema = external_exports.strictObject({
15012
+ threadId: external_exports.string().min(1).max(1024),
15013
+ view: external_exports.enum(["result", "messages"]),
15014
+ cursor: external_exports.string().min(1).max(8192).optional(),
15015
+ limit: external_exports.number().int().min(1).max(100).optional()
15016
+ });
15017
+
15009
15018
  // ../../shared-contracts/dist/credential-imports.js
15010
15019
  var credentialSourceSchema = external_exports.object({
15011
15020
  id: external_exports.string().min(1).max(256),
@@ -15076,6 +15085,153 @@ var harnessDisplaySetSchema = external_exports.strictObject({
15076
15085
  initializeOnly: external_exports.boolean().optional()
15077
15086
  });
15078
15087
 
15088
+ // ../../shared-contracts/dist/model-price-overrides.js
15089
+ var usdPerMillionTokens = external_exports.number().finite().nonnegative();
15090
+ var modelPriceOverrideSchema = external_exports.strictObject({
15091
+ input: usdPerMillionTokens,
15092
+ output: usdPerMillionTokens,
15093
+ cacheRead: usdPerMillionTokens.optional(),
15094
+ cacheWrite: usdPerMillionTokens.optional(),
15095
+ cacheWrite1h: usdPerMillionTokens.optional()
15096
+ });
15097
+ var modelPriceKeySchema = external_exports.string().max(512).refine((key) => key.trim() === key && key.length > 0, "Model ID is required");
15098
+ var modelPriceOverridesSchema = external_exports.strictObject({
15099
+ /** Absolute path of the Host's `pricing.json`. */
15100
+ path: external_exports.string(),
15101
+ entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
15102
+ /** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
15103
+ error: external_exports.string().nullable()
15104
+ });
15105
+ var modelPriceOverridesGetSchema = external_exports.strictObject({});
15106
+ var modelPriceOverridesSetSchema = external_exports.strictObject({
15107
+ key: modelPriceKeySchema,
15108
+ price: modelPriceOverrideSchema.nullable(),
15109
+ previousKey: modelPriceKeySchema.optional()
15110
+ });
15111
+ var modelPriceDefaultParamsSchema = external_exports.strictObject({
15112
+ model: modelPriceKeySchema
15113
+ });
15114
+ var modelPriceSuggestionSchema = external_exports.strictObject({
15115
+ /** Verified from catalog canonical links, not inferred from names or equal prices. */
15116
+ official: external_exports.boolean().optional(),
15117
+ canonicalModelId: external_exports.string().min(1).optional(),
15118
+ provider: external_exports.string().min(1).max(512),
15119
+ model: external_exports.string().min(1).max(512),
15120
+ price: modelPriceOverrideSchema
15121
+ });
15122
+ var modelPriceDefaultResultSchema = external_exports.strictObject({
15123
+ price: modelPriceOverrideSchema.nullable(),
15124
+ /** Local catalog suggestions only; never used automatically for pricing. */
15125
+ suggestions: external_exports.array(modelPriceSuggestionSchema).max(6).optional()
15126
+ });
15127
+
15128
+ // ../../shared-contracts/dist/usage-statistics.js
15129
+ var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
15130
+ var count = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
15131
+ var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
15132
+ var harness = external_exports.string().min(1).max(128);
15133
+ var model = external_exports.string().min(1).max(512);
15134
+ var project = external_exports.string().min(1).max(4096);
15135
+ var usageStatisticsParamsSchema = external_exports.strictObject({
15136
+ range: external_exports.enum(USAGE_STATISTICS_RANGES),
15137
+ harness: harness.optional(),
15138
+ model: model.nullable().optional(),
15139
+ project: project.nullable().optional(),
15140
+ /** One local date inside the range. */
15141
+ date: localDate.optional()
15142
+ });
15143
+ var usageStatisticsTotalsSchema = external_exports.strictObject({
15144
+ requests: count,
15145
+ inputTokens: count,
15146
+ cachedInputTokens: count,
15147
+ cacheWriteInputTokens: count,
15148
+ cacheKnownInputTokens: count,
15149
+ outputTokens: count,
15150
+ reasoningOutputTokens: count,
15151
+ /** USD at the public price, summed over the priced requests only. */
15152
+ costUsd: external_exports.number().finite().min(0),
15153
+ /** Requests without a price (or the cache data the price needs); not in `costUsd`. */
15154
+ unpricedRequests: count,
15155
+ /**
15156
+ * Requests whose storage gave no token counts: counted as requests, with neither tokens nor
15157
+ * cost, and not as unpriced.
15158
+ */
15159
+ unmeteredRequests: count
15160
+ });
15161
+ var totals = usageStatisticsTotalsSchema.shape;
15162
+ var usageStatisticsSessionSchema = external_exports.strictObject({
15163
+ harness,
15164
+ sessionId: external_exports.string().min(1).max(512),
15165
+ project: project.nullable(),
15166
+ /** Models the session used, most requests first. */
15167
+ models: external_exports.array(model).max(16),
15168
+ firstAtMs: count,
15169
+ lastAtMs: count,
15170
+ ...totals
15171
+ });
15172
+ var usageStatisticsResultSchema = external_exports.strictObject({
15173
+ range: external_exports.enum(USAGE_STATISTICS_RANGES),
15174
+ /** First local date of the range; null for all time. */
15175
+ from: localDate.nullable(),
15176
+ to: localDate,
15177
+ /** The filters these figures apply, echoed so a late answer to older filters is recognised. */
15178
+ filters: external_exports.strictObject({
15179
+ harness: harness.nullable(),
15180
+ model: model.nullable(),
15181
+ unknownModel: external_exports.boolean(),
15182
+ project: project.nullable(),
15183
+ unknownProject: external_exports.boolean(),
15184
+ date: localDate.nullable()
15185
+ }),
15186
+ /** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
15187
+ reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
15188
+ /** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
15189
+ failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
15190
+ /** Every value seen in the range, ignoring the filters, to choose filters from. */
15191
+ options: external_exports.strictObject({
15192
+ harnesses: external_exports.array(harness).max(256),
15193
+ models: external_exports.array(model.nullable()).max(4096),
15194
+ projects: external_exports.array(project.nullable()).max(4096)
15195
+ }),
15196
+ /** Current display metadata, scoped by Harness. Never a pricing or filter identity.
15197
+ * Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
15198
+ */
15199
+ modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
15200
+ /** Native credits, all filters applied, never combined across Harnesses or treated as USD.
15201
+ * Only groups with at least one reported value appear; reportedRequests exposes partial data.
15202
+ */
15203
+ credits: external_exports.array(external_exports.strictObject({
15204
+ harness,
15205
+ model: model.nullable(),
15206
+ credits: external_exports.number().finite().min(0),
15207
+ reportedRequests: count,
15208
+ requests: count
15209
+ })).max(4096).optional(),
15210
+ /** All filters applied. */
15211
+ totals: usageStatisticsTotalsSchema,
15212
+ /** Each date and Harness of the range: every filter except the day. */
15213
+ daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
15214
+ /** Local weekday (0 = Sunday) and hour, all filters applied. */
15215
+ hourly: external_exports.array(external_exports.strictObject({
15216
+ weekday: external_exports.number().int().min(0).max(6),
15217
+ hour: external_exports.number().int().min(0).max(23),
15218
+ ...totals
15219
+ })).max(168),
15220
+ byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
15221
+ byModel: external_exports.array(external_exports.strictObject({
15222
+ model: model.nullable(),
15223
+ ...totals,
15224
+ /** Requests priced by what the Harness recorded they cost, not by a price list. */
15225
+ harnessPricedRequests: count
15226
+ })).max(4096),
15227
+ byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
15228
+ /**
15229
+ * The sessions that spent the most, by cost and by tokens without cache, all filters applied;
15230
+ * requests without a native session are not listed here but count everywhere else.
15231
+ */
15232
+ sessions: external_exports.array(usageStatisticsSessionSchema).max(100)
15233
+ });
15234
+
15079
15235
  // ../../shared-contracts/dist/ids.js
15080
15236
  var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
15081
15237
  message: "Identifier must not be empty or whitespace"
@@ -15097,13 +15253,40 @@ var HARNESS_PLUGIN_LIMIT = 128;
15097
15253
  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);
15098
15254
  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");
15099
15255
  var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
15256
+ var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
15257
+ var harnessInstallationGuideSchema = external_exports.object({
15258
+ commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
15259
+ before: localizedTextSchema.optional(),
15260
+ after: localizedTextSchema.optional(),
15261
+ downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
15262
+ }).strict();
15100
15263
  var pluginPresentationShape = {
15101
15264
  id: harnessPluginIdSchema,
15102
15265
  name: external_exports.string().trim().min(1).max(128),
15103
15266
  version: external_exports.string().min(1).max(128),
15267
+ /** Capability-only plugin; omitted for existing session-capable plugins. */
15268
+ kind: external_exports.literal("usage").optional(),
15269
+ /** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
15270
+ iconStyle: external_exports.object({
15271
+ vector: external_exports.object({
15272
+ viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
15273
+ color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
15274
+ paths: external_exports.array(external_exports.object({
15275
+ d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
15276
+ fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
15277
+ fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
15278
+ }).strict()).min(1).max(32)
15279
+ }).strict().optional(),
15280
+ background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
15281
+ borderRadius: external_exports.number().min(0).max(50).optional(),
15282
+ paddingRatio: external_exports.number().min(0).max(0.25).optional()
15283
+ }).strict().optional(),
15284
+ installation: harnessInstallationGuideSchema.optional(),
15285
+ notice: localizedTextSchema.optional(),
15104
15286
  /** The factory accepts a persisted local entrypoint through its construction context. */
15105
15287
  launchCommand: external_exports.literal(true).optional(),
15106
15288
  links: external_exports.object({
15289
+ website: documentationUrlSchema.optional(),
15107
15290
  documentation: documentationUrlSchema.optional(),
15108
15291
  installation: documentationUrlSchema.optional()
15109
15292
  }).strict().optional()
@@ -15180,6 +15363,10 @@ var CONSOLE_HOST_METHODS = Object.freeze([
15180
15363
  "codexhost/account/list",
15181
15364
  "codexhost/account/refresh",
15182
15365
  "codexhost/account/usage/inspect",
15366
+ "codexhost/usage/model-prices/get",
15367
+ "codexhost/usage/model-prices/set",
15368
+ "codexhost/usage/model-prices/default",
15369
+ "codexhost/usage/statistics/get",
15183
15370
  "codexhost/update/check",
15184
15371
  "codexhost/update/start",
15185
15372
  "codexhost/update/status"
@@ -15244,6 +15431,7 @@ var threadUsageSnapshotSchema = external_exports.object({
15244
15431
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
15245
15432
  outputTokens: nonNegativeSafeIntegerSchema.optional(),
15246
15433
  outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15434
+ apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15247
15435
  reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
15248
15436
  totalTokens: nonNegativeSafeIntegerSchema.optional(),
15249
15437
  totalCostUsd: finiteNonNegativeNumberSchema.optional(),
@@ -15255,7 +15443,11 @@ var threadUsageSnapshotSchema = external_exports.object({
15255
15443
  planFiveHourUsedPercent: cacheHitRatePercentSchema.optional(),
15256
15444
  planFiveHourResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
15257
15445
  planSevenDayUsedPercent: cacheHitRatePercentSchema.optional(),
15258
- planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional()
15446
+ planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
15447
+ sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
15448
+ timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
15449
+ costSource: external_exports.enum(["publicPrice", "native"]).optional(),
15450
+ unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
15259
15451
  }).strict().superRefine((usage, context) => {
15260
15452
  if (Object.keys(usage).length === 0) {
15261
15453
  context.addIssue({ code: "custom", message: "Thread Usage must contain a reliable field" });
@@ -15276,6 +15468,20 @@ var threadUsageSnapshotSchema = external_exports.object({
15276
15468
  path: ["contextWindowTokens"]
15277
15469
  });
15278
15470
  }
15471
+ if (usage.costSource !== void 0 && usage.totalCostUsd === void 0) {
15472
+ context.addIssue({
15473
+ code: "custom",
15474
+ message: "Thread Usage costSource must be provided with totalCostUsd",
15475
+ path: ["costSource"]
15476
+ });
15477
+ }
15478
+ if (usage.unpricedModels !== void 0 && usage.costSource !== "publicPrice") {
15479
+ context.addIssue({
15480
+ code: "custom",
15481
+ message: "Thread Usage unpricedModels must be provided with a publicPrice cost",
15482
+ path: ["unpricedModels"]
15483
+ });
15484
+ }
15279
15485
  if (usage.planFiveHourResetsAtUnix !== void 0 && usage.planFiveHourUsedPercent === void 0) {
15280
15486
  context.addIssue({
15281
15487
  code: "custom",
@@ -15545,27 +15751,27 @@ var harnessModelCatalogSchema = external_exports.object({
15545
15751
  }).strict().superRefine((catalog, context) => {
15546
15752
  const refs = /* @__PURE__ */ new Set();
15547
15753
  const thinkingIds = new Set(catalog.thinkingOptions.map(({ id }) => id));
15548
- for (const [index, model] of catalog.models.entries()) {
15549
- if (refs.has(model.ref.id)) {
15754
+ for (const [index, model2] of catalog.models.entries()) {
15755
+ if (refs.has(model2.ref.id)) {
15550
15756
  context.addIssue({
15551
15757
  code: "custom",
15552
15758
  message: "Model Catalog refs must be unique",
15553
15759
  path: ["models", index, "ref", "id"]
15554
15760
  });
15555
15761
  }
15556
- refs.add(model.ref.id);
15557
- if (model.fastModel) {
15558
- if (refs.has(model.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model.fastModel?.id)) {
15762
+ refs.add(model2.ref.id);
15763
+ if (model2.fastModel) {
15764
+ if (refs.has(model2.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model2.fastModel?.id)) {
15559
15765
  context.addIssue({
15560
15766
  code: "custom",
15561
15767
  message: "Fast Model refs must be distinct and unique",
15562
15768
  path: ["models", index, "fastModel"]
15563
15769
  });
15564
15770
  }
15565
- refs.add(model.fastModel.id);
15771
+ refs.add(model2.fastModel.id);
15566
15772
  }
15567
15773
  const supportedThinkingIds = /* @__PURE__ */ new Set();
15568
- for (const [optionIndex, optionId] of (model.supportedThinkingOptionIds ?? []).entries()) {
15774
+ for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
15569
15775
  if (supportedThinkingIds.has(optionId)) {
15570
15776
  context.addIssue({
15571
15777
  code: "custom",
@@ -16159,6 +16365,11 @@ var codexSshDraftSchema = external_exports.strictObject({
16159
16365
  });
16160
16366
  var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
16161
16367
  external_exports.strictObject({ action: external_exports.literal("list") }),
16368
+ external_exports.strictObject({
16369
+ action: external_exports.literal("read-thread"),
16370
+ hostId: hostId.refine((id) => id !== "local"),
16371
+ input: delegationReadParamsSchema
16372
+ }),
16162
16373
  external_exports.strictObject({
16163
16374
  action: external_exports.literal("save"),
16164
16375
  draft: codexSshDraftSchema,
@@ -16294,7 +16505,6 @@ var tokenFields = [
16294
16505
  "cachedInputTokens",
16295
16506
  "cacheWriteInputTokens",
16296
16507
  "outputTokens",
16297
- "outputTokensPerSecond",
16298
16508
  "reasoningOutputTokens",
16299
16509
  "totalTokens",
16300
16510
  "contextWindowTokens",
@@ -16302,10 +16512,12 @@ var tokenFields = [
16302
16512
  ];
16303
16513
  var safeIntegerFields = [
16304
16514
  "planFiveHourResetsAtUnix",
16305
- "planSevenDayResetsAtUnix"
16515
+ "planSevenDayResetsAtUnix",
16516
+ "timeToFirstOutputMs"
16306
16517
  ];
16307
16518
  var percentFields = [
16308
16519
  "cacheHitRatePercent",
16520
+ "sessionCacheHitRatePercent",
16309
16521
  "planFiveHourUsedPercent",
16310
16522
  "planSevenDayUsedPercent"
16311
16523
  ];
@@ -16313,9 +16525,14 @@ var usageFields = /* @__PURE__ */ new Set([
16313
16525
  ...tokenFields,
16314
16526
  ...safeIntegerFields,
16315
16527
  ...percentFields,
16528
+ "sessionCacheUsage",
16316
16529
  "totalCostUsd",
16317
16530
  "totalCredits",
16318
- "contextUsagePercent"
16531
+ "contextUsagePercent",
16532
+ "outputTokensPerSecond",
16533
+ "apiOutputTokensPerSecond",
16534
+ "costSource",
16535
+ "unpricedModels"
16319
16536
  ]);
16320
16537
  function isRecord(value) {
16321
16538
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -16331,7 +16548,11 @@ function parseHostUsage(value) {
16331
16548
  throw new Error(`Harness Usage contains unknown field '${key}'`);
16332
16549
  }
16333
16550
  }
16334
- for (const field of ["totalCredits", "contextUsagePercent"]) {
16551
+ for (const field of [
16552
+ "totalCredits",
16553
+ "contextUsagePercent",
16554
+ "apiOutputTokensPerSecond"
16555
+ ]) {
16335
16556
  const candidate = value[field];
16336
16557
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16337
16558
  throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
@@ -16367,6 +16588,12 @@ function parseHostUsage(value) {
16367
16588
  throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
16368
16589
  }
16369
16590
  }
16591
+ if (value.sessionCacheUsage !== void 0) {
16592
+ const totals2 = value.sessionCacheUsage;
16593
+ 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) {
16594
+ throw new Error("Harness Usage 'sessionCacheUsage' must contain complete bounded token totals");
16595
+ }
16596
+ }
16370
16597
  const hasContextUsed = value.contextUsedTokens !== void 0;
16371
16598
  const hasContextWindow = value.contextWindowTokens !== void 0;
16372
16599
  if (hasContextUsed !== hasContextWindow) {
@@ -16381,8 +16608,43 @@ function parseHostUsage(value) {
16381
16608
  if (value.planSevenDayResetsAtUnix !== void 0 && value.planSevenDayUsedPercent === void 0) {
16382
16609
  throw new Error("Harness Usage 'planSevenDayResetsAtUnix' must be provided with 'planSevenDayUsedPercent'");
16383
16610
  }
16611
+ if (value.costSource !== void 0) {
16612
+ if (value.costSource !== "publicPrice" && value.costSource !== "native") {
16613
+ throw new Error("Harness Usage 'costSource' must be 'publicPrice' or 'native'");
16614
+ }
16615
+ if (value.totalCostUsd === void 0) {
16616
+ throw new Error("Harness Usage 'costSource' must be provided with 'totalCostUsd'");
16617
+ }
16618
+ }
16619
+ if (value.unpricedModels !== void 0) {
16620
+ const models = value.unpricedModels;
16621
+ if (!Array.isArray(models) || models.length === 0 || !models.every((model2) => typeof model2 === "string" && model2.length > 0)) {
16622
+ throw new Error("Harness Usage 'unpricedModels' must be a non-empty list of Model IDs");
16623
+ }
16624
+ if (value.costSource !== "publicPrice") {
16625
+ throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
16626
+ }
16627
+ return { ...value, unpricedModels: [...models] };
16628
+ }
16384
16629
  return { ...value };
16385
16630
  }
16631
+ var requestTokenFields = [
16632
+ "inputTokens",
16633
+ "cachedInputTokens",
16634
+ "cacheWriteInputTokens",
16635
+ "cacheWrite1hInputTokens",
16636
+ "outputTokens",
16637
+ "reasoningOutputTokens",
16638
+ "startedAtMs",
16639
+ "completedAtMs"
16640
+ ];
16641
+ var requestFields = /* @__PURE__ */ new Set([
16642
+ ...requestTokenFields,
16643
+ "requestId",
16644
+ "historical",
16645
+ "model",
16646
+ "provider"
16647
+ ]);
16386
16648
 
16387
16649
  // ../../../node_modules/@agentclientprotocol/sdk/dist/schema/index.js
16388
16650
  var AGENT_METHODS = {
@@ -18667,9 +18929,9 @@ var Connection = class {
18667
18929
  return;
18668
18930
  }
18669
18931
  const responseBatch = isResponseBatch(batch);
18670
- const responseCount = responseBatch ? 0 : batch.reduce((count, message) => count + (isNotificationMessage(message) ? 0 : 1), 0);
18932
+ const responseCount = responseBatch ? 0 : batch.reduce((count2, message) => count2 + (isNotificationMessage(message) ? 0 : 1), 0);
18671
18933
  let remaining = responseCount;
18672
- let remainingNotifications = batch.reduce((count, message) => count + (isNotificationMessage(message) ? 1 : 0), 0);
18934
+ let remainingNotifications = batch.reduce((count2, message) => count2 + (isNotificationMessage(message) ? 1 : 0), 0);
18673
18935
  let responseSent = false;
18674
18936
  const responses = [];
18675
18937
  const sendResponsesIfReady = async () => {
@@ -21653,6 +21915,33 @@ function splitLines(text) {
21653
21915
  }
21654
21916
 
21655
21917
  // ../../../node_modules/smol-toml/dist/date.js
21918
+ /*!
21919
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
21920
+ * SPDX-License-Identifier: BSD-3-Clause
21921
+ *
21922
+ * Redistribution and use in source and binary forms, with or without
21923
+ * modification, are permitted provided that the following conditions are met:
21924
+ *
21925
+ * 1. Redistributions of source code must retain the above copyright notice, this
21926
+ * list of conditions and the following disclaimer.
21927
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
21928
+ * this list of conditions and the following disclaimer in the
21929
+ * documentation and/or other materials provided with the distribution.
21930
+ * 3. Neither the name of the copyright holder nor the names of its contributors
21931
+ * may be used to endorse or promote products derived from this software without
21932
+ * specific prior written permission.
21933
+ *
21934
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21935
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21936
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21937
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21938
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21939
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21940
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21941
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21942
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
21943
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21944
+ */
21656
21945
  var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
21657
21946
  var TomlDate = class _TomlDate extends Date {
21658
21947
  #hasDate = false;
@@ -21745,6 +22034,33 @@ var TomlDate = class _TomlDate extends Date {
21745
22034
  };
21746
22035
 
21747
22036
  // ../../../node_modules/smol-toml/dist/error.js
22037
+ /*!
22038
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22039
+ * SPDX-License-Identifier: BSD-3-Clause
22040
+ *
22041
+ * Redistribution and use in source and binary forms, with or without
22042
+ * modification, are permitted provided that the following conditions are met:
22043
+ *
22044
+ * 1. Redistributions of source code must retain the above copyright notice, this
22045
+ * list of conditions and the following disclaimer.
22046
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22047
+ * this list of conditions and the following disclaimer in the
22048
+ * documentation and/or other materials provided with the distribution.
22049
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22050
+ * may be used to endorse or promote products derived from this software without
22051
+ * specific prior written permission.
22052
+ *
22053
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22054
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22055
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22056
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22057
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22058
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22059
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22060
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22061
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22062
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22063
+ */
21748
22064
  function getLineColFromPtr(string4, ptr) {
21749
22065
  let lines = string4.slice(0, ptr).split(/\r\n|\n|\r/g);
21750
22066
  return [lines.length, lines.pop().length + 1];
@@ -21785,6 +22101,33 @@ ${codeblock}`, options);
21785
22101
  };
21786
22102
 
21787
22103
  // ../../../node_modules/smol-toml/dist/util.js
22104
+ /*!
22105
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22106
+ * SPDX-License-Identifier: BSD-3-Clause
22107
+ *
22108
+ * Redistribution and use in source and binary forms, with or without
22109
+ * modification, are permitted provided that the following conditions are met:
22110
+ *
22111
+ * 1. Redistributions of source code must retain the above copyright notice, this
22112
+ * list of conditions and the following disclaimer.
22113
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22114
+ * this list of conditions and the following disclaimer in the
22115
+ * documentation and/or other materials provided with the distribution.
22116
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22117
+ * may be used to endorse or promote products derived from this software without
22118
+ * specific prior written permission.
22119
+ *
22120
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22121
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22122
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22123
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22124
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22125
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22126
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22127
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22128
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22129
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22130
+ */
21788
22131
  function indexOfNewline(str, start = 0) {
21789
22132
  let idx = str.indexOf("\n", start);
21790
22133
  if (str.charCodeAt(idx - 1) === 13)
@@ -21840,6 +22183,33 @@ function skipUntil(ctx, sep, end) {
21840
22183
  }
21841
22184
 
21842
22185
  // ../../../node_modules/smol-toml/dist/primitive.js
22186
+ /*!
22187
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22188
+ * SPDX-License-Identifier: BSD-3-Clause
22189
+ *
22190
+ * Redistribution and use in source and binary forms, with or without
22191
+ * modification, are permitted provided that the following conditions are met:
22192
+ *
22193
+ * 1. Redistributions of source code must retain the above copyright notice, this
22194
+ * list of conditions and the following disclaimer.
22195
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22196
+ * this list of conditions and the following disclaimer in the
22197
+ * documentation and/or other materials provided with the distribution.
22198
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22199
+ * may be used to endorse or promote products derived from this software without
22200
+ * specific prior written permission.
22201
+ *
22202
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22203
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22204
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22205
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22206
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22207
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22208
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22209
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22210
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22211
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22212
+ */
21843
22213
  var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
21844
22214
  var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
21845
22215
  var LEADING_ZERO = /^[+-]?0[0-9_]/;
@@ -21996,6 +22366,33 @@ function parseValue(ctx, integersAsBigInt, end) {
21996
22366
  }
21997
22367
 
21998
22368
  // ../../../node_modules/smol-toml/dist/extract.js
22369
+ /*!
22370
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22371
+ * SPDX-License-Identifier: BSD-3-Clause
22372
+ *
22373
+ * Redistribution and use in source and binary forms, with or without
22374
+ * modification, are permitted provided that the following conditions are met:
22375
+ *
22376
+ * 1. Redistributions of source code must retain the above copyright notice, this
22377
+ * list of conditions and the following disclaimer.
22378
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22379
+ * this list of conditions and the following disclaimer in the
22380
+ * documentation and/or other materials provided with the distribution.
22381
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22382
+ * may be used to endorse or promote products derived from this software without
22383
+ * specific prior written permission.
22384
+ *
22385
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22386
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22387
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22388
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22389
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22390
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22391
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22392
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22393
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22394
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22395
+ */
21999
22396
  function extractValue(ctx, end, integersAsBigInt) {
22000
22397
  let ptr = ctx.p;
22001
22398
  let c = ctx.s.charCodeAt(ptr);
@@ -22029,6 +22426,33 @@ function extractValue(ctx, end, integersAsBigInt) {
22029
22426
  }
22030
22427
 
22031
22428
  // ../../../node_modules/smol-toml/dist/struct.js
22429
+ /*!
22430
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22431
+ * SPDX-License-Identifier: BSD-3-Clause
22432
+ *
22433
+ * Redistribution and use in source and binary forms, with or without
22434
+ * modification, are permitted provided that the following conditions are met:
22435
+ *
22436
+ * 1. Redistributions of source code must retain the above copyright notice, this
22437
+ * list of conditions and the following disclaimer.
22438
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22439
+ * this list of conditions and the following disclaimer in the
22440
+ * documentation and/or other materials provided with the distribution.
22441
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22442
+ * may be used to endorse or promote products derived from this software without
22443
+ * specific prior written permission.
22444
+ *
22445
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22446
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22447
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22448
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22449
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22450
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22451
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22452
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22453
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22454
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22455
+ */
22032
22456
  var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
22033
22457
  function parseKey(ctx, end = "=") {
22034
22458
  let start = ctx.p;
@@ -22171,6 +22595,33 @@ function parseArray(ctx, integersAsBigInt) {
22171
22595
  }
22172
22596
 
22173
22597
  // ../../../node_modules/smol-toml/dist/parse.js
22598
+ /*!
22599
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22600
+ * SPDX-License-Identifier: BSD-3-Clause
22601
+ *
22602
+ * Redistribution and use in source and binary forms, with or without
22603
+ * modification, are permitted provided that the following conditions are met:
22604
+ *
22605
+ * 1. Redistributions of source code must retain the above copyright notice, this
22606
+ * list of conditions and the following disclaimer.
22607
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22608
+ * this list of conditions and the following disclaimer in the
22609
+ * documentation and/or other materials provided with the distribution.
22610
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22611
+ * may be used to endorse or promote products derived from this software without
22612
+ * specific prior written permission.
22613
+ *
22614
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22615
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22616
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22617
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22618
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22619
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22620
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22621
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22622
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22623
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22624
+ */
22174
22625
  function peekTable(key, table, meta3, type) {
22175
22626
  let t = table;
22176
22627
  let m = meta3;
@@ -22297,6 +22748,64 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
22297
22748
  return res;
22298
22749
  }
22299
22750
 
22751
+ // ../../../node_modules/smol-toml/dist/stringify.js
22752
+ /*!
22753
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22754
+ * SPDX-License-Identifier: BSD-3-Clause
22755
+ *
22756
+ * Redistribution and use in source and binary forms, with or without
22757
+ * modification, are permitted provided that the following conditions are met:
22758
+ *
22759
+ * 1. Redistributions of source code must retain the above copyright notice, this
22760
+ * list of conditions and the following disclaimer.
22761
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22762
+ * this list of conditions and the following disclaimer in the
22763
+ * documentation and/or other materials provided with the distribution.
22764
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22765
+ * may be used to endorse or promote products derived from this software without
22766
+ * specific prior written permission.
22767
+ *
22768
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22769
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22770
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22771
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22772
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22773
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22774
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22775
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22776
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22777
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22778
+ */
22779
+
22780
+ // ../../../node_modules/smol-toml/dist/index.js
22781
+ /*!
22782
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
22783
+ * SPDX-License-Identifier: BSD-3-Clause
22784
+ *
22785
+ * Redistribution and use in source and binary forms, with or without
22786
+ * modification, are permitted provided that the following conditions are met:
22787
+ *
22788
+ * 1. Redistributions of source code must retain the above copyright notice, this
22789
+ * list of conditions and the following disclaimer.
22790
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22791
+ * this list of conditions and the following disclaimer in the
22792
+ * documentation and/or other materials provided with the distribution.
22793
+ * 3. Neither the name of the copyright holder nor the names of its contributors
22794
+ * may be used to endorse or promote products derived from this software without
22795
+ * specific prior written permission.
22796
+ *
22797
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22798
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22799
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22800
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22801
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22802
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22803
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22804
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22805
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22806
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22807
+ */
22808
+
22300
22809
  // dist/models.js
22301
22810
  var KIMI_MODEL_PREFIX = "kimi.";
22302
22811
  function encodeKimiModelRef(alias) {
@@ -24143,7 +24652,7 @@ var KimiSession = class {
24143
24652
  }
24144
24653
  });
24145
24654
  };
24146
- const completeAgentMessage = (phase) => {
24655
+ const completeAgentMessage = (phase, outcome = { status: "succeeded" }) => {
24147
24656
  if (currentAgentMessage) {
24148
24657
  const resolvedPhase = phase ?? currentAgentMessage.phase;
24149
24658
  const item = {
@@ -24152,10 +24661,23 @@ var KimiSession = class {
24152
24661
  text: currentAgentMessage.text,
24153
24662
  ...resolvedPhase ? { phase: resolvedPhase } : {}
24154
24663
  };
24155
- completeItem({ item, outcome: { status: "succeeded" } });
24664
+ completeItem({ item, outcome });
24156
24665
  currentAgentMessage = null;
24157
24666
  }
24158
24667
  };
24668
+ const completeFinalMessage = (outcome) => {
24669
+ completeAgentMessage(outcome.status !== "succeeded" ? "commentary" : hasHadToolCallsInTurn ? "final_answer" : void 0, outcome);
24670
+ };
24671
+ const getActiveTool = (event) => {
24672
+ const existing = accumulator.get(event.toolCallId);
24673
+ if (existing) {
24674
+ return existing.status === "completed" || existing.status === "failed" ? void 0 : existing;
24675
+ }
24676
+ hasHadToolCallsInTurn = true;
24677
+ completeReasoning();
24678
+ completeAgentMessage("commentary");
24679
+ return accumulator.getOrCreate(event.toolCallId, turnId, event.name, event.kind);
24680
+ };
24159
24681
  const handler = {
24160
24682
  onEvent: (event) => {
24161
24683
  if (this.#closed || this.#faulted || this.#activeTurn?.turnId !== turnId)
@@ -24177,12 +24699,9 @@ var KimiSession = class {
24177
24699
  break;
24178
24700
  }
24179
24701
  case "tool.call": {
24180
- hasHadToolCallsInTurn = true;
24181
- completeReasoning();
24182
- if (currentAgentMessage) {
24183
- completeAgentMessage("commentary");
24184
- }
24185
- const state = accumulator.getOrCreate(event.toolCallId, turnId, event.name, event.kind);
24702
+ const state = getActiveTool(event);
24703
+ if (!state)
24704
+ break;
24186
24705
  state.name = canonicalizeKimiToolName(event.name, event.kind, event.args);
24187
24706
  if (event.kind)
24188
24707
  state.kind = event.kind;
@@ -24199,11 +24718,9 @@ var KimiSession = class {
24199
24718
  break;
24200
24719
  }
24201
24720
  case "tool.update": {
24202
- completeReasoning();
24203
- if (currentAgentMessage) {
24204
- completeAgentMessage("commentary");
24205
- }
24206
- const state = accumulator.getOrCreate(event.toolCallId, turnId, event.name, event.kind);
24721
+ const state = getActiveTool(event);
24722
+ if (!state)
24723
+ break;
24207
24724
  if (state.name === "Tool" && event.name) {
24208
24725
  state.name = canonicalizeKimiToolName(event.name, event.kind ?? state.kind, event.rawInput ?? state.rawInput);
24209
24726
  }
@@ -24359,13 +24876,13 @@ var KimiSession = class {
24359
24876
  completeReasoning();
24360
24877
  if (isCommandTurn)
24361
24878
  appendAgentText(formatKimiCommandOutput(commandOutput));
24362
- completeAgentMessage(hasHadToolCallsInTurn ? "final_answer" : void 0);
24363
24879
  let currentNativeTurn = null;
24364
24880
  if (isCommandTurn) {
24365
24881
  const outcome = promptError ? {
24366
24882
  status: "failed",
24367
24883
  error: { code: "nativeFailure", message: promptError.message, retryable: false }
24368
24884
  } : promptResponse?.stopReason === "cancelled" ? { status: "cancelled", reason: "Native command cancelled" } : { status: "succeeded" };
24885
+ completeFinalMessage(outcome);
24369
24886
  const commandTurn = {
24370
24887
  nativeTurnRef: createKimiNativeTurnRef(this.#sessionId, `command:${turnId}`),
24371
24888
  input: command.input,
@@ -24456,6 +24973,8 @@ var KimiSession = class {
24456
24973
  status: "succeeded"
24457
24974
  };
24458
24975
  }
24976
+ if (!isCommandTurn)
24977
+ completeFinalMessage(turnOutcome);
24459
24978
  const completedOutcome = currentNativeTurn?.checkpoint ? { ...turnOutcome, checkpoint: currentNativeTurn.checkpoint } : turnOutcome;
24460
24979
  return {
24461
24980
  kind: "event",