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

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 (40) hide show
  1. package/README.md +2 -2
  2. package/THIRD_PARTY_NOTICES.txt +6 -2
  3. package/app/codexhost-distribution.json +1 -1
  4. package/app/console-server.mjs +70 -20
  5. package/app/console-web.js +61 -18
  6. package/app/desktop-controller.mjs +1142 -69
  7. package/app/host-runtime.mjs +3804 -1949
  8. package/app/plugins/antigravity/plugin.mjs +77 -9
  9. package/app/plugins/claude-code/plugin.mjs +27 -6
  10. package/app/plugins/codebuddy/plugin.mjs +25 -0
  11. package/app/plugins/codex-usage/plugin.mjs +15 -0
  12. package/app/plugins/copilot/plugin.mjs +15 -0
  13. package/app/plugins/cursor-cli/plugin.mjs +43 -8
  14. package/app/plugins/deepseek-harness/plugin.mjs +472 -44
  15. package/app/plugins/devin/assets/icon.svg +1 -0
  16. package/app/plugins/devin/manifest.json +30 -0
  17. package/app/plugins/devin/plugin.mjs +23425 -0
  18. package/app/plugins/enabled.json +2 -0
  19. package/app/plugins/grok/plugin.mjs +470 -387
  20. package/app/plugins/hermes/plugin.mjs +468 -196
  21. package/app/plugins/kimi-code/plugin.mjs +65 -3
  22. package/app/plugins/kiro-cli/plugin.mjs +15 -0
  23. package/app/plugins/muse/plugin.mjs +15 -0
  24. package/app/plugins/omp/plugin.mjs +15 -0
  25. package/app/plugins/opencode/plugin.mjs +15 -0
  26. package/app/plugins/pi/plugin.mjs +1595 -411
  27. package/app/plugins/qoder/plugin.mjs +9539 -8654
  28. package/app/plugins/qoder-cn/plugin.mjs +9539 -8654
  29. package/app/plugins/qwen-code/assets/icon.svg +1 -0
  30. package/app/plugins/qwen-code/manifest.json +29 -0
  31. package/app/plugins/qwen-code/plugin.mjs +29366 -0
  32. package/app/plugins/workbuddy/plugin.mjs +25 -0
  33. package/app/plugins/zcode/plugin.mjs +157 -9
  34. package/app/renderer-extension.js +727 -274
  35. package/bin/boft.exe +0 -0
  36. package/libexec/boft-node-repl.exe +0 -0
  37. package/libexec/boft-shim.exe +0 -0
  38. package/libexec/boft-updater.exe +0 -0
  39. package/licenses/Qwen-Code-SDK-LICENSE.txt +203 -0
  40. package/package.json +2 -2
@@ -15596,6 +15596,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
15596
15596
  /** The text about to be steered; a Harness command always stops and restarts. */
15597
15597
  text: external_exports.string().optional()
15598
15598
  }).strict();
15599
+ var threadSteeringContextSchema = external_exports.object({
15600
+ kind: external_exports.literal("application"),
15601
+ value: external_exports.string().transform((text2, context) => {
15602
+ try {
15603
+ return JSON.parse(text2);
15604
+ } catch {
15605
+ context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
15606
+ return external_exports.NEVER;
15607
+ }
15608
+ }).pipe(external_exports.object({
15609
+ expectedTurnId: hostTurnIdSchema,
15610
+ clientUserMessageId: external_exports.string().min(1),
15611
+ delivery: external_exports.enum(["newTurn", "activeTurn"])
15612
+ }).strict())
15613
+ }).strict().transform((context) => context.value);
15599
15614
  var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15600
