@kody-ade/kody-engine 0.4.204-next.4 → 0.4.204-next.6
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 +60 -37
- 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.
|
|
1486
|
+
version: "0.4.204-next.6",
|
|
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
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
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
|
-
|
|
8509
|
-
continue;
|
|
8510
|
+
return null;
|
|
8510
8511
|
}
|
|
8511
|
-
|
|
8512
|
-
|
|
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(
|
|
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
|
-
|
|
8525
|
-
process.stdout.write(`[jobs] \u2192
|
|
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(
|
|
8529
|
-
cliArgs: {
|
|
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]
|
|
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]
|
|
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
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
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 (!
|
|
8561
|
-
|
|
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
|
-
|
|
8575
|
-
process.stdout.write(`[jobs] \u2192
|
|
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(
|
|
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]
|
|
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]
|
|
8591
|
+
process.stderr.write(`[jobs] tick ${slug} crashed: ${msg}
|
|
8593
8592
|
`);
|
|
8594
8593
|
results.push({ slug, exitCode: 99, reason: msg });
|
|
8595
8594
|
}
|
|
@@ -15634,16 +15633,40 @@ async function runCi(argv) {
|
|
|
15634
15633
|
const eventName = process.env.GITHUB_EVENT_NAME;
|
|
15635
15634
|
const dispatchEventPath = process.env.GITHUB_EVENT_PATH;
|
|
15636
15635
|
let manualWorkflowDispatch = false;
|
|
15636
|
+
let forceRunDuty = null;
|
|
15637
15637
|
if (!args.issueNumber && !autoFallback && eventName === "workflow_dispatch" && dispatchEventPath && fs44.existsSync(dispatchEventPath)) {
|
|
15638
15638
|
try {
|
|
15639
15639
|
const evt = JSON.parse(fs44.readFileSync(dispatchEventPath, "utf-8"));
|
|
15640
15640
|
const issueInput = parseInt(String(evt?.inputs?.issue_number ?? ""), 10);
|
|
15641
15641
|
const sessionInput = String(evt?.inputs?.sessionId ?? "");
|
|
15642
|
-
|
|
15642
|
+
const exeInput = String(evt?.inputs?.executable ?? "").trim();
|
|
15643
|
+
const noTarget = !sessionInput && !(Number.isFinite(issueInput) && issueInput > 0);
|
|
15644
|
+
if (noTarget && exeInput) forceRunDuty = exeInput;
|
|
15645
|
+
else manualWorkflowDispatch = noTarget;
|
|
15643
15646
|
} catch {
|
|
15644
15647
|
manualWorkflowDispatch = false;
|
|
15645
15648
|
}
|
|
15646
15649
|
}
|
|
15650
|
+
if (forceRunDuty) {
|
|
15651
|
+
const config = earlyConfig ?? loadConfig(cwd);
|
|
15652
|
+
process.stdout.write(`\u2192 kody: manual one-shot run of duty ${forceRunDuty}
|
|
15653
|
+
|
|
15654
|
+
`);
|
|
15655
|
+
try {
|
|
15656
|
+
unpackAllSecrets();
|
|
15657
|
+
await resolveAuthToken();
|
|
15658
|
+
} catch {
|
|
15659
|
+
}
|
|
15660
|
+
const result = await runExecutableChain(forceRunDuty, {
|
|
15661
|
+
cliArgs: {},
|
|
15662
|
+
cwd,
|
|
15663
|
+
config,
|
|
15664
|
+
verbose: args.verbose,
|
|
15665
|
+
quiet: args.quiet
|
|
15666
|
+
});
|
|
15667
|
+
const ec = result.exitCode;
|
|
15668
|
+
return ec === 0 || ec === 1 || ec === 2 ? ec : 99;
|
|
15669
|
+
}
|
|
15647
15670
|
if (!args.issueNumber && !autoFallback && (eventName === "schedule" || manualWorkflowDispatch)) {
|
|
15648
15671
|
return runScheduledFanOut(cwd, args, { force: manualWorkflowDispatch });
|
|
15649
15672
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.204-next.
|
|
3
|
+
"version": "0.4.204-next.6",
|
|
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",
|