@kody-ade/kody-engine-lite 0.1.129 → 0.1.131
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/bin/cli.js +49 -14
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -5551,7 +5551,8 @@ function loadToolDeclarations(projectDir) {
|
|
|
5551
5551
|
name,
|
|
5552
5552
|
detect: Array.isArray(v.detect) ? v.detect : [],
|
|
5553
5553
|
stages: Array.isArray(v.stages) ? v.stages : [],
|
|
5554
|
-
setup: typeof v.setup === "string" ? v.setup : ""
|
|
5554
|
+
setup: typeof v.setup === "string" ? v.setup : "",
|
|
5555
|
+
skill: typeof v.skill === "string" ? v.skill : void 0
|
|
5555
5556
|
};
|
|
5556
5557
|
});
|
|
5557
5558
|
} catch (err) {
|
|
@@ -5567,7 +5568,8 @@ function detectTools(declarations, projectDir) {
|
|
|
5567
5568
|
resolved.push({
|
|
5568
5569
|
name: decl.name,
|
|
5569
5570
|
stages: decl.stages,
|
|
5570
|
-
setup: decl.setup
|
|
5571
|
+
setup: decl.setup,
|
|
5572
|
+
skill: decl.skill
|
|
5571
5573
|
});
|
|
5572
5574
|
}
|
|
5573
5575
|
return resolved;
|
|
@@ -5583,12 +5585,14 @@ function runToolSetup(tools, projectDir) {
|
|
|
5583
5585
|
logger.warn(` \u26A0 ${tool.name} setup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
5584
5586
|
}
|
|
5585
5587
|
}
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5588
|
+
if (tool.skill) {
|
|
5589
|
+
try {
|
|
5590
|
+
logger.info(` Installing skill: ${tool.skill}`);
|
|
5591
|
+
execSync3(`npx skills add ${tool.skill} --yes`, { cwd: projectDir, timeout: 6e4, stdio: "pipe" });
|
|
5592
|
+
logger.info(` \u2713 ${tool.name} skill installed`);
|
|
5593
|
+
} catch (err) {
|
|
5594
|
+
logger.warn(` \u26A0 ${tool.name} skill install failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
5595
|
+
}
|
|
5592
5596
|
}
|
|
5593
5597
|
}
|
|
5594
5598
|
}
|
|
@@ -7671,6 +7675,20 @@ function ghComment(issueNumber, body, cwd) {
|
|
|
7671
7675
|
} catch {
|
|
7672
7676
|
}
|
|
7673
7677
|
}
|
|
7678
|
+
var KNOWN_TOOLS = [
|
|
7679
|
+
{
|
|
7680
|
+
name: "playwright",
|
|
7681
|
+
detect: ["playwright.config.ts", "playwright.config.js"],
|
|
7682
|
+
stages: ["verify"],
|
|
7683
|
+
setup: "npx playwright install --with-deps chromium",
|
|
7684
|
+
skill: "microsoft/playwright-cli@playwright-cli"
|
|
7685
|
+
}
|
|
7686
|
+
];
|
|
7687
|
+
function detectToolsForBootstrap(cwd) {
|
|
7688
|
+
return KNOWN_TOOLS.filter(
|
|
7689
|
+
(tool) => tool.detect.some((pattern) => fs8.existsSync(path7.join(cwd, pattern)))
|
|
7690
|
+
);
|
|
7691
|
+
}
|
|
7674
7692
|
function bootstrapCommand(opts, pkgRoot) {
|
|
7675
7693
|
const cwd = process.cwd();
|
|
7676
7694
|
setConfigDir(cwd);
|
|
@@ -8094,17 +8112,34 @@ Command and URL.
|
|
|
8094
8112
|
console.log("\n\u2500\u2500 Tools \u2500\u2500");
|
|
8095
8113
|
const toolsYmlPath = path7.join(cwd, ".kody", "tools.yml");
|
|
8096
8114
|
if (!fs8.existsSync(toolsYmlPath) || opts.force) {
|
|
8097
|
-
const
|
|
8098
|
-
|
|
8099
|
-
#
|
|
8100
|
-
|
|
8115
|
+
const detected = detectToolsForBootstrap(cwd);
|
|
8116
|
+
const header = `# Kody Tools Configuration
|
|
8117
|
+
# Find skills at https://skills.sh
|
|
8118
|
+
`;
|
|
8119
|
+
if (detected.length > 0) {
|
|
8120
|
+
const entries = detected.map(
|
|
8121
|
+
(t) => `${t.name}:
|
|
8122
|
+
detect: ${JSON.stringify(t.detect)}
|
|
8123
|
+
stages: ${JSON.stringify(t.stages)}
|
|
8124
|
+
setup: "${t.setup}"
|
|
8125
|
+
skill: "${t.skill}"`
|
|
8126
|
+
).join("\n\n");
|
|
8127
|
+
fs8.writeFileSync(toolsYmlPath, `${header}
|
|
8128
|
+
${entries}
|
|
8129
|
+
`);
|
|
8130
|
+
for (const t of detected) console.log(` \u2713 ${t.name} detected`);
|
|
8131
|
+
} else {
|
|
8132
|
+
const example = `${header}#
|
|
8133
|
+
# Example:
|
|
8101
8134
|
# playwright:
|
|
8102
8135
|
# detect: ["playwright.config.ts", "playwright.config.js"]
|
|
8103
8136
|
# stages: [verify]
|
|
8104
8137
|
# setup: "npx playwright install --with-deps chromium"
|
|
8138
|
+
# skill: "microsoft/playwright-cli@playwright-cli"
|
|
8105
8139
|
`;
|
|
8106
|
-
|
|
8107
|
-
|
|
8140
|
+
fs8.writeFileSync(toolsYmlPath, example);
|
|
8141
|
+
console.log(" \u25CB No tools detected \u2014 template created");
|
|
8142
|
+
}
|
|
8108
8143
|
} else {
|
|
8109
8144
|
console.log(" \u25CB .kody/tools.yml (already exists, keeping)");
|
|
8110
8145
|
}
|