@loomwork/ui-lineage 0.0.0-stage → 0.1.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 (88) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +471 -2
  4. package/dist/conformance.d.ts +4 -0
  5. package/dist/conformance.d.ts.map +1 -0
  6. package/dist/conformance.js +143 -0
  7. package/dist/conformance.js.map +1 -0
  8. package/dist/derive.d.ts +15 -0
  9. package/dist/derive.d.ts.map +1 -0
  10. package/dist/derive.js +35 -0
  11. package/dist/derive.js.map +1 -0
  12. package/dist/esm/conformance.js +140 -0
  13. package/dist/esm/conformance.js.map +1 -0
  14. package/dist/esm/derive.js +29 -0
  15. package/dist/esm/derive.js.map +1 -0
  16. package/dist/esm/events.js +101 -0
  17. package/dist/esm/events.js.map +1 -0
  18. package/dist/esm/index.js +12 -0
  19. package/dist/esm/index.js.map +1 -0
  20. package/dist/esm/lineage.js +1376 -0
  21. package/dist/esm/lineage.js.map +1 -0
  22. package/dist/esm/retention.js +73 -0
  23. package/dist/esm/retention.js.map +1 -0
  24. package/dist/esm/rootsFor.js +49 -0
  25. package/dist/esm/rootsFor.js.map +1 -0
  26. package/dist/esm/seen.js +733 -0
  27. package/dist/esm/seen.js.map +1 -0
  28. package/dist/esm/seenCrypto.js +197 -0
  29. package/dist/esm/seenCrypto.js.map +1 -0
  30. package/dist/esm/seenGc.js +122 -0
  31. package/dist/esm/seenGc.js.map +1 -0
  32. package/dist/esm/state.js +185 -0
  33. package/dist/esm/state.js.map +1 -0
  34. package/dist/esm/store.js +172 -0
  35. package/dist/esm/store.js.map +1 -0
  36. package/dist/events.d.ts +781 -0
  37. package/dist/events.d.ts.map +1 -0
  38. package/dist/events.js +106 -0
  39. package/dist/events.js.map +1 -0
  40. package/dist/index.d.ts +23 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +60 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/lineage.d.ts +394 -0
  45. package/dist/lineage.d.ts.map +1 -0
  46. package/dist/lineage.js +1383 -0
  47. package/dist/lineage.js.map +1 -0
  48. package/dist/retention.d.ts +45 -0
  49. package/dist/retention.d.ts.map +1 -0
  50. package/dist/retention.js +78 -0
  51. package/dist/retention.js.map +1 -0
  52. package/dist/rootsFor.d.ts +33 -0
  53. package/dist/rootsFor.d.ts.map +1 -0
  54. package/dist/rootsFor.js +52 -0
  55. package/dist/rootsFor.js.map +1 -0
  56. package/dist/seen.d.ts +375 -0
  57. package/dist/seen.d.ts.map +1 -0
  58. package/dist/seen.js +739 -0
  59. package/dist/seen.js.map +1 -0
  60. package/dist/seenCrypto.d.ts +72 -0
  61. package/dist/seenCrypto.d.ts.map +1 -0
  62. package/dist/seenCrypto.js +210 -0
  63. package/dist/seenCrypto.js.map +1 -0
  64. package/dist/seenGc.d.ts +73 -0
  65. package/dist/seenGc.d.ts.map +1 -0
  66. package/dist/seenGc.js +126 -0
  67. package/dist/seenGc.js.map +1 -0
  68. package/dist/state.d.ts +66 -0
  69. package/dist/state.d.ts.map +1 -0
  70. package/dist/state.js +190 -0
  71. package/dist/state.js.map +1 -0
  72. package/dist/store.d.ts +93 -0
  73. package/dist/store.d.ts.map +1 -0
  74. package/dist/store.js +177 -0
  75. package/dist/store.js.map +1 -0
  76. package/package.json +60 -3
  77. package/src/conformance.ts +148 -0
  78. package/src/derive.ts +57 -0
  79. package/src/events.ts +125 -0
  80. package/src/index.ts +79 -0
  81. package/src/lineage.ts +1655 -0
  82. package/src/retention.ts +118 -0
  83. package/src/rootsFor.ts +75 -0
  84. package/src/seen.ts +965 -0
  85. package/src/seenCrypto.ts +271 -0
  86. package/src/seenGc.ts +233 -0
  87. package/src/state.ts +268 -0
  88. package/src/store.ts +274 -0
