@liberseek/boft-cli-win32-arm64 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +36 -3
- package/app/console-web.js +100 -75
- package/app/desktop-controller.mjs +36 -3
- package/app/host-runtime.mjs +81 -21
- package/app/plugins/antigravity/plugin.mjs +52 -7
- package/app/plugins/claude-code/plugin.mjs +206 -54
- package/app/plugins/codebuddy/plugin.mjs +110 -8
- package/app/plugins/codex-usage/plugin.mjs +36 -3
- package/app/plugins/cursor-cli/plugin.mjs +71 -10
- package/app/plugins/deepseek-harness/manifest.json +2 -2
- package/app/plugins/deepseek-harness/plugin.mjs +198 -26
- package/app/plugins/grok/plugin.mjs +64 -5
- package/app/plugins/hermes/plugin.mjs +63 -3
- package/app/plugins/kimi-code/plugin.mjs +64 -9
- package/app/plugins/kiro-cli/plugin.mjs +45 -3
- package/app/plugins/muse/plugin.mjs +36 -3
- package/app/plugins/omp/plugin.mjs +46 -3
- package/app/plugins/opencode/plugin.mjs +52 -5
- package/app/plugins/pi/plugin.mjs +37 -3
- package/app/plugins/qoder/plugin.mjs +50 -3
- package/app/plugins/qoder-cn/plugin.mjs +50 -3
- package/app/plugins/workbuddy/plugin.mjs +227 -12
- package/app/plugins/zcode/plugin.mjs +49 -3
- package/app/renderer-extension.js +369 -281
- package/bin/boft.exe +0 -0
- package/libexec/boft-node-repl.exe +0 -0
- package/libexec/boft-shim.exe +0 -0
- package/libexec/boft-updater.exe +0 -0
- package/package.json +1 -1
|
@@ -14604,6 +14604,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
14604
14604
|
initializeOnly: external_exports.boolean().optional()
|
|
14605
14605
|
});
|
|
14606
14606
|
|
|
14607
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
14608
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
14609
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
14610
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
14611
|
+
label: displayText(256).optional(),
|
|
14612
|
+
description: displayText(1024).optional()
|
|
14613
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14614
|
+
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");
|
|
14615
|
+
|
|
14607
14616
|
// ../../shared-contracts/dist/model-price-overrides.js
|
|
14608
14617
|
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
14609
14618
|
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
@@ -15024,8 +15033,24 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15024
15033
|
}
|
|
15025
15034
|
});
|
|
15026
15035
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15036
|
+
var accountCreditsPeriodSchema = external_exports.enum([
|
|
15037
|
+
"weekly",
|
|
15038
|
+
"monthly",
|
|
15039
|
+
"five_hour",
|
|
15040
|
+
"seven_day",
|
|
15041
|
+
"unknown"
|
|
15042
|
+
]);
|
|
15043
|
+
var accountCreditsScopeSchema = external_exports.object({
|
|
15044
|
+
id: external_exports.string().min(1).max(256),
|
|
15045
|
+
label: external_exports.string().min(1).max(256),
|
|
15046
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15047
|
+
}).strict();
|
|
15027
15048
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
15028
15049
|
product: external_exports.string().min(1),
|
|
15050
|
+
/** Native period and scope, never inferred from the display name. */
|
|
15051
|
+
periodType: accountCreditsPeriodSchema.optional(),
|
|
15052
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15053
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15029
15054
|
used: external_exports.number().finite().nonnegative().optional(),
|
|
15030
15055
|
// Zero is a real empty cap, not an absent field.
|
|
15031
15056
|
limit: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -15047,8 +15072,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
15047
15072
|
label: external_exports.string().min(1).optional(),
|
|
15048
15073
|
usedPercent: usagePercentSchema.optional(),
|
|
15049
15074
|
remaining: external_exports.number().finite().optional(),
|
|
15075
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15076
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15050
15077
|
resetsAt: external_exports.string().min(1).optional(),
|
|
15051
|
-
periodType:
|
|
15078
|
+
periodType: accountCreditsPeriodSchema,
|
|
15052
15079
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
15053
15080
|
resetCredits: accountResetCreditsSchema.optional()
|
|
15054
15081
|
}).strict().superRefine((credits, context) => {
|
|
@@ -15073,7 +15100,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
|
|
|
15073
15100
|
var threadUsageInspectionSchema = external_exports.object({
|
|
15074
15101
|
threadId: hostThreadIdSchema,
|
|
15075
15102
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15076
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15103
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15104
|
+
/** Whether this source can provide cached account quota independently of usage. */
|
|
15105
|
+
accountCreditsSupported: external_exports.boolean().optional()
|
|
15077
15106
|
}).strict();
|
|
15078
15107
|
|
|
15079
15108
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
@@ -15200,7 +15229,8 @@ var harnessPermissionModeSchema = external_exports.object({
|
|
|
15200
15229
|
id: harnessPermissionModeIdSchema,
|
|
15201
15230
|
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15202
15231
|
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15203
|
-
dangerous: external_exports.boolean().optional()
|
|
15232
|
+
dangerous: external_exports.boolean().optional(),
|
|
15233
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15204
15234
|
}).strict();
|
|
15205
15235
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15206
15236
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
@@ -15523,6 +15553,8 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15523
15553
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15524
15554
|
message: external_exports.string().max(2048).optional(),
|
|
15525
15555
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
15556
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
15557
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
15526
15558
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15527
15559
|
}).strict();
|
|
15528
15560
|
|
|
@@ -15661,6 +15693,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
15661
15693
|
invocation: commandInvocationSchema,
|
|
15662
15694
|
label: commandLabelSchema,
|
|
15663
15695
|
description: commandDescriptionSchema.optional(),
|
|
15696
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15664
15697
|
argumentMode: external_exports.enum(["none", "text"]),
|
|
15665
15698
|
/**
|
|
15666
15699
|
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
@@ -17237,6 +17270,8 @@ var BrokeredHarnessAdapter = class {
|
|
|
17237
17270
|
commandCatalog;
|
|
17238
17271
|
liveCommandCatalog;
|
|
17239
17272
|
harnessId;
|
|
17273
|
+
credits;
|
|
17274
|
+
refreshCredits;
|
|
17240
17275
|
#descriptorPath;
|
|
17241
17276
|
#forwardEnvironment;
|
|
17242
17277
|
#isInstalled;
|
|
@@ -17336,6 +17371,10 @@ var BrokeredHarnessAdapter = class {
|
|
|
17336
17371
|
}
|
|
17337
17372
|
constructor(input = {}) {
|
|
17338
17373
|
this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
|
|
17374
|
+
if (input.accountCredits !== false) {
|
|
17375
|
+
this.credits = () => this.#credits;
|
|
17376
|
+
this.refreshCredits = () => this.#refreshAccountCredits();
|
|
17377
|
+
}
|
|
17339
17378
|
this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
|
|
17340
17379
|
if (input.commandCatalog)
|
|
17341
17380
|
this.commandCatalog = input.commandCatalog;
|
|
@@ -17347,10 +17386,7 @@ var BrokeredHarnessAdapter = class {
|
|
|
17347
17386
|
this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
|
|
17348
17387
|
this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
|
|
17349
17388
|
}
|
|
17350
|
-
|
|
17351
|
-
return this.#credits;
|
|
17352
|
-
}
|
|
17353
|
-
refreshCredits() {
|
|
17389
|
+
#refreshAccountCredits() {
|
|
17354
17390
|
if (this.#closed)
|
|
17355
17391
|
return Promise.resolve(null);
|
|
17356
17392
|
if (this.#creditsRefresh)
|
|
@@ -17769,7 +17805,7 @@ function createClaudeUsageStatistics(environment) {
|
|
|
17769
17805
|
}
|
|
17770
17806
|
|
|
17771
17807
|
// dist/claude-code-adapter.js
|
|
17772
|
-
import { randomUUID as
|
|
17808
|
+
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
17773
17809
|
import path18 from "node:path";
|
|
17774
17810
|
|
|
17775
17811
|
// ../../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
@@ -56285,6 +56321,10 @@ var ClaudeSessionImportIndex = class {
|
|
|
56285
56321
|
}
|
|
56286
56322
|
};
|
|
56287
56323
|
|
|
56324
|
+
// dist/claude-fork-references.js
|
|
56325
|
+
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
56326
|
+
import { readFile as readFile6, rename as rename4, rm as rm5, stat as stat5, writeFile as writeFile2 } from "node:fs/promises";
|
|
56327
|
+
|
|
56288
56328
|
// dist/claude-transcript.js
|
|
56289
56329
|
import os5 from "node:os";
|
|
56290
56330
|
import path13 from "node:path";
|
|
@@ -56320,6 +56360,9 @@ async function findTranscriptFile(environment, cwd, relativeName) {
|
|
|
56320
56360
|
}
|
|
56321
56361
|
return null;
|
|
56322
56362
|
}
|
|
56363
|
+
function findClaudeTranscript(input) {
|
|
56364
|
+
return findTranscriptFile(input.environment, input.cwd, `${input.sessionId}.jsonl`);
|
|
56365
|
+
}
|
|
56323
56366
|
function isRecord8(value) {
|
|
56324
56367
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56325
56368
|
}
|
|
@@ -56342,7 +56385,7 @@ function parseTranscriptRecords(contents, sessionId) {
|
|
|
56342
56385
|
return [...messages.values()];
|
|
56343
56386
|
}
|
|
56344
56387
|
async function readClaudeTranscript(input) {
|
|
56345
|
-
const transcript = await
|
|
56388
|
+
const transcript = await findClaudeTranscript(input);
|
|
56346
56389
|
if (!transcript)
|
|
56347
56390
|
return null;
|
|
56348
56391
|
return parseTranscriptRecords(await readFile5(transcript, "utf8"), input.sessionId);
|
|
@@ -56355,9 +56398,83 @@ async function readClaudeSubagentTranscript(input) {
|
|
|
56355
56398
|
return parseTranscriptRecords(await readFile5(transcript, "utf8"), input.sessionId);
|
|
56356
56399
|
}
|
|
56357
56400
|
|
|
56401
|
+
// dist/claude-fork-references.js
|
|
56402
|
+
function isRecord9(value) {
|
|
56403
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56404
|
+
}
|
|
56405
|
+
function parseEntry(line) {
|
|
56406
|
+
if (line.trim().length === 0)
|
|
56407
|
+
return null;
|
|
56408
|
+
try {
|
|
56409
|
+
const entry = JSON.parse(line);
|
|
56410
|
+
return isRecord9(entry) ? entry : null;
|
|
56411
|
+
} catch {
|
|
56412
|
+
return null;
|
|
56413
|
+
}
|
|
56414
|
+
}
|
|
56415
|
+
function remapSameAs(value, copies) {
|
|
56416
|
+
if (Array.isArray(value)) {
|
|
56417
|
+
return value.reduce((count4, item) => count4 + remapSameAs(item, copies), 0);
|
|
56418
|
+
}
|
|
56419
|
+
if (!isRecord9(value))
|
|
56420
|
+
return 0;
|
|
56421
|
+
let count3 = 0;
|
|
56422
|
+
for (const [key, child] of Object.entries(value)) {
|
|
56423
|
+
const copy = key === "sameAs" && typeof child === "string" ? copies.get(child) : void 0;
|
|
56424
|
+
if (copy) {
|
|
56425
|
+
value[key] = copy;
|
|
56426
|
+
count3 += 1;
|
|
56427
|
+
} else {
|
|
56428
|
+
count3 += remapSameAs(child, copies);
|
|
56429
|
+
}
|
|
56430
|
+
}
|
|
56431
|
+
return count3;
|
|
56432
|
+
}
|
|
56433
|
+
async function remapForkedSessionReferences(input) {
|
|
56434
|
+
const transcript = await findClaudeTranscript(input);
|
|
56435
|
+
if (!transcript)
|
|
56436
|
+
return 0;
|
|
56437
|
+
const contents = await readFile6(transcript, "utf8");
|
|
56438
|
+
if (!contents.includes('"sameAs"'))
|
|
56439
|
+
return 0;
|
|
56440
|
+
const lines = contents.split("\n");
|
|
56441
|
+
const entries = lines.map(parseEntry);
|
|
56442
|
+
const copies = /* @__PURE__ */ new Map();
|
|
56443
|
+
for (const entry of entries) {
|
|
56444
|
+
const source = entry?.forkedFrom;
|
|
56445
|
+
if (typeof entry?.uuid === "string" && isRecord9(source) && typeof source.messageUuid === "string") {
|
|
56446
|
+
copies.set(source.messageUuid, entry.uuid);
|
|
56447
|
+
}
|
|
56448
|
+
}
|
|
56449
|
+
let remapped = 0;
|
|
56450
|
+
const output = lines.map((line, index) => {
|
|
56451
|
+
const entry = entries[index];
|
|
56452
|
+
if (entry?.type !== "attachment")
|
|
56453
|
+
return line;
|
|
56454
|
+
const count3 = remapSameAs(entry.attachment, copies);
|
|
56455
|
+
if (count3 === 0)
|
|
56456
|
+
return line;
|
|
56457
|
+
remapped += count3;
|
|
56458
|
+
return JSON.stringify(entry);
|
|
56459
|
+
});
|
|
56460
|
+
if (remapped === 0)
|
|
56461
|
+
return 0;
|
|
56462
|
+
const temporary = `${transcript}.${randomUUID4()}.tmp`;
|
|
56463
|
+
try {
|
|
56464
|
+
await writeFile2(temporary, output.join("\n"), {
|
|
56465
|
+
flag: "wx",
|
|
56466
|
+
mode: (await stat5(transcript)).mode & 511
|
|
56467
|
+
});
|
|
56468
|
+
await rename4(temporary, transcript);
|
|
56469
|
+
} finally {
|
|
56470
|
+
await rm5(temporary, { force: true });
|
|
56471
|
+
}
|
|
56472
|
+
return remapped;
|
|
56473
|
+
}
|
|
56474
|
+
|
|
56358
56475
|
// dist/long-context.js
|
|
56359
|
-
import { randomUUID as
|
|
56360
|
-
import { mkdir as mkdir4, readFile as
|
|
56476
|
+
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
56477
|
+
import { mkdir as mkdir4, readFile as readFile7, rename as rename5, rm as rm6, writeFile as writeFile3 } from "node:fs/promises";
|
|
56361
56478
|
import os6 from "node:os";
|
|
56362
56479
|
import path14 from "node:path";
|
|
56363
56480
|
var MILLION_CONTEXT_MODELS = [{ id: "claude-opus-5-5", aliases: ["claude-opus-5.5"] }];
|
|
@@ -56369,7 +56486,7 @@ function claudeLongContextFile(environment) {
|
|
|
56369
56486
|
}
|
|
56370
56487
|
async function readClaudeLongContext(environment) {
|
|
56371
56488
|
try {
|
|
56372
|
-
const parsed = JSON.parse(await
|
|
56489
|
+
const parsed = JSON.parse(await readFile7(claudeLongContextFile(environment), "utf8"));
|
|
56373
56490
|
if (typeof parsed === "object" && parsed !== null && "enabled" in parsed && typeof parsed.enabled === "boolean") {
|
|
56374
56491
|
return parsed.enabled;
|
|
56375
56492
|
}
|
|
@@ -56380,13 +56497,13 @@ async function readClaudeLongContext(environment) {
|
|
|
56380
56497
|
async function writeClaudeLongContext(environment, enabled) {
|
|
56381
56498
|
const file2 = claudeLongContextFile(environment);
|
|
56382
56499
|
await mkdir4(path14.dirname(file2), { recursive: true, mode: 448 });
|
|
56383
|
-
const temporary = `${file2}.${
|
|
56500
|
+
const temporary = `${file2}.${randomUUID5()}.tmp`;
|
|
56384
56501
|
try {
|
|
56385
|
-
await
|
|
56502
|
+
await writeFile3(temporary, `${JSON.stringify({ enabled })}
|
|
56386
56503
|
`, { mode: 384, flag: "wx" });
|
|
56387
|
-
await
|
|
56504
|
+
await rename5(temporary, file2);
|
|
56388
56505
|
} finally {
|
|
56389
|
-
await
|
|
56506
|
+
await rm6(temporary, { force: true });
|
|
56390
56507
|
}
|
|
56391
56508
|
return enabled;
|
|
56392
56509
|
}
|
|
@@ -56401,7 +56518,7 @@ function claudeSessionModel(model2, enabled) {
|
|
|
56401
56518
|
|
|
56402
56519
|
// dist/model-catalog.js
|
|
56403
56520
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
56404
|
-
import { readFile as
|
|
56521
|
+
import { readFile as readFile8 } from "node:fs/promises";
|
|
56405
56522
|
import os7 from "node:os";
|
|
56406
56523
|
import path15 from "node:path";
|
|
56407
56524
|
|
|
@@ -56541,7 +56658,7 @@ async function readClaudeUserModelPicker(environment = process.env) {
|
|
|
56541
56658
|
const settingsPath = path15.join(resolveClaudeConfigDirectory(environment), "settings.json");
|
|
56542
56659
|
let raw;
|
|
56543
56660
|
try {
|
|
56544
|
-
raw = await
|
|
56661
|
+
raw = await readFile8(settingsPath, "utf8");
|
|
56545
56662
|
} catch {
|
|
56546
56663
|
return void 0;
|
|
56547
56664
|
}
|
|
@@ -56700,26 +56817,38 @@ var claudePermissionModes = [
|
|
|
56700
56817
|
{
|
|
56701
56818
|
id: "plan",
|
|
56702
56819
|
label: "Plan mode",
|
|
56820
|
+
localizations: {
|
|
56821
|
+
"zh-CN": {
|
|
56822
|
+
label: "规划模式",
|
|
56823
|
+
description: "探索并制定计划;批准计划后退出规划,恢复此前的权限模式。"
|
|
56824
|
+
}
|
|
56825
|
+
},
|
|
56703
56826
|
description: "Explore and prepare a plan; approval exits planning and resumes the previous permission mode."
|
|
56704
56827
|
},
|
|
56705
56828
|
{
|
|
56706
56829
|
id: "default",
|
|
56707
56830
|
label: "Default",
|
|
56831
|
+
localizations: { "zh-CN": { label: "默认", description: "编辑和其他受保护操作前询问。" } },
|
|
56708
56832
|
description: "Ask before edits and other protected actions."
|
|
56709
56833
|
},
|
|
56710
56834
|
{
|
|
56711
56835
|
id: "acceptEdits",
|
|
56712
56836
|
label: "Accept edits",
|
|
56837
|
+
localizations: {
|
|
56838
|
+
"zh-CN": { label: "接受编辑", description: "允许文件编辑;其他受保护操作前询问。" }
|
|
56839
|
+
},
|
|
56713
56840
|
description: "Allow file edits and ask for other protected actions."
|
|
56714
56841
|
},
|
|
56715
56842
|
{
|
|
56716
56843
|
id: "auto",
|
|
56717
56844
|
label: "Auto mode",
|
|
56845
|
+
localizations: { "zh-CN": { label: "自动模式", description: "由 Claude 判断权限请求。" } },
|
|
56718
56846
|
description: "Let Claude classify permission requests."
|
|
56719
56847
|
},
|
|
56720
56848
|
{
|
|
56721
56849
|
id: "bypassPermissions",
|
|
56722
56850
|
label: "Bypass permissions",
|
|
56851
|
+
localizations: { "zh-CN": { label: "绕过权限", description: "跳过 Claude Code 权限检查。" } },
|
|
56723
56852
|
description: "Skip Claude Code permission checks.",
|
|
56724
56853
|
dangerous: true
|
|
56725
56854
|
}
|
|
@@ -56826,23 +56955,24 @@ function projectClaudeAccountUsage(usage, account) {
|
|
|
56826
56955
|
return null;
|
|
56827
56956
|
const limits = usage.rate_limits;
|
|
56828
56957
|
const windows = [];
|
|
56829
|
-
const add = (product, periodType, value) => {
|
|
56958
|
+
const add = (product, periodType, value, scope) => {
|
|
56830
56959
|
if (!value || typeof value.utilization !== "number" || !Number.isFinite(value.utilization) || value.utilization < 0 || value.utilization > 100)
|
|
56831
56960
|
return;
|
|
56832
56961
|
windows.push({
|
|
56833
56962
|
product,
|
|
56834
56963
|
periodType,
|
|
56964
|
+
...scope ? { scope: { id: scope, label: scope } } : {},
|
|
56835
56965
|
usagePercent: value.utilization,
|
|
56836
56966
|
...value.resets_at && Number.isFinite(Date.parse(value.resets_at)) ? { resetsAt: value.resets_at } : {}
|
|
56837
56967
|
});
|
|
56838
56968
|
};
|
|
56839
56969
|
add("5-hour window", "five_hour", limits.five_hour);
|
|
56840
56970
|
add("7-day window", "seven_day", limits.seven_day);
|
|
56841
|
-
add("OAuth apps · 7-day", "seven_day", limits.seven_day_oauth_apps);
|
|
56842
|
-
add("Opus · 7-day", "seven_day", limits.seven_day_opus);
|
|
56843
|
-
add("Sonnet · 7-day", "seven_day", limits.seven_day_sonnet);
|
|
56971
|
+
add("OAuth apps · 7-day", "seven_day", limits.seven_day_oauth_apps, "OAuth apps");
|
|
56972
|
+
add("Opus · 7-day", "seven_day", limits.seven_day_opus, "Opus");
|
|
56973
|
+
add("Sonnet · 7-day", "seven_day", limits.seven_day_sonnet, "Sonnet");
|
|
56844
56974
|
for (const window2 of limits.model_scoped ?? [])
|
|
56845
|
-
add(`${window2.display_name} · 7-day`, "seven_day", window2);
|
|
56975
|
+
add(`${window2.display_name} · 7-day`, "seven_day", window2, window2.display_name);
|
|
56846
56976
|
const [primary, ...others] = windows;
|
|
56847
56977
|
if (!primary)
|
|
56848
56978
|
return null;
|
|
@@ -56853,11 +56983,14 @@ function projectClaudeAccountUsage(usage, account) {
|
|
|
56853
56983
|
credits: {
|
|
56854
56984
|
usedPercent: primary.usagePercent,
|
|
56855
56985
|
periodType: primary.periodType,
|
|
56986
|
+
...primary.scope ? { scope: primary.scope } : {},
|
|
56856
56987
|
...!genericPrimary ? { label: primary.product } : {},
|
|
56857
56988
|
...primary.resetsAt ? { resetsAt: primary.resetsAt } : {},
|
|
56858
56989
|
...others.length ? {
|
|
56859
|
-
productUsage: others.map(({ product, usagePercent, resetsAt }) => ({
|
|
56990
|
+
productUsage: others.map(({ product, periodType, scope, usagePercent, resetsAt }) => ({
|
|
56860
56991
|
product,
|
|
56992
|
+
periodType,
|
|
56993
|
+
...scope ? { scope } : {},
|
|
56861
56994
|
usagePercent,
|
|
56862
56995
|
...resetsAt ? { resetsAt } : {}
|
|
56863
56996
|
}))
|
|
@@ -56867,7 +57000,7 @@ function projectClaudeAccountUsage(usage, account) {
|
|
|
56867
57000
|
}
|
|
56868
57001
|
|
|
56869
57002
|
// dist/gateway-models.js
|
|
56870
|
-
import { readFile as
|
|
57003
|
+
import { readFile as readFile9 } from "node:fs/promises";
|
|
56871
57004
|
import path16 from "node:path";
|
|
56872
57005
|
var GATEWAY_MODELS_TIMEOUT_MS = 3e3;
|
|
56873
57006
|
var GATEWAY_MODELS_MAX_BYTES = 2 * 1024 * 1024;
|
|
@@ -56917,7 +57050,7 @@ async function readClaudeUserSettingsEnv(environment) {
|
|
|
56917
57050
|
if (!configDir)
|
|
56918
57051
|
return {};
|
|
56919
57052
|
try {
|
|
56920
|
-
const raw = await
|
|
57053
|
+
const raw = await readFile9(path16.join(configDir, "settings.json"), "utf8");
|
|
56921
57054
|
const parsed = JSON.parse(raw);
|
|
56922
57055
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
56923
57056
|
return {};
|
|
@@ -57161,7 +57294,7 @@ function rejectAfter(milliseconds, message) {
|
|
|
57161
57294
|
function processExited(child) {
|
|
57162
57295
|
return child.exitCode !== null || child.signalCode !== null;
|
|
57163
57296
|
}
|
|
57164
|
-
function
|
|
57297
|
+
function isRecord10(value) {
|
|
57165
57298
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
57166
57299
|
}
|
|
57167
57300
|
function safeNonNegativeInteger2(value) {
|
|
@@ -57181,13 +57314,13 @@ function userMessageContent(input) {
|
|
|
57181
57314
|
return blocks;
|
|
57182
57315
|
}
|
|
57183
57316
|
function permissionModeFromMessage(value) {
|
|
57184
|
-
if (!
|
|
57317
|
+
if (!isRecord10(value) || value.type !== "system" || value.subtype !== "init" && value.subtype !== "status" || !("permissionMode" in value) || value.permissionMode === void 0) {
|
|
57185
57318
|
return void 0;
|
|
57186
57319
|
}
|
|
57187
57320
|
return isClaudePermissionMode(value.permissionMode) ? value.permissionMode : void 0;
|
|
57188
57321
|
}
|
|
57189
57322
|
function parseContextApiUsage(value) {
|
|
57190
|
-
if (!
|
|
57323
|
+
if (!isRecord10(value))
|
|
57191
57324
|
return void 0;
|
|
57192
57325
|
const inputTokens = value.input_tokens;
|
|
57193
57326
|
const outputTokens = value.output_tokens;
|
|
@@ -57199,7 +57332,7 @@ function parseContextApiUsage(value) {
|
|
|
57199
57332
|
return { inputTokens, outputTokens, cacheCreationInputTokens, cacheReadInputTokens };
|
|
57200
57333
|
}
|
|
57201
57334
|
function parseContextUsage(value) {
|
|
57202
|
-
if (!
|
|
57335
|
+
if (!isRecord10(value))
|
|
57203
57336
|
throw new Error("Claude SDK context Usage is invalid");
|
|
57204
57337
|
const usedTokens = value.totalTokens;
|
|
57205
57338
|
const maxTokens = value.maxTokens;
|
|
@@ -57217,7 +57350,7 @@ function parseQuestions(input) {
|
|
|
57217
57350
|
const questions = [];
|
|
57218
57351
|
const questionTexts = /* @__PURE__ */ new Set();
|
|
57219
57352
|
for (const value of input.questions) {
|
|
57220
|
-
if (!
|
|
57353
|
+
if (!isRecord10(value))
|
|
57221
57354
|
return null;
|
|
57222
57355
|
const question = value.question;
|
|
57223
57356
|
const header = value.header;
|
|
@@ -57228,7 +57361,7 @@ function parseQuestions(input) {
|
|
|
57228
57361
|
const labels = /* @__PURE__ */ new Set();
|
|
57229
57362
|
const options = [];
|
|
57230
57363
|
for (const option2 of value.options) {
|
|
57231
|
-
if (!
|
|
57364
|
+
if (!isRecord10(option2) || typeof option2.label !== "string" || option2.label.length === 0 || labels.has(option2.label) || typeof option2.description !== "string") {
|
|
57232
57365
|
return null;
|
|
57233
57366
|
}
|
|
57234
57367
|
labels.add(option2.label);
|
|
@@ -57270,7 +57403,7 @@ function permissionUpdateDestination(value) {
|
|
|
57270
57403
|
return void 0;
|
|
57271
57404
|
}
|
|
57272
57405
|
function isPermissionUpdate(value) {
|
|
57273
|
-
if (!
|
|
57406
|
+
if (!isRecord10(value) || !permissionUpdateDestination(value.destination))
|
|
57274
57407
|
return false;
|
|
57275
57408
|
if (value.type === "setMode") {
|
|
57276
57409
|
return typeof value.mode === "string" && PERMISSION_MODES.has(value.mode);
|
|
@@ -57279,7 +57412,7 @@ function isPermissionUpdate(value) {
|
|
|
57279
57412
|
return Array.isArray(value.directories) && value.directories.every((directory) => typeof directory === "string");
|
|
57280
57413
|
}
|
|
57281
57414
|
if (value.type === "addRules" || value.type === "replaceRules" || value.type === "removeRules") {
|
|
57282
|
-
return typeof value.behavior === "string" && PERMISSION_BEHAVIORS.has(value.behavior) && Array.isArray(value.rules) && value.rules.every((rule) =>
|
|
57415
|
+
return typeof value.behavior === "string" && PERMISSION_BEHAVIORS.has(value.behavior) && Array.isArray(value.rules) && value.rules.every((rule) => isRecord10(rule) && typeof rule.toolName === "string" && (rule.ruleContent === void 0 || typeof rule.ruleContent === "string"));
|
|
57283
57416
|
}
|
|
57284
57417
|
return false;
|
|
57285
57418
|
}
|
|
@@ -57506,7 +57639,7 @@ var ClaudeSdkTransport = class {
|
|
|
57506
57639
|
return { commands: this.#slashCommands, skillNames: this.#skillNames };
|
|
57507
57640
|
}
|
|
57508
57641
|
#observeSlashCommands(message) {
|
|
57509
|
-
if (!
|
|
57642
|
+
if (!isRecord10(message) || message.type !== "system")
|
|
57510
57643
|
return;
|
|
57511
57644
|
if (message.subtype === "init" && Array.isArray(message.skills)) {
|
|
57512
57645
|
this.#skillNames = new Set(message.skills.filter((name) => typeof name === "string"));
|
|
@@ -57925,10 +58058,10 @@ var ClaudeSdkTransport = class {
|
|
|
57925
58058
|
}
|
|
57926
58059
|
}
|
|
57927
58060
|
#observeBackgroundTasks(message) {
|
|
57928
|
-
if (!
|
|
58061
|
+
if (!isRecord10(message) || message.type !== "system")
|
|
57929
58062
|
return;
|
|
57930
58063
|
if (message.subtype === "background_tasks_changed" && Array.isArray(message.tasks)) {
|
|
57931
|
-
this.#backgroundTasks = new Set(message.tasks.flatMap((task) =>
|
|
58064
|
+
this.#backgroundTasks = new Set(message.tasks.flatMap((task) => isRecord10(task) && typeof task.task_id === "string" ? [task.task_id] : []));
|
|
57932
58065
|
} else if (message.subtype === "task_started" && typeof message.task_id === "string") {
|
|
57933
58066
|
this.#backgroundTasks.add(message.task_id);
|
|
57934
58067
|
} else if (message.subtype === "task_notification" && typeof message.task_id === "string" && ["completed", "failed", "stopped"].includes(String(message.status))) {
|
|
@@ -57944,7 +58077,7 @@ var ClaudeSdkTransport = class {
|
|
|
57944
58077
|
}
|
|
57945
58078
|
/** Remembers Workflow agent labels so their approvals can name the agent asking. */
|
|
57946
58079
|
#observeWorkflowAgents(message) {
|
|
57947
|
-
if (!
|
|
58080
|
+
if (!isRecord10(message) || message.type !== "system" || message.subtype !== "task_progress") {
|
|
57948
58081
|
return;
|
|
57949
58082
|
}
|
|
57950
58083
|
for (const agent of parseClaudeWorkflowAgents(message.workflow_progress) ?? []) {
|
|
@@ -58005,7 +58138,7 @@ var ClaudeSdkTransport = class {
|
|
|
58005
58138
|
userMessageId: null,
|
|
58006
58139
|
live: false
|
|
58007
58140
|
});
|
|
58008
|
-
if (autonomous.userMessageId === null &&
|
|
58141
|
+
if (autonomous.userMessageId === null && isRecord10(message) && message.type === "user" && (message.parent_tool_use_id === null || message.parent_tool_use_id === void 0) && typeof message.uuid === "string" && message.uuid.length > 0) {
|
|
58009
58142
|
autonomous.userMessageId = message.uuid;
|
|
58010
58143
|
}
|
|
58011
58144
|
const interpreted = autonomous.accumulator.consume(message);
|
|
@@ -58537,11 +58670,11 @@ var ClaudeWorkflowLifecycle = class {
|
|
|
58537
58670
|
};
|
|
58538
58671
|
|
|
58539
58672
|
// dist/task-tracker.js
|
|
58540
|
-
function
|
|
58673
|
+
function isRecord11(value) {
|
|
58541
58674
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
58542
58675
|
}
|
|
58543
58676
|
function stringField(value, keys) {
|
|
58544
|
-
if (!
|
|
58677
|
+
if (!isRecord11(value))
|
|
58545
58678
|
return void 0;
|
|
58546
58679
|
for (const key of keys) {
|
|
58547
58680
|
const field = value[key];
|
|
@@ -58576,7 +58709,7 @@ var ClaudeTaskTracker = class {
|
|
|
58576
58709
|
};
|
|
58577
58710
|
}
|
|
58578
58711
|
#create(args, result) {
|
|
58579
|
-
if (!
|
|
58712
|
+
if (!isRecord11(result) || !isRecord11(result.task))
|
|
58580
58713
|
return;
|
|
58581
58714
|
const id2 = stringField(result.task, ["id"]);
|
|
58582
58715
|
const subject = stringField(args, ["subject"]) ?? stringField(result.task, ["subject"]);
|
|
@@ -58594,7 +58727,7 @@ var ClaudeTaskTracker = class {
|
|
|
58594
58727
|
const id2 = stringField(args, ["taskId", "id", "task_id"]);
|
|
58595
58728
|
if (!id2)
|
|
58596
58729
|
return;
|
|
58597
|
-
const status =
|
|
58730
|
+
const status = isRecord11(args) ? taskStatus2(args.status) : void 0;
|
|
58598
58731
|
if (status === "deleted") {
|
|
58599
58732
|
this.#tasks.delete(id2);
|
|
58600
58733
|
return;
|
|
@@ -58612,13 +58745,13 @@ var ClaudeTaskTracker = class {
|
|
|
58612
58745
|
});
|
|
58613
58746
|
}
|
|
58614
58747
|
#replace(result) {
|
|
58615
|
-
if (!
|
|
58748
|
+
if (!isRecord11(result) || !Array.isArray(result.tasks))
|
|
58616
58749
|
return;
|
|
58617
58750
|
const next = /* @__PURE__ */ new Map();
|
|
58618
58751
|
for (const value of result.tasks) {
|
|
58619
58752
|
const id2 = stringField(value, ["id"]);
|
|
58620
58753
|
const subject = stringField(value, ["subject"]);
|
|
58621
|
-
const status =
|
|
58754
|
+
const status = isRecord11(value) ? taskStatus2(value.status) : void 0;
|
|
58622
58755
|
if (!id2 || !subject || !status || status === "deleted")
|
|
58623
58756
|
continue;
|
|
58624
58757
|
const existing = this.#tasks.get(id2);
|
|
@@ -58785,11 +58918,11 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
58785
58918
|
};
|
|
58786
58919
|
|
|
58787
58920
|
// dist/tool-lifecycle.js
|
|
58788
|
-
function
|
|
58921
|
+
function isRecord12(value) {
|
|
58789
58922
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
58790
58923
|
}
|
|
58791
58924
|
function stringField2(value, key) {
|
|
58792
|
-
return
|
|
58925
|
+
return isRecord12(value) && typeof value[key] === "string" ? value[key] : void 0;
|
|
58793
58926
|
}
|
|
58794
58927
|
function toolFailure(toolName) {
|
|
58795
58928
|
return {
|
|
@@ -58979,6 +59112,7 @@ var claudeCommandCatalog = harnessCommandCatalogSchema.parse({
|
|
|
58979
59112
|
{
|
|
58980
59113
|
id: "claude.compact",
|
|
58981
59114
|
invocation: "/compact",
|
|
59115
|
+
localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } },
|
|
58982
59116
|
label: "Compact context",
|
|
58983
59117
|
description: "Compact the current conversation context",
|
|
58984
59118
|
argumentMode: "text"
|
|
@@ -59055,7 +59189,7 @@ var CONTEXT_USAGE_TTL_MS = 1e4;
|
|
|
59055
59189
|
var CONTEXT_USAGE_FAILURE_COOLDOWN_MS = 5e3;
|
|
59056
59190
|
var REQUEST_USAGE_RETRY_DELAYS_MS = [0, 100, 250, 500, 1e3];
|
|
59057
59191
|
var DEFAULT_CONTINUATION_QUIESCENCE_MS = 2e3;
|
|
59058
|
-
function
|
|
59192
|
+
function isRecord13(value) {
|
|
59059
59193
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
59060
59194
|
}
|
|
59061
59195
|
function safeNonNegativeInteger3(value) {
|
|
@@ -59064,7 +59198,7 @@ function safeNonNegativeInteger3(value) {
|
|
|
59064
59198
|
function transcriptRequestUsage(messages, messageId) {
|
|
59065
59199
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
59066
59200
|
const entry = messages[index];
|
|
59067
|
-
if (!
|
|
59201
|
+
if (!isRecord13(entry) || entry.type !== "assistant" || entry.parent_tool_use_id !== null && entry.parent_tool_use_id !== void 0 || !isRecord13(entry.message) || entry.message.id !== messageId || !isRecord13(entry.message.usage)) {
|
|
59068
59202
|
continue;
|
|
59069
59203
|
}
|
|
59070
59204
|
const inputTokens = entry.message.usage.input_tokens;
|
|
@@ -59212,6 +59346,7 @@ function projectClaudePlanLimitToCredits(planLimit) {
|
|
|
59212
59346
|
productUsage: [
|
|
59213
59347
|
{
|
|
59214
59348
|
product: "7-day window",
|
|
59349
|
+
periodType: "seven_day",
|
|
59215
59350
|
usagePercent: other.utilizationPercent,
|
|
59216
59351
|
...other.resetsAtUnix !== void 0 ? { resetsAt: isoFromUnix(other.resetsAtUnix) } : {}
|
|
59217
59352
|
}
|
|
@@ -59375,7 +59510,7 @@ var ClaudeHarnessSession = class {
|
|
|
59375
59510
|
cwd: this.#cwd,
|
|
59376
59511
|
sessionId: this.#sessionId
|
|
59377
59512
|
}) ?? [];
|
|
59378
|
-
const ids = new Set(messages.flatMap((message) =>
|
|
59513
|
+
const ids = new Set(messages.flatMap((message) => isRecord13(message) && typeof message.uuid === "string" ? [message.uuid] : []));
|
|
59379
59514
|
if (this.#unpersistedMessageIds.every((id2) => ids.has(id2))) {
|
|
59380
59515
|
this.#unpersistedMessageIds = [];
|
|
59381
59516
|
break;
|
|
@@ -61444,7 +61579,7 @@ var ClaudeCodeAdapter = class {
|
|
|
61444
61579
|
throw new RangeError("Claude Code continuation quiescence must be a positive safe integer");
|
|
61445
61580
|
}
|
|
61446
61581
|
this.#dependencies = dependencies ?? {
|
|
61447
|
-
randomUUID:
|
|
61582
|
+
randomUUID: randomUUID6,
|
|
61448
61583
|
bypassPermissionsAvailable: (environment2) => claudeBypassPermissionsAvailable(environment2 ?? options.environment ?? process.env),
|
|
61449
61584
|
inspectInstallation: () => {
|
|
61450
61585
|
resolveClaudeCodeExecutable({
|
|
@@ -61466,7 +61601,18 @@ var ClaudeCodeAdapter = class {
|
|
|
61466
61601
|
abortTimeoutMs: this.#cancelTimeoutMs
|
|
61467
61602
|
}),
|
|
61468
61603
|
deleteSession: ({ cwd, sessionId }) => M5t(sessionId, { dir: cwd }),
|
|
61469
|
-
forkSession: ({ checkpointId, cwd, sourceSessionId }) =>
|
|
61604
|
+
forkSession: async ({ checkpointId, cwd, sourceSessionId }) => {
|
|
61605
|
+
const forked = await U5t(sourceSessionId, {
|
|
61606
|
+
dir: cwd,
|
|
61607
|
+
upToMessageId: checkpointId
|
|
61608
|
+
});
|
|
61609
|
+
await remapForkedSessionReferences({
|
|
61610
|
+
cwd,
|
|
61611
|
+
environment: options.environment ?? process.env,
|
|
61612
|
+
sessionId: forked.sessionId
|
|
61613
|
+
}).catch(() => void 0);
|
|
61614
|
+
return forked;
|
|
61615
|
+
},
|
|
61470
61616
|
getSessionInfo: async ({ sessionId }) => {
|
|
61471
61617
|
const info = await D5t(sessionId);
|
|
61472
61618
|
return info;
|
|
@@ -61856,11 +62002,11 @@ var ClaudeCodeAdapter = class {
|
|
|
61856
62002
|
};
|
|
61857
62003
|
|
|
61858
62004
|
// dist/installation.js
|
|
61859
|
-
import { readFile as
|
|
62005
|
+
import { readFile as readFile10, realpath as realpath5 } from "node:fs/promises";
|
|
61860
62006
|
import { homedir as homedir2 } from "node:os";
|
|
61861
62007
|
import path19 from "node:path";
|
|
61862
62008
|
async function readSettings(file2) {
|
|
61863
|
-
const text2 = await
|
|
62009
|
+
const text2 = await readFile10(file2, "utf8").catch((error52) => {
|
|
61864
62010
|
if (error52.code === "ENOENT")
|
|
61865
62011
|
return "{}";
|
|
61866
62012
|
throw error52;
|
|
@@ -61911,6 +62057,12 @@ function createClaudeInstallation(environment, command) {
|
|
|
61911
62057
|
canUpdate,
|
|
61912
62058
|
...!canUpdate ? {
|
|
61913
62059
|
messageCode: blocked ? "claude-policy-restricted" : "original-installer",
|
|
62060
|
+
...blocked ? {
|
|
62061
|
+
notice: {
|
|
62062
|
+
en: "Claude updates are restricted by the installation's settings or policy.",
|
|
62063
|
+
"zh-CN": "此 Claude 安装的设置或策略限制了更新。"
|
|
62064
|
+
}
|
|
62065
|
+
} : {},
|
|
61914
62066
|
message: blocked ? "Claude updates are restricted by the installation's settings or policy." : "Use the original installer or package manager for this Claude installation."
|
|
61915
62067
|
} : {}
|
|
61916
62068
|
};
|