@liberseek/boft-cli-win32-arm64 0.7.9 → 0.8.1
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/THIRD_PARTY_NOTICES.txt +9 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +322 -67
- package/app/console-web.js +9202 -5218
- package/app/desktop-controller.mjs +259 -42
- package/app/host-runtime.mjs +6250 -1689
- package/app/plugins/antigravity/manifest.json +18 -1
- package/app/plugins/antigravity/plugin.mjs +283 -42
- package/app/plugins/claude-code/manifest.json +28 -0
- package/app/plugins/claude-code/plugin.mjs +35676 -24151
- package/app/plugins/codebuddy/manifest.json +17 -0
- package/app/plugins/codebuddy/plugin.mjs +5972 -5356
- package/app/plugins/codex-usage/manifest.json +9 -0
- package/app/plugins/codex-usage/plugin.mjs +17386 -0
- package/app/plugins/cursor-cli/manifest.json +18 -1
- package/app/plugins/cursor-cli/plugin.mjs +358 -77
- package/app/plugins/deepseek-harness/assets/icon.svg +1 -0
- package/app/plugins/deepseek-harness/manifest.json +35 -2
- package/app/plugins/deepseek-harness/plugin.mjs +823 -242
- package/app/plugins/enabled.json +2 -1
- package/app/plugins/grok/manifest.json +21 -1
- package/app/plugins/grok/plugin.mjs +933 -268
- package/app/plugins/hermes/assets/icon.png +0 -0
- package/app/plugins/hermes/manifest.json +30 -2
- package/app/plugins/hermes/plugin.mjs +469 -73
- package/app/plugins/kimi-code/assets/icon.svg +5 -0
- package/app/plugins/kimi-code/manifest.json +25 -2
- package/app/plugins/kimi-code/plugin.mjs +562 -36
- package/app/plugins/kiro-cli/assets/kiro-agent.svg +11 -0
- package/app/plugins/kiro-cli/manifest.json +18 -1
- package/app/plugins/kiro-cli/plugin.mjs +291 -22
- package/app/plugins/muse/manifest.json +18 -1
- package/app/plugins/muse/plugin.mjs +258 -17
- package/app/plugins/omp/manifest.json +21 -1
- package/app/plugins/omp/plugin.mjs +2763 -1958
- package/app/plugins/opencode/manifest.json +18 -1
- package/app/plugins/opencode/plugin.mjs +724 -147
- package/app/plugins/pi/manifest.json +32 -0
- package/app/plugins/pi/plugin.mjs +2908 -2312
- package/app/plugins/qoder/manifest.json +18 -1
- package/app/plugins/qoder/plugin.mjs +635 -81
- package/app/plugins/qoder-cn/manifest.json +18 -1
- package/app/plugins/qoder-cn/plugin.mjs +635 -81
- package/app/plugins/workbuddy/manifest.json +18 -0
- package/app/plugins/workbuddy/plugin.mjs +6362 -5748
- package/app/plugins/zcode/manifest.json +19 -1
- package/app/plugins/zcode/plugin.mjs +1117 -278
- package/app/renderer-extension.js +14675 -10087
- 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/licenses/Cordis-LICENSE.txt +21 -0
- package/licenses/Cosmokit-LICENSE.txt +21 -0
- package/package.json +4 -4
- package/app/plugins/kiro-cli/assets/icon.svg +0 -5
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ BOFT CLI runs Pi and other external harnesses inside Codex Desktop.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g @liberseek/boft-cli@0.
|
|
10
|
+
npm install -g @liberseek/boft-cli@0.8.1
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Do not install this package directly. npm selects it through the optional dependencies of `@liberseek/boft-cli`.
|
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
codexhost npm package third-party notices
|
|
2
2
|
|
|
3
|
+
@deepseek-ai/cordis 4.0.4
|
|
4
|
+
License: MIT
|
|
5
|
+
License text: licenses/Cordis-LICENSE.txt
|
|
6
|
+
|
|
7
|
+
@deepseek-ai/cosmokit 1.8.5
|
|
8
|
+
License: MIT
|
|
9
|
+
License text: licenses/Cosmokit-LICENSE.txt
|
|
10
|
+
|
|
3
11
|
@agentclientprotocol/sdk 1.3.0
|
|
4
12
|
License: Apache-2.0
|
|
5
13
|
License text: licenses/Agent-Client-Protocol-SDK-LICENSE.txt
|
|
6
14
|
|
|
7
|
-
@anthropic-ai/claude-agent-sdk 0.3.
|
|
15
|
+
@anthropic-ai/claude-agent-sdk 0.3.273
|
|
8
16
|
License: SEE LICENSE IN README.md
|
|
9
17
|
License text: licenses/Claude-Agent-SDK-LICENSE.md
|
|
10
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":1,"version":"0.
|
|
1
|
+
{"schemaVersion":1,"version":"0.8.1","distribution":"npm","target":"windows-arm64"}
|
package/app/console-server.mjs
CHANGED
|
@@ -136,7 +136,7 @@ async function readRuntimeMetadata(entryPath2, environment = process.env) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// packages/update-manager/dist/github-release.js
|
|
139
|
-
var CODEXHOST_LATEST_RELEASE_URL = "https://api.github.com/repos/
|
|
139
|
+
var CODEXHOST_LATEST_RELEASE_URL = "https://api.github.com/repos/LIBERSEEK/BOFT-CLI/releases/latest";
|
|
140
140
|
var SHA256_DIGEST_PATTERN = /^sha256:([0-9a-f]{64})$/u;
|
|
141
141
|
var RELEASE_NOTES_URL_PATTERN = /^https:\/\/github\.com\/(LiberSeek|LIBERSEEK)\/BOFT-CLI\/releases\/tag\/(v[0-9A-Za-z.+-]+)$/u;
|
|
142
142
|
var DOWNLOAD_URL_PREFIXES = [
|
|
@@ -274,7 +274,7 @@ function selectInstallerReleaseArtifact(release, target) {
|
|
|
274
274
|
// packages/update-manager/dist/github-cli-release.js
|
|
275
275
|
import { execFile } from "node:child_process";
|
|
276
276
|
import path3 from "node:path";
|
|
277
|
-
var GITHUB_LATEST_RELEASE_ENDPOINT = "repos/
|
|
277
|
+
var GITHUB_LATEST_RELEASE_ENDPOINT = "repos/LIBERSEEK/BOFT-CLI/releases/latest";
|
|
278
278
|
var MAX_RELEASE_RESPONSE_BYTES = 1024 * 1024;
|
|
279
279
|
var GITHUB_CLI_TIMEOUT_MS = 5e3;
|
|
280
280
|
function defaultExecutableCandidates(environment, platform) {
|
|
@@ -363,39 +363,25 @@ async function regularFile(filePath) {
|
|
|
363
363
|
throw error51;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
async function
|
|
366
|
+
async function discoverActiveUpdateStatus(stateDirectory) {
|
|
367
367
|
if (!path4.isAbsolute(stateDirectory))
|
|
368
368
|
throw new Error("update state directory must be absolute");
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (!path4.isAbsolute(stateDirectory))
|
|
373
|
-
throw new Error("update state directory must be absolute");
|
|
374
|
-
let entries;
|
|
369
|
+
const lockPath = path4.join(stateDirectory, LOCK_FILE);
|
|
370
|
+
if (!await regularFile(lockPath))
|
|
371
|
+
return null;
|
|
375
372
|
try {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
if (error51.code === "ENOENT")
|
|
373
|
+
const lock = JSON.parse(await readFile2(lockPath, "utf8"));
|
|
374
|
+
if (typeof lock.statusPath !== "string" || !path4.isAbsolute(lock.statusPath))
|
|
379
375
|
return null;
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
continue;
|
|
389
|
-
try {
|
|
390
|
-
candidates.push({
|
|
391
|
-
statusPath,
|
|
392
|
-
status: parseUpdateStatus(JSON.parse(await readFile2(statusPath, "utf8")))
|
|
393
|
-
});
|
|
394
|
-
} catch {
|
|
395
|
-
}
|
|
376
|
+
if (!await regularFile(lock.statusPath))
|
|
377
|
+
return null;
|
|
378
|
+
const status = parseUpdateStatus(JSON.parse(await readFile2(lock.statusPath, "utf8")));
|
|
379
|
+
if (TERMINAL_PHASES.has(status.phase))
|
|
380
|
+
return null;
|
|
381
|
+
return { statusPath: lock.statusPath, status };
|
|
382
|
+
} catch {
|
|
383
|
+
return null;
|
|
396
384
|
}
|
|
397
|
-
candidates.sort((left, right) => right.status.updatedAt - left.status.updatedAt);
|
|
398
|
-
return candidates[0] ?? null;
|
|
399
385
|
}
|
|
400
386
|
async function cleanupTerminalUpdateState(stateDirectory, options = {}) {
|
|
401
387
|
const now = Math.floor((options.now ?? Date.now()) / 1e3);
|
|
@@ -593,6 +579,48 @@ async function verifyDownloadedArtifact(source, filePath, result) {
|
|
|
593
579
|
}
|
|
594
580
|
}
|
|
595
581
|
|
|
582
|
+
// packages/update-manager/dist/updater-ready.js
|
|
583
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
584
|
+
async function waitForUpdaterReady(child, readStatus, timeoutMs = 1e4) {
|
|
585
|
+
let failure;
|
|
586
|
+
const onError = (error51) => {
|
|
587
|
+
failure = error51;
|
|
588
|
+
};
|
|
589
|
+
const onExit = () => {
|
|
590
|
+
failure = new Error("Background Updater exited before completing handoff");
|
|
591
|
+
};
|
|
592
|
+
child.on("error", onError);
|
|
593
|
+
child.on("exit", onExit);
|
|
594
|
+
const deadline = performance.now() + timeoutMs;
|
|
595
|
+
try {
|
|
596
|
+
while (true) {
|
|
597
|
+
const status = await readStatus();
|
|
598
|
+
if (status?.phase === "failed")
|
|
599
|
+
throw new Error(status.error ?? "Background Updater failed");
|
|
600
|
+
if (failure)
|
|
601
|
+
throw failure;
|
|
602
|
+
if (child.exitCode != null || child.signalCode != null) {
|
|
603
|
+
throw new Error("Background Updater exited before completing handoff");
|
|
604
|
+
}
|
|
605
|
+
if (status?.phase === "waiting-for-exit")
|
|
606
|
+
return;
|
|
607
|
+
if (status && status.phase !== "prepared") {
|
|
608
|
+
throw new Error(`Unexpected Updater phase during handoff: ${status.phase}`);
|
|
609
|
+
}
|
|
610
|
+
if (performance.now() >= deadline) {
|
|
611
|
+
throw new Error("Background Updater did not confirm handoff before the startup timeout");
|
|
612
|
+
}
|
|
613
|
+
await delay(20);
|
|
614
|
+
}
|
|
615
|
+
} catch (error51) {
|
|
616
|
+
child.kill();
|
|
617
|
+
throw error51;
|
|
618
|
+
} finally {
|
|
619
|
+
child.removeListener("error", onError);
|
|
620
|
+
child.removeListener("exit", onExit);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
596
624
|
// packages/update-manager/dist/update-manager.js
|
|
597
625
|
var REQUEST_SCHEMA_VERSION = 1;
|
|
598
626
|
var WINDOWS_RENAME_RETRY_DELAYS_MS = [10, 30, 70, 150, 300];
|
|
@@ -602,7 +630,7 @@ function errorMessage(error51) {
|
|
|
602
630
|
function systemErrorCode(error51) {
|
|
603
631
|
return typeof error51 === "object" && error51 !== null && "code" in error51 ? String(error51.code) : null;
|
|
604
632
|
}
|
|
605
|
-
function
|
|
633
|
+
function delay2(milliseconds) {
|
|
606
634
|
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
607
635
|
}
|
|
608
636
|
async function replaceStatusFile(temporaryPath, statusPath) {
|
|
@@ -618,7 +646,7 @@ async function replaceStatusFile(temporaryPath, statusPath) {
|
|
|
618
646
|
throw error51;
|
|
619
647
|
}
|
|
620
648
|
retryIndex += 1;
|
|
621
|
-
await
|
|
649
|
+
await delay2(retryDelay);
|
|
622
650
|
}
|
|
623
651
|
}
|
|
624
652
|
}
|
|
@@ -838,14 +866,20 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
838
866
|
app_path: appPath
|
|
839
867
|
}, artifact.artifactPath);
|
|
840
868
|
},
|
|
841
|
-
start(prepared) {
|
|
869
|
+
async start(prepared) {
|
|
842
870
|
if (!preparedRequests.delete(prepared.requestPath)) {
|
|
843
871
|
throw new Error("background update was not prepared by this manager or was already started");
|
|
844
872
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
873
|
+
try {
|
|
874
|
+
const child = spawnUpdater(prepared.helperPath, prepared.requestPath);
|
|
875
|
+
await waitForUpdaterReady(child, () => this.readStatus(prepared.statusPath));
|
|
876
|
+
if (child.pid === void 0)
|
|
877
|
+
throw new Error("background Updater did not report a process ID");
|
|
878
|
+
return Object.freeze({ ...prepared, updaterPid: child.pid });
|
|
879
|
+
} catch (error51) {
|
|
880
|
+
await writeFailedStatus(prepared.statusPath, prepared.version, prepared.installation, error51);
|
|
881
|
+
throw error51;
|
|
882
|
+
}
|
|
849
883
|
},
|
|
850
884
|
async readStatus(statusPathValue) {
|
|
851
885
|
const statusPath = requireAbsolutePath(statusPathValue, "update status path");
|
|
@@ -5503,8 +5537,8 @@ function az_default() {
|
|
|
5503
5537
|
}
|
|
5504
5538
|
|
|
5505
5539
|
// node_modules/zod/v4/locales/be.js
|
|
5506
|
-
function getBelarusianPlural(
|
|
5507
|
-
const absCount = Math.abs(
|
|
5540
|
+
function getBelarusianPlural(count2, one, few, many) {
|
|
5541
|
+
const absCount = Math.abs(count2);
|
|
5508
5542
|
const lastDigit = absCount % 10;
|
|
5509
5543
|
const lastTwoDigits = absCount % 100;
|
|
5510
5544
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -7582,8 +7616,8 @@ function hu_default() {
|
|
|
7582
7616
|
}
|
|
7583
7617
|
|
|
7584
7618
|
// node_modules/zod/v4/locales/hy.js
|
|
7585
|
-
function getArmenianPlural(
|
|
7586
|
-
return Math.abs(
|
|
7619
|
+
function getArmenianPlural(count2, one, many) {
|
|
7620
|
+
return Math.abs(count2) === 1 ? one : many;
|
|
7587
7621
|
}
|
|
7588
7622
|
function withDefiniteArticle(word) {
|
|
7589
7623
|
if (!word)
|
|
@@ -9711,8 +9745,8 @@ function ro_default() {
|
|
|
9711
9745
|
}
|
|
9712
9746
|
|
|
9713
9747
|
// node_modules/zod/v4/locales/ru.js
|
|
9714
|
-
function getRussianPlural(
|
|
9715
|
-
const absCount = Math.abs(
|
|
9748
|
+
function getRussianPlural(count2, one, few, many) {
|
|
9749
|
+
const absCount = Math.abs(count2);
|
|
9716
9750
|
const lastDigit = absCount % 10;
|
|
9717
9751
|
const lastTwoDigits = absCount % 100;
|
|
9718
9752
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -15381,6 +15415,15 @@ function date4(params) {
|
|
|
15381
15415
|
// node_modules/zod/v4/classic/external.js
|
|
15382
15416
|
config(en_default());
|
|
15383
15417
|
|
|
15418
|
+
// packages/shared-contracts/dist/delegation-read.js
|
|
15419
|
+
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
15420
|
+
var delegationReadParamsSchema = external_exports.strictObject({
|
|
15421
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
15422
|
+
view: external_exports.enum(["result", "messages"]),
|
|
15423
|
+
cursor: external_exports.string().min(1).max(8192).optional(),
|
|
15424
|
+
limit: external_exports.number().int().min(1).max(100).optional()
|
|
15425
|
+
});
|
|
15426
|
+
|
|
15384
15427
|
// packages/shared-contracts/dist/credential-imports.js
|
|
15385
15428
|
var credentialSourceSchema = external_exports.object({
|
|
15386
15429
|
id: external_exports.string().min(1).max(256),
|
|
@@ -15451,6 +15494,160 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
15451
15494
|
initializeOnly: external_exports.boolean().optional()
|
|
15452
15495
|
});
|
|
15453
15496
|
|
|
15497
|
+
// packages/shared-contracts/dist/model-price-overrides.js
|
|
15498
|
+
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
15499
|
+
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
15500
|
+
input: usdPerMillionTokens,
|
|
15501
|
+
output: usdPerMillionTokens,
|
|
15502
|
+
cacheRead: usdPerMillionTokens.optional(),
|
|
15503
|
+
cacheWrite: usdPerMillionTokens.optional(),
|
|
15504
|
+
cacheWrite1h: usdPerMillionTokens.optional()
|
|
15505
|
+
});
|
|
15506
|
+
var modelPriceKeySchema = external_exports.string().max(512).refine((key) => key.trim() === key && key.length > 0, "Model ID is required");
|
|
15507
|
+
var modelPriceOverridesSchema = external_exports.strictObject({
|
|
15508
|
+
/** Absolute path of the Host's `pricing.json`. */
|
|
15509
|
+
path: external_exports.string(),
|
|
15510
|
+
entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
|
|
15511
|
+
/** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
|
|
15512
|
+
error: external_exports.string().nullable()
|
|
15513
|
+
});
|
|
15514
|
+
var modelPriceOverridesGetSchema = external_exports.strictObject({});
|
|
15515
|
+
var modelPriceOverridesSetSchema = external_exports.strictObject({
|
|
15516
|
+
key: modelPriceKeySchema,
|
|
15517
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
15518
|
+
previousKey: modelPriceKeySchema.optional()
|
|
15519
|
+
});
|
|
15520
|
+
var modelPriceDefaultParamsSchema = external_exports.strictObject({
|
|
15521
|
+
model: modelPriceKeySchema
|
|
15522
|
+
});
|
|
15523
|
+
var modelPriceSuggestionSchema = external_exports.strictObject({
|
|
15524
|
+
/** Verified from catalog canonical links, not inferred from names or equal prices. */
|
|
15525
|
+
official: external_exports.boolean().optional(),
|
|
15526
|
+
canonicalModelId: external_exports.string().min(1).optional(),
|
|
15527
|
+
provider: external_exports.string().min(1).max(512),
|
|
15528
|
+
model: external_exports.string().min(1).max(512),
|
|
15529
|
+
price: modelPriceOverrideSchema
|
|
15530
|
+
});
|
|
15531
|
+
var modelPriceDefaultResultSchema = external_exports.strictObject({
|
|
15532
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
15533
|
+
/** Local catalog suggestions only; never used automatically for pricing. */
|
|
15534
|
+
suggestions: external_exports.array(modelPriceSuggestionSchema).max(6).optional()
|
|
15535
|
+
});
|
|
15536
|
+
|
|
15537
|
+
// packages/shared-contracts/dist/usage-statistics.js
|
|
15538
|
+
var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
|
|
15539
|
+
var count = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
15540
|
+
var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
15541
|
+
var harness = external_exports.string().min(1).max(128);
|
|
15542
|
+
var model = external_exports.string().min(1).max(512);
|
|
15543
|
+
var project = external_exports.string().min(1).max(4096);
|
|
15544
|
+
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
15545
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
15546
|
+
harness: harness.optional(),
|
|
15547
|
+
model: model.nullable().optional(),
|
|
15548
|
+
project: project.nullable().optional(),
|
|
15549
|
+
/** One local date inside the range. */
|
|
15550
|
+
date: localDate.optional()
|
|
15551
|
+
});
|
|
15552
|
+
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
15553
|
+
requests: count,
|
|
15554
|
+
inputTokens: count,
|
|
15555
|
+
cachedInputTokens: count,
|
|
15556
|
+
cacheWriteInputTokens: count,
|
|
15557
|
+
cacheKnownInputTokens: count,
|
|
15558
|
+
outputTokens: count,
|
|
15559
|
+
reasoningOutputTokens: count,
|
|
15560
|
+
/** USD at the public price, summed over the priced requests only. */
|
|
15561
|
+
costUsd: external_exports.number().finite().min(0),
|
|
15562
|
+
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
15563
|
+
unpricedRequests: count,
|
|
15564
|
+
/**
|
|
15565
|
+
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
15566
|
+
* cost, and not as unpriced.
|
|
15567
|
+
*/
|
|
15568
|
+
unmeteredRequests: count
|
|
15569
|
+
});
|
|
15570
|
+
var totals = usageStatisticsTotalsSchema.shape;
|
|
15571
|
+
var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
15572
|
+
harness,
|
|
15573
|
+
sessionId: external_exports.string().min(1).max(512),
|
|
15574
|
+
project: project.nullable(),
|
|
15575
|
+
/** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
|
|
15576
|
+
title: external_exports.string().min(1).max(200).optional(),
|
|
15577
|
+
/** Models the session used, most requests first. */
|
|
15578
|
+
models: external_exports.array(model).max(16),
|
|
15579
|
+
firstAtMs: count,
|
|
15580
|
+
lastAtMs: count,
|
|
15581
|
+
...totals
|
|
15582
|
+
});
|
|
15583
|
+
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
15584
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
15585
|
+
/** First local date of the range; null for all time. */
|
|
15586
|
+
from: localDate.nullable(),
|
|
15587
|
+
to: localDate,
|
|
15588
|
+
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
15589
|
+
filters: external_exports.strictObject({
|
|
15590
|
+
harness: harness.nullable(),
|
|
15591
|
+
model: model.nullable(),
|
|
15592
|
+
unknownModel: external_exports.boolean(),
|
|
15593
|
+
project: project.nullable(),
|
|
15594
|
+
unknownProject: external_exports.boolean(),
|
|
15595
|
+
date: localDate.nullable()
|
|
15596
|
+
}),
|
|
15597
|
+
/** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
|
|
15598
|
+
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
|
|
15599
|
+
/** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
|
|
15600
|
+
failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
|
|
15601
|
+
/** Every value seen in the range, ignoring the filters, to choose filters from. */
|
|
15602
|
+
options: external_exports.strictObject({
|
|
15603
|
+
harnesses: external_exports.array(harness).max(256),
|
|
15604
|
+
models: external_exports.array(model.nullable()).max(4096),
|
|
15605
|
+
projects: external_exports.array(project.nullable()).max(4096)
|
|
15606
|
+
}),
|
|
15607
|
+
/** Current display metadata, scoped by Harness. Never a pricing or filter identity.
|
|
15608
|
+
* Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
|
|
15609
|
+
*/
|
|
15610
|
+
modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
|
|
15611
|
+
/** Native credits, all filters applied, never combined across Harnesses or treated as USD.
|
|
15612
|
+
* Only groups with at least one reported value appear; reportedRequests exposes partial data.
|
|
15613
|
+
*/
|
|
15614
|
+
credits: external_exports.array(external_exports.strictObject({
|
|
15615
|
+
harness,
|
|
15616
|
+
model: model.nullable(),
|
|
15617
|
+
credits: external_exports.number().finite().min(0),
|
|
15618
|
+
reportedRequests: count,
|
|
15619
|
+
requests: count
|
|
15620
|
+
})).max(4096).optional(),
|
|
15621
|
+
/** All filters applied. */
|
|
15622
|
+
totals: usageStatisticsTotalsSchema,
|
|
15623
|
+
/** Each date and Harness of the range: every filter except the day. */
|
|
15624
|
+
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
15625
|
+
/** Local weekday (0 = Sunday) and hour, all filters applied. */
|
|
15626
|
+
hourly: external_exports.array(external_exports.strictObject({
|
|
15627
|
+
weekday: external_exports.number().int().min(0).max(6),
|
|
15628
|
+
hour: external_exports.number().int().min(0).max(23),
|
|
15629
|
+
...totals
|
|
15630
|
+
})).max(168),
|
|
15631
|
+
byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
|
|
15632
|
+
byModel: external_exports.array(external_exports.strictObject({
|
|
15633
|
+
model: model.nullable(),
|
|
15634
|
+
...totals,
|
|
15635
|
+
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
15636
|
+
harnessPricedRequests: count
|
|
15637
|
+
})).max(4096),
|
|
15638
|
+
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
15639
|
+
/**
|
|
15640
|
+
* The sessions that spent the most, by cost and by tokens without cache, all filters applied;
|
|
15641
|
+
* requests without a native session are not listed here but count everywhere else.
|
|
15642
|
+
*/
|
|
15643
|
+
sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
|
|
15644
|
+
/**
|
|
15645
|
+
* The sessions last active in the range, newest first, all filters applied. Optional for older
|
|
15646
|
+
* Hosts; missing is treated as no list rather than no sessions.
|
|
15647
|
+
*/
|
|
15648
|
+
recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
|
|
15649
|
+
});
|
|
15650
|
+
|
|
15454
15651
|
// packages/shared-contracts/dist/ids.js
|
|
15455
15652
|
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
15456
15653
|
message: "Identifier must not be empty or whitespace"
|
|
@@ -15472,13 +15669,40 @@ var HARNESS_PLUGIN_LIMIT = 128;
|
|
|
15472
15669
|
var harnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).refine((id) => id !== "codex", "The official Codex identity is reserved").pipe(harnessIdSchema);
|
|
15473
15670
|
var relativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
|
|
15474
15671
|
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
15672
|
+
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
15673
|
+
var harnessInstallationGuideSchema = external_exports.object({
|
|
15674
|
+
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
15675
|
+
before: localizedTextSchema.optional(),
|
|
15676
|
+
after: localizedTextSchema.optional(),
|
|
15677
|
+
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
15678
|
+
}).strict();
|
|
15475
15679
|
var pluginPresentationShape = {
|
|
15476
15680
|
id: harnessPluginIdSchema,
|
|
15477
15681
|
name: external_exports.string().trim().min(1).max(128),
|
|
15478
15682
|
version: external_exports.string().min(1).max(128),
|
|
15683
|
+
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
15684
|
+
kind: external_exports.literal("usage").optional(),
|
|
15685
|
+
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
15686
|
+
iconStyle: external_exports.object({
|
|
15687
|
+
vector: external_exports.object({
|
|
15688
|
+
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
15689
|
+
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
15690
|
+
paths: external_exports.array(external_exports.object({
|
|
15691
|
+
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
15692
|
+
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
15693
|
+
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
15694
|
+
}).strict()).min(1).max(32)
|
|
15695
|
+
}).strict().optional(),
|
|
15696
|
+
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
15697
|
+
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
15698
|
+
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
15699
|
+
}).strict().optional(),
|
|
15700
|
+
installation: harnessInstallationGuideSchema.optional(),
|
|
15701
|
+
notice: localizedTextSchema.optional(),
|
|
15479
15702
|
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
15480
15703
|
launchCommand: external_exports.literal(true).optional(),
|
|
15481
15704
|
links: external_exports.object({
|
|
15705
|
+
website: documentationUrlSchema.optional(),
|
|
15482
15706
|
documentation: documentationUrlSchema.optional(),
|
|
15483
15707
|
installation: documentationUrlSchema.optional()
|
|
15484
15708
|
}).strict().optional()
|
|
@@ -15555,6 +15779,10 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15555
15779
|
"codexhost/account/list",
|
|
15556
15780
|
"codexhost/account/refresh",
|
|
15557
15781
|
"codexhost/account/usage/inspect",
|
|
15782
|
+
"codexhost/usage/model-prices/get",
|
|
15783
|
+
"codexhost/usage/model-prices/set",
|
|
15784
|
+
"codexhost/usage/model-prices/default",
|
|
15785
|
+
"codexhost/usage/statistics/get",
|
|
15558
15786
|
"codexhost/update/check",
|
|
15559
15787
|
"codexhost/update/start",
|
|
15560
15788
|
"codexhost/update/status"
|
|
@@ -15622,6 +15850,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15622
15850
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15623
15851
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15624
15852
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15853
|
+
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15625
15854
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15626
15855
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15627
15856
|
totalCostUsd: finiteNonNegativeNumberSchema.optional(),
|
|
@@ -15633,7 +15862,11 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15633
15862
|
planFiveHourUsedPercent: cacheHitRatePercentSchema.optional(),
|
|
15634
15863
|
planFiveHourResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
15635
15864
|
planSevenDayUsedPercent: cacheHitRatePercentSchema.optional(),
|
|
15636
|
-
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional()
|
|
15865
|
+
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
15866
|
+
sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
|
|
15867
|
+
timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
15868
|
+
costSource: external_exports.enum(["publicPrice", "native"]).optional(),
|
|
15869
|
+
unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
|
|
15637
15870
|
}).strict().superRefine((usage2, context) => {
|
|
15638
15871
|
if (Object.keys(usage2).length === 0) {
|
|
15639
15872
|
context.addIssue({ code: "custom", message: "Thread Usage must contain a reliable field" });
|
|
@@ -15654,6 +15887,20 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15654
15887
|
path: ["contextWindowTokens"]
|
|
15655
15888
|
});
|
|
15656
15889
|
}
|
|
15890
|
+
if (usage2.costSource !== void 0 && usage2.totalCostUsd === void 0) {
|
|
15891
|
+
context.addIssue({
|
|
15892
|
+
code: "custom",
|
|
15893
|
+
message: "Thread Usage costSource must be provided with totalCostUsd",
|
|
15894
|
+
path: ["costSource"]
|
|
15895
|
+
});
|
|
15896
|
+
}
|
|
15897
|
+
if (usage2.unpricedModels !== void 0 && usage2.costSource !== "publicPrice") {
|
|
15898
|
+
context.addIssue({
|
|
15899
|
+
code: "custom",
|
|
15900
|
+
message: "Thread Usage unpricedModels must be provided with a publicPrice cost",
|
|
15901
|
+
path: ["unpricedModels"]
|
|
15902
|
+
});
|
|
15903
|
+
}
|
|
15657
15904
|
if (usage2.planFiveHourResetsAtUnix !== void 0 && usage2.planFiveHourUsedPercent === void 0) {
|
|
15658
15905
|
context.addIssue({
|
|
15659
15906
|
code: "custom",
|
|
@@ -15923,27 +16170,27 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
15923
16170
|
}).strict().superRefine((catalog, context) => {
|
|
15924
16171
|
const refs = /* @__PURE__ */ new Set();
|
|
15925
16172
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id }) => id));
|
|
15926
|
-
for (const [index,
|
|
15927
|
-
if (refs.has(
|
|
16173
|
+
for (const [index, model2] of catalog.models.entries()) {
|
|
16174
|
+
if (refs.has(model2.ref.id)) {
|
|
15928
16175
|
context.addIssue({
|
|
15929
16176
|
code: "custom",
|
|
15930
16177
|
message: "Model Catalog refs must be unique",
|
|
15931
16178
|
path: ["models", index, "ref", "id"]
|
|
15932
16179
|
});
|
|
15933
16180
|
}
|
|
15934
|
-
refs.add(
|
|
15935
|
-
if (
|
|
15936
|
-
if (refs.has(
|
|
16181
|
+
refs.add(model2.ref.id);
|
|
16182
|
+
if (model2.fastModel) {
|
|
16183
|
+
if (refs.has(model2.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model2.fastModel?.id)) {
|
|
15937
16184
|
context.addIssue({
|
|
15938
16185
|
code: "custom",
|
|
15939
16186
|
message: "Fast Model refs must be distinct and unique",
|
|
15940
16187
|
path: ["models", index, "fastModel"]
|
|
15941
16188
|
});
|
|
15942
16189
|
}
|
|
15943
|
-
refs.add(
|
|
16190
|
+
refs.add(model2.fastModel.id);
|
|
15944
16191
|
}
|
|
15945
16192
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
15946
|
-
for (const [optionIndex, optionId] of (
|
|
16193
|
+
for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
|
|
15947
16194
|
if (supportedThinkingIds.has(optionId)) {
|
|
15948
16195
|
context.addIssue({
|
|
15949
16196
|
code: "custom",
|
|
@@ -16532,6 +16779,11 @@ var codexSshDraftSchema = external_exports.strictObject({
|
|
|
16532
16779
|
});
|
|
16533
16780
|
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
16534
16781
|
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
16782
|
+
external_exports.strictObject({
|
|
16783
|
+
action: external_exports.literal("read-thread"),
|
|
16784
|
+
hostId: hostId.refine((id) => id !== "local"),
|
|
16785
|
+
input: delegationReadParamsSchema
|
|
16786
|
+
}),
|
|
16535
16787
|
external_exports.strictObject({
|
|
16536
16788
|
action: external_exports.literal("save"),
|
|
16537
16789
|
draft: codexSshDraftSchema,
|
|
@@ -16824,14 +17076,14 @@ function createConsoleHarnesses(roots, environment = process.env) {
|
|
|
16824
17076
|
return {
|
|
16825
17077
|
list,
|
|
16826
17078
|
async setLaunchPath(id, value) {
|
|
16827
|
-
const
|
|
16828
|
-
if (!
|
|
16829
|
-
if (!
|
|
17079
|
+
const harness2 = (await list()).find((candidate) => candidate.id === id);
|
|
17080
|
+
if (!harness2) throw new ConsoleHarnessError(404, `Harness '${id}' is not installed`);
|
|
17081
|
+
if (!harness2.launchCommand) {
|
|
16830
17082
|
throw new ConsoleHarnessError(400, `Harness '${id}' does not accept an installation path`);
|
|
16831
17083
|
}
|
|
16832
17084
|
try {
|
|
16833
17085
|
const settings = await store.set(id, value);
|
|
16834
|
-
return { ...
|
|
17086
|
+
return { ...harness2, launchPath: settings.path };
|
|
16835
17087
|
} catch (error51) {
|
|
16836
17088
|
throw new ConsoleHarnessError(400, error51 instanceof Error ? error51.message : String(error51));
|
|
16837
17089
|
}
|
|
@@ -17353,14 +17605,15 @@ function createConsoleUpdates(options) {
|
|
|
17353
17605
|
});
|
|
17354
17606
|
let candidate = null;
|
|
17355
17607
|
let handedOff = false;
|
|
17608
|
+
let currentStatusPath = null;
|
|
17356
17609
|
async function latestStatus() {
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
return null;
|
|
17610
|
+
if (!currentStatusPath) {
|
|
17611
|
+
const active = await discoverActiveUpdateStatus(stateDirectory());
|
|
17612
|
+
if (!active) return null;
|
|
17613
|
+
currentStatusPath = active.statusPath;
|
|
17362
17614
|
}
|
|
17363
|
-
|
|
17615
|
+
const status = await manager.readStatus(currentStatusPath);
|
|
17616
|
+
return status ? publicStatus(status) : null;
|
|
17364
17617
|
}
|
|
17365
17618
|
function installable(metadata, release) {
|
|
17366
17619
|
const kind = installationKind(metadata);
|
|
@@ -17487,6 +17740,7 @@ function createConsoleUpdates(options) {
|
|
|
17487
17740
|
if (existing) return { status: existing };
|
|
17488
17741
|
throw new ConsoleUpdateError("busy", "Another update operation is already active");
|
|
17489
17742
|
}
|
|
17743
|
+
currentStatusPath = null;
|
|
17490
17744
|
try {
|
|
17491
17745
|
const release = await fetchLatest();
|
|
17492
17746
|
if (compareSemanticVersions(metadata.version, release.version) >= 0 || candidate && candidate.version !== release.version) {
|
|
@@ -17505,9 +17759,10 @@ function createConsoleUpdates(options) {
|
|
|
17505
17759
|
try {
|
|
17506
17760
|
const prepared = await prepare(metadata, target, release, async (info) => {
|
|
17507
17761
|
await lock.setStatusPath(info.statusPath);
|
|
17762
|
+
currentStatusPath = info.statusPath;
|
|
17508
17763
|
resolvePrepared(info.statusPath);
|
|
17509
17764
|
});
|
|
17510
|
-
manager.start(prepared);
|
|
17765
|
+
await manager.start(prepared);
|
|
17511
17766
|
handedOff = true;
|
|
17512
17767
|
options.onHandedOff();
|
|
17513
17768
|
} catch (error51) {
|
|
@@ -17540,7 +17795,7 @@ function createConsoleUpdates(options) {
|
|
|
17540
17795
|
|
|
17541
17796
|
// packages/console-server/src/server.ts
|
|
17542
17797
|
var CONSOLE_SERVICE = "codexhost-console";
|
|
17543
|
-
var ISSUE_LIST_URL = "https://github.com/
|
|
17798
|
+
var ISSUE_LIST_URL = "https://github.com/LIBERSEEK/BOFT-CLI/issues";
|
|
17544
17799
|
var MAX_BODY_BYTES = 16 * 1024;
|
|
17545
17800
|
var INSPECT_CACHE_MS = 2e3;
|
|
17546
17801
|
var SECURITY_HEADERS = {
|
|
@@ -17835,8 +18090,8 @@ function startConsoleServer(options) {
|
|
|
17835
18090
|
return;
|
|
17836
18091
|
}
|
|
17837
18092
|
try {
|
|
17838
|
-
const
|
|
17839
|
-
sendJson(response, 200, { harness });
|
|
18093
|
+
const harness2 = await options.harnesses.setLaunchPath(id, value === "" ? null : value);
|
|
18094
|
+
sendJson(response, 200, { harness: harness2 });
|
|
17840
18095
|
} catch (error51) {
|
|
17841
18096
|
sendJson(response, error51 instanceof ConsoleHarnessError ? error51.status : 500, {
|
|
17842
18097
|
error: error51 instanceof Error ? error51.message : String(error51)
|
|
@@ -17943,7 +18198,7 @@ async function consoleBuildId(entryPath2, environment = process.env) {
|
|
|
17943
18198
|
}
|
|
17944
18199
|
const runtime = await readRuntimeMetadata(entryPath2, environment).catch(() => null);
|
|
17945
18200
|
if (runtime?.distribution === "development") parts.push(runtime.version);
|
|
17946
|
-
return parts.join(".");
|
|
18201
|
+
return JSON.stringify([parts.join("."), dataDirectory(environment)]);
|
|
17947
18202
|
}
|
|
17948
18203
|
function startDetachedServer(entryPath2, environment) {
|
|
17949
18204
|
const child = spawn3(process.execPath, [entryPath2, "serve"], {
|
|
@@ -18014,7 +18269,7 @@ async function runUpdateCommand(target, updates, write = console.log) {
|
|
|
18014
18269
|
const { status } = await updates.start(target);
|
|
18015
18270
|
if (status.phase === "failed") throw new Error(status.error ?? "Update failed");
|
|
18016
18271
|
write(
|
|
18017
|
-
`Update ${status.version}: ${status.phase}. The background updater
|
|
18272
|
+
`Update ${status.version}: ${status.phase}. The background updater has accepted the handoff; installation is not complete yet. It will install the update and restart BOFT CLI.`
|
|
18018
18273
|
);
|
|
18019
18274
|
}
|
|
18020
18275
|
async function updateFromCommand(appDirectory2, arguments_) {
|