@wjarka/cezarion 0.17.0-dev.5487 → 0.17.0-dev.5501
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/ci-wait/controller.d.ts +37 -37
- package/dist/server/run-checkout.d.ts +29 -0
- package/dist/server/run-checkout.js +31 -0
- package/dist/server/run-checkout.js.map +1 -0
- package/dist/server/self-update-routes.d.ts +19 -19
- package/dist/server/server.d.ts +12 -168
- package/dist/server/server.js +28 -54
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/run/compose.d.ts +0 -5
- package/dist/workflows/run/compose.js +32 -46
- package/dist/workflows/run/compose.js.map +1 -1
- package/dist/workflows/run/family-reconciler.d.ts +2 -6
- package/dist/workflows/run/family-reconciler.js +7 -9
- package/dist/workflows/run/family-reconciler.js.map +1 -1
- package/dist/workflows/run/human-waits.d.ts +0 -2
- package/dist/workflows/run/human-waits.js +10 -7
- package/dist/workflows/run/human-waits.js.map +1 -1
- package/dist/workflows/run/input-delivery.d.ts +2 -2
- package/dist/workflows/run/input-delivery.js +2 -2
- package/dist/workflows/run/input-delivery.js.map +1 -1
- package/dist/workflows/run/run-cancel.d.ts +4 -4
- package/dist/workflows/run/run-cancel.js +5 -5
- package/dist/workflows/run/run-cancel.js.map +1 -1
- package/dist/workflows/run/run-finish.d.ts +2 -2
- package/dist/workflows/run/run-finish.js +1 -1
- package/dist/workflows/run/run-finish.js.map +1 -1
- package/dist/workflows/run/run-recovery.d.ts +0 -4
- package/dist/workflows/run/run-recovery.js +10 -8
- package/dist/workflows/run/run-recovery.js.map +1 -1
- package/dist/workflows/run/step-loop.d.ts +2 -2
- package/dist/workflows/run/step-loop.js +1 -1
- package/dist/workflows/run/step-loop.js.map +1 -1
- package/dist/workflows/run/subagent-waits.d.ts +1 -6
- package/dist/workflows/run/subagent-waits.js +5 -17
- package/dist/workflows/run/subagent-waits.js.map +1 -1
- package/dist/workflows/run/turn-settler.d.ts +0 -2
- package/dist/workflows/run/turn-settler.js +3 -6
- package/dist/workflows/run/turn-settler.js.map +1 -1
- package/dist/workflows/run/wait-engine.d.ts +1186 -28
- package/dist/workflows/run/wait-engine.js +399 -50
- package/dist/workflows/run/wait-engine.js.map +1 -1
- package/dist/workflows/run/wait-kinds.d.ts +5 -3
- package/dist/workflows/run/wait-kinds.js +5 -6
- package/dist/workflows/run/wait-kinds.js.map +1 -1
- package/dist/workflows/run/wait-registry.d.ts +5 -7
- package/dist/workflows/run/wait-registry.js +61 -60
- package/dist/workflows/run/wait-registry.js.map +1 -1
- package/dist/workflows/run/wake-admission.d.ts +2 -4
- package/dist/workflows/run/wake-admission.js +4 -4
- package/dist/workflows/run/wake-admission.js.map +1 -1
- package/dist/workflows/run.js +3 -5
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/wait-scope.d.ts +0 -5
- package/dist/workflows/wait-scope.js +1 -5
- package/dist/workflows/wait-scope.js.map +1 -1
- package/package.json +3 -3
- package/dist/workflows/run/wait-cancellation.d.ts +0 -34
- package/dist/workflows/run/wait-cancellation.js +0 -54
- package/dist/workflows/run/wait-cancellation.js.map +0 -1
- package/dist/workflows/run/wait-resolve.d.ts +0 -1139
- package/dist/workflows/run/wait-resolve.js +0 -313
- package/dist/workflows/run/wait-resolve.js.map +0 -1
package/dist/server/server.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runCheckout, worktreeOf, NO_WORKTREE } from './run-checkout.js';
|
|
1
2
|
import { adoptFallbackControl, protectFallbackRun, runArtifactDirectory } from './project-run-files.js';
|
|
2
3
|
import { deleteSavedWorkflow } from './workflow-files.js';
|
|
3
4
|
import { projectPaths, fallbackProjectWriteError } from '../project-paths.js';
|
|
@@ -3301,29 +3302,20 @@ export function createApp(deps) {
|
|
|
3301
3302
|
})
|
|
3302
3303
|
// Task diff (spec 006): what this run changed — its worktree vs its base.
|
|
3303
3304
|
.get('/runs/:id/diff', async (c) => {
|
|
3304
|
-
const
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
if (blocker)
|
|
3310
|
-
return c.json({ error: blocker }, 409);
|
|
3311
|
-
if (!run.worktreePath || !existsSync(run.worktreePath)) {
|
|
3305
|
+
const checkout = runCheckout(c.get('project'), c.req.param('id'), 'read', { checksAutosave: true, directory: 'existing-worktree' });
|
|
3306
|
+
if ('body' in checkout)
|
|
3307
|
+
return c.json(checkout.body, checkout.status);
|
|
3308
|
+
const { run, directory: workingDirectory } = checkout;
|
|
3309
|
+
if (!workingDirectory) {
|
|
3312
3310
|
return c.text('(no worktree — this task ran directly in the repo working tree)');
|
|
3313
3311
|
}
|
|
3314
|
-
return c.text(await worktreeDiff(
|
|
3312
|
+
return c.text(await worktreeDiff(workingDirectory, run.baseBranch ?? 'HEAD'));
|
|
3315
3313
|
})
|
|
3316
3314
|
.get('/runs/:id/changes', async (c) => {
|
|
3317
|
-
const
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
const blocker = autosaveCleanupBlocker(store.sourceDataDir(run.id), run.id);
|
|
3322
|
-
if (blocker)
|
|
3323
|
-
return c.json({ error: blocker }, 409);
|
|
3324
|
-
const workingDirectory = workingDirectoryOf(run, repoRoot);
|
|
3325
|
-
if (!workingDirectory)
|
|
3326
|
-
return c.json({ error: NO_WORKTREE }, 409);
|
|
3315
|
+
const checkout = runCheckout(c.get('project'), c.req.param('id'), 'read', { checksAutosave: true, directory: 'working-directory' });
|
|
3316
|
+
if ('body' in checkout)
|
|
3317
|
+
return c.json(checkout.body, checkout.status);
|
|
3318
|
+
const { run, directory: workingDirectory } = checkout;
|
|
3327
3319
|
const result = await collectChanges(workingDirectory, run.baseBranch ?? 'HEAD', {
|
|
3328
3320
|
taskBranch: run.branch,
|
|
3329
3321
|
// Anchors a repointed worktree at the branch as this run found it (#751).
|
|
@@ -3337,13 +3329,10 @@ export function createApp(deps) {
|
|
|
3337
3329
|
})
|
|
3338
3330
|
// The run's own commits (<base>..HEAD on the worktree branch) — the Commits tab.
|
|
3339
3331
|
.get('/runs/:id/commits', async (c) => {
|
|
3340
|
-
const
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
const workingDirectory = workingDirectoryOf(run, repoRoot);
|
|
3345
|
-
if (!workingDirectory)
|
|
3346
|
-
return c.json({ error: NO_WORKTREE }, 409);
|
|
3332
|
+
const checkout = runCheckout(c.get('project'), c.req.param('id'), 'read', { checksAutosave: false, directory: 'working-directory' });
|
|
3333
|
+
if ('body' in checkout)
|
|
3334
|
+
return c.json(checkout.body, checkout.status);
|
|
3335
|
+
const { run, directory: workingDirectory } = checkout;
|
|
3347
3336
|
const result = await collectRunCommits(workingDirectory, run.baseBranch ?? 'HEAD');
|
|
3348
3337
|
if (!result.ok)
|
|
3349
3338
|
return c.json({ error: result.error }, 409);
|
|
@@ -3351,13 +3340,10 @@ export function createApp(deps) {
|
|
|
3351
3340
|
})
|
|
3352
3341
|
// One of the run's commits, structured like the Changes tab (reuses collectCommitChanges).
|
|
3353
3342
|
.get('/runs/:id/commit/:sha', async (c) => {
|
|
3354
|
-
const
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
const workingDirectory = workingDirectoryOf(run, repoRoot);
|
|
3359
|
-
if (!workingDirectory)
|
|
3360
|
-
return c.json({ error: NO_WORKTREE }, 409);
|
|
3343
|
+
const checkout = runCheckout(c.get('project'), c.req.param('id'), 'read', { checksAutosave: false, directory: 'working-directory' });
|
|
3344
|
+
if ('body' in checkout)
|
|
3345
|
+
return c.json(checkout.body, checkout.status);
|
|
3346
|
+
const { directory: workingDirectory } = checkout;
|
|
3361
3347
|
const result = await collectCommitChanges(workingDirectory, c.req.param('sha'));
|
|
3362
3348
|
if (!result.ok)
|
|
3363
3349
|
return c.json({ error: result.error }, 409);
|
|
@@ -3365,11 +3351,12 @@ export function createApp(deps) {
|
|
|
3365
3351
|
})
|
|
3366
3352
|
.get('/runs/:id/file-link', paramZodValidator(artifactParamsSchema.omit({ artifactId: true })), queryZodValidator(fileLinkQuerySchema), async (c) => {
|
|
3367
3353
|
const { root, store } = c.get('project');
|
|
3368
|
-
const
|
|
3369
|
-
if (
|
|
3370
|
-
return c.json(
|
|
3354
|
+
const checkout = runCheckout(c.get('project'), c.req.valid('param').id, 'read', { checksAutosave: false, directory: 'recorded-path-or-root' });
|
|
3355
|
+
if ('body' in checkout)
|
|
3356
|
+
return c.json(checkout.body, checkout.status);
|
|
3357
|
+
const { run, directory: workingDirectory } = checkout;
|
|
3371
3358
|
const query = c.req.valid('query');
|
|
3372
|
-
const loaded = await loadFileLink({ dataDir: store.sourceDataDir(run.id), runId: run.id, projectRoot: root, workingDirectory
|
|
3359
|
+
const loaded = await loadFileLink({ dataDir: store.sourceDataDir(run.id), runId: run.id, projectRoot: root, workingDirectory, path: query.path });
|
|
3373
3360
|
if (query.raw === '1') {
|
|
3374
3361
|
if (!loaded.imageBytes || loaded.preview.type !== 'file')
|
|
3375
3362
|
return c.json({ error: 'Only bounded raster images can be served inline.' }, 409);
|
|
@@ -3448,18 +3435,15 @@ export function createApp(deps) {
|
|
|
3448
3435
|
// what an `<img>` sends — while the flag still wins whenever it is present and `*<slash>*`
|
|
3449
3436
|
// (every `fetch`) still gets the JSON listing. See `negotiate`.
|
|
3450
3437
|
.get('/runs/:id/files', queryZodValidator(worktreeFilesQuerySchema), async (c) => {
|
|
3451
|
-
const { root: repoRoot, store } = c.get('project');
|
|
3452
3438
|
const query = c.req.valid('query');
|
|
3453
3439
|
c.header('vary', 'Accept');
|
|
3454
3440
|
const wantsRaw = query.raw !== undefined
|
|
3455
3441
|
? query.raw === '1'
|
|
3456
3442
|
: negotiate(c.req.header('accept'), FILE_FORMATS) === 'image/*';
|
|
3457
|
-
const
|
|
3458
|
-
if (
|
|
3459
|
-
return c.json(
|
|
3460
|
-
const workingDirectory =
|
|
3461
|
-
if (!workingDirectory)
|
|
3462
|
-
return c.json({ error: NO_WORKTREE }, 409);
|
|
3443
|
+
const checkout = runCheckout(c.get('project'), c.req.param('id'), 'read', { checksAutosave: false, directory: 'working-directory' });
|
|
3444
|
+
if ('body' in checkout)
|
|
3445
|
+
return c.json(checkout.body, checkout.status);
|
|
3446
|
+
const { directory: workingDirectory } = checkout;
|
|
3463
3447
|
const result = await readWorktreePath(workingDirectory, query.path ?? '');
|
|
3464
3448
|
if (result.kind === 'invalid' || result.kind === 'missing') {
|
|
3465
3449
|
return c.json({ error: result.error }, 409);
|
|
@@ -3693,16 +3677,6 @@ export function createApp(deps) {
|
|
|
3693
3677
|
txt: 'text/plain; charset=utf-8',
|
|
3694
3678
|
md: 'text/plain; charset=utf-8',
|
|
3695
3679
|
};
|
|
3696
|
-
// ---- session git view (redesign R5 Step 1.2 — §"Git/session API additions").
|
|
3697
|
-
// Structured sibling of the text-blob /diff above (which stays untouched —
|
|
3698
|
-
// protected surface). Isolated runs read their worktree; worktree-off runs
|
|
3699
|
-
// read the repo checkout they executed in. Every predictable git failure
|
|
3700
|
-
// degrades to 409 + human-readable reason, 404 only for unknown ids.
|
|
3701
|
-
const worktreeOf = (run) => run.worktreePath && existsSync(run.worktreePath) ? run.worktreePath : null;
|
|
3702
|
-
const workingDirectoryOf = (run, repoRoot) => run.worktree === false
|
|
3703
|
-
? repoRoot
|
|
3704
|
-
: worktreeOf(run);
|
|
3705
|
-
const NO_WORKTREE = 'no worktree — this task ran directly in the repo working tree';
|
|
3706
3680
|
// ---- chained family: worktrees (project-scoped) ----
|
|
3707
3681
|
const worktreesRoutes = new Hono()
|
|
3708
3682
|
.get('/worktrees', async (c) => {
|