@open-mercato/cezar 0.16.2-pr1637.3572 → 0.16.2-pr1646.3595

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.
Files changed (28) hide show
  1. package/dist/release/bump.d.ts +1 -1
  2. package/dist/release/bump.js +1 -1
  3. package/dist/release/stable.d.ts +21 -4
  4. package/dist/release/stable.js +48 -15
  5. package/dist/release/stable.js.map +1 -1
  6. package/dist/server/server.d.ts +58 -58
  7. package/dist/workflows/continuation-context.d.ts +3 -1
  8. package/dist/workflows/continuation-context.js +22 -3
  9. package/dist/workflows/continuation-context.js.map +1 -1
  10. package/dist/workflows/run.d.ts +2 -0
  11. package/dist/workflows/run.js +8 -4
  12. package/dist/workflows/run.js.map +1 -1
  13. package/package.json +3 -3
  14. package/web/dist/assets/{agent-task-pickers-BdzfdJR3.js → agent-task-pickers-Dyp7yGgP.js} +1 -1
  15. package/web/dist/assets/{automations-route-BTZ2_boj.js → automations-route-DWd6PMRD.js} +1 -1
  16. package/web/dist/assets/{compare-variants-Dg6QlK--.js → compare-variants-DN5Yjmsk.js} +1 -1
  17. package/web/dist/assets/{dashboard-3U8d_5s9.js → dashboard-Cd0X5nU6.js} +1 -1
  18. package/web/dist/assets/{github-VWFbTfEu.js → github-BppUgUiJ.js} +1 -1
  19. package/web/dist/assets/{index-mdntR9AC.js → index-C54lSK_C.js} +3 -3
  20. package/web/dist/assets/{repo-git-DuMm5pnv.js → repo-git-C6ovXU_6.js} +1 -1
  21. package/web/dist/assets/{skills-CHxDHol_.js → skills-D8TecLUp.js} +1 -1
  22. package/web/dist/assets/{task-graph-CK9O0hHi.js → task-graph-CeIQlh4A.js} +1 -1
  23. package/web/dist/assets/{task-workspace-a9K1whJT.js → task-workspace-B3ewUT8I.js} +3 -3
  24. package/web/dist/assets/{tracker-WX0sXgya.js → tracker-ghQW__cd.js} +1 -1
  25. package/web/dist/assets/{workflow-graph-BDZNtD4Y.js → workflow-graph-D_txXspG.js} +1 -1
  26. package/web/dist/assets/worktree-lifecycle-operation-DJ38G3Xu.js +18 -0
  27. package/web/dist/index.html +2 -2
  28. package/web/dist/assets/worktree-lifecycle-operation-DOTiqQFx.js +0 -18
@@ -1,6 +1,6 @@
1
1
  /** The rest of a version bump — the files a `chore(release)` PR used to edit by hand beside the
2
2
  * release set: the cockpit manifest, the lockfile and the changelog. Pure; the release-line
3
- * workflows (`scripts/release-line.mjs`) do the I/O. */
3
+ * workflows (`scripts/release-line.mts`) do the I/O. */
4
4
  import { type ManifestLike } from './manifests.ts';
5
5
  /** Stamp a workspace that versions in lockstep but is not in the release set (the cockpit). */
6
6
  export declare function stampCompanionManifest(pkg: ManifestLike, version: string, releaseNames: readonly string[]): ManifestLike;
@@ -1,6 +1,6 @@
1
1
  /** The rest of a version bump — the files a `chore(release)` PR used to edit by hand beside the
2
2
  * release set: the cockpit manifest, the lockfile and the changelog. Pure; the release-line
3
- * workflows (`scripts/release-line.mjs`) do the I/O. */
3
+ * workflows (`scripts/release-line.mts`) do the I/O. */
4
4
  import { compareStableVersions, parseStableVersion } from './stable.js';
5
5
  import { pinDependency } from './manifests.js';
