@liberseek/boft-cli-win32-arm64 0.8.0 → 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.
@@ -27590,6 +27590,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
27590
27590
  initializeOnly: external_exports.boolean().optional()
27591
27591
  });
27592
27592
 
27593
+ // ../../shared-contracts/dist/harness-presentation.js
27594
+ var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
27595
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
27596
+ var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
27597
+ label: displayText(256).optional(),
27598
+ description: displayText(1024).optional()
27599
+ }).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
27600
+ 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");
27601
+
27593
27602
  // ../../shared-contracts/dist/model-price-overrides.js
27594
27603
  var usdPerMillionTokens = external_exports.number().finite().nonnegative();
27595
27604
  var modelPriceOverrideSchema = external_exports.strictObject({
@@ -27668,6 +27677,8 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
27668
27677
  harness,
27669
27678
  sessionId: external_exports.string().min(1).max(512),
27670
27679
  project: project.nullable(),
27680
+ /** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
27681
+ title: external_exports.string().min(1).max(200).optional(),
27671
27682
  /** Models the session used, most requests first. */
27672
27683
  models: external_exports.array(model).max(16),
27673
27684
  firstAtMs: count,
@@ -27734,7 +27745,12 @@ var usageStatisticsResultSchema = external_exports.strictObject({
27734
27745
  * The sessions that spent the most, by cost and by tokens without cache, all filters applied;
27735
27746
  * requests without a native session are not listed here but count everywhere else.
27736
27747
  */
27737
- sessions: external_exports.array(usageStatisticsSessionSchema).max(100)
27748
+ sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
27749
+ /**
27750
+ * The sessions last active in the range, newest first, all filters applied. Optional for older
27751
+ * Hosts; missing is treated as no list rather than no sessions.
27752
+ */
27753
+ recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
27738
27754
  });
27739
27755
 
27740
27756
  // ../../shared-contracts/dist/ids.js
@@ -28003,8 +28019,24 @@ var threadUsageSnapshotSchema = external_exports.object({
28003
28019
  }
28004
28020
  });
28005
28021
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
28022
+ var accountCreditsPeriodSchema = external_exports.enum([
28023
+ "weekly",
28024
+ "monthly",
28025
+ "five_hour",
28026
+ "seven_day",
28027
+ "unknown"
28028
+ ]);
28029
+ var accountCreditsScopeSchema = external_exports.object({
28030
+ id: external_exports.string().min(1).max(256),
28031
+ label: external_exports.string().min(1).max(256),
28032
+ localizations: harnessLocalizationsSchema.optional()
28033
+ }).strict();
28006
28034
  var accountCreditsProductUsageSchema = external_exports.object({
28007
28035
  product: external_exports.string().min(1),
28036
+ /** Native period and scope, never inferred from the display name. */
28037
+ periodType: accountCreditsPeriodSchema.optional(),
28038
+ scope: accountCreditsScopeSchema.optional(),
28039
+ localizations: harnessLocalizationsSchema.optional(),
28008
28040
  used: external_exports.number().finite().nonnegative().optional(),
28009
28041
  // Zero is a real empty cap, not an absent field.
28010
28042
  limit: external_exports.number().finite().nonnegative().optional(),
@@ -28026,8 +28058,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
28026
28058
  label: external_exports.string().min(1).optional(),
28027
28059
  usedPercent: usagePercentSchema.optional(),
28028
28060
  remaining: external_exports.number().finite().optional(),
28061
+ scope: accountCreditsScopeSchema.optional(),
28062
+ localizations: harnessLocalizationsSchema.optional(),
28029
28063
  resetsAt: external_exports.string().min(1).optional(),
28030
- periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
28064
+ periodType: accountCreditsPeriodSchema,
28031
28065
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
28032
28066
  resetCredits: accountResetCreditsSchema.optional()
28033
28067
  }).strict().superRefine((credits, context) => {
@@ -28052,7 +28086,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
28052
28086
  var threadUsageInspectionSchema = external_exports.object({
28053
28087
  threadId: hostThreadIdSchema,
28054
28088
  usage: threadUsageSnapshotSchema.nullable(),
28055
- accountCredits: accountCreditsSnapshotSchema.optional()
28089
+ accountCredits: accountCreditsSnapshotSchema.optional(),
28090
+ /** Whether this source can provide cached account quota independently of usage. */
28091
+ accountCreditsSupported: external_exports.boolean().optional()
28056
28092
  }).strict();
28057
28093
 
28058
28094
  // ../../shared-contracts/dist/harness-accounts.js
@@ -28179,7 +28215,8 @@ var harnessPermissionModeSchema = external_exports.object({
28179
28215
  id: harnessPermissionModeIdSchema,
28180
28216
  label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
28181
28217
  description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
28182
- dangerous: external_exports.boolean().optional()
28218
+ dangerous: external_exports.boolean().optional(),
28219
+ localizations: harnessLocalizationsSchema.optional()
28183
28220
  }).strict();
28184
28221
  var harnessPermissionModeCatalogSchema = external_exports.object({
28185
28222
  modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
@@ -28502,6 +28539,8 @@ var harnessInstallationStateSchema = external_exports.object({
28502
28539
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
28503
28540
  message: external_exports.string().max(2048).optional(),
28504
28541
  messageCode: external_exports.string().min(1).max(128).optional(),
28542
+ /** Safe plugin-owned explanation, distinct from raw diagnostic message. */
28543
+ notice: harnessLocalizedTextSchema.optional(),
28505
28544
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
28506
28545
  }).strict();
28507
28546
 
@@ -28640,6 +28679,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
28640
28679
  invocation: commandInvocationSchema,
28641
28680
  label: commandLabelSchema,
28642
28681
  description: commandDescriptionSchema.optional(),
28682
+ localizations: harnessLocalizationsSchema.optional(),
28643
28683
  argumentMode: external_exports.enum(["none", "text"]),
28644
28684
  /**
28645
28685
  * Native distinction reported by the Harness. Omitted when the Harness does
@@ -29497,6 +29537,7 @@ var QODER_FALLBACK_COMMAND_CATALOG = harnessCommandCatalogSchema.parse({
29497
29537
  {
29498
29538
  id: "qoder.compact",
29499
29539
  invocation: "/compact",
29540
+ localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } },
29500
29541
  label: "Compact",
29501
29542
  description: "Compresses the context by replacing it with a summary",
29502
29543
  argumentMode: "text"
@@ -30088,26 +30129,35 @@ var QODER_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
30088
30129
  {
30089
30130
  id: "default",
30090
30131
  label: "Default",
30132
+ localizations: { "zh-CN": { label: "默认", description: "执行受保护的工具操作前询问。" } },
30091
30133
  description: "Ask before protected tool actions."
30092
30134
  },
30093
30135
  {
30094
30136
  id: "acceptEdits",
30095
30137
  label: "Accept Edits",
30138
+ localizations: { "zh-CN": { label: "接受编辑", description: "自动接受文件变更。" } },
30096
30139
  description: "Automatically accept file changes."
30097
30140
  },
30098
30141
  {
30099
30142
  id: "auto",
30100
30143
  label: "Auto",
30144
+ localizations: { "zh-CN": { label: "自动", description: "自动允许安全的工具操作。" } },
30101
30145
  description: "Automatically allow safe tool actions."
30102
30146
  },
30103
30147
  {
30104
30148
  id: "plan",
30105
30149
  label: "Plan",
30150
+ localizations: {
30151
+ "zh-CN": { label: "规划模式", description: "仅执行只读操作的规划模式。" }
30152
+ },
30106
30153
  description: "Plan mode with read-only operations."
30107
30154
  },
30108
30155
  {
30109
30156
  id: "bypassPermissions",
30110
30157
  label: "Bypass Permissions",
30158
+ localizations: {
30159
+ "zh-CN": { label: "绕过权限", description: "无需提示即可批准所有工具操作。" }
30160
+ },
30111
30161
  description: "Approve all tool actions without prompting.",
30112
30162
  dangerous: true
30113
30163
  }
@@ -52974,6 +53024,20 @@ import path6 from "node:path";
52974
53024
  import { createInterface } from "node:readline";
52975
53025
  var MAX_SESSION_ID_LENGTH = 512;
52976
53026
  var MAX_CWD_LENGTH = 4096;
53027
+ var MAX_SESSION_TITLE_LENGTH = 200;
53028
+ function usageSessionTitle(value) {
53029
+ if (typeof value !== "string")
53030
+ return void 0;
53031
+ const normalized = value.replaceAll("\0", "").replaceAll(/\s+/gu, " ").trim();
53032
+ if (!normalized)
53033
+ return void 0;
53034
+ if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
53035
+ return normalized;
53036
+ const characters = [...normalized];
53037
+ if (characters.length <= MAX_SESSION_TITLE_LENGTH)
53038
+ return normalized;
53039
+ return `${characters.slice(0, MAX_SESSION_TITLE_LENGTH - 1).join("").trimEnd()}…`;
53040
+ }
52977
53041
  function sessionIdOk(value) {
52978
53042
  return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
52979
53043
  }
@@ -52983,12 +53047,14 @@ function cwdOk(value) {
52983
53047
  function withUsageSession(entry, session) {
52984
53048
  const sessionId = sessionIdOk(session.sessionId) ? session.sessionId : void 0;
52985
53049
  const cwd = cwdOk(session.cwd) ? session.cwd : void 0;
53050
+ const sessionTitle = sessionId !== void 0 ? usageSessionTitle(session.title) : void 0;
52986
53051
  if (sessionId === void 0 && cwd === void 0)
52987
53052
  return entry;
52988
53053
  return {
52989
53054
  ...entry,
52990
53055
  ...sessionId !== void 0 ? { sessionId } : {},
52991
- ...cwd !== void 0 ? { cwd } : {}
53056
+ ...cwd !== void 0 ? { cwd } : {},
53057
+ ...sessionTitle !== void 0 ? { sessionTitle } : {}
52992
53058
  };
52993
53059
  }
52994
53060
  function tokenCount(value) {
@@ -53028,6 +53094,12 @@ function parseHarnessUsageEntry(value) {
53028
53094
  return null;
53029
53095
  if (entry.cwd !== void 0 && !cwdOk(entry.cwd))
53030
53096
  return null;
53097
+ if (entry.sessionTitle !== void 0) {
53098
+ const sessionTitle = usageSessionTitle(entry.sessionTitle);
53099
+ if (sessionTitle === void 0)
53100
+ return null;
53101
+ entry.sessionTitle = sessionTitle;
53102
+ }
53031
53103
  if (entry.tokensUnknown !== void 0 && entry.tokensUnknown !== true)
53032
53104
  return null;
53033
53105
  if (entry.costUsd !== void 0 && (typeof entry.costUsd !== "number" || !Number.isFinite(entry.costUsd) || entry.costUsd < 0)) {
@@ -53139,6 +53211,16 @@ function qoderProjectsDirectory(environment, variant) {
53139
53211
  function isRecord2(value) {
53140
53212
  return typeof value === "object" && value !== null && !Array.isArray(value);
53141
53213
  }
53214
+ function qoderUserText(message) {
53215
+ if (!isRecord2(message))
53216
+ return void 0;
53217
+ const { content } = message;
53218
+ if (typeof content === "string")
53219
+ return content;
53220
+ if (!Array.isArray(content))
53221
+ return void 0;
53222
+ return content.filter((block) => isRecord2(block) && block.type === "text" && typeof block.text === "string").map((block) => String(block.text)).join(" ");
53223
+ }
53142
53224
  function count2(value) {
53143
53225
  return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
53144
53226
  }
@@ -53146,8 +53228,18 @@ async function readQoderUsage(file2, signal) {
53146
53228
  const messages = /* @__PURE__ */ new Map();
53147
53229
  let sessionId;
53148
53230
  let cwd;
53149
- for await (const line of jsonlRecords(file2, '"assistant"', signal)) {
53231
+ let customTitle;
53232
+ let summary;
53233
+ let firstPrompt;
53234
+ for await (const line of jsonlRecords(file2, '"type"', signal)) {
53150
53235
  signal.throwIfAborted();
53236
+ if (line.type === "custom-title")
53237
+ customTitle = usageSessionTitle(line.customTitle);
53238
+ else if (!summary && line.type === "summary")
53239
+ summary = usageSessionTitle(line.summary);
53240
+ else if (!firstPrompt && line.type === "user") {
53241
+ firstPrompt = usageSessionTitle(qoderUserText(line.message));
53242
+ }
53151
53243
  if (line.type !== "assistant" || !isRecord2(line.message))
53152
53244
  continue;
53153
53245
  sessionId ??= line.sessionId;
@@ -53191,7 +53283,8 @@ async function readQoderUsage(file2, signal) {
53191
53283
  }
53192
53284
  const session = {
53193
53285
  sessionId: typeof sessionId === "string" ? sessionId : void 0,
53194
- cwd: typeof cwd === "string" ? cwd : void 0
53286
+ cwd: typeof cwd === "string" ? cwd : void 0,
53287
+ title: customTitle ?? summary ?? firstPrompt
53195
53288
  };
53196
53289
  return [...messages.values()].flatMap(({ entry }) => entry ? [withUsageSession(entry, session)] : []);
53197
53290
  }
@@ -53626,6 +53719,10 @@ function createQoderInstallation(environment, command, variant = "global") {
53626
53719
  updateAvailable: false,
53627
53720
  canUpdate: false,
53628
53721
  messageCode: "qoder-check-unavailable",
53722
+ notice: {
53723
+ en: "This Qoder China release does not expose a non-installing update check. Use its original installer.",
53724
+ "zh-CN": "此 Qoder 中国版尚不支持只检查、不安装的更新查询,请使用原安装方式更新。"
53725
+ },
53629
53726
  message: "This Qoder China release does not expose a non-installing update check. Use its original installer."
53630
53727
  };
53631
53728
  const output = await run(["update", "--check"]);
@@ -27187,6 +27187,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
27187
27187
  initializeOnly: external_exports.boolean().optional()
27188
27188
  });
27189
27189
 
27190
+ // ../../shared-contracts/dist/harness-presentation.js
27191
+ var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
27192
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
27193
+ var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
27194
+ label: displayText(256).optional(),
27195
+ description: displayText(1024).optional()
27196
+ }).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
27197
+ 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");
27198
+
27190
27199
  // ../../shared-contracts/dist/model-price-overrides.js
27191
27200
  var usdPerMillionTokens = external_exports.number().finite().nonnegative();
27192
27201
  var modelPriceOverrideSchema = external_exports.strictObject({
@@ -27265,6 +27274,8 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
27265
27274
  harness,
27266
27275
  sessionId: external_exports.string().min(1).max(512),
27267
27276
  project: project.nullable(),
27277
+ /** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
27278
+ title: external_exports.string().min(1).max(200).optional(),
27268
27279
  /** Models the session used, most requests first. */
27269
27280
  models: external_exports.array(model).max(16),
27270
27281
  firstAtMs: count,
@@ -27331,7 +27342,12 @@ var usageStatisticsResultSchema = external_exports.strictObject({
27331
27342
  * The sessions that spent the most, by cost and by tokens without cache, all filters applied;
27332
27343
  * requests without a native session are not listed here but count everywhere else.
27333
27344
  */
27334
- sessions: external_exports.array(usageStatisticsSessionSchema).max(100)
27345
+ sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
27346
+ /**
27347
+ * The sessions last active in the range, newest first, all filters applied. Optional for older
27348
+ * Hosts; missing is treated as no list rather than no sessions.
27349
+ */
27350
+ recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
27335
27351
  });
27336
27352
 
27337
27353
  // ../../shared-contracts/dist/ids.js
@@ -27600,8 +27616,24 @@ var threadUsageSnapshotSchema = external_exports.object({
27600
27616
  }
27601
27617
  });
27602
27618
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
27619
+ var accountCreditsPeriodSchema = external_exports.enum([
27620
+ "weekly",
27621
+ "monthly",
27622
+ "five_hour",
27623
+ "seven_day",
27624
+ "unknown"
27625
+ ]);
27626
+ var accountCreditsScopeSchema = external_exports.object({
27627
+ id: external_exports.string().min(1).max(256),
27628
+ label: external_exports.string().min(1).max(256),
27629
+ localizations: harnessLocalizationsSchema.optional()
27630
+ }).strict();
27603
27631
  var accountCreditsProductUsageSchema = external_exports.object({
27604
27632
  product: external_exports.string().min(1),
27633
+ /** Native period and scope, never inferred from the display name. */
27634
+ periodType: accountCreditsPeriodSchema.optional(),
27635
+ scope: accountCreditsScopeSchema.optional(),
27636
+ localizations: harnessLocalizationsSchema.optional(),
27605
27637
  used: external_exports.number().finite().nonnegative().optional(),
27606
27638
  // Zero is a real empty cap, not an absent field.
27607
27639
  limit: external_exports.number().finite().nonnegative().optional(),
@@ -27623,8 +27655,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
27623
27655
  label: external_exports.string().min(1).optional(),
27624
27656
  usedPercent: usagePercentSchema.optional(),
27625
27657
  remaining: external_exports.number().finite().optional(),
27658
+ scope: accountCreditsScopeSchema.optional(),
27659
+ localizations: harnessLocalizationsSchema.optional(),
27626
27660
  resetsAt: external_exports.string().min(1).optional(),
27627
- periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
27661
+ periodType: accountCreditsPeriodSchema,
27628
27662
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
27629
27663
  resetCredits: accountResetCreditsSchema.optional()
27630
27664
  }).strict().superRefine((credits, context) => {
@@ -27649,7 +27683,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
27649
27683
  var threadUsageInspectionSchema = external_exports.object({
27650
27684
  threadId: hostThreadIdSchema,
27651
27685
  usage: threadUsageSnapshotSchema.nullable(),
27652
- accountCredits: accountCreditsSnapshotSchema.optional()
27686
+ accountCredits: accountCreditsSnapshotSchema.optional(),
27687
+ /** Whether this source can provide cached account quota independently of usage. */
27688
+ accountCreditsSupported: external_exports.boolean().optional()
27653
27689
  }).strict();
27654
27690
 
27655
27691
  // ../../shared-contracts/dist/harness-accounts.js
@@ -27776,7 +27812,8 @@ var harnessPermissionModeSchema = external_exports.object({
27776
27812
  id: harnessPermissionModeIdSchema,
27777
27813
  label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
27778
27814
  description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
27779
- dangerous: external_exports.boolean().optional()
27815
+ dangerous: external_exports.boolean().optional(),
27816
+ localizations: harnessLocalizationsSchema.optional()
27780
27817
  }).strict();
27781
27818
  var harnessPermissionModeCatalogSchema = external_exports.object({
27782
27819
  modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
@@ -28099,6 +28136,8 @@ var harnessInstallationStateSchema = external_exports.object({
28099
28136
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
28100
28137
  message: external_exports.string().max(2048).optional(),
28101
28138
  messageCode: external_exports.string().min(1).max(128).optional(),
28139
+ /** Safe plugin-owned explanation, distinct from raw diagnostic message. */
28140
+ notice: harnessLocalizedTextSchema.optional(),
28102
28141
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
28103
28142
  }).strict();
28104
28143
 
@@ -28237,6 +28276,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
28237
28276
  invocation: commandInvocationSchema,
28238
28277
  label: commandLabelSchema,
28239
28278
  description: commandDescriptionSchema.optional(),
28279
+ localizations: harnessLocalizationsSchema.optional(),
28240
28280
  argumentMode: external_exports.enum(["none", "text"]),
28241
28281
  /**
28242
28282
  * Native distinction reported by the Harness. Omitted when the Harness does
@@ -29499,6 +29539,7 @@ var QODER_FALLBACK_COMMAND_CATALOG = harnessCommandCatalogSchema.parse({
29499
29539
  {
29500
29540
  id: "qoder.compact",
29501
29541
  invocation: "/compact",
29542
+ localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } },
29502
29543
  label: "Compact",
29503
29544
  description: "Compresses the context by replacing it with a summary",
29504
29545
  argumentMode: "text"
@@ -30090,26 +30131,35 @@ var QODER_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
30090
30131
  {
30091
30132
  id: "default",
30092
30133
  label: "Default",
30134
+ localizations: { "zh-CN": { label: "默认", description: "执行受保护的工具操作前询问。" } },
30093
30135
  description: "Ask before protected tool actions."
30094
30136
  },
30095
30137
  {
30096
30138
  id: "acceptEdits",
30097
30139
  label: "Accept Edits",
30140
+ localizations: { "zh-CN": { label: "接受编辑", description: "自动接受文件变更。" } },
30098
30141
  description: "Automatically accept file changes."
30099
30142
  },
30100
30143
  {
30101
30144
  id: "auto",
30102
30145
  label: "Auto",
30146
+ localizations: { "zh-CN": { label: "自动", description: "自动允许安全的工具操作。" } },
30103
30147
  description: "Automatically allow safe tool actions."
30104
30148
  },
30105
30149
  {
30106
30150
  id: "plan",
30107
30151
  label: "Plan",
30152
+ localizations: {
30153
+ "zh-CN": { label: "规划模式", description: "仅执行只读操作的规划模式。" }
30154
+ },
30108
30155
  description: "Plan mode with read-only operations."
30109
30156
  },
30110
30157
  {
30111
30158
  id: "bypassPermissions",
30112
30159
  label: "Bypass Permissions",
30160
+ localizations: {
30161
+ "zh-CN": { label: "绕过权限", description: "无需提示即可批准所有工具操作。" }
30162
+ },
30113
30163
  description: "Approve all tool actions without prompting.",
30114
30164
  dangerous: true
30115
30165
  }
@@ -52976,6 +53026,20 @@ import path6 from "node:path";
52976
53026
  import { createInterface } from "node:readline";
52977
53027
  var MAX_SESSION_ID_LENGTH = 512;
52978
53028
  var MAX_CWD_LENGTH = 4096;
53029
+ var MAX_SESSION_TITLE_LENGTH = 200;
53030
+ function usageSessionTitle(value) {
53031
+ if (typeof value !== "string")
53032
+ return void 0;
53033
+ const normalized = value.replaceAll("\0", "").replaceAll(/\s+/gu, " ").trim();
53034
+ if (!normalized)
53035
+ return void 0;
53036
+ if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
53037
+ return normalized;
53038
+ const characters = [...normalized];
53039
+ if (characters.length <= MAX_SESSION_TITLE_LENGTH)
53040
+ return normalized;
53041
+ return `${characters.slice(0, MAX_SESSION_TITLE_LENGTH - 1).join("").trimEnd()}…`;
53042
+ }
52979
53043
  function sessionIdOk(value) {
52980
53044
  return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
52981
53045
  }
@@ -52985,12 +53049,14 @@ function cwdOk(value) {
52985
53049
  function withUsageSession(entry, session) {
52986
53050
  const sessionId = sessionIdOk(session.sessionId) ? session.sessionId : void 0;
52987
53051
  const cwd = cwdOk(session.cwd) ? session.cwd : void 0;
53052
+ const sessionTitle = sessionId !== void 0 ? usageSessionTitle(session.title) : void 0;
52988
53053
  if (sessionId === void 0 && cwd === void 0)
52989
53054
  return entry;
52990
53055
  return {
52991
53056
  ...entry,
52992
53057
  ...sessionId !== void 0 ? { sessionId } : {},
52993
- ...cwd !== void 0 ? { cwd } : {}
53058
+ ...cwd !== void 0 ? { cwd } : {},
53059
+ ...sessionTitle !== void 0 ? { sessionTitle } : {}
52994
53060
  };
52995
53061
  }
52996
53062
  function tokenCount(value) {
@@ -53030,6 +53096,12 @@ function parseHarnessUsageEntry(value) {
53030
53096
  return null;
53031
53097
  if (entry.cwd !== void 0 && !cwdOk(entry.cwd))
53032
53098
  return null;
53099
+ if (entry.sessionTitle !== void 0) {
53100
+ const sessionTitle = usageSessionTitle(entry.sessionTitle);
53101
+ if (sessionTitle === void 0)
53102
+ return null;
53103
+ entry.sessionTitle = sessionTitle;
53104
+ }
53033
53105
  if (entry.tokensUnknown !== void 0 && entry.tokensUnknown !== true)
53034
53106
  return null;
53035
53107
  if (entry.costUsd !== void 0 && (typeof entry.costUsd !== "number" || !Number.isFinite(entry.costUsd) || entry.costUsd < 0)) {
@@ -53141,6 +53213,16 @@ function qoderProjectsDirectory(environment, variant) {
53141
53213
  function isRecord2(value) {
53142
53214
  return typeof value === "object" && value !== null && !Array.isArray(value);
53143
53215
  }
53216
+ function qoderUserText(message) {
53217
+ if (!isRecord2(message))
53218
+ return void 0;
53219
+ const { content } = message;
53220
+ if (typeof content === "string")
53221
+ return content;
53222
+ if (!Array.isArray(content))
53223
+ return void 0;
53224
+ return content.filter((block) => isRecord2(block) && block.type === "text" && typeof block.text === "string").map((block) => String(block.text)).join(" ");
53225
+ }
53144
53226
  function count2(value) {
53145
53227
  return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
53146
53228
  }
@@ -53148,8 +53230,18 @@ async function readQoderUsage(file2, signal) {
53148
53230
  const messages = /* @__PURE__ */ new Map();
53149
53231
  let sessionId;
53150
53232
  let cwd;
53151
- for await (const line of jsonlRecords(file2, '"assistant"', signal)) {
53233
+ let customTitle;
53234
+ let summary;
53235
+ let firstPrompt;
53236
+ for await (const line of jsonlRecords(file2, '"type"', signal)) {
53152
53237
  signal.throwIfAborted();
53238
+ if (line.type === "custom-title")
53239
+ customTitle = usageSessionTitle(line.customTitle);
53240
+ else if (!summary && line.type === "summary")
53241
+ summary = usageSessionTitle(line.summary);
53242
+ else if (!firstPrompt && line.type === "user") {
53243
+ firstPrompt = usageSessionTitle(qoderUserText(line.message));
53244
+ }
53153
53245
  if (line.type !== "assistant" || !isRecord2(line.message))
53154
53246
  continue;
53155
53247
  sessionId ??= line.sessionId;
@@ -53193,7 +53285,8 @@ async function readQoderUsage(file2, signal) {
53193
53285
  }
53194
53286
  const session = {
53195
53287
  sessionId: typeof sessionId === "string" ? sessionId : void 0,
53196
- cwd: typeof cwd === "string" ? cwd : void 0
53288
+ cwd: typeof cwd === "string" ? cwd : void 0,
53289
+ title: customTitle ?? summary ?? firstPrompt
53197
53290
  };
53198
53291
  return [...messages.values()].flatMap(({ entry }) => entry ? [withUsageSession(entry, session)] : []);
53199
53292
  }
@@ -53628,6 +53721,10 @@ function createQoderInstallation(environment, command, variant = "global") {
53628
53721
  updateAvailable: false,
53629
53722
  canUpdate: false,
53630
53723
  messageCode: "qoder-check-unavailable",
53724
+ notice: {
53725
+ en: "This Qoder China release does not expose a non-installing update check. Use its original installer.",
53726
+ "zh-CN": "此 Qoder 中国版尚不支持只检查、不安装的更新查询,请使用原安装方式更新。"
53727
+ },
53631
53728
  message: "This Qoder China release does not expose a non-installing update check. Use its original installer."
53632
53729
  };
53633
53730
  const output = await run(["update", "--check"]);