@lousy-agents/mcp 5.17.11 → 5.17.13
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 +291 -13
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -6559,7 +6559,7 @@ function escapeJsonPtr(str) {
|
|
|
6559
6559
|
|
|
6560
6560
|
|
|
6561
6561
|
},
|
|
6562
|
-
|
|
6562
|
+
1895(__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);
|
|
@@ -26881,26 +26881,304 @@ function directory_guard_createNearestExistingSyncDirectoryGuard(rootReal, targe
|
|
|
26881
26881
|
return directory_guard_createSyncDirectoryGuard(root);
|
|
26882
26882
|
}
|
|
26883
26883
|
|
|
26884
|
-
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/
|
|
26884
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/directory-durability.js
|
|
26885
26885
|
|
|
26886
26886
|
|
|
26887
|
-
|
|
26887
|
+
|
|
26888
|
+
|
|
26889
|
+
|
|
26890
|
+
|
|
26891
|
+
function directoryOpenFlags() {
|
|
26888
26892
|
if (process.platform === "win32") {
|
|
26889
|
-
return;
|
|
26893
|
+
return "r";
|
|
26890
26894
|
}
|
|
26891
|
-
|
|
26895
|
+
return (external_node_fs_.constants.O_RDONLY |
|
|
26896
|
+
external_node_fs_.constants.O_DIRECTORY |
|
|
26897
|
+
external_node_fs_.constants.O_NOFOLLOW |
|
|
26898
|
+
external_node_fs_.constants.O_NONBLOCK);
|
|
26899
|
+
}
|
|
26900
|
+
function isWindowsDirectorySyncUnsupported(error) {
|
|
26901
|
+
if (process.platform !== "win32") {
|
|
26902
|
+
return false;
|
|
26903
|
+
}
|
|
26904
|
+
const code = error.code;
|
|
26905
|
+
return (code === "EACCES" ||
|
|
26906
|
+
code === "EINVAL" ||
|
|
26907
|
+
code === "EISDIR" ||
|
|
26908
|
+
code === "ENOSYS" ||
|
|
26909
|
+
code === "ENOTSUP" ||
|
|
26910
|
+
code === "EPERM");
|
|
26911
|
+
}
|
|
26912
|
+
function isWindowsDirectoryOpenUnsupported(error) {
|
|
26913
|
+
if (process.platform !== "win32") {
|
|
26914
|
+
return false;
|
|
26915
|
+
}
|
|
26916
|
+
const code = error.code;
|
|
26917
|
+
return code === "EINVAL" || code === "EISDIR" || code === "ENOSYS" || code === "ENOTSUP";
|
|
26918
|
+
}
|
|
26919
|
+
function unsupportedOutcome(error) {
|
|
26920
|
+
const code = error.code;
|
|
26921
|
+
return code ? { status: "unsupported", code } : { status: "unsupported" };
|
|
26922
|
+
}
|
|
26923
|
+
function assertDirectory(identity, pathname, label) {
|
|
26924
|
+
if (identity.isSymbolicLink() || !identity.isDirectory()) {
|
|
26925
|
+
throw new errors_FsSafeError("not-file", `${label} must be a real directory: ${pathname}`);
|
|
26926
|
+
}
|
|
26927
|
+
}
|
|
26928
|
+
async function createDirectoryReceipt(directoryPath, label) {
|
|
26929
|
+
const resolvedPath = external_node_path_.resolve(directoryPath);
|
|
26930
|
+
const identity = await promises_.lstat(resolvedPath);
|
|
26931
|
+
assertDirectory(identity, resolvedPath, label);
|
|
26932
|
+
return {
|
|
26933
|
+
path: resolvedPath,
|
|
26934
|
+
realPath: await promises_.realpath(resolvedPath),
|
|
26935
|
+
identity,
|
|
26936
|
+
};
|
|
26937
|
+
}
|
|
26938
|
+
function createDirectoryReceiptSync(directoryPath, label) {
|
|
26939
|
+
const resolvedPath = path.resolve(directoryPath);
|
|
26940
|
+
const identity = fsSync.lstatSync(resolvedPath);
|
|
26941
|
+
assertDirectory(identity, resolvedPath, label);
|
|
26942
|
+
return {
|
|
26943
|
+
path: resolvedPath,
|
|
26944
|
+
realPath: fsSync.realpathSync(resolvedPath),
|
|
26945
|
+
identity,
|
|
26946
|
+
};
|
|
26947
|
+
}
|
|
26948
|
+
async function assertDirectoryReceiptCurrent(receipt, label) {
|
|
26949
|
+
const currentIdentity = await promises_.lstat(receipt.path);
|
|
26950
|
+
assertDirectory(currentIdentity, receipt.path, label);
|
|
26951
|
+
if (!file_identity_sameFileIdentity(receipt.identity, currentIdentity) ||
|
|
26952
|
+
(await promises_.realpath(receipt.path)) !== receipt.realPath) {
|
|
26953
|
+
throw new errors_FsSafeError("path-mismatch", `${label} changed during durable directory operation: ${receipt.path}`);
|
|
26954
|
+
}
|
|
26955
|
+
}
|
|
26956
|
+
function assertDirectoryReceiptCurrentSync(receipt, label) {
|
|
26957
|
+
const currentIdentity = fsSync.lstatSync(receipt.path);
|
|
26958
|
+
assertDirectory(currentIdentity, receipt.path, label);
|
|
26959
|
+
if (!sameFileIdentity(receipt.identity, currentIdentity) ||
|
|
26960
|
+
fsSync.realpathSync(receipt.path) !== receipt.realPath) {
|
|
26961
|
+
throw new FsSafeError("path-mismatch", `${label} changed during durable directory operation: ${receipt.path}`);
|
|
26962
|
+
}
|
|
26963
|
+
}
|
|
26964
|
+
async function assertOpenDirectoryCurrent(handle, receipt, label) {
|
|
26965
|
+
const openedIdentity = await handle.stat();
|
|
26966
|
+
assertDirectory(openedIdentity, receipt.path, label);
|
|
26967
|
+
if (!file_identity_sameFileIdentity(receipt.identity, openedIdentity)) {
|
|
26968
|
+
throw new errors_FsSafeError("path-mismatch", `${label} handle changed during directory sync: ${receipt.path}`);
|
|
26969
|
+
}
|
|
26970
|
+
await assertDirectoryReceiptCurrent(receipt, label);
|
|
26971
|
+
}
|
|
26972
|
+
class PinnedDirectoryImpl {
|
|
26973
|
+
receipt;
|
|
26974
|
+
#handle;
|
|
26975
|
+
#label;
|
|
26976
|
+
#closed = false;
|
|
26977
|
+
constructor(handle, receipt, label) {
|
|
26978
|
+
this.#handle = handle;
|
|
26979
|
+
this.receipt = receipt;
|
|
26980
|
+
this.#label = label;
|
|
26981
|
+
}
|
|
26982
|
+
async assertCurrent() {
|
|
26983
|
+
if (this.#closed) {
|
|
26984
|
+
throw new errors_FsSafeError("helper-failed", `${this.#label} pin is already closed`);
|
|
26985
|
+
}
|
|
26986
|
+
await assertOpenDirectoryCurrent(this.#handle, this.receipt, this.#label);
|
|
26987
|
+
}
|
|
26988
|
+
async sync() {
|
|
26989
|
+
await this.assertCurrent();
|
|
26990
|
+
try {
|
|
26991
|
+
await this.#handle.sync();
|
|
26992
|
+
}
|
|
26993
|
+
catch (error) {
|
|
26994
|
+
if (!isWindowsDirectorySyncUnsupported(error)) {
|
|
26995
|
+
throw error;
|
|
26996
|
+
}
|
|
26997
|
+
await this.assertCurrent();
|
|
26998
|
+
return unsupportedOutcome(error);
|
|
26999
|
+
}
|
|
27000
|
+
await this.assertCurrent();
|
|
27001
|
+
return { status: "synced" };
|
|
27002
|
+
}
|
|
27003
|
+
async close() {
|
|
27004
|
+
if (this.#closed) {
|
|
27005
|
+
return;
|
|
27006
|
+
}
|
|
27007
|
+
this.#closed = true;
|
|
27008
|
+
await this.#handle.close();
|
|
27009
|
+
}
|
|
27010
|
+
}
|
|
27011
|
+
async function pinDirectory(directory, options = {}) {
|
|
27012
|
+
const label = options.label ?? "directory";
|
|
27013
|
+
const receipt = typeof directory === "string" ? await createDirectoryReceipt(directory, label) : directory;
|
|
27014
|
+
await assertDirectoryReceiptCurrent(receipt, label);
|
|
27015
|
+
const handle = await promises_.open(receipt.path, directoryOpenFlags());
|
|
26892
27016
|
try {
|
|
26893
|
-
|
|
26894
|
-
|
|
26895
|
-
|
|
26896
|
-
|
|
26897
|
-
await handle.
|
|
27017
|
+
await assertOpenDirectoryCurrent(handle, receipt, label);
|
|
27018
|
+
return new PinnedDirectoryImpl(handle, receipt, label);
|
|
27019
|
+
}
|
|
27020
|
+
catch (error) {
|
|
27021
|
+
await handle.close().catch(() => undefined);
|
|
27022
|
+
throw error;
|
|
27023
|
+
}
|
|
27024
|
+
}
|
|
27025
|
+
async function syncDirectory(directory, options = {}) {
|
|
27026
|
+
const label = options.label ?? "directory";
|
|
27027
|
+
const receipt = typeof directory === "string" ? await createDirectoryReceipt(directory, label) : directory;
|
|
27028
|
+
let pinned;
|
|
27029
|
+
try {
|
|
27030
|
+
pinned = await pinDirectory(receipt, { label });
|
|
27031
|
+
}
|
|
27032
|
+
catch (error) {
|
|
27033
|
+
if (!isWindowsDirectoryOpenUnsupported(error)) {
|
|
27034
|
+
throw error;
|
|
27035
|
+
}
|
|
27036
|
+
await assertDirectoryReceiptCurrent(receipt, label);
|
|
27037
|
+
return unsupportedOutcome(error);
|
|
27038
|
+
}
|
|
27039
|
+
try {
|
|
27040
|
+
return await pinned.sync();
|
|
27041
|
+
}
|
|
27042
|
+
finally {
|
|
27043
|
+
await pinned.close();
|
|
27044
|
+
}
|
|
27045
|
+
}
|
|
27046
|
+
function syncDirectorySync(directory, options = {}) {
|
|
27047
|
+
const label = options.label ?? "directory";
|
|
27048
|
+
const receipt = typeof directory === "string" ? createDirectoryReceiptSync(directory, label) : directory;
|
|
27049
|
+
assertDirectoryReceiptCurrentSync(receipt, label);
|
|
27050
|
+
let descriptor;
|
|
27051
|
+
try {
|
|
27052
|
+
descriptor = fsSync.openSync(receipt.path, directoryOpenFlags());
|
|
27053
|
+
}
|
|
27054
|
+
catch (error) {
|
|
27055
|
+
if (!isWindowsDirectoryOpenUnsupported(error)) {
|
|
27056
|
+
throw error;
|
|
27057
|
+
}
|
|
27058
|
+
assertDirectoryReceiptCurrentSync(receipt, label);
|
|
27059
|
+
return unsupportedOutcome(error);
|
|
27060
|
+
}
|
|
27061
|
+
try {
|
|
27062
|
+
const openedIdentity = fsSync.fstatSync(descriptor);
|
|
27063
|
+
assertDirectory(openedIdentity, receipt.path, label);
|
|
27064
|
+
if (!sameFileIdentity(receipt.identity, openedIdentity)) {
|
|
27065
|
+
throw new FsSafeError("path-mismatch", `${label} handle changed during directory sync: ${receipt.path}`);
|
|
27066
|
+
}
|
|
27067
|
+
assertDirectoryReceiptCurrentSync(receipt, label);
|
|
27068
|
+
try {
|
|
27069
|
+
fsSync.fsyncSync(descriptor);
|
|
27070
|
+
}
|
|
27071
|
+
catch (error) {
|
|
27072
|
+
if (!isWindowsDirectorySyncUnsupported(error)) {
|
|
27073
|
+
throw error;
|
|
27074
|
+
}
|
|
27075
|
+
assertDirectoryReceiptCurrentSync(receipt, label);
|
|
27076
|
+
return unsupportedOutcome(error);
|
|
27077
|
+
}
|
|
27078
|
+
assertDirectoryReceiptCurrentSync(receipt, label);
|
|
27079
|
+
return { status: "synced" };
|
|
27080
|
+
}
|
|
27081
|
+
finally {
|
|
27082
|
+
fsSync.closeSync(descriptor);
|
|
27083
|
+
}
|
|
27084
|
+
}
|
|
27085
|
+
async function syncDirectoryBestEffort(directoryPath) {
|
|
27086
|
+
await syncDirectory(directoryPath).catch(() => undefined);
|
|
27087
|
+
}
|
|
27088
|
+
function syncDirectoryBestEffortSync(directoryPath) {
|
|
27089
|
+
try {
|
|
27090
|
+
syncDirectorySync(directoryPath);
|
|
26898
27091
|
}
|
|
26899
27092
|
catch {
|
|
26900
|
-
//
|
|
27093
|
+
// Compatibility helper for operations whose primary write may remain usable.
|
|
27094
|
+
}
|
|
27095
|
+
}
|
|
27096
|
+
async function findExistingAncestorReceipt(targetPath, label) {
|
|
27097
|
+
let currentPath = path.resolve(targetPath);
|
|
27098
|
+
while (true) {
|
|
27099
|
+
try {
|
|
27100
|
+
return await createDirectoryReceipt(currentPath, label);
|
|
27101
|
+
}
|
|
27102
|
+
catch (error) {
|
|
27103
|
+
if (error.code !== "ENOENT") {
|
|
27104
|
+
throw error;
|
|
27105
|
+
}
|
|
27106
|
+
}
|
|
27107
|
+
const parentPath = path.dirname(currentPath);
|
|
27108
|
+
if (parentPath === currentPath) {
|
|
27109
|
+
throw new FsSafeError("not-found", `${label} has no existing directory ancestor`);
|
|
27110
|
+
}
|
|
27111
|
+
currentPath = parentPath;
|
|
27112
|
+
}
|
|
27113
|
+
}
|
|
27114
|
+
async function ensureDurableDirectory(options) {
|
|
27115
|
+
const directoryPath = path.resolve(options.directoryPath);
|
|
27116
|
+
const label = options.label ?? "directory";
|
|
27117
|
+
const ancestorReceipt = await findExistingAncestorReceipt(directoryPath, label);
|
|
27118
|
+
const targetExists = ancestorReceipt.path === directoryPath;
|
|
27119
|
+
if (options.expectedExistingIdentity &&
|
|
27120
|
+
(!targetExists || !sameFileIdentity(options.expectedExistingIdentity, ancestorReceipt.identity))) {
|
|
27121
|
+
throw new FsSafeError("path-mismatch", `${label} changed before durable directory pinning: ${directoryPath}`);
|
|
27122
|
+
}
|
|
27123
|
+
const ancestor = await pinDirectory(ancestorReceipt, { label });
|
|
27124
|
+
const pinnedDirectories = [ancestor];
|
|
27125
|
+
try {
|
|
27126
|
+
await ancestor.assertCurrent();
|
|
27127
|
+
if (!targetExists) {
|
|
27128
|
+
if (options.create) {
|
|
27129
|
+
await options.create(directoryPath);
|
|
27130
|
+
}
|
|
27131
|
+
else {
|
|
27132
|
+
const created = await ensureAbsoluteDirectory(directoryPath, {
|
|
27133
|
+
mode: options.mode,
|
|
27134
|
+
scopeLabel: label,
|
|
27135
|
+
});
|
|
27136
|
+
if (!created.ok) {
|
|
27137
|
+
throw created.error;
|
|
27138
|
+
}
|
|
27139
|
+
}
|
|
27140
|
+
}
|
|
27141
|
+
await ancestor.assertCurrent();
|
|
27142
|
+
let currentPath = ancestor.receipt.path;
|
|
27143
|
+
for (const segment of path
|
|
27144
|
+
.relative(ancestor.receipt.path, directoryPath)
|
|
27145
|
+
.split(path.sep)
|
|
27146
|
+
.filter(Boolean)) {
|
|
27147
|
+
currentPath = path.join(currentPath, segment);
|
|
27148
|
+
pinnedDirectories.push(await pinDirectory(currentPath, { label }));
|
|
27149
|
+
}
|
|
27150
|
+
let parentSync = { status: "not-needed" };
|
|
27151
|
+
for (let index = pinnedDirectories.length - 1; index > 0; index -= 1) {
|
|
27152
|
+
const parent = pinnedDirectories[index - 1];
|
|
27153
|
+
const child = pinnedDirectories[index];
|
|
27154
|
+
if (!parent || !child) {
|
|
27155
|
+
throw new FsSafeError("helper-failed", `${label} directory pin chain is incomplete`);
|
|
27156
|
+
}
|
|
27157
|
+
await child.assertCurrent();
|
|
27158
|
+
try {
|
|
27159
|
+
const outcome = await parent.sync();
|
|
27160
|
+
if (outcome.status === "unsupported") {
|
|
27161
|
+
parentSync = outcome;
|
|
27162
|
+
}
|
|
27163
|
+
else if (parentSync.status === "not-needed") {
|
|
27164
|
+
parentSync = outcome;
|
|
27165
|
+
}
|
|
27166
|
+
}
|
|
27167
|
+
catch (error) {
|
|
27168
|
+
throw new FsSafeError("helper-failed", `${label} could not sync created directory edge ${child.receipt.path} through ${parent.receipt.path}`, { cause: error });
|
|
27169
|
+
}
|
|
27170
|
+
await child.assertCurrent();
|
|
27171
|
+
}
|
|
27172
|
+
const finalReceipt = pinnedDirectories.at(-1)?.receipt;
|
|
27173
|
+
if (!finalReceipt) {
|
|
27174
|
+
throw new FsSafeError("helper-failed", `${label} directory receipt is missing`);
|
|
27175
|
+
}
|
|
27176
|
+
await ancestor.assertCurrent();
|
|
27177
|
+
await assertDirectoryReceiptCurrent(finalReceipt, label);
|
|
27178
|
+
return { ...finalReceipt, parentSync };
|
|
26901
27179
|
}
|
|
26902
27180
|
finally {
|
|
26903
|
-
await
|
|
27181
|
+
await Promise.all(pinnedDirectories.toReversed().map(async (directory) => directory.close()));
|
|
26904
27182
|
}
|
|
26905
27183
|
}
|
|
26906
27184
|
|
|
@@ -69267,4 +69545,4 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
|
|
|
69267
69545
|
// module factories are used so entry inlining is disabled
|
|
69268
69546
|
// startup
|
|
69269
69547
|
// Load entry module and return exports
|
|
69270
|
-
var __webpack_exports__ = __webpack_require__(
|
|
69548
|
+
var __webpack_exports__ = __webpack_require__(1895);
|