15615
  var threadSteeringInspectResultSchema = external_exports.object({
15601
15616
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
@@ -19102,6 +19117,16 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
19102
19117
  continue;
19103
19118
  if (supportsNativeCommands && row.type === "message" && row.role === "user" && data.agent === "compact" && !manualCompactions.has(text(row.id)))
19104
19119
  continue;
19120
+ if (row.type === "message" && row.role === "user" && data.startsNewUserRequest === false && !localCommand && data.agent !== "compact" && !isNativeCompactionSummary(row)) {
19121
+ const contextOnly = body.trim().length > 0 && body.replace(/<system-reminder\b[^>]*\sdata-role=(["'])user-context\1[^>]*>[\s\S]*?<\/system-reminder>/gu, "").trim().length === 0;
19122
+ if (data.isMeta === true || contextOnly)
19123
+ continue;
19124
+ if (current) {
19125
+ if (body)
19126
+ current.input.push({ type: "text", text: body });
19127
+ continue;
19128
+ }
19129
+ }
19105
19130
  if (includeCompactionHistory && isNativeCompactionSummary(row)) {
19106
19131
  if (supportsNativeCommands && current) {
19107
19132
  const outcome = data.isCompacted === true ? { status: "succeeded" } : {
@@ -15782,6 +15782,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
15782
15782
  /** The text about to be steered; a Harness command always stops and restarts. */
15783
15783
  text: external_exports.string().optional()
15784
15784
  }).strict();
15785
+ var threadSteeringContextSchema = external_exports.object({
15786
+ kind: external_exports.literal("application"),
15787
+ value: external_exports.string().transform((text2, context) => {
15788
+ try {
15789
+ return JSON.parse(text2);
15790
+ } catch {
15791
+ context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
15792
+ return external_exports.NEVER;
15793
+ }
15794
+ }).pipe(external_exports.object({
15795
+ expectedTurnId: hostTurnIdSchema,
15796
+ clientUserMessageId: external_exports.string().min(1),
15797
+ delivery: external_exports.enum(["newTurn", "activeTurn"])
15798
+ }).strict())
15799
+ }).strict().transform((context) => context.value);
15785
15800
  var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15786
15801
  var threadSteeringInspectResultSchema = external_exports.object({
15787
15802
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
@@ -16932,7 +16947,7 @@ function createZcodeInstallation(environment, app) {
16932
16947
  }
16933
16948
 
16934
16949
  // dist/account.js
16935
- import { createHash as createHash3 } from "node:crypto";
16950
+ import { createHash as createHash4 } from "node:crypto";
16936
16951
  import { readFile as readFile3 } from "node:fs/promises";
16937
16952
  import path5 from "node:path";
16938
16953
 
@@ -16981,10 +16996,100 @@ async function readCredential(installation, environment, key) {
16981
16996
  }
16982
16997
 
16983
16998
  // dist/personal-coding-plan.js
16984
- import { createHash as createHash2 } from "node:crypto";
16999
+ import { createHash as createHash3 } from "node:crypto";
16985
17000
  import { readFile as readFile2 } from "node:fs/promises";
16986
17001
  import { homedir as homedir3 } from "node:os";
16987
17002
  import path4 from "node:path";
17003
+
17004
+ // dist/project-token.js
17005
+ import { createHash as createHash2 } from "node:crypto";
17006
+ var locationSchema = external_exports.object({
17007
+ organizationId: external_exports.string().trim().min(1),
17008
+ projectId: external_exports.string().trim().min(1),
17009
+ apiKeyId: external_exports.string().trim().min(1)
17010
+ });
17011
+ function readProjectCredential(credential, family, identity, origin) {
17012
+ const key = `project-key-location:v1:${encodeURIComponent(JSON.stringify([origin, family, identity, null, 1, "non-team"]))}`;
17013
+ const raw = credential(key);
17014
+ if (!raw)
17015
+ return void 0;
17016
+ const location = locationSchema.parse(JSON.parse(raw));
17017
+ const login = credential(`oauth:${family}:access_token`).trim();
17018
+ const loginToken = login.replace(/^Bearer\s+/i, "").trim();
17019
+ if (!loginToken)
17020
+ throw projectCredentialError();
17021
+ const accountScope = createHash2("sha256").update(JSON.stringify([
17022
+ family,
17023
+ "individual-coding-plan",
17024
+ null,
17025
+ login,
17026
+ credential("zcodejwttoken").trim() || null
17027
+ ])).digest("hex");
17028
+ return { origin, loginToken, location, accountScope };
17029
+ }
17030
+ var tokenSchema = external_exports.object({
17031
+ success: external_exports.boolean().optional(),
17032
+ code: external_exports.union([external_exports.literal(0), external_exports.literal(200), external_exports.literal("0"), external_exports.literal("200")]),
17033
+ data: external_exports.object({
17034
+ enable: external_exports.boolean().optional(),
17035
+ accessToken: external_exports.string().trim().min(1),
17036
+ tokenType: external_exports.literal("Bearer"),
17037
+ expiresIn: external_exports.number().finite().positive(),
17038
+ expiresAt: external_exports.number().finite().positive()
17039
+ })
17040
+ });
17041
+ function projectCredentialError() {
17042
+ return new ZcodeError("authenticationRequired", "ZCode Personal Coding Plan project credentials are unavailable. Open the personal plan in ZCode Desktop, then re-detect ZCode and reopen the Thread");
17043
+ }
17044
+ var ProjectToken = class {
17045
+ #cached;
17046
+ async resolve(credential, appVersion, signal, rejectedFingerprint) {
17047
+ signal.throwIfAborted();
17048
+ const scope = createHash2("sha256").update(JSON.stringify(credential)).digest("hex");
17049
+ const cached2 = this.#cached;
17050
+ if (cached2?.scope === scope && cached2.fingerprint !== rejectedFingerprint && cached2.expiresAt > Date.now() + 12e4)
17051
+ return cached2.token;
17052
+ this.#cached = void 0;
17053
+ const { origin, location, loginToken } = credential;
17054
+ const url2 = `${origin}/api/biz/v1/organization/${encodeURIComponent(location.organizationId)}/projects/${encodeURIComponent(location.projectId)}/api_keys/${encodeURIComponent(location.apiKeyId)}/access_tokens`;
17055
+ const started = Date.now();
17056
+ try {
17057
+ const response = await fetch(url2, {
17058
+ method: "POST",
17059
+ headers: { Authorization: `Bearer ${loginToken}`, "Content-Type": "application/json" },
17060
+ body: JSON.stringify({ clientType: "zcode", clientVersion: appVersion }),
17061
+ redirect: "error",
17062
+ signal: AbortSignal.any([signal, AbortSignal.timeout(15e3)])
17063
+ });
17064
+ if (!response.ok)
17065
+ throw projectCredentialError();
17066
+ const parsed = tokenSchema.safeParse(await response.json());
17067
+ if (!parsed.success || parsed.data.success === false || parsed.data.data.enable === false)
17068
+ throw projectCredentialError();
17069
+ const data = parsed.data.data;
17070
+ const expiresAt = Math.min(data.expiresAt * 1e3, started + data.expiresIn * 1e3);
17071
+ signal.throwIfAborted();
17072
+ if (expiresAt <= Date.now())
17073
+ throw projectCredentialError();
17074
+ this.#cached = {
17075
+ scope,
17076
+ token: data.accessToken,
17077
+ expiresAt,
17078
+ fingerprint: createHash2("sha256").update(data.accessToken).digest("hex")
17079
+ };
17080
+ return data.accessToken;
17081
+ } catch (error51) {
17082
+ signal.throwIfAborted();
17083
+ if (error51 instanceof ZcodeError)
17084
+ throw error51;
17085
+ if (error51 instanceof Error && error51.name === "TimeoutError")
17086
+ throw new ZcodeError("unavailable", "ZCode project token request timed out. Try again.", true);
17087
+ throw projectCredentialError();
17088
+ }
17089
+ }
17090
+ };
17091
+
17092
+ // dist/personal-coding-plan.js
16988
17093
  var familySchema = external_exports.enum(["zai", "bigmodel"]);
16989
17094
  var recordSchema2 = external_exports.record(external_exports.string(), external_exports.unknown());
16990
17095
  var CONNECT = "Connect Personal Coding Plan in ZCode Desktop, then re-detect ZCode and reopen the Thread";
@@ -17038,7 +17143,7 @@ async function queryEntitlement(family, apiKey, environment) {
17038
17143
  try {
17039
17144
  const response = await fetch(`${personalCodingPlanOrigin(family, environment)}/api/biz/subscription/list`, {
17040
17145
  method: "GET",
17041
- // The subscription endpoint accepts the model API Key, not the OAuth token or Start JWT.
17146
+ // Legacy Desktop uses a personal API Key; project-token Desktop uses its OAuth login.
17042
17147
  headers: { Authorization: apiKey.trim() },
17043
17148
  redirect: "error",
17044
17149
  signal: AbortSignal.timeout(15e3)
@@ -17072,6 +17177,8 @@ var PersonalCodingPlanAccount = class {
17072
17177
  installation;
17073
17178
  environment;
17074
17179
  #authorized = /* @__PURE__ */ new Map();
17180
+ #projectToken = new ProjectToken();
17181
+ issue;
17075
17182
  constructor(installation, environment) {
17076
17183
  this.installation = installation;
17077
17184
  this.environment = environment;
@@ -17091,12 +17198,16 @@ var PersonalCodingPlanAccount = class {
17091
17198
  const identity = normalized ? normalized.id.trim() : family === "zai" && typeof profile.user_id === "string" ? profile.user_id.trim() : "";
17092
17199
  if (!identity || identity === "unknown")
17093
17200
  return void 0;
17201
+ const project2 = readProjectCredential(credential, family, identity, personalCodingPlanOrigin(family, this.environment));
17202
+ if (project2)
17203
+ return { identity, current, apiKey: project2.loginToken, project: project2 };
17094
17204
  const key = `account-provider:coding-plan:${providerId}:account:${encodeURIComponent(identity)}:api-key`;
17095
17205
  return { identity, current, apiKey: credential(key).trim() };
17096
17206
  }
17097
17207
  async inspect(providerId, accountType) {
17098
17208
  const family = familySchema.parse(accountType);
17099
17209
  this.#authorized.delete(providerId);
17210
+ this.issue = void 0;
17100
17211
  let current = false;
17101
17212
  try {
17102
17213
  const context = await this.#context(providerId, family);
@@ -17108,24 +17219,29 @@ var PersonalCodingPlanAccount = class {
17108
17219
  unavailableReason: "not-connected"
17109
17220
  };
17110
17221
  current = context.current;
17111
- const connectionKey = createHash2("sha256").update(JSON.stringify([family, context.identity, "individual-coding-plan"])).digest("hex");
17222
+ const connectionKey = createHash3("sha256").update(JSON.stringify([family, context.identity, "individual-coding-plan"])).digest("hex");
17112
17223
  const base = { current, connectionKey };
17113
- if (!context.apiKey)
17224
+ if (!context.apiKey) {
17225
+ if (current)
17226
+ this.issue = "ZCode is signed in, but its Personal Coding Plan credentials are not initialized. Open the personal plan in ZCode Desktop, then re-detect ZCode. This does not mean the subscription is inactive.";
17114
17227
  return {
17115
17228
  ...base,
17116
17229
  availability: "unavailable",
17117
17230
  entitled: false,
17118
17231
  unavailableReason: "credential-failed"
17119
17232
  };
17233
+ }
17120
17234
  const entitlement = await queryEntitlement(family, context.apiKey, this.environment);
17121
17235
  const after = await this.#context(providerId, family);
17122
- if (!after || after.identity !== context.identity || after.current !== current || after.apiKey !== context.apiKey)
17236
+ if (!after || after.identity !== context.identity || after.current !== current || after.apiKey !== context.apiKey || JSON.stringify(after.project) !== JSON.stringify(context.project))
17123
17237
  return { availability: "unknown", entitled: false, current: false };
17124
17238
  if (entitlement === "available") {
17125
17239
  if (current)
17126
17240
  this.#authorized.set(providerId, { family, identity: context.identity });
17127
17241
  return { ...base, availability: "available", entitled: true };
17128
17242
  }
17243
+ if (current)
17244
+ this.issue = entitlement === "unavailable" ? "ZCode Personal Coding Plan subscription check found no active subscription. Check the selected account in ZCode Desktop, then re-detect ZCode." : "ZCode Personal Coding Plan credentials or subscription could not be verified. Open the personal plan in ZCode Desktop, then re-detect ZCode; subscription status is unknown.";
17129
17245
  return {
17130
17246
  ...base,
17131
17247
  availability: entitlement === "unknown" ? "unknown" : "unavailable",
@@ -17135,6 +17251,9 @@ var PersonalCodingPlanAccount = class {
17135
17251
  }
17136
17252
  };
17137
17253
  } catch {
17254
+ current = await readSelection(this.environment, family).catch(() => false);
17255
+ if (current)
17256
+ this.issue = "ZCode Personal Coding Plan credentials could not be read or verified. Open the personal plan in ZCode Desktop, then re-detect ZCode; subscription status is unknown.";
17138
17257
  return { availability: "unknown", entitled: false, current };
17139
17258
  }
17140
17259
  }
@@ -17146,7 +17265,9 @@ var PersonalCodingPlanAccount = class {
17146
17265
  type: external_exports.literal("zhipu-account"),
17147
17266
  mode: external_exports.literal("individual-coding-plan"),
17148
17267
  accountType: familySchema
17149
- })
17268
+ }),
17269
+ expectedAccountScope: external_exports.string().optional(),
17270
+ rejectedProjectTokenFingerprint: external_exports.string().optional()
17150
17271
  }).safeParse(request);
17151
17272
  if (!parsed.success)
17152
17273
  throw new ZcodeError("authenticationRequired", CONNECT);
@@ -17159,6 +17280,23 @@ var PersonalCodingPlanAccount = class {
17159
17280
  signal.throwIfAborted();
17160
17281
  if (!context?.current || context.identity !== authorized.identity || !context.apiKey)
17161
17282
  throw new ZcodeError("authenticationRequired", CONNECT);
17283
+ if (context.project) {
17284
+ const { expectedAccountScope, rejectedProjectTokenFingerprint } = parsed.data;
17285
+ if (expectedAccountScope !== void 0 && expectedAccountScope !== context.project.accountScope || rejectedProjectTokenFingerprint && !expectedAccountScope)
17286
+ throw new ZcodeError("authenticationRequired", CONNECT);
17287
+ const apiKey = await this.#projectToken.resolve(context.project, this.installation.version, signal, rejectedProjectTokenFingerprint);
17288
+ const after = await this.#context(providerId, authorized.family);
17289
+ signal.throwIfAborted();
17290
+ if (!after?.current || after.identity !== context.identity || JSON.stringify(after.project) !== JSON.stringify(context.project))
17291
+ throw new ZcodeError("authenticationRequired", CONNECT);
17292
+ return {
17293
+ apiKey,
17294
+ apiKeyId: context.project.location.apiKeyId,
17295
+ accountScope: context.project.accountScope
17296
+ };
17297
+ }
17298
+ if (parsed.data.expectedAccountScope !== void 0 || parsed.data.rejectedProjectTokenFingerprint)
17299
+ throw new ZcodeError("authenticationRequired", CONNECT);
17162
17300
  return { apiKey: context.apiKey };
17163
17301
  }
17164
17302
  };
@@ -17284,7 +17422,7 @@ async function queryStartPlanBalance(origin, appVersion, jwt2, deviceMid) {
17284
17422
  async function accountConfig(installation, environment) {
17285
17423
  const file2 = installation.builtinProviderConfig;
17286
17424
  const builtin = builtinSchema.parse(JSON.parse(await readFile3(file2, "utf8")));
17287
- const basedOnZCodeBuiltinRevision = `zcode-builtin:${builtin.revision}:${createHash3("sha256").update(path5.resolve(file2)).digest("hex")}`;
17425
+ const basedOnZCodeBuiltinRevision = `zcode-builtin:${builtin.revision}:${createHash4("sha256").update(path5.resolve(file2)).digest("hex")}`;
17288
17426
  const family = await readCredential(installation, environment, "oauth:active_provider");
17289
17427
  let balanceData;
17290
17428
  if (family) {
@@ -17336,7 +17474,7 @@ async function accountConfig(installation, environment) {
17336
17474
  };
17337
17475
  }
17338
17476
  }
17339
- const overlayDigest = createHash3("sha256").update(JSON.stringify([providers, states])).digest("hex").slice(0, 16);
17477
+ const overlayDigest = createHash4("sha256").update(JSON.stringify([providers, states])).digest("hex").slice(0, 16);
17340
17478
  return {
17341
17479
  params: {
17342
17480
  revision: `codexhost:${family || "signed-out"}:${builtin.revision}:${overlayDigest}`,
@@ -17353,6 +17491,7 @@ async function accountConfig(installation, environment) {
17353
17491
  async function providerRuntimeHeaders(request, signal, installation, environment, verifier, codingPlan) {
17354
17492
  const mode = external_exports.object({ mode: external_exports.string() }).safeParse(request.accountAccess).data?.mode;
17355
17493
  try {
17494
+ signal.throwIfAborted();
17356
17495
  if (mode === "individual-coding-plan")
17357
17496
  return { headersApplied: true, requestAuth: await codingPlan.requestAuth(request, signal) };
17358
17497
  if (mode !== "start-plan")
@@ -17366,6 +17505,8 @@ async function providerRuntimeHeaders(request, signal, installation, environment
17366
17505
  const headers = await verifier().verify(signal);
17367
17506
  return { headersApplied: true, requestAuth: { apiKey, headers } };
17368
17507
  } catch (error51) {
17508
+ if (signal.aborted)
17509
+ return { headersApplied: false };
17369
17510
  return {
17370
17511
  headersApplied: false,
17371
17512
  errorMessage: error51 instanceof ZcodeError ? error51.message : "ZCode account authentication failed"
@@ -17474,6 +17615,9 @@ var CliTransport = class {
17474
17615
  get startPlanChecked() {
17475
17616
  return this.#startPlanChecked;
17476
17617
  }
17618
+ get codingPlanIssue() {
17619
+ return this.#codingPlan?.issue;
17620
+ }
17477
17621
  constructor(options) {
17478
17622
  this.options = options;
17479
17623
  this.#context = {
@@ -20197,6 +20341,10 @@ var ZcodeAdapter = class {
20197
20341
  code: "authenticationRequired",
20198
20342
  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
20343
  retryable: true
20344
+ } : transport.codingPlanIssue ? {
20345
+ code: "configurationRequired",
20346
+ message: transport.codingPlanIssue,
20347
+ retryable: true
20200
20348
  } : transport.startPlanChecked ? {
20201
20349
  code: "configurationRequired",
20202
20350
  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.",