@kody-ade/kody-engine 0.4.214 → 0.4.215

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 +19 -9
  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.214",
18
+ version: "0.4.215",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -17748,6 +17748,11 @@ var FlyClient = class {
17748
17748
  }
17749
17749
  /** Create + start a pooled machine in serve mode, tagged for `repoTag`. */
17750
17750
  async createPooled(input) {
17751
+ const env = {
17752
+ RUNNER_API_KEY: input.runnerApiKey,
17753
+ PORT: String(input.port ?? 8080)
17754
+ };
17755
+ if (input.litellmUrl?.trim()) env.KODY_LITELLM_URL = input.litellmUrl.trim();
17751
17756
  const body = {
17752
17757
  region: input.region,
17753
17758
  config: {
@@ -17760,11 +17765,7 @@ var FlyClient = class {
17760
17765
  [POOL_METADATA_KEY]: POOL_METADATA_VALUE,
17761
17766
  [POOL_REPO_METADATA_KEY]: input.repoTag
17762
17767
  },
17763
- env: {
17764
- RUNNER_API_KEY: input.runnerApiKey,
17765
- KODY_LITELLM_URL: input.litellmUrl,
17766
- PORT: String(input.port ?? 8080)
17767
- }
17768
+ env
17768
17769
  }
17769
17770
  };
17770
17771
  const m = await this.call(`/apps/${enc(this.opts.app)}/machines`, { method: "POST", body });
@@ -18204,10 +18205,19 @@ var PoolRegistry = class {
18204
18205
  };
18205
18206
  return pm.claim(job);
18206
18207
  }
18207
- /** Status for a single repo's pool, or null if none exists yet. */
18208
+ /** Status for a single repo's pool already known to this owner. */
18208
18209
  status(owner, repo) {
18209
18210
  return this.pools.get(this.key(owner, repo))?.status() ?? null;
18210
18211
  }
18212
+ /**
18213
+ * Status for a repo, creating/adopting its pool on first read when the repo
18214
+ * has pool credentials. This lets a restarted owner recover from existing
18215
+ * pooled machines without waiting for the next claim.
18216
+ */
18217
+ async statusFor(owner, repo) {
18218
+ const pm = await this.getPool(owner, repo);
18219
+ return pm?.status() ?? null;
18220
+ }
18211
18221
  /** Resync every active repo pool (periodic self-heal). Also re-reads each
18212
18222
  * repo's POOL_MIN from its vault so a dashboard resize warms up/drains within
18213
18223
  * one tick — no owner restart needed. */
@@ -18325,7 +18335,7 @@ async function poolServe() {
18325
18335
  const region = process.env.POOL_REGION ?? "fra";
18326
18336
  const perf = process.env.POOL_PERF ?? "medium";
18327
18337
  const guest = PERF_GUEST[perf] ?? PERF_GUEST.medium;
18328
- const litellmUrl = process.env.KODY_LITELLM_URL ?? "http://kody-litellm.internal:4000";
18338
+ const litellmUrl = process.env.KODY_LITELLM_URL?.trim() || void 0;
18329
18339
  const min = envInt("POOL_MIN", 2);
18330
18340
  const runnerPort = envInt("RUNNER_PORT", 8080);
18331
18341
  const apiPort = envInt("POOL_API_PORT", 4100);
@@ -18382,7 +18392,7 @@ async function poolServe() {
18382
18392
  const repoParam = (url.searchParams.get("repo") ?? "").trim();
18383
18393
  const [owner, repo] = repoParam.split("/");
18384
18394
  if (!owner || !repo) return sendJson2(res, 400, { error: "repo query (owner/name) required" });
18385
- return sendJson2(res, 200, { status: registry.status(owner, repo) });
18395
+ return sendJson2(res, 200, { status: await registry.statusFor(owner, repo) });
18386
18396
  }
18387
18397
  if (req.method === "POST" && url.pathname === "/pool/claim") {
18388
18398
  let body;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.214",
3
+ "version": "0.4.215",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",