@codexhost/cli-win32-arm64 0.13.3 → 0.15.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 (33) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +109 -11
  4. package/app/console-web.js +649 -132
  5. package/app/desktop-controller.mjs +120 -12
  6. package/app/host-runtime.mjs +1124 -293
  7. package/app/plugins/antigravity/plugin.mjs +431 -66
  8. package/app/plugins/claude-code/plugin.mjs +761 -139
  9. package/app/plugins/codebuddy/plugin.mjs +322 -68
  10. package/app/plugins/codex-usage/plugin.mjs +249 -102
  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 +34591 -0
  14. package/app/plugins/cursor-cli/plugin.mjs +21011 -44970
  15. package/app/plugins/deepseek-harness/plugin.mjs +160 -43
  16. package/app/plugins/enabled.json +1 -0
  17. package/app/plugins/grok/plugin.mjs +565 -107
  18. package/app/plugins/hermes/plugin.mjs +128 -12
  19. package/app/plugins/kimi-code/plugin.mjs +136 -22
  20. package/app/plugins/kiro-cli/plugin.mjs +136 -22
  21. package/app/plugins/omp/plugin.mjs +2236 -2036
  22. package/app/plugins/opencode/plugin.mjs +187 -68
  23. package/app/plugins/pi/plugin.mjs +2621 -2304
  24. package/app/plugins/qoder/plugin.mjs +153 -36
  25. package/app/plugins/qoder-cn/plugin.mjs +153 -36
  26. package/app/plugins/workbuddy/plugin.mjs +583 -92
  27. package/app/plugins/zcode/plugin.mjs +183 -40
  28. package/app/renderer-extension.js +1758 -392
  29. package/bin/codexhost.exe +0 -0
  30. package/libexec/codexhost-node-repl.exe +0 -0
  31. package/libexec/codexhost-shim.exe +0 -0
  32. package/libexec/codexhost-updater.exe +0 -0
  33. 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({
@@ -14884,7 +14896,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
14884
14896
  });
