@agentic-kit/run-log 0.2.0 → 0.4.0
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 +27 -11
- package/entry-types.d.ts +73 -0
- package/entry-types.js +93 -0
- package/esm/entry-types.d.ts +73 -0
- package/esm/entry-types.js +88 -0
- package/esm/file-store.d.ts +1 -1
- package/esm/file-store.js +3 -2
- package/esm/index.d.ts +7 -3
- package/esm/index.js +7 -3
- package/esm/mirror.d.ts +63 -0
- package/esm/mirror.js +87 -0
- package/esm/projectors/parts.d.ts +1 -1
- package/esm/projectors/parts.js +1 -1
- package/esm/projectors/session.d.ts +2 -2
- package/esm/projectors/session.js +8 -6
- package/esm/projectors/spans.d.ts +84 -0
- package/esm/projectors/spans.js +176 -0
- package/esm/projectors/tool-state.d.ts +50 -0
- package/esm/projectors/tool-state.js +98 -15
- package/esm/projectors/usage.d.ts +1 -1
- package/esm/projectors/usage.js +2 -2
- package/esm/record.d.ts +17 -14
- package/esm/record.js +19 -14
- package/esm/store.d.ts +6 -3
- package/esm/store.js +3 -2
- package/esm/transcripts/format.d.ts +25 -0
- package/esm/transcripts/format.js +29 -0
- package/file-store.d.ts +1 -1
- package/file-store.js +2 -1
- package/index.d.ts +7 -3
- package/index.js +27 -12
- package/mirror.d.ts +63 -0
- package/mirror.js +91 -0
- package/package.json +2 -2
- package/projectors/parts.d.ts +1 -1
- package/projectors/parts.js +1 -1
- package/projectors/session.d.ts +2 -2
- package/projectors/session.js +7 -5
- package/projectors/spans.d.ts +84 -0
- package/projectors/spans.js +179 -0
- package/projectors/tool-state.d.ts +50 -0
- package/projectors/tool-state.js +103 -16
- package/projectors/usage.d.ts +1 -1
- package/projectors/usage.js +2 -2
- package/record.d.ts +17 -14
- package/record.js +20 -15
- package/store.d.ts +6 -3
- package/store.js +2 -1
- package/transcripts/format.d.ts +25 -0
- package/transcripts/format.js +33 -0
- /package/esm/{pi-entry.d.ts → transcripts/pi-entry.d.ts} +0 -0
- /package/esm/{pi-entry.js → transcripts/pi-entry.js} +0 -0
- /package/{pi-entry.d.ts → transcripts/pi-entry.d.ts} +0 -0
- /package/{pi-entry.js → transcripts/pi-entry.js} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Which transcript a record's entry is encoded in.
|
|
4
|
+
*
|
|
5
|
+
* The log stores a harness's own entries verbatim, so a reader cannot know how
|
|
6
|
+
* to project a record without being told what it is looking at. The format is
|
|
7
|
+
* therefore carried *per record*, not per run: a run resumed under a different
|
|
8
|
+
* harness, or migrated between them, stays one ordered log.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately a string rather than a closed union — a format is a value that
|
|
11
|
+
* ships with an adapter, so adding one must not require a release of this
|
|
12
|
+
* package. Known formats are declared as constants here.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SUPPORTED_PI_TRANSCRIPT_VERSION = exports.PI_TRANSCRIPT_FORMAT = void 0;
|
|
16
|
+
exports.assertTranscriptFormat = assertTranscriptFormat;
|
|
17
|
+
/** pi's session-file entries (`@earendil-works/pi-coding-agent`). */
|
|
18
|
+
exports.PI_TRANSCRIPT_FORMAT = 'pi';
|
|
19
|
+
/** The pi session format version this package projects without migration. */
|
|
20
|
+
exports.SUPPORTED_PI_TRANSCRIPT_VERSION = 3;
|
|
21
|
+
/**
|
|
22
|
+
* Narrow a record's format before projecting it. A projector reads one format;
|
|
23
|
+
* handing it another must fail loudly rather than render an empty conversation
|
|
24
|
+
* out of entries it did not understand.
|
|
25
|
+
*/
|
|
26
|
+
function assertTranscriptFormat(records, expected) {
|
|
27
|
+
const formats = new Set(records.map((record) => record.transcriptFormat));
|
|
28
|
+
formats.delete(expected);
|
|
29
|
+
if (formats.size === 0)
|
|
30
|
+
return;
|
|
31
|
+
throw new Error(`run log carries transcript format(s) ${Array.from(formats).sort().join(', ')}; ` +
|
|
32
|
+
`this projector reads "${expected}" entries only`);
|
|
33
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|