@liberseek/boft-cli-win32-arm64 0.7.0 → 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 +0 -4
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +256 -179
- package/app/host-runtime.mjs +646 -323
- package/app/plugins/antigravity/plugin.mjs +123 -1
- package/app/plugins/claude-code/plugin.mjs +252 -46
- package/app/plugins/codebuddy/plugin.mjs +2287 -879
- package/app/plugins/cursor-cli/plugin.mjs +35756 -10755
- package/app/plugins/deepseek-harness/plugin.mjs +70 -0
- package/app/plugins/enabled.json +1 -0
- package/app/plugins/grok/plugin.mjs +193 -82
- package/app/plugins/hermes/plugin.mjs +2444 -94
- package/app/plugins/kiro-cli/plugin.mjs +70 -0
- package/app/plugins/muse/plugin.mjs +70 -0
- package/app/plugins/omp/plugin.mjs +92 -4
- package/app/plugins/opencode/plugin.mjs +70 -0
- package/app/plugins/pi/plugin.mjs +2139 -973
- package/app/plugins/qoder/plugin.mjs +71 -9
- package/app/plugins/qoder-cn/plugin.mjs +71 -9
- 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 +2874 -1408
- 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
- package/licenses/opencodex-LICENSE.txt +0 -21
|
@@ -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,6 +14524,61 @@ 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
|
|
|
@@ -15073,6 +15128,8 @@ var pluginPresentationShape = {
|
|
|
15073
15128
|
id: harnessPluginIdSchema,
|
|
15074
15129
|
name: external_exports.string().trim().min(1).max(128),
|
|
15075
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(),
|
|
15076
15133
|
links: external_exports.object({
|
|
15077
15134
|
documentation: documentationUrlSchema.optional(),
|
|
15078
15135
|
installation: documentationUrlSchema.optional()
|
|
@@ -15110,6 +15167,19 @@ var harnessPluginRouteSchema = external_exports.object({
|
|
|
15110
15167
|
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15111
15168
|
}).strict();
|
|
15112
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
|
+
|
|
15113
15183
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15114
15184
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
15115
15185
|
var nonBlankTextSchema3 = external_exports.string().trim().min(1);
|
|
@@ -16607,7 +16677,7 @@ var BrokeredHarnessAdapter = class {
|
|
|
16607
16677
|
|
|
16608
16678
|
// dist/claude-code-adapter.js
|
|
16609
16679
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
16610
|
-
import
|
|
16680
|
+
import path13 from "node:path";
|
|
16611
16681
|
|
|
16612
16682
|
// ../../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
16613
16683
|
import { createRequire as DW } from "node:module";
|
|
@@ -20514,8 +20584,8 @@ var qU = v(function(BU) {
|
|
|
20514
20584
|
BU._globalThis = void 0;
|
|
20515
20585
|
BU._globalThis = typeof globalThis === "object" ? globalThis : global;
|
|
20516
20586
|
});
|
|
20517
|
-
var GU = v(function(
|
|
20518
|
-
var Axe =
|
|
20587
|
+
var GU = v(function(os6) {
|
|
20588
|
+
var Axe = os6 && os6.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
20519
20589
|
if (n === void 0) n = r;
|
|
20520
20590
|
Object.defineProperty(e, n, { enumerable: true, get: function() {
|
|
20521
20591
|
return t[r];
|
|
@@ -20523,11 +20593,11 @@ var GU = v(function(os5) {
|
|
|
20523
20593
|
} : function(e, t, r, n) {
|
|
20524
20594
|
if (n === void 0) n = r;
|
|
20525
20595
|
e[n] = t[r];
|
|
20526
|
-
}), kxe =
|
|
20596
|
+
}), kxe = os6 && os6.__exportStar || function(e, t) {
|
|
20527
20597
|
for (var r in e) if (r !== "default" && !Object.prototype.hasOwnProperty.call(t, r)) Axe(t, e, r);
|
|
20528
20598
|
};
|
|
20529
|
-
Object.defineProperty(
|
|
20530
|
-
kxe(qU(),
|
|
20599
|
+
Object.defineProperty(os6, "__esModule", { value: true });
|
|
20600
|
+
kxe(qU(), os6);
|
|
20531
20601
|
});
|
|
20532
20602
|
var WU = v(function(is) {
|
|
20533
20603
|
var Oxe = is && is.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
@@ -42547,7 +42617,7 @@ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath
|
|
|
42547
42617
|
const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
|
|
42548
42618
|
const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
|
|
42549
42619
|
if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
|
|
42550
|
-
directories.
|
|
42620
|
+
directories.push(runtimeDirectory);
|
|
42551
42621
|
}
|
|
42552
42622
|
return { ...environment, [pathKey]: directories.join(delimiter) };
|
|
42553
42623
|
}
|
|
@@ -43782,6 +43852,9 @@ async function readClaudeSubagentTranscript(input) {
|
|
|
43782
43852
|
|
|
43783
43853
|
// dist/model-catalog.js
|
|
43784
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";
|
|
43785
43858
|
|
|
43786
43859
|
// dist/thinking-options.js
|
|
43787
43860
|
var option = (id, label) => ({
|
|
@@ -43821,8 +43894,19 @@ var CLAUDE_MODEL_VALUE_MAX_LENGTH = 512;
|
|
|
43821
43894
|
var modelInfoSchema = external_exports.object({
|
|
43822
43895
|
value: external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH),
|
|
43823
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(),
|
|
43824
43898
|
resolvedModel: harnessResolvedModelLabelSchema.optional()
|
|
43825
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
|
+
});
|
|
43826
43910
|
var CLAUDE_DEFAULT_MODEL_REF = encodeClaudeModelRef("default");
|
|
43827
43911
|
function encodeClaudeModelRef(value) {
|
|
43828
43912
|
const parsed = external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH).parse(value);
|
|
@@ -43851,6 +43935,127 @@ function decodeClaudeModelRef(ref) {
|
|
|
43851
43935
|
}
|
|
43852
43936
|
return value === "default" ? void 0 : value;
|
|
43853
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
|
+
}
|
|
43854
44059
|
function uniqueDisplayLabels(rows) {
|
|
43855
44060
|
const groups = /* @__PURE__ */ new Map();
|
|
43856
44061
|
for (const row of rows) {
|
|
@@ -44039,8 +44244,8 @@ function projectClaudeAccountUsage(usage, account) {
|
|
|
44039
44244
|
}
|
|
44040
44245
|
|
|
44041
44246
|
// dist/gateway-models.js
|
|
44042
|
-
import { readFile as
|
|
44043
|
-
import
|
|
44247
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
44248
|
+
import path10 from "node:path";
|
|
44044
44249
|
var GATEWAY_MODELS_TIMEOUT_MS = 3e3;
|
|
44045
44250
|
var GATEWAY_MODELS_MAX_BYTES = 2 * 1024 * 1024;
|
|
44046
44251
|
var OFFICIAL_ANTHROPIC_HOST = "api.anthropic.com";
|
|
@@ -44082,14 +44287,14 @@ function claudeConfigDirectory(environment) {
|
|
|
44082
44287
|
if (configured)
|
|
44083
44288
|
return configured;
|
|
44084
44289
|
const home = trimmedEnv(environment, "HOME") ?? trimmedEnv(environment, "USERPROFILE");
|
|
44085
|
-
return home ?
|
|
44290
|
+
return home ? path10.join(home, ".claude") : void 0;
|
|
44086
44291
|
}
|
|
44087
44292
|
async function readClaudeUserSettingsEnv(environment) {
|
|
44088
44293
|
const configDir = claudeConfigDirectory(environment);
|
|
44089
44294
|
if (!configDir)
|
|
44090
44295
|
return {};
|
|
44091
44296
|
try {
|
|
44092
|
-
const raw = await
|
|
44297
|
+
const raw = await readFile5(path10.join(configDir, "settings.json"), "utf8");
|
|
44093
44298
|
const parsed = JSON.parse(raw);
|
|
44094
44299
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
44095
44300
|
return {};
|
|
@@ -44221,7 +44426,7 @@ async function applyGatewayModelCatalog(snapshot, environment, dependencies = {}
|
|
|
44221
44426
|
}
|
|
44222
44427
|
|
|
44223
44428
|
// dist/file-change.js
|
|
44224
|
-
import
|
|
44429
|
+
import path11 from "node:path";
|
|
44225
44430
|
var hunkSchema = external_exports.object({
|
|
44226
44431
|
oldStart: external_exports.number().int().nonnegative(),
|
|
44227
44432
|
oldLines: external_exports.number().int().nonnegative(),
|
|
@@ -44269,10 +44474,10 @@ function parseClaudeNativeFileChange(toolName, value) {
|
|
|
44269
44474
|
};
|
|
44270
44475
|
}
|
|
44271
44476
|
function displayPath(nativePath, cwd) {
|
|
44272
|
-
const resolvedCwd =
|
|
44273
|
-
const resolvedPath =
|
|
44274
|
-
const relative =
|
|
44275
|
-
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;
|
|
44276
44481
|
const normalized = selected.replaceAll("\\", "/");
|
|
44277
44482
|
return validNativePath(normalized) && normalized !== "." ? normalized : null;
|
|
44278
44483
|
}
|
|
@@ -44284,7 +44489,7 @@ function projectClaudeFileChange(value, cwd) {
|
|
|
44284
44489
|
`@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`,
|
|
44285
44490
|
...hunk.lines
|
|
44286
44491
|
]);
|
|
44287
|
-
const absoluteDisplayPath =
|
|
44492
|
+
const absoluteDisplayPath = path11.posix.isAbsolute(normalizedPath);
|
|
44288
44493
|
const oldHeader = value.kind === "add" ? "/dev/null" : absoluteDisplayPath ? normalizedPath : `a/${normalizedPath}`;
|
|
44289
44494
|
const newHeader = absoluteDisplayPath ? normalizedPath : `b/${normalizedPath}`;
|
|
44290
44495
|
const unifiedDiff = [`--- ${oldHeader}`, `+++ ${newHeader}`, ...body, ""].join("\n");
|
|
@@ -44980,7 +45185,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44980
45185
|
|
|
44981
45186
|
// dist/process-fence.js
|
|
44982
45187
|
import { execFile } from "node:child_process";
|
|
44983
|
-
import
|
|
45188
|
+
import path12 from "node:path";
|
|
44984
45189
|
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
44985
45190
|
import { promisify } from "node:util";
|
|
44986
45191
|
var executeFile = promisify(execFile);
|
|
@@ -45004,9 +45209,9 @@ async function closeClaudeProcessGroup(child, timeoutMs) {
|
|
|
45004
45209
|
if (child.exitCode !== null || child.signalCode !== null)
|
|
45005
45210
|
throw new Error("Claude process tree cannot be confirmed after its Windows root exited");
|
|
45006
45211
|
const root = process.env.SystemRoot ?? process.env.SYSTEMROOT;
|
|
45007
|
-
if (!root || !
|
|
45212
|
+
if (!root || !path12.win32.isAbsolute(root))
|
|
45008
45213
|
throw new Error("Windows SystemRoot is unavailable");
|
|
45009
|
-
await executeFile(
|
|
45214
|
+
await executeFile(path12.win32.join(root, "System32", "taskkill.exe"), ["/PID", String(pid), "/T", "/F"], {
|
|
45010
45215
|
timeout: timeoutMs,
|
|
45011
45216
|
windowsHide: true
|
|
45012
45217
|
});
|
|
@@ -45842,8 +46047,9 @@ var ClaudeSdkModelInspector = class {
|
|
|
45842
46047
|
const candidate = activeQuery;
|
|
45843
46048
|
const canSelectModel = Array.isArray(initialized.models) && typeof candidate.setModel === "function";
|
|
45844
46049
|
const canSelectPermissionMode = typeof candidate.setPermissionMode === "function";
|
|
46050
|
+
const modelPicker = await readClaudeUserModelPicker(this.#environment);
|
|
45845
46051
|
snapshot = {
|
|
45846
|
-
models: initialized.models,
|
|
46052
|
+
models: mergeClaudeModelPickerOptions(initialized.models, modelPicker),
|
|
45847
46053
|
canSelectModel,
|
|
45848
46054
|
canSelectPermissionMode
|
|
45849
46055
|
};
|
|
@@ -48547,7 +48753,7 @@ var ClaudeCodeAdapter = class {
|
|
|
48547
48753
|
error: invalidState("Claude Code Adapter is closing")
|
|
48548
48754
|
};
|
|
48549
48755
|
}
|
|
48550
|
-
const cwd =
|
|
48756
|
+
const cwd = path13.resolve(input.cwd ?? process.cwd());
|
|
48551
48757
|
if (!input.refresh) {
|
|
48552
48758
|
const cached2 = this.#inspectionCache.get(cwd);
|
|
48553
48759
|
if (cached2)
|
|
@@ -48729,7 +48935,7 @@ var ClaudeCodeAdapter = class {
|
|
|
48729
48935
|
}
|
|
48730
48936
|
};
|
|
48731
48937
|
}
|
|
48732
|
-
const cwd =
|
|
48938
|
+
const cwd = path13.resolve(input.cwd);
|
|
48733
48939
|
if (input.kind === "rollbackLastTurn") {
|
|
48734
48940
|
for (const source of this.#sessions) {
|
|
48735
48941
|
const ready = await source.prepareRollback(input.sourceRef.nativeSessionId);
|
|
@@ -48852,7 +49058,7 @@ var ClaudeCodeAdapter = class {
|
|
|
48852
49058
|
};
|
|
48853
49059
|
|
|
48854
49060
|
// dist/user-shell-environment.js
|
|
48855
|
-
import
|
|
49061
|
+
import path14 from "node:path";
|
|
48856
49062
|
import { execFile as execFile2 } from "node:child_process";
|
|
48857
49063
|
var ENVIRONMENT_MARKER = Buffer.from("\0CODEXHOST_USER_SHELL_ENV_V1\0");
|
|
48858
49064
|
var ENVIRONMENT_COMMAND = "printf '\\0CODEXHOST_USER_SHELL_ENV_V1\\0'; /usr/bin/env -0";
|
|
@@ -48895,7 +49101,7 @@ async function withUserShellEnvironment(environment, dependencies) {
|
|
|
48895
49101
|
if (platform === "win32" || !environment.HOME)
|
|
48896
49102
|
return environment;
|
|
48897
49103
|
const shell = environment.SHELL?.trim() || defaultShell(platform);
|
|
48898
|
-
if (!shell || !SUPPORTED_SHELLS.has(
|
|
49104
|
+
if (!shell || !SUPPORTED_SHELLS.has(path14.basename(shell)))
|
|
48899
49105
|
return environment;
|
|
48900
49106
|
const cacheKey = `${platform}\0${shell}\0${environment.HOME}`;
|
|
48901
49107
|
const cached2 = dependencies ? void 0 : shellEnvironmentCache.get(cacheKey);
|