@fractary/codex-cli 0.10.26 → 0.10.27

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 CHANGED
@@ -1047,14 +1047,19 @@ function syncCommand() {
1047
1047
  console.error(chalk10__default.default.yellow(`Warning: Invalid pattern "${pattern}": ${error.message}`));
1048
1048
  }
1049
1049
  }
1050
+ const fsModuleLocal = await import('fs/promises');
1050
1051
  const targetFiles = await Promise.all(
1051
1052
  Array.from(matchedFilePaths).map(async (filePath) => {
1052
1053
  const fullPath = path3__namespace.join(sourceDir, filePath);
1053
- const stats = await import('fs/promises').then((fs3) => fs3.stat(fullPath));
1054
+ const [stats, content] = await Promise.all([
1055
+ fsModuleLocal.stat(fullPath),
1056
+ fsModuleLocal.readFile(fullPath)
1057
+ ]);
1054
1058
  return {
1055
1059
  path: filePath,
1056
1060
  size: stats.size,
1057
- mtime: stats.mtimeMs
1061
+ mtime: stats.mtimeMs,
1062
+ hash: codex.calculateContentHash(content)
1058
1063
  };
1059
1064
  })
1060
1065
  );
@@ -1155,11 +1160,15 @@ function syncCommand() {
1155
1160
  existingCodexFiles = await Promise.all(
1156
1161
  codexGlobMatches.map(async (filePath) => {
1157
1162
  const fullPath = path3__namespace.join(codexProjectDir, filePath);
1158
- const stats = await fsPromises.stat(fullPath);
1163
+ const [stats, content] = await Promise.all([
1164
+ fsPromises.stat(fullPath),
1165
+ fsPromises.readFile(fullPath)
1166
+ ]);
1159
1167
  return {
1160
1168
  path: filePath,
1161
1169
  size: stats.size,
1162
- mtime: stats.mtimeMs
1170
+ mtime: stats.mtimeMs,
1171
+ hash: codex.calculateContentHash(content)
1163
1172
  };
1164
1173
  })
1165
1174
  );