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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +117 -13
  4. package/app/console-web.js +713 -129
  5. package/app/desktop-controller.mjs +713 -42
  6. package/app/host-runtime.mjs +2535 -855
  7. package/app/plugins/antigravity/plugin.mjs +437 -67
  8. package/app/plugins/claude-code/plugin.mjs +758 -248
  9. package/app/plugins/codebuddy/plugin.mjs +348 -156
  10. package/app/plugins/codex-usage/plugin.mjs +258 -106
  11. package/app/plugins/copilot/assets/icon.png +0 -0
  12. package/app/plugins/copilot/manifest.json +26 -0
  13. package/app/plugins/copilot/plugin.mjs +34651 -0
  14. package/app/plugins/cursor-cli/plugin.mjs +20905 -44961
  15. package/app/plugins/deepseek-harness/plugin.mjs +195 -53
  16. package/app/plugins/enabled.json +1 -0
  17. package/app/plugins/grok/plugin.mjs +584 -138
  18. package/app/plugins/hermes/plugin.mjs +134 -13
  19. package/app/plugins/kimi-code/plugin.mjs +145 -26
  20. package/app/plugins/kiro-cli/plugin.mjs +145 -26
  21. package/app/plugins/muse/plugin.mjs +132 -14
  22. package/app/plugins/omp/plugin.mjs +2245 -2040
  23. package/app/plugins/opencode/plugin.mjs +196 -72
  24. package/app/plugins/pi/plugin.mjs +2643 -2309
  25. package/app/plugins/qoder/plugin.mjs +162 -40
  26. package/app/plugins/qoder-cn/plugin.mjs +162 -40
  27. package/app/plugins/workbuddy/plugin.mjs +609 -180
  28. package/app/plugins/zcode/plugin.mjs +192 -44
  29. package/app/renderer-extension.js +3405 -429
  30. package/bin/boft.exe +0 -0
  31. package/libexec/boft-node-repl.exe +0 -0
  32. package/libexec/boft-shim.exe +0 -0
  33. package/libexec/boft-updater.exe +0 -0
  34. package/package.json +1 -1
@@ -22,10 +22,13 @@ function usageSessionTitle(value) {
22
22
  return void 0;
23
23
  if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
24
24
  return normalized;
25
- const characters = [...normalized];
26
- if (characters.length <= MAX_SESSION_TITLE_LENGTH)
27
- return normalized;
28
- return `${characters.slice(0, MAX_SESSION_TITLE_LENGTH - 1).join("").trimEnd()}…`;
25
+ let title = "";
26
+ for (const character of normalized) {
27
+ if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
28
+ break;
29
+ title += character;
30
+ }
31
+ return `${title.trimEnd()}…`;
29
32
  }
