@qvac/harness 0.7.1 → 1.0.0-rc.1

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 (201) hide show
  1. package/README.md +224 -0
  2. package/dist-lib/index.d.ts +55 -3
  3. package/dist-lib/index.js +721 -236
  4. package/dist-lib/lib/capabilities/completion-engine/abort-polyfill.d.ts +1 -0
  5. package/dist-lib/lib/capabilities/completion-engine/abort-polyfill.js +10 -0
  6. package/dist-lib/lib/capabilities/completion-engine/actors/answering.d.ts +3 -0
  7. package/dist-lib/lib/capabilities/completion-engine/actors/answering.js +17 -0
  8. package/dist-lib/lib/capabilities/completion-engine/actors/approval.d.ts +4 -0
  9. package/dist-lib/lib/capabilities/completion-engine/actors/approval.js +29 -0
  10. package/dist-lib/lib/capabilities/completion-engine/actors/direct-search.d.ts +4 -0
  11. package/dist-lib/lib/capabilities/completion-engine/actors/direct-search.js +73 -0
  12. package/dist-lib/lib/capabilities/completion-engine/actors/execute.d.ts +41 -0
  13. package/dist-lib/lib/capabilities/completion-engine/actors/execute.js +49 -0
  14. package/dist-lib/lib/capabilities/completion-engine/actors/executing.d.ts +3 -0
  15. package/dist-lib/lib/capabilities/completion-engine/actors/executing.js +102 -0
  16. package/dist-lib/lib/capabilities/completion-engine/actors/execution-plan.d.ts +47 -0
  17. package/dist-lib/lib/capabilities/completion-engine/actors/execution-plan.js +87 -0
  18. package/dist-lib/lib/capabilities/completion-engine/actors/finishing.d.ts +2 -0
  19. package/dist-lib/lib/capabilities/completion-engine/actors/finishing.js +32 -0
  20. package/dist-lib/lib/capabilities/completion-engine/actors/inspect-preload.d.ts +3 -0
  21. package/dist-lib/lib/capabilities/completion-engine/actors/inspect-preload.js +75 -0
  22. package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.d.ts +3 -0
  23. package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.js +152 -0
  24. package/dist-lib/lib/capabilities/completion-engine/actors/loading-skill.d.ts +3 -0
  25. package/dist-lib/lib/capabilities/completion-engine/actors/loading-skill.js +94 -0
  26. package/dist-lib/lib/capabilities/completion-engine/actors/preload-failure.d.ts +9 -0
  27. package/dist-lib/lib/capabilities/completion-engine/actors/preload-failure.js +11 -0
  28. package/dist-lib/lib/capabilities/completion-engine/actors/preloading.d.ts +3 -0
  29. package/dist-lib/lib/capabilities/completion-engine/actors/preloading.js +114 -0
  30. package/dist-lib/lib/capabilities/completion-engine/actors/preparing.d.ts +3 -0
  31. package/dist-lib/lib/capabilities/completion-engine/actors/preparing.js +198 -0
  32. package/dist-lib/lib/capabilities/completion-engine/actors/rejecting.d.ts +3 -0
  33. package/dist-lib/lib/capabilities/completion-engine/actors/rejecting.js +71 -0
  34. package/dist-lib/lib/capabilities/completion-engine/actors/rejection.d.ts +18 -0
  35. package/dist-lib/lib/capabilities/completion-engine/actors/rejection.js +70 -0
  36. package/dist-lib/lib/capabilities/completion-engine/actors/resolving.d.ts +3 -0
  37. package/dist-lib/lib/capabilities/completion-engine/actors/resolving.js +60 -0
  38. package/dist-lib/lib/capabilities/completion-engine/actors/stream.d.ts +21 -0
  39. package/dist-lib/lib/capabilities/completion-engine/actors/stream.js +48 -0
  40. package/dist-lib/lib/capabilities/completion-engine/actors/streaming.d.ts +3 -0
  41. package/dist-lib/lib/capabilities/completion-engine/actors/streaming.js +156 -0
  42. package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.d.ts +7 -0
  43. package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.js +61 -0
  44. package/dist-lib/lib/capabilities/completion-engine/driver.d.ts +25 -0
  45. package/dist-lib/lib/capabilities/completion-engine/driver.js +553 -0
  46. package/dist-lib/lib/capabilities/completion-engine/durable.d.ts +61 -0
  47. package/dist-lib/lib/capabilities/completion-engine/durable.js +150 -0
  48. package/dist-lib/lib/capabilities/completion-engine/operations.d.ts +6 -0
  49. package/dist-lib/lib/capabilities/completion-engine/operations.js +239 -0
  50. package/dist-lib/lib/capabilities/completion-engine/ports.d.ts +3 -0
  51. package/dist-lib/lib/capabilities/completion-engine/ports.js +267 -0
  52. package/dist-lib/lib/capabilities/completion-engine/session.d.ts +76 -0
  53. package/dist-lib/lib/capabilities/completion-engine/session.js +70 -0
  54. package/dist-lib/lib/capabilities/completion-loop/index.d.ts +80 -0
  55. package/dist-lib/lib/capabilities/completion-loop/index.js +158 -0
  56. package/dist-lib/lib/capabilities/completion-loop/metrics.d.ts +5 -0
  57. package/dist-lib/lib/capabilities/completion-loop/metrics.js +29 -0
  58. package/dist-lib/lib/capabilities/completion-loop/round.d.ts +33 -0
  59. package/dist-lib/lib/capabilities/completion-loop/round.js +353 -0
  60. package/dist-lib/lib/capabilities/completion-loop/tool-execution.d.ts +60 -0
  61. package/dist-lib/lib/capabilities/completion-loop/tool-execution.js +270 -0
  62. package/dist-lib/lib/capabilities/completion-loop/turns.d.ts +23 -0
  63. package/dist-lib/lib/capabilities/completion-loop/turns.js +112 -0
  64. package/dist-lib/lib/capabilities/completion-runtime.d.ts +46 -0
  65. package/dist-lib/lib/capabilities/completion-runtime.js +74 -0
  66. package/dist-lib/lib/capabilities/completion.d.ts +18 -335
  67. package/dist-lib/lib/capabilities/completion.js +20 -1301
  68. package/dist-lib/lib/capabilities/download.d.ts +1 -1
  69. package/dist-lib/lib/capabilities/download.js +7 -2
  70. package/dist-lib/lib/capabilities/invoke.js +5 -3
  71. package/dist-lib/lib/capabilities/tool-plan.d.ts +35 -0
  72. package/dist-lib/lib/capabilities/tool-plan.js +66 -0
  73. package/dist-lib/lib/capabilities/tool-turns.d.ts +11 -2
  74. package/dist-lib/lib/capabilities/tool-turns.js +30 -2
  75. package/dist-lib/lib/capabilities/types.d.ts +287 -0
  76. package/dist-lib/lib/capabilities/types.js +1 -0
  77. package/dist-lib/lib/completion-lifecycle.d.ts +14 -0
  78. package/dist-lib/lib/completion-lifecycle.js +126 -0
  79. package/dist-lib/lib/connect.d.ts +10 -3
  80. package/dist-lib/lib/connect.js +329 -23
  81. package/dist-lib/lib/contract-types.d.ts +19 -2
  82. package/dist-lib/lib/harness-lifecycle.d.ts +66 -0
  83. package/dist-lib/lib/harness-lifecycle.js +129 -0
  84. package/dist-lib/lib/helpers/detach-json.d.ts +1 -0
  85. package/dist-lib/lib/helpers/detach-json.js +146 -0
  86. package/dist-lib/lib/helpers/markup-scanner.d.ts +26 -0
  87. package/dist-lib/lib/helpers/markup-scanner.js +156 -0
  88. package/dist-lib/lib/helpers/markup-stream-filter.js +138 -35
  89. package/dist-lib/lib/helpers/race-abort.d.ts +9 -4
  90. package/dist-lib/lib/helpers/race-abort.js +2 -7
  91. package/dist-lib/lib/helpers/recovery-required.d.ts +1 -0
  92. package/dist-lib/lib/helpers/recovery-required.js +1 -0
  93. package/dist-lib/lib/helpers/run-outcome.d.ts +10 -2
  94. package/dist-lib/lib/helpers/run-outcome.js +8 -5
  95. package/dist-lib/lib/helpers/tool-call-markup.d.ts +2 -0
  96. package/dist-lib/lib/helpers/tool-call-markup.js +197 -82
  97. package/dist-lib/lib/hooks/built-in/arg-repair.d.ts +1 -0
  98. package/dist-lib/lib/hooks/built-in/arg-repair.js +1 -0
  99. package/dist-lib/lib/hooks/built-in/egress.d.ts +1 -0
  100. package/dist-lib/lib/hooks/built-in/egress.js +2 -1
  101. package/dist-lib/lib/hooks/built-in/sandbox.d.ts +1 -0
  102. package/dist-lib/lib/hooks/built-in/sandbox.js +6 -1
  103. package/dist-lib/lib/hooks/built-in/skill-catalog.d.ts +1 -0
  104. package/dist-lib/lib/hooks/built-in/skill-catalog.js +2 -1
  105. package/dist-lib/lib/hooks/pipeline.d.ts +4 -1
  106. package/dist-lib/lib/hooks/pipeline.js +24 -2
  107. package/dist-lib/lib/hooks/run.d.ts +2 -1
  108. package/dist-lib/lib/hooks/run.js +19 -7
  109. package/dist-lib/lib/hooks/types.d.ts +17 -6
  110. package/dist-lib/lib/machine/completion/actions/approval.d.ts +3 -0
  111. package/dist-lib/lib/machine/completion/actions/approval.js +16 -0
  112. package/dist-lib/lib/machine/completion/actions/completion.d.ts +23 -0
  113. package/dist-lib/lib/machine/completion/actions/completion.js +142 -0
  114. package/dist-lib/lib/machine/completion/actions/skills.d.ts +9 -0
  115. package/dist-lib/lib/machine/completion/actions/skills.js +83 -0
  116. package/dist-lib/lib/machine/completion/actions/tools.d.ts +16 -0
  117. package/dist-lib/lib/machine/completion/actions/tools.js +173 -0
  118. package/dist-lib/lib/machine/completion/context.d.ts +9 -0
  119. package/dist-lib/lib/machine/completion/context.js +44 -0
  120. package/dist-lib/lib/machine/completion/contract.d.ts +6 -0
  121. package/dist-lib/lib/machine/completion/contract.js +1 -0
  122. package/dist-lib/lib/machine/completion/guards/retry.d.ts +9 -0
  123. package/dist-lib/lib/machine/completion/guards/retry.js +25 -0
  124. package/dist-lib/lib/machine/completion/implementations.d.ts +81 -0
  125. package/dist-lib/lib/machine/completion/implementations.js +152 -0
  126. package/dist-lib/lib/machine/completion/machine.d.ts +375 -0
  127. package/dist-lib/lib/machine/completion/machine.js +511 -0
  128. package/dist-lib/lib/machine/completion/ports.d.ts +65 -0
  129. package/dist-lib/lib/machine/completion/ports.js +224 -0
  130. package/dist-lib/lib/machine/completion/rules.d.ts +39 -0
  131. package/dist-lib/lib/machine/completion/rules.js +115 -0
  132. package/dist-lib/lib/machine/completion/types.d.ts +493 -0
  133. package/dist-lib/lib/machine/completion/types.js +1 -0
  134. package/dist-lib/lib/machine/engine.d.ts +93 -0
  135. package/dist-lib/lib/machine/engine.js +483 -0
  136. package/dist-lib/lib/machine/errors.d.ts +44 -0
  137. package/dist-lib/lib/machine/errors.js +373 -0
  138. package/dist-lib/lib/machine/guards.d.ts +2 -0
  139. package/dist-lib/lib/machine/guards.js +6 -0
  140. package/dist-lib/lib/machine/index.d.ts +20 -0
  141. package/dist-lib/lib/machine/index.js +11 -0
  142. package/dist-lib/lib/machine/replay-output.d.ts +24 -0
  143. package/dist-lib/lib/machine/replay-output.js +50 -0
  144. package/dist-lib/lib/machine/stable-stringify.d.ts +1 -0
  145. package/dist-lib/lib/machine/stable-stringify.js +11 -0
  146. package/dist-lib/lib/models/model-pool.d.ts +14 -6
  147. package/dist-lib/lib/models/model-pool.js +95 -30
  148. package/dist-lib/lib/run-log/history-codec.d.ts +23 -0
  149. package/dist-lib/lib/run-log/history-codec.js +973 -0
  150. package/dist-lib/lib/run-log/patch.d.ts +6 -0
  151. package/dist-lib/lib/run-log/patch.js +93 -0
  152. package/dist-lib/lib/run-log/persisted-actor.d.ts +18 -0
  153. package/dist-lib/lib/run-log/persisted-actor.js +218 -0
  154. package/dist-lib/lib/run-log/protocol-types.d.ts +153 -0
  155. package/dist-lib/lib/run-log/protocol-types.js +1 -0
  156. package/dist-lib/lib/run-log/protocol.d.ts +27 -0
  157. package/dist-lib/lib/run-log/protocol.js +1056 -0
  158. package/dist-lib/lib/run-log/replay.d.ts +25 -0
  159. package/dist-lib/lib/run-log/replay.js +129 -0
  160. package/dist-lib/lib/run-log/run-journal.d.ts +125 -0
  161. package/dist-lib/lib/run-log/run-journal.js +783 -0
  162. package/dist-lib/lib/run-log-inspect.d.ts +25 -0
  163. package/dist-lib/lib/run-log-inspect.js +627 -0
  164. package/dist-lib/lib/run-log-protocol.d.ts +2 -0
  165. package/dist-lib/lib/run-log-protocol.js +1 -0
  166. package/dist-lib/lib/run-log-redact.d.ts +27 -0
  167. package/dist-lib/lib/run-log-redact.js +1107 -0
  168. package/dist-lib/lib/serve.js +307 -11
  169. package/dist-lib/lib/spawn.js +3 -2
  170. package/dist-lib/lib/tool-call-display.d.ts +1 -21
  171. package/dist-lib/lib/tools/exec/adapters/python/wheels.js +2 -1
  172. package/dist-lib/lib/tools/exec.d.ts +2 -1
  173. package/dist-lib/lib/tools/exec.js +57 -2
  174. package/dist-lib/lib/tools/generate-image.js +1 -1
  175. package/dist-lib/lib/tools/generate-music.js +1 -1
  176. package/dist-lib/lib/tools/http-request.d.ts +2 -1
  177. package/dist-lib/lib/tools/http-request.js +2 -1
  178. package/dist-lib/lib/tools/mcp-call.js +8 -1
  179. package/dist-lib/lib/tools/operations/builders.d.ts +1 -0
  180. package/dist-lib/lib/tools/operations/builders.js +1 -0
  181. package/dist-lib/lib/tools/operations/compile.js +11 -1
  182. package/dist-lib/lib/tools/operations/manifest.js +1 -0
  183. package/dist-lib/lib/tools/outbound-guard.d.ts +8 -6
  184. package/dist-lib/lib/tools/outbound-guard.js +25 -8
  185. package/dist-lib/lib/tools/skills/catalog.d.ts +1 -0
  186. package/dist-lib/lib/tools/skills/catalog.js +35 -0
  187. package/dist-lib/lib/tools/skills/cli-schema-types.d.ts +1 -0
  188. package/dist-lib/lib/tools/skills/cli-schema.js +25 -0
  189. package/dist-lib/lib/wire.d.ts +5 -0
  190. package/dist-lib/lib/wire.js +128 -5
  191. package/dist-lib/schema/harness.js +20 -5
  192. package/dist-lib/spec/hrpc/messages.js +95 -15
  193. package/dist-lib/spec/hyperschema/index.js +95 -15
  194. package/dist-lib/spec/hyperschema/schema.json +69 -1
  195. package/dist-lib/spec/hyperschema/types.d.ts +10 -3
  196. package/package.json +20 -2
  197. package/patches/@qvac%2Finference@0.20.0.patch +67 -0
  198. package/patches/bare-stow@0.1.5.patch +68 -0
  199. package/patches/hypercore-blob-server@1.15.0.patch +15 -0
  200. package/patches/localwatch@1.4.3.patch +13 -0
  201. package/patches/pyodide@314.0.2.patch +144 -0
