@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.
Files changed (54) hide show
  1. package/README.md +27 -11
  2. package/entry-types.d.ts +73 -0
  3. package/entry-types.js +93 -0
  4. package/esm/entry-types.d.ts +73 -0
  5. package/esm/entry-types.js +88 -0
  6. package/esm/file-store.d.ts +1 -1
  7. package/esm/file-store.js +3 -2
  8. package/esm/index.d.ts +7 -3
  9. package/esm/index.js +7 -3
  10. package/esm/mirror.d.ts +63 -0
  11. package/esm/mirror.js +87 -0
  12. package/esm/projectors/parts.d.ts +1 -1
  13. package/esm/projectors/parts.js +1 -1
  14. package/esm/projectors/session.d.ts +2 -2
  15. package/esm/projectors/session.js +8 -6
  16. package/esm/projectors/spans.d.ts +84 -0
  17. package/esm/projectors/spans.js +176 -0
  18. package/esm/projectors/tool-state.d.ts +50 -0
  19. package/esm/projectors/tool-state.js +98 -15
  20. package/esm/projectors/usage.d.ts +1 -1
  21. package/esm/projectors/usage.js +2 -2
  22. package/esm/record.d.ts +17 -14
  23. package/esm/record.js +19 -14
  24. package/esm/store.d.ts +6 -3
  25. package/esm/store.js +3 -2
  26. package/esm/transcripts/format.d.ts +25 -0
  27. package/esm/transcripts/format.js +29 -0
  28. package/file-store.d.ts +1 -1
  29. package/file-store.js +2 -1
  30. package/index.d.ts +7 -3
  31. package/index.js +27 -12
  32. package/mirror.d.ts +63 -0
  33. package/mirror.js +91 -0
  34. package/package.json +2 -2
  35. package/projectors/parts.d.ts +1 -1
  36. package/projectors/parts.js +1 -1
  37. package/projectors/session.d.ts +2 -2
  38. package/projectors/session.js +7 -5
  39. package/projectors/spans.d.ts +84 -0
  40. package/projectors/spans.js +179 -0
  41. package/projectors/tool-state.d.ts +50 -0
  42. package/projectors/tool-state.js +103 -16
  43. package/projectors/usage.d.ts +1 -1
  44. package/projectors/usage.js +2 -2
  45. package/record.d.ts +17 -14
  46. package/record.js +20 -15
  47. package/store.d.ts +6 -3
  48. package/store.js +2 -1
  49. package/transcripts/format.d.ts +25 -0
  50. package/transcripts/format.js +33 -0
  51. /package/esm/{pi-entry.d.ts → transcripts/pi-entry.d.ts} +0 -0
  52. /package/esm/{pi-entry.js → transcripts/pi-entry.js} +0 -0
  53. /package/{pi-entry.d.ts → transcripts/pi-entry.d.ts} +0 -0
  54. /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