@kody-ade/kody-engine 0.4.345 → 0.4.346

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.345",
18
+ version: "0.4.346",
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",
@@ -6534,8 +6534,8 @@ function runIndexRowFromJobContext(input) {
6534
6534
  action: stringValue2(input.data.jobAction) ?? void 0,
6535
6535
  capability: stringValue2(input.data.jobCapability) ?? void 0,
6536
6536
  workflow: workflow ?? void 0,
6537
- implementation: stringValue2(input.data.jobImplementation) ?? stringValue2(input.data.jobExecutable) ?? input.profileName,
6538
- executable: stringValue2(input.data.jobExecutable) ?? stringValue2(input.data.jobImplementation) ?? input.profileName,
6537
+ implementation: stringValue2(input.data.jobImplementation) ?? input.profileName,
6538
+ executable: stringValue2(input.data.jobImplementation) ?? input.profileName,
6539
6539
  agent: stringValue2(input.data.jobAgent) ?? input.profile.agent ?? void 0,
6540
6540
  model: stringValue2(input.data.jobModel) ?? void 0,
6541
6541
  modelProvider: stringValue2(input.data.jobModelProvider) ?? void 0,
@@ -6584,8 +6584,8 @@ function runIndexRowFromGoalEvents(goalId, logPath, events) {
6584
6584
  actor: stringValue2(trigger?.githubActor) ?? stringValue2(trigger?.actor) ?? void 0,
6585
6585
  action: stringValue2(job?.action) ?? void 0,
6586
6586
  capability: stringValue2(job?.capability) ?? void 0,
6587
- implementation: stringValue2(job?.implementation) ?? stringValue2(job?.executable) ?? void 0,
6588
- executable: stringValue2(job?.executable) ?? stringValue2(job?.implementation) ?? void 0,
6587
+ implementation: stringValue2(job?.implementation) ?? void 0,
6588
+ executable: stringValue2(job?.implementation) ?? void 0,
6589
6589
  agent: stringValue2(job?.agent) ?? void 0,
6590
6590
  model: stringValue2(job?.model) ?? void 0,
6591
6591
  modelProvider: stringValue2(job?.modelProvider) ?? void 0,
@@ -7065,7 +7065,7 @@ function jobMetaFromData(data) {
7065
7065
  schedule: typeof data.jobSchedule === "string" ? data.jobSchedule : void 0,
7066
7066
  runUrl: typeof data.runUrl === "string" ? data.runUrl : void 0,
7067
7067
  capability: typeof data.jobCapability === "string" ? data.jobCapability : void 0,
7068
- implementation: typeof data.jobImplementation === "string" ? data.jobImplementation : typeof data.jobExecutable === "string" ? data.jobExecutable : void 0,
7068
+ implementation: typeof data.jobImplementation === "string" ? data.jobImplementation : void 0,
7069
7069
  target: typeof data.jobTarget === "number" ? data.jobTarget : void 0,
7070
7070
  agent: typeof data.jobAgent === "string" ? data.jobAgent : void 0,
7071
7071
  why: typeof data.jobWhy === "string" ? data.jobWhy : void 0
@@ -7905,8 +7905,8 @@ function jobContext(data) {
7905
7905
  flavor: stringValue3(data.jobFlavor) ?? void 0,
7906
7906
  action: stringValue3(data.jobAction) ?? void 0,
7907
7907
  capability: stringValue3(data.jobCapability) ?? void 0,
7908
- implementation: stringValue3(data.jobImplementation) ?? stringValue3(data.jobExecutable) ?? void 0,
7909
- executable: stringValue3(data.jobExecutable) ?? void 0,
7908
+ implementation: stringValue3(data.jobImplementation) ?? void 0,
7909
+ executable: stringValue3(data.jobImplementation) ?? void 0,
7910
7910
  agent: stringValue3(data.jobAgent) ?? void 0,
7911
7911
  schedule: stringValue3(data.jobSchedule) ?? void 0,
7912
7912
  target: data.jobTarget ?? void 0,
@@ -12782,7 +12782,7 @@ var init_dispatchCapabilityTicks = __esm({
12782
12782
  const out = await runJob(
12783
12783
  mintScheduledJob({
12784
12784
  capability: targetExecutable,
12785
- executable: targetExecutable,
12785
+ implementation: targetExecutable,
12786
12786
  cliArgs: { [issueArg]: issue.number }
12787
12787
  }),
12788
12788
  { cwd: ctx.cwd, config: ctx.config, verbose: ctx.verbose, quiet: ctx.quiet, chain: false }
@@ -12839,10 +12839,10 @@ var init_dispatchClassified = __esm({
12839
12839
  // src/jobIdentity.ts
12840
12840
  function stableJobKey(job) {
12841
12841
  const capability = job.workflow ?? job.capability ?? job.action;
12842
- const executable = job.executable ?? capability ?? "unknown";
12843
- if (job.flavor === "scheduled" && job.capability) return `scheduled:${job.capability}:${executable}`;
12842
+ const implementation = job.implementation ?? capability ?? "unknown";
12843
+ if (job.flavor === "scheduled" && job.capability) return `scheduled:${job.capability}:${implementation}`;
12844
12844
  const target = typeof job.target === "number" ? job.target : targetFromCliArgs(job.cliArgs);
12845
- const work = capability && executable && executable !== capability ? `${capability}:${executable}` : capability ?? executable;
12845
+ const work = capability && implementation && implementation !== capability ? `${capability}:${implementation}` : capability ?? implementation;
12846
12846
  return target === void 0 ? `${job.flavor}:${work}` : `${job.flavor}:${work}:${target}`;
12847
12847
  }
12848
12848
  function targetFromCliArgs(cliArgs) {
@@ -12865,7 +12865,6 @@ function taskJobToJob(job, issueArg) {
12865
12865
  return {
12866
12866
  capability: job.capability ?? job.implementation,
12867
12867
  implementation: job.implementation,
12868
- executable: job.implementation,
12869
12868
  ...job.reason ? { why: job.reason } : {},
12870
12869
  ...job.agent ? { agent: job.agent } : {},
12871
12870
  ...job.schedule ? { schedule: job.schedule } : {},
@@ -13231,7 +13230,7 @@ var init_failOnceTaskJob = __esm({
13231
13230
  const issue = typeof ctx.args.issue === "number" ? ctx.args.issue : void 0;
13232
13231
  const fallbackJob = {
13233
13232
  capability: profile.action ?? profile.name,
13234
- executable: profile.name,
13233
+ implementation: profile.name,
13235
13234
  flavor: "instant",
13236
13235
  ...typeof issue === "number" ? { target: issue, cliArgs: { issue } } : { cliArgs: {} }
13237
13236
  };
@@ -15485,9 +15484,8 @@ function requireString2(value, label) {
15485
15484
  function creatorSourceLabel(ctx, profileName) {
15486
15485
  const capability = typeof ctx.data.jobCapability === "string" ? ctx.data.jobCapability.trim() : "";
15487
15486
  const implementation = typeof ctx.data.jobImplementation === "string" ? ctx.data.jobImplementation.trim() : "";
15488
- const executable = typeof ctx.data.jobExecutable === "string" ? ctx.data.jobExecutable.trim() : "";
15489
15487
  const profile = typeof profileName === "string" ? profileName.trim() : "";
15490
- return capability || implementation || executable || profile || "agent-factory";
15488
+ return capability || implementation || profile || "agent-factory";
15491
15489
  }
15492
15490
  function ghJson(args, cwd, input) {
15493
15491
  const raw = gh(args, input === void 0 ? { cwd } : { cwd, input: JSON.stringify(input) });
@@ -16147,7 +16145,6 @@ function taskJobSpecToJob(spec, issueNumber) {
16147
16145
  return {
16148
16146
  capability: spec.capability ?? spec.implementation,
16149
16147
  implementation: spec.implementation,
16150
- executable: spec.implementation,
16151
16148
  why: spec.reason,
16152
16149
  agent: spec.agent,
16153
16150
  schedule: spec.schedule,
@@ -16161,7 +16158,7 @@ function normalizeSpec(input, index) {
16161
16158
  throw new Error(`task job plan entry ${index} must be an object`);
16162
16159
  }
16163
16160
  const raw = input;
16164
- const implementation = typeof raw.implementation === "string" ? raw.implementation.trim() : typeof raw.executable === "string" ? raw.executable.trim() : "";
16161
+ const implementation = typeof raw.implementation === "string" ? raw.implementation.trim() : "";
16165
16162
  if (!/^[a-z][a-z0-9-]*$/.test(implementation)) {
16166
16163
  throw new Error(`task job plan entry ${index} must have a valid implementation`);
16167
16164
  }
@@ -16186,11 +16183,11 @@ function normalizeSpec(input, index) {
16186
16183
  };
16187
16184
  }
16188
16185
  function jobToPlannedTaskJob(job) {
16189
- const implementation = job.implementation ?? job.executable ?? job.capability ?? "unknown";
16186
+ const implementation = job.implementation ?? job.capability ?? "unknown";
16190
16187
  return {
16191
16188
  id: stableJobKey(job),
16192
16189
  implementation,
16193
- capability: job.capability ?? job.action ?? job.executable ?? "unknown",
16190
+ capability: job.capability ?? job.action ?? "unknown",
16194
16191
  ...job.agent ? { agent: job.agent } : {},
16195
16192
  ...job.flavor ? { flavor: job.flavor } : {},
16196
16193
  ...job.schedule ? { schedule: job.schedule } : {},
@@ -19771,11 +19768,11 @@ function jobReferenceBlock(profileName, profile, data) {
19771
19768
  const flavor = typeof data.jobFlavor === "string" && data.jobFlavor.length > 0 ? data.jobFlavor : null;
19772
19769
  const schedule = typeof data.jobSchedule === "string" && data.jobSchedule.length > 0 ? data.jobSchedule : null;
19773
19770
  const isJob2 = Boolean(
19774
- jobId || flavor || schedule || data.jobCapability || data.jobImplementation || data.jobExecutable || data.jobWhy
19771
+ jobId || flavor || schedule || data.jobCapability || data.jobImplementation || data.jobWhy
19775
19772
  );
19776
19773
  if (!isJob2) return null;
19777
19774
  const capability = typeof data.jobCapability === "string" && data.jobCapability.length > 0 ? data.jobCapability : profile.executable ? profile.name : null;
19778
- 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 : typeof data.jobExecutable === "string" && data.jobExecutable.length > 0 ? data.jobExecutable : profileName;
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;
19779
19776
  const agent = typeof profile.agent === "string" && profile.agent.length > 0 ? profile.agent : typeof data.jobAgent === "string" && data.jobAgent.length > 0 ? data.jobAgent : null;
19780
19777
  const description = profile.describe.trim();
19781
19778
  const workflow = typeof data.workflowCapability === "string" && data.workflowCapability.length > 0 ? data.workflowCapability : null;
@@ -20260,7 +20257,7 @@ async function runExecutableChain(profileName, input) {
20260
20257
  if (result.nextJob) {
20261
20258
  const next2 = result.nextJob;
20262
20259
  const after = result.afterNextJob;
20263
- const label = next2.executable ?? next2.capability ?? "unknown";
20260
+ const label = next2.implementation ?? next2.capability ?? "unknown";
20264
20261
  process.stdout.write(`\u2192 kody: in-process job hand-off \u2192 ${label} (hop ${hops}/${MAX_CHAIN_HOPS})
20265
20262
 
20266
20263
  `);
@@ -20337,7 +20334,7 @@ async function runExecutableChain(profileName, input) {
20337
20334
  };
20338
20335
  }
20339
20336
  if (result.nextDispatch || result.nextJob) {
20340
- const pending = result.nextDispatch?.executable ?? result.nextDispatch?.workflow ?? result.nextJob?.executable ?? result.nextJob?.workflow ?? result.nextJob?.capability ?? "unknown";
20337
+ const pending = result.nextDispatch?.executable ?? result.nextDispatch?.workflow ?? result.nextJob?.implementation ?? result.nextJob?.workflow ?? result.nextJob?.capability ?? "unknown";
20341
20338
  process.stderr.write(`[kody] in-process hand-off cap (${MAX_CHAIN_HOPS}) reached; not running ${pending}
20342
20339
  `);
20343
20340
  }
@@ -20351,7 +20348,6 @@ function handoffToJob(handoff) {
20351
20348
  capability: handoff.capability,
20352
20349
  workflow: handoff.workflow,
20353
20350
  implementation: handoff.implementation ?? handoff.executable,
20354
- executable: handoff.executable,
20355
20351
  cliArgs: handoff.cliArgs,
20356
20352
  flavor: "instant",
20357
20353
  saveReport: handoff.saveReport === true,
@@ -20781,8 +20777,7 @@ function validateJob(input) {
20781
20777
  }
20782
20778
  return {
20783
20779
  action: typeof j.action === "string" ? j.action : void 0,
20784
- implementation: typeof j.implementation === "string" ? j.implementation : typeof j.executable === "string" ? j.executable : void 0,
20785
- executable: typeof j.executable === "string" ? j.executable : typeof j.implementation === "string" ? j.implementation : void 0,
20780
+ implementation: typeof j.implementation === "string" ? j.implementation : void 0,
20786
20781
  capability: typeof j.capability === "string" ? j.capability : void 0,
20787
20782
  workflow: typeof j.workflow === "string" ? j.workflow : void 0,
20788
20783
  why: typeof j.why === "string" ? j.why : void 0,
@@ -20816,7 +20811,7 @@ async function runJob(job, base) {
20816
20811
  const capabilityIdentity = valid.capability ?? resolvedCapability?.capability;
20817
20812
  const capabilityContext = valid.workflow ? null : loadCapabilityContext(capabilityIdentity, base.cwd);
20818
20813
  const workflowContext = valid.workflow ? loadWorkflowContext(valid.workflow, base) : !capabilityContext && !resolvedCapability ? loadWorkflowContext(capabilityIdentity ?? action, base) : null;
20819
- const explicitImplementation = valid.implementation ?? valid.executable;
20814
+ const explicitImplementation = valid.implementation;
20820
20815
  const explicitImplementationOnly = explicitImplementation !== void 0 && (valid.action === void 0 || valid.action === explicitImplementation) && (valid.capability === void 0 || valid.capability === explicitImplementation);
20821
20816
  if (!resolvedCapability && !capabilityContext && !workflowContext && !explicitImplementationOnly) {
20822
20817
  throw new InvalidJobError(
@@ -20833,7 +20828,7 @@ async function runJob(job, base) {
20833
20828
  return runCapabilityWorkflow(workflowJob, workflow, workflowCapability, base);
20834
20829
  }
20835
20830
  if (!profileName) {
20836
- throw new InvalidJobError(`job capability resolves to no executable: ${capabilityIdentity ?? action}`);
20831
+ throw new InvalidJobError(`job capability resolves to no implementation: ${capabilityIdentity ?? action}`);
20837
20832
  }
20838
20833
  return runDefaultCapabilityWorkflow(
20839
20834
  valid,
@@ -20864,7 +20859,6 @@ async function runCapabilityImplementationStep(valid, profileName, capabilityIde
20864
20859
  if (capabilityIdentity !== void 0 && capabilityIdentity.length > 0)
20865
20860
  preloadedData.jobCapability = capabilityIdentity;
20866
20861
  preloadedData.jobImplementation = profileName;
20867
- preloadedData.jobExecutable = profileName;
20868
20862
  if (valid.schedule !== void 0 && valid.schedule.length > 0) preloadedData.jobSchedule = valid.schedule;
20869
20863
  if (valid.saveReport === true) preloadedData.jobSaveReport = true;
20870
20864
  if (valid.resultTarget) preloadedData.capabilityResultTarget = valid.resultTarget;
@@ -20894,19 +20888,19 @@ async function runCapabilityImplementationStep(valid, profileName, capabilityIde
20894
20888
  quiet: base.quiet,
20895
20889
  preloadedData: Object.keys(preloadedData).length > 0 ? preloadedData : void 0
20896
20890
  };
20897
- const shouldApplyResolvedCapabilityArgs = valid.implementation === void 0 && valid.executable === void 0 && resolvedCapability && profileName === resolvedCapability.implementation;
20891
+ const shouldApplyResolvedCapabilityArgs = valid.implementation === void 0 && resolvedCapability && profileName === resolvedCapability.implementation;
20898
20892
  input.cliArgs = shouldApplyResolvedCapabilityArgs ? { ...resolvedCapability.cliArgs, ...input.cliArgs } : input.cliArgs;
20899
20893
  const run = base.chain === false ? runExecutable : runExecutableChain;
20900
20894
  return run(profileName, input);
20901
20895
  }
20902
- function shouldRunCapabilityWorkflow(job, workflow, capabilityIdentity, selectedExecutable, base) {
20896
+ function shouldRunCapabilityWorkflow(job, workflow, capabilityIdentity, selectedImplementation, base) {
20903
20897
  if (workflow.steps.length === 0) return false;
20904
20898
  if (!capabilityIdentity) return false;
20905
20899
  const stack = Array.isArray(base.preloadedData?.workflowStack) ? base.preloadedData.workflowStack.filter((entry) => typeof entry === "string") : [];
20906
20900
  if (stack.includes(capabilityIdentity)) return false;
20907
- const requestedImplementation = job.implementation ?? job.executable;
20901
+ const requestedImplementation = job.implementation;
20908
20902
  if (!requestedImplementation) return true;
20909
- return requestedImplementation === selectedExecutable || requestedImplementation === capabilityIdentity || requestedImplementation === job.action;
20903
+ return requestedImplementation === selectedImplementation || requestedImplementation === capabilityIdentity || requestedImplementation === job.action;
20910
20904
  }
20911
20905
  async function runCapabilityWorkflow(parent, workflow, capability, base) {
20912
20906
  let chainData = {
@@ -21105,7 +21099,6 @@ function mintInstantJob(dispatch2, opts) {
21105
21099
  return {
21106
21100
  action: dispatch2.action,
21107
21101
  implementation: dispatch2.implementation ?? dispatch2.executable,
21108
- executable: dispatch2.executable,
21109
21102
  capability: dispatch2.capability,
21110
21103
  why: opts?.why ?? dispatch2.why,
21111
21104
  agent: opts?.agent ?? DEFAULT_INSTANT_AGENT,
@@ -21118,8 +21111,7 @@ function mintScheduledJob(input) {
21118
21111
  return {
21119
21112
  action: input.action,
21120
21113
  capability: input.capability,
21121
- implementation: input.implementation ?? input.executable,
21122
- executable: input.executable,
21114
+ implementation: input.implementation,
21123
21115
  schedule: input.schedule,
21124
21116
  agent: input.agent,
21125
21117
  cliArgs: input.cliArgs ?? {},
@@ -22951,7 +22943,6 @@ async function runCi(argv) {
22951
22943
  capability: route.capability,
22952
22944
  workflow: route.workflow,
22953
22945
  implementation: route.implementation ?? route.executable,
22954
- executable: route.executable,
22955
22946
  cliArgs: { ...route.cliArgs, ...forceRunCliArgs },
22956
22947
  flavor: "instant",
22957
22948
  force: true
@@ -23190,8 +23181,7 @@ async function runScheduledFanOut(cwd, args, opts) {
23190
23181
  mintScheduledJob({
23191
23182
  action: match.action,
23192
23183
  capability: match.capability,
23193
- implementation: match.implementation,
23194
- executable: match.executable,
23184
+ implementation: match.implementation ?? match.executable,
23195
23185
  cliArgs: match.cliArgs
23196
23186
  }),
23197
23187
  {
@@ -26444,7 +26434,6 @@ ${HELP_TEXT}`);
26444
26434
  action: route.action,
26445
26435
  capability: route.capability,
26446
26436
  implementation: route.implementation,
26447
- executable: route.executable,
26448
26437
  cliArgs,
26449
26438
  target: numericTarget(cliArgs),
26450
26439
  flavor: "instant"
@@ -26482,7 +26471,6 @@ ${HELP_TEXT}`);
26482
26471
  action: executable,
26483
26472
  capability: executable,
26484
26473
  implementation: executable,
26485
- executable,
26486
26474
  cliArgs,
26487
26475
  target: numericTarget(cliArgs),
26488
26476
  flavor: "instant"
@@ -489,9 +489,8 @@ export type AnyScript = PreflightScript | PostflightScript
489
489
  // Job — the unified work request (task-state jobs collect run attempts).
490
490
  //
491
491
  // A Job is the required work the engine tries to execute, regardless of how it
492
- // was triggered. It must reference an capability/action capability
493
- // contract. The executable is only the selected implementation detail, never a
494
- // standalone request.
492
+ // was triggered. It must reference a capability/action capability contract.
493
+ // The implementation is selected under that contract, never requested by itself.
495
494
  // Task state stores this durable job separately from individual run attempts.
496
495
  // Two flavors:
497
496
  // - "instant" — run once now (an `@kody <verb>` comment or a manual dispatch)
@@ -508,8 +507,6 @@ export interface Job {
508
507
  action?: string
509
508
  /** How: implementation profile selected by the capability. Not valid by itself. */
510
509
  implementation?: string
511
- /** Legacy compatibility copy of `implementation`. */
512
- executable?: string
513
510
  /** Why (referenced): a capability slug whose intent drives the run. */
514
511
  capability?: string
515
512
  /** Why (referenced): a stored workflow definition to run as an ordered capability chain. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.345",
3
+ "version": "0.4.346",
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",