@lchase/kiln 0.6.0 → 0.6.1
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/README.md +14 -4
- package/dist/sandbox.js +18 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -82,17 +82,27 @@ That is the Anthropic API, the npm registry, and the GitHub hosts a fetch or ins
|
|
|
82
82
|
`kiln sandbox` prints the resolved mode, the allowlist, and anything still missing. `kiln sandbox build` builds the images yak ships but does not publish, from the tag that matches the installed `@lchase/yak`:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
docker build -t yak-agent-sandbox:latest https://github.com/lchase/yak.git#yak-v0.
|
|
86
|
-
docker build -t yak-agent-sandbox-proxy:latest https://github.com/lchase/yak.git#yak-v0.
|
|
85
|
+
docker build -t yak-agent-sandbox:latest https://github.com/lchase/yak.git#yak-v0.8.0:docker/agent-sandbox
|
|
86
|
+
docker build -t yak-agent-sandbox-proxy:latest https://github.com/lchase/yak.git#yak-v0.8.0:docker/agent-proxy
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
The agent image is `node:22-slim` plus the Claude CLI at `/app/claude-cli`. It has no git. `kiln sandbox build` adds `git` and `ca-certificates` and tags that result `yak-agent-sandbox:latest` as well. The proxy image is `yak-agent-sandbox-proxy:latest` (squid on port 3128). Yak mounts the worktree at `/workspace` and puts the container on an `--internal` network whose only egress is that proxy.
|
|
90
90
|
|
|
91
91
|
A linked worktree's `.git` file points at the checkout's common git dir, which is outside that mount. `git` inside the container cannot see the repository until yak mounts that dir too. Land stays on the host, where the worktree link works.
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Podman works when `docker` is aliased to `podman`. Yak 0.8.0 falls back from the `bridge` egress network to `podman` when `bridge` is absent. `YAK_SANDBOX_EGRESS_NETWORK` overrides that name.
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
On macOS, Claude subscription auth lives in the keychain. Yak forwards only `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN` into the container, and never a `~/.claude` directory. Kiln checks that one of those variables is set. It does not print or write the value.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
claude setup-token
|
|
99
|
+
export CLAUDE_CODE_OAUTH_TOKEN
|
|
100
|
+
kiln sandbox build
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Then set the kiln config to `"sandbox": { "mode": "docker" }`.
|
|
104
|
+
|
|
105
|
+
`kiln tick` and `kiln serve` name what is missing when sandbox mode is on: the docker binary, the docker daemon, each image, and the credential. They also refuse an installed `@lchase/yak` that does not pass `allowedDomains` from the agent step into the sandbox proxy. `@lchase/yak` 0.8.0 does. An older package drops `sandbox`, `image`, and `allowedDomains` while loading YAML and opens the proxy with only `api.anthropic.com`, so the job would run on the host with the open internet. Kiln leaves that job failed until `kiln retry`, after the installed package is 0.8.0 or newer.
|
|
96
106
|
|
|
97
107
|
A step that fails with yak reason `sandbox-error` goes to Needs human. The card shows the failure detail. Kiln does not schedule an automatic retry for it. The card of a sandboxed job shows `sandbox · docker` in the same monospace metadata as the rest of the board.
|
|
98
108
|
|
package/dist/sandbox.js
CHANGED
|
@@ -14,10 +14,13 @@ import { jobBasename } from "./paths.js";
|
|
|
14
14
|
* and land commits with the host git identity. Pull requests and
|
|
15
15
|
* `gh pr view` run in the kiln process.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* Preflight searches the installed `@lchase/yak` bundle for
|
|
18
|
+
* `raw.agent.allowedDomains`. `@lchase/yak` 0.8.0 keeps that property
|
|
19
|
+
* access and passes the step allowlist into the sandbox proxy. An older
|
|
20
|
+
* package drops `sandbox`, `image`, and `allowedDomains` while loading
|
|
21
|
+
* workflow YAML and calls `createAgentSandboxNetwork` with only
|
|
22
|
+
* `api.anthropic.com`. Kiln refuses that pin, because the job would run
|
|
23
|
+
* on the host.
|
|
21
24
|
*/
|
|
22
25
|
export const AGENT_SANDBOX_IMAGE = "yak-agent-sandbox:latest";
|
|
23
26
|
export const PROXY_SANDBOX_IMAGE = "yak-agent-sandbox-proxy:latest";
|
|
@@ -167,7 +170,7 @@ export function sandboxPreflightMessage(config, facts) {
|
|
|
167
170
|
return sandboxPreflight(config, facts ?? probeSandboxEnvironment(process.env, requiredSandboxImages(config)));
|
|
168
171
|
}
|
|
169
172
|
/**
|
|
170
|
-
* `docker` argv yak
|
|
173
|
+
* `docker` argv yak builds for one sandboxed agent step
|
|
171
174
|
* (`dockerAgentRunArgs` in `@lchase/yak`). Kiln does not spawn docker
|
|
172
175
|
* itself. Credential values are copied through so a test can show the
|
|
173
176
|
* shape; do not log the result when `env` holds a real token.
|
|
@@ -197,16 +200,21 @@ export function agentSandboxDockerArgs(input) {
|
|
|
197
200
|
...input.cliArgs,
|
|
198
201
|
];
|
|
199
202
|
}
|
|
200
|
-
/**
|
|
201
|
-
|
|
203
|
+
/**
|
|
204
|
+
* Proxy sidecar argv from yak's `startProxyArgs`. `--network` is the
|
|
205
|
+
* egress network (`bridge`, or `podman` when `bridge` is absent), not
|
|
206
|
+
* the internal sandbox network. Yak attaches that internal network only
|
|
207
|
+
* after the proxy accepts connections. Kiln does not spawn the proxy.
|
|
208
|
+
*/
|
|
209
|
+
export function proxySandboxDockerArgs(egressNetwork, allowedDomains, containerName) {
|
|
202
210
|
return [
|
|
203
211
|
"run",
|
|
204
212
|
"-d",
|
|
205
213
|
"--rm",
|
|
206
214
|
"--name",
|
|
207
|
-
|
|
215
|
+
containerName,
|
|
208
216
|
"--network",
|
|
209
|
-
|
|
217
|
+
egressNetwork,
|
|
210
218
|
"-e",
|
|
211
219
|
`ALLOWED_DOMAINS=${allowedDomains.join(",")}`,
|
|
212
220
|
PROXY_SANDBOX_IMAGE,
|
|
@@ -290,7 +298,7 @@ function missingPieces(agentImages, adapter, facts) {
|
|
|
290
298
|
missing.push("no Claude credential for the sandbox. The container only receives ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN. macOS keychain login is not forwarded. Run `claude setup-token` and export CLAUDE_CODE_OAUTH_TOKEN for this kiln process.");
|
|
291
299
|
}
|
|
292
300
|
if (!yakDistHonorsAllowlist(facts.yakDist)) {
|
|
293
|
-
missing.push(`installed @lchase/yak ${facts.yakVersion} does not pass allowedDomains from a workflow step into the sandbox proxy.
|
|
301
|
+
missing.push(`installed @lchase/yak ${facts.yakVersion} does not pass allowedDomains from a workflow step into the sandbox proxy. A package older than 0.8.0 drops sandbox, image, and allowedDomains when it loads workflow YAML, and the proxy allowlist stays api.anthropic.com. Kiln will not launch an unsandboxed run while sandbox mode is docker.`);
|
|
294
302
|
}
|
|
295
303
|
return missing;
|
|
296
304
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lchase/kiln",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Run a workflow on any registered repo. A markdown spec is the input.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=22"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lchase/yak": "0.
|
|
36
|
+
"@lchase/yak": "0.8.0",
|
|
37
37
|
"zod": "^4.6.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|