claude-use 11.87.4 → 11.87.5
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 +482 -464
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -319,10 +319,10 @@ function mergeDefs(...defs) {
|
|
|
319
319
|
function cloneDef(schema) {
|
|
320
320
|
return mergeDefs(schema._zod.def);
|
|
321
321
|
}
|
|
322
|
-
function getElementAtPath(obj,
|
|
323
|
-
if (!
|
|
322
|
+
function getElementAtPath(obj, path99) {
|
|
323
|
+
if (!path99)
|
|
324
324
|
return obj;
|
|
325
|
-
return
|
|
325
|
+
return path99.reduce((acc, key) => acc?.[key], obj);
|
|
326
326
|
}
|
|
327
327
|
function promiseAllObject(promisesObj) {
|
|
328
328
|
const keys = Object.keys(promisesObj);
|
|
@@ -581,11 +581,11 @@ function explicitlyAborted(x3, startIndex = 0) {
|
|
|
581
581
|
}
|
|
582
582
|
return false;
|
|
583
583
|
}
|
|
584
|
-
function prefixIssues(
|
|
584
|
+
function prefixIssues(path99, issues) {
|
|
585
585
|
return issues.map((iss) => {
|
|
586
586
|
var _a4;
|
|
587
587
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
588
|
-
iss.path.unshift(
|
|
588
|
+
iss.path.unshift(path99);
|
|
589
589
|
return iss;
|
|
590
590
|
});
|
|
591
591
|
}
|
|
@@ -1118,16 +1118,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
1120
1120
|
const fieldErrors = { _errors: [] };
|
|
1121
|
-
const processError = (error64,
|
|
1121
|
+
const processError = (error64, path99 = []) => {
|
|
1122
1122
|
for (const issue2 of error64.issues) {
|
|
1123
1123
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1124
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1124
|
+
issue2.errors.map((issues) => processError({ issues }, [...path99, ...issue2.path]));
|
|
1125
1125
|
} else if (issue2.code === "invalid_key") {
|
|
1126
|
-
processError({ issues: issue2.issues }, [...
|
|
1126
|
+
processError({ issues: issue2.issues }, [...path99, ...issue2.path]);
|
|
1127
1127
|
} else if (issue2.code === "invalid_element") {
|
|
1128
|
-
processError({ issues: issue2.issues }, [...
|
|
1128
|
+
processError({ issues: issue2.issues }, [...path99, ...issue2.path]);
|
|
1129
1129
|
} else {
|
|
1130
|
-
const fullpath = [...
|
|
1130
|
+
const fullpath = [...path99, ...issue2.path];
|
|
1131
1131
|
if (fullpath.length === 0) {
|
|
1132
1132
|
fieldErrors._errors.push(mapper(issue2));
|
|
1133
1133
|
} else {
|
|
@@ -1166,17 +1166,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
1168
1168
|
const result = { errors: [] };
|
|
1169
|
-
const processError = (error64,
|
|
1169
|
+
const processError = (error64, path99 = []) => {
|
|
1170
1170
|
var _a4;
|
|
1171
1171
|
for (const issue2 of error64.issues) {
|
|
1172
1172
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1173
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1173
|
+
issue2.errors.map((issues) => processError({ issues }, [...path99, ...issue2.path]));
|
|
1174
1174
|
} else if (issue2.code === "invalid_key") {
|
|
1175
|
-
processError({ issues: issue2.issues }, [...
|
|
1175
|
+
processError({ issues: issue2.issues }, [...path99, ...issue2.path]);
|
|
1176
1176
|
} else if (issue2.code === "invalid_element") {
|
|
1177
|
-
processError({ issues: issue2.issues }, [...
|
|
1177
|
+
processError({ issues: issue2.issues }, [...path99, ...issue2.path]);
|
|
1178
1178
|
} else {
|
|
1179
|
-
const fullpath = [...
|
|
1179
|
+
const fullpath = [...path99, ...issue2.path];
|
|
1180
1180
|
if (fullpath.length === 0) {
|
|
1181
1181
|
result.errors.push(mapper(issue2));
|
|
1182
1182
|
continue;
|
|
@@ -1215,8 +1215,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
function toDotPath(_path) {
|
|
1217
1217
|
const segs = [];
|
|
1218
|
-
const
|
|
1219
|
-
for (const seg of
|
|
1218
|
+
const path99 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1219
|
+
for (const seg of path99) {
|
|
1220
1220
|
if (typeof seg === "number")
|
|
1221
1221
|
segs.push(`[${seg}]`);
|
|
1222
1222
|
else if (typeof seg === "symbol")
|
|
@@ -19248,13 +19248,13 @@ function resolveRef(ref, ctx) {
|
|
|
19248
19248
|
if (!ref.startsWith("#")) {
|
|
19249
19249
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
19250
19250
|
}
|
|
19251
|
-
const
|
|
19252
|
-
if (
|
|
19251
|
+
const path99 = ref.slice(1).split("/").filter(Boolean);
|
|
19252
|
+
if (path99.length === 0) {
|
|
19253
19253
|
return ctx.rootSchema;
|
|
19254
19254
|
}
|
|
19255
19255
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
19256
|
-
if (
|
|
19257
|
-
const key =
|
|
19256
|
+
if (path99[0] === defsKey) {
|
|
19257
|
+
const key = path99[1] === void 0 ? void 0 : decodeJSONPointerSegment(path99[1]);
|
|
19258
19258
|
if (!key || !ctx.defs[key]) {
|
|
19259
19259
|
throw new Error(`Reference not found: ${ref}`);
|
|
19260
19260
|
}
|
|
@@ -23761,42 +23761,42 @@ var require_defaults = __commonJS({
|
|
|
23761
23761
|
var require_env_paths = __commonJS({
|
|
23762
23762
|
"node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module2) {
|
|
23763
23763
|
"use strict";
|
|
23764
|
-
var
|
|
23764
|
+
var path99 = require("path");
|
|
23765
23765
|
var os24 = require("os");
|
|
23766
23766
|
var homedir = os24.homedir();
|
|
23767
23767
|
var tmpdir2 = os24.tmpdir();
|
|
23768
23768
|
var { env } = process;
|
|
23769
23769
|
var macos = (name) => {
|
|
23770
|
-
const library =
|
|
23770
|
+
const library = path99.join(homedir, "Library");
|
|
23771
23771
|
return {
|
|
23772
|
-
data:
|
|
23773
|
-
config:
|
|
23774
|
-
cache:
|
|
23775
|
-
log:
|
|
23776
|
-
temp:
|
|
23772
|
+
data: path99.join(library, "Application Support", name),
|
|
23773
|
+
config: path99.join(library, "Preferences", name),
|
|
23774
|
+
cache: path99.join(library, "Caches", name),
|
|
23775
|
+
log: path99.join(library, "Logs", name),
|
|
23776
|
+
temp: path99.join(tmpdir2, name)
|
|
23777
23777
|
};
|
|
23778
23778
|
};
|
|
23779
23779
|
var windows = (name) => {
|
|
23780
|
-
const appData = env.APPDATA ||
|
|
23781
|
-
const localAppData = env.LOCALAPPDATA ||
|
|
23780
|
+
const appData = env.APPDATA || path99.join(homedir, "AppData", "Roaming");
|
|
23781
|
+
const localAppData = env.LOCALAPPDATA || path99.join(homedir, "AppData", "Local");
|
|
23782
23782
|
return {
|
|
23783
23783
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
23784
|
-
data:
|
|
23785
|
-
config:
|
|
23786
|
-
cache:
|
|
23787
|
-
log:
|
|
23788
|
-
temp:
|
|
23784
|
+
data: path99.join(localAppData, name, "Data"),
|
|
23785
|
+
config: path99.join(appData, name, "Config"),
|
|
23786
|
+
cache: path99.join(localAppData, name, "Cache"),
|
|
23787
|
+
log: path99.join(localAppData, name, "Log"),
|
|
23788
|
+
temp: path99.join(tmpdir2, name)
|
|
23789
23789
|
};
|
|
23790
23790
|
};
|
|
23791
23791
|
var linux = (name) => {
|
|
23792
|
-
const username =
|
|
23792
|
+
const username = path99.basename(homedir);
|
|
23793
23793
|
return {
|
|
23794
|
-
data:
|
|
23795
|
-
config:
|
|
23796
|
-
cache:
|
|
23794
|
+
data: path99.join(env.XDG_DATA_HOME || path99.join(homedir, ".local", "share"), name),
|
|
23795
|
+
config: path99.join(env.XDG_CONFIG_HOME || path99.join(homedir, ".config"), name),
|
|
23796
|
+
cache: path99.join(env.XDG_CACHE_HOME || path99.join(homedir, ".cache"), name),
|
|
23797
23797
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
23798
|
-
log:
|
|
23799
|
-
temp:
|
|
23798
|
+
log: path99.join(env.XDG_STATE_HOME || path99.join(homedir, ".local", "state"), name),
|
|
23799
|
+
temp: path99.join(tmpdir2, username, name)
|
|
23800
23800
|
};
|
|
23801
23801
|
};
|
|
23802
23802
|
var envPaths = (name, options) => {
|
|
@@ -23864,11 +23864,11 @@ var require_util = __commonJS({
|
|
|
23864
23864
|
return result;
|
|
23865
23865
|
}
|
|
23866
23866
|
exports2.emplace = emplace;
|
|
23867
|
-
function getPropertyByPath(source,
|
|
23868
|
-
if (typeof
|
|
23869
|
-
return source[
|
|
23867
|
+
function getPropertyByPath(source, path99) {
|
|
23868
|
+
if (typeof path99 === "string" && Object.prototype.hasOwnProperty.call(source, path99)) {
|
|
23869
|
+
return source[path99];
|
|
23870
23870
|
}
|
|
23871
|
-
const parsedPath = typeof
|
|
23871
|
+
const parsedPath = typeof path99 === "string" ? path99.split(".") : path99;
|
|
23872
23872
|
return parsedPath.reduce((previous, key) => {
|
|
23873
23873
|
if (previous === void 0) {
|
|
23874
23874
|
return previous;
|
|
@@ -23891,9 +23891,9 @@ var require_util = __commonJS({
|
|
|
23891
23891
|
return Object.fromEntries(Object.entries(options).filter(([, value3]) => value3 !== void 0));
|
|
23892
23892
|
}
|
|
23893
23893
|
exports2.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
|
|
23894
|
-
async function isDirectory(
|
|
23894
|
+
async function isDirectory(path99) {
|
|
23895
23895
|
try {
|
|
23896
|
-
const stat = await fs_1.promises.stat(
|
|
23896
|
+
const stat = await fs_1.promises.stat(path99);
|
|
23897
23897
|
return stat.isDirectory();
|
|
23898
23898
|
} catch (e10) {
|
|
23899
23899
|
if (e10.code === "ENOENT") {
|
|
@@ -23903,9 +23903,9 @@ var require_util = __commonJS({
|
|
|
23903
23903
|
}
|
|
23904
23904
|
}
|
|
23905
23905
|
exports2.isDirectory = isDirectory;
|
|
23906
|
-
function isDirectorySync(
|
|
23906
|
+
function isDirectorySync(path99) {
|
|
23907
23907
|
try {
|
|
23908
|
-
const stat = fs_1.default.statSync(
|
|
23908
|
+
const stat = fs_1.default.statSync(path99);
|
|
23909
23909
|
return stat.isDirectory();
|
|
23910
23910
|
} catch (e10) {
|
|
23911
23911
|
if (e10.code === "ENOENT") {
|
|
@@ -24003,7 +24003,7 @@ var require_ExplorerBase = __commonJS({
|
|
|
24003
24003
|
const idx = importStack.indexOf(fullPath);
|
|
24004
24004
|
if (idx !== -1) {
|
|
24005
24005
|
throw new Error(`Circular import detected:
|
|
24006
|
-
${[...importStack, fullPath].map((
|
|
24006
|
+
${[...importStack, fullPath].map((path99, i10) => `${i10 + 1}. ${path99}`).join("\n")} (same as ${idx + 1}.)`);
|
|
24007
24007
|
}
|
|
24008
24008
|
}
|
|
24009
24009
|
}
|
|
@@ -24191,9 +24191,9 @@ var require_Explorer = __commonJS({
|
|
|
24191
24191
|
throw error63;
|
|
24192
24192
|
}
|
|
24193
24193
|
}
|
|
24194
|
-
async #fileExists(
|
|
24194
|
+
async #fileExists(path99) {
|
|
24195
24195
|
try {
|
|
24196
|
-
await promises_1.default.stat(
|
|
24196
|
+
await promises_1.default.stat(path99);
|
|
24197
24197
|
return true;
|
|
24198
24198
|
} catch (e10) {
|
|
24199
24199
|
return false;
|
|
@@ -24353,9 +24353,9 @@ var require_ExplorerSync = __commonJS({
|
|
|
24353
24353
|
throw error63;
|
|
24354
24354
|
}
|
|
24355
24355
|
}
|
|
24356
|
-
#fileExists(
|
|
24356
|
+
#fileExists(path99) {
|
|
24357
24357
|
try {
|
|
24358
|
-
fs_1.default.statSync(
|
|
24358
|
+
fs_1.default.statSync(path99);
|
|
24359
24359
|
return true;
|
|
24360
24360
|
} catch (e10) {
|
|
24361
24361
|
return false;
|
|
@@ -24479,7 +24479,7 @@ var require_dist = __commonJS({
|
|
|
24479
24479
|
};
|
|
24480
24480
|
}
|
|
24481
24481
|
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
24482
|
-
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((
|
|
24482
|
+
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path99) => path99.replace("{name}", moduleName));
|
|
24483
24483
|
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
24484
24484
|
return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
|
|
24485
24485
|
}
|
|
@@ -24609,7 +24609,7 @@ function parseIgnoringUnrecognisedKeys(schema, raw) {
|
|
|
24609
24609
|
return second.success ? { success: true, data: second.data, ignored } : { success: false, issues: second.error.issues };
|
|
24610
24610
|
}
|
|
24611
24611
|
function describeIgnoredKeys(filePath, ignored) {
|
|
24612
|
-
const places = ignored.map(({ path:
|
|
24612
|
+
const places = ignored.map(({ path: path99, keys }) => `${path99.length === 0 ? "" : `${path99.map(String).join(".")}.`}${keys.join(", ")}`);
|
|
24613
24613
|
return `${filePath} has settings this version of agent-shim does not know and ignores: ${places.join("; ")}. A newer release may read them.`;
|
|
24614
24614
|
}
|
|
24615
24615
|
function noteIgnoredKeys(filePath, ignored) {
|
|
@@ -24631,9 +24631,9 @@ function restoreIgnoredKeys(filePath, value3) {
|
|
|
24631
24631
|
return value3;
|
|
24632
24632
|
}
|
|
24633
24633
|
const restored2 = structuredClone(value3);
|
|
24634
|
-
for (const { path:
|
|
24634
|
+
for (const { path: path99, values } of ignored) {
|
|
24635
24635
|
let holder = restored2;
|
|
24636
|
-
for (const step2 of
|
|
24636
|
+
for (const step2 of path99) {
|
|
24637
24637
|
holder = isRecord(holder) ? holder[step2] : void 0;
|
|
24638
24638
|
}
|
|
24639
24639
|
if (isRecord(holder)) {
|
|
@@ -28811,8 +28811,8 @@ var require_utils = __commonJS({
|
|
|
28811
28811
|
}
|
|
28812
28812
|
return output2;
|
|
28813
28813
|
};
|
|
28814
|
-
exports2.basename = (
|
|
28815
|
-
const segs =
|
|
28814
|
+
exports2.basename = (path99, { windows } = {}) => {
|
|
28815
|
+
const segs = path99.split(windows ? /[\\/]/ : "/");
|
|
28816
28816
|
const last = segs[segs.length - 1];
|
|
28817
28817
|
if (last === "") {
|
|
28818
28818
|
return segs[segs.length - 2];
|
|
@@ -33403,9 +33403,9 @@ var init_identity = __esm({
|
|
|
33403
33403
|
});
|
|
33404
33404
|
|
|
33405
33405
|
// src/statusline/keys.ts
|
|
33406
|
-
function valueAt(source,
|
|
33406
|
+
function valueAt(source, path99) {
|
|
33407
33407
|
let current = source;
|
|
33408
|
-
for (const part of
|
|
33408
|
+
for (const part of path99) {
|
|
33409
33409
|
if (!isPlainObject2(current)) {
|
|
33410
33410
|
return void 0;
|
|
33411
33411
|
}
|
|
@@ -33413,14 +33413,14 @@ function valueAt(source, path98) {
|
|
|
33413
33413
|
}
|
|
33414
33414
|
return current;
|
|
33415
33415
|
}
|
|
33416
|
-
function acceptsNull(
|
|
33417
|
-
const layer =
|
|
33416
|
+
function acceptsNull(path99) {
|
|
33417
|
+
const layer = path99.reduceRight((inner, part) => ({ [part]: inner }), null);
|
|
33418
33418
|
return StatuslineSchema.safeParse(layer).success;
|
|
33419
33419
|
}
|
|
33420
|
-
function keyOf(
|
|
33420
|
+
function keyOf(path99, declared) {
|
|
33421
33421
|
const optional2 = declared instanceof external_exports.ZodOptional;
|
|
33422
33422
|
const leaf = optional2 ? declared.unwrap() : declared;
|
|
33423
|
-
const common = { path:
|
|
33423
|
+
const common = { path: path99.join("."), description: declared.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path99), optional: optional2, unsettable: acceptsNull(path99) };
|
|
33424
33424
|
if (leaf instanceof external_exports.ZodNumber) {
|
|
33425
33425
|
return { ...common, kind: "integer", choices: [] };
|
|
33426
33426
|
}
|
|
@@ -33445,7 +33445,7 @@ function keyOf(path98, declared) {
|
|
|
33445
33445
|
if (leaf instanceof external_exports.ZodArray && leaf.element instanceof external_exports.ZodString) {
|
|
33446
33446
|
return { ...common, kind: "textList", choices: [] };
|
|
33447
33447
|
}
|
|
33448
|
-
throw new TypeError(`statusline setting ${
|
|
33448
|
+
throw new TypeError(`statusline setting ${path99.join(".")} has a kind the key listing does not describe`);
|
|
33449
33449
|
}
|
|
33450
33450
|
function walk(shape, prefix) {
|
|
33451
33451
|
return Object.entries(shape).flatMap(([name, schema]) => schema instanceof external_exports.ZodObject ? walk(schema.shape, [...prefix, name]) : [keyOf([...prefix, name], schema)]);
|
|
@@ -33476,14 +33476,14 @@ var init_keys = __esm({
|
|
|
33476
33476
|
});
|
|
33477
33477
|
|
|
33478
33478
|
// src/statusline/change.ts
|
|
33479
|
-
function keyNamed(
|
|
33480
|
-
const found = statuslineKeys().find((key) => key.path ===
|
|
33479
|
+
function keyNamed(path99) {
|
|
33480
|
+
const found = statuslineKeys().find((key) => key.path === path99);
|
|
33481
33481
|
if (found === void 0) {
|
|
33482
|
-
throw new UsageError(`"${
|
|
33482
|
+
throw new UsageError(`"${path99}" is not a statusline setting; \`agent-shim statusline keys\` lists them.`);
|
|
33483
33483
|
}
|
|
33484
33484
|
return found;
|
|
33485
33485
|
}
|
|
33486
|
-
function textListOf(
|
|
33486
|
+
function textListOf(path99, raw) {
|
|
33487
33487
|
if (raw === "") {
|
|
33488
33488
|
return [];
|
|
33489
33489
|
}
|
|
@@ -33491,10 +33491,10 @@ function textListOf(path98, raw) {
|
|
|
33491
33491
|
try {
|
|
33492
33492
|
parsed = JSON.parse(raw);
|
|
33493
33493
|
} catch {
|
|
33494
|
-
throw new UsageError(`${
|
|
33494
|
+
throw new UsageError(`${path99}: "${raw}" is not a JSON array of strings such as ["git","describe"].`);
|
|
33495
33495
|
}
|
|
33496
33496
|
if (!Array.isArray(parsed) || parsed.some((item) => typeof item !== "string")) {
|
|
33497
|
-
throw new UsageError(`${
|
|
33497
|
+
throw new UsageError(`${path99}: "${raw}" is not a JSON array of strings such as ["git","describe"].`);
|
|
33498
33498
|
}
|
|
33499
33499
|
return parsed;
|
|
33500
33500
|
}
|
|
@@ -33503,42 +33503,42 @@ function parseStatuslineAssignment(text5) {
|
|
|
33503
33503
|
if (split < 1) {
|
|
33504
33504
|
throw new UsageError(`"${text5}" is not <setting>=<value>.`);
|
|
33505
33505
|
}
|
|
33506
|
-
const
|
|
33506
|
+
const path99 = text5.slice(0, split);
|
|
33507
33507
|
const raw = text5.slice(split + 1);
|
|
33508
|
-
const key = keyNamed(
|
|
33508
|
+
const key = keyNamed(path99);
|
|
33509
33509
|
if (key.unsettable && raw === UNSET_WORD) {
|
|
33510
|
-
return { path:
|
|
33510
|
+
return { path: path99, value: null };
|
|
33511
33511
|
}
|
|
33512
33512
|
switch (key.kind) {
|
|
33513
33513
|
case "integer": {
|
|
33514
33514
|
const number6 = Number(raw);
|
|
33515
33515
|
if (raw.trim() === "" || !Number.isFinite(number6)) {
|
|
33516
|
-
throw new UsageError(`${
|
|
33516
|
+
throw new UsageError(`${path99}: "${raw}" is not a number.`);
|
|
33517
33517
|
}
|
|
33518
|
-
return { path:
|
|
33518
|
+
return { path: path99, value: number6 };
|
|
33519
33519
|
}
|
|
33520
33520
|
case "boolean":
|
|
33521
33521
|
if (raw !== "true" && raw !== "false") {
|
|
33522
|
-
throw new UsageError(`${
|
|
33522
|
+
throw new UsageError(`${path99}: "${raw}" is not true or false.`);
|
|
33523
33523
|
}
|
|
33524
|
-
return { path:
|
|
33524
|
+
return { path: path99, value: raw === "true" };
|
|
33525
33525
|
case "text":
|
|
33526
33526
|
case "choice":
|
|
33527
|
-
return { path:
|
|
33527
|
+
return { path: path99, value: raw };
|
|
33528
33528
|
case "colour":
|
|
33529
|
-
return { path:
|
|
33529
|
+
return { path: path99, value: /^\d+$/.test(raw) ? Number(raw) : raw };
|
|
33530
33530
|
case "list":
|
|
33531
|
-
return { path:
|
|
33531
|
+
return { path: path99, value: raw === "" ? [] : raw.split(",") };
|
|
33532
33532
|
case "groups":
|
|
33533
|
-
return { path:
|
|
33533
|
+
return { path: path99, value: raw === "" ? [] : raw.split(";").map((group) => group.split(",")) };
|
|
33534
33534
|
case "textList":
|
|
33535
|
-
return { path:
|
|
33535
|
+
return { path: path99, value: textListOf(path99, raw) };
|
|
33536
33536
|
default:
|
|
33537
33537
|
return key.kind;
|
|
33538
33538
|
}
|
|
33539
33539
|
}
|
|
33540
|
-
function setAt(target,
|
|
33541
|
-
const [head, ...rest] =
|
|
33540
|
+
function setAt(target, path99, value3) {
|
|
33541
|
+
const [head, ...rest] = path99;
|
|
33542
33542
|
if (head === void 0) {
|
|
33543
33543
|
return;
|
|
33544
33544
|
}
|
|
@@ -33551,8 +33551,8 @@ function setAt(target, path98, value3) {
|
|
|
33551
33551
|
target[head] = next;
|
|
33552
33552
|
setAt(next, rest, value3);
|
|
33553
33553
|
}
|
|
33554
|
-
function removeAt(target,
|
|
33555
|
-
const [head, ...rest] =
|
|
33554
|
+
function removeAt(target, path99) {
|
|
33555
|
+
const [head, ...rest] = path99;
|
|
33556
33556
|
if (head === void 0) {
|
|
33557
33557
|
return;
|
|
33558
33558
|
}
|
|
@@ -33570,13 +33570,13 @@ function removeAt(target, path98) {
|
|
|
33570
33570
|
}
|
|
33571
33571
|
function applyStatuslineChange(existing, change) {
|
|
33572
33572
|
const draft = structuredClone(existing ?? {});
|
|
33573
|
-
for (const [
|
|
33574
|
-
keyNamed(
|
|
33575
|
-
setAt(draft,
|
|
33573
|
+
for (const [path99, value3] of Object.entries(change.set ?? {})) {
|
|
33574
|
+
keyNamed(path99);
|
|
33575
|
+
setAt(draft, path99.split("."), value3);
|
|
33576
33576
|
}
|
|
33577
|
-
for (const
|
|
33578
|
-
keyNamed(
|
|
33579
|
-
removeAt(draft,
|
|
33577
|
+
for (const path99 of change.unset ?? []) {
|
|
33578
|
+
keyNamed(path99);
|
|
33579
|
+
removeAt(draft, path99.split("."));
|
|
33580
33580
|
}
|
|
33581
33581
|
const result = StatuslineSchema.safeParse(draft);
|
|
33582
33582
|
if (!result.success) {
|
|
@@ -33814,19 +33814,19 @@ function writePools(paths, pools) {
|
|
|
33814
33814
|
applyPatch(paths.globalConfigFile, GlobalConfigSchema, { pools }, { defaults: {} });
|
|
33815
33815
|
}
|
|
33816
33816
|
function poolCycleOf(pools, name) {
|
|
33817
|
-
const walk3 = (current,
|
|
33817
|
+
const walk3 = (current, path99) => {
|
|
33818
33818
|
for (const entry of pools[current]?.identities ?? []) {
|
|
33819
33819
|
const nested = poolNameOf(poolMemberIdentity(entry));
|
|
33820
33820
|
if (nested === void 0) {
|
|
33821
33821
|
continue;
|
|
33822
33822
|
}
|
|
33823
33823
|
if (nested === name) {
|
|
33824
|
-
return [...
|
|
33824
|
+
return [...path99, nested];
|
|
33825
33825
|
}
|
|
33826
|
-
if (
|
|
33826
|
+
if (path99.includes(nested)) {
|
|
33827
33827
|
continue;
|
|
33828
33828
|
}
|
|
33829
|
-
const found = walk3(nested, [...
|
|
33829
|
+
const found = walk3(nested, [...path99, nested]);
|
|
33830
33830
|
if (found !== void 0) {
|
|
33831
33831
|
return found;
|
|
33832
33832
|
}
|
|
@@ -36217,11 +36217,11 @@ function identifyRequest(headers) {
|
|
|
36217
36217
|
function directOrigin2(port) {
|
|
36218
36218
|
return `http://127.0.0.1:${String(port)}`;
|
|
36219
36219
|
}
|
|
36220
|
-
function parseProviderPath(
|
|
36221
|
-
if (!
|
|
36220
|
+
function parseProviderPath(path99) {
|
|
36221
|
+
if (!path99.startsWith(PROVIDER_PATH_PREFIX)) {
|
|
36222
36222
|
return void 0;
|
|
36223
36223
|
}
|
|
36224
|
-
const tail =
|
|
36224
|
+
const tail = path99.slice(PROVIDER_PATH_PREFIX.length);
|
|
36225
36225
|
const slash = tail.indexOf("/");
|
|
36226
36226
|
if (slash <= 0) {
|
|
36227
36227
|
return void 0;
|
|
@@ -36557,12 +36557,12 @@ function decoderFor(encoding) {
|
|
|
36557
36557
|
return void 0;
|
|
36558
36558
|
}
|
|
36559
36559
|
}
|
|
36560
|
-
function destinationOf(
|
|
36561
|
-
const scoped = parseProviderPath(
|
|
36560
|
+
function destinationOf(path99, sessionProvider) {
|
|
36561
|
+
const scoped = parseProviderPath(path99);
|
|
36562
36562
|
if (scoped !== void 0) {
|
|
36563
36563
|
return { provider: scoped.provider, endpoint: scoped.rest };
|
|
36564
36564
|
}
|
|
36565
|
-
return { provider: sessionProvider ?? ANTHROPIC_PROVIDER, endpoint:
|
|
36565
|
+
return { provider: sessionProvider ?? ANTHROPIC_PROVIDER, endpoint: path99 };
|
|
36566
36566
|
}
|
|
36567
36567
|
function modelChoiceOf(event, servedModel, provider) {
|
|
36568
36568
|
if (event.modelChoice !== void 0) return event.modelChoice;
|
|
@@ -40759,8 +40759,8 @@ function parseConnectTarget(authority) {
|
|
|
40759
40759
|
}
|
|
40760
40760
|
return { host, port };
|
|
40761
40761
|
}
|
|
40762
|
-
function servedByPipeline(
|
|
40763
|
-
return
|
|
40762
|
+
function servedByPipeline(path99) {
|
|
40763
|
+
return path99?.startsWith(ROUTED_PATH_PREFIX) === true;
|
|
40764
40764
|
}
|
|
40765
40765
|
function forwardableHeaders(headers) {
|
|
40766
40766
|
const connectionTokens = new Set(
|
|
@@ -41980,7 +41980,7 @@ var init_package = __esm({
|
|
|
41980
41980
|
"package.json"() {
|
|
41981
41981
|
package_default = {
|
|
41982
41982
|
name: "claude-use",
|
|
41983
|
-
version: "11.87.
|
|
41983
|
+
version: "11.87.5",
|
|
41984
41984
|
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.",
|
|
41985
41985
|
license: "MIT",
|
|
41986
41986
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -43315,14 +43315,14 @@ var require_util2 = __commonJS({
|
|
|
43315
43315
|
}
|
|
43316
43316
|
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
43317
43317
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
|
|
43318
|
-
let
|
|
43318
|
+
let path99 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
43319
43319
|
if (origin[origin.length - 1] === "/") {
|
|
43320
43320
|
origin = origin.slice(0, origin.length - 1);
|
|
43321
43321
|
}
|
|
43322
|
-
if (
|
|
43323
|
-
|
|
43322
|
+
if (path99 && path99[0] !== "/") {
|
|
43323
|
+
path99 = `/${path99}`;
|
|
43324
43324
|
}
|
|
43325
|
-
return new URL(`${origin}${
|
|
43325
|
+
return new URL(`${origin}${path99}`);
|
|
43326
43326
|
}
|
|
43327
43327
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
43328
43328
|
throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -44143,9 +44143,9 @@ var require_diagnostics = __commonJS({
|
|
|
44143
44143
|
"undici:client:sendHeaders",
|
|
44144
44144
|
(evt) => {
|
|
44145
44145
|
const {
|
|
44146
|
-
request: { method, path:
|
|
44146
|
+
request: { method, path: path99, origin }
|
|
44147
44147
|
} = evt;
|
|
44148
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
44148
|
+
debugLog("sending request to %s %s%s", method, origin, path99);
|
|
44149
44149
|
}
|
|
44150
44150
|
);
|
|
44151
44151
|
}
|
|
@@ -44163,14 +44163,14 @@ var require_diagnostics = __commonJS({
|
|
|
44163
44163
|
"undici:request:headers",
|
|
44164
44164
|
(evt) => {
|
|
44165
44165
|
const {
|
|
44166
|
-
request: { method, path:
|
|
44166
|
+
request: { method, path: path99, origin },
|
|
44167
44167
|
response: { statusCode }
|
|
44168
44168
|
} = evt;
|
|
44169
44169
|
debugLog(
|
|
44170
44170
|
"received response to %s %s%s - HTTP %d",
|
|
44171
44171
|
method,
|
|
44172
44172
|
origin,
|
|
44173
|
-
|
|
44173
|
+
path99,
|
|
44174
44174
|
statusCode
|
|
44175
44175
|
);
|
|
44176
44176
|
}
|
|
@@ -44179,23 +44179,23 @@ var require_diagnostics = __commonJS({
|
|
|
44179
44179
|
"undici:request:trailers",
|
|
44180
44180
|
(evt) => {
|
|
44181
44181
|
const {
|
|
44182
|
-
request: { method, path:
|
|
44182
|
+
request: { method, path: path99, origin }
|
|
44183
44183
|
} = evt;
|
|
44184
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
44184
|
+
debugLog("trailers received from %s %s%s", method, origin, path99);
|
|
44185
44185
|
}
|
|
44186
44186
|
);
|
|
44187
44187
|
diagnosticsChannel.subscribe(
|
|
44188
44188
|
"undici:request:error",
|
|
44189
44189
|
(evt) => {
|
|
44190
44190
|
const {
|
|
44191
|
-
request: { method, path:
|
|
44191
|
+
request: { method, path: path99, origin },
|
|
44192
44192
|
error: error63
|
|
44193
44193
|
} = evt;
|
|
44194
44194
|
debugLog(
|
|
44195
44195
|
"request to %s %s%s errored - %s",
|
|
44196
44196
|
method,
|
|
44197
44197
|
origin,
|
|
44198
|
-
|
|
44198
|
+
path99,
|
|
44199
44199
|
error63.message
|
|
44200
44200
|
);
|
|
44201
44201
|
}
|
|
@@ -44310,7 +44310,7 @@ var require_request = __commonJS({
|
|
|
44310
44310
|
var kHandler = /* @__PURE__ */ Symbol("handler");
|
|
44311
44311
|
var Request2 = class {
|
|
44312
44312
|
constructor(origin, {
|
|
44313
|
-
path:
|
|
44313
|
+
path: path99,
|
|
44314
44314
|
method,
|
|
44315
44315
|
body,
|
|
44316
44316
|
headers,
|
|
@@ -44327,11 +44327,11 @@ var require_request = __commonJS({
|
|
|
44327
44327
|
maxRedirections,
|
|
44328
44328
|
typeOfService
|
|
44329
44329
|
}, handler) {
|
|
44330
|
-
if (typeof
|
|
44330
|
+
if (typeof path99 !== "string") {
|
|
44331
44331
|
throw new InvalidArgumentError2("path must be a string");
|
|
44332
|
-
} else if (
|
|
44332
|
+
} else if (path99[0] !== "/" && !(path99.startsWith("http://") || path99.startsWith("https://")) && method !== "CONNECT") {
|
|
44333
44333
|
throw new InvalidArgumentError2("path must be an absolute URL or start with a slash");
|
|
44334
|
-
} else if (invalidPathRegex.test(
|
|
44334
|
+
} else if (invalidPathRegex.test(path99)) {
|
|
44335
44335
|
throw new InvalidArgumentError2("invalid request path");
|
|
44336
44336
|
}
|
|
44337
44337
|
if (typeof method !== "string") {
|
|
@@ -44406,7 +44406,7 @@ var require_request = __commonJS({
|
|
|
44406
44406
|
this.completed = false;
|
|
44407
44407
|
this.aborted = false;
|
|
44408
44408
|
this.upgrade = upgrade || null;
|
|
44409
|
-
this.path = query ? serializePathWithQuery(
|
|
44409
|
+
this.path = query ? serializePathWithQuery(path99, query) : path99;
|
|
44410
44410
|
this.origin = origin;
|
|
44411
44411
|
this.protocol = getProtocolFromUrlString(origin);
|
|
44412
44412
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -49631,7 +49631,7 @@ var require_client_h1 = __commonJS({
|
|
|
49631
49631
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
49632
49632
|
}
|
|
49633
49633
|
function writeH1(client, request7) {
|
|
49634
|
-
const { method, path:
|
|
49634
|
+
const { method, path: path99, host, upgrade, blocking, reset } = request7;
|
|
49635
49635
|
let { body, headers, contentLength } = request7;
|
|
49636
49636
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
49637
49637
|
if (util2.isFormDataLike(body)) {
|
|
@@ -49709,7 +49709,7 @@ var require_client_h1 = __commonJS({
|
|
|
49709
49709
|
if (socket.setTypeOfService) {
|
|
49710
49710
|
socket.setTypeOfService(request7.typeOfService);
|
|
49711
49711
|
}
|
|
49712
|
-
let header = `${method} ${
|
|
49712
|
+
let header = `${method} ${path99} HTTP/1.1\r
|
|
49713
49713
|
`;
|
|
49714
49714
|
if (typeof host === "string") {
|
|
49715
49715
|
header += `host: ${host}\r
|
|
@@ -50386,7 +50386,7 @@ var require_client_h2 = __commonJS({
|
|
|
50386
50386
|
const headersTimeout = request7.headersTimeout ?? client[kHeadersTimeout];
|
|
50387
50387
|
const bodyTimeout = request7.bodyTimeout ?? client[kBodyTimeout];
|
|
50388
50388
|
const session = client[kHTTP2Session];
|
|
50389
|
-
const { method, path:
|
|
50389
|
+
const { method, path: path99, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request7;
|
|
50390
50390
|
let { body } = request7;
|
|
50391
50391
|
if (upgrade != null && upgrade !== "websocket") {
|
|
50392
50392
|
util2.errorRequest(client, request7, new InvalidArgumentError2(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
@@ -50455,7 +50455,7 @@ var require_client_h2 = __commonJS({
|
|
|
50455
50455
|
}
|
|
50456
50456
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
50457
50457
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
50458
|
-
headers[HTTP2_HEADER_PATH] =
|
|
50458
|
+
headers[HTTP2_HEADER_PATH] = path99;
|
|
50459
50459
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
50460
50460
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
50461
50461
|
} else {
|
|
@@ -50507,7 +50507,7 @@ var require_client_h2 = __commonJS({
|
|
|
50507
50507
|
stream.setTimeout(headersTimeout);
|
|
50508
50508
|
return true;
|
|
50509
50509
|
}
|
|
50510
|
-
headers[HTTP2_HEADER_PATH] =
|
|
50510
|
+
headers[HTTP2_HEADER_PATH] = path99;
|
|
50511
50511
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
50512
50512
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
50513
50513
|
if (body && typeof body.read === "function") {
|
|
@@ -52863,10 +52863,10 @@ var require_proxy_agent = __commonJS({
|
|
|
52863
52863
|
};
|
|
52864
52864
|
const {
|
|
52865
52865
|
origin,
|
|
52866
|
-
path:
|
|
52866
|
+
path: path99 = "/",
|
|
52867
52867
|
headers = {}
|
|
52868
52868
|
} = opts;
|
|
52869
|
-
opts.path = origin +
|
|
52869
|
+
opts.path = origin + path99;
|
|
52870
52870
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
52871
52871
|
const { host } = new URL(origin);
|
|
52872
52872
|
headers.host = host;
|
|
@@ -55026,20 +55026,20 @@ var require_mock_utils = __commonJS({
|
|
|
55026
55026
|
}
|
|
55027
55027
|
return normalizedQp;
|
|
55028
55028
|
}
|
|
55029
|
-
function safeUrl(
|
|
55030
|
-
if (typeof
|
|
55031
|
-
return
|
|
55029
|
+
function safeUrl(path99) {
|
|
55030
|
+
if (typeof path99 !== "string") {
|
|
55031
|
+
return path99;
|
|
55032
55032
|
}
|
|
55033
|
-
const pathSegments =
|
|
55033
|
+
const pathSegments = path99.split("?", 3);
|
|
55034
55034
|
if (pathSegments.length !== 2) {
|
|
55035
|
-
return
|
|
55035
|
+
return path99;
|
|
55036
55036
|
}
|
|
55037
55037
|
const qp2 = new URLSearchParams(pathSegments.pop());
|
|
55038
55038
|
qp2.sort();
|
|
55039
55039
|
return [...pathSegments, qp2.toString()].join("?");
|
|
55040
55040
|
}
|
|
55041
|
-
function matchKey(mockDispatch2, { path:
|
|
55042
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
55041
|
+
function matchKey(mockDispatch2, { path: path99, method, body, headers }) {
|
|
55042
|
+
const pathMatch = matchValue(mockDispatch2.path, path99);
|
|
55043
55043
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
55044
55044
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
55045
55045
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -55064,8 +55064,8 @@ var require_mock_utils = __commonJS({
|
|
|
55064
55064
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
55065
55065
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
55066
55066
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
55067
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
55068
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
55067
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path99, ignoreTrailingSlash }) => {
|
|
55068
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path99)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path99), resolvedPath);
|
|
55069
55069
|
});
|
|
55070
55070
|
if (matchedMockDispatches.length === 0) {
|
|
55071
55071
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -55104,19 +55104,19 @@ var require_mock_utils = __commonJS({
|
|
|
55104
55104
|
mockDispatches.splice(index, 1);
|
|
55105
55105
|
}
|
|
55106
55106
|
}
|
|
55107
|
-
function removeTrailingSlash(
|
|
55108
|
-
while (
|
|
55109
|
-
|
|
55107
|
+
function removeTrailingSlash(path99) {
|
|
55108
|
+
while (path99.endsWith("/")) {
|
|
55109
|
+
path99 = path99.slice(0, -1);
|
|
55110
55110
|
}
|
|
55111
|
-
if (
|
|
55112
|
-
|
|
55111
|
+
if (path99.length === 0) {
|
|
55112
|
+
path99 = "/";
|
|
55113
55113
|
}
|
|
55114
|
-
return
|
|
55114
|
+
return path99;
|
|
55115
55115
|
}
|
|
55116
55116
|
function buildKey(opts) {
|
|
55117
|
-
const { path:
|
|
55117
|
+
const { path: path99, method, body, headers, query } = opts;
|
|
55118
55118
|
return {
|
|
55119
|
-
path:
|
|
55119
|
+
path: path99,
|
|
55120
55120
|
method,
|
|
55121
55121
|
body,
|
|
55122
55122
|
headers,
|
|
@@ -55806,10 +55806,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
55806
55806
|
}
|
|
55807
55807
|
format(pendingInterceptors) {
|
|
55808
55808
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
55809
|
-
({ method, path:
|
|
55809
|
+
({ method, path: path99, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
55810
55810
|
Method: method,
|
|
55811
55811
|
Origin: origin,
|
|
55812
|
-
Path:
|
|
55812
|
+
Path: path99,
|
|
55813
55813
|
"Status code": statusCode,
|
|
55814
55814
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
55815
55815
|
Invocations: timesInvoked,
|
|
@@ -55891,9 +55891,9 @@ var require_mock_agent = __commonJS({
|
|
|
55891
55891
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
55892
55892
|
const dispatchOpts = { ...opts };
|
|
55893
55893
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
55894
|
-
const [
|
|
55894
|
+
const [path99, searchParams] = dispatchOpts.path.split("?");
|
|
55895
55895
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
55896
|
-
dispatchOpts.path = `${
|
|
55896
|
+
dispatchOpts.path = `${path99}?${normalizedSearchParams}`;
|
|
55897
55897
|
}
|
|
55898
55898
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
55899
55899
|
}
|
|
@@ -56294,12 +56294,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
56294
56294
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
56295
56295
|
*/
|
|
56296
56296
|
async loadSnapshots(filePath) {
|
|
56297
|
-
const
|
|
56298
|
-
if (!
|
|
56297
|
+
const path99 = filePath || this.#snapshotPath;
|
|
56298
|
+
if (!path99) {
|
|
56299
56299
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
56300
56300
|
}
|
|
56301
56301
|
try {
|
|
56302
|
-
const data = await readFile(resolve3(
|
|
56302
|
+
const data = await readFile(resolve3(path99), "utf8");
|
|
56303
56303
|
const parsed = JSON.parse(data);
|
|
56304
56304
|
if (Array.isArray(parsed)) {
|
|
56305
56305
|
this.#snapshots.clear();
|
|
@@ -56313,7 +56313,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
56313
56313
|
if (error63.code === "ENOENT") {
|
|
56314
56314
|
this.#snapshots.clear();
|
|
56315
56315
|
} else {
|
|
56316
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
56316
|
+
throw new UndiciError(`Failed to load snapshots from ${path99}`, { cause: error63 });
|
|
56317
56317
|
}
|
|
56318
56318
|
}
|
|
56319
56319
|
}
|
|
@@ -56324,11 +56324,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
56324
56324
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
56325
56325
|
*/
|
|
56326
56326
|
async saveSnapshots(filePath) {
|
|
56327
|
-
const
|
|
56328
|
-
if (!
|
|
56327
|
+
const path99 = filePath || this.#snapshotPath;
|
|
56328
|
+
if (!path99) {
|
|
56329
56329
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
56330
56330
|
}
|
|
56331
|
-
const resolvedPath = resolve3(
|
|
56331
|
+
const resolvedPath = resolve3(path99);
|
|
56332
56332
|
await mkdir(dirname3(resolvedPath), { recursive: true });
|
|
56333
56333
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
56334
56334
|
hash: hash2,
|
|
@@ -56965,15 +56965,15 @@ var require_redirect_handler = __commonJS({
|
|
|
56965
56965
|
}
|
|
56966
56966
|
this.history[kRedirectCacheControl].push(headers["cache-control"]);
|
|
56967
56967
|
const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
56968
|
-
const
|
|
56969
|
-
const redirectUrlString = `${origin}${
|
|
56968
|
+
const path99 = search ? `${pathname}${search}` : pathname;
|
|
56969
|
+
const redirectUrlString = `${origin}${path99}`;
|
|
56970
56970
|
for (const historyUrl of this.history) {
|
|
56971
56971
|
if (historyUrl.toString() === redirectUrlString) {
|
|
56972
56972
|
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.`);
|
|
56973
56973
|
}
|
|
56974
56974
|
}
|
|
56975
56975
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
56976
|
-
this.opts.path =
|
|
56976
|
+
this.opts.path = path99;
|
|
56977
56977
|
this.opts.origin = origin;
|
|
56978
56978
|
this.opts.query = null;
|
|
56979
56979
|
}
|
|
@@ -58741,10 +58741,10 @@ var require_cache_handler = __commonJS({
|
|
|
58741
58741
|
}
|
|
58742
58742
|
return locationUrl.pathname + locationUrl.search;
|
|
58743
58743
|
}
|
|
58744
|
-
function deleteCachedUri(store, cacheKey,
|
|
58744
|
+
function deleteCachedUri(store, cacheKey, path99) {
|
|
58745
58745
|
deleteCachedValue(store, {
|
|
58746
58746
|
...cacheKey,
|
|
58747
|
-
path:
|
|
58747
|
+
path: path99
|
|
58748
58748
|
});
|
|
58749
58749
|
for (let i10 = 0; i10 < util2.safeHTTPMethods.length; i10++) {
|
|
58750
58750
|
const method = util2.safeHTTPMethods[i10];
|
|
@@ -58752,7 +58752,7 @@ var require_cache_handler = __commonJS({
|
|
|
58752
58752
|
deleteCachedValue(store, {
|
|
58753
58753
|
...cacheKey,
|
|
58754
58754
|
method,
|
|
58755
|
-
path:
|
|
58755
|
+
path: path99
|
|
58756
58756
|
});
|
|
58757
58757
|
}
|
|
58758
58758
|
}
|
|
@@ -58763,9 +58763,9 @@ var require_cache_handler = __commonJS({
|
|
|
58763
58763
|
}
|
|
58764
58764
|
const values = Array.isArray(headerValue2) ? headerValue2 : [headerValue2];
|
|
58765
58765
|
for (let i10 = 0; i10 < values.length; i10++) {
|
|
58766
|
-
const
|
|
58767
|
-
if (
|
|
58768
|
-
deleteCachedUri(store, cacheKey,
|
|
58766
|
+
const path99 = getSameOriginPath(cacheKey, values[i10]);
|
|
58767
|
+
if (path99 !== void 0) {
|
|
58768
|
+
deleteCachedUri(store, cacheKey, path99);
|
|
58769
58769
|
}
|
|
58770
58770
|
}
|
|
58771
58771
|
}
|
|
@@ -63976,11 +63976,11 @@ var require_fetch = __commonJS({
|
|
|
63976
63976
|
function dispatch({ body }) {
|
|
63977
63977
|
const url2 = requestCurrentURL(request7);
|
|
63978
63978
|
const agent = fetchParams.controller.dispatcher;
|
|
63979
|
-
const
|
|
63979
|
+
const path99 = url2.pathname + url2.search;
|
|
63980
63980
|
const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
|
|
63981
63981
|
return new Promise((resolve3, reject) => agent.dispatch(
|
|
63982
63982
|
{
|
|
63983
|
-
path: hasTrailingQuestionMark ? `${
|
|
63983
|
+
path: hasTrailingQuestionMark ? `${path99}?` : path99,
|
|
63984
63984
|
origin: url2.origin,
|
|
63985
63985
|
method: request7.method,
|
|
63986
63986
|
body: agent.isMockActive ? request7.body && (request7.body.source || request7.body.stream) : body,
|
|
@@ -64927,9 +64927,9 @@ var require_util5 = __commonJS({
|
|
|
64927
64927
|
}
|
|
64928
64928
|
}
|
|
64929
64929
|
}
|
|
64930
|
-
function validateCookiePath(
|
|
64931
|
-
for (let i10 = 0; i10 <
|
|
64932
|
-
const code =
|
|
64930
|
+
function validateCookiePath(path99) {
|
|
64931
|
+
for (let i10 = 0; i10 < path99.length; ++i10) {
|
|
64932
|
+
const code = path99.charCodeAt(i10);
|
|
64933
64933
|
if (code < 32 || // exclude CTLs (0-31)
|
|
64934
64934
|
code > 126 || // exclude DEL and non-ascii
|
|
64935
64935
|
code === 59) {
|
|
@@ -68365,11 +68365,11 @@ var require_undici = __commonJS({
|
|
|
68365
68365
|
if (typeof opts.path !== "string") {
|
|
68366
68366
|
throw new InvalidArgumentError2("invalid opts.path");
|
|
68367
68367
|
}
|
|
68368
|
-
let
|
|
68368
|
+
let path99 = opts.path;
|
|
68369
68369
|
if (!opts.path.startsWith("/")) {
|
|
68370
|
-
|
|
68370
|
+
path99 = `/${path99}`;
|
|
68371
68371
|
}
|
|
68372
|
-
url2 = new URL(util2.parseOrigin(url2).origin +
|
|
68372
|
+
url2 = new URL(util2.parseOrigin(url2).origin + path99);
|
|
68373
68373
|
} else {
|
|
68374
68374
|
if (!opts) {
|
|
68375
68375
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -113066,8 +113066,8 @@ var require_utils3 = __commonJS({
|
|
|
113066
113066
|
}
|
|
113067
113067
|
return ind;
|
|
113068
113068
|
}
|
|
113069
|
-
function removeDotSegments(
|
|
113070
|
-
let input2 =
|
|
113069
|
+
function removeDotSegments(path99) {
|
|
113070
|
+
let input2 = path99;
|
|
113071
113071
|
const output2 = [];
|
|
113072
113072
|
let nextSlash = -1;
|
|
113073
113073
|
let len = 0;
|
|
@@ -113141,11 +113141,11 @@ var require_utils3 = __commonJS({
|
|
|
113141
113141
|
}
|
|
113142
113142
|
return output2.join("");
|
|
113143
113143
|
}
|
|
113144
|
-
function removeDotSegmentsRelative(
|
|
113145
|
-
if (
|
|
113146
|
-
return removeDotSegments(
|
|
113144
|
+
function removeDotSegmentsRelative(path99) {
|
|
113145
|
+
if (path99 === "" || path99[0] === "/") {
|
|
113146
|
+
return removeDotSegments(path99);
|
|
113147
113147
|
}
|
|
113148
|
-
const segments =
|
|
113148
|
+
const segments = path99.split("/");
|
|
113149
113149
|
const last = segments.length - 1;
|
|
113150
113150
|
const output2 = [];
|
|
113151
113151
|
let trailingDirectory = false;
|
|
@@ -113508,8 +113508,8 @@ var require_schemes = __commonJS({
|
|
|
113508
113508
|
}
|
|
113509
113509
|
if (wsComponent.resourceName) {
|
|
113510
113510
|
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
113511
|
-
const
|
|
113512
|
-
wsComponent.path =
|
|
113511
|
+
const path99 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
113512
|
+
wsComponent.path = path99 && path99 !== "/" ? path99 : void 0;
|
|
113513
113513
|
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
113514
113514
|
wsComponent.resourceName = void 0;
|
|
113515
113515
|
}
|
|
@@ -117060,7 +117060,7 @@ var require_dist2 = __commonJS({
|
|
|
117060
117060
|
});
|
|
117061
117061
|
|
|
117062
117062
|
// src/cli.ts
|
|
117063
|
-
var
|
|
117063
|
+
var import_node_path98 = __toESM(require("node:path"), 1);
|
|
117064
117064
|
|
|
117065
117065
|
// node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
|
|
117066
117066
|
var CommanderError = class extends Error {
|
|
@@ -120173,9 +120173,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
120173
120173
|
* @param {string} [path]
|
|
120174
120174
|
* @return {(string|null|Command)}
|
|
120175
120175
|
*/
|
|
120176
|
-
executableDir(
|
|
120177
|
-
if (
|
|
120178
|
-
this._executableDir =
|
|
120176
|
+
executableDir(path99) {
|
|
120177
|
+
if (path99 === void 0) return this._executableDir;
|
|
120178
|
+
this._executableDir = path99;
|
|
120179
120179
|
return this;
|
|
120180
120180
|
}
|
|
120181
120181
|
/**
|
|
@@ -122503,7 +122503,7 @@ function statuslineChangeOf(options) {
|
|
|
122503
122503
|
return void 0;
|
|
122504
122504
|
}
|
|
122505
122505
|
const assignments = (options.statusline ?? []).map(parseStatuslineAssignment);
|
|
122506
|
-
return { set: Object.fromEntries(assignments.map(({ path:
|
|
122506
|
+
return { set: Object.fromEntries(assignments.map(({ path: path99, value: value3 }) => [path99, value3])), unset: options.unsetStatusline ?? [] };
|
|
122507
122507
|
}
|
|
122508
122508
|
function registerProfileCommand(program2, deps) {
|
|
122509
122509
|
const { paths } = deps;
|
|
@@ -127065,8 +127065,8 @@ function pathnameOf(url2) {
|
|
|
127065
127065
|
return new URL(url2 ?? "/", "http://127.0.0.1").pathname;
|
|
127066
127066
|
}
|
|
127067
127067
|
function isRcSessionExchange(url2) {
|
|
127068
|
-
const
|
|
127069
|
-
return
|
|
127068
|
+
const path99 = pathnameOf(url2);
|
|
127069
|
+
return path99 === RC_SESSIONS_PATH_PREFIX || path99.startsWith(`${RC_SESSIONS_PATH_PREFIX}/`);
|
|
127070
127070
|
}
|
|
127071
127071
|
var RC_SESSION_ID_PREFIX = "cse_";
|
|
127072
127072
|
var RC_IDLE_EXPIRY_MS = 45e3;
|
|
@@ -127604,8 +127604,8 @@ var RC_READ_FILE_ENCODINGS = ["utf-8", "base64"];
|
|
|
127604
127604
|
function isRcReadFileEncoding(value3) {
|
|
127605
127605
|
return RC_READ_FILE_ENCODINGS.some((encoding) => encoding === value3);
|
|
127606
127606
|
}
|
|
127607
|
-
function buildRcReadFilePayload(requestId,
|
|
127608
|
-
return buildRcControlRequestPayload(requestId, { subtype: "read_file", path:
|
|
127607
|
+
function buildRcReadFilePayload(requestId, path99, options) {
|
|
127608
|
+
return buildRcControlRequestPayload(requestId, { subtype: "read_file", path: path99, ...options?.maxBytes === void 0 ? {} : { max_bytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } });
|
|
127609
127609
|
}
|
|
127610
127610
|
function buildRcFileSuggestionsPayload(requestId, query) {
|
|
127611
127611
|
return buildRcControlRequestPayload(requestId, { subtype: "file_suggestions", query });
|
|
@@ -127707,15 +127707,15 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
|
|
|
127707
127707
|
const result = await deliverRcClientPayload(deps, sessionId, buildRcGetContextUsagePayload(requestId, detail), `request the context usage of session ${sessionId}`);
|
|
127708
127708
|
return result.ok ? { ...result, requestId } : result;
|
|
127709
127709
|
}
|
|
127710
|
-
async function readRcSessionFile(deps, sessionId,
|
|
127711
|
-
if (
|
|
127710
|
+
async function readRcSessionFile(deps, sessionId, path99, options) {
|
|
127711
|
+
if (path99 === "") {
|
|
127712
127712
|
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" };
|
|
127713
127713
|
}
|
|
127714
127714
|
if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
|
|
127715
127715
|
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" };
|
|
127716
127716
|
}
|
|
127717
127717
|
const requestId = deps.newUuid();
|
|
127718
|
-
const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId,
|
|
127718
|
+
const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path99, options), `read ${path99} from session ${sessionId}`);
|
|
127719
127719
|
return result.ok ? { ...result, requestId } : result;
|
|
127720
127720
|
}
|
|
127721
127721
|
async function suggestRcSessionFiles(deps, sessionId, query) {
|
|
@@ -127898,11 +127898,11 @@ function createRcControlHandler(deps) {
|
|
|
127898
127898
|
path: "read-file",
|
|
127899
127899
|
read: (body) => {
|
|
127900
127900
|
const session = bodyString(body, "session");
|
|
127901
|
-
const
|
|
127901
|
+
const path99 = bodyString(body, "path");
|
|
127902
127902
|
const maxBytes = "maxBytes" in body ? bodyPositiveInteger(body, "maxBytes") : void 0;
|
|
127903
127903
|
const encoding = "encoding" in body && isRcReadFileEncoding(body.encoding) ? body.encoding : void 0;
|
|
127904
|
-
const refused2 = session === void 0 ||
|
|
127905
|
-
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,
|
|
127904
|
+
const refused2 = session === void 0 || path99 === void 0 || "maxBytes" in body && maxBytes === void 0 || "encoding" in body && encoding === void 0;
|
|
127905
|
+
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, path99, { ...maxBytes === void 0 ? {} : { maxBytes }, ...encoding === void 0 ? {} : { encoding } }) };
|
|
127906
127906
|
}
|
|
127907
127907
|
},
|
|
127908
127908
|
{
|
|
@@ -128212,9 +128212,9 @@ function requestIdOfBody(body) {
|
|
|
128212
128212
|
}
|
|
128213
128213
|
function frontDoorRcControl(transport, token) {
|
|
128214
128214
|
const headers = { authorization: `Bearer ${token}` };
|
|
128215
|
-
const listAnswerOf = async (
|
|
128215
|
+
const listAnswerOf = async (path99, what) => {
|
|
128216
128216
|
try {
|
|
128217
|
-
return await transport.request({ method: "GET", path:
|
|
128217
|
+
return await transport.request({ method: "GET", path: path99, headers });
|
|
128218
128218
|
} catch (error63) {
|
|
128219
128219
|
throw new Error(`${what}: could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}`, { cause: error63 });
|
|
128220
128220
|
}
|
|
@@ -128286,10 +128286,10 @@ function frontDoorRcControl(transport, token) {
|
|
|
128286
128286
|
}
|
|
128287
128287
|
return pending;
|
|
128288
128288
|
};
|
|
128289
|
-
const writeOf = async (
|
|
128289
|
+
const writeOf = async (path99, body, describeFailure2) => {
|
|
128290
128290
|
let answer;
|
|
128291
128291
|
try {
|
|
128292
|
-
answer = await transport.request({ method: "POST", path:
|
|
128292
|
+
answer = await transport.request({ method: "POST", path: path99, headers: { ...headers, "content-type": "application/json" }, body });
|
|
128293
128293
|
} catch (error63) {
|
|
128294
128294
|
return { ok: false, message: `could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}` };
|
|
128295
128295
|
}
|
|
@@ -128320,10 +128320,10 @@ function frontDoorRcControl(transport, token) {
|
|
|
128320
128320
|
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}`),
|
|
128321
128321
|
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}`),
|
|
128322
128322
|
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}`),
|
|
128323
|
-
readFile: async (sessionId,
|
|
128323
|
+
readFile: async (sessionId, path99, options) => await writeOf(
|
|
128324
128324
|
`${CONTROL_PATH_PREFIX}/read-file`,
|
|
128325
|
-
JSON.stringify({ session: sessionId, path:
|
|
128326
|
-
(status, message) => `reading ${
|
|
128325
|
+
JSON.stringify({ session: sessionId, path: path99, ...options?.maxBytes === void 0 ? {} : { maxBytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } }),
|
|
128326
|
+
(status, message) => `reading ${path99} from ${sessionId} failed (HTTP ${String(status)}): ${message}`
|
|
128327
128327
|
),
|
|
128328
128328
|
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}`),
|
|
128329
128329
|
keepAlive: async (sessionId) => await writeOf(`${CONTROL_PATH_PREFIX}/keep-alive`, JSON.stringify({ session: sessionId }), (status, message) => `keeping ${sessionId} alive failed (HTTP ${String(status)}): ${message}`),
|
|
@@ -128729,12 +128729,12 @@ function tlsFacts(options) {
|
|
|
128729
128729
|
}
|
|
128730
128730
|
function realRcEventDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
|
|
128731
128731
|
const agent = new ExemptTlsAgent();
|
|
128732
|
-
const post = async (
|
|
128732
|
+
const post = async (path99, headers, body) => await new Promise((resolve3, reject) => {
|
|
128733
128733
|
const options = {
|
|
128734
128734
|
host: target.host,
|
|
128735
128735
|
port: target.port,
|
|
128736
128736
|
method: "POST",
|
|
128737
|
-
path:
|
|
128737
|
+
path: path99,
|
|
128738
128738
|
// 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.
|
|
128739
128739
|
headers: { ...headers, host: target.servername ?? target.host, "content-length": String(Buffer.byteLength(body, "utf8")) },
|
|
128740
128740
|
agent
|
|
@@ -128799,12 +128799,12 @@ function lateRcStreamDial(resolve3) {
|
|
|
128799
128799
|
}
|
|
128800
128800
|
function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
|
|
128801
128801
|
const agent = new ExemptTlsAgent();
|
|
128802
|
-
const request7 = async (method,
|
|
128802
|
+
const request7 = async (method, path99, headers, body, signal) => await new Promise((resolve3, reject) => {
|
|
128803
128803
|
const options = {
|
|
128804
128804
|
host: target.host,
|
|
128805
128805
|
port: target.port,
|
|
128806
128806
|
method,
|
|
128807
|
-
path:
|
|
128807
|
+
path: path99,
|
|
128808
128808
|
// 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.
|
|
128809
128809
|
headers: { ...headers, host: target.servername ?? target.host, ...body === void 0 ? {} : { "content-length": String(Buffer.byteLength(body, "utf8")) } },
|
|
128810
128810
|
agent,
|
|
@@ -128846,9 +128846,9 @@ function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_P
|
|
|
128846
128846
|
return { status, body: await readAll(response) };
|
|
128847
128847
|
},
|
|
128848
128848
|
openStream: async (sessionId, headers, resume, signal) => {
|
|
128849
|
-
const
|
|
128849
|
+
const path99 = resume === void 0 ? `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream` : `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream?from_sequence_num=${String(resume.fromSequenceNum)}`;
|
|
128850
128850
|
const streamHeaders = resume === void 0 ? headers : { ...headers, "last-event-id": String(resume.fromSequenceNum) };
|
|
128851
|
-
const { status, response } = await request7("GET",
|
|
128851
|
+
const { status, response } = await request7("GET", path99, streamHeaders, void 0, signal);
|
|
128852
128852
|
if (!isSuccessful2(status)) {
|
|
128853
128853
|
await readAll(response);
|
|
128854
128854
|
return { status, chunks: NO_CHUNKS };
|
|
@@ -130528,8 +130528,8 @@ function once(fn) {
|
|
|
130528
130528
|
return result;
|
|
130529
130529
|
};
|
|
130530
130530
|
}
|
|
130531
|
-
function pathToHttpPath(
|
|
130532
|
-
return `/${
|
|
130531
|
+
function pathToHttpPath(path99) {
|
|
130532
|
+
return `/${path99.map(safeEncodeURIComponent).join("/")}`;
|
|
130533
130533
|
}
|
|
130534
130534
|
var TRACER_SYMBOL = /* @__PURE__ */ Symbol.for("ORPC_TRACER");
|
|
130535
130535
|
function getTracer() {
|
|
@@ -131808,7 +131808,7 @@ function resolveClientRest(rest) {
|
|
|
131808
131808
|
// rest[1] can be undefined if all fields of FriendlyClientOptions are optional
|
|
131809
131809
|
];
|
|
131810
131810
|
}
|
|
131811
|
-
function createORPCClient(link, { path:
|
|
131811
|
+
function createORPCClient(link, { path: path99 = [], ...options } = {}) {
|
|
131812
131812
|
const procedureClient = (...rest) => {
|
|
131813
131813
|
const [input2, callOptions] = resolveClientRest(rest);
|
|
131814
131814
|
const interceptors = [
|
|
@@ -131817,7 +131817,7 @@ function createORPCClient(link, { path: path98 = [], ...options } = {}) {
|
|
|
131817
131817
|
];
|
|
131818
131818
|
return intercept(
|
|
131819
131819
|
interceptors,
|
|
131820
|
-
{ ...callOptions, input: input2, path:
|
|
131820
|
+
{ ...callOptions, input: input2, path: path99 },
|
|
131821
131821
|
({ path: path210, input: input22, ...callOptions2 }) => link.call(path210, input22, callOptions2)
|
|
131822
131822
|
);
|
|
131823
131823
|
};
|
|
@@ -131831,7 +131831,7 @@ function createORPCClient(link, { path: path98 = [], ...options } = {}) {
|
|
|
131831
131831
|
if (client === void 0) {
|
|
131832
131832
|
client = createORPCClient(link, {
|
|
131833
131833
|
...options,
|
|
131834
|
-
path: [...
|
|
131834
|
+
path: [...path99, key],
|
|
131835
131835
|
scoped: options.scoped?.[key]
|
|
131836
131836
|
});
|
|
131837
131837
|
cache.set(key, client);
|
|
@@ -132072,11 +132072,11 @@ function tryOrUndefined(fn) {
|
|
|
132072
132072
|
return void 0;
|
|
132073
132073
|
}
|
|
132074
132074
|
}
|
|
132075
|
-
function pathToHttpPath2(
|
|
132076
|
-
return `/${
|
|
132075
|
+
function pathToHttpPath2(path99) {
|
|
132076
|
+
return `/${path99.map(safeEncodeURIComponent2).join("/")}`;
|
|
132077
132077
|
}
|
|
132078
|
-
function normalizeHttpPath(
|
|
132079
|
-
const paths =
|
|
132078
|
+
function normalizeHttpPath(path99) {
|
|
132079
|
+
const paths = path99.split("/");
|
|
132080
132080
|
if (paths.at(0) === "") {
|
|
132081
132081
|
paths.shift();
|
|
132082
132082
|
}
|
|
@@ -132261,9 +132261,9 @@ function isPlainObject4(value3) {
|
|
|
132261
132261
|
function getOwn(object3, key) {
|
|
132262
132262
|
return Object.hasOwn(object3, key) ? object3[key] : void 0;
|
|
132263
132263
|
}
|
|
132264
|
-
function get(object3,
|
|
132264
|
+
function get(object3, path99) {
|
|
132265
132265
|
let current = object3;
|
|
132266
|
-
for (const key of
|
|
132266
|
+
for (const key of path99) {
|
|
132267
132267
|
if (!isTypescriptObject2(current)) {
|
|
132268
132268
|
return void 0;
|
|
132269
132269
|
}
|
|
@@ -132504,25 +132504,25 @@ var BracketNotationSerializer = class {
|
|
|
132504
132504
|
this.internalSerialize(data, "", true, result);
|
|
132505
132505
|
return result;
|
|
132506
132506
|
}
|
|
132507
|
-
internalSerialize(data,
|
|
132507
|
+
internalSerialize(data, path99, isRoot, result) {
|
|
132508
132508
|
if (Array.isArray(data)) {
|
|
132509
132509
|
data.forEach((item, i10) => {
|
|
132510
|
-
this.internalSerialize(item, isRoot ? i10.toString() : `${
|
|
132510
|
+
this.internalSerialize(item, isRoot ? i10.toString() : `${path99}[${i10}]`, false, result);
|
|
132511
132511
|
});
|
|
132512
132512
|
} else if (isPlainObject4(data)) {
|
|
132513
132513
|
for (const key of Object.keys(data)) {
|
|
132514
|
-
this.internalSerialize(data[key], isRoot ? key : `${
|
|
132514
|
+
this.internalSerialize(data[key], isRoot ? key : `${path99}[${key}]`, false, result);
|
|
132515
132515
|
}
|
|
132516
132516
|
} else {
|
|
132517
|
-
result.push([
|
|
132517
|
+
result.push([path99, data]);
|
|
132518
132518
|
}
|
|
132519
132519
|
}
|
|
132520
132520
|
deserialize(serialized) {
|
|
132521
132521
|
let arrayPushStyles;
|
|
132522
132522
|
const root = new NullProtoObj2();
|
|
132523
132523
|
let emptySlotsLeft = this.maxDeserializingEmptySlots;
|
|
132524
|
-
for (const [
|
|
132525
|
-
const segments = this.parsePath(
|
|
132524
|
+
for (const [path99, value3] of serialized) {
|
|
132525
|
+
const segments = this.parsePath(path99);
|
|
132526
132526
|
let currentRef = root;
|
|
132527
132527
|
let nextSegment = segments[0];
|
|
132528
132528
|
for (let i10 = 1; i10 < segments.length; i10++) {
|
|
@@ -132582,20 +132582,20 @@ var BracketNotationSerializer = class {
|
|
|
132582
132582
|
}
|
|
132583
132583
|
return result;
|
|
132584
132584
|
}
|
|
132585
|
-
parsePath(
|
|
132586
|
-
const start =
|
|
132587
|
-
if (start === -1 ||
|
|
132588
|
-
return [
|
|
132585
|
+
parsePath(path99) {
|
|
132586
|
+
const start = path99.indexOf("[");
|
|
132587
|
+
if (start === -1 || path99[path99.length - 1] !== "]") {
|
|
132588
|
+
return [path99];
|
|
132589
132589
|
}
|
|
132590
|
-
const segments = [
|
|
132590
|
+
const segments = [path99.slice(0, start)];
|
|
132591
132591
|
let from = start + 1;
|
|
132592
|
-
let to2 =
|
|
132592
|
+
let to2 = path99.indexOf("][", from);
|
|
132593
132593
|
while (to2 !== -1) {
|
|
132594
|
-
segments.push(
|
|
132594
|
+
segments.push(path99.slice(from, to2));
|
|
132595
132595
|
from = to2 + 2;
|
|
132596
|
-
to2 =
|
|
132596
|
+
to2 = path99.indexOf("][", from);
|
|
132597
132597
|
}
|
|
132598
|
-
segments.push(
|
|
132598
|
+
segments.push(path99.slice(from, -1));
|
|
132599
132599
|
return segments;
|
|
132600
132600
|
}
|
|
132601
132601
|
};
|
|
@@ -134093,11 +134093,11 @@ var OpenAPISerializer = class {
|
|
|
134093
134093
|
return json2;
|
|
134094
134094
|
}
|
|
134095
134095
|
const form = new FormData();
|
|
134096
|
-
for (const [
|
|
134096
|
+
for (const [path99, value22] of this.bracketNotation.serialize(json2)) {
|
|
134097
134097
|
if (value22 instanceof Blob) {
|
|
134098
|
-
form.append(
|
|
134098
|
+
form.append(path99, value22);
|
|
134099
134099
|
} else if (value22 !== void 0 && value22 !== null) {
|
|
134100
|
-
form.append(
|
|
134100
|
+
form.append(path99, String(value22));
|
|
134101
134101
|
}
|
|
134102
134102
|
}
|
|
134103
134103
|
return form;
|
|
@@ -134135,30 +134135,30 @@ function isBodylessMethod(method) {
|
|
|
134135
134135
|
return method === "GET" || method === "HEAD";
|
|
134136
134136
|
}
|
|
134137
134137
|
var PARAMETER_NAME_REGEX = /^[\w-]+$/;
|
|
134138
|
-
function getDynamicPathParams(
|
|
134139
|
-
if (!
|
|
134138
|
+
function getDynamicPathParams(path99) {
|
|
134139
|
+
if (!path99.includes("{")) {
|
|
134140
134140
|
return void 0;
|
|
134141
134141
|
}
|
|
134142
|
-
const len =
|
|
134142
|
+
const len = path99.length;
|
|
134143
134143
|
let params;
|
|
134144
134144
|
let index = 1;
|
|
134145
134145
|
while (index < len) {
|
|
134146
134146
|
const segmentStart = index;
|
|
134147
|
-
const slashPos =
|
|
134147
|
+
const slashPos = path99.indexOf("/", index);
|
|
134148
134148
|
const segmentEnd = slashPos === -1 ? len : slashPos;
|
|
134149
|
-
if (segmentEnd > segmentStart &&
|
|
134149
|
+
if (segmentEnd > segmentStart && path99.charCodeAt(segmentStart) === 123 && path99.charCodeAt(segmentEnd - 1) === 125) {
|
|
134150
134150
|
let parameterStart = segmentStart + 1;
|
|
134151
134151
|
let allowsSlash = false;
|
|
134152
|
-
const operator =
|
|
134152
|
+
const operator = path99.charCodeAt(parameterStart);
|
|
134153
134153
|
if (operator === 43) {
|
|
134154
134154
|
allowsSlash = true;
|
|
134155
134155
|
parameterStart++;
|
|
134156
134156
|
}
|
|
134157
|
-
const parameterName =
|
|
134157
|
+
const parameterName = path99.slice(parameterStart, segmentEnd - 1);
|
|
134158
134158
|
if (PARAMETER_NAME_REGEX.test(parameterName)) {
|
|
134159
134159
|
params ??= [];
|
|
134160
134160
|
params.push({
|
|
134161
|
-
segment:
|
|
134161
|
+
segment: path99.slice(segmentStart, segmentEnd),
|
|
134162
134162
|
startIndex: segmentStart,
|
|
134163
134163
|
parameterName,
|
|
134164
134164
|
allowsSlash
|
|
@@ -134201,8 +134201,8 @@ openapi.method = (method) => ({
|
|
|
134201
134201
|
...openapi({ method }),
|
|
134202
134202
|
name: "~openapi/method"
|
|
134203
134203
|
});
|
|
134204
|
-
openapi.path = (
|
|
134205
|
-
...openapi({ path:
|
|
134204
|
+
openapi.path = (path99) => ({
|
|
134205
|
+
...openapi({ path: path99 }),
|
|
134206
134206
|
name: "~openapi/path"
|
|
134207
134207
|
});
|
|
134208
134208
|
openapi.spec = (spec) => ({
|
|
@@ -135121,22 +135121,22 @@ function visitJsonSchemaRefs(value3, visit2, schemaLevel = true, seen = /* @__PU
|
|
|
135121
135121
|
}
|
|
135122
135122
|
}
|
|
135123
135123
|
}
|
|
135124
|
-
function mapJsonSchemaRefs(value3, map3, schemaLevel = true,
|
|
135124
|
+
function mapJsonSchemaRefs(value3, map3, schemaLevel = true, path99 = []) {
|
|
135125
135125
|
if (!value3 || typeof value3 !== "object") {
|
|
135126
135126
|
return value3;
|
|
135127
135127
|
}
|
|
135128
135128
|
if (Array.isArray(value3)) {
|
|
135129
|
-
return value3.map((item, index) => mapJsonSchemaRefs(item, map3, schemaLevel, [...
|
|
135129
|
+
return value3.map((item, index) => mapJsonSchemaRefs(item, map3, schemaLevel, [...path99, index]));
|
|
135130
135130
|
}
|
|
135131
135131
|
const result = {};
|
|
135132
135132
|
for (const key of Object.keys(value3)) {
|
|
135133
135133
|
const val = value3[key];
|
|
135134
135134
|
if (key === "$ref" && typeof val === "string") {
|
|
135135
|
-
setOwn2(result, key, map3(val, [...
|
|
135135
|
+
setOwn2(result, key, map3(val, [...path99, key]));
|
|
135136
135136
|
} else if (!schemaLevel) {
|
|
135137
|
-
setOwn2(result, key, mapJsonSchemaRefs(val, map3, true, [...
|
|
135137
|
+
setOwn2(result, key, mapJsonSchemaRefs(val, map3, true, [...path99, key]));
|
|
135138
135138
|
} else if (JSON_SCHEMA_LOGIC_KEYWORDS.has(key) || JSON_SCHEMA_RECORD_KEYWORDS.has(key)) {
|
|
135139
|
-
setOwn2(result, key, mapJsonSchemaRefs(val, map3, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...
|
|
135139
|
+
setOwn2(result, key, mapJsonSchemaRefs(val, map3, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...path99, key]));
|
|
135140
135140
|
} else {
|
|
135141
135141
|
setOwn2(result, key, val);
|
|
135142
135142
|
}
|
|
@@ -135666,7 +135666,7 @@ function unlazy(maybeLazy) {
|
|
|
135666
135666
|
function createProcedureClient(lazyableProcedure, ...rest) {
|
|
135667
135667
|
const options = resolveMaybeOptionalOptions2(rest);
|
|
135668
135668
|
return async (...[input2, callerOptions]) => {
|
|
135669
|
-
const
|
|
135669
|
+
const path99 = toArray2(options.path);
|
|
135670
135670
|
const { default: procedure } = await unlazy(lazyableProcedure);
|
|
135671
135671
|
const clientContext = callerOptions?.context ?? {};
|
|
135672
135672
|
const context = await value2(options.context, clientContext) ?? {};
|
|
@@ -135679,7 +135679,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
135679
135679
|
};
|
|
135680
135680
|
try {
|
|
135681
135681
|
const output2 = await runWithSpan2("call_procedure", (span) => {
|
|
135682
|
-
span?.setAttribute("procedure.path",
|
|
135682
|
+
span?.setAttribute("procedure.path", path99);
|
|
135683
135683
|
return intercept2(
|
|
135684
135684
|
options.interceptors,
|
|
135685
135685
|
{
|
|
@@ -135687,7 +135687,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
135687
135687
|
// input can be optional if it is undefinable
|
|
135688
135688
|
input: input2,
|
|
135689
135689
|
errors,
|
|
135690
|
-
path:
|
|
135690
|
+
path: path99,
|
|
135691
135691
|
procedure,
|
|
135692
135692
|
signal: callerOptions?.signal,
|
|
135693
135693
|
lastEventId: callerOptions?.lastEventId
|
|
@@ -135938,10 +135938,10 @@ function augmentRouter(router, options) {
|
|
|
135938
135938
|
}
|
|
135939
135939
|
return enhanced;
|
|
135940
135940
|
}
|
|
135941
|
-
function getRouter(router,
|
|
135941
|
+
function getRouter(router, path99) {
|
|
135942
135942
|
let current = router;
|
|
135943
|
-
for (let i10 = 0; i10 <
|
|
135944
|
-
const segment =
|
|
135943
|
+
for (let i10 = 0; i10 < path99.length; i10++) {
|
|
135944
|
+
const segment = path99[i10];
|
|
135945
135945
|
if (!isTypescriptObject2(current)) {
|
|
135946
135946
|
return void 0;
|
|
135947
135947
|
}
|
|
@@ -135953,7 +135953,7 @@ function getRouter(router, path98) {
|
|
|
135953
135953
|
continue;
|
|
135954
135954
|
}
|
|
135955
135955
|
const lazied = current;
|
|
135956
|
-
const rest =
|
|
135956
|
+
const rest = path99.slice(i10);
|
|
135957
135957
|
return new Lazy({
|
|
135958
135958
|
...lazied["~orpc"],
|
|
135959
135959
|
async loader() {
|
|
@@ -135968,40 +135968,40 @@ function getRouter(router, path98) {
|
|
|
135968
135968
|
}
|
|
135969
135969
|
return current;
|
|
135970
135970
|
}
|
|
135971
|
-
function walkProcedureContractsSync(router, callback,
|
|
135971
|
+
function walkProcedureContractsSync(router, callback, path99 = []) {
|
|
135972
135972
|
const lazyResults = [];
|
|
135973
|
-
walkProcedureContractsSyncInternal(router, callback,
|
|
135973
|
+
walkProcedureContractsSyncInternal(router, callback, path99.slice(), lazyResults);
|
|
135974
135974
|
return lazyResults;
|
|
135975
135975
|
}
|
|
135976
|
-
function walkProcedureContractsSyncInternal(router, callback,
|
|
135976
|
+
function walkProcedureContractsSyncInternal(router, callback, path99, lazyResults) {
|
|
135977
135977
|
const hiddenContract = getHiddenRouterContract(router);
|
|
135978
135978
|
if (hiddenContract !== void 0) {
|
|
135979
135979
|
router = hiddenContract;
|
|
135980
135980
|
}
|
|
135981
135981
|
if (router instanceof ProcedureContract) {
|
|
135982
|
-
callback(router,
|
|
135982
|
+
callback(router, path99.slice());
|
|
135983
135983
|
return;
|
|
135984
135984
|
}
|
|
135985
135985
|
if (!isTypescriptObject2(router)) {
|
|
135986
135986
|
return;
|
|
135987
135987
|
}
|
|
135988
135988
|
for (const [key, value3] of Object.entries(router)) {
|
|
135989
|
-
|
|
135989
|
+
path99.push(key);
|
|
135990
135990
|
if (value3 instanceof Lazy) {
|
|
135991
|
-
lazyResults.push({ router: value3, path:
|
|
135991
|
+
lazyResults.push({ router: value3, path: path99.slice() });
|
|
135992
135992
|
} else {
|
|
135993
|
-
walkProcedureContractsSyncInternal(value3, callback,
|
|
135993
|
+
walkProcedureContractsSyncInternal(value3, callback, path99, lazyResults);
|
|
135994
135994
|
}
|
|
135995
|
-
|
|
135995
|
+
path99.pop();
|
|
135996
135996
|
}
|
|
135997
135997
|
}
|
|
135998
|
-
async function walkProcedureContractsAsync(router, callback,
|
|
135998
|
+
async function walkProcedureContractsAsync(router, callback, path99 = []) {
|
|
135999
135999
|
const hiddenContract = getHiddenRouterContract(router);
|
|
136000
136000
|
if (hiddenContract !== void 0) {
|
|
136001
136001
|
router = hiddenContract;
|
|
136002
136002
|
}
|
|
136003
136003
|
if (router instanceof ProcedureContract) {
|
|
136004
|
-
await callback(router,
|
|
136004
|
+
await callback(router, path99);
|
|
136005
136005
|
return;
|
|
136006
136006
|
}
|
|
136007
136007
|
if (!isTypescriptObject2(router)) {
|
|
@@ -136010,9 +136010,9 @@ async function walkProcedureContractsAsync(router, callback, path98 = []) {
|
|
|
136010
136010
|
for (const [key, value3] of Object.entries(router)) {
|
|
136011
136011
|
if (value3 instanceof Lazy) {
|
|
136012
136012
|
const { default: router2 } = await unlazy(value3);
|
|
136013
|
-
await walkProcedureContractsAsync(router2, callback, [...
|
|
136013
|
+
await walkProcedureContractsAsync(router2, callback, [...path99, key]);
|
|
136014
136014
|
} else {
|
|
136015
|
-
await walkProcedureContractsAsync(value3, callback, [...
|
|
136015
|
+
await walkProcedureContractsAsync(value3, callback, [...path99, key]);
|
|
136016
136016
|
}
|
|
136017
136017
|
}
|
|
136018
136018
|
}
|
|
@@ -136498,18 +136498,18 @@ function rewriteComponentSchemaRefs(schema, renameMap) {
|
|
|
136498
136498
|
}
|
|
136499
136499
|
var OpenAPIGeneratorError = class extends TypeError {
|
|
136500
136500
|
};
|
|
136501
|
-
function toOpenAPIPath(
|
|
136501
|
+
function toOpenAPIPath(path99, dynamicPathParams) {
|
|
136502
136502
|
if (!dynamicPathParams?.length) {
|
|
136503
|
-
return
|
|
136503
|
+
return path99;
|
|
136504
136504
|
}
|
|
136505
136505
|
let normalized = "";
|
|
136506
136506
|
let currentIndex = 0;
|
|
136507
136507
|
for (const param of dynamicPathParams) {
|
|
136508
|
-
normalized +=
|
|
136508
|
+
normalized += path99.slice(currentIndex, param.startIndex);
|
|
136509
136509
|
normalized += `{${param.parameterName}}`;
|
|
136510
136510
|
currentIndex = param.startIndex + param.segment.length;
|
|
136511
136511
|
}
|
|
136512
|
-
normalized +=
|
|
136512
|
+
normalized += path99.slice(currentIndex);
|
|
136513
136513
|
return normalized;
|
|
136514
136514
|
}
|
|
136515
136515
|
function buildRequest(ctx, operation, def, meta3, dynamicPathParams) {
|
|
@@ -136966,8 +136966,8 @@ var OpenAPIGenerator = class {
|
|
|
136966
136966
|
customErrorResponseBodySchema: options.customErrorResponseBodySchema
|
|
136967
136967
|
};
|
|
136968
136968
|
const errors = [];
|
|
136969
|
-
await walkProcedureContractsAsync(router, (contract,
|
|
136970
|
-
if (value2(options.filter, contract,
|
|
136969
|
+
await walkProcedureContractsAsync(router, (contract, path99) => {
|
|
136970
|
+
if (value2(options.filter, contract, path99) === false) {
|
|
136971
136971
|
return;
|
|
136972
136972
|
}
|
|
136973
136973
|
try {
|
|
@@ -136979,7 +136979,7 @@ var OpenAPIGenerator = class {
|
|
|
136979
136979
|
`QUERY operations require OpenAPI 3.2, but version "${version2}" was requested.`
|
|
136980
136980
|
);
|
|
136981
136981
|
}
|
|
136982
|
-
const postPath = meta3?.path ?? pathToHttpPath2(
|
|
136982
|
+
const postPath = meta3?.path ?? pathToHttpPath2(path99);
|
|
136983
136983
|
const httpPath = meta3?.prefix ? mergeHttpPath(meta3.prefix, postPath) : postPath;
|
|
136984
136984
|
const dynamicPathParams = getDynamicPathParams(httpPath);
|
|
136985
136985
|
const openApiPath = toOpenAPIPath(httpPath, dynamicPathParams);
|
|
@@ -136988,7 +136988,7 @@ var OpenAPIGenerator = class {
|
|
|
136988
136988
|
operation = meta3.spec;
|
|
136989
136989
|
} else {
|
|
136990
136990
|
operation = {
|
|
136991
|
-
operationId: meta3?.operationId ??
|
|
136991
|
+
operationId: meta3?.operationId ?? path99.join("."),
|
|
136992
136992
|
summary: meta3?.summary,
|
|
136993
136993
|
description: meta3?.description,
|
|
136994
136994
|
deprecated: meta3?.deprecated,
|
|
@@ -137008,7 +137008,7 @@ var OpenAPIGenerator = class {
|
|
|
137008
137008
|
if (!(e10 instanceof OpenAPIGeneratorError)) {
|
|
137009
137009
|
throw e10;
|
|
137010
137010
|
}
|
|
137011
|
-
errors.push(`Procedure at ${
|
|
137011
|
+
errors.push(`Procedure at ${path99.join(".") || "(root)"}: ${e10.message}`);
|
|
137012
137012
|
}
|
|
137013
137013
|
});
|
|
137014
137014
|
if (errors.length) {
|
|
@@ -137794,16 +137794,16 @@ var StandardLink = class {
|
|
|
137794
137794
|
/**
|
|
137795
137795
|
* @throws ORPCError, MalformedResponseError, transport-level errors (network failures, timeouts, etc.)
|
|
137796
137796
|
*/
|
|
137797
|
-
call(
|
|
137798
|
-
return runWithSpan(`${ORPC_NAME}.${
|
|
137797
|
+
call(path99, input2, options) {
|
|
137798
|
+
return runWithSpan(`${ORPC_NAME}.${path99.join("/")}`, (span) => {
|
|
137799
137799
|
span?.setAttribute("rpc.system", ORPC_NAME);
|
|
137800
|
-
span?.setAttribute("rpc.method",
|
|
137800
|
+
span?.setAttribute("rpc.method", path99.join("."));
|
|
137801
137801
|
if (getTracer() && isAsyncIteratorObject(input2)) {
|
|
137802
137802
|
input2 = override(input2, traceAsyncIterator("consume_async_iterator_object_input", input2));
|
|
137803
137803
|
} else if (getTracer() && input2 instanceof ReadableStream) {
|
|
137804
137804
|
input2 = override(input2, traceReadableStream("consume_octet_stream_input", input2));
|
|
137805
137805
|
}
|
|
137806
|
-
return intercept(this.interceptors, { ...options, path:
|
|
137806
|
+
return intercept(this.interceptors, { ...options, path: path99, input: input2 }, async ({ path: path210, input: input22, ...options2 }) => {
|
|
137807
137807
|
const tracer = getTracer();
|
|
137808
137808
|
const activeSpan = tracer?.getActiveSpan() ?? span;
|
|
137809
137809
|
let request7 = await runWithSpan(
|
|
@@ -137860,18 +137860,18 @@ var RPCLinkCodec = class {
|
|
|
137860
137860
|
this.headers = options.headers ?? {};
|
|
137861
137861
|
this.serializer = options.serializer ?? new RPCSerializer();
|
|
137862
137862
|
}
|
|
137863
|
-
async encodeInput(input2,
|
|
137864
|
-
let headers = toResolvedStandardHeaders(await value(this.headers, options,
|
|
137863
|
+
async encodeInput(input2, path99, options) {
|
|
137864
|
+
let headers = toResolvedStandardHeaders(await value(this.headers, options, path99, input2));
|
|
137865
137865
|
if (options.lastEventId !== void 0) {
|
|
137866
137866
|
headers = mergeStandardHeaders(headers, { "last-event-id": options.lastEventId });
|
|
137867
137867
|
}
|
|
137868
|
-
const expectedMethod = await value(this.expectedMethod, options,
|
|
137869
|
-
const baseUrl = await value(this.baseUrl, options,
|
|
137868
|
+
const expectedMethod = await value(this.expectedMethod, options, path99, input2);
|
|
137869
|
+
const baseUrl = await value(this.baseUrl, options, path99, input2);
|
|
137870
137870
|
const [pathname, search, hash2] = parseStandardUrl(baseUrl);
|
|
137871
|
-
const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(
|
|
137871
|
+
const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(path99)}`;
|
|
137872
137872
|
const serialized = this.serializer.serialize(input2);
|
|
137873
137873
|
if (expectedMethod === "GET" && !(serialized instanceof Blob) && !(serialized instanceof ReadableStream) && !(serialized instanceof FormData) && !isAsyncIteratorObject(serialized)) {
|
|
137874
|
-
const maxUrlLength = await value(this.maxUrlLength, options,
|
|
137874
|
+
const maxUrlLength = await value(this.maxUrlLength, options, path99, input2);
|
|
137875
137875
|
const mergedSearch = new URLSearchParams(search);
|
|
137876
137876
|
mergedSearch.append("data", stringifyJSON(serialized) ?? "");
|
|
137877
137877
|
const url22 = `${newPathname}?${mergedSearch}${hash2 ?? ""}`;
|
|
@@ -137958,8 +137958,8 @@ var FetchLinkTransport = class {
|
|
|
137958
137958
|
this.fetch = options.fetch ?? ((url2, init) => globalThis.fetch(url2, init));
|
|
137959
137959
|
this.toFetchRequestOptions = options.toFetchRequest;
|
|
137960
137960
|
}
|
|
137961
|
-
async send(standardRequest,
|
|
137962
|
-
let origin = await value(this.origin, options,
|
|
137961
|
+
async send(standardRequest, path99, options) {
|
|
137962
|
+
let origin = await value(this.origin, options, path99);
|
|
137963
137963
|
if (origin?.endsWith("/")) {
|
|
137964
137964
|
origin = origin.slice(0, -1);
|
|
137965
137965
|
}
|
|
@@ -137979,7 +137979,7 @@ var FetchLinkTransport = class {
|
|
|
137979
137979
|
}
|
|
137980
137980
|
}
|
|
137981
137981
|
const fetch3 = this.fetch;
|
|
137982
|
-
const response = await fetch3(url2, init, options,
|
|
137982
|
+
const response = await fetch3(url2, init, options, path99);
|
|
137983
137983
|
if (response.type === "opaqueredirect") {
|
|
137984
137984
|
throw new TypeError("Unexpected redirect response: redirects are not followed.");
|
|
137985
137985
|
}
|
|
@@ -138566,14 +138566,14 @@ var StandardHandler = class {
|
|
|
138566
138566
|
span?.setAttribute("url.path", request22.url);
|
|
138567
138567
|
return { matched: false };
|
|
138568
138568
|
}
|
|
138569
|
-
const { path:
|
|
138570
|
-
span?.updateName(`${ORPC_NAME2}.${
|
|
138569
|
+
const { path: path99, procedure, decodeInput } = matchedOrNot;
|
|
138570
|
+
span?.updateName(`${ORPC_NAME2}.${path99.join("/")}`);
|
|
138571
138571
|
span?.setAttribute("rpc.system", ORPC_NAME2);
|
|
138572
|
-
span?.setAttribute("rpc.method",
|
|
138572
|
+
span?.setAttribute("rpc.method", path99.join("."));
|
|
138573
138573
|
try {
|
|
138574
138574
|
const response = await intercept2(
|
|
138575
138575
|
this.interceptors,
|
|
138576
|
-
{ context: context2, prefix: prefix2, request: request22, path:
|
|
138576
|
+
{ context: context2, prefix: prefix2, request: request22, path: path99, procedure, decodeInput },
|
|
138577
138577
|
async ({ context: context3, prefix: prefix3, request: request32, path: path210, procedure: procedure2, decodeInput: decodeInput2 }) => {
|
|
138578
138578
|
step2 = "decode_input";
|
|
138579
138579
|
let input2 = await runWithSpan2("decode_input", decodeInput2);
|
|
@@ -138607,7 +138607,7 @@ var StandardHandler = class {
|
|
|
138607
138607
|
message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
|
|
138608
138608
|
cause: e10
|
|
138609
138609
|
}) : toORPCError2(e10);
|
|
138610
|
-
const response = await this.codec.encodeError(error63, procedure,
|
|
138610
|
+
const response = await this.codec.encodeError(error63, procedure, path99, { context: context2, prefix: prefix2 });
|
|
138611
138611
|
return { matched: true, response };
|
|
138612
138612
|
}
|
|
138613
138613
|
}
|
|
@@ -138714,7 +138714,7 @@ var RPCMatcher = class {
|
|
|
138714
138714
|
this.rootRouter = router;
|
|
138715
138715
|
this.index(router);
|
|
138716
138716
|
}
|
|
138717
|
-
index(router,
|
|
138717
|
+
index(router, path99 = []) {
|
|
138718
138718
|
const lazyResults = walkProcedureContractsSync(router, (procedure, procedurePath) => {
|
|
138719
138719
|
if (!value2(this.filter, procedure, procedurePath)) {
|
|
138720
138720
|
return;
|
|
@@ -138725,7 +138725,7 @@ var RPCMatcher = class {
|
|
|
138725
138725
|
// contract-first entries have no implementation yet, resolveProcedure fills it in on demand
|
|
138726
138726
|
procedure: procedure instanceof Procedure ? procedure : void 0
|
|
138727
138727
|
});
|
|
138728
|
-
},
|
|
138728
|
+
}, path99);
|
|
138729
138729
|
for (const result of lazyResults) {
|
|
138730
138730
|
this.pendingLazyRouters.set(pathToHttpPath2(result.path), result);
|
|
138731
138731
|
}
|
|
@@ -138857,10 +138857,10 @@ var RPCHandlerCodec = class {
|
|
|
138857
138857
|
}
|
|
138858
138858
|
};
|
|
138859
138859
|
}
|
|
138860
|
-
encodeOutput(output2, procedure,
|
|
138860
|
+
encodeOutput(output2, procedure, path99, options) {
|
|
138861
138861
|
return {
|
|
138862
138862
|
headers: {},
|
|
138863
|
-
status: value2(this.outputStatus, output2, procedure,
|
|
138863
|
+
status: value2(this.outputStatus, output2, procedure, path99, options) ?? DEFAULT_SUCCESS_STATUS,
|
|
138864
138864
|
body: this.serializer.serialize(output2)
|
|
138865
138865
|
};
|
|
138866
138866
|
}
|
|
@@ -138936,19 +138936,19 @@ function matchesZero(m10) {
|
|
|
138936
138936
|
const last = m10.paramsMap[m10.paramsMap.length - 1];
|
|
138937
138937
|
return last[2] || !!last[3] && !last[5];
|
|
138938
138938
|
}
|
|
138939
|
-
function normalizePath(
|
|
138940
|
-
if (!
|
|
138939
|
+
function normalizePath(path99) {
|
|
138940
|
+
if (!path99.includes("/.")) return path99;
|
|
138941
138941
|
const r10 = [];
|
|
138942
138942
|
let s = "";
|
|
138943
|
-
for (s of
|
|
138943
|
+
for (s of path99.split("/")) if (s === ".") continue;
|
|
138944
138944
|
else if (s === "..") {
|
|
138945
138945
|
if (r10.length > 1) r10.pop();
|
|
138946
138946
|
} else r10.push(s);
|
|
138947
138947
|
if (s === "." || s === "..") r10.push("");
|
|
138948
138948
|
return r10.join("/") || "/";
|
|
138949
138949
|
}
|
|
138950
|
-
function splitPath(
|
|
138951
|
-
const s =
|
|
138950
|
+
function splitPath(path99) {
|
|
138951
|
+
const s = path99.split("/");
|
|
138952
138952
|
s.shift();
|
|
138953
138953
|
return s;
|
|
138954
138954
|
}
|
|
@@ -138991,9 +138991,9 @@ function getMatchParams(segments, paramsMap, suffix, slash) {
|
|
|
138991
138991
|
}
|
|
138992
138992
|
return params;
|
|
138993
138993
|
}
|
|
138994
|
-
function encodeEscapes(
|
|
138995
|
-
if (!
|
|
138996
|
-
return
|
|
138994
|
+
function encodeEscapes(path99) {
|
|
138995
|
+
if (!path99.includes("\\")) return path99;
|
|
138996
|
+
return path99.replace(/\\([:(){}\\])/g, (_, c10) => "\uFFFD" + ESCAPABLE.indexOf(c10));
|
|
138997
138997
|
}
|
|
138998
138998
|
function decodeEscapes(segment, prefix) {
|
|
138999
138999
|
return segment.replace(/\uFFFD([0-5])/g, (_, i10) => prefix + ESCAPABLE[i10]);
|
|
@@ -139030,11 +139030,11 @@ function classSetOp(s) {
|
|
|
139030
139030
|
}))) ;
|
|
139031
139031
|
return found;
|
|
139032
139032
|
}
|
|
139033
|
-
function starGroups(
|
|
139034
|
-
if (!
|
|
139033
|
+
function starGroups(path99) {
|
|
139034
|
+
if (!path99.includes("(.*)")) return [path99];
|
|
139035
139035
|
let count2 = 0;
|
|
139036
139036
|
let unnamed;
|
|
139037
|
-
return [
|
|
139037
|
+
return [path99.replace(/\\[\s\S]|(:[A-Za-z_]\w*)?\((?!\?)(\.\*\)(?!\*))?/g, (m10, name, star, at2) => {
|
|
139038
139038
|
if (m10[0] === "\\" || !star) {
|
|
139039
139039
|
if (m10[0] === "(") count2++;
|
|
139040
139040
|
return m10;
|
|
@@ -139043,25 +139043,25 @@ function starGroups(path98) {
|
|
|
139043
139043
|
const k10 = count2;
|
|
139044
139044
|
unnamed = (index) => index === k10 ? name.slice(1) : index > k10 ? index - 1 : index;
|
|
139045
139045
|
} else count2++;
|
|
139046
|
-
return /(^|[^\\])(\\\\)*([)*}?]|:[A-Za-z_]\w*)\{?$/.test(
|
|
139046
|
+
return /(^|[^\\])(\\\\)*([)*}?]|:[A-Za-z_]\w*)\{?$/.test(path99.slice(0, at2)) ? "\uFFFF*" : "*";
|
|
139047
139047
|
}), unnamed];
|
|
139048
139048
|
}
|
|
139049
|
-
function absolutePattern(
|
|
139050
|
-
return /^[/{]/.test(
|
|
139049
|
+
function absolutePattern(path99) {
|
|
139050
|
+
return /^[/{]/.test(path99) ? path99 : `/${path99}`;
|
|
139051
139051
|
}
|
|
139052
|
-
function dotSegments(
|
|
139053
|
-
if (!DOT_SEGMENT.test(
|
|
139054
|
-
const s =
|
|
139052
|
+
function dotSegments(path99) {
|
|
139053
|
+
if (!DOT_SEGMENT.test(path99)) return path99;
|
|
139054
|
+
const s = path99.split("/");
|
|
139055
139055
|
const out = [s[0]];
|
|
139056
139056
|
let dot = false;
|
|
139057
139057
|
for (let i10 = 1; i10 < s.length; i10++) {
|
|
139058
139058
|
const m10 = /^(?:\.|%2e)(\.|%2e)?$/i.exec(s[i10]);
|
|
139059
139059
|
if (m10) {
|
|
139060
|
-
if (m10[1] && (out.length > 1 || out[0]) && !isText(out.pop())) invalidSyntax(DOT_SEGMENT_NEXT_TO,
|
|
139060
|
+
if (m10[1] && (out.length > 1 || out[0]) && !isText(out.pop())) invalidSyntax(DOT_SEGMENT_NEXT_TO, path99);
|
|
139061
139061
|
dot = true;
|
|
139062
139062
|
continue;
|
|
139063
139063
|
}
|
|
139064
|
-
if (dot && /^[:*(]/.test(s[i10])) invalidSyntax(DOT_SEGMENT_NEXT_TO,
|
|
139064
|
+
if (dot && /^[:*(]/.test(s[i10])) invalidSyntax(DOT_SEGMENT_NEXT_TO, path99);
|
|
139065
139065
|
out.push(s[i10]);
|
|
139066
139066
|
dot = false;
|
|
139067
139067
|
}
|
|
@@ -139128,17 +139128,17 @@ function splitStar(segments, input2) {
|
|
|
139128
139128
|
function oneCatchAll(input2) {
|
|
139129
139129
|
throw new Error(`rou3: a route can have only one \`*\`, \`**\`, \`:name+\` or \`:name*\` (${input2})`);
|
|
139130
139130
|
}
|
|
139131
|
-
function splitRoute(
|
|
139132
|
-
const s = splitPath(
|
|
139131
|
+
function splitRoute(path99) {
|
|
139132
|
+
const s = splitPath(path99);
|
|
139133
139133
|
while (s[s.length - 1] === "") s.pop();
|
|
139134
|
-
if (
|
|
139134
|
+
if (path99.includes("**")) {
|
|
139135
139135
|
for (let i10 = 0; i10 < s.length; i10++) if (/^\*\*[^:{}]/.test(s[i10])) s.splice(i10, 1, ...s[i10][2] === "*" ? ["**", s[i10].slice(2)] : [s[i10].slice(1)]);
|
|
139136
139136
|
}
|
|
139137
139137
|
return s;
|
|
139138
139138
|
}
|
|
139139
|
-
function expandedRouteId(
|
|
139140
|
-
if (
|
|
139141
|
-
return "/" + splitRoute(encodeEscapes(
|
|
139139
|
+
function expandedRouteId(path99) {
|
|
139140
|
+
if (path99.charCodeAt(0) !== 47) return `{${expandedRouteId(`/${path99}`)}`;
|
|
139141
|
+
return "/" + splitRoute(encodeEscapes(path99)).map((segment) => {
|
|
139142
139142
|
const key = segmentKey(segment);
|
|
139143
139143
|
return typeof key === "string" ? key : segment;
|
|
139144
139144
|
}).join("/");
|
|
@@ -139160,40 +139160,40 @@ function segmentWildcards(segment) {
|
|
|
139160
139160
|
}
|
|
139161
139161
|
return at2;
|
|
139162
139162
|
}
|
|
139163
|
-
function scanFirstGroup(
|
|
139163
|
+
function scanFirstGroup(path99) {
|
|
139164
139164
|
let i10 = 0;
|
|
139165
139165
|
let depth = 0;
|
|
139166
|
-
for (; i10 <
|
|
139167
|
-
const c10 =
|
|
139166
|
+
for (; i10 < path99.length; i10++) {
|
|
139167
|
+
const c10 = path99.charCodeAt(i10);
|
|
139168
139168
|
if (c10 === 92) i10++;
|
|
139169
139169
|
else if (c10 === 40) depth++;
|
|
139170
139170
|
else if (c10 === 41 && depth > 0) depth--;
|
|
139171
139171
|
else if (c10 === 123 && depth === 0) break;
|
|
139172
139172
|
}
|
|
139173
|
-
if (i10 >=
|
|
139173
|
+
if (i10 >= path99.length) return;
|
|
139174
139174
|
let j10 = i10 + 1;
|
|
139175
139175
|
depth = 0;
|
|
139176
|
-
for (; j10 <
|
|
139177
|
-
const c10 =
|
|
139176
|
+
for (; j10 < path99.length; j10++) {
|
|
139177
|
+
const c10 = path99.charCodeAt(j10);
|
|
139178
139178
|
if (c10 === 92) j10++;
|
|
139179
139179
|
else if (c10 === 40) depth++;
|
|
139180
139180
|
else if (c10 === 41 && depth > 0) depth--;
|
|
139181
139181
|
else if (c10 === 125 && depth === 0) break;
|
|
139182
139182
|
}
|
|
139183
|
-
if (j10 >=
|
|
139184
|
-
const mod =
|
|
139183
|
+
if (j10 >= path99.length) return;
|
|
139184
|
+
const mod = path99[j10 + 1];
|
|
139185
139185
|
const hasMod = mod === "?" || mod === "+" || mod === "*";
|
|
139186
139186
|
return [
|
|
139187
|
-
|
|
139188
|
-
|
|
139189
|
-
|
|
139187
|
+
path99.slice(0, i10),
|
|
139188
|
+
path99.slice(i10 + 1, j10).replace(NAME_CHAR, "\\$&"),
|
|
139189
|
+
path99.slice(j10 + (hasMod ? 2 : 1)).replace(NAME_CHAR, "\\$&"),
|
|
139190
139190
|
hasMod ? mod : void 0
|
|
139191
139191
|
];
|
|
139192
139192
|
}
|
|
139193
139193
|
var NAME_CHAR = /^[\w$\x80-]/;
|
|
139194
|
-
function expandGroupDelimiters(
|
|
139195
|
-
if (!
|
|
139196
|
-
const group = scanFirstGroup(
|
|
139194
|
+
function expandGroupDelimiters(path99, input2 = path99) {
|
|
139195
|
+
if (!path99.includes("{")) return;
|
|
139196
|
+
const group = scanFirstGroup(path99);
|
|
139197
139197
|
if (!group) return;
|
|
139198
139198
|
const [pre2, body, suf, mod] = group;
|
|
139199
139199
|
if (mod === "+" || mod === "*") invalidSyntax(`unsupported \`{}${mod}\``, input2);
|
|
@@ -139295,43 +139295,43 @@ function linearRegExp(regexp) {
|
|
|
139295
139295
|
return source === regexp.source ? regexp : new RegExp(`^${head}${source.slice(1)}`);
|
|
139296
139296
|
}
|
|
139297
139297
|
var upTo = (L, back) => L.replace(/^\\/, "").length < 2 ? `[^/${L}]*` : back ? `(?:[^/](?<!${L}))*` : `(?:(?!${L})[^/])*`;
|
|
139298
|
-
function addRoute(ctx, method = "",
|
|
139298
|
+
function addRoute(ctx, method = "", path99, data) {
|
|
139299
139299
|
method = method.toUpperCase();
|
|
139300
|
-
|
|
139301
|
-
checkConstraints(
|
|
139302
|
-
const resolved = dotSegments(
|
|
139300
|
+
path99 = absolutePattern(path99);
|
|
139301
|
+
checkConstraints(path99);
|
|
139302
|
+
const resolved = dotSegments(path99);
|
|
139303
139303
|
const [route, unnamed] = starGroups(resolved);
|
|
139304
139304
|
variants = void 0;
|
|
139305
|
-
_add(ctx, method, route, data, unnamed && expandedRouteId(resolved),
|
|
139305
|
+
_add(ctx, method, route, data, unnamed && expandedRouteId(resolved), path99, unnamed);
|
|
139306
139306
|
}
|
|
139307
139307
|
var variants;
|
|
139308
|
-
function _add(ctx, method,
|
|
139309
|
-
const groupExpanded = expandGroupDelimiters(
|
|
139308
|
+
function _add(ctx, method, path99, data, route, input2 = path99, unnamed = same) {
|
|
139309
|
+
const groupExpanded = expandGroupDelimiters(path99, input2);
|
|
139310
139310
|
if (groupExpanded) {
|
|
139311
139311
|
if (groupExpanded[1] !== void 0) {
|
|
139312
|
-
route ??= expandedRouteId(
|
|
139312
|
+
route ??= expandedRouteId(path99);
|
|
139313
139313
|
variants ??= {};
|
|
139314
139314
|
}
|
|
139315
139315
|
_add(ctx, method, groupExpanded[0], data, route, input2, unnamed);
|
|
139316
|
-
if (groupExpanded[1] !== void 0) _add(ctx, method, groupExpanded[1], data, route, input2, /[*(]/.test(
|
|
139316
|
+
if (groupExpanded[1] !== void 0) _add(ctx, method, groupExpanded[1], data, route, input2, /[*(]/.test(path99) ? skipGroup(path99, input2, unnamed) : unnamed);
|
|
139317
139317
|
return 0;
|
|
139318
139318
|
}
|
|
139319
|
-
|
|
139320
|
-
const segments = splitRoute(
|
|
139319
|
+
path99 = encodeEscapes(path99);
|
|
139320
|
+
const segments = splitRoute(path99);
|
|
139321
139321
|
const expanded = expandModifiers(segments, input2);
|
|
139322
139322
|
if (expanded) {
|
|
139323
|
-
route ??= expandedRouteId(
|
|
139323
|
+
route ??= expandedRouteId(path99);
|
|
139324
139324
|
variants ??= {};
|
|
139325
139325
|
let count2 = 0;
|
|
139326
139326
|
for (const p of expanded) count2 = _add(ctx, method, p, data, route, input2, unnamed);
|
|
139327
139327
|
return count2;
|
|
139328
139328
|
}
|
|
139329
|
-
const star =
|
|
139329
|
+
const star = path99.includes("*");
|
|
139330
139330
|
const split = star ? splitStar(segments, input2) : void 0;
|
|
139331
139331
|
if (split) {
|
|
139332
139332
|
const [routes, join4, head] = split;
|
|
139333
139333
|
if (routes.length > 1) {
|
|
139334
|
-
route ??= expandedRouteId(
|
|
139334
|
+
route ??= expandedRouteId(path99);
|
|
139335
139335
|
variants ??= {};
|
|
139336
139336
|
}
|
|
139337
139337
|
let count2 = 0;
|
|
@@ -139451,8 +139451,8 @@ function _insert(ctx, method, segments, data, route, input2, unnamed, star, join
|
|
|
139451
139451
|
return _unnamedParamIndex;
|
|
139452
139452
|
}
|
|
139453
139453
|
var same = (index) => index;
|
|
139454
|
-
function skipGroup(
|
|
139455
|
-
const [pre2, body] = scanFirstGroup(
|
|
139454
|
+
function skipGroup(path99, input2, unnamed = same) {
|
|
139455
|
+
const [pre2, body] = scanFirstGroup(path99);
|
|
139456
139456
|
if (!/[*(]/.test(body) && !pre2.endsWith("*")) return unnamed;
|
|
139457
139457
|
const count2 = (p) => _add(createRouter(), "", p, void 0, void 0, input2);
|
|
139458
139458
|
const before = count2(pre2);
|
|
@@ -139514,11 +139514,11 @@ function kindAt(m10, n10, p) {
|
|
|
139514
139514
|
} else if ((suffix && index > suffix[0] ? index - suffix[0] - 1 + end : index) === p) return typeof name === "string" || plain ? 0 : 2;
|
|
139515
139515
|
return 3;
|
|
139516
139516
|
}
|
|
139517
|
-
function findAllRoutes(ctx, method = "",
|
|
139518
|
-
if (opts?.normalize)
|
|
139519
|
-
const slash =
|
|
139520
|
-
if (slash)
|
|
139521
|
-
const segments = splitPath(
|
|
139517
|
+
function findAllRoutes(ctx, method = "", path99, opts) {
|
|
139518
|
+
if (opts?.normalize) path99 = normalizePath(path99);
|
|
139519
|
+
const slash = path99.charCodeAt(path99.length - 1) === 47;
|
|
139520
|
+
if (slash) path99 = path99.slice(0, -1);
|
|
139521
|
+
const segments = splitPath(path99);
|
|
139522
139522
|
const matches2 = _findRanked(ctx, method, segments);
|
|
139523
139523
|
let seen;
|
|
139524
139524
|
for (let i10 = matches2.length - 1; i10 >= 0; i10--) {
|
|
@@ -139575,16 +139575,16 @@ function pushSorted(matches2, match, reverse) {
|
|
|
139575
139575
|
}).sort((a10, b) => a10[1] - b[1]).map((e10) => e10[0]);
|
|
139576
139576
|
for (const m10 of match) matches2.push(m10);
|
|
139577
139577
|
}
|
|
139578
|
-
function findRoute(ctx, method = "",
|
|
139579
|
-
if (opts?.normalize)
|
|
139580
|
-
const slash =
|
|
139581
|
-
if (slash)
|
|
139582
|
-
const staticNode = ctx.static[
|
|
139578
|
+
function findRoute(ctx, method = "", path99, opts) {
|
|
139579
|
+
if (opts?.normalize) path99 = normalizePath(path99);
|
|
139580
|
+
const slash = path99.charCodeAt(path99.length - 1) === 47;
|
|
139581
|
+
if (slash) path99 = path99.slice(0, -1);
|
|
139582
|
+
const staticNode = ctx.static[path99];
|
|
139583
139583
|
if (staticNode && staticNode.methods) {
|
|
139584
139584
|
const staticMatch = staticNode.methods[method] || staticNode.methods[""];
|
|
139585
139585
|
if (staticMatch !== void 0) return { data: staticMatch[0].data };
|
|
139586
139586
|
}
|
|
139587
|
-
const segments = splitPath(
|
|
139587
|
+
const segments = splitPath(path99);
|
|
139588
139588
|
let match;
|
|
139589
139589
|
if (segments.includes("") || ctx.root.hasSuffix && hasSuffixMatch(ctx.root, method, segments, 0)) {
|
|
139590
139590
|
const matches2 = _findRanked(ctx, method, segments, true);
|
|
@@ -139880,8 +139880,8 @@ var STAR_SEGMENT = "*/";
|
|
|
139880
139880
|
function routeToRegExp(route = "/") {
|
|
139881
139881
|
route = absolutePattern(route);
|
|
139882
139882
|
addRoute(createRouter(), "", route);
|
|
139883
|
-
const [
|
|
139884
|
-
return new RegExp(determinize(toRegExp(
|
|
139883
|
+
const [path99, unnamed] = starGroups(dotSegments(route));
|
|
139884
|
+
return new RegExp(determinize(toRegExp(path99, route, unnamed).source));
|
|
139885
139885
|
}
|
|
139886
139886
|
function toRegExp(route, input2, unnamed) {
|
|
139887
139887
|
const inlineOptional = inlineOptionalGroup(route, input2, unnamed);
|
|
@@ -140238,7 +140238,7 @@ var OpenAPIMatcher = class {
|
|
|
140238
140238
|
this.rootRouter = router;
|
|
140239
140239
|
this.index(router);
|
|
140240
140240
|
}
|
|
140241
|
-
index(router,
|
|
140241
|
+
index(router, path99 = []) {
|
|
140242
140242
|
const routes = [];
|
|
140243
140243
|
const lazyResults = walkProcedureContractsSync(router, (contract, path210) => {
|
|
140244
140244
|
if (!value2(this.filter, contract, path210)) {
|
|
@@ -140259,7 +140259,7 @@ var OpenAPIMatcher = class {
|
|
|
140259
140259
|
...route
|
|
140260
140260
|
}
|
|
140261
140261
|
});
|
|
140262
|
-
},
|
|
140262
|
+
}, path99);
|
|
140263
140263
|
const pendingLazyRouters = lazyResults.map((result) => {
|
|
140264
140264
|
const prefix = getOpenAPIMeta(result.router)?.prefix;
|
|
140265
140265
|
return {
|
|
@@ -140359,10 +140359,10 @@ var OpenAPIMatcher = class {
|
|
|
140359
140359
|
return entry.procedure;
|
|
140360
140360
|
}
|
|
140361
140361
|
};
|
|
140362
|
-
function toRou3Route(
|
|
140363
|
-
const dynamicParams = getDynamicPathParams(
|
|
140362
|
+
function toRou3Route(path99) {
|
|
140363
|
+
const dynamicParams = getDynamicPathParams(path99);
|
|
140364
140364
|
if (!dynamicParams) {
|
|
140365
|
-
return { pattern: toRou3Literal(
|
|
140365
|
+
return { pattern: toRou3Literal(path99) };
|
|
140366
140366
|
}
|
|
140367
140367
|
let pattern = "";
|
|
140368
140368
|
let literalStart = 0;
|
|
@@ -140371,11 +140371,11 @@ function toRou3Route(path98) {
|
|
|
140371
140371
|
for (const param of dynamicParams) {
|
|
140372
140372
|
const key = `p${params.length}`;
|
|
140373
140373
|
params.push([key, param.parameterName]);
|
|
140374
|
-
pattern += toRou3Literal(
|
|
140374
|
+
pattern += toRou3Literal(path99.slice(literalStart, param.startIndex));
|
|
140375
140375
|
literalStart = param.startIndex + param.segment.length;
|
|
140376
140376
|
if (param.allowsSlash) {
|
|
140377
140377
|
if (catchAllKey !== void 0) {
|
|
140378
|
-
throw new TypeError(`OpenAPI path "${
|
|
140378
|
+
throw new TypeError(`OpenAPI path "${path99}" has more than one catch-all param ({+name}), but only one is supported per path.`);
|
|
140379
140379
|
}
|
|
140380
140380
|
catchAllKey = key;
|
|
140381
140381
|
pattern += `:${key}(.*)`;
|
|
@@ -140383,7 +140383,7 @@ function toRou3Route(path98) {
|
|
|
140383
140383
|
pattern += `:${key}`;
|
|
140384
140384
|
}
|
|
140385
140385
|
}
|
|
140386
|
-
pattern += toRou3Literal(
|
|
140386
|
+
pattern += toRou3Literal(path99.slice(literalStart));
|
|
140387
140387
|
return { pattern, params, catchAllKey };
|
|
140388
140388
|
}
|
|
140389
140389
|
var ROU3_SYNTAX_REGEX = /[\\:*?+(){}]|(?<![^/])\.(?=\.?(?:\/|$))/g;
|
|
@@ -140391,8 +140391,8 @@ function toRou3Literal(text5) {
|
|
|
140391
140391
|
const normalized = NORMALIZABLE_PATHNAME_REGEX2.test(text5) ? normalizeRou3Path(text5) : text5;
|
|
140392
140392
|
return normalized.replace(ROU3_SYNTAX_REGEX, "\\$&");
|
|
140393
140393
|
}
|
|
140394
|
-
function normalizeRou3Path(
|
|
140395
|
-
return
|
|
140394
|
+
function normalizeRou3Path(path99) {
|
|
140395
|
+
return path99.split("/").map((segment) => safeDecodeURIComponent2(segment).replace(ROU3_ENCODED_SEGMENT_TEXT_REGEX, safeEncodeURIComponent2)).join("/");
|
|
140396
140396
|
}
|
|
140397
140397
|
function toRou3PrefixMatcher(prefix) {
|
|
140398
140398
|
const catchAll = getDynamicPathParams(prefix)?.find((param) => param.allowsSlash);
|
|
@@ -140482,7 +140482,7 @@ var OpenAPIHandlerCodecCore = class {
|
|
|
140482
140482
|
/**
|
|
140483
140483
|
* @throws {TypeError} If `outputStructure` is "detailed" and the output doesn't match the expected structure.
|
|
140484
140484
|
*/
|
|
140485
|
-
encodeOutput(output2, procedure,
|
|
140485
|
+
encodeOutput(output2, procedure, path99) {
|
|
140486
140486
|
const meta3 = getOpenAPIMeta(procedure);
|
|
140487
140487
|
const successStatus = meta3?.successStatus ?? DEFAULT_SUCCESS_STATUS;
|
|
140488
140488
|
const outputStructure = meta3?.outputStructure ?? DEFAULT_OPENAPI_OUTPUT_STRUCTURE;
|
|
@@ -140495,7 +140495,7 @@ var OpenAPIHandlerCodecCore = class {
|
|
|
140495
140495
|
}
|
|
140496
140496
|
if (!isValidDetailedOutput(output2)) {
|
|
140497
140497
|
throw new TypeError(`
|
|
140498
|
-
Invalid "detailed" output structure returned by procedure (${
|
|
140498
|
+
Invalid "detailed" output structure returned by procedure (${path99.join(".")}):
|
|
140499
140499
|
\u2022 Expected an object with optional properties:
|
|
140500
140500
|
- status (number <400)
|
|
140501
140501
|
- headers (object)
|
|
@@ -141108,7 +141108,7 @@ function profileValue(name, paths) {
|
|
|
141108
141108
|
function createConfigApiRouter(deps) {
|
|
141109
141109
|
const authed = doorApiAuth(deps.expectedToken);
|
|
141110
141110
|
const { paths } = deps;
|
|
141111
|
-
const route = (
|
|
141111
|
+
const route = (path99, summary) => authed.meta(openapi({ method: "POST", path: path99, summary, tags: [CONFIG_API_TAG] }));
|
|
141112
141112
|
return {
|
|
141113
141113
|
config: {
|
|
141114
141114
|
identity: {
|
|
@@ -143348,8 +143348,8 @@ function createCodexRouteMount(ports, upstreamBase, provider) {
|
|
|
143348
143348
|
request7.body.resume();
|
|
143349
143349
|
return;
|
|
143350
143350
|
}
|
|
143351
|
-
const
|
|
143352
|
-
const translated = { method: request7.method, path:
|
|
143351
|
+
const path99 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
143352
|
+
const translated = { method: request7.method, path: path99, body, signal: request7.signal };
|
|
143353
143353
|
const routed = await route(translated);
|
|
143354
143354
|
if (request7.signal.aborted) {
|
|
143355
143355
|
return;
|
|
@@ -143583,9 +143583,9 @@ function descendExpanded(root, value3, key) {
|
|
|
143583
143583
|
}
|
|
143584
143584
|
}
|
|
143585
143585
|
function relaxRejectedRecursiveProperty(request7, body) {
|
|
143586
|
-
const
|
|
143587
|
-
if (
|
|
143588
|
-
const propertyIndices =
|
|
143586
|
+
const path99 = rejectedPath(body);
|
|
143587
|
+
if (path99 === void 0) return void 0;
|
|
143588
|
+
const propertyIndices = path99.flatMap((part, index) => part === "properties" && path99[index + 1] !== void 0 ? [index] : []).reverse();
|
|
143589
143589
|
if (propertyIndices.length === 0) return void 0;
|
|
143590
143590
|
const copy2 = structuredClone(request7);
|
|
143591
143591
|
let changed = false;
|
|
@@ -143594,14 +143594,14 @@ function relaxRejectedRecursiveProperty(request7, body) {
|
|
|
143594
143594
|
const schema = declaration.parametersJsonSchema;
|
|
143595
143595
|
if (schema === void 0) continue;
|
|
143596
143596
|
let leaf = schema;
|
|
143597
|
-
for (const part of
|
|
143597
|
+
for (const part of path99) leaf = descendExpanded(schema, leaf, part);
|
|
143598
143598
|
if (!record2(leaf) || typeof leaf.$ref !== "string") continue;
|
|
143599
143599
|
let repairedProperty = false;
|
|
143600
143600
|
for (const propertyIndex of propertyIndices) {
|
|
143601
|
-
const name =
|
|
143601
|
+
const name = path99[propertyIndex + 1];
|
|
143602
143602
|
if (name === void 0) continue;
|
|
143603
143603
|
let owner = schema;
|
|
143604
|
-
for (const part of
|
|
143604
|
+
for (const part of path99.slice(0, propertyIndex)) owner = descendExpanded(schema, owner, part);
|
|
143605
143605
|
if (!record2(owner) || !Array.isArray(owner.required) || !owner.required.includes(name) || !record2(owner.properties)) continue;
|
|
143606
143606
|
const property = owner.properties[name];
|
|
143607
143607
|
if (!record2(property)) continue;
|
|
@@ -143615,8 +143615,8 @@ function relaxRejectedRecursiveProperty(request7, body) {
|
|
|
143615
143615
|
}
|
|
143616
143616
|
if (!repairedProperty) {
|
|
143617
143617
|
let parent = schema;
|
|
143618
|
-
for (const part of
|
|
143619
|
-
const key =
|
|
143618
|
+
for (const part of path99.slice(0, -1)) parent = descendExpanded(schema, parent, part);
|
|
143619
|
+
const key = path99.at(-1);
|
|
143620
143620
|
const truncated = { description: "Recursive value: the original tool schema validates this value." };
|
|
143621
143621
|
if (record2(parent) && key !== void 0 && Object.hasOwn(parent, key)) {
|
|
143622
143622
|
parent[key] = truncated;
|
|
@@ -144108,8 +144108,8 @@ function createAntigravityRouteMount(ports, upstreamBase, provider) {
|
|
|
144108
144108
|
request7.body.resume();
|
|
144109
144109
|
return;
|
|
144110
144110
|
}
|
|
144111
|
-
const
|
|
144112
|
-
const translated = { method: request7.method, path:
|
|
144111
|
+
const path99 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
144112
|
+
const translated = { method: request7.method, path: path99, body, signal: request7.signal };
|
|
144113
144113
|
const routed = await route(translated);
|
|
144114
144114
|
if (request7.signal.aborted) {
|
|
144115
144115
|
return;
|
|
@@ -144153,7 +144153,7 @@ function createPassthroughRoute(name, target) {
|
|
|
144153
144153
|
headroomUpstream: target.headroomUpstream,
|
|
144154
144154
|
serve: async (request7, response) => {
|
|
144155
144155
|
const incoming = new URL(request7.url, "http://127.0.0.1");
|
|
144156
|
-
const
|
|
144156
|
+
const path99 = target.stripPrefix !== void 0 && incoming.pathname.startsWith(target.stripPrefix) ? incoming.pathname.slice(target.stripPrefix.length) : incoming.pathname;
|
|
144157
144157
|
const headers = forwardableHeaders(request7.headers);
|
|
144158
144158
|
delete headers.host;
|
|
144159
144159
|
await new Promise((resolve3) => {
|
|
@@ -144161,7 +144161,7 @@ function createPassthroughRoute(name, target) {
|
|
|
144161
144161
|
host: base.hostname,
|
|
144162
144162
|
port: base.port === "" ? void 0 : Number(base.port),
|
|
144163
144163
|
method: request7.method,
|
|
144164
|
-
path: `${basePath}${
|
|
144164
|
+
path: `${basePath}${path99}${incoming.search}`,
|
|
144165
144165
|
headers,
|
|
144166
144166
|
agent
|
|
144167
144167
|
};
|
|
@@ -144367,13 +144367,13 @@ async function scanRequestHead(request7, wholeBody = false) {
|
|
|
144367
144367
|
}
|
|
144368
144368
|
|
|
144369
144369
|
// src/frontdoor/providerRoute.ts
|
|
144370
|
-
var isRcSelfHostPath = (
|
|
144370
|
+
var isRcSelfHostPath = (path99) => path99 === "/v1/code/sessions" || path99.startsWith("/v1/code/sessions/") || path99 === "/v1/sessions" || path99.startsWith("/v1/sessions/");
|
|
144371
144371
|
function scopeSessionProviderPath(request7) {
|
|
144372
144372
|
if (request7.session.provider === void 0) {
|
|
144373
144373
|
return request7;
|
|
144374
144374
|
}
|
|
144375
|
-
const
|
|
144376
|
-
if (!
|
|
144375
|
+
const path99 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
144376
|
+
if (!path99.startsWith("/v1/") || isRcSelfHostPath(path99)) {
|
|
144377
144377
|
return request7;
|
|
144378
144378
|
}
|
|
144379
144379
|
return { ...request7, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(request7.session.provider)}${request7.url}` };
|
|
@@ -144508,13 +144508,13 @@ function createProviderRouteResolver(deps) {
|
|
|
144508
144508
|
return route;
|
|
144509
144509
|
};
|
|
144510
144510
|
const resolve3 = (request7) => {
|
|
144511
|
-
const
|
|
144512
|
-
const scoped = parseProviderPath(
|
|
144511
|
+
const path99 = new URL(request7.url, "http://127.0.0.1").pathname;
|
|
144512
|
+
const scoped = parseProviderPath(path99);
|
|
144513
144513
|
if (scoped === void 0) {
|
|
144514
|
-
if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(
|
|
144514
|
+
if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(path99)) {
|
|
144515
144515
|
return { ok: true, route: deps.rcSelfHostRoute };
|
|
144516
144516
|
}
|
|
144517
|
-
return
|
|
144517
|
+
return path99.startsWith("/v1/") ? { ok: true, route: oauthRoute } : { ok: false, status: HTTP_STATUS.notFound, message: `no such endpoint: ${path99}` };
|
|
144518
144518
|
}
|
|
144519
144519
|
const { provider } = scoped;
|
|
144520
144520
|
let definition;
|
|
@@ -144610,8 +144610,8 @@ function createProviderRouteResolver(deps) {
|
|
|
144610
144610
|
let modelChoice;
|
|
144611
144611
|
const visited = /* @__PURE__ */ new Set();
|
|
144612
144612
|
for (; ; ) {
|
|
144613
|
-
const
|
|
144614
|
-
const scoped = parseProviderPath(
|
|
144613
|
+
const path99 = new URL(current.url, "http://127.0.0.1").pathname;
|
|
144614
|
+
const scoped = parseProviderPath(path99);
|
|
144615
144615
|
const providerName = scoped?.provider ?? current.session.provider;
|
|
144616
144616
|
if (providerName !== void 0 && visited.has(providerName)) {
|
|
144617
144617
|
return { ok: false, status: HTTP_STATUS.internalServerError, message: `provider routing cycle: ${[...visited, providerName].join(" -> ")}` };
|
|
@@ -144626,7 +144626,7 @@ function createProviderRouteResolver(deps) {
|
|
|
144626
144626
|
} catch {
|
|
144627
144627
|
routes = void 0;
|
|
144628
144628
|
}
|
|
144629
|
-
const resolvesNames = !nameResolved && !isRcSelfHostPath(
|
|
144629
|
+
const resolvesNames = !nameResolved && !isRcSelfHostPath(path99);
|
|
144630
144630
|
if (resolvesNames) {
|
|
144631
144631
|
const scan2 = await scanRequestHead(current, true);
|
|
144632
144632
|
if (scan2.replayed === void 0) {
|
|
@@ -144665,7 +144665,7 @@ function createProviderRouteResolver(deps) {
|
|
|
144665
144665
|
}
|
|
144666
144666
|
if (routed.provider !== providerName) {
|
|
144667
144667
|
const scopedPrefix = providerName === void 0 ? void 0 : `${PROVIDER_PATH_PREFIX}${encodeURIComponent(providerName)}`;
|
|
144668
|
-
const rest2 = scopedPrefix !== void 0 &&
|
|
144668
|
+
const rest2 = scopedPrefix !== void 0 && path99.startsWith(scopedPrefix) ? path99.slice(scopedPrefix.length) : path99;
|
|
144669
144669
|
const query2 = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
|
|
144670
144670
|
const carried = replay;
|
|
144671
144671
|
current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(routed.provider)}${rest2}${query2}`, body: carried.body, headers: carried.headers };
|
|
@@ -144719,7 +144719,7 @@ function createProviderRouteResolver(deps) {
|
|
|
144719
144719
|
const headers = Object.fromEntries(Object.entries(replay.headers).filter(([name]) => name.toLowerCase() !== "content-length"));
|
|
144720
144720
|
replay = { ...replay, headers, body: import_node_stream3.Readable.from([Buffer.from(rewritten, "utf8")]) };
|
|
144721
144721
|
}
|
|
144722
|
-
const rest = scoped === void 0 ?
|
|
144722
|
+
const rest = scoped === void 0 ? path99 : path99.slice(`${PROVIDER_PATH_PREFIX}${encodeURIComponent(scoped.provider)}`.length);
|
|
144723
144723
|
const query = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
|
|
144724
144724
|
current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(matched.provider)}${rest}${query}`, body: replay.body, headers: replay.headers };
|
|
144725
144725
|
}
|
|
@@ -150706,15 +150706,15 @@ function parseNumstat(output2) {
|
|
|
150706
150706
|
if (addedText === void 0 || deletedText === void 0 || pathText === void 0) {
|
|
150707
150707
|
continue;
|
|
150708
150708
|
}
|
|
150709
|
-
const
|
|
150709
|
+
const path99 = pathText === "" ? fields[index + 2] : pathText;
|
|
150710
150710
|
if (pathText === "") {
|
|
150711
150711
|
index += 2;
|
|
150712
150712
|
}
|
|
150713
150713
|
const lines = { added: Number(addedText), deleted: Number(deletedText) };
|
|
150714
|
-
if (
|
|
150714
|
+
if (path99 !== void 0 && Number.isInteger(lines.added) && Number.isInteger(lines.deleted)) {
|
|
150715
150715
|
added += lines.added;
|
|
150716
150716
|
deleted += lines.deleted;
|
|
150717
|
-
byPath.set(
|
|
150717
|
+
byPath.set(path99, lines);
|
|
150718
150718
|
}
|
|
150719
150719
|
}
|
|
150720
150720
|
return { total: { added, deleted }, byPath };
|
|
@@ -151753,11 +151753,11 @@ function targetText(tool, columns) {
|
|
|
151753
151753
|
if (!FILE_TOOLS.includes(tool.name)) {
|
|
151754
151754
|
return truncateWithEllipsis(target, room, ELLIPSIS);
|
|
151755
151755
|
}
|
|
151756
|
-
const
|
|
151757
|
-
if (visibleLength(
|
|
151758
|
-
return
|
|
151756
|
+
const path99 = target.replaceAll("\\", "/");
|
|
151757
|
+
if (visibleLength(path99) <= room) {
|
|
151758
|
+
return path99;
|
|
151759
151759
|
}
|
|
151760
|
-
const file2 =
|
|
151760
|
+
const file2 = path99.split("/").pop() ?? path99;
|
|
151761
151761
|
return visibleLength(DIRECTORY_ELLIPSIS) + visibleLength(file2) > room ? truncateWithEllipsis(file2, room, FILE_ELLIPSIS) : `${DIRECTORY_ELLIPSIS}${file2}`;
|
|
151762
151762
|
}
|
|
151763
151763
|
function finishedByKind(tools) {
|
|
@@ -155514,8 +155514,8 @@ function getErrorMap2() {
|
|
|
155514
155514
|
|
|
155515
155515
|
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v3/helpers/parseUtil.js
|
|
155516
155516
|
var makeIssue = (params) => {
|
|
155517
|
-
const { data, path:
|
|
155518
|
-
const fullPath = [...
|
|
155517
|
+
const { data, path: path99, errorMaps, issueData } = params;
|
|
155518
|
+
const fullPath = [...path99, ...issueData.path || []];
|
|
155519
155519
|
const fullIssue = {
|
|
155520
155520
|
...issueData,
|
|
155521
155521
|
path: fullPath
|
|
@@ -155630,11 +155630,11 @@ var errorUtil;
|
|
|
155630
155630
|
|
|
155631
155631
|
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v3/types.js
|
|
155632
155632
|
var ParseInputLazyPath = class {
|
|
155633
|
-
constructor(parent, value3,
|
|
155633
|
+
constructor(parent, value3, path99, key) {
|
|
155634
155634
|
this._cachedPath = [];
|
|
155635
155635
|
this.parent = parent;
|
|
155636
155636
|
this.data = value3;
|
|
155637
|
-
this._path =
|
|
155637
|
+
this._path = path99;
|
|
155638
155638
|
this._key = key;
|
|
155639
155639
|
}
|
|
155640
155640
|
get path() {
|
|
@@ -159197,11 +159197,11 @@ function normalizeObjectSchema(schema) {
|
|
|
159197
159197
|
}
|
|
159198
159198
|
return void 0;
|
|
159199
159199
|
}
|
|
159200
|
-
function getDotPath(
|
|
159201
|
-
if (
|
|
159200
|
+
function getDotPath(path99) {
|
|
159201
|
+
if (path99.length === 0) {
|
|
159202
159202
|
return "object root";
|
|
159203
159203
|
}
|
|
159204
|
-
return
|
|
159204
|
+
return path99.reduce((acc, seg, index) => {
|
|
159205
159205
|
if (index === 0) {
|
|
159206
159206
|
return String(seg);
|
|
159207
159207
|
}
|
|
@@ -164322,6 +164322,9 @@ init_lock();
|
|
|
164322
164322
|
function prefixOf(sessionId) {
|
|
164323
164323
|
return `${sessionId}.hook.`;
|
|
164324
164324
|
}
|
|
164325
|
+
function isSessionStateFile(sessionId, stateFile, filename) {
|
|
164326
|
+
return filename === stateFile || filename.startsWith(prefixOf(sessionId)) && filename.endsWith(".json");
|
|
164327
|
+
}
|
|
164325
164328
|
function hooksPending(fs36, paths, pool, sessionId) {
|
|
164326
164329
|
return fs36.readdir(stateDirOf(paths, pool)).some((name) => name.startsWith(prefixOf(sessionId)) && name.endsWith(".json"));
|
|
164327
164330
|
}
|
|
@@ -166853,7 +166856,7 @@ async function realRefresher(params) {
|
|
|
166853
166856
|
// src/supervise/launch.ts
|
|
166854
166857
|
var import_node_crypto35 = require("node:crypto");
|
|
166855
166858
|
var import_node_fs40 = require("node:fs");
|
|
166856
|
-
var
|
|
166859
|
+
var import_node_path97 = __toESM(require("node:path"), 1);
|
|
166857
166860
|
var import_promises21 = require("node:stream/promises");
|
|
166858
166861
|
init_package();
|
|
166859
166862
|
init_claudeSession();
|
|
@@ -167694,6 +167697,52 @@ async function supervise(deps, first) {
|
|
|
167694
167697
|
}
|
|
167695
167698
|
}
|
|
167696
167699
|
|
|
167700
|
+
// src/supervise/watchSession.ts
|
|
167701
|
+
var import_node_path96 = __toESM(require("node:path"), 1);
|
|
167702
|
+
function watchSessionFiles(params) {
|
|
167703
|
+
const { paths, pool, sessionId, fs: fs36, log, watch } = params;
|
|
167704
|
+
const stateFile = import_node_path96.default.basename(sessionStatePath(paths, pool, sessionId));
|
|
167705
|
+
return (onChange) => {
|
|
167706
|
+
let watchedDir;
|
|
167707
|
+
let transcriptName;
|
|
167708
|
+
let stopTranscripts;
|
|
167709
|
+
let transcriptWarning = "";
|
|
167710
|
+
const followTranscript = () => {
|
|
167711
|
+
const transcript = readSessionState(fs36, paths, pool, sessionId)?.transcriptPath;
|
|
167712
|
+
const directory = transcript === void 0 ? void 0 : import_node_path96.default.dirname(transcript);
|
|
167713
|
+
transcriptName = transcript === void 0 ? void 0 : import_node_path96.default.basename(transcript);
|
|
167714
|
+
if (!params.watchTranscript || directory === watchedDir) {
|
|
167715
|
+
return;
|
|
167716
|
+
}
|
|
167717
|
+
stopTranscripts?.();
|
|
167718
|
+
watchedDir = void 0;
|
|
167719
|
+
stopTranscripts = void 0;
|
|
167720
|
+
if (directory !== void 0 && fs36.lstat(directory) !== void 0) {
|
|
167721
|
+
try {
|
|
167722
|
+
stopTranscripts = watch.existingDirectory(directory, (filename) => filename === transcriptName, "the session transcript", log)(onChange);
|
|
167723
|
+
watchedDir = directory;
|
|
167724
|
+
transcriptWarning = "";
|
|
167725
|
+
} catch (error63) {
|
|
167726
|
+
const warning = `agent-shim: could not watch the session transcript: ${error63 instanceof Error ? error63.message : String(error63)}`;
|
|
167727
|
+
if (warning !== transcriptWarning) {
|
|
167728
|
+
transcriptWarning = warning;
|
|
167729
|
+
log.warn(warning);
|
|
167730
|
+
}
|
|
167731
|
+
}
|
|
167732
|
+
}
|
|
167733
|
+
};
|
|
167734
|
+
const stopState = watch.directory(stateDirOf(paths, pool), (filename) => isSessionStateFile(sessionId, stateFile, filename), "the session's state", log)(() => {
|
|
167735
|
+
followTranscript();
|
|
167736
|
+
onChange();
|
|
167737
|
+
});
|
|
167738
|
+
followTranscript();
|
|
167739
|
+
return () => {
|
|
167740
|
+
stopState();
|
|
167741
|
+
stopTranscripts?.();
|
|
167742
|
+
};
|
|
167743
|
+
};
|
|
167744
|
+
}
|
|
167745
|
+
|
|
167697
167746
|
// src/supervise/launch.ts
|
|
167698
167747
|
function supervisesLaunch(pool, passthrough) {
|
|
167699
167748
|
return pool?.resumeOnLimit === true && !isClaudeSubcommand(passthrough);
|
|
@@ -167730,7 +167779,7 @@ async function runSupervised(params) {
|
|
|
167730
167779
|
const policy = params.pools[pool];
|
|
167731
167780
|
const markSettings = markHooksSettings(selfInvocation([]), paths.root, pool, first.sessionId);
|
|
167732
167781
|
const settingsArgs2 = [...params.extraFlags, ...params.passthrough];
|
|
167733
|
-
const settings2 = hasSettingsArgument(settingsArgs2) ? combineCallerSettings(settingsArgs2, markSettings, (name) => farm.fs.readFileUtf8(
|
|
167782
|
+
const settings2 = hasSettingsArgument(settingsArgs2) ? combineCallerSettings(settingsArgs2, markSettings, (name) => farm.fs.readFileUtf8(import_node_path97.default.resolve(farm.cwd, name))) : void 0;
|
|
167734
167783
|
const plugin = policy?.compactBeforeLimit === true ? stageNativeCompactionPlugin() : void 0;
|
|
167735
167784
|
if (policy?.compactBeforeLimit === true && plugin !== void 0) {
|
|
167736
167785
|
const baseCompaction = createCompactionDeps({
|
|
@@ -167803,43 +167852,12 @@ async function runSupervised(params) {
|
|
|
167803
167852
|
watchChanges: (identity, onChange) => {
|
|
167804
167853
|
const stopPlugin = plugin === void 0 ? void 0 : realWatchExistingDirectory(plugin.directory, (filename) => filename === "ready.json", "the compaction plugin", log)(onChange);
|
|
167805
167854
|
const stopSnapshot = realWatchDirectory(paths.usageSnapshotsDir, (filename) => filename === `${identity}.json`, `${identity}'s usage`, log)(onChange);
|
|
167806
|
-
|
|
167807
|
-
let stopTranscripts;
|
|
167808
|
-
let transcriptWarning = "";
|
|
167809
|
-
const watchTranscript = () => {
|
|
167810
|
-
const transcript = readSessionState(realFarmFs, paths, pool, first.sessionId)?.transcriptPath;
|
|
167811
|
-
const directory = transcript === void 0 ? void 0 : import_node_path96.default.dirname(transcript);
|
|
167812
|
-
if (compaction === void 0 || directory === watchedDir) {
|
|
167813
|
-
return;
|
|
167814
|
-
}
|
|
167815
|
-
stopTranscripts?.();
|
|
167816
|
-
watchedDir = void 0;
|
|
167817
|
-
stopTranscripts = void 0;
|
|
167818
|
-
if (directory !== void 0 && realFarmFs.lstat(directory) !== void 0) {
|
|
167819
|
-
try {
|
|
167820
|
-
stopTranscripts = realWatchExistingDirectory(directory, (filename) => filename.endsWith(".jsonl"), "the session transcripts", log)(onChange);
|
|
167821
|
-
watchedDir = directory;
|
|
167822
|
-
transcriptWarning = "";
|
|
167823
|
-
} catch (error63) {
|
|
167824
|
-
const warning = `agent-shim: could not watch the session transcripts: ${error63 instanceof Error ? error63.message : String(error63)}`;
|
|
167825
|
-
if (warning !== transcriptWarning) {
|
|
167826
|
-
transcriptWarning = warning;
|
|
167827
|
-
log.warn(warning);
|
|
167828
|
-
}
|
|
167829
|
-
}
|
|
167830
|
-
}
|
|
167831
|
-
};
|
|
167832
|
-
const stopState = realWatchDirectory(stateDirOf(paths, pool), (filename) => filename.endsWith(".json"), "the pool's sessions", log)(() => {
|
|
167833
|
-
watchTranscript();
|
|
167834
|
-
onChange();
|
|
167835
|
-
});
|
|
167836
|
-
watchTranscript();
|
|
167855
|
+
const stopSession = watchSessionFiles({ paths, pool, sessionId: first.sessionId, watchTranscript: compaction !== void 0, fs: realFarmFs, log, watch: { directory: realWatchDirectory, existingDirectory: realWatchExistingDirectory } })(onChange);
|
|
167837
167856
|
if (plugin !== void 0 && nativeCompactionReady(plugin)) queueMicrotask(onChange);
|
|
167838
167857
|
return () => {
|
|
167839
167858
|
stopPlugin?.();
|
|
167840
167859
|
stopSnapshot();
|
|
167841
|
-
|
|
167842
|
-
stopTranscripts?.();
|
|
167860
|
+
stopSession();
|
|
167843
167861
|
};
|
|
167844
167862
|
},
|
|
167845
167863
|
quotaHit: (identity, sessionId, sinceMs) => quotaHitOf(realFarmFs, paths, identity, sessionId, sinceMs, farm.now()),
|
|
@@ -168044,7 +168062,7 @@ async function runClaude(argvOverride) {
|
|
|
168044
168062
|
// src/cli.ts
|
|
168045
168063
|
async function main() {
|
|
168046
168064
|
aliasLegacyEnv(process.env);
|
|
168047
|
-
const invokedName =
|
|
168065
|
+
const invokedName = import_node_path98.default.basename(process.argv[1] ?? "agent-shim");
|
|
168048
168066
|
if (isInvokedAsClaude(invokedName)) {
|
|
168049
168067
|
await runClaude();
|
|
168050
168068
|
return;
|