@@ -0,0 +1,25 @@
1
+ import { type MachineLog, type RunRecord } from './machine/index.ts';
2
+ interface InspectionOptions {
3
+ recordLimit?: number;
4
+ contextRecord?: number;
5
+ physicalLength?: number;
6
+ contextPhysicalLength?: number;
7
+ expectedMachineVersion?: number;
8
+ expectedXstateVersion?: string;
9
+ }
10
+ export interface PositionedRunRecord {
11
+ recordIndex: number;
12
+ stepSeq: number;
13
+ physicalLength: number;
14
+ record: RunRecord;
15
+ }
16
+ interface PositionedInspectionEnvelope {
17
+ records: () => AsyncIterable<PositionedRunRecord>;
18
+ physicalLength?: unknown;
19
+ logicalLength?: unknown;
20
+ nextSeq?: unknown;
21
+ }
22
+ type InspectionCore = MachineLog | PositionedInspectionEnvelope;
23
+ export declare function inspectRun(core: InspectionCore, opts?: InspectionOptions): AsyncGenerator<string>;
24
+ export declare function renderRunLogHtml(core: InspectionCore, opts?: InspectionOptions): Promise<string>;
25
+ export {};
@@ -0,0 +1,627 @@
1
+ import { MACHINE_VERSION, XSTATE_VERSION, createCompletionMachine, replayRun, ReplayDivergence, ReplayTraceDivergence, readRunLog } from './machine/index.js';
2
+ import { errorMessage, isRecord } from './guards.js';
3
+ function isPositionedInspectionCore(core) {
4
+ return 'records' in core && typeof core.records === 'function';
5
+ }
6
+ async function inspectionLog(core) {
7
+ if (!isPositionedInspectionCore(core)) {
8
+ await core.ready();
9
+ return { log: core };
10
+ }
11
+ const envelope = core;
12
+ const counter = (name) => {
13
+ const value = envelope[name];
14
+ if (value === undefined) {
15
+ return undefined;
16
+ }
17
+ if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0) {
18
+ throw new TypeError(`Run export ${name} must be a non-negative integer`);
19
+ }
20
+ return value;
21
+ };
22
+ const exportPhysicalLength = counter('physicalLength');
23
+ const exportLogicalLength = counter('logicalLength');
24
+ const exportNextSeq = counter('nextSeq');
25
+ const values = [];
26
+ const positions = new Map();
27
+ let previousPosition;
28
+ for await (const entry of envelope.records()) {
29
+ if (entry.recordIndex !== values.length) {
30
+ throw new TypeError(`Run export recordIndex ${entry.recordIndex} is not contiguous`);
31
+ }
32
+ if (!Number.isSafeInteger(entry.stepSeq) ||
33
+ entry.stepSeq < 0 ||
34
+ !Number.isSafeInteger(entry.physicalLength) ||
35
+ entry.physicalLength < 0) {
36
+ throw new TypeError(`Run export has invalid physical position at recordIndex ${entry.recordIndex}`);
37
+ }
38
+ const currentPosition = { stepSeq: entry.stepSeq, physicalLength: entry.physicalLength };
39
+ if (exportPhysicalLength !== undefined && entry.physicalLength > exportPhysicalLength) {
40
+ throw new TypeError(`Run export recordIndex ${entry.recordIndex} physicalLength ${entry.physicalLength} exceeds exported prefix ${exportPhysicalLength}`);
41
+ }
42
+ if (previousPosition) {
43
+ if (entry.stepSeq < previousPosition.stepSeq) {
44
+ throw new TypeError(`Run export stepSeq decreases at recordIndex ${entry.recordIndex}`);
45
+ }
46
+ if (entry.physicalLength < previousPosition.physicalLength) {
47
+ throw new TypeError(`Run export physicalLength decreases at recordIndex ${entry.recordIndex}`);
48
+ }
49
+ if (entry.stepSeq === previousPosition.stepSeq &&
50
+ entry.physicalLength !== previousPosition.physicalLength) {
51
+ throw new TypeError(`Run export stepSeq ${entry.stepSeq} has inconsistent physicalLength boundaries`);
52
+ }
53
+ if (exportNextSeq !== undefined && entry.stepSeq > previousPosition.stepSeq + 1) {
54
+ throw new TypeError(`Run export omits a committed step before stepSeq ${entry.stepSeq}`);
55
+ }
56
+ }
57
+ else if (exportNextSeq !== undefined && entry.stepSeq !== 0) {
58
+ throw new TypeError('Run export stepSeq must start at 0 when nextSeq is declared');
59
+ }
60
+ values.push(entry.record);
61
+ positions.set(entry.recordIndex, currentPosition);
62
+ previousPosition = currentPosition;
63
+ }
64
+ if (exportLogicalLength !== undefined && values.length !== exportLogicalLength) {
65
+ throw new TypeError(`Run export logicalLength ${exportLogicalLength} does not match ${values.length} positioned records`);
66
+ }
67
+ if (exportNextSeq !== undefined) {
68
+ const actualNextSeq = previousPosition ? previousPosition.stepSeq + 1 : 0;
69
+ if (actualNextSeq !== exportNextSeq) {
70
+ throw new TypeError(`Run export nextSeq ${exportNextSeq} does not match last positioned step boundary ${actualNextSeq}`);
71
+ }
72
+ }
73
+ const log = {
74
+ get length() {
75
+ return values.length;
76
+ },
77
+ async ready() { },
78
+ async get(index) {
79
+ return values[index] ?? null;
80
+ },
81
+ async append(value) {
82
+ if (!isRunRecord(value)) {
83
+ throw new TypeError('Run export append must be a current run record');
84
+ }
85
+ values.push(value);
86
+ }
87
+ };
88
+ return { log, positions, exportPhysicalLength };
89
+ }
90
+ const MAX_JSON = 300;
91
+ function json(value, limit = MAX_JSON) {
92
+ const text = JSON.stringify(value) ?? 'undefined';
93
+ return text.length > limit ? `${text.slice(0, limit)}…` : text;
94
+ }
95
+ function stateValue(snapshot) {
96
+ return isRecord(snapshot) ? snapshot.value : undefined;
97
+ }
98
+ function contextValue(snapshot) {
99
+ return isRecord(snapshot) ? snapshot.context : undefined;
100
+ }
101
+ function isRunRecord(value) {
102
+ if (!isRecord(value) || value.version !== 5) {
103
+ return false;
104
+ }
105
+ return (value.type === 'metadata' ||
106
+ value.type === 'fork' ||
107
+ value.type === 'checkpoint' ||
108
+ value.type === 'delta' ||
109
+ value.type === 'operation');
110
+ }
111
+ function changedValues({ patch, before, after, path = '', out = [] }) {
112
+ if (!isRecord(patch))
113
+ return out;
114
+ if ('$' in patch) {
115
+ out.push(`${path || '$'}: ${json(before)} -> ${json(after)}`);
116
+ }
117
+ else if ('t' in patch && typeof patch.t === 'number') {
118
+ const beforeTail = Array.isArray(before) ? before.slice(patch.t) : [];
119
+ let afterTail;
120
+ if (Array.isArray(after)) {
121
+ afterTail = after.slice(patch.t);
122
+ }
123
+ else if (Array.isArray(patch.a)) {
124
+ afterTail = patch.a;
125
+ }
126
+ else {
127
+ afterTail = [];
128
+ }
129
+ out.push(`${path || '$'}[${patch.t}..]: ${json(beforeTail)} -> ${json(afterTail)}`);
130
+ }
131
+ else if ('o' in patch && isRecord(patch.o)) {
132
+ const beforeObject = isRecord(before) ? before : {};
133
+ const afterObject = isRecord(after) ? after : {};
134
+ for (const key of Array.isArray(patch.d) ? patch.d : []) {
135
+ if (typeof key !== 'string')
136
+ continue;
137
+ out.push(`${path ? `${path}.` : ''}${key}: ${json(beforeObject[key])} -> <deleted>`);
138
+ }
139
+ for (const [key, entry] of Object.entries(patch.o)) {
140
+ changedValues({
141
+ patch: entry,
142
+ before: beforeObject[key],
143
+ after: afterObject[key],
144
+ path: path ? `${path}.${key}` : key,
145
+ out
146
+ });
147
+ }
148
+ }
149
+ return out;
150
+ }
151
+ function traceLine(trace) {
152
+ const source = trace.sourceIds.length ? trace.sourceIds.join(', ') : '(start)';
153
+ const target = trace.targetIds.length ? trace.targetIds.join(', ') : '(self)';
154
+ const guards = trace.guardNames.length ? ` guard=${trace.guardNames.join(', ')}` : '';
155
+ const actions = trace.actionNames.length ? ` actions=${trace.actionNames.join(', ')}` : '';
156
+ const marker = trace.eventType === '' ? ' [eventless; not replay-verified]' : '';
157
+ return `microstep ${trace.eventType} ${source} -> ${target}${guards}${actions}${marker}`;
158
+ }
159
+ function operationLine(index, record) {
160
+ const receipt = record.receipt;
161
+ const detail = receipt.status === 'result' ? ` result=${json(receipt.result)}` : ` args=${json(receipt.args)}`;
162
+ return `recordIndex ${index} ${receipt.status} ${receipt.effect} ${receipt.name}${detail}`;
163
+ }
164
+ async function* readInspection(source, opts) {
165
+ validateIndex('recordLimit', opts.recordLimit);
166
+ validateIndex('contextRecord', opts.contextRecord);
167
+ validateIndex('physicalLength', opts.physicalLength);
168
+ validateIndex('contextPhysicalLength', opts.contextPhysicalLength);
169
+ if (opts.contextRecord !== undefined && opts.contextPhysicalLength !== undefined) {
170
+ throw new TypeError('Choose contextRecord or contextPhysicalLength, not both');
171
+ }
172
+ if (opts.contextPhysicalLength !== undefined &&
173
+ opts.physicalLength !== undefined &&
174
+ opts.contextPhysicalLength > opts.physicalLength) {
175
+ throw new RangeError(`contextPhysicalLength ${opts.contextPhysicalLength} is beyond physicalLength ${opts.physicalLength}`);
176
+ }
177
+ const { log: core, positions, exportPhysicalLength } = await inspectionLog(source);
178
+ if (opts.contextRecord !== undefined) {
179
+ if (opts.contextRecord >= core.length) {
180
+ throw new RangeError(`contextRecord ${opts.contextRecord} is outside logical export length ${core.length}`);
181
+ }
182
+ if (opts.recordLimit !== undefined && opts.contextRecord >= opts.recordLimit) {
183
+ throw new RangeError(`contextRecord ${opts.contextRecord} is excluded by recordLimit ${opts.recordLimit}`);
184
+ }
185
+ const position = positions?.get(opts.contextRecord);
186
+ if (opts.physicalLength !== undefined &&
187
+ position &&
188
+ position.physicalLength > opts.physicalLength) {
189
+ throw new RangeError(`contextRecord ${opts.contextRecord} is beyond physicalLength ${opts.physicalLength}`);
190
+ }
191
+ }
192
+ let previous;
193
+ let recordedMachine;
194
+ let recordedXstate;
195
+ let hasLegacyRecords = false;
196
+ let physicalContextRecord;
197
+ if (positions && exportPhysicalLength === undefined) {
198
+ yield {
199
+ line: 'export physicalLength envelope unavailable; physical positions are row metadata, not a validated export bound'
200
+ };
201
+ }
202
+ if (opts.contextPhysicalLength !== undefined) {
203
+ const selection = selectPhysicalContext(positions, opts.contextPhysicalLength, exportPhysicalLength);
204
+ physicalContextRecord = selection.recordIndex;
205
+ for (const line of selection.lines) {
206
+ yield { line };
207
+ }
208
+ }
209
+ const contextRecord = opts.contextPhysicalLength === undefined ? opts.contextRecord : physicalContextRecord;
210
+ if (opts.contextPhysicalLength !== undefined && physicalContextRecord !== undefined) {
211
+ if (opts.recordLimit !== undefined && physicalContextRecord >= opts.recordLimit) {
212
+ throw new RangeError(`physical context recordIndex ${physicalContextRecord} is excluded by recordLimit ${opts.recordLimit}`);
213
+ }
214
+ const position = positions?.get(physicalContextRecord);
215
+ if (opts.physicalLength !== undefined &&
216
+ position &&
217
+ position.physicalLength > opts.physicalLength) {
218
+ throw new RangeError(`physical context recordIndex ${physicalContextRecord} is beyond physicalLength ${opts.physicalLength}`);
219
+ }
220
+ }
221
+ if (opts.physicalLength !== undefined && !positions) {
222
+ yield {
223
+ line: `physicalLength selection unavailable: export has no physicalLength mapping for ${opts.physicalLength}`
224
+ };
225
+ }
226
+ else if (opts.physicalLength !== undefined &&
227
+ exportPhysicalLength !== undefined &&
228
+ opts.physicalLength > exportPhysicalLength) {
229
+ yield {
230
+ line: `physicalLength selection unavailable: requested ${opts.physicalLength} exceeds exported prefix ${exportPhysicalLength}; showing the complete export`
231
+ };
232
+ }
233
+ else if (opts.physicalLength !== undefined && exportPhysicalLength === undefined) {
234
+ yield {
235
+ line: `physicalLength ${opts.physicalLength} selection is not validated against an exported physicalLength envelope`
236
+ };
237
+ }
238
+ else if (opts.physicalLength !== undefined &&
239
+ opts.physicalLength !== exportPhysicalLength &&
240
+ ![...(positions?.values() ?? [])].some((position) => position.physicalLength === opts.physicalLength)) {
241
+ yield {
242
+ line: `physicalLength ${opts.physicalLength} is not a represented step boundary; rows show the latest committed steps at or before it, not a validated physical prefix`
243
+ };
244
+ }
245
+ for await (const item of readRunLog(core, { anyMachine: true, legacyInspection: true })) {
246
+ if (opts.recordLimit !== undefined && item.index >= opts.recordLimit)
247
+ break;
248
+ const itemPosition = positions?.get(item.index);
249
+ if (opts.physicalLength !== undefined &&
250
+ itemPosition &&
251
+ itemPosition.physicalLength > opts.physicalLength) {
252
+ break;
253
+ }
254
+ const { index, sourceVersion, record, snapshot, events } = item;
255
+ if (sourceVersion !== 5) {
256
+ hasLegacyRecords = true;
257
+ }
258
+ if (record.type === 'metadata') {
259
+ recordedMachine = record.machine;
260
+ recordedXstate = record.xstate;
261
+ yield {
262
+ line: `recordIndex ${index} run ${record.runId} log v${sourceVersion}${sourceVersion === 4 ? ' (read-only)' : ''} machine v${record.machine} xstate ${record.xstate ?? '?'}`,
263
+ definition: record.definition
264
+ };
265
+ if (sourceVersion === 4) {
266
+ yield {
267
+ line: `recordIndex ${index} v4 records are normalized only for read-only inspection; resume and replay use strict current-version checks`
268
+ };
269
+ }
270
+ const position = positions?.get(index);
271
+ if (position) {
272
+ yield {
273
+ line: `recordIndex ${index} stepSeq ${position.stepSeq} physicalLength ${position.physicalLength}`
274
+ };
275
+ }
276
+ if (MACHINE_VERSION !== record.machine) {
277
+ yield {
278
+ line: `recordIndex ${index} machine drift: local v${MACHINE_VERSION}; recorded v${record.machine}; recorded definition and snapshots remain authoritative`
279
+ };
280
+ }
281
+ if (XSTATE_VERSION !== record.xstate) {
282
+ yield {
283
+ line: `recordIndex ${index} XState drift: local ${XSTATE_VERSION}; recorded ${record.xstate ?? '?'}; recorded definition and snapshots remain authoritative`
284
+ };
285
+ }
286
+ if (opts.expectedMachineVersion !== undefined &&
287
+ opts.expectedMachineVersion !== MACHINE_VERSION) {
288
+ yield {
289
+ line: `recordIndex ${index} caller expected machine v${opts.expectedMachineVersion}; this inspector runs v${MACHINE_VERSION}`
290
+ };
291
+ }
292
+ if (opts.expectedXstateVersion !== undefined &&
293
+ opts.expectedXstateVersion !== XSTATE_VERSION) {
294
+ yield {
295
+ line: `recordIndex ${index} caller expected XState ${opts.expectedXstateVersion}; this inspector runs ${XSTATE_VERSION}`
296
+ };
297
+ }
298
+ if (contextRecord === index) {
299
+ yield { line: `recordIndex ${index} context undefined (no checkpoint yet)` };
300
+ }
301
+ continue;
302
+ }
303
+ const position = positions?.get(index);
304
+ if (position) {
305
+ yield {
306
+ line: `recordIndex ${index} stepSeq ${position.stepSeq} physicalLength ${position.physicalLength}`
307
+ };
308
+ }
309
+ if (record.type === 'operation') {
310
+ yield { line: operationLine(index, record) };
311
+ if (contextRecord === index) {
312
+ const context = contextValue(snapshot);
313
+ yield { line: `recordIndex ${index} context ${JSON.stringify(context) ?? 'undefined'}` };
314
+ }
315
+ continue;
316
+ }
317
+ if (record.type === 'fork') {
318
+ yield {
319
+ line: `recordIndex ${index} fork ${record.runId} of ${record.forkedFrom.runId} at recordIndex ${record.forkedFrom.length}`
320
+ };
321
+ if (contextRecord === index) {
322
+ const context = contextValue(snapshot);
323
+ yield { line: `recordIndex ${index} context ${JSON.stringify(context) ?? 'undefined'}` };
324
+ }
325
+ previous = snapshot;
326
+ continue;
327
+ }
328
+ const before = stateValue(previous);
329
+ const after = stateValue(snapshot);
330
+ yield {
331
+ line: `recordIndex ${index} ${record.type} state ${json(before)} -> ${json(after)}`
332
+ };
333
+ for (const trace of record.trace ?? []) {
334
+ yield { line: `recordIndex ${index} ${traceLine(trace)}` };
335
+ }
336
+ if (!record.trace?.length && events.length) {
337
+ yield {
338
+ line: sourceVersion === 4
339
+ ? `recordIndex ${index} legacy v4 has no recorded microstep guard/action trace; decoded events are shown`
340
+ : `recordIndex ${index} transition trace unavailable; decoded events are shown`
341
+ };
342
+ }
343
+ for (const event of events) {
344
+ yield { line: `recordIndex ${index} event ${json(event)}` };
345
+ }
346
+ if (record.type === 'delta' && record.patch) {
347
+ const paths = changedValues({ patch: record.patch, before: previous, after: snapshot });
348
+ if (paths.length) {
349
+ yield { line: `recordIndex ${index} changed ${paths.join('; ')}` };
350
+ }
351
+ }
352
+ if (contextRecord === index) {
353
+ const context = contextValue(snapshot);
354
+ yield { line: `recordIndex ${index} context ${JSON.stringify(context) ?? 'undefined'}` };
355
+ }
356
+ previous = snapshot;
357
+ }
358
+ if (opts.recordLimit !== undefined || opts.physicalLength !== undefined) {
359
+ yield {
360
+ line: 'replay verification skipped: a recordIndex or physicalLength limit selected a prefix; recorded snapshots remain authoritative'
361
+ };
362
+ }
363
+ else if (recordedMachine !== undefined && recordedXstate !== undefined) {
364
+ if (hasLegacyRecords ||
365
+ recordedMachine !== MACHINE_VERSION ||
366
+ recordedXstate !== XSTATE_VERSION) {
367
+ yield {
368
+ line: 'replay verification skipped: recorded log, machine, or XState version differs from this implementation; stored snapshots and recorded transition traces remain authoritative'
369
+ };
370
+ }
371
+ else {
372
+ yield { line: await replayVerificationLine(core) };
373
+ }
374
+ }
375
+ else {
376
+ yield {
377
+ line: 'state/context replay unavailable: run metadata does not record both machine and XState versions'
378
+ };
379
+ }
380
+ }
381
+ function selectPhysicalContext(positions, requestedLength, exportPhysicalLength) {
382
+ if (!positions) {
383
+ return {
384
+ lines: [
385
+ `physical context unavailable: export has no physicalLength mapping for ${requestedLength}`
386
+ ]
387
+ };
388
+ }
389
+ if (exportPhysicalLength !== undefined && requestedLength > exportPhysicalLength) {
390
+ return {
391
+ lines: [
392
+ `physical context unavailable: requested physicalLength ${requestedLength} exceeds exported prefix ${exportPhysicalLength}`
393
+ ]
394
+ };
395
+ }
396
+ const isExportBoundary = exportPhysicalLength === requestedLength;
397
+ const exactStepBoundary = [...positions.values()].some((position) => position.physicalLength === requestedLength);
398
+ if (!exactStepBoundary && !isExportBoundary) {
399
+ const message = exportPhysicalLength === undefined
400
+ ? `physical context unavailable: ${requestedLength} is not a represented step boundary and this export has no trusted physicalLength envelope`
401
+ : `physical context unavailable: ${requestedLength} is neither a represented step boundary nor the exported prefix ${exportPhysicalLength}`;
402
+ return { lines: [message] };
403
+ }
404
+ let recordIndex;
405
+ for (const [index, position] of positions) {
406
+ if (position.physicalLength > requestedLength)
407
+ continue;
408
+ if (recordIndex !== undefined && index <= recordIndex)
409
+ continue;
410
+ recordIndex = index;
411
+ }
412
+ if (recordIndex === undefined) {
413
+ return { lines: [`no committed record at or before physicalLength ${requestedLength}`] };
414
+ }
415
+ const position = positions.get(recordIndex);
416
+ if (!position) {
417
+ throw new Error(`Missing physical position for recordIndex ${recordIndex}`);
418
+ }
419
+ const lines = [
420
+ `physicalLength ${requestedLength} selects context after recordIndex ${recordIndex} stepSeq ${position.stepSeq} at physicalLength ${position.physicalLength}`
421
+ ];
422
+ if (isExportBoundary && position.physicalLength < requestedLength) {
423
+ lines.push(`exported prefix ends at physicalLength ${requestedLength}; latest committed step ends at ${position.physicalLength}`);
424
+ }
425
+ return { recordIndex, lines };
426
+ }
427
+ async function replayVerificationLine(core) {
428
+ try {
429
+ let checked = 0;
430
+ for await (const _step of replayRun(createCompletionMachine(), core)) {
431
+ checked++;
432
+ }
433
+ return `state/context replay and event-triggered guard/action traces matched for ${checked} recorded event${checked === 1 ? '' : 's'}; eventless guard/action traces are not replay-verified; stored snapshots remain authoritative`;
434
+ }
435
+ catch (error) {
436
+ if (error instanceof ReplayTraceDivergence) {
437
+ return `TRANSITION TRACE REPLAY DIVERGENCE at recordIndex ${error.index}: recorded ${JSON.stringify(error.expected)}; replayed ${JSON.stringify(error.actual)}; stored snapshots remain authoritative`;
438
+ }
439
+ if (error instanceof ReplayDivergence) {
440
+ return `STATE/CONTEXT REPLAY DIVERGENCE at recordIndex ${error.index}: ${error.message}; recorded snapshots remain authoritative`;
441
+ }
442
+ return `state/context replay unavailable: ${errorMessage(error)}; recorded snapshots remain authoritative`;
443
+ }
444
+ }
445
+ function validateIndex(name, value) {
446
+ if (value !== undefined && (!Number.isSafeInteger(value) || value < 0)) {
447
+ throw new TypeError(`${name} must be a non-negative integer`);
448
+ }
449
+ }
450
+ export async function* inspectRun(core, opts = {}) {
451
+ for await (const { line } of readInspection(core, opts)) {
452
+ yield line;
453
+ }
454
+ }
455
+ function escapeHtml(value) {
456
+ return value
457
+ .replace(/&/g, '&amp;')
458
+ .replace(/</g, '&lt;')
459
+ .replace(/>/g, '&gt;')
460
+ .replace(/"/g, '&quot;')
461
+ .replace(/'/g, '&#39;');
462
+ }
463
+ const MAX_GRAPH_NODES = 300;
464
+ const MAX_GRAPH_DEPTH = 32;
465
+ const GRAPH_LABEL_CHARS = 120;
466
+ function graphText(value) {
467
+ const text = typeof value === 'string' ? value : String(value ?? '?');
468
+ return text.length > GRAPH_LABEL_CHARS ? `${text.slice(0, GRAPH_LABEL_CHARS)}…` : text;
469
+ }
470
+ function transitionParts(event, transition) {
471
+ const value = isRecord(transition) ? transition : {};
472
+ const targets = Array.isArray(value.target) ? value.target.map(graphText) : [];
473
+ const guard = value.guard === undefined ? '' : graphText(value.guard);
474
+ const actions = Array.isArray(value.actions) ? value.actions.map(graphText) : [];
475
+ return { event: graphText(event), targets, guard, actions };
476
+ }
477
+ function stateDefinition(value) {
478
+ return isRecord(value) ? value : undefined;
479
+ }
480
+ function renderTransitionPaths(node, context) {
481
+ const paths = [];
482
+ for (const item of node.events) {
483
+ const transition = transitionParts(item.event, item.transition);
484
+ for (const targetId of transition.targets) {
485
+ const targetIndex = context.byStateId.get(targetId);
486
+ if (targetIndex === undefined) {
487
+ continue;
488
+ }
489
+ const target = context.nodes[targetIndex];
490
+ if (!target) {
491
+ continue;
492
+ }
493
+ const sx = context.x(node) + context.nodeWidth;
494
+ const sy = context.y(node) + context.nodeHeight / 2;
495
+ const tx = context.x(target);
496
+ const ty = context.y(target) + context.nodeHeight / 2;
497
+ const bend = Math.max(24, Math.abs(tx - sx) / 2);
498
+ const label = `${transition.event}${transition.guard ? ` [${transition.guard}]` : ''}${transition.actions.length ? ` / ${transition.actions.join(', ')}` : ''}`;
499
+ paths.push(`<path class="transition" marker-end="url(#arrow)" d="M ${sx} ${sy} C ${sx + bend} ${sy}, ${tx - bend} ${ty}, ${tx} ${ty}"/>`);
500
+ paths.push(`<text class="edge-label" x="${Math.round((sx + tx) / 2)}" y="${Math.round((sy + ty) / 2) - 4}">${escapeHtml(label)}</text>`);
501
+ }
502
+ }
503
+ return paths;
504
+ }
505
+ function renderDefinition(definition) {
506
+ const root = stateDefinition(definition);
507
+ if (!root) {
508
+ return '<p>No machine definition was recorded.</p>';
509
+ }
510
+ const nodes = [];
511
+ const work = [
512
+ { node: root, fallbackId: 'root', depth: 0 }
513
+ ];
514
+ while (work.length && nodes.length < MAX_GRAPH_NODES) {
515
+ const entry = work.pop();
516
+ if (!entry) {
517
+ continue;
518
+ }
519
+ const index = nodes.length;
520
+ const id = typeof entry.node.id === 'string' ? graphText(entry.node.id) : graphText(entry.fallbackId);
521
+ const events = [];
522
+ const transitions = isRecord(entry.node.on) ? entry.node.on : {};
523
+ for (const [event, listed] of Object.entries(transitions)) {
524
+ const choices = Array.isArray(listed) ? listed : [listed];
525
+ for (const transition of choices) {
526
+ events.push({ event, transition });
527
+ }
528
+ }
529
+ for (const transition of Array.isArray(entry.node.always) ? entry.node.always : []) {
530
+ events.push({ event: 'always', transition });
531
+ }
532
+ const invokes = Array.isArray(entry.node.invoke) ? entry.node.invoke : [];
533
+ nodes.push({
534
+ index,
535
+ id,
536
+ depth: entry.depth,
537
+ parent: entry.parent,
538
+ events,
539
+ invokes: invokes.map((invoke) => graphText(isRecord(invoke) ? invoke.id : undefined))
540
+ });
541
+ if (entry.depth >= MAX_GRAPH_DEPTH) {
542
+ continue;
543
+ }
544
+ const children = Object.entries(isRecord(entry.node.states) ? entry.node.states : {});
545
+ for (let i = children.length - 1; i >= 0; i--) {
546
+ const childEntry = children[i];
547
+ if (!childEntry) {
548
+ continue;
549
+ }
550
+ const [key, child] = childEntry;
551
+ const childDefinition = stateDefinition(child);
552
+ if (childDefinition) {
553
+ work.push({ node: childDefinition, fallbackId: key, depth: entry.depth + 1, parent: index });
554
+ }
555
+ }
556
+ }
557
+ const byStateId = new Map(nodes.map((node) => [node.id, node.index]));
558
+ const depthWidth = 210;
559
+ const rowHeight = 76;
560
+ const nodeWidth = 174;
561
+ const nodeHeight = 40;
562
+ const left = 28;
563
+ const top = 28;
564
+ const width = Math.max(260, left * 2 + depthWidth * Math.max(0, ...nodes.map((node) => node.depth)) + nodeWidth);
565
+ const height = Math.max(120, top * 2 + rowHeight * nodes.length);
566
+ const x = (node) => left + depthWidth * node.depth;
567
+ const y = (node) => top + rowHeight * node.index;
568
+ const parts = [
569
+ `<svg class="machine-graph" role="img" aria-label="Recorded state machine graph" viewBox="0 0 ${width} ${height}" width="100%" height="${height}">`,
570
+ '<defs><marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#526071"/></marker></defs>'
571
+ ];
572
+ for (const node of nodes) {
573
+ if (node.parent === undefined)
574
+ continue;
575
+ const parent = nodes[node.parent];
576
+ if (!parent) {
577
+ continue;
578
+ }
579
+ const px = x(parent) + nodeWidth / 2;
580
+ const py = y(parent) + nodeHeight;
581
+ const cx = x(node) + nodeWidth / 2;
582
+ const cy = y(node);
583
+ parts.push(`<path class="hierarchy" d="M ${px} ${py} L ${cx} ${cy}"/>`);
584
+ }
585
+ const geometry = { nodes, byStateId, x, y, nodeWidth, nodeHeight };
586
+ for (const node of nodes) {
587
+ parts.push(...renderTransitionPaths(node, geometry));
588
+ }
589
+ for (const node of nodes) {
590
+ const nx = x(node);
591
+ const ny = y(node);
592
+ parts.push(`<g class="state"><rect x="${nx}" y="${ny}" width="${nodeWidth}" height="${nodeHeight}" rx="6"/><text x="${nx + 9}" y="${ny + 25}">${escapeHtml(node.id)}</text></g>`);
593
+ for (const invoke of node.invokes) {
594
+ parts.push(`<text class="invoke" x="${nx + 4}" y="${ny + nodeHeight + 17}">invoke ${escapeHtml(invoke)}</text>`);
595
+ }
596
+ for (const item of node.events) {
597
+ const transition = transitionParts(item.event, item.transition);
598
+ const unresolved = transition.targets.filter((target) => !byStateId.has(target));
599
+ if (unresolved.length || !transition.targets.length) {
600
+ const summary = `${transition.event} → ${unresolved.join(', ') || '(self)'}${transition.guard ? ` [${transition.guard}]` : ''}${transition.actions.length ? ` / ${transition.actions.join(', ')}` : ''}`;
601
+ parts.push(`<text class="unresolved" x="${nx}" y="${ny + nodeHeight + 17}">${escapeHtml(summary)}</text>`);
602
+ }
603
+ }
604
+ }
605
+ parts.push('</svg>');
606
+ if (work.length) {
607
+ parts.push('<p>Graph truncated to a bounded set of recorded states.</p>');
608
+ }
609
+ return parts.join('');
610
+ }
611
+ export async function renderRunLogHtml(core, opts = {}) {
612
+ let definition;
613
+ const lines = [];
614
+ for await (const item of readInspection(core, opts)) {
615
+ lines.push(item.line);
616
+ if (item.definition !== undefined) {
617
+ definition = item.definition;
618
+ }
619
+ }
620
+ return ('<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width">' +
621
+ '<title>Run log inspection</title><style>body{font:14px system-ui;margin:2rem;line-height:1.5}' +
622
+ 'pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f4f4f4;padding:1rem}' +
623
+ 'svg{max-height:75vh;background:#fafbfc;border:1px solid #d5dae0}svg .hierarchy{stroke:#a8b0bc;stroke-width:1.4}svg .transition{fill:none;stroke:#526071;stroke-width:1.5}svg .state rect{fill:#fff;stroke:#435168;stroke-width:1.5}svg text{font:12px system-ui;fill:#17212e}svg .edge-label{font-size:10px;fill:#39485c}svg .invoke,svg .unresolved{font-size:10px;fill:#536176}' +
624
+ '</style></head><body><h1>Recorded machine definition</h1>' +
625
+ renderDefinition(definition) +
626
+ `<h1>Run records</h1><pre>${escapeHtml(lines.join('\n'))}</pre></body></html>`);
627
+ }
@@ -0,0 +1,2 @@
1
+ export { RUN_LOG_VERSION, RUN_LOG_PROTOCOL_VERSION, applyEngineStep, buildEngineBoot, createEngineBoot, contextFromBoot, InvalidEngineStep, requestFromBoot, validateEngineBoot } from './run-log/protocol.ts';
2
+ export type { EngineBoot, EngineStep, ForkOrigin, ForkSegment, HostRunLog, HostRunLogLease, MachineTransitionTrace, HistoryReference, Operation, Patch, Receipt, RecoveryResolution, RunBudget, RunRecord } from './run-log/protocol.ts';
@@ -0,0 +1 @@
1
+ export { RUN_LOG_VERSION, RUN_LOG_PROTOCOL_VERSION, applyEngineStep, buildEngineBoot, createEngineBoot, contextFromBoot, InvalidEngineStep, requestFromBoot, validateEngineBoot } from './run-log/protocol.js';