6
6
  const DEP_SECTIONS = ['dependencies', 'devDependencies', 'peerDependencies'];
@@ -1,4 +1,4 @@
1
- /** Stable-release decisions — the pure half of `scripts/release.mjs`.
1
+ /** Stable-release decisions — the pure half of `scripts/release.mts`.
2
2
  *
3
3
  * Sibling of `snapshot.ts`, but for the *owner-driven* `latest` channel. The
4
4
  * `Release` workflow (`.github/workflows/release.yml`) is run manually and
@@ -43,6 +43,7 @@ export type ReleasePlan = {
43
43
  ok: true;
44
44
  version: string;
45
45
  bumped: boolean;
46
+ resume: boolean;
46
47
  previousTag: string | null;
47
48
  } | {
48
49
  ok: false;
@@ -51,15 +52,31 @@ export type ReleasePlan = {
51
52
  /**
52
53
  * What a release from a `release/vX.Y.x` branch publishes.
53
54
  *
54
- * The committed version ships as-is while no tag names it (the line's first `x.y.0`); once it
55
- * is tagged, the release bumps the patch first — past any tag already taken, so a re-run after a
56
- * half-finished release never collides. The branch and the manifests must agree on the line.
55
+ * A release is done when its GitHub Release exists (created last); the tag pins its commit.
56
+ * - The line's newest tag has no GitHub Release → **resume** that version at its tag. Backports
57
+ * merged since wait for the next patch, so one npm version never mixes two commits.
58
+ * - Otherwise the committed version ships as-is while no tag names it (a fresh line's `x.y.0`,
59
+ * or a bump whose run died before tagging); once tagged, the patch is bumped first.
60
+ * - An untagged version with packages already on npm is refused: publishing it from the tip
61
+ * would mix revisions. Restore its tag at the published commit instead.
57
62
  */
58
63
  export declare function planRelease(input: {
59
64
  branch: string;
60
65
  manifestVersion: string;
61
66
  tags: readonly string[];
67
+ /** Tags that have a GitHub Release. */
68
+ releasedTags: readonly string[];
69
+ /** Whether any release-set package already has `manifestVersion` on npm. */
70
+ manifestPublished: boolean;
62
71
  }): ReleasePlan;
72
+ /** The highest `vX.Y.Z` tag of one line, or `null`. */
73
+ export declare function newestLineTag(tags: readonly string[], line: {
74
+ major: number;
75
+ minor: number;
76
+ }): string | null;
77
+ /** The highest stable version among the release set's `latest` dist-tags — what a new release
78
+ * must reach to move `latest`. Judging one package misses a half-published run. */
79
+ export declare function highestLatest(latests: readonly (string | null | undefined)[]): string | null;
63
80
  /**
64
81
  * The dist-tag a stable release publishes under. Only the newest line moves `latest` — the
65
82
  * updater's stable channel follows it — so a backport publishes under `latest-X.Y` instead.
@@ -1,4 +1,4 @@
1
- /** Stable-release decisions — the pure half of `scripts/release.mjs`.
1
+ /** Stable-release decisions — the pure half of `scripts/release.mts`.
2
2
  *
3
3
  * Sibling of `snapshot.ts`, but for the *owner-driven* `latest` channel. The
4
4
  * `Release` workflow (`.github/workflows/release.yml`) is run manually and
@@ -74,32 +74,65 @@ export function nextMinorVersion(version) {
74
74
  /**
75
75
  * What a release from a `release/vX.Y.x` branch publishes.
76
76
  *
77
- * The committed version ships as-is while no tag names it (the line's first `x.y.0`); once it
78
- * is tagged, the release bumps the patch first — past any tag already taken, so a re-run after a
79
- * half-finished release never collides. The branch and the manifests must agree on the line.
77
+ * A release is done when its GitHub Release exists (created last); the tag pins its commit.
78
+ * - The line's newest tag has no GitHub Release → **resume** that version at its tag. Backports
79
+ * merged since wait for the next patch, so one npm version never mixes two commits.
80
+ * - Otherwise the committed version ships as-is while no tag names it (a fresh line's `x.y.0`,
81
+ * or a bump whose run died before tagging); once tagged, the patch is bumped first.
82
+ * - An untagged version with packages already on npm is refused: publishing it from the tip
83
+ * would mix revisions. Restore its tag at the published commit instead.
80
84
  */
