@lousy-agents/cli 5.22.15 → 5.22.16

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.
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@biomejs/biome": "2.5.15",
21
- "@lousy-agents/mcp": "5.22.14",
21
+ "@lousy-agents/mcp": "5.22.15",
22
22
  "@modelcontextprotocol/server-sequential-thinking": "2026.8.31",
23
23
  "@testcontainers/postgresql": "12.2.1",
24
24
  "@types/node": "24.19.2",
@@ -958,9 +958,9 @@
958
958
  }
959
959
  },
960
960
  "node_modules/@lousy-agents/mcp": {
961
- "version": "5.22.14",
962
- "resolved": "https://registry.npmjs.org/@lousy-agents/mcp/-/mcp-5.22.14.tgz",
963
- "integrity": "sha512-QUo3RbJsQyQ7/XycL/GnldeOcr8Hnnsi/4U9Iycv9rv+lnR/R2BByk0e2xugbILlhFuh1gpqri7NMVLrCYk8qA==",
961
+ "version": "5.22.15",
962
+ "resolved": "https://registry.npmjs.org/@lousy-agents/mcp/-/mcp-5.22.15.tgz",
963
+ "integrity": "sha512-ew1NbCMHNaupCB5tpils2bO5XnRS8TvvV5sxkHkZ2v+A8VyVtUWjNQ7uUiWfNAXMEh9MjYtL/A7pGeRnsr39qw==",
964
964
  "dev": true,
965
965
  "license": "BSD-2-Clause-Patent",
966
966
  "dependencies": {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@biomejs/biome": "2.5.15",
32
- "@lousy-agents/mcp": "5.22.14",
32
+ "@lousy-agents/mcp": "5.22.15",
33
33
  "@modelcontextprotocol/server-sequential-thinking": "2026.8.31",
34
34
  "@testcontainers/postgresql": "12.2.1",
35
35
  "@types/node": "24.19.2",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@biomejs/biome": "2.5.15",
23
- "@lousy-agents/mcp": "5.22.14",
23
+ "@lousy-agents/mcp": "5.22.15",
24
24
  "@modelcontextprotocol/server-sequential-thinking": "2026.8.31",
25
25
  "@types/node": "24.19.2",
26
26
  "chance": "1.1.13",
package/dist/index.js CHANGED
@@ -3053,7 +3053,7 @@ exports.basename = (path, { windows } = {}) => {
3053
3053
 
3054
3054
 
3055
3055
  },
3056
- 6834(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
3056
+ 5217(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
3057
3057
  // NAMESPACE OBJECT: ../../node_modules/micromark/lib/constructs.js
3058
3058
  var constructs_namespaceObject = {};
3059
3059
  __webpack_require__.r(constructs_namespaceObject);
@@ -18751,8 +18751,8 @@ function pinnedWriteModeAssertion(fd, mode, assertBeforeMutation, privateCreatio
18751
18751
 
18752
18752
 
18753
18753
  // Node has no portable no-replace rename. Publish the completed stage by link,
18754
- // then remove its verified temporary name without yielding.
18755
- function publishCopyStage(params) {
18754
+ // then remove its verified temporary name after any descriptor handoff.
18755
+ async function publishCopyStage(params) {
18756
18756
  const { identity, temporaryPath, targetPath } = params;
18757
18757
  const assertCurrent = () => {
18758
18758
  directory_guard_assertSyncDirectoryGuard(params.parentGuard);
@@ -18806,13 +18806,23 @@ function publishCopyStage(params) {
18806
18806
  }
18807
18807
  }
18808
18808
  else {
18809
- const parent = external_node_fs_.lstatSync(external_node_path_.dirname(temporaryPath), { bigint: true });
18810
- const current = external_node_fs_.lstatSync(temporaryPath, { bigint: true });
18811
- if (parent.isSymbolicLink() || !parent.isDirectory() ||
18812
- !file_identity_sameFileIdentityForCleanup(parent, params.parentGuard.stat) ||
18813
- current.isSymbolicLink() || !current.isFile() ||
18814
- !file_identity_sameFileIdentityForCleanup(current, identity)) {
18815
- throw new errors_FsSafeError("path-mismatch", "published copy temporary name changed before cleanup");
18809
+ const verifyPair = () => {
18810
+ directory_guard_assertSyncDirectoryGuard(params.parentGuard);
18811
+ const parent = external_node_fs_.lstatSync(external_node_path_.dirname(temporaryPath), { bigint: true });
18812
+ const current = external_node_fs_.lstatSync(temporaryPath, { bigint: true });
18813
+ const target = external_node_fs_.lstatSync(targetPath, { bigint: true });
18814
+ if (parent.isSymbolicLink() || !parent.isDirectory() ||
18815
+ !file_identity_sameFileIdentityForCleanup(parent, params.parentGuard.stat) ||
18816
+ current.isSymbolicLink() || !current.isFile() || current.nlink !== 2n ||
18817
+ target.isSymbolicLink() || !target.isFile() || target.nlink !== 2n ||
18818
+ !file_identity_sameFileIdentityForCleanup(current, identity) || !file_identity_sameFileIdentityForCleanup(target, identity)) {
18819
+ throw new errors_FsSafeError("path-mismatch", "published copy temporary name changed before cleanup");
18820
+ }
18821
+ };
18822
+ verifyPair();
18823
+ if (params.beforeTemporaryUnlink) {
18824
+ await params.beforeTemporaryUnlink();
18825
+ verifyPair();
18816
18826
  }
18817
18827
  // This removes the stage's name, never the published destination or source.
18818
18828
  external_node_fs_.unlinkSync(temporaryPath);
@@ -18885,6 +18895,40 @@ function publishThroughPlaceholder(params, assertCurrent) {
18885
18895
  }
18886
18896
  }
18887
18897
 
18898
+ ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/publication-handle.js
18899
+
18900
+
18901
+
18902
+
18903
+
18904
+
18905
+ /** Pin the published name before releasing a descriptor opened through its stage. */
18906
+ async function openPublicationHandle(targetPath, identity) {
18907
+ const flags = read_open_flags_resolveReadOpenFlags();
18908
+ const handle = await promises_.open(targetPath, flags).catch(async (error) => {
18909
+ // Restrictive final modes must not be widened just to inspect publication.
18910
+ if (!hasErrorCode(error, "EACCES") || (process.arch !== "x64" && process.arch !== "arm64"))
18911
+ throw error;
18912
+ const metadataFlag = process.platform === "linux" ? 0x200000 : undefined; // O_PATH
18913
+ if (metadataFlag === undefined)
18914
+ throw error;
18915
+ return promises_.open(targetPath, metadataFlag | external_node_fs_.constants.O_NOFOLLOW);
18916
+ });
18917
+ try {
18918
+ const opened = external_node_fs_.fstatSync(handle.fd, { bigint: true });
18919
+ const named = external_node_fs_.lstatSync(targetPath, { bigint: true });
18920
+ if (!opened.isFile() || !named.isFile() || named.isSymbolicLink() ||
18921
+ !file_identity_sameFileIdentityForCleanup(opened, identity) || !file_identity_sameFileIdentityForCleanup(named, identity)) {
18922
+ throw new errors_FsSafeError("path-mismatch", "publication descriptor handoff identity changed");
18923
+ }
18924
+ return handle;
18925
+ }
18926
+ catch (error) {
18927
+ await handle.close().catch(() => undefined);
18928
+ throw error;
18929
+ }
18930
+ }
18931
+
18888
18932
  ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js
18889
18933
 
18890
18934
 
@@ -18906,6 +18950,7 @@ function publishThroughPlaceholder(params, assertCurrent) {
18906
18950
 
18907
18951
 
18908
18952
 
18953
+
18909
18954
 
18910
18955
 
18911
18956
  async function runPinnedStagedWrite(params, parentPath, parentGuard) {
@@ -18923,6 +18968,7 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
18923
18968
  let handle;
18924
18969
  let tempIdentity;
18925
18970
  let readHandle;
18971
+ let handoffCloseFailure;
18926
18972
  let renamed = false;
18927
18973
  const completeCreate = params.overwrite === false && params.input.kind !== "file" && params.input.stageBeforePublish === true;
18928
18974
  let receipt;
@@ -18977,11 +19023,15 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
18977
19023
  }), external_node_path_.basename(tempPath), external_node_fs_.fstatSync(handle.fd, { bigint: true }));
18978
19024
  }
18979
19025
  let verifiedIdentity = expectedTempStat;
19026
+ // Keep unreadable modes supported where Node has no read-free file open.
19027
+ const canHandoff = process.platform !== "win32" &&
19028
+ ((params.mode & 0o400) !== 0 ||
19029
+ (process.platform === "linux" && (process.arch === "x64" || process.arch === "arm64")));
18980
19030
  phase = "publish";
18981
19031
  await withAsyncDirectoryGuards([parentGuard], async () => {
18982
19032
  assertFinalSymlinkRejected(targetPath, params.rejectFinalSymlink);
18983
19033
  if (params.overwrite === false) {
18984
- publishCopyStage({
19034
+ await publishCopyStage({
18985
19035
  temporaryPath: tempPath, targetPath, fd: handle.fd,
18986
19036
  identity: tempIdentity, parentGuard,
18987
19037
  assertBeforeMutation,
@@ -18995,6 +19045,18 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
18995
19045
  publication = Object.freeze({ status: "published", staged: receipt, basename: params.basename, overwrite: false });
18996
19046
  params.onPublished?.(identity);
18997
19047
  },
19048
+ beforeTemporaryUnlink: !canHandoff ? undefined : async () => {
19049
+ readHandle = await openPublicationHandle(targetPath, expectedTempStat);
19050
+ // Keep the destination pinned while closing the stage's NFS dentry.
19051
+ const stagedHandle = handle;
19052
+ handle = undefined;
19053
+ try {
19054
+ await stagedHandle.close();
19055
+ }
19056
+ catch (error) {
19057
+ handoffCloseFailure = { error };
19058
+ }
19059
+ },
18998
19060
  });
18999
19061
  }
19000
19062
  else {
@@ -19022,6 +19084,7 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
19022
19084
  throw new errors_FsSafeError("path-mismatch", "fallback target changed during write");
19023
19085
  }
19024
19086
  const expectedHash = sha256Hex(params.input.data, params.input.encoding);
19087
+ await readHandle?.close();
19025
19088
  readHandle = await promises_.open(targetPath, read_open_flags_resolveReadOpenFlags());
19026
19089
  const readHandleStat = external_node_fs_.fstatSync(readHandle.fd, { bigint: true });
19027
19090
  const actualHash = sha256Hex(await readFileHandleBounded(readHandle, Infinity));
@@ -19060,7 +19123,11 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
19060
19123
  pathname: tempPath, handle, identity: tempIdentity, parentGuard, throwOnCleanupError: true,
19061
19124
  }) : "not-needed";
19062
19125
  },
19063
- close: [async () => { await readHandle?.close(); }, async () => { await handle?.close(); }],
19126
+ close: [async () => { await readHandle?.close(); }, async () => {
19127
+ await handle?.close();
19128
+ if (handoffCloseFailure)
19129
+ throw handoffCloseFailure.error;
19130
+ }],
19064
19131
  });
19065
19132
  }
19066
19133
  else
@@ -112983,4 +113050,4 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
112983
113050
  // module factories are used so entry inlining is disabled
112984
113051
  // startup
112985
113052
  // Load entry module and return exports
112986
- var __webpack_exports__ = __webpack_require__(6834);
113053
+ var __webpack_exports__ = __webpack_require__(5217);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/cli",
3
- "version": "5.22.15",
3
+ "version": "5.22.16",
4
4
  "description": "CLI scaffolding tool that sets up projects with structure, instructions, and feedback loops for AI coding assistants",
5
5
  "type": "module",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "devDependencies": {
24
24
  "@biomejs/biome": "2.5.15",
25
25
  "@eslint/eslintrc": "3.3.7",
26
- "@lousy-agents/mcp": "5.22.14",
26
+ "@lousy-agents/mcp": "5.22.15",
27
27
  "@modelcontextprotocol/server-sequential-thinking": "2026.8.31",
28
28
  "@testing-library/jest-dom": "7.0.1",
29
29
  "@testing-library/react": "16.3.3",