@kody-ade/kody-engine 0.4.504 → 0.4.506

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 +22 -13
  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.504",
18
+ version: "0.4.506",
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",
@@ -4206,7 +4206,6 @@ function validateWorkflow(value, options = {}) {
4206
4206
  );
4207
4207
  }
4208
4208
  const defaults = transitions.filter((transition) => asRecord(transition)?.default === true);
4209
- const conditionals = transitions.filter((transition) => asRecord(transition)?.when !== void 0);
4210
4209
  const unconditional = transitions.filter((transition) => {
4211
4210
  const raw = asRecord(transition);
4212
4211
  return typeof transition === "string" || Boolean(raw && raw.when === void 0 && raw.default !== true && raw.maxIterations === void 0);
@@ -4219,14 +4218,6 @@ function validateWorkflow(value, options = {}) {
4219
4218
  `workflow step ${id} has more than one default connection`
4220
4219
  );
4221
4220
  }
4222
- if (conditionals.length > 0 && defaults.length !== 1) {
4223
- issue(
4224
- issues,
4225
- "missing_default_transition",
4226
- `steps[${index}].next`,
4227
- `workflow step ${id} has conditions and needs one default connection`
4228
- );
4229
- }
4230
4221
  if (unconditional.length > 1 || unconditional.length > 0 && transitions.length > 1) {
4231
4222
  issue(
4232
4223
  issues,
@@ -22317,6 +22308,7 @@ async function runLinearCapabilityWorkflow(parent, workflow, capability, base) {
22317
22308
  workflowTitle: capability.title,
22318
22309
  workflowStepCount: workflow.steps.length,
22319
22310
  workflowIssueNumber: workflowIssueNumber(parent),
22311
+ workflowContext: workflowInputContext(parent.cliArgs),
22320
22312
  workflowFacts: parent.workflowFacts ?? {},
22321
22313
  workflowStack: [
22322
22314
  ...Array.isArray(base.preloadedData?.workflowStack) ? base.preloadedData.workflowStack.filter((entry) => typeof entry === "string") : [],
@@ -22362,7 +22354,10 @@ async function runLinearCapabilityWorkflow(parent, workflow, capability, base) {
22362
22354
  ...chainData,
22363
22355
  ...result.taskState ? { taskState: result.taskState } : {},
22364
22356
  ...outcome ? { workflowLastOutcome: outcome } : {},
22365
- ...result.capabilityOutput !== void 0 ? { workflowLastOutput: result.capabilityOutput } : {},
22357
+ ...result.capabilityOutput !== void 0 ? {
22358
+ workflowLastOutput: result.capabilityOutput,
22359
+ workflowContext: mergeWorkflowContext(chainData.workflowContext, result.capabilityOutput)
22360
+ } : {},
22366
22361
  ...prUrl ? { workflowPrUrl: prUrl } : {},
22367
22362
  ...parsePrNumber5(prUrl) ? { workflowPrNumber: parsePrNumber5(prUrl) } : {}
22368
22363
  };
@@ -22429,6 +22424,7 @@ function workflowChainData(parent, capability, base, state) {
22429
22424
  workflowTitle: capability.title,
22430
22425
  workflowStepCount: capability.config.workflow?.steps.length ?? 0,
22431
22426
  workflowIssueNumber: workflowIssueNumber(parent),
22427
+ workflowContext: base.preloadedData?.workflowContext ?? workflowInputContext(parent.cliArgs),
22432
22428
  workflowFacts: state.facts,
22433
22429
  workflowEvidence: state.evidence,
22434
22430
  workflowArtifacts: state.artifacts,
@@ -22506,7 +22502,10 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
22506
22502
  ...result.taskState ? { taskState: result.taskState } : {},
22507
22503
  ...outcome ? { workflowLastOutcome: outcome } : {},
22508
22504
  ...result.capabilityResults?.at(-1) ? { workflowLastResult: result.capabilityResults.at(-1) } : {},
22509
- ...result.capabilityOutput !== void 0 ? { workflowLastOutput: result.capabilityOutput } : {},
22505
+ ...result.capabilityOutput !== void 0 ? {
22506
+ workflowLastOutput: result.capabilityOutput,
22507
+ workflowContext: mergeWorkflowContext(chainData.workflowContext, result.capabilityOutput)
22508
+ } : {},
22510
22509
  ...prUrl ? { workflowPrUrl: prUrl } : {},
22511
22510
  ...parsePrNumber5(prUrl) ? { workflowPrNumber: parsePrNumber5(prUrl) } : {}
22512
22511
  };
@@ -22647,7 +22646,7 @@ function workflowStepToJob(step, parent, chainData, cwd) {
22647
22646
  rawArgs.issue = targetNumber;
22648
22647
  }
22649
22648
  const genericInput = capabilityStepInput(
22650
- step.input ?? chainData.workflowLastOutput ?? genericInputFromArgs(rawArgs),
22649
+ step.input ?? chainData.workflowContext ?? chainData.workflowLastOutput ?? genericInputFromArgs(rawArgs),
22651
22650
  step.target,
22652
22651
  targetNumber
22653
22652
  );
@@ -22686,6 +22685,16 @@ function genericInputFromArgs(args) {
22686
22685
  }
22687
22686
  return args;
22688
22687
  }
22688
+ function workflowInputContext(args) {
22689
+ const input = genericInputFromArgs(args);
22690
+ if (input && typeof input === "object" && !Array.isArray(input)) return { ...input };
22691
+ return input === void 0 ? {} : { request: input };
22692
+ }
22693
+ function mergeWorkflowContext(current, output) {
22694
+ const context = current && typeof current === "object" && !Array.isArray(current) ? current : {};
22695
+ if (!output || typeof output !== "object" || Array.isArray(output)) return { ...context };
22696
+ return { ...context, ...output };
22697
+ }
22689
22698
  function parseGenericInput(value) {
22690
22699
  if (typeof value !== "string") return value;
22691
22700
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.504",
3
+ "version": "0.4.506",
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",