@cannbot-ai/install-helper 0.0.2-beta.1 → 0.0.2-beta.3
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/index.js +32 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -475,7 +475,10 @@ var zh_CN = {
|
|
|
475
475
|
status_title: "\u5DF2\u5B89\u88C5\u63D2\u4EF6",
|
|
476
476
|
status_none: "\u6682\u65E0\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6",
|
|
477
477
|
status_hint: "\u8FD0\u884C install-helper init \u5F00\u59CB\u5B89\u88C5",
|
|
478
|
-
status_install_time: "\u5B89\u88C5\u65F6\u95F4"
|
|
478
|
+
status_install_time: "\u5B89\u88C5\u65F6\u95F4",
|
|
479
|
+
install_installed_to: "\u5B89\u88C5\u5230",
|
|
480
|
+
install_skills_count: "Skills",
|
|
481
|
+
install_agents_count: "Agents"
|
|
479
482
|
};
|
|
480
483
|
var en_US = {
|
|
481
484
|
wizard_title: "CANNBot Skills Setup Wizard",
|
|
@@ -560,7 +563,10 @@ var en_US = {
|
|
|
560
563
|
status_title: "Installed Plugins",
|
|
561
564
|
status_none: "No installed plugins",
|
|
562
565
|
status_hint: "Run install-helper init to start",
|
|
563
|
-
status_install_time: "Installed at"
|
|
566
|
+
status_install_time: "Installed at",
|
|
567
|
+
install_installed_to: "Installed to",
|
|
568
|
+
install_skills_count: "Skills",
|
|
569
|
+
install_agents_count: "Agents"
|
|
564
570
|
};
|
|
565
571
|
var currentLang = "zh_CN";
|
|
566
572
|
function setLanguage(lang) {
|
|
@@ -793,7 +799,7 @@ async function runWizard() {
|
|
|
793
799
|
}
|
|
794
800
|
}
|
|
795
801
|
async function stepTool(detectedTools, lastTool) {
|
|
796
|
-
printBoxTitle("\u9009\u62E9 AI \u7F16\u7A0B\u5DE5\u5177");
|
|
802
|
+
printBoxTitle("[1/4] \u9009\u62E9 AI \u7F16\u7A0B\u5DE5\u5177");
|
|
797
803
|
if (detectedTools.length === 0) {
|
|
798
804
|
logger.error(t("error_tool_not_found"));
|
|
799
805
|
const choices2 = [
|
|
@@ -868,7 +874,7 @@ async function stepToolManual(lastTool) {
|
|
|
868
874
|
return result;
|
|
869
875
|
}
|
|
870
876
|
async function stepLevel(lastLevel) {
|
|
871
|
-
printBoxTitle("\u9009\u62E9\u5B89\u88C5\u4F4D\u7F6E");
|
|
877
|
+
printBoxTitle("[2/4] \u9009\u62E9\u5B89\u88C5\u4F4D\u7F6E");
|
|
872
878
|
const choices = [
|
|
873
879
|
{ name: "> project \u2014 \u5B89\u88C5\u5230\u5F53\u524D\u76EE\u5F55\uFF08\u63A8\u8350\uFF0C\u4EC5\u5F53\u524D\u9879\u76EE\u53EF\u7528\uFF09", value: "project" },
|
|
874
880
|
{ name: "> global \u2014 \u5B89\u88C5\u5230\u5168\u5C40\uFF08\u6240\u6709\u9879\u76EE\u5171\u4EAB\uFF09", value: "global" },
|
|
@@ -889,7 +895,7 @@ async function stepLevel(lastLevel) {
|
|
|
889
895
|
return result;
|
|
890
896
|
}
|
|
891
897
|
async function stepPlugins(tool, level) {
|
|
892
|
-
printBoxTitle("\u9009\u62E9\u8981\u5B89\u88C5\u7684\u63D2\u4EF6");
|
|
898
|
+
printBoxTitle("[3/4] \u9009\u62E9\u8981\u5B89\u88C5\u7684\u63D2\u4EF6");
|
|
893
899
|
const plugins = getAllPlugins();
|
|
894
900
|
const configRoot = getConfigRoot(tool, level);
|
|
895
901
|
const manifests = readAllManifests(configRoot);
|
|
@@ -934,14 +940,17 @@ async function stepPlugins(tool, level) {
|
|
|
934
940
|
return pluginIds;
|
|
935
941
|
}
|
|
936
942
|
async function stepConfirm(tool, level, plugins) {
|
|
937
|
-
printBoxTitle("\u786E\u8BA4\u5B89\u88C5");
|
|
943
|
+
printBoxTitle("[4/4] \u786E\u8BA4\u5B89\u88C5");
|
|
938
944
|
const allPlugins = getAllPlugins();
|
|
939
945
|
const selectedPlugins = plugins.map((id) => allPlugins.find((p) => p.id === id));
|
|
940
946
|
const displayPath = getConfigRoot(tool, level);
|
|
941
|
-
|
|
947
|
+
const toolName = getToolDisplayName(tool);
|
|
948
|
+
const levelText = level === "project" ? "project" : "global";
|
|
949
|
+
logger.info(`\u5373\u5C06\u5B89\u88C5 ${chalk2.bold(plugins.length)} \u4E2A\u63D2\u4EF6\u5230 ${chalk2.green(toolName)}\uFF08${chalk2.cyan(levelText)} \u7EA7\u522B\uFF09\uFF1A`);
|
|
950
|
+
logger.info(`\u5B89\u88C5\u8DEF\u5F84: ${chalk2.cyan(displayPath)}`);
|
|
942
951
|
for (const plugin of selectedPlugins) {
|
|
943
952
|
if (plugin) {
|
|
944
|
-
logger.step(` \u2022 ${chalk2.bold(plugin.displayName)}
|
|
953
|
+
logger.step(` \u2022 ${chalk2.bold(plugin.displayName)}`);
|
|
945
954
|
}
|
|
946
955
|
}
|
|
947
956
|
logger.blank();
|
|
@@ -1832,7 +1841,7 @@ async function interactiveSkillSelect() {
|
|
|
1832
1841
|
while (true) {
|
|
1833
1842
|
switch (step) {
|
|
1834
1843
|
case 0: {
|
|
1835
|
-
printBoxTitle("\u9009\u62E9 Skill \u7C7B\u522B");
|
|
1844
|
+
printBoxTitle("[3/4] \u9009\u62E9 Skill \u7C7B\u522B");
|
|
1836
1845
|
const categoryChoices = [
|
|
1837
1846
|
...categories.map((cat) => ({
|
|
1838
1847
|
name: `> ${cat.name} (${cat.skills.length} skills)`,
|
|
@@ -1857,7 +1866,7 @@ async function interactiveSkillSelect() {
|
|
|
1857
1866
|
case 1: {
|
|
1858
1867
|
const category = categories.find((c) => c.id === selectedCategoryId);
|
|
1859
1868
|
if (!category) return [];
|
|
1860
|
-
printBoxTitle(
|
|
1869
|
+
printBoxTitle(`[4/4] \u9009\u62E9\u8981\u5B89\u88C5\u7684 Skills \u2014 ${category.name}`);
|
|
1861
1870
|
const tools = ["opencode", "claude", "trae", "cursor", "copilot"];
|
|
1862
1871
|
const levels = ["project", "global"];
|
|
1863
1872
|
const installedSkills = [];
|
|
@@ -2011,8 +2020,8 @@ function printEnhancedSummary(results, tool, configRoot) {
|
|
|
2011
2020
|
const lines = [
|
|
2012
2021
|
chalk4.bold(` ${t("install_done")}!`),
|
|
2013
2022
|
"",
|
|
2014
|
-
` ${chalk4.dim("
|
|
2015
|
-
` ${chalk4.dim("
|
|
2023
|
+
` ${chalk4.dim(t("install_installed_to") + ":")} ${configRoot}`,
|
|
2024
|
+
` ${chalk4.dim(t("install_skills_count") + ":")} ${totalSkills} \u4E2A ${chalk4.dim("|")} ${chalk4.dim(t("install_agents_count") + ":")} ${totalAgents} \u4E2A`,
|
|
2016
2025
|
"",
|
|
2017
2026
|
chalk4.bold(` ${t("install_enhanced_next_steps")}:`),
|
|
2018
2027
|
` ${chalk4.cyan("1.")} ${t("install_enhanced_launch")}: ${chalk4.green(toolName.toLowerCase())}`,
|
|
@@ -2127,10 +2136,10 @@ async function pluginInstallFlow() {
|
|
|
2127
2136
|
return "done";
|
|
2128
2137
|
}
|
|
2129
2138
|
const repoManager = createRepositoryManager();
|
|
2130
|
-
const spinner = createSpinner(
|
|
2139
|
+
const spinner = createSpinner("\u6B63\u5728\u52A0\u8F7D\u63D2\u4EF6\u6570\u636E...");
|
|
2131
2140
|
spinner.start();
|
|
2132
2141
|
const repoPath = await repoManager.ensureRepo();
|
|
2133
|
-
spinner.succeed(
|
|
2142
|
+
spinner.succeed("\u63D2\u4EF6\u6570\u636E\u52A0\u8F7D\u5B8C\u6210");
|
|
2134
2143
|
const allPlugins = getAllPlugins();
|
|
2135
2144
|
const selectedPlugins = answers.plugins.map(
|
|
2136
2145
|
(id) => allPlugins.find((p) => p.id === id)
|
|
@@ -2220,20 +2229,23 @@ async function skillInstallFlow() {
|
|
|
2220
2229
|
return "done";
|
|
2221
2230
|
}
|
|
2222
2231
|
const repoManager = createRepositoryManager();
|
|
2223
|
-
const spinner = createSpinner(
|
|
2232
|
+
const spinner = createSpinner("\u6B63\u5728\u52A0\u8F7D\u63D2\u4EF6\u6570\u636E...");
|
|
2224
2233
|
spinner.start();
|
|
2225
2234
|
const repoPath = await repoManager.ensureRepo();
|
|
2226
|
-
spinner.succeed(
|
|
2235
|
+
spinner.succeed("\u63D2\u4EF6\u6570\u636E\u52A0\u8F7D\u5B8C\u6210");
|
|
2227
2236
|
logger.info(`${t("skill_install_progress")} ${chalk5.bold(selectedSkills.length)} \u4E2A Skills...`);
|
|
2228
2237
|
const results = await installSkills(selectedSkills, tool, level, repoPath);
|
|
2229
2238
|
let successCount = 0;
|
|
2230
2239
|
let failCount = 0;
|
|
2231
|
-
|
|
2240
|
+
const total = results.length;
|
|
2241
|
+
for (let i = 0; i < results.length; i++) {
|
|
2242
|
+
const result = results[i];
|
|
2243
|
+
const progress = `[${i + 1}/${total}]`;
|
|
2232
2244
|
if (result.success) {
|
|
2233
|
-
logger.success(`${result.skillId}`);
|
|
2245
|
+
logger.success(`${progress} ${result.skillId}`);
|
|
2234
2246
|
successCount++;
|
|
2235
2247
|
} else {
|
|
2236
|
-
logger.error(`${result.skillId}: ${result.error}`);
|
|
2248
|
+
logger.error(`${progress} ${result.skillId}: ${result.error}`);
|
|
2237
2249
|
failCount++;
|
|
2238
2250
|
}
|
|
2239
2251
|
}
|
|
@@ -2933,7 +2945,7 @@ function createCLI() {
|
|
|
2933
2945
|
setLanguage(config.language);
|
|
2934
2946
|
}
|
|
2935
2947
|
const program2 = new Command();
|
|
2936
|
-
program2.name("install-helper").description("Install Helper - Interactive installer for CANN operator development skills").version("0.0.2-beta.
|
|
2948
|
+
program2.name("install-helper").description("Install Helper - Interactive installer for CANN operator development skills").version("0.0.2-beta.3");
|
|
2937
2949
|
program2.command("init", { isDefault: false }).description("Run interactive installation wizard").action(async () => {
|
|
2938
2950
|
await initCommand();
|
|
2939
2951
|
});
|