@lousy-agents/mcp 5.22.19 → 5.22.20
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/mcp-server.js +30 -10
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -38052,6 +38052,7 @@ const OPERATIONAL_CODE_VALUES = [
|
|
|
38052
38052
|
"not-empty",
|
|
38053
38053
|
"not-found",
|
|
38054
38054
|
"not-removable",
|
|
38055
|
+
"permission-denied",
|
|
38055
38056
|
"permission-unverified",
|
|
38056
38057
|
"read-failed",
|
|
38057
38058
|
"timeout",
|
|
@@ -39606,6 +39607,15 @@ function fileNotFoundError(cause, details) {
|
|
|
39606
39607
|
function root_errors_outsideWorkspaceError() {
|
|
39607
39608
|
return new errors_FsSafeError("outside-workspace", "file is outside workspace root");
|
|
39608
39609
|
}
|
|
39610
|
+
/** Classify raw traversal denials without disguising an established policy failure. */
|
|
39611
|
+
function pathTraversalPermissionError(error, targetPath) {
|
|
39612
|
+
if (error instanceof errors_FsSafeError)
|
|
39613
|
+
return error.code === "permission-denied" ? error : undefined;
|
|
39614
|
+
if (!hasNodeErrorCode(error, "EACCES") && !hasNodeErrorCode(error, "EPERM"))
|
|
39615
|
+
return;
|
|
39616
|
+
const deniedPath = path_isNodeError(error) && typeof error.path === "string" ? error.path : targetPath;
|
|
39617
|
+
return new errors_FsSafeError("permission-denied", `permission denied while resolving ${deniedPath}`, errorCauseOptions(error));
|
|
39618
|
+
}
|
|
39609
39619
|
function rootPathChangedError(cause) {
|
|
39610
39620
|
return new errors_FsSafeError("path-mismatch", "root path changed during operation", { cause });
|
|
39611
39621
|
}
|
|
@@ -47532,6 +47542,9 @@ async function resolvePathInRoot(root, relativePath, options) {
|
|
|
47532
47542
|
}
|
|
47533
47543
|
}
|
|
47534
47544
|
catch (error) {
|
|
47545
|
+
const permissionError = pathTraversalPermissionError(error, rawAbsolutePath);
|
|
47546
|
+
if (permissionError)
|
|
47547
|
+
throw permissionError;
|
|
47535
47548
|
if (error instanceof errors_FsSafeError && error.code === "symlink") {
|
|
47536
47549
|
throw error;
|
|
47537
47550
|
}
|
|
@@ -49992,6 +50005,9 @@ async function resolveGuardedWritePathInRoot(root, params) {
|
|
|
49992
50005
|
});
|
|
49993
50006
|
}
|
|
49994
50007
|
catch (error) {
|
|
50008
|
+
const permissionError = pathTraversalPermissionError(error, resolvedPath.resolved);
|
|
50009
|
+
if (permissionError)
|
|
50010
|
+
throw permissionError;
|
|
49995
50011
|
throw new errors_FsSafeError("path-alias", "path alias escape blocked", errorCauseOptions(error));
|
|
49996
50012
|
}
|
|
49997
50013
|
}
|
|
@@ -52036,7 +52052,6 @@ async function removeStaleSidecarLockIfAllowed(params) {
|
|
|
52036
52052
|
}
|
|
52037
52053
|
|
|
52038
52054
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js
|
|
52039
|
-
|
|
52040
52055
|
const sidecar_lock_policy_MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
52041
52056
|
function assertFiniteNonNegative(value, label) {
|
|
52042
52057
|
if (!Number.isFinite(value) || value < 0) {
|
|
@@ -52138,16 +52153,16 @@ function sidecarLockPayloadCreatedAtMs(payload) {
|
|
|
52138
52153
|
const createdAtMs = Date.parse(createdAt);
|
|
52139
52154
|
return Number.isFinite(createdAtMs) ? createdAtMs : null;
|
|
52140
52155
|
}
|
|
52141
|
-
|
|
52142
|
-
const createdAtMs = sidecarLockPayloadCreatedAtMs(
|
|
52156
|
+
function defaultSidecarLockShouldReclaim(snapshot, staleMs, nowMs) {
|
|
52157
|
+
const createdAtMs = sidecarLockPayloadCreatedAtMs(snapshot.payload);
|
|
52143
52158
|
if (createdAtMs !== null)
|
|
52144
|
-
return
|
|
52145
|
-
|
|
52146
|
-
return params.nowMs - external_node_fs_.statSync(params.lockPath).mtimeMs > params.staleMs;
|
|
52147
|
-
}
|
|
52148
|
-
catch {
|
|
52159
|
+
return nowMs - createdAtMs > staleMs;
|
|
52160
|
+
if (!snapshot.stat)
|
|
52149
52161
|
return true;
|
|
52150
|
-
|
|
52162
|
+
// A released pathname may already name another owner; age only the admitted record.
|
|
52163
|
+
const mtimeMs = "mtimeNs" in snapshot.stat
|
|
52164
|
+
? Number(snapshot.stat.mtimeNs) / 1e6 : snapshot.stat.mtimeMs;
|
|
52165
|
+
return nowMs - mtimeMs > staleMs;
|
|
52151
52166
|
}
|
|
52152
52167
|
|
|
52153
52168
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.js
|
|
@@ -52365,12 +52380,14 @@ async function handleStaleSidecarAdmission(params) {
|
|
|
52365
52380
|
return;
|
|
52366
52381
|
throw error;
|
|
52367
52382
|
}
|
|
52368
|
-
const shouldReclaim = staleOptions.shouldReclaim
|
|
52383
|
+
const shouldReclaim = staleOptions.shouldReclaim;
|
|
52369
52384
|
let reclaim;
|
|
52370
52385
|
try {
|
|
52371
52386
|
reclaim = await admission.run(async () => {
|
|
52372
52387
|
assertUnheld();
|
|
52373
52388
|
try {
|
|
52389
|
+
if (!shouldReclaim)
|
|
52390
|
+
return defaultSidecarLockShouldReclaim(snapshot, params.staleMs, Date.now());
|
|
52374
52391
|
return await Reflect.apply(shouldReclaim, undefined, [{
|
|
52375
52392
|
lockPath,
|
|
52376
52393
|
normalizedTargetPath,
|
|
@@ -59109,6 +59126,9 @@ async function resolvePinnedRootPathInRoot(root, params) {
|
|
|
59109
59126
|
resolved = await (params.removalReceipts ? resolveRootPathForRemoval(resolution, params.removalReceipts) : root_path_resolveRootPath(resolution));
|
|
59110
59127
|
}
|
|
59111
59128
|
catch (err) {
|
|
59129
|
+
const permissionError = pathTraversalPermissionError(err, params.relativePath);
|
|
59130
|
+
if (permissionError)
|
|
59131
|
+
throw permissionError;
|
|
59112
59132
|
if (err instanceof errors_FsSafeError && err.code === "symlink")
|
|
59113
59133
|
throw err;
|
|
59114
59134
|
throw new errors_FsSafeError("path-alias", "path alias escape blocked", { cause: err });
|