@codexhost/cli-darwin-x64 0.9.1-test.2 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +256 -179
- package/app/host-runtime.mjs +594 -298
- package/app/plugins/antigravity/plugin.mjs +123 -1
- package/app/plugins/claude-code/plugin.mjs +248 -42
- package/app/plugins/codebuddy/plugin.mjs +2166 -758
- package/app/plugins/cursor-cli/plugin.mjs +35942 -10942
- 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/omp/plugin.mjs +106 -8
- package/app/plugins/opencode/plugin.mjs +70 -0
- package/app/plugins/pi/plugin.mjs +1933 -767
- 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 +24873 -0
- package/app/renderer-extension.js +5290 -3642
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- 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, path14) {
|
|
780
|
+
if (!path14)
|
|
781
781
|
return obj;
|
|
782
|
-
return
|
|
782
|
+
return path14.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(path14, 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(path14);
|
|
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, path14 = []) => {
|
|
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 }, [...path14, ...issue2.path]));
|
|
1346
1346
|
} else if (issue2.code === "invalid_key") {
|
|
1347
|
-
processError({ issues: issue2.issues }, [...
|
|
1347
|
+
processError({ issues: issue2.issues }, [...path14, ...issue2.path]);
|
|
1348
1348
|
} else if (issue2.code === "invalid_element") {
|
|
1349
|
-
processError({ issues: issue2.issues }, [...
|
|
1349
|
+
processError({ issues: issue2.issues }, [...path14, ...issue2.path]);
|
|
1350
1350
|
} else {
|
|
1351
|
-
const fullpath = [...
|
|
1351
|
+
const fullpath = [...path14, ...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, path14 = []) => {
|
|
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 }, [...path14, ...issue2.path]));
|
|
1383
1383
|
} else if (issue2.code === "invalid_key") {
|
|
1384
|
-
processError({ issues: issue2.issues }, [...
|
|
1384
|
+
processError({ issues: issue2.issues }, [...path14, ...issue2.path]);
|
|
1385
1385
|
} else if (issue2.code === "invalid_element") {
|
|
1386
|
-
processError({ issues: issue2.issues }, [...
|
|
1386
|
+
processError({ issues: issue2.issues }, [...path14, ...issue2.path]);
|
|
1387
1387
|
} else {
|
|
1388
|
-
const fullpath = [...
|
|
1388
|
+
const fullpath = [...path14, ...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 path14 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1421
|
+
for (const seg of path14) {
|
|
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 path14 = ref.slice(1).split("/").filter(Boolean);
|
|
14114
|
+
if (path14.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 (path14[0] === defsKey) {
|
|
14119
|
+
const key = path14[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
|
|
|
@@ -15052,6 +15107,8 @@ var pluginPresentationShape = {
|
|
|
15052
15107
|
id: harnessPluginIdSchema,
|
|
15053
15108
|
name: external_exports.string().trim().min(1).max(128),
|
|
15054
15109
|
version: external_exports.string().min(1).max(128),
|
|
15110
|
+
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
15111
|
+
launchCommand: external_exports.literal(true).optional(),
|
|
15055
15112
|
links: external_exports.object({
|
|
15056
15113
|
documentation: documentationUrlSchema.optional(),
|
|
15057
15114
|
installation: documentationUrlSchema.optional()
|
|
@@ -15089,6 +15146,19 @@ var harnessPluginRouteSchema = external_exports.object({
|
|
|
15089
15146
|
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15090
15147
|
}).strict();
|
|
15091
15148
|
|
|
15149
|
+
// ../../shared-contracts/dist/harness-launch-settings.js
|
|
15150
|
+
var harnessLaunchPathSchema = external_exports.string().trim().min(1).max(4096).refine((value) => !/[\u0000\r\n]/u.test(value), "Invalid entrypoint path");
|
|
15151
|
+
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
15152
|
+
harnessId: harnessPluginIdSchema
|
|
15153
|
+
}).strict();
|
|
15154
|
+
var harnessLaunchSettingsSetSchema = harnessLaunchSettingsGetSchema.extend({
|
|
15155
|
+
path: harnessLaunchPathSchema.nullable()
|
|
15156
|
+
});
|
|
15157
|
+
var harnessLaunchSettingsSchema = external_exports.object({
|
|
15158
|
+
path: harnessLaunchPathSchema.nullable(),
|
|
15159
|
+
restartRequired: external_exports.boolean()
|
|
15160
|
+
}).strict();
|
|
15161
|
+
|
|
15092
15162
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15093
15163
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
15094
15164
|
var nonBlankTextSchema3 = external_exports.string().trim().min(1);
|
|
@@ -16474,7 +16544,7 @@ var BrokeredHarnessAdapter = class {
|
|
|
16474
16544
|
|
|
16475
16545
|
// dist/claude-code-adapter.js
|
|
16476
16546
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
16477
|
-
import
|
|
16547
|
+
import path12 from "node:path";
|
|
16478
16548
|
|
|
16479
16549
|
// ../../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
16480
16550
|
import { createRequire as DW } from "node:module";
|
|
@@ -20379,8 +20449,8 @@ var qU = v(function(BU) {
|
|
|
20379
20449
|
BU._globalThis = void 0;
|
|
20380
20450
|
BU._globalThis = typeof globalThis === "object" ? globalThis : global;
|
|
20381
20451
|
});
|
|
20382
|
-
var GU = v(function(
|
|
20383
|
-
var Axe =
|
|
20452
|
+
var GU = v(function(os7) {
|
|
20453
|
+
var Axe = os7 && os7.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
20384
20454
|
if (n === void 0) n = r;
|
|
20385
20455
|
Object.defineProperty(e, n, { enumerable: true, get: function() {
|
|
20386
20456
|
return t[r];
|
|
@@ -20388,11 +20458,11 @@ var GU = v(function(os6) {
|
|
|
20388
20458
|
} : function(e, t, r, n) {
|
|
20389
20459
|
if (n === void 0) n = r;
|
|
20390
20460
|
e[n] = t[r];
|
|
20391
|
-
}), kxe =
|
|
20461
|
+
}), kxe = os7 && os7.__exportStar || function(e, t) {
|
|
20392
20462
|
for (var r in e) if (r !== "default" && !Object.prototype.hasOwnProperty.call(t, r)) Axe(t, e, r);
|
|
20393
20463
|
};
|
|
20394
|
-
Object.defineProperty(
|
|
20395
|
-
kxe(qU(),
|
|
20464
|
+
Object.defineProperty(os7, "__esModule", { value: true });
|
|
20465
|
+
kxe(qU(), os7);
|
|
20396
20466
|
});
|
|
20397
20467
|
var WU = v(function(is) {
|
|
20398
20468
|
var Oxe = is && is.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
@@ -42434,7 +42504,7 @@ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath
|
|
|
42434
42504
|
const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
|
|
42435
42505
|
const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
|
|
42436
42506
|
if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
|
|
42437
|
-
directories.
|
|
42507
|
+
directories.push(runtimeDirectory);
|
|
42438
42508
|
}
|
|
42439
42509
|
return { ...environment, [pathKey]: directories.join(delimiter) };
|
|
42440
42510
|
}
|
|
@@ -43482,6 +43552,9 @@ async function readClaudeTranscript(input) {
|
|
|
43482
43552
|
|
|
43483
43553
|
// dist/model-catalog.js
|
|
43484
43554
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
43555
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
43556
|
+
import os6 from "node:os";
|
|
43557
|
+
import path9 from "node:path";
|
|
43485
43558
|
|
|
43486
43559
|
// dist/thinking-options.js
|
|
43487
43560
|
var option = (id, label) => ({
|
|
@@ -43521,8 +43594,19 @@ var CLAUDE_MODEL_VALUE_MAX_LENGTH = 512;
|
|
|
43521
43594
|
var modelInfoSchema = external_exports.object({
|
|
43522
43595
|
value: external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH),
|
|
43523
43596
|
displayName: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
43597
|
+
description: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
43524
43598
|
resolvedModel: harnessResolvedModelLabelSchema.optional()
|
|
43525
43599
|
});
|
|
43600
|
+
var modelPickerOptionSchema = external_exports.object({
|
|
43601
|
+
model: external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH),
|
|
43602
|
+
label: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
43603
|
+
description: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
43604
|
+
behavesAs: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional()
|
|
43605
|
+
});
|
|
43606
|
+
var modelPickerSettingsSchema = external_exports.object({
|
|
43607
|
+
options: external_exports.array(external_exports.unknown()).optional(),
|
|
43608
|
+
replaceBuiltInOptions: external_exports.boolean().optional()
|
|
43609
|
+
});
|
|
43526
43610
|
var CLAUDE_DEFAULT_MODEL_REF = encodeClaudeModelRef("default");
|
|
43527
43611
|
function encodeClaudeModelRef(value) {
|
|
43528
43612
|
const parsed = external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH).parse(value);
|
|
@@ -43551,6 +43635,127 @@ function decodeClaudeModelRef(ref) {
|
|
|
43551
43635
|
}
|
|
43552
43636
|
return value === "default" ? void 0 : value;
|
|
43553
43637
|
}
|
|
43638
|
+
function resolveClaudeConfigDirectory(environment = process.env) {
|
|
43639
|
+
return path9.resolve(environment.CLAUDE_CONFIG_DIR ?? path9.join(os6.homedir(), ".claude"));
|
|
43640
|
+
}
|
|
43641
|
+
function parseModelPickerOptions(value) {
|
|
43642
|
+
if (!Array.isArray(value))
|
|
43643
|
+
return [];
|
|
43644
|
+
const options = [];
|
|
43645
|
+
const seen = /* @__PURE__ */ new Set();
|
|
43646
|
+
for (const entry of value) {
|
|
43647
|
+
const parsed = modelPickerOptionSchema.safeParse(entry);
|
|
43648
|
+
if (!parsed.success)
|
|
43649
|
+
continue;
|
|
43650
|
+
if (seen.has(parsed.data.model))
|
|
43651
|
+
continue;
|
|
43652
|
+
seen.add(parsed.data.model);
|
|
43653
|
+
options.push({
|
|
43654
|
+
model: parsed.data.model,
|
|
43655
|
+
...parsed.data.label ? { label: parsed.data.label } : {},
|
|
43656
|
+
...parsed.data.description ? { description: parsed.data.description } : {},
|
|
43657
|
+
...parsed.data.behavesAs ? { behavesAs: parsed.data.behavesAs } : {}
|
|
43658
|
+
});
|
|
43659
|
+
}
|
|
43660
|
+
return options;
|
|
43661
|
+
}
|
|
43662
|
+
function parseClaudeModelPickerSettings(value) {
|
|
43663
|
+
if (value === void 0 || value === null)
|
|
43664
|
+
return void 0;
|
|
43665
|
+
const parsed = modelPickerSettingsSchema.safeParse(value);
|
|
43666
|
+
if (!parsed.success)
|
|
43667
|
+
return void 0;
|
|
43668
|
+
if (parsed.data.options === void 0 && parsed.data.replaceBuiltInOptions === void 0) {
|
|
43669
|
+
return void 0;
|
|
43670
|
+
}
|
|
43671
|
+
const options = parseModelPickerOptions(parsed.data.options);
|
|
43672
|
+
if (Array.isArray(parsed.data.options) && parsed.data.options.length > 0 && options.length === 0) {
|
|
43673
|
+
return void 0;
|
|
43674
|
+
}
|
|
43675
|
+
return {
|
|
43676
|
+
options,
|
|
43677
|
+
replaceBuiltInOptions: parsed.data.replaceBuiltInOptions === true
|
|
43678
|
+
};
|
|
43679
|
+
}
|
|
43680
|
+
async function readClaudeUserModelPicker(environment = process.env) {
|
|
43681
|
+
const settingsPath = path9.join(resolveClaudeConfigDirectory(environment), "settings.json");
|
|
43682
|
+
let raw;
|
|
43683
|
+
try {
|
|
43684
|
+
raw = await readFile4(settingsPath, "utf8");
|
|
43685
|
+
} catch {
|
|
43686
|
+
return void 0;
|
|
43687
|
+
}
|
|
43688
|
+
let document2;
|
|
43689
|
+
try {
|
|
43690
|
+
document2 = JSON.parse(raw);
|
|
43691
|
+
} catch {
|
|
43692
|
+
return void 0;
|
|
43693
|
+
}
|
|
43694
|
+
if (document2 === null || typeof document2 !== "object" || Array.isArray(document2)) {
|
|
43695
|
+
return void 0;
|
|
43696
|
+
}
|
|
43697
|
+
return parseClaudeModelPickerSettings(document2.modelPicker);
|
|
43698
|
+
}
|
|
43699
|
+
function optionToModelInfo(option2) {
|
|
43700
|
+
return {
|
|
43701
|
+
value: option2.model,
|
|
43702
|
+
displayName: option2.label ?? option2.model,
|
|
43703
|
+
...option2.description ? { description: option2.description } : {},
|
|
43704
|
+
...option2.behavesAs ? { resolvedModel: option2.behavesAs } : {}
|
|
43705
|
+
};
|
|
43706
|
+
}
|
|
43707
|
+
function readModelValue(row) {
|
|
43708
|
+
if (row === null || typeof row !== "object" || Array.isArray(row))
|
|
43709
|
+
return void 0;
|
|
43710
|
+
const value = row.value;
|
|
43711
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
43712
|
+
}
|
|
43713
|
+
function mergeOptionOntoSdkRow(sdkRow, option2) {
|
|
43714
|
+
const base = sdkRow !== null && typeof sdkRow === "object" && !Array.isArray(sdkRow) ? { ...sdkRow } : {};
|
|
43715
|
+
const overlay = optionToModelInfo(option2);
|
|
43716
|
+
return { ...base, ...overlay };
|
|
43717
|
+
}
|
|
43718
|
+
function mergeClaudeModelPickerOptions(sdkModels, modelPicker) {
|
|
43719
|
+
if (!modelPicker)
|
|
43720
|
+
return sdkModels;
|
|
43721
|
+
const sdkRows = Array.isArray(sdkModels) ? [...sdkModels] : [];
|
|
43722
|
+
const sdkByValue = /* @__PURE__ */ new Map();
|
|
43723
|
+
for (const row of sdkRows) {
|
|
43724
|
+
const value = readModelValue(row);
|
|
43725
|
+
if (value && !sdkByValue.has(value))
|
|
43726
|
+
sdkByValue.set(value, row);
|
|
43727
|
+
}
|
|
43728
|
+
if (modelPicker.replaceBuiltInOptions) {
|
|
43729
|
+
const defaultSdk = sdkByValue.get("default");
|
|
43730
|
+
const merged2 = [
|
|
43731
|
+
defaultSdk !== void 0 ? defaultSdk : { value: "default", displayName: "Default" }
|
|
43732
|
+
];
|
|
43733
|
+
const included2 = /* @__PURE__ */ new Set(["default"]);
|
|
43734
|
+
for (const option2 of modelPicker.options) {
|
|
43735
|
+
if (included2.has(option2.model)) {
|
|
43736
|
+
if (option2.model === "default") {
|
|
43737
|
+
merged2[0] = mergeOptionOntoSdkRow(merged2[0], option2);
|
|
43738
|
+
}
|
|
43739
|
+
continue;
|
|
43740
|
+
}
|
|
43741
|
+
merged2.push(mergeOptionOntoSdkRow(sdkByValue.get(option2.model), option2));
|
|
43742
|
+
included2.add(option2.model);
|
|
43743
|
+
}
|
|
43744
|
+
return merged2;
|
|
43745
|
+
}
|
|
43746
|
+
const merged = [...sdkRows];
|
|
43747
|
+
const included = new Set(sdkRows.flatMap((row) => {
|
|
43748
|
+
const value = readModelValue(row);
|
|
43749
|
+
return value ? [value] : [];
|
|
43750
|
+
}));
|
|
43751
|
+
for (const option2 of modelPicker.options) {
|
|
43752
|
+
if (included.has(option2.model))
|
|
43753
|
+
continue;
|
|
43754
|
+
merged.push(mergeOptionOntoSdkRow(void 0, option2));
|
|
43755
|
+
included.add(option2.model);
|
|
43756
|
+
}
|
|
43757
|
+
return merged;
|
|
43758
|
+
}
|
|
43554
43759
|
function uniqueDisplayLabels(rows) {
|
|
43555
43760
|
const groups = /* @__PURE__ */ new Map();
|
|
43556
43761
|
for (const row of rows) {
|
|
@@ -43739,7 +43944,7 @@ function projectClaudeAccountUsage(usage, account) {
|
|
|
43739
43944
|
}
|
|
43740
43945
|
|
|
43741
43946
|
// dist/file-change.js
|
|
43742
|
-
import
|
|
43947
|
+
import path10 from "node:path";
|
|
43743
43948
|
var hunkSchema = external_exports.object({
|
|
43744
43949
|
oldStart: external_exports.number().int().nonnegative(),
|
|
43745
43950
|
oldLines: external_exports.number().int().nonnegative(),
|
|
@@ -43787,10 +43992,10 @@ function parseClaudeNativeFileChange(toolName, value) {
|
|
|
43787
43992
|
};
|
|
43788
43993
|
}
|
|
43789
43994
|
function displayPath(nativePath, cwd) {
|
|
43790
|
-
const resolvedCwd =
|
|
43791
|
-
const resolvedPath =
|
|
43792
|
-
const relative =
|
|
43793
|
-
const selected = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${
|
|
43995
|
+
const resolvedCwd = path10.resolve(cwd);
|
|
43996
|
+
const resolvedPath = path10.isAbsolute(nativePath) ? path10.resolve(nativePath) : path10.resolve(cwd, nativePath);
|
|
43997
|
+
const relative = path10.relative(resolvedCwd, resolvedPath);
|
|
43998
|
+
const selected = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${path10.sep}`) ? relative : resolvedPath;
|
|
43794
43999
|
const normalized = selected.replaceAll("\\", "/");
|
|
43795
44000
|
return validNativePath(normalized) && normalized !== "." ? normalized : null;
|
|
43796
44001
|
}
|
|
@@ -43802,7 +44007,7 @@ function projectClaudeFileChange(value, cwd) {
|
|
|
43802
44007
|
`@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`,
|
|
43803
44008
|
...hunk.lines
|
|
43804
44009
|
]);
|
|
43805
|
-
const absoluteDisplayPath =
|
|
44010
|
+
const absoluteDisplayPath = path10.posix.isAbsolute(normalizedPath);
|
|
43806
44011
|
const oldHeader = value.kind === "add" ? "/dev/null" : absoluteDisplayPath ? normalizedPath : `a/${normalizedPath}`;
|
|
43807
44012
|
const newHeader = absoluteDisplayPath ? normalizedPath : `b/${normalizedPath}`;
|
|
43808
44013
|
const unifiedDiff = [`--- ${oldHeader}`, `+++ ${newHeader}`, ...body, ""].join("\n");
|
|
@@ -44491,7 +44696,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44491
44696
|
|
|
44492
44697
|
// dist/process-fence.js
|
|
44493
44698
|
import { execFile } from "node:child_process";
|
|
44494
|
-
import
|
|
44699
|
+
import path11 from "node:path";
|
|
44495
44700
|
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
44496
44701
|
import { promisify } from "node:util";
|
|
44497
44702
|
var executeFile = promisify(execFile);
|
|
@@ -44515,9 +44720,9 @@ async function closeClaudeProcessGroup(child, timeoutMs) {
|
|
|
44515
44720
|
if (child.exitCode !== null || child.signalCode !== null)
|
|
44516
44721
|
throw new Error("Claude process tree cannot be confirmed after its Windows root exited");
|
|
44517
44722
|
const root = process.env.SystemRoot ?? process.env.SYSTEMROOT;
|
|
44518
|
-
if (!root || !
|
|
44723
|
+
if (!root || !path11.win32.isAbsolute(root))
|
|
44519
44724
|
throw new Error("Windows SystemRoot is unavailable");
|
|
44520
|
-
await executeFile(
|
|
44725
|
+
await executeFile(path11.win32.join(root, "System32", "taskkill.exe"), ["/PID", String(pid), "/T", "/F"], {
|
|
44521
44726
|
timeout: timeoutMs,
|
|
44522
44727
|
windowsHide: true
|
|
44523
44728
|
});
|
|
@@ -45319,8 +45524,9 @@ var ClaudeSdkModelInspector = class {
|
|
|
45319
45524
|
const candidate = activeQuery;
|
|
45320
45525
|
const canSelectModel = Array.isArray(initialized.models) && typeof candidate.setModel === "function";
|
|
45321
45526
|
const canSelectPermissionMode = typeof candidate.setPermissionMode === "function";
|
|
45527
|
+
const modelPicker = await readClaudeUserModelPicker(this.#environment);
|
|
45322
45528
|
return {
|
|
45323
|
-
models: initialized.models,
|
|
45529
|
+
models: mergeClaudeModelPickerOptions(initialized.models, modelPicker),
|
|
45324
45530
|
canSelectModel,
|
|
45325
45531
|
canSelectPermissionMode
|
|
45326
45532
|
};
|
|
@@ -47888,7 +48094,7 @@ var ClaudeCodeAdapter = class {
|
|
|
47888
48094
|
error: invalidState("Claude Code Adapter is closing")
|
|
47889
48095
|
};
|
|
47890
48096
|
}
|
|
47891
|
-
const cwd =
|
|
48097
|
+
const cwd = path12.resolve(input.cwd ?? process.cwd());
|
|
47892
48098
|
if (!input.refresh) {
|
|
47893
48099
|
const cached2 = this.#inspectionCache.get(cwd);
|
|
47894
48100
|
if (cached2)
|
|
@@ -48069,7 +48275,7 @@ var ClaudeCodeAdapter = class {
|
|
|
48069
48275
|
}
|
|
48070
48276
|
};
|
|
48071
48277
|
}
|
|
48072
|
-
const cwd =
|
|
48278
|
+
const cwd = path12.resolve(input.cwd);
|
|
48073
48279
|
if (input.kind === "rollbackLastTurn") {
|
|
48074
48280
|
for (const source of this.#sessions) {
|
|
48075
48281
|
const ready = await source.prepareRollback(input.sourceRef.nativeSessionId);
|
|
@@ -48192,7 +48398,7 @@ var ClaudeCodeAdapter = class {
|
|
|
48192
48398
|
};
|
|
48193
48399
|
|
|
48194
48400
|
// dist/user-shell-environment.js
|
|
48195
|
-
import
|
|
48401
|
+
import path13 from "node:path";
|
|
48196
48402
|
import { execFile as execFile2 } from "node:child_process";
|
|
48197
48403
|
var ENVIRONMENT_MARKER = Buffer.from("\0CODEXHOST_USER_SHELL_ENV_V1\0");
|
|
48198
48404
|
var ENVIRONMENT_COMMAND = "printf '\\0CODEXHOST_USER_SHELL_ENV_V1\\0'; /usr/bin/env -0";
|
|
@@ -48235,7 +48441,7 @@ async function withUserShellEnvironment(environment, dependencies) {
|
|
|
48235
48441
|
if (platform === "win32" || !environment.HOME)
|
|
48236
48442
|
return environment;
|
|
48237
48443
|
const shell = environment.SHELL?.trim() || defaultShell(platform);
|
|
48238
|
-
if (!shell || !SUPPORTED_SHELLS.has(
|
|
48444
|
+
if (!shell || !SUPPORTED_SHELLS.has(path13.basename(shell)))
|
|
48239
48445
|
return environment;
|
|
48240
48446
|
const cacheKey = `${platform}\0${shell}\0${environment.HOME}`;
|
|
48241
48447
|
const cached2 = dependencies ? void 0 : shellEnvironmentCache.get(cacheKey);
|