@kody-ade/kody-engine-lite 0.1.100 → 0.1.101
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 +31 -5
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -305,7 +305,13 @@ function getProjectConfig() {
|
|
|
305
305
|
},
|
|
306
306
|
timeouts: raw.timeouts ?? void 0,
|
|
307
307
|
contextTiers: raw.contextTiers ? { ...DEFAULT_CONFIG.contextTiers, ...raw.contextTiers } : DEFAULT_CONFIG.contextTiers,
|
|
308
|
-
mcp: raw.mcp ? {
|
|
308
|
+
mcp: raw.mcp ? {
|
|
309
|
+
servers: {},
|
|
310
|
+
stages: ["build", "verify", "review", "review-fix"],
|
|
311
|
+
...raw.mcp,
|
|
312
|
+
// Auto-enable when devServer is configured (user can still set enabled: false to override)
|
|
313
|
+
enabled: raw.mcp.enabled ?? !!raw.mcp.devServer
|
|
314
|
+
} : void 0
|
|
309
315
|
};
|
|
310
316
|
} catch {
|
|
311
317
|
logger.warn("kody.config.json is invalid JSON \u2014 using defaults");
|
|
@@ -861,7 +867,7 @@ var init_github_api = __esm({
|
|
|
861
867
|
"use strict";
|
|
862
868
|
init_logger();
|
|
863
869
|
API_TIMEOUT_MS = 3e4;
|
|
864
|
-
LIFECYCLE_LABELS = ["planning", "building", "review", "done", "failed", "waiting", "low", "medium", "high"];
|
|
870
|
+
LIFECYCLE_LABELS = ["planning", "building", "review", "shipping", "done", "failed", "waiting", "low", "medium", "high"];
|
|
865
871
|
KODY_MARKERS = [
|
|
866
872
|
"Kody Review",
|
|
867
873
|
"\u{1F916} Generated by Kody",
|
|
@@ -1281,6 +1287,20 @@ var init_context_tiers = __esm({
|
|
|
1281
1287
|
});
|
|
1282
1288
|
|
|
1283
1289
|
// src/mcp-config.ts
|
|
1290
|
+
function withPlaywrightIfNeeded(mcpConfig, hasUI) {
|
|
1291
|
+
if (!mcpConfig?.enabled || !hasUI) return mcpConfig;
|
|
1292
|
+
const hasPlaywright = Object.keys(mcpConfig.servers).some(
|
|
1293
|
+
(name) => name.toLowerCase().includes("playwright")
|
|
1294
|
+
);
|
|
1295
|
+
if (hasPlaywright) return mcpConfig;
|
|
1296
|
+
return {
|
|
1297
|
+
...mcpConfig,
|
|
1298
|
+
servers: {
|
|
1299
|
+
...mcpConfig.servers,
|
|
1300
|
+
playwright: PLAYWRIGHT_SERVER
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1284
1304
|
function buildMcpConfigJson(mcpConfig) {
|
|
1285
1305
|
if (!mcpConfig?.enabled) return void 0;
|
|
1286
1306
|
if (Object.keys(mcpConfig.servers).length === 0) return void 0;
|
|
@@ -1297,15 +1317,18 @@ function buildMcpConfigJson(mcpConfig) {
|
|
|
1297
1317
|
}
|
|
1298
1318
|
function isMcpEnabledForStage(stageName, mcpConfig) {
|
|
1299
1319
|
if (!mcpConfig?.enabled) return false;
|
|
1300
|
-
if (Object.keys(mcpConfig.servers).length === 0) return false;
|
|
1301
1320
|
const allowedStages = mcpConfig.stages ?? DEFAULT_MCP_STAGES;
|
|
1302
1321
|
return allowedStages.includes(stageName);
|
|
1303
1322
|
}
|
|
1304
|
-
var DEFAULT_MCP_STAGES;
|
|
1323
|
+
var DEFAULT_MCP_STAGES, PLAYWRIGHT_SERVER;
|
|
1305
1324
|
var init_mcp_config = __esm({
|
|
1306
1325
|
"src/mcp-config.ts"() {
|
|
1307
1326
|
"use strict";
|
|
1308
1327
|
DEFAULT_MCP_STAGES = ["build", "verify", "review", "review-fix"];
|
|
1328
|
+
PLAYWRIGHT_SERVER = {
|
|
1329
|
+
command: "npx",
|
|
1330
|
+
args: ["-y", "@anthropic-ai/mcp-playwright"]
|
|
1331
|
+
};
|
|
1309
1332
|
}
|
|
1310
1333
|
});
|
|
1311
1334
|
|
|
@@ -1685,7 +1708,8 @@ async function executeAgentStage(ctx, def) {
|
|
|
1685
1708
|
if (sessionInfo) {
|
|
1686
1709
|
logger.info(` session: ${SESSION_GROUP[def.name]} (${sessionInfo.resumeSession ? "resume" : "new"})`);
|
|
1687
1710
|
}
|
|
1688
|
-
const
|
|
1711
|
+
const mcpForStage = isMcpEnabledForStage(def.name, config.mcp) ? withPlaywrightIfNeeded(config.mcp, taskHasUI(ctx.taskDir)) : void 0;
|
|
1712
|
+
const mcpConfigJson = buildMcpConfigJson(mcpForStage);
|
|
1689
1713
|
if (mcpConfigJson) {
|
|
1690
1714
|
logger.info(` MCP servers enabled for ${def.name}`);
|
|
1691
1715
|
}
|
|
@@ -2670,6 +2694,7 @@ function applyPreStageLabel(ctx, def) {
|
|
|
2670
2694
|
if (!ctx.input.issueNumber || ctx.input.local) return;
|
|
2671
2695
|
if (def.name === "build") setLifecycleLabel(ctx.input.issueNumber, "building");
|
|
2672
2696
|
if (def.name === "review") setLifecycleLabel(ctx.input.issueNumber, "review");
|
|
2697
|
+
if (def.name === "ship") setLifecycleLabel(ctx.input.issueNumber, "shipping");
|
|
2673
2698
|
}
|
|
2674
2699
|
function checkQuestionsAfterStage(ctx, def, state) {
|
|
2675
2700
|
if (def.name !== "taskify" && def.name !== "plan") return null;
|
|
@@ -5027,6 +5052,7 @@ REMINDER: Output the full prompt template first (unchanged), then your three app
|
|
|
5027
5052
|
{ name: "kody:planning", color: "c5def5", description: "Kody is analyzing and planning" },
|
|
5028
5053
|
{ name: "kody:building", color: "0e8a16", description: "Kody is building code" },
|
|
5029
5054
|
{ name: "kody:review", color: "fbca04", description: "Kody is reviewing code" },
|
|
5055
|
+
{ name: "kody:shipping", color: "1d76db", description: "Kody is creating the pull request" },
|
|
5030
5056
|
{ name: "kody:done", color: "0e8a16", description: "Kody completed successfully" },
|
|
5031
5057
|
{ name: "kody:failed", color: "d93f0b", description: "Kody pipeline failed" },
|
|
5032
5058
|
{ name: "kody:waiting", color: "fef2c0", description: "Kody is waiting for answers" },
|