@kody-ade/kody-engine-lite 0.1.128 → 0.1.130
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 +52 -18
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -3745,23 +3745,51 @@ function getBrowserToolGuidance(stageName, taskDir) {
|
|
|
3745
3745
|
### Dev Server Setup (REQUIRED before browsing)
|
|
3746
3746
|
You MUST start the dev server before using any browser navigation tools:
|
|
3747
3747
|
\`\`\`bash
|
|
3748
|
-
# Start the dev server in the background
|
|
3749
|
-
${devServer.command} &
|
|
3750
|
-
|
|
3751
|
-
|
|
3748
|
+
# Start the dev server in the background with output redirected to a log file
|
|
3749
|
+
nohup ${devServer.command} > /tmp/dev-server.log 2>&1 &
|
|
3750
|
+
DEV_PID=$!
|
|
3751
|
+
|
|
3752
|
+
# Wait up to ${devServer.readyTimeout}s for the server to be ready
|
|
3753
|
+
for i in $(seq 1 ${devServer.readyTimeout}); do
|
|
3754
|
+
if curl -s -o /dev/null -w "%{http_code}" ${devServer.url} 2>/dev/null | grep -qE "^[23]"; then
|
|
3755
|
+
echo "Dev server is ready"
|
|
3756
|
+
break
|
|
3757
|
+
fi
|
|
3758
|
+
if ! kill -0 $DEV_PID 2>/dev/null; then
|
|
3759
|
+
echo "Dev server process died. Last 20 lines:"
|
|
3760
|
+
tail -20 /tmp/dev-server.log
|
|
3761
|
+
break
|
|
3762
|
+
fi
|
|
3763
|
+
sleep 1
|
|
3764
|
+
done
|
|
3752
3765
|
\`\`\`
|
|
3753
3766
|
The dev server URL is: ${devServer.url}
|
|
3754
|
-
|
|
3767
|
+
If the dev server fails to start (e.g. DB connection issues), skip browser verification and proceed with code-only changes. Do NOT hang waiting for it.
|
|
3768
|
+
After you are done browsing, kill the dev server: \`kill $DEV_PID 2>/dev/null || true\`` : `
|
|
3755
3769
|
### Dev Server Setup (REQUIRED before browsing)
|
|
3756
3770
|
You MUST start the project's dev server before using any browser navigation tools.
|
|
3757
3771
|
Check package.json for the dev command (usually \`pnpm dev\` or \`npm run dev\`).
|
|
3758
3772
|
\`\`\`bash
|
|
3759
|
-
# Start the dev server in the background
|
|
3760
|
-
pnpm dev &
|
|
3761
|
-
|
|
3762
|
-
|
|
3773
|
+
# Start the dev server in the background with output redirected
|
|
3774
|
+
nohup pnpm dev > /tmp/dev-server.log 2>&1 &
|
|
3775
|
+
DEV_PID=$!
|
|
3776
|
+
|
|
3777
|
+
# Wait up to 30s for the server to be ready
|
|
3778
|
+
for i in $(seq 1 30); do
|
|
3779
|
+
if curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 2>/dev/null | grep -qE "^[23]"; then
|
|
3780
|
+
echo "Dev server is ready"
|
|
3781
|
+
break
|
|
3782
|
+
fi
|
|
3783
|
+
if ! kill -0 $DEV_PID 2>/dev/null; then
|
|
3784
|
+
echo "Dev server process died. Last 20 lines:"
|
|
3785
|
+
tail -20 /tmp/dev-server.log
|
|
3786
|
+
break
|
|
3787
|
+
fi
|
|
3788
|
+
sleep 1
|
|
3789
|
+
done
|
|
3763
3790
|
\`\`\`
|
|
3764
|
-
|
|
3791
|
+
If the dev server fails to start (e.g. DB connection issues), skip browser verification and proceed with code-only changes. Do NOT hang waiting for it.
|
|
3792
|
+
After you are done browsing, kill the dev server: \`kill $DEV_PID 2>/dev/null || true\``;
|
|
3765
3793
|
if (stageName === "build" || stageName === "review-fix") {
|
|
3766
3794
|
return `## Browser Visual Verification (MANDATORY for UI tasks)
|
|
3767
3795
|
|
|
@@ -5523,7 +5551,8 @@ function loadToolDeclarations(projectDir) {
|
|
|
5523
5551
|
name,
|
|
5524
5552
|
detect: Array.isArray(v.detect) ? v.detect : [],
|
|
5525
5553
|
stages: Array.isArray(v.stages) ? v.stages : [],
|
|
5526
|
-
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
|
|
5527
5556
|
};
|
|
5528
5557
|
});
|
|
5529
5558
|
} catch (err) {
|
|
@@ -5539,7 +5568,8 @@ function detectTools(declarations, projectDir) {
|
|
|
5539
5568
|
resolved.push({
|
|
5540
5569
|
name: decl.name,
|
|
5541
5570
|
stages: decl.stages,
|
|
5542
|
-
setup: decl.setup
|
|
5571
|
+
setup: decl.setup,
|
|
5572
|
+
skill: decl.skill
|
|
5543
5573
|
});
|
|
5544
5574
|
}
|
|
5545
5575
|
return resolved;
|
|
@@ -5555,12 +5585,14 @@ function runToolSetup(tools, projectDir) {
|
|
|
5555
5585
|
logger.warn(` \u26A0 ${tool.name} setup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
5556
5586
|
}
|
|
5557
5587
|
}
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
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
|
+
}
|
|
5564
5596
|
}
|
|
5565
5597
|
}
|
|
5566
5598
|
}
|
|
@@ -8069,11 +8101,13 @@ Command and URL.
|
|
|
8069
8101
|
const toolsTemplate = `# Kody Tools Configuration
|
|
8070
8102
|
# Uncomment and configure tools that your project uses.
|
|
8071
8103
|
# The engine detects tools, runs setup commands, and installs matching skills from skills.sh.
|
|
8104
|
+
# Find skills at https://skills.sh
|
|
8072
8105
|
#
|
|
8073
8106
|
# playwright:
|
|
8074
8107
|
# detect: ["playwright.config.ts", "playwright.config.js"]
|
|
8075
8108
|
# stages: [verify]
|
|
8076
8109
|
# setup: "npx playwright install --with-deps chromium"
|
|
8110
|
+
# skill: "microsoft/playwright-cli@playwright-cli"
|
|
8077
8111
|
`;
|
|
8078
8112
|
fs8.writeFileSync(toolsYmlPath, toolsTemplate);
|
|
8079
8113
|
console.log(" \u2713 .kody/tools.yml (template created)");
|