claude-use 11.60.1 → 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 +794 -683
- package/dist/index.cjs +1589 -1485
- package/dist/index.mjs +1551 -1447
- 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
|
|
|
@@ -69140,7 +69223,7 @@ function realPrepareLaunchParams(paths, options) {
|
|
|
69140
69223
|
frontdoor: realFrontDoorPort(paths, options.spawnDaemon),
|
|
69141
69224
|
credentials: { ...realCredentialPort, cache: realCredentialCacheEnv(paths) },
|
|
69142
69225
|
hold: realHoldPort,
|
|
69143
|
-
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",
|
|
69144
69227
|
...farm.directoryIdentity === void 0 ? {} : { directoryPinnedIdentity: farm.directoryIdentity },
|
|
69145
69228
|
...farm.directoryConfigProfile === void 0 ? {} : { directoryRuleConfigProfile: farm.directoryConfigProfile },
|
|
69146
69229
|
...farm.globalDefaultConfigProfile === void 0 ? {} : { globalDefaultConfigProfile: farm.globalDefaultConfigProfile },
|
|
@@ -69181,12 +69264,12 @@ function resolveClaudeLaunch(options, run = realRunPort) {
|
|
|
69181
69264
|
async function resolveClaudeLaunchAsync(options, runAsync2 = realRunAsync) {
|
|
69182
69265
|
return await resolveWithAsyncRuns((run) => resolveClaudeLaunch(options, run), runAsync2);
|
|
69183
69266
|
}
|
|
69184
|
-
var import_node_os9,
|
|
69267
|
+
var import_node_os9, import_node_path44, import_node_crypto21, LaunchRefusedError;
|
|
69185
69268
|
var init_launchWiring = __esm({
|
|
69186
69269
|
"src/launchWiring.ts"() {
|
|
69187
69270
|
"use strict";
|
|
69188
69271
|
import_node_os9 = __toESM(require("node:os"), 1);
|
|
69189
|
-
|
|
69272
|
+
import_node_path44 = __toESM(require("node:path"), 1);
|
|
69190
69273
|
import_node_crypto21 = require("node:crypto");
|
|
69191
69274
|
init_cliError();
|
|
69192
69275
|
init_claudeShim();
|
|
@@ -83845,7 +83928,7 @@ async function jGe(e14, t10, n10, r10) {
|
|
|
83845
83928
|
if (d.length === 0) return [];
|
|
83846
83929
|
return iv(Buffer.from(gZ(d)), { limit: r10.limit, offset: r10.offset }, l, c10);
|
|
83847
83930
|
}
|
|
83848
|
-
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;
|
|
83849
83932
|
var init_sdk = __esm({
|
|
83850
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"() {
|
|
83851
83934
|
import_node_module = require("node:module");
|
|
@@ -83876,7 +83959,7 @@ var init_sdk = __esm({
|
|
|
83876
83959
|
import_path6 = require("path");
|
|
83877
83960
|
import_promises6 = require("fs/promises");
|
|
83878
83961
|
import_os4 = require("os");
|
|
83879
|
-
|
|
83962
|
+
import_node_path45 = __toESM(require("node:path"), 1);
|
|
83880
83963
|
import_node_os10 = __toESM(require("node:os"), 1);
|
|
83881
83964
|
import_node_process5 = __toESM(require("node:process"), 1);
|
|
83882
83965
|
import_path7 = require("path");
|
|
@@ -92327,16 +92410,16 @@ var init_sdk = __esm({
|
|
|
92327
92410
|
wS = import_node_os10.default.tmpdir();
|
|
92328
92411
|
({ env: Fa } = import_node_process5.default);
|
|
92329
92412
|
K7 = (e14) => {
|
|
92330
|
-
let t10 =
|
|
92331
|
-
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) };
|
|
92332
92415
|
};
|
|
92333
92416
|
G7 = (e14) => {
|
|
92334
|
-
let t10 = Fa.APPDATA ||
|
|
92335
|
-
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) };
|
|
92336
92419
|
};
|
|
92337
92420
|
W7 = (e14) => {
|
|
92338
|
-
let t10 =
|
|
92339
|
-
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) };
|
|
92340
92423
|
};
|
|
92341
92424
|
i5e = OS("claude-cli");
|
|
92342
92425
|
X7 = 100;
|
|
@@ -106389,8 +106472,8 @@ var require_utils3 = __commonJS({
|
|
|
106389
106472
|
}
|
|
106390
106473
|
return ind;
|
|
106391
106474
|
}
|
|
106392
|
-
function removeDotSegments(
|
|
106393
|
-
let input2 =
|
|
106475
|
+
function removeDotSegments(path70) {
|
|
106476
|
+
let input2 = path70;
|
|
106394
106477
|
const output2 = [];
|
|
106395
106478
|
let nextSlash = -1;
|
|
106396
106479
|
let len = 0;
|
|
@@ -106799,8 +106882,8 @@ var require_schemes = __commonJS({
|
|
|
106799
106882
|
}
|
|
106800
106883
|
if (wsComponent.resourceName) {
|
|
106801
106884
|
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
106802
|
-
const
|
|
106803
|
-
wsComponent.path =
|
|
106885
|
+
const path70 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
106886
|
+
wsComponent.path = path70 && path70 !== "/" ? path70 : void 0;
|
|
106804
106887
|
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
106805
106888
|
wsComponent.resourceName = void 0;
|
|
106806
106889
|
}
|
|
@@ -110327,7 +110410,7 @@ var require_dist2 = __commonJS({
|
|
|
110327
110410
|
});
|
|
110328
110411
|
|
|
110329
110412
|
// src/cli.ts
|
|
110330
|
-
var
|
|
110413
|
+
var import_node_path69 = __toESM(require("node:path"), 1);
|
|
110331
110414
|
|
|
110332
110415
|
// node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
|
|
110333
110416
|
var CommanderError = class extends Error {
|
|
@@ -113440,9 +113523,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
113440
113523
|
* @param {string} [path]
|
|
113441
113524
|
* @return {(string|null|Command)}
|
|
113442
113525
|
*/
|
|
113443
|
-
executableDir(
|
|
113444
|
-
if (
|
|
113445
|
-
this._executableDir =
|
|
113526
|
+
executableDir(path70) {
|
|
113527
|
+
if (path70 === void 0) return this._executableDir;
|
|
113528
|
+
this._executableDir = path70;
|
|
113446
113529
|
return this;
|
|
113447
113530
|
}
|
|
113448
113531
|
/**
|
|
@@ -114918,19 +115001,19 @@ function writePools(paths, pools) {
|
|
|
114918
115001
|
applyPatch(paths.globalConfigFile, GlobalConfigSchema, { pools }, { defaults: {} });
|
|
114919
115002
|
}
|
|
114920
115003
|
function poolCycleOf(pools, name) {
|
|
114921
|
-
const walk3 = (current,
|
|
115004
|
+
const walk3 = (current, path70) => {
|
|
114922
115005
|
for (const entry of pools[current]?.identities ?? []) {
|
|
114923
115006
|
const nested = poolNameOf(poolMemberIdentity(entry));
|
|
114924
115007
|
if (nested === void 0) {
|
|
114925
115008
|
continue;
|
|
114926
115009
|
}
|
|
114927
115010
|
if (nested === name) {
|
|
114928
|
-
return [...
|
|
115011
|
+
return [...path70, nested];
|
|
114929
115012
|
}
|
|
114930
|
-
if (
|
|
115013
|
+
if (path70.includes(nested)) {
|
|
114931
115014
|
continue;
|
|
114932
115015
|
}
|
|
114933
|
-
const found = walk3(nested, [...
|
|
115016
|
+
const found = walk3(nested, [...path70, nested]);
|
|
114934
115017
|
if (found !== void 0) {
|
|
114935
115018
|
return found;
|
|
114936
115019
|
}
|
|
@@ -115286,6 +115369,7 @@ init_realPorts();
|
|
|
115286
115369
|
init_pipeline();
|
|
115287
115370
|
init_walkPolicy();
|
|
115288
115371
|
init_walk();
|
|
115372
|
+
init_names();
|
|
115289
115373
|
var NoConfigProfileResolvedError = class extends CliError {
|
|
115290
115374
|
constructor(identityName, cwd) {
|
|
115291
115375
|
super(
|
|
@@ -115558,13 +115642,12 @@ var CATEGORY_LABELS = {
|
|
|
115558
115642
|
knowledge: "knowledge",
|
|
115559
115643
|
settings: "settings"
|
|
115560
115644
|
};
|
|
115561
|
-
var PROFILE_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._@-]*$/;
|
|
115562
115645
|
function validateProfileName(value2, existingNames) {
|
|
115563
115646
|
if (value2.length === 0) {
|
|
115564
115647
|
return "A name is required.";
|
|
115565
115648
|
}
|
|
115566
|
-
if (!
|
|
115567
|
-
return
|
|
115649
|
+
if (!isFileName(value2)) {
|
|
115650
|
+
return `Names ${FILE_NAME_RULE}.`;
|
|
115568
115651
|
}
|
|
115569
115652
|
if (existingNames?.includes(value2) ?? false) {
|
|
115570
115653
|
return `A configuration profile named "${value2}" already exists.`;
|
|
@@ -116131,7 +116214,7 @@ function statuslineChangeOf(options) {
|
|
|
116131
116214
|
return void 0;
|
|
116132
116215
|
}
|
|
116133
116216
|
const assignments = (options.statusline ?? []).map(parseStatuslineAssignment);
|
|
116134
|
-
return { set: Object.fromEntries(assignments.map(({ path:
|
|
116217
|
+
return { set: Object.fromEntries(assignments.map(({ path: path70, value: value2 }) => [path70, value2])), unset: options.unsetStatusline ?? [] };
|
|
116135
116218
|
}
|
|
116136
116219
|
function registerProfileCommand(program2, deps) {
|
|
116137
116220
|
const { paths } = deps;
|
|
@@ -116559,7 +116642,7 @@ init_paths();
|
|
|
116559
116642
|
init_package();
|
|
116560
116643
|
|
|
116561
116644
|
// src/check.ts
|
|
116562
|
-
var
|
|
116645
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
116563
116646
|
init_commandDeps();
|
|
116564
116647
|
|
|
116565
116648
|
// src/checkReport.ts
|
|
@@ -116659,7 +116742,7 @@ init_realCredentialCache();
|
|
|
116659
116742
|
init_providersStore();
|
|
116660
116743
|
init_signIn();
|
|
116661
116744
|
init_realPorts();
|
|
116662
|
-
var
|
|
116745
|
+
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
116663
116746
|
init_zod();
|
|
116664
116747
|
init_envBool();
|
|
116665
116748
|
init_load();
|
|
@@ -117001,10 +117084,10 @@ function collectCheckReport(params) {
|
|
|
117001
117084
|
}).input;
|
|
117002
117085
|
const providerName = cascadeProviderName(cascade);
|
|
117003
117086
|
const provider = providerName === void 0 ? void 0 : loadCheckProvider(paths, providerName);
|
|
117004
|
-
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);
|
|
117005
117088
|
const settingsFiles = {
|
|
117006
|
-
"settings.json": realFsPort.readFileUtf8(
|
|
117007
|
-
"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"))
|
|
117008
117091
|
};
|
|
117009
117092
|
const report = runCheck({
|
|
117010
117093
|
cwd,
|
|
@@ -117040,7 +117123,7 @@ function registerCheckCommand(program2, deps) {
|
|
|
117040
117123
|
const command = program2.command("check [path]").description(
|
|
117041
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."
|
|
117042
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) => {
|
|
117043
|
-
const cwd = pathArg === void 0 ? process.cwd() :
|
|
117126
|
+
const cwd = pathArg === void 0 ? process.cwd() : import_node_path32.default.resolve(pathArg);
|
|
117044
117127
|
const report = collectCheckReport({ paths, cwd, ...options.identity === void 0 ? {} : { identity: options.identity }, env: process.env });
|
|
117045
117128
|
if (options.json === true) {
|
|
117046
117129
|
printJson(checkReportToJson(report));
|
|
@@ -117060,7 +117143,7 @@ function registerCheckCommand(program2, deps) {
|
|
|
117060
117143
|
var import_node_crypto13 = require("node:crypto");
|
|
117061
117144
|
var import_node_fs12 = __toESM(require("node:fs"), 1);
|
|
117062
117145
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
117063
|
-
var
|
|
117146
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
117064
117147
|
init_commandDeps();
|
|
117065
117148
|
init_state();
|
|
117066
117149
|
init_schema();
|
|
@@ -117729,10 +117812,10 @@ async function callCodex(ports, request7, sessionId, signal) {
|
|
|
117729
117812
|
// src/codex/commands.ts
|
|
117730
117813
|
function codexHome(env, home) {
|
|
117731
117814
|
const fromEnv = env.CODEX_HOME;
|
|
117732
|
-
return fromEnv !== void 0 && fromEnv !== "" ? fromEnv :
|
|
117815
|
+
return fromEnv !== void 0 && fromEnv !== "" ? fromEnv : import_node_path33.default.join(home, ".codex");
|
|
117733
117816
|
}
|
|
117734
117817
|
function codexUsageSnapshotPath() {
|
|
117735
|
-
return
|
|
117818
|
+
return import_node_path33.default.join(resolveClaudeHome(), "codex-quota.json");
|
|
117736
117819
|
}
|
|
117737
117820
|
function isEnoent5(error63) {
|
|
117738
117821
|
return typeof error63 === "object" && error63 !== null && "code" in error63 && error63.code === "ENOENT";
|
|
@@ -117750,7 +117833,7 @@ var realCodexAuthFs = {
|
|
|
117750
117833
|
}
|
|
117751
117834
|
},
|
|
117752
117835
|
writePrivate: (filePath, contents) => {
|
|
117753
|
-
import_node_fs12.default.mkdirSync(
|
|
117836
|
+
import_node_fs12.default.mkdirSync(import_node_path33.default.dirname(filePath), { recursive: true });
|
|
117754
117837
|
import_node_fs12.default.writeFileSync(filePath, contents, { encoding: "utf8", mode: PRIVATE_FILE_MODE });
|
|
117755
117838
|
import_node_fs12.default.chmodSync(filePath, PRIVATE_FILE_MODE);
|
|
117756
117839
|
},
|
|
@@ -117762,7 +117845,7 @@ function writeUsageSnapshot(log, snapshot) {
|
|
|
117762
117845
|
const target = codexUsageSnapshotPath();
|
|
117763
117846
|
const temp = `${target}.${String(process.pid)}.tmp`;
|
|
117764
117847
|
try {
|
|
117765
|
-
import_node_fs12.default.mkdirSync(
|
|
117848
|
+
import_node_fs12.default.mkdirSync(import_node_path33.default.dirname(target), { recursive: true });
|
|
117766
117849
|
import_node_fs12.default.writeFileSync(temp, `${JSON.stringify(snapshot, null, 2)}
|
|
117767
117850
|
`);
|
|
117768
117851
|
import_node_fs12.default.renameSync(temp, target);
|
|
@@ -117774,7 +117857,7 @@ function createCodexRoutePorts(log, signInFile, options) {
|
|
|
117774
117857
|
const agent = createUpstreamAgent();
|
|
117775
117858
|
const upstreamFetch = createUpstreamFetch(agent);
|
|
117776
117859
|
const tempSuffix = `${String(process.pid)}.${(0, import_node_crypto13.randomUUID)()}`;
|
|
117777
|
-
const auth = createCodexAuthStore(
|
|
117860
|
+
const auth = createCodexAuthStore(import_node_path33.default.join(codexHome(process.env, import_node_os6.default.homedir()), "auth.json"), {
|
|
117778
117861
|
fs: realCodexAuthFs,
|
|
117779
117862
|
fetch: upstreamFetch,
|
|
117780
117863
|
now: () => /* @__PURE__ */ new Date(),
|
|
@@ -117922,7 +118005,7 @@ function registerCodexCommand(program2, deps) {
|
|
|
117922
118005
|
|
|
117923
118006
|
// src/frontdoor/commands.ts
|
|
117924
118007
|
var import_node_crypto25 = require("node:crypto");
|
|
117925
|
-
var
|
|
118008
|
+
var import_node_path52 = __toESM(require("node:path"), 1);
|
|
117926
118009
|
var import_node_fs21 = __toESM(require("node:fs"), 1);
|
|
117927
118010
|
init_commandDeps();
|
|
117928
118011
|
init_configProfilesStore();
|
|
@@ -117944,11 +118027,11 @@ var realSessionFs = {
|
|
|
117944
118027
|
};
|
|
117945
118028
|
|
|
117946
118029
|
// src/agents/sessions.ts
|
|
117947
|
-
var
|
|
118030
|
+
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
117948
118031
|
init_cliError();
|
|
117949
118032
|
|
|
117950
118033
|
// src/agents/read.ts
|
|
117951
|
-
var
|
|
118034
|
+
var import_node_path34 = __toESM(require("node:path"), 1);
|
|
117952
118035
|
init_zod();
|
|
117953
118036
|
|
|
117954
118037
|
// src/agents/schema.ts
|
|
@@ -118067,15 +118150,15 @@ function parseEntry2(project, entry) {
|
|
|
118067
118150
|
}
|
|
118068
118151
|
function listSessions2(fs30, configDir) {
|
|
118069
118152
|
const found = [];
|
|
118070
|
-
for (const project of fs30.readdir(
|
|
118071
|
-
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);
|
|
118072
118155
|
const entries = /* @__PURE__ */ new Set();
|
|
118073
118156
|
for (const name of fs30.readdir(projectDir)) {
|
|
118074
118157
|
if (name.endsWith(TRANSCRIPT_SUFFIX)) {
|
|
118075
118158
|
entries.add(name.slice(0, -TRANSCRIPT_SUFFIX.length));
|
|
118076
118159
|
continue;
|
|
118077
118160
|
}
|
|
118078
|
-
const children = fs30.readdir(
|
|
118161
|
+
const children = fs30.readdir(import_node_path34.default.join(projectDir, name));
|
|
118079
118162
|
if (children.includes(SUBAGENTS_DIR) || children.includes(WORKFLOWS_DIR)) {
|
|
118080
118163
|
entries.add(name);
|
|
118081
118164
|
}
|
|
@@ -118095,8 +118178,8 @@ function locateAgents(fs30, configDir, relativeDir, workflowRunId, report) {
|
|
|
118095
118178
|
const id2 = name.slice(AGENT_FILE_PREFIX.length, -META_SUFFIX.length);
|
|
118096
118179
|
located.push({
|
|
118097
118180
|
id: id2,
|
|
118098
|
-
metaPath:
|
|
118099
|
-
transcriptPath:
|
|
118181
|
+
metaPath: import_node_path34.default.join(relativeDir, name),
|
|
118182
|
+
transcriptPath: import_node_path34.default.join(relativeDir, `${AGENT_FILE_PREFIX}${id2}${TRANSCRIPT_SUFFIX}`),
|
|
118100
118183
|
workflowRunId
|
|
118101
118184
|
});
|
|
118102
118185
|
}
|
|
@@ -118139,7 +118222,7 @@ function describeFailure(error63) {
|
|
|
118139
118222
|
}
|
|
118140
118223
|
function readFileOrReport(fs30, configDir, relative, report) {
|
|
118141
118224
|
try {
|
|
118142
|
-
return fs30.readFileUtf8(
|
|
118225
|
+
return fs30.readFileUtf8(import_node_path34.default.join(configDir, relative));
|
|
118143
118226
|
} catch (error63) {
|
|
118144
118227
|
report({ path: relative, reason: `could not be read: ${describeFailure(error63)}` });
|
|
118145
118228
|
return void 0;
|
|
@@ -118147,7 +118230,7 @@ function readFileOrReport(fs30, configDir, relative, report) {
|
|
|
118147
118230
|
}
|
|
118148
118231
|
function listDirOrReport(fs30, configDir, relative, report) {
|
|
118149
118232
|
try {
|
|
118150
|
-
return fs30.readdir(
|
|
118233
|
+
return fs30.readdir(import_node_path34.default.join(configDir, relative));
|
|
118151
118234
|
} catch (error63) {
|
|
118152
118235
|
report({ path: relative, reason: `could not be listed: ${describeFailure(error63)}` });
|
|
118153
118236
|
return [];
|
|
@@ -118171,18 +118254,18 @@ var WorkflowRunFileSchema = external_exports.object({
|
|
|
118171
118254
|
summary: external_exports.string().optional()
|
|
118172
118255
|
});
|
|
118173
118256
|
function summariseSession(fs30, configDir, ref) {
|
|
118174
|
-
const sessionRelative =
|
|
118175
|
-
const subagentsRelative =
|
|
118176
|
-
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);
|
|
118177
118260
|
const isMeta = (name) => name.startsWith(AGENT_FILE_PREFIX) && name.endsWith(META_SUFFIX);
|
|
118178
|
-
let agentCount = fs30.readdir(
|
|
118179
|
-
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))) {
|
|
118180
118263
|
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
118181
|
-
agentCount += fs30.readdir(
|
|
118264
|
+
agentCount += fs30.readdir(import_node_path34.default.join(configDir, workflowsUnderSubagents, runDir)).filter(isMeta).length;
|
|
118182
118265
|
}
|
|
118183
118266
|
}
|
|
118184
|
-
const workflowRunCount = fs30.readdir(
|
|
118185
|
-
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}`));
|
|
118186
118269
|
return { ...ref, agentCount, workflowRunCount, ...transcript === void 0 ? {} : { updatedAt: new Date(transcript.mtimeMs).toISOString() } };
|
|
118187
118270
|
}
|
|
118188
118271
|
function readSessionAgentTree(fs30, configDir, ref, options = {}) {
|
|
@@ -118190,13 +118273,13 @@ function readSessionAgentTree(fs30, configDir, ref, options = {}) {
|
|
|
118190
118273
|
const report = (problem) => {
|
|
118191
118274
|
problems.push(problem);
|
|
118192
118275
|
};
|
|
118193
|
-
const sessionRelative =
|
|
118194
|
-
const subagentsRelative =
|
|
118195
|
-
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);
|
|
118196
118279
|
const located = locateAgents(fs30, configDir, subagentsRelative, void 0, report);
|
|
118197
118280
|
for (const runDir of listDirOrReport(fs30, configDir, workflowsUnderSubagents, report)) {
|
|
118198
118281
|
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
118199
|
-
located.push(...locateAgents(fs30, configDir,
|
|
118282
|
+
located.push(...locateAgents(fs30, configDir, import_node_path34.default.join(workflowsUnderSubagents, runDir), runDir, report));
|
|
118200
118283
|
}
|
|
118201
118284
|
}
|
|
118202
118285
|
const agents = /* @__PURE__ */ new Map();
|
|
@@ -118237,7 +118320,7 @@ function readSessionAgentTree(fs30, configDir, ref, options = {}) {
|
|
|
118237
118320
|
superseded: ref.superseded,
|
|
118238
118321
|
agents: roots.sort().map(build),
|
|
118239
118322
|
tasks: readTasks(fs30, configDir, ownTaskLists(ref.sessionId), [.../* @__PURE__ */ new Set([...teamNames, ...options.taskListIds ?? []])].filter((id2) => !ownTaskLists(ref.sessionId).includes(id2)), report),
|
|
118240
|
-
workflowRuns: readWorkflowRuns(fs30, configDir,
|
|
118323
|
+
workflowRuns: readWorkflowRuns(fs30, configDir, import_node_path34.default.join(sessionRelative, WORKFLOWS_DIR), report),
|
|
118241
118324
|
problems
|
|
118242
118325
|
};
|
|
118243
118326
|
}
|
|
@@ -118302,12 +118385,12 @@ function ownTaskLists(sessionId) {
|
|
|
118302
118385
|
function readTasks(fs30, configDir, ownLists, sharedLists, report) {
|
|
118303
118386
|
const tasks = [];
|
|
118304
118387
|
[...ownLists, ...sharedLists].forEach((scope, index) => {
|
|
118305
|
-
const relativeDir =
|
|
118388
|
+
const relativeDir = import_node_path34.default.join(TASKS_DIR, scope);
|
|
118306
118389
|
for (const name of [...listDirOrReport(fs30, configDir, relativeDir, report)].sort()) {
|
|
118307
118390
|
if (name.startsWith(".") || !name.endsWith(JSON_SUFFIX)) {
|
|
118308
118391
|
continue;
|
|
118309
118392
|
}
|
|
118310
|
-
const relative =
|
|
118393
|
+
const relative = import_node_path34.default.join(relativeDir, name);
|
|
118311
118394
|
const text5 = readFileOrReport(fs30, configDir, relative, report);
|
|
118312
118395
|
const parsed = TaskFileSchema.safeParse(text5 === void 0 ? void 0 : parseJson3(text5));
|
|
118313
118396
|
if (parsed.success) {
|
|
@@ -118325,7 +118408,7 @@ function readWorkflowRuns(fs30, configDir, relativeDir, report) {
|
|
|
118325
118408
|
if (!name.startsWith(WORKFLOW_RUN_PREFIX) || !name.endsWith(JSON_SUFFIX)) {
|
|
118326
118409
|
continue;
|
|
118327
118410
|
}
|
|
118328
|
-
const relative =
|
|
118411
|
+
const relative = import_node_path34.default.join(relativeDir, name);
|
|
118329
118412
|
const text5 = readFileOrReport(fs30, configDir, relative, report);
|
|
118330
118413
|
const parsed = WorkflowRunFileSchema.safeParse(text5 === void 0 ? void 0 : parseJson3(text5));
|
|
118331
118414
|
if (!parsed.success) {
|
|
@@ -118348,13 +118431,13 @@ var SessionLookupError = class extends CliError {
|
|
|
118348
118431
|
}
|
|
118349
118432
|
};
|
|
118350
118433
|
function identityConfigDir(identitiesDir, identity) {
|
|
118351
|
-
return
|
|
118434
|
+
return import_node_path35.default.join(identitiesDir, identity);
|
|
118352
118435
|
}
|
|
118353
118436
|
function historyStores(fs30, identitiesDir, identities) {
|
|
118354
118437
|
const byRealPath = /* @__PURE__ */ new Map();
|
|
118355
118438
|
for (const identity of identities) {
|
|
118356
118439
|
const configDir = identityConfigDir(identitiesDir, identity);
|
|
118357
|
-
const real = fs30.realpath(
|
|
118440
|
+
const real = fs30.realpath(import_node_path35.default.join(configDir, "projects"));
|
|
118358
118441
|
if (real === void 0) {
|
|
118359
118442
|
continue;
|
|
118360
118443
|
}
|
|
@@ -118416,7 +118499,7 @@ function showSession(fs30, identitiesDir, identities, query, onlyIdentity) {
|
|
|
118416
118499
|
init_realPorts();
|
|
118417
118500
|
|
|
118418
118501
|
// src/supervise/registry.ts
|
|
118419
|
-
var
|
|
118502
|
+
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
118420
118503
|
init_zod();
|
|
118421
118504
|
var SupervisedSessionSchema = external_exports.strictObject({
|
|
118422
118505
|
/** The launcher's process id, which is what tells a live entry from one a crashed launcher left behind. */
|
|
@@ -118441,19 +118524,19 @@ var SessionStateSchema = external_exports.strictObject({
|
|
|
118441
118524
|
at: external_exports.iso.datetime()
|
|
118442
118525
|
});
|
|
118443
118526
|
function superviseDirOf(paths, pool) {
|
|
118444
|
-
return
|
|
118527
|
+
return import_node_path36.default.join(paths.superviseDir, pool);
|
|
118445
118528
|
}
|
|
118446
118529
|
function sessionsDirOf(paths, pool) {
|
|
118447
|
-
return
|
|
118530
|
+
return import_node_path36.default.join(superviseDirOf(paths, pool), "sessions");
|
|
118448
118531
|
}
|
|
118449
118532
|
function sessionFileOf(paths, pool, sessionId) {
|
|
118450
|
-
return
|
|
118533
|
+
return import_node_path36.default.join(sessionsDirOf(paths, pool), `${sessionId}.json`);
|
|
118451
118534
|
}
|
|
118452
118535
|
function stateDirOf(paths, pool) {
|
|
118453
|
-
return
|
|
118536
|
+
return import_node_path36.default.join(superviseDirOf(paths, pool), "state");
|
|
118454
118537
|
}
|
|
118455
118538
|
function sessionStatePath(paths, pool, sessionId) {
|
|
118456
|
-
return
|
|
118539
|
+
return import_node_path36.default.join(stateDirOf(paths, pool), `${sessionId}.json`);
|
|
118457
118540
|
}
|
|
118458
118541
|
function writeSessionState(fs30, paths, pool, sessionId, state) {
|
|
118459
118542
|
fs30.mkdirPrivate(stateDirOf(paths, pool));
|
|
@@ -118484,7 +118567,7 @@ function unregisterSupervised(fs30, paths, pool, sessionId) {
|
|
|
118484
118567
|
function liveSupervised(fs30, paths, pool, isRunning) {
|
|
118485
118568
|
const live = [];
|
|
118486
118569
|
for (const name of fs30.readdir(sessionsDirOf(paths, pool))) {
|
|
118487
|
-
const file2 =
|
|
118570
|
+
const file2 = import_node_path36.default.join(sessionsDirOf(paths, pool), name);
|
|
118488
118571
|
const raw = fs30.readFileUtf8(file2);
|
|
118489
118572
|
if (raw === void 0) {
|
|
118490
118573
|
continue;
|
|
@@ -118530,11 +118613,11 @@ var ModelMoveRequestSchema = external_exports.strictObject({
|
|
|
118530
118613
|
});
|
|
118531
118614
|
function writeModelMove(fs30, paths, request7) {
|
|
118532
118615
|
fs30.mkdirPrivate(paths.modelMovesDir);
|
|
118533
|
-
fs30.writeFilePrivate(
|
|
118616
|
+
fs30.writeFilePrivate(import_node_path36.default.join(paths.modelMovesDir, `${request7.sessionId}.json`), `${JSON.stringify(ModelMoveRequestSchema.parse(request7))}
|
|
118534
118617
|
`);
|
|
118535
118618
|
}
|
|
118536
118619
|
function readModelMove(fs30, paths, sessionId) {
|
|
118537
|
-
const raw = fs30.readFileUtf8(
|
|
118620
|
+
const raw = fs30.readFileUtf8(import_node_path36.default.join(paths.modelMovesDir, `${sessionId}.json`));
|
|
118538
118621
|
if (raw === void 0) {
|
|
118539
118622
|
return void 0;
|
|
118540
118623
|
}
|
|
@@ -118545,7 +118628,7 @@ function readModelMove(fs30, paths, sessionId) {
|
|
|
118545
118628
|
}
|
|
118546
118629
|
}
|
|
118547
118630
|
function removeModelMove(fs30, paths, sessionId) {
|
|
118548
|
-
fs30.removeRecursive(
|
|
118631
|
+
fs30.removeRecursive(import_node_path36.default.join(paths.modelMovesDir, `${sessionId}.json`));
|
|
118549
118632
|
}
|
|
118550
118633
|
function supervisedSessionOf(fs30, paths, sessionId, isRunning) {
|
|
118551
118634
|
for (const pool of fs30.readdir(paths.superviseDir)) {
|
|
@@ -118627,7 +118710,7 @@ function createTargetObservationStore(fs30, paths) {
|
|
|
118627
118710
|
// src/update/commands.ts
|
|
118628
118711
|
var import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
118629
118712
|
var import_node_os7 = __toESM(require("node:os"), 1);
|
|
118630
|
-
var
|
|
118713
|
+
var import_node_path39 = __toESM(require("node:path"), 1);
|
|
118631
118714
|
init_package();
|
|
118632
118715
|
init_commandDeps();
|
|
118633
118716
|
init_configProfilesStore();
|
|
@@ -118731,7 +118814,7 @@ var realUpdatePorts = {
|
|
|
118731
118814
|
chmod: (filePath, mode) => {
|
|
118732
118815
|
import_node_fs16.default.chmodSync(filePath, mode);
|
|
118733
118816
|
},
|
|
118734
|
-
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-")),
|
|
118735
118818
|
rmRecursive: (targetPath) => {
|
|
118736
118819
|
import_node_fs16.default.rmSync(targetPath, { recursive: true, force: true });
|
|
118737
118820
|
}
|
|
@@ -118752,7 +118835,7 @@ function selfUpdateOptions(paths, checkOnly) {
|
|
|
118752
118835
|
platform: process.platform,
|
|
118753
118836
|
arch: process.arch,
|
|
118754
118837
|
executablePath: realOwnExecutablePath(),
|
|
118755
|
-
lockPath:
|
|
118838
|
+
lockPath: import_node_path39.default.join(paths.root, "update.lock"),
|
|
118756
118839
|
checkOnly,
|
|
118757
118840
|
pid: process.pid
|
|
118758
118841
|
};
|
|
@@ -119022,7 +119105,7 @@ function createRealWindowOpener(params) {
|
|
|
119022
119105
|
init_conditions();
|
|
119023
119106
|
|
|
119024
119107
|
// src/usage/handledStamps.ts
|
|
119025
|
-
var
|
|
119108
|
+
var import_node_path46 = __toESM(require("node:path"), 1);
|
|
119026
119109
|
init_zod();
|
|
119027
119110
|
var STAMPS_SCHEMA_VERSION = 1;
|
|
119028
119111
|
var StampsFileSchema = external_exports.strictObject({
|
|
@@ -119045,7 +119128,7 @@ function readHandled(fs30, file2) {
|
|
|
119045
119128
|
}
|
|
119046
119129
|
function writeHandled(fs30, file2, handled) {
|
|
119047
119130
|
const next = { schemaVersion: STAMPS_SCHEMA_VERSION, handled: Object.fromEntries(Object.entries(handled).map(([key, at2]) => [key, new Date(at2).toISOString()])) };
|
|
119048
|
-
fs30.mkdirPrivate(
|
|
119131
|
+
fs30.mkdirPrivate(import_node_path46.default.dirname(file2));
|
|
119049
119132
|
fs30.writeFilePrivate(file2, `${JSON.stringify(next, null, 2)}
|
|
119050
119133
|
`);
|
|
119051
119134
|
}
|
|
@@ -119798,11 +119881,11 @@ function createRcSessionTracker(deps) {
|
|
|
119798
119881
|
};
|
|
119799
119882
|
const observeExchange = (request7) => {
|
|
119800
119883
|
const method = (request7.method ?? "").toUpperCase();
|
|
119801
|
-
const
|
|
119802
|
-
if (!
|
|
119884
|
+
const path70 = new URL(request7.url ?? "/", "http://127.0.0.1").pathname;
|
|
119885
|
+
if (!path70.startsWith(RC_SESSIONS_PATH_PREFIX)) {
|
|
119803
119886
|
return void 0;
|
|
119804
119887
|
}
|
|
119805
|
-
const tail =
|
|
119888
|
+
const tail = path70.slice(RC_SESSIONS_PATH_PREFIX.length);
|
|
119806
119889
|
const facts = {
|
|
119807
119890
|
oauthAuthorization: oauthAuthorizationOf(request7.headers),
|
|
119808
119891
|
anthropicVersion: singleHeader(request7.headers, "anthropic-version"),
|
|
@@ -120171,8 +120254,8 @@ var RC_READ_FILE_ENCODINGS = ["utf-8", "base64"];
|
|
|
120171
120254
|
function isRcReadFileEncoding(value2) {
|
|
120172
120255
|
return RC_READ_FILE_ENCODINGS.some((encoding) => encoding === value2);
|
|
120173
120256
|
}
|
|
120174
|
-
function buildRcReadFilePayload(requestId,
|
|
120175
|
-
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 } });
|
|
120176
120259
|
}
|
|
120177
120260
|
function buildRcFileSuggestionsPayload(requestId, query) {
|
|
120178
120261
|
return buildRcControlRequestPayload(requestId, { subtype: "file_suggestions", query });
|
|
@@ -120274,15 +120357,15 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
|
|
|
120274
120357
|
const result = await deliverRcClientPayload(deps, sessionId, buildRcGetContextUsagePayload(requestId, detail), `request the context usage of session ${sessionId}`);
|
|
120275
120358
|
return result.ok ? { ...result, requestId } : result;
|
|
120276
120359
|
}
|
|
120277
|
-
async function readRcSessionFile(deps, sessionId,
|
|
120278
|
-
if (
|
|
120360
|
+
async function readRcSessionFile(deps, sessionId, path70, options) {
|
|
120361
|
+
if (path70 === "") {
|
|
120279
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" };
|
|
120280
120363
|
}
|
|
120281
120364
|
if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
|
|
120282
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" };
|
|
120283
120366
|
}
|
|
120284
120367
|
const requestId = deps.newUuid();
|
|
120285
|
-
const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId,
|
|
120368
|
+
const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path70, options), `read ${path70} from session ${sessionId}`);
|
|
120286
120369
|
return result.ok ? { ...result, requestId } : result;
|
|
120287
120370
|
}
|
|
120288
120371
|
async function suggestRcSessionFiles(deps, sessionId, query) {
|
|
@@ -120453,11 +120536,11 @@ function createRcControlHandler(deps) {
|
|
|
120453
120536
|
path: "read-file",
|
|
120454
120537
|
read: (body) => {
|
|
120455
120538
|
const session = bodyString(body, "session");
|
|
120456
|
-
const
|
|
120539
|
+
const path70 = bodyString(body, "path");
|
|
120457
120540
|
const maxBytes = "maxBytes" in body ? bodyPositiveInteger(body, "maxBytes") : void 0;
|
|
120458
120541
|
const encoding = "encoding" in body && isRcReadFileEncoding(body.encoding) ? body.encoding : void 0;
|
|
120459
|
-
const refused2 = session === void 0 ||
|
|
120460
|
-
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 } }) };
|
|
120461
120544
|
}
|
|
120462
120545
|
},
|
|
120463
120546
|
{
|
|
@@ -120767,9 +120850,9 @@ function requestIdOfBody(body) {
|
|
|
120767
120850
|
}
|
|
120768
120851
|
function frontDoorRcControl(transport, token) {
|
|
120769
120852
|
const headers = { authorization: `Bearer ${token}` };
|
|
120770
|
-
const listAnswerOf = async (
|
|
120853
|
+
const listAnswerOf = async (path70, what) => {
|
|
120771
120854
|
try {
|
|
120772
|
-
return await transport.request({ method: "GET", path:
|
|
120855
|
+
return await transport.request({ method: "GET", path: path70, headers });
|
|
120773
120856
|
} catch (error63) {
|
|
120774
120857
|
throw new Error(`${what}: could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}`, { cause: error63 });
|
|
120775
120858
|
}
|
|
@@ -120841,10 +120924,10 @@ function frontDoorRcControl(transport, token) {
|
|
|
120841
120924
|
}
|
|
120842
120925
|
return pending;
|
|
120843
120926
|
};
|
|
120844
|
-
const writeOf = async (
|
|
120927
|
+
const writeOf = async (path70, body, describeFailure2) => {
|
|
120845
120928
|
let answer;
|
|
120846
120929
|
try {
|
|
120847
|
-
answer = await transport.request({ method: "POST", path:
|
|
120930
|
+
answer = await transport.request({ method: "POST", path: path70, headers: { ...headers, "content-type": "application/json" }, body });
|
|
120848
120931
|
} catch (error63) {
|
|
120849
120932
|
return { ok: false, message: `could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}` };
|
|
120850
120933
|
}
|
|
@@ -120875,10 +120958,10 @@ function frontDoorRcControl(transport, token) {
|
|
|
120875
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}`),
|
|
120876
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}`),
|
|
120877
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}`),
|
|
120878
|
-
readFile: async (sessionId,
|
|
120961
|
+
readFile: async (sessionId, path70, options) => await writeOf(
|
|
120879
120962
|
`${CONTROL_PATH_PREFIX}/read-file`,
|
|
120880
|
-
JSON.stringify({ session: sessionId, path:
|
|
120881
|
-
(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}`
|
|
120882
120965
|
),
|
|
120883
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}`),
|
|
120884
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}`),
|
|
@@ -121191,12 +121274,12 @@ function tlsFacts(options) {
|
|
|
121191
121274
|
}
|
|
121192
121275
|
function realRcEventDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
|
|
121193
121276
|
const agent = new ExemptTlsAgent();
|
|
121194
|
-
const post = async (
|
|
121277
|
+
const post = async (path70, headers, body) => await new Promise((resolve2, reject) => {
|
|
121195
121278
|
const options = {
|
|
121196
121279
|
host: target.host,
|
|
121197
121280
|
port: target.port,
|
|
121198
121281
|
method: "POST",
|
|
121199
|
-
path:
|
|
121282
|
+
path: path70,
|
|
121200
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.
|
|
121201
121284
|
headers: { ...headers, host: target.servername ?? target.host, "content-length": String(Buffer.byteLength(body, "utf8")) },
|
|
121202
121285
|
agent
|
|
@@ -121261,12 +121344,12 @@ function lateRcStreamDial(resolve2) {
|
|
|
121261
121344
|
}
|
|
121262
121345
|
function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
|
|
121263
121346
|
const agent = new ExemptTlsAgent();
|
|
121264
|
-
const request7 = async (method,
|
|
121347
|
+
const request7 = async (method, path70, headers, body, signal) => await new Promise((resolve2, reject) => {
|
|
121265
121348
|
const options = {
|
|
121266
121349
|
host: target.host,
|
|
121267
121350
|
port: target.port,
|
|
121268
121351
|
method,
|
|
121269
|
-
path:
|
|
121352
|
+
path: path70,
|
|
121270
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.
|
|
121271
121354
|
headers: { ...headers, host: target.servername ?? target.host, ...body === void 0 ? {} : { "content-length": String(Buffer.byteLength(body, "utf8")) } },
|
|
121272
121355
|
agent,
|
|
@@ -121308,9 +121391,9 @@ function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_P
|
|
|
121308
121391
|
return { status, body: await readAll(response) };
|
|
121309
121392
|
},
|
|
121310
121393
|
openStream: async (sessionId, headers, resume, signal) => {
|
|
121311
|
-
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)}`;
|
|
121312
121395
|
const streamHeaders = resume === void 0 ? headers : { ...headers, "last-event-id": String(resume.fromSequenceNum) };
|
|
121313
|
-
const { status, response } = await request7("GET",
|
|
121396
|
+
const { status, response } = await request7("GET", path70, streamHeaders, void 0, signal);
|
|
121314
121397
|
if (!isSuccessful2(status)) {
|
|
121315
121398
|
await readAll(response);
|
|
121316
121399
|
return { status, chunks: NO_CHUNKS };
|
|
@@ -121527,10 +121610,11 @@ function realConnectEffects(ports = DOOR_SOURCE_PORTS) {
|
|
|
121527
121610
|
|
|
121528
121611
|
// src/doctorReport.ts
|
|
121529
121612
|
init_claudeShim();
|
|
121613
|
+
init_names();
|
|
121530
121614
|
init_store();
|
|
121531
121615
|
init_realPorts();
|
|
121532
121616
|
var import_node_fs20 = __toESM(require("node:fs"), 1);
|
|
121533
|
-
var
|
|
121617
|
+
var import_node_path47 = __toESM(require("node:path"), 1);
|
|
121534
121618
|
init_signIn();
|
|
121535
121619
|
init_load();
|
|
121536
121620
|
init_unrecognisedKeys();
|
|
@@ -121861,7 +121945,7 @@ function tcpPortEraRecord(raw) {
|
|
|
121861
121945
|
return (has("port") || has("lastPort")) && !has("socketPath");
|
|
121862
121946
|
}
|
|
121863
121947
|
function pushPathResolution(push, resolution) {
|
|
121864
|
-
const ownDir =
|
|
121948
|
+
const ownDir = import_node_path47.default.dirname(resolution.ownExecutablePath);
|
|
121865
121949
|
switch (resolution.agentShim.status) {
|
|
121866
121950
|
case "ok":
|
|
121867
121951
|
push("path-resolution", "pass", `\`agent-shim\` on PATH resolves to this running executable, ${resolution.ownExecutablePath}.`, "agent-shim");
|
|
@@ -121924,6 +122008,22 @@ function signInProblem(signIn) {
|
|
|
121924
122008
|
return error63 instanceof Error ? error63.message : String(error63);
|
|
121925
122009
|
}
|
|
121926
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
|
+
}
|
|
121927
122027
|
function pushProvider(push, entry, cacheEnv, signIn) {
|
|
121928
122028
|
if (entry.raw === void 0) {
|
|
121929
122029
|
push("provider", "fail", `${entry.path} is missing.`, entry.name);
|
|
@@ -121965,14 +122065,14 @@ function pushProvider(push, entry, cacheEnv, signIn) {
|
|
|
121965
122065
|
}
|
|
121966
122066
|
function pushLegacyName(push, params) {
|
|
121967
122067
|
const legacyVariables = Object.keys(params.env).filter((name) => name.startsWith(LEGACY_ENV_PREFIX) && params.env[name] !== void 0).sort();
|
|
121968
|
-
if (legacyVariables.length === 0 &&
|
|
122068
|
+
if (legacyVariables.length === 0 && import_node_path47.default.basename(params.rootPath) !== LEGACY_HOME_DIRNAME) {
|
|
121969
122069
|
push("legacy-name", "pass", "Nothing here still uses the former `claude-use` name.");
|
|
121970
122070
|
return;
|
|
121971
122071
|
}
|
|
121972
122072
|
for (const name of legacyVariables) {
|
|
121973
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);
|
|
121974
122074
|
}
|
|
121975
|
-
if (
|
|
122075
|
+
if (import_node_path47.default.basename(params.rootPath) === LEGACY_HOME_DIRNAME) {
|
|
121976
122076
|
push(
|
|
121977
122077
|
"legacy-name",
|
|
121978
122078
|
"warn",
|
|
@@ -122034,6 +122134,9 @@ function runDoctor(params) {
|
|
|
122034
122134
|
pushLegacyName(push, params);
|
|
122035
122135
|
const profileSources = /* @__PURE__ */ new Map();
|
|
122036
122136
|
for (const entry of params.configProfiles) {
|
|
122137
|
+
if (!pushNameFinding(push, "config-profile", "configuration profile", entry)) {
|
|
122138
|
+
continue;
|
|
122139
|
+
}
|
|
122037
122140
|
const validated2 = validate3(ConfigProfileSchema, entry, "config-profile", entry.name);
|
|
122038
122141
|
if (!validated2.ok) {
|
|
122039
122142
|
push("config-profile", "fail", validated2.message, entry.name);
|
|
@@ -122129,6 +122232,9 @@ function runDoctor(params) {
|
|
|
122129
122232
|
return poolName === void 0 ? validIdentityNames.has(selector) : poolName in pools;
|
|
122130
122233
|
};
|
|
122131
122234
|
for (const entry of params.providers) {
|
|
122235
|
+
if (!pushNameFinding(push, "provider", "provider", entry)) {
|
|
122236
|
+
continue;
|
|
122237
|
+
}
|
|
122132
122238
|
pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
|
|
122133
122239
|
}
|
|
122134
122240
|
const providerNames = new Set(params.providers.map((entry) => entry.name));
|
|
@@ -122375,18 +122481,18 @@ function collectDoctorReport(params) {
|
|
|
122375
122481
|
const { paths } = params;
|
|
122376
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() : [];
|
|
122377
122483
|
const identities = identityNames.map((name) => {
|
|
122378
|
-
const farmRoot =
|
|
122379
|
-
const identityPath =
|
|
122484
|
+
const farmRoot = import_node_path47.default.join(paths.identitiesDir, name);
|
|
122485
|
+
const identityPath = import_node_path47.default.join(farmRoot, "identity.json");
|
|
122380
122486
|
return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot, credentialsFilePresent: import_node_fs20.default.existsSync(credentialsFilePath(farmRoot)) };
|
|
122381
122487
|
});
|
|
122382
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() : [];
|
|
122383
122489
|
const configProfiles = profileNames.map((name) => {
|
|
122384
|
-
const profilePath =
|
|
122490
|
+
const profilePath = import_node_path47.default.join(paths.configProfilesDir, `${name}.json`);
|
|
122385
122491
|
return { name, path: profilePath, raw: realFsPort.readFileUtf8(profilePath) };
|
|
122386
122492
|
});
|
|
122387
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() : [];
|
|
122388
122494
|
const providers = providerNames.map((name) => {
|
|
122389
|
-
const providerPath =
|
|
122495
|
+
const providerPath = import_node_path47.default.join(paths.providersDir, `${name}.json`);
|
|
122390
122496
|
return { name, path: providerPath, raw: realFsPort.readFileUtf8(providerPath) };
|
|
122391
122497
|
});
|
|
122392
122498
|
const ownExecutablePath = realOwnExecutablePath();
|
|
@@ -122398,12 +122504,12 @@ function collectDoctorReport(params) {
|
|
|
122398
122504
|
binaryDiscovery = { ok: false, message: error63 instanceof Error ? error63.message : String(error63) };
|
|
122399
122505
|
}
|
|
122400
122506
|
const shimState = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
|
|
122401
|
-
const pathDirs = (params.env.PATH ?? "").split(
|
|
122507
|
+
const pathDirs = (params.env.PATH ?? "").split(import_node_path47.default.delimiter).filter((dir) => dir !== "");
|
|
122402
122508
|
const claudeShimShadow = shimState === void 0 ? void 0 : refinePathShadow(
|
|
122403
122509
|
findPathShadow({
|
|
122404
122510
|
pathDirs,
|
|
122405
|
-
targetDir:
|
|
122406
|
-
targetFilename:
|
|
122511
|
+
targetDir: import_node_path47.default.dirname(shimState.targetPath),
|
|
122512
|
+
targetFilename: import_node_path47.default.basename(shimState.targetPath),
|
|
122407
122513
|
findExecutableInDir
|
|
122408
122514
|
}),
|
|
122409
122515
|
shimState.targetPath,
|
|
@@ -122439,7 +122545,7 @@ function collectDoctorReport(params) {
|
|
|
122439
122545
|
agentShim: refinePathShadow(
|
|
122440
122546
|
findPathShadow({
|
|
122441
122547
|
pathDirs,
|
|
122442
|
-
targetDir:
|
|
122548
|
+
targetDir: import_node_path47.default.dirname(ownExecutablePath),
|
|
122443
122549
|
targetFilename: commandFilename(ownExecutablePath, "agent-shim"),
|
|
122444
122550
|
findExecutableInDir
|
|
122445
122551
|
}),
|
|
@@ -122711,11 +122817,11 @@ function tryOrUndefined(fn2) {
|
|
|
122711
122817
|
return void 0;
|
|
122712
122818
|
}
|
|
122713
122819
|
}
|
|
122714
|
-
function pathToHttpPath(
|
|
122715
|
-
return `/${
|
|
122820
|
+
function pathToHttpPath(path70) {
|
|
122821
|
+
return `/${path70.map(safeEncodeURIComponent).join("/")}`;
|
|
122716
122822
|
}
|
|
122717
|
-
function normalizeHttpPath(
|
|
122718
|
-
const paths =
|
|
122823
|
+
function normalizeHttpPath(path70) {
|
|
122824
|
+
const paths = path70.split("/");
|
|
122719
122825
|
if (paths.at(0) === "") {
|
|
122720
122826
|
paths.shift();
|
|
122721
122827
|
}
|
|
@@ -122900,9 +123006,9 @@ function isPlainObject3(value2) {
|
|
|
122900
123006
|
function getOwn(object3, key) {
|
|
122901
123007
|
return Object.hasOwn(object3, key) ? object3[key] : void 0;
|
|
122902
123008
|
}
|
|
122903
|
-
function get(object3,
|
|
123009
|
+
function get(object3, path70) {
|
|
122904
123010
|
let current = object3;
|
|
122905
|
-
for (const key of
|
|
123011
|
+
for (const key of path70) {
|
|
122906
123012
|
if (!isTypescriptObject(current)) {
|
|
122907
123013
|
return void 0;
|
|
122908
123014
|
}
|
|
@@ -124125,7 +124231,7 @@ function resolveClientRest(rest) {
|
|
|
124125
124231
|
// rest[1] can be undefined if all fields of FriendlyClientOptions are optional
|
|
124126
124232
|
];
|
|
124127
124233
|
}
|
|
124128
|
-
function createORPCClient(link, { path:
|
|
124234
|
+
function createORPCClient(link, { path: path70 = [], ...options } = {}) {
|
|
124129
124235
|
const procedureClient = (...rest) => {
|
|
124130
124236
|
const [input2, callOptions] = resolveClientRest(rest);
|
|
124131
124237
|
const interceptors = [
|
|
@@ -124134,7 +124240,7 @@ function createORPCClient(link, { path: path72 = [], ...options } = {}) {
|
|
|
124134
124240
|
];
|
|
124135
124241
|
return intercept(
|
|
124136
124242
|
interceptors,
|
|
124137
|
-
{ ...callOptions, input: input2, path:
|
|
124243
|
+
{ ...callOptions, input: input2, path: path70 },
|
|
124138
124244
|
({ path: path210, input: input22, ...callOptions2 }) => link.call(path210, input22, callOptions2)
|
|
124139
124245
|
);
|
|
124140
124246
|
};
|
|
@@ -124148,7 +124254,7 @@ function createORPCClient(link, { path: path72 = [], ...options } = {}) {
|
|
|
124148
124254
|
if (client === void 0) {
|
|
124149
124255
|
client = createORPCClient(link, {
|
|
124150
124256
|
...options,
|
|
124151
|
-
path: [...
|
|
124257
|
+
path: [...path70, key],
|
|
124152
124258
|
scoped: options.scoped?.[key]
|
|
124153
124259
|
});
|
|
124154
124260
|
cache.set(key, client);
|
|
@@ -124170,24 +124276,24 @@ var BracketNotationSerializer = class {
|
|
|
124170
124276
|
this.internalSerialize(data, "", true, result);
|
|
124171
124277
|
return result;
|
|
124172
124278
|
}
|
|
124173
|
-
internalSerialize(data,
|
|
124279
|
+
internalSerialize(data, path70, isRoot, result) {
|
|
124174
124280
|
if (Array.isArray(data)) {
|
|
124175
124281
|
data.forEach((item, i10) => {
|
|
124176
|
-
this.internalSerialize(item, isRoot ? i10.toString() : `${
|
|
124282
|
+
this.internalSerialize(item, isRoot ? i10.toString() : `${path70}[${i10}]`, false, result);
|
|
124177
124283
|
});
|
|
124178
124284
|
} else if (isPlainObject3(data)) {
|
|
124179
124285
|
for (const key of Object.keys(data)) {
|
|
124180
|
-
this.internalSerialize(data[key], isRoot ? key : `${
|
|
124286
|
+
this.internalSerialize(data[key], isRoot ? key : `${path70}[${key}]`, false, result);
|
|
124181
124287
|
}
|
|
124182
124288
|
} else {
|
|
124183
|
-
result.push([
|
|
124289
|
+
result.push([path70, data]);
|
|
124184
124290
|
}
|
|
124185
124291
|
}
|
|
124186
124292
|
deserialize(serialized) {
|
|
124187
124293
|
const arrayPushStyles = /* @__PURE__ */ new WeakSet();
|
|
124188
124294
|
const root = new NullProtoObj();
|
|
124189
|
-
for (const [
|
|
124190
|
-
const segments = this.parsePath(
|
|
124295
|
+
for (const [path70, value2] of serialized) {
|
|
124296
|
+
const segments = this.parsePath(path70);
|
|
124191
124297
|
let currentRef = root;
|
|
124192
124298
|
let nextSegment = segments[0];
|
|
124193
124299
|
for (let i10 = 1; i10 < segments.length; i10++) {
|
|
@@ -124238,13 +124344,13 @@ var BracketNotationSerializer = class {
|
|
|
124238
124344
|
}
|
|
124239
124345
|
return result;
|
|
124240
124346
|
}
|
|
124241
|
-
parsePath(
|
|
124347
|
+
parsePath(path70) {
|
|
124242
124348
|
const segments = [];
|
|
124243
124349
|
let inBrackets = false;
|
|
124244
124350
|
let currentSegment = "";
|
|
124245
|
-
for (let i10 = 0; i10 <
|
|
124246
|
-
const char =
|
|
124247
|
-
const nextChar =
|
|
124351
|
+
for (let i10 = 0; i10 < path70.length; i10++) {
|
|
124352
|
+
const char = path70[i10];
|
|
124353
|
+
const nextChar = path70[i10 + 1];
|
|
124248
124354
|
if (inBrackets && char === "]" && (nextChar === void 0 || nextChar === "[")) {
|
|
124249
124355
|
if (nextChar === void 0) {
|
|
124250
124356
|
inBrackets = false;
|
|
@@ -124260,7 +124366,7 @@ var BracketNotationSerializer = class {
|
|
|
124260
124366
|
currentSegment += char;
|
|
124261
124367
|
}
|
|
124262
124368
|
}
|
|
124263
|
-
return inBrackets || segments.length === 0 ? [
|
|
124369
|
+
return inBrackets || segments.length === 0 ? [path70] : segments;
|
|
124264
124370
|
}
|
|
124265
124371
|
};
|
|
124266
124372
|
var INTEGER_PATTERN = /^0$|^[1-9]\d*$/;
|
|
@@ -124833,11 +124939,11 @@ var OpenAPISerializer = class {
|
|
|
124833
124939
|
return json2;
|
|
124834
124940
|
}
|
|
124835
124941
|
const form = new FormData();
|
|
124836
|
-
for (const [
|
|
124942
|
+
for (const [path70, value22] of this.bracketNotation.serialize(json2)) {
|
|
124837
124943
|
if (value22 instanceof Blob) {
|
|
124838
|
-
form.append(
|
|
124944
|
+
form.append(path70, value22);
|
|
124839
124945
|
} else if (value22 !== void 0 && value22 !== null) {
|
|
124840
|
-
form.append(
|
|
124946
|
+
form.append(path70, String(value22));
|
|
124841
124947
|
}
|
|
124842
124948
|
}
|
|
124843
124949
|
return form;
|
|
@@ -124875,30 +124981,30 @@ function isBodylessMethod(method) {
|
|
|
124875
124981
|
return method === "GET" || method === "HEAD";
|
|
124876
124982
|
}
|
|
124877
124983
|
var PARAMETER_NAME_REGEX = /^[\w-]+$/;
|
|
124878
|
-
function getDynamicPathParams(
|
|
124879
|
-
if (!
|
|
124984
|
+
function getDynamicPathParams(path70) {
|
|
124985
|
+
if (!path70.includes("{")) {
|
|
124880
124986
|
return void 0;
|
|
124881
124987
|
}
|
|
124882
|
-
const len =
|
|
124988
|
+
const len = path70.length;
|
|
124883
124989
|
let params;
|
|
124884
124990
|
let index = 1;
|
|
124885
124991
|
while (index < len) {
|
|
124886
124992
|
const segmentStart = index;
|
|
124887
|
-
const slashPos =
|
|
124993
|
+
const slashPos = path70.indexOf("/", index);
|
|
124888
124994
|
const segmentEnd = slashPos === -1 ? len : slashPos;
|
|
124889
|
-
if (segmentEnd > segmentStart &&
|
|
124995
|
+
if (segmentEnd > segmentStart && path70.charCodeAt(segmentStart) === 123 && path70.charCodeAt(segmentEnd - 1) === 125) {
|
|
124890
124996
|
let parameterStart = segmentStart + 1;
|
|
124891
124997
|
let allowsSlash = false;
|
|
124892
|
-
const operator =
|
|
124998
|
+
const operator = path70.charCodeAt(parameterStart);
|
|
124893
124999
|
if (operator === 43) {
|
|
124894
125000
|
allowsSlash = true;
|
|
124895
125001
|
parameterStart++;
|
|
124896
125002
|
}
|
|
124897
|
-
const parameterName =
|
|
125003
|
+
const parameterName = path70.slice(parameterStart, segmentEnd - 1);
|
|
124898
125004
|
if (PARAMETER_NAME_REGEX.test(parameterName)) {
|
|
124899
125005
|
params ??= [];
|
|
124900
125006
|
params.push({
|
|
124901
|
-
segment:
|
|
125007
|
+
segment: path70.slice(segmentStart, segmentEnd),
|
|
124902
125008
|
startIndex: segmentStart,
|
|
124903
125009
|
parameterName,
|
|
124904
125010
|
allowsSlash
|
|
@@ -124941,8 +125047,8 @@ openapi.method = (method) => ({
|
|
|
124941
125047
|
...openapi({ method }),
|
|
124942
125048
|
name: "~openapi/method"
|
|
124943
125049
|
});
|
|
124944
|
-
openapi.path = (
|
|
124945
|
-
...openapi({ path:
|
|
125050
|
+
openapi.path = (path70) => ({
|
|
125051
|
+
...openapi({ path: path70 }),
|
|
124946
125052
|
name: "~openapi/path"
|
|
124947
125053
|
});
|
|
124948
125054
|
openapi.spec = (spec) => ({
|
|
@@ -125803,22 +125909,22 @@ function visitJsonSchemaRefs(value2, visit2, schemaLevel = true, seen = /* @__PU
|
|
|
125803
125909
|
}
|
|
125804
125910
|
}
|
|
125805
125911
|
}
|
|
125806
|
-
function mapJsonSchemaRefs(value2, map2, schemaLevel = true,
|
|
125912
|
+
function mapJsonSchemaRefs(value2, map2, schemaLevel = true, path70 = []) {
|
|
125807
125913
|
if (!value2 || typeof value2 !== "object") {
|
|
125808
125914
|
return value2;
|
|
125809
125915
|
}
|
|
125810
125916
|
if (Array.isArray(value2)) {
|
|
125811
|
-
return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...
|
|
125917
|
+
return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...path70, index]));
|
|
125812
125918
|
}
|
|
125813
125919
|
const result = {};
|
|
125814
125920
|
for (const key of Object.keys(value2)) {
|
|
125815
125921
|
const val = value2[key];
|
|
125816
125922
|
if (key === "$ref" && typeof val === "string") {
|
|
125817
|
-
setOwn(result, key, map2(val, [...
|
|
125923
|
+
setOwn(result, key, map2(val, [...path70, key]));
|
|
125818
125924
|
} else if (!schemaLevel) {
|
|
125819
|
-
setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...
|
|
125925
|
+
setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...path70, key]));
|
|
125820
125926
|
} else if (JSON_SCHEMA_LOGIC_KEYWORDS.has(key) || JSON_SCHEMA_RECORD_KEYWORDS.has(key)) {
|
|
125821
|
-
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]));
|
|
125822
125928
|
} else {
|
|
125823
125929
|
setOwn(result, key, val);
|
|
125824
125930
|
}
|
|
@@ -126348,7 +126454,7 @@ function unlazy(maybeLazy) {
|
|
|
126348
126454
|
function createProcedureClient(lazyableProcedure, ...rest) {
|
|
126349
126455
|
const options = resolveMaybeOptionalOptions(rest);
|
|
126350
126456
|
return async (...[input2, callerOptions]) => {
|
|
126351
|
-
const
|
|
126457
|
+
const path70 = toArray(options.path);
|
|
126352
126458
|
const { default: procedure } = await unlazy(lazyableProcedure);
|
|
126353
126459
|
const clientContext = callerOptions?.context ?? {};
|
|
126354
126460
|
const context = await value(options.context, clientContext) ?? {};
|
|
@@ -126361,7 +126467,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
126361
126467
|
};
|
|
126362
126468
|
try {
|
|
126363
126469
|
const output2 = await runWithSpan("call_procedure", (span) => {
|
|
126364
|
-
span?.setAttribute("procedure.path",
|
|
126470
|
+
span?.setAttribute("procedure.path", path70);
|
|
126365
126471
|
return intercept(
|
|
126366
126472
|
options.interceptors,
|
|
126367
126473
|
{
|
|
@@ -126369,7 +126475,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
126369
126475
|
// input can be optional if it is undefinable
|
|
126370
126476
|
input: input2,
|
|
126371
126477
|
errors,
|
|
126372
|
-
path:
|
|
126478
|
+
path: path70,
|
|
126373
126479
|
procedure,
|
|
126374
126480
|
signal: callerOptions?.signal,
|
|
126375
126481
|
lastEventId: callerOptions?.lastEventId
|
|
@@ -126620,10 +126726,10 @@ function augmentRouter(router, options) {
|
|
|
126620
126726
|
}
|
|
126621
126727
|
return enhanced;
|
|
126622
126728
|
}
|
|
126623
|
-
function getRouter(router,
|
|
126729
|
+
function getRouter(router, path70) {
|
|
126624
126730
|
let current = router;
|
|
126625
|
-
for (let i10 = 0; i10 <
|
|
126626
|
-
const segment =
|
|
126731
|
+
for (let i10 = 0; i10 < path70.length; i10++) {
|
|
126732
|
+
const segment = path70[i10];
|
|
126627
126733
|
if (!isTypescriptObject(current)) {
|
|
126628
126734
|
return void 0;
|
|
126629
126735
|
}
|
|
@@ -126635,7 +126741,7 @@ function getRouter(router, path72) {
|
|
|
126635
126741
|
continue;
|
|
126636
126742
|
}
|
|
126637
126743
|
const lazied = current;
|
|
126638
|
-
const rest =
|
|
126744
|
+
const rest = path70.slice(i10);
|
|
126639
126745
|
return new Lazy({
|
|
126640
126746
|
...lazied["~orpc"],
|
|
126641
126747
|
async loader() {
|
|
@@ -126650,40 +126756,40 @@ function getRouter(router, path72) {
|
|
|
126650
126756
|
}
|
|
126651
126757
|
return current;
|
|
126652
126758
|
}
|
|
126653
|
-
function walkProcedureContractsSync(router, callback,
|
|
126759
|
+
function walkProcedureContractsSync(router, callback, path70 = []) {
|
|
126654
126760
|
const lazyResults = [];
|
|
126655
|
-
walkProcedureContractsSyncInternal(router, callback,
|
|
126761
|
+
walkProcedureContractsSyncInternal(router, callback, path70.slice(), lazyResults);
|
|
126656
126762
|
return lazyResults;
|
|
126657
126763
|
}
|
|
126658
|
-
function walkProcedureContractsSyncInternal(router, callback,
|
|
126764
|
+
function walkProcedureContractsSyncInternal(router, callback, path70, lazyResults) {
|
|
126659
126765
|
const hiddenContract = getHiddenRouterContract(router);
|
|
126660
126766
|
if (hiddenContract !== void 0) {
|
|
126661
126767
|
router = hiddenContract;
|
|
126662
126768
|
}
|
|
126663
126769
|
if (router instanceof ProcedureContract) {
|
|
126664
|
-
callback(router,
|
|
126770
|
+
callback(router, path70.slice());
|
|
126665
126771
|
return;
|
|
126666
126772
|
}
|
|
126667
126773
|
if (!isTypescriptObject(router)) {
|
|
126668
126774
|
return;
|
|
126669
126775
|
}
|
|
126670
126776
|
for (const [key, value2] of Object.entries(router)) {
|
|
126671
|
-
|
|
126777
|
+
path70.push(key);
|
|
126672
126778
|
if (value2 instanceof Lazy) {
|
|
126673
|
-
lazyResults.push({ router: value2, path:
|
|
126779
|
+
lazyResults.push({ router: value2, path: path70.slice() });
|
|
126674
126780
|
} else {
|
|
126675
|
-
walkProcedureContractsSyncInternal(value2, callback,
|
|
126781
|
+
walkProcedureContractsSyncInternal(value2, callback, path70, lazyResults);
|
|
126676
126782
|
}
|
|
126677
|
-
|
|
126783
|
+
path70.pop();
|
|
126678
126784
|
}
|
|
126679
126785
|
}
|
|
126680
|
-
async function walkProcedureContractsAsync(router, callback,
|
|
126786
|
+
async function walkProcedureContractsAsync(router, callback, path70 = []) {
|
|
126681
126787
|
const hiddenContract = getHiddenRouterContract(router);
|
|
126682
126788
|
if (hiddenContract !== void 0) {
|
|
126683
126789
|
router = hiddenContract;
|
|
126684
126790
|
}
|
|
126685
126791
|
if (router instanceof ProcedureContract) {
|
|
126686
|
-
await callback(router,
|
|
126792
|
+
await callback(router, path70);
|
|
126687
126793
|
return;
|
|
126688
126794
|
}
|
|
126689
126795
|
if (!isTypescriptObject(router)) {
|
|
@@ -126692,9 +126798,9 @@ async function walkProcedureContractsAsync(router, callback, path72 = []) {
|
|
|
126692
126798
|
for (const [key, value2] of Object.entries(router)) {
|
|
126693
126799
|
if (value2 instanceof Lazy) {
|
|
126694
126800
|
const { default: router2 } = await unlazy(value2);
|
|
126695
|
-
await walkProcedureContractsAsync(router2, callback, [...
|
|
126801
|
+
await walkProcedureContractsAsync(router2, callback, [...path70, key]);
|
|
126696
126802
|
} else {
|
|
126697
|
-
await walkProcedureContractsAsync(value2, callback, [...
|
|
126803
|
+
await walkProcedureContractsAsync(value2, callback, [...path70, key]);
|
|
126698
126804
|
}
|
|
126699
126805
|
}
|
|
126700
126806
|
}
|
|
@@ -127180,18 +127286,18 @@ function rewriteComponentSchemaRefs(schema, renameMap) {
|
|
|
127180
127286
|
}
|
|
127181
127287
|
var OpenAPIGeneratorError = class extends TypeError {
|
|
127182
127288
|
};
|
|
127183
|
-
function toOpenAPIPath(
|
|
127289
|
+
function toOpenAPIPath(path70, dynamicPathParams) {
|
|
127184
127290
|
if (!dynamicPathParams?.length) {
|
|
127185
|
-
return
|
|
127291
|
+
return path70;
|
|
127186
127292
|
}
|
|
127187
127293
|
let normalized = "";
|
|
127188
127294
|
let currentIndex = 0;
|
|
127189
127295
|
for (const param of dynamicPathParams) {
|
|
127190
|
-
normalized +=
|
|
127296
|
+
normalized += path70.slice(currentIndex, param.startIndex);
|
|
127191
127297
|
normalized += `{${param.parameterName}}`;
|
|
127192
127298
|
currentIndex = param.startIndex + param.segment.length;
|
|
127193
127299
|
}
|
|
127194
|
-
normalized +=
|
|
127300
|
+
normalized += path70.slice(currentIndex);
|
|
127195
127301
|
return normalized;
|
|
127196
127302
|
}
|
|
127197
127303
|
function buildRequest(ctx, operation, def, meta3, dynamicPathParams) {
|
|
@@ -127625,8 +127731,8 @@ var OpenAPIGenerator = class {
|
|
|
127625
127731
|
customErrorResponseBodySchema: options.customErrorResponseBodySchema
|
|
127626
127732
|
};
|
|
127627
127733
|
const errors = [];
|
|
127628
|
-
await walkProcedureContractsAsync(router, (contract,
|
|
127629
|
-
if (value(options.filter, contract,
|
|
127734
|
+
await walkProcedureContractsAsync(router, (contract, path70) => {
|
|
127735
|
+
if (value(options.filter, contract, path70) === false) {
|
|
127630
127736
|
return;
|
|
127631
127737
|
}
|
|
127632
127738
|
try {
|
|
@@ -127638,7 +127744,7 @@ var OpenAPIGenerator = class {
|
|
|
127638
127744
|
`QUERY operations require OpenAPI 3.2, but version "${version2}" was requested.`
|
|
127639
127745
|
);
|
|
127640
127746
|
}
|
|
127641
|
-
const postPath = meta3?.path ?? pathToHttpPath(
|
|
127747
|
+
const postPath = meta3?.path ?? pathToHttpPath(path70);
|
|
127642
127748
|
const httpPath = meta3?.prefix ? mergeHttpPath(meta3.prefix, postPath) : postPath;
|
|
127643
127749
|
const dynamicPathParams = getDynamicPathParams(httpPath);
|
|
127644
127750
|
const openApiPath = toOpenAPIPath(httpPath, dynamicPathParams);
|
|
@@ -127647,7 +127753,7 @@ var OpenAPIGenerator = class {
|
|
|
127647
127753
|
operation = meta3.spec;
|
|
127648
127754
|
} else {
|
|
127649
127755
|
operation = {
|
|
127650
|
-
operationId: meta3?.operationId ??
|
|
127756
|
+
operationId: meta3?.operationId ?? path70.join("."),
|
|
127651
127757
|
summary: meta3?.summary,
|
|
127652
127758
|
description: meta3?.description,
|
|
127653
127759
|
deprecated: meta3?.deprecated,
|
|
@@ -127667,7 +127773,7 @@ var OpenAPIGenerator = class {
|
|
|
127667
127773
|
if (!(e14 instanceof OpenAPIGeneratorError)) {
|
|
127668
127774
|
throw e14;
|
|
127669
127775
|
}
|
|
127670
|
-
errors.push(`Procedure at ${
|
|
127776
|
+
errors.push(`Procedure at ${path70.join(".") || "(root)"}: ${e14.message}`);
|
|
127671
127777
|
}
|
|
127672
127778
|
});
|
|
127673
127779
|
if (errors.length) {
|
|
@@ -127975,7 +128081,7 @@ var ResetRowSchema = external_exports.strictObject({
|
|
|
127975
128081
|
var ResetScheduleSchema = external_exports.strictObject({ resets: external_exports.readonly(external_exports.array(ResetRowSchema)) });
|
|
127976
128082
|
|
|
127977
128083
|
// src/frontdoor/controlSchemas.ts
|
|
127978
|
-
var
|
|
128084
|
+
var import_node_path48 = __toESM(require("node:path"), 1);
|
|
127979
128085
|
init_zod();
|
|
127980
128086
|
init_schema2();
|
|
127981
128087
|
|
|
@@ -128189,11 +128295,11 @@ var FrontDoorSessionsOutputSchema = external_exports.strictObject({ sessions: ex
|
|
|
128189
128295
|
var CheckRunInputSchema = external_exports.strictObject({
|
|
128190
128296
|
path: external_exports.string().min(1),
|
|
128191
128297
|
identity: external_exports.string().min(1).optional()
|
|
128192
|
-
}).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" });
|
|
128193
128299
|
var PoolPickInputSchema = external_exports.strictObject({
|
|
128194
128300
|
pool: external_exports.string().min(1),
|
|
128195
128301
|
path: external_exports.string().min(1)
|
|
128196
|
-
}).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" });
|
|
128197
128303
|
var DoctorFindingSchema = external_exports.strictObject({
|
|
128198
128304
|
section: external_exports.enum(DOCTOR_SECTIONS),
|
|
128199
128305
|
subject: external_exports.string().optional(),
|
|
@@ -128514,16 +128620,16 @@ var StandardLink = class {
|
|
|
128514
128620
|
/**
|
|
128515
128621
|
* @throws ORPCError, transport-level errors (network failures, timeouts, etc.)
|
|
128516
128622
|
*/
|
|
128517
|
-
call(
|
|
128518
|
-
return runWithSpan(`${ORPC_NAME}.${
|
|
128623
|
+
call(path70, input2, options) {
|
|
128624
|
+
return runWithSpan(`${ORPC_NAME}.${path70.join("/")}`, (span) => {
|
|
128519
128625
|
span?.setAttribute("rpc.system", ORPC_NAME);
|
|
128520
|
-
span?.setAttribute("rpc.method",
|
|
128626
|
+
span?.setAttribute("rpc.method", path70.join("."));
|
|
128521
128627
|
if (getTracer() && isAsyncIteratorObject(input2)) {
|
|
128522
128628
|
input2 = override(input2, traceAsyncIterator("consume_async_iterator_object_input", input2));
|
|
128523
128629
|
} else if (getTracer() && input2 instanceof ReadableStream) {
|
|
128524
128630
|
input2 = override(input2, traceReadableStream("consume_octet_stream_input", input2));
|
|
128525
128631
|
}
|
|
128526
|
-
return intercept(this.interceptors, { ...options, path:
|
|
128632
|
+
return intercept(this.interceptors, { ...options, path: path70, input: input2 }, async ({ path: path210, input: input22, ...options2 }) => {
|
|
128527
128633
|
const tracer = getTracer();
|
|
128528
128634
|
const activeSpan = tracer?.getActiveSpan() ?? span;
|
|
128529
128635
|
let request7 = await runWithSpan(
|
|
@@ -128580,18 +128686,18 @@ var RPCLinkCodec = class {
|
|
|
128580
128686
|
this.headers = options.headers ?? {};
|
|
128581
128687
|
this.serializer = options.serializer ?? new RPCSerializer();
|
|
128582
128688
|
}
|
|
128583
|
-
async encodeInput(input2,
|
|
128584
|
-
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));
|
|
128585
128691
|
if (options.lastEventId !== void 0) {
|
|
128586
128692
|
headers = mergeStandardHeaders(headers, { "last-event-id": options.lastEventId });
|
|
128587
128693
|
}
|
|
128588
|
-
const expectedMethod = await value(this.expectedMethod, options,
|
|
128589
|
-
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);
|
|
128590
128696
|
const [pathname, search, hash2] = parseStandardUrl(baseUrl);
|
|
128591
|
-
const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(
|
|
128697
|
+
const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(path70)}`;
|
|
128592
128698
|
const serialized = this.serializer.serialize(input2);
|
|
128593
128699
|
if (expectedMethod === "GET" && !(serialized instanceof Blob) && !(serialized instanceof ReadableStream) && !(serialized instanceof FormData) && !isAsyncIteratorObject(serialized)) {
|
|
128594
|
-
const maxUrlLength = await value(this.maxUrlLength, options,
|
|
128700
|
+
const maxUrlLength = await value(this.maxUrlLength, options, path70, input2);
|
|
128595
128701
|
const mergedSearch = new URLSearchParams(search);
|
|
128596
128702
|
mergedSearch.append("data", stringifyJSON(serialized) ?? "");
|
|
128597
128703
|
const url22 = `${newPathname}?${mergedSearch}${hash2 ?? ""}`;
|
|
@@ -128676,8 +128782,8 @@ var FetchLinkTransport = class {
|
|
|
128676
128782
|
this.fetch = options.fetch ?? ((url2, init) => globalThis.fetch(url2, init));
|
|
128677
128783
|
this.toFetchRequestOptions = options.toFetchRequest;
|
|
128678
128784
|
}
|
|
128679
|
-
async send(standardRequest,
|
|
128680
|
-
let origin = await value(this.origin, options,
|
|
128785
|
+
async send(standardRequest, path70, options) {
|
|
128786
|
+
let origin = await value(this.origin, options, path70);
|
|
128681
128787
|
if (origin?.endsWith("/")) {
|
|
128682
128788
|
origin = origin.slice(0, -1);
|
|
128683
128789
|
}
|
|
@@ -128697,7 +128803,7 @@ var FetchLinkTransport = class {
|
|
|
128697
128803
|
}
|
|
128698
128804
|
}
|
|
128699
128805
|
const fetch3 = this.fetch;
|
|
128700
|
-
const response = await fetch3(url2, init, options,
|
|
128806
|
+
const response = await fetch3(url2, init, options, path70);
|
|
128701
128807
|
const standardResponse = toStandardLazyResponse(response);
|
|
128702
128808
|
return standardResponse;
|
|
128703
128809
|
}
|
|
@@ -129088,14 +129194,14 @@ var StandardHandler = class {
|
|
|
129088
129194
|
span?.setAttribute("url.path", request22.url);
|
|
129089
129195
|
return { matched: false };
|
|
129090
129196
|
}
|
|
129091
|
-
const { path:
|
|
129092
|
-
span?.updateName(`${ORPC_NAME}.${
|
|
129197
|
+
const { path: path70, procedure, decodeInput } = matchedOrNot;
|
|
129198
|
+
span?.updateName(`${ORPC_NAME}.${path70.join("/")}`);
|
|
129093
129199
|
span?.setAttribute("rpc.system", ORPC_NAME);
|
|
129094
|
-
span?.setAttribute("rpc.method",
|
|
129200
|
+
span?.setAttribute("rpc.method", path70.join("."));
|
|
129095
129201
|
try {
|
|
129096
129202
|
const response = await intercept(
|
|
129097
129203
|
this.interceptors,
|
|
129098
|
-
{ context: context2, prefix: prefix2, request: request22, path:
|
|
129204
|
+
{ context: context2, prefix: prefix2, request: request22, path: path70, procedure, decodeInput },
|
|
129099
129205
|
async ({ context: context3, prefix: prefix3, request: request32, path: path210, procedure: procedure2, decodeInput: decodeInput2 }) => {
|
|
129100
129206
|
step2 = "decode_input";
|
|
129101
129207
|
let input2 = await runWithSpan("decode_input", decodeInput2);
|
|
@@ -129129,7 +129235,7 @@ var StandardHandler = class {
|
|
|
129129
129235
|
message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
|
|
129130
129236
|
cause: e14
|
|
129131
129237
|
}) : toORPCError(e14);
|
|
129132
|
-
const response = await this.codec.encodeError(error63, procedure,
|
|
129238
|
+
const response = await this.codec.encodeError(error63, procedure, path70, { context: context2, prefix: prefix2 });
|
|
129133
129239
|
return { matched: true, response };
|
|
129134
129240
|
}
|
|
129135
129241
|
}
|
|
@@ -129235,7 +129341,7 @@ var RPCMatcher = class {
|
|
|
129235
129341
|
this.rootRouter = router;
|
|
129236
129342
|
this.index(router);
|
|
129237
129343
|
}
|
|
129238
|
-
index(router,
|
|
129344
|
+
index(router, path70 = []) {
|
|
129239
129345
|
const lazyResults = walkProcedureContractsSync(router, (procedure, procedurePath) => {
|
|
129240
129346
|
if (!value(this.filter, procedure, procedurePath)) {
|
|
129241
129347
|
return;
|
|
@@ -129246,7 +129352,7 @@ var RPCMatcher = class {
|
|
|
129246
129352
|
// contract-first entries have no implementation yet, resolveProcedure fills it in on demand
|
|
129247
129353
|
procedure: procedure instanceof Procedure ? procedure : void 0
|
|
129248
129354
|
});
|
|
129249
|
-
},
|
|
129355
|
+
}, path70);
|
|
129250
129356
|
for (const result of lazyResults) {
|
|
129251
129357
|
this.pendingLazyRouters.set(pathToHttpPath(result.path), result);
|
|
129252
129358
|
}
|
|
@@ -129378,10 +129484,10 @@ var RPCHandlerCodec = class {
|
|
|
129378
129484
|
}
|
|
129379
129485
|
};
|
|
129380
129486
|
}
|
|
129381
|
-
encodeOutput(output2, procedure,
|
|
129487
|
+
encodeOutput(output2, procedure, path70, options) {
|
|
129382
129488
|
return {
|
|
129383
129489
|
headers: {},
|
|
129384
|
-
status: value(this.outputStatus, output2, procedure,
|
|
129490
|
+
status: value(this.outputStatus, output2, procedure, path70, options) ?? DEFAULT_SUCCESS_STATUS,
|
|
129385
129491
|
body: this.serializer.serialize(output2)
|
|
129386
129492
|
};
|
|
129387
129493
|
}
|
|
@@ -129435,39 +129541,39 @@ function createRouter() {
|
|
|
129435
129541
|
static: new NullProtoObj2()
|
|
129436
129542
|
};
|
|
129437
129543
|
}
|
|
129438
|
-
function scanFirstGroup(
|
|
129544
|
+
function scanFirstGroup(path70) {
|
|
129439
129545
|
let i10 = 0;
|
|
129440
129546
|
let depth = 0;
|
|
129441
|
-
for (; i10 <
|
|
129442
|
-
const c10 =
|
|
129547
|
+
for (; i10 < path70.length; i10++) {
|
|
129548
|
+
const c10 = path70.charCodeAt(i10);
|
|
129443
129549
|
if (c10 === 92) i10++;
|
|
129444
129550
|
else if (c10 === 40) depth++;
|
|
129445
129551
|
else if (c10 === 41 && depth > 0) depth--;
|
|
129446
129552
|
else if (c10 === 123 && depth === 0) break;
|
|
129447
129553
|
}
|
|
129448
|
-
if (i10 >=
|
|
129554
|
+
if (i10 >= path70.length) return;
|
|
129449
129555
|
let j10 = i10 + 1;
|
|
129450
129556
|
depth = 0;
|
|
129451
|
-
for (; j10 <
|
|
129452
|
-
const c10 =
|
|
129557
|
+
for (; j10 < path70.length; j10++) {
|
|
129558
|
+
const c10 = path70.charCodeAt(j10);
|
|
129453
129559
|
if (c10 === 92) j10++;
|
|
129454
129560
|
else if (c10 === 40) depth++;
|
|
129455
129561
|
else if (c10 === 41 && depth > 0) depth--;
|
|
129456
129562
|
else if (c10 === 125 && depth === 0) break;
|
|
129457
129563
|
}
|
|
129458
|
-
if (j10 >=
|
|
129459
|
-
const mod =
|
|
129564
|
+
if (j10 >= path70.length) return;
|
|
129565
|
+
const mod = path70[j10 + 1];
|
|
129460
129566
|
const hasMod = mod === "?" || mod === "+" || mod === "*";
|
|
129461
129567
|
return [
|
|
129462
|
-
|
|
129463
|
-
|
|
129464
|
-
|
|
129568
|
+
path70.slice(0, i10),
|
|
129569
|
+
path70.slice(i10 + 1, j10),
|
|
129570
|
+
path70.slice(j10 + (hasMod ? 2 : 1)),
|
|
129465
129571
|
hasMod ? mod : void 0
|
|
129466
129572
|
];
|
|
129467
129573
|
}
|
|
129468
|
-
function expandGroupDelimiters(
|
|
129469
|
-
if (!
|
|
129470
|
-
const group = scanFirstGroup(
|
|
129574
|
+
function expandGroupDelimiters(path70) {
|
|
129575
|
+
if (!path70.includes("{")) return;
|
|
129576
|
+
const group = scanFirstGroup(path70);
|
|
129471
129577
|
if (!group) return;
|
|
129472
129578
|
const [pre2, body, suf, mod] = group;
|
|
129473
129579
|
if (!mod) return [pre2 + body + suf];
|
|
@@ -129537,9 +129643,9 @@ function replaceSegmentWildcards(segment, unnamedStart, toGroupKey = toUnnamedGr
|
|
|
129537
129643
|
}
|
|
129538
129644
|
return [replaced, nextIndex];
|
|
129539
129645
|
}
|
|
129540
|
-
function encodeEscapes(
|
|
129541
|
-
if (!
|
|
129542
|
-
return
|
|
129646
|
+
function encodeEscapes(path70) {
|
|
129647
|
+
if (!path70.includes("\\")) return path70;
|
|
129648
|
+
return path70.replace(/\\([:(){}])/g, (_, c10) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c10)]);
|
|
129543
129649
|
}
|
|
129544
129650
|
function segmentKey(segment) {
|
|
129545
129651
|
if (segment.startsWith("**")) return 2;
|
|
@@ -129568,22 +129674,22 @@ function expandModifiers(segments) {
|
|
|
129568
129674
|
return m10[2] === "+" ? [wc2] : [wc2, without];
|
|
129569
129675
|
}
|
|
129570
129676
|
}
|
|
129571
|
-
function normalizePath(
|
|
129572
|
-
if (!
|
|
129677
|
+
function normalizePath(path70) {
|
|
129678
|
+
if (!path70.includes("/.")) return path70;
|
|
129573
129679
|
const r10 = [];
|
|
129574
|
-
for (const s of
|
|
129680
|
+
for (const s of path70.split("/")) if (s === ".") continue;
|
|
129575
129681
|
else if (s === ".." && r10.length > 1) r10.pop();
|
|
129576
129682
|
else r10.push(s);
|
|
129577
129683
|
return r10.join("/") || "/";
|
|
129578
129684
|
}
|
|
129579
|
-
function splitPath(
|
|
129580
|
-
const s =
|
|
129685
|
+
function splitPath(path70) {
|
|
129686
|
+
const s = path70.split("/");
|
|
129581
129687
|
s.shift();
|
|
129582
129688
|
if (s[s.length - 1] === "") s.pop();
|
|
129583
129689
|
return s;
|
|
129584
129690
|
}
|
|
129585
|
-
function splitRoute(
|
|
129586
|
-
const s = splitPath(
|
|
129691
|
+
function splitRoute(path70) {
|
|
129692
|
+
const s = splitPath(path70);
|
|
129587
129693
|
while (s[s.length - 1] === "") s.pop();
|
|
129588
129694
|
return s;
|
|
129589
129695
|
}
|
|
@@ -129599,16 +129705,16 @@ function getMatchParams(segments, paramsMap) {
|
|
|
129599
129705
|
}
|
|
129600
129706
|
return params;
|
|
129601
129707
|
}
|
|
129602
|
-
function addRoute(ctx, method = "",
|
|
129708
|
+
function addRoute(ctx, method = "", path70, data) {
|
|
129603
129709
|
method = method.toUpperCase();
|
|
129604
|
-
if (
|
|
129605
|
-
const groupExpanded = expandGroupDelimiters(
|
|
129710
|
+
if (path70.charCodeAt(0) !== 47) path70 = `/${path70}`;
|
|
129711
|
+
const groupExpanded = expandGroupDelimiters(path70);
|
|
129606
129712
|
if (groupExpanded) {
|
|
129607
129713
|
for (const expandedPath of groupExpanded) addRoute(ctx, method, expandedPath, data);
|
|
129608
129714
|
return;
|
|
129609
129715
|
}
|
|
129610
|
-
|
|
129611
|
-
const segments = splitRoute(
|
|
129716
|
+
path70 = encodeEscapes(path70);
|
|
129717
|
+
const segments = splitRoute(path70);
|
|
129612
129718
|
const expanded = expandModifiers(segments);
|
|
129613
129719
|
if (expanded) {
|
|
129614
129720
|
for (const p of expanded) addRoute(ctx, method, p, data);
|
|
@@ -129699,15 +129805,15 @@ function getParamRegexp(segment, unnamedStart = 0) {
|
|
|
129699
129805
|
const regex2 = _s2.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_, id2, p) => `(?<${toGroupName(id2)}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i2++)}>`).replace(/\uFFFE(.)/g, (_, c10) => /[.*+?^${}()|[\]\\]/.test(c10) ? `\\${c10}` : c10);
|
|
129700
129806
|
return [new RegExp(`^${regex2}$`), _i2];
|
|
129701
129807
|
}
|
|
129702
|
-
function findRoute(ctx, method = "",
|
|
129703
|
-
if (opts?.normalize)
|
|
129704
|
-
if (
|
|
129705
|
-
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];
|
|
129706
129812
|
if (staticNode && staticNode.methods) {
|
|
129707
129813
|
const staticMatch = staticNode.methods[method] || staticNode.methods[""];
|
|
129708
129814
|
if (staticMatch !== void 0) return staticMatch[0];
|
|
129709
129815
|
}
|
|
129710
|
-
const segments = splitPath(
|
|
129816
|
+
const segments = splitPath(path70);
|
|
129711
129817
|
const match = _lookupTree(ctx.root, method, segments, 0);
|
|
129712
129818
|
if (match === void 0) return;
|
|
129713
129819
|
if (opts?.params === false) return match;
|
|
@@ -129907,7 +130013,7 @@ var OpenAPIMatcher = class {
|
|
|
129907
130013
|
this.rootRouter = router;
|
|
129908
130014
|
this.index(router);
|
|
129909
130015
|
}
|
|
129910
|
-
index(router,
|
|
130016
|
+
index(router, path70 = []) {
|
|
129911
130017
|
const lazyResults = walkProcedureContractsSync(router, (contract, path210) => {
|
|
129912
130018
|
if (!value(this.filter, contract, path210)) {
|
|
129913
130019
|
return;
|
|
@@ -129922,7 +130028,7 @@ var OpenAPIMatcher = class {
|
|
|
129922
130028
|
contract,
|
|
129923
130029
|
procedure: contract instanceof Procedure ? contract : void 0
|
|
129924
130030
|
});
|
|
129925
|
-
},
|
|
130031
|
+
}, path70);
|
|
129926
130032
|
for (const result of lazyResults) {
|
|
129927
130033
|
const prefix = getOpenAPIMeta(result.router)?.prefix;
|
|
129928
130034
|
this.pendingLazyRouters.add({
|
|
@@ -130009,20 +130115,20 @@ var OpenAPIMatcher = class {
|
|
|
130009
130115
|
return entry.procedure;
|
|
130010
130116
|
}
|
|
130011
130117
|
};
|
|
130012
|
-
function toRou3Pattern(
|
|
130013
|
-
const params = getDynamicPathParams(
|
|
130118
|
+
function toRou3Pattern(path70) {
|
|
130119
|
+
const params = getDynamicPathParams(path70);
|
|
130014
130120
|
if (!params?.length) {
|
|
130015
|
-
return
|
|
130121
|
+
return path70;
|
|
130016
130122
|
}
|
|
130017
130123
|
for (let i10 = params.length - 1; i10 >= 0; i10--) {
|
|
130018
130124
|
const param = params[i10];
|
|
130019
130125
|
const pattern = param.allowsSlash ? `**:${param.parameterName}` : `:${param.parameterName}`;
|
|
130020
|
-
|
|
130126
|
+
path70 = path70.slice(0, param.startIndex) + pattern + path70.slice(param.startIndex + param.segment.length);
|
|
130021
130127
|
}
|
|
130022
|
-
return
|
|
130128
|
+
return path70;
|
|
130023
130129
|
}
|
|
130024
|
-
function toRou3PrefixMatcher(
|
|
130025
|
-
const pattern = toRou3Pattern(
|
|
130130
|
+
function toRou3PrefixMatcher(path70) {
|
|
130131
|
+
const pattern = toRou3Pattern(path70);
|
|
130026
130132
|
return routeToRegExp(pattern === "/" ? "/**" : `${pattern}/**`);
|
|
130027
130133
|
}
|
|
130028
130134
|
function decodeParams(params) {
|
|
@@ -130101,7 +130207,7 @@ var OpenAPIHandlerCodecCore = class {
|
|
|
130101
130207
|
/**
|
|
130102
130208
|
* @throws {TypeError} If `outputStructure` is "detailed" and the output doesn't match the expected structure.
|
|
130103
130209
|
*/
|
|
130104
|
-
encodeOutput(output2, procedure,
|
|
130210
|
+
encodeOutput(output2, procedure, path70) {
|
|
130105
130211
|
const meta3 = getOpenAPIMeta(procedure);
|
|
130106
130212
|
const successStatus = meta3?.successStatus ?? DEFAULT_SUCCESS_STATUS;
|
|
130107
130213
|
const outputStructure = meta3?.outputStructure ?? DEFAULT_OPENAPI_OUTPUT_STRUCTURE;
|
|
@@ -130114,7 +130220,7 @@ var OpenAPIHandlerCodecCore = class {
|
|
|
130114
130220
|
}
|
|
130115
130221
|
if (!isValidDetailedOutput(output2)) {
|
|
130116
130222
|
throw new TypeError(`
|
|
130117
|
-
Invalid "detailed" output structure returned by procedure (${
|
|
130223
|
+
Invalid "detailed" output structure returned by procedure (${path70.join(".")}):
|
|
130118
130224
|
\u2022 Expected an object with optional properties:
|
|
130119
130225
|
- status (number <400)
|
|
130120
130226
|
- headers (object)
|
|
@@ -130682,7 +130788,7 @@ function profileValue(name, paths) {
|
|
|
130682
130788
|
function createConfigApiRouter(deps) {
|
|
130683
130789
|
const authed = doorApiAuth(deps.expectedToken);
|
|
130684
130790
|
const { paths } = deps;
|
|
130685
|
-
const route = (
|
|
130791
|
+
const route = (path70, summary) => authed.meta(openapi({ method: "POST", path: path70, summary, tags: [CONFIG_API_TAG] }));
|
|
130686
130792
|
return {
|
|
130687
130793
|
config: {
|
|
130688
130794
|
identity: {
|
|
@@ -131041,7 +131147,7 @@ function createLifecycleApiRouter(deps) {
|
|
|
131041
131147
|
init_cliError();
|
|
131042
131148
|
|
|
131043
131149
|
// src/frontdoor/launchSchemas.ts
|
|
131044
|
-
var
|
|
131150
|
+
var import_node_path49 = __toESM(require("node:path"), 1);
|
|
131045
131151
|
init_zod();
|
|
131046
131152
|
init_statusline();
|
|
131047
131153
|
init_claudeVersion();
|
|
@@ -131052,7 +131158,7 @@ var LaunchResolveInputSchema = external_exports.strictObject({
|
|
|
131052
131158
|
argv: external_exports.readonly(external_exports.array(external_exports.string())).optional(),
|
|
131053
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. */
|
|
131054
131160
|
env: external_exports.record(external_exports.string(), external_exports.string()).optional()
|
|
131055
|
-
}).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" });
|
|
131056
131162
|
var LaunchPoolDecisionSchema = external_exports.strictObject({
|
|
131057
131163
|
name: external_exports.string(),
|
|
131058
131164
|
reasons: external_exports.readonly(external_exports.array(external_exports.string())),
|
|
@@ -132103,6 +132209,7 @@ async function serveRouted(incoming, deps) {
|
|
|
132103
132209
|
|
|
132104
132210
|
// src/frontdoor/providerRoute.ts
|
|
132105
132211
|
init_load();
|
|
132212
|
+
init_names();
|
|
132106
132213
|
init_schema();
|
|
132107
132214
|
init_translate2();
|
|
132108
132215
|
init_translate();
|
|
@@ -132709,8 +132816,8 @@ function createCodexRouteMount(ports, upstreamBase, provider) {
|
|
|
132709
132816
|
request7.body.resume();
|
|
132710
132817
|
return;
|
|
132711
132818
|
}
|
|
132712
|
-
const
|
|
132713
|
-
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 };
|
|
132714
132821
|
const routed = await route(translated);
|
|
132715
132822
|
if (request7.signal.aborted) {
|
|
132716
132823
|
return;
|
|
@@ -133331,8 +133438,8 @@ function createAntigravityRouteMount(ports, upstreamBase, provider) {
|
|
|
133331
133438
|
request7.body.resume();
|
|
133332
133439
|
return;
|
|
133333
133440
|
}
|
|
133334
|
-
const
|
|
133335
|
-
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 };
|
|
133336
133443
|
const routed = await route(translated);
|
|
133337
133444
|
if (request7.signal.aborted) {
|
|
133338
133445
|
return;
|
|
@@ -133373,7 +133480,7 @@ function createPassthroughRoute(name, target) {
|
|
|
133373
133480
|
headroomUpstream: target.headroomUpstream,
|
|
133374
133481
|
serve: async (request7, response) => {
|
|
133375
133482
|
const incoming = new URL(request7.url, "http://127.0.0.1");
|
|
133376
|
-
const
|
|
133483
|
+
const path70 = target.stripPrefix !== void 0 && incoming.pathname.startsWith(target.stripPrefix) ? incoming.pathname.slice(target.stripPrefix.length) : incoming.pathname;
|
|
133377
133484
|
const headers = forwardableHeaders(request7.headers);
|
|
133378
133485
|
delete headers.host;
|
|
133379
133486
|
await new Promise((resolve2) => {
|
|
@@ -133381,7 +133488,7 @@ function createPassthroughRoute(name, target) {
|
|
|
133381
133488
|
host: base.hostname,
|
|
133382
133489
|
port: base.port === "" ? void 0 : Number(base.port),
|
|
133383
133490
|
method: request7.method,
|
|
133384
|
-
path: `${basePath}${
|
|
133491
|
+
path: `${basePath}${path70}${incoming.search}`,
|
|
133385
133492
|
headers,
|
|
133386
133493
|
agent
|
|
133387
133494
|
};
|
|
@@ -133553,13 +133660,13 @@ async function scanRequestHead(request7, wholeBody = false) {
|
|
|
133553
133660
|
}
|
|
133554
133661
|
|
|
133555
133662
|
// src/frontdoor/providerRoute.ts
|
|
133556
|
-
var isRcSelfHostPath = (
|
|
133663
|
+
var isRcSelfHostPath = (path70) => path70 === "/v1/code/sessions" || path70.startsWith("/v1/code/sessions/") || path70 === "/v1/sessions" || path70.startsWith("/v1/sessions/");
|
|
133557
133664
|
function scopeSessionProviderPath(request7) {
|
|
133558
133665
|
if (request7.session.provider === void 0) {
|
|
133559
133666
|
return request7;
|
|
133560
133667
|
}
|
|
133561
|
-
const
|
|
133562
|
-
if (!
|
|
133668
|
+
const path70 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
133669
|
+
if (!path70.startsWith("/v1/") || isRcSelfHostPath(path70)) {
|
|
133563
133670
|
return request7;
|
|
133564
133671
|
}
|
|
133565
133672
|
return { ...request7, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(request7.session.provider)}${request7.url}` };
|
|
@@ -133619,7 +133726,7 @@ function resolveAccountTarget(model, models) {
|
|
|
133619
133726
|
const ref = model.slice("acct:".length);
|
|
133620
133727
|
const [identity, ...rest] = ref.split("/");
|
|
133621
133728
|
const named = rest.join("/");
|
|
133622
|
-
return identity === void 0 || named === "" ? void 0 : { identity, model: named };
|
|
133729
|
+
return identity === void 0 || !isFileName(identity) || named === "" ? void 0 : { identity, model: named };
|
|
133623
133730
|
}
|
|
133624
133731
|
const virtual = models?.virtual?.[model];
|
|
133625
133732
|
const first = virtual?.members.find((member) => member.startsWith("acct:"));
|
|
@@ -133683,19 +133790,22 @@ function createProviderRouteResolver(deps) {
|
|
|
133683
133790
|
return route;
|
|
133684
133791
|
};
|
|
133685
133792
|
const resolve2 = (request7) => {
|
|
133686
|
-
const
|
|
133687
|
-
const scoped = parseProviderPath(
|
|
133793
|
+
const path70 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
133794
|
+
const scoped = parseProviderPath(path70);
|
|
133688
133795
|
if (scoped === void 0) {
|
|
133689
|
-
if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(
|
|
133796
|
+
if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(path70)) {
|
|
133690
133797
|
return { ok: true, route: deps.rcSelfHostRoute };
|
|
133691
133798
|
}
|
|
133692
|
-
return
|
|
133799
|
+
return path70.startsWith("/v1/") ? { ok: true, route: oauthRoute } : { ok: false, status: HTTP_STATUS.notFound, message: `no such endpoint: ${path70}` };
|
|
133693
133800
|
}
|
|
133694
133801
|
const { provider } = scoped;
|
|
133695
133802
|
let definition;
|
|
133696
133803
|
try {
|
|
133697
133804
|
definition = loadProvider(deps.providersDir, provider, deps.fs);
|
|
133698
133805
|
} catch (error63) {
|
|
133806
|
+
if (error63 instanceof InvalidProviderNameError) {
|
|
133807
|
+
return { ok: false, status: HTTP_STATUS.notFound, message: `no provider named ${JSON.stringify(provider)}` };
|
|
133808
|
+
}
|
|
133699
133809
|
if (error63 instanceof ConfigValidationError || error63 instanceof LegacyProviderFileError) {
|
|
133700
133810
|
return { ok: false, status: HTTP_STATUS.internalServerError, message: `provider ${provider} is invalid: ${error63 instanceof Error ? error63.message : String(error63)}` };
|
|
133701
133811
|
}
|
|
@@ -133781,8 +133891,8 @@ function createProviderRouteResolver(deps) {
|
|
|
133781
133891
|
let modelChoice;
|
|
133782
133892
|
const visited = /* @__PURE__ */ new Set();
|
|
133783
133893
|
for (; ; ) {
|
|
133784
|
-
const
|
|
133785
|
-
const scoped = parseProviderPath(
|
|
133894
|
+
const path70 = new URL(current.url, "http://127.0.0.1").pathname;
|
|
133895
|
+
const scoped = parseProviderPath(path70);
|
|
133786
133896
|
const providerName = scoped?.provider ?? current.session.provider;
|
|
133787
133897
|
if (providerName !== void 0 && visited.has(providerName)) {
|
|
133788
133898
|
return { ok: false, status: HTTP_STATUS.internalServerError, message: `provider routing cycle: ${[...visited, providerName].join(" -> ")}` };
|
|
@@ -133797,7 +133907,7 @@ function createProviderRouteResolver(deps) {
|
|
|
133797
133907
|
} catch {
|
|
133798
133908
|
routes = void 0;
|
|
133799
133909
|
}
|
|
133800
|
-
const resolvesNames = !nameResolved && !isRcSelfHostPath(
|
|
133910
|
+
const resolvesNames = !nameResolved && !isRcSelfHostPath(path70);
|
|
133801
133911
|
if (resolvesNames) {
|
|
133802
133912
|
const scan2 = await scanRequestHead(current, true);
|
|
133803
133913
|
if (scan2.replayed === void 0) {
|
|
@@ -133836,7 +133946,7 @@ function createProviderRouteResolver(deps) {
|
|
|
133836
133946
|
}
|
|
133837
133947
|
if (routed.provider !== providerName) {
|
|
133838
133948
|
const scopedPrefix = providerName === void 0 ? void 0 : `${PROVIDER_PATH_PREFIX}${encodeURIComponent(providerName)}`;
|
|
133839
|
-
const rest2 = scopedPrefix !== void 0 &&
|
|
133949
|
+
const rest2 = scopedPrefix !== void 0 && path70.startsWith(scopedPrefix) ? path70.slice(scopedPrefix.length) : path70;
|
|
133840
133950
|
const query2 = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
|
|
133841
133951
|
const carried = replay;
|
|
133842
133952
|
current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(routed.provider)}${rest2}${query2}`, body: carried.body, headers: carried.headers };
|
|
@@ -133890,7 +134000,7 @@ function createProviderRouteResolver(deps) {
|
|
|
133890
134000
|
const headers = Object.fromEntries(Object.entries(replay.headers).filter(([name]) => name.toLowerCase() !== "content-length"));
|
|
133891
134001
|
replay = { ...replay, headers, body: import_node_stream3.Readable.from([Buffer.from(rewritten, "utf8")]) };
|
|
133892
134002
|
}
|
|
133893
|
-
const rest = scoped === void 0 ?
|
|
134003
|
+
const rest = scoped === void 0 ? path70 : path70.slice(`${PROVIDER_PATH_PREFIX}${encodeURIComponent(scoped.provider)}`.length);
|
|
133894
134004
|
const query = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
|
|
133895
134005
|
current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(matched.provider)}${rest}${query}`, body: replay.body, headers: replay.headers };
|
|
133896
134006
|
}
|
|
@@ -133998,7 +134108,7 @@ function createRcLiveUsage(deps) {
|
|
|
133998
134108
|
}
|
|
133999
134109
|
|
|
134000
134110
|
// src/frontdoor/rcSelfHostMint.ts
|
|
134001
|
-
var
|
|
134111
|
+
var import_node_path50 = __toESM(require("node:path"), 1);
|
|
134002
134112
|
init_account();
|
|
134003
134113
|
|
|
134004
134114
|
// src/frontdoor/rcSelfHostLocal.ts
|
|
@@ -134128,7 +134238,7 @@ function readJsonObject(fs30, file2) {
|
|
|
134128
134238
|
return isRecord16(parsed) ? parsed : void 0;
|
|
134129
134239
|
}
|
|
134130
134240
|
function readRcSelfHostRecord(fs30, frontdoorDir) {
|
|
134131
|
-
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));
|
|
134132
134242
|
if (parsed === void 0) {
|
|
134133
134243
|
return void 0;
|
|
134134
134244
|
}
|
|
@@ -134142,11 +134252,11 @@ function mintRcSelfHostCredential(deps) {
|
|
|
134142
134252
|
if (!isIdentityName(deps.identity)) {
|
|
134143
134253
|
throw new Error(`"${deps.identity}" is not a valid identity name.`);
|
|
134144
134254
|
}
|
|
134145
|
-
const identityDir =
|
|
134146
|
-
const credentialsFile =
|
|
134147
|
-
const claudeJsonFile =
|
|
134148
|
-
const recordDir =
|
|
134149
|
-
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);
|
|
134150
134260
|
const previousRecord = readRcSelfHostRecord(deps.fs, deps.frontdoorDir);
|
|
134151
134261
|
const existingCredentials = readJsonObject(deps.fs, credentialsFile);
|
|
134152
134262
|
const existingOauth = isRecord16(existingCredentials?.claudeAiOauth) ? existingCredentials.claudeAiOauth : void 0;
|
|
@@ -134162,7 +134272,7 @@ function mintRcSelfHostCredential(deps) {
|
|
|
134162
134272
|
const organizationUuid = deps.newUuid();
|
|
134163
134273
|
const accountUuid = deps.newUuid();
|
|
134164
134274
|
const mintedAt = new Date(deps.now()).toISOString();
|
|
134165
|
-
deps.fs.mkdirPrivate(
|
|
134275
|
+
deps.fs.mkdirPrivate(import_node_path50.default.dirname(credentialsFile));
|
|
134166
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)}
|
|
134167
134277
|
`);
|
|
134168
134278
|
const claudeJson = readJsonObject(deps.fs, claudeJsonFile) ?? {};
|
|
@@ -134549,7 +134659,7 @@ function registerRcCommand(frontdoor, paths) {
|
|
|
134549
134659
|
}
|
|
134550
134660
|
|
|
134551
134661
|
// src/frontdoor/rcCredentialStore.ts
|
|
134552
|
-
var
|
|
134662
|
+
var import_node_path51 = __toESM(require("node:path"), 1);
|
|
134553
134663
|
function isSafeSessionId(sessionId) {
|
|
134554
134664
|
return /^[A-Za-z0-9_-]+$/.test(sessionId);
|
|
134555
134665
|
}
|
|
@@ -134575,7 +134685,7 @@ function sequenceNumOfJson(value2) {
|
|
|
134575
134685
|
}
|
|
134576
134686
|
function createRcCredentialStore(fs30, dir) {
|
|
134577
134687
|
fs30.mkdirPrivate(dir);
|
|
134578
|
-
const fileFor = (sessionId) =>
|
|
134688
|
+
const fileFor = (sessionId) => import_node_path51.default.join(dir, `${sessionId}.json`);
|
|
134579
134689
|
const readParsed = (sessionId) => {
|
|
134580
134690
|
const raw = fs30.readFileUtf8(fileFor(sessionId));
|
|
134581
134691
|
if (raw === void 0) {
|
|
@@ -137230,7 +137340,7 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, retire, trackTun
|
|
|
137230
137340
|
log
|
|
137231
137341
|
});
|
|
137232
137342
|
const canonicalProvider = createProviderCanonicaliser({
|
|
137233
|
-
defined: (name) => realFarmFs.lstat(
|
|
137343
|
+
defined: (name) => providerFileDefined((file2) => realFarmFs.lstat(file2), paths.providersDir, name),
|
|
137234
137344
|
aliases: () => loadProviderAliases(paths.providerAliasesFile, realFsPort),
|
|
137235
137345
|
log
|
|
137236
137346
|
});
|
|
@@ -137378,7 +137488,7 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, retire, trackTun
|
|
|
137378
137488
|
const leafFor = createLeafCache(loadCa(), () => /* @__PURE__ */ new Date());
|
|
137379
137489
|
const capture = captureFromEnv(process.env, paths.logsDir);
|
|
137380
137490
|
if (capture !== void 0) {
|
|
137381
|
-
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")}`);
|
|
137382
137492
|
}
|
|
137383
137493
|
if (rcSelfHostSurface !== void 0) {
|
|
137384
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");
|
|
@@ -137466,7 +137576,7 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, retire, trackTun
|
|
|
137466
137576
|
cooldownStepMs: DOOR_STALL_BOUND_MS,
|
|
137467
137577
|
cooldownCapMs: DOOR_RESPAWN_COOLDOWN_CAP_MS,
|
|
137468
137578
|
startLockFile: paths.frontdoorLockFile,
|
|
137469
|
-
...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 } } : {}
|
|
137470
137580
|
}),
|
|
137471
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.
|
|
137472
137582
|
observeLaunchRegistry: createLaunchEventPublisher(doorEvents, () => Date.now()).observe,
|
|
@@ -137563,7 +137673,7 @@ function registerFrontDoorCommand(program2, deps) {
|
|
|
137563
137673
|
// src/statusline/commands.ts
|
|
137564
137674
|
var import_node_child_process8 = require("node:child_process");
|
|
137565
137675
|
var import_node_os13 = __toESM(require("node:os"), 1);
|
|
137566
|
-
var
|
|
137676
|
+
var import_node_path60 = __toESM(require("node:path"), 1);
|
|
137567
137677
|
init_commandDeps();
|
|
137568
137678
|
init_statusline();
|
|
137569
137679
|
init_providersStore();
|
|
@@ -137572,13 +137682,13 @@ init_account();
|
|
|
137572
137682
|
init_read();
|
|
137573
137683
|
|
|
137574
137684
|
// src/statusline/client.ts
|
|
137575
|
-
var
|
|
137685
|
+
var import_node_path53 = __toESM(require("node:path"), 1);
|
|
137576
137686
|
function isAntigravityPayload(payload) {
|
|
137577
137687
|
return typeof payload === "object" && payload !== null && "product" in payload && payload.product === "antigravity";
|
|
137578
137688
|
}
|
|
137579
137689
|
var ANTIGRAVITY_SETTINGS_SEGMENTS = [".gemini", "antigravity-cli", "settings.json"];
|
|
137580
137690
|
function antigravityStacksWithDefault(fs30, homeDir) {
|
|
137581
|
-
const raw = fs30.readFileUtf8(
|
|
137691
|
+
const raw = fs30.readFileUtf8(import_node_path53.default.join(homeDir, ...ANTIGRAVITY_SETTINGS_SEGMENTS));
|
|
137582
137692
|
if (raw === void 0) {
|
|
137583
137693
|
return false;
|
|
137584
137694
|
}
|
|
@@ -138008,7 +138118,7 @@ function viewOf(payload) {
|
|
|
138008
138118
|
init_blockingSpawn();
|
|
138009
138119
|
var import_node_fs22 = __toESM(require("node:fs"), 1);
|
|
138010
138120
|
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
138011
|
-
var
|
|
138121
|
+
var import_node_path54 = __toESM(require("node:path"), 1);
|
|
138012
138122
|
|
|
138013
138123
|
// src/statusline/memoryUse.ts
|
|
138014
138124
|
var BYTES_PER_KIBIBYTE = 1024;
|
|
@@ -138137,9 +138247,9 @@ function realStatuslinePorts(env, stateDirectory) {
|
|
|
138137
138247
|
}
|
|
138138
138248
|
},
|
|
138139
138249
|
writeText: (target, text5) => {
|
|
138140
|
-
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`);
|
|
138141
138251
|
try {
|
|
138142
|
-
import_node_fs22.default.mkdirSync(
|
|
138252
|
+
import_node_fs22.default.mkdirSync(import_node_path54.default.dirname(target), { recursive: true, mode: STATE_DIRECTORY_MODE });
|
|
138143
138253
|
import_node_fs22.default.writeFileSync(temporary, text5, { mode: STATE_FILE_MODE });
|
|
138144
138254
|
import_node_fs22.default.renameSync(temporary, target);
|
|
138145
138255
|
} catch {
|
|
@@ -138394,7 +138504,7 @@ function effortSegment({ payload, settings: settings2 }) {
|
|
|
138394
138504
|
}
|
|
138395
138505
|
|
|
138396
138506
|
// src/statusline/dailyLedger.ts
|
|
138397
|
-
var
|
|
138507
|
+
var import_node_path55 = __toESM(require("node:path"), 1);
|
|
138398
138508
|
init_zod();
|
|
138399
138509
|
init_schema2();
|
|
138400
138510
|
var DAILY_LEDGER_DIRECTORY = "daily-cost";
|
|
@@ -138438,19 +138548,19 @@ function advance(existing, carried, cost, nowMs) {
|
|
|
138438
138548
|
return { entry: existing, changed: false };
|
|
138439
138549
|
}
|
|
138440
138550
|
function recordDailySpend(ports, nowMs, sessionId, cost) {
|
|
138441
|
-
const root =
|
|
138551
|
+
const root = import_node_path55.default.join(ports.stateDirectory, DAILY_LEDGER_DIRECTORY);
|
|
138442
138552
|
const today = localDay(nowMs);
|
|
138443
138553
|
const days = (ports.listDirectory(root) ?? []).filter((name) => DAY_NAME.test(name));
|
|
138444
138554
|
const previous = days.filter((day) => day < today).sort().at(-1);
|
|
138445
138555
|
for (const day of days) {
|
|
138446
138556
|
if (day < today && day !== previous) {
|
|
138447
|
-
ports.removePath(
|
|
138557
|
+
ports.removePath(import_node_path55.default.join(root, day));
|
|
138448
138558
|
}
|
|
138449
138559
|
}
|
|
138450
|
-
const todayDirectory =
|
|
138560
|
+
const todayDirectory = import_node_path55.default.join(root, today);
|
|
138451
138561
|
if (sessionId !== void 0 && cost !== void 0 && CLIENT_SESSION_ID_PATTERN.test(sessionId)) {
|
|
138452
|
-
const file2 =
|
|
138453
|
-
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`)));
|
|
138454
138564
|
const next = advance(parseEntry3(ports.readText(file2)), carried, cost, nowMs);
|
|
138455
138565
|
if (next?.changed === true) {
|
|
138456
138566
|
ports.writeText(file2, `${JSON.stringify(next.entry)}
|
|
@@ -138458,7 +138568,7 @@ function recordDailySpend(ports, nowMs, sessionId, cost) {
|
|
|
138458
138568
|
}
|
|
138459
138569
|
}
|
|
138460
138570
|
const entries = (ports.listDirectory(todayDirectory) ?? []).filter((name) => ENTRY_FILE.test(name)).flatMap((name) => {
|
|
138461
|
-
const entry = parseEntry3(ports.readText(
|
|
138571
|
+
const entry = parseEntry3(ports.readText(import_node_path55.default.join(todayDirectory, name)));
|
|
138462
138572
|
return entry === void 0 ? [] : [entry];
|
|
138463
138573
|
});
|
|
138464
138574
|
return entries.length === 0 ? void 0 : entries.reduce((sum2, entry) => sum2 + (entry.totalUsd - entry.baselineUsd), 0);
|
|
@@ -138722,7 +138832,7 @@ function modelSegment(context) {
|
|
|
138722
138832
|
}
|
|
138723
138833
|
|
|
138724
138834
|
// src/statusline/elements/header/outputStyle.ts
|
|
138725
|
-
var
|
|
138835
|
+
var import_node_path56 = __toESM(require("node:path"), 1);
|
|
138726
138836
|
init_zod();
|
|
138727
138837
|
var SettingsFileSchema = external_exports.looseObject({ outputStyle: external_exports.string().optional().catch(void 0) });
|
|
138728
138838
|
function outputStyleIn(file2, readText2) {
|
|
@@ -138742,12 +138852,12 @@ function outputStyleIn(file2, readText2) {
|
|
|
138742
138852
|
}
|
|
138743
138853
|
function outputStyleSegment({ payload, ports }) {
|
|
138744
138854
|
const pinned = ports.env.CLAUDE_CONFIG_DIR;
|
|
138745
|
-
const configDirectory = pinned === void 0 || pinned === "" ?
|
|
138855
|
+
const configDirectory = pinned === void 0 || pinned === "" ? import_node_path56.default.join(ports.homeDirectory, ".claude") : pinned;
|
|
138746
138856
|
const projectDirectory = payload.cwd ?? payload.workspace?.current_dir;
|
|
138747
138857
|
const files = [
|
|
138748
|
-
|
|
138749
|
-
|
|
138750
|
-
...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")]
|
|
138751
138861
|
];
|
|
138752
138862
|
const style = files.map((file2) => outputStyleIn(file2, ports.readText)).findLast((name) => name !== void 0);
|
|
138753
138863
|
return style === void 0 ? void 0 : `style: ${style}`;
|
|
@@ -138837,13 +138947,13 @@ init_zod();
|
|
|
138837
138947
|
|
|
138838
138948
|
// src/statusline/cacheFile.ts
|
|
138839
138949
|
var import_node_crypto26 = require("node:crypto");
|
|
138840
|
-
var
|
|
138950
|
+
var import_node_path57 = __toESM(require("node:path"), 1);
|
|
138841
138951
|
var SESSION_CACHE_DIRECTORY = "session";
|
|
138842
138952
|
function cacheDirectory(ports) {
|
|
138843
|
-
return
|
|
138953
|
+
return import_node_path57.default.join(ports.stateDirectory, SESSION_CACHE_DIRECTORY);
|
|
138844
138954
|
}
|
|
138845
138955
|
function cacheFileFor(ports, kind, transcriptPath) {
|
|
138846
|
-
return
|
|
138956
|
+
return import_node_path57.default.join(cacheDirectory(ports), `${kind}-${(0, import_node_crypto26.createHash)("sha256").update(transcriptPath).digest("hex")}.json`);
|
|
138847
138957
|
}
|
|
138848
138958
|
var RETENTION_DAYS = 30;
|
|
138849
138959
|
var HOURS_PER_DAY10 = 24;
|
|
@@ -138858,7 +138968,7 @@ function pruneCache(ports, cutoffMs) {
|
|
|
138858
138968
|
return;
|
|
138859
138969
|
}
|
|
138860
138970
|
for (const name of names) {
|
|
138861
|
-
const file2 =
|
|
138971
|
+
const file2 = import_node_path57.default.join(directory, name);
|
|
138862
138972
|
const modifiedAtMs = ports.modifiedAtMs(file2);
|
|
138863
138973
|
if (modifiedAtMs !== void 0 && modifiedAtMs < cutoffMs) {
|
|
138864
138974
|
ports.removePath(file2);
|
|
@@ -139013,15 +139123,15 @@ function parseNumstat(output2) {
|
|
|
139013
139123
|
if (addedText === void 0 || deletedText === void 0 || pathText === void 0) {
|
|
139014
139124
|
continue;
|
|
139015
139125
|
}
|
|
139016
|
-
const
|
|
139126
|
+
const path70 = pathText === "" ? fields[index + 2] : pathText;
|
|
139017
139127
|
if (pathText === "") {
|
|
139018
139128
|
index += 2;
|
|
139019
139129
|
}
|
|
139020
139130
|
const lines = { added: Number(addedText), deleted: Number(deletedText) };
|
|
139021
|
-
if (
|
|
139131
|
+
if (path70 !== void 0 && Number.isInteger(lines.added) && Number.isInteger(lines.deleted)) {
|
|
139022
139132
|
added += lines.added;
|
|
139023
139133
|
deleted += lines.deleted;
|
|
139024
|
-
byPath.set(
|
|
139134
|
+
byPath.set(path70, lines);
|
|
139025
139135
|
}
|
|
139026
139136
|
}
|
|
139027
139137
|
return { total: { added, deleted }, byPath };
|
|
@@ -139076,7 +139186,7 @@ function readGitStatus(ports, cwd, query) {
|
|
|
139076
139186
|
}
|
|
139077
139187
|
|
|
139078
139188
|
// src/statusline/vcs/jj.ts
|
|
139079
|
-
var
|
|
139189
|
+
var import_node_path58 = __toESM(require("node:path"), 1);
|
|
139080
139190
|
var JJ2 = "jj";
|
|
139081
139191
|
var MAX_WALK_DEPTH = 64;
|
|
139082
139192
|
var MAX_LABEL_CODE_POINTS = 64;
|
|
@@ -139089,13 +139199,13 @@ function isJjRepository(ports, cwd) {
|
|
|
139089
139199
|
return false;
|
|
139090
139200
|
}
|
|
139091
139201
|
for (let depth = 0; depth < MAX_WALK_DEPTH; depth += 1) {
|
|
139092
|
-
if (ports.entryKind(
|
|
139202
|
+
if (ports.entryKind(import_node_path58.default.join(directory, ".jj")) === "directory") {
|
|
139093
139203
|
return true;
|
|
139094
139204
|
}
|
|
139095
|
-
if (ports.entryKind(
|
|
139205
|
+
if (ports.entryKind(import_node_path58.default.join(directory, ".git")) !== void 0) {
|
|
139096
139206
|
return false;
|
|
139097
139207
|
}
|
|
139098
|
-
const parent =
|
|
139208
|
+
const parent = import_node_path58.default.dirname(directory);
|
|
139099
139209
|
if (parent === directory) {
|
|
139100
139210
|
return false;
|
|
139101
139211
|
}
|
|
@@ -139371,7 +139481,7 @@ function gitFilesRow(context) {
|
|
|
139371
139481
|
}
|
|
139372
139482
|
|
|
139373
139483
|
// src/statusline/configCounts.ts
|
|
139374
|
-
var
|
|
139484
|
+
var import_node_path59 = __toESM(require("node:path"), 1);
|
|
139375
139485
|
init_zod();
|
|
139376
139486
|
var nameList = external_exports.array(external_exports.unknown()).catch([]).transform((items) => items.filter((item) => typeof item === "string"));
|
|
139377
139487
|
var ConfigFileSchema = external_exports.looseObject({
|
|
@@ -139445,7 +139555,7 @@ function countRules(ports, root) {
|
|
|
139445
139555
|
break;
|
|
139446
139556
|
}
|
|
139447
139557
|
entries += 1;
|
|
139448
|
-
const entry =
|
|
139558
|
+
const entry = import_node_path59.default.join(real, name);
|
|
139449
139559
|
const kind = followedKind(ports, entry);
|
|
139450
139560
|
if (kind === "directory") {
|
|
139451
139561
|
count2 += walk3(entry);
|
|
@@ -139462,33 +139572,33 @@ function countRules(ports, root) {
|
|
|
139462
139572
|
return walk3(root);
|
|
139463
139573
|
}
|
|
139464
139574
|
function sameLocation(ports, left, right) {
|
|
139465
|
-
return (ports.realPath(left) ??
|
|
139575
|
+
return (ports.realPath(left) ?? import_node_path59.default.resolve(left)) === (ports.realPath(right) ?? import_node_path59.default.resolve(right));
|
|
139466
139576
|
}
|
|
139467
139577
|
function configDirectoryOf(ports) {
|
|
139468
139578
|
const pinned = ports.env.CLAUDE_CONFIG_DIR;
|
|
139469
|
-
return pinned === void 0 || pinned === "" ?
|
|
139579
|
+
return pinned === void 0 || pinned === "" ? import_node_path59.default.join(ports.homeDirectory, ".claude") : pinned;
|
|
139470
139580
|
}
|
|
139471
139581
|
function countConfiguration(ports, projectDirectory) {
|
|
139472
139582
|
const userDirectory = configDirectoryOf(ports);
|
|
139473
|
-
const userSettings = readConfigFile(ports,
|
|
139474
|
-
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");
|
|
139475
139585
|
const global2 = readConfigFile(ports, globalFile);
|
|
139476
139586
|
const userServers = /* @__PURE__ */ new Set([...namesOf(userSettings), ...namesOf(global2)]);
|
|
139477
139587
|
removeNames(userServers, global2?.disabledMcpServers);
|
|
139478
139588
|
const projectServers = /* @__PURE__ */ new Set();
|
|
139479
|
-
let claudeMd = isFile(ports,
|
|
139480
|
-
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"));
|
|
139481
139591
|
let hookEvents = hookEventsOf(userSettings);
|
|
139482
139592
|
if (projectDirectory !== void 0) {
|
|
139483
|
-
const projectClaude =
|
|
139593
|
+
const projectClaude = import_node_path59.default.join(projectDirectory, ".claude");
|
|
139484
139594
|
const projectIsUser = sameLocation(ports, projectClaude, userDirectory);
|
|
139485
|
-
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")]];
|
|
139486
139596
|
claudeMd += claudeMdFiles.filter((file2) => isFile(ports, file2)).length;
|
|
139487
|
-
const mcpJson = namesOf(readConfigFile(ports,
|
|
139597
|
+
const mcpJson = namesOf(readConfigFile(ports, import_node_path59.default.join(projectDirectory, ".mcp.json")));
|
|
139488
139598
|
if (!projectIsUser) {
|
|
139489
|
-
rules += countRules(ports,
|
|
139490
|
-
const settings2 = readConfigFile(ports,
|
|
139491
|
-
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"));
|
|
139492
139602
|
hookEvents += hookEventsOf(settings2) + hookEventsOf(local);
|
|
139493
139603
|
for (const name of [...namesOf(settings2), ...namesOf(local)]) {
|
|
139494
139604
|
projectServers.add(name);
|
|
@@ -140374,7 +140484,7 @@ function registerStatuslineCommand(program2, deps) {
|
|
|
140374
140484
|
} else {
|
|
140375
140485
|
const configDir = process.env.CLAUDE_CONFIG_DIR;
|
|
140376
140486
|
try {
|
|
140377
|
-
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"));
|
|
140378
140488
|
} catch {
|
|
140379
140489
|
account = void 0;
|
|
140380
140490
|
}
|
|
@@ -142475,8 +142585,8 @@ function getErrorMap2() {
|
|
|
142475
142585
|
|
|
142476
142586
|
// node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/helpers/parseUtil.js
|
|
142477
142587
|
var makeIssue = (params) => {
|
|
142478
|
-
const { data, path:
|
|
142479
|
-
const fullPath = [...
|
|
142588
|
+
const { data, path: path70, errorMaps, issueData } = params;
|
|
142589
|
+
const fullPath = [...path70, ...issueData.path || []];
|
|
142480
142590
|
const fullIssue = {
|
|
142481
142591
|
...issueData,
|
|
142482
142592
|
path: fullPath
|
|
@@ -142591,11 +142701,11 @@ var errorUtil;
|
|
|
142591
142701
|
|
|
142592
142702
|
// node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/types.js
|
|
142593
142703
|
var ParseInputLazyPath = class {
|
|
142594
|
-
constructor(parent, value2,
|
|
142704
|
+
constructor(parent, value2, path70, key) {
|
|
142595
142705
|
this._cachedPath = [];
|
|
142596
142706
|
this.parent = parent;
|
|
142597
142707
|
this.data = value2;
|
|
142598
|
-
this._path =
|
|
142708
|
+
this._path = path70;
|
|
142599
142709
|
this._key = key;
|
|
142600
142710
|
}
|
|
142601
142711
|
get path() {
|
|
@@ -146158,11 +146268,11 @@ function normalizeObjectSchema(schema) {
|
|
|
146158
146268
|
}
|
|
146159
146269
|
return void 0;
|
|
146160
146270
|
}
|
|
146161
|
-
function getDotPath(
|
|
146162
|
-
if (
|
|
146271
|
+
function getDotPath(path70) {
|
|
146272
|
+
if (path70.length === 0) {
|
|
146163
146273
|
return "object root";
|
|
146164
146274
|
}
|
|
146165
|
-
return
|
|
146275
|
+
return path70.reduce((acc, seg, index) => {
|
|
146166
146276
|
if (index === 0) {
|
|
146167
146277
|
return String(seg);
|
|
146168
146278
|
}
|
|
@@ -150205,7 +150315,7 @@ async function serveMcp(mcp, transport, options = {}) {
|
|
|
150205
150315
|
|
|
150206
150316
|
// src/mcp/permissions.ts
|
|
150207
150317
|
var import_node_fs23 = __toESM(require("node:fs"), 1);
|
|
150208
|
-
var
|
|
150318
|
+
var import_node_path61 = __toESM(require("node:path"), 1);
|
|
150209
150319
|
init_zod();
|
|
150210
150320
|
init_store();
|
|
150211
150321
|
var StoredMcpPermissionsSchema = external_exports.strictObject({
|
|
@@ -150227,10 +150337,10 @@ function effectiveMcpPermissions(flags, stored) {
|
|
|
150227
150337
|
return { writes: flags.writes || stored.writes, remoteControl: flags.remoteControl || stored.remoteControl, history: flags.history || stored.history };
|
|
150228
150338
|
}
|
|
150229
150339
|
function watchMcpPermissions(paths, onChange) {
|
|
150230
|
-
const directory =
|
|
150340
|
+
const directory = import_node_path61.default.dirname(paths.mcpPermissionsFile);
|
|
150231
150341
|
import_node_fs23.default.mkdirSync(directory, { recursive: true });
|
|
150232
150342
|
const watcher = import_node_fs23.default.watch(directory, (_event, filename) => {
|
|
150233
|
-
if (filename === null || filename ===
|
|
150343
|
+
if (filename === null || filename === import_node_path61.default.basename(paths.mcpPermissionsFile)) {
|
|
150234
150344
|
onChange();
|
|
150235
150345
|
}
|
|
150236
150346
|
});
|
|
@@ -150543,16 +150653,16 @@ init_credentialCache();
|
|
|
150543
150653
|
|
|
150544
150654
|
// src/identityToken.ts
|
|
150545
150655
|
var import_node_fs24 = __toESM(require("node:fs"), 1);
|
|
150546
|
-
var
|
|
150656
|
+
var import_node_path62 = __toESM(require("node:path"), 1);
|
|
150547
150657
|
init_cliError();
|
|
150548
150658
|
var TOKEN_FILE_MODE = 384;
|
|
150549
150659
|
var TOKEN_DIR_MODE = 448;
|
|
150550
150660
|
var OAUTH_TOKEN_RE = /^sk-ant-oat\d+-[A-Za-z0-9_-]+$/;
|
|
150551
150661
|
function identityTokenDir(paths) {
|
|
150552
|
-
return
|
|
150662
|
+
return import_node_path62.default.join(paths.root, "credentials");
|
|
150553
150663
|
}
|
|
150554
150664
|
function identityTokenPath(paths, identityName) {
|
|
150555
|
-
return
|
|
150665
|
+
return import_node_path62.default.join(identityTokenDir(paths), `${identityName}.token`);
|
|
150556
150666
|
}
|
|
150557
150667
|
function storeIdentityToken(paths, identityName, raw) {
|
|
150558
150668
|
const token = raw.trim();
|
|
@@ -150563,7 +150673,7 @@ function storeIdentityToken(paths, identityName, raw) {
|
|
|
150563
150673
|
import_node_fs24.default.mkdirSync(dir, { recursive: true, mode: TOKEN_DIR_MODE });
|
|
150564
150674
|
import_node_fs24.default.chmodSync(dir, TOKEN_DIR_MODE);
|
|
150565
150675
|
const target = identityTokenPath(paths, identityName);
|
|
150566
|
-
const temp =
|
|
150676
|
+
const temp = import_node_path62.default.join(dir, `.${identityName}.${String(process.pid)}.tmp`);
|
|
150567
150677
|
import_node_fs24.default.writeFileSync(temp, `${token}
|
|
150568
150678
|
`, { mode: TOKEN_FILE_MODE });
|
|
150569
150679
|
import_node_fs24.default.renameSync(temp, target);
|
|
@@ -150735,7 +150845,7 @@ function registerDoctorCommand(program2, deps) {
|
|
|
150735
150845
|
// src/headroom/commands.ts
|
|
150736
150846
|
var import_node_fs25 = __toESM(require("node:fs"), 1);
|
|
150737
150847
|
var import_node_http5 = __toESM(require("node:http"), 1);
|
|
150738
|
-
var
|
|
150848
|
+
var import_node_path63 = __toESM(require("node:path"), 1);
|
|
150739
150849
|
var import_node_child_process9 = require("node:child_process");
|
|
150740
150850
|
init_commandDeps();
|
|
150741
150851
|
init_configProfilesStore();
|
|
@@ -150926,12 +151036,12 @@ function readInstalledHeadroomCommit() {
|
|
|
150926
151036
|
if (toolDir.status !== 0) {
|
|
150927
151037
|
return void 0;
|
|
150928
151038
|
}
|
|
150929
|
-
const libDir =
|
|
151039
|
+
const libDir = import_node_path63.default.join(toolDir.stdout.trim(), HEADROOM_TOOL_NAME, "lib");
|
|
150930
151040
|
for (const python of realFarmFs.readdir(libDir)) {
|
|
150931
|
-
const sitePackages =
|
|
151041
|
+
const sitePackages = import_node_path63.default.join(libDir, python, "site-packages");
|
|
150932
151042
|
for (const entry of realFarmFs.readdir(sitePackages)) {
|
|
150933
151043
|
if (entry.startsWith("headroom_ai-") && entry.endsWith(".dist-info")) {
|
|
150934
|
-
const directUrl = realFarmFs.readFileUtf8(
|
|
151044
|
+
const directUrl = realFarmFs.readFileUtf8(import_node_path63.default.join(sitePackages, entry, "direct_url.json"));
|
|
150935
151045
|
return directUrl === void 0 ? void 0 : parseInstalledCommit(directUrl);
|
|
150936
151046
|
}
|
|
150937
151047
|
}
|
|
@@ -151187,7 +151297,7 @@ async function refreshCatalogueForReal(paths, name, env) {
|
|
|
151187
151297
|
init_realPorts();
|
|
151188
151298
|
|
|
151189
151299
|
// src/usage/realJobRunner.ts
|
|
151190
|
-
var
|
|
151300
|
+
var import_node_path64 = __toESM(require("node:path"), 1);
|
|
151191
151301
|
init_conditions();
|
|
151192
151302
|
init_identityClaude();
|
|
151193
151303
|
var JOB_LAUNCH_FLAGS = ["--no-headroom", "--no-remote-control", "--track-usage"];
|
|
@@ -151200,7 +151310,7 @@ ${outcome.trimEnd()}
|
|
|
151200
151310
|
}
|
|
151201
151311
|
function createRealJobRunner(params) {
|
|
151202
151312
|
return async (name, identity, job) => {
|
|
151203
|
-
const logFile =
|
|
151313
|
+
const logFile = import_node_path64.default.join(params.paths.jobLogsDir, `${name}.log`);
|
|
151204
151314
|
const append = (outcome) => {
|
|
151205
151315
|
params.fs.mkdirPrivate(params.paths.jobLogsDir);
|
|
151206
151316
|
params.fs.appendFilePrivate(logFile, logEntry(name, identity, params.now(), outcome));
|
|
@@ -151257,7 +151367,7 @@ function registerHeadlessCommands(program2, deps) {
|
|
|
151257
151367
|
}
|
|
151258
151368
|
|
|
151259
151369
|
// src/jobs.ts
|
|
151260
|
-
var
|
|
151370
|
+
var import_node_path65 = __toESM(require("node:path"), 1);
|
|
151261
151371
|
init_commandDeps();
|
|
151262
151372
|
init_cliError();
|
|
151263
151373
|
init_schema();
|
|
@@ -151282,7 +151392,7 @@ function jobOf(options) {
|
|
|
151282
151392
|
target: options.identity === void 0 ? { pool: options.pool ?? "" } : { identity: options.identity },
|
|
151283
151393
|
trigger: options.at === void 0 ? { beforeReset: options.beforeReset ?? "fiveHour", lead: options.lead ?? "" } : { at: options.at },
|
|
151284
151394
|
prompt: options.prompt,
|
|
151285
|
-
cwd:
|
|
151395
|
+
cwd: import_node_path65.default.resolve(options.cwd ?? process.cwd()),
|
|
151286
151396
|
timeout: options.timeout,
|
|
151287
151397
|
...options.model === void 0 ? {} : { model: options.model },
|
|
151288
151398
|
...options.allowedTool === void 0 ? {} : { allowedTools: options.allowedTool }
|
|
@@ -151355,7 +151465,7 @@ function registerJobCommand(program2, deps) {
|
|
|
151355
151465
|
console.log(`Allowed tools: ${entry.allowedTools.join(", ")}`);
|
|
151356
151466
|
}
|
|
151357
151467
|
console.log(`Prompt: ${entry.prompt}`);
|
|
151358
|
-
console.log(`Results: ${
|
|
151468
|
+
console.log(`Results: ${import_node_path65.default.join(paths.jobLogsDir, `${name}.log`)}`);
|
|
151359
151469
|
}),
|
|
151360
151470
|
["agent-shim job show digest"]
|
|
151361
151471
|
);
|
|
@@ -151378,7 +151488,7 @@ function registerJobCommand(program2, deps) {
|
|
|
151378
151488
|
throw new UsageError(`No member of the job's pool can be picked right now.`);
|
|
151379
151489
|
}
|
|
151380
151490
|
await createRealJobRunner({ paths, spawnDaemon: spawnDetachedSupervisor, fs: realFarmFs, now: () => /* @__PURE__ */ new Date() })(name, identity, entry);
|
|
151381
|
-
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`)}.`);
|
|
151382
151492
|
}),
|
|
151383
151493
|
["agent-shim job run digest"]
|
|
151384
151494
|
);
|
|
@@ -151542,7 +151652,7 @@ init_providerAliases();
|
|
|
151542
151652
|
|
|
151543
151653
|
// src/providerRename.ts
|
|
151544
151654
|
var import_node_fs26 = __toESM(require("node:fs"), 1);
|
|
151545
|
-
var
|
|
151655
|
+
var import_node_path66 = __toESM(require("node:path"), 1);
|
|
151546
151656
|
init_schema();
|
|
151547
151657
|
init_store();
|
|
151548
151658
|
init_load();
|
|
@@ -151552,6 +151662,7 @@ init_credentialCache();
|
|
|
151552
151662
|
init_providerCatalogue();
|
|
151553
151663
|
init_schema2();
|
|
151554
151664
|
init_read();
|
|
151665
|
+
init_names();
|
|
151555
151666
|
init_providerAliases();
|
|
151556
151667
|
init_providersStore();
|
|
151557
151668
|
function renameRef(ref, from, to2) {
|
|
@@ -151597,7 +151708,7 @@ function renameProvider(paths, from, to2, ports) {
|
|
|
151597
151708
|
if (from === to2) {
|
|
151598
151709
|
throw new UsageError(`"${from}" is already the provider's name.`);
|
|
151599
151710
|
}
|
|
151600
|
-
|
|
151711
|
+
requireNewProviderName(to2);
|
|
151601
151712
|
if (!providerExists(paths, from)) {
|
|
151602
151713
|
throw new ProviderNotFoundError(from);
|
|
151603
151714
|
}
|
|
@@ -151659,7 +151770,7 @@ function rewriteReferences(paths, from, to2) {
|
|
|
151659
151770
|
const launch = renamedLaunch(profile.launch, from, to2);
|
|
151660
151771
|
const models = profile.models === void 0 ? void 0 : renamedModels(profile.models, from, to2);
|
|
151661
151772
|
if (launch !== void 0 || models !== void 0) {
|
|
151662
|
-
applyPatch(
|
|
151773
|
+
applyPatch(import_node_path66.default.join(paths.configProfilesDir, `${name}.json`), ConfigProfileSchema, { ...launch === void 0 ? {} : { launch }, ...models === void 0 ? {} : { models } });
|
|
151663
151774
|
rewritten.push(`profile ${name}`);
|
|
151664
151775
|
}
|
|
151665
151776
|
}
|
|
@@ -152486,7 +152597,7 @@ function registerSessionCommands(program2, deps) {
|
|
|
152486
152597
|
}
|
|
152487
152598
|
|
|
152488
152599
|
// src/usage/commands.ts
|
|
152489
|
-
var
|
|
152600
|
+
var import_node_path67 = __toESM(require("node:path"), 1);
|
|
152490
152601
|
init_commandDeps();
|
|
152491
152602
|
init_realPorts();
|
|
152492
152603
|
init_account();
|
|
@@ -152625,7 +152736,7 @@ function collectAccounts(fs30, paths, identity, probe) {
|
|
|
152625
152736
|
return names.map((name) => ({
|
|
152626
152737
|
identity: name,
|
|
152627
152738
|
account: readAccountMetadata(fs30, paths.identitiesDir, name),
|
|
152628
|
-
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 }),
|
|
152629
152740
|
usage: readUsageSnapshot(fs30, paths.usageSnapshotsDir, name)
|
|
152630
152741
|
}));
|
|
152631
152742
|
}
|
|
@@ -153032,7 +153143,7 @@ function quotaHitOf(fs30, paths, identity, sessionId, sinceMs, nowMs) {
|
|
|
153032
153143
|
}
|
|
153033
153144
|
|
|
153034
153145
|
// src/supervise/move.ts
|
|
153035
|
-
var
|
|
153146
|
+
var import_node_path68 = __toESM(require("node:path"), 1);
|
|
153036
153147
|
init_lock();
|
|
153037
153148
|
init_poolPick();
|
|
153038
153149
|
init_read();
|
|
@@ -153078,7 +153189,7 @@ function createMover(deps) {
|
|
|
153078
153189
|
if (resolution.identity === request7.from) {
|
|
153079
153190
|
return { kind: "stay", reason: `no other member of pool "${pool}" can take it` };
|
|
153080
153191
|
}
|
|
153081
|
-
const transcript =
|
|
153192
|
+
const transcript = import_node_path68.default.join(paths.identitiesDir, resolution.identity, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
|
|
153082
153193
|
if (farmFs.lstat(transcript)?.kind !== "file") {
|
|
153083
153194
|
return { kind: "stay", reason: `${resolution.identity} does not share this conversation's history, so it could not resume it` };
|
|
153084
153195
|
}
|
|
@@ -153112,13 +153223,13 @@ function createIdentityMover(deps) {
|
|
|
153112
153223
|
throw error63;
|
|
153113
153224
|
}
|
|
153114
153225
|
try {
|
|
153115
|
-
if (farmFs.readFileUtf8(
|
|
153226
|
+
if (farmFs.readFileUtf8(import_node_path68.default.join(paths.identitiesDir, request7.to, "identity.json")) === void 0) {
|
|
153116
153227
|
return { kind: "stay", reason: `no identity "${request7.to}"` };
|
|
153117
153228
|
}
|
|
153118
153229
|
if (request7.to === request7.from) {
|
|
153119
153230
|
return { kind: "stay", reason: `the model already runs under this session's identity` };
|
|
153120
153231
|
}
|
|
153121
|
-
const transcript =
|
|
153232
|
+
const transcript = import_node_path68.default.join(paths.identitiesDir, request7.to, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
|
|
153122
153233
|
if (farmFs.lstat(transcript)?.kind !== "file") {
|
|
153123
153234
|
return { kind: "stay", reason: `${request7.to} does not share this conversation's history, so it could not resume it` };
|
|
153124
153235
|
}
|
|
@@ -153697,7 +153808,7 @@ async function runClaude(argvOverride) {
|
|
|
153697
153808
|
// src/cli.ts
|
|
153698
153809
|
async function main() {
|
|
153699
153810
|
aliasLegacyEnv(process.env);
|
|
153700
|
-
const invokedName =
|
|
153811
|
+
const invokedName = import_node_path69.default.basename(process.argv[1] ?? "agent-shim");
|
|
153701
153812
|
if (isInvokedAsClaude(invokedName)) {
|
|
153702
153813
|
await runClaude();
|
|
153703
153814
|
return;
|