@kody-ade/kody-engine 0.4.413 → 0.4.414

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 +13 -14
  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.413",
18
+ version: "0.4.414",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -13122,6 +13122,11 @@ import { createLoopState as createLoopState2 } from "@kody-ade/agency-domain";
13122
13122
  async function dispatchAgencyLoopsWith(input) {
13123
13123
  const repository = new AgencyModelRepository(input.backend, input.tenantId);
13124
13124
  const records = await repository.listManagedWork();
13125
+ const goals = new Map(
13126
+ records.filter(
13127
+ (record2) => "executionRef" in record2.definition
13128
+ ).map((record2) => [record2.definition.id, record2.definition])
13129
+ );
13125
13130
  const loops = records.filter(
13126
13131
  (record2) => "trigger" in record2.definition
13127
13132
  );
@@ -13165,7 +13170,7 @@ async function dispatchAgencyLoopsWith(input) {
13165
13170
  });
13166
13171
  await repository.saveState(runningState, "loop", now);
13167
13172
  try {
13168
- const output = await input.run(jobForTarget(record2.definition));
13173
+ const output = await input.run(jobForTarget(record2.definition, goals));
13169
13174
  const succeeded = output.exitCode === 0;
13170
13175
  await input.backend.finishAgencyDispatch(
13171
13176
  input.tenantId,
@@ -13196,19 +13201,13 @@ async function dispatchAgencyLoopsWith(input) {
13196
13201
  }
13197
13202
  return results;
13198
13203
  }
13199
- function jobForTarget(loop) {
13200
- if (loop.targetRef.kind === "workflow") {
13201
- return { workflow: loop.targetRef.id, cliArgs: {}, flavor: "scheduled" };
13202
- }
13203
- if (loop.targetRef.kind === "capability") {
13204
- return { capability: loop.targetRef.id, cliArgs: {}, flavor: "scheduled" };
13204
+ function jobForTarget(loop, goals) {
13205
+ const target = loop.targetRef.kind === "goal" ? goals.get(loop.targetRef.id)?.executionRef : loop.targetRef;
13206
+ if (!target) throw new Error(`Loop target Goal is missing: ${loop.targetRef.id}`);
13207
+ if (target.kind === "workflow") {
13208
+ return { workflow: target.id, cliArgs: {}, flavor: "scheduled" };
13205
13209
  }
13206
- return {
13207
- capability: "goal-manager",
13208
- implementation: "goal-manager",
13209
- cliArgs: { goal: loop.targetRef.id },
13210
- flavor: "scheduled"
13211
- };
13210
+ return { capability: target.id, cliArgs: {}, flavor: "scheduled" };
13212
13211
  }
13213
13212
  function repositoryTenant(config) {
13214
13213
  const owner = config.github?.owner?.trim() || process.env.GITHUB_REPOSITORY?.split("/")[0]?.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.413",
3
+ "version": "0.4.414",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",