@wjarka/cezarion 0.14.3-pr445.674 → 0.14.3-pr445.678
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/runs/agent-tmpdir.d.ts +20 -11
- package/dist/runs/agent-tmpdir.js +109 -60
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{commit-list-BeUMZVTG.js → commit-list-qdzAPi8Z.js} +1 -1
- package/web/dist/assets/{compare-variants-C6cWQRm6.js → compare-variants-C6_Cv6VF.js} +1 -1
- package/web/dist/assets/{github-DOdsQOK1.js → github-BQqHSJy_.js} +1 -1
- package/web/dist/assets/{index-Bgof7Re_.js → index-CLWCibEp.js} +2 -2
- package/web/dist/assets/{repo-git-DrwyyyTd.js → repo-git-DhF1KMFd.js} +1 -1
- package/web/dist/assets/{skills-Cic3wuT0.js → skills-DnmPLWJD.js} +1 -1
- package/web/dist/assets/{task-changes-BTeip8SF.js → task-changes-CcwZXXmr.js} +1 -1
- package/web/dist/assets/{task-commits-_B5Er_bk.js → task-commits-HNUeqwZs.js} +1 -1
- package/web/dist/assets/{task-files-gBSmQiWh.js → task-files-D98MFv71.js} +1 -1
- package/web/dist/assets/{task-thread-DpWTRA9Y.js → task-thread-D1KURj8H.js} +8 -8
- package/web/dist/assets/{workflows-bnMSTYwO.js → workflows-CxIz1O58.js} +1 -1
- package/web/dist/index.html +1 -1
|
@@ -13,11 +13,18 @@ export declare function agentTmpDir(dataDir: string, runId: string): string;
|
|
|
13
13
|
* like the 100-character directories #387 reports, moves to the fallback.
|
|
14
14
|
*/
|
|
15
15
|
export declare const MAX_SOCKET_SAFE_DIR_LENGTH = 78;
|
|
16
|
+
/** The first path whose UTF-8 byte length fits the socket budget, or
|
|
17
|
+
* `undefined` when none does. Pure on purpose (#440): resolution calls it
|
|
18
|
+
* with the real candidates, tests with synthetic ones, so the nothing-fits
|
|
19
|
+
* branch stays exercised even though a real platform root is always short. */
|
|
20
|
+
export declare function firstSocketSafeDir(paths: readonly string[]): string | undefined;
|
|
16
21
|
/**
|
|
17
22
|
* The temp directory this run should use: the repo-local per-run directory
|
|
18
|
-
* when it is short enough for unix-socket paths, and a short
|
|
19
|
-
* the OS temp root
|
|
20
|
-
*
|
|
23
|
+
* when it is short enough for unix-socket paths, and otherwise a short
|
|
24
|
+
* digest-named directory under the first OS temp root whose candidate fits —
|
|
25
|
+
* the env-honouring root first, the platform default when `TMPDIR` itself is
|
|
26
|
+
* too deep (#387, #440). Pure resolution — nothing is created, nothing is
|
|
27
|
+
* probed; `agentTmpEnv` owns the side effects.
|
|
21
28
|
*/
|
|
22
29
|
export declare function resolveAgentTmpDir(dataDir: string, runId: string): string;
|
|
23
30
|
/**
|
|
@@ -58,24 +65,26 @@ export declare function agentTmpEnv(dataDir: string, runId: string, env?: NodeJS
|
|
|
58
65
|
* agent is gone, and a Continue re-creates it through `agentTmpEnv`. Never
|
|
59
66
|
* throws — reaping must not break a terminal transition.
|
|
60
67
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
68
|
+
* The repo-local directory and the digest name under EVERY root are tried,
|
|
69
|
+
* because the resolution depends on the lengths of `dataDir` and the ambient
|
|
70
|
+
* `TMPDIR`, either of which a Continue, a re-base or a changed env can move
|
|
71
|
+
* between mint and reap; removing a name that was never minted is a no-op, so
|
|
72
|
+
* trying them all is pure safety.
|
|
65
73
|
*/
|
|
66
74
|
export declare function removeAgentTmpDir(dataDir: string, runId: string): void;
|
|
67
75
|
/**
|
|
68
76
|
* Remove every per-run directory that is not in `keepRunIds` — the startup
|
|
69
77
|
* sweep, so a crash (which never reaches the terminal-transition reap) cannot
|
|
70
|
-
* accumulate them forever.
|
|
78
|
+
* accumulate them forever. Three confined sets are swept and nothing else:
|
|
71
79
|
*
|
|
72
80
|
* - `<dataDir>/tmp`, where entries ARE the run ids (reports the ids reaped);
|
|
73
|
-
* - the
|
|
74
|
-
*
|
|
81
|
+
* - the `cez-agent-<12 hex>` directories under EVERY OS temp root — the
|
|
82
|
+
* env-honouring root and the platform default (#440) — where the name
|
|
83
|
+
* digests the dataDir and is not reversible to a run id (reports the
|
|
75
84
|
* directory names reaped). The pattern is exact — prefix, lowercase hex,
|
|
76
85
|
* fixed length, directories only — and a directory is removed only when
|
|
77
86
|
* its `.cez-owner` marker names THIS dataDir and none of this dataDir's
|
|
78
|
-
* kept runs claims it, so another project's scratch in
|
|
87
|
+
* kept runs claims it, so another project's scratch in a shared root is
|
|
79
88
|
* never touched.
|
|
80
89
|
*/
|
|
81
90
|
export declare function sweepAgentTmpDirs(dataDir: string, keepRunIds: Iterable<string>): string[];
|
|
@@ -30,7 +30,12 @@
|
|
|
30
30
|
* typechecking inside the run. A directory that would land too deep
|
|
31
31
|
* resolves instead to a short digest-named directory under the OS temp
|
|
32
32
|
* root — still per-run, still probed, still reaped. A repo whose own path
|
|
33
|
-
* already fits keeps today's directory, byte for byte.
|
|
33
|
+
* already fits keeps today's directory, byte for byte. When the ambient
|
|
34
|
+
* `TMPDIR` itself is too deep for that root's candidate (#440 — routine
|
|
35
|
+
* inside a cezar task session, whose `TMPDIR` is the checkout's own
|
|
36
|
+
* scratch tree per #785), the next root is the platform's own temp root
|
|
37
|
+
* (`/tmp`), which `TMPDIR` cannot deepen; only when no root fits does the
|
|
38
|
+
* spawn refuse.
|
|
34
39
|
*
|
|
35
40
|
* `CEZ_AGENT_TMPDIR=0` opts out of ALL THREE — cezar keeps its hands off the
|
|
36
41
|
* temp directory entirely and the pre-#785 behaviour is back, byte for byte.
|
|
@@ -85,6 +90,33 @@ function osTempRoot() {
|
|
|
85
90
|
return tmpdir();
|
|
86
91
|
}
|
|
87
92
|
}
|
|
93
|
+
/** The platform's own temp root — the one `TMPDIR`/`TEMP`/`TMP` cannot move.
|
|
94
|
+
* POSIX spells it `/tmp` (resolved through symlinks for the same reason
|
|
95
|
+
* `osTempRoot` resolves them). Windows has no such constant and no named
|
|
96
|
+
* unix sockets to protect, so it contributes no second root and keeps
|
|
97
|
+
* today's single-root behaviour. */
|
|
98
|
+
function platformTempRoot() {
|
|
99
|
+
if (process.platform === 'win32')
|
|
100
|
+
return undefined;
|
|
101
|
+
try {
|
|
102
|
+
return realpathSync('/tmp');
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return '/tmp';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** Every root a fallback directory can hang off, most preferred first: the
|
|
109
|
+
* env-honouring OS temp root, then the platform default (#440). A cezar task
|
|
110
|
+
* session exports a `TMPDIR` as deep as the checkout it belongs to (#785),
|
|
111
|
+
* so the first root's candidate can itself cross the socket cap while the
|
|
112
|
+
* platform default still fits. Resolution picks the first root whose
|
|
113
|
+
* candidate fits; removal and the sweep walk them all, because the env can
|
|
114
|
+
* differ between mint and reap. */
|
|
115
|
+
function osTempRoots() {
|
|
116
|
+
const env = osTempRoot();
|
|
117
|
+
const platform = platformTempRoot();
|
|
118
|
+
return platform && platform !== env ? [env, platform] : [env];
|
|
119
|
+
}
|
|
88
120
|
const FALLBACK_PREFIX = 'cez-agent-';
|
|
89
121
|
const FALLBACK_NAME_LENGTH = 12;
|
|
90
122
|
/** The marker file inside a fallback directory naming the dataDir that minted
|
|
@@ -124,39 +156,52 @@ function writeOwnerMarker(dir, dataDir) {
|
|
|
124
156
|
}
|
|
125
157
|
}
|
|
126
158
|
/**
|
|
127
|
-
* Where the fallback lives for this dataDir+run pair. The name
|
|
128
|
-
* dataDir in, because the OS temp
|
|
129
|
-
* id alone would let one repo's reap delete another repo's live
|
|
130
|
-
* two run ids happen to share their leading characters. The name
|
|
131
|
-
* make the sweep safe — a digest is not reversible, so a sweep
|
|
132
|
-
* its own stale directories from another project's live ones —
|
|
133
|
-
* every fallback directory also carries the `.cez-owner` marker.
|
|
159
|
+
* Where the fallback lives for this dataDir+run pair under one root. The name
|
|
160
|
+
* digests the dataDir in, because the OS temp roots are SHARED: a name derived
|
|
161
|
+
* from the run id alone would let one repo's reap delete another repo's live
|
|
162
|
+
* scratch when two run ids happen to share their leading characters. The name
|
|
163
|
+
* alone cannot make the sweep safe — a digest is not reversible, so a sweep
|
|
164
|
+
* could not tell its own stale directories from another project's live ones —
|
|
165
|
+
* which is why every fallback directory also carries the `.cez-owner` marker.
|
|
166
|
+
* The digest does not include the root, so the name is stable across roots:
|
|
167
|
+
* whatever env a later reap or sweep runs under, it can find the directory.
|
|
134
168
|
*/
|
|
135
|
-
function fallbackTmpDir(dataDir, runId) {
|
|
169
|
+
function fallbackTmpDir(root, dataDir, runId) {
|
|
136
170
|
const digest = createHash('sha256').update(`${dataDir}:${runId}`).digest('hex');
|
|
137
|
-
return join(
|
|
171
|
+
return join(root, FALLBACK_PREFIX + digest.slice(0, FALLBACK_NAME_LENGTH));
|
|
172
|
+
}
|
|
173
|
+
/** The first path whose UTF-8 byte length fits the socket budget, or
|
|
174
|
+
* `undefined` when none does. Pure on purpose (#440): resolution calls it
|
|
175
|
+
* with the real candidates, tests with synthetic ones, so the nothing-fits
|
|
176
|
+
* branch stays exercised even though a real platform root is always short. */
|
|
177
|
+
export function firstSocketSafeDir(paths) {
|
|
178
|
+
return paths.find((path) => Buffer.byteLength(path, 'utf8') <= MAX_SOCKET_SAFE_DIR_LENGTH);
|
|
138
179
|
}
|
|
139
180
|
/**
|
|
140
181
|
* The temp directory this run should use: the repo-local per-run directory
|
|
141
|
-
* when it is short enough for unix-socket paths, and a short
|
|
142
|
-
* the OS temp root
|
|
143
|
-
*
|
|
182
|
+
* when it is short enough for unix-socket paths, and otherwise a short
|
|
183
|
+
* digest-named directory under the first OS temp root whose candidate fits —
|
|
184
|
+
* the env-honouring root first, the platform default when `TMPDIR` itself is
|
|
185
|
+
* too deep (#387, #440). Pure resolution — nothing is created, nothing is
|
|
186
|
+
* probed; `agentTmpEnv` owns the side effects.
|
|
144
187
|
*/
|
|
145
188
|
export function resolveAgentTmpDir(dataDir, runId) {
|
|
146
189
|
const local = agentTmpDir(dataDir, runId);
|
|
147
190
|
if (Buffer.byteLength(local, 'utf8') <= MAX_SOCKET_SAFE_DIR_LENGTH)
|
|
148
191
|
return local;
|
|
149
|
-
const
|
|
150
|
-
|
|
192
|
+
const candidates = osTempRoots().map((root) => fallbackTmpDir(root, dataDir, runId));
|
|
193
|
+
const fallback = firstSocketSafeDir(candidates);
|
|
194
|
+
if (fallback)
|
|
151
195
|
return fallback;
|
|
152
|
-
// Nothing fits —
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
+ `${Buffer.byteLength(
|
|
159
|
-
+ `${MAX_SOCKET_SAFE_DIR_LENGTH}-byte unix socket budget`
|
|
196
|
+
// Nothing fits — every root, the platform default included, has a candidate
|
|
197
|
+
// past the cap. Minting any would hand the agent a temp directory that
|
|
198
|
+
// cannot serve unix sockets: the silent failure #387 is about. Fail the
|
|
199
|
+
// spawn with the named error instead; the remedy names the escape.
|
|
200
|
+
const shortest = candidates.reduce((a, b) => Buffer.byteLength(a, 'utf8') < Buffer.byteLength(b, 'utf8') ? a : b);
|
|
201
|
+
throw new AgentTempDirError(Buffer.byteLength(shortest) < Buffer.byteLength(local) ? shortest : local, new Error(`no socket-safe temp directory exists — repo-local path is `
|
|
202
|
+
+ `${Buffer.byteLength(local)} bytes and every OS temp root candidate is past the `
|
|
203
|
+
+ `${MAX_SOCKET_SAFE_DIR_LENGTH}-byte unix socket budget (tried: `
|
|
204
|
+
+ candidates.map((c) => `${c} (${Buffer.byteLength(c)} bytes)`).join(', ') + ')'));
|
|
160
205
|
}
|
|
161
206
|
/** `errno` → the phrasing a human recognises from their shell. */
|
|
162
207
|
const REASONS = {
|
|
@@ -259,15 +304,17 @@ export function agentTmpEnv(dataDir, runId, env = process.env) {
|
|
|
259
304
|
* agent is gone, and a Continue re-creates it through `agentTmpEnv`. Never
|
|
260
305
|
* throws — reaping must not break a terminal transition.
|
|
261
306
|
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
307
|
+
* The repo-local directory and the digest name under EVERY root are tried,
|
|
308
|
+
* because the resolution depends on the lengths of `dataDir` and the ambient
|
|
309
|
+
* `TMPDIR`, either of which a Continue, a re-base or a changed env can move
|
|
310
|
+
* between mint and reap; removing a name that was never minted is a no-op, so
|
|
311
|
+
* trying them all is pure safety.
|
|
266
312
|
*/
|
|
267
313
|
export function removeAgentTmpDir(dataDir, runId) {
|
|
268
314
|
if (!safeRunId(runId))
|
|
269
315
|
return;
|
|
270
|
-
|
|
316
|
+
const locations = [agentTmpDir(dataDir, runId), ...osTempRoots().map((root) => fallbackTmpDir(root, dataDir, runId))];
|
|
317
|
+
for (const dir of locations) {
|
|
271
318
|
try {
|
|
272
319
|
rmSync(dir, { recursive: true, force: true });
|
|
273
320
|
}
|
|
@@ -279,15 +326,16 @@ export function removeAgentTmpDir(dataDir, runId) {
|
|
|
279
326
|
/**
|
|
280
327
|
* Remove every per-run directory that is not in `keepRunIds` — the startup
|
|
281
328
|
* sweep, so a crash (which never reaches the terminal-transition reap) cannot
|
|
282
|
-
* accumulate them forever.
|
|
329
|
+
* accumulate them forever. Three confined sets are swept and nothing else:
|
|
283
330
|
*
|
|
284
331
|
* - `<dataDir>/tmp`, where entries ARE the run ids (reports the ids reaped);
|
|
285
|
-
* - the
|
|
286
|
-
*
|
|
332
|
+
* - the `cez-agent-<12 hex>` directories under EVERY OS temp root — the
|
|
333
|
+
* env-honouring root and the platform default (#440) — where the name
|
|
334
|
+
* digests the dataDir and is not reversible to a run id (reports the
|
|
287
335
|
* directory names reaped). The pattern is exact — prefix, lowercase hex,
|
|
288
336
|
* fixed length, directories only — and a directory is removed only when
|
|
289
337
|
* its `.cez-owner` marker names THIS dataDir and none of this dataDir's
|
|
290
|
-
* kept runs claims it, so another project's scratch in
|
|
338
|
+
* kept runs claims it, so another project's scratch in a shared root is
|
|
291
339
|
* never touched.
|
|
292
340
|
*/
|
|
293
341
|
export function sweepAgentTmpDirs(dataDir, keepRunIds) {
|
|
@@ -316,44 +364,45 @@ export function sweepAgentTmpDirs(dataDir, keepRunIds) {
|
|
|
316
364
|
}
|
|
317
365
|
}
|
|
318
366
|
}
|
|
319
|
-
// The #387 fallback
|
|
367
|
+
// The #387 fallback locations, in every shared OS temp root. Kept narrow on
|
|
320
368
|
// purpose: exact prefix, 12 lowercase-hex name, directories only, and
|
|
321
369
|
// ownership — a directory is removed only when its `.cez-owner` marker
|
|
322
370
|
// names THIS dataDir (a marker that is missing or foreign is another
|
|
323
371
|
// project's, or unknown, and is never ours to remove) and none of this
|
|
324
372
|
// dataDir's kept runs claims it.
|
|
325
373
|
const owner = dataDirOwner(dataDir);
|
|
326
|
-
const claimed = new Set([...keep].filter(safeRunId).map((id) => basename(fallbackTmpDir(dataDir, id))));
|
|
327
|
-
const osRoot
|
|
328
|
-
|
|
329
|
-
try {
|
|
330
|
-
fallbackEntries = readdirSync(osRoot, { withFileTypes: true });
|
|
331
|
-
}
|
|
332
|
-
catch {
|
|
333
|
-
return reaped;
|
|
334
|
-
}
|
|
335
|
-
for (const entry of fallbackEntries) {
|
|
336
|
-
if (!entry.isDirectory() || !entry.name.startsWith(FALLBACK_PREFIX))
|
|
337
|
-
continue;
|
|
338
|
-
if (!/^[0-9a-f]{12}$/.test(entry.name.slice(FALLBACK_PREFIX.length)))
|
|
339
|
-
continue;
|
|
340
|
-
let entryOwner;
|
|
374
|
+
const claimed = new Set([...keep].filter(safeRunId).map((id) => basename(fallbackTmpDir(osTempRoot(), dataDir, id))));
|
|
375
|
+
for (const osRoot of osTempRoots()) {
|
|
376
|
+
let fallbackEntries;
|
|
341
377
|
try {
|
|
342
|
-
|
|
378
|
+
fallbackEntries = readdirSync(osRoot, { withFileTypes: true });
|
|
343
379
|
}
|
|
344
380
|
catch {
|
|
345
|
-
continue; //
|
|
381
|
+
continue; // an unreadable root is skipped, not fatal: others remain.
|
|
346
382
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
383
|
+
for (const entry of fallbackEntries) {
|
|
384
|
+
if (!entry.isDirectory() || !entry.name.startsWith(FALLBACK_PREFIX))
|
|
385
|
+
continue;
|
|
386
|
+
if (!/^[0-9a-f]{12}$/.test(entry.name.slice(FALLBACK_PREFIX.length)))
|
|
387
|
+
continue;
|
|
388
|
+
let entryOwner;
|
|
389
|
+
try {
|
|
390
|
+
entryOwner = readFileSync(join(osRoot, entry.name, OWNER_FILE), 'utf8').trim();
|
|
391
|
+
}
|
|
392
|
+
catch {
|
|
393
|
+
continue; // no readable marker: unknown ownership is never ours to remove.
|
|
394
|
+
}
|
|
395
|
+
if (entryOwner !== owner)
|
|
396
|
+
continue;
|
|
397
|
+
if (claimed.has(entry.name))
|
|
398
|
+
continue;
|
|
399
|
+
try {
|
|
400
|
+
rmSync(join(osRoot, entry.name), { recursive: true, force: true });
|
|
401
|
+
reaped.push(entry.name);
|
|
402
|
+
}
|
|
403
|
+
catch {
|
|
404
|
+
// best-effort: a locked directory is retried on the next boot.
|
|
405
|
+
}
|
|
357
406
|
}
|
|
358
407
|
}
|
|
359
408
|
return reaped;
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChH,OAAO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2
2
|
"name": "@wjarka/cezarion",
|
|
3
|
-
"version": "0.14.3-pr445.
|
|
3
|
+
"version": "0.14.3-pr445.678",
|
|
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.3-pr445.
|
|
54
|
-
"@open-mercato/cezar-contract": "0.14.3-pr445.
|
|
53
|
+
"@open-mercato/cezar-api-client": "0.14.3-pr445.678",
|
|
54
|
+
"@open-mercato/cezar-contract": "0.14.3-pr445.678",
|
|
55
55
|
"@types/node": "^20.14.0",
|
|
56
56
|
"@types/ws": "^8.18.1",
|
|
57
57
|
"esbuild": "^0.28.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Rt as r,_t as i,lt as a}from"./alert-dialog-BOp2HnnL.js";import{t as o}from"./utils-GZNjgma4.js";import{t as s}from"./project-router-CvFAMDcP.js";import{h as c}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Rt as r,_t as i,lt as a}from"./alert-dialog-BOp2HnnL.js";import{t as o}from"./utils-GZNjgma4.js";import{t as s}from"./project-router-CvFAMDcP.js";import{h as c}from"./index-CLWCibEp.js";import{t as l}from"./lib-BQXq3kEf.js";var u=e(t(),1),d=n(),f=77;function p({slot:e,commits:t,className:n,heading:i}){let[a,s]=(0,u.useState)(``),p=a.trim().toLowerCase(),h=p?t.filter(e=>e.subject.toLowerCase().includes(p)):t,g=h.length>150,_=(0,u.useRef)(null),v=(0,u.useRef)(null),[y,b]=(0,u.useState)(0);(0,u.useLayoutEffect)(()=>{if(!g)return;let e=()=>{let e=_.current,t=v.current;!e||!t||b(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[g]);let x=h.map(n=>(0,d.jsx)(m,{commit:n,detailed:e===`task-commits`&&t.length===1},n.sha));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`label`,{className:`relative mb-[22px] block`,children:[(0,d.jsx)(r,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3.5 left-3 size-4 text-muted-foreground`}),(0,d.jsx)(c,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:a,onChange:e=>s(e.target.value),className:`h-11 bg-card pl-10`})]}),(0,d.jsxs)(`div`,{ref:e=>{_.current=e,e&&(v.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":g,className:o(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-4 py-1 md:px-5`,n),children:[i?(0,d.jsx)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 py-4`,children:i}):null,h.length===0?(0,d.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,g?(0,d.jsx)(l,{scrollRef:v,startMargin:y,itemSize:f,children:x}):x]})]})}function m({commit:e,detailed:t}){return(0,d.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_77px] [content-visibility:auto]`,children:(0,d.jsxs)(s,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:o(`flex min-h-[76px] min-w-0 flex-col items-start gap-3 rounded-sm py-4 hover:bg-muted`,!t&&`md:flex-row md:items-center md:py-3`),children:[(0,d.jsx)(i,{size:16,"aria-hidden":`true`,className:o(`shrink-0 text-accent-text`,t?`size-[22px]`:`size-4`)}),(0,d.jsxs)(`span`,{className:o(`min-w-0 w-full`,!t&&`md:w-auto md:flex-1`),children:[(0,d.jsx)(`span`,{className:o(`block font-normal`,t?`text-[22px] leading-snug`:`text-[13px] md:truncate`),children:e.subject}),(0,d.jsxs)(`span`,{className:`mt-1 block truncate text-[11px] text-soft-foreground`,children:[e.author,` · `,e.when]})]}),(0,d.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),t?(0,d.jsxs)(`span`,{className:`inline-flex min-h-11 items-center gap-2 rounded-lg bg-action px-3 text-xs font-medium text-action-foreground`,children:[(0,d.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-4`}),`View changes`]}):null]})})}export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,Ca as i,Cn as a,Hi as o,Hr as s,Ta as c,Tr as l,Xr as u,Y as d,Z as f,a as p,c as m,cr as h,d as g,i as _,in as v,kr as y,l as b,n as x,ni as S,o as C,r as w,s as T,sa as E,t as D,wn as O}from"./alert-dialog-BOp2HnnL.js";import{t as k}from"./utils-GZNjgma4.js";import{n as A,r as j,t as M}from"./collapsible-bb0csfMs.js";import{c as N,t as P}from"./project-router-CvFAMDcP.js";import{t as F}from"./search-x-I9Q8pgUa.js";import{t as I}from"./markdown-Ir62-VMS.js";import{n as L,t as R}from"./token-metrics-BLzFUb8F.js";import{g as z,m as B}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,Ca as i,Cn as a,Hi as o,Hr as s,Ta as c,Tr as l,Xr as u,Y as d,Z as f,a as p,c as m,cr as h,d as g,i as _,in as v,kr as y,l as b,n as x,ni as S,o as C,r as w,s as T,sa as E,t as D,wn as O}from"./alert-dialog-BOp2HnnL.js";import{t as k}from"./utils-GZNjgma4.js";import{n as A,r as j,t as M}from"./collapsible-bb0csfMs.js";import{c as N,t as P}from"./project-router-CvFAMDcP.js";import{t as F}from"./search-x-I9Q8pgUa.js";import{t as I}from"./markdown-Ir62-VMS.js";import{n as L,t as R}from"./token-metrics-BLzFUb8F.js";import{g as z,m as B}from"./index-CLWCibEp.js";import{t as V}from"./run-diff-DrQsmf3-.js";var H=e(t(),1),U=n();function W(){let{groupId:e}=i(),t=a(e),n=R(O().data),o=r();if((0,H.useEffect)(()=>{e&&o.invalidateQueries({queryKey:v.groups.detail(e)})},[o,e,(h().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,U.jsx)(B,{});if(t.isError){let e=t.error instanceof S&&t.error.status===404;return(0,U.jsx)(`div`,{"data-route":`compare`,className:`task-flow-page flex min-h-full flex-col`,children:(0,U.jsx)(b,{icon:e?(0,U.jsx)(F,{}):(0,U.jsx)(z,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsx)(g,{asChild:!0,variant:`outline`,children:(0,U.jsx)(P,{to:`/`,children:`Back to tasks`})}),e?null:(0,U.jsx)(g,{variant:`outline`,onClick:()=>void t.refetch(),children:`Retry`})]})})})}return(0,U.jsx)(G,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function G({groupId:e,variants:t,showTokens:n,showCost:i}){let a=N(),u=r(),[d,f]=(0,H.useState)(null),h=t.every(e=>l.has(e.status)),g=t[0]?s(t[0]):``,y=c({mutationFn:t=>o(e,t),onSuccess:(t,n)=>{u.invalidateQueries({queryKey:v.runs.all}),u.invalidateQueries({queryKey:v.groups.detail(e)}),a(`/tasks/${t.winner?.id??n}`)},onError:e=>E(e.message,{tone:`danger`})});return(0,U.jsxs)(`div`,{"data-route":`compare`,className:`task-flow-page flex w-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,U.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,U.jsx)(z,{className:`size-5 shrink-0 text-accent-icon`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Compare variants`})]}),(0,U.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[g,` · `,t.length,` `,h?`completed variants with distinct committed diffs.`:`variants of the same task, each in its own worktree.`]})]}),h?null:(0,U.jsxs)(`section`,{role:`status`,className:`rounded-xl border border-border bg-card p-5`,children:[(0,U.jsx)(`h2`,{className:`text-lg font-normal`,children:`Variants are still running`}),(0,U.jsx)(`p`,{className:`mt-3 text-[13px] text-muted-foreground`,children:`Compare progress now. Picking a result is disabled until every variant finishes.`})]}),(0,U.jsx)(`div`,{"data-slot":`compare-columns`,className:k(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,U.jsx)(K,{variant:e,allTerminal:h,pickPending:y.isPending,onPick:()=>f(e),showTokens:n,showCost:i},e.id))}),(0,U.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-[22px]`,children:t.map(e=>(0,U.jsx)(q,{variant:e},e.id))}),(0,U.jsx)(D,{open:d!==null,onOpenChange:e=>!e&&f(null),children:(0,U.jsxs)(_,{"data-slot":`variant-confirm-dialog`,children:[(0,U.jsxs)(T,{children:[(0,U.jsxs)(m,{children:[`Pick variant `,d?.variant,`?`]}),(0,U.jsxs)(p,{children:[`Variant `,d?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,U.jsxs)(C,{children:[(0,U.jsx)(w,{children:`Cancel`}),(0,U.jsxs)(x,{"data-slot":`confirm-pick`,onClick:()=>{d&&y.mutate(d.id),f(null)},children:[`Pick variant `,d?.variant]})]})]})})]})}function K({variant:e,allTerminal:t,pickPending:n,onPick:r,showTokens:i,showCost:a}){let o=u(e),s=y(e.costUsd),c=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,U.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-accent-strong/15 font-mono text-xs font-semibold text-accent-text`,children:e.variant}),(0,U.jsxs)(`span`,{"data-slot":`variant-status`,className:`text-lg font-normal`,children:[`· `,(0,U.jsx)(`span`,{className:`capitalize`,children:o.label})]}),i&&c||a&&s?(0,U.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] text-soft-foreground`,children:[i?(0,U.jsx)(L,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,i&&c&&a&&s?(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,a&&s?(0,U.jsx)(`span`,{className:`font-mono tabular-nums`,children:s}):null]}):null]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,U.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,U.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,U.jsx)(I,{children:e.handoffExcerpt})}):(0,U.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,U.jsx)(g,{asChild:!0,variant:`outline`,className:`self-start`,children:(0,U.jsx)(P,{to:`/tasks/${e.id}`,children:`Open task`})}),(0,U.jsxs)(g,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,U.jsx)(d,{"aria-hidden":`true`}),`Pick variant `,e.variant]})]})}function q({variant:e}){let[t,n]=(0,H.useState)(!1);return(0,U.jsxs)(M,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,U.jsxs)(j,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,U.jsx)(f,{className:k(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,U.jsx)(A,{children:(0,U.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,U.jsx)(V,{runId:e.id})})})]})}export{W as CompareVariantsRoute};
|