@kody-ade/kody-engine 0.4.424 → 0.4.426

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.
Files changed (2) hide show
  1. package/dist/bin/kody.js +15 -3
  2. 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.424",
18
+ version: "0.4.426",
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",
@@ -2329,6 +2329,14 @@ var init_kody_api_client = __esm({
2329
2329
 
2330
2330
  // src/state-backend.ts
2331
2331
  import { anyApi } from "convex/server";
2332
+ function serializeAgencyDispatchDecision(decision) {
2333
+ return {
2334
+ kind: decision.kind,
2335
+ reason: decision.reason,
2336
+ ...decision.scheduledAt ? { scheduledAt: decision.scheduledAt } : {},
2337
+ ...decision.nextEligibleAt ? { nextEligibleAt: decision.nextEligibleAt } : {}
2338
+ };
2339
+ }
2332
2340
  function requireTenant(tenantId2) {
2333
2341
  const value = tenantId2.trim();
2334
2342
  if (!/^[^/\s]+\/[^/\s]+$/.test(value)) throw new Error("tenantId must be an owner/repository pair");
@@ -2485,6 +2493,7 @@ function createStateBackendFromEnv(env = process.env, client) {
2485
2493
  const result = await transport.mutation(anyApi.agencyModel.reserveDispatch, {
2486
2494
  tenantId: requireTenant(tenantId2),
2487
2495
  ...reservation,
2496
+ decision: serializeAgencyDispatchDecision(reservation.decision),
2488
2497
  idempotencyKey: requireNonEmpty(reservation.idempotencyKey, "idempotencyKey"),
2489
2498
  loopId: requireNonEmpty(reservation.loopId, "loopId"),
2490
2499
  reservationId: requireNonEmpty(reservation.reservationId, "reservationId"),
@@ -2498,7 +2507,7 @@ function createStateBackendFromEnv(env = process.env, client) {
2498
2507
  tenantId: requireTenant(tenantId2),
2499
2508
  idempotencyKey: requireNonEmpty(idempotencyKey, "idempotencyKey"),
2500
2509
  loopId: requireNonEmpty(loopId, "loopId"),
2501
- decision,
2510
+ decision: serializeAgencyDispatchDecision(decision),
2502
2511
  now
2503
2512
  });
2504
2513
  },
@@ -13548,7 +13557,10 @@ async function runAttempt(run, job, timeoutSeconds) {
13548
13557
  let timer;
13549
13558
  try {
13550
13559
  return await Promise.race([
13551
- run(job, abortController),
13560
+ run(job, abortController).catch((error) => ({
13561
+ exitCode: 99,
13562
+ reason: error instanceof Error ? error.message : String(error)
13563
+ })),
13552
13564
  new Promise((resolve17) => {
13553
13565
  timer = setTimeout(() => {
13554
13566
  abortController.abort();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.424",
3
+ "version": "0.4.426",
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",