@kody-ade/kody-engine 0.4.490 → 0.4.492
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 +26 -6
- 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.492",
|
|
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",
|
|
@@ -2448,6 +2448,16 @@ async function readRuntimeSecretFromKody(name, env = process.env) {
|
|
|
2448
2448
|
const body = await response.json();
|
|
2449
2449
|
return typeof body.value === "string" ? body.value : null;
|
|
2450
2450
|
}
|
|
2451
|
+
async function writeRuntimeSecretToKody(name, value, env = process.env) {
|
|
2452
|
+
const token = await githubOidcToken(env);
|
|
2453
|
+
const response = await fetch(`${resolveKodyApiUrl(env)}/api/kody/engine/secret`, {
|
|
2454
|
+
method: "PUT",
|
|
2455
|
+
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
|
|
2456
|
+
body: JSON.stringify({ name, value }),
|
|
2457
|
+
signal: AbortSignal.timeout(3e4)
|
|
2458
|
+
});
|
|
2459
|
+
if (!response.ok) throw new Error(`Kody secret upsert failed (${response.status})`);
|
|
2460
|
+
}
|
|
2451
2461
|
async function readPreviewContextFromKody(env = process.env) {
|
|
2452
2462
|
const token = await githubOidcToken(env);
|
|
2453
2463
|
const response = await fetch(`${resolveKodyApiUrl(env)}/api/kody/engine/preview-context`, {
|
|
@@ -4316,7 +4326,7 @@ function validateCapabilityContractValue(boundary, schema, value) {
|
|
|
4316
4326
|
}
|
|
4317
4327
|
}
|
|
4318
4328
|
function capabilityContractInput(inputs, args) {
|
|
4319
|
-
const isGenericRunnerInput = inputs.some((input) => input.name === "input") &&
|
|
4329
|
+
const isGenericRunnerInput = inputs.some((input) => input.name === "input") && Object.hasOwn(args, "input");
|
|
4320
4330
|
if (!isGenericRunnerInput) return args;
|
|
4321
4331
|
const value = args.input;
|
|
4322
4332
|
if (typeof value !== "string") return value;
|
|
@@ -4337,10 +4347,13 @@ var init_capability_contract_validation = __esm({
|
|
|
4337
4347
|
});
|
|
4338
4348
|
CapabilityContractValidationError = class extends Error {
|
|
4339
4349
|
constructor(boundary, errors) {
|
|
4350
|
+
const details = errors.map((error) => {
|
|
4351
|
+
const location = error.instancePath || "$";
|
|
4352
|
+
const property = error.keyword === "additionalProperties" && typeof error.params.additionalProperty === "string" ? ` (${error.params.additionalProperty})` : "";
|
|
4353
|
+
return `${location}: ${error.message ?? error.keyword}${property}`;
|
|
4354
|
+
}).join("; ");
|
|
4340
4355
|
super(
|
|
4341
|
-
`Capability ${boundary} does not match its declared contract: ${
|
|
4342
|
-
separator: "; "
|
|
4343
|
-
})}`
|
|
4356
|
+
`Capability ${boundary} does not match its declared contract: ${details}`
|
|
4344
4357
|
);
|
|
4345
4358
|
this.boundary = boundary;
|
|
4346
4359
|
this.errors = errors;
|
|
@@ -15443,7 +15456,10 @@ async function resolveRuntimeSecret(name, ctx, opts = {}) {
|
|
|
15443
15456
|
if (hasGitHubActionsIdentity(env)) {
|
|
15444
15457
|
try {
|
|
15445
15458
|
const value = await readRuntimeSecretFromKody(name, env);
|
|
15446
|
-
|
|
15459
|
+
if (value) return { value, source: "vault" };
|
|
15460
|
+
const fallback = envSecret(name, env);
|
|
15461
|
+
if (fallback.value) await writeRuntimeSecretToKody(name, fallback.value, env);
|
|
15462
|
+
return fallback;
|
|
15447
15463
|
} catch (err) {
|
|
15448
15464
|
const fallback = envSecret(name, env);
|
|
15449
15465
|
return {
|
|
@@ -16728,6 +16744,7 @@ var init_parseSimpleCapabilityOutput = __esm({
|
|
|
16728
16744
|
reason: reason2,
|
|
16729
16745
|
summary: reason2
|
|
16730
16746
|
};
|
|
16747
|
+
ctx.output.exitCode = 1;
|
|
16731
16748
|
ctx.output.reason = reason2;
|
|
16732
16749
|
ctx.data.capabilityOutput = blocked;
|
|
16733
16750
|
ctx.data.capabilityResults = [
|
|
@@ -16769,6 +16786,9 @@ var init_parseSimpleCapabilityOutput = __esm({
|
|
|
16769
16786
|
ctx.data.capabilityOutput = output;
|
|
16770
16787
|
const structuredResult = parseCapabilityResult(output);
|
|
16771
16788
|
if (structuredResult) {
|
|
16789
|
+
if ((structuredResult.status === "fail" || structuredResult.status === "blocked") && (ctx.output.exitCode === void 0 || ctx.output.exitCode === 0)) {
|
|
16790
|
+
ctx.output.exitCode = 1;
|
|
16791
|
+
}
|
|
16772
16792
|
ctx.output.reason = structuredResult.summary;
|
|
16773
16793
|
ctx.data.capabilityResults = [structuredResult];
|
|
16774
16794
|
return;
|
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.492",
|
|
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",
|