@cannbot-ai/install-helper 0.0.1-beta.0 → 0.0.1-beta.1
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/README.md +1 -1
- package/dist/index.js +26 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# install-helper
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Install Helper — CANNBot 交互式安装助手
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@cannbot-ai/install-helper)
|
|
6
6
|
[](https://nodejs.org)
|
package/dist/index.js
CHANGED
|
@@ -232,7 +232,7 @@ async function getCommandVersion(cmd, args = ["--version"]) {
|
|
|
232
232
|
}
|
|
233
233
|
async function getCommandPath(cmd) {
|
|
234
234
|
try {
|
|
235
|
-
const result = await execa("
|
|
235
|
+
const result = await execa("sh", ["-c", `command -v ${cmd}`], { timeout: 5e3 });
|
|
236
236
|
return result.stdout.trim();
|
|
237
237
|
} catch {
|
|
238
238
|
return void 0;
|
|
@@ -929,7 +929,8 @@ async function stepConfirm(tool, level, plugins) {
|
|
|
929
929
|
printBoxTitle("\u786E\u8BA4\u5B89\u88C5");
|
|
930
930
|
const allPlugins = getAllPlugins();
|
|
931
931
|
const selectedPlugins = plugins.map((id) => allPlugins.find((p) => p.id === id));
|
|
932
|
-
|
|
932
|
+
const displayPath = level === "project" ? `.${tool}/` : getConfigRoot(tool, level);
|
|
933
|
+
logger.info(`\u5373\u5C06\u5B89\u88C5 ${chalk2.bold(plugins.length)} \u4E2A\u573A\u666F\u5230 ${chalk2.cyan(displayPath)}\uFF1A`);
|
|
933
934
|
for (const plugin of selectedPlugins) {
|
|
934
935
|
if (plugin) {
|
|
935
936
|
logger.step(` \u2022 ${chalk2.bold(plugin.displayName)} ${chalk2.dim(`(${plugin.skills} skills, ${plugin.agents} agents)`)}`);
|
|
@@ -1021,7 +1022,7 @@ function parseFrontmatter(filePath) {
|
|
|
1021
1022
|
}
|
|
1022
1023
|
}
|
|
1023
1024
|
if (endIndex === -1) return null;
|
|
1024
|
-
const yamlBlock = lines.slice(1, endIndex).
|
|
1025
|
+
const yamlBlock = lines.slice(1, endIndex).map((l) => l.replace(/\r$/, "")).join("\n");
|
|
1025
1026
|
const parsed = parseYaml(yamlBlock);
|
|
1026
1027
|
if (!parsed || typeof parsed !== "object") return null;
|
|
1027
1028
|
if (!parsed.name || typeof parsed.name !== "string") return null;
|
|
@@ -1095,6 +1096,7 @@ function scanDirectory(dirPath, repoPath, sourcePrefix, skills, seen) {
|
|
|
1095
1096
|
filePath: skillMd
|
|
1096
1097
|
});
|
|
1097
1098
|
}
|
|
1099
|
+
continue;
|
|
1098
1100
|
}
|
|
1099
1101
|
scanDirectory(fullPath, repoPath, sourcePrefix, skills, seen);
|
|
1100
1102
|
}
|
|
@@ -1192,8 +1194,7 @@ var STATIC_SKILL_CATEGORIES = [
|
|
|
1192
1194
|
{ id: "ascendc-task-focus", description: "\u957F\u4EFB\u52A1\u805A\u7126\u9632\u8FF7\u5931", source: "ops" },
|
|
1193
1195
|
{ id: "tilelang-op-test-design", description: "TileLang \u6D4B\u8BD5\u8BBE\u8BA1", source: "ops" },
|
|
1194
1196
|
{ id: "tilelang-review", description: "TileLang \u4EE3\u7801\u683C\u5F0F\u68C0\u67E5", source: "ops" },
|
|
1195
|
-
{ id: "triton-op-verifier", description: "Triton \u7B97\u5B50\u9A8C\u8BC1", source: "ops" }
|
|
1196
|
-
{ id: "cannbot-skill-reviewer", description: "Skill \u5165\u5E93\u8D28\u91CF\u5BA1\u67E5", source: "infra" }
|
|
1197
|
+
{ id: "triton-op-verifier", description: "Triton \u7B97\u5B50\u9A8C\u8BC1", source: "ops" }
|
|
1197
1198
|
]
|
|
1198
1199
|
},
|
|
1199
1200
|
{
|
|
@@ -1816,11 +1817,15 @@ async function interactiveSkillSelect() {
|
|
|
1816
1817
|
const category = categories.find((c) => c.id === selectedCategoryId);
|
|
1817
1818
|
if (!category) return [];
|
|
1818
1819
|
printBoxTitle(`\u9009\u62E9\u8981\u5B89\u88C5\u7684 Skills \u2014 ${category.name}`);
|
|
1819
|
-
const
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1820
|
+
const tools = ["opencode", "claude", "trae", "cursor", "copilot"];
|
|
1821
|
+
const levels = ["project", "global"];
|
|
1822
|
+
const installedSkills = [];
|
|
1823
|
+
for (const t2 of tools) {
|
|
1824
|
+
for (const l of levels) {
|
|
1825
|
+
const path = l === "project" ? process.cwd() : getConfigRoot(t2, l);
|
|
1826
|
+
installedSkills.push(...getInstalledSkills(t2, l, path));
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1824
1829
|
const installedSet = new Set(installedSkills);
|
|
1825
1830
|
const skillChoices = category.skills.map((skill) => {
|
|
1826
1831
|
const isInstalled = installedSet.has(skill.id);
|
|
@@ -1988,11 +1993,18 @@ function printEnhancedSummary(results, tool, configRoot) {
|
|
|
1988
1993
|
}
|
|
1989
1994
|
|
|
1990
1995
|
// src/commands/init.ts
|
|
1991
|
-
import { existsSync as existsSync10 } from "fs";
|
|
1996
|
+
import { existsSync as existsSync10, readFileSync as readFileSync5 } from "fs";
|
|
1992
1997
|
import { join as join10 } from "path";
|
|
1993
1998
|
async function initCommand() {
|
|
1994
1999
|
const cwd = process.cwd();
|
|
1995
|
-
if (existsSync10(join10(cwd, "package.json")) &&
|
|
2000
|
+
if (existsSync10(join10(cwd, "package.json")) && (() => {
|
|
2001
|
+
try {
|
|
2002
|
+
const pkg = JSON.parse(readFileSync5(join10(cwd, "package.json"), "utf-8"));
|
|
2003
|
+
return pkg.name === "@cannbot-ai/install-helper";
|
|
2004
|
+
} catch {
|
|
2005
|
+
return false;
|
|
2006
|
+
}
|
|
2007
|
+
})()) {
|
|
1996
2008
|
logger.warn("\u5F53\u524D\u76EE\u5F55\u770B\u8D77\u6765\u662F install-helper \u5305\u76EE\u5F55");
|
|
1997
2009
|
logger.info("\u8BF7\u5728\u4F60\u7684\u9879\u76EE\u76EE\u5F55\u4E2D\u8FD0\u884C\u6B64\u547D\u4EE4\uFF0C\u800C\u4E0D\u662F\u5728 install-helper \u5B89\u88C5\u76EE\u5F55\u4E2D");
|
|
1998
2010
|
logger.info("\u793A\u4F8B\uFF1Acd ~/my-project && install-helper");
|
|
@@ -2716,7 +2728,7 @@ async function updateCommand(pluginNames, options) {
|
|
|
2716
2728
|
}
|
|
2717
2729
|
}
|
|
2718
2730
|
const repoManager = createRepositoryManager();
|
|
2719
|
-
const updateSpinner = createSpinner(t("update_updating") + "
|
|
2731
|
+
const updateSpinner = createSpinner(t("update_updating") + "...");
|
|
2720
2732
|
updateSpinner.start();
|
|
2721
2733
|
await repoManager.updateRepo();
|
|
2722
2734
|
const repoPath = repoManager.getRepoPath();
|
|
@@ -2853,7 +2865,7 @@ function createCLI() {
|
|
|
2853
2865
|
setLanguage(config.language);
|
|
2854
2866
|
}
|
|
2855
2867
|
const program2 = new Command();
|
|
2856
|
-
program2.name("install-helper").description("
|
|
2868
|
+
program2.name("install-helper").description("Install Helper - Interactive installer for CANN operator development skills").version("0.0.1-beta.1");
|
|
2857
2869
|
program2.command("init", { isDefault: false }).description("Run interactive installation wizard").action(async () => {
|
|
2858
2870
|
await initCommand();
|
|
2859
2871
|
});
|