@liberseek/boft-cli-win32-arm64 0.6.9 → 0.7.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 +12 -4
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +287 -170
- package/app/host-runtime.mjs +2450 -1044
- package/app/plugins/antigravity/plugin.mjs +167 -16
- package/app/plugins/claude-code/plugin.mjs +311 -58
- package/app/plugins/codebuddy/plugin.mjs +2355 -894
- package/app/plugins/cursor-cli/plugin.mjs +35973 -10933
- package/app/plugins/deepseek-harness/plugin.mjs +125 -7
- package/app/plugins/enabled.json +4 -1
- package/app/plugins/grok/plugin.mjs +261 -97
- package/app/plugins/hermes/plugin.mjs +2486 -99
- package/app/plugins/kiro-cli/plugin.mjs +120 -3
- package/app/plugins/muse/plugin.mjs +110 -0
- package/app/plugins/omp/plugin.mjs +145 -10
- package/app/plugins/opencode/plugin.mjs +162 -46
- package/app/plugins/pi/plugin.mjs +2891 -1678
- package/app/plugins/qoder/assets/icon.svg +1 -0
- package/app/plugins/qoder/manifest.json +12 -0
- package/app/plugins/qoder/plugin.mjs +52352 -0
- package/app/plugins/qoder-cn/assets/icon.svg +1 -0
- package/app/plugins/qoder-cn/manifest.json +12 -0
- package/app/plugins/qoder-cn/plugin.mjs +52350 -0
- package/app/plugins/workbuddy/assets/icon.svg +29 -0
- package/app/plugins/workbuddy/manifest.json +14 -0
- package/app/plugins/workbuddy/plugin.mjs +25007 -0
- package/app/renderer-extension.js +6043 -1442
- 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/Qoder-Agent-SDK-LICENSE.txt +7 -0
- package/licenses/QoderCN-Agent-SDK-LICENSE.txt +7 -0
- package/licenses/{opencodex-LICENSE.txt → tailwindcss-LICENSE.txt} +1 -1
- package/package.json +1 -1
|
@@ -776,10 +776,10 @@ function mergeDefs(...defs) {
|
|
|
776
776
|
function cloneDef(schema) {
|
|
777
777
|
return mergeDefs(schema._zod.def);
|
|
778
778
|
}
|
|
779
|
-
function getElementAtPath(obj,
|
|
780
|
-
if (!
|
|
779
|
+
function getElementAtPath(obj, path15) {
|
|
780
|
+
if (!path15)
|
|
781
781
|
return obj;
|
|
782
|
-
return
|
|
782
|
+
return path15.reduce((acc, key) => acc?.[key], obj);
|
|
783
783
|
}
|
|
784
784
|
function promiseAllObject(promisesObj) {
|
|
785
785
|
const keys = Object.keys(promisesObj);
|
|
@@ -1188,11 +1188,11 @@ function explicitlyAborted(x2, startIndex = 0) {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
return false;
|
|
1190
1190
|
}
|
|
1191
|
-
function prefixIssues(
|
|
1191
|
+
function prefixIssues(path15, issues) {
|
|
1192
1192
|
return issues.map((iss) => {
|
|
1193
1193
|
var _a4;
|
|
1194
1194
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
1195
|
-
iss.path.unshift(
|
|
1195
|
+
iss.path.unshift(path15);
|
|
1196
1196
|
return iss;
|
|
1197
1197
|
});
|
|
1198
1198
|
}
|
|
@@ -1339,16 +1339,16 @@ function flattenError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
1341
1341
|
const fieldErrors = { _errors: [] };
|
|
1342
|
-
const processError = (error53,
|
|
1342
|
+
const processError = (error53, path15 = []) => {
|
|
1343
1343
|
for (const issue2 of error53.issues) {
|
|
1344
1344
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1345
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1345
|
+
issue2.errors.map((issues) => processError({ issues }, [...path15, ...issue2.path]));
|
|
1346
1346
|
} else if (issue2.code === "invalid_key") {
|
|
1347
|
-
processError({ issues: issue2.issues }, [...
|
|
1347
|
+
processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
|
|
1348
1348
|
} else if (issue2.code === "invalid_element") {
|
|
1349
|
-
processError({ issues: issue2.issues }, [...
|
|
1349
|
+
processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
|
|
1350
1350
|
} else {
|
|
1351
|
-
const fullpath = [...
|
|
1351
|
+
const fullpath = [...path15, ...issue2.path];
|
|
1352
1352
|
if (fullpath.length === 0) {
|
|
1353
1353
|
fieldErrors._errors.push(mapper(issue2));
|
|
1354
1354
|
} else {
|
|
@@ -1375,17 +1375,17 @@ function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1375
1375
|
}
|
|
1376
1376
|
function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
1377
1377
|
const result = { errors: [] };
|
|
1378
|
-
const processError = (error53,
|
|
1378
|
+
const processError = (error53, path15 = []) => {
|
|
1379
1379
|
var _a4, _b2;
|
|
1380
1380
|
for (const issue2 of error53.issues) {
|
|
1381
1381
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1382
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1382
|
+
issue2.errors.map((issues) => processError({ issues }, [...path15, ...issue2.path]));
|
|
1383
1383
|
} else if (issue2.code === "invalid_key") {
|
|
1384
|
-
processError({ issues: issue2.issues }, [...
|
|
1384
|
+
processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
|
|
1385
1385
|
} else if (issue2.code === "invalid_element") {
|
|
1386
|
-
processError({ issues: issue2.issues }, [...
|
|
1386
|
+
processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
|
|
1387
1387
|
} else {
|
|
1388
|
-
const fullpath = [...
|
|
1388
|
+
const fullpath = [...path15, ...issue2.path];
|
|
1389
1389
|
if (fullpath.length === 0) {
|
|
1390
1390
|
result.errors.push(mapper(issue2));
|
|
1391
1391
|
continue;
|
|
@@ -1417,8 +1417,8 @@ function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
function toDotPath(_path) {
|
|
1419
1419
|
const segs = [];
|
|
1420
|
-
const
|
|
1421
|
-
for (const seg of
|
|
1420
|
+
const path15 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1421
|
+
for (const seg of path15) {
|
|
1422
1422
|
if (typeof seg === "number")
|
|
1423
1423
|
segs.push(`[${seg}]`);
|
|
1424
1424
|
else if (typeof seg === "symbol")
|
|
@@ -14110,13 +14110,13 @@ function resolveRef(ref, ctx) {
|
|
|
14110
14110
|
if (!ref.startsWith("#")) {
|
|
14111
14111
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14112
14112
|
}
|
|
14113
|
-
const
|
|
14114
|
-
if (
|
|
14113
|
+
const path15 = ref.slice(1).split("/").filter(Boolean);
|
|
14114
|
+
if (path15.length === 0) {
|
|
14115
14115
|
return ctx.rootSchema;
|
|
14116
14116
|
}
|
|
14117
14117
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14118
|
-
if (
|
|
14119
|
-
const key =
|
|
14118
|
+
if (path15[0] === defsKey) {
|
|
14119
|
+
const key = path15[1];
|
|
14120
14120
|
if (!key || !ctx.defs[key]) {
|
|
14121
14121
|
throw new Error(`Reference not found: ${ref}`);
|
|
14122
14122
|
}
|
|
@@ -14524,9 +14524,104 @@ function date4(params) {
|
|
|
14524
14524
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
14525
14525
|
config(en_default());
|
|
14526
14526
|
|
|
14527
|
+
// ../../shared-contracts/dist/credential-imports.js
|
|
14528
|
+
var credentialSourceSchema = external_exports.object({
|
|
14529
|
+
id: external_exports.string().min(1).max(256),
|
|
14530
|
+
harnessId: external_exports.string().min(1),
|
|
14531
|
+
label: external_exports.string().min(1).max(512),
|
|
14532
|
+
provider: external_exports.enum(["openai-codex", "xai"])
|
|
14533
|
+
}).strict();
|
|
14534
|
+
var credentialImportNameSchema = external_exports.string().regex(/^[a-z][a-z0-9-]{0,47}$/);
|
|
14535
|
+
var credentialImportRecordSchema = external_exports.object({
|
|
14536
|
+
name: credentialImportNameSchema,
|
|
14537
|
+
source: credentialSourceSchema,
|
|
14538
|
+
importedAt: external_exports.string()
|
|
14539
|
+
}).strict();
|
|
14540
|
+
var credentialImportsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
14541
|
+
external_exports.object({ action: external_exports.literal("list") }).strict(),
|
|
14542
|
+
external_exports.object({
|
|
14543
|
+
action: external_exports.literal("import"),
|
|
14544
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
14545
|
+
name: credentialImportNameSchema,
|
|
14546
|
+
confirmed: external_exports.literal(true)
|
|
14547
|
+
}).strict(),
|
|
14548
|
+
external_exports.object({
|
|
14549
|
+
action: external_exports.literal("reimport"),
|
|
14550
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
14551
|
+
name: credentialImportNameSchema,
|
|
14552
|
+
confirmed: external_exports.literal(true)
|
|
14553
|
+
}).strict(),
|
|
14554
|
+
external_exports.object({
|
|
14555
|
+
action: external_exports.literal("remove"),
|
|
14556
|
+
name: credentialImportNameSchema,
|
|
14557
|
+
confirmed: external_exports.literal(true)
|
|
14558
|
+
}).strict()
|
|
14559
|
+
]);
|
|
14560
|
+
var credentialOtherLoginSchema = external_exports.object({
|
|
14561
|
+
provider: external_exports.string().min(1).max(128),
|
|
14562
|
+
type: external_exports.enum(["oauth", "api_key", "unknown"]),
|
|
14563
|
+
/** Best-effort account label (e.g. the email in a Codex token), derived locally when present. */
|
|
14564
|
+
label: external_exports.string().min(1).max(512).optional(),
|
|
14565
|
+
/** Recognized credential vendor, derived from the OAuth token issuer. Absent when unknown. */
|
|
14566
|
+
vendor: external_exports.enum(["openai-codex", "xai"]).optional()
|
|
14567
|
+
}).strict();
|
|
14568
|
+
var credentialImportsResultSchema = external_exports.object({
|
|
14569
|
+
sources: external_exports.array(credentialSourceSchema),
|
|
14570
|
+
targets: external_exports.array(external_exports.object({
|
|
14571
|
+
harnessId: external_exports.string(),
|
|
14572
|
+
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
14573
|
+
imports: external_exports.array(credentialImportRecordSchema),
|
|
14574
|
+
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
14575
|
+
}).strict())
|
|
14576
|
+
}).strict();
|
|
14577
|
+
var credentialImportsParamsSchema = external_exports.object({
|
|
14578
|
+
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
14579
|
+
request: credentialImportsRequestSchema
|
|
14580
|
+
}).strict();
|
|
14581
|
+
|
|
14527
14582
|
// ../../shared-contracts/dist/version.js
|
|
14528
14583
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14529
14584
|
|
|
14585
|
+
// ../../shared-contracts/dist/idle-release.js
|
|
14586
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
14587
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
14588
|
+
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
14589
|
+
enabled: external_exports.boolean(),
|
|
14590
|
+
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
14591
|
+
});
|
|
14592
|
+
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
14593
|
+
enabled: false,
|
|
14594
|
+
timeoutMinutes: 30
|
|
14595
|
+
});
|
|
14596
|
+
|
|
14597
|
+
// ../../shared-contracts/dist/loaded-sessions.js
|
|
14598
|
+
var loadedSessionStateSchema = external_exports.enum([
|
|
14599
|
+
"idle",
|
|
14600
|
+
"running",
|
|
14601
|
+
"busy",
|
|
14602
|
+
"closing",
|
|
14603
|
+
"failed",
|
|
14604
|
+
"blocked"
|
|
14605
|
+
]);
|
|
14606
|
+
var loadedSessionReasonSchema = external_exports.enum([
|
|
14607
|
+
"none",
|
|
14608
|
+
"disabled",
|
|
14609
|
+
"timeout",
|
|
14610
|
+
"operation",
|
|
14611
|
+
"background",
|
|
14612
|
+
"identity",
|
|
14613
|
+
"persistence",
|
|
14614
|
+
"closeFailed"
|
|
14615
|
+
]);
|
|
14616
|
+
var loadedSessionsSchema = external_exports.array(external_exports.strictObject({
|
|
14617
|
+
threadId: external_exports.string(),
|
|
14618
|
+
title: external_exports.string(),
|
|
14619
|
+
harnessId: external_exports.string(),
|
|
14620
|
+
state: loadedSessionStateSchema,
|
|
14621
|
+
reason: loadedSessionReasonSchema,
|
|
14622
|
+
inactiveMs: external_exports.number().nonnegative()
|
|
14623
|
+
}));
|
|
14624
|
+
|
|
14530
14625
|
// ../../shared-contracts/dist/ids.js
|
|
14531
14626
|
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14532
14627
|
message: "Identifier must not be empty or whitespace"
|
|
@@ -15033,6 +15128,8 @@ var pluginPresentationShape = {
|
|
|
15033
15128
|
id: harnessPluginIdSchema,
|
|
15034
15129
|
name: external_exports.string().trim().min(1).max(128),
|
|
15035
15130
|
version: external_exports.string().min(1).max(128),
|
|
15131
|
+
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
15132
|
+
launchCommand: external_exports.literal(true).optional(),
|
|
15036
15133
|
links: external_exports.object({
|
|
15037
15134
|
documentation: documentationUrlSchema.optional(),
|
|
15038
15135
|
installation: documentationUrlSchema.optional()
|
|
@@ -15070,6 +15167,19 @@ var harnessPluginRouteSchema = external_exports.object({
|
|
|
15070
15167
|
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15071
15168
|
}).strict();
|
|
15072
15169
|
|
|
15170
|
+
// ../../shared-contracts/dist/harness-launch-settings.js
|
|
15171
|
+
var harnessLaunchPathSchema = external_exports.string().trim().min(1).max(4096).refine((value) => !/[\u0000\r\n]/u.test(value), "Invalid entrypoint path");
|
|
15172
|
+
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
15173
|
+
harnessId: harnessPluginIdSchema
|
|
15174
|
+
}).strict();
|
|
15175
|
+
var harnessLaunchSettingsSetSchema = harnessLaunchSettingsGetSchema.extend({
|
|
15176
|
+
path: harnessLaunchPathSchema.nullable()
|
|
15177
|
+
});
|
|
15178
|
+
var harnessLaunchSettingsSchema = external_exports.object({
|
|
15179
|
+
path: harnessLaunchPathSchema.nullable(),
|
|
15180
|
+
restartRequired: external_exports.boolean()
|
|
15181
|
+
}).strict();
|
|
15182
|
+
|
|
15073
15183
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15074
15184
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
15075
15185
|
var nonBlankTextSchema3 = external_exports.string().trim().min(1);
|
|
@@ -16567,7 +16677,7 @@ var BrokeredHarnessAdapter = class {
|
|
|
16567
16677
|
|
|
16568
16678
|
// dist/claude-code-adapter.js
|
|
16569
16679
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
16570
|
-
import
|
|
16680
|
+
import path13 from "node:path";
|
|
16571
16681
|
|
|
16572
16682
|
// ../../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
16573
16683
|
import { createRequire as DW } from "node:module";
|
|
@@ -20474,8 +20584,8 @@ var qU = v(function(BU) {
|
|
|
20474
20584
|
BU._globalThis = void 0;
|
|
20475
20585
|
BU._globalThis = typeof globalThis === "object" ? globalThis : global;
|
|
20476
20586
|
});
|
|
20477
|
-
var GU = v(function(
|
|
20478
|
-
var Axe =
|
|
20587
|
+
var GU = v(function(os6) {
|
|
20588
|
+
var Axe = os6 && os6.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
20479
20589
|
if (n === void 0) n = r;
|
|
20480
20590
|
Object.defineProperty(e, n, { enumerable: true, get: function() {
|
|
20481
20591
|
return t[r];
|
|
@@ -20483,11 +20593,11 @@ var GU = v(function(os5) {
|
|
|
20483
20593
|
} : function(e, t, r, n) {
|
|
20484
20594
|
if (n === void 0) n = r;
|
|
20485
20595
|
e[n] = t[r];
|
|
20486
|
-
}), kxe =
|
|
20596
|
+
}), kxe = os6 && os6.__exportStar || function(e, t) {
|
|
20487
20597
|
for (var r in e) if (r !== "default" && !Object.prototype.hasOwnProperty.call(t, r)) Axe(t, e, r);
|
|
20488
20598
|
};
|
|
20489
|
-
Object.defineProperty(
|
|
20490
|
-
kxe(qU(),
|
|
20599
|
+
Object.defineProperty(os6, "__esModule", { value: true });
|
|
20600
|
+
kxe(qU(), os6);
|
|
20491
20601
|
});
|
|
20492
20602
|
var WU = v(function(is) {
|
|
20493
20603
|
var Oxe = is && is.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
@@ -42507,7 +42617,7 @@ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath
|
|
|
42507
42617
|
const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
|
|
42508
42618
|
const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
|
|
42509
42619
|
if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
|
|
42510
|
-
directories.
|
|
42620
|
+
directories.push(runtimeDirectory);
|
|
42511
42621
|
}
|
|
42512
42622
|
return { ...environment, [pathKey]: directories.join(delimiter) };
|
|
42513
42623
|
}
|
|
@@ -43742,6 +43852,9 @@ async function readClaudeSubagentTranscript(input) {
|
|
|
43742
43852
|
|
|
43743
43853
|
// dist/model-catalog.js
|
|
43744
43854
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
43855
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
43856
|
+
import os5 from "node:os";
|
|
43857
|
+
import path9 from "node:path";
|
|
43745
43858
|
|
|
43746
43859
|
// dist/thinking-options.js
|
|
43747
43860
|
var option = (id, label) => ({
|
|
@@ -43781,8 +43894,19 @@ var CLAUDE_MODEL_VALUE_MAX_LENGTH = 512;
|
|
|
43781
43894
|
var modelInfoSchema = external_exports.object({
|
|
43782
43895
|
value: external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH),
|
|
43783
43896
|
displayName: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
43897
|
+
description: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
43784
43898
|
resolvedModel: harnessResolvedModelLabelSchema.optional()
|
|
43785
43899
|
});
|
|
43900
|
+
var modelPickerOptionSchema = external_exports.object({
|
|
43901
|
+
model: external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH),
|
|
43902
|
+
label: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
43903
|
+
description: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
43904
|
+
behavesAs: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional()
|
|
43905
|
+
});
|
|
43906
|
+
var modelPickerSettingsSchema = external_exports.object({
|
|
43907
|
+
options: external_exports.array(external_exports.unknown()).optional(),
|
|
43908
|
+
replaceBuiltInOptions: external_exports.boolean().optional()
|
|
43909
|
+
});
|
|
43786
43910
|
var CLAUDE_DEFAULT_MODEL_REF = encodeClaudeModelRef("default");
|
|
43787
43911
|
function encodeClaudeModelRef(value) {
|
|
43788
43912
|
const parsed = external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH).parse(value);
|
|
@@ -43811,6 +43935,127 @@ function decodeClaudeModelRef(ref) {
|
|
|
43811
43935
|
}
|
|
43812
43936
|
return value === "default" ? void 0 : value;
|
|
43813
43937
|
}
|
|
43938
|
+
function resolveClaudeConfigDirectory(environment = process.env) {
|
|
43939
|
+
return path9.resolve(environment.CLAUDE_CONFIG_DIR ?? path9.join(os5.homedir(), ".claude"));
|
|
43940
|
+
}
|
|
43941
|
+
function parseModelPickerOptions(value) {
|
|
43942
|
+
if (!Array.isArray(value))
|
|
43943
|
+
return [];
|
|
43944
|
+
const options = [];
|
|
43945
|
+
const seen = /* @__PURE__ */ new Set();
|
|
43946
|
+
for (const entry of value) {
|
|
43947
|
+
const parsed = modelPickerOptionSchema.safeParse(entry);
|
|
43948
|
+
if (!parsed.success)
|
|
43949
|
+
continue;
|
|
43950
|
+
if (seen.has(parsed.data.model))
|
|
43951
|
+
continue;
|
|
43952
|
+
seen.add(parsed.data.model);
|
|
43953
|
+
options.push({
|
|
43954
|
+
model: parsed.data.model,
|
|
43955
|
+
...parsed.data.label ? { label: parsed.data.label } : {},
|
|
43956
|
+
...parsed.data.description ? { description: parsed.data.description } : {},
|
|
43957
|
+
...parsed.data.behavesAs ? { behavesAs: parsed.data.behavesAs } : {}
|
|
43958
|
+
});
|
|
43959
|
+
}
|
|
43960
|
+
return options;
|
|
43961
|
+
}
|
|
43962
|
+
function parseClaudeModelPickerSettings(value) {
|
|
43963
|
+
if (value === void 0 || value === null)
|
|
43964
|
+
return void 0;
|
|
43965
|
+
const parsed = modelPickerSettingsSchema.safeParse(value);
|
|
43966
|
+
if (!parsed.success)
|
|
43967
|
+
return void 0;
|
|
43968
|
+
if (parsed.data.options === void 0 && parsed.data.replaceBuiltInOptions === void 0) {
|
|
43969
|
+
return void 0;
|
|
43970
|
+
}
|
|
43971
|
+
const options = parseModelPickerOptions(parsed.data.options);
|
|
43972
|
+
if (Array.isArray(parsed.data.options) && parsed.data.options.length > 0 && options.length === 0) {
|
|
43973
|
+
return void 0;
|
|
43974
|
+
}
|
|
43975
|
+
return {
|
|
43976
|
+
options,
|
|
43977
|
+
replaceBuiltInOptions: parsed.data.replaceBuiltInOptions === true
|
|
43978
|
+
};
|
|
43979
|
+
}
|
|
43980
|
+
async function readClaudeUserModelPicker(environment = process.env) {
|
|
43981
|
+
const settingsPath = path9.join(resolveClaudeConfigDirectory(environment), "settings.json");
|
|
43982
|
+
let raw;
|
|
43983
|
+
try {
|
|
43984
|
+
raw = await readFile4(settingsPath, "utf8");
|
|
43985
|
+
} catch {
|
|
43986
|
+
return void 0;
|
|
43987
|
+
}
|
|
43988
|
+
let document2;
|
|
43989
|
+
try {
|
|
43990
|
+
document2 = JSON.parse(raw);
|
|
43991
|
+
} catch {
|
|
43992
|
+
return void 0;
|
|
43993
|
+
}
|
|
43994
|
+
if (document2 === null || typeof document2 !== "object" || Array.isArray(document2)) {
|
|
43995
|
+
return void 0;
|
|
43996
|
+
}
|
|
43997
|
+
return parseClaudeModelPickerSettings(document2.modelPicker);
|
|
43998
|
+
}
|
|
43999
|
+
function optionToModelInfo(option2) {
|
|
44000
|
+
return {
|
|
44001
|
+
value: option2.model,
|
|
44002
|
+
displayName: option2.label ?? option2.model,
|
|
44003
|
+
...option2.description ? { description: option2.description } : {},
|
|
44004
|
+
...option2.behavesAs ? { resolvedModel: option2.behavesAs } : {}
|
|
44005
|
+
};
|
|
44006
|
+
}
|
|
44007
|
+
function readModelValue(row) {
|
|
44008
|
+
if (row === null || typeof row !== "object" || Array.isArray(row))
|
|
44009
|
+
return void 0;
|
|
44010
|
+
const value = row.value;
|
|
44011
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
44012
|
+
}
|
|
44013
|
+
function mergeOptionOntoSdkRow(sdkRow, option2) {
|
|
44014
|
+
const base = sdkRow !== null && typeof sdkRow === "object" && !Array.isArray(sdkRow) ? { ...sdkRow } : {};
|
|
44015
|
+
const overlay = optionToModelInfo(option2);
|
|
44016
|
+
return { ...base, ...overlay };
|
|
44017
|
+
}
|
|
44018
|
+
function mergeClaudeModelPickerOptions(sdkModels, modelPicker) {
|
|
44019
|
+
if (!modelPicker)
|
|
44020
|
+
return sdkModels;
|
|
44021
|
+
const sdkRows = Array.isArray(sdkModels) ? [...sdkModels] : [];
|
|
44022
|
+
const sdkByValue = /* @__PURE__ */ new Map();
|
|
44023
|
+
for (const row of sdkRows) {
|
|
44024
|
+
const value = readModelValue(row);
|
|
44025
|
+
if (value && !sdkByValue.has(value))
|
|
44026
|
+
sdkByValue.set(value, row);
|
|
44027
|
+
}
|
|
44028
|
+
if (modelPicker.replaceBuiltInOptions) {
|
|
44029
|
+
const defaultSdk = sdkByValue.get("default");
|
|
44030
|
+
const merged2 = [
|
|
44031
|
+
defaultSdk !== void 0 ? defaultSdk : { value: "default", displayName: "Default" }
|
|
44032
|
+
];
|
|
44033
|
+
const included2 = /* @__PURE__ */ new Set(["default"]);
|
|
44034
|
+
for (const option2 of modelPicker.options) {
|
|
44035
|
+
if (included2.has(option2.model)) {
|
|
44036
|
+
if (option2.model === "default") {
|
|
44037
|
+
merged2[0] = mergeOptionOntoSdkRow(merged2[0], option2);
|
|
44038
|
+
}
|
|
44039
|
+
continue;
|
|
44040
|
+
}
|
|
44041
|
+
merged2.push(mergeOptionOntoSdkRow(sdkByValue.get(option2.model), option2));
|
|
44042
|
+
included2.add(option2.model);
|
|
44043
|
+
}
|
|
44044
|
+
return merged2;
|
|
44045
|
+
}
|
|
44046
|
+
const merged = [...sdkRows];
|
|
44047
|
+
const included = new Set(sdkRows.flatMap((row) => {
|
|
44048
|
+
const value = readModelValue(row);
|
|
44049
|
+
return value ? [value] : [];
|
|
44050
|
+
}));
|
|
44051
|
+
for (const option2 of modelPicker.options) {
|
|
44052
|
+
if (included.has(option2.model))
|
|
44053
|
+
continue;
|
|
44054
|
+
merged.push(mergeOptionOntoSdkRow(void 0, option2));
|
|
44055
|
+
included.add(option2.model);
|
|
44056
|
+
}
|
|
44057
|
+
return merged;
|
|
44058
|
+
}
|
|
43814
44059
|
function uniqueDisplayLabels(rows) {
|
|
43815
44060
|
const groups = /* @__PURE__ */ new Map();
|
|
43816
44061
|
for (const row of rows) {
|
|
@@ -43999,8 +44244,8 @@ function projectClaudeAccountUsage(usage, account) {
|
|
|
43999
44244
|
}
|
|
44000
44245
|
|
|
44001
44246
|
// dist/gateway-models.js
|
|
44002
|
-
import { readFile as
|
|
44003
|
-
import
|
|
44247
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
44248
|
+
import path10 from "node:path";
|
|
44004
44249
|
var GATEWAY_MODELS_TIMEOUT_MS = 3e3;
|
|
44005
44250
|
var GATEWAY_MODELS_MAX_BYTES = 2 * 1024 * 1024;
|
|
44006
44251
|
var OFFICIAL_ANTHROPIC_HOST = "api.anthropic.com";
|
|
@@ -44042,14 +44287,14 @@ function claudeConfigDirectory(environment) {
|
|
|
44042
44287
|
if (configured)
|
|
44043
44288
|
return configured;
|
|
44044
44289
|
const home = trimmedEnv(environment, "HOME") ?? trimmedEnv(environment, "USERPROFILE");
|
|
44045
|
-
return home ?
|
|
44290
|
+
return home ? path10.join(home, ".claude") : void 0;
|
|
44046
44291
|
}
|
|
44047
44292
|
async function readClaudeUserSettingsEnv(environment) {
|
|
44048
44293
|
const configDir = claudeConfigDirectory(environment);
|
|
44049
44294
|
if (!configDir)
|
|
44050
44295
|
return {};
|
|
44051
44296
|
try {
|
|
44052
|
-
const raw = await
|
|
44297
|
+
const raw = await readFile5(path10.join(configDir, "settings.json"), "utf8");
|
|
44053
44298
|
const parsed = JSON.parse(raw);
|
|
44054
44299
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
44055
44300
|
return {};
|
|
@@ -44181,7 +44426,7 @@ async function applyGatewayModelCatalog(snapshot, environment, dependencies = {}
|
|
|
44181
44426
|
}
|
|
44182
44427
|
|
|
44183
44428
|
// dist/file-change.js
|
|
44184
|
-
import
|
|
44429
|
+
import path11 from "node:path";
|
|
44185
44430
|
var hunkSchema = external_exports.object({
|
|
44186
44431
|
oldStart: external_exports.number().int().nonnegative(),
|
|
44187
44432
|
oldLines: external_exports.number().int().nonnegative(),
|
|
@@ -44229,10 +44474,10 @@ function parseClaudeNativeFileChange(toolName, value) {
|
|
|
44229
44474
|
};
|
|
44230
44475
|
}
|
|
44231
44476
|
function displayPath(nativePath, cwd) {
|
|
44232
|
-
const resolvedCwd =
|
|
44233
|
-
const resolvedPath =
|
|
44234
|
-
const relative =
|
|
44235
|
-
const selected = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${
|
|
44477
|
+
const resolvedCwd = path11.resolve(cwd);
|
|
44478
|
+
const resolvedPath = path11.isAbsolute(nativePath) ? path11.resolve(nativePath) : path11.resolve(cwd, nativePath);
|
|
44479
|
+
const relative = path11.relative(resolvedCwd, resolvedPath);
|
|
44480
|
+
const selected = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${path11.sep}`) ? relative : resolvedPath;
|
|
44236
44481
|
const normalized = selected.replaceAll("\\", "/");
|
|
44237
44482
|
return validNativePath(normalized) && normalized !== "." ? normalized : null;
|
|
44238
44483
|
}
|
|
@@ -44244,7 +44489,7 @@ function projectClaudeFileChange(value, cwd) {
|
|
|
44244
44489
|
`@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`,
|
|
44245
44490
|
...hunk.lines
|
|
44246
44491
|
]);
|
|
44247
|
-
const absoluteDisplayPath =
|
|
44492
|
+
const absoluteDisplayPath = path11.posix.isAbsolute(normalizedPath);
|
|
44248
44493
|
const oldHeader = value.kind === "add" ? "/dev/null" : absoluteDisplayPath ? normalizedPath : `a/${normalizedPath}`;
|
|
44249
44494
|
const newHeader = absoluteDisplayPath ? normalizedPath : `b/${normalizedPath}`;
|
|
44250
44495
|
const unifiedDiff = [`--- ${oldHeader}`, `+++ ${newHeader}`, ...body, ""].join("\n");
|
|
@@ -44940,7 +45185,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44940
45185
|
|
|
44941
45186
|
// dist/process-fence.js
|
|
44942
45187
|
import { execFile } from "node:child_process";
|
|
44943
|
-
import
|
|
45188
|
+
import path12 from "node:path";
|
|
44944
45189
|
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
44945
45190
|
import { promisify } from "node:util";
|
|
44946
45191
|
var executeFile = promisify(execFile);
|
|
@@ -44964,9 +45209,9 @@ async function closeClaudeProcessGroup(child, timeoutMs) {
|
|
|
44964
45209
|
if (child.exitCode !== null || child.signalCode !== null)
|
|
44965
45210
|
throw new Error("Claude process tree cannot be confirmed after its Windows root exited");
|
|
44966
45211
|
const root = process.env.SystemRoot ?? process.env.SYSTEMROOT;
|
|
44967
|
-
if (!root || !
|
|
45212
|
+
if (!root || !path12.win32.isAbsolute(root))
|
|
44968
45213
|
throw new Error("Windows SystemRoot is unavailable");
|
|
44969
|
-
await executeFile(
|
|
45214
|
+
await executeFile(path12.win32.join(root, "System32", "taskkill.exe"), ["/PID", String(pid), "/T", "/F"], {
|
|
44970
45215
|
timeout: timeoutMs,
|
|
44971
45216
|
windowsHide: true
|
|
44972
45217
|
});
|
|
@@ -44993,6 +45238,7 @@ async function closeClaudeProcessGroup(child, timeoutMs) {
|
|
|
44993
45238
|
|
|
44994
45239
|
// dist/sdk-transport.js
|
|
44995
45240
|
var CLIENT_APP = "codexhost-claude-code-adapter/0.0.0";
|
|
45241
|
+
var SESSION_ENTRYPOINT = "codexhost-sdk";
|
|
44996
45242
|
var APPROVAL_TITLE_MAX_LENGTH = 120;
|
|
44997
45243
|
var APPROVAL_DESCRIPTION_MAX_LENGTH = 500;
|
|
44998
45244
|
var DEFAULT_ABORT_TIMEOUT_MS = 2e3;
|
|
@@ -45315,6 +45561,7 @@ var ClaudeSdkTransport = class {
|
|
|
45315
45561
|
forwardSubagentText: true,
|
|
45316
45562
|
env: withNodeRuntimeOnPath({
|
|
45317
45563
|
...this.#environment,
|
|
45564
|
+
CLAUDE_CODE_ENTRYPOINT: SESSION_ENTRYPOINT,
|
|
45318
45565
|
CLAUDE_AGENT_SDK_CLIENT_APP: CLIENT_APP
|
|
45319
45566
|
}),
|
|
45320
45567
|
spawnClaudeCodeProcess: (options) => this.#spawn(options)
|
|
@@ -45800,8 +46047,9 @@ var ClaudeSdkModelInspector = class {
|
|
|
45800
46047
|
const candidate = activeQuery;
|
|
45801
46048
|
const canSelectModel = Array.isArray(initialized.models) && typeof candidate.setModel === "function";
|
|
45802
46049
|
const canSelectPermissionMode = typeof candidate.setPermissionMode === "function";
|
|
46050
|
+
const modelPicker = await readClaudeUserModelPicker(this.#environment);
|
|
45803
46051
|
snapshot = {
|
|
45804
|
-
models: initialized.models,
|
|
46052
|
+
models: mergeClaudeModelPickerOptions(initialized.models, modelPicker),
|
|
45805
46053
|
canSelectModel,
|
|
45806
46054
|
canSelectPermissionMode
|
|
45807
46055
|
};
|
|
@@ -46214,6 +46462,7 @@ var ClaudeToolLifecycle = class {
|
|
|
46214
46462
|
const fileItem = {
|
|
46215
46463
|
type: "fileChange",
|
|
46216
46464
|
itemId: this.#newItemId(),
|
|
46465
|
+
sourceItemIds: [tool.item.itemId],
|
|
46217
46466
|
changes: [change]
|
|
46218
46467
|
};
|
|
46219
46468
|
this.#emit({ type: "item.started", turnId, item: fileItem });
|
|
@@ -46964,7 +47213,7 @@ var ClaudeHarnessSession = class {
|
|
|
46964
47213
|
return this.#closePromise;
|
|
46965
47214
|
}
|
|
46966
47215
|
async #selectModel(command) {
|
|
46967
|
-
if (this.#acceptingTurn || this.#
|
|
47216
|
+
if (this.#acceptingTurn || this.#configurationTask || this.#readingHistory) {
|
|
46968
47217
|
return {
|
|
46969
47218
|
ok: false,
|
|
46970
47219
|
error: {
|
|
@@ -47022,7 +47271,7 @@ var ClaudeHarnessSession = class {
|
|
|
47022
47271
|
}
|
|
47023
47272
|
}
|
|
47024
47273
|
async #selectThinking(command) {
|
|
47025
|
-
if (this.#acceptingTurn || this.#
|
|
47274
|
+
if (this.#acceptingTurn || this.#configurationTask || this.#readingHistory) {
|
|
47026
47275
|
return {
|
|
47027
47276
|
ok: false,
|
|
47028
47277
|
error: {
|
|
@@ -48408,7 +48657,8 @@ var ClaudeCodeAdapter = class {
|
|
|
48408
48657
|
#latestPlanLimit = null;
|
|
48409
48658
|
#accountInspection = null;
|
|
48410
48659
|
constructor(options = {}, dependencies) {
|
|
48411
|
-
|
|
48660
|
+
const environment = options.environment ?? process.env;
|
|
48661
|
+
this.#pendingSessions = new ClaudePendingSessions(environment);
|
|
48412
48662
|
this.#closeTimeoutMs = options.closeTimeoutMs ?? DEFAULT_CLOSE_TIMEOUT_MS;
|
|
48413
48663
|
this.#cancelTimeoutMs = options.cancelTimeoutMs ?? DEFAULT_CANCEL_TIMEOUT_MS;
|
|
48414
48664
|
if (!Number.isSafeInteger(this.#cancelTimeoutMs) || this.#cancelTimeoutMs <= 0) {
|
|
@@ -48503,7 +48753,7 @@ var ClaudeCodeAdapter = class {
|
|
|
48503
48753
|
error: invalidState("Claude Code Adapter is closing")
|
|
48504
48754
|
};
|
|
48505
48755
|
}
|
|
48506
|
-
const cwd =
|
|
48756
|
+
const cwd = path13.resolve(input.cwd ?? process.cwd());
|
|
48507
48757
|
if (!input.refresh) {
|
|
48508
48758
|
const cached2 = this.#inspectionCache.get(cwd);
|
|
48509
48759
|
if (cached2)
|
|
@@ -48685,7 +48935,7 @@ var ClaudeCodeAdapter = class {
|
|
|
48685
48935
|
}
|
|
48686
48936
|
};
|
|
48687
48937
|
}
|
|
48688
|
-
const cwd =
|
|
48938
|
+
const cwd = path13.resolve(input.cwd);
|
|
48689
48939
|
if (input.kind === "rollbackLastTurn") {
|
|
48690
48940
|
for (const source of this.#sessions) {
|
|
48691
48941
|
const ready = await source.prepareRollback(input.sourceRef.nativeSessionId);
|
|
@@ -48808,8 +49058,8 @@ var ClaudeCodeAdapter = class {
|
|
|
48808
49058
|
};
|
|
48809
49059
|
|
|
48810
49060
|
// dist/user-shell-environment.js
|
|
48811
|
-
import
|
|
48812
|
-
import {
|
|
49061
|
+
import path14 from "node:path";
|
|
49062
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
48813
49063
|
var ENVIRONMENT_MARKER = Buffer.from("\0CODEXHOST_USER_SHELL_ENV_V1\0");
|
|
48814
49064
|
var ENVIRONMENT_COMMAND = "printf '\\0CODEXHOST_USER_SHELL_ENV_V1\\0'; /usr/bin/env -0";
|
|
48815
49065
|
var SHELL_ENVIRONMENT_TIMEOUT_MS = 3e3;
|
|
@@ -48846,24 +49096,27 @@ function mergeMissingEnvironment(environment, shellEnvironment) {
|
|
|
48846
49096
|
}
|
|
48847
49097
|
return merged;
|
|
48848
49098
|
}
|
|
48849
|
-
function withUserShellEnvironment(environment, dependencies) {
|
|
49099
|
+
async function withUserShellEnvironment(environment, dependencies) {
|
|
48850
49100
|
const platform = dependencies?.platform ?? process.platform;
|
|
48851
49101
|
if (platform === "win32" || !environment.HOME)
|
|
48852
49102
|
return environment;
|
|
48853
49103
|
const shell = environment.SHELL?.trim() || defaultShell(platform);
|
|
48854
|
-
if (!shell || !SUPPORTED_SHELLS.has(
|
|
49104
|
+
if (!shell || !SUPPORTED_SHELLS.has(path14.basename(shell)))
|
|
48855
49105
|
return environment;
|
|
48856
49106
|
const cacheKey = `${platform}\0${shell}\0${environment.HOME}`;
|
|
48857
49107
|
const cached2 = dependencies ? void 0 : shellEnvironmentCache.get(cacheKey);
|
|
48858
49108
|
if (cached2)
|
|
48859
49109
|
return mergeMissingEnvironment(environment, cached2);
|
|
48860
|
-
const run = dependencies?.run ?? ((command, arguments_, options) =>
|
|
48861
|
-
|
|
48862
|
-
|
|
48863
|
-
|
|
49110
|
+
const run = dependencies?.run ?? ((command, arguments_, options) => new Promise((resolve2) => {
|
|
49111
|
+
const child = execFile2(command, arguments_, {
|
|
49112
|
+
...options,
|
|
49113
|
+
encoding: "buffer",
|
|
49114
|
+
killSignal: "SIGKILL"
|
|
49115
|
+
}, (error52, stdout) => resolve2({ status: error52 ? 1 : 0, stdout }));
|
|
49116
|
+
child.stdin?.end();
|
|
48864
49117
|
}));
|
|
48865
49118
|
try {
|
|
48866
|
-
const result = run(shell, ["-ilc", ENVIRONMENT_COMMAND], {
|
|
49119
|
+
const result = await run(shell, ["-ilc", ENVIRONMENT_COMMAND], {
|
|
48867
49120
|
env: environment,
|
|
48868
49121
|
maxBuffer: SHELL_ENVIRONMENT_MAX_BYTES,
|
|
48869
49122
|
timeout: SHELL_ENVIRONMENT_TIMEOUT_MS,
|
|
@@ -48882,8 +49135,8 @@ function withUserShellEnvironment(environment, dependencies) {
|
|
|
48882
49135
|
|
|
48883
49136
|
// dist/plugin.js
|
|
48884
49137
|
var CLAUDE_CODE_COMMAND_ENV = "CODEXHOST_CLAUDE_COMMAND";
|
|
48885
|
-
function createHarnessAdapter(context) {
|
|
48886
|
-
const environment = withUserShellEnvironment({ ...context.environment });
|
|
49138
|
+
async function createHarnessAdapter(context) {
|
|
49139
|
+
const environment = await withUserShellEnvironment({ ...context.environment });
|
|
48887
49140
|
if (context.platform === "darwin" && context.managedRemoteHost) {
|
|
48888
49141
|
return new BrokeredHarnessAdapter({
|
|
48889
49142
|
commandCatalog: claudeCommandCatalog,
|