@kody-ade/kody-engine 0.3.5 → 0.3.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
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@kody-ade/kody-engine",
|
|
6
|
-
version: "0.3.
|
|
6
|
+
version: "0.3.6",
|
|
7
7
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
8
8
|
license: "MIT",
|
|
9
9
|
type: "module",
|
|
@@ -4159,6 +4159,13 @@ REVIEW_POSTED=https://github.com/${ctx.config.github.owner}/${ctx.config.github.
|
|
|
4159
4159
|
import { execFileSync as execFileSync15, spawnSync } from "child_process";
|
|
4160
4160
|
import * as fs18 from "fs";
|
|
4161
4161
|
import * as path16 from "path";
|
|
4162
|
+
function notifyIssue(issueNumber, body, cwd) {
|
|
4163
|
+
if (!issueNumber || issueNumber <= 0) return;
|
|
4164
|
+
try {
|
|
4165
|
+
postIssueComment(issueNumber, body, cwd);
|
|
4166
|
+
} catch {
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4162
4169
|
function bumpVersion(current, bump) {
|
|
4163
4170
|
const m = current.match(/^(\d+)\.(\d+)\.(\d+)(.*)$/);
|
|
4164
4171
|
if (!m) throw new Error(`cannot parse version '${current}' (expected x.y.z[-suffix])`);
|
|
@@ -4275,6 +4282,7 @@ var releaseFlow = async (ctx) => {
|
|
|
4275
4282
|
const mode = ctx.args.mode ?? "prepare";
|
|
4276
4283
|
const bump = ctx.args.bump ?? "patch";
|
|
4277
4284
|
const dryRun = ctx.args["dry-run"] === true || ctx.args.dryRun === true;
|
|
4285
|
+
const issueNumber = typeof ctx.args.issue === "number" ? ctx.args.issue : void 0;
|
|
4278
4286
|
const cwd = ctx.cwd;
|
|
4279
4287
|
const releaseCfg = ctx.config.release ?? {};
|
|
4280
4288
|
const versionFiles = releaseCfg.versionFiles && releaseCfg.versionFiles.length > 0 ? releaseCfg.versionFiles : ["package.json"];
|
|
@@ -4282,15 +4290,34 @@ var releaseFlow = async (ctx) => {
|
|
|
4282
4290
|
ctx.skipAgent = true;
|
|
4283
4291
|
if (mode === "prepare") {
|
|
4284
4292
|
await runPrepare({ cwd, bump, dryRun, versionFiles, ctx });
|
|
4285
|
-
|
|
4286
|
-
}
|
|
4287
|
-
if (mode === "finalize") {
|
|
4293
|
+
} else if (mode === "finalize") {
|
|
4288
4294
|
await runFinalize({ cwd, dryRun, timeoutMs, releaseCfg, ctx });
|
|
4289
|
-
|
|
4295
|
+
} else {
|
|
4296
|
+
ctx.output.exitCode = 64;
|
|
4297
|
+
ctx.output.reason = `release: unknown mode '${mode}'`;
|
|
4290
4298
|
}
|
|
4291
|
-
ctx
|
|
4292
|
-
ctx.output.reason = `release: unknown mode '${mode}'`;
|
|
4299
|
+
notifyIssue(issueNumber, buildIssueNotice(mode, dryRun, ctx), cwd);
|
|
4293
4300
|
};
|
|
4301
|
+
function buildIssueNotice(mode, dryRun, ctx) {
|
|
4302
|
+
const exit = ctx.output.exitCode ?? 0;
|
|
4303
|
+
const url = ctx.output.prUrl;
|
|
4304
|
+
const reason = ctx.output.reason;
|
|
4305
|
+
const label = mode === "finalize" ? "release finalize" : mode === "prepare" ? "release prepare" : `release ${mode}`;
|
|
4306
|
+
if (exit !== 0) {
|
|
4307
|
+
const suffix = url ? ` \u2014 ${url}` : "";
|
|
4308
|
+
return `\u26A0\uFE0F kody ${label} failed: ${truncate2(reason ?? "unknown error", 1500)}${suffix}`;
|
|
4309
|
+
}
|
|
4310
|
+
if (dryRun) {
|
|
4311
|
+
return `\u2139\uFE0F kody ${label} (dry-run): ${reason ?? "plan printed, no changes applied"}`;
|
|
4312
|
+
}
|
|
4313
|
+
if (mode === "prepare") {
|
|
4314
|
+
return url ? `\u2705 kody release PR opened: ${url}` : "\u2705 kody release prepared";
|
|
4315
|
+
}
|
|
4316
|
+
if (mode === "finalize") {
|
|
4317
|
+
return url ? `\u2705 kody release published: ${url}` : "\u2705 kody release finalized (tag pushed)";
|
|
4318
|
+
}
|
|
4319
|
+
return `\u2705 kody ${label} complete`;
|
|
4320
|
+
}
|
|
4294
4321
|
async function runPrepare(args) {
|
|
4295
4322
|
const { cwd, bump, dryRun, versionFiles, ctx } = args;
|
|
4296
4323
|
const pkgPath = path16.join(cwd, "package.json");
|
|
@@ -33,6 +33,13 @@
|
|
|
33
33
|
"type": "bool",
|
|
34
34
|
"required": false,
|
|
35
35
|
"describe": "Print plan without writing files, creating PRs, tagging, or publishing."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "issue",
|
|
39
|
+
"flag": "--issue",
|
|
40
|
+
"type": "int",
|
|
41
|
+
"required": false,
|
|
42
|
+
"describe": "Issue number to post success/failure follow-up on. Auto-populated by dispatch when triggered via @kody comment."
|
|
36
43
|
}
|
|
37
44
|
],
|
|
38
45
|
"claudeCode": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.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",
|