@kody-ade/kody-engine 0.4.204-next.4 → 0.4.204-next.5

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 +35 -36
  2. package/package.json +1 -1
package/dist/bin/kody.js CHANGED
@@ -1483,7 +1483,7 @@ var init_loadCoverageRules = __esm({
1483
1483
  // package.json
1484
1484
  var package_default = {
1485
1485
  name: "@kody-ade/kody-engine",
1486
- version: "0.4.204-next.4",
1486
+ version: "0.4.204-next.5",
1487
1487
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
1488
1488
  license: "MIT",
1489
1489
  type: "module",
@@ -8500,33 +8500,38 @@ var dispatchJobFileTicks = async (ctx, _profile, args) => {
8500
8500
  `);
8501
8501
  const results = [];
8502
8502
  const now = Date.now();
8503
- for (const slug of slugs) {
8504
- const frontmatter = readJobFrontmatter(ctx.cwd, jobsDir, slug);
8505
- if (frontmatter.disabled === true) {
8506
- process.stdout.write(`[jobs] \u23ED skip ${slug}: disabled in frontmatter
8503
+ const scheduledDuties = listFolderDutySlugs(path29.join(ctx.cwd, jobsDir)).map((slug) => {
8504
+ try {
8505
+ const p = loadProfile(path29.join(ctx.cwd, jobsDir, slug, "profile.json"));
8506
+ return { slug, every: p.every, staff: p.staff };
8507
+ } catch (err) {
8508
+ process.stderr.write(`[jobs] \u23ED skip folder-duty ${slug}: profile load failed: ${String(err)}
8507
8509
  `);
8508
- results.push({ slug, exitCode: 0, skipped: true, reason: "disabled" });
8509
- continue;
8510
+ return null;
8510
8511
  }
8511
- if (!frontmatter.staff || frontmatter.staff.trim().length === 0) {
8512
- process.stderr.write(`[jobs] \u23ED skip ${slug}: no staff assigned (add 'staff: <slug>' frontmatter)
8512
+ }).filter((d) => d !== null && Boolean(d.every));
8513
+ process.stdout.write(`[jobs] ${scheduledDuties.length} scheduled folder-dut(y/ies) to consider
8514
+ `);
8515
+ for (const { slug, every, staff } of scheduledDuties) {
8516
+ if (!staff || staff.trim().length === 0) {
8517
+ process.stderr.write(`[jobs] \u23ED skip ${slug}: scheduled duty has no staff
8513
8518
  `);
8514
8519
  results.push({ slug, exitCode: 0, skipped: true, reason: "no staff assigned" });
8515
8520
  continue;
8516
8521
  }
8517
- const decision = await decideShouldFire(frontmatter.every, slug, backend, now);
8522
+ const decision = await decideShouldFire(every, slug, backend, now);
8518
8523
  if (decision.skip) {
8519
8524
  process.stdout.write(`[jobs] \u23ED skip ${slug}: ${decision.reason}
8520
8525
  `);
8521
8526
  results.push({ slug, exitCode: 0, skipped: true, reason: decision.reason });
8522
8527
  continue;
8523
8528
  }
8524
- const slugTarget = frontmatter.tickScript ? scriptedExecutable : targetExecutable;
8525
- process.stdout.write(`[jobs] \u2192 tick ${slug} (${slugTarget})
8529
+ await stampFired(backend, slug, now);
8530
+ process.stdout.write(`[jobs] \u2192 run scheduled duty ${slug} (one-shot, as ${staff})
8526
8531
  `);
8527
8532
  try {
8528
- const out = await runExecutable(slugTarget, {
8529
- cliArgs: { [slugArg]: slug },
8533
+ const out = await runExecutable(slug, {
8534
+ cliArgs: {},
8530
8535
  cwd: ctx.cwd,
8531
8536
  config: ctx.config,
8532
8537
  verbose: ctx.verbose,
@@ -8534,49 +8539,43 @@ var dispatchJobFileTicks = async (ctx, _profile, args) => {
8534
8539
  });
8535
8540
  results.push({ slug, exitCode: out.exitCode, reason: out.reason });
8536
8541
  if (out.exitCode !== 0) {
8537
- process.stderr.write(`[jobs] tick ${slug} failed (exit ${out.exitCode}): ${out.reason ?? ""}
8542
+ process.stderr.write(`[jobs] scheduled duty ${slug} failed (exit ${out.exitCode}): ${out.reason ?? ""}
8538
8543
  `);
8539
8544
  }
8540
8545
  } catch (err) {
8541
8546
  const msg = err instanceof Error ? err.message : String(err);
8542
- process.stderr.write(`[jobs] tick ${slug} crashed: ${msg}
8547
+ process.stderr.write(`[jobs] scheduled duty ${slug} crashed: ${msg}
8543
8548
  `);
8544
8549
  results.push({ slug, exitCode: 99, reason: msg });
8545
8550
  }
8546
8551
  }
8547
- const folderSlugs = listFolderDutySlugs(path29.join(ctx.cwd, jobsDir));
8548
- for (const slug of folderSlugs) {
8549
- let every;
8550
- let staff;
8551
- try {
8552
- const profile = loadProfile(path29.join(ctx.cwd, jobsDir, slug, "profile.json"));
8553
- every = profile.every;
8554
- staff = profile.staff;
8555
- } catch (err) {
8556
- process.stderr.write(`[jobs] \u23ED skip folder-duty ${slug}: profile load failed: ${String(err)}
8552
+ for (const slug of slugs) {
8553
+ const frontmatter = readJobFrontmatter(ctx.cwd, jobsDir, slug);
8554
+ if (frontmatter.disabled === true) {
8555
+ process.stdout.write(`[jobs] \u23ED skip ${slug}: disabled in frontmatter
8557
8556
  `);
8557
+ results.push({ slug, exitCode: 0, skipped: true, reason: "disabled" });
8558
8558
  continue;
8559
8559
  }
8560
- if (!every) continue;
8561
- if (!staff || staff.trim().length === 0) {
8562
- process.stderr.write(`[jobs] \u23ED skip ${slug}: scheduled duty has no staff
8560
+ if (!frontmatter.staff || frontmatter.staff.trim().length === 0) {
8561
+ process.stderr.write(`[jobs] \u23ED skip ${slug}: no staff assigned (add 'staff: <slug>' frontmatter)
8563
8562
  `);
8564
8563
  results.push({ slug, exitCode: 0, skipped: true, reason: "no staff assigned" });
8565
8564
  continue;
8566
8565
  }
8567
- const decision = await decideShouldFire(every, slug, backend, now);
8566
+ const decision = await decideShouldFire(frontmatter.every, slug, backend, now);
8568
8567
  if (decision.skip) {
8569
8568
  process.stdout.write(`[jobs] \u23ED skip ${slug}: ${decision.reason}
8570
8569
  `);
8571
8570
  results.push({ slug, exitCode: 0, skipped: true, reason: decision.reason });
8572
8571
  continue;
8573
8572
  }
8574
- await stampFired(backend, slug, now);
8575
- process.stdout.write(`[jobs] \u2192 run scheduled duty ${slug} (one-shot, as ${staff})
8573
+ const slugTarget = frontmatter.tickScript ? scriptedExecutable : targetExecutable;
8574
+ process.stdout.write(`[jobs] \u2192 tick ${slug} (${slugTarget})
8576
8575
  `);
8577
8576
  try {
8578
- const out = await runExecutable(slug, {
8579
- cliArgs: {},
8577
+ const out = await runExecutable(slugTarget, {
8578
+ cliArgs: { [slugArg]: slug },
8580
8579
  cwd: ctx.cwd,
8581
8580
  config: ctx.config,
8582
8581
  verbose: ctx.verbose,
@@ -8584,12 +8583,12 @@ var dispatchJobFileTicks = async (ctx, _profile, args) => {
8584
8583
  });
8585
8584
  results.push({ slug, exitCode: out.exitCode, reason: out.reason });
8586
8585
  if (out.exitCode !== 0) {
8587
- process.stderr.write(`[jobs] scheduled duty ${slug} failed (exit ${out.exitCode}): ${out.reason ?? ""}
8586
+ process.stderr.write(`[jobs] tick ${slug} failed (exit ${out.exitCode}): ${out.reason ?? ""}
8588
8587
  `);
8589
8588
  }
8590
8589
  } catch (err) {
8591
8590
  const msg = err instanceof Error ? err.message : String(err);
8592
- process.stderr.write(`[jobs] scheduled duty ${slug} crashed: ${msg}
8591
+ process.stderr.write(`[jobs] tick ${slug} crashed: ${msg}
8593
8592
  `);
8594
8593
  results.push({ slug, exitCode: 99, reason: msg });
8595
8594
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.204-next.4",
3
+ "version": "0.4.204-next.5",
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",