@kody-ade/kody-engine 0.4.290 → 0.4.291

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.
Files changed (2) hide show
  1. package/dist/bin/kody.js +32 -30
  2. package/package.json +1 -1
package/dist/bin/kody.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@kody-ade/kody-engine",
18
- version: "0.4.290",
18
+ version: "0.4.291",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -3160,18 +3160,18 @@ async function runAgent(opts) {
3160
3160
  }
3161
3161
  if (opts.enableCapabilityTool) {
3162
3162
  const { buildCapabilityMcpServer: buildCapabilityMcpServer2 } = await Promise.resolve().then(() => (init_capabilityMcp(), capabilityMcp_exports));
3163
- if (!opts.dutyRepoSlug) {
3163
+ if (!opts.capabilityRepoSlug) {
3164
3164
  throw new Error(
3165
- "enableCapabilityTool requires dutyRepoSlug (owner/name) \u2014 set kody.config.json github.{owner,repo} or GITHUB_REPOSITORY env var"
3165
+ "enableCapabilityTool requires capabilityRepoSlug (owner/name) \u2014 set kody.config.json github.{owner,repo} or GITHUB_REPOSITORY env var"
3166
3166
  );
3167
3167
  }
3168
- const dutyHandle = buildCapabilityMcpServer2({
3169
- repoSlug: opts.dutyRepoSlug,
3168
+ const capabilityHandle = buildCapabilityMcpServer2({
3169
+ repoSlug: opts.capabilityRepoSlug,
3170
3170
  state: opts.capabilityState,
3171
3171
  operatorMention: opts.capabilityOperatorMention ?? "",
3172
3172
  ...opts.capabilitySlug ? { capabilitySlug: opts.capabilitySlug } : {}
3173
3173
  });
3174
- mcpEntries.push(["kody-capability", dutyHandle.server]);
3174
+ mcpEntries.push(["kody-capability", capabilityHandle.server]);
3175
3175
  }
3176
3176
  if (opts.enableDashboardCmsTool) {
3177
3177
  const { buildDashboardCmsMcpServer: buildDashboardCmsMcpServer2, DASHBOARD_CMS_MCP_TOOL_NAMES: DASHBOARD_CMS_MCP_TOOL_NAMES2 } = await Promise.resolve().then(() => (init_dashboardCmsMcp(), dashboardCmsMcp_exports));
@@ -8130,7 +8130,7 @@ async function planGoalCapabilitySchedule(opts) {
8130
8130
  }
8131
8131
  };
8132
8132
  }
8133
- const dispatch2 = dutyDispatch(capability);
8133
+ const dispatch2 = capabilityDispatch(capability);
8134
8134
  statuses[due.slug] = markCapabilitySelected(statuses[due.slug], now);
8135
8135
  return {
8136
8136
  kind: "dispatch",
@@ -8190,7 +8190,7 @@ async function describeCapabilitySchedule(capability, slug2, backend, previous)
8190
8190
  lastFiredAt
8191
8191
  };
8192
8192
  }
8193
- function dutyDispatch(capability) {
8193
+ function capabilityDispatch(capability) {
8194
8194
  const { executable, cliArgs } = resolveCapabilityExecution(capability);
8195
8195
  return { capability: capability.slug, executable, cliArgs };
8196
8196
  }
@@ -9724,7 +9724,7 @@ var init_applyCapabilityReports = __esm({
9724
9724
  init_stateStore();
9725
9725
  applyCapabilityReports = async (ctx, _profile, agentResult) => {
9726
9726
  const reports = collectReports(ctx.data.capabilityReports, agentResult);
9727
- const results = collectResults(ctx.data.dutyResults, agentResult);
9727
+ const results = collectResults(ctx.data.capabilityResults ?? ctx.data.dutyResults, agentResult);
9728
9728
  const resultGoalId = typeof ctx.args.goal === "string" && ctx.args.goal.length > 0 ? ctx.args.goal : null;
9729
9729
  const explicitEvidence = typeof ctx.args.evidence === "string" && ctx.args.evidence.length > 0 ? ctx.args.evidence : void 0;
9730
9730
  const evidenceItems = collectGoalCapabilityEvidence(reports, results, resultGoalId, explicitEvidence);
@@ -10243,7 +10243,7 @@ function formatCapabilityReference(data, profileName) {
10243
10243
  if (capabilitySchedule) {
10244
10244
  lines.push(`- Cadence: \`${capabilitySchedule}\``);
10245
10245
  }
10246
- const capabilityBody = pickToken(data, "dutyIntent", "jobIntent");
10246
+ const capabilityBody = pickToken(data, "capabilityIntent", "jobIntent", "dutyIntent");
10247
10247
  if (capabilityBody) {
10248
10248
  lines.push("", "## Capability body", "", capabilityBody);
10249
10249
  }
@@ -17806,10 +17806,11 @@ function collectShellSideChannels(ctx, stdout) {
17806
17806
  const prior = Array.isArray(ctx.data.capabilityReports) ? ctx.data.capabilityReports : [];
17807
17807
  ctx.data.capabilityReports = [...prior, ...capabilityReports];
17808
17808
  }
17809
- const dutyResults = parseCapabilityResultsFromText(stdout);
17810
- if (dutyResults.length > 0) {
17811
- const prior = Array.isArray(ctx.data.dutyResults) ? ctx.data.dutyResults : [];
17812
- ctx.data.dutyResults = [...prior, ...dutyResults];
17809
+ const capabilityResults = parseCapabilityResultsFromText(stdout);
17810
+ if (capabilityResults.length > 0) {
17811
+ const prior = Array.isArray(ctx.data.capabilityResults) ? ctx.data.capabilityResults : Array.isArray(ctx.data.dutyResults) ? ctx.data.dutyResults : [];
17812
+ ctx.data.capabilityResults = [...prior, ...capabilityResults];
17813
+ ctx.data.dutyResults = ctx.data.capabilityResults;
17813
17814
  }
17814
17815
  }
17815
17816
  function operatorRequestBlock(why) {
@@ -18025,7 +18026,7 @@ async function runExecutable(profileName, input) {
18025
18026
  // owner/repo from kody.config.json; envelope falls back to GITHUB_REPOSITORY
18026
18027
  // for tester repos that don't set config.github (the file isn't always
18027
18028
  // checked in). Either way, capabilityMcp needs "owner/name" to hit the compare API.
18028
- dutyRepoSlug: config.github?.owner && config.github?.repo ? `${config.github.owner}/${config.github.repo}` : process.env.GITHUB_REPOSITORY?.trim() || void 0,
18029
+ capabilityRepoSlug: config.github?.owner && config.github?.repo ? `${config.github.owner}/${config.github.repo}` : process.env.GITHUB_REPOSITORY?.trim() || void 0,
18029
18030
  verifyToolMaxAttempts: profile.claudeCode.verifyAttempts ?? null,
18030
18031
  verifyConfig: profile.claudeCode.enableVerifyTool ? config : void 0,
18031
18032
  executableName: profileName,
@@ -18814,6 +18815,7 @@ async function runCapabilityImplementationStep(valid, profileName, capabilityIde
18814
18815
  if (capabilityContext) {
18815
18816
  preloadedData.capabilitySlug = capabilityContext.slug;
18816
18817
  preloadedData.capabilityTitle = capabilityContext.title;
18818
+ preloadedData.capabilityIntent = capabilityContext.body;
18817
18819
  preloadedData.dutyIntent = capabilityContext.body;
18818
18820
  preloadedData.jobIntent = capabilityContext.body;
18819
18821
  if (preloadedData.jobCapability === void 0) preloadedData.jobCapability = capabilityContext.slug;
@@ -19498,11 +19500,11 @@ function buildExecutableCatalog() {
19498
19500
  if (entries.length === 0) return "";
19499
19501
  const lines = [
19500
19502
  "",
19501
- "# Available executables",
19503
+ "# Available capability implementations",
19502
19504
  "These run inside the engine, NOT inside this chat. You cannot invoke them",
19503
- "directly \u2014 to run one, tell the user to post `@kody <name>` (with any flags)",
19505
+ "directly \u2014 to run one, tell the user to post the matching `@kody <action>`",
19504
19506
  "as a comment on the relevant issue or PR. The dispatcher binds the issue/PR",
19505
- "number to the executable's inputs automatically.",
19507
+ "number to the implementation inputs automatically.",
19506
19508
  ""
19507
19509
  ];
19508
19510
  for (const e of entries) {
@@ -20718,12 +20720,12 @@ async function runCi(argv) {
20718
20720
  const evt = JSON.parse(fs46.readFileSync(dispatchEventPath, "utf-8"));
20719
20721
  const issueInput = parseInt(String(evt?.inputs?.issue_number ?? ""), 10);
20720
20722
  const sessionInput = String(evt?.inputs?.sessionId ?? "");
20721
- const dutyInput = String(evt?.inputs?.capability ?? evt?.inputs?.executable ?? "").trim();
20723
+ const capabilityInput = String(evt?.inputs?.capability ?? evt?.inputs?.executable ?? "").trim();
20722
20724
  const messageInput = String(evt?.inputs?.message ?? "").trim();
20723
20725
  const noTarget = !sessionInput && !(Number.isFinite(issueInput) && issueInput > 0);
20724
- if (noTarget && dutyInput) {
20725
- forceRunAction = dutyInput;
20726
- if (dutyInput === "goal-manager" && messageInput) {
20726
+ if (noTarget && capabilityInput) {
20727
+ forceRunAction = capabilityInput;
20728
+ if (capabilityInput === "goal-manager" && messageInput) {
20727
20729
  forceRunCliArgs = { goal: messageInput };
20728
20730
  }
20729
20731
  } else {
@@ -20736,8 +20738,8 @@ async function runCi(argv) {
20736
20738
  if (forceRunAction) {
20737
20739
  const config = earlyConfig ?? loadConfig(cwd);
20738
20740
  const manualGoalManager = forceRunAction === "goal-manager";
20739
- const dutyRoute = manualGoalManager ? null : resolveCapabilityAction(forceRunAction);
20740
- const scheduledWatchRoute = manualGoalManager || dutyRoute ? void 0 : dispatchScheduledWatches({ force: true }).find(
20741
+ const capabilityRoute = manualGoalManager ? null : resolveCapabilityAction(forceRunAction);
20742
+ const scheduledWatchRoute = manualGoalManager || capabilityRoute ? void 0 : dispatchScheduledWatches({ force: true }).find(
20741
20743
  (match) => match.action === forceRunAction || match.executable === forceRunAction
20742
20744
  );
20743
20745
  const route = manualGoalManager ? {
@@ -20745,7 +20747,7 @@ async function runCi(argv) {
20745
20747
  capability: "goal-manager",
20746
20748
  executable: "goal-manager",
20747
20749
  cliArgs: forceRunCliArgs
20748
- } : dutyRoute ?? scheduledWatchRoute;
20750
+ } : capabilityRoute ?? scheduledWatchRoute;
20749
20751
  if (!route) {
20750
20752
  process.stderr.write(`[kody] manual one-shot action '${forceRunAction}' has no capability action
20751
20753
  `);
@@ -23416,9 +23418,9 @@ async function poolServe() {
23416
23418
  const tick = setInterval(() => {
23417
23419
  registry.resyncAll().catch((err) => log(`resync tick failed: ${err instanceof Error ? err.message : String(err)}`));
23418
23420
  }, refillMs);
23419
- const dutyTickEnabled = (process.env.POOL_CAPABILITY_TICK ?? "1") !== "0";
23420
- const dutyTickMs = envInt2("POOL_CAPABILITY_TICK_MS", 15 * 6e4);
23421
- const dutyTick = dutyTickEnabled ? setInterval(() => {
23421
+ const capabilityTickEnabled = (process.env.POOL_CAPABILITY_TICK ?? "1") !== "0";
23422
+ const capabilityTickMs = envInt2("POOL_CAPABILITY_TICK_MS", 15 * 6e4);
23423
+ const capabilityTick = capabilityTickEnabled ? setInterval(() => {
23422
23424
  runCapabilityFallbackTick({
23423
23425
  isDegraded: () => gitHubActionsDegraded(),
23424
23426
  activeRepos: () => registry.activeRepos(),
@@ -23427,7 +23429,7 @@ async function poolServe() {
23427
23429
  }).catch(
23428
23430
  (err) => log(`capability fallback tick failed: ${err instanceof Error ? err.message : String(err)}`)
23429
23431
  );
23430
- }, dutyTickMs) : null;
23432
+ }, capabilityTickMs) : null;
23431
23433
  const server = createServer4(async (req, res) => {
23432
23434
  try {
23433
23435
  if (!req.method || !req.url) return sendJson2(res, 400, { error: "bad request" });
@@ -23484,7 +23486,7 @@ async function poolServe() {
23484
23486
  const shutdown = (signal) => {
23485
23487
  log(`${signal} \u2014 shutting down`);
23486
23488
  clearInterval(tick);
23487
- if (dutyTick) clearInterval(dutyTick);
23489
+ if (capabilityTick) clearInterval(capabilityTick);
23488
23490
  server.close(() => process.exit(0));
23489
23491
  };
23490
23492
  process.once("SIGINT", () => shutdown("SIGINT"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.290",
3
+ "version": "0.4.291",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",