claude-use 11.60.0 → 11.60.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/dist/cli.cjs +816 -688
- package/dist/index.cjs +1642 -1488
- package/dist/index.mjs +1604 -1450
- package/dist/types/index.d.ts +17 -11
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -318,10 +318,10 @@ function mergeDefs(...defs) {
|
|
|
318
318
|
function cloneDef(schema) {
|
|
319
319
|
return mergeDefs(schema._zod.def);
|
|
320
320
|
}
|
|
321
|
-
function getElementAtPath(obj,
|
|
322
|
-
if (!
|
|
321
|
+
function getElementAtPath(obj, path70) {
|
|
322
|
+
if (!path70)
|
|
323
323
|
return obj;
|
|
324
|
-
return
|
|
324
|
+
return path70.reduce((acc, key) => acc?.[key], obj);
|
|
325
325
|
}
|
|
326
326
|
function promiseAllObject(promisesObj) {
|
|
327
327
|
const keys = Object.keys(promisesObj);
|
|
@@ -580,11 +580,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
580
580
|
}
|
|
581
581
|
return false;
|
|
582
582
|
}
|
|
583
|
-
function prefixIssues(
|
|
583
|
+
function prefixIssues(path70, issues) {
|
|
584
584
|
return issues.map((iss) => {
|
|
585
585
|
var _a4;
|
|
586
586
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
587
|
-
iss.path.unshift(
|
|
587
|
+
iss.path.unshift(path70);
|
|
588
588
|
return iss;
|
|
589
589
|
});
|
|
590
590
|
}
|
|
@@ -1105,16 +1105,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
1107
1107
|
const fieldErrors = { _errors: [] };
|
|
1108
|
-
const processError = (error64,
|
|
1108
|
+
const processError = (error64, path70 = []) => {
|
|
1109
1109
|
for (const issue2 of error64.issues) {
|
|
1110
1110
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1111
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1111
|
+
issue2.errors.map((issues) => processError({ issues }, [...path70, ...issue2.path]));
|
|
1112
1112
|
} else if (issue2.code === "invalid_key") {
|
|
1113
|
-
processError({ issues: issue2.issues }, [...
|
|
1113
|
+
processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
|
|
1114
1114
|
} else if (issue2.code === "invalid_element") {
|
|
1115
|
-
processError({ issues: issue2.issues }, [...
|
|
1115
|
+
processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
|
|
1116
1116
|
} else {
|
|
1117
|
-
const fullpath = [...
|
|
1117
|
+
const fullpath = [...path70, ...issue2.path];
|
|
1118
1118
|
if (fullpath.length === 0) {
|
|
1119
1119
|
fieldErrors._errors.push(mapper(issue2));
|
|
1120
1120
|
} else {
|
|
@@ -1153,17 +1153,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
1155
1155
|
const result = { errors: [] };
|
|
1156
|
-
const processError = (error64,
|
|
1156
|
+
const processError = (error64, path70 = []) => {
|
|
1157
1157
|
var _a4;
|
|
1158
1158
|
for (const issue2 of error64.issues) {
|
|
1159
1159
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1160
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1160
|
+
issue2.errors.map((issues) => processError({ issues }, [...path70, ...issue2.path]));
|
|
1161
1161
|
} else if (issue2.code === "invalid_key") {
|
|
1162
|
-
processError({ issues: issue2.issues }, [...
|
|
1162
|
+
processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
|
|
1163
1163
|
} else if (issue2.code === "invalid_element") {
|
|
1164
|
-
processError({ issues: issue2.issues }, [...
|
|
1164
|
+
processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
|
|
1165
1165
|
} else {
|
|
1166
|
-
const fullpath = [...
|
|
1166
|
+
const fullpath = [...path70, ...issue2.path];
|
|
1167
1167
|
if (fullpath.length === 0) {
|
|
1168
1168
|
result.errors.push(mapper(issue2));
|
|
1169
1169
|
continue;
|
|
@@ -1202,8 +1202,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
function toDotPath(_path) {
|
|
1204
1204
|
const segs = [];
|
|
1205
|
-
const
|
|
1206
|
-
for (const seg of
|
|
1205
|
+
const path70 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1206
|
+
for (const seg of path70) {
|
|
1207
1207
|
if (typeof seg === "number")
|
|
1208
1208
|
segs.push(`[${seg}]`);
|
|
1209
1209
|
else if (typeof seg === "symbol")
|
|
@@ -19199,13 +19199,13 @@ function resolveRef(ref, ctx) {
|
|
|
19199
19199
|
if (!ref.startsWith("#")) {
|
|
19200
19200
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
19201
19201
|
}
|
|
19202
|
-
const
|
|
19203
|
-
if (
|
|
19202
|
+
const path70 = ref.slice(1).split("/").filter(Boolean);
|
|
19203
|
+
if (path70.length === 0) {
|
|
19204
19204
|
return ctx.rootSchema;
|
|
19205
19205
|
}
|
|
19206
19206
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
19207
|
-
if (
|
|
19208
|
-
const key =
|
|
19207
|
+
if (path70[0] === defsKey) {
|
|
19208
|
+
const key = path70[1] === void 0 ? void 0 : decodeJSONPointerSegment(path70[1]);
|
|
19209
19209
|
if (!key || !ctx.defs[key]) {
|
|
19210
19210
|
throw new Error(`Reference not found: ${ref}`);
|
|
19211
19211
|
}
|
|
@@ -23712,42 +23712,42 @@ var require_defaults = __commonJS({
|
|
|
23712
23712
|
var require_env_paths = __commonJS({
|
|
23713
23713
|
"node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module2) {
|
|
23714
23714
|
"use strict";
|
|
23715
|
-
var
|
|
23715
|
+
var path70 = require("path");
|
|
23716
23716
|
var os14 = require("os");
|
|
23717
23717
|
var homedir = os14.homedir();
|
|
23718
23718
|
var tmpdir = os14.tmpdir();
|
|
23719
23719
|
var { env } = process;
|
|
23720
23720
|
var macos = (name) => {
|
|
23721
|
-
const library =
|
|
23721
|
+
const library = path70.join(homedir, "Library");
|
|
23722
23722
|
return {
|
|
23723
|
-
data:
|
|
23724
|
-
config:
|
|
23725
|
-
cache:
|
|
23726
|
-
log:
|
|
23727
|
-
temp:
|
|
23723
|
+
data: path70.join(library, "Application Support", name),
|
|
23724
|
+
config: path70.join(library, "Preferences", name),
|
|
23725
|
+
cache: path70.join(library, "Caches", name),
|
|
23726
|
+
log: path70.join(library, "Logs", name),
|
|
23727
|
+
temp: path70.join(tmpdir, name)
|
|
23728
23728
|
};
|
|
23729
23729
|
};
|
|
23730
23730
|
var windows = (name) => {
|
|
23731
|
-
const appData = env.APPDATA ||
|
|
23732
|
-
const localAppData = env.LOCALAPPDATA ||
|
|
23731
|
+
const appData = env.APPDATA || path70.join(homedir, "AppData", "Roaming");
|
|
23732
|
+
const localAppData = env.LOCALAPPDATA || path70.join(homedir, "AppData", "Local");
|
|
23733
23733
|
return {
|
|
23734
23734
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
23735
|
-
data:
|
|
23736
|
-
config:
|
|
23737
|
-
cache:
|
|
23738
|
-
log:
|
|
23739
|
-
temp:
|
|
23735
|
+
data: path70.join(localAppData, name, "Data"),
|
|
23736
|
+
config: path70.join(appData, name, "Config"),
|
|
23737
|
+
cache: path70.join(localAppData, name, "Cache"),
|
|
23738
|
+
log: path70.join(localAppData, name, "Log"),
|
|
23739
|
+
temp: path70.join(tmpdir, name)
|
|
23740
23740
|
};
|
|
23741
23741
|
};
|
|
23742
23742
|
var linux = (name) => {
|
|
23743
|
-
const username =
|
|
23743
|
+
const username = path70.basename(homedir);
|
|
23744
23744
|
return {
|
|
23745
|
-
data:
|
|
23746
|
-
config:
|
|
23747
|
-
cache:
|
|
23745
|
+
data: path70.join(env.XDG_DATA_HOME || path70.join(homedir, ".local", "share"), name),
|
|
23746
|
+
config: path70.join(env.XDG_CONFIG_HOME || path70.join(homedir, ".config"), name),
|
|
23747
|
+
cache: path70.join(env.XDG_CACHE_HOME || path70.join(homedir, ".cache"), name),
|
|
23748
23748
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
23749
|
-
log:
|
|
23750
|
-
temp:
|
|
23749
|
+
log: path70.join(env.XDG_STATE_HOME || path70.join(homedir, ".local", "state"), name),
|
|
23750
|
+
temp: path70.join(tmpdir, username, name)
|
|
23751
23751
|
};
|
|
23752
23752
|
};
|
|
23753
23753
|
var envPaths = (name, options) => {
|
|
@@ -23815,11 +23815,11 @@ var require_util = __commonJS({
|
|
|
23815
23815
|
return result;
|
|
23816
23816
|
}
|
|
23817
23817
|
exports2.emplace = emplace;
|
|
23818
|
-
function getPropertyByPath(source,
|
|
23819
|
-
if (typeof
|
|
23820
|
-
return source[
|
|
23818
|
+
function getPropertyByPath(source, path70) {
|
|
23819
|
+
if (typeof path70 === "string" && Object.prototype.hasOwnProperty.call(source, path70)) {
|
|
23820
|
+
return source[path70];
|
|
23821
23821
|
}
|
|
23822
|
-
const parsedPath = typeof
|
|
23822
|
+
const parsedPath = typeof path70 === "string" ? path70.split(".") : path70;
|
|
23823
23823
|
return parsedPath.reduce((previous, key) => {
|
|
23824
23824
|
if (previous === void 0) {
|
|
23825
23825
|
return previous;
|
|
@@ -23842,9 +23842,9 @@ var require_util = __commonJS({
|
|
|
23842
23842
|
return Object.fromEntries(Object.entries(options).filter(([, value2]) => value2 !== void 0));
|
|
23843
23843
|
}
|
|
23844
23844
|
exports2.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
|
|
23845
|
-
async function isDirectory(
|
|
23845
|
+
async function isDirectory(path70) {
|
|
23846
23846
|
try {
|
|
23847
|
-
const stat = await fs_1.promises.stat(
|
|
23847
|
+
const stat = await fs_1.promises.stat(path70);
|
|
23848
23848
|
return stat.isDirectory();
|
|
23849
23849
|
} catch (e14) {
|
|
23850
23850
|
if (e14.code === "ENOENT") {
|
|
@@ -23854,9 +23854,9 @@ var require_util = __commonJS({
|
|
|
23854
23854
|
}
|
|
23855
23855
|
}
|
|
23856
23856
|
exports2.isDirectory = isDirectory;
|
|
23857
|
-
function isDirectorySync(
|
|
23857
|
+
function isDirectorySync(path70) {
|
|
23858
23858
|
try {
|
|
23859
|
-
const stat = fs_1.default.statSync(
|
|
23859
|
+
const stat = fs_1.default.statSync(path70);
|
|
23860
23860
|
return stat.isDirectory();
|
|
23861
23861
|
} catch (e14) {
|
|
23862
23862
|
if (e14.code === "ENOENT") {
|
|
@@ -23954,7 +23954,7 @@ var require_ExplorerBase = __commonJS({
|
|
|
23954
23954
|
const idx = importStack.indexOf(fullPath);
|
|
23955
23955
|
if (idx !== -1) {
|
|
23956
23956
|
throw new Error(`Circular import detected:
|
|
23957
|
-
${[...importStack, fullPath].map((
|
|
23957
|
+
${[...importStack, fullPath].map((path70, i10) => `${i10 + 1}. ${path70}`).join("\n")} (same as ${idx + 1}.)`);
|
|
23958
23958
|
}
|
|
23959
23959
|
}
|
|
23960
23960
|
}
|
|
@@ -24142,9 +24142,9 @@ var require_Explorer = __commonJS({
|
|
|
24142
24142
|
throw error63;
|
|
24143
24143
|
}
|
|
24144
24144
|
}
|
|
24145
|
-
async #fileExists(
|
|
24145
|
+
async #fileExists(path70) {
|
|
24146
24146
|
try {
|
|
24147
|
-
await promises_1.default.stat(
|
|
24147
|
+
await promises_1.default.stat(path70);
|
|
24148
24148
|
return true;
|
|
24149
24149
|
} catch (e14) {
|
|
24150
24150
|
return false;
|
|
@@ -24304,9 +24304,9 @@ var require_ExplorerSync = __commonJS({
|
|
|
24304
24304
|
throw error63;
|
|
24305
24305
|
}
|
|
24306
24306
|
}
|
|
24307
|
-
#fileExists(
|
|
24307
|
+
#fileExists(path70) {
|
|
24308
24308
|
try {
|
|
24309
|
-
fs_1.default.statSync(
|
|
24309
|
+
fs_1.default.statSync(path70);
|
|
24310
24310
|
return true;
|
|
24311
24311
|
} catch (e14) {
|
|
24312
24312
|
return false;
|
|
@@ -24430,7 +24430,7 @@ var require_dist = __commonJS({
|
|
|
24430
24430
|
};
|
|
24431
24431
|
}
|
|
24432
24432
|
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
24433
|
-
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((
|
|
24433
|
+
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path70) => path70.replace("{name}", moduleName));
|
|
24434
24434
|
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
24435
24435
|
return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
|
|
24436
24436
|
}
|
|
@@ -24560,7 +24560,7 @@ function parseIgnoringUnrecognisedKeys(schema, raw) {
|
|
|
24560
24560
|
return second.success ? { success: true, data: second.data, ignored } : { success: false, issues: second.error.issues };
|
|
24561
24561
|
}
|
|
24562
24562
|
function describeIgnoredKeys(filePath, ignored) {
|
|
24563
|
-
const places = ignored.map(({ path:
|
|
24563
|
+
const places = ignored.map(({ path: path70, keys }) => `${path70.length === 0 ? "" : `${path70.map(String).join(".")}.`}${keys.join(", ")}`);
|
|
24564
24564
|
return `${filePath} has settings this version of agent-shim does not know and ignores: ${places.join("; ")}. A newer release may read them.`;
|
|
24565
24565
|
}
|
|
24566
24566
|
function noteIgnoredKeys(filePath, ignored) {
|
|
@@ -24582,9 +24582,9 @@ function restoreIgnoredKeys(filePath, value2) {
|
|
|
24582
24582
|
return value2;
|
|
24583
24583
|
}
|
|
24584
24584
|
const restored = structuredClone(value2);
|
|
24585
|
-
for (const { path:
|
|
24585
|
+
for (const { path: path70, values } of ignored) {
|
|
24586
24586
|
let holder = restored;
|
|
24587
|
-
for (const step2 of
|
|
24587
|
+
for (const step2 of path70) {
|
|
24588
24588
|
holder = isRecord(holder) ? holder[step2] : void 0;
|
|
24589
24589
|
}
|
|
24590
24590
|
if (isRecord(holder)) {
|
|
@@ -25054,6 +25054,72 @@ var init_proxyBypass = __esm({
|
|
|
25054
25054
|
}
|
|
25055
25055
|
});
|
|
25056
25056
|
|
|
25057
|
+
// src/config/names.ts
|
|
25058
|
+
function isFileName(name) {
|
|
25059
|
+
return FILE_NAME.test(name);
|
|
25060
|
+
}
|
|
25061
|
+
function isStoredName(name) {
|
|
25062
|
+
return name.length > 0 && Buffer.byteLength(name) <= MAX_NAME_BYTES && name !== "." && name !== ".." && !/[/\\]/u.test(name) && !name.includes("\0");
|
|
25063
|
+
}
|
|
25064
|
+
function requireNewProviderName(name) {
|
|
25065
|
+
if (!isFileName(name)) {
|
|
25066
|
+
throw new InvalidProviderNameError(name, FILE_NAME_RULE);
|
|
25067
|
+
}
|
|
25068
|
+
}
|
|
25069
|
+
function profileFilePath(directory, name, source) {
|
|
25070
|
+
if (!isStoredName(name)) {
|
|
25071
|
+
throw new UnsafeNameError(name, "configuration profile", STORED_NAME_RULE, source);
|
|
25072
|
+
}
|
|
25073
|
+
return import_node_path4.default.join(directory, `${name}.json`);
|
|
25074
|
+
}
|
|
25075
|
+
function providerFilePath(directory, name, source) {
|
|
25076
|
+
if (!isStoredName(name)) {
|
|
25077
|
+
throw new InvalidProviderNameError(name, STORED_NAME_RULE, source);
|
|
25078
|
+
}
|
|
25079
|
+
return import_node_path4.default.join(directory, `${name}.json`);
|
|
25080
|
+
}
|
|
25081
|
+
var import_node_path4, FILESYSTEM_COMPONENT_BYTES, MAX_PID_DIGITS, UUID_CHARS, ATOMIC_WRITE_OVERHEAD_BYTES, FARM_SWAP_OVERHEAD_BYTES, MAX_NAME_BYTES, FILE_NAME_PATTERN, FILE_NAME, FILE_NAME_RULE, STORED_NAME_RULE, FileNameSchema, StoredNameSchema, UnsafeNameError, InvalidProviderNameError;
|
|
25082
|
+
var init_names = __esm({
|
|
25083
|
+
"src/config/names.ts"() {
|
|
25084
|
+
"use strict";
|
|
25085
|
+
import_node_path4 = __toESM(require("node:path"), 1);
|
|
25086
|
+
init_zod();
|
|
25087
|
+
init_cliError();
|
|
25088
|
+
FILESYSTEM_COMPONENT_BYTES = 255;
|
|
25089
|
+
MAX_PID_DIGITS = 10;
|
|
25090
|
+
UUID_CHARS = 36;
|
|
25091
|
+
ATOMIC_WRITE_OVERHEAD_BYTES = ".".length + ".json".length + ".".length + MAX_PID_DIGITS + ".".length + UUID_CHARS + ".tmp".length;
|
|
25092
|
+
FARM_SWAP_OVERHEAD_BYTES = ".".length + ".previous.".length + MAX_PID_DIGITS + ".".length + UUID_CHARS;
|
|
25093
|
+
MAX_NAME_BYTES = FILESYSTEM_COMPONENT_BYTES - Math.max(ATOMIC_WRITE_OVERHEAD_BYTES, FARM_SWAP_OVERHEAD_BYTES);
|
|
25094
|
+
FILE_NAME_PATTERN = `[A-Za-z0-9][A-Za-z0-9._@-]{0,${String(MAX_NAME_BYTES - 1)}}`;
|
|
25095
|
+
FILE_NAME = new RegExp(`^${FILE_NAME_PATTERN}$`);
|
|
25096
|
+
FILE_NAME_RULE = `must start with a letter or digit, contain only letters, digits, dots, dashes, underscores and at signs, and be at most ${String(MAX_NAME_BYTES)} bytes`;
|
|
25097
|
+
STORED_NAME_RULE = `must be non-empty, at most ${String(MAX_NAME_BYTES)} bytes, not "." or "..", and contain no path separator or NUL`;
|
|
25098
|
+
FileNameSchema = external_exports.string().min(1).regex(FILE_NAME, FILE_NAME_RULE);
|
|
25099
|
+
StoredNameSchema = external_exports.string().min(1).max(MAX_NAME_BYTES).refine(isStoredName, STORED_NAME_RULE);
|
|
25100
|
+
UnsafeNameError = class extends CliError {
|
|
25101
|
+
constructor(attemptedName, kind, rule = STORED_NAME_RULE, source) {
|
|
25102
|
+
super(`${source === void 0 ? "" : `${source}: `}${JSON.stringify(attemptedName)} is not a valid ${kind} name: a name ${rule}.`);
|
|
25103
|
+
this.attemptedName = attemptedName;
|
|
25104
|
+
this.kind = kind;
|
|
25105
|
+
this.rule = rule;
|
|
25106
|
+
this.source = source;
|
|
25107
|
+
this.name = "UnsafeNameError";
|
|
25108
|
+
}
|
|
25109
|
+
attemptedName;
|
|
25110
|
+
kind;
|
|
25111
|
+
rule;
|
|
25112
|
+
source;
|
|
25113
|
+
};
|
|
25114
|
+
InvalidProviderNameError = class extends UnsafeNameError {
|
|
25115
|
+
constructor(attemptedName, rule = STORED_NAME_RULE, source) {
|
|
25116
|
+
super(attemptedName, "provider", rule, source);
|
|
25117
|
+
this.name = "InvalidProviderNameError";
|
|
25118
|
+
}
|
|
25119
|
+
};
|
|
25120
|
+
}
|
|
25121
|
+
});
|
|
25122
|
+
|
|
25057
25123
|
// node_modules/.pnpm/ansi-regex@6.3.0/node_modules/ansi-regex/index.js
|
|
25058
25124
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
25059
25125
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
@@ -27626,13 +27692,14 @@ function isTimeZone(name) {
|
|
|
27626
27692
|
return false;
|
|
27627
27693
|
}
|
|
27628
27694
|
}
|
|
27629
|
-
var
|
|
27695
|
+
var import_node_path5, CATEGORY_NAMES, OVERRIDABLE_CATEGORIES, CategoryMapSchema, DURATION_RE, DurationSchema, WhenConditionObjectSchema, WhenSchema, EntryValueSchema, ENTRY_KEY_RE, EntriesSchema, LaunchSchema, CREDENTIAL_TARGETS, PROVIDER_CREDENTIAL_TARGETS, CREDENTIAL_TARGET_VARS, ArgvSchema, CommandSourceOptions, EnvCredentialSourceSchema, FileCredentialSourceSchema, CommandCredentialSourceSchema, OpCredentialSourceSchema, KeychainCredentialSourceSchema, LiteralCredentialSourceSchema, CredentialSourceSchema, RemoteCredentialSourceSchema, CREDENTIAL_CACHE_STORES, CredentialCacheSchema, CredentialSchema, ProviderCredentialSchema, RESERVED_PROVIDER_ENV_KEYS, ProviderEnvSchema, PROVIDER_KINDS, ANTIGRAVITY_MODES, CLAUDE_TIERS, ANTIGRAVITY_EFFORTS, ANTIGRAVITY_DEFAULT_MODE, ANTIGRAVITY_DEFAULT_MODEL, ANTIGRAVITY_DEFAULT_TIER_MODELS, ANTIGRAVITY_DEFAULT_EFFORT, AntigravityModelTargetSchema, AntigravityProviderConfigSchema, CODEX_EFFORTS, CODEX_LOGINS, CODEX_DEFAULT_LOGIN, CODEX_DEFAULT_MODEL, CODEX_DEFAULT_TIER_MODELS, CODEX_DEFAULT_EFFORT, CodexProviderConfigSchema, ProviderRouteSchema, PickerModelSchema, PickerModelsSchema, ProviderCatalogueSchema, HttpProviderSchema, CodexProviderSchema, RouterProviderSchema, AntigravityProviderSchema, ProviderSchema, SELECTION_MODES, VirtualModelSchema, ModelPricesSchema, FamilySettingsSchema, ModelsConfigSchema, ModelsLayerSchema, ConfigProfileSchema, POOL_SELECTOR_PREFIX, POOL_NAME_PATTERN, PoolNameSchema, SELECTOR_RE, IdentitySelectorSchema, PoolMemberSchema, POOL_PREFERENCES, PoolPreferenceSchema, WHOLE_PERCENT_MAX, CompactAtUtilisationSchema, PoolSchema, WEEKDAYS, AnchorSchema, JOB_WINDOWS, JobTriggerSchema, JobTargetSchema, JobSchema, DirectoryRuleSchema, DirectoryRulesSchema, PortableConfigSchema, HEADROOM_MODES, HEADROOM_CCR_MODES, HEADROOM_ROLLOUT_CHANNELS, INTERCEPT_CHANNELS, READ_MATURATION_CHANNELS, HeadroomGlobalConfigObjectSchema, HeadroomGlobalConfigSchema, HEADROOM_DEFAULT_SOURCE, HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES, FRONTDOOR_DEFAULT_IDLE_SHUTDOWN_MINUTES, FrontDoorGlobalConfigSchema, UPDATE_MODES, UpdateGlobalConfigSchema, GlobalConfigSchema, IdentitySchema, CategoryClassificationSchema, CategoryClassificationOverlaySchema, SHIPPED_CATEGORY_DEFAULTS;
|
|
27630
27696
|
var init_schema = __esm({
|
|
27631
27697
|
"src/config/schema.ts"() {
|
|
27632
27698
|
"use strict";
|
|
27633
27699
|
init_proxyBypass();
|
|
27700
|
+
init_names();
|
|
27634
27701
|
init_statusline();
|
|
27635
|
-
|
|
27702
|
+
import_node_path5 = __toESM(require("node:path"), 1);
|
|
27636
27703
|
init_zod();
|
|
27637
27704
|
init_dist2();
|
|
27638
27705
|
init_versionDiscovery();
|
|
@@ -27664,7 +27731,7 @@ var init_schema = __esm({
|
|
|
27664
27731
|
LaunchSchema = external_exports.strictObject({
|
|
27665
27732
|
skipPermissions: external_exports.boolean().optional(),
|
|
27666
27733
|
remoteControl: external_exports.boolean().optional(),
|
|
27667
|
-
provider:
|
|
27734
|
+
provider: StoredNameSchema.optional(),
|
|
27668
27735
|
headroom: external_exports.boolean().optional(),
|
|
27669
27736
|
trackUsage: external_exports.boolean().optional(),
|
|
27670
27737
|
/** The exact Claude Code version to run, as it is named in Claude Code's versions directory (`2.1.220`). A pin that is not installed fails the launch; it never falls back to the highest version. */
|
|
@@ -27703,7 +27770,7 @@ var init_schema = __esm({
|
|
|
27703
27770
|
};
|
|
27704
27771
|
EnvCredentialSourceSchema = external_exports.strictObject({ env: external_exports.string().min(1) });
|
|
27705
27772
|
FileCredentialSourceSchema = external_exports.strictObject({
|
|
27706
|
-
file: external_exports.string().min(1).refine((filePath) => filePath.startsWith("~/") ||
|
|
27773
|
+
file: external_exports.string().min(1).refine((filePath) => filePath.startsWith("~/") || import_node_path5.default.isAbsolute(filePath), {
|
|
27707
27774
|
message: "a credential file must be an absolute or ~-rooted path, since a launch can start in any directory"
|
|
27708
27775
|
})
|
|
27709
27776
|
});
|
|
@@ -27816,7 +27883,7 @@ var init_schema = __esm({
|
|
|
27816
27883
|
/** The condition, the same `when` union a configuration cascade entry takes: the object form or a trilean predicate tree over the request facts the door resolves (`request.model` and kin). */
|
|
27817
27884
|
when: WhenSchema,
|
|
27818
27885
|
/** The provider a matching request is sent to, by the name a provider file carries. */
|
|
27819
|
-
provider:
|
|
27886
|
+
provider: StoredNameSchema,
|
|
27820
27887
|
/** The model name to rewrite the request to before it reaches the target, for a provider that expects another form (OpenRouter's `anthropic/claude-...` for instance). A route that rewrites reads the whole body, the one copy the rewrite needs. */
|
|
27821
27888
|
model: external_exports.string().min(1).optional()
|
|
27822
27889
|
});
|
|
@@ -27933,7 +28000,7 @@ var init_schema = __esm({
|
|
|
27933
28000
|
ConfigProfileSchema = external_exports.strictObject({
|
|
27934
28001
|
$schema: external_exports.string().optional(),
|
|
27935
28002
|
description: external_exports.string().optional(),
|
|
27936
|
-
extends: external_exports.array(
|
|
28003
|
+
extends: external_exports.array(StoredNameSchema).optional(),
|
|
27937
28004
|
categories: CategoryMapSchema.optional(),
|
|
27938
28005
|
entries: EntriesSchema.optional(),
|
|
27939
28006
|
launch: LaunchSchema.optional(),
|
|
@@ -27941,9 +28008,8 @@ var init_schema = __esm({
|
|
|
27941
28008
|
});
|
|
27942
28009
|
POOL_SELECTOR_PREFIX = "pool:";
|
|
27943
28010
|
POOL_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._-]*";
|
|
27944
|
-
IDENTITY_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._@-]*";
|
|
27945
28011
|
PoolNameSchema = external_exports.string().min(1).regex(new RegExp(`^${POOL_NAME_PATTERN}$`));
|
|
27946
|
-
SELECTOR_RE = new RegExp(`^(${POOL_SELECTOR_PREFIX}${POOL_NAME_PATTERN}|${
|
|
28012
|
+
SELECTOR_RE = new RegExp(`^(${POOL_SELECTOR_PREFIX}${POOL_NAME_PATTERN}|${FILE_NAME_PATTERN})$`);
|
|
27947
28013
|
IdentitySelectorSchema = external_exports.string().min(1).regex(SELECTOR_RE);
|
|
27948
28014
|
PoolMemberSchema = external_exports.union([external_exports.string().min(1).regex(SELECTOR_RE), external_exports.strictObject({ identity: external_exports.string().min(1).regex(SELECTOR_RE), when: WhenSchema })]);
|
|
27949
28015
|
POOL_PREFERENCES = ["score", "listed"];
|
|
@@ -27981,7 +28047,7 @@ var init_schema = __esm({
|
|
|
27981
28047
|
});
|
|
27982
28048
|
DirectoryRuleSchema = ConfigProfileSchema.omit({ description: true }).extend({
|
|
27983
28049
|
path: external_exports.string().min(1),
|
|
27984
|
-
configProfile:
|
|
28050
|
+
configProfile: StoredNameSchema.optional(),
|
|
27985
28051
|
identity: IdentitySelectorSchema.optional(),
|
|
27986
28052
|
when: WhenSchema.optional()
|
|
27987
28053
|
});
|
|
@@ -27990,7 +28056,10 @@ var init_schema = __esm({
|
|
|
27990
28056
|
rules: external_exports.array(DirectoryRuleSchema)
|
|
27991
28057
|
});
|
|
27992
28058
|
PortableConfigSchema = ConfigProfileSchema.omit({ description: true }).extend({
|
|
27993
|
-
|
|
28059
|
+
// A committed file is the one place a name arrives from someone other than the person: it may only name a profile or provider by the shape new ones are given, which cannot name a path, where the person's own files may also name one stored under an older, looser rule.
|
|
28060
|
+
extends: external_exports.array(FileNameSchema).optional(),
|
|
28061
|
+
launch: LaunchSchema.extend({ provider: FileNameSchema.optional() }).optional(),
|
|
28062
|
+
configProfile: FileNameSchema.optional(),
|
|
27994
28063
|
identity: IdentitySelectorSchema.optional(),
|
|
27995
28064
|
when: WhenSchema.optional()
|
|
27996
28065
|
});
|
|
@@ -28039,7 +28108,7 @@ var init_schema = __esm({
|
|
|
28039
28108
|
});
|
|
28040
28109
|
GlobalConfigSchema = external_exports.strictObject({
|
|
28041
28110
|
$schema: external_exports.string().optional(),
|
|
28042
|
-
defaultConfigProfile:
|
|
28111
|
+
defaultConfigProfile: StoredNameSchema.optional(),
|
|
28043
28112
|
walkUpLimit: external_exports.string().min(1).optional(),
|
|
28044
28113
|
categories: CategoryMapSchema.optional(),
|
|
28045
28114
|
entries: EntriesSchema.optional(),
|
|
@@ -28053,8 +28122,8 @@ var init_schema = __esm({
|
|
|
28053
28122
|
});
|
|
28054
28123
|
IdentitySchema = external_exports.strictObject({
|
|
28055
28124
|
$schema: external_exports.string().optional(),
|
|
28056
|
-
name:
|
|
28057
|
-
defaultConfigProfile:
|
|
28125
|
+
name: FileNameSchema,
|
|
28126
|
+
defaultConfigProfile: StoredNameSchema.optional(),
|
|
28058
28127
|
allowAmbientCredential: external_exports.boolean().default(false),
|
|
28059
28128
|
credential: CredentialSchema.optional(),
|
|
28060
28129
|
/** When this identity's five-hour window should be open: the front door opens one at each anchor if none is. Absent, nothing is opened on a schedule. */
|
|
@@ -28105,7 +28174,7 @@ function readFrontDoorState(fs30, stateFile) {
|
|
|
28105
28174
|
}
|
|
28106
28175
|
}
|
|
28107
28176
|
function writeFrontDoorState(fs30, stateFile, state) {
|
|
28108
|
-
fs30.mkdirp(
|
|
28177
|
+
fs30.mkdirp(import_node_path6.default.dirname(stateFile));
|
|
28109
28178
|
fs30.writeFilePrivate(stateFile, `${JSON.stringify(state, null, 2)}
|
|
28110
28179
|
`);
|
|
28111
28180
|
}
|
|
@@ -28118,18 +28187,18 @@ function frontDoorOrigin(state) {
|
|
|
28118
28187
|
}
|
|
28119
28188
|
function writeFrontDoorDirectRecord(fs30, recordsDir, record2) {
|
|
28120
28189
|
fs30.mkdirp(recordsDir);
|
|
28121
|
-
fs30.writeFilePrivate(
|
|
28190
|
+
fs30.writeFilePrivate(import_node_path6.default.join(recordsDir, `${String(record2.pid)}.json`), `${JSON.stringify({ directPort: record2.directPort })}
|
|
28122
28191
|
`);
|
|
28123
28192
|
}
|
|
28124
28193
|
function removeFrontDoorDirectRecord(fs30, recordsDir, pid) {
|
|
28125
|
-
fs30.removeRecursive(
|
|
28194
|
+
fs30.removeRecursive(import_node_path6.default.join(recordsDir, `${String(pid)}.json`));
|
|
28126
28195
|
}
|
|
28127
28196
|
function markFrontDoorDraining(fs30, markersDir, pid) {
|
|
28128
28197
|
fs30.mkdirp(markersDir);
|
|
28129
|
-
fs30.writeFilePrivate(
|
|
28198
|
+
fs30.writeFilePrivate(import_node_path6.default.join(markersDir, String(pid)), "\n");
|
|
28130
28199
|
}
|
|
28131
28200
|
function unmarkFrontDoorDraining(fs30, markersDir, pid) {
|
|
28132
|
-
fs30.removeRecursive(
|
|
28201
|
+
fs30.removeRecursive(import_node_path6.default.join(markersDir, String(pid)));
|
|
28133
28202
|
}
|
|
28134
28203
|
function listDrainingFrontDoors(fs30, markersDir, isRunning) {
|
|
28135
28204
|
return fs30.readdir(markersDir).flatMap((file2) => /^[1-9]\d*$/.test(file2) && Number.isSafeInteger(Number(file2)) ? [Number(file2)] : []).filter(isRunning).sort((a10, b) => a10 - b);
|
|
@@ -28146,7 +28215,7 @@ function readDirectRecordEntry(fs30, recordsDir, file2) {
|
|
|
28146
28215
|
}
|
|
28147
28216
|
let raw;
|
|
28148
28217
|
try {
|
|
28149
|
-
raw = fs30.readFileUtf8(
|
|
28218
|
+
raw = fs30.readFileUtf8(import_node_path6.default.join(recordsDir, file2));
|
|
28150
28219
|
} catch {
|
|
28151
28220
|
return void 0;
|
|
28152
28221
|
}
|
|
@@ -28171,7 +28240,7 @@ function pruneMalformedFrontDoorDirectFiles(fs30, recordsDir, isRunning) {
|
|
|
28171
28240
|
const writer = RECORD_TEMPORARY_FILE.exec(file2)?.[1];
|
|
28172
28241
|
const stale = writer !== void 0 && !isRunning(Number(writer));
|
|
28173
28242
|
if (stale || readDirectRecordEntry(fs30, recordsDir, file2)?.malformed === true) {
|
|
28174
|
-
fs30.removeRecursive(
|
|
28243
|
+
fs30.removeRecursive(import_node_path6.default.join(recordsDir, file2));
|
|
28175
28244
|
}
|
|
28176
28245
|
}
|
|
28177
28246
|
}
|
|
@@ -28190,7 +28259,7 @@ function recordOf(details) {
|
|
|
28190
28259
|
}
|
|
28191
28260
|
function writeFrontDoorSession(fs30, sessionsDir, session) {
|
|
28192
28261
|
fs30.mkdirPrivate(sessionsDir);
|
|
28193
|
-
fs30.writeFilePrivate(
|
|
28262
|
+
fs30.writeFilePrivate(import_node_path6.default.join(sessionsDir, `${String(session.pid)}.json`), `${JSON.stringify(session, null, 2)}
|
|
28194
28263
|
`);
|
|
28195
28264
|
}
|
|
28196
28265
|
function listFrontDoorSessions(fs30, sessionsDir) {
|
|
@@ -28200,7 +28269,7 @@ function listFrontDoorSessions(fs30, sessionsDir) {
|
|
|
28200
28269
|
continue;
|
|
28201
28270
|
}
|
|
28202
28271
|
try {
|
|
28203
|
-
const parsed = FrontDoorSessionSchema.safeParse(JSON.parse(fs30.readFileUtf8(
|
|
28272
|
+
const parsed = FrontDoorSessionSchema.safeParse(JSON.parse(fs30.readFileUtf8(import_node_path6.default.join(sessionsDir, name)) ?? ""));
|
|
28204
28273
|
if (parsed.success) {
|
|
28205
28274
|
sessions.push({ pid: parsed.data.pid, startedAt: parsed.data.startedAt, ...parsed.data.supervisorPid === void 0 ? {} : { supervisorPid: parsed.data.supervisorPid } });
|
|
28206
28275
|
}
|
|
@@ -28211,7 +28280,7 @@ function listFrontDoorSessions(fs30, sessionsDir) {
|
|
|
28211
28280
|
return sessions.sort((a10, b) => a10.pid - b.pid);
|
|
28212
28281
|
}
|
|
28213
28282
|
function removeFrontDoorSession(fs30, sessionsDir, pid) {
|
|
28214
|
-
fs30.removeRecursive(
|
|
28283
|
+
fs30.removeRecursive(import_node_path6.default.join(sessionsDir, `${String(pid)}.json`));
|
|
28215
28284
|
}
|
|
28216
28285
|
function pruneDeadFrontDoorSessions(fs30, sessionsDir, isRunning) {
|
|
28217
28286
|
const removed = [];
|
|
@@ -28230,7 +28299,7 @@ function liveSessionTokens(fs30, sessionsDir) {
|
|
|
28230
28299
|
continue;
|
|
28231
28300
|
}
|
|
28232
28301
|
try {
|
|
28233
|
-
const parsed = FrontDoorSessionSchema.safeParse(JSON.parse(fs30.readFileUtf8(
|
|
28302
|
+
const parsed = FrontDoorSessionSchema.safeParse(JSON.parse(fs30.readFileUtf8(import_node_path6.default.join(sessionsDir, name)) ?? ""));
|
|
28234
28303
|
if (parsed.success) {
|
|
28235
28304
|
tokens.add(parsed.data.token);
|
|
28236
28305
|
}
|
|
@@ -28246,7 +28315,7 @@ function readFrontDoorSessionModels(fs30, sessionsDir, sessionId) {
|
|
|
28246
28315
|
continue;
|
|
28247
28316
|
}
|
|
28248
28317
|
try {
|
|
28249
|
-
const parsed = FrontDoorSessionSchema.safeParse(JSON.parse(fs30.readFileUtf8(
|
|
28318
|
+
const parsed = FrontDoorSessionSchema.safeParse(JSON.parse(fs30.readFileUtf8(import_node_path6.default.join(sessionsDir, name)) ?? ""));
|
|
28250
28319
|
if (parsed.success && parsed.data.sessionId === sessionId) {
|
|
28251
28320
|
return parsed.data.models;
|
|
28252
28321
|
}
|
|
@@ -28256,11 +28325,11 @@ function readFrontDoorSessionModels(fs30, sessionsDir, sessionId) {
|
|
|
28256
28325
|
}
|
|
28257
28326
|
return void 0;
|
|
28258
28327
|
}
|
|
28259
|
-
var
|
|
28328
|
+
var import_node_path6, FRONT_DOOR_PROTOCOL, FrontDoorSessionSchema, FrontDoorStateSchema, MAX_TCP_PORT, FrontDoorDirectRecordSchema, RECORD_TEMPORARY_FILE;
|
|
28260
28329
|
var init_state = __esm({
|
|
28261
28330
|
"src/frontdoor/state.ts"() {
|
|
28262
28331
|
"use strict";
|
|
28263
|
-
|
|
28332
|
+
import_node_path6 = __toESM(require("node:path"), 1);
|
|
28264
28333
|
init_zod();
|
|
28265
28334
|
init_schema();
|
|
28266
28335
|
FRONT_DOOR_PROTOCOL = 5;
|
|
@@ -28317,7 +28386,7 @@ function readHeadroomState(fs30, stateFile) {
|
|
|
28317
28386
|
}
|
|
28318
28387
|
}
|
|
28319
28388
|
function writeHeadroomState(fs30, stateFile, state) {
|
|
28320
|
-
fs30.mkdirp(
|
|
28389
|
+
fs30.mkdirp(import_node_path7.default.dirname(stateFile));
|
|
28321
28390
|
fs30.writeFilePrivate(stateFile, `${JSON.stringify(state, null, 2)}
|
|
28322
28391
|
`);
|
|
28323
28392
|
}
|
|
@@ -28379,15 +28448,15 @@ function parseAllowlistFile(content) {
|
|
|
28379
28448
|
return content.replace(/^\uFEFF/, "").replace(ALLOWLIST_FILE_COMMENT, "").split(ALLOWLIST_FILE_SEPARATORS).map((entry) => entry.replace(ALLOWLIST_SURROUNDING_WHITESPACE, "")).filter((entry) => entry !== "" && !ALLOWLIST_ENTRY_WHITESPACE.test(entry) && (entry.includes("://") ? isAdmissibleUrl(entry) : isBareHost(entry)));
|
|
28380
28449
|
}
|
|
28381
28450
|
function writeAllowlistFile(fs30, allowlistFile, allowlist) {
|
|
28382
|
-
fs30.mkdirPrivate(
|
|
28451
|
+
fs30.mkdirPrivate(import_node_path7.default.dirname(allowlistFile));
|
|
28383
28452
|
fs30.writeFilePrivate(allowlistFile, formatAllowlistFile(allowlist));
|
|
28384
28453
|
}
|
|
28385
28454
|
function pruneStaleAllowlistTemporaries(fs30, allowlistFile, isRunning) {
|
|
28386
|
-
const prefix = `${
|
|
28387
|
-
for (const name of fs30.readdir(
|
|
28455
|
+
const prefix = `${import_node_path7.default.basename(allowlistFile)}.`;
|
|
28456
|
+
for (const name of fs30.readdir(import_node_path7.default.dirname(allowlistFile))) {
|
|
28388
28457
|
const writer = name.startsWith(prefix) ? /^([1-9]\d*)\.tmp$/.exec(name.slice(prefix.length))?.[1] : void 0;
|
|
28389
28458
|
if (writer !== void 0 && !isRunning(Number(writer))) {
|
|
28390
|
-
fs30.removeRecursive(
|
|
28459
|
+
fs30.removeRecursive(import_node_path7.default.join(import_node_path7.default.dirname(allowlistFile), name));
|
|
28391
28460
|
}
|
|
28392
28461
|
}
|
|
28393
28462
|
}
|
|
@@ -28398,7 +28467,7 @@ function readAllProviders(fs30, providersDir) {
|
|
|
28398
28467
|
continue;
|
|
28399
28468
|
}
|
|
28400
28469
|
try {
|
|
28401
|
-
const parsed = parseJson(fs30.readFileUtf8(
|
|
28470
|
+
const parsed = parseJson(fs30.readFileUtf8(import_node_path7.default.join(providersDir, name)), ProviderSchema);
|
|
28402
28471
|
if (parsed !== void 0) {
|
|
28403
28472
|
result.push({ name: name.slice(0, -".json".length), provider: parsed });
|
|
28404
28473
|
}
|
|
@@ -28410,11 +28479,11 @@ function readAllProviders(fs30, providersDir) {
|
|
|
28410
28479
|
}
|
|
28411
28480
|
function writeSession(fs30, sessionsDir, session) {
|
|
28412
28481
|
fs30.mkdirp(sessionsDir);
|
|
28413
|
-
fs30.writeFileUtf8(
|
|
28482
|
+
fs30.writeFileUtf8(import_node_path7.default.join(sessionsDir, `${String(session.pid)}.json`), `${JSON.stringify(session, null, 2)}
|
|
28414
28483
|
`);
|
|
28415
28484
|
}
|
|
28416
28485
|
function removeSession(fs30, sessionsDir, pid) {
|
|
28417
|
-
fs30.removeRecursive(
|
|
28486
|
+
fs30.removeRecursive(import_node_path7.default.join(sessionsDir, `${String(pid)}.json`));
|
|
28418
28487
|
}
|
|
28419
28488
|
function listSessions(fs30, sessionsDir) {
|
|
28420
28489
|
const sessions = [];
|
|
@@ -28423,7 +28492,7 @@ function listSessions(fs30, sessionsDir) {
|
|
|
28423
28492
|
continue;
|
|
28424
28493
|
}
|
|
28425
28494
|
try {
|
|
28426
|
-
const parsed = parseJson(fs30.readFileUtf8(
|
|
28495
|
+
const parsed = parseJson(fs30.readFileUtf8(import_node_path7.default.join(sessionsDir, name)), HeadroomSessionSchema);
|
|
28427
28496
|
if (parsed !== void 0) {
|
|
28428
28497
|
sessions.push(parsed);
|
|
28429
28498
|
}
|
|
@@ -28453,12 +28522,12 @@ function readStartLock(fs30, lockFile) {
|
|
|
28453
28522
|
return void 0;
|
|
28454
28523
|
}
|
|
28455
28524
|
}
|
|
28456
|
-
var import_node_crypto2,
|
|
28525
|
+
var import_node_crypto2, import_node_path7, HeadroomStateSchema, HeadroomSessionSchema, HeadroomLockSchema, HEADROOM_ALLOWLIST_FILE_FLAG, ALLOWLIST_LINE_BREAKS, ALLOWLIST_WHITESPACE, ALLOWLIST_FILE_SEPARATORS, ALLOWLIST_FILE_COMMENT, ALLOWLIST_ENTRY_WHITESPACE, ALLOWLIST_SURROUNDING_WHITESPACE, ALLOWLIST_SAFE_SCHEMES;
|
|
28457
28526
|
var init_state2 = __esm({
|
|
28458
28527
|
"src/headroom/state.ts"() {
|
|
28459
28528
|
"use strict";
|
|
28460
28529
|
import_node_crypto2 = require("node:crypto");
|
|
28461
|
-
|
|
28530
|
+
import_node_path7 = __toESM(require("node:path"), 1);
|
|
28462
28531
|
init_zod();
|
|
28463
28532
|
init_schema();
|
|
28464
28533
|
HeadroomStateSchema = external_exports.strictObject({
|
|
@@ -28737,10 +28806,10 @@ function redactBody(chunk2) {
|
|
|
28737
28806
|
}
|
|
28738
28807
|
}
|
|
28739
28808
|
function captureFromEnv(env, logsDir) {
|
|
28740
|
-
return env[CAPTURE_ENV] === "1" ? createFileCapture(
|
|
28809
|
+
return env[CAPTURE_ENV] === "1" ? createFileCapture(path8.join(logsDir, "frontdoor-capture.jsonl")) : void 0;
|
|
28741
28810
|
}
|
|
28742
28811
|
function createFileCapture(file2, now = () => /* @__PURE__ */ new Date()) {
|
|
28743
|
-
fs3.mkdirSync(
|
|
28812
|
+
fs3.mkdirSync(path8.dirname(file2), { recursive: true });
|
|
28744
28813
|
let nextId = 0;
|
|
28745
28814
|
const append = (record2) => {
|
|
28746
28815
|
fs3.appendFileSync(file2, `${JSON.stringify({ ts: now().toISOString(), ...record2 })}
|
|
@@ -28827,12 +28896,12 @@ function createFileCapture(file2, now = () => /* @__PURE__ */ new Date()) {
|
|
|
28827
28896
|
}
|
|
28828
28897
|
};
|
|
28829
28898
|
}
|
|
28830
|
-
var fs3,
|
|
28899
|
+
var fs3, path8, SECRET_HEADER_NAME, SECRET_JSON_KEY, SECRET_BODY_PATTERNS, CHUNK_LOG_CAP_BYTES, STREAM_LOG_CAP_BYTES, CAPTURE_FILE_MODE, CAPTURE_ENV;
|
|
28831
28900
|
var init_capture = __esm({
|
|
28832
28901
|
"src/frontdoor/capture.ts"() {
|
|
28833
28902
|
"use strict";
|
|
28834
28903
|
fs3 = __toESM(require("node:fs"), 1);
|
|
28835
|
-
|
|
28904
|
+
path8 = __toESM(require("node:path"), 1);
|
|
28836
28905
|
SECRET_HEADER_NAME = /authorization|cookie|token|secret|credential|api[-_]key/i;
|
|
28837
28906
|
SECRET_JSON_KEY = /token|secret|password|credential|authorization|api[-_]key/i;
|
|
28838
28907
|
SECRET_BODY_PATTERNS = [
|
|
@@ -28849,7 +28918,7 @@ var init_capture = __esm({
|
|
|
28849
28918
|
|
|
28850
28919
|
// src/headroom/socket.ts
|
|
28851
28920
|
function headroomSocketPath(paths, supervisorPid) {
|
|
28852
|
-
return
|
|
28921
|
+
return import_node_path8.default.join(paths.headroomSocketDir, `${String(supervisorPid)}${HEADROOM_SOCKET_SUFFIX}`);
|
|
28853
28922
|
}
|
|
28854
28923
|
function platformRefusal(platform) {
|
|
28855
28924
|
return PLATFORMS_WITHOUT_UNIX_SOCKETS.includes(platform) ? `headroom routing needs a unix domain socket, which headroom cannot serve on ${platform}; agent-shim never falls back to a TCP port for this hop` : void 0;
|
|
@@ -28878,7 +28947,7 @@ function verifyHeadroomSocket(socketPath, ports) {
|
|
|
28878
28947
|
return { refused: unsupported };
|
|
28879
28948
|
}
|
|
28880
28949
|
const uid = ports.currentUid();
|
|
28881
|
-
const directory =
|
|
28950
|
+
const directory = import_node_path8.default.dirname(socketPath);
|
|
28882
28951
|
const refusal2 = ownerOnlyRefusal("socket directory", directory, ports.lstat(directory), "dir", uid) ?? ownerOnlyRefusal("socket", socketPath, ports.lstat(socketPath), "socket", uid);
|
|
28883
28952
|
return refusal2 === void 0 ? { socketPath } : { refused: refusal2 };
|
|
28884
28953
|
}
|
|
@@ -28892,20 +28961,20 @@ function pathDirectories(target, ports) {
|
|
|
28892
28961
|
continue;
|
|
28893
28962
|
}
|
|
28894
28963
|
if (name === "..") {
|
|
28895
|
-
current =
|
|
28964
|
+
current = import_node_path8.default.dirname(current);
|
|
28896
28965
|
continue;
|
|
28897
28966
|
}
|
|
28898
28967
|
if (!directories.includes(current)) {
|
|
28899
28968
|
directories.push(current);
|
|
28900
28969
|
}
|
|
28901
|
-
const entry =
|
|
28970
|
+
const entry = import_node_path8.default.join(current, name);
|
|
28902
28971
|
if (pending.length > 0 && ports.lstat(entry)?.kind === "symlink") {
|
|
28903
28972
|
hops += 1;
|
|
28904
28973
|
if (hops > MAX_SYMLINK_HOPS) {
|
|
28905
28974
|
return `the symlinks on the allowlist file's path go more than ${String(MAX_SYMLINK_HOPS)} deep`;
|
|
28906
28975
|
}
|
|
28907
28976
|
const linkTarget = ports.readlink(entry);
|
|
28908
|
-
if (
|
|
28977
|
+
if (import_node_path8.default.isAbsolute(linkTarget)) {
|
|
28909
28978
|
current = "/";
|
|
28910
28979
|
}
|
|
28911
28980
|
pending.push(...linkTarget.split("/").reverse());
|
|
@@ -28938,7 +29007,7 @@ function verifyAllowlistFile(allowlistFile, ports) {
|
|
|
28938
29007
|
return { message: directories, repairable: false };
|
|
28939
29008
|
}
|
|
28940
29009
|
const socketDirectory = directories.at(-1);
|
|
28941
|
-
const headroomDirectory = socketDirectory === void 0 ? void 0 :
|
|
29010
|
+
const headroomDirectory = socketDirectory === void 0 ? void 0 : import_node_path8.default.dirname(socketDirectory);
|
|
28942
29011
|
for (const directory of directories) {
|
|
28943
29012
|
const stat = ports.lstat(directory);
|
|
28944
29013
|
if (directory === socketDirectory) {
|
|
@@ -28988,16 +29057,16 @@ function pruneStaleHeadroomSockets(fs30, paths, isRunning) {
|
|
|
28988
29057
|
if (pid === void 0 || isRunning(Number.parseInt(pid, 10))) {
|
|
28989
29058
|
continue;
|
|
28990
29059
|
}
|
|
28991
|
-
fs30.removeRecursive(
|
|
29060
|
+
fs30.removeRecursive(import_node_path8.default.join(paths.headroomSocketDir, name));
|
|
28992
29061
|
removed.push(name);
|
|
28993
29062
|
}
|
|
28994
29063
|
return removed;
|
|
28995
29064
|
}
|
|
28996
|
-
var
|
|
29065
|
+
var import_node_path8, GROUP_OR_OTHER_BITS, OCTAL_RADIX, MODE_DIGITS, HEADROOM_SOCKET_SUFFIX, HEADROOM_SOCKET_NAME, UNIX_SOCKET_PATH_MAX_BYTES, PLATFORMS_WITHOUT_UNIX_SOCKETS, KIND_NAMES, MAX_SYMLINK_HOPS, ROOT_UID, GROUP_OR_OTHER_WRITE_BITS, STICKY_BIT, MOVE_ROOT_REMEDY;
|
|
28997
29066
|
var init_socket = __esm({
|
|
28998
29067
|
"src/headroom/socket.ts"() {
|
|
28999
29068
|
"use strict";
|
|
29000
|
-
|
|
29069
|
+
import_node_path8 = __toESM(require("node:path"), 1);
|
|
29001
29070
|
GROUP_OR_OTHER_BITS = 63;
|
|
29002
29071
|
OCTAL_RADIX = 8;
|
|
29003
29072
|
MODE_DIGITS = 4;
|
|
@@ -29184,7 +29253,7 @@ async function runSupervisor(initialConfig, ports, options = {}) {
|
|
|
29184
29253
|
ports.log(`agent-shim headroom supervisor: repairing the allowlist file: ${problem.message}`);
|
|
29185
29254
|
try {
|
|
29186
29255
|
fs30.mkdirPrivate(paths.headroomDir);
|
|
29187
|
-
fs30.mkdirPrivate(
|
|
29256
|
+
fs30.mkdirPrivate(import_node_path9.default.dirname(paths.headroomAllowlistFile));
|
|
29188
29257
|
writeAllowlistFile(fs30, paths.headroomAllowlistFile, allowlist);
|
|
29189
29258
|
} catch (error63) {
|
|
29190
29259
|
return `could not write the headroom allowlist file ${paths.headroomAllowlistFile}: ${error63 instanceof Error ? error63.message : String(error63)}`;
|
|
@@ -29406,11 +29475,11 @@ function lastLines(output2) {
|
|
|
29406
29475
|
const lines = redactText(output2).split("\n").map((line) => line.trim()).filter((line) => line !== "").map((line) => line.length > DAEMON_EXIT_LOG_LINE_CHARS ? `${line.slice(0, DAEMON_EXIT_LOG_LINE_CHARS)}...` : line);
|
|
29407
29476
|
return lines.length === 0 ? "(the daemon wrote nothing)" : lines.slice(-DAEMON_EXIT_LOG_LINES).join(" | ");
|
|
29408
29477
|
}
|
|
29409
|
-
var
|
|
29478
|
+
var import_node_path9, HEADROOM_BACKOFF_BASE_MS, HEADROOM_BACKOFF_CAP_MS, HEADROOM_START_RETRY_BUDGET, HEADROOM_READY_TIMEOUT_MS, DAEMON_EXIT_LOG_LINES, DAEMON_EXIT_LOG_LINE_CHARS, DAEMON_LOG_TAIL_BYTES, HEADROOM_POLL_MS, MS_PER_MINUTE, STOP_POLL_MS, TERM_GRACE_MS, KILL_GRACE_MS, HEADROOM_SUPERVISOR_STILL_RUNNING;
|
|
29410
29479
|
var init_supervisor = __esm({
|
|
29411
29480
|
"src/headroom/supervisor.ts"() {
|
|
29412
29481
|
"use strict";
|
|
29413
|
-
|
|
29482
|
+
import_node_path9 = __toESM(require("node:path"), 1);
|
|
29414
29483
|
init_schema();
|
|
29415
29484
|
init_state();
|
|
29416
29485
|
init_settings();
|
|
@@ -29617,7 +29686,7 @@ async function realRunAsync(command, args) {
|
|
|
29617
29686
|
});
|
|
29618
29687
|
}
|
|
29619
29688
|
function expandHome(filePath) {
|
|
29620
|
-
return filePath.startsWith("~/") ?
|
|
29689
|
+
return filePath.startsWith("~/") ? import_node_path10.default.join(import_node_os2.default.homedir(), filePath.slice(1)) : filePath;
|
|
29621
29690
|
}
|
|
29622
29691
|
function hasDesktopSession() {
|
|
29623
29692
|
if (process.platform === "darwin") {
|
|
@@ -29720,7 +29789,7 @@ function spawnDaemonThroughScript(script) {
|
|
|
29720
29789
|
return (paths, subcommand, logPath) => spawnDetachedDaemon({ command: process.execPath, args: [script, subcommand] }, paths, subcommand, logPath);
|
|
29721
29790
|
}
|
|
29722
29791
|
function spawnDetachedDaemon(invocation, paths, subcommand, logPath) {
|
|
29723
|
-
import_node_fs3.default.mkdirSync(
|
|
29792
|
+
import_node_fs3.default.mkdirSync(import_node_path10.default.dirname(logPath), { recursive: true });
|
|
29724
29793
|
const logFd = import_node_fs3.default.openSync(logPath, "a");
|
|
29725
29794
|
try {
|
|
29726
29795
|
const child = (0, import_node_child_process3.spawn)(invocation.command, invocation.args, detachedDaemonSpawnOptions(logFd, { ...process.env, AGENT_SHIM_HOME: paths.root }));
|
|
@@ -29774,7 +29843,7 @@ function listVersionsDir(dir) {
|
|
|
29774
29843
|
throw error63;
|
|
29775
29844
|
}
|
|
29776
29845
|
return entries.filter((entry) => entry.isFile()).map((entry) => {
|
|
29777
|
-
const fullPath =
|
|
29846
|
+
const fullPath = import_node_path10.default.join(dir, entry.name);
|
|
29778
29847
|
const stat = import_node_fs3.default.statSync(fullPath);
|
|
29779
29848
|
return {
|
|
29780
29849
|
name: entry.name,
|
|
@@ -29788,7 +29857,7 @@ function windowsPathExtensions(pathext) {
|
|
|
29788
29857
|
return (pathext ?? WINDOWS_DEFAULT_PATHEXT).split(";").map((ext) => ext.trim()).filter((ext) => ext.length > 0);
|
|
29789
29858
|
}
|
|
29790
29859
|
function resolveExecutableCandidate(dir, name, env) {
|
|
29791
|
-
const candidate =
|
|
29860
|
+
const candidate = import_node_path10.default.join(dir, name);
|
|
29792
29861
|
if (env.platform === "win32") {
|
|
29793
29862
|
const extensions = windowsPathExtensions(env.pathext);
|
|
29794
29863
|
const alreadyHasRecognisedExtension = extensions.some((ext) => candidate.toLowerCase().endsWith(ext.toLowerCase()));
|
|
@@ -29837,13 +29906,13 @@ function resolveOwnExecutablePath(env) {
|
|
|
29837
29906
|
if (env.argv1 !== void 0 && !env.argv1.includes("/") && !env.argv1.includes("\\")) {
|
|
29838
29907
|
return searchPathForExecutable(env.pathDirs, env.argv1, env.findExecutableInDir) ?? env.execPath;
|
|
29839
29908
|
}
|
|
29840
|
-
const candidate = env.argv1 === void 0 ? env.execPath :
|
|
29841
|
-
const candidateDir =
|
|
29842
|
-
const candidateDirOnPath = env.pathDirs.some((dir) =>
|
|
29909
|
+
const candidate = env.argv1 === void 0 ? env.execPath : import_node_path10.default.resolve(env.cwd, env.argv1);
|
|
29910
|
+
const candidateDir = import_node_path10.default.dirname(candidate);
|
|
29911
|
+
const candidateDirOnPath = env.pathDirs.some((dir) => import_node_path10.default.resolve(dir) === candidateDir);
|
|
29843
29912
|
if (candidateDirOnPath) {
|
|
29844
29913
|
return candidate;
|
|
29845
29914
|
}
|
|
29846
|
-
const viaPath = searchPathForExecutable(env.pathDirs,
|
|
29915
|
+
const viaPath = searchPathForExecutable(env.pathDirs, import_node_path10.default.basename(candidate), env.findExecutableInDir);
|
|
29847
29916
|
return viaPath ?? candidate;
|
|
29848
29917
|
}
|
|
29849
29918
|
function realOwnExecutablePath() {
|
|
@@ -29851,7 +29920,7 @@ function realOwnExecutablePath() {
|
|
|
29851
29920
|
argv1: process.argv[1],
|
|
29852
29921
|
execPath: process.execPath,
|
|
29853
29922
|
cwd: process.cwd(),
|
|
29854
|
-
pathDirs: (process.env.PATH ?? "").split(
|
|
29923
|
+
pathDirs: (process.env.PATH ?? "").split(import_node_path10.default.delimiter).filter((dir) => dir !== ""),
|
|
29855
29924
|
findExecutableInDir
|
|
29856
29925
|
});
|
|
29857
29926
|
}
|
|
@@ -29864,7 +29933,7 @@ function realContentSourcePath() {
|
|
|
29864
29933
|
function realResolveClaudeBinary(isOwnBinary) {
|
|
29865
29934
|
return (request7) => discoverClaudeBinary({
|
|
29866
29935
|
listVersionsDir,
|
|
29867
|
-
pathDirs: (process.env.PATH ?? "").split(
|
|
29936
|
+
pathDirs: (process.env.PATH ?? "").split(import_node_path10.default.delimiter).filter((dir) => dir !== ""),
|
|
29868
29937
|
findExecutableInDir,
|
|
29869
29938
|
isOwnBinary,
|
|
29870
29939
|
...request7?.version === void 0 ? {} : { version: request7.version }
|
|
@@ -29873,7 +29942,7 @@ function realResolveClaudeBinary(isOwnBinary) {
|
|
|
29873
29942
|
function realInstalledClaudeVersions() {
|
|
29874
29943
|
return installedVersions(listVersionsDir(defaultVersionsDir()));
|
|
29875
29944
|
}
|
|
29876
|
-
var import_node_child_process3, import_node_crypto4, import_node_fs3, import_node_os2,
|
|
29945
|
+
var import_node_child_process3, import_node_crypto4, import_node_fs3, import_node_os2, import_node_path10, import_node_sea, realFsPort, OWNER_ONLY_DIR_MODE, OWNER_ONLY_FILE_MODE, PERMISSION_BITS, realFarmFs, INT32_BYTE_LENGTH, KEY_POLL_MS, CTRL_C_BYTE, realHoldPort, LINE_FEED, UTF8_CONTINUATION_MASK, UTF8_CONTINUATION_BITS, PS_TIMEOUT_MS, realRunPort, MACOS_GUI_SESSION_MANAGER, realCredentialPort, realAsyncCredentialPort, SOCKET_PERMISSION_BITS, realHeadroomSocketTrust, realSpawnPort, realProcPort, realLogPort, EXECUTE_BITS_MASK, WINDOWS_DEFAULT_PATHEXT;
|
|
29877
29946
|
var init_realPorts = __esm({
|
|
29878
29947
|
"src/realPorts.ts"() {
|
|
29879
29948
|
"use strict";
|
|
@@ -29883,7 +29952,7 @@ var init_realPorts = __esm({
|
|
|
29883
29952
|
import_node_crypto4 = require("node:crypto");
|
|
29884
29953
|
import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
29885
29954
|
import_node_os2 = __toESM(require("node:os"), 1);
|
|
29886
|
-
|
|
29955
|
+
import_node_path10 = __toESM(require("node:path"), 1);
|
|
29887
29956
|
import_node_sea = require("node:sea");
|
|
29888
29957
|
init_load();
|
|
29889
29958
|
init_versionDiscovery();
|
|
@@ -30157,10 +30226,10 @@ function isInvokedAsClaude(invokedName) {
|
|
|
30157
30226
|
}
|
|
30158
30227
|
function resolveOwnBinaryCheck(paths, contentSourcePath) {
|
|
30159
30228
|
const state = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
|
|
30160
|
-
const recordedTarget = state === void 0 ? void 0 :
|
|
30229
|
+
const recordedTarget = state === void 0 ? void 0 : import_node_path11.default.resolve(state.targetPath);
|
|
30161
30230
|
let ownStat;
|
|
30162
30231
|
return (candidate) => {
|
|
30163
|
-
if (recordedTarget !== void 0 &&
|
|
30232
|
+
if (recordedTarget !== void 0 && import_node_path11.default.resolve(candidate) === recordedTarget) {
|
|
30164
30233
|
return true;
|
|
30165
30234
|
}
|
|
30166
30235
|
ownStat ??= statOrUndefined(contentSourcePath);
|
|
@@ -30170,7 +30239,7 @@ function resolveOwnBinaryCheck(paths, contentSourcePath) {
|
|
|
30170
30239
|
};
|
|
30171
30240
|
}
|
|
30172
30241
|
function resolveClaudeTargetPath(ownExecutablePath, dir) {
|
|
30173
|
-
return
|
|
30242
|
+
return import_node_path11.default.join(dir ?? import_node_path11.default.dirname(ownExecutablePath), claudeTargetFilename(ownExecutablePath));
|
|
30174
30243
|
}
|
|
30175
30244
|
function isEnoent3(error63) {
|
|
30176
30245
|
return typeof error63 === "object" && error63 !== null && "code" in error63 && error63.code === "ENOENT";
|
|
@@ -30204,13 +30273,13 @@ function enableClaudeShim(params, linkFs = nodeLinkFs) {
|
|
|
30204
30273
|
throw new UnsupportedShimSourceError(realContentPath);
|
|
30205
30274
|
}
|
|
30206
30275
|
const targetPath = resolveClaudeTargetPath(params.ownExecutablePath, params.dir);
|
|
30207
|
-
import_node_fs4.default.mkdirSync(
|
|
30276
|
+
import_node_fs4.default.mkdirSync(import_node_path11.default.dirname(targetPath), { recursive: true });
|
|
30208
30277
|
const existing = lstatOrUndefined(targetPath);
|
|
30209
30278
|
if (existing !== void 0) {
|
|
30210
30279
|
const ownStat = import_node_fs4.default.statSync(realContentPath);
|
|
30211
30280
|
const state = readJson(params.paths.claudeShimFile, ClaudeShimStateSchema);
|
|
30212
30281
|
const sameInode = existing.dev === ownStat.dev && existing.ino === ownStat.ino;
|
|
30213
|
-
const markerMatches = state !== void 0 &&
|
|
30282
|
+
const markerMatches = state !== void 0 && import_node_path11.default.resolve(state.targetPath) === targetPath;
|
|
30214
30283
|
if (!sameInode && !markerMatches && !params.force) {
|
|
30215
30284
|
throw new ForeignClaudeEntryError(targetPath, "enable");
|
|
30216
30285
|
}
|
|
@@ -30235,7 +30304,7 @@ function enableClaudeShim(params, linkFs = nodeLinkFs) {
|
|
|
30235
30304
|
function disableClaudeShim(params) {
|
|
30236
30305
|
const realContentPath = import_node_fs4.default.realpathSync(params.contentSourcePath);
|
|
30237
30306
|
const state = readJson(params.paths.claudeShimFile, ClaudeShimStateSchema);
|
|
30238
|
-
const targetPath = params.dir !== void 0 ?
|
|
30307
|
+
const targetPath = params.dir !== void 0 ? import_node_path11.default.join(params.dir, claudeTargetFilename(params.ownExecutablePath)) : state?.targetPath ?? resolveClaudeTargetPath(params.ownExecutablePath);
|
|
30239
30308
|
const existing = lstatOrUndefined(targetPath);
|
|
30240
30309
|
if (existing === void 0) {
|
|
30241
30310
|
if (state !== void 0) {
|
|
@@ -30245,7 +30314,7 @@ function disableClaudeShim(params) {
|
|
|
30245
30314
|
}
|
|
30246
30315
|
const ownStat = import_node_fs4.default.statSync(realContentPath);
|
|
30247
30316
|
const sameInode = existing.dev === ownStat.dev && existing.ino === ownStat.ino;
|
|
30248
|
-
const markerMatches = state !== void 0 &&
|
|
30317
|
+
const markerMatches = state !== void 0 && import_node_path11.default.resolve(state.targetPath) === targetPath;
|
|
30249
30318
|
if (!sameInode && !markerMatches && !params.force) {
|
|
30250
30319
|
throw new ForeignClaudeEntryError(targetPath, "disable");
|
|
30251
30320
|
}
|
|
@@ -30254,15 +30323,15 @@ function disableClaudeShim(params) {
|
|
|
30254
30323
|
return { action: "disabled", targetPath };
|
|
30255
30324
|
}
|
|
30256
30325
|
function findPathShadow(params) {
|
|
30257
|
-
const resolvedTargetDir =
|
|
30326
|
+
const resolvedTargetDir = import_node_path11.default.resolve(params.targetDir);
|
|
30258
30327
|
for (const dir of params.pathDirs) {
|
|
30259
30328
|
const found = params.findExecutableInDir(dir, params.targetFilename);
|
|
30260
30329
|
if (found === void 0) {
|
|
30261
30330
|
continue;
|
|
30262
30331
|
}
|
|
30263
|
-
return
|
|
30332
|
+
return import_node_path11.default.resolve(dir) === resolvedTargetDir ? { status: "ok" } : { status: "shadowed", by: found };
|
|
30264
30333
|
}
|
|
30265
|
-
return params.pathDirs.some((dir) =>
|
|
30334
|
+
return params.pathDirs.some((dir) => import_node_path11.default.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
|
|
30266
30335
|
}
|
|
30267
30336
|
function registerShimCommand(program2, deps) {
|
|
30268
30337
|
const { paths } = deps;
|
|
@@ -30280,21 +30349,21 @@ function registerShimCommand(program2, deps) {
|
|
|
30280
30349
|
ownExecutablePath,
|
|
30281
30350
|
contentSourcePath,
|
|
30282
30351
|
platform: process.platform,
|
|
30283
|
-
...options.dir === void 0 ? {} : { dir:
|
|
30352
|
+
...options.dir === void 0 ? {} : { dir: import_node_path11.default.resolve(options.dir) },
|
|
30284
30353
|
force: options.force ?? false
|
|
30285
30354
|
});
|
|
30286
30355
|
console.log(`${result.action === "enabled" ? "Installed" : "Reinstalled"} \`claude\` at ${result.targetPath} (${result.method}).`);
|
|
30287
30356
|
const shadow = findPathShadow({
|
|
30288
|
-
pathDirs: (process.env.PATH ?? "").split(
|
|
30289
|
-
targetDir:
|
|
30290
|
-
targetFilename:
|
|
30357
|
+
pathDirs: (process.env.PATH ?? "").split(import_node_path11.default.delimiter).filter((dir) => dir !== ""),
|
|
30358
|
+
targetDir: import_node_path11.default.dirname(result.targetPath),
|
|
30359
|
+
targetFilename: import_node_path11.default.basename(result.targetPath),
|
|
30291
30360
|
findExecutableInDir
|
|
30292
30361
|
});
|
|
30293
30362
|
if (shadow.status === "not-on-path") {
|
|
30294
|
-
console.warn(`warning: ${
|
|
30363
|
+
console.warn(`warning: ${import_node_path11.default.dirname(result.targetPath)} is not on PATH \u2014 add it, or use \`agent-shim run\` instead.`);
|
|
30295
30364
|
} else if (shadow.status === "shadowed") {
|
|
30296
30365
|
console.warn(
|
|
30297
|
-
`warning: 'claude' on PATH currently resolves to ${shadow.by}, not ${result.targetPath}. Put ${
|
|
30366
|
+
`warning: 'claude' on PATH currently resolves to ${shadow.by}, not ${result.targetPath}. Put ${import_node_path11.default.dirname(result.targetPath)} ahead of it on PATH.`
|
|
30298
30367
|
);
|
|
30299
30368
|
}
|
|
30300
30369
|
});
|
|
@@ -30306,7 +30375,7 @@ function registerShimCommand(program2, deps) {
|
|
|
30306
30375
|
paths,
|
|
30307
30376
|
ownExecutablePath,
|
|
30308
30377
|
contentSourcePath,
|
|
30309
|
-
...options.dir === void 0 ? {} : { dir:
|
|
30378
|
+
...options.dir === void 0 ? {} : { dir: import_node_path11.default.resolve(options.dir) },
|
|
30310
30379
|
force: options.force ?? false
|
|
30311
30380
|
});
|
|
30312
30381
|
console.log(
|
|
@@ -30315,12 +30384,12 @@ function registerShimCommand(program2, deps) {
|
|
|
30315
30384
|
});
|
|
30316
30385
|
withExamples(disable, ["agent-shim shim disable"]);
|
|
30317
30386
|
}
|
|
30318
|
-
var import_node_fs4,
|
|
30387
|
+
var import_node_fs4, import_node_path11, EXECUTABLE_FILE_MODE, ClaudeShimStateSchema, ForeignClaudeEntryError, UnsupportedShimSourceError, nodeLinkFs;
|
|
30319
30388
|
var init_claudeShim = __esm({
|
|
30320
30389
|
"src/claudeShim.ts"() {
|
|
30321
30390
|
"use strict";
|
|
30322
30391
|
import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
30323
|
-
|
|
30392
|
+
import_node_path11 = __toESM(require("node:path"), 1);
|
|
30324
30393
|
init_zod();
|
|
30325
30394
|
init_commandDeps();
|
|
30326
30395
|
init_store();
|
|
@@ -30718,8 +30787,8 @@ var require_utils = __commonJS({
|
|
|
30718
30787
|
}
|
|
30719
30788
|
return output2;
|
|
30720
30789
|
};
|
|
30721
|
-
exports2.basename = (
|
|
30722
|
-
const segs =
|
|
30790
|
+
exports2.basename = (path70, { windows } = {}) => {
|
|
30791
|
+
const segs = path70.split(windows ? /[\\/]/ : "/");
|
|
30723
30792
|
const last = segs[segs.length - 1];
|
|
30724
30793
|
if (last === "") {
|
|
30725
30794
|
return segs[segs.length - 2];
|
|
@@ -32402,6 +32471,9 @@ function isNonEmpty(value2) {
|
|
|
32402
32471
|
return value2 !== void 0 && value2 !== "";
|
|
32403
32472
|
}
|
|
32404
32473
|
function selected(selector, source) {
|
|
32474
|
+
if (!IdentitySelectorSchema.safeParse(selector).success) {
|
|
32475
|
+
throw new UnsafeNameError(selector, "identity", `${FILE_NAME_RULE}, or be pool:<name> for a pool`, IDENTITY_SOURCE_LABELS[source]);
|
|
32476
|
+
}
|
|
32405
32477
|
const pool = poolNameOf(selector);
|
|
32406
32478
|
return pool === void 0 ? { name: selector, source, configDirEscapeHatch: false } : { pool, source, configDirEscapeHatch: false };
|
|
32407
32479
|
}
|
|
@@ -32443,14 +32515,18 @@ function decideConfigProfile(params) {
|
|
|
32443
32515
|
return { source: "none" };
|
|
32444
32516
|
}
|
|
32445
32517
|
function loadIdentity(identitiesDir, name, fs30) {
|
|
32446
|
-
|
|
32518
|
+
if (!isFileName(name)) {
|
|
32519
|
+
throw new UnsafeNameError(name, "identity", FILE_NAME_RULE);
|
|
32520
|
+
}
|
|
32521
|
+
return loadConfigFile(import_node_path12.default.join(identitiesDir, name, "identity.json"), IdentitySchema, fs30.readConfigFile);
|
|
32447
32522
|
}
|
|
32448
|
-
var
|
|
32523
|
+
var import_node_path12, IDENTITY_DECISION_SOURCES, IDENTITY_SOURCE_LABELS, CONFIG_PROFILE_DECISION_SOURCES;
|
|
32449
32524
|
var init_identity = __esm({
|
|
32450
32525
|
"src/launcher/identity.ts"() {
|
|
32451
32526
|
"use strict";
|
|
32452
|
-
|
|
32527
|
+
import_node_path12 = __toESM(require("node:path"), 1);
|
|
32453
32528
|
init_load();
|
|
32529
|
+
init_names();
|
|
32454
32530
|
init_schema();
|
|
32455
32531
|
IDENTITY_DECISION_SOURCES = [
|
|
32456
32532
|
/** `CLAUDE_CONFIG_DIR` was already set: identity resolution is skipped entirely and the real binary uses whatever it already points to. */
|
|
@@ -32466,6 +32542,14 @@ var init_identity = __esm({
|
|
|
32466
32542
|
/** Nothing resolved an identity at all — a bare launch with no active identity. */
|
|
32467
32543
|
"none"
|
|
32468
32544
|
];
|
|
32545
|
+
IDENTITY_SOURCE_LABELS = {
|
|
32546
|
+
"config-dir-escape-hatch": "CLAUDE_CONFIG_DIR",
|
|
32547
|
+
argv: "the identity named on the command line",
|
|
32548
|
+
env: "AGENT_SHIM_IDENTITY",
|
|
32549
|
+
"directory-pin": "a directory rule",
|
|
32550
|
+
"active-identity-file": "the active-identity file",
|
|
32551
|
+
none: "nothing"
|
|
32552
|
+
};
|
|
32469
32553
|
CONFIG_PROFILE_DECISION_SOURCES = [
|
|
32470
32554
|
/** An explicit `--config-profile` CLI flag. */
|
|
32471
32555
|
"cli-flag",
|
|
@@ -32484,9 +32568,9 @@ var init_identity = __esm({
|
|
|
32484
32568
|
});
|
|
32485
32569
|
|
|
32486
32570
|
// src/statusline/keys.ts
|
|
32487
|
-
function valueAt(source,
|
|
32571
|
+
function valueAt(source, path70) {
|
|
32488
32572
|
let current = source;
|
|
32489
|
-
for (const part of
|
|
32573
|
+
for (const part of path70) {
|
|
32490
32574
|
if (!isPlainObject2(current)) {
|
|
32491
32575
|
return void 0;
|
|
32492
32576
|
}
|
|
@@ -32494,10 +32578,10 @@ function valueAt(source, path72) {
|
|
|
32494
32578
|
}
|
|
32495
32579
|
return current;
|
|
32496
32580
|
}
|
|
32497
|
-
function keyOf(
|
|
32581
|
+
function keyOf(path70, declared) {
|
|
32498
32582
|
const optional2 = declared instanceof external_exports.ZodOptional;
|
|
32499
32583
|
const leaf = optional2 ? declared.unwrap() : declared;
|
|
32500
|
-
const common = { path:
|
|
32584
|
+
const common = { path: path70.join("."), description: declared.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path70), optional: optional2 };
|
|
32501
32585
|
if (leaf instanceof external_exports.ZodNumber) {
|
|
32502
32586
|
return { ...common, kind: "integer", choices: [] };
|
|
32503
32587
|
}
|
|
@@ -32516,7 +32600,7 @@ function keyOf(path72, declared) {
|
|
|
32516
32600
|
if (leaf instanceof external_exports.ZodArray && leaf.element instanceof external_exports.ZodEnum) {
|
|
32517
32601
|
return { ...common, kind: "list", choices: Object.values(leaf.element.enum).map(String) };
|
|
32518
32602
|
}
|
|
32519
|
-
throw new TypeError(`statusline setting ${
|
|
32603
|
+
throw new TypeError(`statusline setting ${path70.join(".")} has a kind the key listing does not describe`);
|
|
32520
32604
|
}
|
|
32521
32605
|
function walk(shape, prefix) {
|
|
32522
32606
|
return Object.entries(shape).flatMap(([name, schema]) => schema instanceof external_exports.ZodObject ? walk(schema.shape, [...prefix, name]) : [keyOf([...prefix, name], schema)]);
|
|
@@ -32540,10 +32624,10 @@ var init_keys = __esm({
|
|
|
32540
32624
|
});
|
|
32541
32625
|
|
|
32542
32626
|
// src/statusline/change.ts
|
|
32543
|
-
function keyNamed(
|
|
32544
|
-
const found = statuslineKeys().find((key) => key.path ===
|
|
32627
|
+
function keyNamed(path70) {
|
|
32628
|
+
const found = statuslineKeys().find((key) => key.path === path70);
|
|
32545
32629
|
if (found === void 0) {
|
|
32546
|
-
throw new UsageError(`"${
|
|
32630
|
+
throw new UsageError(`"${path70}" is not a statusline setting; \`agent-shim statusline keys\` lists them.`);
|
|
32547
32631
|
}
|
|
32548
32632
|
return found;
|
|
32549
32633
|
}
|
|
@@ -32552,38 +32636,38 @@ function parseStatuslineAssignment(text5) {
|
|
|
32552
32636
|
if (split < 1) {
|
|
32553
32637
|
throw new UsageError(`"${text5}" is not <setting>=<value>.`);
|
|
32554
32638
|
}
|
|
32555
|
-
const
|
|
32639
|
+
const path70 = text5.slice(0, split);
|
|
32556
32640
|
const raw = text5.slice(split + 1);
|
|
32557
|
-
const key = keyNamed(
|
|
32641
|
+
const key = keyNamed(path70);
|
|
32558
32642
|
if (key.optional && raw === UNSET_WORD) {
|
|
32559
|
-
return { path:
|
|
32643
|
+
return { path: path70, value: null };
|
|
32560
32644
|
}
|
|
32561
32645
|
switch (key.kind) {
|
|
32562
32646
|
case "integer": {
|
|
32563
32647
|
const number6 = Number(raw);
|
|
32564
32648
|
if (raw.trim() === "" || !Number.isFinite(number6)) {
|
|
32565
|
-
throw new UsageError(`${
|
|
32649
|
+
throw new UsageError(`${path70}: "${raw}" is not a number.`);
|
|
32566
32650
|
}
|
|
32567
|
-
return { path:
|
|
32651
|
+
return { path: path70, value: number6 };
|
|
32568
32652
|
}
|
|
32569
32653
|
case "boolean":
|
|
32570
32654
|
if (raw !== "true" && raw !== "false") {
|
|
32571
|
-
throw new UsageError(`${
|
|
32655
|
+
throw new UsageError(`${path70}: "${raw}" is not true or false.`);
|
|
32572
32656
|
}
|
|
32573
|
-
return { path:
|
|
32657
|
+
return { path: path70, value: raw === "true" };
|
|
32574
32658
|
case "text":
|
|
32575
32659
|
case "choice":
|
|
32576
|
-
return { path:
|
|
32660
|
+
return { path: path70, value: raw };
|
|
32577
32661
|
case "colour":
|
|
32578
|
-
return { path:
|
|
32662
|
+
return { path: path70, value: /^\d+$/.test(raw) ? Number(raw) : raw };
|
|
32579
32663
|
case "list":
|
|
32580
|
-
return { path:
|
|
32664
|
+
return { path: path70, value: raw === "" ? [] : raw.split(",") };
|
|
32581
32665
|
default:
|
|
32582
32666
|
return key.kind;
|
|
32583
32667
|
}
|
|
32584
32668
|
}
|
|
32585
|
-
function setAt(target,
|
|
32586
|
-
const [head, ...rest] =
|
|
32669
|
+
function setAt(target, path70, value2) {
|
|
32670
|
+
const [head, ...rest] = path70;
|
|
32587
32671
|
if (head === void 0) {
|
|
32588
32672
|
return;
|
|
32589
32673
|
}
|
|
@@ -32596,8 +32680,8 @@ function setAt(target, path72, value2) {
|
|
|
32596
32680
|
target[head] = next;
|
|
32597
32681
|
setAt(next, rest, value2);
|
|
32598
32682
|
}
|
|
32599
|
-
function removeAt(target,
|
|
32600
|
-
const [head, ...rest] =
|
|
32683
|
+
function removeAt(target, path70) {
|
|
32684
|
+
const [head, ...rest] = path70;
|
|
32601
32685
|
if (head === void 0) {
|
|
32602
32686
|
return;
|
|
32603
32687
|
}
|
|
@@ -32615,13 +32699,13 @@ function removeAt(target, path72) {
|
|
|
32615
32699
|
}
|
|
32616
32700
|
function applyStatuslineChange(existing, change) {
|
|
32617
32701
|
const draft = structuredClone(existing ?? {});
|
|
32618
|
-
for (const [
|
|
32619
|
-
keyNamed(
|
|
32620
|
-
setAt(draft,
|
|
32702
|
+
for (const [path70, value2] of Object.entries(change.set ?? {})) {
|
|
32703
|
+
keyNamed(path70);
|
|
32704
|
+
setAt(draft, path70.split("."), value2);
|
|
32621
32705
|
}
|
|
32622
|
-
for (const
|
|
32623
|
-
keyNamed(
|
|
32624
|
-
removeAt(draft,
|
|
32706
|
+
for (const path70 of change.unset ?? []) {
|
|
32707
|
+
keyNamed(path70);
|
|
32708
|
+
removeAt(draft, path70.split("."));
|
|
32625
32709
|
}
|
|
32626
32710
|
const result = StatuslineSchema.safeParse(draft);
|
|
32627
32711
|
if (!result.success) {
|
|
@@ -32642,7 +32726,7 @@ var init_change = __esm({
|
|
|
32642
32726
|
|
|
32643
32727
|
// src/configProfilesStore.ts
|
|
32644
32728
|
function profileJsonPath(paths, name) {
|
|
32645
|
-
return
|
|
32729
|
+
return profileFilePath(paths.configProfilesDir, name);
|
|
32646
32730
|
}
|
|
32647
32731
|
function profileExists(paths, name) {
|
|
32648
32732
|
return import_node_fs5.default.existsSync(profileJsonPath(paths, name));
|
|
@@ -32656,6 +32740,9 @@ function readProfile(paths, name) {
|
|
|
32656
32740
|
return readJson(profileJsonPath(paths, name), ConfigProfileSchema);
|
|
32657
32741
|
}
|
|
32658
32742
|
function createProfile(paths, name, extendsList, description) {
|
|
32743
|
+
if (!isFileName(name)) {
|
|
32744
|
+
throw new UnsafeNameError(name, "configuration profile", FILE_NAME_RULE);
|
|
32745
|
+
}
|
|
32659
32746
|
if (profileExists(paths, name)) {
|
|
32660
32747
|
throw new ProfileAlreadyExistsError(name);
|
|
32661
32748
|
}
|
|
@@ -32670,13 +32757,20 @@ function createProfile(paths, name, extendsList, description) {
|
|
|
32670
32757
|
writeJsonAtomic(filePath, parsed.data);
|
|
32671
32758
|
return parsed.data;
|
|
32672
32759
|
}
|
|
32673
|
-
function
|
|
32760
|
+
function reportUnusableProfileName(name, message) {
|
|
32761
|
+
console.error(`agent-shim: config-profiles/${name}.json is skipped: ${message}`);
|
|
32762
|
+
}
|
|
32763
|
+
function listProfiles(paths, onUnusable = reportUnusableProfileName) {
|
|
32674
32764
|
if (!import_node_fs5.default.existsSync(paths.configProfilesDir)) {
|
|
32675
32765
|
return [];
|
|
32676
32766
|
}
|
|
32677
32767
|
const names = import_node_fs5.default.readdirSync(paths.configProfilesDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort();
|
|
32678
32768
|
const result = [];
|
|
32679
32769
|
for (const name of names) {
|
|
32770
|
+
if (!isStoredName(name)) {
|
|
32771
|
+
onUnusable(name, `its name ${JSON.stringify(name)} is not usable, so the file is ignored. Rename or remove it.`);
|
|
32772
|
+
continue;
|
|
32773
|
+
}
|
|
32680
32774
|
const profile = readProfile(paths, name);
|
|
32681
32775
|
if (profile !== void 0) {
|
|
32682
32776
|
result.push({ name, profile });
|
|
@@ -32796,17 +32890,17 @@ function applyProfileChange(paths, name, change) {
|
|
|
32796
32890
|
}
|
|
32797
32891
|
return touched;
|
|
32798
32892
|
}
|
|
32799
|
-
var import_node_fs5,
|
|
32893
|
+
var import_node_fs5, ProfileNotFoundError, ProfileAlreadyExistsError, InvalidCategoryNameError;
|
|
32800
32894
|
var init_configProfilesStore = __esm({
|
|
32801
32895
|
"src/configProfilesStore.ts"() {
|
|
32802
32896
|
"use strict";
|
|
32803
32897
|
import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
32804
|
-
import_node_path12 = __toESM(require("node:path"), 1);
|
|
32805
32898
|
init_store();
|
|
32806
32899
|
init_schema();
|
|
32807
32900
|
init_cliError();
|
|
32808
32901
|
init_change();
|
|
32809
32902
|
init_load();
|
|
32903
|
+
init_names();
|
|
32810
32904
|
ProfileNotFoundError = class extends CliError {
|
|
32811
32905
|
constructor(profileName) {
|
|
32812
32906
|
super(`No configuration profile named "${profileName}". Run \`agent-shim profile add ${profileName}\` first.`);
|
|
@@ -33141,7 +33235,7 @@ function loadCascadeInput(params) {
|
|
|
33141
33235
|
const globalConfig2 = loadConfigFile(params.paths.globalConfigFile, GlobalConfigSchema, params.read);
|
|
33142
33236
|
const directoryRules = loadConfigFile(params.paths.directoryRulesFile, DirectoryRulesSchema, params.read);
|
|
33143
33237
|
const loadProfile = (name) => {
|
|
33144
|
-
const filepath =
|
|
33238
|
+
const filepath = profileFilePath(params.paths.configProfilesDir, name);
|
|
33145
33239
|
const loaded = loadConfigFile(filepath, ConfigProfileSchema, params.read);
|
|
33146
33240
|
if (loaded === void 0) {
|
|
33147
33241
|
return void 0;
|
|
@@ -33214,6 +33308,7 @@ var init_cascade = __esm({
|
|
|
33214
33308
|
init_pathNorm();
|
|
33215
33309
|
init_walk();
|
|
33216
33310
|
init_legacy();
|
|
33311
|
+
init_names();
|
|
33217
33312
|
PORTABLE_CONFIG_FILENAME = ".agent-shim.json";
|
|
33218
33313
|
PORTABLE_LOCAL_CONFIG_FILENAME = ".agent-shim.local.json";
|
|
33219
33314
|
}
|
|
@@ -36100,11 +36195,11 @@ function identifyRequest(headers) {
|
|
|
36100
36195
|
function directOrigin2(port) {
|
|
36101
36196
|
return `http://127.0.0.1:${String(port)}`;
|
|
36102
36197
|
}
|
|
36103
|
-
function parseProviderPath(
|
|
36104
|
-
if (!
|
|
36198
|
+
function parseProviderPath(path70) {
|
|
36199
|
+
if (!path70.startsWith(PROVIDER_PATH_PREFIX)) {
|
|
36105
36200
|
return void 0;
|
|
36106
36201
|
}
|
|
36107
|
-
const tail =
|
|
36202
|
+
const tail = path70.slice(PROVIDER_PATH_PREFIX.length);
|
|
36108
36203
|
const slash = tail.indexOf("/");
|
|
36109
36204
|
if (slash <= 0) {
|
|
36110
36205
|
return void 0;
|
|
@@ -36378,8 +36473,8 @@ function parseConnectTarget(authority) {
|
|
|
36378
36473
|
}
|
|
36379
36474
|
return { host, port };
|
|
36380
36475
|
}
|
|
36381
|
-
function servedByPipeline(
|
|
36382
|
-
return
|
|
36476
|
+
function servedByPipeline(path70) {
|
|
36477
|
+
return path70?.startsWith(ROUTED_PATH_PREFIX) === true;
|
|
36383
36478
|
}
|
|
36384
36479
|
function forwardableHeaders(headers) {
|
|
36385
36480
|
const connectionTokens = new Set(
|
|
@@ -36857,7 +36952,7 @@ var init_package = __esm({
|
|
|
36857
36952
|
"package.json"() {
|
|
36858
36953
|
package_default = {
|
|
36859
36954
|
name: "claude-use",
|
|
36860
|
-
version: "11.60.
|
|
36955
|
+
version: "11.60.2",
|
|
36861
36956
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
36862
36957
|
license: "MIT",
|
|
36863
36958
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -37380,12 +37475,12 @@ function decoderFor(encoding) {
|
|
|
37380
37475
|
return void 0;
|
|
37381
37476
|
}
|
|
37382
37477
|
}
|
|
37383
|
-
function destinationOf(
|
|
37384
|
-
const scoped = parseProviderPath(
|
|
37478
|
+
function destinationOf(path70, sessionProvider) {
|
|
37479
|
+
const scoped = parseProviderPath(path70);
|
|
37385
37480
|
if (scoped !== void 0) {
|
|
37386
37481
|
return { provider: scoped.provider, endpoint: scoped.rest };
|
|
37387
37482
|
}
|
|
37388
|
-
return { provider: sessionProvider ?? ANTHROPIC_PROVIDER, endpoint:
|
|
37483
|
+
return { provider: sessionProvider ?? ANTHROPIC_PROVIDER, endpoint: path70 };
|
|
37389
37484
|
}
|
|
37390
37485
|
function modelChoiceOf(event, servedModel, provider) {
|
|
37391
37486
|
if (event.modelChoice !== void 0) return event.modelChoice;
|
|
@@ -38734,13 +38829,11 @@ var init_families = __esm({
|
|
|
38734
38829
|
});
|
|
38735
38830
|
|
|
38736
38831
|
// src/providersStore.ts
|
|
38737
|
-
function requireValidProviderName(name) {
|
|
38738
|
-
if (!PROVIDER_NAME_RE.test(name)) {
|
|
38739
|
-
throw new InvalidProviderNameError(name);
|
|
38740
|
-
}
|
|
38741
|
-
}
|
|
38742
38832
|
function providerJsonPath(paths, name) {
|
|
38743
|
-
return
|
|
38833
|
+
return providerFilePath(paths.providersDir, name);
|
|
38834
|
+
}
|
|
38835
|
+
function providerFileDefined(lstat, providersDir, name) {
|
|
38836
|
+
return isStoredName(name) && lstat(providerFilePath(providersDir, name)) !== void 0;
|
|
38744
38837
|
}
|
|
38745
38838
|
function providerExists(paths, name) {
|
|
38746
38839
|
return import_node_fs11.default.existsSync(providerJsonPath(paths, name));
|
|
@@ -38801,7 +38894,7 @@ function readProvider(paths, name) {
|
|
|
38801
38894
|
return parseProviderFile(filePath, raw);
|
|
38802
38895
|
}
|
|
38803
38896
|
function loadProvider(providersDir, name, port) {
|
|
38804
|
-
const filePath =
|
|
38897
|
+
const filePath = providerFilePath(providersDir, name);
|
|
38805
38898
|
const raw = port.readConfigFile(filePath);
|
|
38806
38899
|
return raw === void 0 ? void 0 : parseProviderFile(filePath, raw);
|
|
38807
38900
|
}
|
|
@@ -38819,7 +38912,7 @@ function listProviders(paths, onInvalid = reportInvalidProvider) {
|
|
|
38819
38912
|
try {
|
|
38820
38913
|
provider = readProvider(paths, name);
|
|
38821
38914
|
} catch (error63) {
|
|
38822
|
-
if (!(error63 instanceof ConfigValidationError || error63 instanceof LegacyProviderFileError)) {
|
|
38915
|
+
if (!(error63 instanceof ConfigValidationError || error63 instanceof LegacyProviderFileError || error63 instanceof UnsafeNameError)) {
|
|
38823
38916
|
throw error63;
|
|
38824
38917
|
}
|
|
38825
38918
|
onInvalid(name, error63.message);
|
|
@@ -38859,7 +38952,7 @@ function addProvider(paths, name, input2) {
|
|
|
38859
38952
|
if (providerExists(paths, name)) {
|
|
38860
38953
|
throw new ProviderAlreadyExistsError(name);
|
|
38861
38954
|
}
|
|
38862
|
-
|
|
38955
|
+
requireNewProviderName(name);
|
|
38863
38956
|
const kind = input2.kind ?? "http";
|
|
38864
38957
|
if (kind === "codex" && input2.baseUrl !== void 0) {
|
|
38865
38958
|
throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
|
|
@@ -39083,12 +39176,11 @@ function resolveRoutedProviderCredentials(params) {
|
|
|
39083
39176
|
}
|
|
39084
39177
|
return { ok: true, checked: [...providerNames].sort() };
|
|
39085
39178
|
}
|
|
39086
|
-
var import_node_fs11,
|
|
39179
|
+
var import_node_fs11, ProviderNotFoundError, ProviderAlreadyExistsError, LEGACY_PROVIDER_FIELDS, LEGACY_ENV_CREDENTIAL_KEYS, LEGACY_LITERAL_PLACEHOLDER, LegacyProviderFileError, ProviderKindMismatchError;
|
|
39087
39180
|
var init_providersStore = __esm({
|
|
39088
39181
|
"src/providersStore.ts"() {
|
|
39089
39182
|
"use strict";
|
|
39090
39183
|
import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
39091
|
-
import_node_path30 = __toESM(require("node:path"), 1);
|
|
39092
39184
|
init_load();
|
|
39093
39185
|
init_store();
|
|
39094
39186
|
init_unrecognisedKeys();
|
|
@@ -39098,6 +39190,7 @@ var init_providersStore = __esm({
|
|
|
39098
39190
|
init_credential();
|
|
39099
39191
|
init_walk();
|
|
39100
39192
|
init_families();
|
|
39193
|
+
init_names();
|
|
39101
39194
|
ProviderNotFoundError = class extends CliError {
|
|
39102
39195
|
constructor(name) {
|
|
39103
39196
|
super(`No provider named "${name}". Run \`agent-shim provider add ${name}\` first.`);
|
|
@@ -39114,17 +39207,6 @@ var init_providersStore = __esm({
|
|
|
39114
39207
|
}
|
|
39115
39208
|
providerName;
|
|
39116
39209
|
};
|
|
39117
|
-
InvalidProviderNameError = class extends CliError {
|
|
39118
|
-
constructor(attemptedName) {
|
|
39119
|
-
super(
|
|
39120
|
-
`"${attemptedName}" is not a valid provider name. Provider names must start with a letter or number and may then contain letters, numbers, dots, hyphens, underscores, and at signs.`
|
|
39121
|
-
);
|
|
39122
|
-
this.attemptedName = attemptedName;
|
|
39123
|
-
this.name = "InvalidProviderNameError";
|
|
39124
|
-
}
|
|
39125
|
-
attemptedName;
|
|
39126
|
-
};
|
|
39127
|
-
PROVIDER_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._@-]*$/;
|
|
39128
39210
|
LEGACY_PROVIDER_FIELDS = ["tokenEnv", "tokenCommand", "authScheme"];
|
|
39129
39211
|
LEGACY_ENV_CREDENTIAL_KEYS = Object.values(CREDENTIAL_TARGET_VARS);
|
|
39130
39212
|
LEGACY_LITERAL_PLACEHOLDER = "<the value of env.ANTHROPIC_AUTH_TOKEN>";
|
|
@@ -39170,7 +39252,7 @@ function decideSignIn(facts) {
|
|
|
39170
39252
|
return { state: "signed-out", detail: facts.platform === "darwin" ? `no Keychain item and no ${CREDENTIALS_FILE}` : `no ${CREDENTIALS_FILE}` };
|
|
39171
39253
|
}
|
|
39172
39254
|
function credentialsFilePath(farmRoot) {
|
|
39173
|
-
return
|
|
39255
|
+
return import_node_path30.default.join(farmRoot, CREDENTIALS_FILE);
|
|
39174
39256
|
}
|
|
39175
39257
|
function identitySignIn(fs30, probe, identity) {
|
|
39176
39258
|
const probing = !identity.hasCredentialBlock;
|
|
@@ -39181,12 +39263,12 @@ function identitySignIn(fs30, probe, identity) {
|
|
|
39181
39263
|
platform: probe.platform
|
|
39182
39264
|
});
|
|
39183
39265
|
}
|
|
39184
|
-
var import_node_crypto9,
|
|
39266
|
+
var import_node_crypto9, import_node_path30, CREDENTIALS_FILE, KEYCHAIN_SERVICE_PREFIX, KEYCHAIN_SERVICE_HASH_DIGITS;
|
|
39185
39267
|
var init_signIn = __esm({
|
|
39186
39268
|
"src/usage/signIn.ts"() {
|
|
39187
39269
|
"use strict";
|
|
39188
39270
|
import_node_crypto9 = require("node:crypto");
|
|
39189
|
-
|
|
39271
|
+
import_node_path30 = __toESM(require("node:path"), 1);
|
|
39190
39272
|
CREDENTIALS_FILE = ".credentials.json";
|
|
39191
39273
|
KEYCHAIN_SERVICE_PREFIX = "Claude Code-credentials";
|
|
39192
39274
|
KEYCHAIN_SERVICE_HASH_DIGITS = 8;
|
|
@@ -40421,14 +40503,14 @@ var require_util2 = __commonJS({
|
|
|
40421
40503
|
}
|
|
40422
40504
|
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
40423
40505
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
|
|
40424
|
-
let
|
|
40506
|
+
let path70 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
40425
40507
|
if (origin[origin.length - 1] === "/") {
|
|
40426
40508
|
origin = origin.slice(0, origin.length - 1);
|
|
40427
40509
|
}
|
|
40428
|
-
if (
|
|
40429
|
-
|
|
40510
|
+
if (path70 && path70[0] !== "/") {
|
|
40511
|
+
path70 = `/${path70}`;
|
|
40430
40512
|
}
|
|
40431
|
-
return new URL(`${origin}${
|
|
40513
|
+
return new URL(`${origin}${path70}`);
|
|
40432
40514
|
}
|
|
40433
40515
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
40434
40516
|
throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -41249,9 +41331,9 @@ var require_diagnostics = __commonJS({
|
|
|
41249
41331
|
"undici:client:sendHeaders",
|
|
41250
41332
|
(evt) => {
|
|
41251
41333
|
const {
|
|
41252
|
-
request: { method, path:
|
|
41334
|
+
request: { method, path: path70, origin }
|
|
41253
41335
|
} = evt;
|
|
41254
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
41336
|
+
debugLog("sending request to %s %s%s", method, origin, path70);
|
|
41255
41337
|
}
|
|
41256
41338
|
);
|
|
41257
41339
|
}
|
|
@@ -41269,14 +41351,14 @@ var require_diagnostics = __commonJS({
|
|
|
41269
41351
|
"undici:request:headers",
|
|
41270
41352
|
(evt) => {
|
|
41271
41353
|
const {
|
|
41272
|
-
request: { method, path:
|
|
41354
|
+
request: { method, path: path70, origin },
|
|
41273
41355
|
response: { statusCode }
|
|
41274
41356
|
} = evt;
|
|
41275
41357
|
debugLog(
|
|
41276
41358
|
"received response to %s %s%s - HTTP %d",
|
|
41277
41359
|
method,
|
|
41278
41360
|
origin,
|
|
41279
|
-
|
|
41361
|
+
path70,
|
|
41280
41362
|
statusCode
|
|
41281
41363
|
);
|
|
41282
41364
|
}
|
|
@@ -41285,23 +41367,23 @@ var require_diagnostics = __commonJS({
|
|
|
41285
41367
|
"undici:request:trailers",
|
|
41286
41368
|
(evt) => {
|
|
41287
41369
|
const {
|
|
41288
|
-
request: { method, path:
|
|
41370
|
+
request: { method, path: path70, origin }
|
|
41289
41371
|
} = evt;
|
|
41290
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
41372
|
+
debugLog("trailers received from %s %s%s", method, origin, path70);
|
|
41291
41373
|
}
|
|
41292
41374
|
);
|
|
41293
41375
|
diagnosticsChannel.subscribe(
|
|
41294
41376
|
"undici:request:error",
|
|
41295
41377
|
(evt) => {
|
|
41296
41378
|
const {
|
|
41297
|
-
request: { method, path:
|
|
41379
|
+
request: { method, path: path70, origin },
|
|
41298
41380
|
error: error63
|
|
41299
41381
|
} = evt;
|
|
41300
41382
|
debugLog(
|
|
41301
41383
|
"request to %s %s%s errored - %s",
|
|
41302
41384
|
method,
|
|
41303
41385
|
origin,
|
|
41304
|
-
|
|
41386
|
+
path70,
|
|
41305
41387
|
error63.message
|
|
41306
41388
|
);
|
|
41307
41389
|
}
|
|
@@ -41416,7 +41498,7 @@ var require_request = __commonJS({
|
|
|
41416
41498
|
var kHandler = /* @__PURE__ */ Symbol("handler");
|
|
41417
41499
|
var Request2 = class {
|
|
41418
41500
|
constructor(origin, {
|
|
41419
|
-
path:
|
|
41501
|
+
path: path70,
|
|
41420
41502
|
method,
|
|
41421
41503
|
body,
|
|
41422
41504
|
headers,
|
|
@@ -41433,11 +41515,11 @@ var require_request = __commonJS({
|
|
|
41433
41515
|
maxRedirections,
|
|
41434
41516
|
typeOfService
|
|
41435
41517
|
}, handler) {
|
|
41436
|
-
if (typeof
|
|
41518
|
+
if (typeof path70 !== "string") {
|
|
41437
41519
|
throw new InvalidArgumentError2("path must be a string");
|
|
41438
|
-
} else if (
|
|
41520
|
+
} else if (path70[0] !== "/" && !(path70.startsWith("http://") || path70.startsWith("https://")) && method !== "CONNECT") {
|
|
41439
41521
|
throw new InvalidArgumentError2("path must be an absolute URL or start with a slash");
|
|
41440
|
-
} else if (invalidPathRegex.test(
|
|
41522
|
+
} else if (invalidPathRegex.test(path70)) {
|
|
41441
41523
|
throw new InvalidArgumentError2("invalid request path");
|
|
41442
41524
|
}
|
|
41443
41525
|
if (typeof method !== "string") {
|
|
@@ -41512,7 +41594,7 @@ var require_request = __commonJS({
|
|
|
41512
41594
|
this.completed = false;
|
|
41513
41595
|
this.aborted = false;
|
|
41514
41596
|
this.upgrade = upgrade || null;
|
|
41515
|
-
this.path = query ? serializePathWithQuery(
|
|
41597
|
+
this.path = query ? serializePathWithQuery(path70, query) : path70;
|
|
41516
41598
|
this.origin = origin;
|
|
41517
41599
|
this.protocol = getProtocolFromUrlString(origin);
|
|
41518
41600
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -46694,7 +46776,7 @@ var require_client_h1 = __commonJS({
|
|
|
46694
46776
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
46695
46777
|
}
|
|
46696
46778
|
function writeH1(client, request7) {
|
|
46697
|
-
const { method, path:
|
|
46779
|
+
const { method, path: path70, host, upgrade, blocking, reset } = request7;
|
|
46698
46780
|
let { body, headers, contentLength } = request7;
|
|
46699
46781
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
46700
46782
|
if (util2.isFormDataLike(body)) {
|
|
@@ -46772,7 +46854,7 @@ var require_client_h1 = __commonJS({
|
|
|
46772
46854
|
if (socket.setTypeOfService) {
|
|
46773
46855
|
socket.setTypeOfService(request7.typeOfService);
|
|
46774
46856
|
}
|
|
46775
|
-
let header = `${method} ${
|
|
46857
|
+
let header = `${method} ${path70} HTTP/1.1\r
|
|
46776
46858
|
`;
|
|
46777
46859
|
if (typeof host === "string") {
|
|
46778
46860
|
header += `host: ${host}\r
|
|
@@ -47451,7 +47533,7 @@ var require_client_h2 = __commonJS({
|
|
|
47451
47533
|
const headersTimeout = request7.headersTimeout ?? client[kHeadersTimeout];
|
|
47452
47534
|
const bodyTimeout = request7.bodyTimeout ?? client[kBodyTimeout];
|
|
47453
47535
|
const session = client[kHTTP2Session];
|
|
47454
|
-
const { method, path:
|
|
47536
|
+
const { method, path: path70, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request7;
|
|
47455
47537
|
let { body } = request7;
|
|
47456
47538
|
if (upgrade != null && upgrade !== "websocket") {
|
|
47457
47539
|
util2.errorRequest(client, request7, new InvalidArgumentError2(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
@@ -47520,7 +47602,7 @@ var require_client_h2 = __commonJS({
|
|
|
47520
47602
|
}
|
|
47521
47603
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
47522
47604
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
47523
|
-
headers[HTTP2_HEADER_PATH] =
|
|
47605
|
+
headers[HTTP2_HEADER_PATH] = path70;
|
|
47524
47606
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
47525
47607
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
47526
47608
|
} else {
|
|
@@ -47562,7 +47644,7 @@ var require_client_h2 = __commonJS({
|
|
|
47562
47644
|
stream.setTimeout(headersTimeout);
|
|
47563
47645
|
return true;
|
|
47564
47646
|
}
|
|
47565
|
-
headers[HTTP2_HEADER_PATH] =
|
|
47647
|
+
headers[HTTP2_HEADER_PATH] = path70;
|
|
47566
47648
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
47567
47649
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
47568
47650
|
if (body && typeof body.read === "function") {
|
|
@@ -49914,10 +49996,10 @@ var require_proxy_agent = __commonJS({
|
|
|
49914
49996
|
};
|
|
49915
49997
|
const {
|
|
49916
49998
|
origin,
|
|
49917
|
-
path:
|
|
49999
|
+
path: path70 = "/",
|
|
49918
50000
|
headers = {}
|
|
49919
50001
|
} = opts;
|
|
49920
|
-
opts.path = origin +
|
|
50002
|
+
opts.path = origin + path70;
|
|
49921
50003
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
49922
50004
|
const { host } = new URL(origin);
|
|
49923
50005
|
headers.host = host;
|
|
@@ -52026,20 +52108,20 @@ var require_mock_utils = __commonJS({
|
|
|
52026
52108
|
}
|
|
52027
52109
|
return normalizedQp;
|
|
52028
52110
|
}
|
|
52029
|
-
function safeUrl(
|
|
52030
|
-
if (typeof
|
|
52031
|
-
return
|
|
52111
|
+
function safeUrl(path70) {
|
|
52112
|
+
if (typeof path70 !== "string") {
|
|
52113
|
+
return path70;
|
|
52032
52114
|
}
|
|
52033
|
-
const pathSegments =
|
|
52115
|
+
const pathSegments = path70.split("?", 3);
|
|
52034
52116
|
if (pathSegments.length !== 2) {
|
|
52035
|
-
return
|
|
52117
|
+
return path70;
|
|
52036
52118
|
}
|
|
52037
52119
|
const qp2 = new URLSearchParams(pathSegments.pop());
|
|
52038
52120
|
qp2.sort();
|
|
52039
52121
|
return [...pathSegments, qp2.toString()].join("?");
|
|
52040
52122
|
}
|
|
52041
|
-
function matchKey(mockDispatch2, { path:
|
|
52042
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
52123
|
+
function matchKey(mockDispatch2, { path: path70, method, body, headers }) {
|
|
52124
|
+
const pathMatch = matchValue(mockDispatch2.path, path70);
|
|
52043
52125
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
52044
52126
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
52045
52127
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -52064,8 +52146,8 @@ var require_mock_utils = __commonJS({
|
|
|
52064
52146
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
52065
52147
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
52066
52148
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
52067
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
52068
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
52149
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path70, ignoreTrailingSlash }) => {
|
|
52150
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path70)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path70), resolvedPath);
|
|
52069
52151
|
});
|
|
52070
52152
|
if (matchedMockDispatches.length === 0) {
|
|
52071
52153
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -52104,19 +52186,19 @@ var require_mock_utils = __commonJS({
|
|
|
52104
52186
|
mockDispatches.splice(index, 1);
|
|
52105
52187
|
}
|
|
52106
52188
|
}
|
|
52107
|
-
function removeTrailingSlash(
|
|
52108
|
-
while (
|
|
52109
|
-
|
|
52189
|
+
function removeTrailingSlash(path70) {
|
|
52190
|
+
while (path70.endsWith("/")) {
|
|
52191
|
+
path70 = path70.slice(0, -1);
|
|
52110
52192
|
}
|
|
52111
|
-
if (
|
|
52112
|
-
|
|
52193
|
+
if (path70.length === 0) {
|
|
52194
|
+
path70 = "/";
|
|
52113
52195
|
}
|
|
52114
|
-
return
|
|
52196
|
+
return path70;
|
|
52115
52197
|
}
|
|
52116
52198
|
function buildKey(opts) {
|
|
52117
|
-
const { path:
|
|
52199
|
+
const { path: path70, method, body, headers, query } = opts;
|
|
52118
52200
|
return {
|
|
52119
|
-
path:
|
|
52201
|
+
path: path70,
|
|
52120
52202
|
method,
|
|
52121
52203
|
body,
|
|
52122
52204
|
headers,
|
|
@@ -52806,10 +52888,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
52806
52888
|
}
|
|
52807
52889
|
format(pendingInterceptors) {
|
|
52808
52890
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
52809
|
-
({ method, path:
|
|
52891
|
+
({ method, path: path70, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
52810
52892
|
Method: method,
|
|
52811
52893
|
Origin: origin,
|
|
52812
|
-
Path:
|
|
52894
|
+
Path: path70,
|
|
52813
52895
|
"Status code": statusCode,
|
|
52814
52896
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
52815
52897
|
Invocations: timesInvoked,
|
|
@@ -52891,9 +52973,9 @@ var require_mock_agent = __commonJS({
|
|
|
52891
52973
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
52892
52974
|
const dispatchOpts = { ...opts };
|
|
52893
52975
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
52894
|
-
const [
|
|
52976
|
+
const [path70, searchParams] = dispatchOpts.path.split("?");
|
|
52895
52977
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
52896
|
-
dispatchOpts.path = `${
|
|
52978
|
+
dispatchOpts.path = `${path70}?${normalizedSearchParams}`;
|
|
52897
52979
|
}
|
|
52898
52980
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
52899
52981
|
}
|
|
@@ -53294,12 +53376,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
53294
53376
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
53295
53377
|
*/
|
|
53296
53378
|
async loadSnapshots(filePath) {
|
|
53297
|
-
const
|
|
53298
|
-
if (!
|
|
53379
|
+
const path70 = filePath || this.#snapshotPath;
|
|
53380
|
+
if (!path70) {
|
|
53299
53381
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
53300
53382
|
}
|
|
53301
53383
|
try {
|
|
53302
|
-
const data = await readFile(resolve2(
|
|
53384
|
+
const data = await readFile(resolve2(path70), "utf8");
|
|
53303
53385
|
const parsed = JSON.parse(data);
|
|
53304
53386
|
if (Array.isArray(parsed)) {
|
|
53305
53387
|
this.#snapshots.clear();
|
|
@@ -53313,7 +53395,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
53313
53395
|
if (error63.code === "ENOENT") {
|
|
53314
53396
|
this.#snapshots.clear();
|
|
53315
53397
|
} else {
|
|
53316
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
53398
|
+
throw new UndiciError(`Failed to load snapshots from ${path70}`, { cause: error63 });
|
|
53317
53399
|
}
|
|
53318
53400
|
}
|
|
53319
53401
|
}
|
|
@@ -53324,11 +53406,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
53324
53406
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
53325
53407
|
*/
|
|
53326
53408
|
async saveSnapshots(filePath) {
|
|
53327
|
-
const
|
|
53328
|
-
if (!
|
|
53409
|
+
const path70 = filePath || this.#snapshotPath;
|
|
53410
|
+
if (!path70) {
|
|
53329
53411
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
53330
53412
|
}
|
|
53331
|
-
const resolvedPath = resolve2(
|
|
53413
|
+
const resolvedPath = resolve2(path70);
|
|
53332
53414
|
await mkdir(dirname3(resolvedPath), { recursive: true });
|
|
53333
53415
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
53334
53416
|
hash: hash2,
|
|
@@ -53960,15 +54042,15 @@ var require_redirect_handler = __commonJS({
|
|
|
53960
54042
|
return;
|
|
53961
54043
|
}
|
|
53962
54044
|
const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
53963
|
-
const
|
|
53964
|
-
const redirectUrlString = `${origin}${
|
|
54045
|
+
const path70 = search ? `${pathname}${search}` : pathname;
|
|
54046
|
+
const redirectUrlString = `${origin}${path70}`;
|
|
53965
54047
|
for (const historyUrl of this.history) {
|
|
53966
54048
|
if (historyUrl.toString() === redirectUrlString) {
|
|
53967
54049
|
throw new InvalidArgumentError2(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
53968
54050
|
}
|
|
53969
54051
|
}
|
|
53970
54052
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
53971
|
-
this.opts.path =
|
|
54053
|
+
this.opts.path = path70;
|
|
53972
54054
|
this.opts.origin = origin;
|
|
53973
54055
|
this.opts.query = null;
|
|
53974
54056
|
}
|
|
@@ -55728,10 +55810,10 @@ var require_cache_handler = __commonJS({
|
|
|
55728
55810
|
}
|
|
55729
55811
|
return locationUrl.pathname + locationUrl.search;
|
|
55730
55812
|
}
|
|
55731
|
-
function deleteCachedUri(store, cacheKey,
|
|
55813
|
+
function deleteCachedUri(store, cacheKey, path70) {
|
|
55732
55814
|
deleteCachedValue(store, {
|
|
55733
55815
|
...cacheKey,
|
|
55734
|
-
path:
|
|
55816
|
+
path: path70
|
|
55735
55817
|
});
|
|
55736
55818
|
for (let i10 = 0; i10 < util2.safeHTTPMethods.length; i10++) {
|
|
55737
55819
|
const method = util2.safeHTTPMethods[i10];
|
|
@@ -55739,7 +55821,7 @@ var require_cache_handler = __commonJS({
|
|
|
55739
55821
|
deleteCachedValue(store, {
|
|
55740
55822
|
...cacheKey,
|
|
55741
55823
|
method,
|
|
55742
|
-
path:
|
|
55824
|
+
path: path70
|
|
55743
55825
|
});
|
|
55744
55826
|
}
|
|
55745
55827
|
}
|
|
@@ -55750,9 +55832,9 @@ var require_cache_handler = __commonJS({
|
|
|
55750
55832
|
}
|
|
55751
55833
|
const values = Array.isArray(headerValue2) ? headerValue2 : [headerValue2];
|
|
55752
55834
|
for (let i10 = 0; i10 < values.length; i10++) {
|
|
55753
|
-
const
|
|
55754
|
-
if (
|
|
55755
|
-
deleteCachedUri(store, cacheKey,
|
|
55835
|
+
const path70 = getSameOriginPath(cacheKey, values[i10]);
|
|
55836
|
+
if (path70 !== void 0) {
|
|
55837
|
+
deleteCachedUri(store, cacheKey, path70);
|
|
55756
55838
|
}
|
|
55757
55839
|
}
|
|
55758
55840
|
}
|
|
@@ -60752,11 +60834,11 @@ var require_fetch = __commonJS({
|
|
|
60752
60834
|
function dispatch({ body }) {
|
|
60753
60835
|
const url2 = requestCurrentURL(request7);
|
|
60754
60836
|
const agent = fetchParams.controller.dispatcher;
|
|
60755
|
-
const
|
|
60837
|
+
const path70 = url2.pathname + url2.search;
|
|
60756
60838
|
const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
|
|
60757
60839
|
return new Promise((resolve2, reject) => agent.dispatch(
|
|
60758
60840
|
{
|
|
60759
|
-
path: hasTrailingQuestionMark ? `${
|
|
60841
|
+
path: hasTrailingQuestionMark ? `${path70}?` : path70,
|
|
60760
60842
|
origin: url2.origin,
|
|
60761
60843
|
method: request7.method,
|
|
60762
60844
|
body: agent.isMockActive ? request7.body && (request7.body.source || request7.body.stream) : body,
|
|
@@ -61703,9 +61785,9 @@ var require_util5 = __commonJS({
|
|
|
61703
61785
|
}
|
|
61704
61786
|
}
|
|
61705
61787
|
}
|
|
61706
|
-
function validateCookiePath(
|
|
61707
|
-
for (let i10 = 0; i10 <
|
|
61708
|
-
const code =
|
|
61788
|
+
function validateCookiePath(path70) {
|
|
61789
|
+
for (let i10 = 0; i10 < path70.length; ++i10) {
|
|
61790
|
+
const code = path70.charCodeAt(i10);
|
|
61709
61791
|
if (code < 32 || // exclude CTLs (0-31)
|
|
61710
61792
|
code > 126 || // exclude DEL and non-ascii
|
|
61711
61793
|
code === 59) {
|
|
@@ -65053,11 +65135,11 @@ var require_undici = __commonJS({
|
|
|
65053
65135
|
if (typeof opts.path !== "string") {
|
|
65054
65136
|
throw new InvalidArgumentError2("invalid opts.path");
|
|
65055
65137
|
}
|
|
65056
|
-
let
|
|
65138
|
+
let path70 = opts.path;
|
|
65057
65139
|
if (!opts.path.startsWith("/")) {
|
|
65058
|
-
|
|
65140
|
+
path70 = `/${path70}`;
|
|
65059
65141
|
}
|
|
65060
|
-
url2 = new URL(util2.parseOrigin(url2).origin +
|
|
65142
|
+
url2 = new URL(util2.parseOrigin(url2).origin + path70);
|
|
65061
65143
|
} else {
|
|
65062
65144
|
if (!opts) {
|
|
65063
65145
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -65496,7 +65578,7 @@ var init_selfIdentity = __esm({
|
|
|
65496
65578
|
// src/frontdoor/trust.ts
|
|
65497
65579
|
function resolveTrustBundle(params) {
|
|
65498
65580
|
const { caCertFile, bundlesDir, variable, inherited, fs: fs30 } = params;
|
|
65499
|
-
if (inherited === void 0 || inherited === "" ||
|
|
65581
|
+
if (inherited === void 0 || inherited === "" || import_node_path37.default.resolve(inherited) === import_node_path37.default.resolve(caCertFile)) {
|
|
65500
65582
|
return { path: caCertFile };
|
|
65501
65583
|
}
|
|
65502
65584
|
const caPem = fs30.readFileUtf8(caCertFile);
|
|
@@ -65514,19 +65596,19 @@ function resolveTrustBundle(params) {
|
|
|
65514
65596
|
}
|
|
65515
65597
|
const combined = `${inheritedPem.trimEnd()}
|
|
65516
65598
|
${caPem}`;
|
|
65517
|
-
const bundle =
|
|
65599
|
+
const bundle = import_node_path37.default.join(bundlesDir, `${(0, import_node_crypto15.createHash)("sha256").update(combined).digest("hex").slice(0, BUNDLE_NAME_HEX_DIGITS)}.pem`);
|
|
65518
65600
|
if (!fs30.exists(bundle)) {
|
|
65519
65601
|
fs30.mkdirp(bundlesDir);
|
|
65520
65602
|
fs30.writeFileAtomic(bundle, combined);
|
|
65521
65603
|
}
|
|
65522
65604
|
return { path: bundle };
|
|
65523
65605
|
}
|
|
65524
|
-
var import_node_crypto15,
|
|
65606
|
+
var import_node_crypto15, import_node_path37, BUNDLE_NAME_HEX_DIGITS;
|
|
65525
65607
|
var init_trust = __esm({
|
|
65526
65608
|
"src/frontdoor/trust.ts"() {
|
|
65527
65609
|
"use strict";
|
|
65528
65610
|
import_node_crypto15 = require("node:crypto");
|
|
65529
|
-
|
|
65611
|
+
import_node_path37 = __toESM(require("node:path"), 1);
|
|
65530
65612
|
BUNDLE_NAME_HEX_DIGITS = 16;
|
|
65531
65613
|
}
|
|
65532
65614
|
});
|
|
@@ -65729,10 +65811,10 @@ async function downloadAndInstall(ports, asset, target) {
|
|
|
65729
65811
|
const tempDir = ports.fs.mkdtemp();
|
|
65730
65812
|
try {
|
|
65731
65813
|
const assetUrl = `${DOWNLOAD_BASE_URL}/${asset}`;
|
|
65732
|
-
ports.fs.writeFileBytes(
|
|
65733
|
-
ports.fs.writeFileUtf8(
|
|
65734
|
-
const downloaded = ports.fs.readFileBytes(
|
|
65735
|
-
const sidecar = ports.fs.readFileUtf8(
|
|
65814
|
+
ports.fs.writeFileBytes(import_node_path38.default.join(tempDir, asset), await mustDownload(ports.http, assetUrl));
|
|
65815
|
+
ports.fs.writeFileUtf8(import_node_path38.default.join(tempDir, `${asset}.sha256`), Buffer.from(await mustDownload(ports.http, `${assetUrl}.sha256`)).toString("utf8"));
|
|
65816
|
+
const downloaded = ports.fs.readFileBytes(import_node_path38.default.join(tempDir, asset));
|
|
65817
|
+
const sidecar = ports.fs.readFileUtf8(import_node_path38.default.join(tempDir, `${asset}.sha256`));
|
|
65736
65818
|
if (downloaded === void 0 || sidecar === void 0) {
|
|
65737
65819
|
throw new UpdateDownloadError(`the downloaded files for ${asset} are missing from ${tempDir}`);
|
|
65738
65820
|
}
|
|
@@ -65741,7 +65823,7 @@ async function downloadAndInstall(ports, asset, target) {
|
|
|
65741
65823
|
if (expected === void 0 || expected !== actual) {
|
|
65742
65824
|
throw new UpdateDownloadError(`checksum mismatch for ${asset} (expected ${expected ?? "(none)"}, got ${actual})`);
|
|
65743
65825
|
}
|
|
65744
|
-
const tempBinary =
|
|
65826
|
+
const tempBinary = import_node_path38.default.join(import_node_path38.default.dirname(target), `.${import_node_path38.default.basename(target)}.${String(process.pid)}.${(0, import_node_crypto16.randomUUID)()}.tmp`);
|
|
65745
65827
|
ports.fs.writeFileBytes(tempBinary, downloaded);
|
|
65746
65828
|
try {
|
|
65747
65829
|
ports.fs.chmod(tempBinary, EXECUTABLE_MODE);
|
|
@@ -65788,12 +65870,12 @@ async function runSelfUpdate(ports, options) {
|
|
|
65788
65870
|
}
|
|
65789
65871
|
return { current: options.currentVersion, latest, action: "updated" };
|
|
65790
65872
|
}
|
|
65791
|
-
var import_node_crypto16,
|
|
65873
|
+
var import_node_crypto16, import_node_path38, LATEST_RELEASE_URL, DOWNLOAD_BASE_URL, MACOS_X64_NOTE, BREW_PREFIXES, EXECUTABLE_MODE, UpdateChannelError, UpdateConflictError, UpdateDownloadError;
|
|
65792
65874
|
var init_update = __esm({
|
|
65793
65875
|
"src/update/update.ts"() {
|
|
65794
65876
|
"use strict";
|
|
65795
65877
|
import_node_crypto16 = require("node:crypto");
|
|
65796
|
-
|
|
65878
|
+
import_node_path38 = __toESM(require("node:path"), 1);
|
|
65797
65879
|
init_cliError();
|
|
65798
65880
|
LATEST_RELEASE_URL = "https://github.com/ExaDev/agent-shim/releases/latest";
|
|
65799
65881
|
DOWNLOAD_BASE_URL = "https://github.com/ExaDev/agent-shim/releases/latest/download";
|
|
@@ -65964,13 +66046,13 @@ function agentShimCliPath(distDir = typeof __AGENT_SHIM_DIST_DIR__ === "string"
|
|
|
65964
66046
|
if (distDir === void 0) {
|
|
65965
66047
|
throw new OwnCliPathUnknownError();
|
|
65966
66048
|
}
|
|
65967
|
-
return
|
|
66049
|
+
return import_node_path40.default.join(distDir, OWN_CLI_FILE_NAME);
|
|
65968
66050
|
}
|
|
65969
|
-
var
|
|
66051
|
+
var import_node_path40, OWN_CLI_FILE_NAME, OwnCliPathUnknownError;
|
|
65970
66052
|
var init_ownCli = __esm({
|
|
65971
66053
|
"src/ownCli.ts"() {
|
|
65972
66054
|
"use strict";
|
|
65973
|
-
|
|
66055
|
+
import_node_path40 = __toESM(require("node:path"), 1);
|
|
65974
66056
|
init_cliError();
|
|
65975
66057
|
OWN_CLI_FILE_NAME = "cli.cjs";
|
|
65976
66058
|
OwnCliPathUnknownError = class extends CliError {
|
|
@@ -66355,7 +66437,7 @@ function buildEnv(params) {
|
|
|
66355
66437
|
const parentCustomHeaders = params.baseEnv.ANTHROPIC_CUSTOM_HEADERS;
|
|
66356
66438
|
let providerCustomHeaders;
|
|
66357
66439
|
if (!params.configDirEscapeHatch && params.resolvedIdentityName !== void 0) {
|
|
66358
|
-
env.CLAUDE_CONFIG_DIR =
|
|
66440
|
+
env.CLAUDE_CONFIG_DIR = import_node_path41.default.join(params.identitiesDir, params.resolvedIdentityName);
|
|
66359
66441
|
}
|
|
66360
66442
|
if (params.provider !== void 0) {
|
|
66361
66443
|
const providerEnv = params.provider.definition.kind !== void 0 && params.provider.definition.kind !== "http" ? {} : params.provider.definition.env ?? {};
|
|
@@ -66409,11 +66491,11 @@ function buildEnv(params) {
|
|
|
66409
66491
|
}
|
|
66410
66492
|
return env;
|
|
66411
66493
|
}
|
|
66412
|
-
var
|
|
66494
|
+
var import_node_path41, LOOPBACK_HOSTS, PROVIDER_SESSION_PLACEHOLDER;
|
|
66413
66495
|
var init_flags = __esm({
|
|
66414
66496
|
"src/launcher/flags.ts"() {
|
|
66415
66497
|
"use strict";
|
|
66416
|
-
|
|
66498
|
+
import_node_path41 = __toESM(require("node:path"), 1);
|
|
66417
66499
|
init_envBool();
|
|
66418
66500
|
init_cliError();
|
|
66419
66501
|
init_conditions();
|
|
@@ -66505,7 +66587,7 @@ function newestTranscript(fs30, projectDir) {
|
|
|
66505
66587
|
if (!name.endsWith(".jsonl")) {
|
|
66506
66588
|
continue;
|
|
66507
66589
|
}
|
|
66508
|
-
const candidate =
|
|
66590
|
+
const candidate = import_node_path42.default.join(projectDir, name);
|
|
66509
66591
|
const stat = fs30.lstat(candidate);
|
|
66510
66592
|
if (stat?.kind === "file" && stat.mtimeMs > newestMs) {
|
|
66511
66593
|
newestMs = stat.mtimeMs;
|
|
@@ -66515,24 +66597,24 @@ function newestTranscript(fs30, projectDir) {
|
|
|
66515
66597
|
return newest;
|
|
66516
66598
|
}
|
|
66517
66599
|
function latestConversationId(fs30, params) {
|
|
66518
|
-
const file2 = newestTranscript(fs30,
|
|
66519
|
-
return file2 === void 0 ? void 0 :
|
|
66600
|
+
const file2 = newestTranscript(fs30, import_node_path42.default.join(params.claudeHome, "projects", projectDirNameOf(params.cwd)));
|
|
66601
|
+
return file2 === void 0 ? void 0 : import_node_path42.default.basename(file2, ".jsonl");
|
|
66520
66602
|
}
|
|
66521
66603
|
function resumedContextTokens(fs30, params) {
|
|
66522
66604
|
const target = resumeTargetOf(params.passthrough);
|
|
66523
66605
|
if (target === void 0) {
|
|
66524
66606
|
return void 0;
|
|
66525
66607
|
}
|
|
66526
|
-
const projectDir =
|
|
66527
|
-
const file2 = target.kind === "id" ?
|
|
66608
|
+
const projectDir = import_node_path42.default.join(params.claudeHome, "projects", projectDirNameOf(params.cwd));
|
|
66609
|
+
const file2 = target.kind === "id" ? import_node_path42.default.join(projectDir, `${target.id}.jsonl`) : newestTranscript(fs30, projectDir);
|
|
66528
66610
|
const text5 = file2 === void 0 ? void 0 : fs30.readFileUtf8(file2);
|
|
66529
66611
|
return text5 === void 0 ? void 0 : contextTokensOfTranscript(text5);
|
|
66530
66612
|
}
|
|
66531
|
-
var
|
|
66613
|
+
var import_node_path42;
|
|
66532
66614
|
var init_resumeContext = __esm({
|
|
66533
66615
|
"src/usage/resumeContext.ts"() {
|
|
66534
66616
|
"use strict";
|
|
66535
|
-
|
|
66617
|
+
import_node_path42 = __toESM(require("node:path"), 1);
|
|
66536
66618
|
}
|
|
66537
66619
|
});
|
|
66538
66620
|
|
|
@@ -67931,7 +68013,7 @@ var init_translate2 = __esm({
|
|
|
67931
68013
|
|
|
67932
68014
|
// src/providerCatalogue.ts
|
|
67933
68015
|
function catalogueCachePath(paths, name) {
|
|
67934
|
-
return
|
|
68016
|
+
return providerFilePath(paths.catalogueDir, name);
|
|
67935
68017
|
}
|
|
67936
68018
|
function parseCatalogueCache(text5) {
|
|
67937
68019
|
if (text5 === void 0) {
|
|
@@ -68007,13 +68089,13 @@ async function fetchCatalogue(params) {
|
|
|
68007
68089
|
}
|
|
68008
68090
|
throw new CatalogueFetchError(`no catalogue from ${outcomes.join("; ")}`);
|
|
68009
68091
|
}
|
|
68010
|
-
var
|
|
68092
|
+
var import_picomatch3, DEFAULT_CANDIDATE_URLS, MS_PER_SECOND9, SECONDS_PER_HOUR3, HOURS_PER_DAY4, MS_PER_HOUR3, HOURS_BETWEEN_RETRIES, HTTP_OK, HTTP_MULTIPLE_CHOICES, CATALOGUE_MAX_AGE_MS, CATALOGUE_RETRY_MS, CATALOGUE_REQUEST_SECONDS, CATALOGUE_REQUEST_TIMEOUT_MS, CATALOGUE_REFRESH_TIMEOUT_MS, CatalogueModelSchema, CatalogueCacheSchema, CatalogueFetchError;
|
|
68011
68093
|
var init_providerCatalogue = __esm({
|
|
68012
68094
|
"src/providerCatalogue.ts"() {
|
|
68013
68095
|
"use strict";
|
|
68014
|
-
import_node_path44 = __toESM(require("node:path"), 1);
|
|
68015
68096
|
import_picomatch3 = __toESM(require_picomatch2(), 1);
|
|
68016
68097
|
init_zod();
|
|
68098
|
+
init_names();
|
|
68017
68099
|
DEFAULT_CANDIDATE_URLS = 2;
|
|
68018
68100
|
MS_PER_SECOND9 = 1e3;
|
|
68019
68101
|
SECONDS_PER_HOUR3 = 3600;
|
|
@@ -68662,7 +68744,7 @@ function decideLaunch(params, readOnly) {
|
|
|
68662
68744
|
identityDefaultConfigProfile: loadedIdentity?.config.defaultConfigProfile,
|
|
68663
68745
|
globalDefaultConfigProfile: params.globalDefaultConfigProfile
|
|
68664
68746
|
});
|
|
68665
|
-
if (configProfileDecision.name !== void 0 && params.allowMissingConfigProfile !== true && fs30.readConfigFile(
|
|
68747
|
+
if (configProfileDecision.name !== void 0 && params.allowMissingConfigProfile !== true && fs30.readConfigFile(profileFilePath(paths.configProfilesDir, configProfileDecision.name, `the configuration profile selected via ${configProfileDecision.source}`)) === void 0) {
|
|
68666
68748
|
log.error(
|
|
68667
68749
|
`agent-shim: no configuration profile named "${configProfileDecision.name}" (selected via ${configProfileDecision.source}). Run \`agent-shim profile add ${configProfileDecision.name}\` first.`
|
|
68668
68750
|
);
|
|
@@ -68789,7 +68871,7 @@ function decideLaunch(params, readOnly) {
|
|
|
68789
68871
|
extraFlags: splitExtraFlags(env.CLAUDE_EXTRA_FLAGS),
|
|
68790
68872
|
passthrough: withLauncherSettings(params.supervised === void 0 ? parsedArgv.rest : withSupervision(parsedArgv.rest, params.supervised), launcherSettings)
|
|
68791
68873
|
});
|
|
68792
|
-
const configDir = configDirEscapeHatchApplies || identityDecision.name === void 0 ? env.CLAUDE_CONFIG_DIR :
|
|
68874
|
+
const configDir = configDirEscapeHatchApplies || identityDecision.name === void 0 ? env.CLAUDE_CONFIG_DIR : import_node_path43.default.join(paths.identitiesDir, identityDecision.name);
|
|
68793
68875
|
const decision = {
|
|
68794
68876
|
identitySource: identityDecision.source,
|
|
68795
68877
|
configDirEscapeHatch: identityDecision.configDirEscapeHatch,
|
|
@@ -68842,7 +68924,7 @@ function prepareLaunch(params) {
|
|
|
68842
68924
|
let warnings = [];
|
|
68843
68925
|
const updateCheck = runLaunchUpdateCheck({
|
|
68844
68926
|
mode: params.updateMode ?? "off",
|
|
68845
|
-
checkPath:
|
|
68927
|
+
checkPath: import_node_path43.default.join(paths.root, "update.check"),
|
|
68846
68928
|
currentVersion: package_default.version,
|
|
68847
68929
|
port: params.update
|
|
68848
68930
|
});
|
|
@@ -68989,13 +69071,13 @@ function runLaunchPlan(plan, spawn9) {
|
|
|
68989
69071
|
function runLauncher(params) {
|
|
68990
69072
|
params.proc.exit(runLaunchPlan(prepareLaunch(params), params.spawn));
|
|
68991
69073
|
}
|
|
68992
|
-
var import_node_crypto20, import_node_util6,
|
|
69074
|
+
var import_node_crypto20, import_node_util6, import_node_path43;
|
|
68993
69075
|
var init_launcher = __esm({
|
|
68994
69076
|
"src/launcher.ts"() {
|
|
68995
69077
|
"use strict";
|
|
68996
69078
|
import_node_crypto20 = require("node:crypto");
|
|
68997
69079
|
import_node_util6 = require("node:util");
|
|
68998
|
-
|
|
69080
|
+
import_node_path43 = __toESM(require("node:path"), 1);
|
|
68999
69081
|
init_package();
|
|
69000
69082
|
init_envBool();
|
|
69001
69083
|
init_argv();
|
|
@@ -69029,6 +69111,7 @@ var init_launcher = __esm({
|
|
|
69029
69111
|
init_claudeVersion();
|
|
69030
69112
|
init_launchHook();
|
|
69031
69113
|
init_targets();
|
|
69114
|
+
init_names();
|
|
69032
69115
|
}
|
|
69033
69116
|
});
|
|
69034
69117
|
|
|
@@ -69036,7 +69119,7 @@ var init_launcher = __esm({
|
|
|
69036
69119
|
function keyOf2(command, args) {
|
|
69037
69120
|
return JSON.stringify([command, args]);
|
|
69038
69121
|
}
|
|
69039
|
-
async function
|
|
69122
|
+
async function recordRuns(decide, runAsync2) {
|
|
69040
69123
|
const answers = /* @__PURE__ */ new Map();
|
|
69041
69124
|
const replay = {
|
|
69042
69125
|
run: (command, args) => {
|
|
@@ -69049,7 +69132,8 @@ async function resolveWithAsyncRuns(decide, runAsync2) {
|
|
|
69049
69132
|
};
|
|
69050
69133
|
for (; ; ) {
|
|
69051
69134
|
try {
|
|
69052
|
-
|
|
69135
|
+
decide(replay);
|
|
69136
|
+
return replay;
|
|
69053
69137
|
} catch (error63) {
|
|
69054
69138
|
if (!(error63 instanceof RunNeededError)) {
|
|
69055
69139
|
throw error63;
|
|
@@ -69058,6 +69142,16 @@ async function resolveWithAsyncRuns(decide, runAsync2) {
|
|
|
69058
69142
|
}
|
|
69059
69143
|
}
|
|
69060
69144
|
}
|
|
69145
|
+
async function resolveWithAsyncRuns(decide, runAsync2) {
|
|
69146
|
+
let result;
|
|
69147
|
+
await recordRuns((run) => {
|
|
69148
|
+
result = { value: decide(run) };
|
|
69149
|
+
}, runAsync2);
|
|
69150
|
+
if (result === void 0) {
|
|
69151
|
+
throw new Error("the decision finished without a result");
|
|
69152
|
+
}
|
|
69153
|
+
return result.value;
|
|
69154
|
+
}
|
|
69061
69155
|
var RunNeededError;
|
|
69062
69156
|
var init_replayRun = __esm({
|
|
69063
69157
|
"src/replayRun.ts"() {
|
|
@@ -69129,7 +69223,7 @@ function realPrepareLaunchParams(paths, options) {
|
|
|
69129
69223
|
frontdoor: realFrontDoorPort(paths, options.spawnDaemon),
|
|
69130
69224
|
credentials: { ...realCredentialPort, cache: realCredentialCacheEnv(paths) },
|
|
69131
69225
|
hold: realHoldPort,
|
|
69132
|
-
hasStoredLogin: (identity) => identitySignIn(realFarmFs, { platform: process.platform, run: options.run ?? realRunPort }, { farmRoot:
|
|
69226
|
+
hasStoredLogin: (identity) => identitySignIn(realFarmFs, { platform: process.platform, run: options.run ?? realRunPort }, { farmRoot: import_node_path44.default.join(paths.identitiesDir, identity), hasCredentialBlock: false }).state !== "signed-out",
|
|
69133
69227
|
...farm.directoryIdentity === void 0 ? {} : { directoryPinnedIdentity: farm.directoryIdentity },
|
|
69134
69228
|
...farm.directoryConfigProfile === void 0 ? {} : { directoryRuleConfigProfile: farm.directoryConfigProfile },
|
|
69135
69229
|
...farm.globalDefaultConfigProfile === void 0 ? {} : { globalDefaultConfigProfile: farm.globalDefaultConfigProfile },
|
|
@@ -69170,12 +69264,12 @@ function resolveClaudeLaunch(options, run = realRunPort) {
|
|
|
69170
69264
|
async function resolveClaudeLaunchAsync(options, runAsync2 = realRunAsync) {
|
|
69171
69265
|
return await resolveWithAsyncRuns((run) => resolveClaudeLaunch(options, run), runAsync2);
|
|
69172
69266
|
}
|
|
69173
|
-
var import_node_os9,
|
|
69267
|
+
var import_node_os9, import_node_path44, import_node_crypto21, LaunchRefusedError;
|
|
69174
69268
|
var init_launchWiring = __esm({
|
|
69175
69269
|
"src/launchWiring.ts"() {
|
|
69176
69270
|
"use strict";
|
|
69177
69271
|
import_node_os9 = __toESM(require("node:os"), 1);
|
|
69178
|
-
|
|
69272
|
+
import_node_path44 = __toESM(require("node:path"), 1);
|
|
69179
69273
|
import_node_crypto21 = require("node:crypto");
|
|
69180
69274
|
init_cliError();
|
|
69181
69275
|
init_claudeShim();
|
|
@@ -69211,11 +69305,14 @@ function identityLaunchArgv(identity, flags) {
|
|
|
69211
69305
|
}
|
|
69212
69306
|
async function withIdentityClaude(params, identity, flags, use2) {
|
|
69213
69307
|
const refusals = [];
|
|
69308
|
+
const env = Object.fromEntries(Object.entries(process.env).filter(([name]) => name !== CONFIG_DIR_VARIABLE));
|
|
69309
|
+
const argv = [...identityLaunchArgv(identity, flags)];
|
|
69310
|
+
const run = await recordRuns((replay) => resolveClaudeLaunch({ argv, cwd: params.cwd, env: definedEnvironment(env), paths: params.paths }, replay), params.runAsync ?? realRunAsync);
|
|
69214
69311
|
const plan = prepareLaunch(
|
|
69215
69312
|
realPrepareLaunchParams(params.paths, {
|
|
69216
69313
|
proc: {
|
|
69217
|
-
env
|
|
69218
|
-
argv
|
|
69314
|
+
env,
|
|
69315
|
+
argv,
|
|
69219
69316
|
exit: (code) => {
|
|
69220
69317
|
throw new LaunchRefusedError(refusals.join("\n") || `the launch was refused (exit ${String(code)})`, code);
|
|
69221
69318
|
}
|
|
@@ -69229,7 +69326,8 @@ async function withIdentityClaude(params, identity, flags, use2) {
|
|
|
69229
69326
|
}
|
|
69230
69327
|
},
|
|
69231
69328
|
spawnDaemon: params.spawnDaemon,
|
|
69232
|
-
|
|
69329
|
+
run,
|
|
69330
|
+
farm: buildFarmRuntime(params.paths, params.cwd, run)
|
|
69233
69331
|
})
|
|
69234
69332
|
);
|
|
69235
69333
|
const abort = new AbortController();
|
|
@@ -69249,6 +69347,8 @@ var init_identityClaude = __esm({
|
|
|
69249
69347
|
"use strict";
|
|
69250
69348
|
init_launchWiring();
|
|
69251
69349
|
init_launcher();
|
|
69350
|
+
init_realPorts();
|
|
69351
|
+
init_replayRun();
|
|
69252
69352
|
CONFIG_DIR_VARIABLE = "CLAUDE_CONFIG_DIR";
|
|
69253
69353
|
IDENTITY_ONLY_FLAG = "--no-provider";
|
|
69254
69354
|
}
|
|
@@ -83828,7 +83928,7 @@ async function jGe(e14, t10, n10, r10) {
|
|
|
83828
83928
|
if (d.length === 0) return [];
|
|
83829
83929
|
return iv(Buffer.from(gZ(d)), { limit: r10.limit, offset: r10.offset }, l, c10);
|
|
83830
83930
|
}
|
|
83831
|
-
var import_node_module, import_crypto, import_crypto2, import_path, import_node_fs17, import_node_process4, import_fs, import_os, import_path2, yy, import_fs2, import_promises, import_path3, import_readline, import_promises2, import_path4, import_os2, import_path5, Se, import_promises3, xe, import_promises4, import_fs3, import_promises5, import_os3, import_path6, import_promises6, import_os4, import_node_path47, import_node_os10, import_node_process5, import_path7, import_events, import_fs4, import_promises7, import_path8, import_child_process, import_util9, import_child_process2, import_fs5, import_path9, import_path10, import_crypto3, import_fs6, import_path11, import_promises8, import_path12, import_path13, import_promises9, import_path14, import_path15, import_fs7, import_promises10, import_path16, import_crypto4, import_path17, import_async_hooks, import_fs8, import_promises11, import_crypto5, import_fs9, import_promises12, import_path18, import_promises13, import_path19, import_crypto6, import_path20, import_path21, import_path22, import_path23, import_promises14, import_fs10, import_promises15, import_path24, import_util10, import_path25, import_os5, import_path26, import_path27, import_path28, import_path29, import_path30, import_net, import_os6, import_child_process3, import_fs11, import_child_process4, import_crypto7, import_promises16, import_module, import_os7, import_path31, import_url, import_events2, import_child_process5, import_fs12, import_readline2, import_string_decoder, import_fs13, import_promises17, import_os8, import_path32, import_crypto8, import_os9, import_fs14, import_path33, import_crypto9, import_fs15, import_promises18, import_path34, IZ, DZ, v_, LZ, OT, NZ, UZ, kT, X, FZ, dr, HZ, jZ, BZ, ot, st, ed, Kv, Te, Me, Oo, nd, hF, Xv, Qv, rd, LF, or, WF, ZF, sA, XF, od, sd, hg, id, Sg, Oz, fA, $z, Wz, Zz, s$, a$, d$, f$, g$, _$, E$, v$, T$, O$, I$, L$, wg, z$, j$, G$, V$, yA, SA, rH, lH, uH, _H, EH, EA, RH, TH, kH, DH, NH, zH, jH, GH, VH, ZH, JH, ej, nj, ij, cj, uj, CA, bj, Aj, wj, PT, KZ, GZ, VGe, VZ, MT, wr, jo, JZ, XZ, NT, UT, FT, zT, Bo, $T, HT, jT, BT, a4, sp, l4, c4, vt, u4, Nt, KT, d4, p4, uc, GT, m4, g4, WT, _4, y4, VT, Dn, Et, b4, C4, v4, A4, ra, x4, ip, qT, ZT, w4, O4, ro, P4, I4, D4, L4, M4, N4, U4, YT, JT, Sn, H4, Ko, j4, oo, XT, QT, G4, W4, V4, ew, Z4, Y4, tw, X4, nw, R_, rw, ow, Go, sw, iw, aw, lw, ei, aY, cw, Or, cY, uw, dw, lp, pw, cp, mY, gY, up, _Y, aa, fw, la, EY, bY, CY, vY, AY, RY, xY, TY, wY, OY, kY, PY, IY, mw, x_, gw, ca, MY, et, dp, hw, pp, zY, $Y, _w, HY, ua, yw, wt, KY, T_, Sw, WY, VY, qY, so, mp, Ew, vw, bw, YY, Cw, JY, XY, kr, QY, e9, Wo, n9, da, o9, s9, i9, a9, l9, c9, u9, d9, p9, f9, m9, g9, h9, _9, y9, S9, E9, b9, C9, v9, A9, R9, x9, T9, Qe, Aw, pa, hp, Rw, dc, k9, w_, P9, Pr, xw, I9, fa, D9, L9, _p, N9, ma, yp, z9, Tw, $9, H9, ww, Vo, Ir, pc, W9, V9, q9, Ow, Y9, Sp, J9, Ep, X9, qo, Q9, bp, kw, eJ, Pw, Iw, Dw, Lw, tJ, nJ, rJ, oJ, sJ, ti, io, iJ, Mw, Nw, Cp, aJ, Uw, Fw, ga, pr, uJ, Fe, $w, O_, k_, I_, ha, Bw, D_, qw, Vw, N_, U_, yJ, _a3, Yo, Zw, bJ, Rp, Yw, vJ, AJ, Jw, xp, Xw, Tp, Qw, kJ, ya, IJ, DJ, Sa, MJ, fc, NJ, eO, FJ, zJ, $J, tO, Ea, jJ, nO, rO, sO, iO, Vn, GJ, Ln, Jo, aO, lO, cO, wp, XJ, QJ, uO, ba, dO, pO, fO, Dr, ao, mO, Ca, gO, z_, $_, H_, j_, B_, K_, G_, W_, V_, q_, Z_, _O, Y_, J_, yO, X_, c3, Q_, ey, ty, ny, ry, oy, sy, iy, ay, ly, cy, we, SO, en, d3, Pp, vO, g3, gy, wO, S3, BO, KO, Ip, Dp, v3, GO, WO, F9e, IO, A3, hy, x3, NO, I3, Ay, Ry, D3, xy, L3, bc, xa, Ty, wy, Oy, ky, XO, Py, Iy, Dy, Ly, My, Ny, Uy, Fy, zy, nk, rk, d3e, p3e, f3e, m3e, g3e, U3, jp, jy, ik, By, Ky, lk, $3, uk, ck, G3, W3, V3, it, Y3, J3, hk, tXe, Q3, kt, We, gX, Ta, SX, mr, Yp, Jp, eS, nS, yXe, IX, DX, rS, ka, oS, Ok, kk, HX, jX, ef, bXe, Uk, Mr, wc, Fk, Pa, OXe, kXe, iS, PXe, IXe, DXe, GX, YX, JX, XX, QX, e6, t6, Yk, n6, r6, o6, s6, i6, a6, l6, c6, Vk, uS, lf, dS, Qk, eP, uf, os10, qXe, ZXe, h6, tP, df, _6, y6, S6, E6, b6, Jn, gr, nP, rP, Dc, pS, oP, gS, lP, C6, mS, lS, sP, w6, O6, dP, k6, YXe, JXe, P6, I6, pf, L6, fP, XXe, QXe, M6, SS, z6, $6, j6, bP, CP, G6, Lc, si, Z6, ES, bS, X6, Q6, e5, t5, n5, u5, r5, o5, s5, i5, a5, l5, c5, u52, d5, p5, f5, m5, g5, h5, _5, y5, S5, E5, b5, C5, v5, A5, R5, x5, T5, w5, O5, k5, P5, I5, D5, L5, M5, N5, U5, F5, z5, $5, H5, j5, B5, K5, G5, W5, V5, q5, Z5, Y5, J5, X5, Q5, e8, t8, n8, r8, o8, s8, i8, a8, l8, c8, u8, d8, CS, p8, f8, m8, g8, h8, _8, y8, S8, E8, b8, C8, v8, A8, R8, x8, T8, w8, O8, k8, P8, I8, D8, L8, M8, N8, U8, F8, z8, $8, H8, j8, B8, K8, G8, W8, V8, q8, Z8, Y8, J8, X8, Q8, e7, t7, n7, r7, o7, s7, i7, a7, l7, c7, u7, d7, p7, f7, m7, g7, h7, _7, y7, S7, E7, b7, C7, TP, v7, L6e, RP, A7, x7, kP, ff, U6e, F6e, Ua, z6e, $6e, H6e, j6e, PP, IP, vS, DP, w7, LP, O7, k7, P7, AS, RS, xS, I7, MP, NP, D7, G6e, L7, W6e, M7, N7, UP, V6e, U7, F7, z7, $7, H7, j7, B7, q6e, is, wS, Fa, K7, G7, W7, i5e, X7, Q7, HP, $P, BP, tQ, WP, VP, JP, _Q, QP, eI, xQ, Uc, DS, $a, wQ, OQ, kQ, PQ, IQ, DQ, LQ, MQ, NQ, UQ, FQ, zQ, $Q, HQ, jQ, BQ, KQ, GQ, WQ, VQ, qQ, ZQ, YQ, JQ, XQ, QQ, eee, tee, nee, ree, oee, see, iee, aee, lee, cee, uee, dee, pee, fee, mee, gee, hee, _ee, yee, See, Eee, bee, Cee, vee, Aee, Ree, xee, Tee, wee, Oee, kee, Pee, Iee, Dee, Lee, Mee, Nee, Uee, Fee, zee, $ee, Hee, jee, Bee, Kee, Gee, Wee, Vee, qee, Zee, Yee, Jee, Xee, Qee, ete, tte, nte, rte, ote, ste, ite, ate, lte, cte, ute, dte, pte, fte, mte, gte, hte, _te, yte, Ste, Ete, bte, Cte, vte, Ate, Rte, xte, Tte, wte, Ote, kte, Pte, Ite, Dte, Lte, Mte, Nte, Ute, Fte, zte, $te, Hte, jte, Bte, Kte, Gte, Wte, Vte, qte, Zte, Yte, Jte, Xte, Qte, ene, tne, nne, rne, one, sne, ine, ane, lne, cne, une, dne, pne, fne, mne, gne, hne, _ne, yne, Sne, Ene, bne, Cne, vne, Ane, Rne, xne, Tne, wne, One, kne, Pne, Ine, Dne, Lne, Mne, Nne, Une, Fne, zne, $ne, Hne, jne, Bne, Kne, Gne, Wne, Vne, qne, Zne, Yne, Jne, Xne, Qne, ere, tre, nre, rre, ore, sre, ire, are, lre, cre, ure, dre, pre, fre, mre, gre, hre, _re, yre, Sre, Ere, bre, Cre, vre, Are, Rre, xre, Tre, wre, Ore, kre, Pre, Ire, Dre, Lre, Mre, Nre, Ure, Fre, zre, $re, Hre, jre, Bre, Kre, Gre, Wre, Vre, qre, Zre, Yre, Jre, Xre, Qre, eoe, toe, noe, roe, ooe, soe, ioe, aoe, loe, coe, uoe, doe, poe, foe, moe, goe, hoe, _oe, yoe, Soe, Eoe, boe, Coe, voe, Aoe, Roe, xoe, Toe, woe, Ooe, koe, Poe, Ioe, Doe, Loe, Moe, Noe, Uoe, Foe, zoe, $oe, Hoe, joe, Boe, Koe, Goe, Woe, Voe, qoe, Zoe, Yoe, Joe, Xoe, Qoe, ese, tse, nse, rse, ose, sse, ise, ase, lse, cse, use, dse, pse, fse, mse, gse, hse, _se, yse, Sse, Ese, LS, bse, Cse, vse, Ase, Rse, xse, Tse, wse, Ose, kse, Pse, Ise, Dse, Lse, Mse, Nse, Use, Fse, zse, $se, Hse, jse, Bse, Kse, Gse, Wse, Vse, qse, Zse, Yse, Jse, Xse, Qse, eie, tie, nie, rie, oie, sie, iie, aie, lie, cie, uie, die, pie, fie, mie, gie, hie, _ie, yie, Sie, Eie, bie, Cie, vie, Aie, Rie, xie, Tie, wie, Oie, kie, Pie, Iie, Die, Lie, Mie, Nie, Uie, Fie, zie, $ie, Hie, jie, Bie, Kie, Gie, Wie, Vie, qie, Zie, Yie, Jie, Xie, Qie, eae, tae, nae, rae, oae, sae, iae, aae, lae, cae, uae, dae, pae, fae, mae, gae, hae, _ae, yae, Sae, Eae, bae, Cae, vae, Aae, Rae, xae, Tae, wae, Oae, kae, Pae, Iae, Dae, Lae, Mae, Nae, Uae, Fae, zae, $ae, Hae, jae, Bae, Kae, Gae, Wae, Vae, qae, Zae, Yae, Jae, Xae, Qae, ele, tle, nle, rle, ole, sle, ile, ale, lle, cle, ule, dle, ple, fle, mle, gle, hle, _le, yle, Sle, Ele, ble, Cle, vle, Ale, Rle, xle, Tle, wle, Ole, kle, Ple, Ile, Dle, Lle, Mle, Nle, Ule, Fle, zle, $le, Hle, jle, Ble, Kle, Gle, Wle, Vle, qle, Zle, Yle, Jle, MS, Xle, Qle, ece, tce, nce, rce, oce, sce, ice, ace, lce, cce, uce, dce, pce, fce, mce, gce, hce, _ce, yce, Sce, Ece, bce, Cce, vce, Ace, Rce, xce, Tce, wce, Oce, kce, Pce, Ice, Dce, Lce, Mce, Nce, Uce, Fce, zce, $ce, Hce, jce, Bce, Kce, Gce, Wce, Vce, qce, Zce, Yce, Jce, Xce, Qce, eue, tue, nue, rue, oue, sue, iue, aue, lue, cue, uue, due, pue, fue, mue, gue, hue, _ue, yue, Sue, Eue, bue, Cue, vue, Aue, Rue, xue, Tue, wue, Oue, kue, Pue, Iue, Due, Lue, Mue, Nue, Uue, Fue, zue, $ue, Hue, jue, Bue, Kue, Gue, Wue, Vue, que, Zue, Yue, Jue, Xue, Que, ede, tde, nde, rde, ode, sde, ide, ade, lde, cde, ude, dde, pde, fde, mde, gde, hde, _de, yde, Sde, Ede, bde, Cde, vde, Ade, Rde, xde, Tde, wde, Ode, kde, Pde, Ide, Dde, Lde, Mde, Nde, Ude, Fde, zde, $de, Hde, jde, Bde, Kde, Gde, Wde, Vde, qde, Zde, Yde, Jde, Xde, Qde, epe, tpe, npe, rpe, ope, spe, ipe, ape, lpe, cpe, upe, dpe, ppe, fpe, mpe, gpe, hpe, _pe, ype, Spe, Epe, bpe, Cpe, vpe, Ape, Rpe, xpe, Tpe, wpe, Ope, kpe, Ppe, Ipe, Dpe, Lpe, Mpe, Npe, Upe, Fpe, zpe, $pe, Hpe, jpe, Bpe, Kpe, Gpe, Wpe, Vpe, qpe, Zpe, Ype, Jpe, Xpe, Qpe, efe, tfe, nfe, rfe, ofe, sfe, ife, afe, lfe, cfe, ufe, dfe, pfe, ffe, mfe, gfe, hfe, _fe, yfe, Sfe, Efe, bfe, Cfe, vfe, Afe, Rfe, xfe, Tfe, wfe, Ofe, kfe, Pfe, Ife, Dfe, Lfe, Mfe, Nfe, Ufe, Ffe, zfe, $fe, Hfe, jfe, Bfe, Kfe, Gfe, Wfe, Vfe, qfe, Zfe, Yfe, Jfe, Xfe, Qfe, eme, tme, nme, rme, ome, sme, ime, ame, lme, cme, ume, dme, pme, fme, mme, gme, hme, _me, yme, Sme, Eme, bme, Cme, vme, Ame, Rme, xme, Tme, wme, Ome, kme, Pme, Ime, Dme, Lme, Mme, Nme, Ume, Fme, zme, $me, Hme, jme, Bme, Kme, Gme, Wme, Vme, qme, Zme, Yme, Jme, NS, Xme, Qme, ege, tge, nge, rge, oge, sge, ige, age, lge, cge, uge, dge, pge, fge, mge, gge, hge, _ge, yge, Sge, Ege, bge, Cge, vge, Age, Rge, xge, Tge, wge, Oge, kge, Pge, Ige, Dge, Lge, Mge, Nge, Uge, Fge, zge, $ge, Hge, US, jge, Bge, Kge, Gge, Wge, Vge, qge, Zge, Yge, Jge, Xge, Qge, ehe, the, nhe, rhe, ohe, she, ihe, ahe, lhe, che, uhe, dhe, phe, fhe, mhe, ghe, hhe, _he, yhe, She, Ehe, bhe, Che, vhe, Ahe, Rhe, xhe, The, whe, Ohe, khe, Phe, Ihe, Dhe, Lhe, Mhe, Nhe, FS, rI, oI, Uhe, Fhe, zhe, $he, Hhe, jhe, Bhe, Khe, Ghe, Whe, Vhe, qhe, Zhe, Yhe, Jhe, Xhe, Qhe, e_e, t_e, n_e, r_e, o_e, s_e, i_e, a_e, l_e, c_e, u_e, d_e, p_e, f_e, m_e, g_e, h_e, __e, y_e, S_e, E_e, b_e, C_e, v_e, A_e, R_e, x_e, T_e, w_e, O_e, k_e, P_e, I_e, D_e, L_e, M_e, N_e, U_e, F_e, z_e, $_e, H_e, j_e, B_e, K_e, G_e, W_e, V_e, q_e, Z_e, Y_e, J_e, Q_e, Xn, eye, F8e, tye, z8e, nye, iI, rye, oye, lI, cye, uye, dye, _ye, on, vye, Aye, dI, C7e, v7e, ho, kI, PI, Dye, Sf, Lye, jc, Mye, Nye, LI, NI, Fye, VS, zye, $ye, x7e, zI, YS, KI, GI, VI, Hye, qS, ls, Kye, Gye, oD, nE, sD, So, Yc, vn, Zye, oE, sE, iD, aD, wf, Jc, Xc, kf, Qc, Pf, eu, fi, tu, mi, lD, cD, uD, dD, pD, fD, mD, gD, hD, _D, yD, SD, ED, bD, vD, AD, cE, RD, Xye, TD, wD, OD, kD, PD, uE, ID, DD, LD, MD, FD, If, nu, zD, $D, HD, jD, BD, zt, dE, Df, pE, fE, KD, GD, WD, VD, qD, ru, ZD, YD, JD, XD, QD, eL, tL, mE, yr, He, rL, ou, Je, yE, SE, EE, fL, mL, tSe, bE, CE, vE, AE, RE, xE, TE, wE, gL, hL, _L, yL, OE, sSe, kE, PE, IE, DE, LE, ME, NE, Nf, UE, FE, zE, $E, HE, jE, BE, cSe, gE, KE, vL, Uf, GE, WE, VE, qE, ZE, YE, Ff, JE, XE, QE, eb, tb, nb, zf, AL, rb, ob, sb, TL, ab, RL, xL, $f, Hf, dSe, fSe, OL, kL, Sr, FL, ML, zL, lu, hSe, iC, aC, lC, HL, jL, cC, uC, BL, dC, KL, pC, GL, fC, mC, WL, VL, qL, ZL, gC, YL, hC, JL, XL, _C, yC, SC, EC, QL, sC, bC, CC, vC, AC, RC, xC, TC, wC, OC, tM, qf, kC, $L, rM, ASe, Fn, oM, sM, iM, aM, lM, cM, uM, dM, pM, fM, mM, gM, Be, SM, LC, ct, MC, EM, bM, CM, pEe, fEe, Yf, mEe, gEe, hEe, _Ee, yEe, SEe, EEe, bEe, CEe, vEe, AEe, REe, xEe, TEe, wEe, OEe, NC, kEe, vM, PEe, IEe, DEe, LEe, MEe, fu, AM, NEe, UEe, IC, DC, FEe, zEe, qa, TM, HEe, jEe, KEe, wM, em, mu, qEe, ZEe, JEe, OM, Qn, kM, LM, nbe, rbe, abe, lbe, cbe, rm, pbe, At, hbe, BC, BM, Zet, WM, VM, qM, ZM, Cbe, vbe, YM, Abe, Rbe, JM, xbe, Tbe, QM, Ibe, eN, Lbe, nN, Mbe, Nbe, sm, rN, iN, Fbe, aN, $be, jbe, Kbe, Gbe, yu, lN, uN, dN, Xbe, KM, Qbe, eCe, tCe, oCe, iCe, _N, yN, wN, Ytt, ON, OCe, DCe, LN, $Ce, HCe, Cu, BCe, MN, VCe, QCe, ive, uve, VN, pve, fve, _rt, gve, Sve, nv, tv, GN, tU, Fve, Hve, iU, tAe, sAe, iAe, aAe, cAe, Ie, bU, Q, vo, F, zn, fAe, ms, mAe, _m, nn, he, Xa, an, lv, cv, Si, wu, se, br, CU, Oe, gAe, hAe, _Ae, yAe, SAe, EAe, bAe, CAe, vAe, uv, AAe, RAe, xAe, TAe, wAe, OAe, vU, kAe, Ro, el, tl, ym, ku, Sm, Pu, Iu, Em, Ei, xo, bm, Fr, ft, Du, Ao, pv, Lu, To, Cm, vm, nl, Ou, Mu, Nu, bi, Uu, rl, $r, zr, gs, Fu, zu, Am, fv, Rm, $u, wot, H, Oot, kot, Pot, Iot, Dot, Lot, Mot, Not, Uot, Fot, zot, $ot, Hot, jot, xU, Bot, Kot, Got, Wot, Vot, qot, Zot, Yot, Jot, Xot, Qot, est, tst, nst, rst, ost, sst, ist, ast, FAe, zAe, gv, OU, Ss, km, Mt, kU, PU, kst, HAe, jAe, hv, $n, Hu, IU, Yt, tr, nr, Jt, Pm, DU, _v, LU, MU, yv, ju, le, Sv, NU, Pst, Ist, Im, BAe, Dm, KAe, Bu, ol, UU, GAe, WAe, VAe, qAe, ZAe, YAe, Ev, JAe, XAe, bv, Lm, QAe, eRe, Mm, tRe, Ku, Gu, nRe, Wu, sl, rRe, Vu, Nm, Um, Fm, Dst, zm, $m, Hm, FU, zU, $U, Cv, HU, qu, il, jU, oRe, jm, sRe, Bm, iRe, vv, aRe, Km, lRe, cRe, uRe, dRe, pRe, fRe, mRe, gRe, hRe, _Re, Gm, yRe, SRe, Wm, Av, Rv, xv, ERe, bRe, CRe, Tv, vRe, ARe, RRe, xRe, TRe, BU, Vm, wRe, qm, Lst, ORe, al, kRe, Mst, Zu, PRe, wv, IRe, DRe, LRe, MRe, NRe, URe, FRe, Om, zRe, $Re, HRe, Yu, Ov, jRe, BRe, KRe, GRe, WRe, VRe, qRe, ZRe, YRe, JRe, XRe, QRe, exe, txe, nxe, rxe, oxe, sxe, ll, ixe, axe, lxe, Zm, cxe, uxe, dxe, kv, pxe, Nst, Ust, Fst, zst, $st, Hst, ae, WU, qU, VU, ZU, YU, Ym, e0, fxe, mxe, Dv, Cr, gxe, Ju, d0, h0, _0, v0, A0, Sxe, Exe, Mv, Cxe, Fv, Oj, kj, PA, IA, DA, Lj, Dj, aLe, NA, FA, uLe, dd, fLe, Po, SLe, ELe, zA, bLe, xLe, TLe, wLe, OLe, kLe, $j, qj, ILe, DLe, LLe, MLe, Ce, NLe, Wg, Oi, VA, Do, Jj, Xj, Qj, eB, tB, nB, qA, ZA, jA, Bj, jLe, BLe, GLe, rB, BA, Gg, GA, WA, VLe, qLe, Kj, Hs, sB, QLe, YA, iB, uB, eMe, dB, pB, fB, mB, tMe, XA, aB, QA, gB, hB, _B, yB, jn, lMe, SB, dMe, bB, mMe, fd, RB, hMe, Rr, TB, SMe, EMe, Pl, wB, Vg, AMe, Il, RMe, xMe, qg, OB, wMe, OMe, kB, eo, Dl, Zg, DB, NMe, FB, WMe, VMe, $B, HB, jB, BB, Ml, GB, nR, WB, Jg, KB, eNe, Bs, VB, gd, Nl, Xg, tNe, YB, qB, Pi, rK, iK, pNe, hd, _d, to, yd, nh, uK, aK, _Ne, lK, cK, Sd, Ul, rh, oh, dK, CNe, pK, sh, fK, RNe, xNe, TNe, mK, wNe, ONe, ih, Ed, lr, gK, hK, yK, SK, EK, ah, bK, FNe, CK, zNe, $Ne, HNe, vK, BNe, lh, AK, RK, xK, VNe, dn, TK, wK, OK, kK, PK, QNe, eUe, IK, DK, rUe, LK, MK, NK, UK, iUe, aUe, lUe, cUe, uUe, dUe, pUe, fUe, mUe, gUe, hUe, _Ue, yUe, SUe, EUe, bUe, CUe, vUe, AUe, FK, xUe, zK, $K, wUe, HK, OUe, jK, BK, PUe, KK, IUe, DUe, LUe, GK, MUe, NUe, UUe, FUe, WK, zUe, $Ue, HUe, VK, jUe, BUe, KUe, GUe, WUe, VUe, qUe, ZUe, YUe, JUe, XUe, QUe, e0e, t0e, n0e, r0e, Xe, qK, ZK, YK, JK, a0e, l0e, uh, XK, QK, e1, n1, r1, dh, m0e, g0e, h0e, _0e, bd, o1, S0e, Fl, s1, b0e, i1, Di, a1, l1, c1, u1, d1, p1, f1, P0e, I0e, m1, D0e, g1, h1, _1, vyt, U0e, y1, Ayt, iR, F0e, z0e, $0e, Gs, zl, fh, E1, b1, H0e, j0e, B0e, K0e, mh, $l, gh, Ws, aR, hh, _h, G0e, W0e, lR, R1, x1, V0e, uR, k1, P1, I1, D1, L1, Y0e, dR, J0e, Fyt, pR, X0e, fR, mR, Q0e, zyt, eFe, gR, hR, _R, $yt, M1, yR, N1, U1, tFe, nFe, rFe, oFe, iFe, Mi, cFe, $1, Wyt, Vyt, H1, j1, B1, K1, uFe, G1, W1, V1, q1, dFe, pFe, SR, fFe, eSt, tSt, mFe, jl, Vs, gFe, Y1, hFe, _Fe, X1, Q1, eG, yFe, SFe, tG, EFe, bFe, CFe, vFe, bR, CR, RFe, xFe, vR, TFe, Eh, nSt, Cd, wFe, OFe, aSt, rG, PFe, IFe, _St, oG, sG, bSt, CSt, HFe, jFe, $St, BFe, KFe, HSt, JSt, XSt, lG, OR, VFe, YFe, uG, eze, nze, gG, vd, vh, kR, zi, sze, yG, ize, yEt, Ad, $i, bG, Kn, AEt, REt, xEt, aze, AG, wG, $R, dze, $G, pze, fze, mze, gze, hze, BR, HG, jG, fbt, yze, Sze, Eze, Gn, ji, kG, PG, NR, UR, KR, GG, Cze, vze, Rze, GR, xze, Tze, xh, WR, Oze, kze, mbt, Pze, Ize, Dze, Lze, Mze, Nze, qG, Uze, Fze, zze, $ze, ZG, Hze, IG, jze, Bze, YG, Kze, Gze, DG, Wze, Vze, JG, qze, Zze, Yze, Jze, QG, Xze, Qze, e$e, t$e, r$e, o$e, s$e, i$e, a$e, eW, nW, c$e, m$e, xd, VR, gbt, hbt, _bt, h$e, qR, Th, MR, aW, _$e, S$e, lW, E$e, b$e, C$e, v$e, A$e, x$e, w$e, O$e, k$e, P$e, I$e, N$e, ybt, FR, Sbt, U$e, MG, Td, Ebt, bbt, uW, z$e, $$e, H$e, Cbt, j$e, B$e, vbt, Abt, K$e, Rbt, Oh, kh, G$e, YR, Ph, W$e, Ih, Mbt, Nbt, Ubt, Dh, V$e, Z$e, tx, EW, Id, Fh, X$e, xCt, Q$e, eHe, ix, ax, lx, cx, zh, $h, MW, tHe, nHe, aHe, uHe, dHe, Zs, pHe, CW, vW, AW, Nh, UW, fHe, mHe, gHe, hHe, _He, yHe, SHe, EHe, pn, dx, nx, Mh, Bi, AHe, TCt, xHe, Pd, RW, THe, xW, wHe, OHe, Hh, kHe, TW, fx, Bh, Ki, KW, Gl, PHe, Kh, kW, Wl, NHe, Ld, UHe, tV, rV, jHe, XHe, cvt, tje, fV, mV, sje, aje, _V, yV, pje, zvt, $vt, gje, yje, Sje, Kvt, Gvt, eAt, RV, Eje, bje, mAt, Cje, gAt, xV, wV, OV, Js, Lje, FV, Yh, Jh, Md, Tx, zV, $V, HV, Xh, jV, cr, KV, Mo, Fje, zje, yRt, jje, Gje, Vje, sBe, YV, e22, o_, gBe, t2, s_, kx, o2, LBe, UBe, $x, Vi, R2, KBe, GBe, Dx, ZBe, k2, n_, l2, sKe, lKe, z2, bKe, RKe, ec, W2, H2, xKe, wKe, PKe, IKe, $Ke, X2, HKe, jKe, BKe, KKe, VKe, eTt, qKe, tTt, nTt, ZKe, rTt, YKe, oTt, JKe, Wx, XKe, iTt, eq, tq, QKe, nq, rq, e1e, t1e, oq, sq, n1e, r1e, aTt, lTt, c1e, Zx, cq, u1e, uq, a_, d1e, Xx, nc, S1e, c_, mq, gq, Qx, hq, _q, E1e, Sq, u_, rc, d_, b1e, bq, Uo, Cq, vq, A1e, Yd, Jd, R1e, x1e, Aq, gn, T1e, w1e, O1e, Xs, k1e, P1e, xq, Pwt, I1e, Oq, kq, Pq, D1e, L1e, Iq, M1e, N1e, nT, U1e, p_, rT, Dq, oT, iT, F1e, Uq, aT, jq, K1e, Gq, yOt, sGe, cGe, uGe, yGe;
|
|
83931
|
+
var import_node_module, import_crypto, import_crypto2, import_path, import_node_fs17, import_node_process4, import_fs, import_os, import_path2, yy, import_fs2, import_promises, import_path3, import_readline, import_promises2, import_path4, import_os2, import_path5, Se, import_promises3, xe, import_promises4, import_fs3, import_promises5, import_os3, import_path6, import_promises6, import_os4, import_node_path45, import_node_os10, import_node_process5, import_path7, import_events, import_fs4, import_promises7, import_path8, import_child_process, import_util9, import_child_process2, import_fs5, import_path9, import_path10, import_crypto3, import_fs6, import_path11, import_promises8, import_path12, import_path13, import_promises9, import_path14, import_path15, import_fs7, import_promises10, import_path16, import_crypto4, import_path17, import_async_hooks, import_fs8, import_promises11, import_crypto5, import_fs9, import_promises12, import_path18, import_promises13, import_path19, import_crypto6, import_path20, import_path21, import_path22, import_path23, import_promises14, import_fs10, import_promises15, import_path24, import_util10, import_path25, import_os5, import_path26, import_path27, import_path28, import_path29, import_path30, import_net, import_os6, import_child_process3, import_fs11, import_child_process4, import_crypto7, import_promises16, import_module, import_os7, import_path31, import_url, import_events2, import_child_process5, import_fs12, import_readline2, import_string_decoder, import_fs13, import_promises17, import_os8, import_path32, import_crypto8, import_os9, import_fs14, import_path33, import_crypto9, import_fs15, import_promises18, import_path34, IZ, DZ, v_, LZ, OT, NZ, UZ, kT, X, FZ, dr, HZ, jZ, BZ, ot, st, ed, Kv, Te, Me, Oo, nd, hF, Xv, Qv, rd, LF, or, WF, ZF, sA, XF, od, sd, hg, id, Sg, Oz, fA, $z, Wz, Zz, s$, a$, d$, f$, g$, _$, E$, v$, T$, O$, I$, L$, wg, z$, j$, G$, V$, yA, SA, rH, lH, uH, _H, EH, EA, RH, TH, kH, DH, NH, zH, jH, GH, VH, ZH, JH, ej, nj, ij, cj, uj, CA, bj, Aj, wj, PT, KZ, GZ, VGe, VZ, MT, wr, jo, JZ, XZ, NT, UT, FT, zT, Bo, $T, HT, jT, BT, a4, sp, l4, c4, vt, u4, Nt, KT, d4, p4, uc, GT, m4, g4, WT, _4, y4, VT, Dn, Et, b4, C4, v4, A4, ra, x4, ip, qT, ZT, w4, O4, ro, P4, I4, D4, L4, M4, N4, U4, YT, JT, Sn, H4, Ko, j4, oo, XT, QT, G4, W4, V4, ew, Z4, Y4, tw, X4, nw, R_, rw, ow, Go, sw, iw, aw, lw, ei, aY, cw, Or, cY, uw, dw, lp, pw, cp, mY, gY, up, _Y, aa, fw, la, EY, bY, CY, vY, AY, RY, xY, TY, wY, OY, kY, PY, IY, mw, x_, gw, ca, MY, et, dp, hw, pp, zY, $Y, _w, HY, ua, yw, wt, KY, T_, Sw, WY, VY, qY, so, mp, Ew, vw, bw, YY, Cw, JY, XY, kr, QY, e9, Wo, n9, da, o9, s9, i9, a9, l9, c9, u9, d9, p9, f9, m9, g9, h9, _9, y9, S9, E9, b9, C9, v9, A9, R9, x9, T9, Qe, Aw, pa, hp, Rw, dc, k9, w_, P9, Pr, xw, I9, fa, D9, L9, _p, N9, ma, yp, z9, Tw, $9, H9, ww, Vo, Ir, pc, W9, V9, q9, Ow, Y9, Sp, J9, Ep, X9, qo, Q9, bp, kw, eJ, Pw, Iw, Dw, Lw, tJ, nJ, rJ, oJ, sJ, ti, io, iJ, Mw, Nw, Cp, aJ, Uw, Fw, ga, pr, uJ, Fe, $w, O_, k_, I_, ha, Bw, D_, qw, Vw, N_, U_, yJ, _a3, Yo, Zw, bJ, Rp, Yw, vJ, AJ, Jw, xp, Xw, Tp, Qw, kJ, ya, IJ, DJ, Sa, MJ, fc, NJ, eO, FJ, zJ, $J, tO, Ea, jJ, nO, rO, sO, iO, Vn, GJ, Ln, Jo, aO, lO, cO, wp, XJ, QJ, uO, ba, dO, pO, fO, Dr, ao, mO, Ca, gO, z_, $_, H_, j_, B_, K_, G_, W_, V_, q_, Z_, _O, Y_, J_, yO, X_, c3, Q_, ey, ty, ny, ry, oy, sy, iy, ay, ly, cy, we, SO, en, d3, Pp, vO, g3, gy, wO, S3, BO, KO, Ip, Dp, v3, GO, WO, F9e, IO, A3, hy, x3, NO, I3, Ay, Ry, D3, xy, L3, bc, xa, Ty, wy, Oy, ky, XO, Py, Iy, Dy, Ly, My, Ny, Uy, Fy, zy, nk, rk, d3e, p3e, f3e, m3e, g3e, U3, jp, jy, ik, By, Ky, lk, $3, uk, ck, G3, W3, V3, it, Y3, J3, hk, tXe, Q3, kt, We, gX, Ta, SX, mr, Yp, Jp, eS, nS, yXe, IX, DX, rS, ka, oS, Ok, kk, HX, jX, ef, bXe, Uk, Mr, wc, Fk, Pa, OXe, kXe, iS, PXe, IXe, DXe, GX, YX, JX, XX, QX, e6, t6, Yk, n6, r6, o6, s6, i6, a6, l6, c6, Vk, uS, lf, dS, Qk, eP, uf, os10, qXe, ZXe, h6, tP, df, _6, y6, S6, E6, b6, Jn, gr, nP, rP, Dc, pS, oP, gS, lP, C6, mS, lS, sP, w6, O6, dP, k6, YXe, JXe, P6, I6, pf, L6, fP, XXe, QXe, M6, SS, z6, $6, j6, bP, CP, G6, Lc, si, Z6, ES, bS, X6, Q6, e5, t5, n5, u5, r5, o5, s5, i5, a5, l5, c5, u52, d5, p5, f5, m5, g5, h5, _5, y5, S5, E5, b5, C5, v5, A5, R5, x5, T5, w5, O5, k5, P5, I5, D5, L5, M5, N5, U5, F5, z5, $5, H5, j5, B5, K5, G5, W5, V5, q5, Z5, Y5, J5, X5, Q5, e8, t8, n8, r8, o8, s8, i8, a8, l8, c8, u8, d8, CS, p8, f8, m8, g8, h8, _8, y8, S8, E8, b8, C8, v8, A8, R8, x8, T8, w8, O8, k8, P8, I8, D8, L8, M8, N8, U8, F8, z8, $8, H8, j8, B8, K8, G8, W8, V8, q8, Z8, Y8, J8, X8, Q8, e7, t7, n7, r7, o7, s7, i7, a7, l7, c7, u7, d7, p7, f7, m7, g7, h7, _7, y7, S7, E7, b7, C7, TP, v7, L6e, RP, A7, x7, kP, ff, U6e, F6e, Ua, z6e, $6e, H6e, j6e, PP, IP, vS, DP, w7, LP, O7, k7, P7, AS, RS, xS, I7, MP, NP, D7, G6e, L7, W6e, M7, N7, UP, V6e, U7, F7, z7, $7, H7, j7, B7, q6e, is, wS, Fa, K7, G7, W7, i5e, X7, Q7, HP, $P, BP, tQ, WP, VP, JP, _Q, QP, eI, xQ, Uc, DS, $a, wQ, OQ, kQ, PQ, IQ, DQ, LQ, MQ, NQ, UQ, FQ, zQ, $Q, HQ, jQ, BQ, KQ, GQ, WQ, VQ, qQ, ZQ, YQ, JQ, XQ, QQ, eee, tee, nee, ree, oee, see, iee, aee, lee, cee, uee, dee, pee, fee, mee, gee, hee, _ee, yee, See, Eee, bee, Cee, vee, Aee, Ree, xee, Tee, wee, Oee, kee, Pee, Iee, Dee, Lee, Mee, Nee, Uee, Fee, zee, $ee, Hee, jee, Bee, Kee, Gee, Wee, Vee, qee, Zee, Yee, Jee, Xee, Qee, ete, tte, nte, rte, ote, ste, ite, ate, lte, cte, ute, dte, pte, fte, mte, gte, hte, _te, yte, Ste, Ete, bte, Cte, vte, Ate, Rte, xte, Tte, wte, Ote, kte, Pte, Ite, Dte, Lte, Mte, Nte, Ute, Fte, zte, $te, Hte, jte, Bte, Kte, Gte, Wte, Vte, qte, Zte, Yte, Jte, Xte, Qte, ene, tne, nne, rne, one, sne, ine, ane, lne, cne, une, dne, pne, fne, mne, gne, hne, _ne, yne, Sne, Ene, bne, Cne, vne, Ane, Rne, xne, Tne, wne, One, kne, Pne, Ine, Dne, Lne, Mne, Nne, Une, Fne, zne, $ne, Hne, jne, Bne, Kne, Gne, Wne, Vne, qne, Zne, Yne, Jne, Xne, Qne, ere, tre, nre, rre, ore, sre, ire, are, lre, cre, ure, dre, pre, fre, mre, gre, hre, _re, yre, Sre, Ere, bre, Cre, vre, Are, Rre, xre, Tre, wre, Ore, kre, Pre, Ire, Dre, Lre, Mre, Nre, Ure, Fre, zre, $re, Hre, jre, Bre, Kre, Gre, Wre, Vre, qre, Zre, Yre, Jre, Xre, Qre, eoe, toe, noe, roe, ooe, soe, ioe, aoe, loe, coe, uoe, doe, poe, foe, moe, goe, hoe, _oe, yoe, Soe, Eoe, boe, Coe, voe, Aoe, Roe, xoe, Toe, woe, Ooe, koe, Poe, Ioe, Doe, Loe, Moe, Noe, Uoe, Foe, zoe, $oe, Hoe, joe, Boe, Koe, Goe, Woe, Voe, qoe, Zoe, Yoe, Joe, Xoe, Qoe, ese, tse, nse, rse, ose, sse, ise, ase, lse, cse, use, dse, pse, fse, mse, gse, hse, _se, yse, Sse, Ese, LS, bse, Cse, vse, Ase, Rse, xse, Tse, wse, Ose, kse, Pse, Ise, Dse, Lse, Mse, Nse, Use, Fse, zse, $se, Hse, jse, Bse, Kse, Gse, Wse, Vse, qse, Zse, Yse, Jse, Xse, Qse, eie, tie, nie, rie, oie, sie, iie, aie, lie, cie, uie, die, pie, fie, mie, gie, hie, _ie, yie, Sie, Eie, bie, Cie, vie, Aie, Rie, xie, Tie, wie, Oie, kie, Pie, Iie, Die, Lie, Mie, Nie, Uie, Fie, zie, $ie, Hie, jie, Bie, Kie, Gie, Wie, Vie, qie, Zie, Yie, Jie, Xie, Qie, eae, tae, nae, rae, oae, sae, iae, aae, lae, cae, uae, dae, pae, fae, mae, gae, hae, _ae, yae, Sae, Eae, bae, Cae, vae, Aae, Rae, xae, Tae, wae, Oae, kae, Pae, Iae, Dae, Lae, Mae, Nae, Uae, Fae, zae, $ae, Hae, jae, Bae, Kae, Gae, Wae, Vae, qae, Zae, Yae, Jae, Xae, Qae, ele, tle, nle, rle, ole, sle, ile, ale, lle, cle, ule, dle, ple, fle, mle, gle, hle, _le, yle, Sle, Ele, ble, Cle, vle, Ale, Rle, xle, Tle, wle, Ole, kle, Ple, Ile, Dle, Lle, Mle, Nle, Ule, Fle, zle, $le, Hle, jle, Ble, Kle, Gle, Wle, Vle, qle, Zle, Yle, Jle, MS, Xle, Qle, ece, tce, nce, rce, oce, sce, ice, ace, lce, cce, uce, dce, pce, fce, mce, gce, hce, _ce, yce, Sce, Ece, bce, Cce, vce, Ace, Rce, xce, Tce, wce, Oce, kce, Pce, Ice, Dce, Lce, Mce, Nce, Uce, Fce, zce, $ce, Hce, jce, Bce, Kce, Gce, Wce, Vce, qce, Zce, Yce, Jce, Xce, Qce, eue, tue, nue, rue, oue, sue, iue, aue, lue, cue, uue, due, pue, fue, mue, gue, hue, _ue, yue, Sue, Eue, bue, Cue, vue, Aue, Rue, xue, Tue, wue, Oue, kue, Pue, Iue, Due, Lue, Mue, Nue, Uue, Fue, zue, $ue, Hue, jue, Bue, Kue, Gue, Wue, Vue, que, Zue, Yue, Jue, Xue, Que, ede, tde, nde, rde, ode, sde, ide, ade, lde, cde, ude, dde, pde, fde, mde, gde, hde, _de, yde, Sde, Ede, bde, Cde, vde, Ade, Rde, xde, Tde, wde, Ode, kde, Pde, Ide, Dde, Lde, Mde, Nde, Ude, Fde, zde, $de, Hde, jde, Bde, Kde, Gde, Wde, Vde, qde, Zde, Yde, Jde, Xde, Qde, epe, tpe, npe, rpe, ope, spe, ipe, ape, lpe, cpe, upe, dpe, ppe, fpe, mpe, gpe, hpe, _pe, ype, Spe, Epe, bpe, Cpe, vpe, Ape, Rpe, xpe, Tpe, wpe, Ope, kpe, Ppe, Ipe, Dpe, Lpe, Mpe, Npe, Upe, Fpe, zpe, $pe, Hpe, jpe, Bpe, Kpe, Gpe, Wpe, Vpe, qpe, Zpe, Ype, Jpe, Xpe, Qpe, efe, tfe, nfe, rfe, ofe, sfe, ife, afe, lfe, cfe, ufe, dfe, pfe, ffe, mfe, gfe, hfe, _fe, yfe, Sfe, Efe, bfe, Cfe, vfe, Afe, Rfe, xfe, Tfe, wfe, Ofe, kfe, Pfe, Ife, Dfe, Lfe, Mfe, Nfe, Ufe, Ffe, zfe, $fe, Hfe, jfe, Bfe, Kfe, Gfe, Wfe, Vfe, qfe, Zfe, Yfe, Jfe, Xfe, Qfe, eme, tme, nme, rme, ome, sme, ime, ame, lme, cme, ume, dme, pme, fme, mme, gme, hme, _me, yme, Sme, Eme, bme, Cme, vme, Ame, Rme, xme, Tme, wme, Ome, kme, Pme, Ime, Dme, Lme, Mme, Nme, Ume, Fme, zme, $me, Hme, jme, Bme, Kme, Gme, Wme, Vme, qme, Zme, Yme, Jme, NS, Xme, Qme, ege, tge, nge, rge, oge, sge, ige, age, lge, cge, uge, dge, pge, fge, mge, gge, hge, _ge, yge, Sge, Ege, bge, Cge, vge, Age, Rge, xge, Tge, wge, Oge, kge, Pge, Ige, Dge, Lge, Mge, Nge, Uge, Fge, zge, $ge, Hge, US, jge, Bge, Kge, Gge, Wge, Vge, qge, Zge, Yge, Jge, Xge, Qge, ehe, the, nhe, rhe, ohe, she, ihe, ahe, lhe, che, uhe, dhe, phe, fhe, mhe, ghe, hhe, _he, yhe, She, Ehe, bhe, Che, vhe, Ahe, Rhe, xhe, The, whe, Ohe, khe, Phe, Ihe, Dhe, Lhe, Mhe, Nhe, FS, rI, oI, Uhe, Fhe, zhe, $he, Hhe, jhe, Bhe, Khe, Ghe, Whe, Vhe, qhe, Zhe, Yhe, Jhe, Xhe, Qhe, e_e, t_e, n_e, r_e, o_e, s_e, i_e, a_e, l_e, c_e, u_e, d_e, p_e, f_e, m_e, g_e, h_e, __e, y_e, S_e, E_e, b_e, C_e, v_e, A_e, R_e, x_e, T_e, w_e, O_e, k_e, P_e, I_e, D_e, L_e, M_e, N_e, U_e, F_e, z_e, $_e, H_e, j_e, B_e, K_e, G_e, W_e, V_e, q_e, Z_e, Y_e, J_e, Q_e, Xn, eye, F8e, tye, z8e, nye, iI, rye, oye, lI, cye, uye, dye, _ye, on, vye, Aye, dI, C7e, v7e, ho, kI, PI, Dye, Sf, Lye, jc, Mye, Nye, LI, NI, Fye, VS, zye, $ye, x7e, zI, YS, KI, GI, VI, Hye, qS, ls, Kye, Gye, oD, nE, sD, So, Yc, vn, Zye, oE, sE, iD, aD, wf, Jc, Xc, kf, Qc, Pf, eu, fi, tu, mi, lD, cD, uD, dD, pD, fD, mD, gD, hD, _D, yD, SD, ED, bD, vD, AD, cE, RD, Xye, TD, wD, OD, kD, PD, uE, ID, DD, LD, MD, FD, If, nu, zD, $D, HD, jD, BD, zt, dE, Df, pE, fE, KD, GD, WD, VD, qD, ru, ZD, YD, JD, XD, QD, eL, tL, mE, yr, He, rL, ou, Je, yE, SE, EE, fL, mL, tSe, bE, CE, vE, AE, RE, xE, TE, wE, gL, hL, _L, yL, OE, sSe, kE, PE, IE, DE, LE, ME, NE, Nf, UE, FE, zE, $E, HE, jE, BE, cSe, gE, KE, vL, Uf, GE, WE, VE, qE, ZE, YE, Ff, JE, XE, QE, eb, tb, nb, zf, AL, rb, ob, sb, TL, ab, RL, xL, $f, Hf, dSe, fSe, OL, kL, Sr, FL, ML, zL, lu, hSe, iC, aC, lC, HL, jL, cC, uC, BL, dC, KL, pC, GL, fC, mC, WL, VL, qL, ZL, gC, YL, hC, JL, XL, _C, yC, SC, EC, QL, sC, bC, CC, vC, AC, RC, xC, TC, wC, OC, tM, qf, kC, $L, rM, ASe, Fn, oM, sM, iM, aM, lM, cM, uM, dM, pM, fM, mM, gM, Be, SM, LC, ct, MC, EM, bM, CM, pEe, fEe, Yf, mEe, gEe, hEe, _Ee, yEe, SEe, EEe, bEe, CEe, vEe, AEe, REe, xEe, TEe, wEe, OEe, NC, kEe, vM, PEe, IEe, DEe, LEe, MEe, fu, AM, NEe, UEe, IC, DC, FEe, zEe, qa, TM, HEe, jEe, KEe, wM, em, mu, qEe, ZEe, JEe, OM, Qn, kM, LM, nbe, rbe, abe, lbe, cbe, rm, pbe, At, hbe, BC, BM, Zet, WM, VM, qM, ZM, Cbe, vbe, YM, Abe, Rbe, JM, xbe, Tbe, QM, Ibe, eN, Lbe, nN, Mbe, Nbe, sm, rN, iN, Fbe, aN, $be, jbe, Kbe, Gbe, yu, lN, uN, dN, Xbe, KM, Qbe, eCe, tCe, oCe, iCe, _N, yN, wN, Ytt, ON, OCe, DCe, LN, $Ce, HCe, Cu, BCe, MN, VCe, QCe, ive, uve, VN, pve, fve, _rt, gve, Sve, nv, tv, GN, tU, Fve, Hve, iU, tAe, sAe, iAe, aAe, cAe, Ie, bU, Q, vo, F, zn, fAe, ms, mAe, _m, nn, he, Xa, an, lv, cv, Si, wu, se, br, CU, Oe, gAe, hAe, _Ae, yAe, SAe, EAe, bAe, CAe, vAe, uv, AAe, RAe, xAe, TAe, wAe, OAe, vU, kAe, Ro, el, tl, ym, ku, Sm, Pu, Iu, Em, Ei, xo, bm, Fr, ft, Du, Ao, pv, Lu, To, Cm, vm, nl, Ou, Mu, Nu, bi, Uu, rl, $r, zr, gs, Fu, zu, Am, fv, Rm, $u, wot, H, Oot, kot, Pot, Iot, Dot, Lot, Mot, Not, Uot, Fot, zot, $ot, Hot, jot, xU, Bot, Kot, Got, Wot, Vot, qot, Zot, Yot, Jot, Xot, Qot, est, tst, nst, rst, ost, sst, ist, ast, FAe, zAe, gv, OU, Ss, km, Mt, kU, PU, kst, HAe, jAe, hv, $n, Hu, IU, Yt, tr, nr, Jt, Pm, DU, _v, LU, MU, yv, ju, le, Sv, NU, Pst, Ist, Im, BAe, Dm, KAe, Bu, ol, UU, GAe, WAe, VAe, qAe, ZAe, YAe, Ev, JAe, XAe, bv, Lm, QAe, eRe, Mm, tRe, Ku, Gu, nRe, Wu, sl, rRe, Vu, Nm, Um, Fm, Dst, zm, $m, Hm, FU, zU, $U, Cv, HU, qu, il, jU, oRe, jm, sRe, Bm, iRe, vv, aRe, Km, lRe, cRe, uRe, dRe, pRe, fRe, mRe, gRe, hRe, _Re, Gm, yRe, SRe, Wm, Av, Rv, xv, ERe, bRe, CRe, Tv, vRe, ARe, RRe, xRe, TRe, BU, Vm, wRe, qm, Lst, ORe, al, kRe, Mst, Zu, PRe, wv, IRe, DRe, LRe, MRe, NRe, URe, FRe, Om, zRe, $Re, HRe, Yu, Ov, jRe, BRe, KRe, GRe, WRe, VRe, qRe, ZRe, YRe, JRe, XRe, QRe, exe, txe, nxe, rxe, oxe, sxe, ll, ixe, axe, lxe, Zm, cxe, uxe, dxe, kv, pxe, Nst, Ust, Fst, zst, $st, Hst, ae, WU, qU, VU, ZU, YU, Ym, e0, fxe, mxe, Dv, Cr, gxe, Ju, d0, h0, _0, v0, A0, Sxe, Exe, Mv, Cxe, Fv, Oj, kj, PA, IA, DA, Lj, Dj, aLe, NA, FA, uLe, dd, fLe, Po, SLe, ELe, zA, bLe, xLe, TLe, wLe, OLe, kLe, $j, qj, ILe, DLe, LLe, MLe, Ce, NLe, Wg, Oi, VA, Do, Jj, Xj, Qj, eB, tB, nB, qA, ZA, jA, Bj, jLe, BLe, GLe, rB, BA, Gg, GA, WA, VLe, qLe, Kj, Hs, sB, QLe, YA, iB, uB, eMe, dB, pB, fB, mB, tMe, XA, aB, QA, gB, hB, _B, yB, jn, lMe, SB, dMe, bB, mMe, fd, RB, hMe, Rr, TB, SMe, EMe, Pl, wB, Vg, AMe, Il, RMe, xMe, qg, OB, wMe, OMe, kB, eo, Dl, Zg, DB, NMe, FB, WMe, VMe, $B, HB, jB, BB, Ml, GB, nR, WB, Jg, KB, eNe, Bs, VB, gd, Nl, Xg, tNe, YB, qB, Pi, rK, iK, pNe, hd, _d, to, yd, nh, uK, aK, _Ne, lK, cK, Sd, Ul, rh, oh, dK, CNe, pK, sh, fK, RNe, xNe, TNe, mK, wNe, ONe, ih, Ed, lr, gK, hK, yK, SK, EK, ah, bK, FNe, CK, zNe, $Ne, HNe, vK, BNe, lh, AK, RK, xK, VNe, dn, TK, wK, OK, kK, PK, QNe, eUe, IK, DK, rUe, LK, MK, NK, UK, iUe, aUe, lUe, cUe, uUe, dUe, pUe, fUe, mUe, gUe, hUe, _Ue, yUe, SUe, EUe, bUe, CUe, vUe, AUe, FK, xUe, zK, $K, wUe, HK, OUe, jK, BK, PUe, KK, IUe, DUe, LUe, GK, MUe, NUe, UUe, FUe, WK, zUe, $Ue, HUe, VK, jUe, BUe, KUe, GUe, WUe, VUe, qUe, ZUe, YUe, JUe, XUe, QUe, e0e, t0e, n0e, r0e, Xe, qK, ZK, YK, JK, a0e, l0e, uh, XK, QK, e1, n1, r1, dh, m0e, g0e, h0e, _0e, bd, o1, S0e, Fl, s1, b0e, i1, Di, a1, l1, c1, u1, d1, p1, f1, P0e, I0e, m1, D0e, g1, h1, _1, vyt, U0e, y1, Ayt, iR, F0e, z0e, $0e, Gs, zl, fh, E1, b1, H0e, j0e, B0e, K0e, mh, $l, gh, Ws, aR, hh, _h, G0e, W0e, lR, R1, x1, V0e, uR, k1, P1, I1, D1, L1, Y0e, dR, J0e, Fyt, pR, X0e, fR, mR, Q0e, zyt, eFe, gR, hR, _R, $yt, M1, yR, N1, U1, tFe, nFe, rFe, oFe, iFe, Mi, cFe, $1, Wyt, Vyt, H1, j1, B1, K1, uFe, G1, W1, V1, q1, dFe, pFe, SR, fFe, eSt, tSt, mFe, jl, Vs, gFe, Y1, hFe, _Fe, X1, Q1, eG, yFe, SFe, tG, EFe, bFe, CFe, vFe, bR, CR, RFe, xFe, vR, TFe, Eh, nSt, Cd, wFe, OFe, aSt, rG, PFe, IFe, _St, oG, sG, bSt, CSt, HFe, jFe, $St, BFe, KFe, HSt, JSt, XSt, lG, OR, VFe, YFe, uG, eze, nze, gG, vd, vh, kR, zi, sze, yG, ize, yEt, Ad, $i, bG, Kn, AEt, REt, xEt, aze, AG, wG, $R, dze, $G, pze, fze, mze, gze, hze, BR, HG, jG, fbt, yze, Sze, Eze, Gn, ji, kG, PG, NR, UR, KR, GG, Cze, vze, Rze, GR, xze, Tze, xh, WR, Oze, kze, mbt, Pze, Ize, Dze, Lze, Mze, Nze, qG, Uze, Fze, zze, $ze, ZG, Hze, IG, jze, Bze, YG, Kze, Gze, DG, Wze, Vze, JG, qze, Zze, Yze, Jze, QG, Xze, Qze, e$e, t$e, r$e, o$e, s$e, i$e, a$e, eW, nW, c$e, m$e, xd, VR, gbt, hbt, _bt, h$e, qR, Th, MR, aW, _$e, S$e, lW, E$e, b$e, C$e, v$e, A$e, x$e, w$e, O$e, k$e, P$e, I$e, N$e, ybt, FR, Sbt, U$e, MG, Td, Ebt, bbt, uW, z$e, $$e, H$e, Cbt, j$e, B$e, vbt, Abt, K$e, Rbt, Oh, kh, G$e, YR, Ph, W$e, Ih, Mbt, Nbt, Ubt, Dh, V$e, Z$e, tx, EW, Id, Fh, X$e, xCt, Q$e, eHe, ix, ax, lx, cx, zh, $h, MW, tHe, nHe, aHe, uHe, dHe, Zs, pHe, CW, vW, AW, Nh, UW, fHe, mHe, gHe, hHe, _He, yHe, SHe, EHe, pn, dx, nx, Mh, Bi, AHe, TCt, xHe, Pd, RW, THe, xW, wHe, OHe, Hh, kHe, TW, fx, Bh, Ki, KW, Gl, PHe, Kh, kW, Wl, NHe, Ld, UHe, tV, rV, jHe, XHe, cvt, tje, fV, mV, sje, aje, _V, yV, pje, zvt, $vt, gje, yje, Sje, Kvt, Gvt, eAt, RV, Eje, bje, mAt, Cje, gAt, xV, wV, OV, Js, Lje, FV, Yh, Jh, Md, Tx, zV, $V, HV, Xh, jV, cr, KV, Mo, Fje, zje, yRt, jje, Gje, Vje, sBe, YV, e22, o_, gBe, t2, s_, kx, o2, LBe, UBe, $x, Vi, R2, KBe, GBe, Dx, ZBe, k2, n_, l2, sKe, lKe, z2, bKe, RKe, ec, W2, H2, xKe, wKe, PKe, IKe, $Ke, X2, HKe, jKe, BKe, KKe, VKe, eTt, qKe, tTt, nTt, ZKe, rTt, YKe, oTt, JKe, Wx, XKe, iTt, eq, tq, QKe, nq, rq, e1e, t1e, oq, sq, n1e, r1e, aTt, lTt, c1e, Zx, cq, u1e, uq, a_, d1e, Xx, nc, S1e, c_, mq, gq, Qx, hq, _q, E1e, Sq, u_, rc, d_, b1e, bq, Uo, Cq, vq, A1e, Yd, Jd, R1e, x1e, Aq, gn, T1e, w1e, O1e, Xs, k1e, P1e, xq, Pwt, I1e, Oq, kq, Pq, D1e, L1e, Iq, M1e, N1e, nT, U1e, p_, rT, Dq, oT, iT, F1e, Uq, aT, jq, K1e, Gq, yOt, sGe, cGe, uGe, yGe;
|
|
83832
83932
|
var init_sdk = __esm({
|
|
83833
83933
|
"node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.292_@anthropic-ai+sdk@0.131.0_zod@4.6.5__@modelconte_9caa915130557974815a7ac66b010e49/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs"() {
|
|
83834
83934
|
import_node_module = require("node:module");
|
|
@@ -83859,7 +83959,7 @@ var init_sdk = __esm({
|
|
|
83859
83959
|
import_path6 = require("path");
|
|
83860
83960
|
import_promises6 = require("fs/promises");
|
|
83861
83961
|
import_os4 = require("os");
|
|
83862
|
-
|
|
83962
|
+
import_node_path45 = __toESM(require("node:path"), 1);
|
|
83863
83963
|
import_node_os10 = __toESM(require("node:os"), 1);
|
|
83864
83964
|
import_node_process5 = __toESM(require("node:process"), 1);
|
|
83865
83965
|
import_path7 = require("path");
|
|
@@ -92310,16 +92410,16 @@ var init_sdk = __esm({
|
|
|
92310
92410
|
wS = import_node_os10.default.tmpdir();
|
|
92311
92411
|
({ env: Fa } = import_node_process5.default);
|
|
92312
92412
|
K7 = (e14) => {
|
|
92313
|
-
let t10 =
|
|
92314
|
-
return { data:
|
|
92413
|
+
let t10 = import_node_path45.default.join(is, "Library");
|
|
92414
|
+
return { data: import_node_path45.default.join(t10, "Application Support", e14), config: import_node_path45.default.join(t10, "Preferences", e14), cache: import_node_path45.default.join(t10, "Caches", e14), log: import_node_path45.default.join(t10, "Logs", e14), temp: import_node_path45.default.join(wS, e14) };
|
|
92315
92415
|
};
|
|
92316
92416
|
G7 = (e14) => {
|
|
92317
|
-
let t10 = Fa.APPDATA ||
|
|
92318
|
-
return { data:
|
|
92417
|
+
let t10 = Fa.APPDATA || import_node_path45.default.join(is, "AppData", "Roaming"), n10 = Fa.LOCALAPPDATA || import_node_path45.default.join(is, "AppData", "Local");
|
|
92418
|
+
return { data: import_node_path45.default.join(n10, e14, "Data"), config: import_node_path45.default.join(t10, e14, "Config"), cache: import_node_path45.default.join(n10, e14, "Cache"), log: import_node_path45.default.join(n10, e14, "Log"), temp: import_node_path45.default.join(wS, e14) };
|
|
92319
92419
|
};
|
|
92320
92420
|
W7 = (e14) => {
|
|
92321
|
-
let t10 =
|
|
92322
|
-
return { data:
|
|
92421
|
+
let t10 = import_node_path45.default.basename(is);
|
|
92422
|
+
return { data: import_node_path45.default.join(Fa.XDG_DATA_HOME || import_node_path45.default.join(is, ".local", "share"), e14), config: import_node_path45.default.join(Fa.XDG_CONFIG_HOME || import_node_path45.default.join(is, ".config"), e14), cache: import_node_path45.default.join(Fa.XDG_CACHE_HOME || import_node_path45.default.join(is, ".cache"), e14), log: import_node_path45.default.join(Fa.XDG_STATE_HOME || import_node_path45.default.join(is, ".local", "state"), e14), temp: import_node_path45.default.join(wS, t10, e14) };
|
|
92323
92423
|
};
|
|
92324
92424
|
i5e = OS("claude-cli");
|
|
92325
92425
|
X7 = 100;
|
|
@@ -106372,8 +106472,8 @@ var require_utils3 = __commonJS({
|
|
|
106372
106472
|
}
|
|
106373
106473
|
return ind;
|
|
106374
106474
|
}
|
|
106375
|
-
function removeDotSegments(
|
|
106376
|
-
let input2 =
|
|
106475
|
+
function removeDotSegments(path70) {
|
|
106476
|
+
let input2 = path70;
|
|
106377
106477
|
const output2 = [];
|
|
106378
106478
|
let nextSlash = -1;
|
|
106379
106479
|
let len = 0;
|
|
@@ -106782,8 +106882,8 @@ var require_schemes = __commonJS({
|
|
|
106782
106882
|
}
|
|
106783
106883
|
if (wsComponent.resourceName) {
|
|
106784
106884
|
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
106785
|
-
const
|
|
106786
|
-
wsComponent.path =
|
|
106885
|
+
const path70 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
106886
|
+
wsComponent.path = path70 && path70 !== "/" ? path70 : void 0;
|
|
106787
106887
|
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
106788
106888
|
wsComponent.resourceName = void 0;
|
|
106789
106889
|
}
|
|
@@ -110310,7 +110410,7 @@ var require_dist2 = __commonJS({
|
|
|
110310
110410
|
});
|
|
110311
110411
|
|
|
110312
110412
|
// src/cli.ts
|
|
110313
|
-
var
|
|
110413
|
+
var import_node_path69 = __toESM(require("node:path"), 1);
|
|
110314
110414
|
|
|
110315
110415
|
// node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
|
|
110316
110416
|
var CommanderError = class extends Error {
|
|
@@ -113423,9 +113523,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
113423
113523
|
* @param {string} [path]
|
|
113424
113524
|
* @return {(string|null|Command)}
|
|
113425
113525
|
*/
|
|
113426
|
-
executableDir(
|
|
113427
|
-
if (
|
|
113428
|
-
this._executableDir =
|
|
113526
|
+
executableDir(path70) {
|
|
113527
|
+
if (path70 === void 0) return this._executableDir;
|
|
113528
|
+
this._executableDir = path70;
|
|
113429
113529
|
return this;
|
|
113430
113530
|
}
|
|
113431
113531
|
/**
|
|
@@ -114901,19 +115001,19 @@ function writePools(paths, pools) {
|
|
|
114901
115001
|
applyPatch(paths.globalConfigFile, GlobalConfigSchema, { pools }, { defaults: {} });
|
|
114902
115002
|
}
|
|
114903
115003
|
function poolCycleOf(pools, name) {
|
|
114904
|
-
const walk3 = (current,
|
|
115004
|
+
const walk3 = (current, path70) => {
|
|
114905
115005
|
for (const entry of pools[current]?.identities ?? []) {
|
|
114906
115006
|
const nested = poolNameOf(poolMemberIdentity(entry));
|
|
114907
115007
|
if (nested === void 0) {
|
|
114908
115008
|
continue;
|
|
114909
115009
|
}
|
|
114910
115010
|
if (nested === name) {
|
|
114911
|
-
return [...
|
|
115011
|
+
return [...path70, nested];
|
|
114912
115012
|
}
|
|
114913
|
-
if (
|
|
115013
|
+
if (path70.includes(nested)) {
|
|
114914
115014
|
continue;
|
|
114915
115015
|
}
|
|
114916
|
-
const found = walk3(nested, [...
|
|
115016
|
+
const found = walk3(nested, [...path70, nested]);
|
|
114917
115017
|
if (found !== void 0) {
|
|
114918
115018
|
return found;
|
|
114919
115019
|
}
|
|
@@ -115269,6 +115369,7 @@ init_realPorts();
|
|
|
115269
115369
|
init_pipeline();
|
|
115270
115370
|
init_walkPolicy();
|
|
115271
115371
|
init_walk();
|
|
115372
|
+
init_names();
|
|
115272
115373
|
var NoConfigProfileResolvedError = class extends CliError {
|
|
115273
115374
|
constructor(identityName, cwd) {
|
|
115274
115375
|
super(
|
|
@@ -115541,13 +115642,12 @@ var CATEGORY_LABELS = {
|
|
|
115541
115642
|
knowledge: "knowledge",
|
|
115542
115643
|
settings: "settings"
|
|
115543
115644
|
};
|
|
115544
|
-
var PROFILE_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._@-]*$/;
|
|
115545
115645
|
function validateProfileName(value2, existingNames) {
|
|
115546
115646
|
if (value2.length === 0) {
|
|
115547
115647
|
return "A name is required.";
|
|
115548
115648
|
}
|
|
115549
|
-
if (!
|
|
115550
|
-
return
|
|
115649
|
+
if (!isFileName(value2)) {
|
|
115650
|
+
return `Names ${FILE_NAME_RULE}.`;
|
|
115551
115651
|
}
|
|
115552
115652
|
if (existingNames?.includes(value2) ?? false) {
|
|
115553
115653
|
return `A configuration profile named "${value2}" already exists.`;
|
|
@@ -116114,7 +116214,7 @@ function statuslineChangeOf(options) {
|
|
|
116114
116214
|
return void 0;
|
|
116115
116215
|
}
|
|
116116
116216
|
const assignments = (options.statusline ?? []).map(parseStatuslineAssignment);
|
|
116117
|
-
return { set: Object.fromEntries(assignments.map(({ path:
|
|
116217
|
+
return { set: Object.fromEntries(assignments.map(({ path: path70, value: value2 }) => [path70, value2])), unset: options.unsetStatusline ?? [] };
|
|
116118
116218
|
}
|
|
116119
116219
|
function registerProfileCommand(program2, deps) {
|
|
116120
116220
|
const { paths } = deps;
|
|
@@ -116542,7 +116642,7 @@ init_paths();
|
|
|
116542
116642
|
init_package();
|
|
116543
116643
|
|
|
116544
116644
|
// src/check.ts
|
|
116545
|
-
var
|
|
116645
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
116546
116646
|
init_commandDeps();
|
|
116547
116647
|
|
|
116548
116648
|
// src/checkReport.ts
|
|
@@ -116642,7 +116742,7 @@ init_realCredentialCache();
|
|
|
116642
116742
|
init_providersStore();
|
|
116643
116743
|
init_signIn();
|
|
116644
116744
|
init_realPorts();
|
|
116645
|
-
var
|
|
116745
|
+
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
116646
116746
|
init_zod();
|
|
116647
116747
|
init_envBool();
|
|
116648
116748
|
init_load();
|
|
@@ -116984,10 +117084,10 @@ function collectCheckReport(params) {
|
|
|
116984
117084
|
}).input;
|
|
116985
117085
|
const providerName = cascadeProviderName(cascade);
|
|
116986
117086
|
const provider = providerName === void 0 ? void 0 : loadCheckProvider(paths, providerName);
|
|
116987
|
-
const farmRoot = identityDecision.name === void 0 ? void 0 :
|
|
117087
|
+
const farmRoot = identityDecision.name === void 0 ? void 0 : import_node_path31.default.join(paths.identitiesDir, identityDecision.name);
|
|
116988
117088
|
const settingsFiles = {
|
|
116989
|
-
"settings.json": realFsPort.readFileUtf8(
|
|
116990
|
-
"settings.local.json": realFsPort.readFileUtf8(
|
|
117089
|
+
"settings.json": realFsPort.readFileUtf8(import_node_path31.default.join(claudeHome, "settings.json")),
|
|
117090
|
+
"settings.local.json": realFsPort.readFileUtf8(import_node_path31.default.join(claudeHome, "settings.local.json"))
|
|
116991
117091
|
};
|
|
116992
117092
|
const report = runCheck({
|
|
116993
117093
|
cwd,
|
|
@@ -117023,7 +117123,7 @@ function registerCheckCommand(program2, deps) {
|
|
|
117023
117123
|
const command = program2.command("check [path]").description(
|
|
117024
117124
|
"Show what a launch in a directory would share or hide and why, plus credential and settings diagnostics. Never touches the farm or spawns claude."
|
|
117025
117125
|
).option("--identity <name>", "Identity to check (defaults to the identity a launch there would resolve).").option("--json", "Print the report as JSON.").option("--strict", "Exit 1 when the report carries any warning, not only on errors.").action((pathArg, options) => {
|
|
117026
|
-
const cwd = pathArg === void 0 ? process.cwd() :
|
|
117126
|
+
const cwd = pathArg === void 0 ? process.cwd() : import_node_path32.default.resolve(pathArg);
|
|
117027
117127
|
const report = collectCheckReport({ paths, cwd, ...options.identity === void 0 ? {} : { identity: options.identity }, env: process.env });
|
|
117028
117128
|
if (options.json === true) {
|
|
117029
117129
|
printJson(checkReportToJson(report));
|
|
@@ -117043,7 +117143,7 @@ function registerCheckCommand(program2, deps) {
|
|
|
117043
117143
|
var import_node_crypto13 = require("node:crypto");
|
|
117044
117144
|
var import_node_fs12 = __toESM(require("node:fs"), 1);
|
|
117045
117145
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
117046
|
-
var
|
|
117146
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
117047
117147
|
init_commandDeps();
|
|
117048
117148
|
init_state();
|
|
117049
117149
|
init_schema();
|
|
@@ -117712,10 +117812,10 @@ async function callCodex(ports, request7, sessionId, signal) {
|
|
|
117712
117812
|
// src/codex/commands.ts
|
|
117713
117813
|
function codexHome(env, home) {
|
|
117714
117814
|
const fromEnv = env.CODEX_HOME;
|
|
117715
|
-
return fromEnv !== void 0 && fromEnv !== "" ? fromEnv :
|
|
117815
|
+
return fromEnv !== void 0 && fromEnv !== "" ? fromEnv : import_node_path33.default.join(home, ".codex");
|
|
117716
117816
|
}
|
|
117717
117817
|
function codexUsageSnapshotPath() {
|
|
117718
|
-
return
|
|
117818
|
+
return import_node_path33.default.join(resolveClaudeHome(), "codex-quota.json");
|
|
117719
117819
|
}
|
|
117720
117820
|
function isEnoent5(error63) {
|
|
117721
117821
|
return typeof error63 === "object" && error63 !== null && "code" in error63 && error63.code === "ENOENT";
|
|
@@ -117733,7 +117833,7 @@ var realCodexAuthFs = {
|
|
|
117733
117833
|
}
|
|
117734
117834
|
},
|
|
117735
117835
|
writePrivate: (filePath, contents) => {
|
|
117736
|
-
import_node_fs12.default.mkdirSync(
|
|
117836
|
+
import_node_fs12.default.mkdirSync(import_node_path33.default.dirname(filePath), { recursive: true });
|
|
117737
117837
|
import_node_fs12.default.writeFileSync(filePath, contents, { encoding: "utf8", mode: PRIVATE_FILE_MODE });
|
|
117738
117838
|
import_node_fs12.default.chmodSync(filePath, PRIVATE_FILE_MODE);
|
|
117739
117839
|
},
|
|
@@ -117745,7 +117845,7 @@ function writeUsageSnapshot(log, snapshot) {
|
|
|
117745
117845
|
const target = codexUsageSnapshotPath();
|
|
117746
117846
|
const temp = `${target}.${String(process.pid)}.tmp`;
|
|
117747
117847
|
try {
|
|
117748
|
-
import_node_fs12.default.mkdirSync(
|
|
117848
|
+
import_node_fs12.default.mkdirSync(import_node_path33.default.dirname(target), { recursive: true });
|
|
117749
117849
|
import_node_fs12.default.writeFileSync(temp, `${JSON.stringify(snapshot, null, 2)}
|
|
117750
117850
|
`);
|
|
117751
117851
|
import_node_fs12.default.renameSync(temp, target);
|
|
@@ -117757,7 +117857,7 @@ function createCodexRoutePorts(log, signInFile, options) {
|
|
|
117757
117857
|
const agent = createUpstreamAgent();
|
|
117758
117858
|
const upstreamFetch = createUpstreamFetch(agent);
|
|
117759
117859
|
const tempSuffix = `${String(process.pid)}.${(0, import_node_crypto13.randomUUID)()}`;
|
|
117760
|
-
const auth = createCodexAuthStore(
|
|
117860
|
+
const auth = createCodexAuthStore(import_node_path33.default.join(codexHome(process.env, import_node_os6.default.homedir()), "auth.json"), {
|
|
117761
117861
|
fs: realCodexAuthFs,
|
|
117762
117862
|
fetch: upstreamFetch,
|
|
117763
117863
|
now: () => /* @__PURE__ */ new Date(),
|
|
@@ -117905,7 +118005,7 @@ function registerCodexCommand(program2, deps) {
|
|
|
117905
118005
|
|
|
117906
118006
|
// src/frontdoor/commands.ts
|
|
117907
118007
|
var import_node_crypto25 = require("node:crypto");
|
|
117908
|
-
var
|
|
118008
|
+
var import_node_path52 = __toESM(require("node:path"), 1);
|
|
117909
118009
|
var import_node_fs21 = __toESM(require("node:fs"), 1);
|
|
117910
118010
|
init_commandDeps();
|
|
117911
118011
|
init_configProfilesStore();
|
|
@@ -117927,11 +118027,11 @@ var realSessionFs = {
|
|
|
117927
118027
|
};
|
|
117928
118028
|
|
|
117929
118029
|
// src/agents/sessions.ts
|
|
117930
|
-
var
|
|
118030
|
+
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
117931
118031
|
init_cliError();
|
|
117932
118032
|
|
|
117933
118033
|
// src/agents/read.ts
|
|
117934
|
-
var
|
|
118034
|
+
var import_node_path34 = __toESM(require("node:path"), 1);
|
|
117935
118035
|
init_zod();
|
|
117936
118036
|
|
|
117937
118037
|
// src/agents/schema.ts
|
|
@@ -118050,15 +118150,15 @@ function parseEntry2(project, entry) {
|
|
|
118050
118150
|
}
|
|
118051
118151
|
function listSessions2(fs30, configDir) {
|
|
118052
118152
|
const found = [];
|
|
118053
|
-
for (const project of fs30.readdir(
|
|
118054
|
-
const projectDir =
|
|
118153
|
+
for (const project of fs30.readdir(import_node_path34.default.join(configDir, PROJECTS_DIR))) {
|
|
118154
|
+
const projectDir = import_node_path34.default.join(configDir, PROJECTS_DIR, project);
|
|
118055
118155
|
const entries = /* @__PURE__ */ new Set();
|
|
118056
118156
|
for (const name of fs30.readdir(projectDir)) {
|
|
118057
118157
|
if (name.endsWith(TRANSCRIPT_SUFFIX)) {
|
|
118058
118158
|
entries.add(name.slice(0, -TRANSCRIPT_SUFFIX.length));
|
|
118059
118159
|
continue;
|
|
118060
118160
|
}
|
|
118061
|
-
const children = fs30.readdir(
|
|
118161
|
+
const children = fs30.readdir(import_node_path34.default.join(projectDir, name));
|
|
118062
118162
|
if (children.includes(SUBAGENTS_DIR) || children.includes(WORKFLOWS_DIR)) {
|
|
118063
118163
|
entries.add(name);
|
|
118064
118164
|
}
|
|
@@ -118078,8 +118178,8 @@ function locateAgents(fs30, configDir, relativeDir, workflowRunId, report) {
|
|
|
118078
118178
|
const id2 = name.slice(AGENT_FILE_PREFIX.length, -META_SUFFIX.length);
|
|
118079
118179
|
located.push({
|
|
118080
118180
|
id: id2,
|
|
118081
|
-
metaPath:
|
|
118082
|
-
transcriptPath:
|
|
118181
|
+
metaPath: import_node_path34.default.join(relativeDir, name),
|
|
118182
|
+
transcriptPath: import_node_path34.default.join(relativeDir, `${AGENT_FILE_PREFIX}${id2}${TRANSCRIPT_SUFFIX}`),
|
|
118083
118183
|
workflowRunId
|
|
118084
118184
|
});
|
|
118085
118185
|
}
|
|
@@ -118122,7 +118222,7 @@ function describeFailure(error63) {
|
|
|
118122
118222
|
}
|
|
118123
118223
|
function readFileOrReport(fs30, configDir, relative, report) {
|
|
118124
118224
|
try {
|
|
118125
|
-
return fs30.readFileUtf8(
|
|
118225
|
+
return fs30.readFileUtf8(import_node_path34.default.join(configDir, relative));
|
|
118126
118226
|
} catch (error63) {
|
|
118127
118227
|
report({ path: relative, reason: `could not be read: ${describeFailure(error63)}` });
|
|
118128
118228
|
return void 0;
|
|
@@ -118130,7 +118230,7 @@ function readFileOrReport(fs30, configDir, relative, report) {
|
|
|
118130
118230
|
}
|
|
118131
118231
|
function listDirOrReport(fs30, configDir, relative, report) {
|
|
118132
118232
|
try {
|
|
118133
|
-
return fs30.readdir(
|
|
118233
|
+
return fs30.readdir(import_node_path34.default.join(configDir, relative));
|
|
118134
118234
|
} catch (error63) {
|
|
118135
118235
|
report({ path: relative, reason: `could not be listed: ${describeFailure(error63)}` });
|
|
118136
118236
|
return [];
|
|
@@ -118154,18 +118254,18 @@ var WorkflowRunFileSchema = external_exports.object({
|
|
|
118154
118254
|
summary: external_exports.string().optional()
|
|
118155
118255
|
});
|
|
118156
118256
|
function summariseSession(fs30, configDir, ref) {
|
|
118157
|
-
const sessionRelative =
|
|
118158
|
-
const subagentsRelative =
|
|
118159
|
-
const workflowsUnderSubagents =
|
|
118257
|
+
const sessionRelative = import_node_path34.default.join(PROJECTS_DIR, ref.project, ref.entry);
|
|
118258
|
+
const subagentsRelative = import_node_path34.default.join(sessionRelative, SUBAGENTS_DIR);
|
|
118259
|
+
const workflowsUnderSubagents = import_node_path34.default.join(subagentsRelative, WORKFLOWS_DIR);
|
|
118160
118260
|
const isMeta = (name) => name.startsWith(AGENT_FILE_PREFIX) && name.endsWith(META_SUFFIX);
|
|
118161
|
-
let agentCount = fs30.readdir(
|
|
118162
|
-
for (const runDir of fs30.readdir(
|
|
118261
|
+
let agentCount = fs30.readdir(import_node_path34.default.join(configDir, subagentsRelative)).filter(isMeta).length;
|
|
118262
|
+
for (const runDir of fs30.readdir(import_node_path34.default.join(configDir, workflowsUnderSubagents))) {
|
|
118163
118263
|
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
118164
|
-
agentCount += fs30.readdir(
|
|
118264
|
+
agentCount += fs30.readdir(import_node_path34.default.join(configDir, workflowsUnderSubagents, runDir)).filter(isMeta).length;
|
|
118165
118265
|
}
|
|
118166
118266
|
}
|
|
118167
|
-
const workflowRunCount = fs30.readdir(
|
|
118168
|
-
const transcript = fs30.lstat(
|
|
118267
|
+
const workflowRunCount = fs30.readdir(import_node_path34.default.join(configDir, sessionRelative, WORKFLOWS_DIR)).filter((name) => name.startsWith(WORKFLOW_RUN_PREFIX) && name.endsWith(JSON_SUFFIX)).length;
|
|
118268
|
+
const transcript = fs30.lstat(import_node_path34.default.join(configDir, PROJECTS_DIR, ref.project, `${ref.entry}${TRANSCRIPT_SUFFIX}`));
|
|
118169
118269
|
return { ...ref, agentCount, workflowRunCount, ...transcript === void 0 ? {} : { updatedAt: new Date(transcript.mtimeMs).toISOString() } };
|
|
118170
118270
|
}
|
|
118171
118271
|
function readSessionAgentTree(fs30, configDir, ref, options = {}) {
|
|
@@ -118173,13 +118273,13 @@ function readSessionAgentTree(fs30, configDir, ref, options = {}) {
|
|
|
118173
118273
|
const report = (problem) => {
|
|
118174
118274
|
problems.push(problem);
|
|
118175
118275
|
};
|
|
118176
|
-
const sessionRelative =
|
|
118177
|
-
const subagentsRelative =
|
|
118178
|
-
const workflowsUnderSubagents =
|
|
118276
|
+
const sessionRelative = import_node_path34.default.join(PROJECTS_DIR, ref.project, ref.entry);
|
|
118277
|
+
const subagentsRelative = import_node_path34.default.join(sessionRelative, SUBAGENTS_DIR);
|
|
118278
|
+
const workflowsUnderSubagents = import_node_path34.default.join(subagentsRelative, WORKFLOWS_DIR);
|
|
118179
118279
|
const located = locateAgents(fs30, configDir, subagentsRelative, void 0, report);
|
|
118180
118280
|
for (const runDir of listDirOrReport(fs30, configDir, workflowsUnderSubagents, report)) {
|
|
118181
118281
|
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
118182
|
-
located.push(...locateAgents(fs30, configDir,
|
|
118282
|
+
located.push(...locateAgents(fs30, configDir, import_node_path34.default.join(workflowsUnderSubagents, runDir), runDir, report));
|
|
118183
118283
|
}
|
|
118184
118284
|
}
|
|
118185
118285
|
const agents = /* @__PURE__ */ new Map();
|
|
@@ -118220,7 +118320,7 @@ function readSessionAgentTree(fs30, configDir, ref, options = {}) {
|
|
|
118220
118320
|
superseded: ref.superseded,
|
|
118221
118321
|
agents: roots.sort().map(build),
|
|
118222
118322
|
tasks: readTasks(fs30, configDir, ownTaskLists(ref.sessionId), [.../* @__PURE__ */ new Set([...teamNames, ...options.taskListIds ?? []])].filter((id2) => !ownTaskLists(ref.sessionId).includes(id2)), report),
|
|
118223
|
-
workflowRuns: readWorkflowRuns(fs30, configDir,
|
|
118323
|
+
workflowRuns: readWorkflowRuns(fs30, configDir, import_node_path34.default.join(sessionRelative, WORKFLOWS_DIR), report),
|
|
118224
118324
|
problems
|
|
118225
118325
|
};
|
|
118226
118326
|
}
|
|
@@ -118285,12 +118385,12 @@ function ownTaskLists(sessionId) {
|
|
|
118285
118385
|
function readTasks(fs30, configDir, ownLists, sharedLists, report) {
|
|
118286
118386
|
const tasks = [];
|
|
118287
118387
|
[...ownLists, ...sharedLists].forEach((scope, index) => {
|
|
118288
|
-
const relativeDir =
|
|
118388
|
+
const relativeDir = import_node_path34.default.join(TASKS_DIR, scope);
|
|
118289
118389
|
for (const name of [...listDirOrReport(fs30, configDir, relativeDir, report)].sort()) {
|
|
118290
118390
|
if (name.startsWith(".") || !name.endsWith(JSON_SUFFIX)) {
|
|
118291
118391
|
continue;
|
|
118292
118392
|
}
|
|
118293
|
-
const relative =
|
|
118393
|
+
const relative = import_node_path34.default.join(relativeDir, name);
|
|
118294
118394
|
const text5 = readFileOrReport(fs30, configDir, relative, report);
|
|
118295
118395
|
const parsed = TaskFileSchema.safeParse(text5 === void 0 ? void 0 : parseJson3(text5));
|
|
118296
118396
|
if (parsed.success) {
|
|
@@ -118308,7 +118408,7 @@ function readWorkflowRuns(fs30, configDir, relativeDir, report) {
|
|
|
118308
118408
|
if (!name.startsWith(WORKFLOW_RUN_PREFIX) || !name.endsWith(JSON_SUFFIX)) {
|
|
118309
118409
|
continue;
|
|
118310
118410
|
}
|
|
118311
|
-
const relative =
|
|
118411
|
+
const relative = import_node_path34.default.join(relativeDir, name);
|
|
118312
118412
|
const text5 = readFileOrReport(fs30, configDir, relative, report);
|
|
118313
118413
|
const parsed = WorkflowRunFileSchema.safeParse(text5 === void 0 ? void 0 : parseJson3(text5));
|
|
118314
118414
|
if (!parsed.success) {
|
|
@@ -118331,13 +118431,13 @@ var SessionLookupError = class extends CliError {
|
|
|
118331
118431
|
}
|
|
118332
118432
|
};
|
|
118333
118433
|
function identityConfigDir(identitiesDir, identity) {
|
|
118334
|
-
return
|
|
118434
|
+
return import_node_path35.default.join(identitiesDir, identity);
|
|
118335
118435
|
}
|
|
118336
118436
|
function historyStores(fs30, identitiesDir, identities) {
|
|
118337
118437
|
const byRealPath = /* @__PURE__ */ new Map();
|
|
118338
118438
|
for (const identity of identities) {
|
|
118339
118439
|
const configDir = identityConfigDir(identitiesDir, identity);
|
|
118340
|
-
const real = fs30.realpath(
|
|
118440
|
+
const real = fs30.realpath(import_node_path35.default.join(configDir, "projects"));
|
|
118341
118441
|
if (real === void 0) {
|
|
118342
118442
|
continue;
|
|
118343
118443
|
}
|
|
@@ -118399,7 +118499,7 @@ function showSession(fs30, identitiesDir, identities, query, onlyIdentity) {
|
|
|
118399
118499
|
init_realPorts();
|
|
118400
118500
|
|
|
118401
118501
|
// src/supervise/registry.ts
|
|
118402
|
-
var
|
|
118502
|
+
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
118403
118503
|
init_zod();
|
|
118404
118504
|
var SupervisedSessionSchema = external_exports.strictObject({
|
|
118405
118505
|
/** The launcher's process id, which is what tells a live entry from one a crashed launcher left behind. */
|
|
@@ -118424,19 +118524,19 @@ var SessionStateSchema = external_exports.strictObject({
|
|
|
118424
118524
|
at: external_exports.iso.datetime()
|
|
118425
118525
|
});
|
|
118426
118526
|
function superviseDirOf(paths, pool) {
|
|
118427
|
-
return
|
|
118527
|
+
return import_node_path36.default.join(paths.superviseDir, pool);
|
|
118428
118528
|
}
|
|
118429
118529
|
function sessionsDirOf(paths, pool) {
|
|
118430
|
-
return
|
|
118530
|
+
return import_node_path36.default.join(superviseDirOf(paths, pool), "sessions");
|
|
118431
118531
|
}
|
|
118432
118532
|
function sessionFileOf(paths, pool, sessionId) {
|
|
118433
|
-
return
|
|
118533
|
+
return import_node_path36.default.join(sessionsDirOf(paths, pool), `${sessionId}.json`);
|
|
118434
118534
|
}
|
|
118435
118535
|
function stateDirOf(paths, pool) {
|
|
118436
|
-
return
|
|
118536
|
+
return import_node_path36.default.join(superviseDirOf(paths, pool), "state");
|
|
118437
118537
|
}
|
|
118438
118538
|
function sessionStatePath(paths, pool, sessionId) {
|
|
118439
|
-
return
|
|
118539
|
+
return import_node_path36.default.join(stateDirOf(paths, pool), `${sessionId}.json`);
|
|
118440
118540
|
}
|
|
118441
118541
|
function writeSessionState(fs30, paths, pool, sessionId, state) {
|
|
118442
118542
|
fs30.mkdirPrivate(stateDirOf(paths, pool));
|
|
@@ -118467,7 +118567,7 @@ function unregisterSupervised(fs30, paths, pool, sessionId) {
|
|
|
118467
118567
|
function liveSupervised(fs30, paths, pool, isRunning) {
|
|
118468
118568
|
const live = [];
|
|
118469
118569
|
for (const name of fs30.readdir(sessionsDirOf(paths, pool))) {
|
|
118470
|
-
const file2 =
|
|
118570
|
+
const file2 = import_node_path36.default.join(sessionsDirOf(paths, pool), name);
|
|
118471
118571
|
const raw = fs30.readFileUtf8(file2);
|
|
118472
118572
|
if (raw === void 0) {
|
|
118473
118573
|
continue;
|
|
@@ -118513,11 +118613,11 @@ var ModelMoveRequestSchema = external_exports.strictObject({
|
|
|
118513
118613
|
});
|
|
118514
118614
|
function writeModelMove(fs30, paths, request7) {
|
|
118515
118615
|
fs30.mkdirPrivate(paths.modelMovesDir);
|
|
118516
|
-
fs30.writeFilePrivate(
|
|
118616
|
+
fs30.writeFilePrivate(import_node_path36.default.join(paths.modelMovesDir, `${request7.sessionId}.json`), `${JSON.stringify(ModelMoveRequestSchema.parse(request7))}
|
|
118517
118617
|
`);
|
|
118518
118618
|
}
|
|
118519
118619
|
function readModelMove(fs30, paths, sessionId) {
|
|
118520
|
-
const raw = fs30.readFileUtf8(
|
|
118620
|
+
const raw = fs30.readFileUtf8(import_node_path36.default.join(paths.modelMovesDir, `${sessionId}.json`));
|
|
118521
118621
|
if (raw === void 0) {
|
|
118522
118622
|
return void 0;
|
|
118523
118623
|
}
|
|
@@ -118528,7 +118628,7 @@ function readModelMove(fs30, paths, sessionId) {
|
|
|
118528
118628
|
}
|
|
118529
118629
|
}
|
|
118530
118630
|
function removeModelMove(fs30, paths, sessionId) {
|
|
118531
|
-
fs30.removeRecursive(
|
|
118631
|
+
fs30.removeRecursive(import_node_path36.default.join(paths.modelMovesDir, `${sessionId}.json`));
|
|
118532
118632
|
}
|
|
118533
118633
|
function supervisedSessionOf(fs30, paths, sessionId, isRunning) {
|
|
118534
118634
|
for (const pool of fs30.readdir(paths.superviseDir)) {
|
|
@@ -118610,7 +118710,7 @@ function createTargetObservationStore(fs30, paths) {
|
|
|
118610
118710
|
// src/update/commands.ts
|
|
118611
118711
|
var import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
118612
118712
|
var import_node_os7 = __toESM(require("node:os"), 1);
|
|
118613
|
-
var
|
|
118713
|
+
var import_node_path39 = __toESM(require("node:path"), 1);
|
|
118614
118714
|
init_package();
|
|
118615
118715
|
init_commandDeps();
|
|
118616
118716
|
init_configProfilesStore();
|
|
@@ -118714,7 +118814,7 @@ var realUpdatePorts = {
|
|
|
118714
118814
|
chmod: (filePath, mode) => {
|
|
118715
118815
|
import_node_fs16.default.chmodSync(filePath, mode);
|
|
118716
118816
|
},
|
|
118717
|
-
mkdtemp: () => import_node_fs16.default.mkdtempSync(
|
|
118817
|
+
mkdtemp: () => import_node_fs16.default.mkdtempSync(import_node_path39.default.join(import_node_os7.default.tmpdir(), "agent-shim-update-")),
|
|
118718
118818
|
rmRecursive: (targetPath) => {
|
|
118719
118819
|
import_node_fs16.default.rmSync(targetPath, { recursive: true, force: true });
|
|
118720
118820
|
}
|
|
@@ -118735,7 +118835,7 @@ function selfUpdateOptions(paths, checkOnly) {
|
|
|
118735
118835
|
platform: process.platform,
|
|
118736
118836
|
arch: process.arch,
|
|
118737
118837
|
executablePath: realOwnExecutablePath(),
|
|
118738
|
-
lockPath:
|
|
118838
|
+
lockPath: import_node_path39.default.join(paths.root, "update.lock"),
|
|
118739
118839
|
checkOnly,
|
|
118740
118840
|
pid: process.pid
|
|
118741
118841
|
};
|
|
@@ -119005,7 +119105,7 @@ function createRealWindowOpener(params) {
|
|
|
119005
119105
|
init_conditions();
|
|
119006
119106
|
|
|
119007
119107
|
// src/usage/handledStamps.ts
|
|
119008
|
-
var
|
|
119108
|
+
var import_node_path46 = __toESM(require("node:path"), 1);
|
|
119009
119109
|
init_zod();
|
|
119010
119110
|
var STAMPS_SCHEMA_VERSION = 1;
|
|
119011
119111
|
var StampsFileSchema = external_exports.strictObject({
|
|
@@ -119028,7 +119128,7 @@ function readHandled(fs30, file2) {
|
|
|
119028
119128
|
}
|
|
119029
119129
|
function writeHandled(fs30, file2, handled) {
|
|
119030
119130
|
const next = { schemaVersion: STAMPS_SCHEMA_VERSION, handled: Object.fromEntries(Object.entries(handled).map(([key, at2]) => [key, new Date(at2).toISOString()])) };
|
|
119031
|
-
fs30.mkdirPrivate(
|
|
119131
|
+
fs30.mkdirPrivate(import_node_path46.default.dirname(file2));
|
|
119032
119132
|
fs30.writeFilePrivate(file2, `${JSON.stringify(next, null, 2)}
|
|
119033
119133
|
`);
|
|
119034
119134
|
}
|
|
@@ -119781,11 +119881,11 @@ function createRcSessionTracker(deps) {
|
|
|
119781
119881
|
};
|
|
119782
119882
|
const observeExchange = (request7) => {
|
|
119783
119883
|
const method = (request7.method ?? "").toUpperCase();
|
|
119784
|
-
const
|
|
119785
|
-
if (!
|
|
119884
|
+
const path70 = new URL(request7.url ?? "/", "http://127.0.0.1").pathname;
|
|
119885
|
+
if (!path70.startsWith(RC_SESSIONS_PATH_PREFIX)) {
|
|
119786
119886
|
return void 0;
|
|
119787
119887
|
}
|
|
119788
|
-
const tail =
|
|
119888
|
+
const tail = path70.slice(RC_SESSIONS_PATH_PREFIX.length);
|
|
119789
119889
|
const facts = {
|
|
119790
119890
|
oauthAuthorization: oauthAuthorizationOf(request7.headers),
|
|
119791
119891
|
anthropicVersion: singleHeader(request7.headers, "anthropic-version"),
|
|
@@ -120154,8 +120254,8 @@ var RC_READ_FILE_ENCODINGS = ["utf-8", "base64"];
|
|
|
120154
120254
|
function isRcReadFileEncoding(value2) {
|
|
120155
120255
|
return RC_READ_FILE_ENCODINGS.some((encoding) => encoding === value2);
|
|
120156
120256
|
}
|
|
120157
|
-
function buildRcReadFilePayload(requestId,
|
|
120158
|
-
return buildRcControlRequestPayload(requestId, { subtype: "read_file", path:
|
|
120257
|
+
function buildRcReadFilePayload(requestId, path70, options) {
|
|
120258
|
+
return buildRcControlRequestPayload(requestId, { subtype: "read_file", path: path70, ...options?.maxBytes === void 0 ? {} : { max_bytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } });
|
|
120159
120259
|
}
|
|
120160
120260
|
function buildRcFileSuggestionsPayload(requestId, query) {
|
|
120161
120261
|
return buildRcControlRequestPayload(requestId, { subtype: "file_suggestions", query });
|
|
@@ -120257,15 +120357,15 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
|
|
|
120257
120357
|
const result = await deliverRcClientPayload(deps, sessionId, buildRcGetContextUsagePayload(requestId, detail), `request the context usage of session ${sessionId}`);
|
|
120258
120358
|
return result.ok ? { ...result, requestId } : result;
|
|
120259
120359
|
}
|
|
120260
|
-
async function readRcSessionFile(deps, sessionId,
|
|
120261
|
-
if (
|
|
120360
|
+
async function readRcSessionFile(deps, sessionId, path70, options) {
|
|
120361
|
+
if (path70 === "") {
|
|
120262
120362
|
return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none" };
|
|
120263
120363
|
}
|
|
120264
120364
|
if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
|
|
120265
120365
|
return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing" };
|
|
120266
120366
|
}
|
|
120267
120367
|
const requestId = deps.newUuid();
|
|
120268
|
-
const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId,
|
|
120368
|
+
const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path70, options), `read ${path70} from session ${sessionId}`);
|
|
120269
120369
|
return result.ok ? { ...result, requestId } : result;
|
|
120270
120370
|
}
|
|
120271
120371
|
async function suggestRcSessionFiles(deps, sessionId, query) {
|
|
@@ -120436,11 +120536,11 @@ function createRcControlHandler(deps) {
|
|
|
120436
120536
|
path: "read-file",
|
|
120437
120537
|
read: (body) => {
|
|
120438
120538
|
const session = bodyString(body, "session");
|
|
120439
|
-
const
|
|
120539
|
+
const path70 = bodyString(body, "path");
|
|
120440
120540
|
const maxBytes = "maxBytes" in body ? bodyPositiveInteger(body, "maxBytes") : void 0;
|
|
120441
120541
|
const encoding = "encoding" in body && isRcReadFileEncoding(body.encoding) ? body.encoding : void 0;
|
|
120442
|
-
const refused2 = session === void 0 ||
|
|
120443
|
-
return refused2 ? { error: `the read-file body must be JSON naming a non-empty session id and path, maxBytes only as a positive whole number or absent, and an encoding the SDK's own type permits (${RC_READ_FILE_ENCODINGS.join(", ")}) or none` } : { session, run: async () => await deps.readFile(session,
|
|
120542
|
+
const refused2 = session === void 0 || path70 === void 0 || "maxBytes" in body && maxBytes === void 0 || "encoding" in body && encoding === void 0;
|
|
120543
|
+
return refused2 ? { error: `the read-file body must be JSON naming a non-empty session id and path, maxBytes only as a positive whole number or absent, and an encoding the SDK's own type permits (${RC_READ_FILE_ENCODINGS.join(", ")}) or none` } : { session, run: async () => await deps.readFile(session, path70, { ...maxBytes === void 0 ? {} : { maxBytes }, ...encoding === void 0 ? {} : { encoding } }) };
|
|
120444
120544
|
}
|
|
120445
120545
|
},
|
|
120446
120546
|
{
|
|
@@ -120750,9 +120850,9 @@ function requestIdOfBody(body) {
|
|
|
120750
120850
|
}
|
|
120751
120851
|
function frontDoorRcControl(transport, token) {
|
|
120752
120852
|
const headers = { authorization: `Bearer ${token}` };
|
|
120753
|
-
const listAnswerOf = async (
|
|
120853
|
+
const listAnswerOf = async (path70, what) => {
|
|
120754
120854
|
try {
|
|
120755
|
-
return await transport.request({ method: "GET", path:
|
|
120855
|
+
return await transport.request({ method: "GET", path: path70, headers });
|
|
120756
120856
|
} catch (error63) {
|
|
120757
120857
|
throw new Error(`${what}: could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}`, { cause: error63 });
|
|
120758
120858
|
}
|
|
@@ -120824,10 +120924,10 @@ function frontDoorRcControl(transport, token) {
|
|
|
120824
120924
|
}
|
|
120825
120925
|
return pending;
|
|
120826
120926
|
};
|
|
120827
|
-
const writeOf = async (
|
|
120927
|
+
const writeOf = async (path70, body, describeFailure2) => {
|
|
120828
120928
|
let answer;
|
|
120829
120929
|
try {
|
|
120830
|
-
answer = await transport.request({ method: "POST", path:
|
|
120930
|
+
answer = await transport.request({ method: "POST", path: path70, headers: { ...headers, "content-type": "application/json" }, body });
|
|
120831
120931
|
} catch (error63) {
|
|
120832
120932
|
return { ok: false, message: `could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}` };
|
|
120833
120933
|
}
|
|
@@ -120858,10 +120958,10 @@ function frontDoorRcControl(transport, token) {
|
|
|
120858
120958
|
endSession: async (sessionId, reason) => await writeOf(`${CONTROL_PATH_PREFIX}/end-session`, JSON.stringify({ session: sessionId, ...reason === void 0 ? {} : { reason } }), (status, message) => `ending ${sessionId} failed (HTTP ${String(status)}): ${message}`),
|
|
120859
120959
|
getUsage: async (sessionId, skipBehaviors) => await writeOf(`${CONTROL_PATH_PREFIX}/get-usage`, JSON.stringify({ session: sessionId, ...skipBehaviors === void 0 ? {} : { skipBehaviors } }), (status, message) => `requesting the usage of ${sessionId} failed (HTTP ${String(status)}): ${message}`),
|
|
120860
120960
|
getContextUsage: async (sessionId, detail) => await writeOf(`${CONTROL_PATH_PREFIX}/get-context-usage`, JSON.stringify({ session: sessionId, ...detail === void 0 ? {} : { detail } }), (status, message) => `requesting the context usage of ${sessionId} failed (HTTP ${String(status)}): ${message}`),
|
|
120861
|
-
readFile: async (sessionId,
|
|
120961
|
+
readFile: async (sessionId, path70, options) => await writeOf(
|
|
120862
120962
|
`${CONTROL_PATH_PREFIX}/read-file`,
|
|
120863
|
-
JSON.stringify({ session: sessionId, path:
|
|
120864
|
-
(status, message) => `reading ${
|
|
120963
|
+
JSON.stringify({ session: sessionId, path: path70, ...options?.maxBytes === void 0 ? {} : { maxBytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } }),
|
|
120964
|
+
(status, message) => `reading ${path70} from ${sessionId} failed (HTTP ${String(status)}): ${message}`
|
|
120865
120965
|
),
|
|
120866
120966
|
fileSuggestions: async (sessionId, query) => await writeOf(`${CONTROL_PATH_PREFIX}/file-suggestions`, JSON.stringify({ session: sessionId, query }), (status, message) => `requesting file suggestions from ${sessionId} failed (HTTP ${String(status)}): ${message}`),
|
|
120867
120967
|
keepAlive: async (sessionId) => await writeOf(`${CONTROL_PATH_PREFIX}/keep-alive`, JSON.stringify({ session: sessionId }), (status, message) => `keeping ${sessionId} alive failed (HTTP ${String(status)}): ${message}`),
|
|
@@ -121174,12 +121274,12 @@ function tlsFacts(options) {
|
|
|
121174
121274
|
}
|
|
121175
121275
|
function realRcEventDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
|
|
121176
121276
|
const agent = new ExemptTlsAgent();
|
|
121177
|
-
const post = async (
|
|
121277
|
+
const post = async (path70, headers, body) => await new Promise((resolve2, reject) => {
|
|
121178
121278
|
const options = {
|
|
121179
121279
|
host: target.host,
|
|
121180
121280
|
port: target.port,
|
|
121181
121281
|
method: "POST",
|
|
121182
|
-
path:
|
|
121282
|
+
path: path70,
|
|
121183
121283
|
// The Host header names the host whose API this is, not the address dialled: a redirected test dials a loopback stand-in while still speaking to the API host by name, exactly as the forwarded paths present their SNI.
|
|
121184
121284
|
headers: { ...headers, host: target.servername ?? target.host, "content-length": String(Buffer.byteLength(body, "utf8")) },
|
|
121185
121285
|
agent
|
|
@@ -121244,12 +121344,12 @@ function lateRcStreamDial(resolve2) {
|
|
|
121244
121344
|
}
|
|
121245
121345
|
function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
|
|
121246
121346
|
const agent = new ExemptTlsAgent();
|
|
121247
|
-
const request7 = async (method,
|
|
121347
|
+
const request7 = async (method, path70, headers, body, signal) => await new Promise((resolve2, reject) => {
|
|
121248
121348
|
const options = {
|
|
121249
121349
|
host: target.host,
|
|
121250
121350
|
port: target.port,
|
|
121251
121351
|
method,
|
|
121252
|
-
path:
|
|
121352
|
+
path: path70,
|
|
121253
121353
|
// The Host header names the host whose API this is, not the address dialled: a redirected test dials a loopback stand-in while still speaking to the API host by name, exactly as the forwarded paths present their SNI.
|
|
121254
121354
|
headers: { ...headers, host: target.servername ?? target.host, ...body === void 0 ? {} : { "content-length": String(Buffer.byteLength(body, "utf8")) } },
|
|
121255
121355
|
agent,
|
|
@@ -121291,9 +121391,9 @@ function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_P
|
|
|
121291
121391
|
return { status, body: await readAll(response) };
|
|
121292
121392
|
},
|
|
121293
121393
|
openStream: async (sessionId, headers, resume, signal) => {
|
|
121294
|
-
const
|
|
121394
|
+
const path70 = resume === void 0 ? `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream` : `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream?from_sequence_num=${String(resume.fromSequenceNum)}`;
|
|
121295
121395
|
const streamHeaders = resume === void 0 ? headers : { ...headers, "last-event-id": String(resume.fromSequenceNum) };
|
|
121296
|
-
const { status, response } = await request7("GET",
|
|
121396
|
+
const { status, response } = await request7("GET", path70, streamHeaders, void 0, signal);
|
|
121297
121397
|
if (!isSuccessful2(status)) {
|
|
121298
121398
|
await readAll(response);
|
|
121299
121399
|
return { status, chunks: NO_CHUNKS };
|
|
@@ -121510,10 +121610,11 @@ function realConnectEffects(ports = DOOR_SOURCE_PORTS) {
|
|
|
121510
121610
|
|
|
121511
121611
|
// src/doctorReport.ts
|
|
121512
121612
|
init_claudeShim();
|
|
121613
|
+
init_names();
|
|
121513
121614
|
init_store();
|
|
121514
121615
|
init_realPorts();
|
|
121515
121616
|
var import_node_fs20 = __toESM(require("node:fs"), 1);
|
|
121516
|
-
var
|
|
121617
|
+
var import_node_path47 = __toESM(require("node:path"), 1);
|
|
121517
121618
|
init_signIn();
|
|
121518
121619
|
init_load();
|
|
121519
121620
|
init_unrecognisedKeys();
|
|
@@ -121844,7 +121945,7 @@ function tcpPortEraRecord(raw) {
|
|
|
121844
121945
|
return (has("port") || has("lastPort")) && !has("socketPath");
|
|
121845
121946
|
}
|
|
121846
121947
|
function pushPathResolution(push, resolution) {
|
|
121847
|
-
const ownDir =
|
|
121948
|
+
const ownDir = import_node_path47.default.dirname(resolution.ownExecutablePath);
|
|
121848
121949
|
switch (resolution.agentShim.status) {
|
|
121849
121950
|
case "ok":
|
|
121850
121951
|
push("path-resolution", "pass", `\`agent-shim\` on PATH resolves to this running executable, ${resolution.ownExecutablePath}.`, "agent-shim");
|
|
@@ -121907,6 +122008,22 @@ function signInProblem(signIn) {
|
|
|
121907
122008
|
return error63 instanceof Error ? error63.message : String(error63);
|
|
121908
122009
|
}
|
|
121909
122010
|
}
|
|
122011
|
+
function pushNameFinding(push, section, kind, entry) {
|
|
122012
|
+
if (isFileName(entry.name)) {
|
|
122013
|
+
return true;
|
|
122014
|
+
}
|
|
122015
|
+
if (!isStoredName(entry.name)) {
|
|
122016
|
+
push(section, "fail", `${entry.path} cannot be used as a ${kind}: its name is ${JSON.stringify(entry.name)}, and a name ${FILE_NAME_RULE}. Rename or remove the file.`, entry.name);
|
|
122017
|
+
return false;
|
|
122018
|
+
}
|
|
122019
|
+
push(
|
|
122020
|
+
section,
|
|
122021
|
+
"warn",
|
|
122022
|
+
`The ${kind} ${JSON.stringify(entry.name)} is stored under a name that does not fit the shape names are given now (a name ${FILE_NAME_RULE}). It still works from your own configuration, but a project file cannot name it. Rename ${entry.path} to a name that fits, and change what names it.`,
|
|
122023
|
+
entry.name
|
|
122024
|
+
);
|
|
122025
|
+
return true;
|
|
122026
|
+
}
|
|
121910
122027
|
function pushProvider(push, entry, cacheEnv, signIn) {
|
|
121911
122028
|
if (entry.raw === void 0) {
|
|
121912
122029
|
push("provider", "fail", `${entry.path} is missing.`, entry.name);
|
|
@@ -121948,14 +122065,14 @@ function pushProvider(push, entry, cacheEnv, signIn) {
|
|
|
121948
122065
|
}
|
|
121949
122066
|
function pushLegacyName(push, params) {
|
|
121950
122067
|
const legacyVariables = Object.keys(params.env).filter((name) => name.startsWith(LEGACY_ENV_PREFIX) && params.env[name] !== void 0).sort();
|
|
121951
|
-
if (legacyVariables.length === 0 &&
|
|
122068
|
+
if (legacyVariables.length === 0 && import_node_path47.default.basename(params.rootPath) !== LEGACY_HOME_DIRNAME) {
|
|
121952
122069
|
push("legacy-name", "pass", "Nothing here still uses the former `claude-use` name.");
|
|
121953
122070
|
return;
|
|
121954
122071
|
}
|
|
121955
122072
|
for (const name of legacyVariables) {
|
|
121956
122073
|
push("legacy-name", "warn", `${name} is the former name of ${name.replace(LEGACY_ENV_PREFIX, ENV_PREFIX)}. Rename it; the old name still works but is only a fallback.`, name);
|
|
121957
122074
|
}
|
|
121958
|
-
if (
|
|
122075
|
+
if (import_node_path47.default.basename(params.rootPath) === LEGACY_HOME_DIRNAME) {
|
|
121959
122076
|
push(
|
|
121960
122077
|
"legacy-name",
|
|
121961
122078
|
"warn",
|
|
@@ -122017,6 +122134,9 @@ function runDoctor(params) {
|
|
|
122017
122134
|
pushLegacyName(push, params);
|
|
122018
122135
|
const profileSources = /* @__PURE__ */ new Map();
|
|
122019
122136
|
for (const entry of params.configProfiles) {
|
|
122137
|
+
if (!pushNameFinding(push, "config-profile", "configuration profile", entry)) {
|
|
122138
|
+
continue;
|
|
122139
|
+
}
|
|
122020
122140
|
const validated2 = validate3(ConfigProfileSchema, entry, "config-profile", entry.name);
|
|
122021
122141
|
if (!validated2.ok) {
|
|
122022
122142
|
push("config-profile", "fail", validated2.message, entry.name);
|
|
@@ -122112,6 +122232,9 @@ function runDoctor(params) {
|
|
|
122112
122232
|
return poolName === void 0 ? validIdentityNames.has(selector) : poolName in pools;
|
|
122113
122233
|
};
|
|
122114
122234
|
for (const entry of params.providers) {
|
|
122235
|
+
if (!pushNameFinding(push, "provider", "provider", entry)) {
|
|
122236
|
+
continue;
|
|
122237
|
+
}
|
|
122115
122238
|
pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
|
|
122116
122239
|
}
|
|
122117
122240
|
const providerNames = new Set(params.providers.map((entry) => entry.name));
|
|
@@ -122358,18 +122481,18 @@ function collectDoctorReport(params) {
|
|
|
122358
122481
|
const { paths } = params;
|
|
122359
122482
|
const identityNames = import_node_fs20.default.existsSync(paths.identitiesDir) ? import_node_fs20.default.readdirSync(paths.identitiesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && isIdentityDirectoryName(entry.name)).map((entry) => entry.name).sort() : [];
|
|
122360
122483
|
const identities = identityNames.map((name) => {
|
|
122361
|
-
const farmRoot =
|
|
122362
|
-
const identityPath =
|
|
122484
|
+
const farmRoot = import_node_path47.default.join(paths.identitiesDir, name);
|
|
122485
|
+
const identityPath = import_node_path47.default.join(farmRoot, "identity.json");
|
|
122363
122486
|
return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot, credentialsFilePresent: import_node_fs20.default.existsSync(credentialsFilePath(farmRoot)) };
|
|
122364
122487
|
});
|
|
122365
122488
|
const profileNames = import_node_fs20.default.existsSync(paths.configProfilesDir) ? import_node_fs20.default.readdirSync(paths.configProfilesDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
|
|
122366
122489
|
const configProfiles = profileNames.map((name) => {
|
|
122367
|
-
const profilePath =
|
|
122490
|
+
const profilePath = import_node_path47.default.join(paths.configProfilesDir, `${name}.json`);
|
|
122368
122491
|
return { name, path: profilePath, raw: realFsPort.readFileUtf8(profilePath) };
|
|
122369
122492
|
});
|
|
122370
122493
|
const providerNames = import_node_fs20.default.existsSync(paths.providersDir) ? import_node_fs20.default.readdirSync(paths.providersDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
|
|
122371
122494
|
const providers = providerNames.map((name) => {
|
|
122372
|
-
const providerPath =
|
|
122495
|
+
const providerPath = import_node_path47.default.join(paths.providersDir, `${name}.json`);
|
|
122373
122496
|
return { name, path: providerPath, raw: realFsPort.readFileUtf8(providerPath) };
|
|
122374
122497
|
});
|
|
122375
122498
|
const ownExecutablePath = realOwnExecutablePath();
|
|
@@ -122381,12 +122504,12 @@ function collectDoctorReport(params) {
|
|
|
122381
122504
|
binaryDiscovery = { ok: false, message: error63 instanceof Error ? error63.message : String(error63) };
|
|
122382
122505
|
}
|
|
122383
122506
|
const shimState = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
|
|
122384
|
-
const pathDirs = (params.env.PATH ?? "").split(
|
|
122507
|
+
const pathDirs = (params.env.PATH ?? "").split(import_node_path47.default.delimiter).filter((dir) => dir !== "");
|
|
122385
122508
|
const claudeShimShadow = shimState === void 0 ? void 0 : refinePathShadow(
|
|
122386
122509
|
findPathShadow({
|
|
122387
122510
|
pathDirs,
|
|
122388
|
-
targetDir:
|
|
122389
|
-
targetFilename:
|
|
122511
|
+
targetDir: import_node_path47.default.dirname(shimState.targetPath),
|
|
122512
|
+
targetFilename: import_node_path47.default.basename(shimState.targetPath),
|
|
122390
122513
|
findExecutableInDir
|
|
122391
122514
|
}),
|
|
122392
122515
|
shimState.targetPath,
|
|
@@ -122422,7 +122545,7 @@ function collectDoctorReport(params) {
|
|
|
122422
122545
|
agentShim: refinePathShadow(
|
|
122423
122546
|
findPathShadow({
|
|
122424
122547
|
pathDirs,
|
|
122425
|
-
targetDir:
|
|
122548
|
+
targetDir: import_node_path47.default.dirname(ownExecutablePath),
|
|
122426
122549
|
targetFilename: commandFilename(ownExecutablePath, "agent-shim"),
|
|
122427
122550
|
findExecutableInDir
|
|
122428
122551
|
}),
|
|
@@ -122694,11 +122817,11 @@ function tryOrUndefined(fn2) {
|
|
|
122694
122817
|
return void 0;
|
|
122695
122818
|
}
|
|
122696
122819
|
}
|
|
122697
|
-
function pathToHttpPath(
|
|
122698
|
-
return `/${
|
|
122820
|
+
function pathToHttpPath(path70) {
|
|
122821
|
+
return `/${path70.map(safeEncodeURIComponent).join("/")}`;
|
|
122699
122822
|
}
|
|
122700
|
-
function normalizeHttpPath(
|
|
122701
|
-
const paths =
|
|
122823
|
+
function normalizeHttpPath(path70) {
|
|
122824
|
+
const paths = path70.split("/");
|
|
122702
122825
|
if (paths.at(0) === "") {
|
|
122703
122826
|
paths.shift();
|
|
122704
122827
|
}
|
|
@@ -122883,9 +123006,9 @@ function isPlainObject3(value2) {
|
|
|
122883
123006
|
function getOwn(object3, key) {
|
|
122884
123007
|
return Object.hasOwn(object3, key) ? object3[key] : void 0;
|
|
122885
123008
|
}
|
|
122886
|
-
function get(object3,
|
|
123009
|
+
function get(object3, path70) {
|
|
122887
123010
|
let current = object3;
|
|
122888
|
-
for (const key of
|
|
123011
|
+
for (const key of path70) {
|
|
122889
123012
|
if (!isTypescriptObject(current)) {
|
|
122890
123013
|
return void 0;
|
|
122891
123014
|
}
|
|
@@ -124108,7 +124231,7 @@ function resolveClientRest(rest) {
|
|
|
124108
124231
|
// rest[1] can be undefined if all fields of FriendlyClientOptions are optional
|
|
124109
124232
|
];
|
|
124110
124233
|
}
|
|
124111
|
-
function createORPCClient(link, { path:
|
|
124234
|
+
function createORPCClient(link, { path: path70 = [], ...options } = {}) {
|
|
124112
124235
|
const procedureClient = (...rest) => {
|
|
124113
124236
|
const [input2, callOptions] = resolveClientRest(rest);
|
|
124114
124237
|
const interceptors = [
|
|
@@ -124117,7 +124240,7 @@ function createORPCClient(link, { path: path72 = [], ...options } = {}) {
|
|
|
124117
124240
|
];
|
|
124118
124241
|
return intercept(
|
|
124119
124242
|
interceptors,
|
|
124120
|
-
{ ...callOptions, input: input2, path:
|
|
124243
|
+
{ ...callOptions, input: input2, path: path70 },
|
|
124121
124244
|
({ path: path210, input: input22, ...callOptions2 }) => link.call(path210, input22, callOptions2)
|
|
124122
124245
|
);
|
|
124123
124246
|
};
|
|
@@ -124131,7 +124254,7 @@ function createORPCClient(link, { path: path72 = [], ...options } = {}) {
|
|
|
124131
124254
|
if (client === void 0) {
|
|
124132
124255
|
client = createORPCClient(link, {
|
|
124133
124256
|
...options,
|
|
124134
|
-
path: [...
|
|
124257
|
+
path: [...path70, key],
|
|
124135
124258
|
scoped: options.scoped?.[key]
|
|
124136
124259
|
});
|
|
124137
124260
|
cache.set(key, client);
|
|
@@ -124153,24 +124276,24 @@ var BracketNotationSerializer = class {
|
|
|
124153
124276
|
this.internalSerialize(data, "", true, result);
|
|
124154
124277
|
return result;
|
|
124155
124278
|
}
|
|
124156
|
-
internalSerialize(data,
|
|
124279
|
+
internalSerialize(data, path70, isRoot, result) {
|
|
124157
124280
|
if (Array.isArray(data)) {
|
|
124158
124281
|
data.forEach((item, i10) => {
|
|
124159
|
-
this.internalSerialize(item, isRoot ? i10.toString() : `${
|
|
124282
|
+
this.internalSerialize(item, isRoot ? i10.toString() : `${path70}[${i10}]`, false, result);
|
|
124160
124283
|
});
|
|
124161
124284
|
} else if (isPlainObject3(data)) {
|
|
124162
124285
|
for (const key of Object.keys(data)) {
|
|
124163
|
-
this.internalSerialize(data[key], isRoot ? key : `${
|
|
124286
|
+
this.internalSerialize(data[key], isRoot ? key : `${path70}[${key}]`, false, result);
|
|
124164
124287
|
}
|
|
124165
124288
|
} else {
|
|
124166
|
-
result.push([
|
|
124289
|
+
result.push([path70, data]);
|
|
124167
124290
|
}
|
|
124168
124291
|
}
|
|
124169
124292
|
deserialize(serialized) {
|
|
124170
124293
|
const arrayPushStyles = /* @__PURE__ */ new WeakSet();
|
|
124171
124294
|
const root = new NullProtoObj();
|
|
124172
|
-
for (const [
|
|
124173
|
-
const segments = this.parsePath(
|
|
124295
|
+
for (const [path70, value2] of serialized) {
|
|
124296
|
+
const segments = this.parsePath(path70);
|
|
124174
124297
|
let currentRef = root;
|
|
124175
124298
|
let nextSegment = segments[0];
|
|
124176
124299
|
for (let i10 = 1; i10 < segments.length; i10++) {
|
|
@@ -124221,13 +124344,13 @@ var BracketNotationSerializer = class {
|
|
|
124221
124344
|
}
|
|
124222
124345
|
return result;
|
|
124223
124346
|
}
|
|
124224
|
-
parsePath(
|
|
124347
|
+
parsePath(path70) {
|
|
124225
124348
|
const segments = [];
|
|
124226
124349
|
let inBrackets = false;
|
|
124227
124350
|
let currentSegment = "";
|
|
124228
|
-
for (let i10 = 0; i10 <
|
|
124229
|
-
const char =
|
|
124230
|
-
const nextChar =
|
|
124351
|
+
for (let i10 = 0; i10 < path70.length; i10++) {
|
|
124352
|
+
const char = path70[i10];
|
|
124353
|
+
const nextChar = path70[i10 + 1];
|
|
124231
124354
|
if (inBrackets && char === "]" && (nextChar === void 0 || nextChar === "[")) {
|
|
124232
124355
|
if (nextChar === void 0) {
|
|
124233
124356
|
inBrackets = false;
|
|
@@ -124243,7 +124366,7 @@ var BracketNotationSerializer = class {
|
|
|
124243
124366
|
currentSegment += char;
|
|
124244
124367
|
}
|
|
124245
124368
|
}
|
|
124246
|
-
return inBrackets || segments.length === 0 ? [
|
|
124369
|
+
return inBrackets || segments.length === 0 ? [path70] : segments;
|
|
124247
124370
|
}
|
|
124248
124371
|
};
|
|
124249
124372
|
var INTEGER_PATTERN = /^0$|^[1-9]\d*$/;
|
|
@@ -124816,11 +124939,11 @@ var OpenAPISerializer = class {
|
|
|
124816
124939
|
return json2;
|
|
124817
124940
|
}
|
|
124818
124941
|
const form = new FormData();
|
|
124819
|
-
for (const [
|
|
124942
|
+
for (const [path70, value22] of this.bracketNotation.serialize(json2)) {
|
|
124820
124943
|
if (value22 instanceof Blob) {
|
|
124821
|
-
form.append(
|
|
124944
|
+
form.append(path70, value22);
|
|
124822
124945
|
} else if (value22 !== void 0 && value22 !== null) {
|
|
124823
|
-
form.append(
|
|
124946
|
+
form.append(path70, String(value22));
|
|
124824
124947
|
}
|
|
124825
124948
|
}
|
|
124826
124949
|
return form;
|
|
@@ -124858,30 +124981,30 @@ function isBodylessMethod(method) {
|
|
|
124858
124981
|
return method === "GET" || method === "HEAD";
|
|
124859
124982
|
}
|
|
124860
124983
|
var PARAMETER_NAME_REGEX = /^[\w-]+$/;
|
|
124861
|
-
function getDynamicPathParams(
|
|
124862
|
-
if (!
|
|
124984
|
+
function getDynamicPathParams(path70) {
|
|
124985
|
+
if (!path70.includes("{")) {
|
|
124863
124986
|
return void 0;
|
|
124864
124987
|
}
|
|
124865
|
-
const len =
|
|
124988
|
+
const len = path70.length;
|
|
124866
124989
|
let params;
|
|
124867
124990
|
let index = 1;
|
|
124868
124991
|
while (index < len) {
|
|
124869
124992
|
const segmentStart = index;
|
|
124870
|
-
const slashPos =
|
|
124993
|
+
const slashPos = path70.indexOf("/", index);
|
|
124871
124994
|
const segmentEnd = slashPos === -1 ? len : slashPos;
|
|
124872
|
-
if (segmentEnd > segmentStart &&
|
|
124995
|
+
if (segmentEnd > segmentStart && path70.charCodeAt(segmentStart) === 123 && path70.charCodeAt(segmentEnd - 1) === 125) {
|
|
124873
124996
|
let parameterStart = segmentStart + 1;
|
|
124874
124997
|
let allowsSlash = false;
|
|
124875
|
-
const operator =
|
|
124998
|
+
const operator = path70.charCodeAt(parameterStart);
|
|
124876
124999
|
if (operator === 43) {
|
|
124877
125000
|
allowsSlash = true;
|
|
124878
125001
|
parameterStart++;
|
|
124879
125002
|
}
|
|
124880
|
-
const parameterName =
|
|
125003
|
+
const parameterName = path70.slice(parameterStart, segmentEnd - 1);
|
|
124881
125004
|
if (PARAMETER_NAME_REGEX.test(parameterName)) {
|
|
124882
125005
|
params ??= [];
|
|
124883
125006
|
params.push({
|
|
124884
|
-
segment:
|
|
125007
|
+
segment: path70.slice(segmentStart, segmentEnd),
|
|
124885
125008
|
startIndex: segmentStart,
|
|
124886
125009
|
parameterName,
|
|
124887
125010
|
allowsSlash
|
|
@@ -124924,8 +125047,8 @@ openapi.method = (method) => ({
|
|
|
124924
125047
|
...openapi({ method }),
|
|
124925
125048
|
name: "~openapi/method"
|
|
124926
125049
|
});
|
|
124927
|
-
openapi.path = (
|
|
124928
|
-
...openapi({ path:
|
|
125050
|
+
openapi.path = (path70) => ({
|
|
125051
|
+
...openapi({ path: path70 }),
|
|
124929
125052
|
name: "~openapi/path"
|
|
124930
125053
|
});
|
|
124931
125054
|
openapi.spec = (spec) => ({
|
|
@@ -125786,22 +125909,22 @@ function visitJsonSchemaRefs(value2, visit2, schemaLevel = true, seen = /* @__PU
|
|
|
125786
125909
|
}
|
|
125787
125910
|
}
|
|
125788
125911
|
}
|
|
125789
|
-
function mapJsonSchemaRefs(value2, map2, schemaLevel = true,
|
|
125912
|
+
function mapJsonSchemaRefs(value2, map2, schemaLevel = true, path70 = []) {
|
|
125790
125913
|
if (!value2 || typeof value2 !== "object") {
|
|
125791
125914
|
return value2;
|
|
125792
125915
|
}
|
|
125793
125916
|
if (Array.isArray(value2)) {
|
|
125794
|
-
return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...
|
|
125917
|
+
return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...path70, index]));
|
|
125795
125918
|
}
|
|
125796
125919
|
const result = {};
|
|
125797
125920
|
for (const key of Object.keys(value2)) {
|
|
125798
125921
|
const val = value2[key];
|
|
125799
125922
|
if (key === "$ref" && typeof val === "string") {
|
|
125800
|
-
setOwn(result, key, map2(val, [...
|
|
125923
|
+
setOwn(result, key, map2(val, [...path70, key]));
|
|
125801
125924
|
} else if (!schemaLevel) {
|
|
125802
|
-
setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...
|
|
125925
|
+
setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...path70, key]));
|
|
125803
125926
|
} else if (JSON_SCHEMA_LOGIC_KEYWORDS.has(key) || JSON_SCHEMA_RECORD_KEYWORDS.has(key)) {
|
|
125804
|
-
setOwn(result, key, mapJsonSchemaRefs(val, map2, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...
|
|
125927
|
+
setOwn(result, key, mapJsonSchemaRefs(val, map2, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...path70, key]));
|
|
125805
125928
|
} else {
|
|
125806
125929
|
setOwn(result, key, val);
|
|
125807
125930
|
}
|
|
@@ -126331,7 +126454,7 @@ function unlazy(maybeLazy) {
|
|
|
126331
126454
|
function createProcedureClient(lazyableProcedure, ...rest) {
|
|
126332
126455
|
const options = resolveMaybeOptionalOptions(rest);
|
|
126333
126456
|
return async (...[input2, callerOptions]) => {
|
|
126334
|
-
const
|
|
126457
|
+
const path70 = toArray(options.path);
|
|
126335
126458
|
const { default: procedure } = await unlazy(lazyableProcedure);
|
|
126336
126459
|
const clientContext = callerOptions?.context ?? {};
|
|
126337
126460
|
const context = await value(options.context, clientContext) ?? {};
|
|
@@ -126344,7 +126467,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
126344
126467
|
};
|
|
126345
126468
|
try {
|
|
126346
126469
|
const output2 = await runWithSpan("call_procedure", (span) => {
|
|
126347
|
-
span?.setAttribute("procedure.path",
|
|
126470
|
+
span?.setAttribute("procedure.path", path70);
|
|
126348
126471
|
return intercept(
|
|
126349
126472
|
options.interceptors,
|
|
126350
126473
|
{
|
|
@@ -126352,7 +126475,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
126352
126475
|
// input can be optional if it is undefinable
|
|
126353
126476
|
input: input2,
|
|
126354
126477
|
errors,
|
|
126355
|
-
path:
|
|
126478
|
+
path: path70,
|
|
126356
126479
|
procedure,
|
|
126357
126480
|
signal: callerOptions?.signal,
|
|
126358
126481
|
lastEventId: callerOptions?.lastEventId
|
|
@@ -126603,10 +126726,10 @@ function augmentRouter(router, options) {
|
|
|
126603
126726
|
}
|
|
126604
126727
|
return enhanced;
|
|
126605
126728
|
}
|
|
126606
|
-
function getRouter(router,
|
|
126729
|
+
function getRouter(router, path70) {
|
|
126607
126730
|
let current = router;
|
|
126608
|
-
for (let i10 = 0; i10 <
|
|
126609
|
-
const segment =
|
|
126731
|
+
for (let i10 = 0; i10 < path70.length; i10++) {
|
|
126732
|
+
const segment = path70[i10];
|
|
126610
126733
|
if (!isTypescriptObject(current)) {
|
|
126611
126734
|
return void 0;
|
|
126612
126735
|
}
|
|
@@ -126618,7 +126741,7 @@ function getRouter(router, path72) {
|
|
|
126618
126741
|
continue;
|
|
126619
126742
|
}
|
|
126620
126743
|
const lazied = current;
|
|
126621
|
-
const rest =
|
|
126744
|
+
const rest = path70.slice(i10);
|
|
126622
126745
|
return new Lazy({
|
|
126623
126746
|
...lazied["~orpc"],
|
|
126624
126747
|
async loader() {
|
|
@@ -126633,40 +126756,40 @@ function getRouter(router, path72) {
|
|
|
126633
126756
|
}
|
|
126634
126757
|
return current;
|
|
126635
126758
|
}
|
|
126636
|
-
function walkProcedureContractsSync(router, callback,
|
|
126759
|
+
function walkProcedureContractsSync(router, callback, path70 = []) {
|
|
126637
126760
|
const lazyResults = [];
|
|
126638
|
-
walkProcedureContractsSyncInternal(router, callback,
|
|
126761
|
+
walkProcedureContractsSyncInternal(router, callback, path70.slice(), lazyResults);
|
|
126639
126762
|
return lazyResults;
|
|
126640
126763
|
}
|
|
126641
|
-
function walkProcedureContractsSyncInternal(router, callback,
|
|
126764
|
+
function walkProcedureContractsSyncInternal(router, callback, path70, lazyResults) {
|
|
126642
126765
|
const hiddenContract = getHiddenRouterContract(router);
|
|
126643
126766
|
if (hiddenContract !== void 0) {
|
|
126644
126767
|
router = hiddenContract;
|
|
126645
126768
|
}
|
|
126646
126769
|
if (router instanceof ProcedureContract) {
|
|
126647
|
-
callback(router,
|
|
126770
|
+
callback(router, path70.slice());
|
|
126648
126771
|
return;
|
|
126649
126772
|
}
|
|
126650
126773
|
if (!isTypescriptObject(router)) {
|
|
126651
126774
|
return;
|
|
126652
126775
|
}
|
|
126653
126776
|
for (const [key, value2] of Object.entries(router)) {
|
|
126654
|
-
|
|
126777
|
+
path70.push(key);
|
|
126655
126778
|
if (value2 instanceof Lazy) {
|
|
126656
|
-
lazyResults.push({ router: value2, path:
|
|
126779
|
+
lazyResults.push({ router: value2, path: path70.slice() });
|
|
126657
126780
|
} else {
|
|
126658
|
-
walkProcedureContractsSyncInternal(value2, callback,
|
|
126781
|
+
walkProcedureContractsSyncInternal(value2, callback, path70, lazyResults);
|
|
126659
126782
|
}
|
|
126660
|
-
|
|
126783
|
+
path70.pop();
|
|
126661
126784
|
}
|
|
126662
126785
|
}
|
|
126663
|
-
async function walkProcedureContractsAsync(router, callback,
|
|
126786
|
+
async function walkProcedureContractsAsync(router, callback, path70 = []) {
|
|
126664
126787
|
const hiddenContract = getHiddenRouterContract(router);
|
|
126665
126788
|
if (hiddenContract !== void 0) {
|
|
126666
126789
|
router = hiddenContract;
|
|
126667
126790
|
}
|
|
126668
126791
|
if (router instanceof ProcedureContract) {
|
|
126669
|
-
await callback(router,
|
|
126792
|
+
await callback(router, path70);
|
|
126670
126793
|
return;
|
|
126671
126794
|
}
|
|
126672
126795
|
if (!isTypescriptObject(router)) {
|
|
@@ -126675,9 +126798,9 @@ async function walkProcedureContractsAsync(router, callback, path72 = []) {
|
|
|
126675
126798
|
for (const [key, value2] of Object.entries(router)) {
|
|
126676
126799
|
if (value2 instanceof Lazy) {
|
|
126677
126800
|
const { default: router2 } = await unlazy(value2);
|
|
126678
|
-
await walkProcedureContractsAsync(router2, callback, [...
|
|
126801
|
+
await walkProcedureContractsAsync(router2, callback, [...path70, key]);
|
|
126679
126802
|
} else {
|
|
126680
|
-
await walkProcedureContractsAsync(value2, callback, [...
|
|
126803
|
+
await walkProcedureContractsAsync(value2, callback, [...path70, key]);
|
|
126681
126804
|
}
|
|
126682
126805
|
}
|
|
126683
126806
|
}
|
|
@@ -127163,18 +127286,18 @@ function rewriteComponentSchemaRefs(schema, renameMap) {
|
|
|
127163
127286
|
}
|
|
127164
127287
|
var OpenAPIGeneratorError = class extends TypeError {
|
|
127165
127288
|
};
|
|
127166
|
-
function toOpenAPIPath(
|
|
127289
|
+
function toOpenAPIPath(path70, dynamicPathParams) {
|
|
127167
127290
|
if (!dynamicPathParams?.length) {
|
|
127168
|
-
return
|
|
127291
|
+
return path70;
|
|
127169
127292
|
}
|
|
127170
127293
|
let normalized = "";
|
|
127171
127294
|
let currentIndex = 0;
|
|
127172
127295
|
for (const param of dynamicPathParams) {
|
|
127173
|
-
normalized +=
|
|
127296
|
+
normalized += path70.slice(currentIndex, param.startIndex);
|
|
127174
127297
|
normalized += `{${param.parameterName}}`;
|
|
127175
127298
|
currentIndex = param.startIndex + param.segment.length;
|
|
127176
127299
|
}
|
|
127177
|
-
normalized +=
|
|
127300
|
+
normalized += path70.slice(currentIndex);
|
|
127178
127301
|
return normalized;
|
|
127179
127302
|
}
|
|
127180
127303
|
function buildRequest(ctx, operation, def, meta3, dynamicPathParams) {
|
|
@@ -127608,8 +127731,8 @@ var OpenAPIGenerator = class {
|
|
|
127608
127731
|
customErrorResponseBodySchema: options.customErrorResponseBodySchema
|
|
127609
127732
|
};
|
|
127610
127733
|
const errors = [];
|
|
127611
|
-
await walkProcedureContractsAsync(router, (contract,
|
|
127612
|
-
if (value(options.filter, contract,
|
|
127734
|
+
await walkProcedureContractsAsync(router, (contract, path70) => {
|
|
127735
|
+
if (value(options.filter, contract, path70) === false) {
|
|
127613
127736
|
return;
|
|
127614
127737
|
}
|
|
127615
127738
|
try {
|
|
@@ -127621,7 +127744,7 @@ var OpenAPIGenerator = class {
|
|
|
127621
127744
|
`QUERY operations require OpenAPI 3.2, but version "${version2}" was requested.`
|
|
127622
127745
|
);
|
|
127623
127746
|
}
|
|
127624
|
-
const postPath = meta3?.path ?? pathToHttpPath(
|
|
127747
|
+
const postPath = meta3?.path ?? pathToHttpPath(path70);
|
|
127625
127748
|
const httpPath = meta3?.prefix ? mergeHttpPath(meta3.prefix, postPath) : postPath;
|
|
127626
127749
|
const dynamicPathParams = getDynamicPathParams(httpPath);
|
|
127627
127750
|
const openApiPath = toOpenAPIPath(httpPath, dynamicPathParams);
|
|
@@ -127630,7 +127753,7 @@ var OpenAPIGenerator = class {
|
|
|
127630
127753
|
operation = meta3.spec;
|
|
127631
127754
|
} else {
|
|
127632
127755
|
operation = {
|
|
127633
|
-
operationId: meta3?.operationId ??
|
|
127756
|
+
operationId: meta3?.operationId ?? path70.join("."),
|
|
127634
127757
|
summary: meta3?.summary,
|
|
127635
127758
|
description: meta3?.description,
|
|
127636
127759
|
deprecated: meta3?.deprecated,
|
|
@@ -127650,7 +127773,7 @@ var OpenAPIGenerator = class {
|
|
|
127650
127773
|
if (!(e14 instanceof OpenAPIGeneratorError)) {
|
|
127651
127774
|
throw e14;
|
|
127652
127775
|
}
|
|
127653
|
-
errors.push(`Procedure at ${
|
|
127776
|
+
errors.push(`Procedure at ${path70.join(".") || "(root)"}: ${e14.message}`);
|
|
127654
127777
|
}
|
|
127655
127778
|
});
|
|
127656
127779
|
if (errors.length) {
|
|
@@ -127958,7 +128081,7 @@ var ResetRowSchema = external_exports.strictObject({
|
|
|
127958
128081
|
var ResetScheduleSchema = external_exports.strictObject({ resets: external_exports.readonly(external_exports.array(ResetRowSchema)) });
|
|
127959
128082
|
|
|
127960
128083
|
// src/frontdoor/controlSchemas.ts
|
|
127961
|
-
var
|
|
128084
|
+
var import_node_path48 = __toESM(require("node:path"), 1);
|
|
127962
128085
|
init_zod();
|
|
127963
128086
|
init_schema2();
|
|
127964
128087
|
|
|
@@ -128172,11 +128295,11 @@ var FrontDoorSessionsOutputSchema = external_exports.strictObject({ sessions: ex
|
|
|
128172
128295
|
var CheckRunInputSchema = external_exports.strictObject({
|
|
128173
128296
|
path: external_exports.string().min(1),
|
|
128174
128297
|
identity: external_exports.string().min(1).optional()
|
|
128175
|
-
}).refine((input2) =>
|
|
128298
|
+
}).refine((input2) => import_node_path48.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
128176
128299
|
var PoolPickInputSchema = external_exports.strictObject({
|
|
128177
128300
|
pool: external_exports.string().min(1),
|
|
128178
128301
|
path: external_exports.string().min(1)
|
|
128179
|
-
}).refine((input2) =>
|
|
128302
|
+
}).refine((input2) => import_node_path48.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
128180
128303
|
var DoctorFindingSchema = external_exports.strictObject({
|
|
128181
128304
|
section: external_exports.enum(DOCTOR_SECTIONS),
|
|
128182
128305
|
subject: external_exports.string().optional(),
|
|
@@ -128497,16 +128620,16 @@ var StandardLink = class {
|
|
|
128497
128620
|
/**
|
|
128498
128621
|
* @throws ORPCError, transport-level errors (network failures, timeouts, etc.)
|
|
128499
128622
|
*/
|
|
128500
|
-
call(
|
|
128501
|
-
return runWithSpan(`${ORPC_NAME}.${
|
|
128623
|
+
call(path70, input2, options) {
|
|
128624
|
+
return runWithSpan(`${ORPC_NAME}.${path70.join("/")}`, (span) => {
|
|
128502
128625
|
span?.setAttribute("rpc.system", ORPC_NAME);
|
|
128503
|
-
span?.setAttribute("rpc.method",
|
|
128626
|
+
span?.setAttribute("rpc.method", path70.join("."));
|
|
128504
128627
|
if (getTracer() && isAsyncIteratorObject(input2)) {
|
|
128505
128628
|
input2 = override(input2, traceAsyncIterator("consume_async_iterator_object_input", input2));
|
|
128506
128629
|
} else if (getTracer() && input2 instanceof ReadableStream) {
|
|
128507
128630
|
input2 = override(input2, traceReadableStream("consume_octet_stream_input", input2));
|
|
128508
128631
|
}
|
|
128509
|
-
return intercept(this.interceptors, { ...options, path:
|
|
128632
|
+
return intercept(this.interceptors, { ...options, path: path70, input: input2 }, async ({ path: path210, input: input22, ...options2 }) => {
|
|
128510
128633
|
const tracer = getTracer();
|
|
128511
128634
|
const activeSpan = tracer?.getActiveSpan() ?? span;
|
|
128512
128635
|
let request7 = await runWithSpan(
|
|
@@ -128563,18 +128686,18 @@ var RPCLinkCodec = class {
|
|
|
128563
128686
|
this.headers = options.headers ?? {};
|
|
128564
128687
|
this.serializer = options.serializer ?? new RPCSerializer();
|
|
128565
128688
|
}
|
|
128566
|
-
async encodeInput(input2,
|
|
128567
|
-
let headers = toResolvedStandardHeaders(await value(this.headers, options,
|
|
128689
|
+
async encodeInput(input2, path70, options) {
|
|
128690
|
+
let headers = toResolvedStandardHeaders(await value(this.headers, options, path70, input2));
|
|
128568
128691
|
if (options.lastEventId !== void 0) {
|
|
128569
128692
|
headers = mergeStandardHeaders(headers, { "last-event-id": options.lastEventId });
|
|
128570
128693
|
}
|
|
128571
|
-
const expectedMethod = await value(this.expectedMethod, options,
|
|
128572
|
-
const baseUrl = await value(this.baseUrl, options,
|
|
128694
|
+
const expectedMethod = await value(this.expectedMethod, options, path70, input2);
|
|
128695
|
+
const baseUrl = await value(this.baseUrl, options, path70, input2);
|
|
128573
128696
|
const [pathname, search, hash2] = parseStandardUrl(baseUrl);
|
|
128574
|
-
const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(
|
|
128697
|
+
const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(path70)}`;
|
|
128575
128698
|
const serialized = this.serializer.serialize(input2);
|
|
128576
128699
|
if (expectedMethod === "GET" && !(serialized instanceof Blob) && !(serialized instanceof ReadableStream) && !(serialized instanceof FormData) && !isAsyncIteratorObject(serialized)) {
|
|
128577
|
-
const maxUrlLength = await value(this.maxUrlLength, options,
|
|
128700
|
+
const maxUrlLength = await value(this.maxUrlLength, options, path70, input2);
|
|
128578
128701
|
const mergedSearch = new URLSearchParams(search);
|
|
128579
128702
|
mergedSearch.append("data", stringifyJSON(serialized) ?? "");
|
|
128580
128703
|
const url22 = `${newPathname}?${mergedSearch}${hash2 ?? ""}`;
|
|
@@ -128659,8 +128782,8 @@ var FetchLinkTransport = class {
|
|
|
128659
128782
|
this.fetch = options.fetch ?? ((url2, init) => globalThis.fetch(url2, init));
|
|
128660
128783
|
this.toFetchRequestOptions = options.toFetchRequest;
|
|
128661
128784
|
}
|
|
128662
|
-
async send(standardRequest,
|
|
128663
|
-
let origin = await value(this.origin, options,
|
|
128785
|
+
async send(standardRequest, path70, options) {
|
|
128786
|
+
let origin = await value(this.origin, options, path70);
|
|
128664
128787
|
if (origin?.endsWith("/")) {
|
|
128665
128788
|
origin = origin.slice(0, -1);
|
|
128666
128789
|
}
|
|
@@ -128680,7 +128803,7 @@ var FetchLinkTransport = class {
|
|
|
128680
128803
|
}
|
|
128681
128804
|
}
|
|
128682
128805
|
const fetch3 = this.fetch;
|
|
128683
|
-
const response = await fetch3(url2, init, options,
|
|
128806
|
+
const response = await fetch3(url2, init, options, path70);
|
|
128684
128807
|
const standardResponse = toStandardLazyResponse(response);
|
|
128685
128808
|
return standardResponse;
|
|
128686
128809
|
}
|
|
@@ -129071,14 +129194,14 @@ var StandardHandler = class {
|
|
|
129071
129194
|
span?.setAttribute("url.path", request22.url);
|
|
129072
129195
|
return { matched: false };
|
|
129073
129196
|
}
|
|
129074
|
-
const { path:
|
|
129075
|
-
span?.updateName(`${ORPC_NAME}.${
|
|
129197
|
+
const { path: path70, procedure, decodeInput } = matchedOrNot;
|
|
129198
|
+
span?.updateName(`${ORPC_NAME}.${path70.join("/")}`);
|
|
129076
129199
|
span?.setAttribute("rpc.system", ORPC_NAME);
|
|
129077
|
-
span?.setAttribute("rpc.method",
|
|
129200
|
+
span?.setAttribute("rpc.method", path70.join("."));
|
|
129078
129201
|
try {
|
|
129079
129202
|
const response = await intercept(
|
|
129080
129203
|
this.interceptors,
|
|
129081
|
-
{ context: context2, prefix: prefix2, request: request22, path:
|
|
129204
|
+
{ context: context2, prefix: prefix2, request: request22, path: path70, procedure, decodeInput },
|
|
129082
129205
|
async ({ context: context3, prefix: prefix3, request: request32, path: path210, procedure: procedure2, decodeInput: decodeInput2 }) => {
|
|
129083
129206
|
step2 = "decode_input";
|
|
129084
129207
|
let input2 = await runWithSpan("decode_input", decodeInput2);
|
|
@@ -129112,7 +129235,7 @@ var StandardHandler = class {
|
|
|
129112
129235
|
message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
|
|
129113
129236
|
cause: e14
|
|
129114
129237
|
}) : toORPCError(e14);
|
|
129115
|
-
const response = await this.codec.encodeError(error63, procedure,
|
|
129238
|
+
const response = await this.codec.encodeError(error63, procedure, path70, { context: context2, prefix: prefix2 });
|
|
129116
129239
|
return { matched: true, response };
|
|
129117
129240
|
}
|
|
129118
129241
|
}
|
|
@@ -129218,7 +129341,7 @@ var RPCMatcher = class {
|
|
|
129218
129341
|
this.rootRouter = router;
|
|
129219
129342
|
this.index(router);
|
|
129220
129343
|
}
|
|
129221
|
-
index(router,
|
|
129344
|
+
index(router, path70 = []) {
|
|
129222
129345
|
const lazyResults = walkProcedureContractsSync(router, (procedure, procedurePath) => {
|
|
129223
129346
|
if (!value(this.filter, procedure, procedurePath)) {
|
|
129224
129347
|
return;
|
|
@@ -129229,7 +129352,7 @@ var RPCMatcher = class {
|
|
|
129229
129352
|
// contract-first entries have no implementation yet, resolveProcedure fills it in on demand
|
|
129230
129353
|
procedure: procedure instanceof Procedure ? procedure : void 0
|
|
129231
129354
|
});
|
|
129232
|
-
},
|
|
129355
|
+
}, path70);
|
|
129233
129356
|
for (const result of lazyResults) {
|
|
129234
129357
|
this.pendingLazyRouters.set(pathToHttpPath(result.path), result);
|
|
129235
129358
|
}
|
|
@@ -129361,10 +129484,10 @@ var RPCHandlerCodec = class {
|
|
|
129361
129484
|
}
|
|
129362
129485
|
};
|
|
129363
129486
|
}
|
|
129364
|
-
encodeOutput(output2, procedure,
|
|
129487
|
+
encodeOutput(output2, procedure, path70, options) {
|
|
129365
129488
|
return {
|
|
129366
129489
|
headers: {},
|
|
129367
|
-
status: value(this.outputStatus, output2, procedure,
|
|
129490
|
+
status: value(this.outputStatus, output2, procedure, path70, options) ?? DEFAULT_SUCCESS_STATUS,
|
|
129368
129491
|
body: this.serializer.serialize(output2)
|
|
129369
129492
|
};
|
|
129370
129493
|
}
|
|
@@ -129418,39 +129541,39 @@ function createRouter() {
|
|
|
129418
129541
|
static: new NullProtoObj2()
|
|
129419
129542
|
};
|
|
129420
129543
|
}
|
|
129421
|
-
function scanFirstGroup(
|
|
129544
|
+
function scanFirstGroup(path70) {
|
|
129422
129545
|
let i10 = 0;
|
|
129423
129546
|
let depth = 0;
|
|
129424
|
-
for (; i10 <
|
|
129425
|
-
const c10 =
|
|
129547
|
+
for (; i10 < path70.length; i10++) {
|
|
129548
|
+
const c10 = path70.charCodeAt(i10);
|
|
129426
129549
|
if (c10 === 92) i10++;
|
|
129427
129550
|
else if (c10 === 40) depth++;
|
|
129428
129551
|
else if (c10 === 41 && depth > 0) depth--;
|
|
129429
129552
|
else if (c10 === 123 && depth === 0) break;
|
|
129430
129553
|
}
|
|
129431
|
-
if (i10 >=
|
|
129554
|
+
if (i10 >= path70.length) return;
|
|
129432
129555
|
let j10 = i10 + 1;
|
|
129433
129556
|
depth = 0;
|
|
129434
|
-
for (; j10 <
|
|
129435
|
-
const c10 =
|
|
129557
|
+
for (; j10 < path70.length; j10++) {
|
|
129558
|
+
const c10 = path70.charCodeAt(j10);
|
|
129436
129559
|
if (c10 === 92) j10++;
|
|
129437
129560
|
else if (c10 === 40) depth++;
|
|
129438
129561
|
else if (c10 === 41 && depth > 0) depth--;
|
|
129439
129562
|
else if (c10 === 125 && depth === 0) break;
|
|
129440
129563
|
}
|
|
129441
|
-
if (j10 >=
|
|
129442
|
-
const mod =
|
|
129564
|
+
if (j10 >= path70.length) return;
|
|
129565
|
+
const mod = path70[j10 + 1];
|
|
129443
129566
|
const hasMod = mod === "?" || mod === "+" || mod === "*";
|
|
129444
129567
|
return [
|
|
129445
|
-
|
|
129446
|
-
|
|
129447
|
-
|
|
129568
|
+
path70.slice(0, i10),
|
|
129569
|
+
path70.slice(i10 + 1, j10),
|
|
129570
|
+
path70.slice(j10 + (hasMod ? 2 : 1)),
|
|
129448
129571
|
hasMod ? mod : void 0
|
|
129449
129572
|
];
|
|
129450
129573
|
}
|
|
129451
|
-
function expandGroupDelimiters(
|
|
129452
|
-
if (!
|
|
129453
|
-
const group = scanFirstGroup(
|
|
129574
|
+
function expandGroupDelimiters(path70) {
|
|
129575
|
+
if (!path70.includes("{")) return;
|
|
129576
|
+
const group = scanFirstGroup(path70);
|
|
129454
129577
|
if (!group) return;
|
|
129455
129578
|
const [pre2, body, suf, mod] = group;
|
|
129456
129579
|
if (!mod) return [pre2 + body + suf];
|
|
@@ -129520,9 +129643,9 @@ function replaceSegmentWildcards(segment, unnamedStart, toGroupKey = toUnnamedGr
|
|
|
129520
129643
|
}
|
|
129521
129644
|
return [replaced, nextIndex];
|
|
129522
129645
|
}
|
|
129523
|
-
function encodeEscapes(
|
|
129524
|
-
if (!
|
|
129525
|
-
return
|
|
129646
|
+
function encodeEscapes(path70) {
|
|
129647
|
+
if (!path70.includes("\\")) return path70;
|
|
129648
|
+
return path70.replace(/\\([:(){}])/g, (_, c10) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c10)]);
|
|
129526
129649
|
}
|
|
129527
129650
|
function segmentKey(segment) {
|
|
129528
129651
|
if (segment.startsWith("**")) return 2;
|
|
@@ -129551,22 +129674,22 @@ function expandModifiers(segments) {
|
|
|
129551
129674
|
return m10[2] === "+" ? [wc2] : [wc2, without];
|
|
129552
129675
|
}
|
|
129553
129676
|
}
|
|
129554
|
-
function normalizePath(
|
|
129555
|
-
if (!
|
|
129677
|
+
function normalizePath(path70) {
|
|
129678
|
+
if (!path70.includes("/.")) return path70;
|
|
129556
129679
|
const r10 = [];
|
|
129557
|
-
for (const s of
|
|
129680
|
+
for (const s of path70.split("/")) if (s === ".") continue;
|
|
129558
129681
|
else if (s === ".." && r10.length > 1) r10.pop();
|
|
129559
129682
|
else r10.push(s);
|
|
129560
129683
|
return r10.join("/") || "/";
|
|
129561
129684
|
}
|
|
129562
|
-
function splitPath(
|
|
129563
|
-
const s =
|
|
129685
|
+
function splitPath(path70) {
|
|
129686
|
+
const s = path70.split("/");
|
|
129564
129687
|
s.shift();
|
|
129565
129688
|
if (s[s.length - 1] === "") s.pop();
|
|
129566
129689
|
return s;
|
|
129567
129690
|
}
|
|
129568
|
-
function splitRoute(
|
|
129569
|
-
const s = splitPath(
|
|
129691
|
+
function splitRoute(path70) {
|
|
129692
|
+
const s = splitPath(path70);
|
|
129570
129693
|
while (s[s.length - 1] === "") s.pop();
|
|
129571
129694
|
return s;
|
|
129572
129695
|
}
|
|
@@ -129582,16 +129705,16 @@ function getMatchParams(segments, paramsMap) {
|
|
|
129582
129705
|
}
|
|
129583
129706
|
return params;
|
|
129584
129707
|
}
|
|
129585
|
-
function addRoute(ctx, method = "",
|
|
129708
|
+
function addRoute(ctx, method = "", path70, data) {
|
|
129586
129709
|
method = method.toUpperCase();
|
|
129587
|
-
if (
|
|
129588
|
-
const groupExpanded = expandGroupDelimiters(
|
|
129710
|
+
if (path70.charCodeAt(0) !== 47) path70 = `/${path70}`;
|
|
129711
|
+
const groupExpanded = expandGroupDelimiters(path70);
|
|
129589
129712
|
if (groupExpanded) {
|
|
129590
129713
|
for (const expandedPath of groupExpanded) addRoute(ctx, method, expandedPath, data);
|
|
129591
129714
|
return;
|
|
129592
129715
|
}
|
|
129593
|
-
|
|
129594
|
-
const segments = splitRoute(
|
|
129716
|
+
path70 = encodeEscapes(path70);
|
|
129717
|
+
const segments = splitRoute(path70);
|
|
129595
129718
|
const expanded = expandModifiers(segments);
|
|
129596
129719
|
if (expanded) {
|
|
129597
129720
|
for (const p of expanded) addRoute(ctx, method, p, data);
|
|
@@ -129682,15 +129805,15 @@ function getParamRegexp(segment, unnamedStart = 0) {
|
|
|
129682
129805
|
const regex2 = _s2.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_, id2, p) => `(?<${toGroupName(id2)}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i2++)}>`).replace(/\uFFFE(.)/g, (_, c10) => /[.*+?^${}()|[\]\\]/.test(c10) ? `\\${c10}` : c10);
|
|
129683
129806
|
return [new RegExp(`^${regex2}$`), _i2];
|
|
129684
129807
|
}
|
|
129685
|
-
function findRoute(ctx, method = "",
|
|
129686
|
-
if (opts?.normalize)
|
|
129687
|
-
if (
|
|
129688
|
-
const staticNode = ctx.static[
|
|
129808
|
+
function findRoute(ctx, method = "", path70, opts) {
|
|
129809
|
+
if (opts?.normalize) path70 = normalizePath(path70);
|
|
129810
|
+
if (path70.charCodeAt(path70.length - 1) === 47) path70 = path70.slice(0, -1);
|
|
129811
|
+
const staticNode = ctx.static[path70];
|
|
129689
129812
|
if (staticNode && staticNode.methods) {
|
|
129690
129813
|
const staticMatch = staticNode.methods[method] || staticNode.methods[""];
|
|
129691
129814
|
if (staticMatch !== void 0) return staticMatch[0];
|
|
129692
129815
|
}
|
|
129693
|
-
const segments = splitPath(
|
|
129816
|
+
const segments = splitPath(path70);
|
|
129694
129817
|
const match = _lookupTree(ctx.root, method, segments, 0);
|
|
129695
129818
|
if (match === void 0) return;
|
|
129696
129819
|
if (opts?.params === false) return match;
|
|
@@ -129890,7 +130013,7 @@ var OpenAPIMatcher = class {
|
|
|
129890
130013
|
this.rootRouter = router;
|
|
129891
130014
|
this.index(router);
|
|
129892
130015
|
}
|
|
129893
|
-
index(router,
|
|
130016
|
+
index(router, path70 = []) {
|
|
129894
130017
|
const lazyResults = walkProcedureContractsSync(router, (contract, path210) => {
|
|
129895
130018
|
if (!value(this.filter, contract, path210)) {
|
|
129896
130019
|
return;
|
|
@@ -129905,7 +130028,7 @@ var OpenAPIMatcher = class {
|
|
|
129905
130028
|
contract,
|
|
129906
130029
|
procedure: contract instanceof Procedure ? contract : void 0
|
|
129907
130030
|
});
|
|
129908
|
-
},
|
|
130031
|
+
}, path70);
|
|
129909
130032
|
for (const result of lazyResults) {
|
|
129910
130033
|
const prefix = getOpenAPIMeta(result.router)?.prefix;
|
|
129911
130034
|
this.pendingLazyRouters.add({
|
|
@@ -129992,20 +130115,20 @@ var OpenAPIMatcher = class {
|
|
|
129992
130115
|
return entry.procedure;
|
|
129993
130116
|
}
|
|
129994
130117
|
};
|
|
129995
|
-
function toRou3Pattern(
|
|
129996
|
-
const params = getDynamicPathParams(
|
|
130118
|
+
function toRou3Pattern(path70) {
|
|
130119
|
+
const params = getDynamicPathParams(path70);
|
|
129997
130120
|
if (!params?.length) {
|
|
129998
|
-
return
|
|
130121
|
+
return path70;
|
|
129999
130122
|
}
|
|
130000
130123
|
for (let i10 = params.length - 1; i10 >= 0; i10--) {
|
|
130001
130124
|
const param = params[i10];
|
|
130002
130125
|
const pattern = param.allowsSlash ? `**:${param.parameterName}` : `:${param.parameterName}`;
|
|
130003
|
-
|
|
130126
|
+
path70 = path70.slice(0, param.startIndex) + pattern + path70.slice(param.startIndex + param.segment.length);
|
|
130004
130127
|
}
|
|
130005
|
-
return
|
|
130128
|
+
return path70;
|
|
130006
130129
|
}
|
|
130007
|
-
function toRou3PrefixMatcher(
|
|
130008
|
-
const pattern = toRou3Pattern(
|
|
130130
|
+
function toRou3PrefixMatcher(path70) {
|
|
130131
|
+
const pattern = toRou3Pattern(path70);
|
|
130009
130132
|
return routeToRegExp(pattern === "/" ? "/**" : `${pattern}/**`);
|
|
130010
130133
|
}
|
|
130011
130134
|
function decodeParams(params) {
|
|
@@ -130084,7 +130207,7 @@ var OpenAPIHandlerCodecCore = class {
|
|
|
130084
130207
|
/**
|
|
130085
130208
|
* @throws {TypeError} If `outputStructure` is "detailed" and the output doesn't match the expected structure.
|
|
130086
130209
|
*/
|
|
130087
|
-
encodeOutput(output2, procedure,
|
|
130210
|
+
encodeOutput(output2, procedure, path70) {
|
|
130088
130211
|
const meta3 = getOpenAPIMeta(procedure);
|
|
130089
130212
|
const successStatus = meta3?.successStatus ?? DEFAULT_SUCCESS_STATUS;
|
|
130090
130213
|
const outputStructure = meta3?.outputStructure ?? DEFAULT_OPENAPI_OUTPUT_STRUCTURE;
|
|
@@ -130097,7 +130220,7 @@ var OpenAPIHandlerCodecCore = class {
|
|
|
130097
130220
|
}
|
|
130098
130221
|
if (!isValidDetailedOutput(output2)) {
|
|
130099
130222
|
throw new TypeError(`
|
|
130100
|
-
Invalid "detailed" output structure returned by procedure (${
|
|
130223
|
+
Invalid "detailed" output structure returned by procedure (${path70.join(".")}):
|
|
130101
130224
|
\u2022 Expected an object with optional properties:
|
|
130102
130225
|
- status (number <400)
|
|
130103
130226
|
- headers (object)
|
|
@@ -130665,7 +130788,7 @@ function profileValue(name, paths) {
|
|
|
130665
130788
|
function createConfigApiRouter(deps) {
|
|
130666
130789
|
const authed = doorApiAuth(deps.expectedToken);
|
|
130667
130790
|
const { paths } = deps;
|
|
130668
|
-
const route = (
|
|
130791
|
+
const route = (path70, summary) => authed.meta(openapi({ method: "POST", path: path70, summary, tags: [CONFIG_API_TAG] }));
|
|
130669
130792
|
return {
|
|
130670
130793
|
config: {
|
|
130671
130794
|
identity: {
|
|
@@ -131024,7 +131147,7 @@ function createLifecycleApiRouter(deps) {
|
|
|
131024
131147
|
init_cliError();
|
|
131025
131148
|
|
|
131026
131149
|
// src/frontdoor/launchSchemas.ts
|
|
131027
|
-
var
|
|
131150
|
+
var import_node_path49 = __toESM(require("node:path"), 1);
|
|
131028
131151
|
init_zod();
|
|
131029
131152
|
init_statusline();
|
|
131030
131153
|
init_claudeVersion();
|
|
@@ -131035,7 +131158,7 @@ var LaunchResolveInputSchema = external_exports.strictObject({
|
|
|
131035
131158
|
argv: external_exports.readonly(external_exports.array(external_exports.string())).optional(),
|
|
131036
131159
|
/** The launch's inherited environment. Absent means an empty one: the door's own environment is never a substitute for the caller's, so a caller that wants `AGENT_SHIM_*` switches or a `CLAUDE_CONFIG_DIR` considered names them here. Values are read, never reported. */
|
|
131037
131160
|
env: external_exports.record(external_exports.string(), external_exports.string()).optional()
|
|
131038
|
-
}).refine((input2) =>
|
|
131161
|
+
}).refine((input2) => import_node_path49.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
131039
131162
|
var LaunchPoolDecisionSchema = external_exports.strictObject({
|
|
131040
131163
|
name: external_exports.string(),
|
|
131041
131164
|
reasons: external_exports.readonly(external_exports.array(external_exports.string())),
|
|
@@ -132086,6 +132209,7 @@ async function serveRouted(incoming, deps) {
|
|
|
132086
132209
|
|
|
132087
132210
|
// src/frontdoor/providerRoute.ts
|
|
132088
132211
|
init_load();
|
|
132212
|
+
init_names();
|
|
132089
132213
|
init_schema();
|
|
132090
132214
|
init_translate2();
|
|
132091
132215
|
init_translate();
|
|
@@ -132692,8 +132816,8 @@ function createCodexRouteMount(ports, upstreamBase, provider) {
|
|
|
132692
132816
|
request7.body.resume();
|
|
132693
132817
|
return;
|
|
132694
132818
|
}
|
|
132695
|
-
const
|
|
132696
|
-
const translated = { method: request7.method, path:
|
|
132819
|
+
const path70 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
132820
|
+
const translated = { method: request7.method, path: path70, body, signal: request7.signal };
|
|
132697
132821
|
const routed = await route(translated);
|
|
132698
132822
|
if (request7.signal.aborted) {
|
|
132699
132823
|
return;
|
|
@@ -133314,8 +133438,8 @@ function createAntigravityRouteMount(ports, upstreamBase, provider) {
|
|
|
133314
133438
|
request7.body.resume();
|
|
133315
133439
|
return;
|
|
133316
133440
|
}
|
|
133317
|
-
const
|
|
133318
|
-
const translated = { method: request7.method, path:
|
|
133441
|
+
const path70 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
133442
|
+
const translated = { method: request7.method, path: path70, body, signal: request7.signal };
|
|
133319
133443
|
const routed = await route(translated);
|
|
133320
133444
|
if (request7.signal.aborted) {
|
|
133321
133445
|
return;
|
|
@@ -133356,7 +133480,7 @@ function createPassthroughRoute(name, target) {
|
|
|
133356
133480
|
headroomUpstream: target.headroomUpstream,
|
|
133357
133481
|
serve: async (request7, response) => {
|
|
133358
133482
|
const incoming = new URL(request7.url, "http://127.0.0.1");
|
|
133359
|
-
const
|
|
133483
|
+
const path70 = target.stripPrefix !== void 0 && incoming.pathname.startsWith(target.stripPrefix) ? incoming.pathname.slice(target.stripPrefix.length) : incoming.pathname;
|
|
133360
133484
|
const headers = forwardableHeaders(request7.headers);
|
|
133361
133485
|
delete headers.host;
|
|
133362
133486
|
await new Promise((resolve2) => {
|
|
@@ -133364,7 +133488,7 @@ function createPassthroughRoute(name, target) {
|
|
|
133364
133488
|
host: base.hostname,
|
|
133365
133489
|
port: base.port === "" ? void 0 : Number(base.port),
|
|
133366
133490
|
method: request7.method,
|
|
133367
|
-
path: `${basePath}${
|
|
133491
|
+
path: `${basePath}${path70}${incoming.search}`,
|
|
133368
133492
|
headers,
|
|
133369
133493
|
agent
|
|
133370
133494
|
};
|
|
@@ -133536,13 +133660,13 @@ async function scanRequestHead(request7, wholeBody = false) {
|
|
|
133536
133660
|
}
|
|
133537
133661
|
|
|
133538
133662
|
// src/frontdoor/providerRoute.ts
|
|
133539
|
-
var isRcSelfHostPath = (
|
|
133663
|
+
var isRcSelfHostPath = (path70) => path70 === "/v1/code/sessions" || path70.startsWith("/v1/code/sessions/") || path70 === "/v1/sessions" || path70.startsWith("/v1/sessions/");
|
|
133540
133664
|
function scopeSessionProviderPath(request7) {
|
|
133541
133665
|
if (request7.session.provider === void 0) {
|
|
133542
133666
|
return request7;
|
|
133543
133667
|
}
|
|
133544
|
-
const
|
|
133545
|
-
if (!
|
|
133668
|
+
const path70 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
133669
|
+
if (!path70.startsWith("/v1/") || isRcSelfHostPath(path70)) {
|
|
133546
133670
|
return request7;
|
|
133547
133671
|
}
|
|
133548
133672
|
return { ...request7, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(request7.session.provider)}${request7.url}` };
|
|
@@ -133602,7 +133726,7 @@ function resolveAccountTarget(model, models) {
|
|
|
133602
133726
|
const ref = model.slice("acct:".length);
|
|
133603
133727
|
const [identity, ...rest] = ref.split("/");
|
|
133604
133728
|
const named = rest.join("/");
|
|
133605
|
-
return identity === void 0 || named === "" ? void 0 : { identity, model: named };
|
|
133729
|
+
return identity === void 0 || !isFileName(identity) || named === "" ? void 0 : { identity, model: named };
|
|
133606
133730
|
}
|
|
133607
133731
|
const virtual = models?.virtual?.[model];
|
|
133608
133732
|
const first = virtual?.members.find((member) => member.startsWith("acct:"));
|
|
@@ -133666,19 +133790,22 @@ function createProviderRouteResolver(deps) {
|
|
|
133666
133790
|
return route;
|
|
133667
133791
|
};
|
|
133668
133792
|
const resolve2 = (request7) => {
|
|
133669
|
-
const
|
|
133670
|
-
const scoped = parseProviderPath(
|
|
133793
|
+
const path70 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
133794
|
+
const scoped = parseProviderPath(path70);
|
|
133671
133795
|
if (scoped === void 0) {
|
|
133672
|
-
if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(
|
|
133796
|
+
if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(path70)) {
|
|
133673
133797
|
return { ok: true, route: deps.rcSelfHostRoute };
|
|
133674
133798
|
}
|
|
133675
|
-
return
|
|
133799
|
+
return path70.startsWith("/v1/") ? { ok: true, route: oauthRoute } : { ok: false, status: HTTP_STATUS.notFound, message: `no such endpoint: ${path70}` };
|
|
133676
133800
|
}
|
|
133677
133801
|
const { provider } = scoped;
|
|
133678
133802
|
let definition;
|
|
133679
133803
|
try {
|
|
133680
133804
|
definition = loadProvider(deps.providersDir, provider, deps.fs);
|
|
133681
133805
|
} catch (error63) {
|
|
133806
|
+
if (error63 instanceof InvalidProviderNameError) {
|
|
133807
|
+
return { ok: false, status: HTTP_STATUS.notFound, message: `no provider named ${JSON.stringify(provider)}` };
|
|
133808
|
+
}
|
|
133682
133809
|
if (error63 instanceof ConfigValidationError || error63 instanceof LegacyProviderFileError) {
|
|
133683
133810
|
return { ok: false, status: HTTP_STATUS.internalServerError, message: `provider ${provider} is invalid: ${error63 instanceof Error ? error63.message : String(error63)}` };
|
|
133684
133811
|
}
|
|
@@ -133764,8 +133891,8 @@ function createProviderRouteResolver(deps) {
|
|
|
133764
133891
|
let modelChoice;
|
|
133765
133892
|
const visited = /* @__PURE__ */ new Set();
|
|
133766
133893
|
for (; ; ) {
|
|
133767
|
-
const
|
|
133768
|
-
const scoped = parseProviderPath(
|
|
133894
|
+
const path70 = new URL(current.url, "http://127.0.0.1").pathname;
|
|
133895
|
+
const scoped = parseProviderPath(path70);
|
|
133769
133896
|
const providerName = scoped?.provider ?? current.session.provider;
|
|
133770
133897
|
if (providerName !== void 0 && visited.has(providerName)) {
|
|
133771
133898
|
return { ok: false, status: HTTP_STATUS.internalServerError, message: `provider routing cycle: ${[...visited, providerName].join(" -> ")}` };
|
|
@@ -133780,7 +133907,7 @@ function createProviderRouteResolver(deps) {
|
|
|
133780
133907
|
} catch {
|
|
133781
133908
|
routes = void 0;
|
|
133782
133909
|
}
|
|
133783
|
-
const resolvesNames = !nameResolved && !isRcSelfHostPath(
|
|
133910
|
+
const resolvesNames = !nameResolved && !isRcSelfHostPath(path70);
|
|
133784
133911
|
if (resolvesNames) {
|
|
133785
133912
|
const scan2 = await scanRequestHead(current, true);
|
|
133786
133913
|
if (scan2.replayed === void 0) {
|
|
@@ -133819,7 +133946,7 @@ function createProviderRouteResolver(deps) {
|
|
|
133819
133946
|
}
|
|
133820
133947
|
if (routed.provider !== providerName) {
|
|
133821
133948
|
const scopedPrefix = providerName === void 0 ? void 0 : `${PROVIDER_PATH_PREFIX}${encodeURIComponent(providerName)}`;
|
|
133822
|
-
const rest2 = scopedPrefix !== void 0 &&
|
|
133949
|
+
const rest2 = scopedPrefix !== void 0 && path70.startsWith(scopedPrefix) ? path70.slice(scopedPrefix.length) : path70;
|
|
133823
133950
|
const query2 = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
|
|
133824
133951
|
const carried = replay;
|
|
133825
133952
|
current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(routed.provider)}${rest2}${query2}`, body: carried.body, headers: carried.headers };
|
|
@@ -133873,7 +134000,7 @@ function createProviderRouteResolver(deps) {
|
|
|
133873
134000
|
const headers = Object.fromEntries(Object.entries(replay.headers).filter(([name]) => name.toLowerCase() !== "content-length"));
|
|
133874
134001
|
replay = { ...replay, headers, body: import_node_stream3.Readable.from([Buffer.from(rewritten, "utf8")]) };
|
|
133875
134002
|
}
|
|
133876
|
-
const rest = scoped === void 0 ?
|
|
134003
|
+
const rest = scoped === void 0 ? path70 : path70.slice(`${PROVIDER_PATH_PREFIX}${encodeURIComponent(scoped.provider)}`.length);
|
|
133877
134004
|
const query = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
|
|
133878
134005
|
current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(matched.provider)}${rest}${query}`, body: replay.body, headers: replay.headers };
|
|
133879
134006
|
}
|
|
@@ -133981,7 +134108,7 @@ function createRcLiveUsage(deps) {
|
|
|
133981
134108
|
}
|
|
133982
134109
|
|
|
133983
134110
|
// src/frontdoor/rcSelfHostMint.ts
|
|
133984
|
-
var
|
|
134111
|
+
var import_node_path50 = __toESM(require("node:path"), 1);
|
|
133985
134112
|
init_account();
|
|
133986
134113
|
|
|
133987
134114
|
// src/frontdoor/rcSelfHostLocal.ts
|
|
@@ -134111,7 +134238,7 @@ function readJsonObject(fs30, file2) {
|
|
|
134111
134238
|
return isRecord16(parsed) ? parsed : void 0;
|
|
134112
134239
|
}
|
|
134113
134240
|
function readRcSelfHostRecord(fs30, frontdoorDir) {
|
|
134114
|
-
const parsed = readJsonObject(fs30,
|
|
134241
|
+
const parsed = readJsonObject(fs30, import_node_path50.default.join(frontdoorDir, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE));
|
|
134115
134242
|
if (parsed === void 0) {
|
|
134116
134243
|
return void 0;
|
|
134117
134244
|
}
|
|
@@ -134125,11 +134252,11 @@ function mintRcSelfHostCredential(deps) {
|
|
|
134125
134252
|
if (!isIdentityName(deps.identity)) {
|
|
134126
134253
|
throw new Error(`"${deps.identity}" is not a valid identity name.`);
|
|
134127
134254
|
}
|
|
134128
|
-
const identityDir =
|
|
134129
|
-
const credentialsFile =
|
|
134130
|
-
const claudeJsonFile =
|
|
134131
|
-
const recordDir =
|
|
134132
|
-
const recordFile =
|
|
134255
|
+
const identityDir = import_node_path50.default.join(deps.identitiesDir, deps.identity);
|
|
134256
|
+
const credentialsFile = import_node_path50.default.join(identityDir, CREDENTIALS_FILE2);
|
|
134257
|
+
const claudeJsonFile = import_node_path50.default.join(identityDir, CLAUDE_JSON2);
|
|
134258
|
+
const recordDir = import_node_path50.default.join(deps.frontdoorDir, RC_SELF_HOST_RECORD_DIR);
|
|
134259
|
+
const recordFile = import_node_path50.default.join(recordDir, RC_SELF_HOST_RECORD_FILE);
|
|
134133
134260
|
const previousRecord = readRcSelfHostRecord(deps.fs, deps.frontdoorDir);
|
|
134134
134261
|
const existingCredentials = readJsonObject(deps.fs, credentialsFile);
|
|
134135
134262
|
const existingOauth = isRecord16(existingCredentials?.claudeAiOauth) ? existingCredentials.claudeAiOauth : void 0;
|
|
@@ -134145,7 +134272,7 @@ function mintRcSelfHostCredential(deps) {
|
|
|
134145
134272
|
const organizationUuid = deps.newUuid();
|
|
134146
134273
|
const accountUuid = deps.newUuid();
|
|
134147
134274
|
const mintedAt = new Date(deps.now()).toISOString();
|
|
134148
|
-
deps.fs.mkdirPrivate(
|
|
134275
|
+
deps.fs.mkdirPrivate(import_node_path50.default.dirname(credentialsFile));
|
|
134149
134276
|
deps.fs.writeFilePrivate(credentialsFile, `${JSON.stringify({ ...existingCredentials, claudeAiOauth: { accessToken, refreshToken, expiresAt: null, scopes: [...RC_SELF_HOST_SCOPE_LIST], subscriptionType: SELF_HOST_SUBSCRIPTION_TYPE, rateLimitTier: null } }, null, 2)}
|
|
134150
134277
|
`);
|
|
134151
134278
|
const claudeJson = readJsonObject(deps.fs, claudeJsonFile) ?? {};
|
|
@@ -134532,7 +134659,7 @@ function registerRcCommand(frontdoor, paths) {
|
|
|
134532
134659
|
}
|
|
134533
134660
|
|
|
134534
134661
|
// src/frontdoor/rcCredentialStore.ts
|
|
134535
|
-
var
|
|
134662
|
+
var import_node_path51 = __toESM(require("node:path"), 1);
|
|
134536
134663
|
function isSafeSessionId(sessionId) {
|
|
134537
134664
|
return /^[A-Za-z0-9_-]+$/.test(sessionId);
|
|
134538
134665
|
}
|
|
@@ -134558,7 +134685,7 @@ function sequenceNumOfJson(value2) {
|
|
|
134558
134685
|
}
|
|
134559
134686
|
function createRcCredentialStore(fs30, dir) {
|
|
134560
134687
|
fs30.mkdirPrivate(dir);
|
|
134561
|
-
const fileFor = (sessionId) =>
|
|
134688
|
+
const fileFor = (sessionId) => import_node_path51.default.join(dir, `${sessionId}.json`);
|
|
134562
134689
|
const readParsed = (sessionId) => {
|
|
134563
134690
|
const raw = fs30.readFileUtf8(fileFor(sessionId));
|
|
134564
134691
|
if (raw === void 0) {
|
|
@@ -137213,7 +137340,7 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, retire, trackTun
|
|
|
137213
137340
|
log
|
|
137214
137341
|
});
|
|
137215
137342
|
const canonicalProvider = createProviderCanonicaliser({
|
|
137216
|
-
defined: (name) => realFarmFs.lstat(
|
|
137343
|
+
defined: (name) => providerFileDefined((file2) => realFarmFs.lstat(file2), paths.providersDir, name),
|
|
137217
137344
|
aliases: () => loadProviderAliases(paths.providerAliasesFile, realFsPort),
|
|
137218
137345
|
log
|
|
137219
137346
|
});
|
|
@@ -137361,7 +137488,7 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, retire, trackTun
|
|
|
137361
137488
|
const leafFor = createLeafCache(loadCa(), () => /* @__PURE__ */ new Date());
|
|
137362
137489
|
const capture = captureFromEnv(process.env, paths.logsDir);
|
|
137363
137490
|
if (capture !== void 0) {
|
|
137364
|
-
log(`capture enabled, recording CONNECT targets and piped exchanges to ${
|
|
137491
|
+
log(`capture enabled, recording CONNECT targets and piped exchanges to ${import_node_path52.default.join(paths.logsDir, "frontdoor-capture.jsonl")}`);
|
|
137365
137492
|
}
|
|
137366
137493
|
if (rcSelfHostSurface !== void 0) {
|
|
137367
137494
|
log("self-hosted Remote Control surface on: the door serves the CCR session family itself, and its own client-half dials its own transparent surface");
|
|
@@ -137449,7 +137576,7 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, retire, trackTun
|
|
|
137449
137576
|
cooldownStepMs: DOOR_STALL_BOUND_MS,
|
|
137450
137577
|
cooldownCapMs: DOOR_RESPAWN_COOLDOWN_CAP_MS,
|
|
137451
137578
|
startLockFile: paths.frontdoorLockFile,
|
|
137452
|
-
...process.platform === "darwin" ? { nativeSample: { command: MACOS_SAMPLER, args: ["{pid}", "{seconds}", "-file", "{file}"], directory:
|
|
137579
|
+
...process.platform === "darwin" ? { nativeSample: { command: MACOS_SAMPLER, args: ["{pid}", "{seconds}", "-file", "{file}"], directory: import_node_path52.default.join(import_node_path52.default.dirname(paths.frontdoorLogPath), "stall-samples"), seconds: Math.max(1, Math.ceil(DOOR_WATCHDOG_CHECK_MS / MS_PER_SECOND16)), keep: DOOR_RESPAWN_MAX_GENERATIONS + 1 } } : {}
|
|
137453
137580
|
}),
|
|
137454
137581
|
// The launch lifecycle publisher over the same backbone the typed API serves: the tick's registry facts go in here, and the door's own register, prune and end moments come out as source-tagged events.
|
|
137455
137582
|
observeLaunchRegistry: createLaunchEventPublisher(doorEvents, () => Date.now()).observe,
|
|
@@ -137546,7 +137673,7 @@ function registerFrontDoorCommand(program2, deps) {
|
|
|
137546
137673
|
// src/statusline/commands.ts
|
|
137547
137674
|
var import_node_child_process8 = require("node:child_process");
|
|
137548
137675
|
var import_node_os13 = __toESM(require("node:os"), 1);
|
|
137549
|
-
var
|
|
137676
|
+
var import_node_path60 = __toESM(require("node:path"), 1);
|
|
137550
137677
|
init_commandDeps();
|
|
137551
137678
|
init_statusline();
|
|
137552
137679
|
init_providersStore();
|
|
@@ -137555,13 +137682,13 @@ init_account();
|
|
|
137555
137682
|
init_read();
|
|
137556
137683
|
|
|
137557
137684
|
// src/statusline/client.ts
|
|
137558
|
-
var
|
|
137685
|
+
var import_node_path53 = __toESM(require("node:path"), 1);
|
|
137559
137686
|
function isAntigravityPayload(payload) {
|
|
137560
137687
|
return typeof payload === "object" && payload !== null && "product" in payload && payload.product === "antigravity";
|
|
137561
137688
|
}
|
|
137562
137689
|
var ANTIGRAVITY_SETTINGS_SEGMENTS = [".gemini", "antigravity-cli", "settings.json"];
|
|
137563
137690
|
function antigravityStacksWithDefault(fs30, homeDir) {
|
|
137564
|
-
const raw = fs30.readFileUtf8(
|
|
137691
|
+
const raw = fs30.readFileUtf8(import_node_path53.default.join(homeDir, ...ANTIGRAVITY_SETTINGS_SEGMENTS));
|
|
137565
137692
|
if (raw === void 0) {
|
|
137566
137693
|
return false;
|
|
137567
137694
|
}
|
|
@@ -137991,7 +138118,7 @@ function viewOf(payload) {
|
|
|
137991
138118
|
init_blockingSpawn();
|
|
137992
138119
|
var import_node_fs22 = __toESM(require("node:fs"), 1);
|
|
137993
138120
|
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
137994
|
-
var
|
|
138121
|
+
var import_node_path54 = __toESM(require("node:path"), 1);
|
|
137995
138122
|
|
|
137996
138123
|
// src/statusline/memoryUse.ts
|
|
137997
138124
|
var BYTES_PER_KIBIBYTE = 1024;
|
|
@@ -138120,9 +138247,9 @@ function realStatuslinePorts(env, stateDirectory) {
|
|
|
138120
138247
|
}
|
|
138121
138248
|
},
|
|
138122
138249
|
writeText: (target, text5) => {
|
|
138123
|
-
const temporary =
|
|
138250
|
+
const temporary = import_node_path54.default.join(import_node_path54.default.dirname(target), `.${import_node_path54.default.basename(target)}.${String(process.pid)}.tmp`);
|
|
138124
138251
|
try {
|
|
138125
|
-
import_node_fs22.default.mkdirSync(
|
|
138252
|
+
import_node_fs22.default.mkdirSync(import_node_path54.default.dirname(target), { recursive: true, mode: STATE_DIRECTORY_MODE });
|
|
138126
138253
|
import_node_fs22.default.writeFileSync(temporary, text5, { mode: STATE_FILE_MODE });
|
|
138127
138254
|
import_node_fs22.default.renameSync(temporary, target);
|
|
138128
138255
|
} catch {
|
|
@@ -138377,7 +138504,7 @@ function effortSegment({ payload, settings: settings2 }) {
|
|
|
138377
138504
|
}
|
|
138378
138505
|
|
|
138379
138506
|
// src/statusline/dailyLedger.ts
|
|
138380
|
-
var
|
|
138507
|
+
var import_node_path55 = __toESM(require("node:path"), 1);
|
|
138381
138508
|
init_zod();
|
|
138382
138509
|
init_schema2();
|
|
138383
138510
|
var DAILY_LEDGER_DIRECTORY = "daily-cost";
|
|
@@ -138421,19 +138548,19 @@ function advance(existing, carried, cost, nowMs) {
|
|
|
138421
138548
|
return { entry: existing, changed: false };
|
|
138422
138549
|
}
|
|
138423
138550
|
function recordDailySpend(ports, nowMs, sessionId, cost) {
|
|
138424
|
-
const root =
|
|
138551
|
+
const root = import_node_path55.default.join(ports.stateDirectory, DAILY_LEDGER_DIRECTORY);
|
|
138425
138552
|
const today = localDay(nowMs);
|
|
138426
138553
|
const days = (ports.listDirectory(root) ?? []).filter((name) => DAY_NAME.test(name));
|
|
138427
138554
|
const previous = days.filter((day) => day < today).sort().at(-1);
|
|
138428
138555
|
for (const day of days) {
|
|
138429
138556
|
if (day < today && day !== previous) {
|
|
138430
|
-
ports.removePath(
|
|
138557
|
+
ports.removePath(import_node_path55.default.join(root, day));
|
|
138431
138558
|
}
|
|
138432
138559
|
}
|
|
138433
|
-
const todayDirectory =
|
|
138560
|
+
const todayDirectory = import_node_path55.default.join(root, today);
|
|
138434
138561
|
if (sessionId !== void 0 && cost !== void 0 && CLIENT_SESSION_ID_PATTERN.test(sessionId)) {
|
|
138435
|
-
const file2 =
|
|
138436
|
-
const carried = previous === void 0 ? void 0 : parseEntry3(ports.readText(
|
|
138562
|
+
const file2 = import_node_path55.default.join(todayDirectory, `${sessionId}.json`);
|
|
138563
|
+
const carried = previous === void 0 ? void 0 : parseEntry3(ports.readText(import_node_path55.default.join(root, previous, `${sessionId}.json`)));
|
|
138437
138564
|
const next = advance(parseEntry3(ports.readText(file2)), carried, cost, nowMs);
|
|
138438
138565
|
if (next?.changed === true) {
|
|
138439
138566
|
ports.writeText(file2, `${JSON.stringify(next.entry)}
|
|
@@ -138441,7 +138568,7 @@ function recordDailySpend(ports, nowMs, sessionId, cost) {
|
|
|
138441
138568
|
}
|
|
138442
138569
|
}
|
|
138443
138570
|
const entries = (ports.listDirectory(todayDirectory) ?? []).filter((name) => ENTRY_FILE.test(name)).flatMap((name) => {
|
|
138444
|
-
const entry = parseEntry3(ports.readText(
|
|
138571
|
+
const entry = parseEntry3(ports.readText(import_node_path55.default.join(todayDirectory, name)));
|
|
138445
138572
|
return entry === void 0 ? [] : [entry];
|
|
138446
138573
|
});
|
|
138447
138574
|
return entries.length === 0 ? void 0 : entries.reduce((sum2, entry) => sum2 + (entry.totalUsd - entry.baselineUsd), 0);
|
|
@@ -138705,7 +138832,7 @@ function modelSegment(context) {
|
|
|
138705
138832
|
}
|
|
138706
138833
|
|
|
138707
138834
|
// src/statusline/elements/header/outputStyle.ts
|
|
138708
|
-
var
|
|
138835
|
+
var import_node_path56 = __toESM(require("node:path"), 1);
|
|
138709
138836
|
init_zod();
|
|
138710
138837
|
var SettingsFileSchema = external_exports.looseObject({ outputStyle: external_exports.string().optional().catch(void 0) });
|
|
138711
138838
|
function outputStyleIn(file2, readText2) {
|
|
@@ -138725,12 +138852,12 @@ function outputStyleIn(file2, readText2) {
|
|
|
138725
138852
|
}
|
|
138726
138853
|
function outputStyleSegment({ payload, ports }) {
|
|
138727
138854
|
const pinned = ports.env.CLAUDE_CONFIG_DIR;
|
|
138728
|
-
const configDirectory = pinned === void 0 || pinned === "" ?
|
|
138855
|
+
const configDirectory = pinned === void 0 || pinned === "" ? import_node_path56.default.join(ports.homeDirectory, ".claude") : pinned;
|
|
138729
138856
|
const projectDirectory = payload.cwd ?? payload.workspace?.current_dir;
|
|
138730
138857
|
const files = [
|
|
138731
|
-
|
|
138732
|
-
|
|
138733
|
-
...projectDirectory === void 0 ? [] : [
|
|
138858
|
+
import_node_path56.default.join(configDirectory, "settings.json"),
|
|
138859
|
+
import_node_path56.default.join(configDirectory, "settings.local.json"),
|
|
138860
|
+
...projectDirectory === void 0 ? [] : [import_node_path56.default.join(projectDirectory, ".claude", "settings.json"), import_node_path56.default.join(projectDirectory, ".claude", "settings.local.json")]
|
|
138734
138861
|
];
|
|
138735
138862
|
const style = files.map((file2) => outputStyleIn(file2, ports.readText)).findLast((name) => name !== void 0);
|
|
138736
138863
|
return style === void 0 ? void 0 : `style: ${style}`;
|
|
@@ -138820,13 +138947,13 @@ init_zod();
|
|
|
138820
138947
|
|
|
138821
138948
|
// src/statusline/cacheFile.ts
|
|
138822
138949
|
var import_node_crypto26 = require("node:crypto");
|
|
138823
|
-
var
|
|
138950
|
+
var import_node_path57 = __toESM(require("node:path"), 1);
|
|
138824
138951
|
var SESSION_CACHE_DIRECTORY = "session";
|
|
138825
138952
|
function cacheDirectory(ports) {
|
|
138826
|
-
return
|
|
138953
|
+
return import_node_path57.default.join(ports.stateDirectory, SESSION_CACHE_DIRECTORY);
|
|
138827
138954
|
}
|
|
138828
138955
|
function cacheFileFor(ports, kind, transcriptPath) {
|
|
138829
|
-
return
|
|
138956
|
+
return import_node_path57.default.join(cacheDirectory(ports), `${kind}-${(0, import_node_crypto26.createHash)("sha256").update(transcriptPath).digest("hex")}.json`);
|
|
138830
138957
|
}
|
|
138831
138958
|
var RETENTION_DAYS = 30;
|
|
138832
138959
|
var HOURS_PER_DAY10 = 24;
|
|
@@ -138841,7 +138968,7 @@ function pruneCache(ports, cutoffMs) {
|
|
|
138841
138968
|
return;
|
|
138842
138969
|
}
|
|
138843
138970
|
for (const name of names) {
|
|
138844
|
-
const file2 =
|
|
138971
|
+
const file2 = import_node_path57.default.join(directory, name);
|
|
138845
138972
|
const modifiedAtMs = ports.modifiedAtMs(file2);
|
|
138846
138973
|
if (modifiedAtMs !== void 0 && modifiedAtMs < cutoffMs) {
|
|
138847
138974
|
ports.removePath(file2);
|
|
@@ -138996,15 +139123,15 @@ function parseNumstat(output2) {
|
|
|
138996
139123
|
if (addedText === void 0 || deletedText === void 0 || pathText === void 0) {
|
|
138997
139124
|
continue;
|
|
138998
139125
|
}
|
|
138999
|
-
const
|
|
139126
|
+
const path70 = pathText === "" ? fields[index + 2] : pathText;
|
|
139000
139127
|
if (pathText === "") {
|
|
139001
139128
|
index += 2;
|
|
139002
139129
|
}
|
|
139003
139130
|
const lines = { added: Number(addedText), deleted: Number(deletedText) };
|
|
139004
|
-
if (
|
|
139131
|
+
if (path70 !== void 0 && Number.isInteger(lines.added) && Number.isInteger(lines.deleted)) {
|
|
139005
139132
|
added += lines.added;
|
|
139006
139133
|
deleted += lines.deleted;
|
|
139007
|
-
byPath.set(
|
|
139134
|
+
byPath.set(path70, lines);
|
|
139008
139135
|
}
|
|
139009
139136
|
}
|
|
139010
139137
|
return { total: { added, deleted }, byPath };
|
|
@@ -139059,7 +139186,7 @@ function readGitStatus(ports, cwd, query) {
|
|
|
139059
139186
|
}
|
|
139060
139187
|
|
|
139061
139188
|
// src/statusline/vcs/jj.ts
|
|
139062
|
-
var
|
|
139189
|
+
var import_node_path58 = __toESM(require("node:path"), 1);
|
|
139063
139190
|
var JJ2 = "jj";
|
|
139064
139191
|
var MAX_WALK_DEPTH = 64;
|
|
139065
139192
|
var MAX_LABEL_CODE_POINTS = 64;
|
|
@@ -139072,13 +139199,13 @@ function isJjRepository(ports, cwd) {
|
|
|
139072
139199
|
return false;
|
|
139073
139200
|
}
|
|
139074
139201
|
for (let depth = 0; depth < MAX_WALK_DEPTH; depth += 1) {
|
|
139075
|
-
if (ports.entryKind(
|
|
139202
|
+
if (ports.entryKind(import_node_path58.default.join(directory, ".jj")) === "directory") {
|
|
139076
139203
|
return true;
|
|
139077
139204
|
}
|
|
139078
|
-
if (ports.entryKind(
|
|
139205
|
+
if (ports.entryKind(import_node_path58.default.join(directory, ".git")) !== void 0) {
|
|
139079
139206
|
return false;
|
|
139080
139207
|
}
|
|
139081
|
-
const parent =
|
|
139208
|
+
const parent = import_node_path58.default.dirname(directory);
|
|
139082
139209
|
if (parent === directory) {
|
|
139083
139210
|
return false;
|
|
139084
139211
|
}
|
|
@@ -139354,7 +139481,7 @@ function gitFilesRow(context) {
|
|
|
139354
139481
|
}
|
|
139355
139482
|
|
|
139356
139483
|
// src/statusline/configCounts.ts
|
|
139357
|
-
var
|
|
139484
|
+
var import_node_path59 = __toESM(require("node:path"), 1);
|
|
139358
139485
|
init_zod();
|
|
139359
139486
|
var nameList = external_exports.array(external_exports.unknown()).catch([]).transform((items) => items.filter((item) => typeof item === "string"));
|
|
139360
139487
|
var ConfigFileSchema = external_exports.looseObject({
|
|
@@ -139428,7 +139555,7 @@ function countRules(ports, root) {
|
|
|
139428
139555
|
break;
|
|
139429
139556
|
}
|
|
139430
139557
|
entries += 1;
|
|
139431
|
-
const entry =
|
|
139558
|
+
const entry = import_node_path59.default.join(real, name);
|
|
139432
139559
|
const kind = followedKind(ports, entry);
|
|
139433
139560
|
if (kind === "directory") {
|
|
139434
139561
|
count2 += walk3(entry);
|
|
@@ -139445,33 +139572,33 @@ function countRules(ports, root) {
|
|
|
139445
139572
|
return walk3(root);
|
|
139446
139573
|
}
|
|
139447
139574
|
function sameLocation(ports, left, right) {
|
|
139448
|
-
return (ports.realPath(left) ??
|
|
139575
|
+
return (ports.realPath(left) ?? import_node_path59.default.resolve(left)) === (ports.realPath(right) ?? import_node_path59.default.resolve(right));
|
|
139449
139576
|
}
|
|
139450
139577
|
function configDirectoryOf(ports) {
|
|
139451
139578
|
const pinned = ports.env.CLAUDE_CONFIG_DIR;
|
|
139452
|
-
return pinned === void 0 || pinned === "" ?
|
|
139579
|
+
return pinned === void 0 || pinned === "" ? import_node_path59.default.join(ports.homeDirectory, ".claude") : pinned;
|
|
139453
139580
|
}
|
|
139454
139581
|
function countConfiguration(ports, projectDirectory) {
|
|
139455
139582
|
const userDirectory = configDirectoryOf(ports);
|
|
139456
|
-
const userSettings = readConfigFile(ports,
|
|
139457
|
-
const globalFile = ports.env.CLAUDE_CONFIG_DIR === void 0 || ports.env.CLAUDE_CONFIG_DIR === "" ?
|
|
139583
|
+
const userSettings = readConfigFile(ports, import_node_path59.default.join(userDirectory, "settings.json"));
|
|
139584
|
+
const globalFile = ports.env.CLAUDE_CONFIG_DIR === void 0 || ports.env.CLAUDE_CONFIG_DIR === "" ? import_node_path59.default.join(ports.homeDirectory, ".claude.json") : import_node_path59.default.join(userDirectory, ".claude.json");
|
|
139458
139585
|
const global2 = readConfigFile(ports, globalFile);
|
|
139459
139586
|
const userServers = /* @__PURE__ */ new Set([...namesOf(userSettings), ...namesOf(global2)]);
|
|
139460
139587
|
removeNames(userServers, global2?.disabledMcpServers);
|
|
139461
139588
|
const projectServers = /* @__PURE__ */ new Set();
|
|
139462
|
-
let claudeMd = isFile(ports,
|
|
139463
|
-
let rules = countRules(ports,
|
|
139589
|
+
let claudeMd = isFile(ports, import_node_path59.default.join(userDirectory, "CLAUDE.md")) ? 1 : 0;
|
|
139590
|
+
let rules = countRules(ports, import_node_path59.default.join(userDirectory, "rules"));
|
|
139464
139591
|
let hookEvents = hookEventsOf(userSettings);
|
|
139465
139592
|
if (projectDirectory !== void 0) {
|
|
139466
|
-
const projectClaude =
|
|
139593
|
+
const projectClaude = import_node_path59.default.join(projectDirectory, ".claude");
|
|
139467
139594
|
const projectIsUser = sameLocation(ports, projectClaude, userDirectory);
|
|
139468
|
-
const claudeMdFiles = [
|
|
139595
|
+
const claudeMdFiles = [import_node_path59.default.join(projectDirectory, "CLAUDE.md"), import_node_path59.default.join(projectDirectory, "CLAUDE.local.md"), import_node_path59.default.join(projectClaude, "CLAUDE.local.md"), ...projectIsUser ? [] : [import_node_path59.default.join(projectClaude, "CLAUDE.md")]];
|
|
139469
139596
|
claudeMd += claudeMdFiles.filter((file2) => isFile(ports, file2)).length;
|
|
139470
|
-
const mcpJson = namesOf(readConfigFile(ports,
|
|
139597
|
+
const mcpJson = namesOf(readConfigFile(ports, import_node_path59.default.join(projectDirectory, ".mcp.json")));
|
|
139471
139598
|
if (!projectIsUser) {
|
|
139472
|
-
rules += countRules(ports,
|
|
139473
|
-
const settings2 = readConfigFile(ports,
|
|
139474
|
-
const local = readConfigFile(ports,
|
|
139599
|
+
rules += countRules(ports, import_node_path59.default.join(projectClaude, "rules"));
|
|
139600
|
+
const settings2 = readConfigFile(ports, import_node_path59.default.join(projectClaude, "settings.json"));
|
|
139601
|
+
const local = readConfigFile(ports, import_node_path59.default.join(projectClaude, "settings.local.json"));
|
|
139475
139602
|
hookEvents += hookEventsOf(settings2) + hookEventsOf(local);
|
|
139476
139603
|
for (const name of [...namesOf(settings2), ...namesOf(local)]) {
|
|
139477
139604
|
projectServers.add(name);
|
|
@@ -140357,7 +140484,7 @@ function registerStatuslineCommand(program2, deps) {
|
|
|
140357
140484
|
} else {
|
|
140358
140485
|
const configDir = process.env.CLAUDE_CONFIG_DIR;
|
|
140359
140486
|
try {
|
|
140360
|
-
account = readAccountMetadataFile(realFarmFs, configDir === void 0 || configDir === "" ?
|
|
140487
|
+
account = readAccountMetadataFile(realFarmFs, configDir === void 0 || configDir === "" ? import_node_path60.default.join(import_node_os13.default.homedir(), ".claude.json") : import_node_path60.default.join(configDir, ".claude.json"));
|
|
140361
140488
|
} catch {
|
|
140362
140489
|
account = void 0;
|
|
140363
140490
|
}
|
|
@@ -142458,8 +142585,8 @@ function getErrorMap2() {
|
|
|
142458
142585
|
|
|
142459
142586
|
// node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/helpers/parseUtil.js
|
|
142460
142587
|
var makeIssue = (params) => {
|
|
142461
|
-
const { data, path:
|
|
142462
|
-
const fullPath = [...
|
|
142588
|
+
const { data, path: path70, errorMaps, issueData } = params;
|
|
142589
|
+
const fullPath = [...path70, ...issueData.path || []];
|
|
142463
142590
|
const fullIssue = {
|
|
142464
142591
|
...issueData,
|
|
142465
142592
|
path: fullPath
|
|
@@ -142574,11 +142701,11 @@ var errorUtil;
|
|
|
142574
142701
|
|
|
142575
142702
|
// node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/types.js
|
|
142576
142703
|
var ParseInputLazyPath = class {
|
|
142577
|
-
constructor(parent, value2,
|
|
142704
|
+
constructor(parent, value2, path70, key) {
|
|
142578
142705
|
this._cachedPath = [];
|
|
142579
142706
|
this.parent = parent;
|
|
142580
142707
|
this.data = value2;
|
|
142581
|
-
this._path =
|
|
142708
|
+
this._path = path70;
|
|
142582
142709
|
this._key = key;
|
|
142583
142710
|
}
|
|
142584
142711
|
get path() {
|
|
@@ -146141,11 +146268,11 @@ function normalizeObjectSchema(schema) {
|
|
|
146141
146268
|
}
|
|
146142
146269
|
return void 0;
|
|
146143
146270
|
}
|
|
146144
|
-
function getDotPath(
|
|
146145
|
-
if (
|
|
146271
|
+
function getDotPath(path70) {
|
|
146272
|
+
if (path70.length === 0) {
|
|
146146
146273
|
return "object root";
|
|
146147
146274
|
}
|
|
146148
|
-
return
|
|
146275
|
+
return path70.reduce((acc, seg, index) => {
|
|
146149
146276
|
if (index === 0) {
|
|
146150
146277
|
return String(seg);
|
|
146151
146278
|
}
|
|
@@ -150188,7 +150315,7 @@ async function serveMcp(mcp, transport, options = {}) {
|
|
|
150188
150315
|
|
|
150189
150316
|
// src/mcp/permissions.ts
|
|
150190
150317
|
var import_node_fs23 = __toESM(require("node:fs"), 1);
|
|
150191
|
-
var
|
|
150318
|
+
var import_node_path61 = __toESM(require("node:path"), 1);
|
|
150192
150319
|
init_zod();
|
|
150193
150320
|
init_store();
|
|
150194
150321
|
var StoredMcpPermissionsSchema = external_exports.strictObject({
|
|
@@ -150210,10 +150337,10 @@ function effectiveMcpPermissions(flags, stored) {
|
|
|
150210
150337
|
return { writes: flags.writes || stored.writes, remoteControl: flags.remoteControl || stored.remoteControl, history: flags.history || stored.history };
|
|
150211
150338
|
}
|
|
150212
150339
|
function watchMcpPermissions(paths, onChange) {
|
|
150213
|
-
const directory =
|
|
150340
|
+
const directory = import_node_path61.default.dirname(paths.mcpPermissionsFile);
|
|
150214
150341
|
import_node_fs23.default.mkdirSync(directory, { recursive: true });
|
|
150215
150342
|
const watcher = import_node_fs23.default.watch(directory, (_event, filename) => {
|
|
150216
|
-
if (filename === null || filename ===
|
|
150343
|
+
if (filename === null || filename === import_node_path61.default.basename(paths.mcpPermissionsFile)) {
|
|
150217
150344
|
onChange();
|
|
150218
150345
|
}
|
|
150219
150346
|
});
|
|
@@ -150526,16 +150653,16 @@ init_credentialCache();
|
|
|
150526
150653
|
|
|
150527
150654
|
// src/identityToken.ts
|
|
150528
150655
|
var import_node_fs24 = __toESM(require("node:fs"), 1);
|
|
150529
|
-
var
|
|
150656
|
+
var import_node_path62 = __toESM(require("node:path"), 1);
|
|
150530
150657
|
init_cliError();
|
|
150531
150658
|
var TOKEN_FILE_MODE = 384;
|
|
150532
150659
|
var TOKEN_DIR_MODE = 448;
|
|
150533
150660
|
var OAUTH_TOKEN_RE = /^sk-ant-oat\d+-[A-Za-z0-9_-]+$/;
|
|
150534
150661
|
function identityTokenDir(paths) {
|
|
150535
|
-
return
|
|
150662
|
+
return import_node_path62.default.join(paths.root, "credentials");
|
|
150536
150663
|
}
|
|
150537
150664
|
function identityTokenPath(paths, identityName) {
|
|
150538
|
-
return
|
|
150665
|
+
return import_node_path62.default.join(identityTokenDir(paths), `${identityName}.token`);
|
|
150539
150666
|
}
|
|
150540
150667
|
function storeIdentityToken(paths, identityName, raw) {
|
|
150541
150668
|
const token = raw.trim();
|
|
@@ -150546,7 +150673,7 @@ function storeIdentityToken(paths, identityName, raw) {
|
|
|
150546
150673
|
import_node_fs24.default.mkdirSync(dir, { recursive: true, mode: TOKEN_DIR_MODE });
|
|
150547
150674
|
import_node_fs24.default.chmodSync(dir, TOKEN_DIR_MODE);
|
|
150548
150675
|
const target = identityTokenPath(paths, identityName);
|
|
150549
|
-
const temp =
|
|
150676
|
+
const temp = import_node_path62.default.join(dir, `.${identityName}.${String(process.pid)}.tmp`);
|
|
150550
150677
|
import_node_fs24.default.writeFileSync(temp, `${token}
|
|
150551
150678
|
`, { mode: TOKEN_FILE_MODE });
|
|
150552
150679
|
import_node_fs24.default.renameSync(temp, target);
|
|
@@ -150718,7 +150845,7 @@ function registerDoctorCommand(program2, deps) {
|
|
|
150718
150845
|
// src/headroom/commands.ts
|
|
150719
150846
|
var import_node_fs25 = __toESM(require("node:fs"), 1);
|
|
150720
150847
|
var import_node_http5 = __toESM(require("node:http"), 1);
|
|
150721
|
-
var
|
|
150848
|
+
var import_node_path63 = __toESM(require("node:path"), 1);
|
|
150722
150849
|
var import_node_child_process9 = require("node:child_process");
|
|
150723
150850
|
init_commandDeps();
|
|
150724
150851
|
init_configProfilesStore();
|
|
@@ -150909,12 +151036,12 @@ function readInstalledHeadroomCommit() {
|
|
|
150909
151036
|
if (toolDir.status !== 0) {
|
|
150910
151037
|
return void 0;
|
|
150911
151038
|
}
|
|
150912
|
-
const libDir =
|
|
151039
|
+
const libDir = import_node_path63.default.join(toolDir.stdout.trim(), HEADROOM_TOOL_NAME, "lib");
|
|
150913
151040
|
for (const python of realFarmFs.readdir(libDir)) {
|
|
150914
|
-
const sitePackages =
|
|
151041
|
+
const sitePackages = import_node_path63.default.join(libDir, python, "site-packages");
|
|
150915
151042
|
for (const entry of realFarmFs.readdir(sitePackages)) {
|
|
150916
151043
|
if (entry.startsWith("headroom_ai-") && entry.endsWith(".dist-info")) {
|
|
150917
|
-
const directUrl = realFarmFs.readFileUtf8(
|
|
151044
|
+
const directUrl = realFarmFs.readFileUtf8(import_node_path63.default.join(sitePackages, entry, "direct_url.json"));
|
|
150918
151045
|
return directUrl === void 0 ? void 0 : parseInstalledCommit(directUrl);
|
|
150919
151046
|
}
|
|
150920
151047
|
}
|
|
@@ -151170,7 +151297,7 @@ async function refreshCatalogueForReal(paths, name, env) {
|
|
|
151170
151297
|
init_realPorts();
|
|
151171
151298
|
|
|
151172
151299
|
// src/usage/realJobRunner.ts
|
|
151173
|
-
var
|
|
151300
|
+
var import_node_path64 = __toESM(require("node:path"), 1);
|
|
151174
151301
|
init_conditions();
|
|
151175
151302
|
init_identityClaude();
|
|
151176
151303
|
var JOB_LAUNCH_FLAGS = ["--no-headroom", "--no-remote-control", "--track-usage"];
|
|
@@ -151183,7 +151310,7 @@ ${outcome.trimEnd()}
|
|
|
151183
151310
|
}
|
|
151184
151311
|
function createRealJobRunner(params) {
|
|
151185
151312
|
return async (name, identity, job) => {
|
|
151186
|
-
const logFile =
|
|
151313
|
+
const logFile = import_node_path64.default.join(params.paths.jobLogsDir, `${name}.log`);
|
|
151187
151314
|
const append = (outcome) => {
|
|
151188
151315
|
params.fs.mkdirPrivate(params.paths.jobLogsDir);
|
|
151189
151316
|
params.fs.appendFilePrivate(logFile, logEntry(name, identity, params.now(), outcome));
|
|
@@ -151240,7 +151367,7 @@ function registerHeadlessCommands(program2, deps) {
|
|
|
151240
151367
|
}
|
|
151241
151368
|
|
|
151242
151369
|
// src/jobs.ts
|
|
151243
|
-
var
|
|
151370
|
+
var import_node_path65 = __toESM(require("node:path"), 1);
|
|
151244
151371
|
init_commandDeps();
|
|
151245
151372
|
init_cliError();
|
|
151246
151373
|
init_schema();
|
|
@@ -151265,7 +151392,7 @@ function jobOf(options) {
|
|
|
151265
151392
|
target: options.identity === void 0 ? { pool: options.pool ?? "" } : { identity: options.identity },
|
|
151266
151393
|
trigger: options.at === void 0 ? { beforeReset: options.beforeReset ?? "fiveHour", lead: options.lead ?? "" } : { at: options.at },
|
|
151267
151394
|
prompt: options.prompt,
|
|
151268
|
-
cwd:
|
|
151395
|
+
cwd: import_node_path65.default.resolve(options.cwd ?? process.cwd()),
|
|
151269
151396
|
timeout: options.timeout,
|
|
151270
151397
|
...options.model === void 0 ? {} : { model: options.model },
|
|
151271
151398
|
...options.allowedTool === void 0 ? {} : { allowedTools: options.allowedTool }
|
|
@@ -151338,7 +151465,7 @@ function registerJobCommand(program2, deps) {
|
|
|
151338
151465
|
console.log(`Allowed tools: ${entry.allowedTools.join(", ")}`);
|
|
151339
151466
|
}
|
|
151340
151467
|
console.log(`Prompt: ${entry.prompt}`);
|
|
151341
|
-
console.log(`Results: ${
|
|
151468
|
+
console.log(`Results: ${import_node_path65.default.join(paths.jobLogsDir, `${name}.log`)}`);
|
|
151342
151469
|
}),
|
|
151343
151470
|
["agent-shim job show digest"]
|
|
151344
151471
|
);
|
|
@@ -151361,7 +151488,7 @@ function registerJobCommand(program2, deps) {
|
|
|
151361
151488
|
throw new UsageError(`No member of the job's pool can be picked right now.`);
|
|
151362
151489
|
}
|
|
151363
151490
|
await createRealJobRunner({ paths, spawnDaemon: spawnDetachedSupervisor, fs: realFarmFs, now: () => /* @__PURE__ */ new Date() })(name, identity, entry);
|
|
151364
|
-
console.log(`Ran job "${name}" as ${identity}; the result is in ${
|
|
151491
|
+
console.log(`Ran job "${name}" as ${identity}; the result is in ${import_node_path65.default.join(paths.jobLogsDir, `${name}.log`)}.`);
|
|
151365
151492
|
}),
|
|
151366
151493
|
["agent-shim job run digest"]
|
|
151367
151494
|
);
|
|
@@ -151525,7 +151652,7 @@ init_providerAliases();
|
|
|
151525
151652
|
|
|
151526
151653
|
// src/providerRename.ts
|
|
151527
151654
|
var import_node_fs26 = __toESM(require("node:fs"), 1);
|
|
151528
|
-
var
|
|
151655
|
+
var import_node_path66 = __toESM(require("node:path"), 1);
|
|
151529
151656
|
init_schema();
|
|
151530
151657
|
init_store();
|
|
151531
151658
|
init_load();
|
|
@@ -151535,6 +151662,7 @@ init_credentialCache();
|
|
|
151535
151662
|
init_providerCatalogue();
|
|
151536
151663
|
init_schema2();
|
|
151537
151664
|
init_read();
|
|
151665
|
+
init_names();
|
|
151538
151666
|
init_providerAliases();
|
|
151539
151667
|
init_providersStore();
|
|
151540
151668
|
function renameRef(ref, from, to2) {
|
|
@@ -151580,7 +151708,7 @@ function renameProvider(paths, from, to2, ports) {
|
|
|
151580
151708
|
if (from === to2) {
|
|
151581
151709
|
throw new UsageError(`"${from}" is already the provider's name.`);
|
|
151582
151710
|
}
|
|
151583
|
-
|
|
151711
|
+
requireNewProviderName(to2);
|
|
151584
151712
|
if (!providerExists(paths, from)) {
|
|
151585
151713
|
throw new ProviderNotFoundError(from);
|
|
151586
151714
|
}
|
|
@@ -151642,7 +151770,7 @@ function rewriteReferences(paths, from, to2) {
|
|
|
151642
151770
|
const launch = renamedLaunch(profile.launch, from, to2);
|
|
151643
151771
|
const models = profile.models === void 0 ? void 0 : renamedModels(profile.models, from, to2);
|
|
151644
151772
|
if (launch !== void 0 || models !== void 0) {
|
|
151645
|
-
applyPatch(
|
|
151773
|
+
applyPatch(import_node_path66.default.join(paths.configProfilesDir, `${name}.json`), ConfigProfileSchema, { ...launch === void 0 ? {} : { launch }, ...models === void 0 ? {} : { models } });
|
|
151646
151774
|
rewritten.push(`profile ${name}`);
|
|
151647
151775
|
}
|
|
151648
151776
|
}
|
|
@@ -152469,7 +152597,7 @@ function registerSessionCommands(program2, deps) {
|
|
|
152469
152597
|
}
|
|
152470
152598
|
|
|
152471
152599
|
// src/usage/commands.ts
|
|
152472
|
-
var
|
|
152600
|
+
var import_node_path67 = __toESM(require("node:path"), 1);
|
|
152473
152601
|
init_commandDeps();
|
|
152474
152602
|
init_realPorts();
|
|
152475
152603
|
init_account();
|
|
@@ -152608,7 +152736,7 @@ function collectAccounts(fs30, paths, identity, probe) {
|
|
|
152608
152736
|
return names.map((name) => ({
|
|
152609
152737
|
identity: name,
|
|
152610
152738
|
account: readAccountMetadata(fs30, paths.identitiesDir, name),
|
|
152611
|
-
signIn: identitySignIn(fs30, probe, { farmRoot:
|
|
152739
|
+
signIn: identitySignIn(fs30, probe, { farmRoot: import_node_path67.default.join(paths.identitiesDir, name), hasCredentialBlock: readIdentity(paths, name)?.credential !== void 0 }),
|
|
152612
152740
|
usage: readUsageSnapshot(fs30, paths.usageSnapshotsDir, name)
|
|
152613
152741
|
}));
|
|
152614
152742
|
}
|
|
@@ -153015,7 +153143,7 @@ function quotaHitOf(fs30, paths, identity, sessionId, sinceMs, nowMs) {
|
|
|
153015
153143
|
}
|
|
153016
153144
|
|
|
153017
153145
|
// src/supervise/move.ts
|
|
153018
|
-
var
|
|
153146
|
+
var import_node_path68 = __toESM(require("node:path"), 1);
|
|
153019
153147
|
init_lock();
|
|
153020
153148
|
init_poolPick();
|
|
153021
153149
|
init_read();
|
|
@@ -153061,7 +153189,7 @@ function createMover(deps) {
|
|
|
153061
153189
|
if (resolution.identity === request7.from) {
|
|
153062
153190
|
return { kind: "stay", reason: `no other member of pool "${pool}" can take it` };
|
|
153063
153191
|
}
|
|
153064
|
-
const transcript =
|
|
153192
|
+
const transcript = import_node_path68.default.join(paths.identitiesDir, resolution.identity, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
|
|
153065
153193
|
if (farmFs.lstat(transcript)?.kind !== "file") {
|
|
153066
153194
|
return { kind: "stay", reason: `${resolution.identity} does not share this conversation's history, so it could not resume it` };
|
|
153067
153195
|
}
|
|
@@ -153095,13 +153223,13 @@ function createIdentityMover(deps) {
|
|
|
153095
153223
|
throw error63;
|
|
153096
153224
|
}
|
|
153097
153225
|
try {
|
|
153098
|
-
if (farmFs.readFileUtf8(
|
|
153226
|
+
if (farmFs.readFileUtf8(import_node_path68.default.join(paths.identitiesDir, request7.to, "identity.json")) === void 0) {
|
|
153099
153227
|
return { kind: "stay", reason: `no identity "${request7.to}"` };
|
|
153100
153228
|
}
|
|
153101
153229
|
if (request7.to === request7.from) {
|
|
153102
153230
|
return { kind: "stay", reason: `the model already runs under this session's identity` };
|
|
153103
153231
|
}
|
|
153104
|
-
const transcript =
|
|
153232
|
+
const transcript = import_node_path68.default.join(paths.identitiesDir, request7.to, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
|
|
153105
153233
|
if (farmFs.lstat(transcript)?.kind !== "file") {
|
|
153106
153234
|
return { kind: "stay", reason: `${request7.to} does not share this conversation's history, so it could not resume it` };
|
|
153107
153235
|
}
|
|
@@ -153680,7 +153808,7 @@ async function runClaude(argvOverride) {
|
|
|
153680
153808
|
// src/cli.ts
|
|
153681
153809
|
async function main() {
|
|
153682
153810
|
aliasLegacyEnv(process.env);
|
|
153683
|
-
const invokedName =
|
|
153811
|
+
const invokedName = import_node_path69.default.basename(process.argv[1] ?? "agent-shim");
|
|
153684
153812
|
if (isInvokedAsClaude(invokedName)) {
|
|
153685
153813
|
await runClaude();
|
|
153686
153814
|
return;
|