memkin 0.4.2 → 0.4.3

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 (135) hide show
  1. package/dist/apply/candidate-selection.d.ts +60 -0
  2. package/dist/apply/candidate-selection.d.ts.map +1 -0
  3. package/dist/apply/candidate-selection.js +159 -0
  4. package/dist/apply/candidate-selection.js.map +1 -0
  5. package/dist/apply/cutover.d.ts +45 -0
  6. package/dist/apply/cutover.d.ts.map +1 -0
  7. package/dist/apply/cutover.js +85 -0
  8. package/dist/apply/cutover.js.map +1 -0
  9. package/dist/apply/engine.d.ts +34 -0
  10. package/dist/apply/engine.d.ts.map +1 -0
  11. package/dist/apply/engine.js +255 -0
  12. package/dist/apply/engine.js.map +1 -0
  13. package/dist/apply/ids.d.ts +9 -0
  14. package/dist/apply/ids.d.ts.map +1 -0
  15. package/dist/apply/ids.js +0 -0
  16. package/dist/apply/ids.js.map +1 -0
  17. package/dist/apply/page-content.d.ts +14 -0
  18. package/dist/apply/page-content.d.ts.map +1 -0
  19. package/dist/apply/page-content.js +0 -0
  20. package/dist/apply/page-content.js.map +1 -0
  21. package/dist/apply/rematerialize.d.ts +13 -0
  22. package/dist/apply/rematerialize.d.ts.map +1 -0
  23. package/dist/apply/rematerialize.js +150 -0
  24. package/dist/apply/rematerialize.js.map +1 -0
  25. package/dist/apply/rollback.d.ts +20 -0
  26. package/dist/apply/rollback.d.ts.map +1 -0
  27. package/dist/apply/rollback.js +117 -0
  28. package/dist/apply/rollback.js.map +1 -0
  29. package/dist/apply/shadow-runner.d.ts +47 -0
  30. package/dist/apply/shadow-runner.d.ts.map +1 -0
  31. package/dist/apply/shadow-runner.js +84 -0
  32. package/dist/apply/shadow-runner.js.map +1 -0
  33. package/dist/apply/types.d.ts +51 -0
  34. package/dist/apply/types.d.ts.map +1 -0
  35. package/dist/apply/types.js +13 -0
  36. package/dist/apply/types.js.map +1 -0
  37. package/dist/cli.js +5 -0
  38. package/dist/cli.js.map +1 -1
  39. package/dist/consolidator/consolidator.d.ts +21 -2
  40. package/dist/consolidator/consolidator.d.ts.map +1 -1
  41. package/dist/consolidator/consolidator.js +16 -1
  42. package/dist/consolidator/consolidator.js.map +1 -1
  43. package/dist/core/config.d.ts +42 -0
  44. package/dist/core/config.d.ts.map +1 -1
  45. package/dist/core/config.js +25 -0
  46. package/dist/core/config.js.map +1 -1
  47. package/dist/core/pipeline.d.ts +26 -1
  48. package/dist/core/pipeline.d.ts.map +1 -1
  49. package/dist/core/pipeline.js +26 -0
  50. package/dist/core/pipeline.js.map +1 -1
  51. package/dist/core/schemas.d.ts +16 -16
  52. package/dist/daemon/serve-runtime.d.ts +1 -1
  53. package/dist/daemon/serve-runtime.d.ts.map +1 -1
  54. package/dist/daemon/serve-runtime.js +26 -1
  55. package/dist/daemon/serve-runtime.js.map +1 -1
  56. package/dist/distiller/authority-matrix.d.ts +22 -0
  57. package/dist/distiller/authority-matrix.d.ts.map +1 -0
  58. package/dist/distiller/authority-matrix.js +29 -0
  59. package/dist/distiller/authority-matrix.js.map +1 -0
  60. package/dist/distiller/contract.d.ts +1427 -0
  61. package/dist/distiller/contract.d.ts.map +1 -0
  62. package/dist/distiller/contract.js +166 -0
  63. package/dist/distiller/contract.js.map +1 -0
  64. package/dist/distiller/index.d.ts +83 -0
  65. package/dist/distiller/index.d.ts.map +1 -0
  66. package/dist/distiller/index.js +226 -0
  67. package/dist/distiller/index.js.map +1 -0
  68. package/dist/distiller/map-reduce.d.ts +81 -0
  69. package/dist/distiller/map-reduce.d.ts.map +1 -0
  70. package/dist/distiller/map-reduce.js +92 -0
  71. package/dist/distiller/map-reduce.js.map +1 -0
  72. package/dist/distiller/msg-id.d.ts +55 -0
  73. package/dist/distiller/msg-id.d.ts.map +1 -0
  74. package/dist/distiller/msg-id.js +91 -0
  75. package/dist/distiller/msg-id.js.map +1 -0
  76. package/dist/distiller/payload-privacy.d.ts +18 -0
  77. package/dist/distiller/payload-privacy.d.ts.map +1 -0
  78. package/dist/distiller/payload-privacy.js +51 -0
  79. package/dist/distiller/payload-privacy.js.map +1 -0
  80. package/dist/distiller/prompt.d.ts +28 -0
  81. package/dist/distiller/prompt.d.ts.map +1 -0
  82. package/dist/distiller/prompt.js +69 -0
  83. package/dist/distiller/prompt.js.map +1 -0
  84. package/dist/distiller/raw-privacy.d.ts +55 -0
  85. package/dist/distiller/raw-privacy.d.ts.map +1 -0
  86. package/dist/distiller/raw-privacy.js +123 -0
  87. package/dist/distiller/raw-privacy.js.map +1 -0
  88. package/dist/distiller/segmenter.d.ts +40 -0
  89. package/dist/distiller/segmenter.d.ts.map +1 -0
  90. package/dist/distiller/segmenter.js +75 -0
  91. package/dist/distiller/segmenter.js.map +1 -0
  92. package/dist/embedded-assets.generated.d.ts.map +1 -1
  93. package/dist/embedded-assets.generated.js +5 -4
  94. package/dist/embedded-assets.generated.js.map +1 -1
  95. package/dist/eval/golden.d.ts +12 -12
  96. package/dist/server/api.d.ts.map +1 -1
  97. package/dist/server/api.js +6 -1
  98. package/dist/server/api.js.map +1 -1
  99. package/dist/setup/generate-config.d.ts.map +1 -1
  100. package/dist/setup/generate-config.js +3 -0
  101. package/dist/setup/generate-config.js.map +1 -1
  102. package/dist/setup/validate-config.d.ts +2 -1
  103. package/dist/setup/validate-config.d.ts.map +1 -1
  104. package/dist/setup/validate-config.js.map +1 -1
  105. package/dist/store/agent-sessions.d.ts.map +1 -1
  106. package/dist/store/agent-sessions.js +3 -1
  107. package/dist/store/agent-sessions.js.map +1 -1
  108. package/dist/store/distilled-payload.d.ts +50 -0
  109. package/dist/store/distilled-payload.d.ts.map +1 -0
  110. package/dist/store/distilled-payload.js +117 -0
  111. package/dist/store/distilled-payload.js.map +1 -0
  112. package/dist/store/engine-factory.d.ts.map +1 -1
  113. package/dist/store/engine-factory.js +8 -1
  114. package/dist/store/engine-factory.js.map +1 -1
  115. package/dist/store/migrations/index.d.ts.map +1 -1
  116. package/dist/store/migrations/index.js +139 -0
  117. package/dist/store/migrations/index.js.map +1 -1
  118. package/dist/store/search.d.ts.map +1 -1
  119. package/dist/store/search.js +15 -8
  120. package/dist/store/search.js.map +1 -1
  121. package/dist/store/source-filter.d.ts +19 -0
  122. package/dist/store/source-filter.d.ts.map +1 -0
  123. package/dist/store/source-filter.js +44 -0
  124. package/dist/store/source-filter.js.map +1 -0
  125. package/dist/store/timeline.d.ts.map +1 -1
  126. package/dist/store/timeline.js +15 -8
  127. package/dist/store/timeline.js.map +1 -1
  128. package/dist/synth/scope.d.ts.map +1 -1
  129. package/dist/synth/scope.js +10 -4
  130. package/dist/synth/scope.js.map +1 -1
  131. package/package.json +2 -1
  132. package/web/dist/assets/index-Cie2dVF3.js +5167 -0
  133. package/web/dist/assets/index-diZtO98v.css +2 -0
  134. package/web/dist/assets/newsreader-T5L87s1n.woff2 +0 -0
  135. package/web/dist/index.html +19 -0
