@wjarka/cezarion 0.14.2-pr406.627 → 0.14.2-pr407.628
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 +1 -17
- package/dist/runs/agent-tmpdir.d.ts +4 -42
- package/dist/runs/agent-tmpdir.js +31 -145
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/server/server.d.ts +58 -58
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -599,7 +599,7 @@ Useful environment variables:
|
|
|
599
599
|
| `GITHUB_TOKEN` | Fallback for GitHub reads/PRs when `gh` isn't authenticated. |
|
|
600
600
|
| `CEZ_ENV_PASSTHROUGH=A,B` | Forward these extra host env vars to spawned agents. By default agents get a least-privilege env (safe shell/toolchain vars + the backend's own auth + `GITHUB_TOKEN` + `CEZ_*`), not your full environment — use this to add a var an agent needs. |
|
|
601
601
|
| `CEZ_AGENT_ENV_FULL=1` | Escape hatch: give spawned agents the full host environment (pre-hardening behavior). Off by default; only set it if you understand that this hands every host secret to the agent process. |
|
|
602
|
-
| `CEZ_AGENT_TMPDIR=0` | Stop giving each task its own temp directory and hand agents the host `TMPDIR` again (pre-#785 behavior). On by default: every run gets `TMPDIR`/`TEMP`/`TMP` pointing at `.ai/cezar/tmp/<task-id>`, created and write-probed before the agent spawns and reaped when the run ends
|
|
602
|
+
| `CEZ_AGENT_TMPDIR=0` | Stop giving each task its own temp directory and hand agents the host `TMPDIR` again (pre-#785 behavior). On by default: every run gets `TMPDIR`/`TEMP`/`TMP` pointing at `.ai/cezar/tmp/<task-id>`, created and write-probed before the agent spawns and reaped when the run ends, so concurrent tasks stop sharing one directory and a task refuses to start rather than run against a temp directory that silently swallows its shell output (see Troubleshooting below). Only an exact `0` disables it, and it disables the whole thing — the pre-spawn check included, so this stays an escape hatch you can actually take. |
|
|
603
603
|
| `CEZ_REDACT_SECRETS=0` | Disable scrubbing of credential values/token shapes from the on-disk state (the NDJSON transcript and the free-text fields of `runs.json`). On by default; leave it on. Controller-generated delegation tokens are always scrubbed. Best-effort defense-in-depth, not a guarantee: it catches known token shapes and the values of your own secret-named env vars, so a credential in neither category can still get through. |
|
|
604
604
|
| `CEZ_TITLE_UPDATES=0` | Turn off the live task-title refresh (namer re-runs on each turn end). The Settings → Agents toggle overrides this default. |
|
|
605
605
|
| `CEZ_AUTONAME=0` | Disable ALL LLM task naming (creation + live) — titles stay heuristic (`437: /om-auto-review-pr`). Under `CEZ_DRY_RUN=1` naming is already off unless forced with `CEZ_AUTONAME=1`. |
|
|
@@ -636,22 +636,6 @@ per-task directory and pre-spawn check alike — and hands agents the host
|
|
|
636
636
|
`TMPDIR` again, which is the way out if the check itself is wrong on your
|
|
637
637
|
platform.
|
|
638
638
|
|
|
639
|
-
### Troubleshooting: tools inside a task fail with a socket-path error
|
|
640
|
-
|
|
641
|
-
**Symptom.** Inside a task, `npm install`, `npm run typecheck`, or another tool
|
|
642
|
-
dies with `listen EINVAL` or a "socket path too long" / `ENAMETOOLONG` error —
|
|
643
|
-
with `TMPDIR=/tmp` set by hand, the same commands succeed. Tools like `tsx` bind
|
|
644
|
-
*named* unix sockets under `TMPDIR` (its IPC server builds
|
|
645
|
-
`<tmpdir>/tsx-<uid>/<pid>.pipe`), and the kernel caps a socket path at 104–108
|
|
646
|
-
bytes — a temp directory near that length leaves no room for the name.
|
|
647
|
-
|
|
648
|
-
**Fix.** Since #387 cezar keeps each task's temp directory at most 78 bytes. A
|
|
649
|
-
checkout deep enough to push `.ai/cezar/tmp/<task-id>` past that limit gets a
|
|
650
|
-
short `cez-agent-…` directory under the system temp directory instead — still
|
|
651
|
-
per-task, still write-probed before the agent spawns, still reaped when the run
|
|
652
|
-
ends. Checkouts whose path already fits keep the repo-local directory.
|
|
653
|
-
`CEZ_AGENT_TMPDIR=0` reverts the whole mechanism to the host `TMPDIR`.
|
|
654
|
-
|
|
655
639
|
---
|
|
656
640
|
|
|
657
641
|
## Coding agent backends
|
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
/** Where a run's agent-scoped temp directory lives. */
|
|
2
2
|
export declare function agentTmpDir(dataDir: string, runId: string): string;
|
|
3
|
-
/**
|
|
4
|
-
* The longest a per-run temp directory may be so that tools binding named
|
|
5
|
-
* unix sockets under it still work (#387). `sockaddr_un.sun_path` holds 108
|
|
6
|
-
* bytes on Linux and 104 on macOS, NUL included; the longest name a known
|
|
7
|
-
* tool lays down under TMPDIR is tsx's IPC socket, `<tmpdir>/tsx-<uid>/
|
|
8
|
-
* <pid>.pipe`, ~22 bytes (Chrome's `SingletonSocket` is 16). A 78-byte
|
|
9
|
-
* ceiling leaves ≥25 bytes of headroom on the tighter platform — past
|
|
10
|
-
* anything these tools generate — while keeping ordinary checkouts on their
|
|
11
|
-
* repo-local scratch: only a genuinely deep path, like the 100-character
|
|
12
|
-
* directories #387 reports, moves to the fallback.
|
|
13
|
-
*/
|
|
14
|
-
export declare const MAX_SOCKET_SAFE_DIR_LENGTH = 78;
|
|
15
|
-
/**
|
|
16
|
-
* The temp directory this run should use: the repo-local per-run directory
|
|
17
|
-
* when it is short enough for unix-socket paths, and a short directory under
|
|
18
|
-
* the OS temp root when it is not (#387). Pure resolution — nothing is
|
|
19
|
-
* created, nothing is probed; `agentTmpEnv` owns the side effects.
|
|
20
|
-
*/
|
|
21
|
-
export declare function resolveAgentTmpDir(dataDir: string, runId: string): string;
|
|
22
3
|
/**
|
|
23
4
|
* The preflight's failure. Named so the spawn path can tell it apart from an
|
|
24
5
|
* ordinary crash and turn it into the run's `error` — the same treatment
|
|
@@ -36,19 +17,12 @@ export declare function agentTmpDirEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
|
36
17
|
* directory actually accepts writes. Throws `AgentTempDirError` when it does
|
|
37
18
|
* not — callers turn that into the run's error rather than spawning.
|
|
38
19
|
*
|
|
39
|
-
* The directory is `resolveAgentTmpDir`'s call: repo-local when that path is
|
|
40
|
-
* short enough for unix-socket paths, a digest-named directory under the OS
|
|
41
|
-
* temp root when the checkout is too deep for one (#387). In the shared OS
|
|
42
|
-
* root the directory is created private to this user (0700); repo-local
|
|
43
|
-
* scratch already sits inside the user's own tree and keeps the default mode
|
|
44
|
-
* it always had.
|
|
45
|
-
*
|
|
46
20
|
* All three spellings are set, on every platform: a tool that reads `TMP` (or
|
|
47
21
|
* `TEMP`) would otherwise keep following the host value straight back to the
|
|
48
22
|
* exhausted directory this exists to escape.
|
|
49
23
|
*
|
|
50
|
-
* Returns `{}` under the opt-out, without probing anything: the hatch turns
|
|
51
|
-
*
|
|
24
|
+
* Returns `{}` under the opt-out, without probing anything: the hatch turns the
|
|
25
|
+
* whole feature off, preflight included, so it stays an escape someone can
|
|
52
26
|
* actually take.
|
|
53
27
|
*/
|
|
54
28
|
export declare function agentTmpEnv(dataDir: string, runId: string, env?: NodeJS.ProcessEnv): Record<string, string>;
|
|
@@ -56,24 +30,12 @@ export declare function agentTmpEnv(dataDir: string, runId: string, env?: NodeJS
|
|
|
56
30
|
* Reap one run's directory. Scratch, not an artifact: nothing reads it once the
|
|
57
31
|
* agent is gone, and a Continue re-creates it through `agentTmpEnv`. Never
|
|
58
32
|
* throws — reaping must not break a terminal transition.
|
|
59
|
-
*
|
|
60
|
-
* Both locations are tried because the resolution depends on the length of
|
|
61
|
-
* `dataDir`, which a Continue or a re-base can change between mint and reap;
|
|
62
|
-
* removing a name that was never minted is a no-op, so trying both is pure
|
|
63
|
-
* safety.
|
|
64
33
|
*/
|
|
65
34
|
export declare function removeAgentTmpDir(dataDir: string, runId: string): void;
|
|
66
35
|
/**
|
|
67
36
|
* Remove every per-run directory that is not in `keepRunIds` — the startup
|
|
68
37
|
* sweep, so a crash (which never reaches the terminal-transition reap) cannot
|
|
69
|
-
* accumulate them forever.
|
|
70
|
-
*
|
|
71
|
-
* - `<dataDir>/tmp`, where entries ARE the run ids (reports the ids reaped);
|
|
72
|
-
* - the OS temp root's `cez-agent-<12 hex>` directories (#387), where the
|
|
73
|
-
* name digests the dataDir and is not reversible to a run id (reports the
|
|
74
|
-
* directory names reaped). The pattern is exact — prefix, lowercase hex,
|
|
75
|
-
* fixed length, directories only — and a directory is removed only when
|
|
76
|
-
* THIS dataDir cannot claim it, so another repo's scratch in the shared
|
|
77
|
-
* root is never touched.
|
|
38
|
+
* accumulate them forever. Confined to `<dataDir>/tmp`; sibling run state is
|
|
39
|
+
* never enumerated, let alone touched. Returns the ids actually reaped.
|
|
78
40
|
*/
|
|
79
41
|
export declare function sweepAgentTmpDirs(dataDir: string, keepRunIds: Iterable<string>): string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Task-scoped temp directory for spawned agents (#785
|
|
2
|
+
* Task-scoped temp directory for spawned agents (#785).
|
|
3
3
|
*
|
|
4
4
|
* Every agent used to inherit the host's `TMPDIR`/`TEMP`/`TMP` verbatim — they
|
|
5
5
|
* ride in on `buildChildEnv`'s base allowlist — so every run on the machine
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* the agent reads back an empty result with a bogus exit status. Nothing in the
|
|
13
13
|
* cockpit says anything is wrong.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* Two properties fix that, and this module owns both:
|
|
16
16
|
*
|
|
17
17
|
* 1. **Isolation** — each run gets `<dataDir>/tmp/<runId>`, on the same disk
|
|
18
18
|
* as the run's own state rather than a shared tmpfs, reaped when the run
|
|
@@ -21,28 +21,15 @@
|
|
|
21
21
|
* 2. **Fail loud** — the directory is write-probed before the backend spawns.
|
|
22
22
|
* A run that cannot get a working temp directory fails immediately with a
|
|
23
23
|
* named, actionable error instead of spawning an agent that will run blind.
|
|
24
|
-
* 3. **Short enough to bind** (#387) — tools bind *named* unix sockets under
|
|
25
|
-
* `TMPDIR` (tsx's IPC server lays down `<tmpdir>/tsx-<uid>/<pid>.pipe`,
|
|
26
|
-
* Chrome a `SingletonSocket`), and the kernel caps a socket path at
|
|
27
|
-
* `sun_path` — 108 bytes on Linux, 104 on macOS, NUL included. A checkout
|
|
28
|
-
* deep enough (Cezar's own nested task worktrees land past 100 chars)
|
|
29
|
-
* pushed every such bind past the cap and broke `npm install` and
|
|
30
|
-
* typechecking inside the run. A directory that would land too deep
|
|
31
|
-
* resolves instead to a short digest-named directory under the OS temp
|
|
32
|
-
* root — still per-run, still probed, still reaped. A repo whose own path
|
|
33
|
-
* already fits keeps today's directory, byte for byte.
|
|
34
24
|
*
|
|
35
|
-
* `CEZ_AGENT_TMPDIR=0` opts out of
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* run.
|
|
25
|
+
* `CEZ_AGENT_TMPDIR=0` opts out of BOTH — cezar keeps its hands off the temp
|
|
26
|
+
* directory entirely and the pre-#785 behaviour is back, byte for byte. That is
|
|
27
|
+
* deliberate: an escape hatch that still imposed the preflight would be a hatch
|
|
28
|
+
* you cannot actually escape through, and this repo's graceful-degradation rule
|
|
29
|
+
* says a new check must never become the only way to run.
|
|
41
30
|
*/
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import { tmpdir } from 'node:os';
|
|
45
|
-
import { basename, join } from 'node:path';
|
|
31
|
+
import { existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
32
|
+
import { join } from 'node:path';
|
|
46
33
|
/** Run ids are uuids; anything else must never reach a recursive `rmSync`.
|
|
47
34
|
*
|
|
48
35
|
* `.` and `..` are excluded explicitly, not as pedantry: they match the
|
|
@@ -61,58 +48,6 @@ export function agentTmpDir(dataDir, runId) {
|
|
|
61
48
|
function agentTmpRoot(dataDir) {
|
|
62
49
|
return join(dataDir, 'tmp');
|
|
63
50
|
}
|
|
64
|
-
/**
|
|
65
|
-
* The longest a per-run temp directory may be so that tools binding named
|
|
66
|
-
* unix sockets under it still work (#387). `sockaddr_un.sun_path` holds 108
|
|
67
|
-
* bytes on Linux and 104 on macOS, NUL included; the longest name a known
|
|
68
|
-
* tool lays down under TMPDIR is tsx's IPC socket, `<tmpdir>/tsx-<uid>/
|
|
69
|
-
* <pid>.pipe`, ~22 bytes (Chrome's `SingletonSocket` is 16). A 78-byte
|
|
70
|
-
* ceiling leaves ≥25 bytes of headroom on the tighter platform — past
|
|
71
|
-
* anything these tools generate — while keeping ordinary checkouts on their
|
|
72
|
-
* repo-local scratch: only a genuinely deep path, like the 100-character
|
|
73
|
-
* directories #387 reports, moves to the fallback.
|
|
74
|
-
*/
|
|
75
|
-
export const MAX_SOCKET_SAFE_DIR_LENGTH = 78;
|
|
76
|
-
/** The OS temp root, symlink-resolved: `bind(2)` bounds the path the kernel
|
|
77
|
-
* walks, so the check must measure what the path resolves to, not what it
|
|
78
|
-
* says (macOS hands out `/var/folders/...` through a `/private/var` symlink). */
|
|
79
|
-
function osTempRoot() {
|
|
80
|
-
try {
|
|
81
|
-
return realpathSync(tmpdir());
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
return tmpdir();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const FALLBACK_PREFIX = 'cez-agent-';
|
|
88
|
-
const FALLBACK_NAME_LENGTH = 12;
|
|
89
|
-
/**
|
|
90
|
-
* Where the fallback lives for this dataDir+run pair. The name digests the
|
|
91
|
-
* dataDir in, because the OS temp root is SHARED: a name derived from the run
|
|
92
|
-
* id alone would let one repo's reap or sweep delete another repo's live
|
|
93
|
-
* scratch when two run ids happen to share their leading characters.
|
|
94
|
-
*/
|
|
95
|
-
function fallbackTmpDir(dataDir, runId) {
|
|
96
|
-
const digest = createHash('sha256').update(`${dataDir}:${runId}`).digest('hex');
|
|
97
|
-
return join(osTempRoot(), FALLBACK_PREFIX + digest.slice(0, FALLBACK_NAME_LENGTH));
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* The temp directory this run should use: the repo-local per-run directory
|
|
101
|
-
* when it is short enough for unix-socket paths, and a short directory under
|
|
102
|
-
* the OS temp root when it is not (#387). Pure resolution — nothing is
|
|
103
|
-
* created, nothing is probed; `agentTmpEnv` owns the side effects.
|
|
104
|
-
*/
|
|
105
|
-
export function resolveAgentTmpDir(dataDir, runId) {
|
|
106
|
-
const local = agentTmpDir(dataDir, runId);
|
|
107
|
-
if (local.length <= MAX_SOCKET_SAFE_DIR_LENGTH)
|
|
108
|
-
return local;
|
|
109
|
-
const fallback = fallbackTmpDir(dataDir, runId);
|
|
110
|
-
if (fallback.length <= MAX_SOCKET_SAFE_DIR_LENGTH)
|
|
111
|
-
return fallback;
|
|
112
|
-
// No candidate fits (a pathological host TMPDIR over a pathological repo
|
|
113
|
-
// path together): keep whichever leaves socket names the most room.
|
|
114
|
-
return fallback.length < local.length ? fallback : local;
|
|
115
|
-
}
|
|
116
51
|
/** `errno` → the phrasing a human recognises from their shell. */
|
|
117
52
|
const REASONS = {
|
|
118
53
|
EDQUOT: 'Disk quota exceeded',
|
|
@@ -175,28 +110,20 @@ function probeWritable(dir) {
|
|
|
175
110
|
* directory actually accepts writes. Throws `AgentTempDirError` when it does
|
|
176
111
|
* not — callers turn that into the run's error rather than spawning.
|
|
177
112
|
*
|
|
178
|
-
* The directory is `resolveAgentTmpDir`'s call: repo-local when that path is
|
|
179
|
-
* short enough for unix-socket paths, a digest-named directory under the OS
|
|
180
|
-
* temp root when the checkout is too deep for one (#387). In the shared OS
|
|
181
|
-
* root the directory is created private to this user (0700); repo-local
|
|
182
|
-
* scratch already sits inside the user's own tree and keeps the default mode
|
|
183
|
-
* it always had.
|
|
184
|
-
*
|
|
185
113
|
* All three spellings are set, on every platform: a tool that reads `TMP` (or
|
|
186
114
|
* `TEMP`) would otherwise keep following the host value straight back to the
|
|
187
115
|
* exhausted directory this exists to escape.
|
|
188
116
|
*
|
|
189
|
-
* Returns `{}` under the opt-out, without probing anything: the hatch turns
|
|
190
|
-
*
|
|
117
|
+
* Returns `{}` under the opt-out, without probing anything: the hatch turns the
|
|
118
|
+
* whole feature off, preflight included, so it stays an escape someone can
|
|
191
119
|
* actually take.
|
|
192
120
|
*/
|
|
193
121
|
export function agentTmpEnv(dataDir, runId, env = process.env) {
|
|
194
122
|
if (!agentTmpDirEnabled(env))
|
|
195
123
|
return {};
|
|
196
|
-
const
|
|
197
|
-
const dir = resolveAgentTmpDir(dataDir, runId);
|
|
124
|
+
const dir = agentTmpDir(dataDir, runId);
|
|
198
125
|
try {
|
|
199
|
-
mkdirSync(dir,
|
|
126
|
+
mkdirSync(dir, { recursive: true });
|
|
200
127
|
}
|
|
201
128
|
catch (err) {
|
|
202
129
|
throw new AgentTempDirError(dir, err);
|
|
@@ -208,85 +135,44 @@ export function agentTmpEnv(dataDir, runId, env = process.env) {
|
|
|
208
135
|
* Reap one run's directory. Scratch, not an artifact: nothing reads it once the
|
|
209
136
|
* agent is gone, and a Continue re-creates it through `agentTmpEnv`. Never
|
|
210
137
|
* throws — reaping must not break a terminal transition.
|
|
211
|
-
*
|
|
212
|
-
* Both locations are tried because the resolution depends on the length of
|
|
213
|
-
* `dataDir`, which a Continue or a re-base can change between mint and reap;
|
|
214
|
-
* removing a name that was never minted is a no-op, so trying both is pure
|
|
215
|
-
* safety.
|
|
216
138
|
*/
|
|
217
139
|
export function removeAgentTmpDir(dataDir, runId) {
|
|
218
140
|
if (!safeRunId(runId))
|
|
219
141
|
return;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
// best-effort; the startup sweep picks up whatever survives.
|
|
226
|
-
}
|
|
142
|
+
try {
|
|
143
|
+
rmSync(agentTmpDir(dataDir, runId), { recursive: true, force: true });
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
// best-effort; the startup sweep picks up whatever survives.
|
|
227
147
|
}
|
|
228
148
|
}
|
|
229
149
|
/**
|
|
230
150
|
* Remove every per-run directory that is not in `keepRunIds` — the startup
|
|
231
151
|
* sweep, so a crash (which never reaches the terminal-transition reap) cannot
|
|
232
|
-
* accumulate them forever.
|
|
233
|
-
*
|
|
234
|
-
* - `<dataDir>/tmp`, where entries ARE the run ids (reports the ids reaped);
|
|
235
|
-
* - the OS temp root's `cez-agent-<12 hex>` directories (#387), where the
|
|
236
|
-
* name digests the dataDir and is not reversible to a run id (reports the
|
|
237
|
-
* directory names reaped). The pattern is exact — prefix, lowercase hex,
|
|
238
|
-
* fixed length, directories only — and a directory is removed only when
|
|
239
|
-
* THIS dataDir cannot claim it, so another repo's scratch in the shared
|
|
240
|
-
* root is never touched.
|
|
152
|
+
* accumulate them forever. Confined to `<dataDir>/tmp`; sibling run state is
|
|
153
|
+
* never enumerated, let alone touched. Returns the ids actually reaped.
|
|
241
154
|
*/
|
|
242
155
|
export function sweepAgentTmpDirs(dataDir, keepRunIds) {
|
|
156
|
+
const root = agentTmpRoot(dataDir);
|
|
157
|
+
if (!existsSync(root))
|
|
158
|
+
return [];
|
|
243
159
|
const keep = new Set(keepRunIds);
|
|
244
160
|
const reaped = [];
|
|
245
161
|
let entries;
|
|
246
|
-
const root = agentTmpRoot(dataDir);
|
|
247
|
-
if (existsSync(root)) {
|
|
248
|
-
try {
|
|
249
|
-
entries = readdirSync(root, { withFileTypes: true })
|
|
250
|
-
.filter((e) => e.isDirectory())
|
|
251
|
-
.map((e) => e.name);
|
|
252
|
-
}
|
|
253
|
-
catch {
|
|
254
|
-
entries = [];
|
|
255
|
-
}
|
|
256
|
-
for (const name of entries) {
|
|
257
|
-
if (keep.has(name) || !safeRunId(name))
|
|
258
|
-
continue;
|
|
259
|
-
try {
|
|
260
|
-
rmSync(join(root, name), { recursive: true, force: true });
|
|
261
|
-
reaped.push(name);
|
|
262
|
-
}
|
|
263
|
-
catch {
|
|
264
|
-
// best-effort: a locked directory is retried on the next boot.
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
// The #387 fallback location, in the shared OS temp root. Kept narrow on
|
|
269
|
-
// purpose: exact prefix, 12 lowercase-hex name, directories only, and only
|
|
270
|
-
// names this dataDir cannot claim.
|
|
271
|
-
const claimed = new Set([...keep].filter(safeRunId).map((id) => basename(fallbackTmpDir(dataDir, id))));
|
|
272
|
-
const osRoot = osTempRoot();
|
|
273
|
-
let fallbackEntries;
|
|
274
162
|
try {
|
|
275
|
-
|
|
163
|
+
entries = readdirSync(root, { withFileTypes: true })
|
|
164
|
+
.filter((e) => e.isDirectory())
|
|
165
|
+
.map((e) => e.name);
|
|
276
166
|
}
|
|
277
167
|
catch {
|
|
278
|
-
return
|
|
168
|
+
return [];
|
|
279
169
|
}
|
|
280
|
-
for (const
|
|
281
|
-
if (
|
|
282
|
-
continue;
|
|
283
|
-
if (!/^[0-9a-f]{12}$/.test(entry.name.slice(FALLBACK_PREFIX.length)))
|
|
284
|
-
continue;
|
|
285
|
-
if (claimed.has(entry.name))
|
|
170
|
+
for (const name of entries) {
|
|
171
|
+
if (keep.has(name) || !safeRunId(name))
|
|
286
172
|
continue;
|
|
287
173
|
try {
|
|
288
|
-
rmSync(join(
|
|
289
|
-
reaped.push(
|
|
174
|
+
rmSync(join(root, name), { recursive: true, force: true });
|
|
175
|
+
reaped.push(name);
|
|
290
176
|
}
|
|
291
177
|
catch {
|
|
292
178
|
// best-effort: a locked directory is retried on the next boot.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tmpdir.js","sourceRoot":"","sources":["../../src/runs/agent-tmpdir.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-tmpdir.js","sourceRoot":"","sources":["../../src/runs/agent-tmpdir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;8EAK8E;AAC9E,SAAS,SAAS,CAAC,EAAU;IAC3B,OAAO,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,IA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AC;AAChB,CAAC"}
|
package/dist/server/server.d.ts
CHANGED
|
@@ -3962,19 +3962,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
3962
3962
|
} & {
|
|
3963
3963
|
"/repo/commit/:sha": {
|
|
3964
3964
|
$get: {
|
|
3965
|
-
output: string;
|
|
3966
|
-
outputFormat: "text";
|
|
3967
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
3968
|
-
input: {
|
|
3969
|
-
query: {
|
|
3970
|
-
structured?: string | undefined;
|
|
3971
|
-
};
|
|
3972
|
-
} & {
|
|
3973
|
-
param: {
|
|
3974
|
-
sha: string;
|
|
3975
|
-
};
|
|
3976
|
-
};
|
|
3977
|
-
} | {
|
|
3978
3965
|
output: {
|
|
3979
3966
|
error: string;
|
|
3980
3967
|
code?: "invalid_input" | undefined;
|
|
@@ -4038,6 +4025,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4038
4025
|
sha: string;
|
|
4039
4026
|
};
|
|
4040
4027
|
};
|
|
4028
|
+
} | {
|
|
4029
|
+
output: string;
|
|
4030
|
+
outputFormat: "text";
|
|
4031
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
4032
|
+
input: {
|
|
4033
|
+
query: {
|
|
4034
|
+
structured?: string | undefined;
|
|
4035
|
+
};
|
|
4036
|
+
} & {
|
|
4037
|
+
param: {
|
|
4038
|
+
sha: string;
|
|
4039
|
+
};
|
|
4040
|
+
};
|
|
4041
4041
|
};
|
|
4042
4042
|
};
|
|
4043
4043
|
} & {
|
|
@@ -10098,20 +10098,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
10098
10098
|
} & {
|
|
10099
10099
|
"/runs/:id/handoff": {
|
|
10100
10100
|
$get: {
|
|
10101
|
-
output:
|
|
10102
|
-
|
|
10103
|
-
|
|
10101
|
+
output: {
|
|
10102
|
+
error: string;
|
|
10103
|
+
};
|
|
10104
|
+
outputFormat: "json";
|
|
10105
|
+
status: 404;
|
|
10104
10106
|
input: {
|
|
10105
10107
|
param: {
|
|
10106
10108
|
id: string;
|
|
10107
10109
|
};
|
|
10108
10110
|
};
|
|
10109
10111
|
} | {
|
|
10110
|
-
output:
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
outputFormat: "json";
|
|
10114
|
-
status: 404;
|
|
10112
|
+
output: string;
|
|
10113
|
+
outputFormat: "text";
|
|
10114
|
+
status: 200;
|
|
10115
10115
|
input: {
|
|
10116
10116
|
param: {
|
|
10117
10117
|
id: string;
|
|
@@ -10149,20 +10149,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
10149
10149
|
} & {
|
|
10150
10150
|
"/runs/:id/diff": {
|
|
10151
10151
|
$get: {
|
|
10152
|
-
output:
|
|
10153
|
-
|
|
10154
|
-
|
|
10152
|
+
output: {
|
|
10153
|
+
error: string;
|
|
10154
|
+
};
|
|
10155
|
+
outputFormat: "json";
|
|
10156
|
+
status: 404;
|
|
10155
10157
|
input: {
|
|
10156
10158
|
param: {
|
|
10157
10159
|
id: string;
|
|
10158
10160
|
};
|
|
10159
10161
|
};
|
|
10160
10162
|
} | {
|
|
10161
|
-
output:
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
outputFormat: "json";
|
|
10165
|
-
status: 404;
|
|
10163
|
+
output: string;
|
|
10164
|
+
outputFormat: "text";
|
|
10165
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
10166
10166
|
input: {
|
|
10167
10167
|
param: {
|
|
10168
10168
|
id: string;
|
|
@@ -12539,19 +12539,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
12539
12539
|
} & {
|
|
12540
12540
|
"/repo/commit/:sha": {
|
|
12541
12541
|
$get: {
|
|
12542
|
-
output: string;
|
|
12543
|
-
outputFormat: "text";
|
|
12544
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
12545
|
-
input: {
|
|
12546
|
-
query: {
|
|
12547
|
-
structured?: string | undefined;
|
|
12548
|
-
};
|
|
12549
|
-
} & {
|
|
12550
|
-
param: {
|
|
12551
|
-
sha: string;
|
|
12552
|
-
};
|
|
12553
|
-
};
|
|
12554
|
-
} | {
|
|
12555
12542
|
output: {
|
|
12556
12543
|
error: string;
|
|
12557
12544
|
code?: "invalid_input" | undefined;
|
|
@@ -12615,6 +12602,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
12615
12602
|
sha: string;
|
|
12616
12603
|
};
|
|
12617
12604
|
};
|
|
12605
|
+
} | {
|
|
12606
|
+
output: string;
|
|
12607
|
+
outputFormat: "text";
|
|
12608
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
12609
|
+
input: {
|
|
12610
|
+
query: {
|
|
12611
|
+
structured?: string | undefined;
|
|
12612
|
+
};
|
|
12613
|
+
} & {
|
|
12614
|
+
param: {
|
|
12615
|
+
sha: string;
|
|
12616
|
+
};
|
|
12617
|
+
};
|
|
12618
12618
|
};
|
|
12619
12619
|
};
|
|
12620
12620
|
} & {
|
|
@@ -18675,20 +18675,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
18675
18675
|
} & {
|
|
18676
18676
|
"/runs/:id/handoff": {
|
|
18677
18677
|
$get: {
|
|
18678
|
-
output:
|
|
18679
|
-
|
|
18680
|
-
|
|
18678
|
+
output: {
|
|
18679
|
+
error: string;
|
|
18680
|
+
};
|
|
18681
|
+
outputFormat: "json";
|
|
18682
|
+
status: 404;
|
|
18681
18683
|
input: {
|
|
18682
18684
|
param: {
|
|
18683
18685
|
id: string;
|
|
18684
18686
|
};
|
|
18685
18687
|
};
|
|
18686
18688
|
} | {
|
|
18687
|
-
output:
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
outputFormat: "json";
|
|
18691
|
-
status: 404;
|
|
18689
|
+
output: string;
|
|
18690
|
+
outputFormat: "text";
|
|
18691
|
+
status: 200;
|
|
18692
18692
|
input: {
|
|
18693
18693
|
param: {
|
|
18694
18694
|
id: string;
|
|
@@ -18726,20 +18726,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
18726
18726
|
} & {
|
|
18727
18727
|
"/runs/:id/diff": {
|
|
18728
18728
|
$get: {
|
|
18729
|
-
output:
|
|
18730
|
-
|
|
18731
|
-
|
|
18729
|
+
output: {
|
|
18730
|
+
error: string;
|
|
18731
|
+
};
|
|
18732
|
+
outputFormat: "json";
|
|
18733
|
+
status: 404;
|
|
18732
18734
|
input: {
|
|
18733
18735
|
param: {
|
|
18734
18736
|
id: string;
|
|
18735
18737
|
};
|
|
18736
18738
|
};
|
|
18737
18739
|
} | {
|
|
18738
|
-
output:
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
outputFormat: "json";
|
|
18742
|
-
status: 404;
|
|
18740
|
+
output: string;
|
|
18741
|
+
outputFormat: "text";
|
|
18742
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
18743
18743
|
input: {
|
|
18744
18744
|
param: {
|
|
18745
18745
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wjarka/cezarion",
|
|
3
|
-
"version": "0.14.2-
|
|
3
|
+
"version": "0.14.2-pr407.628",
|
|
4
4
|
"description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@open-mercato/cezar-api-client": "0.14.2-
|
|
54
|
-
"@open-mercato/cezar-contract": "0.14.2-
|
|
53
|
+
"@open-mercato/cezar-api-client": "0.14.2-pr407.628",
|
|
54
|
+
"@open-mercato/cezar-contract": "0.14.2-pr407.628",
|
|
55
55
|
"@types/node": "^20.14.0",
|
|
56
56
|
"@types/ws": "^8.18.1",
|
|
57
57
|
"esbuild": "^0.28.1",
|