@lousy-agents/mcp 5.14.10 → 5.15.1
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/116.js +4 -3
- package/dist/316.js +4 -3
- package/dist/475.js +2 -2
- package/dist/653.js +13 -10
- package/dist/mcp-server.js +326 -133
- package/package.json +1 -1
package/dist/116.js
CHANGED
|
@@ -2,9 +2,6 @@ export const __rspack_esm_id = 116;
|
|
|
2
2
|
export const __rspack_esm_ids = [116];
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
4
|
8711(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
6
|
-
prompt: () => (prompt)
|
|
7
|
-
});
|
|
8
5
|
/* import */ var node_util__rspack_import_0 = __webpack_require__(7975);
|
|
9
6
|
/* import */ var node_process__rspack_import_1 = __webpack_require__(1708);
|
|
10
7
|
/* import */ var node_readline__rspack_import_2 = __webpack_require__(481);
|
|
@@ -290,6 +287,10 @@ async function prompt(message, opts = {}) {
|
|
|
290
287
|
|
|
291
288
|
|
|
292
289
|
|
|
290
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
291
|
+
prompt: () => (prompt)
|
|
292
|
+
});
|
|
293
|
+
|
|
293
294
|
|
|
294
295
|
},
|
|
295
296
|
|
package/dist/316.js
CHANGED
|
@@ -4,9 +4,6 @@ export const __webpack_modules__ = {
|
|
|
4
4
|
5375(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
var zlib__rspack_import_11_namespace_cache;
|
|
6
6
|
__webpack_require__.r(__webpack_exports__);
|
|
7
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
8
|
-
t: () => (ce)
|
|
9
|
-
});
|
|
10
7
|
/* import */ var _rolldown_runtime_mjs__rspack_import_14 = __webpack_require__(421);
|
|
11
8
|
/* import */ var node_fs__rspack_import_0 = __webpack_require__(3024);
|
|
12
9
|
/* import */ var node_fs_promises__rspack_import_1 = __webpack_require__(1455);
|
|
@@ -2954,6 +2951,10 @@ var Da = (e) => {
|
|
|
2954
2951
|
};
|
|
2955
2952
|
|
|
2956
2953
|
|
|
2954
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
2955
|
+
t: () => (ce)
|
|
2956
|
+
});
|
|
2957
|
+
|
|
2957
2958
|
|
|
2958
2959
|
},
|
|
2959
2960
|
|
package/dist/475.js
CHANGED
|
@@ -1729,10 +1729,10 @@ class FSWatcher extends external_node_events_.EventEmitter {
|
|
|
1729
1729
|
const options = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
|
|
1730
1730
|
let stream = readdirp(root, options);
|
|
1731
1731
|
this._streams.add(stream);
|
|
1732
|
-
stream.once(STR_CLOSE, () => {
|
|
1732
|
+
stream.once((/* inlined export .STR_CLOSE */"close"), () => {
|
|
1733
1733
|
stream = undefined;
|
|
1734
1734
|
});
|
|
1735
|
-
stream.once(STR_END, () => {
|
|
1735
|
+
stream.once((/* inlined export .STR_END */"end"), () => {
|
|
1736
1736
|
if (stream) {
|
|
1737
1737
|
this._streams.delete(stream);
|
|
1738
1738
|
stream = undefined;
|
package/dist/653.js
CHANGED
|
@@ -3,13 +3,6 @@ export const __rspack_esm_ids = [653];
|
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
4
|
292(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
__webpack_require__.r(__webpack_exports__);
|
|
6
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
7
|
-
a: () => (y),
|
|
8
|
-
i: () => (S),
|
|
9
|
-
n: () => (ne),
|
|
10
|
-
r: () => (C),
|
|
11
|
-
t: () => (oe)
|
|
12
|
-
});
|
|
13
6
|
/* import */ var _rolldown_runtime_mjs__rspack_import_8 = __webpack_require__(421);
|
|
14
7
|
/* import */ var node_module__rspack_import_0 = __webpack_require__(8995);
|
|
15
8
|
/* import */ var node_fs__rspack_import_1 = __webpack_require__(3024);
|
|
@@ -689,12 +682,18 @@ async function fe(e = {}) {
|
|
|
689
682
|
}
|
|
690
683
|
|
|
691
684
|
|
|
685
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
686
|
+
t: () => (oe)
|
|
687
|
+
}, {
|
|
688
|
+
a: y,
|
|
689
|
+
i: S,
|
|
690
|
+
n: ne,
|
|
691
|
+
r: C
|
|
692
|
+
});
|
|
693
|
+
|
|
692
694
|
|
|
693
695
|
},
|
|
694
696
|
421(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
695
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
696
|
-
t: () => (__exportAll)
|
|
697
|
-
});
|
|
698
697
|
/* import */ var node_module__rspack_import_0 = __webpack_require__(8995);
|
|
699
698
|
|
|
700
699
|
//#region \0rolldown/runtime.js
|
|
@@ -711,6 +710,10 @@ var __exportAll = (all, no_symbols) => {
|
|
|
711
710
|
//#endregion
|
|
712
711
|
|
|
713
712
|
|
|
713
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
714
|
+
t: () => (__exportAll)
|
|
715
|
+
});
|
|
716
|
+
|
|
714
717
|
|
|
715
718
|
},
|
|
716
719
|
8900(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
package/dist/mcp-server.js
CHANGED
|
@@ -6559,7 +6559,7 @@ function escapeJsonPtr(str) {
|
|
|
6559
6559
|
|
|
6560
6560
|
|
|
6561
6561
|
},
|
|
6562
|
-
|
|
6562
|
+
2229(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
6563
6563
|
// NAMESPACE OBJECT: ../../node_modules/micromark/lib/constructs.js
|
|
6564
6564
|
var constructs_namespaceObject = {};
|
|
6565
6565
|
__webpack_require__.r(constructs_namespaceObject);
|
|
@@ -26997,6 +26997,191 @@ function guardedRmSync(params) {
|
|
|
26997
26997
|
}), { verifyAfter: params.verifyAfter });
|
|
26998
26998
|
}
|
|
26999
26999
|
|
|
27000
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/deny-mutations.js
|
|
27001
|
+
|
|
27002
|
+
|
|
27003
|
+
|
|
27004
|
+
|
|
27005
|
+
async function pathExists(filePath) {
|
|
27006
|
+
try {
|
|
27007
|
+
await promises_.lstat(filePath);
|
|
27008
|
+
return true;
|
|
27009
|
+
}
|
|
27010
|
+
catch (err) {
|
|
27011
|
+
if (!path_isNotFoundPathError(err)) {
|
|
27012
|
+
throw err;
|
|
27013
|
+
}
|
|
27014
|
+
return false;
|
|
27015
|
+
}
|
|
27016
|
+
}
|
|
27017
|
+
async function resolvePathViaExistingAncestor(targetPath) {
|
|
27018
|
+
const normalized = external_node_path_.resolve(targetPath);
|
|
27019
|
+
let cursor = normalized;
|
|
27020
|
+
const missingSuffix = [];
|
|
27021
|
+
while (external_node_path_.dirname(cursor) !== cursor && !(await pathExists(cursor))) {
|
|
27022
|
+
missingSuffix.unshift(external_node_path_.basename(cursor));
|
|
27023
|
+
cursor = external_node_path_.dirname(cursor);
|
|
27024
|
+
}
|
|
27025
|
+
if (!(await pathExists(cursor))) {
|
|
27026
|
+
return normalized;
|
|
27027
|
+
}
|
|
27028
|
+
try {
|
|
27029
|
+
const resolvedAncestor = external_node_path_.resolve(await promises_.realpath(cursor));
|
|
27030
|
+
return missingSuffix.length === 0
|
|
27031
|
+
? resolvedAncestor
|
|
27032
|
+
: external_node_path_.resolve(resolvedAncestor, ...missingSuffix);
|
|
27033
|
+
}
|
|
27034
|
+
catch {
|
|
27035
|
+
return normalized;
|
|
27036
|
+
}
|
|
27037
|
+
}
|
|
27038
|
+
async function comparablePaths(rawPath) {
|
|
27039
|
+
path_assertNoNulPathInput(rawPath, "path contains a NUL byte");
|
|
27040
|
+
const resolved = external_node_path_.resolve(rawPath);
|
|
27041
|
+
return new Set([resolved, await resolvePathViaExistingAncestor(resolved)]);
|
|
27042
|
+
}
|
|
27043
|
+
function isSamePath(left, right) {
|
|
27044
|
+
return path_isPathInside(left, right) && path_isPathInside(right, left);
|
|
27045
|
+
}
|
|
27046
|
+
function hasPolicyEntries(policy) {
|
|
27047
|
+
return Boolean(policy?.paths?.length || policy?.prefixes?.length);
|
|
27048
|
+
}
|
|
27049
|
+
function policyPathEntries(entries) {
|
|
27050
|
+
const paths = [];
|
|
27051
|
+
for (const entry of entries ?? []) {
|
|
27052
|
+
if (entry.length === 0) {
|
|
27053
|
+
throw new errors_FsSafeError("invalid-path", "deny mutation paths must be non-empty");
|
|
27054
|
+
}
|
|
27055
|
+
path_assertNoNulPathInput(entry, "deny mutation path contains a NUL byte");
|
|
27056
|
+
if (!external_node_path_.isAbsolute(entry)) {
|
|
27057
|
+
throw new errors_FsSafeError("invalid-path", "deny mutation paths must be absolute");
|
|
27058
|
+
}
|
|
27059
|
+
paths.push(entry);
|
|
27060
|
+
}
|
|
27061
|
+
return paths;
|
|
27062
|
+
}
|
|
27063
|
+
async function assertMutationNotDenied(filePath, policy, options = {}) {
|
|
27064
|
+
if (!hasPolicyEntries(policy)) {
|
|
27065
|
+
return;
|
|
27066
|
+
}
|
|
27067
|
+
const targetPaths = await comparablePaths(filePath);
|
|
27068
|
+
for (const deniedPath of policyPathEntries(policy.paths)) {
|
|
27069
|
+
const deniedPaths = await comparablePaths(deniedPath);
|
|
27070
|
+
for (const target of targetPaths) {
|
|
27071
|
+
for (const denied of deniedPaths) {
|
|
27072
|
+
if (isSamePath(denied, target) ||
|
|
27073
|
+
(options.protectAncestors === true && path_isPathInside(target, denied))) {
|
|
27074
|
+
throw new errors_FsSafeError("denied-path", "path is denied by denyMutations policy");
|
|
27075
|
+
}
|
|
27076
|
+
}
|
|
27077
|
+
}
|
|
27078
|
+
}
|
|
27079
|
+
for (const deniedPrefix of policyPathEntries(policy.prefixes)) {
|
|
27080
|
+
const deniedPaths = await comparablePaths(deniedPrefix);
|
|
27081
|
+
for (const target of targetPaths) {
|
|
27082
|
+
for (const denied of deniedPaths) {
|
|
27083
|
+
if (path_isPathInside(denied, target) ||
|
|
27084
|
+
(options.protectAncestors === true && path_isPathInside(target, denied))) {
|
|
27085
|
+
throw new errors_FsSafeError("denied-path", "path is denied by denyMutations policy");
|
|
27086
|
+
}
|
|
27087
|
+
}
|
|
27088
|
+
}
|
|
27089
|
+
}
|
|
27090
|
+
}
|
|
27091
|
+
function mergeDenyMutationPolicies(defaultPolicy, callPolicy) {
|
|
27092
|
+
if (!defaultPolicy) {
|
|
27093
|
+
return callPolicy;
|
|
27094
|
+
}
|
|
27095
|
+
if (!callPolicy) {
|
|
27096
|
+
return defaultPolicy;
|
|
27097
|
+
}
|
|
27098
|
+
return {
|
|
27099
|
+
paths: [...(defaultPolicy.paths ?? []), ...(callPolicy.paths ?? [])],
|
|
27100
|
+
prefixes: [...(defaultPolicy.prefixes ?? []), ...(callPolicy.prefixes ?? [])],
|
|
27101
|
+
};
|
|
27102
|
+
}
|
|
27103
|
+
|
|
27104
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/opened-realpath.js
|
|
27105
|
+
|
|
27106
|
+
|
|
27107
|
+
|
|
27108
|
+
|
|
27109
|
+
|
|
27110
|
+
async function resolveOpenedFileRealPathForHandle(handle, ioPath) {
|
|
27111
|
+
const handleStat = await handle.stat();
|
|
27112
|
+
const fdCandidates = process.platform === "linux"
|
|
27113
|
+
? [`/proc/self/fd/${handle.fd}`, `/dev/fd/${handle.fd}`]
|
|
27114
|
+
: process.platform === "win32"
|
|
27115
|
+
? []
|
|
27116
|
+
: [`/dev/fd/${handle.fd}`];
|
|
27117
|
+
for (const fdPath of fdCandidates) {
|
|
27118
|
+
try {
|
|
27119
|
+
const fdRealPath = await promises_.realpath(fdPath);
|
|
27120
|
+
const fdRealStat = await promises_.stat(fdRealPath);
|
|
27121
|
+
if (file_identity_sameFileIdentity(handleStat, fdRealStat)) {
|
|
27122
|
+
return fdRealPath;
|
|
27123
|
+
}
|
|
27124
|
+
}
|
|
27125
|
+
catch {
|
|
27126
|
+
// try next fd path
|
|
27127
|
+
}
|
|
27128
|
+
}
|
|
27129
|
+
try {
|
|
27130
|
+
const ioRealPath = await promises_.realpath(ioPath);
|
|
27131
|
+
const ioRealStat = await promises_.stat(ioRealPath);
|
|
27132
|
+
if (file_identity_sameFileIdentity(handleStat, ioRealStat)) {
|
|
27133
|
+
return ioRealPath;
|
|
27134
|
+
}
|
|
27135
|
+
}
|
|
27136
|
+
catch (err) {
|
|
27137
|
+
if (!path_isNotFoundPathError(err)) {
|
|
27138
|
+
throw err;
|
|
27139
|
+
}
|
|
27140
|
+
}
|
|
27141
|
+
const parentResolved = await resolveOpenedFileRealPathFromParent(handleStat, ioPath);
|
|
27142
|
+
if (parentResolved) {
|
|
27143
|
+
return parentResolved;
|
|
27144
|
+
}
|
|
27145
|
+
throw new errors_FsSafeError("path-mismatch", "unable to resolve opened file path");
|
|
27146
|
+
}
|
|
27147
|
+
async function resolveOpenedFileRealPathFromParent(handleStat, ioPath) {
|
|
27148
|
+
let parentReal;
|
|
27149
|
+
try {
|
|
27150
|
+
parentReal = await promises_.realpath(external_node_path_.dirname(ioPath));
|
|
27151
|
+
}
|
|
27152
|
+
catch (err) {
|
|
27153
|
+
if (path_isNotFoundPathError(err)) {
|
|
27154
|
+
return null;
|
|
27155
|
+
}
|
|
27156
|
+
throw err;
|
|
27157
|
+
}
|
|
27158
|
+
let entries;
|
|
27159
|
+
try {
|
|
27160
|
+
entries = await promises_.readdir(parentReal);
|
|
27161
|
+
}
|
|
27162
|
+
catch (err) {
|
|
27163
|
+
if (path_isNotFoundPathError(err)) {
|
|
27164
|
+
return null;
|
|
27165
|
+
}
|
|
27166
|
+
throw err;
|
|
27167
|
+
}
|
|
27168
|
+
for (const entry of entries.toSorted()) {
|
|
27169
|
+
const candidatePath = external_node_path_.join(parentReal, entry);
|
|
27170
|
+
try {
|
|
27171
|
+
const candidateStat = await promises_.lstat(candidatePath);
|
|
27172
|
+
if (candidateStat.isFile() && file_identity_sameFileIdentity(handleStat, candidateStat)) {
|
|
27173
|
+
return await promises_.realpath(candidatePath);
|
|
27174
|
+
}
|
|
27175
|
+
}
|
|
27176
|
+
catch (err) {
|
|
27177
|
+
if (!path_isNotFoundPathError(err)) {
|
|
27178
|
+
throw err;
|
|
27179
|
+
}
|
|
27180
|
+
}
|
|
27181
|
+
}
|
|
27182
|
+
return null;
|
|
27183
|
+
}
|
|
27184
|
+
|
|
27000
27185
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/pinned-python-config.js
|
|
27001
27186
|
let overrideConfig = {};
|
|
27002
27187
|
function parseMode(value) {
|
|
@@ -27843,7 +28028,7 @@ async function runPinnedWriteHelper(params) {
|
|
|
27843
28028
|
relativeParentPath: params.relativeParentPath,
|
|
27844
28029
|
});
|
|
27845
28030
|
if (getFsSafePythonConfig().mode === "off") {
|
|
27846
|
-
return await
|
|
28031
|
+
return await runPinnedWriteFallback(params);
|
|
27847
28032
|
}
|
|
27848
28033
|
if (params.input.kind === "stream") {
|
|
27849
28034
|
try {
|
|
@@ -27851,7 +28036,7 @@ async function runPinnedWriteHelper(params) {
|
|
|
27851
28036
|
}
|
|
27852
28037
|
catch (error) {
|
|
27853
28038
|
if (canFallbackFromPythonError(error)) {
|
|
27854
|
-
return await
|
|
28039
|
+
return await runPinnedWriteFallback(params);
|
|
27855
28040
|
}
|
|
27856
28041
|
throw error;
|
|
27857
28042
|
}
|
|
@@ -27875,7 +28060,7 @@ async function runPinnedWriteHelper(params) {
|
|
|
27875
28060
|
}
|
|
27876
28061
|
catch (error) {
|
|
27877
28062
|
if (canFallbackFromPythonError(error)) {
|
|
27878
|
-
return await
|
|
28063
|
+
return await runPinnedWriteFallback(params);
|
|
27879
28064
|
}
|
|
27880
28065
|
throw error;
|
|
27881
28066
|
}
|
|
@@ -27902,12 +28087,6 @@ async function runPinnedCopyHelper(params) {
|
|
|
27902
28087
|
},
|
|
27903
28088
|
});
|
|
27904
28089
|
}
|
|
27905
|
-
async function runPinnedWriteFallbackOrThrow(params, cause) {
|
|
27906
|
-
if (process.platform !== "win32") {
|
|
27907
|
-
throw new errors_FsSafeError("helper-unavailable", "Python helper is required for pinned writes on this platform", { cause });
|
|
27908
|
-
}
|
|
27909
|
-
return await runPinnedWriteFallback(params);
|
|
27910
|
-
}
|
|
27911
28090
|
async function runPinnedWriteFallback(params) {
|
|
27912
28091
|
const parentPath = params.relativeParentPath
|
|
27913
28092
|
? external_node_path_.join(params.rootPath, ...params.relativeParentPath.split("/"))
|
|
@@ -28030,7 +28209,7 @@ async function resolveRootPath(params) {
|
|
|
28030
28209
|
const absolutePath = external_node_path_.resolve(params.absolutePath);
|
|
28031
28210
|
const rootCanonicalPath = params.rootCanonicalPath
|
|
28032
28211
|
? external_node_path_.resolve(params.rootCanonicalPath)
|
|
28033
|
-
: await
|
|
28212
|
+
: await root_path_resolvePathViaExistingAncestor(rootPath);
|
|
28034
28213
|
const context = createBoundaryResolutionContext({
|
|
28035
28214
|
resolveParams: params,
|
|
28036
28215
|
rootPath,
|
|
@@ -28399,7 +28578,7 @@ async function resolveOutsideLexicalCanonicalPathAsync(params) {
|
|
|
28399
28578
|
if (path_isPathInside(params.rootPath, params.absolutePath)) {
|
|
28400
28579
|
return undefined;
|
|
28401
28580
|
}
|
|
28402
|
-
return await
|
|
28581
|
+
return await root_path_resolvePathViaExistingAncestor(params.absolutePath);
|
|
28403
28582
|
}
|
|
28404
28583
|
function resolveOutsideLexicalCanonicalPathSync(params) {
|
|
28405
28584
|
if (isPathInside(params.rootPath, params.absolutePath)) {
|
|
@@ -28446,11 +28625,11 @@ function buildResolvedRootPath(params) {
|
|
|
28446
28625
|
kind: params.kind.kind,
|
|
28447
28626
|
};
|
|
28448
28627
|
}
|
|
28449
|
-
async function
|
|
28628
|
+
async function root_path_resolvePathViaExistingAncestor(targetPath) {
|
|
28450
28629
|
const normalized = external_node_path_.resolve(targetPath);
|
|
28451
28630
|
let cursor = normalized;
|
|
28452
28631
|
const missingSuffix = [];
|
|
28453
|
-
while (!isFilesystemRoot(cursor) && !(await
|
|
28632
|
+
while (!isFilesystemRoot(cursor) && !(await root_path_pathExists(cursor))) {
|
|
28454
28633
|
missingSuffix.unshift(external_node_path_.basename(cursor));
|
|
28455
28634
|
const parent = external_node_path_.dirname(cursor);
|
|
28456
28635
|
if (parent === cursor) {
|
|
@@ -28458,7 +28637,7 @@ async function resolvePathViaExistingAncestor(targetPath) {
|
|
|
28458
28637
|
}
|
|
28459
28638
|
cursor = parent;
|
|
28460
28639
|
}
|
|
28461
|
-
if (!(await
|
|
28640
|
+
if (!(await root_path_pathExists(cursor))) {
|
|
28462
28641
|
return normalized;
|
|
28463
28642
|
}
|
|
28464
28643
|
try {
|
|
@@ -28570,7 +28749,7 @@ function shortPath(value) {
|
|
|
28570
28749
|
function isFilesystemRoot(candidate) {
|
|
28571
28750
|
return external_node_path_.parse(candidate).root === candidate;
|
|
28572
28751
|
}
|
|
28573
|
-
async function
|
|
28752
|
+
async function root_path_pathExists(targetPath) {
|
|
28574
28753
|
try {
|
|
28575
28754
|
await promises_.lstat(targetPath);
|
|
28576
28755
|
return true;
|
|
@@ -28592,7 +28771,7 @@ async function resolveSymlinkHopPath(symlinkPath) {
|
|
|
28592
28771
|
}
|
|
28593
28772
|
const linkTarget = await promises_.readlink(symlinkPath);
|
|
28594
28773
|
const linkAbsolute = external_node_path_.resolve(external_node_path_.dirname(symlinkPath), linkTarget);
|
|
28595
|
-
return
|
|
28774
|
+
return root_path_resolvePathViaExistingAncestor(linkAbsolute);
|
|
28596
28775
|
}
|
|
28597
28776
|
}
|
|
28598
28777
|
function resolveSymlinkHopPathSync(symlinkPath) {
|
|
@@ -28661,6 +28840,23 @@ function path_policy_shortPath(value) {
|
|
|
28661
28840
|
return value;
|
|
28662
28841
|
}
|
|
28663
28842
|
|
|
28843
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/read-opened-file.js
|
|
28844
|
+
|
|
28845
|
+
async function read_opened_file_readOpenedFileSafely(params) {
|
|
28846
|
+
if (params.maxBytes !== undefined && params.opened.stat.size > params.maxBytes) {
|
|
28847
|
+
throw new errors_FsSafeError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${params.opened.stat.size})`);
|
|
28848
|
+
}
|
|
28849
|
+
const buffer = await params.opened.handle.readFile();
|
|
28850
|
+
if (params.maxBytes !== undefined && buffer.byteLength > params.maxBytes) {
|
|
28851
|
+
throw new errors_FsSafeError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${buffer.byteLength})`);
|
|
28852
|
+
}
|
|
28853
|
+
return {
|
|
28854
|
+
buffer,
|
|
28855
|
+
realPath: params.opened.realPath,
|
|
28856
|
+
stat: params.opened.stat,
|
|
28857
|
+
};
|
|
28858
|
+
}
|
|
28859
|
+
|
|
28664
28860
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/path-stat.js
|
|
28665
28861
|
function pathStatFromStats(stat) {
|
|
28666
28862
|
return {
|
|
@@ -28988,6 +29184,10 @@ async function serializePathWrite(key, run) {
|
|
|
28988
29184
|
|
|
28989
29185
|
|
|
28990
29186
|
|
|
29187
|
+
|
|
29188
|
+
|
|
29189
|
+
|
|
29190
|
+
|
|
28991
29191
|
|
|
28992
29192
|
|
|
28993
29193
|
|
|
@@ -29186,6 +29386,7 @@ class RootHandle {
|
|
|
29186
29386
|
mkdir: this.defaults.mkdir,
|
|
29187
29387
|
mode: this.defaults.mode,
|
|
29188
29388
|
...options,
|
|
29389
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29189
29390
|
append: writeMode === "append",
|
|
29190
29391
|
truncateExisting: writeMode === "replace",
|
|
29191
29392
|
});
|
|
@@ -29197,18 +29398,29 @@ class RootHandle {
|
|
|
29197
29398
|
mkdir: this.defaults.mkdir,
|
|
29198
29399
|
mode: this.defaults.mode,
|
|
29199
29400
|
...options,
|
|
29401
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29200
29402
|
});
|
|
29201
29403
|
}
|
|
29202
|
-
async remove(relativePath) {
|
|
29404
|
+
async remove(relativePath, options = {}) {
|
|
29203
29405
|
assertValidRootRelativePath(relativePath);
|
|
29204
|
-
await removePathInRoot(this.context,
|
|
29406
|
+
await removePathInRoot(this.context, {
|
|
29407
|
+
relativePath,
|
|
29408
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29409
|
+
});
|
|
29205
29410
|
}
|
|
29206
|
-
async mkdir(relativePath) {
|
|
29411
|
+
async mkdir(relativePath, options = {}) {
|
|
29207
29412
|
assertValidRootRelativePath(relativePath);
|
|
29208
|
-
await mkdirPathInRoot(this.context, {
|
|
29413
|
+
await mkdirPathInRoot(this.context, {
|
|
29414
|
+
relativePath,
|
|
29415
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29416
|
+
});
|
|
29209
29417
|
}
|
|
29210
|
-
async ensureRoot() {
|
|
29211
|
-
await mkdirPathInRoot(this.context, {
|
|
29418
|
+
async ensureRoot(options = {}) {
|
|
29419
|
+
await mkdirPathInRoot(this.context, {
|
|
29420
|
+
relativePath: "",
|
|
29421
|
+
allowRoot: true,
|
|
29422
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29423
|
+
});
|
|
29212
29424
|
}
|
|
29213
29425
|
async write(relativePath, data, options = {}) {
|
|
29214
29426
|
await writeFileInRoot(this.context, {
|
|
@@ -29217,6 +29429,7 @@ class RootHandle {
|
|
|
29217
29429
|
mkdir: this.defaults.mkdir,
|
|
29218
29430
|
mode: this.defaults.mode,
|
|
29219
29431
|
...options,
|
|
29432
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29220
29433
|
});
|
|
29221
29434
|
}
|
|
29222
29435
|
async create(relativePath, data, options = {}) {
|
|
@@ -29226,6 +29439,7 @@ class RootHandle {
|
|
|
29226
29439
|
mkdir: this.defaults.mkdir,
|
|
29227
29440
|
mode: this.defaults.mode,
|
|
29228
29441
|
...options,
|
|
29442
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29229
29443
|
overwrite: false,
|
|
29230
29444
|
});
|
|
29231
29445
|
}
|
|
@@ -29248,6 +29462,7 @@ class RootHandle {
|
|
|
29248
29462
|
mkdir: this.defaults.mkdir,
|
|
29249
29463
|
mode: this.defaults.mode,
|
|
29250
29464
|
...options,
|
|
29465
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
29251
29466
|
});
|
|
29252
29467
|
}
|
|
29253
29468
|
async exists(relativePath) {
|
|
@@ -29291,6 +29506,12 @@ class RootHandle {
|
|
|
29291
29506
|
async move(fromRelative, toRelative, options = {}) {
|
|
29292
29507
|
assertValidRootRelativePath(fromRelative);
|
|
29293
29508
|
assertValidRootRelativePath(toRelative);
|
|
29509
|
+
const denyMutations = mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations);
|
|
29510
|
+
await assertMoveMutationAllowed(this.context, {
|
|
29511
|
+
fromRelative,
|
|
29512
|
+
toRelative,
|
|
29513
|
+
denyMutations,
|
|
29514
|
+
});
|
|
29294
29515
|
try {
|
|
29295
29516
|
await runPinnedHelper("rename", this.rootReal, {
|
|
29296
29517
|
from: fromRelative,
|
|
@@ -29302,6 +29523,7 @@ class RootHandle {
|
|
|
29302
29523
|
if (canFallbackFromPythonError(error)) {
|
|
29303
29524
|
await movePathFallback(this.context, {
|
|
29304
29525
|
fromRelative,
|
|
29526
|
+
denyMutations,
|
|
29305
29527
|
overwrite: options.overwrite ?? false,
|
|
29306
29528
|
toRelative,
|
|
29307
29529
|
});
|
|
@@ -29350,7 +29572,7 @@ async function openFileInRoot(root, params) {
|
|
|
29350
29572
|
async function readFileInRoot(root, params) {
|
|
29351
29573
|
const opened = await openFileInRoot(root, params);
|
|
29352
29574
|
try {
|
|
29353
|
-
return await
|
|
29575
|
+
return await read_opened_file_readOpenedFileSafely({ opened, maxBytes: params.maxBytes });
|
|
29354
29576
|
}
|
|
29355
29577
|
finally {
|
|
29356
29578
|
await opened.handle.close().catch(() => { });
|
|
@@ -29383,20 +29605,6 @@ async function openLocalFileSafely(params) {
|
|
|
29383
29605
|
assertNoNulPathInput(params.filePath, "file path contains a NUL byte");
|
|
29384
29606
|
return await openVerifiedLocalFile(params.filePath);
|
|
29385
29607
|
}
|
|
29386
|
-
async function readOpenedFileSafely(params) {
|
|
29387
|
-
if (params.maxBytes !== undefined && params.opened.stat.size > params.maxBytes) {
|
|
29388
|
-
throw new errors_FsSafeError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${params.opened.stat.size})`);
|
|
29389
|
-
}
|
|
29390
|
-
const buffer = await params.opened.handle.readFile();
|
|
29391
|
-
if (params.maxBytes !== undefined && buffer.byteLength > params.maxBytes) {
|
|
29392
|
-
throw new errors_FsSafeError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${buffer.byteLength})`);
|
|
29393
|
-
}
|
|
29394
|
-
return {
|
|
29395
|
-
buffer,
|
|
29396
|
-
realPath: params.opened.realPath,
|
|
29397
|
-
stat: params.opened.stat,
|
|
29398
|
-
};
|
|
29399
|
-
}
|
|
29400
29608
|
function emitWriteBoundaryWarning(reason) {
|
|
29401
29609
|
logWarn(`security: fs-safe write boundary warning (${reason})`);
|
|
29402
29610
|
}
|
|
@@ -29437,82 +29645,9 @@ async function verifyAtomicWriteResult(params) {
|
|
|
29437
29645
|
await opened.handle.close().catch(() => { });
|
|
29438
29646
|
}
|
|
29439
29647
|
}
|
|
29440
|
-
async function resolveOpenedFileRealPathForHandle(handle, ioPath) {
|
|
29441
|
-
const handleStat = await handle.stat();
|
|
29442
|
-
const fdCandidates = process.platform === "linux"
|
|
29443
|
-
? [`/proc/self/fd/${handle.fd}`, `/dev/fd/${handle.fd}`]
|
|
29444
|
-
: process.platform === "win32"
|
|
29445
|
-
? []
|
|
29446
|
-
: [`/dev/fd/${handle.fd}`];
|
|
29447
|
-
for (const fdPath of fdCandidates) {
|
|
29448
|
-
try {
|
|
29449
|
-
const fdRealPath = await promises_.realpath(fdPath);
|
|
29450
|
-
const fdRealStat = await promises_.stat(fdRealPath);
|
|
29451
|
-
if (file_identity_sameFileIdentity(handleStat, fdRealStat)) {
|
|
29452
|
-
return fdRealPath;
|
|
29453
|
-
}
|
|
29454
|
-
}
|
|
29455
|
-
catch {
|
|
29456
|
-
// try next fd path
|
|
29457
|
-
}
|
|
29458
|
-
}
|
|
29459
|
-
try {
|
|
29460
|
-
const ioRealPath = await promises_.realpath(ioPath);
|
|
29461
|
-
const ioRealStat = await promises_.stat(ioRealPath);
|
|
29462
|
-
if (file_identity_sameFileIdentity(handleStat, ioRealStat)) {
|
|
29463
|
-
return ioRealPath;
|
|
29464
|
-
}
|
|
29465
|
-
}
|
|
29466
|
-
catch (err) {
|
|
29467
|
-
if (!path_isNotFoundPathError(err)) {
|
|
29468
|
-
throw err;
|
|
29469
|
-
}
|
|
29470
|
-
}
|
|
29471
|
-
const parentResolved = await resolveOpenedFileRealPathFromParent(handleStat, ioPath);
|
|
29472
|
-
if (parentResolved) {
|
|
29473
|
-
return parentResolved;
|
|
29474
|
-
}
|
|
29475
|
-
throw new errors_FsSafeError("path-mismatch", "unable to resolve opened file path");
|
|
29476
|
-
}
|
|
29477
|
-
async function resolveOpenedFileRealPathFromParent(handleStat, ioPath) {
|
|
29478
|
-
let parentReal;
|
|
29479
|
-
try {
|
|
29480
|
-
parentReal = await promises_.realpath(external_node_path_.dirname(ioPath));
|
|
29481
|
-
}
|
|
29482
|
-
catch (err) {
|
|
29483
|
-
if (path_isNotFoundPathError(err)) {
|
|
29484
|
-
return null;
|
|
29485
|
-
}
|
|
29486
|
-
throw err;
|
|
29487
|
-
}
|
|
29488
|
-
let entries;
|
|
29489
|
-
try {
|
|
29490
|
-
entries = await promises_.readdir(parentReal);
|
|
29491
|
-
}
|
|
29492
|
-
catch (err) {
|
|
29493
|
-
if (path_isNotFoundPathError(err)) {
|
|
29494
|
-
return null;
|
|
29495
|
-
}
|
|
29496
|
-
throw err;
|
|
29497
|
-
}
|
|
29498
|
-
for (const entry of entries.toSorted()) {
|
|
29499
|
-
const candidatePath = external_node_path_.join(parentReal, entry);
|
|
29500
|
-
try {
|
|
29501
|
-
const candidateStat = await promises_.lstat(candidatePath);
|
|
29502
|
-
if (candidateStat.isFile() && file_identity_sameFileIdentity(handleStat, candidateStat)) {
|
|
29503
|
-
return await promises_.realpath(candidatePath);
|
|
29504
|
-
}
|
|
29505
|
-
}
|
|
29506
|
-
catch (err) {
|
|
29507
|
-
if (!path_isNotFoundPathError(err)) {
|
|
29508
|
-
throw err;
|
|
29509
|
-
}
|
|
29510
|
-
}
|
|
29511
|
-
}
|
|
29512
|
-
return null;
|
|
29513
|
-
}
|
|
29514
29648
|
async function openWritableFileInRoot(root, params) {
|
|
29515
29649
|
const { rootReal, rootWithSep, resolved } = await resolvePathInRoot(root, params.relativePath);
|
|
29650
|
+
await assertMutationNotDenied(resolved, params.denyMutations);
|
|
29516
29651
|
try {
|
|
29517
29652
|
await assertNoPathAliasEscape({
|
|
29518
29653
|
absolutePath: resolved,
|
|
@@ -29639,6 +29774,7 @@ async function appendFileInRoot(root, params) {
|
|
|
29639
29774
|
relativePath: params.relativePath,
|
|
29640
29775
|
mkdir: params.mkdir,
|
|
29641
29776
|
mode: params.mode,
|
|
29777
|
+
denyMutations: params.denyMutations,
|
|
29642
29778
|
truncateExisting: false,
|
|
29643
29779
|
append: true,
|
|
29644
29780
|
});
|
|
@@ -29666,8 +29802,8 @@ async function appendFileInRoot(root, params) {
|
|
|
29666
29802
|
await target.handle.close().catch(() => { });
|
|
29667
29803
|
}
|
|
29668
29804
|
}
|
|
29669
|
-
async function removePathInRoot(root,
|
|
29670
|
-
const resolved = await resolvePinnedRemovePathInRoot(root, relativePath);
|
|
29805
|
+
async function removePathInRoot(root, params) {
|
|
29806
|
+
const resolved = await resolvePinnedRemovePathInRoot(root, params.relativePath, params.denyMutations);
|
|
29671
29807
|
if (process.platform === "win32") {
|
|
29672
29808
|
await removePathFallback(resolved);
|
|
29673
29809
|
return;
|
|
@@ -29715,7 +29851,7 @@ async function writeFileInRoot(root, params) {
|
|
|
29715
29851
|
});
|
|
29716
29852
|
return;
|
|
29717
29853
|
}
|
|
29718
|
-
const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode);
|
|
29854
|
+
const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode, params.denyMutations);
|
|
29719
29855
|
await serializePathWrite(pinned.targetPath, async () => {
|
|
29720
29856
|
let identity;
|
|
29721
29857
|
try {
|
|
@@ -29771,7 +29907,7 @@ async function copyFileInRoot(root, params) {
|
|
|
29771
29907
|
});
|
|
29772
29908
|
return;
|
|
29773
29909
|
}
|
|
29774
|
-
const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode);
|
|
29910
|
+
const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode, params.denyMutations);
|
|
29775
29911
|
await serializePathWrite(pinned.targetPath, async () => {
|
|
29776
29912
|
let identity;
|
|
29777
29913
|
try {
|
|
@@ -29815,8 +29951,9 @@ async function copyFileInRoot(root, params) {
|
|
|
29815
29951
|
await source.handle.close().catch(() => { });
|
|
29816
29952
|
}
|
|
29817
29953
|
}
|
|
29818
|
-
async function resolvePinnedWriteTargetInRoot(root, relativePath, requestedMode) {
|
|
29954
|
+
async function resolvePinnedWriteTargetInRoot(root, relativePath, requestedMode, denyMutations) {
|
|
29819
29955
|
const { rootReal, rootWithSep, resolved } = await resolvePathInRoot(root, relativePath);
|
|
29956
|
+
await assertMutationNotDenied(resolved, denyMutations);
|
|
29820
29957
|
try {
|
|
29821
29958
|
await assertNoPathAliasEscape({
|
|
29822
29959
|
absolutePath: resolved,
|
|
@@ -29873,12 +30010,16 @@ async function resolvePinnedWriteTargetInRoot(root, relativePath, requestedMode)
|
|
|
29873
30010
|
async function resolvePinnedPathInRoot(root, params) {
|
|
29874
30011
|
return await resolvePinnedOperationPathInRoot(root, {
|
|
29875
30012
|
allowRoot: params.allowRoot,
|
|
30013
|
+
denyMutations: params.denyMutations,
|
|
30014
|
+
protectDenyMutationAncestors: false,
|
|
29876
30015
|
relativePath: params.relativePath,
|
|
29877
30016
|
policy: PATH_ALIAS_POLICIES.strict,
|
|
29878
30017
|
});
|
|
29879
30018
|
}
|
|
29880
|
-
async function resolvePinnedRemovePathInRoot(root, relativePath) {
|
|
30019
|
+
async function resolvePinnedRemovePathInRoot(root, relativePath, denyMutations) {
|
|
29881
30020
|
return await resolvePinnedOperationPathInRoot(root, {
|
|
30021
|
+
denyMutations,
|
|
30022
|
+
protectDenyMutationAncestors: true,
|
|
29882
30023
|
relativePath,
|
|
29883
30024
|
policy: PATH_ALIAS_POLICIES.unlinkTarget,
|
|
29884
30025
|
});
|
|
@@ -29890,6 +30031,7 @@ async function resolvePinnedOperationPathInRoot(root, params) {
|
|
|
29890
30031
|
});
|
|
29891
30032
|
const relativeResolved = external_node_path_.relative(resolved.rootReal, resolved.canonicalPath);
|
|
29892
30033
|
if ((relativeResolved === "" || relativeResolved === ".") && params.allowRoot === true) {
|
|
30034
|
+
await assertMutationNotDenied(resolved.canonicalPath, params.denyMutations);
|
|
29893
30035
|
return { rootReal: resolved.rootReal, resolved: resolved.canonicalPath, relativePosix: "" };
|
|
29894
30036
|
}
|
|
29895
30037
|
const firstSegment = relativeResolved.split(external_node_path_.sep)[0];
|
|
@@ -29903,6 +30045,9 @@ async function resolvePinnedOperationPathInRoot(root, params) {
|
|
|
29903
30045
|
if (!path_isPathInside(resolved.rootWithSep, resolved.canonicalPath)) {
|
|
29904
30046
|
throw new errors_FsSafeError("outside-workspace", "file is outside workspace root");
|
|
29905
30047
|
}
|
|
30048
|
+
await assertMutationNotDenied(resolved.canonicalPath, params.denyMutations, {
|
|
30049
|
+
protectAncestors: params.protectDenyMutationAncestors,
|
|
30050
|
+
});
|
|
29906
30051
|
return { rootReal: resolved.rootReal, resolved: resolved.canonicalPath, relativePosix };
|
|
29907
30052
|
}
|
|
29908
30053
|
async function resolvePinnedRootPathInRoot(root, params) {
|
|
@@ -29980,13 +30125,21 @@ async function listPathFallback(root, relativePath, withFileTypes) {
|
|
|
29980
30125
|
throw error;
|
|
29981
30126
|
}
|
|
29982
30127
|
}
|
|
30128
|
+
async function assertMoveMutationAllowed(root, params) {
|
|
30129
|
+
const source = await resolvePathInRoot(root, params.fromRelative);
|
|
30130
|
+
await assertMutationNotDenied(source.resolved, params.denyMutations, { protectAncestors: true });
|
|
30131
|
+
const target = await resolvePathInRoot(root, params.toRelative);
|
|
30132
|
+
await assertMutationNotDenied(target.resolved, params.denyMutations, { protectAncestors: true });
|
|
30133
|
+
}
|
|
29983
30134
|
async function movePathFallback(root, params) {
|
|
29984
30135
|
const source = await resolvePathInRoot(root, params.fromRelative);
|
|
30136
|
+
await assertMutationNotDenied(source.resolved, params.denyMutations, { protectAncestors: true });
|
|
29985
30137
|
await resolvePinnedRootPathInRoot(root, {
|
|
29986
30138
|
relativePath: params.fromRelative,
|
|
29987
30139
|
policy: PATH_ALIAS_POLICIES.strict,
|
|
29988
30140
|
});
|
|
29989
30141
|
const target = await resolvePathInRoot(root, params.toRelative);
|
|
30142
|
+
await assertMutationNotDenied(target.resolved, params.denyMutations, { protectAncestors: true });
|
|
29990
30143
|
await resolvePinnedRootPathInRoot(root, {
|
|
29991
30144
|
relativePath: params.toRelative,
|
|
29992
30145
|
policy: PATH_ALIAS_POLICIES.unlinkTarget,
|
|
@@ -30070,6 +30223,7 @@ async function writeFileFallback(root, params) {
|
|
|
30070
30223
|
relativePath: params.relativePath,
|
|
30071
30224
|
mkdir: params.mkdir,
|
|
30072
30225
|
mode: params.mode,
|
|
30226
|
+
denyMutations: params.denyMutations,
|
|
30073
30227
|
truncateExisting: false,
|
|
30074
30228
|
});
|
|
30075
30229
|
const destinationPath = target.realPath;
|
|
@@ -30115,6 +30269,7 @@ async function writeFileFallback(root, params) {
|
|
|
30115
30269
|
}
|
|
30116
30270
|
async function writeMissingFileFallback(root, params) {
|
|
30117
30271
|
const { rootReal, resolved } = await resolvePathInRoot(root, params.relativePath);
|
|
30272
|
+
await assertMutationNotDenied(resolved, params.denyMutations);
|
|
30118
30273
|
try {
|
|
30119
30274
|
await assertNoPathAliasEscape({
|
|
30120
30275
|
absolutePath: resolved,
|
|
@@ -30188,6 +30343,7 @@ async function copyFileFallback(root, params, source) {
|
|
|
30188
30343
|
relativePath: params.relativePath,
|
|
30189
30344
|
mkdir: params.mkdir,
|
|
30190
30345
|
mode: params.mode,
|
|
30346
|
+
denyMutations: params.denyMutations,
|
|
30191
30347
|
truncateExisting: false,
|
|
30192
30348
|
});
|
|
30193
30349
|
const destinationPath = target.realPath;
|
|
@@ -30347,7 +30503,7 @@ async function file_system_utils_pathExistsWithinRoot(targetDir, relativePath) {
|
|
|
30347
30503
|
* (symlink, traversal, or size-limit violation). These errors carry a
|
|
30348
30504
|
* FsSafeError as their `cause` and should be re-thrown rather than
|
|
30349
30505
|
* silently swallowed by per-file error handlers.
|
|
30350
|
-
*/ function
|
|
30506
|
+
*/ function file_system_utils_isFsSafeViolation(error) {
|
|
30351
30507
|
return error instanceof Error && error.cause instanceof errors_FsSafeError;
|
|
30352
30508
|
}
|
|
30353
30509
|
async function file_system_utils_statWithinRoot(targetDir, relativePath) {
|
|
@@ -36145,6 +36301,7 @@ const PackageJsonSchema = schemas_object({
|
|
|
36145
36301
|
*/
|
|
36146
36302
|
|
|
36147
36303
|
|
|
36304
|
+
|
|
36148
36305
|
/** Maximum skill file size: 1 MB */ const MAX_SKILL_FILE_BYTES = 1_048_576;
|
|
36149
36306
|
/**
|
|
36150
36307
|
* Skill directory locations to search for SKILL.md files.
|
|
@@ -36153,6 +36310,33 @@ const PackageJsonSchema = schemas_object({
|
|
|
36153
36310
|
(0,external_node_path_.join)(".claude", "skills"),
|
|
36154
36311
|
(0,external_node_path_.join)(".agents", "skills")
|
|
36155
36312
|
];
|
|
36313
|
+
/** Maximum lock file size: 256 KB */ const MAX_LOCK_FILE_BYTES = 262_144;
|
|
36314
|
+
/** Relative path to the skills lock file. */ const SKILLS_LOCK_PATH = "skills-lock.json";
|
|
36315
|
+
/** Zod schema for skills-lock.json structure */ const SkillsLockSchema = schemas_object({
|
|
36316
|
+
skills: record(schemas_string(), unknown()).optional()
|
|
36317
|
+
});
|
|
36318
|
+
/**
|
|
36319
|
+
* Reads the skills-lock.json file and returns the set of locked skill names.
|
|
36320
|
+
* Returns an empty set if the file does not exist or cannot be parsed.
|
|
36321
|
+
*/ async function readLockedSkillNames(targetDir) {
|
|
36322
|
+
try {
|
|
36323
|
+
const exists = await pathExistsWithinRoot(targetDir, SKILLS_LOCK_PATH);
|
|
36324
|
+
if (!exists) {
|
|
36325
|
+
return new Set();
|
|
36326
|
+
}
|
|
36327
|
+
const content = await readTextWithinRoot(targetDir, SKILLS_LOCK_PATH, MAX_LOCK_FILE_BYTES);
|
|
36328
|
+
const result = SkillsLockSchema.safeParse(JSON.parse(content));
|
|
36329
|
+
if (result.success && Object.hasOwn(result.data, "skills") && result.data.skills != null) {
|
|
36330
|
+
return new Set(Object.keys(result.data.skills));
|
|
36331
|
+
}
|
|
36332
|
+
return new Set();
|
|
36333
|
+
} catch (error) {
|
|
36334
|
+
if (isFsSafeViolation(error)) {
|
|
36335
|
+
throw error;
|
|
36336
|
+
}
|
|
36337
|
+
return new Set();
|
|
36338
|
+
}
|
|
36339
|
+
}
|
|
36156
36340
|
/**
|
|
36157
36341
|
* File system implementation of the skill lint gateway.
|
|
36158
36342
|
*/ class FileSystemSkillLintGateway {
|
|
@@ -36162,7 +36346,11 @@ const PackageJsonSchema = schemas_object({
|
|
|
36162
36346
|
const discovered = await this.discoverSkillsInDir(targetDir, relativeDir);
|
|
36163
36347
|
skills.push(...discovered);
|
|
36164
36348
|
}
|
|
36165
|
-
|
|
36349
|
+
const lockedNames = await readLockedSkillNames(targetDir);
|
|
36350
|
+
if (lockedNames.size === 0) {
|
|
36351
|
+
return skills;
|
|
36352
|
+
}
|
|
36353
|
+
return skills.filter((skill)=>!lockedNames.has(skill.skillName));
|
|
36166
36354
|
}
|
|
36167
36355
|
async discoverSkillsInDir(targetDir, skillsDir) {
|
|
36168
36356
|
try {
|
|
@@ -36245,7 +36433,7 @@ const MAX_WORKFLOW_FILE_BYTES = 1_048_576;
|
|
|
36245
36433
|
const tools = this.extractToolsFromWorkflow(workflow, file.name);
|
|
36246
36434
|
allTools.push(...tools);
|
|
36247
36435
|
} catch (error) {
|
|
36248
|
-
if (
|
|
36436
|
+
if (file_system_utils_isFsSafeViolation(error)) {
|
|
36249
36437
|
throw error;
|
|
36250
36438
|
}
|
|
36251
36439
|
}
|
|
@@ -36602,7 +36790,7 @@ class FileSystemWorkflowGateway {
|
|
|
36602
36790
|
const candidates = extractSetupStepsFromWorkflow(workflow, config.setupActionPatterns);
|
|
36603
36791
|
allCandidates.push(...candidates);
|
|
36604
36792
|
} catch (error) {
|
|
36605
|
-
if (
|
|
36793
|
+
if (file_system_utils_isFsSafeViolation(error)) {
|
|
36606
36794
|
throw error;
|
|
36607
36795
|
}
|
|
36608
36796
|
// Skip workflow files with YAML parse errors or transient I/O failures
|
|
@@ -50956,7 +51144,7 @@ function formatHeadingAsSetext(node, state) {
|
|
|
50956
51144
|
node.type === 'break'
|
|
50957
51145
|
) {
|
|
50958
51146
|
literalWithBreak = true
|
|
50959
|
-
return EXIT
|
|
51147
|
+
return (/* inlined export .EXIT */false)
|
|
50960
51148
|
}
|
|
50961
51149
|
})
|
|
50962
51150
|
|
|
@@ -67974,10 +68162,11 @@ exports.visitAsync = visitAsync;
|
|
|
67974
68162
|
|
|
67975
68163
|
},
|
|
67976
68164
|
5492(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
68165
|
+
const t=Symbol.for(`__confbox_fmt__`),n=/^(\s+)/,r=/(\s+)$/;function i(e,t={}){return{sample:t.indent===void 0&&t.preserveIndentation!==!1&&e.slice(0,t?.sampleSize||1024),whiteSpace:t.preserveWhitespace===!1?void 0:{start:n.exec(e)?.[0]||``,end:r.exec(e)?.[0]||``}}}function a(e,n,r){!n||typeof n!=`object`||Object.defineProperty(n,t,{enumerable:!1,configurable:!0,writable:!0,value:i(e,r)})}function o(n,r){if(!n||typeof n!=`object`||!(t in n))return{indent:r?.indent??2,whitespace:{start:``,end:``}};let i=n[t];return{indent:r?.indent||e(i.sample||``).indent,whitespace:i.whiteSpace||{start:``,end:``}}}
|
|
67977
68166
|
__webpack_require__.d(__webpack_exports__, {
|
|
67978
68167
|
n: () => (a)
|
|
67979
68168
|
});
|
|
67980
|
-
|
|
68169
|
+
|
|
67981
68170
|
|
|
67982
68171
|
},
|
|
67983
68172
|
5975(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
@@ -68004,11 +68193,11 @@ function jsonc_r(n,r){let i=jsonc_parser_m(n,r?.errors,r);return (0,_format.n)(n
|
|
|
68004
68193
|
|
|
68005
68194
|
},
|
|
68006
68195
|
3770(module) {
|
|
68007
|
-
module.exports = JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')
|
|
68196
|
+
module.exports = /*#__PURE__*/JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')
|
|
68008
68197
|
|
|
68009
68198
|
},
|
|
68010
68199
|
3928(module) {
|
|
68011
|
-
module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')
|
|
68200
|
+
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')
|
|
68012
68201
|
|
|
68013
68202
|
},
|
|
68014
68203
|
|
|
@@ -68070,12 +68259,16 @@ __webpack_require__.t = function(value, mode) {
|
|
|
68070
68259
|
})();
|
|
68071
68260
|
// webpack/runtime/define_property_getters
|
|
68072
68261
|
(() => {
|
|
68073
|
-
__webpack_require__.d = (exports,
|
|
68074
|
-
|
|
68075
|
-
|
|
68076
|
-
|
|
68077
|
-
|
|
68078
|
-
|
|
68262
|
+
__webpack_require__.d = (exports, getters, values) => {
|
|
68263
|
+
var define = (defs, kind) => {
|
|
68264
|
+
for(var key in defs) {
|
|
68265
|
+
if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
|
|
68266
|
+
Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
|
|
68267
|
+
}
|
|
68268
|
+
}
|
|
68269
|
+
};
|
|
68270
|
+
define(getters, "get");
|
|
68271
|
+
define(values, "value");
|
|
68079
68272
|
};
|
|
68080
68273
|
})();
|
|
68081
68274
|
// webpack/runtime/ensure_chunk
|
|
@@ -68177,4 +68370,4 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
|
|
|
68177
68370
|
// module factories are used so entry inlining is disabled
|
|
68178
68371
|
// startup
|
|
68179
68372
|
// Load entry module and return exports
|
|
68180
|
-
var __webpack_exports__ = __webpack_require__(
|
|
68373
|
+
var __webpack_exports__ = __webpack_require__(2229);
|