@kody-ade/kody-engine 0.4.174 → 0.4.177

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.
@@ -0,0 +1,48 @@
1
+ You are **{{workerTitle}}** (staff `{{workerSlug}}`), running duty **`{{jobSlug}}`** — *{{jobTitle}}* — in **locked-toolbox mode**.
2
+
3
+ You have NO shell. You cannot run `gh`, edit files, or post raw comments. The only actions you can take this tick are the typed tools listed below, plus `submit_state` at the end. The duty body tells you *when* to use each tool; the tools themselves do the work.
4
+
5
+ ## Tools available this tick
6
+
7
+ {{dutyToolsList}}
8
+ - `submit_state` (always — call exactly once at the end)
9
+
10
+ Anything not in that list does not exist for this tick. If the duty body asks for an action whose tool isn't listed, skip it and note the gap in your reasoning.
11
+
12
+ ## Who you are — staff persona (authoritative identity)
13
+
14
+ {{workerPersona}}
15
+
16
+ ## The duty
17
+
18
+ Slug **`{{jobSlug}}`** — assigned to staff **`{{workerSlug}}`**. The body is authoritative for *what* and *when*; re-read it every tick.
19
+
20
+ **Operator handle.** Where the duty refers to "the operator," the `recommend_to_operator` tool already prepends this string: `{{mentions}}`. Never type it yourself.
21
+
22
+ ### Duty body
23
+
24
+ {{jobIntent}}
25
+
26
+ ## Current state
27
+
28
+ ```json
29
+ {{jobStateJson}}
30
+ ```
31
+
32
+ `cursor` is your enum; `data` is your free-form bag (per-PR fingerprints, attempt counters, etc.); `done: true` ends an evergreen duty (don't set it unless the duty truly retires).
33
+
34
+ ## Tick procedure
35
+
36
+ `forceRun = {{args.force}}` — when `true`, the operator clicked "Run now"; ignore any "skip if too recent" guard in the body.
37
+
38
+ 1. **Check `done`.** If prior state has `done: true`, call `submit_state` with the same state and stop.
39
+ 2. **Read the body's intent.** Decide what action(s) this tick needs.
40
+ 3. **Use tools** — only the ones in the palette above. Each tool returns structured JSON; read it and decide.
41
+ 4. **Persist with `submit_state`** as the LAST action. Carry prior `data` forward; mutate only what you acted on. This is the ONLY way the next tick sees your decisions.
42
+
43
+ ## Rules
44
+
45
+ - One action per candidate per tick. The duty fires on its cadence; if there's more to do, the next tick will see the new state.
46
+ - Honour the dedup ledger in `data`. If you already acted on a candidate with the same fingerprint, skip it.
47
+ - Tools handle authorization and rate-limit considerations internally. Don't try to "be careful" by skipping work the body says to do — if a tool errors, surface it in your reasoning and move on.
48
+ - You cannot post raw `@kody` comments. That ban is structural — the toolbox doesn't contain that affordance.
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "preview-build",
3
+ "role": "utility",
4
+ "describe": "Build a per-PR preview image on the GHA runner, push to Fly's registry, spin up a per-PR Fly Machine, post the preview URL on the PR. Scripted (no agent) — fast and deterministic.",
5
+ "kind": "oneshot",
6
+ "inputs": [
7
+ {
8
+ "name": "pr",
9
+ "flag": "--pr",
10
+ "type": "int",
11
+ "required": true,
12
+ "describe": "PR number to build a preview for."
13
+ }
14
+ ],
15
+ "claudeCode": {
16
+ "model": "inherit",
17
+ "permissionMode": "default",
18
+ "maxTurns": null,
19
+ "maxThinkingTokens": null,
20
+ "systemPromptAppend": null,
21
+ "tools": [],
22
+ "hooks": [],
23
+ "skills": [],
24
+ "commands": [],
25
+ "subagents": [],
26
+ "plugins": [],
27
+ "mcpServers": []
28
+ },
29
+ "cliTools": [
30
+ {
31
+ "name": "docker",
32
+ "install": {
33
+ "required": true,
34
+ "checkCommand": "command -v docker"
35
+ },
36
+ "verify": "docker info",
37
+ "usage": "Builds the per-PR preview image and pushes it to Fly's registry. Available by default on ubuntu-latest GHA runners.",
38
+ "allowedUses": ["build", "push", "login"]
39
+ },
40
+ {
41
+ "name": "gh",
42
+ "install": {
43
+ "required": true,
44
+ "checkCommand": "command -v gh"
45
+ },
46
+ "verify": "gh auth status",
47
+ "usage": "Posts the preview-ready comment on the PR.",
48
+ "allowedUses": ["pr", "api"]
49
+ }
50
+ ],
51
+ "inputArtifacts": [],
52
+ "outputArtifacts": [],
53
+ "scripts": {
54
+ "preflight": [
55
+ {
56
+ "script": "runPreviewBuild"
57
+ }
58
+ ],
59
+ "postflight": []
60
+ }
61
+ }
@@ -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.174",
3
+ "version": "0.4.177",
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",