81
85
  export function planRelease(input) {
82
86
  const line = parseReleaseBranch(input.branch);
83
87
  if (!line)
84
88
  return { ok: false, error: `"${input.branch}" is not a release/vX.Y.x branch` };
85
- const base = parseStableVersion(input.manifestVersion);
89
+ const manifest = input.manifestVersion.trim();
90
+ const base = parseStableVersion(manifest);
86
91
  if (!base)
87
- return { ok: false, error: `manifest version "${input.manifestVersion}" is not a plain x.y.z` };
92
+ return { ok: false, error: `manifest version "${manifest}" is not a plain x.y.z` };
88
93
  if (base[0] !== line.major || base[1] !== line.minor) {
94
+ return { ok: false, error: `manifest version ${manifest} does not belong to ${input.branch}` };
95
+ }
96
+ const tags = input.tags.map((t) => t.trim());
97
+ const previousOf = (version) => tags
98
+ .filter((t) => parseStableVersion(t) && compareStableVersions(t, version) < 0)
99
+ .sort(compareStableVersions)
100
+ .at(-1) ?? null;
101
+ const newest = newestLineTag(tags, line);
102
+ if (newest && !input.releasedTags.includes(newest)) {
103
+ const version = newest.slice(1);
104
+ return { ok: true, version, bumped: false, resume: true, previousTag: previousOf(version) };
105
+ }
106
+ const taken = new Set(tags);
107
+ let version = manifest;
108
+ while (taken.has(`v${version}`))
109
+ version = computeStableVersion('patch', version);
110
+ const bumped = version !== manifest;
111
+ if (!bumped && input.manifestPublished) {
89
112
  return {
90
113
  ok: false,
91
- error: `manifest version ${input.manifestVersion} does not belong to ${input.branch}`,
114
+ error: `${manifest} is on npm but has no v${manifest} tag — restore the tag at the commit it was published from (never delete a release tag)`,
92
115
  };
93
116
  }
94
- const taken = new Set(input.tags.map((t) => t.trim()));
95
- let version = input.manifestVersion.trim();
96
- while (taken.has(`v${version}`))
97
- version = computeStableVersion('patch', version);
98
- const previous = input.tags
99
- .filter((t) => parseStableVersion(t) && compareStableVersions(t, version) < 0)
117
+ return { ok: true, version, bumped, resume: false, previousTag: previousOf(version) };
118
+ }
119
+ /** The highest `vX.Y.Z` tag of one line, or `null`. */
120
+ export function newestLineTag(tags, line) {
121
+ return (tags
122
+ .filter((t) => {
123
+ const v = /^v/.test(t) ? parseStableVersion(t) : null;
124
+ return v !== null && v[0] === line.major && v[1] === line.minor;
125
+ })
126
+ .sort(compareStableVersions)
127
+ .at(-1) ?? null);
128
+ }
129
+ /** The highest stable version among the release set's `latest` dist-tags — what a new release
130
+ * must reach to move `latest`. Judging one package misses a half-published run. */
131
+ export function highestLatest(latests) {
132
+ return (latests
133
+ .filter((v) => typeof v === 'string' && parseStableVersion(v) !== null)
100
134
  .sort(compareStableVersions)
101
- .at(-1);
102
- return { ok: true, version, bumped: version !== input.manifestVersion.trim(), previousTag: previous ?? null };
135
+ .at(-1) ?? null);
103
136
  }
