@kody-ade/kody-engine 0.4.492 → 0.4.494
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 +29 -12
- 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.494",
|
|
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,12 +2448,12 @@ 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
|
|
2451
|
+
async function writeRuntimeSecretsToKody(secrets, env = process.env) {
|
|
2452
2452
|
const token = await githubOidcToken(env);
|
|
2453
2453
|
const response = await fetch(`${resolveKodyApiUrl(env)}/api/kody/engine/secret`, {
|
|
2454
2454
|
method: "PUT",
|
|
2455
2455
|
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
|
|
2456
|
-
body: JSON.stringify({
|
|
2456
|
+
body: JSON.stringify({ secrets }),
|
|
2457
2457
|
signal: AbortSignal.timeout(3e4)
|
|
2458
2458
|
});
|
|
2459
2459
|
if (!response.ok) throw new Error(`Kody secret upsert failed (${response.status})`);
|
|
@@ -4325,9 +4325,12 @@ function validateCapabilityContractValue(boundary, schema, value) {
|
|
|
4325
4325
|
throw new CapabilityContractValidationError(boundary, validate.errors ?? []);
|
|
4326
4326
|
}
|
|
4327
4327
|
}
|
|
4328
|
-
function capabilityContractInput(inputs, args) {
|
|
4328
|
+
function capabilityContractInput(inputs, args, capabilityId) {
|
|
4329
4329
|
const isGenericRunnerInput = inputs.some((input) => input.name === "input") && Object.hasOwn(args, "input");
|
|
4330
|
-
if (!isGenericRunnerInput)
|
|
4330
|
+
if (!isGenericRunnerInput) {
|
|
4331
|
+
const isParameterlessGenericRunner = (inputs.some((input) => input.name === "capability") || args.capability === capabilityId) && Object.hasOwn(args, "capability");
|
|
4332
|
+
return isParameterlessGenericRunner ? {} : args;
|
|
4333
|
+
}
|
|
4331
4334
|
const value = args.input;
|
|
4332
4335
|
if (typeof value !== "string") return value;
|
|
4333
4336
|
try {
|
|
@@ -15457,9 +15460,7 @@ async function resolveRuntimeSecret(name, ctx, opts = {}) {
|
|
|
15457
15460
|
try {
|
|
15458
15461
|
const value = await readRuntimeSecretFromKody(name, env);
|
|
15459
15462
|
if (value) return { value, source: "vault" };
|
|
15460
|
-
|
|
15461
|
-
if (fallback.value) await writeRuntimeSecretToKody(name, fallback.value, env);
|
|
15462
|
-
return fallback;
|
|
15463
|
+
return envSecret(name, env);
|
|
15463
15464
|
} catch (err) {
|
|
15464
15465
|
const fallback = envSecret(name, env);
|
|
15465
15466
|
return {
|
|
@@ -15493,14 +15494,26 @@ async function resolveRuntimeSecret(name, ctx, opts = {}) {
|
|
|
15493
15494
|
}
|
|
15494
15495
|
async function resolveRuntimeSecrets(names, ctx, opts = {}) {
|
|
15495
15496
|
const declared = Array.isArray(names) ? [...new Set(names.filter((name) => typeof name === "string" && /^[A-Z][A-Z0-9_]*$/.test(name)))] : [];
|
|
15496
|
-
const resolved =
|
|
15497
|
-
|
|
15497
|
+
const resolved = [];
|
|
15498
|
+
for (const name of declared) {
|
|
15499
|
+
resolved.push({ name, result: await resolveRuntimeSecret(name, ctx, opts) });
|
|
15500
|
+
}
|
|
15501
|
+
const warnings = resolved.flatMap(({ result }) => result.warning ? [result.warning] : []);
|
|
15502
|
+
const fallbackSecrets = Object.fromEntries(
|
|
15503
|
+
resolved.flatMap(({ name, result }) => result.source === "env" && result.value ? [[name, result.value]] : [])
|
|
15498
15504
|
);
|
|
15505
|
+
if (hasGitHubActionsIdentity(opts.env ?? process.env) && Object.keys(fallbackSecrets).length > 0) {
|
|
15506
|
+
try {
|
|
15507
|
+
await writeRuntimeSecretsToKody(fallbackSecrets, opts.env ?? process.env);
|
|
15508
|
+
} catch (err) {
|
|
15509
|
+
warnings.push(`Kody secret migration failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
15510
|
+
}
|
|
15511
|
+
}
|
|
15499
15512
|
return {
|
|
15500
15513
|
environment: Object.fromEntries(
|
|
15501
15514
|
resolved.flatMap(({ name, result }) => result.value ? [[name, result.value]] : [])
|
|
15502
15515
|
),
|
|
15503
|
-
warnings
|
|
15516
|
+
warnings
|
|
15504
15517
|
};
|
|
15505
15518
|
}
|
|
15506
15519
|
var init_runtimeSecrets = __esm({
|
|
@@ -20984,7 +20997,11 @@ async function runImplementation(profileName, input) {
|
|
|
20984
20997
|
validateCapabilityContractValue(
|
|
20985
20998
|
"input",
|
|
20986
20999
|
profile.canonicalContract.inputSchema,
|
|
20987
|
-
capabilityContractInput(
|
|
21000
|
+
capabilityContractInput(
|
|
21001
|
+
profile.inputs,
|
|
21002
|
+
args,
|
|
21003
|
+
profile.canonicalContract.capabilityId
|
|
21004
|
+
)
|
|
20988
21005
|
);
|
|
20989
21006
|
}
|
|
20990
21007
|
} catch (err) {
|
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.494",
|
|
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",
|