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

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.
@@ -15080,6 +15080,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
15080
15080
  initializeOnly: external_exports.boolean().optional()
15081
15081
  });
15082
15082
 
15083
+ // ../../shared-contracts/dist/harness-presentation.js
15084
+ var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
15085
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
15086
+ var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
15087
+ label: displayText(256).optional(),
15088
+ description: displayText(1024).optional()
15089
+ }).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
15090
+ var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
15091
+
15083
15092
  // ../../shared-contracts/dist/model-price-overrides.js
15084
15093
  var usdPerMillionTokens = external_exports.number().finite().nonnegative();
15085
15094
  var modelPriceOverrideSchema = external_exports.strictObject({
@@ -15500,8 +15509,24 @@ var threadUsageSnapshotSchema = external_exports.object({
15500
15509
  }
15501
15510
  });
15502
15511
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
15512
+ var accountCreditsPeriodSchema = external_exports.enum([
15513
+ "weekly",
15514
+ "monthly",
15515
+ "five_hour",
15516
+ "seven_day",
15517
+ "unknown"
15518
+ ]);
15519
+ var accountCreditsScopeSchema = external_exports.object({
15520
+ id: external_exports.string().min(1).max(256),
15521
+ label: external_exports.string().min(1).max(256),
15522
+ localizations: harnessLocalizationsSchema.optional()
15523
+ }).strict();
15503
15524
  var accountCreditsProductUsageSchema = external_exports.object({
15504
15525
  product: external_exports.string().min(1),
15526
+ /** Native period and scope, never inferred from the display name. */
15527
+ periodType: accountCreditsPeriodSchema.optional(),
15528
+ scope: accountCreditsScopeSchema.optional(),
15529
+ localizations: harnessLocalizationsSchema.optional(),
15505
15530
  used: external_exports.number().finite().nonnegative().optional(),
15506
15531
  // Zero is a real empty cap, not an absent field.
15507
15532
  limit: external_exports.number().finite().nonnegative().optional(),
@@ -15523,8 +15548,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
15523
15548
  label: external_exports.string().min(1).optional(),
15524
15549
  usedPercent: usagePercentSchema.optional(),
15525
15550
  remaining: external_exports.number().finite().optional(),
15551
+ scope: accountCreditsScopeSchema.optional(),
15552
+ localizations: harnessLocalizationsSchema.optional(),
15526
15553
  resetsAt: external_exports.string().min(1).optional(),
15527
- periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
15554
+ periodType: accountCreditsPeriodSchema,
15528
15555
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
15529
15556
  resetCredits: accountResetCreditsSchema.optional()
15530
15557
  }).strict().superRefine((credits, context) => {
@@ -15549,7 +15576,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
15549
15576
  var threadUsageInspectionSchema = external_exports.object({
15550
15577
  threadId: hostThreadIdSchema,
15551
15578
  usage: threadUsageSnapshotSchema.nullable(),
15552
- accountCredits: accountCreditsSnapshotSchema.optional()
15579
+ accountCredits: accountCreditsSnapshotSchema.optional(),
15580
+ /** Whether this source can provide cached account quota independently of usage. */
15581
+ accountCreditsSupported: external_exports.boolean().optional()
15553
15582
  }).strict();
15554
15583
 
15555
15584
  // ../../shared-contracts/dist/harness-accounts.js
@@ -15676,7 +15705,8 @@ var harnessPermissionModeSchema = external_exports.object({
15676
15705
  id: harnessPermissionModeIdSchema,
15677
15706
  label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
15678
15707
  description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
15679
- dangerous: external_exports.boolean().optional()
15708
+ dangerous: external_exports.boolean().optional(),
15709
+ localizations: harnessLocalizationsSchema.optional()
15680
15710
  }).strict();
15681
15711
  var harnessPermissionModeCatalogSchema = external_exports.object({
15682
15712
  modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
@@ -15999,6 +16029,8 @@ var harnessInstallationStateSchema = external_exports.object({
15999
16029
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
16000
16030
  message: external_exports.string().max(2048).optional(),
16001
16031
  messageCode: external_exports.string().min(1).max(128).optional(),
16032
+ /** Safe plugin-owned explanation, distinct from raw diagnostic message. */
16033
+ notice: harnessLocalizedTextSchema.optional(),
16002
16034
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
16003
16035
  }).strict();
16004
16036
 
@@ -16137,6 +16169,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
16137
16169
  invocation: commandInvocationSchema,
16138
16170
  label: commandLabelSchema,
16139
16171
  description: commandDescriptionSchema.optional(),
16172
+ localizations: harnessLocalizationsSchema.optional(),
16140
16173
  argumentMode: external_exports.enum(["none", "text"]),
16141
16174
  /**
16142
16175
  * Native distinction reported by the Harness. Omitted when the Harness does
@@ -16817,6 +16850,27 @@ function nativeError(error51, profile = CODEBUDDY_RUNTIME_PROFILE) {
16817
16850
  function failure(code, message, profile = CODEBUDDY_RUNTIME_PROFILE) {
16818
16851
  return { ok: false, error: nativeError(new CodeBuddyError(code, message), profile) };
16819
16852
  }
16853
+ function nativeTurnError(stopReason, meta3, profile) {
16854
+ const fallback = `Native Turn stopped: ${text(stopReason) || "unknown"} (${text(meta3["codebuddy.ai/outcome"]) || "no native outcome"})`;
16855
+ const raw = text(meta3["codebuddy.ai/errorMessage"]).trim();
16856
+ let diagnostic = "";
16857
+ let category;
16858
+ if (raw) {
16859
+ try {
16860
+ const error51 = record2(JSON.parse(raw));
16861
+ const data = record2(error51.data);
16862
+ diagnostic = text(data.details).trim() || text(error51.message).trim();
16863
+ category = data.category;
16864
+ } catch {
16865
+ diagnostic = raw;
16866
+ }
16867
+ }
16868
+ return nativeError(new CodeBuddyError(
16869
+ // -32000 is shared by native refusals; the category identifies authentication failures.
16870
+ category === "auth" ? "authenticationRequired" : "nativeFailure",
16871
+ diagnostic ? `${fallback}: ${diagnostic}` : fallback
16872
+ ), profile);
16873
+ }
16820
16874
  async function bounded(operation, milliseconds, label, onTimeout) {
16821
16875
  let timer;
16822
16876
  try {
@@ -16922,6 +16976,11 @@ function commandCatalog(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
16922
16976
  id: `${profile.harnessId}.${name}`,
16923
16977
  invocation: `/${name}`,
16924
16978
  label: name,
16979
+ ...name === "compact" && !skill ? {
16980
+ localizations: {
16981
+ "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" }
16982
+ }
16983
+ } : {},
16925
16984
  ...text(entry.description).trim() ? { description: text(entry.description).trim().slice(0, 512) } : {},
16926
16985
  argumentMode: name === "compact" || record2(entry.input).hint || record2(entry._meta).type === "skill" ? "text" : "none",
16927
16986
  ...record2(entry._meta).type === "skill" ? { kind: "skill" } : {}
@@ -17071,6 +17130,40 @@ import { homedir as homedir2 } from "node:os";
17071
17130
  import path6 from "node:path";
17072
17131
  import { isDeepStrictEqual } from "node:util";
17073
17132
 
17133
+ // dist/permission-presentation.js
17134
+ var labels = {
17135
+ "Always Ask": "始终询问",
17136
+ "Accept Edits": "接受编辑",
17137
+ Plan: "规划模式",
17138
+ Auto: "自动",
17139
+ "Auto mode": "自动模式",
17140
+ "Don't Ask": "不询问",
17141
+ "Bypass Permissions": "绕过权限",
17142
+ "Full Access": "完全访问",
17143
+ Delegate: "由父会话管理",
17144
+ Default: "默认"
17145
+ };
17146
+ var descriptions = {
17147
+ "Prompts for permission on first use of each tool": "首次使用每种工具时请求权限。",
17148
+ "Automatically accepts file edit permissions for the session": "自动接受本会话中的文件编辑权限。",
17149
+ "Agent can analyze but not modify files or execute commands": "Agent 可以分析,但不能修改文件或执行命令。",
17150
+ "An AI classifier reviews actions that would normally prompt: safe ones are auto-approved, risky ones are denied. If the classifier is unavailable, the action falls back to a prompt (or is denied when prompts cannot be shown)": "由 AI 分类器评估原本需要询问的操作:安全操作自动批准,风险操作拒绝。分类器不可用时改为询问;无法显示询问时拒绝。",
17151
+ "Does not show permission prompts; pre-approved and safe read-only actions run, everything else that would prompt is denied": "不显示权限询问;已获批准和安全的只读操作可以执行,其余原本需要询问的操作会被拒绝。",
17152
+ "Skips all permission prompts": "跳过常规权限询问。",
17153
+ "Skips ALL permission checks including dangerous commands for all agents": "为所有 Agent 跳过全部权限检查,包括危险命令。",
17154
+ "Permissions managed by parent session": "由父会话管理权限。"
17155
+ };
17156
+ function permissionLocalizations(label, description) {
17157
+ const localizedLabel = Object.hasOwn(labels, label) ? labels[label] : void 0;
17158
+ const localizedDescription = Object.hasOwn(descriptions, description) ? descriptions[description] : void 0;
17159
+ return {
17160
+ "zh-CN": {
17161
+ ...localizedLabel ? { label: localizedLabel } : {},
17162
+ ...localizedDescription ? { description: localizedDescription } : {}
17163
+ }
17164
+ };
17165
+ }
17166
+
17074
17167
  // dist/configuration.js
17075
17168
  var CODEBUDDY_CAPABILITIES = {
17076
17169
  configuration: {
@@ -17128,6 +17221,7 @@ function configuration(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
17128
17221
  modes: rows(mode.options).map((option) => ({
17129
17222
  id: option.value,
17130
17223
  label: option.name,
17224
+ localizations: permissionLocalizations(text(option.name), text(option.description)),
17131
17225
  ...option.description ? { description: option.description } : {},
17132
17226
  ...["bypassPermissions", "fullAccess"].includes(text(option.value)) ? { dangerous: true } : {}
17133
17227
  })),
@@ -24809,7 +24903,7 @@ var CodeBuddySession = class {
24809
24903
  // Those remain visible on individual Items; they do not fail the completed Turn.
24810
24904
  (!meta3["codebuddy.ai/outcome"] || meta3["codebuddy.ai/outcome"] === "SUCCESS" || meta3["codebuddy.ai/outcome"] === "PARTIAL_SUCCESS") ? { status: "succeeded" } : {
24811
24905
  status: "failed",
24812
- error: nativeError(new CodeBuddyError("nativeFailure", `Native Turn stopped: ${text(stop) || "unknown"} (${text(meta3["codebuddy.ai/outcome"]) || "no native outcome"})`), this.profile)
24906
+ error: nativeTurnError(stop, meta3, this.profile)
24813
24907
  };
24814
24908
  const snapshot = await this.#snapshot();
24815
24909
  const added = snapshot.turns.filter((turn) => !active.before.has(turn.nativeTurnRef.nativeTurnKey));
@@ -25117,6 +25211,10 @@ function createCodeBuddyInstallation(environment) {
25117
25211
  canUpdate,
25118
25212
  ...!canUpdate ? {
25119
25213
  messageCode: "codebuddy-npm-required",
25214
+ notice: {
25215
+ en: "Use CodeBuddy's native updater or original package manager. Latest-version checks here require an identified npm installation.",
25216
+ "zh-CN": "请使用 CodeBuddy 原生更新器或原包管理器更新。此处仅能查询已识别的 npm 安装的最新版本。"
25217
+ },
25120
25218
  message: "Use CodeBuddy's native updater or original package manager for this installation. Latest-version checks here require an identified npm installation."
25121
25219
  } : {}
25122
25220
  };
@@ -26039,6 +26137,8 @@ var BrokeredHarnessAdapter = class {
26039
26137
  commandCatalog;
26040
26138
  liveCommandCatalog;
26041
26139
  harnessId;
26140
+ credits;
26141
+ refreshCredits;
26042
26142
  #descriptorPath;
26043
26143
  #forwardEnvironment;
26044
26144
  #isInstalled;
@@ -26138,6 +26238,10 @@ var BrokeredHarnessAdapter = class {
26138
26238
  }
26139
26239
  constructor(input = {}) {
26140
26240
  this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
26241
+ if (input.accountCredits !== false) {
26242
+ this.credits = () => this.#credits;
26243
+ this.refreshCredits = () => this.#refreshAccountCredits();
26244
+ }
26141
26245
  this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
26142
26246
  if (input.commandCatalog)
26143
26247
  this.commandCatalog = input.commandCatalog;
@@ -26149,10 +26253,7 @@ var BrokeredHarnessAdapter = class {
26149
26253
  this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
26150
26254
  this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
26151
26255
  }
26152
- credits() {
26153
- return this.#credits;
26154
- }
26155
- refreshCredits() {
26256
+ #refreshAccountCredits() {
26156
26257
  if (this.#closed)
26157
26258
  return Promise.resolve(null);
26158
26259
  if (this.#creditsRefresh)
@@ -26324,6 +26425,7 @@ function createHarnessAdapter(context) {
26324
26425
  if (context.platform === "darwin" && context.managedRemoteHost) {
26325
26426
  const environment2 = { ...context.environment };
26326
26427
  return new BrokeredHarnessAdapter({
26428
+ accountCredits: false,
26327
26429
  harnessId: "codebuddy",
26328
26430
  forwardDelegationEnvironment: true,
26329
26431
  commandCatalog: CODEBUDDY_COMMAND_CATALOG,
@@ -14598,6 +14598,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
14598
14598
  initializeOnly: external_exports.boolean().optional()
14599
14599
  });
14600
14600
 
14601
+ // ../../shared-contracts/dist/harness-presentation.js
14602
+ var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
14603
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
14604
+ var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
14605
+ label: displayText(256).optional(),
14606
+ description: displayText(1024).optional()
14607
+ }).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
14608
+ var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
14609
+
14601
14610
  // ../../shared-contracts/dist/model-price-overrides.js
14602
14611
  var usdPerMillionTokens = external_exports.number().finite().nonnegative();
14603
14612
  var modelPriceOverrideSchema = external_exports.strictObject({
@@ -15018,8 +15027,24 @@ var threadUsageSnapshotSchema = external_exports.object({
15018
15027
  }
15019
15028
  });
15020
15029
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
15030
+ var accountCreditsPeriodSchema = external_exports.enum([
15031
+ "weekly",
15032
+ "monthly",
15033
+ "five_hour",
15034
+ "seven_day",
15035
+ "unknown"
15036
+ ]);
15037
+ var accountCreditsScopeSchema = external_exports.object({
15038
+ id: external_exports.string().min(1).max(256),
15039
+ label: external_exports.string().min(1).max(256),
15040
+ localizations: harnessLocalizationsSchema.optional()
15041
+ }).strict();
15021
15042
  var accountCreditsProductUsageSchema = external_exports.object({
15022
15043
  product: external_exports.string().min(1),
15044
+ /** Native period and scope, never inferred from the display name. */
15045
+ periodType: accountCreditsPeriodSchema.optional(),
15046
+ scope: accountCreditsScopeSchema.optional(),
15047
+ localizations: harnessLocalizationsSchema.optional(),
15023
15048
  used: external_exports.number().finite().nonnegative().optional(),
15024
15049
  // Zero is a real empty cap, not an absent field.
15025
15050
  limit: external_exports.number().finite().nonnegative().optional(),
@@ -15041,8 +15066,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
15041
15066
  label: external_exports.string().min(1).optional(),
15042
15067
  usedPercent: usagePercentSchema.optional(),
15043
15068
  remaining: external_exports.number().finite().optional(),
15069
+ scope: accountCreditsScopeSchema.optional(),
15070
+ localizations: harnessLocalizationsSchema.optional(),
15044
15071
  resetsAt: external_exports.string().min(1).optional(),
15045
- periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
15072
+ periodType: accountCreditsPeriodSchema,
15046
15073
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
15047
15074
  resetCredits: accountResetCreditsSchema.optional()
15048
15075
  }).strict().superRefine((credits, context) => {
@@ -15067,7 +15094,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
15067
15094
  var threadUsageInspectionSchema = external_exports.object({
15068
15095
  threadId: hostThreadIdSchema,
15069
15096
  usage: threadUsageSnapshotSchema.nullable(),
15070
- accountCredits: accountCreditsSnapshotSchema.optional()
15097
+ accountCredits: accountCreditsSnapshotSchema.optional(),
15098
+ /** Whether this source can provide cached account quota independently of usage. */
15099
+ accountCreditsSupported: external_exports.boolean().optional()
15071
15100
  }).strict();
15072
15101
 
15073
15102
  // ../../shared-contracts/dist/harness-accounts.js
@@ -15194,7 +15223,8 @@ var harnessPermissionModeSchema = external_exports.object({
15194
15223
  id: harnessPermissionModeIdSchema,
15195
15224
  label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
15196
15225
  description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
15197
- dangerous: external_exports.boolean().optional()
15226
+ dangerous: external_exports.boolean().optional(),
15227
+ localizations: harnessLocalizationsSchema.optional()
15198
15228
  }).strict();
15199
15229
  var harnessPermissionModeCatalogSchema = external_exports.object({
15200
15230
  modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
@@ -15517,6 +15547,8 @@ var harnessInstallationStateSchema = external_exports.object({
15517
15547
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
15518
15548
  message: external_exports.string().max(2048).optional(),
15519
15549
  messageCode: external_exports.string().min(1).max(128).optional(),
15550
+ /** Safe plugin-owned explanation, distinct from raw diagnostic message. */
15551
+ notice: harnessLocalizedTextSchema.optional(),
15520
15552
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
15521
15553
  }).strict();
15522
15554
 
@@ -15655,6 +15687,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
15655
15687
  invocation: commandInvocationSchema,
15656
15688
  label: commandLabelSchema,
15657
15689
  description: commandDescriptionSchema.optional(),
15690
+ localizations: harnessLocalizationsSchema.optional(),
15658
15691
  argumentMode: external_exports.enum(["none", "text"]),
15659
15692
  /**
15660
15693
  * Native distinction reported by the Harness. Omitted when the Harness does
@@ -27659,6 +27659,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
27659
27659
  initializeOnly: external_exports.boolean().optional()
27660
27660
  });
27661
27661
 
27662
+ // ../../shared-contracts/dist/harness-presentation.js
27663
+ var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
27664
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
27665
+ var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
27666
+ label: displayText(256).optional(),
27667
+ description: displayText(1024).optional()
27668
+ }).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
27669
+ var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
27670
+
27662
27671
  // ../../shared-contracts/dist/model-price-overrides.js
27663
27672
  var usdPerMillionTokens = external_exports.number().finite().nonnegative();
27664
27673
  var modelPriceOverrideSchema = external_exports.strictObject({
@@ -28079,8 +28088,24 @@ var threadUsageSnapshotSchema = external_exports.object({
28079
28088
  }
28080
28089
  });
28081
28090
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
28091
+ var accountCreditsPeriodSchema = external_exports.enum([
28092
+ "weekly",
28093
+ "monthly",
28094
+ "five_hour",
28095
+ "seven_day",
28096
+ "unknown"
28097
+ ]);
28098
+ var accountCreditsScopeSchema = external_exports.object({
28099
+ id: external_exports.string().min(1).max(256),
28100
+ label: external_exports.string().min(1).max(256),
28101
+ localizations: harnessLocalizationsSchema.optional()
28102
+ }).strict();
28082
28103
  var accountCreditsProductUsageSchema = external_exports.object({
28083
28104
  product: external_exports.string().min(1),
28105
+ /** Native period and scope, never inferred from the display name. */
28106
+ periodType: accountCreditsPeriodSchema.optional(),
28107
+ scope: accountCreditsScopeSchema.optional(),
28108
+ localizations: harnessLocalizationsSchema.optional(),
28084
28109
  used: external_exports.number().finite().nonnegative().optional(),
28085
28110
  // Zero is a real empty cap, not an absent field.
28086
28111
  limit: external_exports.number().finite().nonnegative().optional(),
@@ -28102,8 +28127,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
28102
28127
  label: external_exports.string().min(1).optional(),
28103
28128
  usedPercent: usagePercentSchema.optional(),
28104
28129
  remaining: external_exports.number().finite().optional(),
28130
+ scope: accountCreditsScopeSchema.optional(),
28131
+ localizations: harnessLocalizationsSchema.optional(),
28105
28132
  resetsAt: external_exports.string().min(1).optional(),
28106
- periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
28133
+ periodType: accountCreditsPeriodSchema,
28107
28134
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
28108
28135
  resetCredits: accountResetCreditsSchema.optional()
28109
28136
  }).strict().superRefine((credits, context) => {
@@ -28128,7 +28155,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
28128
28155
  var threadUsageInspectionSchema = external_exports.object({
28129
28156
  threadId: hostThreadIdSchema,
28130
28157
  usage: threadUsageSnapshotSchema.nullable(),
28131
- accountCredits: accountCreditsSnapshotSchema.optional()
28158
+ accountCredits: accountCreditsSnapshotSchema.optional(),
28159
+ /** Whether this source can provide cached account quota independently of usage. */
28160
+ accountCreditsSupported: external_exports.boolean().optional()
28132
28161
  }).strict();
28133
28162
 
28134
28163
  // ../../shared-contracts/dist/harness-accounts.js
@@ -28255,7 +28284,8 @@ var harnessPermissionModeSchema = external_exports.object({
28255
28284
  id: harnessPermissionModeIdSchema,
28256
28285
  label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
28257
28286
  description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
28258
- dangerous: external_exports.boolean().optional()
28287
+ dangerous: external_exports.boolean().optional(),
28288
+ localizations: harnessLocalizationsSchema.optional()
28259
28289
  }).strict();
28260
28290
  var harnessPermissionModeCatalogSchema = external_exports.object({
28261
28291
  modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
@@ -28578,6 +28608,8 @@ var harnessInstallationStateSchema = external_exports.object({
28578
28608
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
28579
28609
  message: external_exports.string().max(2048).optional(),
28580
28610
  messageCode: external_exports.string().min(1).max(128).optional(),
28611
+ /** Safe plugin-owned explanation, distinct from raw diagnostic message. */
28612
+ notice: harnessLocalizedTextSchema.optional(),
28581
28613
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
28582
28614
  }).strict();
28583
28615
 
@@ -28716,6 +28748,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
28716
28748
  invocation: commandInvocationSchema,
28717
28749
  label: commandLabelSchema,
28718
28750
  description: commandDescriptionSchema.optional(),
28751
+ localizations: harnessLocalizationsSchema.optional(),
28719
28752
  argumentMode: external_exports.enum(["none", "text"]),
28720
28753
  /**
28721
28754
  * Native distinction reported by the Harness. Omitted when the Harness does
@@ -29470,12 +29503,15 @@ function projectCursorAccountUsage(usage, identity, plan) {
29470
29503
  credits: {
29471
29504
  usedPercent,
29472
29505
  label: "Auto · monthly",
29506
+ scope: { id: "auto", label: "Auto" },
29473
29507
  periodType: "monthly",
29474
29508
  ...resetsAt ? { resetsAt } : {},
29475
29509
  ...apiPercent === void 0 ? {} : {
29476
29510
  productUsage: [
29477
29511
  {
29478
29512
  product: "API · monthly",
29513
+ periodType: "monthly",
29514
+ scope: { id: "api", label: "API" },
29479
29515
  usagePercent: apiPercent,
29480
29516
  ...resetsAt ? { resetsAt } : {}
29481
29517
  }
@@ -29964,9 +30000,30 @@ var CURSOR_CAPABILITIES = {
29964
30000
  var CURSOR_MODES = harnessPermissionModeCatalogSchema.parse({
29965
30001
  defaultModeId: "agent",
29966
30002
  modes: [
29967
- { id: "agent", label: "Agent", description: "Native agent mode with Cursor tool approvals" },
29968
- { id: "plan", label: "Plan", description: "Native read-only planning mode" },
29969
- { id: "ask", label: "Ask", description: "Native read-only question mode" }
30003
+ {
30004
+ id: "agent",
30005
+ label: "Agent",
30006
+ description: "Native agent mode with Cursor tool approvals",
30007
+ localizations: {
30008
+ "zh-CN": { description: "执行任务,可修改文件和运行命令;需要审批的操作仍会请求确认。" }
30009
+ }
30010
+ },
30011
+ {
30012
+ id: "plan",
30013
+ label: "Plan",
30014
+ description: "Native read-only planning mode",
30015
+ localizations: {
30016
+ "zh-CN": { label: "规划模式", description: "只读分析代码并制定实施计划,不修改项目文件。" }
30017
+ }
30018
+ },
30019
+ {
30020
+ id: "ask",
30021
+ label: "Ask",
30022
+ description: "Native read-only question mode",
30023
+ localizations: {
30024
+ "zh-CN": { label: "询问", description: "只读查看代码并回答问题,不修改项目文件。" }
30025
+ }
30026
+ }
29970
30027
  ]
29971
30028
  });
29972
30029
  var cursorModelRef = (nativeId) => harnessModelRefSchema.parse({ id: `cursor.${Buffer.from(nativeId).toString("base64url")}` });
@@ -48849,6 +48906,8 @@ var BrokeredHarnessAdapter = class {
48849
48906
  commandCatalog;
48850
48907
  liveCommandCatalog;
48851
48908
  harnessId;
48909
+ credits;
48910
+ refreshCredits;
48852
48911
  #descriptorPath;
48853
48912
  #forwardEnvironment;
48854
48913
  #isInstalled;
@@ -48948,6 +49007,10 @@ var BrokeredHarnessAdapter = class {
48948
49007
  }
48949
49008
  constructor(input = {}) {
48950
49009
  this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
49010
+ if (input.accountCredits !== false) {
49011
+ this.credits = () => this.#credits;
49012
+ this.refreshCredits = () => this.#refreshAccountCredits();
49013
+ }
48951
49014
  this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
48952
49015
  if (input.commandCatalog)
48953
49016
  this.commandCatalog = input.commandCatalog;
@@ -48959,10 +49022,7 @@ var BrokeredHarnessAdapter = class {
48959
49022
  this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
48960
49023
  this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
48961
49024
  }
48962
- credits() {
48963
- return this.#credits;
48964
- }
48965
- refreshCredits() {
49025
+ #refreshAccountCredits() {
48966
49026
  if (this.#closed)
48967
49027
  return Promise.resolve(null);
48968
49028
  if (this.#creditsRefresh)
@@ -49134,6 +49194,7 @@ function createHarnessAdapter(context) {
49134
49194
  if (context.platform === "darwin" && context.managedRemoteHost) {
49135
49195
  const environment2 = { ...context.environment };
49136
49196
  return new BrokeredHarnessAdapter({
49197
+ accountCredits: false,
49137
49198
  harnessId: "cursor-cli",
49138
49199
  forwardDelegationEnvironment: true,
49139
49200
  commandCatalog: CURSOR_COMMAND_CATALOG,
@@ -31,8 +31,8 @@
31
31
  }
32
32
  },
33
33
  "notice": {
34
- "en": "Requires DSH 0.1.7-rc.1 or later and the V4 protocol. Verified with 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1 and 0.2.0-rc.2; other versions require native protocol validation.",
35
- "zh-CN": "需要 DSH 0.1.7-rc.1 或更高版本及 V4 协议。已验证 0.1.7-rc.1、0.1.7-rc.2、0.2.0-rc.1 和 0.2.0-rc.2;其他版本仍需通过原生协议校验。"
34
+ "en": "Requires DSH 0.1.7-rc.1 or later and the V4 protocol. Verified with 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1, 0.2.0-rc.2, 0.2.1-rc.1 and 0.2.1-rc.2; other versions require native protocol validation.",
35
+ "zh-CN": "需要 DSH 0.1.7-rc.1 或更高版本及 V4 协议。已验证 0.1.7-rc.1、0.1.7-rc.2、0.2.0-rc.1、0.2.0-rc.2、0.2.1-rc.1 和 0.2.1-rc.2;其他版本仍需通过原生协议校验。"
36
36
  },
37
37
  "links": {
38
38
  "website": "https://github.com/deepseek-ai/deepseek-harness",