@jspg-ai/coding-bb 0.0.3-beta.17 → 0.0.3-beta.18
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/cbb/lib/install/init.js +6 -2
- package/package.json +1 -1
package/cbb/lib/install/init.js
CHANGED
|
@@ -1006,12 +1006,15 @@ async function init(targetDir, options = {}) {
|
|
|
1006
1006
|
// 选择优先级:调用方预设(cbb setup)> .last-tools(非交互沿用)> 交互选择;无记录才回退全选
|
|
1007
1007
|
const isNonInteractive = yes || !process.stdin.isTTY;
|
|
1008
1008
|
let selectedAdapters;
|
|
1009
|
+
let fromRecord = false; // 选择来自预设或 .last-tools 记录(需落盘归一化后的新工具名)
|
|
1009
1010
|
if (presetAdapters && presetAdapters.length > 0) {
|
|
1010
1011
|
selectedAdapters = presetAdapters;
|
|
1012
|
+
fromRecord = true;
|
|
1011
1013
|
} else if (isNonInteractive) {
|
|
1012
1014
|
const lastTools = readLastTools();
|
|
1013
1015
|
const reused = lastTools ? adapters.filter(a => lastTools.has(a.name)) : [];
|
|
1014
1016
|
selectedAdapters = reused.length > 0 ? reused : adapters;
|
|
1017
|
+
fromRecord = reused.length > 0;
|
|
1015
1018
|
if (yes && process.stdin.isTTY) {
|
|
1016
1019
|
log(reused.length > 0
|
|
1017
1020
|
? `--yes 非交互模式,沿用上次工具选择:${reused.map(a => a.displayName).join('、')}`
|
|
@@ -1020,8 +1023,9 @@ async function init(targetDir, options = {}) {
|
|
|
1020
1023
|
} else {
|
|
1021
1024
|
selectedAdapters = await selectTools(isUpgrade);
|
|
1022
1025
|
}
|
|
1023
|
-
// 业务空间根记录本次选择,供 cbb update
|
|
1024
|
-
|
|
1026
|
+
// 业务空间根记录本次选择,供 cbb update 等非交互场景沿用;
|
|
1027
|
+
// 沿用旧记录时同样落盘,使历史工具名(codebuddy → workbuddy)归一化自愈
|
|
1028
|
+
if (isWorkspaceRoot && fromRecord) {
|
|
1025
1029
|
saveLastTools(selectedAdapters);
|
|
1026
1030
|
}
|
|
1027
1031
|
|