@clawos-dev/clawd 0.2.143-beta.304.b7f17df → 0.2.143-beta.305.c9c21d1
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
|
@@ -8435,7 +8435,7 @@ var require_transport = __commonJS({
|
|
|
8435
8435
|
"use strict";
|
|
8436
8436
|
var { createRequire } = require("module");
|
|
8437
8437
|
var getCallers = require_caller();
|
|
8438
|
-
var { join: join15, isAbsolute: isAbsolute2, sep:
|
|
8438
|
+
var { join: join15, isAbsolute: isAbsolute2, sep: sep3 } = require("path");
|
|
8439
8439
|
var sleep2 = require_atomic_sleep();
|
|
8440
8440
|
var onExit = require_on_exit_leak_free();
|
|
8441
8441
|
var ThreadStream = require_thread_stream();
|
|
@@ -8543,7 +8543,7 @@ var require_transport = __commonJS({
|
|
|
8543
8543
|
let fixTarget2;
|
|
8544
8544
|
for (const filePath of callers) {
|
|
8545
8545
|
try {
|
|
8546
|
-
const context = filePath === "node:repl" ? process.cwd() +
|
|
8546
|
+
const context = filePath === "node:repl" ? process.cwd() + sep3 : filePath;
|
|
8547
8547
|
fixTarget2 = createRequire(context).resolve(origin);
|
|
8548
8548
|
break;
|
|
8549
8549
|
} catch (err) {
|
|
@@ -35740,13 +35740,16 @@ function seedDefaultPersonas(args) {
|
|
|
35740
35740
|
args.logger.info("persona.seed.created", { personaId: entry.personaId });
|
|
35741
35741
|
}
|
|
35742
35742
|
}
|
|
35743
|
+
function skipNodeModules(src) {
|
|
35744
|
+
return !src.split(path11.sep).includes("node_modules");
|
|
35745
|
+
}
|
|
35743
35746
|
function copyBundleExtras(srcDir, dstDir) {
|
|
35744
35747
|
for (const entry of fs9.readdirSync(srcDir, { withFileTypes: true })) {
|
|
35745
35748
|
if (entry.name === "CLAUDE.md" || entry.name === ".clawd") continue;
|
|
35746
35749
|
const srcPath = path11.join(srcDir, entry.name);
|
|
35747
35750
|
const dstPath = path11.join(dstDir, entry.name);
|
|
35748
35751
|
if (entry.isDirectory()) {
|
|
35749
|
-
fs9.cpSync(srcPath, dstPath, { recursive: true, dereference: true });
|
|
35752
|
+
fs9.cpSync(srcPath, dstPath, { recursive: true, dereference: true, filter: skipNodeModules });
|
|
35750
35753
|
} else if (entry.isFile()) {
|
|
35751
35754
|
fs9.copyFileSync(srcPath, dstPath);
|
|
35752
35755
|
}
|
|
@@ -35765,7 +35768,7 @@ function refreshDaemonManagedDirs(args) {
|
|
|
35765
35768
|
if (!fs9.existsSync(srcPath)) continue;
|
|
35766
35769
|
const dstPath = path11.join(personaDir, relPath);
|
|
35767
35770
|
try {
|
|
35768
|
-
fs9.cpSync(srcPath, dstPath, { recursive: true, force: true, dereference: true });
|
|
35771
|
+
fs9.cpSync(srcPath, dstPath, { recursive: true, force: true, dereference: true, filter: skipNodeModules });
|
|
35769
35772
|
args.logger.info("persona.refresh.synced", {
|
|
35770
35773
|
personaId: entry.personaId,
|
|
35771
35774
|
path: relPath
|
|
@@ -42313,8 +42316,8 @@ function isGuestPathAllowed(grants, absPath, personaRoot, action = "read", userW
|
|
|
42313
42316
|
if (target === u || target.startsWith(u + usep)) return true;
|
|
42314
42317
|
}
|
|
42315
42318
|
const root = path40.resolve(personaRoot);
|
|
42316
|
-
const
|
|
42317
|
-
if (!target.startsWith(root +
|
|
42319
|
+
const sep3 = root.endsWith(path40.sep) ? "" : path40.sep;
|
|
42320
|
+
if (!target.startsWith(root + sep3)) return false;
|
|
42318
42321
|
const rel = path40.relative(root, target);
|
|
42319
42322
|
if (!rel || rel.startsWith("..")) return false;
|
|
42320
42323
|
const personaId = rel.split(path40.sep)[0];
|
|
@@ -42326,8 +42329,8 @@ function isGuestPathAllowed(grants, absPath, personaRoot, action = "read", userW
|
|
|
42326
42329
|
function personaIdFromPath(absPath, personaRoot) {
|
|
42327
42330
|
const root = path40.resolve(personaRoot);
|
|
42328
42331
|
const target = path40.resolve(absPath);
|
|
42329
|
-
const
|
|
42330
|
-
if (!target.startsWith(root +
|
|
42332
|
+
const sep3 = root.endsWith(path40.sep) ? "" : path40.sep;
|
|
42333
|
+
if (!target.startsWith(root + sep3)) return null;
|
|
42331
42334
|
const rel = path40.relative(root, target);
|
|
42332
42335
|
if (!rel || rel.startsWith("..")) return null;
|
|
42333
42336
|
const id = rel.split(path40.sep)[0];
|
|
@@ -18,5 +18,9 @@ DEST="${3:?缺目标目录}"
|
|
|
18
18
|
remaining="$(find "$DEST" -mindepth 1 -maxdepth 1 ! -name '.clawd-project.json' -print -quit)"
|
|
19
19
|
[ -z "$remaining" ] || { echo "❌ 目标已有内容(非空目录): $DEST" >&2; exit 1; }
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
# 排除 node_modules:模板可能被 install 过,pnpm 的 node_modules 里有指向**模板绝对路径**的软链
|
|
22
|
+
# (tslib 等传递依赖)。cp 到新项目后这些软链 dangling(仍指模板原始路径);而 pnpm install 见
|
|
23
|
+
# node_modules 已在 + lockfile 没变会直接 skip、不重建软链 → 运行/打包时 Cannot find module。
|
|
24
|
+
# 新项目本来就要 install,故 scaffold 一律不拷 node_modules(保留 lockfile 以锁版本)。
|
|
25
|
+
rsync -a --exclude='node_modules' "$SRC/" "$DEST/"
|
|
22
26
|
echo "✅ 新 extension: $DEST"
|
package/package.json
CHANGED