@kody-ade/kody-engine 0.4.494 → 0.4.495
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 +7 -16
- 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.495",
|
|
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 writeRuntimeSecretToKody(name, value, 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({ name, value }),
|
|
2457
2457
|
signal: AbortSignal.timeout(3e4)
|
|
2458
2458
|
});
|
|
2459
2459
|
if (!response.ok) throw new Error(`Kody secret upsert failed (${response.status})`);
|
|
@@ -15460,7 +15460,9 @@ async function resolveRuntimeSecret(name, ctx, opts = {}) {
|
|
|
15460
15460
|
try {
|
|
15461
15461
|
const value = await readRuntimeSecretFromKody(name, env);
|
|
15462
15462
|
if (value) return { value, source: "vault" };
|
|
15463
|
-
|
|
15463
|
+
const fallback = envSecret(name, env);
|
|
15464
|
+
if (fallback.value) await writeRuntimeSecretToKody(name, fallback.value, env);
|
|
15465
|
+
return fallback;
|
|
15464
15466
|
} catch (err) {
|
|
15465
15467
|
const fallback = envSecret(name, env);
|
|
15466
15468
|
return {
|
|
@@ -15498,22 +15500,11 @@ async function resolveRuntimeSecrets(names, ctx, opts = {}) {
|
|
|
15498
15500
|
for (const name of declared) {
|
|
15499
15501
|
resolved.push({ name, result: await resolveRuntimeSecret(name, ctx, opts) });
|
|
15500
15502
|
}
|
|
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]] : [])
|
|
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
|
-
}
|
|
15512
15503
|
return {
|
|
15513
15504
|
environment: Object.fromEntries(
|
|
15514
15505
|
resolved.flatMap(({ name, result }) => result.value ? [[name, result.value]] : [])
|
|
15515
15506
|
),
|
|
15516
|
-
warnings
|
|
15507
|
+
warnings: resolved.flatMap(({ result }) => result.warning ? [result.warning] : [])
|
|
15517
15508
|
};
|
|
15518
15509
|
}
|
|
15519
15510
|
var init_runtimeSecrets = __esm({
|
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.495",
|
|
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",
|