104
137
  /**
105
138
  * The dist-tag a stable release publishes under. Only the newest line moves `latest` — the
@@ -1 +1 @@
1
- {"version":3,"file":"stable.js","sourceRoot":"","sources":["../../src/release/stable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAA+C,MAAM,gBAAgB,CAAC;AAO/F,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAE7F,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;2DAM2D;AAC3D,MAAM,UAAU,oBAAoB,CAAC,IAAiB,EAAE,IAAY;IAClE,MAAM,CAAC,GAAG,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CAAC,CAAC;AAC9D,CAAC"}
@@ -10872,19 +10872,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
10872
10872
  } & {
10873
10873
  "/repo/commit/:sha": {
10874
10874
  $get: {
10875
- output: string;
10876
- outputFormat: "text";
10877
- status: import("hono/utils/http-status").ContentfulStatusCode;
10878
- input: {
10879
- query: {
10880
- structured?: string | string[] | undefined;
10881
- };
10882
- } & {
10883
- param: {
10884
- sha: string;
10885
- };
10886
- };
10887
- } | {
10888
10875
  output: {
10889
10876
  sha: string;
10890
10877
  subject: string;
@@ -10932,6 +10919,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
10932
10919
  sha: string;
10933
10920
  };
10934
10921
  };
10922
+ } | {
10923
+ output: string;
10924
+ outputFormat: "text";
10925
+ status: import("hono/utils/http-status").ContentfulStatusCode;
10926
+ input: {
10927
+ query: {
10928
+ structured?: string | string[] | undefined;
10929
+ };
10930
+ } & {
10931
+ param: {
10932
+ sha: string;
10933
+ };
10934
+ };
10935
10935
  };
10936
10936
  };
10937
10937
  } & {
@@ -16910,20 +16910,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
16910
16910
  } & {
16911
16911
  "/runs/:id/handoff": {
16912
16912
  $get: {
16913
- output: string;
16914
- outputFormat: "text";
16915
- status: 200;
16913
+ output: {
16914
+ error: string;
16915
+ };
16916
+ outputFormat: "json";
16917
+ status: 404;
16916
16918
  input: {
16917
16919
  param: {
16918
16920
  id: string;
16919
16921
  };
16920
16922
  };
16921
16923
  } | {
16922
- output: {
16923
- error: string;
16924
- };
16925
- outputFormat: "json";
16926
- status: 404;
16924
+ output: string;
16925
+ outputFormat: "text";
16926
+ status: 200;
16927
16927
  input: {
16928
16928
  param: {
16929
16929
  id: string;
@@ -16949,20 +16949,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
16949
16949
  } & {
16950
16950
  "/runs/:id/diff": {
16951
16951
  $get: {
16952
- output: string;
16953
- outputFormat: "text";
16954
- status: import("hono/utils/http-status").ContentfulStatusCode;
16952
+ output: {
16953
+ error: string;
16954
+ };
16955
+ outputFormat: "json";
16956
+ status: 404;
16955
16957
  input: {
16956
16958
  param: {
16957
16959
  id: string;
16958
16960
  };
16959
16961
  };
16960
16962
  } | {
16961
- output: {
16962
- error: string;
16963
- };
16964
- outputFormat: "json";
16965
- status: 404;
16963
+ output: string;
16964
+ outputFormat: "text";
16965
+ status: import("hono/utils/http-status").ContentfulStatusCode;
16966
16966
  input: {
16967
16967
  param: {
16968
16968
  id: string;
@@ -24502,19 +24502,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
24502
24502
  } & {
24503
24503
  "/repo/commit/:sha": {
24504
24504
  $get: {
24505
- output: string;
24506
- outputFormat: "text";
24507
- status: import("hono/utils/http-status").ContentfulStatusCode;
24508
- input: {
24509
- query: {
24510
- structured?: string | string[] | undefined;
24511
- };
24512
- } & {
24513
- param: {
24514
- sha: string;
24515
- };
24516
- };
24517
- } | {
24518
24505
  output: {
24519
24506
  sha: string;
24520
24507
  subject: string;
@@ -24562,6 +24549,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
24562
24549
  sha: string;
24563
24550
  };
24564
24551
  };
24552
+ } | {
24553
+ output: string;
24554
+ outputFormat: "text";
24555
+ status: import("hono/utils/http-status").ContentfulStatusCode;
24556
+ input: {
24557
+ query: {
24558
+ structured?: string | string[] | undefined;
24559
+ };
24560
+ } & {
24561
+ param: {
24562
+ sha: string;
24563
+ };
24564
+ };
24565
24565
  };
24566
24566
  };
24567
24567
  } & {
@@ -30540,20 +30540,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
30540
30540
  } & {
30541
30541
  "/runs/:id/handoff": {
30542
30542
  $get: {
30543
- output: string;
30544
- outputFormat: "text";
30545
- status: 200;
30543
+ output: {
30544
+ error: string;
30545
+ };
30546
+ outputFormat: "json";
30547
+ status: 404;
30546
30548
  input: {
30547
30549
  param: {
30548
30550
  id: string;
30549
30551
  };
30550
30552
  };
30551
30553
  } | {
30552
- output: {
30553
- error: string;
30554
- };
30555
- outputFormat: "json";
30556
- status: 404;
30554
+ output: string;
30555
+ outputFormat: "text";
30556
+ status: 200;
30557
30557
  input: {
30558
30558
  param: {
30559
30559
  id: string;
@@ -30579,20 +30579,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
30579
30579
  } & {
30580
30580
  "/runs/:id/diff": {
30581
30581
  $get: {
30582
- output: string;
30583
- outputFormat: "text";
30584
- status: import("hono/utils/http-status").ContentfulStatusCode;
30582
+ output: {
30583
+ error: string;
30584
+ };
30585
+ outputFormat: "json";
30586
+ status: 404;
30585
30587
  input: {
30586
30588
  param: {
30587
30589
  id: string;
30588
30590
  };
30589
30591
  };
30590
30592
  } | {
30591
- output: {
30592
- error: string;
30593
- };
30594
- outputFormat: "json";
30595
- status: 404;
30593
+ output: string;
30594
+ outputFormat: "text";
30595
+ status: import("hono/utils/http-status").ContentfulStatusCode;
30596
30596
  input: {
30597
30597
  param: {
30598
30598
  id: string;
@@ -3,5 +3,7 @@ import type { RunEvent, RunRecord } from '../runs/store.ts';
3
3
  * Reconstruct the portable part of a task when a continuation switches runner/account and the
4
4
  * provider-owned session id therefore cannot be resumed. Events are already secret-redacted by
5
5
  * RunStore; only conversation messages are copied, never tool inputs/results or reasoning.
6
+ * Pasted attachments travel as absolute paths under `attachmentsDir`, or the new session is
7
+ * asked about a screenshot it was never shown.
6
8
  */