14885
14897
  var usageStatisticsResultSchema = external_exports.strictObject({
14886
14898
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
14887
- /** First local date of the range; null for all time. */
14899
+ /** First date in the query timezone (Host local when omitted); null for all time. */
14888
14900
  from: localDate.nullable(),
14889
14901
  to: localDate,
14890
14902
  /** The filters these figures apply, echoed so a late answer to older filters is recognised. */
@@ -14924,7 +14936,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
14924
14936
  totals: usageStatisticsTotalsSchema,
14925
14937
  /** Each date and Harness of the range: every filter except the day. */
14926
14938
  daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
14927
- /** Local weekday (0 = Sunday) and hour, all filters applied. */
14939
+ /** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
14928
14940
  hourly: external_exports.array(external_exports.strictObject({
14929
14941
  weekday: external_exports.number().int().min(0).max(6),
14930
14942
  hour: external_exports.number().int().min(0).max(23),
@@ -14964,6 +14976,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
14964
14976
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
14965
14977
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
14966
14978
 
14979
+ // ../../shared-contracts/dist/thread-questions.js
14980
+ var field = external_exports.discriminatedUnion("type", [
14981
+ external_exports.object({
14982
+ id: external_exports.string().min(1),
14983
+ type: external_exports.literal("choice"),
14984
+ prompt: external_exports.string(),
14985
+ options: external_exports.array(external_exports.object({
14986
+ value: external_exports.string().min(1),
14987
+ label: external_exports.string(),
14988
+ description: external_exports.string().optional()
14989
+ })).min(1),
14990
+ multiple: external_exports.boolean(),
14991
+ allowOther: external_exports.boolean(),
14992
+ optional: external_exports.boolean()
14993
+ }),
14994
+ external_exports.object({
14995
+ id: external_exports.string().min(1),
14996
+ type: external_exports.literal("text"),
14997
+ prompt: external_exports.string(),
14998
+ multiline: external_exports.boolean(),
14999
+ secret: external_exports.literal(false),
15000
+ optional: external_exports.boolean(),
15001
+ placeholder: external_exports.string().optional(),
15002
+ prefill: external_exports.string().optional()
15003
+ })
15004
+ ]);
15005
+ var threadQuestionSchema = external_exports.object({
15006
+ interactionId: external_exports.string().min(1),
15007
+ turnId: external_exports.string().min(1),
15008
+ title: external_exports.string().optional(),
15009
+ questions: external_exports.array(field).min(1)
15010
+ }).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
15011
+ message: "Shared cards require at least one multi-select question"
15012
+ });
15013
+ var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
15014
+ var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
15015
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15016
+ threadId: external_exports.string().min(1),
15017
+ turnId: external_exports.string().min(1),
15018
+ interactionId: external_exports.string().min(1),
15019
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15020
+ cancelled: external_exports.boolean().default(false)
15021
+ });
15022
+ var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
15023
+
14967
15024
  // ../../shared-contracts/dist/console.js
14968
15025
  var consoleAnnouncementSchema = external_exports.strictObject({
14969
15026
  title: external_exports.string().trim().min(1).max(200),
@@ -14984,6 +15041,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
14984
15041
  "codexhost/harness/display-settings/set",
14985
15042
  "codexhost/harness/inspect",
14986
15043
  "codexhost/harness/installation",
15044
+ "codexhost/harness/installation/start",
15045
+ "codexhost/harness/installation/status",
14987
15046
  "codexhost/harness/launch-settings/get",
14988
15047
  "codexhost/harness/launch-settings/set",
14989
15048
  "codexhost/harness/web-ui/open",
@@ -15059,7 +15118,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
15059
15118
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
15060
15119
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
15061
15120
  var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
15121
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
15122
+ var composerIndicatorsSchema = external_exports.array(external_exports.object({
15123
+ kind: external_exports.literal("countdown"),
15124
+ id: external_exports.string().min(1).max(64),
15125
+ expiresAtUnix: nonNegativeSafeIntegerSchema,
15126
+ label: indicatorTextSchema(256).optional(),
15127
+ tooltip: indicatorTextSchema(1024).optional()
15128
+ }).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
15129
+ message: "Composer indicator IDs must be unique"
15130
+ });
15062
15131
  var threadUsageSnapshotSchema = external_exports.object({
15132
+ composerIndicators: composerIndicatorsSchema.optional(),
15063
15133
  inputTokens: nonNegativeSafeIntegerSchema.optional(),
15064
15134
  cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
15065
15135
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
@@ -15467,7 +15537,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
15467
15537
  }).strict().optional(),
15468
15538
  autonomousTurns: external_exports.object({
15469
15539
  observe: external_exports.boolean()
15470
- }).strict().optional()
15540
+ }).strict().optional(),
15541
+ /** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
15542
+ steer: external_exports.boolean().optional()
15471
15543
  }).strict();
15472
15544
  var harnessConfigurationStateSchema = external_exports.object({
15473
15545
  effectiveModel: harnessModelRefSchema.optional(),
@@ -15514,7 +15586,9 @@ var harnessInspectionSchema = external_exports.union([
15514
15586
  var harnessInspectParamsSchema = external_exports.object({
15515
15587
  harnessId: harnessIdSchema,
15516
15588
  cwd: nonBlankTextSchema2.max(16384).optional(),
15517
- refresh: external_exports.boolean().optional()
15589
+ refresh: external_exports.boolean().optional(),
15590
+ /** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
15591
+ purpose: external_exports.literal("availability").optional()
15518
15592
  }).strict();
15519
15593
  var harnessWebUiOpenParamsSchema = external_exports.object({
15520
15594
  harnessId: harnessIdSchema
@@ -15597,6 +15671,15 @@ var threadOwnershipListResultSchema = external_exports.object({
15597
15671
  seen.add(thread.threadId);
15598
15672
  }
15599
15673
  });
15674
+ var threadSteeringInspectParamsSchema = external_exports.object({
15675
+ threadId: hostThreadIdSchema,
15676
+ /** The text about to be steered; a Harness command always stops and restarts. */
15677
+ text: external_exports.string().optional()
15678
+ }).strict();
15679
+ var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15680
+ var threadSteeringInspectResultSchema = external_exports.object({
15681
+ delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
15682
+ }).strict();
15600
15683
 
