@fenglimg/fabric-shared 1.0.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.
@@ -0,0 +1,2030 @@
1
+ import { HumanLockEntry, AgentsMeta, LedgerEntry } from './types/index.js';
2
+ export { AgentsMetaNode, AiLedgerEntry, ClientPaths, FabricConfig, HumanLedgerEntry } from './types/index.js';
3
+ export { Locale, Messages, PROTECTED_TOKENS, ProtectedToken, TranslationKey, Translator, createTranslator, defaultMessages, detectNodeLocale, enMessages, normalizeLocale, zhCNMessages } from './i18n/index.js';
4
+ import { z } from 'zod';
5
+
6
+ declare const agentsMetaNodeSchema: z.ZodObject<{
7
+ file: z.ZodString;
8
+ scope_glob: z.ZodString;
9
+ deps: z.ZodArray<z.ZodString, "many">;
10
+ priority: z.ZodEnum<["high", "medium", "low"]>;
11
+ hash: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ file: string;
14
+ priority: "high" | "medium" | "low";
15
+ hash: string;
16
+ scope_glob: string;
17
+ deps: string[];
18
+ }, {
19
+ file: string;
20
+ priority: "high" | "medium" | "low";
21
+ hash: string;
22
+ scope_glob: string;
23
+ deps: string[];
24
+ }>;
25
+ declare const agentsMetaSchema: z.ZodObject<{
26
+ revision: z.ZodString;
27
+ nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
28
+ file: z.ZodString;
29
+ scope_glob: z.ZodString;
30
+ deps: z.ZodArray<z.ZodString, "many">;
31
+ priority: z.ZodEnum<["high", "medium", "low"]>;
32
+ hash: z.ZodString;
33
+ }, "strip", z.ZodTypeAny, {
34
+ file: string;
35
+ priority: "high" | "medium" | "low";
36
+ hash: string;
37
+ scope_glob: string;
38
+ deps: string[];
39
+ }, {
40
+ file: string;
41
+ priority: "high" | "medium" | "low";
42
+ hash: string;
43
+ scope_glob: string;
44
+ deps: string[];
45
+ }>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ revision: string;
48
+ nodes: Record<string, {
49
+ file: string;
50
+ priority: "high" | "medium" | "low";
51
+ hash: string;
52
+ scope_glob: string;
53
+ deps: string[];
54
+ }>;
55
+ }, {
56
+ revision: string;
57
+ nodes: Record<string, {
58
+ file: string;
59
+ priority: "high" | "medium" | "low";
60
+ hash: string;
61
+ scope_glob: string;
62
+ deps: string[];
63
+ }>;
64
+ }>;
65
+
66
+ declare const ledgerSourceSchema: z.ZodEnum<["ai", "human"]>;
67
+ declare const ledgerQuerySchema: z.ZodObject<{
68
+ source: z.ZodOptional<z.ZodEnum<["ai", "human"]>>;
69
+ since: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, unknown>>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ source?: "ai" | "human" | undefined;
72
+ since?: number | undefined;
73
+ }, {
74
+ source?: "ai" | "human" | undefined;
75
+ since?: unknown;
76
+ }>;
77
+ declare const historyStateQuerySchema: z.ZodEffects<z.ZodObject<{
78
+ ledger_id: z.ZodOptional<z.ZodString>;
79
+ ts: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, unknown>>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ ledger_id?: string | undefined;
82
+ ts?: number | undefined;
83
+ }, {
84
+ ledger_id?: string | undefined;
85
+ ts?: unknown;
86
+ }>, {
87
+ ledger_id?: string | undefined;
88
+ ts?: number | undefined;
89
+ }, {
90
+ ledger_id?: string | undefined;
91
+ ts?: unknown;
92
+ }>;
93
+ declare const humanLockApproveRequestSchema: z.ZodObject<{
94
+ file: z.ZodString;
95
+ start_line: z.ZodNumber;
96
+ end_line: z.ZodNumber;
97
+ new_hash: z.ZodString;
98
+ }, "strip", z.ZodTypeAny, {
99
+ file: string;
100
+ start_line: number;
101
+ end_line: number;
102
+ new_hash: string;
103
+ }, {
104
+ file: string;
105
+ start_line: number;
106
+ end_line: number;
107
+ new_hash: string;
108
+ }>;
109
+ declare const humanLockFileParamsSchema: z.ZodObject<{
110
+ file: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ file: string;
113
+ }, {
114
+ file: string;
115
+ }>;
116
+ declare const annotateIntentRequestSchema: z.ZodObject<{
117
+ ledger_entry_id: z.ZodString;
118
+ annotation: z.ZodString;
119
+ }, "strip", z.ZodTypeAny, {
120
+ ledger_entry_id: string;
121
+ annotation: string;
122
+ }, {
123
+ ledger_entry_id: string;
124
+ annotation: string;
125
+ }>;
126
+
127
+ declare const aiLedgerEntrySchema: z.ZodObject<{
128
+ source: z.ZodLiteral<"ai">;
129
+ commit_sha: z.ZodOptional<z.ZodString>;
130
+ id: z.ZodOptional<z.ZodString>;
131
+ ts: z.ZodNumber;
132
+ intent: z.ZodString;
133
+ affected_paths: z.ZodArray<z.ZodString, "many">;
134
+ }, "strip", z.ZodTypeAny, {
135
+ source: "ai";
136
+ ts: number;
137
+ intent: string;
138
+ affected_paths: string[];
139
+ commit_sha?: string | undefined;
140
+ id?: string | undefined;
141
+ }, {
142
+ source: "ai";
143
+ ts: number;
144
+ intent: string;
145
+ affected_paths: string[];
146
+ commit_sha?: string | undefined;
147
+ id?: string | undefined;
148
+ }>;
149
+ declare const humanLedgerEntrySchema: z.ZodObject<{
150
+ source: z.ZodLiteral<"human">;
151
+ parent_sha: z.ZodString;
152
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
153
+ diff_stat: z.ZodString;
154
+ annotation: z.ZodOptional<z.ZodString>;
155
+ id: z.ZodOptional<z.ZodString>;
156
+ ts: z.ZodNumber;
157
+ intent: z.ZodString;
158
+ affected_paths: z.ZodArray<z.ZodString, "many">;
159
+ }, "strip", z.ZodTypeAny, {
160
+ source: "human";
161
+ ts: number;
162
+ intent: string;
163
+ affected_paths: string[];
164
+ parent_sha: string;
165
+ diff_stat: string;
166
+ annotation?: string | undefined;
167
+ id?: string | undefined;
168
+ parent_ledger_entry_id?: string | undefined;
169
+ }, {
170
+ source: "human";
171
+ ts: number;
172
+ intent: string;
173
+ affected_paths: string[];
174
+ parent_sha: string;
175
+ diff_stat: string;
176
+ annotation?: string | undefined;
177
+ id?: string | undefined;
178
+ parent_ledger_entry_id?: string | undefined;
179
+ }>;
180
+ declare const ledgerEntrySchema: z.ZodEffects<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
181
+ source: z.ZodLiteral<"ai">;
182
+ commit_sha: z.ZodOptional<z.ZodString>;
183
+ id: z.ZodOptional<z.ZodString>;
184
+ ts: z.ZodNumber;
185
+ intent: z.ZodString;
186
+ affected_paths: z.ZodArray<z.ZodString, "many">;
187
+ }, "strip", z.ZodTypeAny, {
188
+ source: "ai";
189
+ ts: number;
190
+ intent: string;
191
+ affected_paths: string[];
192
+ commit_sha?: string | undefined;
193
+ id?: string | undefined;
194
+ }, {
195
+ source: "ai";
196
+ ts: number;
197
+ intent: string;
198
+ affected_paths: string[];
199
+ commit_sha?: string | undefined;
200
+ id?: string | undefined;
201
+ }>, z.ZodObject<{
202
+ source: z.ZodLiteral<"human">;
203
+ parent_sha: z.ZodString;
204
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
205
+ diff_stat: z.ZodString;
206
+ annotation: z.ZodOptional<z.ZodString>;
207
+ id: z.ZodOptional<z.ZodString>;
208
+ ts: z.ZodNumber;
209
+ intent: z.ZodString;
210
+ affected_paths: z.ZodArray<z.ZodString, "many">;
211
+ }, "strip", z.ZodTypeAny, {
212
+ source: "human";
213
+ ts: number;
214
+ intent: string;
215
+ affected_paths: string[];
216
+ parent_sha: string;
217
+ diff_stat: string;
218
+ annotation?: string | undefined;
219
+ id?: string | undefined;
220
+ parent_ledger_entry_id?: string | undefined;
221
+ }, {
222
+ source: "human";
223
+ ts: number;
224
+ intent: string;
225
+ affected_paths: string[];
226
+ parent_sha: string;
227
+ diff_stat: string;
228
+ annotation?: string | undefined;
229
+ id?: string | undefined;
230
+ parent_ledger_entry_id?: string | undefined;
231
+ }>]>, {
232
+ source: "ai";
233
+ ts: number;
234
+ intent: string;
235
+ affected_paths: string[];
236
+ commit_sha?: string | undefined;
237
+ id?: string | undefined;
238
+ } | {
239
+ source: "human";
240
+ ts: number;
241
+ intent: string;
242
+ affected_paths: string[];
243
+ parent_sha: string;
244
+ diff_stat: string;
245
+ annotation?: string | undefined;
246
+ id?: string | undefined;
247
+ parent_ledger_entry_id?: string | undefined;
248
+ }, unknown>;
249
+
250
+ interface HumanLockFile {
251
+ locked?: HumanLockEntry[];
252
+ }
253
+ declare const humanLockEntrySchema: z.ZodObject<{
254
+ file: z.ZodString;
255
+ start_line: z.ZodNumber;
256
+ end_line: z.ZodNumber;
257
+ hash: z.ZodString;
258
+ }, "strip", z.ZodTypeAny, {
259
+ file: string;
260
+ hash: string;
261
+ start_line: number;
262
+ end_line: number;
263
+ }, {
264
+ file: string;
265
+ hash: string;
266
+ start_line: number;
267
+ end_line: number;
268
+ }>;
269
+ declare const humanLockFileSchema: z.ZodObject<{
270
+ locked: z.ZodOptional<z.ZodArray<z.ZodObject<{
271
+ file: z.ZodString;
272
+ start_line: z.ZodNumber;
273
+ end_line: z.ZodNumber;
274
+ hash: z.ZodString;
275
+ }, "strip", z.ZodTypeAny, {
276
+ file: string;
277
+ hash: string;
278
+ start_line: number;
279
+ end_line: number;
280
+ }, {
281
+ file: string;
282
+ hash: string;
283
+ start_line: number;
284
+ end_line: number;
285
+ }>, "many">>;
286
+ }, "strip", z.ZodTypeAny, {
287
+ locked?: {
288
+ file: string;
289
+ hash: string;
290
+ start_line: number;
291
+ end_line: number;
292
+ }[] | undefined;
293
+ }, {
294
+ locked?: {
295
+ file: string;
296
+ hash: string;
297
+ start_line: number;
298
+ end_line: number;
299
+ }[] | undefined;
300
+ }>;
301
+
302
+ declare const clientPathsSchema: z.ZodObject<{
303
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
304
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
305
+ cursor: z.ZodOptional<z.ZodString>;
306
+ windsurf: z.ZodOptional<z.ZodString>;
307
+ rooCode: z.ZodOptional<z.ZodString>;
308
+ geminiCLI: z.ZodOptional<z.ZodString>;
309
+ codexCLI: z.ZodOptional<z.ZodString>;
310
+ }, "strip", z.ZodTypeAny, {
311
+ claudeCodeCLI?: string | undefined;
312
+ claudeCodeDesktop?: string | undefined;
313
+ cursor?: string | undefined;
314
+ windsurf?: string | undefined;
315
+ rooCode?: string | undefined;
316
+ geminiCLI?: string | undefined;
317
+ codexCLI?: string | undefined;
318
+ }, {
319
+ claudeCodeCLI?: string | undefined;
320
+ claudeCodeDesktop?: string | undefined;
321
+ cursor?: string | undefined;
322
+ windsurf?: string | undefined;
323
+ rooCode?: string | undefined;
324
+ geminiCLI?: string | undefined;
325
+ codexCLI?: string | undefined;
326
+ }>;
327
+ declare const fabricConfigSchema: z.ZodObject<{
328
+ clientPaths: z.ZodOptional<z.ZodObject<{
329
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
330
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
331
+ cursor: z.ZodOptional<z.ZodString>;
332
+ windsurf: z.ZodOptional<z.ZodString>;
333
+ rooCode: z.ZodOptional<z.ZodString>;
334
+ geminiCLI: z.ZodOptional<z.ZodString>;
335
+ codexCLI: z.ZodOptional<z.ZodString>;
336
+ }, "strip", z.ZodTypeAny, {
337
+ claudeCodeCLI?: string | undefined;
338
+ claudeCodeDesktop?: string | undefined;
339
+ cursor?: string | undefined;
340
+ windsurf?: string | undefined;
341
+ rooCode?: string | undefined;
342
+ geminiCLI?: string | undefined;
343
+ codexCLI?: string | undefined;
344
+ }, {
345
+ claudeCodeCLI?: string | undefined;
346
+ claudeCodeDesktop?: string | undefined;
347
+ cursor?: string | undefined;
348
+ windsurf?: string | undefined;
349
+ rooCode?: string | undefined;
350
+ geminiCLI?: string | undefined;
351
+ codexCLI?: string | undefined;
352
+ }>>;
353
+ externalFixturePath: z.ZodOptional<z.ZodString>;
354
+ scanIgnores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
355
+ }, "strip", z.ZodTypeAny, {
356
+ clientPaths?: {
357
+ claudeCodeCLI?: string | undefined;
358
+ claudeCodeDesktop?: string | undefined;
359
+ cursor?: string | undefined;
360
+ windsurf?: string | undefined;
361
+ rooCode?: string | undefined;
362
+ geminiCLI?: string | undefined;
363
+ codexCLI?: string | undefined;
364
+ } | undefined;
365
+ externalFixturePath?: string | undefined;
366
+ scanIgnores?: string[] | undefined;
367
+ }, {
368
+ clientPaths?: {
369
+ claudeCodeCLI?: string | undefined;
370
+ claudeCodeDesktop?: string | undefined;
371
+ cursor?: string | undefined;
372
+ windsurf?: string | undefined;
373
+ rooCode?: string | undefined;
374
+ geminiCLI?: string | undefined;
375
+ codexCLI?: string | undefined;
376
+ } | undefined;
377
+ externalFixturePath?: string | undefined;
378
+ scanIgnores?: string[] | undefined;
379
+ }>;
380
+
381
+ interface ForensicCodeSample {
382
+ path: string;
383
+ lines: string;
384
+ snippet: string;
385
+ pattern_hint: string;
386
+ }
387
+ interface ForensicTopology {
388
+ total_files: number;
389
+ by_ext: Record<string, number>;
390
+ key_dirs: string[];
391
+ max_depth: number;
392
+ }
393
+ interface ForensicEntryPoint {
394
+ path: string;
395
+ reason: string;
396
+ size_bytes?: number;
397
+ }
398
+ interface ForensicFramework {
399
+ kind: string;
400
+ version: string;
401
+ subkind: string;
402
+ evidence: string[];
403
+ }
404
+ interface ForensicReadme {
405
+ quality: "missing" | "stub" | "ok";
406
+ line_count: number;
407
+ has_contributing: boolean;
408
+ }
409
+ interface ForensicReport {
410
+ version: string;
411
+ generated_at: string;
412
+ generated_by: string;
413
+ target: string;
414
+ project_name: string;
415
+ framework: ForensicFramework;
416
+ topology: ForensicTopology;
417
+ entry_points: ForensicEntryPoint[];
418
+ code_samples: ForensicCodeSample[];
419
+ readme: ForensicReadme;
420
+ recommendations_for_skill: string[];
421
+ }
422
+ declare const forensicCodeSampleSchema: z.ZodObject<{
423
+ path: z.ZodString;
424
+ lines: z.ZodString;
425
+ snippet: z.ZodString;
426
+ pattern_hint: z.ZodString;
427
+ }, "strip", z.ZodTypeAny, {
428
+ path: string;
429
+ lines: string;
430
+ snippet: string;
431
+ pattern_hint: string;
432
+ }, {
433
+ path: string;
434
+ lines: string;
435
+ snippet: string;
436
+ pattern_hint: string;
437
+ }>;
438
+ declare const forensicTopologySchema: z.ZodObject<{
439
+ total_files: z.ZodNumber;
440
+ by_ext: z.ZodRecord<z.ZodString, z.ZodNumber>;
441
+ key_dirs: z.ZodArray<z.ZodString, "many">;
442
+ max_depth: z.ZodNumber;
443
+ }, "strip", z.ZodTypeAny, {
444
+ total_files: number;
445
+ by_ext: Record<string, number>;
446
+ key_dirs: string[];
447
+ max_depth: number;
448
+ }, {
449
+ total_files: number;
450
+ by_ext: Record<string, number>;
451
+ key_dirs: string[];
452
+ max_depth: number;
453
+ }>;
454
+ declare const forensicEntryPointSchema: z.ZodObject<{
455
+ path: z.ZodString;
456
+ reason: z.ZodString;
457
+ size_bytes: z.ZodOptional<z.ZodNumber>;
458
+ }, "strip", z.ZodTypeAny, {
459
+ path: string;
460
+ reason: string;
461
+ size_bytes?: number | undefined;
462
+ }, {
463
+ path: string;
464
+ reason: string;
465
+ size_bytes?: number | undefined;
466
+ }>;
467
+ declare const forensicFrameworkSchema: z.ZodObject<{
468
+ kind: z.ZodString;
469
+ version: z.ZodString;
470
+ subkind: z.ZodString;
471
+ evidence: z.ZodArray<z.ZodString, "many">;
472
+ }, "strip", z.ZodTypeAny, {
473
+ kind: string;
474
+ version: string;
475
+ subkind: string;
476
+ evidence: string[];
477
+ }, {
478
+ kind: string;
479
+ version: string;
480
+ subkind: string;
481
+ evidence: string[];
482
+ }>;
483
+ declare const forensicReadmeSchema: z.ZodObject<{
484
+ quality: z.ZodEnum<["missing", "stub", "ok"]>;
485
+ line_count: z.ZodNumber;
486
+ has_contributing: z.ZodBoolean;
487
+ }, "strip", z.ZodTypeAny, {
488
+ quality: "missing" | "ok" | "stub";
489
+ line_count: number;
490
+ has_contributing: boolean;
491
+ }, {
492
+ quality: "missing" | "ok" | "stub";
493
+ line_count: number;
494
+ has_contributing: boolean;
495
+ }>;
496
+ declare const forensicReportSchema: z.ZodObject<{
497
+ version: z.ZodString;
498
+ generated_at: z.ZodString;
499
+ generated_by: z.ZodString;
500
+ target: z.ZodString;
501
+ project_name: z.ZodString;
502
+ framework: z.ZodObject<{
503
+ kind: z.ZodString;
504
+ version: z.ZodString;
505
+ subkind: z.ZodString;
506
+ evidence: z.ZodArray<z.ZodString, "many">;
507
+ }, "strip", z.ZodTypeAny, {
508
+ kind: string;
509
+ version: string;
510
+ subkind: string;
511
+ evidence: string[];
512
+ }, {
513
+ kind: string;
514
+ version: string;
515
+ subkind: string;
516
+ evidence: string[];
517
+ }>;
518
+ topology: z.ZodObject<{
519
+ total_files: z.ZodNumber;
520
+ by_ext: z.ZodRecord<z.ZodString, z.ZodNumber>;
521
+ key_dirs: z.ZodArray<z.ZodString, "many">;
522
+ max_depth: z.ZodNumber;
523
+ }, "strip", z.ZodTypeAny, {
524
+ total_files: number;
525
+ by_ext: Record<string, number>;
526
+ key_dirs: string[];
527
+ max_depth: number;
528
+ }, {
529
+ total_files: number;
530
+ by_ext: Record<string, number>;
531
+ key_dirs: string[];
532
+ max_depth: number;
533
+ }>;
534
+ entry_points: z.ZodArray<z.ZodObject<{
535
+ path: z.ZodString;
536
+ reason: z.ZodString;
537
+ size_bytes: z.ZodOptional<z.ZodNumber>;
538
+ }, "strip", z.ZodTypeAny, {
539
+ path: string;
540
+ reason: string;
541
+ size_bytes?: number | undefined;
542
+ }, {
543
+ path: string;
544
+ reason: string;
545
+ size_bytes?: number | undefined;
546
+ }>, "many">;
547
+ code_samples: z.ZodArray<z.ZodObject<{
548
+ path: z.ZodString;
549
+ lines: z.ZodString;
550
+ snippet: z.ZodString;
551
+ pattern_hint: z.ZodString;
552
+ }, "strip", z.ZodTypeAny, {
553
+ path: string;
554
+ lines: string;
555
+ snippet: string;
556
+ pattern_hint: string;
557
+ }, {
558
+ path: string;
559
+ lines: string;
560
+ snippet: string;
561
+ pattern_hint: string;
562
+ }>, "many">;
563
+ readme: z.ZodObject<{
564
+ quality: z.ZodEnum<["missing", "stub", "ok"]>;
565
+ line_count: z.ZodNumber;
566
+ has_contributing: z.ZodBoolean;
567
+ }, "strip", z.ZodTypeAny, {
568
+ quality: "missing" | "ok" | "stub";
569
+ line_count: number;
570
+ has_contributing: boolean;
571
+ }, {
572
+ quality: "missing" | "ok" | "stub";
573
+ line_count: number;
574
+ has_contributing: boolean;
575
+ }>;
576
+ recommendations_for_skill: z.ZodArray<z.ZodString, "many">;
577
+ }, "strip", z.ZodTypeAny, {
578
+ version: string;
579
+ generated_at: string;
580
+ generated_by: string;
581
+ target: string;
582
+ project_name: string;
583
+ framework: {
584
+ kind: string;
585
+ version: string;
586
+ subkind: string;
587
+ evidence: string[];
588
+ };
589
+ topology: {
590
+ total_files: number;
591
+ by_ext: Record<string, number>;
592
+ key_dirs: string[];
593
+ max_depth: number;
594
+ };
595
+ entry_points: {
596
+ path: string;
597
+ reason: string;
598
+ size_bytes?: number | undefined;
599
+ }[];
600
+ code_samples: {
601
+ path: string;
602
+ lines: string;
603
+ snippet: string;
604
+ pattern_hint: string;
605
+ }[];
606
+ readme: {
607
+ quality: "missing" | "ok" | "stub";
608
+ line_count: number;
609
+ has_contributing: boolean;
610
+ };
611
+ recommendations_for_skill: string[];
612
+ }, {
613
+ version: string;
614
+ generated_at: string;
615
+ generated_by: string;
616
+ target: string;
617
+ project_name: string;
618
+ framework: {
619
+ kind: string;
620
+ version: string;
621
+ subkind: string;
622
+ evidence: string[];
623
+ };
624
+ topology: {
625
+ total_files: number;
626
+ by_ext: Record<string, number>;
627
+ key_dirs: string[];
628
+ max_depth: number;
629
+ };
630
+ entry_points: {
631
+ path: string;
632
+ reason: string;
633
+ size_bytes?: number | undefined;
634
+ }[];
635
+ code_samples: {
636
+ path: string;
637
+ lines: string;
638
+ snippet: string;
639
+ pattern_hint: string;
640
+ }[];
641
+ readme: {
642
+ quality: "missing" | "ok" | "stub";
643
+ line_count: number;
644
+ has_contributing: boolean;
645
+ };
646
+ recommendations_for_skill: string[];
647
+ }>;
648
+
649
+ interface InitContextFramework {
650
+ kind: string;
651
+ version: string;
652
+ subkind: string;
653
+ }
654
+ interface InitContextInvariant {
655
+ type: "ban" | "require" | "protect";
656
+ rule: string;
657
+ rationale?: string;
658
+ }
659
+ interface InitContextDomainGroup {
660
+ name: string;
661
+ paths: string[];
662
+ summary?: string;
663
+ }
664
+ interface InitContextInterviewTrailEntry {
665
+ phase: string;
666
+ question: string;
667
+ answer: string;
668
+ }
669
+ interface InitContext {
670
+ framework: InitContextFramework;
671
+ architecture_patterns: string[];
672
+ invariants: InitContextInvariant[];
673
+ domain_groups: InitContextDomainGroup[];
674
+ interview_trail: InitContextInterviewTrailEntry[];
675
+ forensic_ref: string;
676
+ }
677
+ declare const initContextFrameworkSchema: z.ZodObject<{
678
+ kind: z.ZodString;
679
+ version: z.ZodString;
680
+ subkind: z.ZodString;
681
+ }, "strip", z.ZodTypeAny, {
682
+ kind: string;
683
+ version: string;
684
+ subkind: string;
685
+ }, {
686
+ kind: string;
687
+ version: string;
688
+ subkind: string;
689
+ }>;
690
+ declare const initContextInvariantSchema: z.ZodObject<{
691
+ type: z.ZodEnum<["ban", "require", "protect"]>;
692
+ rule: z.ZodString;
693
+ rationale: z.ZodOptional<z.ZodString>;
694
+ }, "strip", z.ZodTypeAny, {
695
+ type: "ban" | "require" | "protect";
696
+ rule: string;
697
+ rationale?: string | undefined;
698
+ }, {
699
+ type: "ban" | "require" | "protect";
700
+ rule: string;
701
+ rationale?: string | undefined;
702
+ }>;
703
+ declare const initContextDomainGroupSchema: z.ZodObject<{
704
+ name: z.ZodString;
705
+ paths: z.ZodArray<z.ZodString, "many">;
706
+ summary: z.ZodOptional<z.ZodString>;
707
+ }, "strip", z.ZodTypeAny, {
708
+ paths: string[];
709
+ name: string;
710
+ summary?: string | undefined;
711
+ }, {
712
+ paths: string[];
713
+ name: string;
714
+ summary?: string | undefined;
715
+ }>;
716
+ declare const initContextInterviewTrailEntrySchema: z.ZodObject<{
717
+ phase: z.ZodString;
718
+ question: z.ZodString;
719
+ answer: z.ZodString;
720
+ }, "strip", z.ZodTypeAny, {
721
+ phase: string;
722
+ question: string;
723
+ answer: string;
724
+ }, {
725
+ phase: string;
726
+ question: string;
727
+ answer: string;
728
+ }>;
729
+ declare const initContextSchema: z.ZodObject<{
730
+ framework: z.ZodObject<{
731
+ kind: z.ZodString;
732
+ version: z.ZodString;
733
+ subkind: z.ZodString;
734
+ }, "strip", z.ZodTypeAny, {
735
+ kind: string;
736
+ version: string;
737
+ subkind: string;
738
+ }, {
739
+ kind: string;
740
+ version: string;
741
+ subkind: string;
742
+ }>;
743
+ architecture_patterns: z.ZodArray<z.ZodString, "many">;
744
+ invariants: z.ZodArray<z.ZodObject<{
745
+ type: z.ZodEnum<["ban", "require", "protect"]>;
746
+ rule: z.ZodString;
747
+ rationale: z.ZodOptional<z.ZodString>;
748
+ }, "strip", z.ZodTypeAny, {
749
+ type: "ban" | "require" | "protect";
750
+ rule: string;
751
+ rationale?: string | undefined;
752
+ }, {
753
+ type: "ban" | "require" | "protect";
754
+ rule: string;
755
+ rationale?: string | undefined;
756
+ }>, "many">;
757
+ domain_groups: z.ZodArray<z.ZodObject<{
758
+ name: z.ZodString;
759
+ paths: z.ZodArray<z.ZodString, "many">;
760
+ summary: z.ZodOptional<z.ZodString>;
761
+ }, "strip", z.ZodTypeAny, {
762
+ paths: string[];
763
+ name: string;
764
+ summary?: string | undefined;
765
+ }, {
766
+ paths: string[];
767
+ name: string;
768
+ summary?: string | undefined;
769
+ }>, "many">;
770
+ interview_trail: z.ZodArray<z.ZodObject<{
771
+ phase: z.ZodString;
772
+ question: z.ZodString;
773
+ answer: z.ZodString;
774
+ }, "strip", z.ZodTypeAny, {
775
+ phase: string;
776
+ question: string;
777
+ answer: string;
778
+ }, {
779
+ phase: string;
780
+ question: string;
781
+ answer: string;
782
+ }>, "many">;
783
+ forensic_ref: z.ZodString;
784
+ }, "strip", z.ZodTypeAny, {
785
+ framework: {
786
+ kind: string;
787
+ version: string;
788
+ subkind: string;
789
+ };
790
+ architecture_patterns: string[];
791
+ invariants: {
792
+ type: "ban" | "require" | "protect";
793
+ rule: string;
794
+ rationale?: string | undefined;
795
+ }[];
796
+ domain_groups: {
797
+ paths: string[];
798
+ name: string;
799
+ summary?: string | undefined;
800
+ }[];
801
+ interview_trail: {
802
+ phase: string;
803
+ question: string;
804
+ answer: string;
805
+ }[];
806
+ forensic_ref: string;
807
+ }, {
808
+ framework: {
809
+ kind: string;
810
+ version: string;
811
+ subkind: string;
812
+ };
813
+ architecture_patterns: string[];
814
+ invariants: {
815
+ type: "ban" | "require" | "protect";
816
+ rule: string;
817
+ rationale?: string | undefined;
818
+ }[];
819
+ domain_groups: {
820
+ paths: string[];
821
+ name: string;
822
+ summary?: string | undefined;
823
+ }[];
824
+ interview_trail: {
825
+ phase: string;
826
+ question: string;
827
+ answer: string;
828
+ }[];
829
+ forensic_ref: string;
830
+ }>;
831
+
832
+ interface MetaUpdatedEvent {
833
+ type: "meta:updated";
834
+ payload: AgentsMeta;
835
+ }
836
+ interface LockDriftEvent {
837
+ type: "lock:drift";
838
+ payload: {
839
+ locked: HumanLockEntry[];
840
+ drifted: HumanLockEntry[];
841
+ };
842
+ }
843
+ interface LockApprovedEvent {
844
+ type: "lock:approved";
845
+ payload: {
846
+ locked: HumanLockEntry[];
847
+ approved: HumanLockEntry[];
848
+ };
849
+ }
850
+ interface LedgerAppendedEvent {
851
+ type: "ledger:appended";
852
+ payload: LedgerEntry;
853
+ }
854
+ interface DriftDetectedEvent {
855
+ type: "drift:detected";
856
+ payload: ForensicReport;
857
+ }
858
+ type FabricEvent = MetaUpdatedEvent | LockDriftEvent | LockApprovedEvent | LedgerAppendedEvent | DriftDetectedEvent;
859
+ declare const metaUpdatedEventSchema: z.ZodObject<{
860
+ type: z.ZodLiteral<"meta:updated">;
861
+ payload: z.ZodObject<{
862
+ revision: z.ZodString;
863
+ nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
864
+ file: z.ZodString;
865
+ scope_glob: z.ZodString;
866
+ deps: z.ZodArray<z.ZodString, "many">;
867
+ priority: z.ZodEnum<["high", "medium", "low"]>;
868
+ hash: z.ZodString;
869
+ }, "strip", z.ZodTypeAny, {
870
+ file: string;
871
+ priority: "high" | "medium" | "low";
872
+ hash: string;
873
+ scope_glob: string;
874
+ deps: string[];
875
+ }, {
876
+ file: string;
877
+ priority: "high" | "medium" | "low";
878
+ hash: string;
879
+ scope_glob: string;
880
+ deps: string[];
881
+ }>>;
882
+ }, "strip", z.ZodTypeAny, {
883
+ revision: string;
884
+ nodes: Record<string, {
885
+ file: string;
886
+ priority: "high" | "medium" | "low";
887
+ hash: string;
888
+ scope_glob: string;
889
+ deps: string[];
890
+ }>;
891
+ }, {
892
+ revision: string;
893
+ nodes: Record<string, {
894
+ file: string;
895
+ priority: "high" | "medium" | "low";
896
+ hash: string;
897
+ scope_glob: string;
898
+ deps: string[];
899
+ }>;
900
+ }>;
901
+ }, "strip", z.ZodTypeAny, {
902
+ type: "meta:updated";
903
+ payload: {
904
+ revision: string;
905
+ nodes: Record<string, {
906
+ file: string;
907
+ priority: "high" | "medium" | "low";
908
+ hash: string;
909
+ scope_glob: string;
910
+ deps: string[];
911
+ }>;
912
+ };
913
+ }, {
914
+ type: "meta:updated";
915
+ payload: {
916
+ revision: string;
917
+ nodes: Record<string, {
918
+ file: string;
919
+ priority: "high" | "medium" | "low";
920
+ hash: string;
921
+ scope_glob: string;
922
+ deps: string[];
923
+ }>;
924
+ };
925
+ }>;
926
+ declare const lockDriftEventSchema: z.ZodObject<{
927
+ type: z.ZodLiteral<"lock:drift">;
928
+ payload: z.ZodObject<{
929
+ locked: z.ZodArray<z.ZodObject<{
930
+ file: z.ZodString;
931
+ start_line: z.ZodNumber;
932
+ end_line: z.ZodNumber;
933
+ hash: z.ZodString;
934
+ }, "strip", z.ZodTypeAny, {
935
+ file: string;
936
+ hash: string;
937
+ start_line: number;
938
+ end_line: number;
939
+ }, {
940
+ file: string;
941
+ hash: string;
942
+ start_line: number;
943
+ end_line: number;
944
+ }>, "many">;
945
+ drifted: z.ZodArray<z.ZodObject<{
946
+ file: z.ZodString;
947
+ start_line: z.ZodNumber;
948
+ end_line: z.ZodNumber;
949
+ hash: z.ZodString;
950
+ }, "strip", z.ZodTypeAny, {
951
+ file: string;
952
+ hash: string;
953
+ start_line: number;
954
+ end_line: number;
955
+ }, {
956
+ file: string;
957
+ hash: string;
958
+ start_line: number;
959
+ end_line: number;
960
+ }>, "many">;
961
+ }, "strip", z.ZodTypeAny, {
962
+ locked: {
963
+ file: string;
964
+ hash: string;
965
+ start_line: number;
966
+ end_line: number;
967
+ }[];
968
+ drifted: {
969
+ file: string;
970
+ hash: string;
971
+ start_line: number;
972
+ end_line: number;
973
+ }[];
974
+ }, {
975
+ locked: {
976
+ file: string;
977
+ hash: string;
978
+ start_line: number;
979
+ end_line: number;
980
+ }[];
981
+ drifted: {
982
+ file: string;
983
+ hash: string;
984
+ start_line: number;
985
+ end_line: number;
986
+ }[];
987
+ }>;
988
+ }, "strip", z.ZodTypeAny, {
989
+ type: "lock:drift";
990
+ payload: {
991
+ locked: {
992
+ file: string;
993
+ hash: string;
994
+ start_line: number;
995
+ end_line: number;
996
+ }[];
997
+ drifted: {
998
+ file: string;
999
+ hash: string;
1000
+ start_line: number;
1001
+ end_line: number;
1002
+ }[];
1003
+ };
1004
+ }, {
1005
+ type: "lock:drift";
1006
+ payload: {
1007
+ locked: {
1008
+ file: string;
1009
+ hash: string;
1010
+ start_line: number;
1011
+ end_line: number;
1012
+ }[];
1013
+ drifted: {
1014
+ file: string;
1015
+ hash: string;
1016
+ start_line: number;
1017
+ end_line: number;
1018
+ }[];
1019
+ };
1020
+ }>;
1021
+ declare const lockApprovedEventSchema: z.ZodObject<{
1022
+ type: z.ZodLiteral<"lock:approved">;
1023
+ payload: z.ZodObject<{
1024
+ locked: z.ZodArray<z.ZodObject<{
1025
+ file: z.ZodString;
1026
+ start_line: z.ZodNumber;
1027
+ end_line: z.ZodNumber;
1028
+ hash: z.ZodString;
1029
+ }, "strip", z.ZodTypeAny, {
1030
+ file: string;
1031
+ hash: string;
1032
+ start_line: number;
1033
+ end_line: number;
1034
+ }, {
1035
+ file: string;
1036
+ hash: string;
1037
+ start_line: number;
1038
+ end_line: number;
1039
+ }>, "many">;
1040
+ approved: z.ZodArray<z.ZodObject<{
1041
+ file: z.ZodString;
1042
+ start_line: z.ZodNumber;
1043
+ end_line: z.ZodNumber;
1044
+ hash: z.ZodString;
1045
+ }, "strip", z.ZodTypeAny, {
1046
+ file: string;
1047
+ hash: string;
1048
+ start_line: number;
1049
+ end_line: number;
1050
+ }, {
1051
+ file: string;
1052
+ hash: string;
1053
+ start_line: number;
1054
+ end_line: number;
1055
+ }>, "many">;
1056
+ }, "strip", z.ZodTypeAny, {
1057
+ approved: {
1058
+ file: string;
1059
+ hash: string;
1060
+ start_line: number;
1061
+ end_line: number;
1062
+ }[];
1063
+ locked: {
1064
+ file: string;
1065
+ hash: string;
1066
+ start_line: number;
1067
+ end_line: number;
1068
+ }[];
1069
+ }, {
1070
+ approved: {
1071
+ file: string;
1072
+ hash: string;
1073
+ start_line: number;
1074
+ end_line: number;
1075
+ }[];
1076
+ locked: {
1077
+ file: string;
1078
+ hash: string;
1079
+ start_line: number;
1080
+ end_line: number;
1081
+ }[];
1082
+ }>;
1083
+ }, "strip", z.ZodTypeAny, {
1084
+ type: "lock:approved";
1085
+ payload: {
1086
+ approved: {
1087
+ file: string;
1088
+ hash: string;
1089
+ start_line: number;
1090
+ end_line: number;
1091
+ }[];
1092
+ locked: {
1093
+ file: string;
1094
+ hash: string;
1095
+ start_line: number;
1096
+ end_line: number;
1097
+ }[];
1098
+ };
1099
+ }, {
1100
+ type: "lock:approved";
1101
+ payload: {
1102
+ approved: {
1103
+ file: string;
1104
+ hash: string;
1105
+ start_line: number;
1106
+ end_line: number;
1107
+ }[];
1108
+ locked: {
1109
+ file: string;
1110
+ hash: string;
1111
+ start_line: number;
1112
+ end_line: number;
1113
+ }[];
1114
+ };
1115
+ }>;
1116
+ declare const ledgerAppendedEventSchema: z.ZodObject<{
1117
+ type: z.ZodLiteral<"ledger:appended">;
1118
+ payload: z.ZodEffects<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
1119
+ source: z.ZodLiteral<"ai">;
1120
+ commit_sha: z.ZodOptional<z.ZodString>;
1121
+ id: z.ZodOptional<z.ZodString>;
1122
+ ts: z.ZodNumber;
1123
+ intent: z.ZodString;
1124
+ affected_paths: z.ZodArray<z.ZodString, "many">;
1125
+ }, "strip", z.ZodTypeAny, {
1126
+ source: "ai";
1127
+ ts: number;
1128
+ intent: string;
1129
+ affected_paths: string[];
1130
+ commit_sha?: string | undefined;
1131
+ id?: string | undefined;
1132
+ }, {
1133
+ source: "ai";
1134
+ ts: number;
1135
+ intent: string;
1136
+ affected_paths: string[];
1137
+ commit_sha?: string | undefined;
1138
+ id?: string | undefined;
1139
+ }>, z.ZodObject<{
1140
+ source: z.ZodLiteral<"human">;
1141
+ parent_sha: z.ZodString;
1142
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
1143
+ diff_stat: z.ZodString;
1144
+ annotation: z.ZodOptional<z.ZodString>;
1145
+ id: z.ZodOptional<z.ZodString>;
1146
+ ts: z.ZodNumber;
1147
+ intent: z.ZodString;
1148
+ affected_paths: z.ZodArray<z.ZodString, "many">;
1149
+ }, "strip", z.ZodTypeAny, {
1150
+ source: "human";
1151
+ ts: number;
1152
+ intent: string;
1153
+ affected_paths: string[];
1154
+ parent_sha: string;
1155
+ diff_stat: string;
1156
+ annotation?: string | undefined;
1157
+ id?: string | undefined;
1158
+ parent_ledger_entry_id?: string | undefined;
1159
+ }, {
1160
+ source: "human";
1161
+ ts: number;
1162
+ intent: string;
1163
+ affected_paths: string[];
1164
+ parent_sha: string;
1165
+ diff_stat: string;
1166
+ annotation?: string | undefined;
1167
+ id?: string | undefined;
1168
+ parent_ledger_entry_id?: string | undefined;
1169
+ }>]>, {
1170
+ source: "ai";
1171
+ ts: number;
1172
+ intent: string;
1173
+ affected_paths: string[];
1174
+ commit_sha?: string | undefined;
1175
+ id?: string | undefined;
1176
+ } | {
1177
+ source: "human";
1178
+ ts: number;
1179
+ intent: string;
1180
+ affected_paths: string[];
1181
+ parent_sha: string;
1182
+ diff_stat: string;
1183
+ annotation?: string | undefined;
1184
+ id?: string | undefined;
1185
+ parent_ledger_entry_id?: string | undefined;
1186
+ }, unknown>;
1187
+ }, "strip", z.ZodTypeAny, {
1188
+ type: "ledger:appended";
1189
+ payload: {
1190
+ source: "ai";
1191
+ ts: number;
1192
+ intent: string;
1193
+ affected_paths: string[];
1194
+ commit_sha?: string | undefined;
1195
+ id?: string | undefined;
1196
+ } | {
1197
+ source: "human";
1198
+ ts: number;
1199
+ intent: string;
1200
+ affected_paths: string[];
1201
+ parent_sha: string;
1202
+ diff_stat: string;
1203
+ annotation?: string | undefined;
1204
+ id?: string | undefined;
1205
+ parent_ledger_entry_id?: string | undefined;
1206
+ };
1207
+ }, {
1208
+ type: "ledger:appended";
1209
+ payload?: unknown;
1210
+ }>;
1211
+ declare const driftDetectedEventSchema: z.ZodObject<{
1212
+ type: z.ZodLiteral<"drift:detected">;
1213
+ payload: z.ZodObject<{
1214
+ version: z.ZodString;
1215
+ generated_at: z.ZodString;
1216
+ generated_by: z.ZodString;
1217
+ target: z.ZodString;
1218
+ project_name: z.ZodString;
1219
+ framework: z.ZodObject<{
1220
+ kind: z.ZodString;
1221
+ version: z.ZodString;
1222
+ subkind: z.ZodString;
1223
+ evidence: z.ZodArray<z.ZodString, "many">;
1224
+ }, "strip", z.ZodTypeAny, {
1225
+ kind: string;
1226
+ version: string;
1227
+ subkind: string;
1228
+ evidence: string[];
1229
+ }, {
1230
+ kind: string;
1231
+ version: string;
1232
+ subkind: string;
1233
+ evidence: string[];
1234
+ }>;
1235
+ topology: z.ZodObject<{
1236
+ total_files: z.ZodNumber;
1237
+ by_ext: z.ZodRecord<z.ZodString, z.ZodNumber>;
1238
+ key_dirs: z.ZodArray<z.ZodString, "many">;
1239
+ max_depth: z.ZodNumber;
1240
+ }, "strip", z.ZodTypeAny, {
1241
+ total_files: number;
1242
+ by_ext: Record<string, number>;
1243
+ key_dirs: string[];
1244
+ max_depth: number;
1245
+ }, {
1246
+ total_files: number;
1247
+ by_ext: Record<string, number>;
1248
+ key_dirs: string[];
1249
+ max_depth: number;
1250
+ }>;
1251
+ entry_points: z.ZodArray<z.ZodObject<{
1252
+ path: z.ZodString;
1253
+ reason: z.ZodString;
1254
+ size_bytes: z.ZodOptional<z.ZodNumber>;
1255
+ }, "strip", z.ZodTypeAny, {
1256
+ path: string;
1257
+ reason: string;
1258
+ size_bytes?: number | undefined;
1259
+ }, {
1260
+ path: string;
1261
+ reason: string;
1262
+ size_bytes?: number | undefined;
1263
+ }>, "many">;
1264
+ code_samples: z.ZodArray<z.ZodObject<{
1265
+ path: z.ZodString;
1266
+ lines: z.ZodString;
1267
+ snippet: z.ZodString;
1268
+ pattern_hint: z.ZodString;
1269
+ }, "strip", z.ZodTypeAny, {
1270
+ path: string;
1271
+ lines: string;
1272
+ snippet: string;
1273
+ pattern_hint: string;
1274
+ }, {
1275
+ path: string;
1276
+ lines: string;
1277
+ snippet: string;
1278
+ pattern_hint: string;
1279
+ }>, "many">;
1280
+ readme: z.ZodObject<{
1281
+ quality: z.ZodEnum<["missing", "stub", "ok"]>;
1282
+ line_count: z.ZodNumber;
1283
+ has_contributing: z.ZodBoolean;
1284
+ }, "strip", z.ZodTypeAny, {
1285
+ quality: "missing" | "ok" | "stub";
1286
+ line_count: number;
1287
+ has_contributing: boolean;
1288
+ }, {
1289
+ quality: "missing" | "ok" | "stub";
1290
+ line_count: number;
1291
+ has_contributing: boolean;
1292
+ }>;
1293
+ recommendations_for_skill: z.ZodArray<z.ZodString, "many">;
1294
+ }, "strip", z.ZodTypeAny, {
1295
+ version: string;
1296
+ generated_at: string;
1297
+ generated_by: string;
1298
+ target: string;
1299
+ project_name: string;
1300
+ framework: {
1301
+ kind: string;
1302
+ version: string;
1303
+ subkind: string;
1304
+ evidence: string[];
1305
+ };
1306
+ topology: {
1307
+ total_files: number;
1308
+ by_ext: Record<string, number>;
1309
+ key_dirs: string[];
1310
+ max_depth: number;
1311
+ };
1312
+ entry_points: {
1313
+ path: string;
1314
+ reason: string;
1315
+ size_bytes?: number | undefined;
1316
+ }[];
1317
+ code_samples: {
1318
+ path: string;
1319
+ lines: string;
1320
+ snippet: string;
1321
+ pattern_hint: string;
1322
+ }[];
1323
+ readme: {
1324
+ quality: "missing" | "ok" | "stub";
1325
+ line_count: number;
1326
+ has_contributing: boolean;
1327
+ };
1328
+ recommendations_for_skill: string[];
1329
+ }, {
1330
+ version: string;
1331
+ generated_at: string;
1332
+ generated_by: string;
1333
+ target: string;
1334
+ project_name: string;
1335
+ framework: {
1336
+ kind: string;
1337
+ version: string;
1338
+ subkind: string;
1339
+ evidence: string[];
1340
+ };
1341
+ topology: {
1342
+ total_files: number;
1343
+ by_ext: Record<string, number>;
1344
+ key_dirs: string[];
1345
+ max_depth: number;
1346
+ };
1347
+ entry_points: {
1348
+ path: string;
1349
+ reason: string;
1350
+ size_bytes?: number | undefined;
1351
+ }[];
1352
+ code_samples: {
1353
+ path: string;
1354
+ lines: string;
1355
+ snippet: string;
1356
+ pattern_hint: string;
1357
+ }[];
1358
+ readme: {
1359
+ quality: "missing" | "ok" | "stub";
1360
+ line_count: number;
1361
+ has_contributing: boolean;
1362
+ };
1363
+ recommendations_for_skill: string[];
1364
+ }>;
1365
+ }, "strip", z.ZodTypeAny, {
1366
+ type: "drift:detected";
1367
+ payload: {
1368
+ version: string;
1369
+ generated_at: string;
1370
+ generated_by: string;
1371
+ target: string;
1372
+ project_name: string;
1373
+ framework: {
1374
+ kind: string;
1375
+ version: string;
1376
+ subkind: string;
1377
+ evidence: string[];
1378
+ };
1379
+ topology: {
1380
+ total_files: number;
1381
+ by_ext: Record<string, number>;
1382
+ key_dirs: string[];
1383
+ max_depth: number;
1384
+ };
1385
+ entry_points: {
1386
+ path: string;
1387
+ reason: string;
1388
+ size_bytes?: number | undefined;
1389
+ }[];
1390
+ code_samples: {
1391
+ path: string;
1392
+ lines: string;
1393
+ snippet: string;
1394
+ pattern_hint: string;
1395
+ }[];
1396
+ readme: {
1397
+ quality: "missing" | "ok" | "stub";
1398
+ line_count: number;
1399
+ has_contributing: boolean;
1400
+ };
1401
+ recommendations_for_skill: string[];
1402
+ };
1403
+ }, {
1404
+ type: "drift:detected";
1405
+ payload: {
1406
+ version: string;
1407
+ generated_at: string;
1408
+ generated_by: string;
1409
+ target: string;
1410
+ project_name: string;
1411
+ framework: {
1412
+ kind: string;
1413
+ version: string;
1414
+ subkind: string;
1415
+ evidence: string[];
1416
+ };
1417
+ topology: {
1418
+ total_files: number;
1419
+ by_ext: Record<string, number>;
1420
+ key_dirs: string[];
1421
+ max_depth: number;
1422
+ };
1423
+ entry_points: {
1424
+ path: string;
1425
+ reason: string;
1426
+ size_bytes?: number | undefined;
1427
+ }[];
1428
+ code_samples: {
1429
+ path: string;
1430
+ lines: string;
1431
+ snippet: string;
1432
+ pattern_hint: string;
1433
+ }[];
1434
+ readme: {
1435
+ quality: "missing" | "ok" | "stub";
1436
+ line_count: number;
1437
+ has_contributing: boolean;
1438
+ };
1439
+ recommendations_for_skill: string[];
1440
+ };
1441
+ }>;
1442
+ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1443
+ type: z.ZodLiteral<"meta:updated">;
1444
+ payload: z.ZodObject<{
1445
+ revision: z.ZodString;
1446
+ nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
1447
+ file: z.ZodString;
1448
+ scope_glob: z.ZodString;
1449
+ deps: z.ZodArray<z.ZodString, "many">;
1450
+ priority: z.ZodEnum<["high", "medium", "low"]>;
1451
+ hash: z.ZodString;
1452
+ }, "strip", z.ZodTypeAny, {
1453
+ file: string;
1454
+ priority: "high" | "medium" | "low";
1455
+ hash: string;
1456
+ scope_glob: string;
1457
+ deps: string[];
1458
+ }, {
1459
+ file: string;
1460
+ priority: "high" | "medium" | "low";
1461
+ hash: string;
1462
+ scope_glob: string;
1463
+ deps: string[];
1464
+ }>>;
1465
+ }, "strip", z.ZodTypeAny, {
1466
+ revision: string;
1467
+ nodes: Record<string, {
1468
+ file: string;
1469
+ priority: "high" | "medium" | "low";
1470
+ hash: string;
1471
+ scope_glob: string;
1472
+ deps: string[];
1473
+ }>;
1474
+ }, {
1475
+ revision: string;
1476
+ nodes: Record<string, {
1477
+ file: string;
1478
+ priority: "high" | "medium" | "low";
1479
+ hash: string;
1480
+ scope_glob: string;
1481
+ deps: string[];
1482
+ }>;
1483
+ }>;
1484
+ }, "strip", z.ZodTypeAny, {
1485
+ type: "meta:updated";
1486
+ payload: {
1487
+ revision: string;
1488
+ nodes: Record<string, {
1489
+ file: string;
1490
+ priority: "high" | "medium" | "low";
1491
+ hash: string;
1492
+ scope_glob: string;
1493
+ deps: string[];
1494
+ }>;
1495
+ };
1496
+ }, {
1497
+ type: "meta:updated";
1498
+ payload: {
1499
+ revision: string;
1500
+ nodes: Record<string, {
1501
+ file: string;
1502
+ priority: "high" | "medium" | "low";
1503
+ hash: string;
1504
+ scope_glob: string;
1505
+ deps: string[];
1506
+ }>;
1507
+ };
1508
+ }>, z.ZodObject<{
1509
+ type: z.ZodLiteral<"lock:drift">;
1510
+ payload: z.ZodObject<{
1511
+ locked: z.ZodArray<z.ZodObject<{
1512
+ file: z.ZodString;
1513
+ start_line: z.ZodNumber;
1514
+ end_line: z.ZodNumber;
1515
+ hash: z.ZodString;
1516
+ }, "strip", z.ZodTypeAny, {
1517
+ file: string;
1518
+ hash: string;
1519
+ start_line: number;
1520
+ end_line: number;
1521
+ }, {
1522
+ file: string;
1523
+ hash: string;
1524
+ start_line: number;
1525
+ end_line: number;
1526
+ }>, "many">;
1527
+ drifted: z.ZodArray<z.ZodObject<{
1528
+ file: z.ZodString;
1529
+ start_line: z.ZodNumber;
1530
+ end_line: z.ZodNumber;
1531
+ hash: z.ZodString;
1532
+ }, "strip", z.ZodTypeAny, {
1533
+ file: string;
1534
+ hash: string;
1535
+ start_line: number;
1536
+ end_line: number;
1537
+ }, {
1538
+ file: string;
1539
+ hash: string;
1540
+ start_line: number;
1541
+ end_line: number;
1542
+ }>, "many">;
1543
+ }, "strip", z.ZodTypeAny, {
1544
+ locked: {
1545
+ file: string;
1546
+ hash: string;
1547
+ start_line: number;
1548
+ end_line: number;
1549
+ }[];
1550
+ drifted: {
1551
+ file: string;
1552
+ hash: string;
1553
+ start_line: number;
1554
+ end_line: number;
1555
+ }[];
1556
+ }, {
1557
+ locked: {
1558
+ file: string;
1559
+ hash: string;
1560
+ start_line: number;
1561
+ end_line: number;
1562
+ }[];
1563
+ drifted: {
1564
+ file: string;
1565
+ hash: string;
1566
+ start_line: number;
1567
+ end_line: number;
1568
+ }[];
1569
+ }>;
1570
+ }, "strip", z.ZodTypeAny, {
1571
+ type: "lock:drift";
1572
+ payload: {
1573
+ locked: {
1574
+ file: string;
1575
+ hash: string;
1576
+ start_line: number;
1577
+ end_line: number;
1578
+ }[];
1579
+ drifted: {
1580
+ file: string;
1581
+ hash: string;
1582
+ start_line: number;
1583
+ end_line: number;
1584
+ }[];
1585
+ };
1586
+ }, {
1587
+ type: "lock:drift";
1588
+ payload: {
1589
+ locked: {
1590
+ file: string;
1591
+ hash: string;
1592
+ start_line: number;
1593
+ end_line: number;
1594
+ }[];
1595
+ drifted: {
1596
+ file: string;
1597
+ hash: string;
1598
+ start_line: number;
1599
+ end_line: number;
1600
+ }[];
1601
+ };
1602
+ }>, z.ZodObject<{
1603
+ type: z.ZodLiteral<"lock:approved">;
1604
+ payload: z.ZodObject<{
1605
+ locked: z.ZodArray<z.ZodObject<{
1606
+ file: z.ZodString;
1607
+ start_line: z.ZodNumber;
1608
+ end_line: z.ZodNumber;
1609
+ hash: z.ZodString;
1610
+ }, "strip", z.ZodTypeAny, {
1611
+ file: string;
1612
+ hash: string;
1613
+ start_line: number;
1614
+ end_line: number;
1615
+ }, {
1616
+ file: string;
1617
+ hash: string;
1618
+ start_line: number;
1619
+ end_line: number;
1620
+ }>, "many">;
1621
+ approved: z.ZodArray<z.ZodObject<{
1622
+ file: z.ZodString;
1623
+ start_line: z.ZodNumber;
1624
+ end_line: z.ZodNumber;
1625
+ hash: z.ZodString;
1626
+ }, "strip", z.ZodTypeAny, {
1627
+ file: string;
1628
+ hash: string;
1629
+ start_line: number;
1630
+ end_line: number;
1631
+ }, {
1632
+ file: string;
1633
+ hash: string;
1634
+ start_line: number;
1635
+ end_line: number;
1636
+ }>, "many">;
1637
+ }, "strip", z.ZodTypeAny, {
1638
+ approved: {
1639
+ file: string;
1640
+ hash: string;
1641
+ start_line: number;
1642
+ end_line: number;
1643
+ }[];
1644
+ locked: {
1645
+ file: string;
1646
+ hash: string;
1647
+ start_line: number;
1648
+ end_line: number;
1649
+ }[];
1650
+ }, {
1651
+ approved: {
1652
+ file: string;
1653
+ hash: string;
1654
+ start_line: number;
1655
+ end_line: number;
1656
+ }[];
1657
+ locked: {
1658
+ file: string;
1659
+ hash: string;
1660
+ start_line: number;
1661
+ end_line: number;
1662
+ }[];
1663
+ }>;
1664
+ }, "strip", z.ZodTypeAny, {
1665
+ type: "lock:approved";
1666
+ payload: {
1667
+ approved: {
1668
+ file: string;
1669
+ hash: string;
1670
+ start_line: number;
1671
+ end_line: number;
1672
+ }[];
1673
+ locked: {
1674
+ file: string;
1675
+ hash: string;
1676
+ start_line: number;
1677
+ end_line: number;
1678
+ }[];
1679
+ };
1680
+ }, {
1681
+ type: "lock:approved";
1682
+ payload: {
1683
+ approved: {
1684
+ file: string;
1685
+ hash: string;
1686
+ start_line: number;
1687
+ end_line: number;
1688
+ }[];
1689
+ locked: {
1690
+ file: string;
1691
+ hash: string;
1692
+ start_line: number;
1693
+ end_line: number;
1694
+ }[];
1695
+ };
1696
+ }>, z.ZodObject<{
1697
+ type: z.ZodLiteral<"ledger:appended">;
1698
+ payload: z.ZodEffects<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
1699
+ source: z.ZodLiteral<"ai">;
1700
+ commit_sha: z.ZodOptional<z.ZodString>;
1701
+ id: z.ZodOptional<z.ZodString>;
1702
+ ts: z.ZodNumber;
1703
+ intent: z.ZodString;
1704
+ affected_paths: z.ZodArray<z.ZodString, "many">;
1705
+ }, "strip", z.ZodTypeAny, {
1706
+ source: "ai";
1707
+ ts: number;
1708
+ intent: string;
1709
+ affected_paths: string[];
1710
+ commit_sha?: string | undefined;
1711
+ id?: string | undefined;
1712
+ }, {
1713
+ source: "ai";
1714
+ ts: number;
1715
+ intent: string;
1716
+ affected_paths: string[];
1717
+ commit_sha?: string | undefined;
1718
+ id?: string | undefined;
1719
+ }>, z.ZodObject<{
1720
+ source: z.ZodLiteral<"human">;
1721
+ parent_sha: z.ZodString;
1722
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
1723
+ diff_stat: z.ZodString;
1724
+ annotation: z.ZodOptional<z.ZodString>;
1725
+ id: z.ZodOptional<z.ZodString>;
1726
+ ts: z.ZodNumber;
1727
+ intent: z.ZodString;
1728
+ affected_paths: z.ZodArray<z.ZodString, "many">;
1729
+ }, "strip", z.ZodTypeAny, {
1730
+ source: "human";
1731
+ ts: number;
1732
+ intent: string;
1733
+ affected_paths: string[];
1734
+ parent_sha: string;
1735
+ diff_stat: string;
1736
+ annotation?: string | undefined;
1737
+ id?: string | undefined;
1738
+ parent_ledger_entry_id?: string | undefined;
1739
+ }, {
1740
+ source: "human";
1741
+ ts: number;
1742
+ intent: string;
1743
+ affected_paths: string[];
1744
+ parent_sha: string;
1745
+ diff_stat: string;
1746
+ annotation?: string | undefined;
1747
+ id?: string | undefined;
1748
+ parent_ledger_entry_id?: string | undefined;
1749
+ }>]>, {
1750
+ source: "ai";
1751
+ ts: number;
1752
+ intent: string;
1753
+ affected_paths: string[];
1754
+ commit_sha?: string | undefined;
1755
+ id?: string | undefined;
1756
+ } | {
1757
+ source: "human";
1758
+ ts: number;
1759
+ intent: string;
1760
+ affected_paths: string[];
1761
+ parent_sha: string;
1762
+ diff_stat: string;
1763
+ annotation?: string | undefined;
1764
+ id?: string | undefined;
1765
+ parent_ledger_entry_id?: string | undefined;
1766
+ }, unknown>;
1767
+ }, "strip", z.ZodTypeAny, {
1768
+ type: "ledger:appended";
1769
+ payload: {
1770
+ source: "ai";
1771
+ ts: number;
1772
+ intent: string;
1773
+ affected_paths: string[];
1774
+ commit_sha?: string | undefined;
1775
+ id?: string | undefined;
1776
+ } | {
1777
+ source: "human";
1778
+ ts: number;
1779
+ intent: string;
1780
+ affected_paths: string[];
1781
+ parent_sha: string;
1782
+ diff_stat: string;
1783
+ annotation?: string | undefined;
1784
+ id?: string | undefined;
1785
+ parent_ledger_entry_id?: string | undefined;
1786
+ };
1787
+ }, {
1788
+ type: "ledger:appended";
1789
+ payload?: unknown;
1790
+ }>, z.ZodObject<{
1791
+ type: z.ZodLiteral<"drift:detected">;
1792
+ payload: z.ZodObject<{
1793
+ version: z.ZodString;
1794
+ generated_at: z.ZodString;
1795
+ generated_by: z.ZodString;
1796
+ target: z.ZodString;
1797
+ project_name: z.ZodString;
1798
+ framework: z.ZodObject<{
1799
+ kind: z.ZodString;
1800
+ version: z.ZodString;
1801
+ subkind: z.ZodString;
1802
+ evidence: z.ZodArray<z.ZodString, "many">;
1803
+ }, "strip", z.ZodTypeAny, {
1804
+ kind: string;
1805
+ version: string;
1806
+ subkind: string;
1807
+ evidence: string[];
1808
+ }, {
1809
+ kind: string;
1810
+ version: string;
1811
+ subkind: string;
1812
+ evidence: string[];
1813
+ }>;
1814
+ topology: z.ZodObject<{
1815
+ total_files: z.ZodNumber;
1816
+ by_ext: z.ZodRecord<z.ZodString, z.ZodNumber>;
1817
+ key_dirs: z.ZodArray<z.ZodString, "many">;
1818
+ max_depth: z.ZodNumber;
1819
+ }, "strip", z.ZodTypeAny, {
1820
+ total_files: number;
1821
+ by_ext: Record<string, number>;
1822
+ key_dirs: string[];
1823
+ max_depth: number;
1824
+ }, {
1825
+ total_files: number;
1826
+ by_ext: Record<string, number>;
1827
+ key_dirs: string[];
1828
+ max_depth: number;
1829
+ }>;
1830
+ entry_points: z.ZodArray<z.ZodObject<{
1831
+ path: z.ZodString;
1832
+ reason: z.ZodString;
1833
+ size_bytes: z.ZodOptional<z.ZodNumber>;
1834
+ }, "strip", z.ZodTypeAny, {
1835
+ path: string;
1836
+ reason: string;
1837
+ size_bytes?: number | undefined;
1838
+ }, {
1839
+ path: string;
1840
+ reason: string;
1841
+ size_bytes?: number | undefined;
1842
+ }>, "many">;
1843
+ code_samples: z.ZodArray<z.ZodObject<{
1844
+ path: z.ZodString;
1845
+ lines: z.ZodString;
1846
+ snippet: z.ZodString;
1847
+ pattern_hint: z.ZodString;
1848
+ }, "strip", z.ZodTypeAny, {
1849
+ path: string;
1850
+ lines: string;
1851
+ snippet: string;
1852
+ pattern_hint: string;
1853
+ }, {
1854
+ path: string;
1855
+ lines: string;
1856
+ snippet: string;
1857
+ pattern_hint: string;
1858
+ }>, "many">;
1859
+ readme: z.ZodObject<{
1860
+ quality: z.ZodEnum<["missing", "stub", "ok"]>;
1861
+ line_count: z.ZodNumber;
1862
+ has_contributing: z.ZodBoolean;
1863
+ }, "strip", z.ZodTypeAny, {
1864
+ quality: "missing" | "ok" | "stub";
1865
+ line_count: number;
1866
+ has_contributing: boolean;
1867
+ }, {
1868
+ quality: "missing" | "ok" | "stub";
1869
+ line_count: number;
1870
+ has_contributing: boolean;
1871
+ }>;
1872
+ recommendations_for_skill: z.ZodArray<z.ZodString, "many">;
1873
+ }, "strip", z.ZodTypeAny, {
1874
+ version: string;
1875
+ generated_at: string;
1876
+ generated_by: string;
1877
+ target: string;
1878
+ project_name: string;
1879
+ framework: {
1880
+ kind: string;
1881
+ version: string;
1882
+ subkind: string;
1883
+ evidence: string[];
1884
+ };
1885
+ topology: {
1886
+ total_files: number;
1887
+ by_ext: Record<string, number>;
1888
+ key_dirs: string[];
1889
+ max_depth: number;
1890
+ };
1891
+ entry_points: {
1892
+ path: string;
1893
+ reason: string;
1894
+ size_bytes?: number | undefined;
1895
+ }[];
1896
+ code_samples: {
1897
+ path: string;
1898
+ lines: string;
1899
+ snippet: string;
1900
+ pattern_hint: string;
1901
+ }[];
1902
+ readme: {
1903
+ quality: "missing" | "ok" | "stub";
1904
+ line_count: number;
1905
+ has_contributing: boolean;
1906
+ };
1907
+ recommendations_for_skill: string[];
1908
+ }, {
1909
+ version: string;
1910
+ generated_at: string;
1911
+ generated_by: string;
1912
+ target: string;
1913
+ project_name: string;
1914
+ framework: {
1915
+ kind: string;
1916
+ version: string;
1917
+ subkind: string;
1918
+ evidence: string[];
1919
+ };
1920
+ topology: {
1921
+ total_files: number;
1922
+ by_ext: Record<string, number>;
1923
+ key_dirs: string[];
1924
+ max_depth: number;
1925
+ };
1926
+ entry_points: {
1927
+ path: string;
1928
+ reason: string;
1929
+ size_bytes?: number | undefined;
1930
+ }[];
1931
+ code_samples: {
1932
+ path: string;
1933
+ lines: string;
1934
+ snippet: string;
1935
+ pattern_hint: string;
1936
+ }[];
1937
+ readme: {
1938
+ quality: "missing" | "ok" | "stub";
1939
+ line_count: number;
1940
+ has_contributing: boolean;
1941
+ };
1942
+ recommendations_for_skill: string[];
1943
+ }>;
1944
+ }, "strip", z.ZodTypeAny, {
1945
+ type: "drift:detected";
1946
+ payload: {
1947
+ version: string;
1948
+ generated_at: string;
1949
+ generated_by: string;
1950
+ target: string;
1951
+ project_name: string;
1952
+ framework: {
1953
+ kind: string;
1954
+ version: string;
1955
+ subkind: string;
1956
+ evidence: string[];
1957
+ };
1958
+ topology: {
1959
+ total_files: number;
1960
+ by_ext: Record<string, number>;
1961
+ key_dirs: string[];
1962
+ max_depth: number;
1963
+ };
1964
+ entry_points: {
1965
+ path: string;
1966
+ reason: string;
1967
+ size_bytes?: number | undefined;
1968
+ }[];
1969
+ code_samples: {
1970
+ path: string;
1971
+ lines: string;
1972
+ snippet: string;
1973
+ pattern_hint: string;
1974
+ }[];
1975
+ readme: {
1976
+ quality: "missing" | "ok" | "stub";
1977
+ line_count: number;
1978
+ has_contributing: boolean;
1979
+ };
1980
+ recommendations_for_skill: string[];
1981
+ };
1982
+ }, {
1983
+ type: "drift:detected";
1984
+ payload: {
1985
+ version: string;
1986
+ generated_at: string;
1987
+ generated_by: string;
1988
+ target: string;
1989
+ project_name: string;
1990
+ framework: {
1991
+ kind: string;
1992
+ version: string;
1993
+ subkind: string;
1994
+ evidence: string[];
1995
+ };
1996
+ topology: {
1997
+ total_files: number;
1998
+ by_ext: Record<string, number>;
1999
+ key_dirs: string[];
2000
+ max_depth: number;
2001
+ };
2002
+ entry_points: {
2003
+ path: string;
2004
+ reason: string;
2005
+ size_bytes?: number | undefined;
2006
+ }[];
2007
+ code_samples: {
2008
+ path: string;
2009
+ lines: string;
2010
+ snippet: string;
2011
+ pattern_hint: string;
2012
+ }[];
2013
+ readme: {
2014
+ quality: "missing" | "ok" | "stub";
2015
+ line_count: number;
2016
+ has_contributing: boolean;
2017
+ };
2018
+ recommendations_for_skill: string[];
2019
+ };
2020
+ }>]>;
2021
+
2022
+ type FrameworkInfo = {
2023
+ kind: "vite" | "next" | "react" | "vue" | "cocos-creator" | "rust" | "python" | "unknown";
2024
+ version: string;
2025
+ subkind: string;
2026
+ evidence: string[];
2027
+ };
2028
+ declare function detectFramework(root: string): FrameworkInfo;
2029
+
2030
+ export { AgentsMeta, type DriftDetectedEvent, type FabricEvent, type ForensicCodeSample, type ForensicEntryPoint, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicTopology, type FrameworkInfo, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type LedgerAppendedEvent, LedgerEntry, type LockApprovedEvent, type LockDriftEvent, type MetaUpdatedEvent, agentsMetaNodeSchema, agentsMetaSchema, aiLedgerEntrySchema, annotateIntentRequestSchema, clientPathsSchema, detectFramework, driftDetectedEventSchema, fabricConfigSchema, fabricEventSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicTopologySchema, historyStateQuerySchema, humanLedgerEntrySchema, humanLockApproveRequestSchema, humanLockEntrySchema, humanLockFileParamsSchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantSchema, initContextSchema, ledgerAppendedEventSchema, ledgerEntrySchema, ledgerQuerySchema, ledgerSourceSchema, lockApprovedEventSchema, lockDriftEventSchema, metaUpdatedEventSchema };