7
- export declare function freshContinuationContext(run: RunRecord, events: readonly RunEvent[]): string;
9
+ export declare function freshContinuationContext(run: RunRecord, events: readonly RunEvent[], attachmentsDir: string): string;
@@ -1,3 +1,4 @@
1
+ import { join } from 'node:path';
1
2
  /** Keep a backend hand-off useful without turning an old, very long thread into an unbounded
2
3
  * opening prompt. The original task and current run state live outside this allowance. */
3
4
  const CONVERSATION_CONTEXT_CHARS = 60_000;
@@ -11,12 +12,30 @@ function cleanText(value) {
11
12
  .trim();
12
13
  return text || undefined;
13
14
  }
15
+ /** Pasted attachments live as files, so a new provider can only see them through their paths. */
16
+ function attachmentLines(urls, attachmentsDir) {
17
+ if (!Array.isArray(urls))
18
+ return [];
19
+ return urls.flatMap((url) => {
20
+ const name = typeof url === 'string' ? url.split('/').pop() : undefined;
21
+ if (!name || name.includes('..') || name.includes('\\'))
22
+ return [];
23
+ return [`- ${join(attachmentsDir, name)}`];
24
+ });
25
+ }
26
+ function withAttachments(text, lines) {
27
+ if (!lines.length)
28
+ return text;
29
+ return [text, 'Attached files:', ...lines].filter(Boolean).join('\n');
30
+ }
14
31
  /**
15
32
  * Reconstruct the portable part of a task when a continuation switches runner/account and the
16
33
  * provider-owned session id therefore cannot be resumed. Events are already secret-redacted by
17
34
  * RunStore; only conversation messages are copied, never tool inputs/results or reasoning.
35
+ * Pasted attachments travel as absolute paths under `attachmentsDir`, or the new session is
36
+ * asked about a screenshot it was never shown.
18
37
  */
