@kody-ade/kody-engine 0.4.346 → 0.4.348

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/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.346",
18
+ version: "0.4.348",
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",
@@ -1221,12 +1221,10 @@ function emitEvent(cwd, ev) {
1221
1221
  if (process.env.KODY_EVENTS === "0") return;
1222
1222
  try {
1223
1223
  const runId = resolveRunId();
1224
- const implementation = typeof ev.implementation === "string" ? ev.implementation : ev.executable;
1225
1224
  const fullEvent = {
1226
1225
  ts: (/* @__PURE__ */ new Date()).toISOString(),
1227
1226
  runId,
1228
- ...ev,
1229
- implementation
1227
+ ...ev
1230
1228
  };
1231
1229
  const file = eventsPath(cwd, runId);
1232
1230
  fs3.mkdirSync(path5.dirname(file), { recursive: true });
@@ -1405,7 +1403,7 @@ function verifyToolDefinition(opts) {
1405
1403
  const attempt = state.attempts;
1406
1404
  if (attempt > state.maxAttempts) {
1407
1405
  emitEvent(opts.cwd, {
1408
- executable: opts.executable,
1406
+ implementation: opts.implementation,
1409
1407
  kind: "error",
1410
1408
  name: "verify_tool",
1411
1409
  outcome: "failed",
@@ -1428,7 +1426,7 @@ function verifyToolDefinition(opts) {
1428
1426
  const result = await runVerify2(opts.config, opts.cwd);
1429
1427
  const durationMs = Date.now() - startedAt;
1430
1428
  emitEvent(opts.cwd, {
1431
- executable: opts.executable,
1429
+ implementation: opts.implementation,
1432
1430
  kind: "postflight",
1433
1431
  name: `verify_attempt_${attempt}`,
1434
1432
  durationMs,
@@ -1905,11 +1903,10 @@ function readCapabilityFolder(root, slug2) {
1905
1903
  }
1906
1904
  function parseCapabilityConfig(raw) {
1907
1905
  const tools = stringList(raw.tools ?? raw.capabilityTools ?? raw.capabilityTools);
1908
- const implementations = stringList(raw.implementations ?? raw.executables);
1906
+ const implementations = stringList(raw.implementations);
1909
1907
  return {
1910
1908
  action: stringField(raw.action),
1911
- implementation: stringField(raw.implementation ?? raw.executable),
1912
- executable: stringField(raw.executable),
1909
+ implementation: stringField(raw.implementation),
1913
1910
  tickScript: stringField(raw.tickScript),
1914
1911
  capabilityKind: parseCapabilityKind(raw.capabilityKind),
1915
1912
  disabled: typeof raw.disabled === "boolean" ? raw.disabled : void 0,
@@ -1921,7 +1918,6 @@ function parseCapabilityConfig(raw) {
1921
1918
  capabilityTools: tools,
1922
1919
  capabilityToolMode: parseCapabilityToolMode(raw.capabilityToolMode),
1923
1920
  implementations,
1924
- executables: stringList(raw.executables),
1925
1921
  role: stringField(raw.role),
1926
1922
  describe: stringField(raw.describe),
1927
1923
  stage: stringField(raw.stage),
@@ -1985,7 +1981,7 @@ function parseWorkflowStep(value) {
1985
1981
  const raw = value;
1986
1982
  const capability = stringField(raw.capability ?? raw.action);
1987
1983
  if (!capability || !isSafeSlug(capability)) return null;
1988
- const implementation = stringField(raw.implementation ?? raw.executable);
1984
+ const implementation = stringField(raw.implementation);
1989
1985
  const action = stringField(raw.action);
1990
1986
  const agent = stringField(raw.agent);
1991
1987
  const reason = stringField(raw.reason);
@@ -1994,7 +1990,7 @@ function parseWorkflowStep(value) {
1994
1990
  return {
1995
1991
  capability,
1996
1992
  ...action && isSafeSlug(action) ? { action } : {},
1997
- ...implementation && isSafeSlug(implementation) ? { implementation, executable: implementation } : {},
1993
+ ...implementation && isSafeSlug(implementation) ? { implementation } : {},
1998
1994
  ...target === "issue" || target === "pr" ? { target } : {},
1999
1995
  ...agent && isSafeSlug(agent) ? { agent } : {},
2000
1996
  ...reason ? { reason } : {},
@@ -2260,7 +2256,7 @@ function listCapabilityActions(projectCapabilitiesRoot = getProjectCapabilitiesR
2260
2256
  const seen = /* @__PURE__ */ new Set();
2261
2257
  const out = [];
2262
2258
  const add = (action) => {
2263
- if (!isSafeName(action.action) || !isSafeName(action.capability) || !isSafeName(action.executable)) return;
2259
+ if (!isSafeName(action.action) || !isSafeName(action.capability) || !isSafeName(action.implementation)) return;
2264
2260
  if (seen.has(action.action)) return;
2265
2261
  seen.add(action.action);
2266
2262
  out.push(action);
@@ -2296,15 +2292,15 @@ function getCapabilityActionInputs(action) {
2296
2292
  function resolveCapabilityExecution(capability) {
2297
2293
  const firstWorkflowStep = capability.config.workflow?.steps[0];
2298
2294
  if (firstWorkflowStep) {
2299
- const implementation2 = firstWorkflowStep.implementation ?? firstWorkflowStep.executable ?? firstWorkflowStep.capability;
2300
- return { implementation: implementation2, executable: implementation2, cliArgs: {} };
2295
+ const implementation2 = firstWorkflowStep.implementation ?? firstWorkflowStep.capability;
2296
+ return { implementation: implementation2, cliArgs: {} };
2301
2297
  }
2302
- const implementation = capability.config.implementation ?? capability.config.executable ?? capability.config.implementations?.[0] ?? capability.config.executables?.[0] ?? (capability.config.role ? capability.slug : void 0) ?? (capability.config.tickScript ? "capability-tick-scripted" : "capability-tick");
2303
- const cliArgs = executableDeclaresInput(implementation, "capability") ? { capability: capability.slug } : {};
2304
- return { implementation, executable: implementation, cliArgs };
2298
+ const implementation = capability.config.implementation ?? capability.config.implementations?.[0] ?? (capability.config.role ? capability.slug : void 0) ?? (capability.config.tickScript ? "capability-tick-scripted" : "capability-tick");
2299
+ const cliArgs = implementationDeclaresInput(implementation, "capability") ? { capability: capability.slug } : {};
2300
+ return { implementation, cliArgs };
2305
2301
  }
2306
- function executableDeclaresInput(executable, inputName) {
2307
- const profilePath = resolveExecutable(executable);
2302
+ function implementationDeclaresInput(implementation, inputName) {
2303
+ const profilePath = resolveExecutable(implementation);
2308
2304
  if (!profilePath) return false;
2309
2305
  try {
2310
2306
  const raw = JSON.parse(fs6.readFileSync(profilePath, "utf-8"));
@@ -2345,13 +2341,12 @@ function listFolderCapabilityActions(root, source) {
2345
2341
  if (!capability) continue;
2346
2342
  if (capability.config.internal === true || capability.config.public === false) continue;
2347
2343
  const action = capability.config.action ?? slug2;
2348
- const { implementation, executable, cliArgs } = resolveCapabilityExecution(capability);
2344
+ const { implementation, cliArgs } = resolveCapabilityExecution(capability);
2349
2345
  if (hasUnresolvedExplicitImplementation(capability, implementation)) continue;
2350
2346
  out.push({
2351
2347
  action,
2352
2348
  capability: slug2,
2353
2349
  implementation,
2354
- executable,
2355
2350
  cliArgs,
2356
2351
  source,
2357
2352
  describe: capability.config.describe ?? capability.title,
@@ -2361,13 +2356,13 @@ function listFolderCapabilityActions(root, source) {
2361
2356
  }
2362
2357
  return out.sort((a, b) => a.action.localeCompare(b.action));
2363
2358
  }
2364
- function hasUnresolvedExplicitImplementation(capability, executable) {
2359
+ function hasUnresolvedExplicitImplementation(capability, implementation) {
2365
2360
  const config = capability.config;
2366
- const hasExplicitImplementation = Boolean(config.implementation || config.executable) || (config.implementations?.length ?? 0) > 0 || (config.executables?.length ?? 0) > 0;
2361
+ const hasExplicitImplementation = Boolean(config.implementation) || (config.implementations?.length ?? 0) > 0;
2367
2362
  if (!hasExplicitImplementation) return false;
2368
2363
  if (config.workflow?.steps.length) return false;
2369
2364
  if (config.role && PUBLIC_EXECUTABLE_ROLES.has(config.role)) return false;
2370
- return resolveExecutable(executable) === null;
2365
+ return resolveExecutable(implementation) === null;
2371
2366
  }
2372
2367
  function listBuiltinCapabilityActions(root = getBuiltinCapabilitiesRoot()) {
2373
2368
  if (!fs6.existsSync(root) || !fs6.statSync(root).isDirectory()) return [];
@@ -2377,12 +2372,11 @@ function listBuiltinCapabilityActions(root = getBuiltinCapabilitiesRoot()) {
2377
2372
  const capability = readCapabilityFolder(root, slug2);
2378
2373
  if (!capability) continue;
2379
2374
  const action = capability.config.action ?? slug2;
2380
- const implementation = capability.config.implementation ?? capability.config.executable ?? slug2;
2375
+ const implementation = capability.config.implementation ?? slug2;
2381
2376
  out.push({
2382
2377
  action,
2383
2378
  capability: slug2,
2384
2379
  implementation,
2385
- executable: implementation,
2386
2380
  cliArgs: {},
2387
2381
  source: "builtin",
2388
2382
  describe: capability.config.describe ?? capability.title,
@@ -2898,25 +2892,6 @@ function capabilityToolDefinitions(opts) {
2898
2892
  return { content: [{ type: "text", text }] };
2899
2893
  }
2900
2894
  };
2901
- const dispatchTool = {
2902
- name: "dispatch_workflow",
2903
- description: "Legacy alias for start_capability. Dispatches a kody.yml workflow_dispatch run for a capability action against an issue. Prefer start_capability({name:'run', issue:<n>}). Returns {ok} or {ok:false,error}.",
2904
- inputSchema: {
2905
- capability: z3.string().min(1).optional().describe("Capability action to run (e.g. 'run')."),
2906
- executable: z3.string().min(1).optional().describe("Deprecated alias for capability."),
2907
- issueNumber: z3.number().int().positive().describe("Issue (or PR) number forwarded as issue_number.")
2908
- },
2909
- handler: async (args) => {
2910
- const capability = String(args.capability ?? args.executable ?? "");
2911
- const issueNumber = Number(args.issueNumber);
2912
- if (isDispatchGated(capability, readCapabilityTrustMode(opts.state, opts.repoSlug, opts.capabilitySlug))) {
2913
- return { content: [{ type: "text", text: trustRefusal(opts.capabilitySlug) }] };
2914
- }
2915
- const result = startCapability(workflowFile, capability, issueNumber, opts.repoSlug);
2916
- const text = result.ok ? `Dispatched capability \`${capability}\` on #${issueNumber} via workflow_dispatch.` : `Dispatch failed for capability \`${capability}\` on #${issueNumber}: ${result.error}`;
2917
- return { content: [{ type: "text", text }] };
2918
- }
2919
- };
2920
2895
  const cmsTools = dashboardCmsToolDefinitions({
2921
2896
  repoSlug: opts.repoSlug,
2922
2897
  assertWriteAllowed: () => assertCmsWriteAllowed(opts)
@@ -2933,7 +2908,6 @@ function capabilityToolDefinitions(opts) {
2933
2908
  ensureIssueTool,
2934
2909
  ensureCommentTool,
2935
2910
  startCapabilityTool,
2936
- dispatchTool,
2937
2911
  ...cmsTools
2938
2912
  ];
2939
2913
  }
@@ -2983,7 +2957,6 @@ var init_capabilityMcp = __esm({
2983
2957
  "ensure_issue",
2984
2958
  "ensure_comment",
2985
2959
  "start_capability",
2986
- "dispatch_workflow",
2987
2960
  ...DASHBOARD_CMS_MCP_TOOL_NAMES
2988
2961
  ];
2989
2962
  }
@@ -3246,7 +3219,7 @@ async function runAgent(opts) {
3246
3219
  const verifyServer = buildVerifyMcpServer2({
3247
3220
  config: opts.verifyConfig,
3248
3221
  cwd: opts.cwd,
3249
- executable: opts.executableName ?? "agent",
3222
+ implementation: opts.implementationName ?? "agent",
3250
3223
  maxAttempts: typeof opts.verifyToolMaxAttempts === "number" && opts.verifyToolMaxAttempts > 0 ? opts.verifyToolMaxAttempts : void 0
3251
3224
  });
3252
3225
  mcpEntries.push(["kody-verify", verifyServer]);
@@ -4455,11 +4428,11 @@ function loadProfile(profilePath) {
4455
4428
  `
4456
4429
  );
4457
4430
  }
4458
- const execRef = typeof r.implementation === "string" && r.implementation.trim() ? r.implementation.trim() : typeof r.executable === "string" ? r.executable.trim() : "";
4431
+ const execRef = typeof r.implementation === "string" && r.implementation.trim() ? r.implementation.trim() : "";
4459
4432
  if (execRef) {
4460
4433
  const refPath = resolveExecutable(execRef);
4461
4434
  if (!refPath) {
4462
- throw new ProfileError(profilePath, `capability references unknown executable '${execRef}'`);
4435
+ throw new ProfileError(profilePath, `capability references unknown implementation '${execRef}'`);
4463
4436
  }
4464
4437
  if (path19.resolve(refPath) === path19.resolve(profilePath)) {
4465
4438
  } else {
@@ -4469,7 +4442,6 @@ function loadProfile(profilePath) {
4469
4442
  name: requireString(profilePath, r, "name"),
4470
4443
  action: typeof r.action === "string" && r.action.trim() ? r.action.trim() : void 0,
4471
4444
  implementation: execRef,
4472
- executable: execRef,
4473
4445
  internal: typeof r.internal === "boolean" ? r.internal : base.internal,
4474
4446
  public: typeof r.public === "boolean" ? r.public : base.public,
4475
4447
  capabilityKind: parseCapabilityKind2(r.capabilityKind) ?? base.capabilityKind,
@@ -4523,7 +4495,6 @@ function loadProfile(profilePath) {
4523
4495
  name: requireString(profilePath, r, "name"),
4524
4496
  action: typeof r.action === "string" && r.action.trim() ? r.action.trim() : void 0,
4525
4497
  implementation: void 0,
4526
- executable: void 0,
4527
4498
  internal: typeof r.internal === "boolean" ? r.internal : void 0,
4528
4499
  public: typeof r.public === "boolean" ? r.public : void 0,
4529
4500
  capabilityKind: parseCapabilityKind2(r.capabilityKind),
@@ -4898,8 +4869,6 @@ var init_profile = __esm({
4898
4869
  "action",
4899
4870
  "implementation",
4900
4871
  "implementations",
4901
- "executable",
4902
- "executables",
4903
4872
  "internal",
4904
4873
  "public",
4905
4874
  "capabilityKind",
@@ -4972,15 +4941,21 @@ function normalizeTaskState(parsed) {
4972
4941
  if (parsed?.schemaVersion !== 1) {
4973
4942
  throw new CorruptStateError(`unexpected schemaVersion: ${JSON.stringify(parsed?.schemaVersion)}`);
4974
4943
  }
4975
- const raw = parsed;
4976
- const legacyCurrent = typeof raw.core?.currentExecutable === "string" ? raw.core.currentExecutable : void 0;
4977
- const currentImplementation = typeof parsed.core?.currentImplementation === "string" ? parsed.core.currentImplementation : legacyCurrent ?? null;
4978
- const implementations = parsed.implementations && typeof parsed.implementations === "object" ? parsed.implementations : raw.executables && typeof raw.executables === "object" && !Array.isArray(raw.executables) ? raw.executables : {};
4979
- const coreWithoutLegacy = { ...parsed.core ?? {} };
4980
- delete coreWithoutLegacy.currentExecutable;
4944
+ const currentImplementation = typeof parsed.core?.currentImplementation === "string" ? parsed.core.currentImplementation : null;
4945
+ const implementations = parsed.implementations && typeof parsed.implementations === "object" ? parsed.implementations : {};
4946
+ const parsedCore = parsed.core ?? emptyState().core;
4947
+ const core = {
4948
+ phase: parsedCore.phase,
4949
+ status: parsedCore.status,
4950
+ lastOutcome: parsedCore.lastOutcome,
4951
+ attempts: parsedCore.attempts,
4952
+ ...parsedCore.prUrl ? { prUrl: parsedCore.prUrl } : {},
4953
+ ...parsedCore.runUrl ? { runUrl: parsedCore.runUrl } : {},
4954
+ ...parsedCore.ranAsAgent !== void 0 ? { ranAsAgent: parsedCore.ranAsAgent } : {}
4955
+ };
4981
4956
  return {
4982
4957
  schemaVersion: 1,
4983
- core: { ...emptyState().core, ...coreWithoutLegacy, currentImplementation },
4958
+ core: { ...emptyState().core, ...core, currentImplementation },
4984
4959
  implementations,
4985
4960
  artifacts: parsed.artifacts && typeof parsed.artifacts === "object" ? parsed.artifacts : {},
4986
4961
  jobs: normalizeJobs(parsed.jobs),
@@ -5124,7 +5099,7 @@ function normalizeJobs(input) {
5124
5099
  for (const [key, value] of Object.entries(input)) {
5125
5100
  if (!value || typeof value !== "object" || Array.isArray(value)) continue;
5126
5101
  const raw = value;
5127
- const implementation = typeof raw.implementation === "string" ? raw.implementation : typeof raw.executable === "string" ? raw.executable : void 0;
5102
+ const implementation = typeof raw.implementation === "string" ? raw.implementation : void 0;
5128
5103
  if (typeof raw.id !== "string" || typeof implementation !== "string") continue;
5129
5104
  if (!isStatus(raw.status)) continue;
5130
5105
  out[key] = {
@@ -5153,7 +5128,7 @@ function normalizeHistory(input) {
5153
5128
  for (const value of input) {
5154
5129
  if (!value || typeof value !== "object" || Array.isArray(value)) continue;
5155
5130
  const raw = value;
5156
- const implementation = typeof raw.implementation === "string" ? raw.implementation : typeof raw.executable === "string" ? raw.executable : void 0;
5131
+ const implementation = typeof raw.implementation === "string" ? raw.implementation : void 0;
5157
5132
  if (typeof raw.timestamp !== "string" || typeof implementation !== "string" || typeof raw.action !== "string") {
5158
5133
  continue;
5159
5134
  }
@@ -5853,7 +5828,7 @@ async function runContainerLoop(profile, ctx, input) {
5853
5828
  preloadedData: preloadedSnapshot
5854
5829
  });
5855
5830
  emitEvent(input.cwd, {
5856
- executable: profile.name,
5831
+ implementation: profile.name,
5857
5832
  kind: "container_child",
5858
5833
  name: child.exec,
5859
5834
  durationMs: Date.now() - childStartedAt,
@@ -5862,7 +5837,7 @@ async function runContainerLoop(profile, ctx, input) {
5862
5837
  });
5863
5838
  } catch (err) {
5864
5839
  emitEvent(input.cwd, {
5865
- executable: profile.name,
5840
+ implementation: profile.name,
5866
5841
  kind: "container_child",
5867
5842
  name: child.exec,
5868
5843
  durationMs: Date.now() - childStartedAt,
@@ -6535,7 +6510,6 @@ function runIndexRowFromJobContext(input) {
6535
6510
  capability: stringValue2(input.data.jobCapability) ?? void 0,
6536
6511
  workflow: workflow ?? void 0,
6537
6512
  implementation: stringValue2(input.data.jobImplementation) ?? input.profileName,
6538
- executable: stringValue2(input.data.jobImplementation) ?? input.profileName,
6539
6513
  agent: stringValue2(input.data.jobAgent) ?? input.profile.agent ?? void 0,
6540
6514
  model: stringValue2(input.data.jobModel) ?? void 0,
6541
6515
  modelProvider: stringValue2(input.data.jobModelProvider) ?? void 0,
@@ -6585,7 +6559,6 @@ function runIndexRowFromGoalEvents(goalId, logPath, events) {
6585
6559
  action: stringValue2(job?.action) ?? void 0,
6586
6560
  capability: stringValue2(job?.capability) ?? void 0,
6587
6561
  implementation: stringValue2(job?.implementation) ?? void 0,
6588
- executable: stringValue2(job?.implementation) ?? void 0,
6589
6562
  agent: stringValue2(job?.agent) ?? void 0,
6590
6563
  model: stringValue2(job?.model) ?? void 0,
6591
6564
  modelProvider: stringValue2(job?.modelProvider) ?? void 0,
@@ -7329,8 +7302,7 @@ function planManagedGoalTick(goal) {
7329
7302
  evidence: missing,
7330
7303
  stage: step.stage,
7331
7304
  capability: step.capability,
7332
- implementation: step.implementation ?? step.executable,
7333
- executable: step.executable,
7305
+ implementation: step.implementation,
7334
7306
  cliArgs: resolved.cliArgs,
7335
7307
  ...step.saveReport === true ? { saveReport: true } : {}
7336
7308
  };
@@ -7440,8 +7412,7 @@ function asRoute(value) {
7440
7412
  evidence: raw.evidence,
7441
7413
  stage: raw.stage,
7442
7414
  capability: raw.capability,
7443
- implementation: typeof raw.implementation === "string" ? raw.implementation : typeof raw.executable === "string" ? raw.executable : void 0,
7444
- executable: typeof raw.executable === "string" ? raw.executable : void 0,
7415
+ implementation: typeof raw.implementation === "string" ? raw.implementation : void 0,
7445
7416
  args: args ?? void 0,
7446
7417
  saveReport: raw.saveReport === true,
7447
7418
  onPending: asRoutePolicy(raw.onPending),
@@ -7798,8 +7769,7 @@ function capabilityDispatchFromOutput(output) {
7798
7769
  if (!output) return void 0;
7799
7770
  const dispatch2 = pruneUndefined2({
7800
7771
  capability: stringValue3(output.capability) ?? void 0,
7801
- implementation: stringValue3(output.implementation) ?? stringValue3(output.executable) ?? void 0,
7802
- executable: stringValue3(output.executable) ?? void 0,
7772
+ implementation: stringValue3(output.implementation) ?? void 0,
7803
7773
  action: stringValue3(output.action) ?? void 0
7804
7774
  });
7805
7775
  return Object.keys(dispatch2).length > 0 ? dispatch2 : void 0;
@@ -7880,7 +7850,6 @@ function triggerContext() {
7880
7850
  "title",
7881
7851
  "capability",
7882
7852
  "implementation",
7883
- "executable",
7884
7853
  "base"
7885
7854
  ]) : void 0
7886
7855
  });
@@ -7906,7 +7875,6 @@ function jobContext(data) {
7906
7875
  action: stringValue3(data.jobAction) ?? void 0,
7907
7876
  capability: stringValue3(data.jobCapability) ?? void 0,
7908
7877
  implementation: stringValue3(data.jobImplementation) ?? void 0,
7909
- executable: stringValue3(data.jobImplementation) ?? void 0,
7910
7878
  agent: stringValue3(data.jobAgent) ?? void 0,
7911
7879
  schedule: stringValue3(data.jobSchedule) ?? void 0,
7912
7880
  target: data.jobTarget ?? void 0,
@@ -7981,8 +7949,7 @@ function routeStepForLog(step) {
7981
7949
  evidence: step.evidence,
7982
7950
  stage: step.stage,
7983
7951
  capability: step.capability,
7984
- implementation: step.implementation ?? step.executable,
7985
- executable: step.executable,
7952
+ implementation: step.implementation,
7986
7953
  args: step.args,
7987
7954
  saveReport: step.saveReport === true ? true : void 0
7988
7955
  });
@@ -8499,8 +8466,7 @@ function cloneRoute(route) {
8499
8466
  stage: step.stage,
8500
8467
  evidence: step.evidence,
8501
8468
  capability: step.capability,
8502
- ...step.implementation ? { implementation: step.implementation } : step.executable ? { implementation: step.executable } : {},
8503
- ...step.executable ? { executable: step.executable } : {},
8469
+ ...step.implementation ? { implementation: step.implementation } : {},
8504
8470
  ...step.args ? { args: structuredClone(step.args) } : {}
8505
8471
  }));
8506
8472
  }
@@ -8519,8 +8485,7 @@ function routeArray(value) {
8519
8485
  stage: raw.stage,
8520
8486
  evidence: raw.evidence,
8521
8487
  capability: raw.capability,
8522
- implementation: typeof raw.implementation === "string" ? raw.implementation : typeof raw.executable === "string" ? raw.executable : void 0,
8523
- executable: typeof raw.executable === "string" ? raw.executable : void 0,
8488
+ implementation: typeof raw.implementation === "string" ? raw.implementation : void 0,
8524
8489
  args: raw.args && typeof raw.args === "object" && !Array.isArray(raw.args) ? { ...raw.args } : void 0
8525
8490
  });
8526
8491
  }
@@ -8567,20 +8532,18 @@ var init_typeDefinitions = __esm({
8567
8532
  evidence: ["planReady", "changeImplemented", "changeVerified"],
8568
8533
  capabilities: ["plan", "fix", "review"],
8569
8534
  route: [
8570
- { stage: "plan", evidence: "planReady", capability: "plan", implementation: "plan", executable: "plan" },
8535
+ { stage: "plan", evidence: "planReady", capability: "plan", implementation: "plan" },
8571
8536
  {
8572
8537
  stage: "implement",
8573
8538
  evidence: "changeImplemented",
8574
8539
  capability: "fix",
8575
- implementation: "fix",
8576
- executable: "fix"
8540
+ implementation: "fix"
8577
8541
  },
8578
8542
  {
8579
8543
  stage: "review",
8580
8544
  evidence: "changeVerified",
8581
8545
  capability: "review",
8582
- implementation: "review",
8583
- executable: "review"
8546
+ implementation: "review"
8584
8547
  }
8585
8548
  ]
8586
8549
  },
@@ -8614,7 +8577,6 @@ var init_typeDefinitions = __esm({
8614
8577
  evidence: "releasePrExists",
8615
8578
  capability: "release",
8616
8579
  implementation: "release-prepare",
8617
- executable: "release-prepare",
8618
8580
  args: { issue: { fact: "issue" }, goal: { fact: "goalId" } }
8619
8581
  },
8620
8582
  {
@@ -8622,15 +8584,13 @@ var init_typeDefinitions = __esm({
8622
8584
  evidence: "mainMerged",
8623
8585
  capability: "release-merge",
8624
8586
  implementation: "release-merge",
8625
- executable: "release-merge",
8626
8587
  args: { pr: { fact: "releasePr" }, issue: { fact: "issue" }, goal: { fact: "goalId" } }
8627
8588
  },
8628
8589
  {
8629
8590
  stage: "publish",
8630
8591
  evidence: "productionDeployed",
8631
8592
  capability: "vercel-production-deploy",
8632
- implementation: "vercel-production-deploy",
8633
- executable: "vercel-production-deploy"
8593
+ implementation: "vercel-production-deploy"
8634
8594
  }
8635
8595
  ]
8636
8596
  },
@@ -8643,8 +8603,7 @@ var init_typeDefinitions = __esm({
8643
8603
  stage: "verify",
8644
8604
  evidence: "checklistComplete",
8645
8605
  capability: "task-verifier",
8646
- implementation: "task-verifier",
8647
- executable: "task-verifier"
8606
+ implementation: "task-verifier"
8648
8607
  }
8649
8608
  ]
8650
8609
  }
@@ -9051,7 +9010,7 @@ function planTargetLoopSchedule(opts) {
9051
9010
  if (!gate.ok) return targetLoopDecision("idle", gate.reason, at);
9052
9011
  }
9053
9012
  const dispatchTargetId = target.type === "goal" && opts.resolvedGoalTargetId?.trim() ? opts.resolvedGoalTargetId.trim() : targetId;
9054
- const dispatch2 = target.type === "goal" ? { action: "goal-manager", executable: "goal-manager", cliArgs: { goal: dispatchTargetId } } : { workflow: targetId, cliArgs: {} };
9013
+ const dispatch2 = target.type === "goal" ? { action: "goal-manager", implementation: "goal-manager", cliArgs: { goal: dispatchTargetId } } : { workflow: targetId, cliArgs: {} };
9055
9014
  return {
9056
9015
  kind: "dispatch",
9057
9016
  reason: `dispatch ${target.type} ${target.type === "goal" ? dispatchTargetId : targetId}`,
@@ -9066,7 +9025,7 @@ function planTargetLoopSchedule(opts) {
9066
9025
  ...dispatch2.action ? { action: dispatch2.action } : {},
9067
9026
  ...dispatch2.capability ? { capability: dispatch2.capability } : {},
9068
9027
  ...dispatch2.workflow ? { workflow: dispatch2.workflow } : {},
9069
- ...dispatch2.executable ? { executable: dispatch2.executable } : {},
9028
+ ...dispatch2.implementation ? { implementation: dispatch2.implementation } : {},
9070
9029
  reason: preferred ? `preferred time ${preferred.time} ${preferred.timezone}` : "ready target loop tick",
9071
9030
  at
9072
9031
  },
@@ -9136,7 +9095,7 @@ async function planGoalCapabilitySchedule(opts) {
9136
9095
  lastDecision: {
9137
9096
  kind: "dispatch",
9138
9097
  capability: due.slug,
9139
- executable: dispatch2.executable,
9098
+ implementation: dispatch2.implementation,
9140
9099
  reason: due.reason,
9141
9100
  at
9142
9101
  },
@@ -9153,12 +9112,12 @@ async function describeCapabilitySchedule(capability, slug2, backend, previous)
9153
9112
  if (!config.agent || config.agent.trim().length === 0) {
9154
9113
  return { slug: slug2, title: capability.title, state: "blocked", reason: "no agent assigned" };
9155
9114
  }
9156
- if (config.executables && config.executables.length > 1) {
9115
+ if (config.implementations && config.implementations.length > 1) {
9157
9116
  return {
9158
9117
  slug: slug2,
9159
9118
  title: capability.title,
9160
9119
  state: "blocked",
9161
- reason: "multi-executable capability needs task-jobs route"
9120
+ reason: "multi-implementation capability needs task-jobs route"
9162
9121
  };
9163
9122
  }
9164
9123
  let lastFiredAt = validIso(previous?.lastFiredAt) ? previous?.lastFiredAt : void 0;
@@ -9185,8 +9144,8 @@ async function describeCapabilitySchedule(capability, slug2, backend, previous)
9185
9144
  };
9186
9145
  }
9187
9146
  function capabilityDispatch(capability) {
9188
- const { executable, cliArgs } = resolveCapabilityExecution(capability);
9189
- return { capability: capability.slug, executable, cliArgs };
9147
+ const { implementation, cliArgs } = resolveCapabilityExecution(capability);
9148
+ return { capability: capability.slug, implementation, cliArgs };
9190
9149
  }
9191
9150
  function compareOldestLastFired(a, b) {
9192
9151
  const aTime = validIso(a.lastFiredAt) ? Date.parse(a.lastFiredAt) : Number.NEGATIVE_INFINITY;
@@ -9282,7 +9241,7 @@ function stageManagedGoalDecision(data, goalId, goal, goalState, decision, detai
9282
9241
  } : {
9283
9242
  capability: decision.capability,
9284
9243
  cliArgs: decision.cliArgs,
9285
- ...decision.executable ? { executable: decision.executable } : {}
9244
+ ...decision.implementation ? { implementation: decision.implementation } : {}
9286
9245
  },
9287
9246
  goal: details.goalSnapshot,
9288
9247
  inspection: details.inspection,
@@ -9298,7 +9257,7 @@ function stageManagedGoalDecision(data, goalId, goal, goalState, decision, detai
9298
9257
  stage: decision.stage,
9299
9258
  capability: decision.capability,
9300
9259
  cliArgs: decision.cliArgs,
9301
- ...decision.executable ? { executable: decision.executable } : {}
9260
+ ...decision.implementation ? { implementation: decision.implementation } : {}
9302
9261
  },
9303
9262
  change: details.change
9304
9263
  });
@@ -9542,7 +9501,7 @@ var init_advanceManagedGoal = __esm({
9542
9501
  ...decision2.dispatch.action ? { action: decision2.dispatch.action } : {},
9543
9502
  ...decision2.dispatch.capability ? { capability: decision2.dispatch.capability } : {},
9544
9503
  ...decision2.dispatch.workflow ? { workflow: decision2.dispatch.workflow } : {},
9545
- ...decision2.dispatch.executable ? { executable: decision2.dispatch.executable } : {},
9504
+ ...decision2.dispatch.implementation ? { implementation: decision2.dispatch.implementation } : {},
9546
9505
  cliArgs: decision2.dispatch.cliArgs
9547
9506
  };
9548
9507
  }
@@ -9596,7 +9555,7 @@ var init_advanceManagedGoal = __esm({
9596
9555
  if (decision2.kind === "dispatch" && decision2.dispatch) {
9597
9556
  ctx.output.nextDispatch = {
9598
9557
  capability: decision2.dispatch.capability,
9599
- executable: decision2.dispatch.executable,
9558
+ implementation: decision2.dispatch.implementation,
9600
9559
  cliArgs: decision2.dispatch.cliArgs,
9601
9560
  ...goal.raw.extra.saveReport === true ? { saveReport: true } : {}
9602
9561
  };
@@ -9675,7 +9634,7 @@ var init_advanceManagedGoal = __esm({
9675
9634
  ctx.output.nextDispatch = {
9676
9635
  capability: decision.capability,
9677
9636
  cliArgs: decision.cliArgs,
9678
- ...decision.executable ? { executable: decision.executable } : {},
9637
+ ...decision.implementation ? { implementation: decision.implementation } : {},
9679
9638
  ...decision.saveReport === true ? { saveReport: true } : {},
9680
9639
  resultTarget: { type: "goal", id: goal.id, evidence: decision.evidence }
9681
9640
  };
@@ -9868,7 +9827,7 @@ function parseRouteStep(value) {
9868
9827
  stage: requiredString(input.stage, "route.stage"),
9869
9828
  evidence: requiredString(input.evidence, "route.evidence"),
9870
9829
  capability: slug(input.capability, "route.capability"),
9871
- ...typeof input.executable === "string" && input.executable.trim() ? { executable: input.executable.trim() } : {},
9830
+ ...typeof input.implementation === "string" && input.implementation.trim() ? { implementation: input.implementation.trim() } : {},
9872
9831
  ...record(input.args) ? { args: record(input.args) } : {}
9873
9832
  };
9874
9833
  }
@@ -11007,7 +10966,7 @@ var init_applyCapabilityReports = __esm({
11007
10966
  if (changed && ctx.output.exitCode === 0 && !ctx.output.nextDispatch && shouldResumeManagedGoal(goalId, nextForOutput)) {
11008
10967
  ctx.output.nextDispatch = {
11009
10968
  action: "goal-manager",
11010
- executable: "goal-manager",
10969
+ implementation: "goal-manager",
11011
10970
  cliArgs: { goal: goalId }
11012
10971
  };
11013
10972
  }
@@ -14178,7 +14137,7 @@ var init_loadCapabilityState = __esm({
14178
14137
  ctx.data.jobStateJson = JSON.stringify(loaded.state, null, 2);
14179
14138
  ctx.data.capabilitySlug = slug2;
14180
14139
  ctx.data.capabilityTitle = profile.describe;
14181
- ctx.data.executableSlug = profile.implementation ?? profile.executable ?? profile.name;
14140
+ ctx.data.executableSlug = profile.implementation ?? profile.name;
14182
14141
  ctx.data.agentSlug = profile.agent ?? "";
14183
14142
  ctx.data.agentTitle = "";
14184
14143
  ctx.data.capabilitySchedule = String(ctx.data.jobSchedule ?? "");
@@ -19771,8 +19730,8 @@ function jobReferenceBlock(profileName, profile, data) {
19771
19730
  jobId || flavor || schedule || data.jobCapability || data.jobImplementation || data.jobWhy
19772
19731
  );
19773
19732
  if (!isJob2) return null;
19774
- const capability = typeof data.jobCapability === "string" && data.jobCapability.length > 0 ? data.jobCapability : profile.executable ? profile.name : null;
19775
- const implementation = typeof profile.implementation === "string" && profile.implementation.length > 0 ? profile.implementation : typeof profile.executable === "string" && profile.executable.length > 0 ? profile.executable : typeof data.jobImplementation === "string" && data.jobImplementation.length > 0 ? data.jobImplementation : profileName;
19733
+ const capability = typeof data.jobCapability === "string" && data.jobCapability.length > 0 ? data.jobCapability : profile.implementation ? profile.name : null;
19734
+ const implementation = typeof profile.implementation === "string" && profile.implementation.length > 0 ? profile.implementation : typeof data.jobImplementation === "string" && data.jobImplementation.length > 0 ? data.jobImplementation : profileName;
19776
19735
  const agent = typeof profile.agent === "string" && profile.agent.length > 0 ? profile.agent : typeof data.jobAgent === "string" && data.jobAgent.length > 0 ? data.jobAgent : null;
19777
19736
  const description = profile.describe.trim();
19778
19737
  const workflow = typeof data.workflowCapability === "string" && data.workflowCapability.length > 0 ? data.workflowCapability : null;
@@ -19799,11 +19758,11 @@ function jobReferenceBlock(profileName, profile, data) {
19799
19758
  async function runExecutable(profileName, input) {
19800
19759
  const stageStartedAt = Date.now();
19801
19760
  let finishRunIndex = null;
19802
- emitEvent(input.cwd, { executable: profileName, kind: "stage_start" });
19761
+ emitEvent(input.cwd, { implementation: profileName, kind: "stage_start" });
19803
19762
  const finishAndEnd = (out) => {
19804
19763
  finishRunIndex?.(out);
19805
19764
  emitEvent(input.cwd, {
19806
- executable: profileName,
19765
+ implementation: profileName,
19807
19766
  kind: "stage_end",
19808
19767
  durationMs: Date.now() - stageStartedAt,
19809
19768
  outcome: out.exitCode === 0 ? "ok" : "failed",
@@ -20012,7 +19971,7 @@ async function runExecutable(profileName, input) {
20012
19971
  capabilityRepoSlug: config.github?.owner && config.github?.repo ? `${config.github.owner}/${config.github.repo}` : process.env.GITHUB_REPOSITORY?.trim() || void 0,
20013
19972
  verifyToolMaxAttempts: profile.claudeCode.verifyAttempts ?? null,
20014
19973
  verifyConfig: profile.claudeCode.enableVerifyTool ? config : void 0,
20015
- executableName: profileName,
19974
+ implementationName: profileName,
20016
19975
  settingSources: profile.claudeCode.settingSources
20017
19976
  });
20018
19977
  };
@@ -20022,7 +19981,7 @@ async function runExecutable(profileName, input) {
20022
19981
  const preLabel = entry.script ?? entry.shell ?? "<unknown>";
20023
19982
  if (!shouldRun(entry, ctx)) {
20024
19983
  emitEvent(input.cwd, {
20025
- executable: profileName,
19984
+ implementation: profileName,
20026
19985
  kind: "preflight",
20027
19986
  name: preLabel,
20028
19987
  outcome: "skipped"
@@ -20033,7 +19992,7 @@ async function runExecutable(profileName, input) {
20033
19992
  if (entry.shell) {
20034
19993
  await runShellEntry(entry, ctx, profile);
20035
19994
  emitEvent(input.cwd, {
20036
- executable: profileName,
19995
+ implementation: profileName,
20037
19996
  kind: "preflight",
20038
19997
  name: preLabel,
20039
19998
  durationMs: Date.now() - t0,
@@ -20044,7 +20003,7 @@ async function runExecutable(profileName, input) {
20044
20003
  if (!fn) return finishAndEnd({ exitCode: 99, reason: `preflight script not registered: ${entry.script}` });
20045
20004
  await fn(ctx, profile, entry.with);
20046
20005
  emitEvent(input.cwd, {
20047
- executable: profileName,
20006
+ implementation: profileName,
20048
20007
  kind: "preflight",
20049
20008
  name: preLabel,
20050
20009
  durationMs: Date.now() - t0,
@@ -20067,7 +20026,7 @@ async function runExecutable(profileName, input) {
20067
20026
  reason: "composePrompt did not produce a prompt (ctx.data.prompt missing)"
20068
20027
  });
20069
20028
  }
20070
- emitEvent(input.cwd, { executable: profileName, kind: "agent_start" });
20029
+ emitEvent(input.cwd, { implementation: profileName, kind: "agent_start" });
20071
20030
  try {
20072
20031
  agentResult = await invokeAgent(prompt);
20073
20032
  } catch (err) {
@@ -20077,7 +20036,7 @@ async function runExecutable(profileName, input) {
20077
20036
  });
20078
20037
  }
20079
20038
  emitEvent(input.cwd, {
20080
- executable: profileName,
20039
+ implementation: profileName,
20081
20040
  kind: "agent_end",
20082
20041
  durationMs: agentResult.durationMs,
20083
20042
  outcome: agentResult.outcome === "completed" ? "ok" : "failed",
@@ -20104,7 +20063,7 @@ async function runExecutable(profileName, input) {
20104
20063
  `
20105
20064
  );
20106
20065
  emitEvent(input.cwd, {
20107
- executable: profileName,
20066
+ implementation: profileName,
20108
20067
  kind: "postflight",
20109
20068
  name: entryLabel,
20110
20069
  outcome: "skipped"
@@ -20123,7 +20082,7 @@ async function runExecutable(profileName, input) {
20123
20082
  `);
20124
20083
  }
20125
20084
  emitEvent(input.cwd, {
20126
- executable: profileName,
20085
+ implementation: profileName,
20127
20086
  kind: "postflight",
20128
20087
  name: entryLabel,
20129
20088
  outcome: "skipped"
@@ -20159,7 +20118,7 @@ async function runExecutable(profileName, input) {
20159
20118
  file,
20160
20119
  JSON.stringify(
20161
20120
  {
20162
- executable: profileName,
20121
+ implementation: profileName,
20163
20122
  postflight: label,
20164
20123
  message: msg,
20165
20124
  stack: err instanceof Error ? err.stack : void 0,
@@ -20176,7 +20135,7 @@ async function runExecutable(profileName, input) {
20176
20135
  if (ctx.output.exitCode === 0) ctx.output.exitCode = 99;
20177
20136
  }
20178
20137
  emitEvent(input.cwd, {
20179
- executable: profileName,
20138
+ implementation: profileName,
20180
20139
  kind: "postflight",
20181
20140
  name: label,
20182
20141
  durationMs: Date.now() - t0,
@@ -20278,7 +20237,7 @@ async function runExecutableChain(profileName, input) {
20278
20237
  if (!afterJob) {
20279
20238
  return {
20280
20239
  exitCode: 99,
20281
- reason: `in-process return missing capability/action for ${after.executable ?? "unknown"}`
20240
+ reason: `in-process return missing capability/action for ${handoffLabel(after)}`
20282
20241
  };
20283
20242
  }
20284
20243
  process.stdout.write(
@@ -20312,7 +20271,7 @@ async function runExecutableChain(profileName, input) {
20312
20271
  if (!nextJob) {
20313
20272
  return {
20314
20273
  exitCode: 99,
20315
- reason: `in-process hand-off missing capability/action for ${next.executable ?? "unknown"}`
20274
+ reason: `in-process hand-off missing capability/action for ${handoffLabel(next)}`
20316
20275
  };
20317
20276
  }
20318
20277
  process.stdout.write(
@@ -20334,7 +20293,7 @@ async function runExecutableChain(profileName, input) {
20334
20293
  };
20335
20294
  }
20336
20295
  if (result.nextDispatch || result.nextJob) {
20337
- const pending = result.nextDispatch?.executable ?? result.nextDispatch?.workflow ?? result.nextJob?.implementation ?? result.nextJob?.workflow ?? result.nextJob?.capability ?? "unknown";
20296
+ const pending = result.nextDispatch?.implementation ?? result.nextDispatch?.workflow ?? result.nextDispatch?.action ?? result.nextDispatch?.capability ?? result.nextJob?.implementation ?? result.nextJob?.workflow ?? result.nextJob?.capability ?? "unknown";
20338
20297
  process.stderr.write(`[kody] in-process hand-off cap (${MAX_CHAIN_HOPS}) reached; not running ${pending}
20339
20298
  `);
20340
20299
  }
@@ -20347,13 +20306,16 @@ function handoffToJob(handoff) {
20347
20306
  action: handoff.action ?? handoff.capability,
20348
20307
  capability: handoff.capability,
20349
20308
  workflow: handoff.workflow,
20350
- implementation: handoff.implementation ?? handoff.executable,
20309
+ implementation: handoff.implementation,
20351
20310
  cliArgs: handoff.cliArgs,
20352
20311
  flavor: "instant",
20353
20312
  saveReport: handoff.saveReport === true,
20354
20313
  resultTarget: handoff.resultTarget
20355
20314
  };
20356
20315
  }
20316
+ function handoffLabel(handoff) {
20317
+ return handoff.implementation ?? handoff.workflow ?? handoff.action ?? handoff.capability ?? "unknown";
20318
+ }
20357
20319
  function clearStampedLifecycleLabels(profile, ctx) {
20358
20320
  const target = ctx.args.issue ?? ctx.args.pr;
20359
20321
  if (typeof target !== "number" || !Number.isFinite(target)) return;
@@ -20820,7 +20782,7 @@ async function runJob(job, base) {
20820
20782
  }
20821
20783
  const workflow = capabilityContext?.config.workflow ?? workflowContext?.config.workflow;
20822
20784
  const workflowIdentity = valid.workflow ?? capabilityIdentity ?? workflowContext?.slug;
20823
- const capabilitySelectedImplementation = resolvedCapability?.implementation ?? capabilityContext?.config.implementation ?? capabilityContext?.config.executable ?? capabilityContext?.config.implementations?.[0] ?? capabilityContext?.config.executables?.[0] ?? (capabilityContext?.config.role ? capabilityContext.slug : void 0) ?? (capabilityContext?.config.tickScript ? "capability-tick-scripted" : void 0);
20785
+ const capabilitySelectedImplementation = resolvedCapability?.implementation ?? capabilityContext?.config.implementation ?? capabilityContext?.config.implementations?.[0] ?? (capabilityContext?.config.role ? capabilityContext.slug : void 0) ?? (capabilityContext?.config.tickScript ? "capability-tick-scripted" : void 0);
20824
20786
  const profileName = explicitImplementation ?? capabilitySelectedImplementation;
20825
20787
  if (workflow && shouldRunCapabilityWorkflow(valid, workflow, workflowIdentity, capabilitySelectedImplementation, base)) {
20826
20788
  const workflowCapability = capabilityContext ?? workflowContext;
@@ -21003,7 +20965,6 @@ function workflowStepToJob(step, parent, chainData) {
21003
20965
  action,
21004
20966
  capability: step.capability,
21005
20967
  ...step.implementation ? { implementation: step.implementation } : {},
21006
- ...step.executable ? { executable: step.executable } : {},
21007
20968
  ...composeStepWhy(parent.why, step) ? { why: composeStepWhy(parent.why, step) } : {},
21008
20969
  ...step.agent ?? parent.agent ? { agent: step.agent ?? parent.agent } : {},
21009
20970
  ...parent.schedule ? { schedule: parent.schedule } : {},
@@ -21098,7 +21059,7 @@ function loadWorkflowContext(slug2, base) {
21098
21059
  function mintInstantJob(dispatch2, opts) {
21099
21060
  return {
21100
21061
  action: dispatch2.action,
21101
- implementation: dispatch2.implementation ?? dispatch2.executable,
21062
+ implementation: dispatch2.implementation,
21102
21063
  capability: dispatch2.capability,
21103
21064
  why: opts?.why ?? dispatch2.why,
21104
21065
  agent: opts?.agent ?? DEFAULT_INSTANT_AGENT,
@@ -22071,8 +22032,8 @@ function cronMatchesInWindow(spec, end, windowSec) {
22071
22032
  // src/dispatch.ts
22072
22033
  init_registry();
22073
22034
  var POLITE_WORDS = /* @__PURE__ */ new Set(["please", "kindly", "hi", "hey", "hello", "thanks", "thank", "plz", "pls", "yo"]);
22074
- function primaryNumericInputName(executable) {
22075
- const inputs = getProfileInputs(executable);
22035
+ function primaryNumericInputName(implementation) {
22036
+ const inputs = getProfileInputs(implementation);
22076
22037
  if (!inputs) return null;
22077
22038
  const intInput = inputs.find((i) => i.type === "int" && i.required);
22078
22039
  return intInput?.name ?? null;
@@ -22093,7 +22054,6 @@ function routeResult(route, cliArgs, target, why) {
22093
22054
  action: route.action,
22094
22055
  capability: route.capability,
22095
22056
  implementation: route.implementation,
22096
- executable: route.executable,
22097
22057
  cliArgs: { ...route.cliArgs, ...cliArgs },
22098
22058
  target
22099
22059
  };
@@ -22323,7 +22283,6 @@ function dispatchScheduledWatches(opts) {
22323
22283
  action: exe.name,
22324
22284
  capability: exe.name,
22325
22285
  implementation: exe.name,
22326
- executable: exe.name,
22327
22286
  cliArgs: {},
22328
22287
  target: 0
22329
22288
  }
@@ -22678,7 +22637,7 @@ function detectPackageManager2(cwd) {
22678
22637
  return "npm";
22679
22638
  }
22680
22639
  function shouldChainScheduledWatch(match) {
22681
- return match.action === "goal-scheduler" || match.capability === "goal-scheduler" || match.implementation === "goal-scheduler" || match.executable === "goal-scheduler";
22640
+ return match.action === "goal-scheduler" || match.capability === "goal-scheduler" || match.implementation === "goal-scheduler";
22682
22641
  }
22683
22642
  function shellOut(cmd, args, cwd, stream = true) {
22684
22643
  try {
@@ -22862,7 +22821,7 @@ async function runCi(argv) {
22862
22821
  applyCompanyStoreRuntimeConfig(inputs);
22863
22822
  const issueInput = parseInt(String(inputs?.issue_number ?? ""), 10);
22864
22823
  const sessionInput = String(inputs?.sessionId ?? "");
22865
- const capabilityInput = String(inputs?.capability ?? inputs?.executable ?? "").trim();
22824
+ const capabilityInput = String(inputs?.capability ?? "").trim();
22866
22825
  const messageInput = String(inputs?.message ?? "").trim();
22867
22826
  const noTarget = !sessionInput && !(Number.isFinite(issueInput) && issueInput > 0);
22868
22827
  if (noTarget && capabilityInput) {
@@ -22886,13 +22845,12 @@ async function runCi(argv) {
22886
22845
  cliArgs: {}
22887
22846
  };
22888
22847
  const scheduledWatchRoute = manualGoalManager || capabilityRoute || workflowRoute ? void 0 : dispatchScheduledWatches({ force: true }).find(
22889
- (match) => match.action === forceRunAction || match.capability === forceRunAction || match.implementation === forceRunAction || match.executable === forceRunAction
22848
+ (match) => match.action === forceRunAction || match.capability === forceRunAction || match.implementation === forceRunAction
22890
22849
  );
22891
22850
  const route = manualGoalManager ? {
22892
22851
  action: "goal-manager",
22893
22852
  capability: "goal-manager",
22894
22853
  implementation: "goal-manager",
22895
- executable: "goal-manager",
22896
22854
  cliArgs: forceRunCliArgs
22897
22855
  } : capabilityRoute ?? workflowRoute ?? scheduledWatchRoute;
22898
22856
  if (!route) {
@@ -22900,7 +22858,7 @@ async function runCi(argv) {
22900
22858
  `);
22901
22859
  return 64;
22902
22860
  }
22903
- if (route.executable === "goal-manager" && typeof forceRunCliArgs.goal !== "string") {
22861
+ if (route.implementation === "goal-manager" && typeof forceRunCliArgs.goal !== "string") {
22904
22862
  process.stderr.write("[kody] manual goal-manager run requires message goal id\n");
22905
22863
  return 64;
22906
22864
  }
@@ -22942,7 +22900,7 @@ async function runCi(argv) {
22942
22900
  action: route.action,
22943
22901
  capability: route.capability,
22944
22902
  workflow: route.workflow,
22945
- implementation: route.implementation ?? route.executable,
22903
+ implementation: route.implementation,
22946
22904
  cliArgs: { ...route.cliArgs, ...forceRunCliArgs },
22947
22905
  flavor: "instant",
22948
22906
  force: true
@@ -23071,7 +23029,7 @@ ${CI_HELP}`);
23071
23029
  const pm = args.packageManager ?? detectPackageManager2(cwd);
23072
23030
  process.stdout.write(`\u2192 kody: package manager = ${pm}
23073
23031
  `);
23074
- const buildOnly = dispatch2.implementation === "preview-build" || dispatch2.executable === "preview-build";
23032
+ const buildOnly = dispatch2.implementation === "preview-build";
23075
23033
  if (args.skipInstall || buildOnly) {
23076
23034
  process.stdout.write(`\u2192 kody: skipping dep install (${buildOnly ? "build-only executable" : "--skip-install"})
23077
23035
  `);
@@ -23181,7 +23139,7 @@ async function runScheduledFanOut(cwd, args, opts) {
23181
23139
  mintScheduledJob({
23182
23140
  action: match.action,
23183
23141
  capability: match.capability,
23184
- implementation: match.implementation ?? match.executable,
23142
+ implementation: match.implementation,
23185
23143
  cliArgs: match.cliArgs
23186
23144
  }),
23187
23145
  {
@@ -24282,7 +24240,7 @@ async function mcpHttpServer() {
24282
24240
  verifyToolDefinition({
24283
24241
  config,
24284
24242
  cwd: process.cwd(),
24285
- executable: "mcp-http"
24243
+ implementation: "mcp-http"
24286
24244
  })
24287
24245
  ]
24288
24246
  },
@@ -26039,7 +25997,7 @@ function summarizeRun(events) {
26039
25997
  const durationMs = new Date(endedAt).getTime() - new Date(startedAt).getTime();
26040
25998
  const exitCodeRaw = lastEnd?.meta?.exitCode;
26041
25999
  const exitCode = typeof exitCodeRaw === "number" ? exitCodeRaw : null;
26042
- const executables = Array.from(new Set(sorted.map((e) => e.executable)));
26000
+ const implementations = Array.from(new Set(sorted.map((e) => e.implementation)));
26043
26001
  let tIn = 0;
26044
26002
  let tOut = 0;
26045
26003
  let tCacheR = 0;
@@ -26057,7 +26015,7 @@ function summarizeRun(events) {
26057
26015
  startedAt,
26058
26016
  endedAt,
26059
26017
  durationMs,
26060
- executables,
26018
+ implementations,
26061
26019
  exitCode,
26062
26020
  ok: exitCode === 0,
26063
26021
  totalInputTokens: tIn,
@@ -26065,15 +26023,15 @@ function summarizeRun(events) {
26065
26023
  totalCacheReadTokens: tCacheR
26066
26024
  };
26067
26025
  }
26068
- function rollupByExecutable(events) {
26069
- const byExec = /* @__PURE__ */ new Map();
26026
+ function rollupByImplementation(events) {
26027
+ const byImplementation = /* @__PURE__ */ new Map();
26070
26028
  for (const ev of events) {
26071
26029
  if (ev.kind !== "stage_end") continue;
26072
- if (!byExec.has(ev.executable)) byExec.set(ev.executable, []);
26073
- byExec.get(ev.executable).push(ev);
26030
+ if (!byImplementation.has(ev.implementation)) byImplementation.set(ev.implementation, []);
26031
+ byImplementation.get(ev.implementation).push(ev);
26074
26032
  }
26075
26033
  const rollups = [];
26076
- for (const [executable, stageEnds] of byExec) {
26034
+ for (const [implementation, stageEnds] of byImplementation) {
26077
26035
  const durations = stageEnds.map((e) => e.durationMs ?? 0).filter((d) => d > 0).sort((a, b) => a - b);
26078
26036
  const ok = stageEnds.filter((e) => e.outcome === "ok").length;
26079
26037
  const failed = stageEnds.filter((e) => e.outcome === "failed").length;
@@ -26083,7 +26041,7 @@ function rollupByExecutable(events) {
26083
26041
  let tCacheC = 0;
26084
26042
  for (const ev of events) {
26085
26043
  if (ev.kind !== "agent_end") continue;
26086
- if (ev.executable !== executable) continue;
26044
+ if (ev.implementation !== implementation) continue;
26087
26045
  const tokens = ev.meta?.tokens;
26088
26046
  if (tokens) {
26089
26047
  tIn += Number(tokens.input ?? 0);
@@ -26094,7 +26052,7 @@ function rollupByExecutable(events) {
26094
26052
  }
26095
26053
  const mean = durations.length > 0 ? durations.reduce((s, n) => s + n, 0) / durations.length : 0;
26096
26054
  rollups.push({
26097
- executable,
26055
+ implementation,
26098
26056
  agentRuns: stageEnds.length,
26099
26057
  ok,
26100
26058
  failed,
@@ -26134,13 +26092,13 @@ async function runStats(argv) {
26134
26092
  process.stdout.write("no runs in the requested window\n");
26135
26093
  return 0;
26136
26094
  }
26137
- const byExec = rollupByExecutable(allEvents);
26095
+ const byImplementation = rollupByImplementation(allEvents);
26138
26096
  if (opts.asJson) {
26139
- process.stdout.write(`${JSON.stringify({ agentRuns: runSummaries, byExecutable: byExec }, null, 2)}
26097
+ process.stdout.write(`${JSON.stringify({ agentRuns: runSummaries, byImplementation }, null, 2)}
26140
26098
  `);
26141
26099
  return 0;
26142
26100
  }
26143
- printReport(runSummaries, byExec);
26101
+ printReport(runSummaries, byImplementation);
26144
26102
  return 0;
26145
26103
  }
26146
26104
  function printReport(agentRuns, rollups) {
@@ -26168,9 +26126,9 @@ Kody run statistics \u2014 ${totalRuns} runs
26168
26126
  `
26169
26127
  );
26170
26128
  process.stdout.write(`
26171
- Per-executable (stage_end events)
26129
+ Per-implementation (stage_end events)
26172
26130
  `);
26173
- const headers = ["executable", "runs", "ok", "failed", "p50", "p95", "mean", "tok-in", "tok-out", "cache-r"];
26131
+ const headers = ["implementation", "runs", "ok", "failed", "p50", "p95", "mean", "tok-in", "tok-out", "cache-r"];
26174
26132
  const widths = [22, 6, 6, 7, 9, 9, 9, 10, 10, 10];
26175
26133
  process.stdout.write(`${headers.map((h, i) => h.padEnd(widths[i])).join("")}
26176
26134
  `);
@@ -26178,7 +26136,7 @@ Per-executable (stage_end events)
26178
26136
  `);
26179
26137
  for (const r of rollups) {
26180
26138
  const row = [
26181
- r.executable,
26139
+ r.implementation,
26182
26140
  String(r.agentRuns),
26183
26141
  String(r.ok),
26184
26142
  String(r.failed),
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Types shared by the generic executor and executables.
2
+ * Types shared by the generic executor and implementation profiles.
3
3
  *
4
4
  * The executor reads a Profile, validates the user's CLI args against
5
5
  * Profile.inputs, then runs the declared preflight scripts → agent →
@@ -20,42 +20,39 @@ export interface Profile {
20
20
  /**
21
21
  * Public action name owned by a capability. A user may type `@kody <action>`;
22
22
  * dispatch resolves that action to the capability, then the capability selects the
23
- * implementation executable. Absent → the capability slug/name is the action.
23
+ * implementation profile. Absent → the capability slug/name is the action.
24
24
  */
25
25
  action?: string
26
26
  /**
27
- * Optional agent this executable runs *as*. When set, the executor
27
+ * Optional agent this implementation runs *as*. When set, the executor
28
28
  * loads hydrated `.kody/agents/<agent>.md` and injects that agent (authoritative
29
- * identity) ahead of the executable's own system-prompt append. This is the
30
- * unification hook: a "capability" is just an executable + an agent. Absent →
29
+ * identity) ahead of the implementation's own system-prompt append. This is the
30
+ * unification hook: a capability can select an implementation + an agent. Absent →
31
31
  * runs with no agent (unchanged legacy behaviour). A declared-but-missing
32
32
  * agent file is fatal at run time (see src/agents.ts).
33
33
  */
34
34
  agent?: string
35
35
  describe: string
36
36
  /**
37
- * Semantic role — what this executable IS, not when it runs.
37
+ * Semantic role — what this implementation IS, not when it runs.
38
38
  * - primitive: single-step agent executor (flow → agent → verify → commit → PR).
39
39
  * - orchestrator: no-agent, drives primitives via a postflight transition table
40
40
  * (comment-based, one GHA run per step).
41
41
  * - container: no-agent, runs declared `children` sequentially in-process
42
42
  * (one GHA run for the whole flow). Routing is done by per-child
43
43
  * `next` maps over action types — no @kody comments dispatched.
44
- * - watch: scheduled observer that inspects repo state and may trigger other executables.
44
+ * - watch: scheduled observer that inspects repo state and may trigger other implementations.
45
45
  * - utility: no-agent, one-off administrative work (scaffolding, release, etc.).
46
46
  *
47
47
  * Roles enforce shape at profile-load time and let help/dispatch treat
48
- * executables differently by category.
48
+ * implementations differently by category.
49
49
  */
50
50
  role: "primitive" | "orchestrator" | "container" | "watch" | "utility"
51
51
  /**
52
52
  * Capability contract profiles can point at a separate implementation by name.
53
- * `executable` remains a legacy alias while old assets migrate.
54
53
  */
55
54
  implementation?: string
56
- executable?: string
57
55
  implementations?: string[]
58
- executables?: string[]
59
56
  /** Hide a capability implementation profile from public action discovery. */
60
57
  internal?: boolean
61
58
  /** Explicit public-action flag for capability profiles. */
@@ -99,7 +96,7 @@ export interface Profile {
99
96
  /** Cron expression for scheduled profiles (e.g. "0 8 * * MON"). */
100
97
  schedule?: string
101
98
  /**
102
- * Task-state phase label emitted when this executable completes successfully.
99
+ * Task-state phase label emitted when this implementation completes successfully.
103
100
  * Failing actions always set phase to "failed" regardless. Omitted → "idle".
104
101
  * Lets state.ts stay generic — phase semantics live on the profile.
105
102
  */
@@ -115,7 +112,7 @@ export interface Profile {
115
112
  *
116
113
  * Lifecycles exist to consolidate orchestration boilerplate (label,
117
114
  * context loading, verify, commit, comment) that recurs across many
118
- * executables. Per-executable specifics still go in `scripts.preflight`
115
+ * implementations. Per-implementation specifics still go in `scripts.preflight`
119
116
  * and `scripts.postflight` — the lifecycle wraps them, it doesn't
120
117
  * replace them.
121
118
  */
@@ -131,14 +128,14 @@ export interface Profile {
131
128
  }
132
129
  outputContract?: OutputContract
133
130
  /**
134
- * Declared artifacts consumed by this executable. The resolveArtifacts
131
+ * Declared artifacts consumed by this implementation. The resolveArtifacts
135
132
  * preflight loads each into ctx.data.artifacts[name] from the task-state
136
- * comment. If `required: true` and the artifact is absent, the executable
133
+ * comment. If `required: true` and the artifact is absent, the implementation
137
134
  * fails fast.
138
135
  */
139
136
  inputArtifacts: InputArtifactSpec[]
140
137
  /**
141
- * Declared artifacts produced by this executable. The persistArtifacts
138
+ * Declared artifacts produced by this implementation. The persistArtifacts
142
139
  * postflight reads the named source field from ctx.data and writes an
143
140
  * Artifact entry into the task state's `artifacts` map.
144
141
  */
@@ -440,7 +437,6 @@ export interface Context {
440
437
  capability?: string
441
438
  workflow?: string
442
439
  implementation?: string
443
- executable?: string
444
440
  cliArgs: Record<string, unknown>
445
441
  saveReport?: boolean
446
442
  resultTarget?: CapabilityResultTarget
@@ -453,7 +449,6 @@ export interface Context {
453
449
  capability?: string
454
450
  workflow?: string
455
451
  implementation?: string
456
- executable?: string
457
452
  cliArgs: Record<string, unknown>
458
453
  saveReport?: boolean
459
454
  resultTarget?: CapabilityResultTarget
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.346",
3
+ "version": "0.4.348",
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",
@@ -12,28 +12,6 @@
12
12
  "templates",
13
13
  "kody.config.schema.json"
14
14
  ],
15
- "scripts": {
16
- "kody:run": "tsx bin/kody.ts",
17
- "serve": "tsx bin/kody.ts serve",
18
- "serve:vscode": "tsx bin/kody.ts serve vscode",
19
- "serve:claude": "tsx bin/kody.ts serve claude",
20
- "clean:dist": "node scripts/clean-dist.cjs",
21
- "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
22
- "check:modularity": "tsx scripts/check-script-modularity.ts",
23
- "pretest": "pnpm check:modularity",
24
- "test": "vitest run tests/unit tests/int --coverage",
25
- "posttest": "tsx scripts/check-coverage-floor.ts",
26
- "test:smoke": "vitest run tests/smoke --no-coverage",
27
- "test:e2e": "vitest run tests/e2e --no-coverage",
28
- "test:all": "vitest run tests --no-coverage",
29
- "typecheck": "tsc --noEmit",
30
- "lint": "biome check",
31
- "lint:fix": "biome check --write",
32
- "format": "biome format --write",
33
- "verify:package": "node scripts/verify-package-tarball.cjs",
34
- "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner",
35
- "prepublishOnly": "pnpm typecheck && vitest run tests/unit tests/int --no-coverage && pnpm build && pnpm verify:package"
36
- },
37
15
  "dependencies": {
38
16
  "@actions/cache": "^6.0.0",
39
17
  "@anthropic-ai/claude-agent-sdk": "0.2.119",
@@ -57,5 +35,26 @@
57
35
  "url": "git+https://github.com/aharonyaircohen/kody-engine.git"
58
36
  },
59
37
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
60
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
61
- }
38
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
39
+ "scripts": {
40
+ "kody:run": "tsx bin/kody.ts",
41
+ "serve": "tsx bin/kody.ts serve",
42
+ "serve:vscode": "tsx bin/kody.ts serve vscode",
43
+ "serve:claude": "tsx bin/kody.ts serve claude",
44
+ "clean:dist": "node scripts/clean-dist.cjs",
45
+ "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
46
+ "check:modularity": "tsx scripts/check-script-modularity.ts",
47
+ "pretest": "pnpm check:modularity",
48
+ "test": "vitest run tests/unit tests/int --coverage",
49
+ "posttest": "tsx scripts/check-coverage-floor.ts",
50
+ "test:smoke": "vitest run tests/smoke --no-coverage",
51
+ "test:e2e": "vitest run tests/e2e --no-coverage",
52
+ "test:all": "vitest run tests --no-coverage",
53
+ "typecheck": "tsc --noEmit",
54
+ "lint": "biome check",
55
+ "lint:fix": "biome check --write",
56
+ "format": "biome format --write",
57
+ "verify:package": "node scripts/verify-package-tarball.cjs",
58
+ "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner"
59
+ }
60
+ }