agenticreplay 0.1.12 → 0.1.13
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 +6 -0
- package/node_modules/@agenticreplay/adapters/package.json +6 -6
- package/node_modules/@agenticreplay/core/package.json +3 -3
- package/node_modules/@agenticreplay/fs-capture/dist/capture.d.ts +8 -0
- package/node_modules/@agenticreplay/fs-capture/dist/capture.d.ts.map +1 -1
- package/node_modules/@agenticreplay/fs-capture/dist/capture.js +7 -1
- package/node_modules/@agenticreplay/fs-capture/dist/capture.js.map +1 -1
- package/node_modules/@agenticreplay/fs-capture/package.json +2 -2
- package/node_modules/@agenticreplay/mcp-shim/package.json +1 -1
- package/node_modules/@agenticreplay/node-instrument/package.json +1 -1
- package/node_modules/@agenticreplay/plugin-api/dist/index.d.ts +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/index.d.ts.map +1 -1
- package/node_modules/@agenticreplay/plugin-api/dist/index.js +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/index.js.map +1 -1
- package/node_modules/@agenticreplay/plugin-api/dist/memory-review.d.ts +35 -0
- package/node_modules/@agenticreplay/plugin-api/dist/memory-review.d.ts.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/memory-review.js +2 -0
- package/node_modules/@agenticreplay/plugin-api/dist/memory-review.js.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/package.json +1 -1
- package/node_modules/@agenticreplay/providers/package.json +3 -3
- package/node_modules/@agenticreplay/proxy/package.json +5 -5
- package/node_modules/@agenticreplay/schema/package.json +1 -1
- package/node_modules/@agenticreplay/shell-shim/package.json +3 -3
- package/node_modules/@agenticreplay/viewer/dist/index.d.ts +1 -0
- package/node_modules/@agenticreplay/viewer/dist/index.d.ts.map +1 -1
- package/node_modules/@agenticreplay/viewer/dist/index.js +1 -0
- package/node_modules/@agenticreplay/viewer/dist/index.js.map +1 -1
- package/node_modules/@agenticreplay/viewer/dist/review.d.ts +41 -0
- package/node_modules/@agenticreplay/viewer/dist/review.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/review.js +206 -0
- package/node_modules/@agenticreplay/viewer/dist/review.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/package.json +2 -2
- package/package.json +12 -12
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +1 -0
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands/record.d.ts.map +1 -1
- package/packages/cli/dist/commands/record.js +37 -15
- package/packages/cli/dist/commands/record.js.map +1 -1
- package/packages/cli/dist/commands/review.d.ts +4 -0
- package/packages/cli/dist/commands/review.d.ts.map +1 -0
- package/packages/cli/dist/commands/review.js +54 -0
- package/packages/cli/dist/commands/review.js.map +1 -0
- package/packages/cli/dist/config.d.ts +3 -0
- package/packages/cli/dist/config.d.ts.map +1 -1
- package/packages/cli/dist/config.js.map +1 -1
- package/packages/cli/dist/flags.d.ts.map +1 -1
- package/packages/cli/dist/flags.js +2 -0
- package/packages/cli/dist/flags.js.map +1 -1
- package/packages/cli/dist/fs-events.d.ts.map +1 -1
- package/packages/cli/dist/fs-events.js +16 -0
- package/packages/cli/dist/fs-events.js.map +1 -1
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +5 -0
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/review-coordinator.d.ts +16 -0
- package/packages/cli/dist/review-coordinator.d.ts.map +1 -0
- package/packages/cli/dist/review-coordinator.js +141 -0
- package/packages/cli/dist/review-coordinator.js.map +1 -0
- package/packages/cli/dist/review-store.d.ts +24 -0
- package/packages/cli/dist/review-store.d.ts.map +1 -0
- package/packages/cli/dist/review-store.js +159 -0
- package/packages/cli/dist/review-store.js.map +1 -0
- package/packages/cli/dist/snapshot.d.ts +2 -0
- package/packages/cli/dist/snapshot.d.ts.map +1 -1
- package/packages/cli/dist/snapshot.js.map +1 -1
- package/packages/cli/package.json +11 -11
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReviewPreparer } from '@agenticreplay/plugin-api';
|
|
2
|
+
import type { ReviewAction, ReviewView } from '@agenticreplay/viewer';
|
|
3
|
+
import { RecordingReviewStore } from './review-store.js';
|
|
4
|
+
export declare class ReviewCoordinator {
|
|
5
|
+
#private;
|
|
6
|
+
private readonly store;
|
|
7
|
+
private readonly preparer?;
|
|
8
|
+
constructor(store: RecordingReviewStore, preparer?: ReviewPreparer | undefined);
|
|
9
|
+
read(): Promise<ReviewView>;
|
|
10
|
+
decide(action: ReviewAction): Promise<ReviewView>;
|
|
11
|
+
private failure;
|
|
12
|
+
private present;
|
|
13
|
+
private transition;
|
|
14
|
+
private view;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=review-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-coordinator.d.ts","sourceRoot":"","sources":["../src/review-coordinator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAoB,oBAAoB,EAAqB,MAAM,mBAAmB,CAAC;AAiC9F,qBAAa,iBAAiB;;IAI1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBADT,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,CAAC,EAAE,cAAc,YAAA;IAGtC,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAkD3B,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;YAwBzC,OAAO;YASP,OAAO;YAaP,UAAU;IAYxB,OAAO,CAAC,IAAI;CAkBb"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { Redactor } from '@agenticreplay/core';
|
|
3
|
+
import { RecordingReviewStore } from './review-store.js';
|
|
4
|
+
const unavailable = 'Kiokuko review integration is unavailable. The recording remains queued.';
|
|
5
|
+
const changed = 'This review changed in another window. Refresh before continuing.';
|
|
6
|
+
function safeText(value, limit) {
|
|
7
|
+
if (typeof value !== 'string' || value.length > limit || !value.trim())
|
|
8
|
+
throw new Error('Review text is empty or exceeds its size limit.');
|
|
9
|
+
if (new Redactor().redactString(value, 'memory-review').hits.length)
|
|
10
|
+
throw new Error('Review text contains a possible secret. Remove it before continuing.');
|
|
11
|
+
return value.replace(/\r\n?/g, '\n');
|
|
12
|
+
}
|
|
13
|
+
function validateCandidate(value, events) {
|
|
14
|
+
if (!Array.isArray(value.evidence) || value.evidence.length > 20)
|
|
15
|
+
throw new Error('Invalid review evidence.');
|
|
16
|
+
return {
|
|
17
|
+
title: safeText(value.title, 200),
|
|
18
|
+
body: safeText(value.body, 6000),
|
|
19
|
+
evidence: value.evidence.map(({ sequence, kind, description }) => {
|
|
20
|
+
if (!Number.isSafeInteger(sequence) ||
|
|
21
|
+
sequence < 1 ||
|
|
22
|
+
sequence > events ||
|
|
23
|
+
!['observed', 'inferred', 'unverified'].includes(kind)) {
|
|
24
|
+
throw new Error('Review evidence is outside the source recording.');
|
|
25
|
+
}
|
|
26
|
+
return { sequence, kind, description: safeText(description, 500) };
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export class ReviewCoordinator {
|
|
31
|
+
store;
|
|
32
|
+
preparer;
|
|
33
|
+
#preview;
|
|
34
|
+
constructor(store, preparer) {
|
|
35
|
+
this.store = store;
|
|
36
|
+
this.preparer = preparer;
|
|
37
|
+
}
|
|
38
|
+
async read() {
|
|
39
|
+
const current = await this.store.current();
|
|
40
|
+
if (current.state === 'declined')
|
|
41
|
+
return this.view(current, 'This review was discarded.');
|
|
42
|
+
try {
|
|
43
|
+
await this.store.verifySource();
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return this.view({ ...current, state: 'preparation_failed' }, 'The source recording is missing or changed.');
|
|
47
|
+
}
|
|
48
|
+
if (current.state === 'awaiting_review' && this.#preview?.digest === current.digest)
|
|
49
|
+
return this.view(current, 'Review the proposed memory and its evidence.', this.#preview.candidate);
|
|
50
|
+
if (!this.preparer)
|
|
51
|
+
return this.failure(current, unavailable);
|
|
52
|
+
let candidate;
|
|
53
|
+
try {
|
|
54
|
+
const signal = AbortSignal.timeout(10_000);
|
|
55
|
+
// Pass the timeout to the adapter and also stop waiting if the adapter fails to honor it.
|
|
56
|
+
const raw = await new Promise((resolve, reject) => {
|
|
57
|
+
const abort = () => reject(signal.reason);
|
|
58
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
59
|
+
Promise.resolve()
|
|
60
|
+
.then(() => this.preparer.prepare({
|
|
61
|
+
source: structuredClone(this.store.source),
|
|
62
|
+
traceDirectory: this.store.traceDirectory,
|
|
63
|
+
signal,
|
|
64
|
+
}))
|
|
65
|
+
.then(resolve, reject)
|
|
66
|
+
.finally(() => signal.removeEventListener('abort', abort));
|
|
67
|
+
});
|
|
68
|
+
candidate = raw === null ? null : validateCandidate(raw, this.store.source.range.events);
|
|
69
|
+
await this.store.verifySource();
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return this.failure(current, 'Kiokuko could not prepare a valid proposal. Refresh to retry.');
|
|
73
|
+
}
|
|
74
|
+
if (!candidate) {
|
|
75
|
+
const entry = await this.transition(current, { state: 'empty' });
|
|
76
|
+
return this.view(entry, 'Kiokuko found no memory candidates for this recording.');
|
|
77
|
+
}
|
|
78
|
+
return this.present(current, candidate);
|
|
79
|
+
}
|
|
80
|
+
async decide(action) {
|
|
81
|
+
const current = await this.store.current();
|
|
82
|
+
const preview = this.#preview;
|
|
83
|
+
if (current.state !== 'awaiting_review' ||
|
|
84
|
+
current.revision !== action.revision ||
|
|
85
|
+
current.digest !== action.digest ||
|
|
86
|
+
preview?.digest !== action.digest) {
|
|
87
|
+
throw new Error(changed);
|
|
88
|
+
}
|
|
89
|
+
await this.store.verifySource();
|
|
90
|
+
if (action.kind === 'decline') {
|
|
91
|
+
const result = await this.transition(current, { state: 'declined', digest: current.digest });
|
|
92
|
+
this.#preview = undefined;
|
|
93
|
+
return this.view(result, 'This review was discarded.');
|
|
94
|
+
}
|
|
95
|
+
return this.present(current, { ...preview.candidate, body: safeText(action.body, 6000) }, 'Review the updated proposal before continuing.');
|
|
96
|
+
}
|
|
97
|
+
async failure(current, message) {
|
|
98
|
+
// Preserve the known proposal binding if an adapter temporarily disappears on restart.
|
|
99
|
+
const entry = current.state === 'awaiting_review'
|
|
100
|
+
? { ...current, state: 'preparation_failed' }
|
|
101
|
+
: await this.transition(current, { state: 'preparation_failed' });
|
|
102
|
+
return this.view(entry, message);
|
|
103
|
+
}
|
|
104
|
+
async present(current, candidate, message = 'Review the proposed memory and its evidence.') {
|
|
105
|
+
const digest = createHash('sha256')
|
|
106
|
+
.update(JSON.stringify({ version: 1, source: this.store.source, candidate }))
|
|
107
|
+
.digest('hex');
|
|
108
|
+
const entry = await this.transition(current, { state: 'awaiting_review', digest });
|
|
109
|
+
this.#preview = { digest, candidate };
|
|
110
|
+
return this.view(entry, message, candidate);
|
|
111
|
+
}
|
|
112
|
+
async transition(current, next) {
|
|
113
|
+
if (current.state === next.state &&
|
|
114
|
+
(!('digest' in next) || ('digest' in current && current.digest === next.digest))) {
|
|
115
|
+
return current;
|
|
116
|
+
}
|
|
117
|
+
const result = await this.store.advance(current, next);
|
|
118
|
+
if (!result)
|
|
119
|
+
throw new Error(changed);
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
view(entry, message, candidate) {
|
|
123
|
+
const source = this.store.source;
|
|
124
|
+
return {
|
|
125
|
+
runId: source.runId,
|
|
126
|
+
repository: source.repository,
|
|
127
|
+
exitCode: source.exitCode,
|
|
128
|
+
events: source.range.events,
|
|
129
|
+
capture: source.capture,
|
|
130
|
+
captureIssues: source.captureIssues,
|
|
131
|
+
state: entry.state,
|
|
132
|
+
message,
|
|
133
|
+
...(candidate && 'digest' in entry
|
|
134
|
+
? {
|
|
135
|
+
proposal: { ...candidate, revision: entry.revision, digest: entry.digest },
|
|
136
|
+
}
|
|
137
|
+
: {}),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=review-coordinator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-coordinator.js","sourceRoot":"","sources":["../src/review-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,OAAO,EAAoB,oBAAoB,EAAqB,MAAM,mBAAmB,CAAC;AAE9F,MAAM,WAAW,GAAG,0EAA0E,CAAC;AAC/F,MAAM,OAAO,GAAG,mEAAmE,CAAC;AAEpF,SAAS,QAAQ,CAAC,KAAc,EAAE,KAAa;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QACpE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,IAAI,IAAI,QAAQ,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM;QACjE,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IAC1F,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAsB,EAAE,MAAc;IAC/D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE;QAC9D,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,OAAO;QACL,K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@
|
|
|
1
|
+
import type { RecordingReviewSource } from '@agenticreplay/plugin-api';
|
|
2
|
+
export declare function reviewRepository(cwd: string): Promise<string>;
|
|
3
|
+
export type ReviewEntry = {
|
|
4
|
+
state: 'queued' | 'empty' | 'preparation_failed';
|
|
5
|
+
} | {
|
|
6
|
+
state: 'awaiting_review' | 'declined';
|
|
7
|
+
digest: string;
|
|
8
|
+
};
|
|
9
|
+
export type StoredReview = ReviewEntry & {
|
|
10
|
+
revision: number;
|
|
11
|
+
};
|
|
12
|
+
/** Private operational state adjacent to the recording store, outside individual run directories. */
|
|
13
|
+
export declare class RecordingReviewStore {
|
|
14
|
+
private readonly directory;
|
|
15
|
+
readonly traceDirectory: string;
|
|
16
|
+
readonly source: RecordingReviewSource;
|
|
17
|
+
private constructor();
|
|
18
|
+
static enqueue(cwd: string, runId: string, traceDirectory: string, repository: string): Promise<RecordingReviewStore>;
|
|
19
|
+
static open(cwd: string, runId: string): Promise<RecordingReviewStore>;
|
|
20
|
+
verifySource(): Promise<void>;
|
|
21
|
+
current(): Promise<StoredReview>;
|
|
22
|
+
advance(current: StoredReview, entry: ReviewEntry): Promise<StoredReview | null>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=review-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-store.d.ts","sourceRoot":"","sources":["../src/review-store.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAMvE,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAanE;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,GAAG,oBAAoB,CAAA;CAAE,GACpD;IAAE,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AA6D9D,qGAAqG;AACrG,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC/B,QAAQ,CAAC,MAAM,EAAE,qBAAqB;IAHxC,OAAO;WAMM,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;WAkB9E,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAetC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAW7B,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;IAuBhC,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;CAMvF"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
3
|
+
import { link, mkdir, open, readFile, readdir, realpath, rm, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { isAbsolute, join, relative, sep } from 'node:path';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
|
+
import { agenticreplayDir, assertPrivatePathIdentity, privatePathIdentity, resolveRunSelector, restrictToOwner, sha256File, } from '@agenticreplay/core';
|
|
7
|
+
import { assertManifest, RUN_ID_PATTERN } from '@agenticreplay/schema';
|
|
8
|
+
const exec = promisify(execFile);
|
|
9
|
+
const hashPattern = /^[0-9a-f]{64}$/;
|
|
10
|
+
export async function reviewRepository(cwd) {
|
|
11
|
+
const { stdout } = await exec('git', ['rev-parse', '--show-toplevel'], {
|
|
12
|
+
cwd,
|
|
13
|
+
timeout: 3000,
|
|
14
|
+
maxBuffer: 64 * 1024,
|
|
15
|
+
}).catch(() => {
|
|
16
|
+
throw new Error('Memory review requires a local Git repository.');
|
|
17
|
+
});
|
|
18
|
+
const repository = await realpath(stdout.replace(/\r?\n$/, ''));
|
|
19
|
+
const fromRoot = relative(repository, await realpath(cwd));
|
|
20
|
+
if (isAbsolute(fromRoot) || fromRoot === '..' || fromRoot.startsWith(`..${sep}`))
|
|
21
|
+
throw new Error('The recording directory is outside its Git repository.');
|
|
22
|
+
return repository;
|
|
23
|
+
}
|
|
24
|
+
function errorCode(error) {
|
|
25
|
+
return error?.code;
|
|
26
|
+
}
|
|
27
|
+
/** Write the complete next generation before atomically claiming its number. */
|
|
28
|
+
async function createOnce(dir, name, data) {
|
|
29
|
+
const staged = join(dir, `.${randomUUID()}.incoming`);
|
|
30
|
+
await writeFile(staged, '', { flag: 'wx', mode: 0o600 });
|
|
31
|
+
try {
|
|
32
|
+
await restrictToOwner(staged, 0o600);
|
|
33
|
+
const file = await open(staged, 'w');
|
|
34
|
+
try {
|
|
35
|
+
await file.writeFile(`${JSON.stringify(data)}\n`);
|
|
36
|
+
await file.sync();
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
await file.close();
|
|
40
|
+
}
|
|
41
|
+
await link(staged, join(dir, name));
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (errorCode(error) === 'EEXIST')
|
|
46
|
+
return false;
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
await rm(staged, { force: true });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function sourceFor(traceDirectory, runId, repository) {
|
|
54
|
+
const bytes = await readFile(join(traceDirectory, 'manifest.json'));
|
|
55
|
+
const manifest = JSON.parse(bytes.toString('utf8'));
|
|
56
|
+
assertManifest(manifest);
|
|
57
|
+
if (manifest.run_id !== runId ||
|
|
58
|
+
!manifest.ended_at ||
|
|
59
|
+
!manifest.integrity?.events_sha256 ||
|
|
60
|
+
manifest.counts === undefined ||
|
|
61
|
+
manifest.exit_code === undefined) {
|
|
62
|
+
throw new Error('The recording is missing its finalized manifest.');
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
version: 1,
|
|
66
|
+
kind: 'recorded_process',
|
|
67
|
+
repository,
|
|
68
|
+
runId,
|
|
69
|
+
hostSessionId: null,
|
|
70
|
+
range: { kind: 'whole_run', events: manifest.counts.events },
|
|
71
|
+
manifestDigest: createHash('sha256').update(bytes).digest('hex'),
|
|
72
|
+
eventsDigest: manifest.integrity.events_sha256,
|
|
73
|
+
capture: manifest.capture?.status ?? 'unverified',
|
|
74
|
+
captureIssues: manifest.capture?.issues ?? [],
|
|
75
|
+
exitCode: manifest.exit_code,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** Private operational state adjacent to the recording store, outside individual run directories. */
|
|
79
|
+
export class RecordingReviewStore {
|
|
80
|
+
directory;
|
|
81
|
+
traceDirectory;
|
|
82
|
+
source;
|
|
83
|
+
constructor(directory, traceDirectory, source) {
|
|
84
|
+
this.directory = directory;
|
|
85
|
+
this.traceDirectory = traceDirectory;
|
|
86
|
+
this.source = source;
|
|
87
|
+
}
|
|
88
|
+
static async enqueue(cwd, runId, traceDirectory, repository) {
|
|
89
|
+
if (!RUN_ID_PATTERN.test(runId))
|
|
90
|
+
throw new Error('Invalid recording ID.');
|
|
91
|
+
const parent = join(agenticreplayDir(cwd), 'reviews');
|
|
92
|
+
const directory = join(parent, runId);
|
|
93
|
+
const source = await sourceFor(traceDirectory, runId, repository);
|
|
94
|
+
for (const path of [parent, directory]) {
|
|
95
|
+
await mkdir(path, { recursive: true, mode: 0o700 });
|
|
96
|
+
const identity = await privatePathIdentity(path);
|
|
97
|
+
await restrictToOwner(path, 0o700);
|
|
98
|
+
await assertPrivatePathIdentity(path, identity);
|
|
99
|
+
}
|
|
100
|
+
await createOnce(directory, 'source.json', source);
|
|
101
|
+
const stored = await readFile(join(directory, 'source.json'), 'utf8');
|
|
102
|
+
if (JSON.stringify(JSON.parse(stored)) !== JSON.stringify(source))
|
|
103
|
+
throw new Error('This review is already bound to a different recording.');
|
|
104
|
+
return new RecordingReviewStore(directory, traceDirectory, source);
|
|
105
|
+
}
|
|
106
|
+
static async open(cwd, runId) {
|
|
107
|
+
if (!RUN_ID_PATTERN.test(runId))
|
|
108
|
+
throw new Error('Specify an exact run ID from agenticreplay list.');
|
|
109
|
+
const directory = join(agenticreplayDir(cwd), 'reviews', runId);
|
|
110
|
+
const stored = await readFile(join(directory, 'source.json'), 'utf8').catch((error) => {
|
|
111
|
+
if (errorCode(error) !== 'ENOENT')
|
|
112
|
+
throw error;
|
|
113
|
+
throw new Error(`No queued memory review for ${runId}.`);
|
|
114
|
+
});
|
|
115
|
+
const { dir } = await resolveRunSelector(cwd, runId);
|
|
116
|
+
const source = await sourceFor(dir, runId, await reviewRepository(cwd));
|
|
117
|
+
if (JSON.stringify(JSON.parse(stored)) !== JSON.stringify(source))
|
|
118
|
+
throw new Error('The recording or its repository changed since review was queued.');
|
|
119
|
+
return new RecordingReviewStore(directory, dir, source);
|
|
120
|
+
}
|
|
121
|
+
async verifySource() {
|
|
122
|
+
const [manifest, events] = await Promise.all([
|
|
123
|
+
sha256File(join(this.traceDirectory, 'manifest.json')),
|
|
124
|
+
sha256File(join(this.traceDirectory, 'events.jsonl')),
|
|
125
|
+
]).catch(() => {
|
|
126
|
+
throw new Error('The source recording is unavailable.');
|
|
127
|
+
});
|
|
128
|
+
if (manifest !== this.source.manifestDigest || events !== this.source.eventsDigest)
|
|
129
|
+
throw new Error('The source recording changed. Its queued review is invalid.');
|
|
130
|
+
}
|
|
131
|
+
async current() {
|
|
132
|
+
const revision = (await readdir(this.directory)).reduce((latest, name) => {
|
|
133
|
+
const match = /^([1-9][0-9]*)\.json$/.exec(name);
|
|
134
|
+
return match ? Math.max(latest, Number(match[1])) : latest;
|
|
135
|
+
}, 0);
|
|
136
|
+
if (revision === 0)
|
|
137
|
+
return { state: 'queued', revision };
|
|
138
|
+
const record = JSON.parse(await readFile(join(this.directory, `${revision}.json`), 'utf8'));
|
|
139
|
+
if (!Number.isSafeInteger(revision) ||
|
|
140
|
+
!record ||
|
|
141
|
+
!(record.state === 'empty' ||
|
|
142
|
+
record.state === 'preparation_failed' ||
|
|
143
|
+
((record.state === 'awaiting_review' || record.state === 'declined') &&
|
|
144
|
+
typeof record.digest === 'string' &&
|
|
145
|
+
hashPattern.test(record.digest)))) {
|
|
146
|
+
throw new Error('The queued review state is invalid.');
|
|
147
|
+
}
|
|
148
|
+
return { ...record, revision };
|
|
149
|
+
}
|
|
150
|
+
async advance(current, entry) {
|
|
151
|
+
if (current.state === 'declined')
|
|
152
|
+
return null;
|
|
153
|
+
const revision = current.revision + 1;
|
|
154
|
+
if (!(await createOnce(this.directory, `${revision}.json`, entry)))
|
|
155
|
+
return null;
|
|
156
|
+
return { ...entry, revision };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=review-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-store.js","sourceRoot":"","sources":["../src/review-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,UAAU,GACX,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,cAAc,EAA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AAC;QACtC,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,QAAQ,OAAO,EAAE,KAAK,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAChF,OAAO,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { FileChange } from '@agenticreplay/fs-capture';
|
|
2
2
|
export interface SnapshotResult {
|
|
3
3
|
changes: FileChange[];
|
|
4
|
+
/** See `TurnSnapshot.coveredBy`: this turn's window was already sampled by a later turn. */
|
|
5
|
+
coveredBy?: number;
|
|
4
6
|
/** See `TurnSnapshot.skippedGitlinks`: declared paths this snapshot could not hold. */
|
|
5
7
|
skippedGitlinks?: readonly string[];
|
|
6
8
|
/** See `TurnSnapshot.uncommittedNested`: nested repositories with no commit to record them by. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,kGAAkG;IAClG,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtE;AAED,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO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AM,CAAC;CAChB;AAeD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,YAAY,CAAC,CAuBvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,CAAC,4BAA4B,EAAE,cAAc,EAAE,2BAA2B,CAAC,CAAC;AAE9F,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAsB,EACtB,IAAY,EACZ,UAAwB,EAAE;IAE1B,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IAEtC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,OAAO,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC9B,QAAQ,IAAI,CAAC,CAAC;QACd,IAAI,CAAC;YACH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC3E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,SAAS,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,wFAAwF;YACxF,6BAA6B;YAC7B,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;gBAAE,MAAM;YACnC,IAAI,QAAQ,GAAG,WAAW,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agenticreplay",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"mcpName": "io.github.askdkc/agenticreplay",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"directory": "packages/cli"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@agenticreplay/schema": "0.1.
|
|
41
|
-
"@agenticreplay/plugin-api": "0.1.
|
|
42
|
-
"@agenticreplay/core": "0.1.
|
|
43
|
-
"@agenticreplay/proxy": "0.1.
|
|
44
|
-
"@agenticreplay/providers": "0.1.
|
|
45
|
-
"@agenticreplay/adapters": "0.1.
|
|
46
|
-
"@agenticreplay/fs-capture": "0.1.
|
|
47
|
-
"@agenticreplay/viewer": "0.1.
|
|
48
|
-
"@agenticreplay/mcp-shim": "0.1.
|
|
49
|
-
"@agenticreplay/shell-shim": "0.1.
|
|
40
|
+
"@agenticreplay/schema": "0.1.13",
|
|
41
|
+
"@agenticreplay/plugin-api": "0.1.13",
|
|
42
|
+
"@agenticreplay/core": "0.1.13",
|
|
43
|
+
"@agenticreplay/proxy": "0.1.13",
|
|
44
|
+
"@agenticreplay/providers": "0.1.13",
|
|
45
|
+
"@agenticreplay/adapters": "0.1.13",
|
|
46
|
+
"@agenticreplay/fs-capture": "0.1.13",
|
|
47
|
+
"@agenticreplay/viewer": "0.1.13",
|
|
48
|
+
"@agenticreplay/mcp-shim": "0.1.13",
|
|
49
|
+
"@agenticreplay/shell-shim": "0.1.13"
|
|
50
50
|
}
|
|
51
51
|
}
|