@kody-ade/kody-engine 0.4.336 → 0.4.337
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 +21 -13
- 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.
|
|
18
|
+
version: "0.4.337",
|
|
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",
|
|
@@ -15390,10 +15390,10 @@ function parseAgentFactoryBundle(raw) {
|
|
|
15390
15390
|
modelCreatorContractsUsed: value.modelCreatorContractsUsed
|
|
15391
15391
|
};
|
|
15392
15392
|
}
|
|
15393
|
-
function
|
|
15393
|
+
function buildStatePrBranchName(sourceLabel, issueNumber, title, now = Date.now()) {
|
|
15394
15394
|
const slug2 = title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48).replace(/-+$/g, "");
|
|
15395
15395
|
const suffix = slug2 ? `-${slug2}` : "";
|
|
15396
|
-
return
|
|
15396
|
+
return `${sourceLabel}/issue-${issueNumber}-${now.toString(36)}${suffix}`;
|
|
15397
15397
|
}
|
|
15398
15398
|
function normalizeBundleFiles(ctx, bundle) {
|
|
15399
15399
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -15449,6 +15449,13 @@ function requireString2(value, label) {
|
|
|
15449
15449
|
}
|
|
15450
15450
|
return value;
|
|
15451
15451
|
}
|
|
15452
|
+
function creatorSourceLabel(ctx, profileName) {
|
|
15453
|
+
const capability = typeof ctx.data.jobCapability === "string" ? ctx.data.jobCapability.trim() : "";
|
|
15454
|
+
const implementation = typeof ctx.data.jobImplementation === "string" ? ctx.data.jobImplementation.trim() : "";
|
|
15455
|
+
const executable = typeof ctx.data.jobExecutable === "string" ? ctx.data.jobExecutable.trim() : "";
|
|
15456
|
+
const profile = typeof profileName === "string" ? profileName.trim() : "";
|
|
15457
|
+
return capability || implementation || executable || profile || "agent-factory";
|
|
15458
|
+
}
|
|
15452
15459
|
function ghJson(args, cwd, input) {
|
|
15453
15460
|
const raw = gh(args, input === void 0 ? { cwd } : { cwd, input: JSON.stringify(input) });
|
|
15454
15461
|
if (!raw) return {};
|
|
@@ -15460,10 +15467,10 @@ function ghJson(args, cwd, input) {
|
|
|
15460
15467
|
);
|
|
15461
15468
|
}
|
|
15462
15469
|
}
|
|
15463
|
-
function renderPullRequestBody(ctx, bundle, files) {
|
|
15470
|
+
function renderPullRequestBody(ctx, bundle, files, sourceLabel) {
|
|
15464
15471
|
const issueNumber = readIssueNumber(ctx);
|
|
15465
15472
|
return [
|
|
15466
|
-
|
|
15473
|
+
`${sourceLabel} generated Kody agency model changes for review.`,
|
|
15467
15474
|
"",
|
|
15468
15475
|
`Source issue: ${ctx.config.github.owner}/${ctx.config.github.repo}#${issueNumber}`,
|
|
15469
15476
|
"",
|
|
@@ -15478,9 +15485,9 @@ function renderPullRequestBody(ctx, bundle, files) {
|
|
|
15478
15485
|
"Generated definitions are inactive until this state-repo PR is reviewed and merged."
|
|
15479
15486
|
].join("\n");
|
|
15480
15487
|
}
|
|
15481
|
-
function renderIssueComment(owner, repo, prUrl, bundle) {
|
|
15488
|
+
function renderIssueComment(owner, repo, prUrl, bundle, sourceLabel) {
|
|
15482
15489
|
return [
|
|
15483
|
-
|
|
15490
|
+
`${sourceLabel} opened a state-repo review PR: ${prUrl}`,
|
|
15484
15491
|
"",
|
|
15485
15492
|
`State repo: ${owner}/${repo}`,
|
|
15486
15493
|
"",
|
|
@@ -15494,7 +15501,7 @@ var init_openAgentFactoryStatePr = __esm({
|
|
|
15494
15501
|
"use strict";
|
|
15495
15502
|
init_issue();
|
|
15496
15503
|
init_stateRepo();
|
|
15497
|
-
openAgentFactoryStatePr = async (ctx,
|
|
15504
|
+
openAgentFactoryStatePr = async (ctx, profile, agentResult) => {
|
|
15498
15505
|
if (agentResult?.outcome !== "completed") {
|
|
15499
15506
|
throw new Error(`openAgentFactoryStatePr: agent did not complete: ${agentResult?.error ?? "unknown failure"}`);
|
|
15500
15507
|
}
|
|
@@ -15505,11 +15512,12 @@ var init_openAgentFactoryStatePr = __esm({
|
|
|
15505
15512
|
throw new Error("openAgentFactoryStatePr: config.state.repo and config.state.path are required");
|
|
15506
15513
|
}
|
|
15507
15514
|
const issueNumber = readIssueNumber(ctx);
|
|
15515
|
+
const sourceLabel = creatorSourceLabel(ctx, profile.name);
|
|
15508
15516
|
const bundle = parseAgentFactoryBundle(String(ctx.data.prSummary ?? ""));
|
|
15509
15517
|
const normalizedFiles = normalizeBundleFiles(ctx, bundle);
|
|
15510
15518
|
const stateRepo = parseStateRepo(ctx.config);
|
|
15511
15519
|
const baseBranch = "main";
|
|
15512
|
-
const branch =
|
|
15520
|
+
const branch = buildStatePrBranchName(sourceLabel, issueNumber, bundle.title);
|
|
15513
15521
|
const baseRef = ghJson(
|
|
15514
15522
|
["api", `/repos/${stateRepo.owner}/${stateRepo.repo}/git/ref/heads/${baseBranch}`],
|
|
15515
15523
|
ctx.cwd
|
|
@@ -15548,7 +15556,7 @@ var init_openAgentFactoryStatePr = __esm({
|
|
|
15548
15556
|
["api", "--method", "POST", `/repos/${stateRepo.owner}/${stateRepo.repo}/git/commits`, "--input", "-"],
|
|
15549
15557
|
ctx.cwd,
|
|
15550
15558
|
{
|
|
15551
|
-
message:
|
|
15559
|
+
message: `${sourceLabel}: ${bundle.title}`,
|
|
15552
15560
|
tree: treeSha,
|
|
15553
15561
|
parents: [baseSha]
|
|
15554
15562
|
}
|
|
@@ -15573,16 +15581,16 @@ var init_openAgentFactoryStatePr = __esm({
|
|
|
15573
15581
|
["api", "--method", "POST", `/repos/${stateRepo.owner}/${stateRepo.repo}/pulls`, "--input", "-"],
|
|
15574
15582
|
ctx.cwd,
|
|
15575
15583
|
{
|
|
15576
|
-
title:
|
|
15584
|
+
title: `${sourceLabel}: ${bundle.title}`,
|
|
15577
15585
|
head: branch,
|
|
15578
15586
|
base: baseBranch,
|
|
15579
|
-
body: renderPullRequestBody(ctx, bundle, normalizedFiles)
|
|
15587
|
+
body: renderPullRequestBody(ctx, bundle, normalizedFiles, sourceLabel)
|
|
15580
15588
|
}
|
|
15581
15589
|
);
|
|
15582
15590
|
const prUrl = requireString2(pr.html_url, "created pull request url");
|
|
15583
15591
|
gh(["issue", "comment", String(issueNumber), "--body-file", "-"], {
|
|
15584
15592
|
cwd: ctx.cwd,
|
|
15585
|
-
input: renderIssueComment(stateRepo.owner, stateRepo.repo, prUrl, bundle)
|
|
15593
|
+
input: renderIssueComment(stateRepo.owner, stateRepo.repo, prUrl, bundle, sourceLabel)
|
|
15586
15594
|
});
|
|
15587
15595
|
ctx.data.agentFactoryStatePr = {
|
|
15588
15596
|
repo: `${stateRepo.owner}/${stateRepo.repo}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.337",
|
|
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",
|