30
33
  function sessionIdOk(value) {
31
34
  return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
@@ -3095,10 +3098,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3095
3098
  const shape = def.shape;
3096
3099
  const propValues = {};
3097
3100
  for (const key in shape) {
3098
- const field2 = shape[key]._zod;
3099
- if (field2.values) {
3101
+ const field3 = shape[key]._zod;
3102
+ if (field3.values) {
3100
3103
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3101
- for (const v of field2.values)
3104
+ for (const v of field3.values)
3102
3105
  propValues[key].add(v);
3103
3106
  }
3104
3107
  }
@@ -14845,10 +14848,19 @@ var model = external_exports.string().min(1).max(512);
14845
14848
  var project = external_exports.string().min(1).max(4096);
14846
14849
  var usageStatisticsParamsSchema = external_exports.strictObject({
14847
14850
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
14851
+ /** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
14852
+ timeZone: external_exports.string().min(1).max(128).refine((value) => {
14853
+ try {
14854
+ new Intl.DateTimeFormat("en", { timeZone: value });
14855
+ return true;
14856
+ } catch {
14857
+ return false;
14858
+ }
14859
+ }, "Unsupported usage statistics timezone").optional(),
14848
14860
  harness: harness.optional(),
14849
14861
  model: model.nullable().optional(),
14850
14862
  project: project.nullable().optional(),
14851
- /** One local date inside the range. */
14863
+ /** One date in the query timezone inside the range. */
14852
14864
  date: localDate.optional()
14853
14865
  });
14854
14866
  var usageStatisticsTotalsSchema = external_exports.strictObject({
@@ -14857,6 +14869,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
14857
14869
  cachedInputTokens: count,
14858
14870
  cacheWriteInputTokens: count,
14859
14871
  cacheKnownInputTokens: count,
14872
+ cacheHitCachedInputTokens: count,
14873
+ cacheHitInputTokens: count,
14860
14874
  outputTokens: count,
14861
14875
  reasoningOutputTokens: count,
14862
14876
  /** USD at the public price, summed over the priced requests only. */
@@ -14884,7 +14898,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
14884
14898
  });
14885
14899
  var usageStatisticsResultSchema = external_exports.strictObject({
14886
14900
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
14887
- /** First local date of the range; null for all time. */
14901
+ /** First date in the query timezone (Host local when omitted); null for all time. */
14888
14902
  from: localDate.nullable(),
14889
14903
  to: localDate,
14890
14904
  /** The filters these figures apply, echoed so a late answer to older filters is recognised. */
@@ -14924,7 +14938,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
14924
14938
  totals: usageStatisticsTotalsSchema,
14925
14939
  /** Each date and Harness of the range: every filter except the day. */
14926
14940
  daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
14927
- /** Local weekday (0 = Sunday) and hour, all filters applied. */
14941
+ /** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
14928
14942
  hourly: external_exports.array(external_exports.strictObject({
14929
14943
  weekday: external_exports.number().int().min(0).max(6),
14930
14944
  hour: external_exports.number().int().min(0).max(23),
@@ -14964,6 +14978,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
14964
14978
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
14965
14979
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
14966
14980
 
14981
+ // ../../shared-contracts/dist/thread-questions.js
14982
+ var field = external_exports.discriminatedUnion("type", [
14983
+ external_exports.object({
14984
+ id: external_exports.string().min(1),
14985
+ type: external_exports.literal("choice"),
14986
+ prompt: external_exports.string(),
14987
+ options: external_exports.array(external_exports.object({
14988
+ value: external_exports.string().min(1),
14989
+ label: external_exports.string(),
14990
+ description: external_exports.string().optional()
14991
+ })).min(1),
14992
+ multiple: external_exports.boolean(),
14993
+ allowOther: external_exports.boolean(),
14994
+ optional: external_exports.boolean()
14995
+ }),
14996
+ external_exports.object({
14997
+ id: external_exports.string().min(1),
14998
+ type: external_exports.literal("text"),
14999
+ prompt: external_exports.string(),
15000
+ multiline: external_exports.boolean(),
15001
+ secret: external_exports.literal(false),
15002
+ optional: external_exports.boolean(),
15003
+ placeholder: external_exports.string().optional(),
15004
+ prefill: external_exports.string().optional()
15005
+ })
15006
+ ]);
15007
+ var threadQuestionSchema = external_exports.object({
15008
+ interactionId: external_exports.string().min(1),
15009
+ turnId: external_exports.string().min(1),
15010
+ title: external_exports.string().optional(),
15011
+ questions: external_exports.array(field).min(1)
15012
+ }).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
15013
+ message: "Shared cards require at least one multi-select question"
15014
+ });
15015
+ var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
15016
+ var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
15017
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15018
+ threadId: external_exports.string().min(1),
15019
+ turnId: external_exports.string().min(1),
15020
+ interactionId: external_exports.string().min(1),
15021
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15022
+ cancelled: external_exports.boolean().default(false)
15023
+ });
15024
+ var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
15025
+
14967
15026
  // ../../shared-contracts/dist/harness-plugins.js
14968
15027
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
14969
15028
  var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
@@ -15066,6 +15125,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
15066
15125
  "codexhost/harness/display-settings/set",
15067
15126
  "codexhost/harness/inspect",
15068
15127
  "codexhost/harness/installation",
15128
+ "codexhost/harness/installation/start",
15129
+ "codexhost/harness/installation/status",
15069
15130
  "codexhost/harness/launch-settings/get",
15070
15131
  "codexhost/harness/launch-settings/set",
15071
15132
  HARNESS_LONG_CONTEXT_GET_METHOD,
@@ -15143,7 +15204,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
15143
15204
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
15144
15205
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
15145
15206
  var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
15207
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
15208
+ var composerIndicatorsSchema = external_exports.array(external_exports.object({
15209
+ kind: external_exports.literal("countdown"),
15210
+ id: external_exports.string().min(1).max(64),
15211
+ expiresAtUnix: nonNegativeSafeIntegerSchema,
15212
+ label: indicatorTextSchema(256).optional(),
15213
+ tooltip: indicatorTextSchema(1024).optional()
15214
+ }).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
15215
+ message: "Composer indicator IDs must be unique"
15216
+ });
15146
15217
  var threadUsageSnapshotSchema = external_exports.object({
15218
+ composerIndicators: composerIndicatorsSchema.optional(),
15147
15219
  inputTokens: nonNegativeSafeIntegerSchema.optional(),
15148
15220
  cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
15149
15221
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
@@ -15569,7 +15641,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
15569
15641
  }).strict().optional(),
15570
15642
  input: external_exports.object({
15571
15643
  image: external_exports.boolean()
15572
- }).strict().optional()
15644
+ }).strict().optional(),
15645
+ /** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
15646
+ steer: external_exports.boolean().optional()
15573
15647
  }).strict();
15574
15648
  var harnessConfigurationStateSchema = external_exports.object({
15575
15649
  effectiveModel: harnessModelRefSchema.optional(),
@@ -15616,7 +15690,9 @@ var harnessInspectionSchema = external_exports.union([
15616
15690
  var harnessInspectParamsSchema = external_exports.object({
15617
15691
  harnessId: harnessIdSchema,
15618
15692
  cwd: nonBlankTextSchema2.max(16384).optional(),
15619
- refresh: external_exports.boolean().optional()
15693
+ refresh: external_exports.boolean().optional(),
15694
+ /** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
15695
+ purpose: external_exports.literal("availability").optional()
15620
15696
  }).strict();
15621
15697
  var harnessWebUiOpenParamsSchema = external_exports.object({
15622
15698
  harnessId: harnessIdSchema
@@ -15701,13 +15777,25 @@ var threadOwnershipListResultSchema = external_exports.object({
15701
15777
  seen.add(thread.threadId);
15702
15778
  }
15703
15779
  });
15780
+ var threadSteeringInspectParamsSchema = external_exports.object({
15781
+ threadId: hostThreadIdSchema,
15782
+ /** The text about to be steered; a Harness command always stops and restarts. */
15783
+ text: external_exports.string().optional()
15784
+ }).strict();
15785
+ var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15786
+ var threadSteeringInspectResultSchema = external_exports.object({
15787
+ delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
15788
+ }).strict();
15704
15789
 
15705
15790
  // ../../shared-contracts/dist/harness-route.js
15706
15791
  var harnessPluginRouteSchema = external_exports.object({
15707
15792
  harnessId: harnessPluginIdSchema,
15708
15793
  model: harnessModelRefSchema.optional(),
15709
15794
  thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
15710
- permissionModeId: harnessPermissionModeIdSchema.optional()
15795
+ permissionModeId: harnessPermissionModeIdSchema.optional(),
15796
+ /** A draft prewarm create: stays unsubmitted until the user's first Turn.
15797
+ * Desktop forwards only the Model of a main-process prewarm to thread/start. */
15798
+ prewarm: external_exports.literal(true).optional()
15711
15799
  }).strict();
15712
15800
 
15713
15801
  // ../../shared-contracts/dist/harness-launch-settings.js
@@ -15733,6 +15821,10 @@ var harnessInstallationStateSchema = external_exports.object({
15733
15821
  latestVersion: external_exports.string().min(1).max(128),
15734
15822
  updateAvailable: external_exports.boolean(),
15735
15823
  canUpdate: external_exports.boolean(),
15824
+ /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
15825
+ versionKind: external_exports.enum(["cli", "application"]).optional(),
15826
+ /** Official download opened by the user; does not imply an automatic installation. */
15827
+ manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
15736
15828
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
15737
15829
  message: external_exports.string().max(2048).optional(),
15738
15830
  messageCode: external_exports.string().min(1).max(128).optional(),
@@ -15740,6 +15832,20 @@ var harnessInstallationStateSchema = external_exports.object({
15740
15832
  notice: harnessLocalizedTextSchema.optional(),
15741
15833
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
15742
15834
  }).strict();
15835
+ var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
15836
+ var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
15837
+ external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
15838
+ external_exports.object({
15839
+ taskId: external_exports.string().uuid(),
15840
+ status: external_exports.literal("succeeded"),
15841
+ result: harnessInstallationStateSchema
15842
+ }).strict(),
15843
+ external_exports.object({
15844
+ taskId: external_exports.string().uuid(),
15845
+ status: external_exports.literal("failed"),
15846
+ error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
15847
+ }).strict()
15848
+ ]);
15743
15849
 
15744
15850
  // ../../shared-contracts/dist/codex-accounts.js
15745
15851
  var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
@@ -16237,6 +16343,18 @@ function sanitizeDiagnosticTail(value) {
16237
16343
  return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
16238
16344
  }
16239
16345
 
16346
+ // ../../harness-adapter/dist/steer.js
16347
+ function unsupportedSteer(harnessLabel) {
16348
+ return {
16349
+ ok: false,
16350
+ error: {
16351
+ code: "unsupported",
16352
+ message: `${harnessLabel} cannot steer an active Turn natively`,
16353
+ retryable: false
16354
+ }
16355
+ };
16356
+ }
16357
+
16240
16358
  // ../../harness-adapter/dist/usage.js
16241
16359
  var tokenFields = [
16242
16360
  "inputTokens",
@@ -16264,6 +16382,7 @@ var usageFields = /* @__PURE__ */ new Set([
16264
16382
  ...safeIntegerFields,
16265
16383
  ...percentFields,
16266
16384
  "sessionCacheUsage",
16385
+ "composerIndicators",
16267
16386
  "totalCostUsd",
16268
16387
  "totalCredits",
16269
16388
  "contextUsagePercent",
@@ -16286,26 +16405,27 @@ function parseHostUsage(value) {
16286
16405
  throw new Error(`Harness Usage contains unknown field '${key}'`);
16287
16406
  }
16288
16407
  }
16289
- for (const field2 of [
16408
+ const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16409
+ for (const field3 of [
16290
16410
  "totalCredits",
16291
16411
  "contextUsagePercent",
16292
16412
  "apiOutputTokensPerSecond"
16293
16413
  ]) {
16294
- const candidate = value[field2];
16414
+ const candidate = value[field3];
16295
16415
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16296
- throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16416
+ throw new Error(`Harness Usage '${field3}' must be a finite non-negative number`);
16297
16417
  }
16298
16418
  }
16299
- for (const field2 of tokenFields) {
16300
- const candidate = value[field2];
16419
+ for (const field3 of tokenFields) {
16420
+ const candidate = value[field3];
16301
16421
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16302
- throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16422
+ throw new Error(`Harness Usage '${field3}' must be a non-negative safe integer`);
16303
16423
  }
16304
16424
  }
16305
- for (const field2 of safeIntegerFields) {
16306
- const candidate = value[field2];
16425
+ for (const field3 of safeIntegerFields) {
16426
+ const candidate = value[field3];
16307
16427
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16308
- throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16428
+ throw new Error(`Harness Usage '${field3}' must be a non-negative safe integer`);
16309
16429
  }
16310
16430
  }
16311
16431
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -16314,16 +16434,16 @@ function parseHostUsage(value) {
16314
16434
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
16315
16435
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
16316
16436
  }
16317
- for (const field2 of ["totalCredits", "contextUsagePercent"]) {
16318
- const candidate = value[field2];
16437
+ for (const field3 of ["totalCredits", "contextUsagePercent"]) {
16438
+ const candidate = value[field3];
16319
16439
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16320
- throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16440
+ throw new Error(`Harness Usage '${field3}' must be a finite non-negative number`);
16321
16441
  }
16322
16442
  }
16323
- for (const field2 of percentFields) {
16324
- const candidate = value[field2];
16443
+ for (const field3 of percentFields) {
16444
+ const candidate = value[field3];
16325
16445
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
16326
- throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
16446
+ throw new Error(`Harness Usage '${field3}' must be between 0 and 100`);
16327
16447
  }
16328
16448
  }
16329
16449
  if (value.sessionCacheUsage !== void 0) {
@@ -16362,9 +16482,9 @@ function parseHostUsage(value) {
16362
16482
  if (value.costSource !== "publicPrice") {
16363
16483
  throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
16364
16484
  }
16365
- return { ...value, unpricedModels: [...models] };
16485
+ return { ...value, ...indicators, unpricedModels: [...models] };
16366
16486
  }
16367
- return { ...value };
16487
+ return { ...value, ...indicators };
16368
16488
  }
16369
16489
  var requestTokenFields = [
16370
16490
  "inputTokens",
@@ -16394,19 +16514,19 @@ function parseHostUsageRequest(value) {
16394
16514
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
16395
16515
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
16396
16516
  }
16397
- for (const field2 of ["model", "provider"]) {
16398
- const candidate = value[field2];
16517
+ for (const field3 of ["model", "provider"]) {
16518
+ const candidate = value[field3];
16399
16519
  if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
16400
- throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
16520
+ throw new Error(`Harness Usage request '${field3}' must be a non-empty string`);
16401
16521
  }
16402
16522
  }
16403
16523
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
16404
16524
  throw new Error("Harness Usage request 'historical' must be a boolean");
16405
16525
  }
16406
- for (const field2 of requestTokenFields) {
16407
- const candidate = value[field2];
16526
+ for (const field3 of requestTokenFields) {
16527
+ const candidate = value[field3];
16408
16528
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16409
- throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
16529
+ throw new Error(`Harness Usage request '${field3}' must be a non-negative safe integer`);
16410
16530
  }
16411
16531
  }
16412
16532
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -16912,7 +17032,7 @@ var subscriptionSchema = external_exports.object({
16912
17032
  });
16913
17033
  function codingProduct(value) {
16914
17034
  const entry = recordSchema2.safeParse(value).data;
16915
- return [entry?.productId, entry?.productName].some((field2) => typeof field2 === "string" && field2.toLowerCase().includes("coding"));
17035
+ return [entry?.productId, entry?.productName].some((field3) => typeof field3 === "string" && field3.toLowerCase().includes("coding"));
16916
17036
  }
16917
17037
  async function queryEntitlement(family, apiKey, environment) {
16918
17038
  try {
@@ -17225,6 +17345,8 @@ async function accountConfig(installation, environment) {
17225
17345
  states
17226
17346
  },
17227
17347
  startPlan,
17348
+ signedIn: Boolean(family),
17349
+ startPlanChecked: !family || balanceData !== void 0,
17228
17350
  codingPlan
17229
17351
  };
17230
17352
  }
@@ -17330,6 +17452,8 @@ var CliTransport = class {
17330
17452
  // Aborting these cancels only this transport's running and queued shared verifications.
17331
17453
  #headerRequests = /* @__PURE__ */ new Map();
17332
17454
  #startPlan = false;
17455
+ #signedIn = false;
17456
+ #startPlanChecked = true;
17333
17457
  #codingPlan;
17334
17458
  #fault;
17335
17459
  #closed = false;
@@ -17342,6 +17466,14 @@ var CliTransport = class {
17342
17466
  get startPlan() {
17343
17467
  return this.#startPlan;
17344
17468
  }
17469
+ /** Whether ZCode Desktop is signed in to a Zhipu account, whatever that account is entitled to. */
17470
+ get signedIn() {
17471
+ return this.#signedIn;
17472
+ }
17473
+ /** False when the Start Plan balance could not be read, so its entitlement is unknown. */
17474
+ get startPlanChecked() {
17475
+ return this.#startPlanChecked;
17476
+ }
17345
17477
  constructor(options) {
17346
17478
  this.options = options;
17347
17479
  this.#context = {
@@ -17353,9 +17485,11 @@ var CliTransport = class {
17353
17485
  if (this.#child || this.#closed)
17354
17486
  throw new ZcodeError("invalidState", "ZCode transport already started or closed");
17355
17487
  const installation = await resolveInstallation(this.options.environment, this.options.app);
17356
- const { params: accountParams, startPlan, codingPlan } = await accountConfig(installation, this.options.environment);
17488
+ const { params: accountParams, startPlan, signedIn, startPlanChecked, codingPlan } = await accountConfig(installation, this.options.environment);
17357
17489
  this.#installation = installation;
17358
17490
  this.#startPlan = startPlan;
17491
+ this.#signedIn = signedIn;
17492
+ this.#startPlanChecked = startPlanChecked;
17359
17493
  this.#codingPlan = codingPlan;
17360
17494
  const child = spawn(installation.runtime, [installation.cli, "app-server", "--stdio", "--surface", "desktop"], {
17361
17495
  cwd: this.options.cwd,
@@ -17635,16 +17769,16 @@ var CliTransport = class {
17635
17769
  var CONFIG_URL = "https://zcode.z.ai/api/v1/client/configs";
17636
17770
  var CONFIG_TTL_MS = 6e4;
17637
17771
  var CONFIG_TIMEOUT_MS = 15e3;
17638
- var field = external_exports.string().min(1).optional().catch(void 0);
17772
+ var field2 = external_exports.string().min(1).optional().catch(void 0);
17639
17773
  var responseSchema = external_exports.object({
17640
17774
  data: external_exports.object({
17641
17775
  configs: external_exports.object({
17642
17776
  captcha: external_exports.object({
17643
17777
  enabled: external_exports.boolean().optional(),
17644
17778
  skip_model_request: external_exports.boolean().optional(),
17645
- region: field,
17646
- prefix: field,
17647
- sceneId: field
17779
+ region: field2,
17780
+ prefix: field2,
17781
+ sceneId: field2
17648
17782
  }).optional()
17649
17783
  })
17650
17784
  })
@@ -19472,6 +19606,7 @@ async function readHistory(transport, snapshot, events = []) {
19472
19606
 
19473
19607
  // dist/capabilities.js
19474
19608
  var ZCODE_CAPABILITIES = {
19609
+ steer: false,
19475
19610
  configuration: {
19476
19611
  selectModel: true,
19477
19612
  selectThinkingOption: true,
@@ -19646,6 +19781,8 @@ var ZcodeSession = class {
19646
19781
  if (this.#closed || this.#faulted)
19647
19782
  return failure("invalidState", "ZCode session is closed");
19648
19783
  try {
19784
+ if (command.type === "turn.steer")
19785
+ return unsupportedSteer("ZCode");
19649
19786
  if (command.type === "turn.start") {
19650
19787
  if (!hostTurnIdSchema.safeParse(command.turnId).success || !command.input.length || command.input.some((item) => item.type !== "text") || !command.input.some((item) => item.type === "text" && item.text.trim()))
19651
19788
  return failure("invalidRequest", "ZCode requires nonempty text and a turn ID");
@@ -20054,9 +20191,20 @@ var ZcodeAdapter = class {
20054
20191
  if (!catalog.models.length)
20055
20192
  return {
20056
20193
  status: "unavailable",
20057
- error: {
20194
+ // A signed-in account without an active plan is not a login problem; only a signed-out
20195
+ // ZCode Desktop needs the login prompt.
20196
+ error: !transport.signedIn ? {
20058
20197
  code: "authenticationRequired",
20059
- message: "ZCode has no available models. Connect Start Plan or Personal Coding Plan in ZCode Desktop, or add a personal provider, then re-detect ZCode. Team Coding Plan is not supported.",
20198
+ message: "ZCode has no available models. Sign in to ZCode Desktop with a Start Plan or Personal Coding Plan account, or add a personal provider, then re-detect ZCode. Team Coding Plan is not supported.",
20199
+ retryable: true
20200
+ } : transport.startPlanChecked ? {
20201
+ code: "configurationRequired",
20202
+ message: "ZCode is signed in, but the account has no available models: no active Start Plan or event quota, no Personal Coding Plan, and no personal provider. Free trial and event quotas expire; subscribe to GLM Coding Plan or add a personal provider (API Key) in ZCode Desktop, then re-detect ZCode. Team Coding Plan is not supported.",
20203
+ retryable: true
20204
+ } : {
20205
+ // The balance request failed, so a valid Start Plan may just be unreadable now.
20206
+ code: "configurationRequired",
20207
+ message: "ZCode is signed in, but no models are available: the Start Plan balance could not be checked, and there is no Personal Coding Plan or personal provider. Re-detect ZCode in a moment; if this persists, check the network and the account in ZCode Desktop. Team Coding Plan is not supported.",
20060
20208
  retryable: true
20061
20209
  }
20062
20210
  };