@@ -0,0 +1,781 @@
1
+ import { Operation } from "@loomwork/ui-core";
2
+ import { z } from "zod";
3
+ export declare const EXPERIENCE_COMPOSED = "EXPERIENCE_COMPOSED";
4
+ export declare const EXPERIENCE_REVERTED = "EXPERIENCE_REVERTED";
5
+ export declare const EXPERIENCE_BRANCHED = "EXPERIENCE_BRANCHED";
6
+ export declare const EXPERIENCE_PROMOTED = "EXPERIENCE_PROMOTED";
7
+ export type LineageEventType = typeof EXPERIENCE_COMPOSED | typeof EXPERIENCE_REVERTED | typeof EXPERIENCE_BRANCHED | typeof EXPERIENCE_PROMOTED;
8
+ export declare const ComposedPayload: z.ZodObject<{
9
+ ops: z.ZodArray<z.ZodObject<{
10
+ op: z.ZodType<Operation, z.ZodTypeDef, Operation>;
11
+ baseVersion: z.ZodOptional<z.ZodString>;
12
+ by: z.ZodObject<{
13
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
14
+ agentId: z.ZodOptional<z.ZodString>;
15
+ modelId: z.ZodOptional<z.ZodString>;
16
+ ref: z.ZodOptional<z.ZodString>;
17
+ decisionId: z.ZodOptional<z.ZodString>;
18
+ policyDecisionId: z.ZodOptional<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ source: "user" | "system" | "agent" | "application";
21
+ ref?: string | undefined;
22
+ agentId?: string | undefined;
23
+ modelId?: string | undefined;
24
+ decisionId?: string | undefined;
25
+ policyDecisionId?: string | undefined;
26
+ }, {
27
+ source: "user" | "system" | "agent" | "application";
28
+ ref?: string | undefined;
29
+ agentId?: string | undefined;
30
+ modelId?: string | undefined;
31
+ decisionId?: string | undefined;
32
+ policyDecisionId?: string | undefined;
33
+ }>;
34
+ at: z.ZodString;
35
+ }, "strip", z.ZodTypeAny, {
36
+ at: string;
37
+ op: Operation;
38
+ by: {
39
+ source: "user" | "system" | "agent" | "application";
40
+ ref?: string | undefined;
41
+ agentId?: string | undefined;
42
+ modelId?: string | undefined;
43
+ decisionId?: string | undefined;
44
+ policyDecisionId?: string | undefined;
45
+ };
46
+ baseVersion?: string | undefined;
47
+ }, {
48
+ at: string;
49
+ op: Operation;
50
+ by: {
51
+ source: "user" | "system" | "agent" | "application";
52
+ ref?: string | undefined;
53
+ agentId?: string | undefined;
54
+ modelId?: string | undefined;
55
+ decisionId?: string | undefined;
56
+ policyDecisionId?: string | undefined;
57
+ };
58
+ baseVersion?: string | undefined;
59
+ }>, "many">;
60
+ /**
61
+ * What the author said about the change (U7): UNTRUSTED text (a planner's model text), bounded
62
+ * and stripped by `boundSummary` on the way in AND on the way out of the fold, since the log is
63
+ * untrusted input. Optional, so every version written before it replays unchanged; it is not in
64
+ * the content address (nothing here is).
65
+ */
66
+ summary: z.ZodOptional<z.ZodString>;
67
+ /**
68
+ * The strictest class of everything the author READ to write `summary` (the experience, tool
69
+ * samples, caller context), stamped by the host at compose. A summary is judged against it (and
70
+ * against the version's own class floor) before a viewer is shown it. Recorded on the event, not
71
+ * in the content address. Absent = unknown, and the floor alone gates the summary.
72
+ */
73
+ summaryClass: z.ZodOptional<z.ZodEnum<["secret", "sensitive", "internal"]>>;
74
+ experienceId: z.ZodString;
75
+ versionHash: z.ZodString;
76
+ ref: z.ZodObject<{
77
+ __loomContent: z.ZodString;
78
+ }, "strip", z.ZodTypeAny, {
79
+ __loomContent: string;
80
+ }, {
81
+ __loomContent: string;
82
+ }>;
83
+ parents: z.ZodArray<z.ZodString, "many">;
84
+ by: z.ZodObject<{
85
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
86
+ agentId: z.ZodOptional<z.ZodString>;
87
+ modelId: z.ZodOptional<z.ZodString>;
88
+ ref: z.ZodOptional<z.ZodString>;
89
+ decisionId: z.ZodOptional<z.ZodString>;
90
+ policyDecisionId: z.ZodOptional<z.ZodString>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ source: "user" | "system" | "agent" | "application";
93
+ ref?: string | undefined;
94
+ agentId?: string | undefined;
95
+ modelId?: string | undefined;
96
+ decisionId?: string | undefined;
97
+ policyDecisionId?: string | undefined;
98
+ }, {
99
+ source: "user" | "system" | "agent" | "application";
100
+ ref?: string | undefined;
101
+ agentId?: string | undefined;
102
+ modelId?: string | undefined;
103
+ decisionId?: string | undefined;
104
+ policyDecisionId?: string | undefined;
105
+ }>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ by: {
108
+ source: "user" | "system" | "agent" | "application";
109
+ ref?: string | undefined;
110
+ agentId?: string | undefined;
111
+ modelId?: string | undefined;
112
+ decisionId?: string | undefined;
113
+ policyDecisionId?: string | undefined;
114
+ };
115
+ ops: {
116
+ at: string;
117
+ op: Operation;
118
+ by: {
119
+ source: "user" | "system" | "agent" | "application";
120
+ ref?: string | undefined;
121
+ agentId?: string | undefined;
122
+ modelId?: string | undefined;
123
+ decisionId?: string | undefined;
124
+ policyDecisionId?: string | undefined;
125
+ };
126
+ baseVersion?: string | undefined;
127
+ }[];
128
+ experienceId: string;
129
+ versionHash: string;
130
+ ref: {
131
+ __loomContent: string;
132
+ };
133
+ parents: string[];
134
+ summary?: string | undefined;
135
+ summaryClass?: "secret" | "sensitive" | "internal" | undefined;
136
+ }, {
137
+ by: {
138
+ source: "user" | "system" | "agent" | "application";
139
+ ref?: string | undefined;
140
+ agentId?: string | undefined;
141
+ modelId?: string | undefined;
142
+ decisionId?: string | undefined;
143
+ policyDecisionId?: string | undefined;
144
+ };
145
+ ops: {
146
+ at: string;
147
+ op: Operation;
148
+ by: {
149
+ source: "user" | "system" | "agent" | "application";
150
+ ref?: string | undefined;
151
+ agentId?: string | undefined;
152
+ modelId?: string | undefined;
153
+ decisionId?: string | undefined;
154
+ policyDecisionId?: string | undefined;
155
+ };
156
+ baseVersion?: string | undefined;
157
+ }[];
158
+ experienceId: string;
159
+ versionHash: string;
160
+ ref: {
161
+ __loomContent: string;
162
+ };
163
+ parents: string[];
164
+ summary?: string | undefined;
165
+ summaryClass?: "secret" | "sensitive" | "internal" | undefined;
166
+ }>;
167
+ export declare const RevertedPayload: z.ZodObject<{
168
+ revertedTo: z.ZodString;
169
+ experienceId: z.ZodString;
170
+ versionHash: z.ZodString;
171
+ ref: z.ZodObject<{
172
+ __loomContent: z.ZodString;
173
+ }, "strip", z.ZodTypeAny, {
174
+ __loomContent: string;
175
+ }, {
176
+ __loomContent: string;
177
+ }>;
178
+ parents: z.ZodArray<z.ZodString, "many">;
179
+ by: z.ZodObject<{
180
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
181
+ agentId: z.ZodOptional<z.ZodString>;
182
+ modelId: z.ZodOptional<z.ZodString>;
183
+ ref: z.ZodOptional<z.ZodString>;
184
+ decisionId: z.ZodOptional<z.ZodString>;
185
+ policyDecisionId: z.ZodOptional<z.ZodString>;
186
+ }, "strip", z.ZodTypeAny, {
187
+ source: "user" | "system" | "agent" | "application";
188
+ ref?: string | undefined;
189
+ agentId?: string | undefined;
190
+ modelId?: string | undefined;
191
+ decisionId?: string | undefined;
192
+ policyDecisionId?: string | undefined;
193
+ }, {
194
+ source: "user" | "system" | "agent" | "application";
195
+ ref?: string | undefined;
196
+ agentId?: string | undefined;
197
+ modelId?: string | undefined;
198
+ decisionId?: string | undefined;
199
+ policyDecisionId?: string | undefined;
200
+ }>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ by: {
203
+ source: "user" | "system" | "agent" | "application";
204
+ ref?: string | undefined;
205
+ agentId?: string | undefined;
206
+ modelId?: string | undefined;
207
+ decisionId?: string | undefined;
208
+ policyDecisionId?: string | undefined;
209
+ };
210
+ experienceId: string;
211
+ versionHash: string;
212
+ ref: {
213
+ __loomContent: string;
214
+ };
215
+ parents: string[];
216
+ revertedTo: string;
217
+ }, {
218
+ by: {
219
+ source: "user" | "system" | "agent" | "application";
220
+ ref?: string | undefined;
221
+ agentId?: string | undefined;
222
+ modelId?: string | undefined;
223
+ decisionId?: string | undefined;
224
+ policyDecisionId?: string | undefined;
225
+ };
226
+ experienceId: string;
227
+ versionHash: string;
228
+ ref: {
229
+ __loomContent: string;
230
+ };
231
+ parents: string[];
232
+ revertedTo: string;
233
+ }>;
234
+ export declare const BranchedPayload: z.ZodObject<{
235
+ from: z.ZodObject<{
236
+ experienceId: z.ZodString;
237
+ versionHash: z.ZodString;
238
+ }, "strip", z.ZodTypeAny, {
239
+ experienceId: string;
240
+ versionHash: string;
241
+ }, {
242
+ experienceId: string;
243
+ versionHash: string;
244
+ }>;
245
+ /** The version of the SOURCE line whose sticky classes were carried in (its head at the fork). */
246
+ carriedFrom: z.ZodString;
247
+ experienceId: z.ZodString;
248
+ versionHash: z.ZodString;
249
+ ref: z.ZodObject<{
250
+ __loomContent: z.ZodString;
251
+ }, "strip", z.ZodTypeAny, {
252
+ __loomContent: string;
253
+ }, {
254
+ __loomContent: string;
255
+ }>;
256
+ parents: z.ZodArray<z.ZodString, "many">;
257
+ by: z.ZodObject<{
258
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
259
+ agentId: z.ZodOptional<z.ZodString>;
260
+ modelId: z.ZodOptional<z.ZodString>;
261
+ ref: z.ZodOptional<z.ZodString>;
262
+ decisionId: z.ZodOptional<z.ZodString>;
263
+ policyDecisionId: z.ZodOptional<z.ZodString>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ source: "user" | "system" | "agent" | "application";
266
+ ref?: string | undefined;
267
+ agentId?: string | undefined;
268
+ modelId?: string | undefined;
269
+ decisionId?: string | undefined;
270
+ policyDecisionId?: string | undefined;
271
+ }, {
272
+ source: "user" | "system" | "agent" | "application";
273
+ ref?: string | undefined;
274
+ agentId?: string | undefined;
275
+ modelId?: string | undefined;
276
+ decisionId?: string | undefined;
277
+ policyDecisionId?: string | undefined;
278
+ }>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ by: {
281
+ source: "user" | "system" | "agent" | "application";
282
+ ref?: string | undefined;
283
+ agentId?: string | undefined;
284
+ modelId?: string | undefined;
285
+ decisionId?: string | undefined;
286
+ policyDecisionId?: string | undefined;
287
+ };
288
+ experienceId: string;
289
+ versionHash: string;
290
+ ref: {
291
+ __loomContent: string;
292
+ };
293
+ parents: string[];
294
+ from: {
295
+ experienceId: string;
296
+ versionHash: string;
297
+ };
298
+ carriedFrom: string;
299
+ }, {
300
+ by: {
301
+ source: "user" | "system" | "agent" | "application";
302
+ ref?: string | undefined;
303
+ agentId?: string | undefined;
304
+ modelId?: string | undefined;
305
+ decisionId?: string | undefined;
306
+ policyDecisionId?: string | undefined;
307
+ };
308
+ experienceId: string;
309
+ versionHash: string;
310
+ ref: {
311
+ __loomContent: string;
312
+ };
313
+ parents: string[];
314
+ from: {
315
+ experienceId: string;
316
+ versionHash: string;
317
+ };
318
+ carriedFrom: string;
319
+ }>;
320
+ export declare const PromotedPayload: z.ZodObject<{
321
+ ref: z.ZodObject<{
322
+ __loomContent: z.ZodString;
323
+ }, "strip", z.ZodTypeAny, {
324
+ __loomContent: string;
325
+ }, {
326
+ __loomContent: string;
327
+ }>;
328
+ experienceId: z.ZodString;
329
+ versionHash: z.ZodString;
330
+ by: z.ZodObject<{
331
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
332
+ agentId: z.ZodOptional<z.ZodString>;
333
+ modelId: z.ZodOptional<z.ZodString>;
334
+ ref: z.ZodOptional<z.ZodString>;
335
+ decisionId: z.ZodOptional<z.ZodString>;
336
+ policyDecisionId: z.ZodOptional<z.ZodString>;
337
+ }, "strip", z.ZodTypeAny, {
338
+ source: "user" | "system" | "agent" | "application";
339
+ ref?: string | undefined;
340
+ agentId?: string | undefined;
341
+ modelId?: string | undefined;
342
+ decisionId?: string | undefined;
343
+ policyDecisionId?: string | undefined;
344
+ }, {
345
+ source: "user" | "system" | "agent" | "application";
346
+ ref?: string | undefined;
347
+ agentId?: string | undefined;
348
+ modelId?: string | undefined;
349
+ decisionId?: string | undefined;
350
+ policyDecisionId?: string | undefined;
351
+ }>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ by: {
354
+ source: "user" | "system" | "agent" | "application";
355
+ ref?: string | undefined;
356
+ agentId?: string | undefined;
357
+ modelId?: string | undefined;
358
+ decisionId?: string | undefined;
359
+ policyDecisionId?: string | undefined;
360
+ };
361
+ experienceId: string;
362
+ versionHash: string;
363
+ ref: {
364
+ __loomContent: string;
365
+ };
366
+ }, {
367
+ by: {
368
+ source: "user" | "system" | "agent" | "application";
369
+ ref?: string | undefined;
370
+ agentId?: string | undefined;
371
+ modelId?: string | undefined;
372
+ decisionId?: string | undefined;
373
+ policyDecisionId?: string | undefined;
374
+ };
375
+ experienceId: string;
376
+ versionHash: string;
377
+ ref: {
378
+ __loomContent: string;
379
+ };
380
+ }>;
381
+ export type ComposedPayload = z.infer<typeof ComposedPayload>;
382
+ export type SummaryClass = NonNullable<ComposedPayload["summaryClass"]>;
383
+ export type RevertedPayload = z.infer<typeof RevertedPayload>;
384
+ export type BranchedPayload = z.infer<typeof BranchedPayload>;
385
+ export type PromotedPayload = z.infer<typeof PromotedPayload>;
386
+ export declare const PAYLOAD_SCHEMAS: {
387
+ readonly EXPERIENCE_COMPOSED: z.ZodObject<{
388
+ ops: z.ZodArray<z.ZodObject<{
389
+ op: z.ZodType<Operation, z.ZodTypeDef, Operation>;
390
+ baseVersion: z.ZodOptional<z.ZodString>;
391
+ by: z.ZodObject<{
392
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
393
+ agentId: z.ZodOptional<z.ZodString>;
394
+ modelId: z.ZodOptional<z.ZodString>;
395
+ ref: z.ZodOptional<z.ZodString>;
396
+ decisionId: z.ZodOptional<z.ZodString>;
397
+ policyDecisionId: z.ZodOptional<z.ZodString>;
398
+ }, "strip", z.ZodTypeAny, {
399
+ source: "user" | "system" | "agent" | "application";
400
+ ref?: string | undefined;
401
+ agentId?: string | undefined;
402
+ modelId?: string | undefined;
403
+ decisionId?: string | undefined;
404
+ policyDecisionId?: string | undefined;
405
+ }, {
406
+ source: "user" | "system" | "agent" | "application";
407
+ ref?: string | undefined;
408
+ agentId?: string | undefined;
409
+ modelId?: string | undefined;
410
+ decisionId?: string | undefined;
411
+ policyDecisionId?: string | undefined;
412
+ }>;
413
+ at: z.ZodString;
414
+ }, "strip", z.ZodTypeAny, {
415
+ at: string;
416
+ op: Operation;
417
+ by: {
418
+ source: "user" | "system" | "agent" | "application";
419
+ ref?: string | undefined;
420
+ agentId?: string | undefined;
421
+ modelId?: string | undefined;
422
+ decisionId?: string | undefined;
423
+ policyDecisionId?: string | undefined;
424
+ };
425
+ baseVersion?: string | undefined;
426
+ }, {
427
+ at: string;
428
+ op: Operation;
429
+ by: {
430
+ source: "user" | "system" | "agent" | "application";
431
+ ref?: string | undefined;
432
+ agentId?: string | undefined;
433
+ modelId?: string | undefined;
434
+ decisionId?: string | undefined;
435
+ policyDecisionId?: string | undefined;
436
+ };
437
+ baseVersion?: string | undefined;
438
+ }>, "many">;
439
+ /**
440
+ * What the author said about the change (U7): UNTRUSTED text (a planner's model text), bounded
441
+ * and stripped by `boundSummary` on the way in AND on the way out of the fold, since the log is
442
+ * untrusted input. Optional, so every version written before it replays unchanged; it is not in
443
+ * the content address (nothing here is).
444
+ */
445
+ summary: z.ZodOptional<z.ZodString>;
446
+ /**
447
+ * The strictest class of everything the author READ to write `summary` (the experience, tool
448
+ * samples, caller context), stamped by the host at compose. A summary is judged against it (and
449
+ * against the version's own class floor) before a viewer is shown it. Recorded on the event, not
450
+ * in the content address. Absent = unknown, and the floor alone gates the summary.
451
+ */
452
+ summaryClass: z.ZodOptional<z.ZodEnum<["secret", "sensitive", "internal"]>>;
453
+ experienceId: z.ZodString;
454
+ versionHash: z.ZodString;
455
+ ref: z.ZodObject<{
456
+ __loomContent: z.ZodString;
457
+ }, "strip", z.ZodTypeAny, {
458
+ __loomContent: string;
459
+ }, {
460
+ __loomContent: string;
461
+ }>;
462
+ parents: z.ZodArray<z.ZodString, "many">;
463
+ by: z.ZodObject<{
464
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
465
+ agentId: z.ZodOptional<z.ZodString>;
466
+ modelId: z.ZodOptional<z.ZodString>;
467
+ ref: z.ZodOptional<z.ZodString>;
468
+ decisionId: z.ZodOptional<z.ZodString>;
469
+ policyDecisionId: z.ZodOptional<z.ZodString>;
470
+ }, "strip", z.ZodTypeAny, {
471
+ source: "user" | "system" | "agent" | "application";
472
+ ref?: string | undefined;
473
+ agentId?: string | undefined;
474
+ modelId?: string | undefined;
475
+ decisionId?: string | undefined;
476
+ policyDecisionId?: string | undefined;
477
+ }, {
478
+ source: "user" | "system" | "agent" | "application";
479
+ ref?: string | undefined;
480
+ agentId?: string | undefined;
481
+ modelId?: string | undefined;
482
+ decisionId?: string | undefined;
483
+ policyDecisionId?: string | undefined;
484
+ }>;
485
+ }, "strip", z.ZodTypeAny, {
486
+ by: {
487
+ source: "user" | "system" | "agent" | "application";
488
+ ref?: string | undefined;
489
+ agentId?: string | undefined;
490
+ modelId?: string | undefined;
491
+ decisionId?: string | undefined;
492
+ policyDecisionId?: string | undefined;
493
+ };
494
+ ops: {
495
+ at: string;
496
+ op: Operation;
497
+ by: {
498
+ source: "user" | "system" | "agent" | "application";
499
+ ref?: string | undefined;
500
+ agentId?: string | undefined;
501
+ modelId?: string | undefined;
502
+ decisionId?: string | undefined;
503
+ policyDecisionId?: string | undefined;
504
+ };
505
+ baseVersion?: string | undefined;
506
+ }[];
507
+ experienceId: string;
508
+ versionHash: string;
509
+ ref: {
510
+ __loomContent: string;
511
+ };
512
+ parents: string[];
513
+ summary?: string | undefined;
514
+ summaryClass?: "secret" | "sensitive" | "internal" | undefined;
515
+ }, {
516
+ by: {
517
+ source: "user" | "system" | "agent" | "application";
518
+ ref?: string | undefined;
519
+ agentId?: string | undefined;
520
+ modelId?: string | undefined;
521
+ decisionId?: string | undefined;
522
+ policyDecisionId?: string | undefined;
523
+ };
524
+ ops: {
525
+ at: string;
526
+ op: Operation;
527
+ by: {
528
+ source: "user" | "system" | "agent" | "application";
529
+ ref?: string | undefined;
530
+ agentId?: string | undefined;
531
+ modelId?: string | undefined;
532
+ decisionId?: string | undefined;
533
+ policyDecisionId?: string | undefined;
534
+ };
535
+ baseVersion?: string | undefined;
536
+ }[];
537
+ experienceId: string;
538
+ versionHash: string;
539
+ ref: {
540
+ __loomContent: string;
541
+ };
542
+ parents: string[];
543
+ summary?: string | undefined;
544
+ summaryClass?: "secret" | "sensitive" | "internal" | undefined;
545
+ }>;
546
+ readonly EXPERIENCE_REVERTED: z.ZodObject<{
547
+ revertedTo: z.ZodString;
548
+ experienceId: z.ZodString;
549
+ versionHash: z.ZodString;
550
+ ref: z.ZodObject<{
551
+ __loomContent: z.ZodString;
552
+ }, "strip", z.ZodTypeAny, {
553
+ __loomContent: string;
554
+ }, {
555
+ __loomContent: string;
556
+ }>;
557
+ parents: z.ZodArray<z.ZodString, "many">;
558
+ by: z.ZodObject<{
559
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
560
+ agentId: z.ZodOptional<z.ZodString>;
561
+ modelId: z.ZodOptional<z.ZodString>;
562
+ ref: z.ZodOptional<z.ZodString>;
563
+ decisionId: z.ZodOptional<z.ZodString>;
564
+ policyDecisionId: z.ZodOptional<z.ZodString>;
565
+ }, "strip", z.ZodTypeAny, {
566
+ source: "user" | "system" | "agent" | "application";
567
+ ref?: string | undefined;
568
+ agentId?: string | undefined;
569
+ modelId?: string | undefined;
570
+ decisionId?: string | undefined;
571
+ policyDecisionId?: string | undefined;
572
+ }, {
573
+ source: "user" | "system" | "agent" | "application";
574
+ ref?: string | undefined;
575
+ agentId?: string | undefined;
576
+ modelId?: string | undefined;
577
+ decisionId?: string | undefined;
578
+ policyDecisionId?: string | undefined;
579
+ }>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ by: {
582
+ source: "user" | "system" | "agent" | "application";
583
+ ref?: string | undefined;
584
+ agentId?: string | undefined;
585
+ modelId?: string | undefined;
586
+ decisionId?: string | undefined;
587
+ policyDecisionId?: string | undefined;
588
+ };
589
+ experienceId: string;
590
+ versionHash: string;
591
+ ref: {
592
+ __loomContent: string;
593
+ };
594
+ parents: string[];
595
+ revertedTo: string;
596
+ }, {
597
+ by: {
598
+ source: "user" | "system" | "agent" | "application";
599
+ ref?: string | undefined;
600
+ agentId?: string | undefined;
601
+ modelId?: string | undefined;
602
+ decisionId?: string | undefined;
603
+ policyDecisionId?: string | undefined;
604
+ };
605
+ experienceId: string;
606
+ versionHash: string;
607
+ ref: {
608
+ __loomContent: string;
609
+ };
610
+ parents: string[];
611
+ revertedTo: string;
612
+ }>;
613
+ readonly EXPERIENCE_BRANCHED: z.ZodObject<{
614
+ from: z.ZodObject<{
615
+ experienceId: z.ZodString;
616
+ versionHash: z.ZodString;
617
+ }, "strip", z.ZodTypeAny, {
618
+ experienceId: string;
619
+ versionHash: string;
620
+ }, {
621
+ experienceId: string;
622
+ versionHash: string;
623
+ }>;
624
+ /** The version of the SOURCE line whose sticky classes were carried in (its head at the fork). */
625
+ carriedFrom: z.ZodString;
626
+ experienceId: z.ZodString;
627
+ versionHash: z.ZodString;
628
+ ref: z.ZodObject<{
629
+ __loomContent: z.ZodString;
630
+ }, "strip", z.ZodTypeAny, {
631
+ __loomContent: string;
632
+ }, {
633
+ __loomContent: string;
634
+ }>;
635
+ parents: z.ZodArray<z.ZodString, "many">;
636
+ by: z.ZodObject<{
637
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
638
+ agentId: z.ZodOptional<z.ZodString>;
639
+ modelId: z.ZodOptional<z.ZodString>;
640
+ ref: z.ZodOptional<z.ZodString>;
641
+ decisionId: z.ZodOptional<z.ZodString>;
642
+ policyDecisionId: z.ZodOptional<z.ZodString>;
643
+ }, "strip", z.ZodTypeAny, {
644
+ source: "user" | "system" | "agent" | "application";
645
+ ref?: string | undefined;
646
+ agentId?: string | undefined;
647
+ modelId?: string | undefined;
648
+ decisionId?: string | undefined;
649
+ policyDecisionId?: string | undefined;
650
+ }, {
651
+ source: "user" | "system" | "agent" | "application";
652
+ ref?: string | undefined;
653
+ agentId?: string | undefined;
654
+ modelId?: string | undefined;
655
+ decisionId?: string | undefined;
656
+ policyDecisionId?: string | undefined;
657
+ }>;
658
+ }, "strip", z.ZodTypeAny, {
659
+ by: {
660
+ source: "user" | "system" | "agent" | "application";
661
+ ref?: string | undefined;
662
+ agentId?: string | undefined;
663
+ modelId?: string | undefined;
664
+ decisionId?: string | undefined;
665
+ policyDecisionId?: string | undefined;
666
+ };
667
+ experienceId: string;
668
+ versionHash: string;
669
+ ref: {
670
+ __loomContent: string;
671
+ };
672
+ parents: string[];
673
+ from: {
674
+ experienceId: string;
675
+ versionHash: string;
676
+ };
677
+ carriedFrom: string;
678
+ }, {
679
+ by: {
680
+ source: "user" | "system" | "agent" | "application";
681
+ ref?: string | undefined;
682
+ agentId?: string | undefined;
683
+ modelId?: string | undefined;
684
+ decisionId?: string | undefined;
685
+ policyDecisionId?: string | undefined;
686
+ };
687
+ experienceId: string;
688
+ versionHash: string;
689
+ ref: {
690
+ __loomContent: string;
691
+ };
692
+ parents: string[];
693
+ from: {
694
+ experienceId: string;
695
+ versionHash: string;
696
+ };
697
+ carriedFrom: string;
698
+ }>;
699
+ readonly EXPERIENCE_PROMOTED: z.ZodObject<{
700
+ ref: z.ZodObject<{
701
+ __loomContent: z.ZodString;
702
+ }, "strip", z.ZodTypeAny, {
703
+ __loomContent: string;
704
+ }, {
705
+ __loomContent: string;
706
+ }>;
707
+ experienceId: z.ZodString;
708
+ versionHash: z.ZodString;
709
+ by: z.ZodObject<{
710
+ source: z.ZodEnum<["user", "agent", "application", "system"]>;
711
+ agentId: z.ZodOptional<z.ZodString>;
712
+ modelId: z.ZodOptional<z.ZodString>;
713
+ ref: z.ZodOptional<z.ZodString>;
714
+ decisionId: z.ZodOptional<z.ZodString>;
715
+ policyDecisionId: z.ZodOptional<z.ZodString>;
716
+ }, "strip", z.ZodTypeAny, {
717
+ source: "user" | "system" | "agent" | "application";
718
+ ref?: string | undefined;
719
+ agentId?: string | undefined;
720
+ modelId?: string | undefined;
721
+ decisionId?: string | undefined;
722
+ policyDecisionId?: string | undefined;
723
+ }, {
724
+ source: "user" | "system" | "agent" | "application";
725
+ ref?: string | undefined;
726
+ agentId?: string | undefined;
727
+ modelId?: string | undefined;
728
+ decisionId?: string | undefined;
729
+ policyDecisionId?: string | undefined;
730
+ }>;
731
+ }, "strip", z.ZodTypeAny, {
732
+ by: {
733
+ source: "user" | "system" | "agent" | "application";
734
+ ref?: string | undefined;
735
+ agentId?: string | undefined;
736
+ modelId?: string | undefined;
737
+ decisionId?: string | undefined;
738
+ policyDecisionId?: string | undefined;
739
+ };
740
+ experienceId: string;
741
+ versionHash: string;
742
+ ref: {
743
+ __loomContent: string;
744
+ };
745
+ }, {
746
+ by: {
747
+ source: "user" | "system" | "agent" | "application";
748
+ ref?: string | undefined;
749
+ agentId?: string | undefined;
750
+ modelId?: string | undefined;
751
+ decisionId?: string | undefined;
752
+ policyDecisionId?: string | undefined;
753
+ };
754
+ experienceId: string;
755
+ versionHash: string;
756
+ ref: {
757
+ __loomContent: string;
758
+ };
759
+ }>;
760
+ };
761
+ export declare const isLineageEventType: (t: string) => t is LineageEventType;
762
+ /**
763
+ * The payload paths that carry host or model TEXT, per event type: the op props and labels, the
764
+ * author's `summary` and the `by` provenance (a user's own words and ids). These are what a host
765
+ * seals under its owner's key so erasing the owner makes the line unreadable
766
+ * (`registerLineageSensitivePaths`). Everything else on an event is an identifier (`experienceId`,
767
+ * `versionHash`, `ref`, `parents`, `from`, `carriedFrom`, `revertedTo`) or a class
768
+ * (`summaryClass`), and stays plain so the log's structure survives the key.
769
+ *
770
+ * `ops` is one path: it covers every nested op's `by`, props, labels and prompt text.
771
+ */
772
+ export declare const LINEAGE_SENSITIVE_PATHS: Readonly<Record<LineageEventType, readonly string[]>>;
773
+ /**
774
+ * Register {@link LINEAGE_SENSITIVE_PATHS} on a crypto event store (`EncryptingEventStore`'s
775
+ * `registerSensitive`). Call it once at composition, before the first lineage write: what was
776
+ * written before stays plaintext.
777
+ */
778
+ export declare function registerLineageSensitivePaths(store: {
779
+ registerSensitive(eventType: string, paths: readonly string[]): void;
780
+ }): void;
781
+ //# sourceMappingURL=events.d.ts.map