@playcraft/cli 0.0.29 → 0.0.30
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/commands/prefab.js
CHANGED
|
@@ -479,8 +479,17 @@ export function registerPrefabCommands(program) {
|
|
|
479
479
|
return;
|
|
480
480
|
}
|
|
481
481
|
for (const s of scenes) {
|
|
482
|
+
const mark = s.isActive ? ' *' : '';
|
|
482
483
|
const gc = s.gameConfigPath ? ` [${s.gameConfigPath}]` : '';
|
|
483
|
-
console.log(` ${s.name} (${s.id})${gc}`);
|
|
484
|
+
console.log(` ${s.name} (${s.id})${mark}${gc}`);
|
|
485
|
+
}
|
|
486
|
+
if (scenes.some((s) => s.isActive)) {
|
|
487
|
+
console.log('');
|
|
488
|
+
console.log('标 * 为 manifest 中的主场景(isMain)。其他场景请用 --variant <sceneId> 指定上下文。');
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
console.log('');
|
|
492
|
+
console.log('(manifest 未标记主场景;操作其他场景请用 --variant <sceneId>)');
|
|
484
493
|
}
|
|
485
494
|
});
|
|
486
495
|
}
|
|
@@ -62,12 +62,24 @@ export class AgentApiClient {
|
|
|
62
62
|
return res.json();
|
|
63
63
|
}
|
|
64
64
|
static loadConfig() {
|
|
65
|
+
// 兜底覆盖三类常见沙箱运行用户:
|
|
66
|
+
// - AGS 镜像(ccr.ccs.tencentyun.com/ags-image/sandbox-code)默认运行用户为 `user`,HOME=/home/user
|
|
67
|
+
// - 自建 docker/Dockerfile 沙箱 runtime stage 用户为 `opencode`,HOME=/home/opencode
|
|
68
|
+
// - 以 root 启动 CLI 的旁路场景,HOME=/root
|
|
69
|
+
// 第一条 cwd 与第二条 /project 是与运行用户无关的硬编码命中点。
|
|
65
70
|
const searchPaths = [
|
|
66
71
|
join(process.cwd(), '.playcraft.json'),
|
|
67
72
|
'/project/.playcraft.json',
|
|
73
|
+
'/home/user/.playcraft.json',
|
|
74
|
+
'/home/opencode/.playcraft.json',
|
|
75
|
+
'/root/.playcraft.json',
|
|
68
76
|
join(homedir(), '.playcraft.json'),
|
|
69
77
|
];
|
|
78
|
+
const seen = new Set();
|
|
70
79
|
for (const p of searchPaths) {
|
|
80
|
+
if (seen.has(p))
|
|
81
|
+
continue;
|
|
82
|
+
seen.add(p);
|
|
71
83
|
if (existsSync(p)) {
|
|
72
84
|
try {
|
|
73
85
|
return JSON.parse(readFileSync(p, 'utf-8'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcraft/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"release": "node scripts/release.js"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@playcraft/build": "^0.0.
|
|
27
|
-
"@playcraft/common": "^0.0.
|
|
26
|
+
"@playcraft/build": "^0.0.31",
|
|
27
|
+
"@playcraft/common": "^0.0.19",
|
|
28
28
|
"chokidar": "^4.0.3",
|
|
29
29
|
"commander": "^13.1.0",
|
|
30
30
|
"cors": "^2.8.6",
|