@kody-ade/kody-engine 0.4.502 → 0.4.503
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
|
@@ -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.503",
|
|
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",
|
|
@@ -15648,6 +15648,8 @@ var init_loadQaContext = __esm({
|
|
|
15648
15648
|
// src/scripts/loadSimpleCapability.ts
|
|
15649
15649
|
import * as fs43 from "fs";
|
|
15650
15650
|
import * as path40 from "path";
|
|
15651
|
+
import * as os6 from "os";
|
|
15652
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
15651
15653
|
function registerCapabilitySubagents(profile, toolRoot, toolFiles) {
|
|
15652
15654
|
const subagentFiles = toolFiles.flatMap((file) => {
|
|
15653
15655
|
const match = /^agents\/([a-z][a-z0-9-]{0,63})\.md$/.exec(file);
|
|
@@ -15754,9 +15756,12 @@ var init_loadSimpleCapability = __esm({
|
|
|
15754
15756
|
if (capability.config.outputSchema) {
|
|
15755
15757
|
ctx.data.capabilityOutputSchema = capability.config.outputSchema;
|
|
15756
15758
|
}
|
|
15759
|
+
const outputPath = ctx.data.capabilityExecution === "agent" && capability.config.outputSchema ? path40.join(os6.tmpdir(), `kody-capability-output-${randomUUID2()}.json`) : void 0;
|
|
15760
|
+
if (outputPath) ctx.data.capabilityOutputPath = outputPath;
|
|
15757
15761
|
ctx.data.capabilityEnvironment = {
|
|
15758
15762
|
...capabilityInputEnvironment(input),
|
|
15759
|
-
...capabilityConfigEnvironment(ctx.config)
|
|
15763
|
+
...capabilityConfigEnvironment(ctx.config),
|
|
15764
|
+
...outputPath ? { KODY_CAPABILITY_OUTPUT: outputPath } : {}
|
|
15760
15765
|
};
|
|
15761
15766
|
ctx.data.prompt = [
|
|
15762
15767
|
capability.rawBody.trim(),
|
|
@@ -15793,7 +15798,13 @@ var init_loadSimpleCapability = __esm({
|
|
|
15793
15798
|
"",
|
|
15794
15799
|
"```json",
|
|
15795
15800
|
JSON.stringify(capability.config.outputSchema, null, 2),
|
|
15796
|
-
"```"
|
|
15801
|
+
"```",
|
|
15802
|
+
...outputPath ? [
|
|
15803
|
+
"",
|
|
15804
|
+
"Write the final JSON value to this file before your final response:",
|
|
15805
|
+
outputPath,
|
|
15806
|
+
"The Engine reads this file as the authoritative result. Do not write markdown to it."
|
|
15807
|
+
] : []
|
|
15797
15808
|
] : ["Return one JSON value."]
|
|
15798
15809
|
].join("\n");
|
|
15799
15810
|
};
|
|
@@ -16741,6 +16752,15 @@ var init_parseReproOutput = __esm({
|
|
|
16741
16752
|
});
|
|
16742
16753
|
|
|
16743
16754
|
// src/scripts/parseSimpleCapabilityOutput.ts
|
|
16755
|
+
import * as fs45 from "fs";
|
|
16756
|
+
function readOutputFile(outputPath) {
|
|
16757
|
+
if (!outputPath || !fs45.existsSync(outputPath)) return { found: false };
|
|
16758
|
+
try {
|
|
16759
|
+
return { found: true, value: JSON.parse(fs45.readFileSync(outputPath, "utf-8")) };
|
|
16760
|
+
} finally {
|
|
16761
|
+
fs45.rmSync(outputPath, { force: true });
|
|
16762
|
+
}
|
|
16763
|
+
}
|
|
16744
16764
|
function parseOutput(text2) {
|
|
16745
16765
|
if (!text2) return void 0;
|
|
16746
16766
|
try {
|
|
@@ -16780,7 +16800,9 @@ var init_parseSimpleCapabilityOutput = __esm({
|
|
|
16780
16800
|
init_capability_contract_validation();
|
|
16781
16801
|
init_capabilityResult();
|
|
16782
16802
|
parseSimpleCapabilityOutput = async (ctx, _profile, agentResult) => {
|
|
16783
|
-
const
|
|
16803
|
+
const outputPath = typeof ctx.data.capabilityOutputPath === "string" ? ctx.data.capabilityOutputPath : void 0;
|
|
16804
|
+
const fileOutput = readOutputFile(outputPath);
|
|
16805
|
+
const output = fileOutput.found ? fileOutput.value : Object.hasOwn(ctx.data, "capabilityScriptOutput") ? ctx.data.capabilityScriptOutput : parseOutput(agentResult?.finalText);
|
|
16784
16806
|
if (output === void 0) {
|
|
16785
16807
|
const reason2 = agentResult?.outcomeKind === "out_of_turns" ? "Capability execution limit reached" : "Capability execution ended before returning a result";
|
|
16786
16808
|
const blocked = {
|
|
@@ -17322,8 +17344,8 @@ var init_postResearchComment = __esm({
|
|
|
17322
17344
|
});
|
|
17323
17345
|
|
|
17324
17346
|
// src/scripts/prepareBrowserAuth.ts
|
|
17325
|
-
import * as
|
|
17326
|
-
import * as
|
|
17347
|
+
import * as fs46 from "fs";
|
|
17348
|
+
import * as os7 from "os";
|
|
17327
17349
|
import * as path42 from "path";
|
|
17328
17350
|
function appendAuthMessage(ctx, message) {
|
|
17329
17351
|
const current = typeof ctx.data.qaAuthBlock === "string" ? ctx.data.qaAuthBlock.trim() : "";
|
|
@@ -17363,8 +17385,8 @@ async function githubJson(url, token) {
|
|
|
17363
17385
|
return await response.json();
|
|
17364
17386
|
}
|
|
17365
17387
|
function writeKodyStorageState(input) {
|
|
17366
|
-
const directory =
|
|
17367
|
-
|
|
17388
|
+
const directory = fs46.mkdtempSync(path42.join(os7.tmpdir(), "kody-browser-auth-"));
|
|
17389
|
+
fs46.chmodSync(directory, 448);
|
|
17368
17390
|
const file = path42.join(directory, "storage-state.json");
|
|
17369
17391
|
const now = Date.now();
|
|
17370
17392
|
const repoEntry = {
|
|
@@ -17395,7 +17417,7 @@ function writeKodyStorageState(input) {
|
|
|
17395
17417
|
}
|
|
17396
17418
|
]
|
|
17397
17419
|
};
|
|
17398
|
-
|
|
17420
|
+
fs46.writeFileSync(file, JSON.stringify(storageState), { mode: 384 });
|
|
17399
17421
|
return { directory, file };
|
|
17400
17422
|
}
|
|
17401
17423
|
function configurePlaywright(profile, storageStatePath) {
|
|
@@ -17477,7 +17499,7 @@ async function prepareMethod(ctx, profile, method) {
|
|
|
17477
17499
|
configurePlaywright(profile, state.file);
|
|
17478
17500
|
const authDirectory = state.directory;
|
|
17479
17501
|
registerRuntimeCleanup(ctx, () => {
|
|
17480
|
-
|
|
17502
|
+
fs46.rmSync(authDirectory, { recursive: true, force: true });
|
|
17481
17503
|
});
|
|
17482
17504
|
appendAuthMessage(
|
|
17483
17505
|
ctx,
|
|
@@ -17485,7 +17507,7 @@ async function prepareMethod(ctx, profile, method) {
|
|
|
17485
17507
|
);
|
|
17486
17508
|
return true;
|
|
17487
17509
|
} catch (error) {
|
|
17488
|
-
if (state)
|
|
17510
|
+
if (state) fs46.rmSync(state.directory, { recursive: true, force: true });
|
|
17489
17511
|
const reason = error instanceof Error ? error.message : String(error);
|
|
17490
17512
|
appendAuthMessage(
|
|
17491
17513
|
ctx,
|
|
@@ -19161,7 +19183,7 @@ var init_tickShellRunner = __esm({
|
|
|
19161
19183
|
});
|
|
19162
19184
|
|
|
19163
19185
|
// src/scripts/runScheduledImplementationTick.ts
|
|
19164
|
-
import * as
|
|
19186
|
+
import * as fs47 from "fs";
|
|
19165
19187
|
import * as path44 from "path";
|
|
19166
19188
|
var runScheduledImplementationTick;
|
|
19167
19189
|
var init_runScheduledImplementationTick = __esm({
|
|
@@ -19190,7 +19212,7 @@ var init_runScheduledImplementationTick = __esm({
|
|
|
19190
19212
|
return;
|
|
19191
19213
|
}
|
|
19192
19214
|
const shellPath = path44.join(profile.dir, shell);
|
|
19193
|
-
if (!
|
|
19215
|
+
if (!fs47.existsSync(shellPath)) {
|
|
19194
19216
|
ctx.output.exitCode = 99;
|
|
19195
19217
|
ctx.output.reason = `runScheduledImplementationTick: shell not found: ${shell} (looked in ${profile.dir})`;
|
|
19196
19218
|
return;
|
|
@@ -19222,13 +19244,13 @@ var init_runScheduledImplementationTick = __esm({
|
|
|
19222
19244
|
|
|
19223
19245
|
// src/scripts/runSimpleCapabilityScript.ts
|
|
19224
19246
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
19225
|
-
import * as
|
|
19247
|
+
import * as fs48 from "fs";
|
|
19226
19248
|
function formatDuration2(timeoutMs) {
|
|
19227
19249
|
return timeoutMs % 6e4 === 0 ? `${timeoutMs / 6e4} minutes` : `${timeoutMs}ms`;
|
|
19228
19250
|
}
|
|
19229
19251
|
function isRegularFile2(filePath) {
|
|
19230
19252
|
try {
|
|
19231
|
-
const stat =
|
|
19253
|
+
const stat = fs48.lstatSync(filePath);
|
|
19232
19254
|
return stat.isFile() && !stat.isSymbolicLink();
|
|
19233
19255
|
} catch {
|
|
19234
19256
|
return false;
|
|
@@ -19307,7 +19329,7 @@ var init_runSimpleCapabilityScript = __esm({
|
|
|
19307
19329
|
});
|
|
19308
19330
|
|
|
19309
19331
|
// src/scripts/runTickScript.ts
|
|
19310
|
-
import * as
|
|
19332
|
+
import * as fs49 from "fs";
|
|
19311
19333
|
import * as path45 from "path";
|
|
19312
19334
|
var runTickScript;
|
|
19313
19335
|
var init_runTickScript = __esm({
|
|
@@ -19341,7 +19363,7 @@ var init_runTickScript = __esm({
|
|
|
19341
19363
|
return;
|
|
19342
19364
|
}
|
|
19343
19365
|
const scriptPath = path45.isAbsolute(tickScript) ? tickScript : path45.join(ctx.cwd, tickScript);
|
|
19344
|
-
if (!
|
|
19366
|
+
if (!fs49.existsSync(scriptPath)) {
|
|
19345
19367
|
ctx.output.exitCode = 99;
|
|
19346
19368
|
ctx.output.reason = `runTickScript: tickScript not found: ${scriptPath}`;
|
|
19347
19369
|
return;
|
|
@@ -20385,7 +20407,7 @@ var init_warmupMcp = __esm({
|
|
|
20385
20407
|
});
|
|
20386
20408
|
|
|
20387
20409
|
// src/scripts/writeAgentRunSummary.ts
|
|
20388
|
-
import * as
|
|
20410
|
+
import * as fs50 from "fs";
|
|
20389
20411
|
var writeAgentRunSummary;
|
|
20390
20412
|
var init_writeAgentRunSummary = __esm({
|
|
20391
20413
|
"src/scripts/writeAgentRunSummary.ts"() {
|
|
@@ -20411,7 +20433,7 @@ var init_writeAgentRunSummary = __esm({
|
|
|
20411
20433
|
if (reason) lines.push(`- **Reason:** ${reason}`);
|
|
20412
20434
|
lines.push("");
|
|
20413
20435
|
try {
|
|
20414
|
-
|
|
20436
|
+
fs50.appendFileSync(summaryPath, `${lines.join("\n")}
|
|
20415
20437
|
`);
|
|
20416
20438
|
} catch {
|
|
20417
20439
|
}
|
|
@@ -20747,7 +20769,7 @@ var init_scripts = __esm({
|
|
|
20747
20769
|
});
|
|
20748
20770
|
|
|
20749
20771
|
// src/stateWorkspace.ts
|
|
20750
|
-
import * as
|
|
20772
|
+
import * as fs51 from "fs";
|
|
20751
20773
|
import * as path47 from "path";
|
|
20752
20774
|
function tenantId(config) {
|
|
20753
20775
|
const owner = config.github?.owner?.trim() || process.env.GITHUB_REPOSITORY?.split("/")[0]?.trim();
|
|
@@ -20756,8 +20778,8 @@ function tenantId(config) {
|
|
|
20756
20778
|
}
|
|
20757
20779
|
function writeRuntimeFile(cwd, relativePath, content) {
|
|
20758
20780
|
const target = path47.join(cwd, RUNTIME_ROOT, relativePath);
|
|
20759
|
-
|
|
20760
|
-
|
|
20781
|
+
fs51.mkdirSync(path47.dirname(target), { recursive: true });
|
|
20782
|
+
fs51.writeFileSync(target, content, "utf8");
|
|
20761
20783
|
}
|
|
20762
20784
|
function record(value) {
|
|
20763
20785
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -20826,7 +20848,7 @@ async function hydrateStateWorkspace(config, cwd, backendOverride) {
|
|
|
20826
20848
|
if (hydratedWorkspaces.has(key)) return;
|
|
20827
20849
|
const backend = backendOverride ?? createStateBackendFromEnv();
|
|
20828
20850
|
const root = path47.join(cwd, RUNTIME_ROOT);
|
|
20829
|
-
|
|
20851
|
+
fs51.rmSync(root, { recursive: true, force: true });
|
|
20830
20852
|
await Promise.all([
|
|
20831
20853
|
hydratePrefix(backend, tenant, cwd, "context:"),
|
|
20832
20854
|
hydratePrefix(backend, tenant, cwd, "memory:"),
|
|
@@ -20913,8 +20935,8 @@ var init_tools = __esm({
|
|
|
20913
20935
|
|
|
20914
20936
|
// src/executor.ts
|
|
20915
20937
|
import { spawn as spawn8 } from "child_process";
|
|
20916
|
-
import * as
|
|
20917
|
-
import * as
|
|
20938
|
+
import * as fs52 from "fs";
|
|
20939
|
+
import * as os8 from "os";
|
|
20918
20940
|
import * as path48 from "path";
|
|
20919
20941
|
function isMutatingPostflight(scriptName) {
|
|
20920
20942
|
return MUTATING_POSTFLIGHTS.has(scriptName ?? "");
|
|
@@ -21655,7 +21677,7 @@ function resolveProfilePath(profileName, cwd = process.cwd()) {
|
|
|
21655
21677
|
// fallback
|
|
21656
21678
|
];
|
|
21657
21679
|
for (const c of candidates) {
|
|
21658
|
-
if (
|
|
21680
|
+
if (fs52.existsSync(c)) return c;
|
|
21659
21681
|
}
|
|
21660
21682
|
return candidates[0];
|
|
21661
21683
|
}
|
|
@@ -21771,7 +21793,7 @@ function resolveShellTimeoutMs(entry) {
|
|
|
21771
21793
|
async function runShellEntry(entry, ctx, profile) {
|
|
21772
21794
|
const shellName = entry.shell;
|
|
21773
21795
|
const shellPath = path48.join(profile.dir, shellName);
|
|
21774
|
-
if (!
|
|
21796
|
+
if (!fs52.existsSync(shellPath)) {
|
|
21775
21797
|
ctx.skipAgent = true;
|
|
21776
21798
|
ctx.output.exitCode = 99;
|
|
21777
21799
|
ctx.output.reason = `shell script not found: ${shellName} (looked in ${profile.dir})`;
|
|
@@ -21779,7 +21801,7 @@ async function runShellEntry(entry, ctx, profile) {
|
|
|
21779
21801
|
}
|
|
21780
21802
|
const positional = entry.with ? Object.values(entry.with).map((v) => String(v)) : [];
|
|
21781
21803
|
const outputFile = path48.join(
|
|
21782
|
-
|
|
21804
|
+
os8.tmpdir(),
|
|
21783
21805
|
`kody-shell-output-${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`
|
|
21784
21806
|
);
|
|
21785
21807
|
const env = { ...process.env, HUSKY: "0", SKIP_HOOKS: "1", KODY_OUTPUT: outputFile };
|
|
@@ -21845,9 +21867,9 @@ async function runShellEntry(entry, ctx, profile) {
|
|
|
21845
21867
|
}
|
|
21846
21868
|
let sideChannelText = "";
|
|
21847
21869
|
try {
|
|
21848
|
-
if (
|
|
21849
|
-
sideChannelText =
|
|
21850
|
-
|
|
21870
|
+
if (fs52.existsSync(outputFile)) {
|
|
21871
|
+
sideChannelText = fs52.readFileSync(outputFile, "utf-8");
|
|
21872
|
+
fs52.rmSync(outputFile, { force: true });
|
|
21851
21873
|
}
|
|
21852
21874
|
} catch {
|
|
21853
21875
|
}
|
|
@@ -24143,7 +24165,7 @@ async function hydrateDefinitionsFromEnv(cwd = process.cwd(), env = process.env)
|
|
|
24143
24165
|
|
|
24144
24166
|
// src/kody-cli.ts
|
|
24145
24167
|
import { execFileSync as execFileSync24 } from "child_process";
|
|
24146
|
-
import * as
|
|
24168
|
+
import * as fs53 from "fs";
|
|
24147
24169
|
import * as path49 from "path";
|
|
24148
24170
|
|
|
24149
24171
|
// src/app-auth.ts
|
|
@@ -24940,9 +24962,9 @@ async function resolveAuthToken(env = process.env) {
|
|
|
24940
24962
|
return void 0;
|
|
24941
24963
|
}
|
|
24942
24964
|
function detectPackageManager2(cwd) {
|
|
24943
|
-
if (
|
|
24944
|
-
if (
|
|
24945
|
-
if (
|
|
24965
|
+
if (fs53.existsSync(path49.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
24966
|
+
if (fs53.existsSync(path49.join(cwd, "yarn.lock"))) return "yarn";
|
|
24967
|
+
if (fs53.existsSync(path49.join(cwd, "bun.lockb"))) return "bun";
|
|
24946
24968
|
return "npm";
|
|
24947
24969
|
}
|
|
24948
24970
|
function shouldChainScheduledWatch(match) {
|
|
@@ -25044,8 +25066,8 @@ function postFailureTail(issueNumber, cwd, reason) {
|
|
|
25044
25066
|
const logPath = lastRunLogPath(cwd);
|
|
25045
25067
|
let tail = "";
|
|
25046
25068
|
try {
|
|
25047
|
-
if (
|
|
25048
|
-
const content =
|
|
25069
|
+
if (fs53.existsSync(logPath)) {
|
|
25070
|
+
const content = fs53.readFileSync(logPath, "utf-8");
|
|
25049
25071
|
tail = content.slice(-3e3);
|
|
25050
25072
|
}
|
|
25051
25073
|
} catch {
|
|
@@ -25136,9 +25158,9 @@ async function runCi(argv) {
|
|
|
25136
25158
|
forceRunCliArgs = { goal: envForceMessage };
|
|
25137
25159
|
}
|
|
25138
25160
|
}
|
|
25139
|
-
if (!args.issueNumber && !autoFallback && !forceRunAction && !runRequestFanOut && eventName === "workflow_dispatch" && dispatchEventPath &&
|
|
25161
|
+
if (!args.issueNumber && !autoFallback && !forceRunAction && !runRequestFanOut && eventName === "workflow_dispatch" && dispatchEventPath && fs53.existsSync(dispatchEventPath)) {
|
|
25140
25162
|
try {
|
|
25141
|
-
const evt = JSON.parse(
|
|
25163
|
+
const evt = JSON.parse(fs53.readFileSync(dispatchEventPath, "utf-8"));
|
|
25142
25164
|
const inputs = objectValue2(evt.inputs);
|
|
25143
25165
|
const issueInput = parseInt(String(inputs?.issue_number ?? ""), 10);
|
|
25144
25166
|
const sessionInput = String(inputs?.sessionId ?? "");
|
|
@@ -25549,7 +25571,7 @@ init_repoWorkspace();
|
|
|
25549
25571
|
|
|
25550
25572
|
// src/scripts/brainTurnLog.ts
|
|
25551
25573
|
init_runtimePaths();
|
|
25552
|
-
import * as
|
|
25574
|
+
import * as fs54 from "fs";
|
|
25553
25575
|
import * as path50 from "path";
|
|
25554
25576
|
import posixPath4 from "path/posix";
|
|
25555
25577
|
var live = /* @__PURE__ */ new Map();
|
|
@@ -25558,8 +25580,8 @@ function brainEventsFilePath(dir, chatId) {
|
|
|
25558
25580
|
}
|
|
25559
25581
|
function lastPersistedSeq(dir, chatId) {
|
|
25560
25582
|
const p = brainEventsFilePath(dir, chatId);
|
|
25561
|
-
if (!
|
|
25562
|
-
const lines =
|
|
25583
|
+
if (!fs54.existsSync(p)) return 0;
|
|
25584
|
+
const lines = fs54.readFileSync(p, "utf-8").split("\n").filter(Boolean);
|
|
25563
25585
|
if (lines.length === 0) return 0;
|
|
25564
25586
|
try {
|
|
25565
25587
|
return JSON.parse(lines[lines.length - 1]).seq || 0;
|
|
@@ -25569,9 +25591,9 @@ function lastPersistedSeq(dir, chatId) {
|
|
|
25569
25591
|
}
|
|
25570
25592
|
function readSince(dir, chatId, since) {
|
|
25571
25593
|
const p = brainEventsFilePath(dir, chatId);
|
|
25572
|
-
if (!
|
|
25594
|
+
if (!fs54.existsSync(p)) return [];
|
|
25573
25595
|
const out = [];
|
|
25574
|
-
for (const line of
|
|
25596
|
+
for (const line of fs54.readFileSync(p, "utf-8").split("\n")) {
|
|
25575
25597
|
if (!line) continue;
|
|
25576
25598
|
try {
|
|
25577
25599
|
const rec = JSON.parse(line);
|
|
@@ -25597,12 +25619,12 @@ function beginTurn(dir, chatId) {
|
|
|
25597
25619
|
};
|
|
25598
25620
|
live.set(chatId, state);
|
|
25599
25621
|
const p = brainEventsFilePath(dir, chatId);
|
|
25600
|
-
|
|
25622
|
+
fs54.mkdirSync(path50.dirname(p), { recursive: true });
|
|
25601
25623
|
return (event) => {
|
|
25602
25624
|
state.seq += 1;
|
|
25603
25625
|
const rec = { seq: state.seq, turn, ts: Date.now(), event };
|
|
25604
25626
|
try {
|
|
25605
|
-
|
|
25627
|
+
fs54.appendFileSync(p, `${JSON.stringify(rec)}
|
|
25606
25628
|
`);
|
|
25607
25629
|
} catch (err) {
|
|
25608
25630
|
process.stderr.write(
|
|
@@ -25641,7 +25663,7 @@ function endTurnIfUnterminated(dir, chatId, errMessage) {
|
|
|
25641
25663
|
event: { type: "error", error: errMessage || "turn ended unexpectedly", chatId }
|
|
25642
25664
|
};
|
|
25643
25665
|
try {
|
|
25644
|
-
|
|
25666
|
+
fs54.appendFileSync(brainEventsFilePath(dir, chatId), `${JSON.stringify(rec)}
|
|
25645
25667
|
`);
|
|
25646
25668
|
} catch {
|
|
25647
25669
|
}
|
|
@@ -26458,7 +26480,7 @@ init_config();
|
|
|
26458
26480
|
init_fetchRepoMcp();
|
|
26459
26481
|
|
|
26460
26482
|
// src/servers/mcpHttpServer.ts
|
|
26461
|
-
import { randomUUID as
|
|
26483
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
26462
26484
|
import { createServer as createServer4 } from "http";
|
|
26463
26485
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
26464
26486
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
@@ -26467,7 +26489,7 @@ function buildMcpHttpServer(opts) {
|
|
|
26467
26489
|
const transports = /* @__PURE__ */ new Map();
|
|
26468
26490
|
for (const route of opts.routes) {
|
|
26469
26491
|
const transport = new StreamableHTTPServerTransport({
|
|
26470
|
-
sessionIdGenerator: () =>
|
|
26492
|
+
sessionIdGenerator: () => randomUUID3()
|
|
26471
26493
|
});
|
|
26472
26494
|
transports.set(route.path, transport);
|
|
26473
26495
|
routes.set(route.path, route.name);
|
|
@@ -27819,7 +27841,7 @@ async function poolServe() {
|
|
|
27819
27841
|
|
|
27820
27842
|
// src/servers/runner-serve.ts
|
|
27821
27843
|
import { spawn as spawn9 } from "child_process";
|
|
27822
|
-
import * as
|
|
27844
|
+
import * as fs55 from "fs";
|
|
27823
27845
|
import { createServer as createServer6 } from "http";
|
|
27824
27846
|
var DEFAULT_PORT2 = 8080;
|
|
27825
27847
|
var DEFAULT_WORKDIR = "/workspace/repo";
|
|
@@ -27895,8 +27917,8 @@ async function defaultRunJob(job) {
|
|
|
27895
27917
|
const workdir = process.env.RUNNER_WORKDIR ?? DEFAULT_WORKDIR;
|
|
27896
27918
|
const branch = job.ref ?? "main";
|
|
27897
27919
|
const authUrl = `https://x-access-token:${job.githubToken}@github.com/${job.repo}.git`;
|
|
27898
|
-
|
|
27899
|
-
|
|
27920
|
+
fs55.rmSync(workdir, { recursive: true, force: true });
|
|
27921
|
+
fs55.mkdirSync(workdir, { recursive: true });
|
|
27900
27922
|
const allSecrets = typeof job.allSecrets === "string" ? job.allSecrets : JSON.stringify(job.allSecrets ?? {});
|
|
27901
27923
|
const target = job.runRequest.target;
|
|
27902
27924
|
const interactive = target.type === "chat";
|
|
File without changes
|
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.503",
|
|
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",
|
|
@@ -12,6 +12,29 @@
|
|
|
12
12
|
"templates",
|
|
13
13
|
"kody.config.schema.json"
|
|
14
14
|
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"kody:run": "tsx bin/kody.ts",
|
|
17
|
+
"serve": "tsx bin/kody.ts serve",
|
|
18
|
+
"serve:vscode": "tsx bin/kody.ts serve vscode",
|
|
19
|
+
"serve:claude": "tsx bin/kody.ts serve claude",
|
|
20
|
+
"clean:dist": "node scripts/clean-dist.cjs",
|
|
21
|
+
"build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
|
|
22
|
+
"check:modularity": "tsx scripts/check-script-modularity.ts",
|
|
23
|
+
"pretest": "pnpm check:modularity",
|
|
24
|
+
"test": "vitest run tests/unit tests/int --coverage",
|
|
25
|
+
"posttest": "tsx scripts/check-coverage-floor.ts",
|
|
26
|
+
"test:smoke": "vitest run tests/smoke --no-coverage",
|
|
27
|
+
"test:e2e": "vitest run tests/e2e --no-coverage",
|
|
28
|
+
"test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
|
|
29
|
+
"test:all": "vitest run tests --no-coverage",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "biome check",
|
|
32
|
+
"lint:fix": "biome check --write",
|
|
33
|
+
"format": "biome format --write",
|
|
34
|
+
"verify:package": "node scripts/verify-package-tarball.cjs",
|
|
35
|
+
"brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain --build-arg KODY_ENGINE_REF=$(git rev-parse HEAD) -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner",
|
|
36
|
+
"prepublishOnly": "pnpm typecheck && vitest run tests/unit tests/int --no-coverage && pnpm test:runtime-services && pnpm build && pnpm verify:package"
|
|
37
|
+
},
|
|
15
38
|
"dependencies": {
|
|
16
39
|
"@actions/cache": "^6.0.0",
|
|
17
40
|
"@anthropic-ai/claude-agent-sdk": "0.2.119",
|
|
@@ -38,27 +61,5 @@
|
|
|
38
61
|
"url": "git+https://github.com/aharonyaircohen/kody-engine.git"
|
|
39
62
|
},
|
|
40
63
|
"homepage": "https://github.com/aharonyaircohen/kody-engine",
|
|
41
|
-
"bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
|
|
42
|
-
|
|
43
|
-
"kody:run": "tsx bin/kody.ts",
|
|
44
|
-
"serve": "tsx bin/kody.ts serve",
|
|
45
|
-
"serve:vscode": "tsx bin/kody.ts serve vscode",
|
|
46
|
-
"serve:claude": "tsx bin/kody.ts serve claude",
|
|
47
|
-
"clean:dist": "node scripts/clean-dist.cjs",
|
|
48
|
-
"build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
|
|
49
|
-
"check:modularity": "tsx scripts/check-script-modularity.ts",
|
|
50
|
-
"pretest": "pnpm check:modularity",
|
|
51
|
-
"test": "vitest run tests/unit tests/int --coverage",
|
|
52
|
-
"posttest": "tsx scripts/check-coverage-floor.ts",
|
|
53
|
-
"test:smoke": "vitest run tests/smoke --no-coverage",
|
|
54
|
-
"test:e2e": "vitest run tests/e2e --no-coverage",
|
|
55
|
-
"test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
|
|
56
|
-
"test:all": "vitest run tests --no-coverage",
|
|
57
|
-
"typecheck": "tsc --noEmit",
|
|
58
|
-
"lint": "biome check",
|
|
59
|
-
"lint:fix": "biome check --write",
|
|
60
|
-
"format": "biome format --write",
|
|
61
|
-
"verify:package": "node scripts/verify-package-tarball.cjs",
|
|
62
|
-
"brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain --build-arg KODY_ENGINE_REF=$(git rev-parse HEAD) -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
64
|
+
"bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
|
|
65
|
+
}
|