@kody-ade/kody-engine 0.4.422 → 0.4.424
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 +24 -7
- 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.424",
|
|
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",
|
|
@@ -1895,6 +1895,11 @@ function definitionsRoot(cwd = process.cwd()) {
|
|
|
1895
1895
|
if (fs5.existsSync(hydrated)) return hydrated;
|
|
1896
1896
|
return override ? path6.resolve(override) : hydrated;
|
|
1897
1897
|
}
|
|
1898
|
+
function hasExplicitDefinitionsRoot(cwd = process.cwd(), env = process.env) {
|
|
1899
|
+
const root = env.KODY_DEFINITIONS_ROOT?.trim();
|
|
1900
|
+
const rootCwd = env.KODY_DEFINITIONS_ROOT_CWD?.trim();
|
|
1901
|
+
return Boolean(root && rootCwd && path6.resolve(cwd) === path6.resolve(rootCwd));
|
|
1902
|
+
}
|
|
1898
1903
|
function capabilitiesRoot(cwd = process.cwd()) {
|
|
1899
1904
|
return path6.join(definitionsRoot(cwd), "capabilities");
|
|
1900
1905
|
}
|
|
@@ -2442,17 +2447,17 @@ function createStateBackendFromEnv(env = process.env, client) {
|
|
|
2442
2447
|
});
|
|
2443
2448
|
return Array.isArray(result) ? result : [];
|
|
2444
2449
|
},
|
|
2445
|
-
async getAgencyState(tenantId2,
|
|
2450
|
+
async getAgencyState(tenantId2, definitionId2) {
|
|
2446
2451
|
const result = await transport.query(anyApi.agencyModel.getState, {
|
|
2447
2452
|
tenantId: requireTenant(tenantId2),
|
|
2448
|
-
definitionId: requireNonEmpty(
|
|
2453
|
+
definitionId: requireNonEmpty(definitionId2, "definitionId")
|
|
2449
2454
|
});
|
|
2450
2455
|
return result ?? null;
|
|
2451
2456
|
},
|
|
2452
|
-
async putAgencyState(tenantId2,
|
|
2457
|
+
async putAgencyState(tenantId2, definitionId2, kind, schemaVersion, data, updatedAt) {
|
|
2453
2458
|
await transport.mutation(anyApi.agencyModel.putState, {
|
|
2454
2459
|
tenantId: requireTenant(tenantId2),
|
|
2455
|
-
definitionId: requireNonEmpty(
|
|
2460
|
+
definitionId: requireNonEmpty(definitionId2, "definitionId"),
|
|
2456
2461
|
kind,
|
|
2457
2462
|
schemaVersion,
|
|
2458
2463
|
data,
|
|
@@ -13013,6 +13018,13 @@ function goalProgressFromOutputs(definition, outputs) {
|
|
|
13013
13018
|
);
|
|
13014
13019
|
return required2.filter((key) => satisfied.has(key)).length / required2.length;
|
|
13015
13020
|
}
|
|
13021
|
+
function definitionId(document) {
|
|
13022
|
+
const data = document.data;
|
|
13023
|
+
if (typeof data.id !== "string" || !data.id.trim()) {
|
|
13024
|
+
throw new Error(`Agency Definition is missing id: ${document.recordId}`);
|
|
13025
|
+
}
|
|
13026
|
+
return data.id;
|
|
13027
|
+
}
|
|
13016
13028
|
function parseState(document, definition, kind) {
|
|
13017
13029
|
if (!document) return null;
|
|
13018
13030
|
if (document.schemaVersion !== 1) throw new Error(`Unsupported Agency State schema: ${document.schemaVersion}`);
|
|
@@ -13106,7 +13118,11 @@ var init_agencyModelRepository = __esm({
|
|
|
13106
13118
|
const ordered = [...documents].sort(
|
|
13107
13119
|
(left, right) => left.createdAt.localeCompare(right.createdAt) || left.recordId.localeCompare(right.recordId)
|
|
13108
13120
|
);
|
|
13109
|
-
|
|
13121
|
+
const latest = /* @__PURE__ */ new Map();
|
|
13122
|
+
for (const document of ordered) {
|
|
13123
|
+
latest.set(`${document.kind}:${definitionId(document)}`, document);
|
|
13124
|
+
}
|
|
13125
|
+
for (const document of latest.values()) addDefinition(catalog, document);
|
|
13110
13126
|
validateRelationships(catalog);
|
|
13111
13127
|
return catalog;
|
|
13112
13128
|
}
|
|
@@ -26295,6 +26311,7 @@ ${CHAT_HELP}`);
|
|
|
26295
26311
|
|
|
26296
26312
|
// src/entry.ts
|
|
26297
26313
|
init_config();
|
|
26314
|
+
init_definition_paths();
|
|
26298
26315
|
|
|
26299
26316
|
// src/definition-hydration.ts
|
|
26300
26317
|
init_state_backend();
|
|
@@ -27962,7 +27979,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
27962
27979
|
unpackAllSecrets();
|
|
27963
27980
|
const cwdFlag = argv.indexOf("--cwd");
|
|
27964
27981
|
const definitionCwd = cwdFlag >= 0 && argv[cwdFlag + 1] ? argv[cwdFlag + 1] : process.cwd();
|
|
27965
|
-
const shouldHydrate = Boolean(process.env.CONVEX_URL?.trim()) || process.env.GITHUB_ACTIONS === "true" && Boolean(process.env.GITHUB_EVENT_NAME);
|
|
27982
|
+
const shouldHydrate = !hasExplicitDefinitionsRoot(definitionCwd) && (Boolean(process.env.CONVEX_URL?.trim()) || process.env.GITHUB_ACTIONS === "true" && Boolean(process.env.GITHUB_EVENT_NAME));
|
|
27966
27983
|
if (shouldHydrate) {
|
|
27967
27984
|
try {
|
|
27968
27985
|
await hydrateDefinitionsFromEnv(definitionCwd);
|
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.424",
|
|
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",
|