15601
15684
  // ../../shared-contracts/dist/harness-plugins.js
15602
15685
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
@@ -15698,6 +15781,10 @@ var harnessInstallationStateSchema = external_exports.object({
15698
15781
  latestVersion: external_exports.string().min(1).max(128),
15699
15782
  updateAvailable: external_exports.boolean(),
15700
15783
  canUpdate: external_exports.boolean(),
15784
+ /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
15785
+ versionKind: external_exports.enum(["cli", "application"]).optional(),
15786
+ /** Official download opened by the user; does not imply an automatic installation. */
15787
+ manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
15701
15788
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
15702
15789
  message: external_exports.string().max(2048).optional(),
15703
15790
  messageCode: external_exports.string().min(1).max(128).optional(),
@@ -15705,6 +15792,20 @@ var harnessInstallationStateSchema = external_exports.object({
15705
15792
  notice: harnessLocalizedTextSchema.optional(),
15706
15793
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
15707
15794
  }).strict();
15795
+ var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
15796
+ var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
15797
+ external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
15798
+ external_exports.object({
15799
+ taskId: external_exports.string().uuid(),
15800
+ status: external_exports.literal("succeeded"),
15801
+ result: harnessInstallationStateSchema
15802
+ }).strict(),
15803
+ external_exports.object({
15804
+ taskId: external_exports.string().uuid(),
15805
+ status: external_exports.literal("failed"),
15806
+ error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
15807
+ }).strict()
15808
+ ]);
15708
15809
 
15709
15810
  // ../../shared-contracts/dist/codex-accounts.js
15710
15811
  var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
@@ -16190,6 +16291,18 @@ function sanitizeDiagnosticTail(value) {
16190
16291
  return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
16191
16292
  }
16192
16293
 
16294
+ // ../../harness-adapter/dist/steer.js
16295
+ function unsupportedSteer(harnessLabel) {
16296
+ return {
16297
+ ok: false,
16298
+ error: {
16299
+ code: "unsupported",
16300
+ message: `${harnessLabel} cannot steer an active Turn natively`,
16301
+ retryable: false
16302
+ }
16303
+ };
16304
+ }
16305
+
16193
16306
  // ../../harness-adapter/dist/usage.js