19
- export function freshContinuationContext(run, events) {
38
+ export function freshContinuationContext(run, events, attachmentsDir) {
20
39
  const v2Messages = events.flatMap((event) => {
21
40
  if (event.type !== 'item.completed' || typeof event.item !== 'object' || event.item === null)
22
41
  return [];
@@ -43,7 +62,7 @@ export function freshContinuationContext(run, events) {
43
62
  const user = events.flatMap((event) => {
44
63
  if (event.type !== 'user-message')
45
64
  return [];
46
- const text = cleanText(event.text);
65
+ const text = withAttachments(cleanText(event.text), attachmentLines(event.images, attachmentsDir));
47
66
  return text ? [{ seq: event.seq, role: 'User', text }] : [];
48
67
  });
49
68
  const messages = [...user, ...assistant]
@@ -63,7 +82,7 @@ export function freshContinuationContext(run, events) {
63
82
  'You are continuing an existing Cezar task in a fresh provider session. The previous provider session cannot be resumed. Use this persisted Cezar state and conversation as the hand-off; inspect the existing worktree before changing anything.',
64
83
  '',
65
84
  '## Original task',
66
- run.task.trim() || '(given as attachments only)',
85
+ withAttachments(run.task.trim() || '(given as attachments only)', attachmentLines(run.taskImages, attachmentsDir)),
67
86
  '',
68
87
  '## Cezar task state before this continuation',
69
88
  // A queued/running status is this continuation's own bookkeeping, not where the task stood;
@@ -1 +1 @@
1
- {"version":3,"file":"continuation-context.js","sourceRoot":"","sources":["../../src/workflows/continuation-context.ts"],"names":[],"mappings":"AAEA;0FAC0F;AAC1F,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAE1C,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,IAAI,GAAG,KAAK;SACf,OAAO,CAAC,0CAA0C,EAAE,EAAE,CAAC;SACvD,OAAO,CAAC,iCAAiC,EAAE,EAAE,CAAC;SAC9C,OAAO,CAAC,kCAAkC,EAAE,EAAE,CAAC;SAC/C,IAAI,EAAE,CAAC;IACV,OAAO,IAAI,IAAI,SAAS,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAc,EAAE,MAA2B;IAClF,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1C,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,EAAE,CAAC;QACxG,MAAM,IAAI,GAAG,KAAK,CAAC,IAA0D,CAAC;QAC9E,0FAA0F;QAC1F,2FAA2F;QAC3F,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,EAAE,CAAC;QAC/D,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;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C,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,EAAE;QACF,0BAA0B,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3E,YAAY,IAAI,uCAAuC;KACxD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -1083,6 +1083,8 @@ export declare class RunManager {
1083
1083
  * an ordinary queued workflow (#472), so a second restart reconstructs and
1084
1084
  * hydrates the same amendments instead of dropping them. */
1085
1085
  private hydrateQueuedContinuation;
1086
+ /** Where `persistAttachment` writes a run's pasted files. */
1087
+ private attachmentsDir;
1086
1088
  /**
1087
1089
  * Re-read persisted attachments at dequeue/restart (#472): an image comes back as a viewable
1088
1090
  * block AND a path, a file (#950) as a path only. The branch is on the NAME's extension, never
@@ -2950,6 +2950,10 @@ export class RunManager {
2950
2950
  persistedAttachments: persisted.attachments,
2951
2951
  };
2952
2952
  }
2953
+ /** Where `persistAttachment` writes a run's pasted files. */
2954
+ attachmentsDir(runId) {
2955
+ return join(this.dataDir, 'runs', `${runId}-images`);
2956
+ }
2953
2957
  /**
2954
2958
  * Re-read persisted attachments at dequeue/restart (#472): an image comes back as a viewable
2955
2959
  * block AND a path, a file (#950) as a path only. The branch is on the NAME's extension, never
@@ -2966,7 +2970,7 @@ export class RunManager {
2966
2970
  const name = url.split('/').pop();
2967
2971
  if (!name || name.includes('..') || name.includes('/') || name.includes('\\'))
2968
2972
  continue;
2969
- const path = join(this.dataDir, 'runs', `${runId}-images`, name);
2973
+ const path = join(this.attachmentsDir(runId), name);
2970
2974
  try {
2971
2975
  if (isImageAttachmentName(name)) {
2972
2976
  const data = readFileSync(path);
@@ -3550,7 +3554,7 @@ export class RunManager {
3550
3554
  // portable context from Cezar's durable record + redacted event stream before this new turn's
3551
3555
  // user-message is appended. This works even when the interrupted agent never wrote HANDOFF.md.
3552
3556
  const portableContext = record && sessionId === undefined
3553
- ? freshContinuationContext(record, this.store.readEvents(runId))
3557
+ ? freshContinuationContext(record, this.store.readEvents(runId), this.attachmentsDir(runId))
3554
3558
  : undefined;
3555
3559
  // The record is mutated in place below; a missing-session fallback needs it as it was.
3556
3560
  const recordBeforeTurn = record && sessionId !== undefined
@@ -4020,7 +4024,7 @@ export class RunManager {
4020
4024
  const freshId = randomUUID();
4021
4025
  this.store.updateStep(runId, stepId, { sessionId: freshId });
4022
4026
  this.store.appendEvent(runId, { type: 'note', stepId, message: MISSING_SESSION_NOTE });
4023
- const context = freshContinuationContext({ ...recordBeforeTurn, steps: recordBeforeTurn.steps.filter((step) => step.id !== stepId) }, this.store.readEvents(runId).filter((event) => event.stepId !== stepId));
4027
+ const context = freshContinuationContext({ ...recordBeforeTurn, steps: recordBeforeTurn.steps.filter((step) => step.id !== stepId) }, this.store.readEvents(runId).filter((event) => event.stepId !== stepId), this.attachmentsDir(runId));
4024
4028
  await trackFallbackOutcome(() => {
4025
4029
  session = launch(freshId, false, context);
4026
4030
  for (const content of replay)
@@ -5991,7 +5995,7 @@ export class RunManager {
5991
5995
  const freshId = randomUUID();
5992
5996
  this.store.updateStep(runId, step.id, { sessionId: freshId, backend });
5993
5997
  emit({ type: 'note', stepId: step.id, message: MISSING_SESSION_NOTE });
5994
- const context = freshContinuationContext(record, this.store.readEvents(runId));
5998
+ const context = freshContinuationContext(record, this.store.readEvents(runId), this.attachmentsDir(runId));
5995
5999
  result = await trackFallbackOutcome(() => {
5996
6000
  session = attach(launch(freshId, false, `${context}\n\n---\n\n## New user instruction\n${userPrompt}`), false);
5997
6001
  for (const content of replay)