@@ -0,0 +1,1427 @@
1
+ /**
2
+ * Distillation output contract v4 (spec §5).
3
+ *
4
+ * A `DistilledPayload` is the target-agnostic, immutable product of session
5
+ * distillation: a set of signals, each a member of a Zod discriminated union
6
+ * keyed by `type`. PR-2 only produces and persists this payload; it never
7
+ * writes pages (that is PR-4's apply engine).
8
+ *
9
+ * Design notes:
10
+ * - Discriminated union: every `type` carries its own additional fields and
11
+ * admission rules. Strict validation — the distiller retries once on failure
12
+ * before parking the revision in `retrying`.
13
+ * - authority is a three-value ladder (user_confirmed / assistant_claimed /
14
+ * assistant_proposed). The per-type admissibility matrix lives in
15
+ * authority-matrix.ts (spec §5).
16
+ * - Dates use ISO 8601 (z.string().datetime()).
17
+ * - preference.category and knowledge.source_kind are closed enums, not free
18
+ * text.
19
+ * - reference.url is required and must additionally be locatable inside the
20
+ * evidence message text — that cross-check lives in msg-id.ts (it needs the
21
+ * transcript), not here.
22
+ * - Payload-internal dedup: no two signals may share (type, slugify(topic)).
23
+ * That guarantee is why the two-layer ID scheme (spec §6.1) needs no ordinal.
24
+ */
25
+ import { z } from "zod";
26
+ export declare const SignalTypeSchema: z.ZodEnum<["decision", "task", "reference", "preference", "knowledge", "discovery"]>;
27
+ export type SignalType = z.infer<typeof SignalTypeSchema>;
28
+ export declare const AuthoritySchema: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
29
+ export type Authority = z.infer<typeof AuthoritySchema>;
30
+ export declare const TaskStatusSchema: z.ZodEnum<["open", "in_progress", "done", "cancelled"]>;
31
+ export type TaskStatus = z.infer<typeof TaskStatusSchema>;
32
+ export declare const PreferenceCategorySchema: z.ZodEnum<["tooling", "workflow", "communication", "coding_style", "ui", "personal", "other"]>;
33
+ export type PreferenceCategory = z.infer<typeof PreferenceCategorySchema>;
34
+ export declare const KnowledgeSourceKindSchema: z.ZodEnum<["documentation", "experiment", "external_reference", "domain_fact", "observation"]>;
35
+ export type KnowledgeSourceKind = z.infer<typeof KnowledgeSourceKindSchema>;
36
+ export declare const DiscoverySubtypeSchema: z.ZodEnum<["insight", "pattern", "risk", "procedure"]>;
37
+ export type DiscoverySubtype = z.infer<typeof DiscoverySubtypeSchema>;
38
+ export declare const MsgRangeSchema: z.ZodObject<{
39
+ start: z.ZodString;
40
+ end: z.ZodString;
41
+ }, "strip", z.ZodTypeAny, {
42
+ end: string;
43
+ start: string;
44
+ }, {
45
+ end: string;
46
+ start: string;
47
+ }>;
48
+ export type MsgRange = z.infer<typeof MsgRangeSchema>;
49
+ export declare const DecisionSignalSchema: z.ZodObject<{
50
+ topic: z.ZodString;
51
+ what: z.ZodString;
52
+ why: z.ZodOptional<z.ZodString>;
53
+ project: z.ZodOptional<z.ZodString>;
54
+ entities: z.ZodArray<z.ZodString, "many">;
55
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
56
+ supersedes_topic: z.ZodOptional<z.ZodString>;
57
+ evidence: z.ZodArray<z.ZodObject<{
58
+ start: z.ZodString;
59
+ end: z.ZodString;
60
+ }, "strip", z.ZodTypeAny, {
61
+ end: string;
62
+ start: string;
63
+ }, {
64
+ end: string;
65
+ start: string;
66
+ }>, "many">;
67
+ persistence_reason: z.ZodString;
68
+ type: z.ZodLiteral<"decision">;
69
+ }, "strip", z.ZodTypeAny, {
70
+ type: "decision";
71
+ what: string;
72
+ entities: string[];
73
+ topic: string;
74
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
75
+ evidence: {
76
+ end: string;
77
+ start: string;
78
+ }[];
79
+ persistence_reason: string;
80
+ project?: string | undefined;
81
+ why?: string | undefined;
82
+ supersedes_topic?: string | undefined;
83
+ }, {
84
+ type: "decision";
85
+ what: string;
86
+ entities: string[];
87
+ topic: string;
88
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
89
+ evidence: {
90
+ end: string;
91
+ start: string;
92
+ }[];
93
+ persistence_reason: string;
94
+ project?: string | undefined;
95
+ why?: string | undefined;
96
+ supersedes_topic?: string | undefined;
97
+ }>;
98
+ export declare const TaskSignalSchema: z.ZodObject<{
99
+ owner: z.ZodOptional<z.ZodString>;
100
+ due_date: z.ZodOptional<z.ZodString>;
101
+ status: z.ZodEnum<["open", "in_progress", "done", "cancelled"]>;
102
+ topic: z.ZodString;
103
+ what: z.ZodString;
104
+ why: z.ZodOptional<z.ZodString>;
105
+ project: z.ZodOptional<z.ZodString>;
106
+ entities: z.ZodArray<z.ZodString, "many">;
107
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
108
+ supersedes_topic: z.ZodOptional<z.ZodString>;
109
+ evidence: z.ZodArray<z.ZodObject<{
110
+ start: z.ZodString;
111
+ end: z.ZodString;
112
+ }, "strip", z.ZodTypeAny, {
113
+ end: string;
114
+ start: string;
115
+ }, {
116
+ end: string;
117
+ start: string;
118
+ }>, "many">;
119
+ persistence_reason: z.ZodString;
120
+ type: z.ZodLiteral<"task">;
121
+ }, "strip", z.ZodTypeAny, {
122
+ type: "task";
123
+ status: "open" | "in_progress" | "done" | "cancelled";
124
+ what: string;
125
+ entities: string[];
126
+ topic: string;
127
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
128
+ evidence: {
129
+ end: string;
130
+ start: string;
131
+ }[];
132
+ persistence_reason: string;
133
+ project?: string | undefined;
134
+ due_date?: string | undefined;
135
+ why?: string | undefined;
136
+ supersedes_topic?: string | undefined;
137
+ owner?: string | undefined;
138
+ }, {
139
+ type: "task";
140
+ status: "open" | "in_progress" | "done" | "cancelled";
141
+ what: string;
142
+ entities: string[];
143
+ topic: string;
144
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
145
+ evidence: {
146
+ end: string;
147
+ start: string;
148
+ }[];
149
+ persistence_reason: string;
150
+ project?: string | undefined;
151
+ due_date?: string | undefined;
152
+ why?: string | undefined;
153
+ supersedes_topic?: string | undefined;
154
+ owner?: string | undefined;
155
+ }>;
156
+ export declare const ReferenceSignalSchema: z.ZodObject<{
157
+ url: z.ZodString;
158
+ trigger: z.ZodOptional<z.ZodString>;
159
+ topic: z.ZodString;
160
+ what: z.ZodString;
161
+ why: z.ZodOptional<z.ZodString>;
162
+ project: z.ZodOptional<z.ZodString>;
163
+ entities: z.ZodArray<z.ZodString, "many">;
164
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
165
+ supersedes_topic: z.ZodOptional<z.ZodString>;
166
+ evidence: z.ZodArray<z.ZodObject<{
167
+ start: z.ZodString;
168
+ end: z.ZodString;
169
+ }, "strip", z.ZodTypeAny, {
170
+ end: string;
171
+ start: string;
172
+ }, {
173
+ end: string;
174
+ start: string;
175
+ }>, "many">;
176
+ persistence_reason: z.ZodString;
177
+ type: z.ZodLiteral<"reference">;
178
+ }, "strip", z.ZodTypeAny, {
179
+ url: string;
180
+ type: "reference";
181
+ what: string;
182
+ entities: string[];
183
+ topic: string;
184
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
185
+ evidence: {
186
+ end: string;
187
+ start: string;
188
+ }[];
189
+ persistence_reason: string;
190
+ project?: string | undefined;
191
+ trigger?: string | undefined;
192
+ why?: string | undefined;
193
+ supersedes_topic?: string | undefined;
194
+ }, {
195
+ url: string;
196
+ type: "reference";
197
+ what: string;
198
+ entities: string[];
199
+ topic: string;
200
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
201
+ evidence: {
202
+ end: string;
203
+ start: string;
204
+ }[];
205
+ persistence_reason: string;
206
+ project?: string | undefined;
207
+ trigger?: string | undefined;
208
+ why?: string | undefined;
209
+ supersedes_topic?: string | undefined;
210
+ }>;
211
+ export declare const PreferenceSignalSchema: z.ZodObject<{
212
+ subject: z.ZodString;
213
+ category: z.ZodEnum<["tooling", "workflow", "communication", "coding_style", "ui", "personal", "other"]>;
214
+ topic: z.ZodString;
215
+ what: z.ZodString;
216
+ why: z.ZodOptional<z.ZodString>;
217
+ project: z.ZodOptional<z.ZodString>;
218
+ entities: z.ZodArray<z.ZodString, "many">;
219
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
220
+ supersedes_topic: z.ZodOptional<z.ZodString>;
221
+ evidence: z.ZodArray<z.ZodObject<{
222
+ start: z.ZodString;
223
+ end: z.ZodString;
224
+ }, "strip", z.ZodTypeAny, {
225
+ end: string;
226
+ start: string;
227
+ }, {
228
+ end: string;
229
+ start: string;
230
+ }>, "many">;
231
+ persistence_reason: z.ZodString;
232
+ type: z.ZodLiteral<"preference">;
233
+ }, "strip", z.ZodTypeAny, {
234
+ type: "preference";
235
+ what: string;
236
+ entities: string[];
237
+ topic: string;
238
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
239
+ evidence: {
240
+ end: string;
241
+ start: string;
242
+ }[];
243
+ persistence_reason: string;
244
+ subject: string;
245
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
246
+ project?: string | undefined;
247
+ why?: string | undefined;
248
+ supersedes_topic?: string | undefined;
249
+ }, {
250
+ type: "preference";
251
+ what: string;
252
+ entities: string[];
253
+ topic: string;
254
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
255
+ evidence: {
256
+ end: string;
257
+ start: string;
258
+ }[];
259
+ persistence_reason: string;
260
+ subject: string;
261
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
262
+ project?: string | undefined;
263
+ why?: string | undefined;
264
+ supersedes_topic?: string | undefined;
265
+ }>;
266
+ export declare const KnowledgeSignalSchema: z.ZodObject<{
267
+ source_kind: z.ZodEnum<["documentation", "experiment", "external_reference", "domain_fact", "observation"]>;
268
+ valid_at: z.ZodOptional<z.ZodString>;
269
+ invalid_at: z.ZodOptional<z.ZodString>;
270
+ topic: z.ZodString;
271
+ what: z.ZodString;
272
+ why: z.ZodOptional<z.ZodString>;
273
+ project: z.ZodOptional<z.ZodString>;
274
+ entities: z.ZodArray<z.ZodString, "many">;
275
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
276
+ supersedes_topic: z.ZodOptional<z.ZodString>;
277
+ evidence: z.ZodArray<z.ZodObject<{
278
+ start: z.ZodString;
279
+ end: z.ZodString;
280
+ }, "strip", z.ZodTypeAny, {
281
+ end: string;
282
+ start: string;
283
+ }, {
284
+ end: string;
285
+ start: string;
286
+ }>, "many">;
287
+ persistence_reason: z.ZodString;
288
+ type: z.ZodLiteral<"knowledge">;
289
+ }, "strip", z.ZodTypeAny, {
290
+ type: "knowledge";
291
+ what: string;
292
+ entities: string[];
293
+ topic: string;
294
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
295
+ evidence: {
296
+ end: string;
297
+ start: string;
298
+ }[];
299
+ persistence_reason: string;
300
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
301
+ project?: string | undefined;
302
+ why?: string | undefined;
303
+ supersedes_topic?: string | undefined;
304
+ valid_at?: string | undefined;
305
+ invalid_at?: string | undefined;
306
+ }, {
307
+ type: "knowledge";
308
+ what: string;
309
+ entities: string[];
310
+ topic: string;
311
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
312
+ evidence: {
313
+ end: string;
314
+ start: string;
315
+ }[];
316
+ persistence_reason: string;
317
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
318
+ project?: string | undefined;
319
+ why?: string | undefined;
320
+ supersedes_topic?: string | undefined;
321
+ valid_at?: string | undefined;
322
+ invalid_at?: string | undefined;
323
+ }>;
324
+ export declare const DiscoverySignalSchema: z.ZodObject<{
325
+ subtype: z.ZodEnum<["insight", "pattern", "risk", "procedure"]>;
326
+ topic: z.ZodString;
327
+ what: z.ZodString;
328
+ why: z.ZodOptional<z.ZodString>;
329
+ project: z.ZodOptional<z.ZodString>;
330
+ entities: z.ZodArray<z.ZodString, "many">;
331
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
332
+ supersedes_topic: z.ZodOptional<z.ZodString>;
333
+ evidence: z.ZodArray<z.ZodObject<{
334
+ start: z.ZodString;
335
+ end: z.ZodString;
336
+ }, "strip", z.ZodTypeAny, {
337
+ end: string;
338
+ start: string;
339
+ }, {
340
+ end: string;
341
+ start: string;
342
+ }>, "many">;
343
+ persistence_reason: z.ZodString;
344
+ type: z.ZodLiteral<"discovery">;
345
+ }, "strip", z.ZodTypeAny, {
346
+ type: "discovery";
347
+ what: string;
348
+ entities: string[];
349
+ topic: string;
350
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
351
+ evidence: {
352
+ end: string;
353
+ start: string;
354
+ }[];
355
+ persistence_reason: string;
356
+ subtype: "procedure" | "pattern" | "insight" | "risk";
357
+ project?: string | undefined;
358
+ why?: string | undefined;
359
+ supersedes_topic?: string | undefined;
360
+ }, {
361
+ type: "discovery";
362
+ what: string;
363
+ entities: string[];
364
+ topic: string;
365
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
366
+ evidence: {
367
+ end: string;
368
+ start: string;
369
+ }[];
370
+ persistence_reason: string;
371
+ subtype: "procedure" | "pattern" | "insight" | "risk";
372
+ project?: string | undefined;
373
+ why?: string | undefined;
374
+ supersedes_topic?: string | undefined;
375
+ }>;
376
+ export declare const DistilledSignalSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
377
+ topic: z.ZodString;
378
+ what: z.ZodString;
379
+ why: z.ZodOptional<z.ZodString>;
380
+ project: z.ZodOptional<z.ZodString>;
381
+ entities: z.ZodArray<z.ZodString, "many">;
382
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
383
+ supersedes_topic: z.ZodOptional<z.ZodString>;
384
+ evidence: z.ZodArray<z.ZodObject<{
385
+ start: z.ZodString;
386
+ end: z.ZodString;
387
+ }, "strip", z.ZodTypeAny, {
388
+ end: string;
389
+ start: string;
390
+ }, {
391
+ end: string;
392
+ start: string;
393
+ }>, "many">;
394
+ persistence_reason: z.ZodString;
395
+ type: z.ZodLiteral<"decision">;
396
+ }, "strip", z.ZodTypeAny, {
397
+ type: "decision";
398
+ what: string;
399
+ entities: string[];
400
+ topic: string;
401
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
402
+ evidence: {
403
+ end: string;
404
+ start: string;
405
+ }[];
406
+ persistence_reason: string;
407
+ project?: string | undefined;
408
+ why?: string | undefined;
409
+ supersedes_topic?: string | undefined;
410
+ }, {
411
+ type: "decision";
412
+ what: string;
413
+ entities: string[];
414
+ topic: string;
415
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
416
+ evidence: {
417
+ end: string;
418
+ start: string;
419
+ }[];
420
+ persistence_reason: string;
421
+ project?: string | undefined;
422
+ why?: string | undefined;
423
+ supersedes_topic?: string | undefined;
424
+ }>, z.ZodObject<{
425
+ owner: z.ZodOptional<z.ZodString>;
426
+ due_date: z.ZodOptional<z.ZodString>;
427
+ status: z.ZodEnum<["open", "in_progress", "done", "cancelled"]>;
428
+ topic: z.ZodString;
429
+ what: z.ZodString;
430
+ why: z.ZodOptional<z.ZodString>;
431
+ project: z.ZodOptional<z.ZodString>;
432
+ entities: z.ZodArray<z.ZodString, "many">;
433
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
434
+ supersedes_topic: z.ZodOptional<z.ZodString>;
435
+ evidence: z.ZodArray<z.ZodObject<{
436
+ start: z.ZodString;
437
+ end: z.ZodString;
438
+ }, "strip", z.ZodTypeAny, {
439
+ end: string;
440
+ start: string;
441
+ }, {
442
+ end: string;
443
+ start: string;
444
+ }>, "many">;
445
+ persistence_reason: z.ZodString;
446
+ type: z.ZodLiteral<"task">;
447
+ }, "strip", z.ZodTypeAny, {
448
+ type: "task";
449
+ status: "open" | "in_progress" | "done" | "cancelled";
450
+ what: string;
451
+ entities: string[];
452
+ topic: string;
453
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
454
+ evidence: {
455
+ end: string;
456
+ start: string;
457
+ }[];
458
+ persistence_reason: string;
459
+ project?: string | undefined;
460
+ due_date?: string | undefined;
461
+ why?: string | undefined;
462
+ supersedes_topic?: string | undefined;
463
+ owner?: string | undefined;
464
+ }, {
465
+ type: "task";
466
+ status: "open" | "in_progress" | "done" | "cancelled";
467
+ what: string;
468
+ entities: string[];
469
+ topic: string;
470
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
471
+ evidence: {
472
+ end: string;
473
+ start: string;
474
+ }[];
475
+ persistence_reason: string;
476
+ project?: string | undefined;
477
+ due_date?: string | undefined;
478
+ why?: string | undefined;
479
+ supersedes_topic?: string | undefined;
480
+ owner?: string | undefined;
481
+ }>, z.ZodObject<{
482
+ url: z.ZodString;
483
+ trigger: z.ZodOptional<z.ZodString>;
484
+ topic: z.ZodString;
485
+ what: z.ZodString;
486
+ why: z.ZodOptional<z.ZodString>;
487
+ project: z.ZodOptional<z.ZodString>;
488
+ entities: z.ZodArray<z.ZodString, "many">;
489
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
490
+ supersedes_topic: z.ZodOptional<z.ZodString>;
491
+ evidence: z.ZodArray<z.ZodObject<{
492
+ start: z.ZodString;
493
+ end: z.ZodString;
494
+ }, "strip", z.ZodTypeAny, {
495
+ end: string;
496
+ start: string;
497
+ }, {
498
+ end: string;
499
+ start: string;
500
+ }>, "many">;
501
+ persistence_reason: z.ZodString;
502
+ type: z.ZodLiteral<"reference">;
503
+ }, "strip", z.ZodTypeAny, {
504
+ url: string;
505
+ type: "reference";
506
+ what: string;
507
+ entities: string[];
508
+ topic: string;
509
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
510
+ evidence: {
511
+ end: string;
512
+ start: string;
513
+ }[];
514
+ persistence_reason: string;
515
+ project?: string | undefined;
516
+ trigger?: string | undefined;
517
+ why?: string | undefined;
518
+ supersedes_topic?: string | undefined;
519
+ }, {
520
+ url: string;
521
+ type: "reference";
522
+ what: string;
523
+ entities: string[];
524
+ topic: string;
525
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
526
+ evidence: {
527
+ end: string;
528
+ start: string;
529
+ }[];
530
+ persistence_reason: string;
531
+ project?: string | undefined;
532
+ trigger?: string | undefined;
533
+ why?: string | undefined;
534
+ supersedes_topic?: string | undefined;
535
+ }>, z.ZodObject<{
536
+ subject: z.ZodString;
537
+ category: z.ZodEnum<["tooling", "workflow", "communication", "coding_style", "ui", "personal", "other"]>;
538
+ topic: z.ZodString;
539
+ what: z.ZodString;
540
+ why: z.ZodOptional<z.ZodString>;
541
+ project: z.ZodOptional<z.ZodString>;
542
+ entities: z.ZodArray<z.ZodString, "many">;
543
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
544
+ supersedes_topic: z.ZodOptional<z.ZodString>;
545
+ evidence: z.ZodArray<z.ZodObject<{
546
+ start: z.ZodString;
547
+ end: z.ZodString;
548
+ }, "strip", z.ZodTypeAny, {
549
+ end: string;
550
+ start: string;
551
+ }, {
552
+ end: string;
553
+ start: string;
554
+ }>, "many">;
555
+ persistence_reason: z.ZodString;
556
+ type: z.ZodLiteral<"preference">;
557
+ }, "strip", z.ZodTypeAny, {
558
+ type: "preference";
559
+ what: string;
560
+ entities: string[];
561
+ topic: string;
562
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
563
+ evidence: {
564
+ end: string;
565
+ start: string;
566
+ }[];
567
+ persistence_reason: string;
568
+ subject: string;
569
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
570
+ project?: string | undefined;
571
+ why?: string | undefined;
572
+ supersedes_topic?: string | undefined;
573
+ }, {
574
+ type: "preference";
575
+ what: string;
576
+ entities: string[];
577
+ topic: string;
578
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
579
+ evidence: {
580
+ end: string;
581
+ start: string;
582
+ }[];
583
+ persistence_reason: string;
584
+ subject: string;
585
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
586
+ project?: string | undefined;
587
+ why?: string | undefined;
588
+ supersedes_topic?: string | undefined;
589
+ }>, z.ZodObject<{
590
+ source_kind: z.ZodEnum<["documentation", "experiment", "external_reference", "domain_fact", "observation"]>;
591
+ valid_at: z.ZodOptional<z.ZodString>;
592
+ invalid_at: z.ZodOptional<z.ZodString>;
593
+ topic: z.ZodString;
594
+ what: z.ZodString;
595
+ why: z.ZodOptional<z.ZodString>;
596
+ project: z.ZodOptional<z.ZodString>;
597
+ entities: z.ZodArray<z.ZodString, "many">;
598
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
599
+ supersedes_topic: z.ZodOptional<z.ZodString>;
600
+ evidence: z.ZodArray<z.ZodObject<{
601
+ start: z.ZodString;
602
+ end: z.ZodString;
603
+ }, "strip", z.ZodTypeAny, {
604
+ end: string;
605
+ start: string;
606
+ }, {
607
+ end: string;
608
+ start: string;
609
+ }>, "many">;
610
+ persistence_reason: z.ZodString;
611
+ type: z.ZodLiteral<"knowledge">;
612
+ }, "strip", z.ZodTypeAny, {
613
+ type: "knowledge";
614
+ what: string;
615
+ entities: string[];
616
+ topic: string;
617
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
618
+ evidence: {
619
+ end: string;
620
+ start: string;
621
+ }[];
622
+ persistence_reason: string;
623
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
624
+ project?: string | undefined;
625
+ why?: string | undefined;
626
+ supersedes_topic?: string | undefined;
627
+ valid_at?: string | undefined;
628
+ invalid_at?: string | undefined;
629
+ }, {
630
+ type: "knowledge";
631
+ what: string;
632
+ entities: string[];
633
+ topic: string;
634
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
635
+ evidence: {
636
+ end: string;
637
+ start: string;
638
+ }[];
639
+ persistence_reason: string;
640
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
641
+ project?: string | undefined;
642
+ why?: string | undefined;
643
+ supersedes_topic?: string | undefined;
644
+ valid_at?: string | undefined;
645
+ invalid_at?: string | undefined;
646
+ }>, z.ZodObject<{
647
+ subtype: z.ZodEnum<["insight", "pattern", "risk", "procedure"]>;
648
+ topic: z.ZodString;
649
+ what: z.ZodString;
650
+ why: z.ZodOptional<z.ZodString>;
651
+ project: z.ZodOptional<z.ZodString>;
652
+ entities: z.ZodArray<z.ZodString, "many">;
653
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
654
+ supersedes_topic: z.ZodOptional<z.ZodString>;
655
+ evidence: z.ZodArray<z.ZodObject<{
656
+ start: z.ZodString;
657
+ end: z.ZodString;
658
+ }, "strip", z.ZodTypeAny, {
659
+ end: string;
660
+ start: string;
661
+ }, {
662
+ end: string;
663
+ start: string;
664
+ }>, "many">;
665
+ persistence_reason: z.ZodString;
666
+ type: z.ZodLiteral<"discovery">;
667
+ }, "strip", z.ZodTypeAny, {
668
+ type: "discovery";
669
+ what: string;
670
+ entities: string[];
671
+ topic: string;
672
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
673
+ evidence: {
674
+ end: string;
675
+ start: string;
676
+ }[];
677
+ persistence_reason: string;
678
+ subtype: "procedure" | "pattern" | "insight" | "risk";
679
+ project?: string | undefined;
680
+ why?: string | undefined;
681
+ supersedes_topic?: string | undefined;
682
+ }, {
683
+ type: "discovery";
684
+ what: string;
685
+ entities: string[];
686
+ topic: string;
687
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
688
+ evidence: {
689
+ end: string;
690
+ start: string;
691
+ }[];
692
+ persistence_reason: string;
693
+ subtype: "procedure" | "pattern" | "insight" | "risk";
694
+ project?: string | undefined;
695
+ why?: string | undefined;
696
+ supersedes_topic?: string | undefined;
697
+ }>]>;
698
+ export type DistilledSignal = z.infer<typeof DistilledSignalSchema>;
699
+ export declare const DistilledPayloadSchema: z.ZodEffects<z.ZodObject<{
700
+ signals: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
701
+ topic: z.ZodString;
702
+ what: z.ZodString;
703
+ why: z.ZodOptional<z.ZodString>;
704
+ project: z.ZodOptional<z.ZodString>;
705
+ entities: z.ZodArray<z.ZodString, "many">;
706
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
707
+ supersedes_topic: z.ZodOptional<z.ZodString>;
708
+ evidence: z.ZodArray<z.ZodObject<{
709
+ start: z.ZodString;
710
+ end: z.ZodString;
711
+ }, "strip", z.ZodTypeAny, {
712
+ end: string;
713
+ start: string;
714
+ }, {
715
+ end: string;
716
+ start: string;
717
+ }>, "many">;
718
+ persistence_reason: z.ZodString;
719
+ type: z.ZodLiteral<"decision">;
720
+ }, "strip", z.ZodTypeAny, {
721
+ type: "decision";
722
+ what: string;
723
+ entities: string[];
724
+ topic: string;
725
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
726
+ evidence: {
727
+ end: string;
728
+ start: string;
729
+ }[];
730
+ persistence_reason: string;
731
+ project?: string | undefined;
732
+ why?: string | undefined;
733
+ supersedes_topic?: string | undefined;
734
+ }, {
735
+ type: "decision";
736
+ what: string;
737
+ entities: string[];
738
+ topic: string;
739
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
740
+ evidence: {
741
+ end: string;
742
+ start: string;
743
+ }[];
744
+ persistence_reason: string;
745
+ project?: string | undefined;
746
+ why?: string | undefined;
747
+ supersedes_topic?: string | undefined;
748
+ }>, z.ZodObject<{
749
+ owner: z.ZodOptional<z.ZodString>;
750
+ due_date: z.ZodOptional<z.ZodString>;
751
+ status: z.ZodEnum<["open", "in_progress", "done", "cancelled"]>;
752
+ topic: z.ZodString;
753
+ what: z.ZodString;
754
+ why: z.ZodOptional<z.ZodString>;
755
+ project: z.ZodOptional<z.ZodString>;
756
+ entities: z.ZodArray<z.ZodString, "many">;
757
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
758
+ supersedes_topic: z.ZodOptional<z.ZodString>;
759
+ evidence: z.ZodArray<z.ZodObject<{
760
+ start: z.ZodString;
761
+ end: z.ZodString;
762
+ }, "strip", z.ZodTypeAny, {
763
+ end: string;
764
+ start: string;
765
+ }, {
766
+ end: string;
767
+ start: string;
768
+ }>, "many">;
769
+ persistence_reason: z.ZodString;
770
+ type: z.ZodLiteral<"task">;
771
+ }, "strip", z.ZodTypeAny, {
772
+ type: "task";
773
+ status: "open" | "in_progress" | "done" | "cancelled";
774
+ what: string;
775
+ entities: string[];
776
+ topic: string;
777
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
778
+ evidence: {
779
+ end: string;
780
+ start: string;
781
+ }[];
782
+ persistence_reason: string;
783
+ project?: string | undefined;
784
+ due_date?: string | undefined;
785
+ why?: string | undefined;
786
+ supersedes_topic?: string | undefined;
787
+ owner?: string | undefined;
788
+ }, {
789
+ type: "task";
790
+ status: "open" | "in_progress" | "done" | "cancelled";
791
+ what: string;
792
+ entities: string[];
793
+ topic: string;
794
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
795
+ evidence: {
796
+ end: string;
797
+ start: string;
798
+ }[];
799
+ persistence_reason: string;
800
+ project?: string | undefined;
801
+ due_date?: string | undefined;
802
+ why?: string | undefined;
803
+ supersedes_topic?: string | undefined;
804
+ owner?: string | undefined;
805
+ }>, z.ZodObject<{
806
+ url: z.ZodString;
807
+ trigger: z.ZodOptional<z.ZodString>;
808
+ topic: z.ZodString;
809
+ what: z.ZodString;
810
+ why: z.ZodOptional<z.ZodString>;
811
+ project: z.ZodOptional<z.ZodString>;
812
+ entities: z.ZodArray<z.ZodString, "many">;
813
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
814
+ supersedes_topic: z.ZodOptional<z.ZodString>;
815
+ evidence: z.ZodArray<z.ZodObject<{
816
+ start: z.ZodString;
817
+ end: z.ZodString;
818
+ }, "strip", z.ZodTypeAny, {
819
+ end: string;
820
+ start: string;
821
+ }, {
822
+ end: string;
823
+ start: string;
824
+ }>, "many">;
825
+ persistence_reason: z.ZodString;
826
+ type: z.ZodLiteral<"reference">;
827
+ }, "strip", z.ZodTypeAny, {
828
+ url: string;
829
+ type: "reference";
830
+ what: string;
831
+ entities: string[];
832
+ topic: string;
833
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
834
+ evidence: {
835
+ end: string;
836
+ start: string;
837
+ }[];
838
+ persistence_reason: string;
839
+ project?: string | undefined;
840
+ trigger?: string | undefined;
841
+ why?: string | undefined;
842
+ supersedes_topic?: string | undefined;
843
+ }, {
844
+ url: string;
845
+ type: "reference";
846
+ what: string;
847
+ entities: string[];
848
+ topic: string;
849
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
850
+ evidence: {
851
+ end: string;
852
+ start: string;
853
+ }[];
854
+ persistence_reason: string;
855
+ project?: string | undefined;
856
+ trigger?: string | undefined;
857
+ why?: string | undefined;
858
+ supersedes_topic?: string | undefined;
859
+ }>, z.ZodObject<{
860
+ subject: z.ZodString;
861
+ category: z.ZodEnum<["tooling", "workflow", "communication", "coding_style", "ui", "personal", "other"]>;
862
+ topic: z.ZodString;
863
+ what: z.ZodString;
864
+ why: z.ZodOptional<z.ZodString>;
865
+ project: z.ZodOptional<z.ZodString>;
866
+ entities: z.ZodArray<z.ZodString, "many">;
867
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
868
+ supersedes_topic: z.ZodOptional<z.ZodString>;
869
+ evidence: z.ZodArray<z.ZodObject<{
870
+ start: z.ZodString;
871
+ end: z.ZodString;
872
+ }, "strip", z.ZodTypeAny, {
873
+ end: string;
874
+ start: string;
875
+ }, {
876
+ end: string;
877
+ start: string;
878
+ }>, "many">;
879
+ persistence_reason: z.ZodString;
880
+ type: z.ZodLiteral<"preference">;
881
+ }, "strip", z.ZodTypeAny, {
882
+ type: "preference";
883
+ what: string;
884
+ entities: string[];
885
+ topic: string;
886
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
887
+ evidence: {
888
+ end: string;
889
+ start: string;
890
+ }[];
891
+ persistence_reason: string;
892
+ subject: string;
893
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
894
+ project?: string | undefined;
895
+ why?: string | undefined;
896
+ supersedes_topic?: string | undefined;
897
+ }, {
898
+ type: "preference";
899
+ what: string;
900
+ entities: string[];
901
+ topic: string;
902
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
903
+ evidence: {
904
+ end: string;
905
+ start: string;
906
+ }[];
907
+ persistence_reason: string;
908
+ subject: string;
909
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
910
+ project?: string | undefined;
911
+ why?: string | undefined;
912
+ supersedes_topic?: string | undefined;
913
+ }>, z.ZodObject<{
914
+ source_kind: z.ZodEnum<["documentation", "experiment", "external_reference", "domain_fact", "observation"]>;
915
+ valid_at: z.ZodOptional<z.ZodString>;
916
+ invalid_at: z.ZodOptional<z.ZodString>;
917
+ topic: z.ZodString;
918
+ what: z.ZodString;
919
+ why: z.ZodOptional<z.ZodString>;
920
+ project: z.ZodOptional<z.ZodString>;
921
+ entities: z.ZodArray<z.ZodString, "many">;
922
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
923
+ supersedes_topic: z.ZodOptional<z.ZodString>;
924
+ evidence: z.ZodArray<z.ZodObject<{
925
+ start: z.ZodString;
926
+ end: z.ZodString;
927
+ }, "strip", z.ZodTypeAny, {
928
+ end: string;
929
+ start: string;
930
+ }, {
931
+ end: string;
932
+ start: string;
933
+ }>, "many">;
934
+ persistence_reason: z.ZodString;
935
+ type: z.ZodLiteral<"knowledge">;
936
+ }, "strip", z.ZodTypeAny, {
937
+ type: "knowledge";
938
+ what: string;
939
+ entities: string[];
940
+ topic: string;
941
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
942
+ evidence: {
943
+ end: string;
944
+ start: string;
945
+ }[];
946
+ persistence_reason: string;
947
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
948
+ project?: string | undefined;
949
+ why?: string | undefined;
950
+ supersedes_topic?: string | undefined;
951
+ valid_at?: string | undefined;
952
+ invalid_at?: string | undefined;
953
+ }, {
954
+ type: "knowledge";
955
+ what: string;
956
+ entities: string[];
957
+ topic: string;
958
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
959
+ evidence: {
960
+ end: string;
961
+ start: string;
962
+ }[];
963
+ persistence_reason: string;
964
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
965
+ project?: string | undefined;
966
+ why?: string | undefined;
967
+ supersedes_topic?: string | undefined;
968
+ valid_at?: string | undefined;
969
+ invalid_at?: string | undefined;
970
+ }>, z.ZodObject<{
971
+ subtype: z.ZodEnum<["insight", "pattern", "risk", "procedure"]>;
972
+ topic: z.ZodString;
973
+ what: z.ZodString;
974
+ why: z.ZodOptional<z.ZodString>;
975
+ project: z.ZodOptional<z.ZodString>;
976
+ entities: z.ZodArray<z.ZodString, "many">;
977
+ authority: z.ZodEnum<["user_confirmed", "assistant_claimed", "assistant_proposed"]>;
978
+ supersedes_topic: z.ZodOptional<z.ZodString>;
979
+ evidence: z.ZodArray<z.ZodObject<{
980
+ start: z.ZodString;
981
+ end: z.ZodString;
982
+ }, "strip", z.ZodTypeAny, {
983
+ end: string;
984
+ start: string;
985
+ }, {
986
+ end: string;
987
+ start: string;
988
+ }>, "many">;
989
+ persistence_reason: z.ZodString;
990
+ type: z.ZodLiteral<"discovery">;
991
+ }, "strip", z.ZodTypeAny, {
992
+ type: "discovery";
993
+ what: string;
994
+ entities: string[];
995
+ topic: string;
996
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
997
+ evidence: {
998
+ end: string;
999
+ start: string;
1000
+ }[];
1001
+ persistence_reason: string;
1002
+ subtype: "procedure" | "pattern" | "insight" | "risk";
1003
+ project?: string | undefined;
1004
+ why?: string | undefined;
1005
+ supersedes_topic?: string | undefined;
1006
+ }, {
1007
+ type: "discovery";
1008
+ what: string;
1009
+ entities: string[];
1010
+ topic: string;
1011
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1012
+ evidence: {
1013
+ end: string;
1014
+ start: string;
1015
+ }[];
1016
+ persistence_reason: string;
1017
+ subtype: "procedure" | "pattern" | "insight" | "risk";
1018
+ project?: string | undefined;
1019
+ why?: string | undefined;
1020
+ supersedes_topic?: string | undefined;
1021
+ }>]>, "many">;
1022
+ }, "strip", z.ZodTypeAny, {
1023
+ signals: ({
1024
+ type: "decision";
1025
+ what: string;
1026
+ entities: string[];
1027
+ topic: string;
1028
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1029
+ evidence: {
1030
+ end: string;
1031
+ start: string;
1032
+ }[];
1033
+ persistence_reason: string;
1034
+ project?: string | undefined;
1035
+ why?: string | undefined;
1036
+ supersedes_topic?: string | undefined;
1037
+ } | {
1038
+ type: "task";
1039
+ status: "open" | "in_progress" | "done" | "cancelled";
1040
+ what: string;
1041
+ entities: string[];
1042
+ topic: string;
1043
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1044
+ evidence: {
1045
+ end: string;
1046
+ start: string;
1047
+ }[];
1048
+ persistence_reason: string;
1049
+ project?: string | undefined;
1050
+ due_date?: string | undefined;
1051
+ why?: string | undefined;
1052
+ supersedes_topic?: string | undefined;
1053
+ owner?: string | undefined;
1054
+ } | {
1055
+ url: string;
1056
+ type: "reference";
1057
+ what: string;
1058
+ entities: string[];
1059
+ topic: string;
1060
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1061
+ evidence: {
1062
+ end: string;
1063
+ start: string;
1064
+ }[];
1065
+ persistence_reason: string;
1066
+ project?: string | undefined;
1067
+ trigger?: string | undefined;
1068
+ why?: string | undefined;
1069
+ supersedes_topic?: string | undefined;
1070
+ } | {
1071
+ type: "preference";
1072
+ what: string;
1073
+ entities: string[];
1074
+ topic: string;
1075
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1076
+ evidence: {
1077
+ end: string;
1078
+ start: string;
1079
+ }[];
1080
+ persistence_reason: string;
1081
+ subject: string;
1082
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
1083
+ project?: string | undefined;
1084
+ why?: string | undefined;
1085
+ supersedes_topic?: string | undefined;
1086
+ } | {
1087
+ type: "knowledge";
1088
+ what: string;
1089
+ entities: string[];
1090
+ topic: string;
1091
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1092
+ evidence: {
1093
+ end: string;
1094
+ start: string;
1095
+ }[];
1096
+ persistence_reason: string;
1097
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
1098
+ project?: string | undefined;
1099
+ why?: string | undefined;
1100
+ supersedes_topic?: string | undefined;
1101
+ valid_at?: string | undefined;
1102
+ invalid_at?: string | undefined;
1103
+ } | {
1104
+ type: "discovery";
1105
+ what: string;
1106
+ entities: string[];
1107
+ topic: string;
1108
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1109
+ evidence: {
1110
+ end: string;
1111
+ start: string;
1112
+ }[];
1113
+ persistence_reason: string;
1114
+ subtype: "procedure" | "pattern" | "insight" | "risk";
1115
+ project?: string | undefined;
1116
+ why?: string | undefined;
1117
+ supersedes_topic?: string | undefined;
1118
+ })[];
1119
+ }, {
1120
+ signals: ({
1121
+ type: "decision";
1122
+ what: string;
1123
+ entities: string[];
1124
+ topic: string;
1125
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1126
+ evidence: {
1127
+ end: string;
1128
+ start: string;
1129
+ }[];
1130
+ persistence_reason: string;
1131
+ project?: string | undefined;
1132
+ why?: string | undefined;
1133
+ supersedes_topic?: string | undefined;
1134
+ } | {
1135
+ type: "task";
1136
+ status: "open" | "in_progress" | "done" | "cancelled";
1137
+ what: string;
1138
+ entities: string[];
1139
+ topic: string;
1140
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1141
+ evidence: {
1142
+ end: string;
1143
+ start: string;
1144
+ }[];
1145
+ persistence_reason: string;
1146
+ project?: string | undefined;
1147
+ due_date?: string | undefined;
1148
+ why?: string | undefined;
1149
+ supersedes_topic?: string | undefined;
1150
+ owner?: string | undefined;
1151
+ } | {
1152
+ url: string;
1153
+ type: "reference";
1154
+ what: string;
1155
+ entities: string[];
1156
+ topic: string;
1157
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1158
+ evidence: {
1159
+ end: string;
1160
+ start: string;
1161
+ }[];
1162
+ persistence_reason: string;
1163
+ project?: string | undefined;
1164
+ trigger?: string | undefined;
1165
+ why?: string | undefined;
1166
+ supersedes_topic?: string | undefined;
1167
+ } | {
1168
+ type: "preference";
1169
+ what: string;
1170
+ entities: string[];
1171
+ topic: string;
1172
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1173
+ evidence: {
1174
+ end: string;
1175
+ start: string;
1176
+ }[];
1177
+ persistence_reason: string;
1178
+ subject: string;
1179
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
1180
+ project?: string | undefined;
1181
+ why?: string | undefined;
1182
+ supersedes_topic?: string | undefined;
1183
+ } | {
1184
+ type: "knowledge";
1185
+ what: string;
1186
+ entities: string[];
1187
+ topic: string;
1188
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1189
+ evidence: {
1190
+ end: string;
1191
+ start: string;
1192
+ }[];
1193
+ persistence_reason: string;
1194
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
1195
+ project?: string | undefined;
1196
+ why?: string | undefined;
1197
+ supersedes_topic?: string | undefined;
1198
+ valid_at?: string | undefined;
1199
+ invalid_at?: string | undefined;
1200
+ } | {
1201
+ type: "discovery";
1202
+ what: string;
1203
+ entities: string[];
1204
+ topic: string;
1205
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1206
+ evidence: {
1207
+ end: string;
1208
+ start: string;
1209
+ }[];
1210
+ persistence_reason: string;
1211
+ subtype: "procedure" | "pattern" | "insight" | "risk";
1212
+ project?: string | undefined;
1213
+ why?: string | undefined;
1214
+ supersedes_topic?: string | undefined;
1215
+ })[];
1216
+ }>, {
1217
+ signals: ({
1218
+ type: "decision";
1219
+ what: string;
1220
+ entities: string[];
1221
+ topic: string;
1222
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1223
+ evidence: {
1224
+ end: string;
1225
+ start: string;
1226
+ }[];
1227
+ persistence_reason: string;
1228
+ project?: string | undefined;
1229
+ why?: string | undefined;
1230
+ supersedes_topic?: string | undefined;
1231
+ } | {
1232
+ type: "task";
1233
+ status: "open" | "in_progress" | "done" | "cancelled";
1234
+ what: string;
1235
+ entities: string[];
1236
+ topic: string;
1237
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1238
+ evidence: {
1239
+ end: string;
1240
+ start: string;
1241
+ }[];
1242
+ persistence_reason: string;
1243
+ project?: string | undefined;
1244
+ due_date?: string | undefined;
1245
+ why?: string | undefined;
1246
+ supersedes_topic?: string | undefined;
1247
+ owner?: string | undefined;
1248
+ } | {
1249
+ url: string;
1250
+ type: "reference";
1251
+ what: string;
1252
+ entities: string[];
1253
+ topic: string;
1254
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1255
+ evidence: {
1256
+ end: string;
1257
+ start: string;
1258
+ }[];
1259
+ persistence_reason: string;
1260
+ project?: string | undefined;
1261
+ trigger?: string | undefined;
1262
+ why?: string | undefined;
1263
+ supersedes_topic?: string | undefined;
1264
+ } | {
1265
+ type: "preference";
1266
+ what: string;
1267
+ entities: string[];
1268
+ topic: string;
1269
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1270
+ evidence: {
1271
+ end: string;
1272
+ start: string;
1273
+ }[];
1274
+ persistence_reason: string;
1275
+ subject: string;
1276
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
1277
+ project?: string | undefined;
1278
+ why?: string | undefined;
1279
+ supersedes_topic?: string | undefined;
1280
+ } | {
1281
+ type: "knowledge";
1282
+ what: string;
1283
+ entities: string[];
1284
+ topic: string;
1285
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1286
+ evidence: {
1287
+ end: string;
1288
+ start: string;
1289
+ }[];
1290
+ persistence_reason: string;
1291
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
1292
+ project?: string | undefined;
1293
+ why?: string | undefined;
1294
+ supersedes_topic?: string | undefined;
1295
+ valid_at?: string | undefined;
1296
+ invalid_at?: string | undefined;
1297
+ } | {
1298
+ type: "discovery";
1299
+ what: string;
1300
+ entities: string[];
1301
+ topic: string;
1302
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1303
+ evidence: {
1304
+ end: string;
1305
+ start: string;
1306
+ }[];
1307
+ persistence_reason: string;
1308
+ subtype: "procedure" | "pattern" | "insight" | "risk";
1309
+ project?: string | undefined;
1310
+ why?: string | undefined;
1311
+ supersedes_topic?: string | undefined;
1312
+ })[];
1313
+ }, {
1314
+ signals: ({
1315
+ type: "decision";
1316
+ what: string;
1317
+ entities: string[];
1318
+ topic: string;
1319
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1320
+ evidence: {
1321
+ end: string;
1322
+ start: string;
1323
+ }[];
1324
+ persistence_reason: string;
1325
+ project?: string | undefined;
1326
+ why?: string | undefined;
1327
+ supersedes_topic?: string | undefined;
1328
+ } | {
1329
+ type: "task";
1330
+ status: "open" | "in_progress" | "done" | "cancelled";
1331
+ what: string;
1332
+ entities: string[];
1333
+ topic: string;
1334
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1335
+ evidence: {
1336
+ end: string;
1337
+ start: string;
1338
+ }[];
1339
+ persistence_reason: string;
1340
+ project?: string | undefined;
1341
+ due_date?: string | undefined;
1342
+ why?: string | undefined;
1343
+ supersedes_topic?: string | undefined;
1344
+ owner?: string | undefined;
1345
+ } | {
1346
+ url: string;
1347
+ type: "reference";
1348
+ what: string;
1349
+ entities: string[];
1350
+ topic: string;
1351
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1352
+ evidence: {
1353
+ end: string;
1354
+ start: string;
1355
+ }[];
1356
+ persistence_reason: string;
1357
+ project?: string | undefined;
1358
+ trigger?: string | undefined;
1359
+ why?: string | undefined;
1360
+ supersedes_topic?: string | undefined;
1361
+ } | {
1362
+ type: "preference";
1363
+ what: string;
1364
+ entities: string[];
1365
+ topic: string;
1366
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1367
+ evidence: {
1368
+ end: string;
1369
+ start: string;
1370
+ }[];
1371
+ persistence_reason: string;
1372
+ subject: string;
1373
+ category: "communication" | "tooling" | "workflow" | "other" | "coding_style" | "ui" | "personal";
1374
+ project?: string | undefined;
1375
+ why?: string | undefined;
1376
+ supersedes_topic?: string | undefined;
1377
+ } | {
1378
+ type: "knowledge";
1379
+ what: string;
1380
+ entities: string[];
1381
+ topic: string;
1382
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1383
+ evidence: {
1384
+ end: string;
1385
+ start: string;
1386
+ }[];
1387
+ persistence_reason: string;
1388
+ source_kind: "documentation" | "experiment" | "external_reference" | "domain_fact" | "observation";
1389
+ project?: string | undefined;
1390
+ why?: string | undefined;
1391
+ supersedes_topic?: string | undefined;
1392
+ valid_at?: string | undefined;
1393
+ invalid_at?: string | undefined;
1394
+ } | {
1395
+ type: "discovery";
1396
+ what: string;
1397
+ entities: string[];
1398
+ topic: string;
1399
+ authority: "user_confirmed" | "assistant_claimed" | "assistant_proposed";
1400
+ evidence: {
1401
+ end: string;
1402
+ start: string;
1403
+ }[];
1404
+ persistence_reason: string;
1405
+ subtype: "procedure" | "pattern" | "insight" | "risk";
1406
+ project?: string | undefined;
1407
+ why?: string | undefined;
1408
+ supersedes_topic?: string | undefined;
1409
+ })[];
1410
+ }>;
1411
+ export type DistilledPayload = z.infer<typeof DistilledPayloadSchema>;
1412
+ /**
1413
+ * Deterministic topic slug used both for payload-internal dedup and downstream
1414
+ * ID derivation (spec §6.1 normalized_topic). Lowercase, collapse whitespace,
1415
+ * strip punctuation, hyphenate.
1416
+ */
1417
+ export declare function slugifyTopic(topic: string): string;
1418
+ export type ParsePayloadResult = {
1419
+ ok: true;
1420
+ payload: DistilledPayload;
1421
+ } | {
1422
+ ok: false;
1423
+ error: z.ZodError;
1424
+ };
1425
+ /** Safe-parse wrapper returning a discriminated result rather than throwing. */
1426
+ export declare function parsePayload(input: unknown): ParsePayloadResult;
1427
+ //# sourceMappingURL=contract.d.ts.map