16194
16307
  var tokenFields = [
16195
16308
  "inputTokens",
@@ -16217,6 +16330,7 @@ var usageFields = /* @__PURE__ */ new Set([
16217
16330
  ...safeIntegerFields,
16218
16331
  ...percentFields,
16219
16332
  "sessionCacheUsage",
16333
+ "composerIndicators",
16220
16334
  "totalCostUsd",
16221
16335
  "totalCredits",
16222
16336
  "contextUsagePercent",
@@ -16239,26 +16353,27 @@ function parseHostUsage(value) {
16239
16353
  throw new Error(`Harness Usage contains unknown field '${key}'`);
16240
16354
  }
16241
16355
  }
16242
- for (const field2 of [
16356
+ const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16357
+ for (const field3 of [
16243
16358
  "totalCredits",
16244
16359
  "contextUsagePercent",
16245
16360
  "apiOutputTokensPerSecond"
16246
16361
  ]) {
16247
- const candidate = value[field2];
16362
+ const candidate = value[field3];
16248
16363
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16249
- throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16364
+ throw new Error(`Harness Usage '${field3}' must be a finite non-negative number`);
16250
16365
  }
16251
16366
  }
16252
- for (const field2 of tokenFields) {
16253
- const candidate = value[field2];
16367
+ for (const field3 of tokenFields) {
16368
+ const candidate = value[field3];
16254
16369
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16255
- throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16370
+ throw new Error(`Harness Usage '${field3}' must be a non-negative safe integer`);
16256
16371
  }
16257
16372
  }
16258
- for (const field2 of safeIntegerFields) {
16259
- const candidate = value[field2];
16373
+ for (const field3 of safeIntegerFields) {
16374
+ const candidate = value[field3];
16260
16375
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16261
- throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16376
+ throw new Error(`Harness Usage '${field3}' must be a non-negative safe integer`);
16262
16377
  }
16263
16378
  }
16264
16379
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -16267,10 +16382,10 @@ function parseHostUsage(value) {
16267
16382
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
16268
16383
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
16269
16384
  }
16270
- for (const field2 of percentFields) {
16271
- const candidate = value[field2];
16385
+ for (const field3 of percentFields) {
16386
+ const candidate = value[field3];
16272
16387
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
16273
- throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
16388
+ throw new Error(`Harness Usage '${field3}' must be between 0 and 100`);
16274
16389
  }
16275
16390
  }
16276
16391
  if (value.sessionCacheUsage !== void 0) {
@@ -16309,9 +16424,9 @@ function parseHostUsage(value) {
16309
16424
  if (value.costSource !== "publicPrice") {
16310
16425
  throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
16311
16426
  }
16312
- return { ...value, unpricedModels: [...models] };
16427
+ return { ...value, ...indicators, unpricedModels: [...models] };
16313
16428
  }
16314
- return { ...value };
16429
+ return { ...value, ...indicators };
16315
16430
  }
16316
16431
  var requestTokenFields = [
16317
16432
  "inputTokens",
@@ -16341,19 +16456,19 @@ function parseHostUsageRequest(value) {
16341
16456
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
16342
16457
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
16343
16458
  }
16344
- for (const field2 of ["model", "provider"]) {
16345
- const candidate = value[field2];
16459
+ for (const field3 of ["model", "provider"]) {
16460
+ const candidate = value[field3];
16346
16461
  if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
16347
- throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
16462
+ throw new Error(`Harness Usage request '${field3}' must be a non-empty string`);
16348
16463
  }
16349
16464
  }
16350
16465
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
16351
16466
  throw new Error("Harness Usage request 'historical' must be a boolean");
16352
16467
  }
16353
- for (const field2 of requestTokenFields) {
16354
- const candidate = value[field2];
16468
+ for (const field3 of requestTokenFields) {
16469
+ const candidate = value[field3];
16355
16470
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16356
- throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
16471
+ throw new Error(`Harness Usage request '${field3}' must be a non-negative safe integer`);
16357
16472
  }
16358
16473
  }
16359
16474
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -16859,7 +16974,7 @@ var subscriptionSchema = external_exports.object({
16859
16974
  });
16860
16975
  function codingProduct(value) {
16861
16976
  const entry = recordSchema2.safeParse(value).data;
16862
- return [entry?.productId, entry?.productName].some((field2) => typeof field2 === "string" && field2.toLowerCase().includes("coding"));
16977
+ return [entry?.productId, entry?.productName].some((field3) => typeof field3 === "string" && field3.toLowerCase().includes("coding"));
16863
16978
  }
16864
16979
  async function queryEntitlement(family, apiKey, environment) {
16865
16980
  try {
@@ -17172,6 +17287,8 @@ async function accountConfig(installation, environment) {
17172
17287
  states
17173
17288
  },
17174
17289
  startPlan,
17290
+ signedIn: Boolean(family),
17291
+ startPlanChecked: !family || balanceData !== void 0,
17175
17292
  codingPlan
17176
17293
  };
17177
17294
  }
@@ -17277,6 +17394,8 @@ var CliTransport = class {
17277
17394
  // Aborting these cancels only this transport's running and queued shared verifications.
17278
17395
  #headerRequests = /* @__PURE__ */ new Map();
17279
17396
  #startPlan = false;
17397
+ #signedIn = false;
17398
+ #startPlanChecked = true;
17280
17399
  #codingPlan;
17281
17400
  #fault;
17282
17401
  #closed = false;
@@ -17289,6 +17408,14 @@ var CliTransport = class {
17289
17408
  get startPlan() {
17290
17409
  return this.#startPlan;
17291
17410
  }
17411
+ /** Whether ZCode Desktop is signed in to a Zhipu account, whatever that account is entitled to. */
17412
+ get signedIn() {
17413
+ return this.#signedIn;
17414
+ }
17415
+ /** False when the Start Plan balance could not be read, so its entitlement is unknown. */
17416
+ get startPlanChecked() {
17417
+ return this.#startPlanChecked;
17418
+ }
17292
17419
  constructor(options) {
17293
17420
  this.options = options;
17294
17421
  this.#context = {
@@ -17300,9 +17427,11 @@ var CliTransport = class {
17300
17427
  if (this.#child || this.#closed)
17301
17428
  throw new ZcodeError("invalidState", "ZCode transport already started or closed");
17302
17429
  const installation = await resolveInstallation(this.options.environment, this.options.app);
17303
- const { params: accountParams, startPlan, codingPlan } = await accountConfig(installation, this.options.environment);
17430
+ const { params: accountParams, startPlan, signedIn, startPlanChecked, codingPlan } = await accountConfig(installation, this.options.environment);
17304
17431
  this.#installation = installation;
17305
17432
  this.#startPlan = startPlan;
17433
+ this.#signedIn = signedIn;
17434
+ this.#startPlanChecked = startPlanChecked;
17306
17435
  this.#codingPlan = codingPlan;
17307
17436
  const child = spawn(installation.runtime, [installation.cli, "app-server", "--stdio", "--surface", "desktop"], {
17308
17437
  cwd: this.options.cwd,
@@ -17582,16 +17711,16 @@ var CliTransport = class {
17582
17711
  var CONFIG_URL = "https://zcode.z.ai/api/v1/client/configs";
17583
17712
  var CONFIG_TTL_MS = 6e4;
17584
17713
  var CONFIG_TIMEOUT_MS = 15e3;
17585
- var field = external_exports.string().min(1).optional().catch(void 0);
17714
+ var field2 = external_exports.string().min(1).optional().catch(void 0);
17586
17715
  var responseSchema = external_exports.object({
17587
17716
  data: external_exports.object({
17588
17717
  configs: external_exports.object({
17589
17718
  captcha: external_exports.object({
17590
17719
  enabled: external_exports.boolean().optional(),
17591
17720
  skip_model_request: external_exports.boolean().optional(),
17592
- region: field,
17593
- prefix: field,
17594
- sceneId: field
17721
+ region: field2,
17722
+ prefix: field2,
17723
+ sceneId: field2
17595
17724
  }).optional()
17596
17725
  })
17597
17726
  })
@@ -19419,6 +19548,7 @@ async function readHistory(transport, snapshot, events = []) {
19419
19548
 
19420
19549
  // dist/capabilities.js
19421
19550
  var ZCODE_CAPABILITIES = {
19551
+ steer: false,
19422
19552
  configuration: {
19423
19553
  selectModel: true,
19424
19554
  selectThinkingOption: true,
@@ -19593,6 +19723,8 @@ var ZcodeSession = class {
19593
19723
  if (this.#closed || this.#faulted)
19594
19724
  return failure("invalidState", "ZCode session is closed");
19595
19725
  try {
19726
+ if (command.type === "turn.steer")
19727
+ return unsupportedSteer("ZCode");
19596
19728
  if (command.type === "turn.start") {
19597
19729
  if (!hostTurnIdSchema.safeParse(command.turnId).success || !command.input.length || command.input.some((item) => item.type !== "text") || !command.input.some((item) => item.text.trim()))
19598
19730
  return failure("invalidRequest", "ZCode requires nonempty text and a turn ID");
@@ -20001,9 +20133,20 @@ var ZcodeAdapter = class {
20001
20133
  if (!catalog.models.length)
20002
20134
  return {
20003
20135
  status: "unavailable",
20004
- error: {
20136
+ // A signed-in account without an active plan is not a login problem; only a signed-out
20137
+ // ZCode Desktop needs the login prompt.
20138
+ error: !transport.signedIn ? {
20005
20139
  code: "authenticationRequired",
20006
- 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.",
20140
+ 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.",
20141
+ retryable: true
20142
+ } : transport.startPlanChecked ? {
20143
+ code: "configurationRequired",
20144
+ 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.",
20145
+ retryable: true
20146
+ } : {
20147
+ // The balance request failed, so a valid Start Plan may just be unreadable now.
20148
+ code: "configurationRequired",
20149
+ 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.",
20007
20150
  retryable: true
20008
20151
  }
20009
20152
  };