@kody-ade/kody-engine 0.4.177 → 0.4.179

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 CHANGED
@@ -1309,7 +1309,7 @@ var init_loadPriorArt = __esm({
1309
1309
  // package.json
1310
1310
  var package_default = {
1311
1311
  name: "@kody-ade/kody-engine",
1312
- version: "0.4.177",
1312
+ version: "0.4.179",
1313
1313
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
1314
1314
  license: "MIT",
1315
1315
  type: "module",
@@ -12560,7 +12560,12 @@ var runPreviewBuild = async (ctx, _profile, _args) => {
12560
12560
  repo = required("GITHUB_REPOSITORY");
12561
12561
  ref = required("GITHUB_SHA");
12562
12562
  masterKey = required("KODY_MASTER_KEY");
12563
- ghToken4 = required("GITHUB_TOKEN");
12563
+ ghToken4 = (process.env.KODY_TOKEN ?? process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN ?? process.env.GH_PAT ?? "").trim();
12564
+ if (!ghToken4) {
12565
+ throw new Error(
12566
+ "GitHub auth token missing (KODY_TOKEN / GH_TOKEN / GITHUB_TOKEN / GH_PAT all empty)"
12567
+ );
12568
+ }
12564
12569
  } catch (err) {
12565
12570
  ctx.output.exitCode = 99;
12566
12571
  ctx.output.reason = `runPreviewBuild: ${err instanceof Error ? err.message : String(err)}`;
@@ -12594,13 +12599,22 @@ var runPreviewBuild = async (ctx, _profile, _args) => {
12594
12599
  );
12595
12600
  }
12596
12601
  const consumerDockerfile = path36.join(ctx.cwd, "Dockerfile.preview");
12602
+ const { stat } = await import("fs/promises");
12603
+ let hasConsumerDockerfile = false;
12597
12604
  try {
12598
- await copyFile(bundledDockerfilePath(buildMode), consumerDockerfile);
12599
- console.log(`[preview-build] using bundled Dockerfile.preview.${buildMode}`);
12600
- } catch (err) {
12601
- console.warn(
12602
- `[preview-build] failed to drop bundled Dockerfile: ${err instanceof Error ? err.message : err}`
12605
+ await stat(consumerDockerfile);
12606
+ hasConsumerDockerfile = true;
12607
+ } catch {
12608
+ hasConsumerDockerfile = false;
12609
+ }
12610
+ if (!hasConsumerDockerfile) {
12611
+ const bundled = bundledDockerfilePath(buildMode);
12612
+ await copyFile(bundled, consumerDockerfile);
12613
+ console.log(
12614
+ `[preview-build] using bundled Dockerfile.preview.${buildMode} (from ${bundled})`
12603
12615
  );
12616
+ } else {
12617
+ console.log("[preview-build] using repo Dockerfile.preview");
12604
12618
  }
12605
12619
  let baseImage = null;
12606
12620
  if (ghcrOwner) {
@@ -0,0 +1,43 @@
1
+ # syntax=docker/dockerfile:1.7
2
+ #
3
+ # Bundled default Dockerfile.preview — DEV-MODE variant.
4
+ #
5
+ # Previews run `next dev`, NOT `next build` + `next start`. This skips
6
+ # the 5–10 min webpack production compile entirely. Trade-offs:
7
+ # - First request to each route lags 2–5s (compile-on-demand)
8
+ # - Subsequent requests are fast
9
+ # - Memory hungry at runtime (webpack alive)
10
+ # For PR previews this is the right trade — reviewers click a handful
11
+ # of pages, never need prod optimizations. Production stays on Vercel.
12
+ #
13
+ # When BASE_IMAGE is set, deps are inherited from the per-repo base
14
+ # image; the install layer just verifies the lockfile.
15
+
16
+ ARG BASE_IMAGE=node:22-alpine
17
+
18
+ FROM ${BASE_IMAGE}
19
+ WORKDIR /app
20
+
21
+ RUN corepack enable 2>/dev/null || true
22
+
23
+ COPY package.json pnpm-lock.yaml* package-lock.json* yarn.lock* ./
24
+ RUN --mount=type=cache,id=kp-pnpm-store,target=/root/.local/share/pnpm/store \
25
+ --mount=type=cache,id=kp-npm-cache,target=/root/.npm \
26
+ if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile --ignore-scripts; \
27
+ elif [ -f package-lock.json ]; then npm ci --ignore-scripts; \
28
+ elif [ -f yarn.lock ]; then yarn install --frozen-lockfile --ignore-scripts; \
29
+ else npm install --ignore-scripts; fi
30
+
31
+ # Overwrite source files with the PR's version. node_modules and any
32
+ # prior .next directory from the base image are preserved as warm
33
+ # caches for the dev server's first compile.
34
+ COPY . ./
35
+ RUN mkdir -p public
36
+
37
+ ENV NEXT_TELEMETRY_DISABLED=1
38
+ ENV NODE_ENV=development
39
+ ENV PORT=8080
40
+ ENV HOSTNAME=0.0.0.0
41
+
42
+ EXPOSE 8080
43
+ CMD ["sh", "-c", "if [ -f pnpm-lock.yaml ]; then pnpm exec next dev -H 0.0.0.0 -p 8080; else npx next dev -H 0.0.0.0 -p 8080; fi"]
@@ -0,0 +1,40 @@
1
+ # syntax=docker/dockerfile:1.7
2
+ #
3
+ # Bundled default Dockerfile.preview — PROD-MODE variant.
4
+ #
5
+ # Runs `next build` + `next start` — same shape as Vercel. Slower
6
+ # first build (~5–10 min webpack) but instant per-page response.
7
+ # Pick this mode for repos where reviewers test production-only
8
+ # behaviour (SSG, static optimization, edge runtime parity).
9
+
10
+ ARG BASE_IMAGE=node:22-alpine
11
+
12
+ FROM ${BASE_IMAGE}
13
+ WORKDIR /app
14
+
15
+ RUN corepack enable 2>/dev/null || true
16
+
17
+ COPY package.json pnpm-lock.yaml* package-lock.json* yarn.lock* ./
18
+ RUN --mount=type=cache,id=kp-pnpm-store,target=/root/.local/share/pnpm/store \
19
+ --mount=type=cache,id=kp-npm-cache,target=/root/.npm \
20
+ if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile --ignore-scripts; \
21
+ elif [ -f package-lock.json ]; then npm ci --ignore-scripts; \
22
+ elif [ -f yarn.lock ]; then yarn install --frozen-lockfile --ignore-scripts; \
23
+ else npm install --ignore-scripts; fi
24
+
25
+ COPY . ./
26
+ RUN mkdir -p public
27
+
28
+ ENV NEXT_TELEMETRY_DISABLED=1
29
+ ENV NODE_ENV=production
30
+ ENV PORT=8080
31
+ ENV HOSTNAME=0.0.0.0
32
+ ENV NODE_OPTIONS="--max-old-space-size=7168"
33
+
34
+ RUN --mount=type=cache,id=kp-next-cache,target=/app/.next/cache \
35
+ if [ -f pnpm-lock.yaml ]; then pnpm exec next build; \
36
+ else npx next build; \
37
+ fi
38
+
39
+ EXPOSE 8080
40
+ CMD ["sh", "-c", "if [ -f pnpm-lock.yaml ]; then pnpm exec next start -H 0.0.0.0 -p 8080; else npx next start -H 0.0.0.0 -p 8080; fi"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.177",
3
+ "version": "0.4.179",
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",