@fenglimg/fabric-shared 2.0.0-rc.15 → 2.0.0-rc.22

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.
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { Locale, Messages, PROTECTED_TOKENS, ProtectedToken, TranslationKey, Tra
4
4
  import { z } from 'zod';
5
5
  import { Layer, KnowledgeType, StableId } from './schemas/api-contracts.js';
6
6
  export { FabExtractKnowledgeInput, FabExtractKnowledgeInputSchema, FabExtractKnowledgeInputShape, FabExtractKnowledgeOutput, FabExtractKnowledgeOutputSchema, FabReviewInput, FabReviewInputSchema, FabReviewInputShape, FabReviewOutput, FabReviewOutputSchema, FabReviewOutputShape, KNOWLEDGE_TYPE_CODES, KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, KnowledgeTypeCode, KnowledgeTypeSchema, LayerSchema, Maturity, MaturitySchema, PROPOSED_REASON_DESCRIPTIONS, ProposedReason, ProposedReasonSchema, StableIdSchema, annotateIntentRequestSchema, fabExtractKnowledgeAnnotations, fabReviewAnnotations, formatKnowledgeId, getKnowledgeAnnotations, getKnowledgeInputSchema, getKnowledgeOutputSchema, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, knowledgeSectionsAnnotations, knowledgeSectionsInputSchema, knowledgeSectionsOutputSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextHintNarrowEntrySchema, planContextHintOutputSchema, planContextInputSchema, planContextOutputSchema, structuredWarningSchema } from './schemas/api-contracts.js';
7
+ export { BOOTSTRAP_CANONICAL, BOOTSTRAP_MARKER_BEGIN, BOOTSTRAP_MARKER_END, BOOTSTRAP_REGEX, LEGACY_KB_MARKER_BEGIN, LEGACY_KB_MARKER_END, LEGACY_KB_REGEX } from './templates/bootstrap-canonical.js';
7
8
 
8
9
  declare const AGENTS_META_LAYERS: readonly ["L0", "L1", "L2"];
9
10
  declare const AGENTS_META_TOPOLOGY_TYPES: readonly ["mirror", "cross-cutting", "domain", "local", "global"];
@@ -1354,7 +1355,6 @@ declare const fabricConfigSchema: z.ZodObject<{
1354
1355
  cursor?: string | undefined;
1355
1356
  codexCLI?: string | undefined;
1356
1357
  }>>;
1357
- externalFixturePath: z.ZodOptional<z.ZodString>;
1358
1358
  scanIgnores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1359
1359
  audit_mode: z.ZodOptional<z.ZodEnum<["strict", "warn", "off"]>>;
1360
1360
  mcpPayloadLimits: z.ZodOptional<z.ZodObject<{
@@ -1387,6 +1387,7 @@ declare const fabricConfigSchema: z.ZodObject<{
1387
1387
  archive_digest_max_sessions: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1388
1388
  review_topic_result_cap: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1389
1389
  review_stale_pending_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1390
+ fabric_event_retention_days: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<7>, z.ZodLiteral<30>, z.ZodLiteral<90>]>>;
1390
1391
  }, "strip", z.ZodTypeAny, {
1391
1392
  fabric_language: "match-existing" | "zh-CN" | "en" | "zh-CN-hybrid";
1392
1393
  default_layer_filter: "personal" | "team" | "both";
@@ -1414,13 +1415,13 @@ declare const fabricConfigSchema: z.ZodObject<{
1414
1415
  cursor?: string | undefined;
1415
1416
  codexCLI?: string | undefined;
1416
1417
  } | undefined;
1417
- externalFixturePath?: string | undefined;
1418
1418
  scanIgnores?: string[] | undefined;
1419
1419
  audit_mode?: "strict" | "warn" | "off" | undefined;
1420
1420
  mcpPayloadLimits?: {
1421
1421
  warnBytes?: number | undefined;
1422
1422
  hardBytes?: number | undefined;
1423
1423
  } | undefined;
1424
+ fabric_event_retention_days?: 7 | 30 | 90 | undefined;
1424
1425
  }, {
1425
1426
  clientPaths?: {
1426
1427
  claudeCodeCLI?: string | undefined;
@@ -1428,7 +1429,6 @@ declare const fabricConfigSchema: z.ZodObject<{
1428
1429
  cursor?: string | undefined;
1429
1430
  codexCLI?: string | undefined;
1430
1431
  } | undefined;
1431
- externalFixturePath?: string | undefined;
1432
1432
  scanIgnores?: string[] | undefined;
1433
1433
  audit_mode?: "strict" | "warn" | "off" | undefined;
1434
1434
  mcpPayloadLimits?: {
@@ -1455,8 +1455,49 @@ declare const fabricConfigSchema: z.ZodObject<{
1455
1455
  archive_digest_max_sessions?: number | undefined;
1456
1456
  review_topic_result_cap?: number | undefined;
1457
1457
  review_stale_pending_days?: number | undefined;
1458
+ fabric_event_retention_days?: 7 | 30 | 90 | undefined;
1458
1459
  }>;
1459
1460
 
1461
+ type FabricConfigSchemaShape = z.infer<typeof fabricConfigSchema>;
1462
+ type PanelFieldGroup = "A_locale" | "B_hint_threshold" | "C_audit";
1463
+ type ValidateResult = {
1464
+ ok: true;
1465
+ value: unknown;
1466
+ } | {
1467
+ ok: false;
1468
+ error: string;
1469
+ };
1470
+ interface PanelFieldMeta {
1471
+ /** Schema key this field edits — type-checked against the inferred config shape. */
1472
+ readonly key: keyof FabricConfigSchemaShape;
1473
+ /** Logical grouping for panel section headers. */
1474
+ readonly group: PanelFieldGroup;
1475
+ /** Clack widget hint — `select` for enums, `text` for free-form numbers. */
1476
+ readonly widget: "select" | "text";
1477
+ /** i18n key for the field label; strings landed in TASK-006. */
1478
+ readonly label_i18n_key: string;
1479
+ /** i18n key for the field's description / help text. */
1480
+ readonly description_i18n_key: string;
1481
+ /** Default value pulled from the Zod schema's `.default(...)`. */
1482
+ readonly default: string | number;
1483
+ /** Enum options for `select` widgets, derived from the Zod enum schema. */
1484
+ readonly enum_values?: readonly string[];
1485
+ /** Validates raw user input from the TUI prompt. */
1486
+ validate(raw: string): ValidateResult;
1487
+ /** Renders a stored value back to the panel display string. */
1488
+ format_for_display(value: unknown): string;
1489
+ }
1490
+ /**
1491
+ * Returns the per-field metadata array driving the `fab config` clack panel.
1492
+ * Group A (2) + Group B (8) + Group C (1) = 11 entries.
1493
+ */
1494
+ declare function getPanelFields(): readonly PanelFieldMeta[];
1495
+ /**
1496
+ * Lookup a single panel field by its config key. Returns `undefined` if the
1497
+ * key is not panel-scoped (e.g. Group D/E plumbing).
1498
+ */
1499
+ declare function getPanelFieldByKey(key: string): PanelFieldMeta | undefined;
1500
+
1460
1501
  interface ForensicCodeSample {
1461
1502
  path: string;
1462
1503
  lines: string;
@@ -5353,6 +5394,46 @@ declare const mcpConfigMigratedEventSchema: z.ZodObject<{
5353
5394
  correlation_id?: string | undefined;
5354
5395
  session_id?: string | undefined;
5355
5396
  }>;
5397
+ declare const bootstrapMarkerMigratedEventSchema: z.ZodObject<{
5398
+ event_type: z.ZodLiteral<"bootstrap_marker_migrated">;
5399
+ path: z.ZodString;
5400
+ migrated_count: z.ZodNumber;
5401
+ legacy_marker: z.ZodLiteral<"fabric:knowledge-base">;
5402
+ new_marker: z.ZodLiteral<"fabric:bootstrap">;
5403
+ timestamp: z.ZodString;
5404
+ kind: z.ZodLiteral<"fabric-event">;
5405
+ id: z.ZodString;
5406
+ ts: z.ZodNumber;
5407
+ schema_version: z.ZodLiteral<1>;
5408
+ correlation_id: z.ZodOptional<z.ZodString>;
5409
+ session_id: z.ZodOptional<z.ZodString>;
5410
+ }, "strip", z.ZodTypeAny, {
5411
+ path: string;
5412
+ id: string;
5413
+ ts: number;
5414
+ schema_version: 1;
5415
+ kind: "fabric-event";
5416
+ event_type: "bootstrap_marker_migrated";
5417
+ migrated_count: number;
5418
+ legacy_marker: "fabric:knowledge-base";
5419
+ new_marker: "fabric:bootstrap";
5420
+ timestamp: string;
5421
+ correlation_id?: string | undefined;
5422
+ session_id?: string | undefined;
5423
+ }, {
5424
+ path: string;
5425
+ id: string;
5426
+ ts: number;
5427
+ schema_version: 1;
5428
+ kind: "fabric-event";
5429
+ event_type: "bootstrap_marker_migrated";
5430
+ migrated_count: number;
5431
+ legacy_marker: "fabric:knowledge-base";
5432
+ new_marker: "fabric:bootstrap";
5433
+ timestamp: string;
5434
+ correlation_id?: string | undefined;
5435
+ session_id?: string | undefined;
5436
+ }>;
5356
5437
  declare const metaReconciledOnStartupEventSchema: z.ZodObject<{
5357
5438
  event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
5358
5439
  reconciled_files: z.ZodArray<z.ZodString, "many">;
@@ -5393,6 +5474,7 @@ declare const metaReconciledEventSchema: z.ZodObject<{
5393
5474
  duration_ms: z.ZodNumber;
5394
5475
  trigger: z.ZodEnum<["doctor", "manual"]>;
5395
5476
  source: z.ZodLiteral<"reconcileKnowledge">;
5477
+ force_write_reason: z.ZodOptional<z.ZodEnum<["revision_drift"]>>;
5396
5478
  kind: z.ZodLiteral<"fabric-event">;
5397
5479
  id: z.ZodString;
5398
5480
  ts: z.ZodNumber;
@@ -5411,6 +5493,7 @@ declare const metaReconciledEventSchema: z.ZodObject<{
5411
5493
  trigger: "manual" | "doctor";
5412
5494
  correlation_id?: string | undefined;
5413
5495
  session_id?: string | undefined;
5496
+ force_write_reason?: "revision_drift" | undefined;
5414
5497
  }, {
5415
5498
  id: string;
5416
5499
  source: "reconcileKnowledge";
@@ -5423,6 +5506,7 @@ declare const metaReconciledEventSchema: z.ZodObject<{
5423
5506
  trigger: "manual" | "doctor";
5424
5507
  correlation_id?: string | undefined;
5425
5508
  session_id?: string | undefined;
5509
+ force_write_reason?: "revision_drift" | undefined;
5426
5510
  }>;
5427
5511
  declare const claudeSkillPathMigratedEventSchema: z.ZodObject<{
5428
5512
  event_type: z.ZodLiteral<"claude_skill_path_migrated">;
@@ -6150,6 +6234,157 @@ declare const pendingAutoArchivedEventSchema: z.ZodObject<{
6150
6234
  correlation_id?: string | undefined;
6151
6235
  session_id?: string | undefined;
6152
6236
  }>;
6237
+ declare const assistantTurnObservedEventSchema: z.ZodObject<{
6238
+ event_type: z.ZodLiteral<"assistant_turn_observed">;
6239
+ kb_line_raw: z.ZodNullable<z.ZodString>;
6240
+ cite_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6241
+ cite_tags: z.ZodDefault<z.ZodArray<z.ZodEnum<["planned", "recalled", "chained-from", "dismissed", "none"]>, "many">>;
6242
+ client: z.ZodOptional<z.ZodEnum<["cc", "codex", "cursor"]>>;
6243
+ turn_id: z.ZodString;
6244
+ envelope_index: z.ZodOptional<z.ZodNumber>;
6245
+ timestamp: z.ZodString;
6246
+ kind: z.ZodLiteral<"fabric-event">;
6247
+ id: z.ZodString;
6248
+ ts: z.ZodNumber;
6249
+ schema_version: z.ZodLiteral<1>;
6250
+ correlation_id: z.ZodOptional<z.ZodString>;
6251
+ session_id: z.ZodOptional<z.ZodString>;
6252
+ }, "strip", z.ZodTypeAny, {
6253
+ id: string;
6254
+ ts: number;
6255
+ schema_version: 1;
6256
+ kind: "fabric-event";
6257
+ event_type: "assistant_turn_observed";
6258
+ timestamp: string;
6259
+ kb_line_raw: string | null;
6260
+ cite_ids: string[];
6261
+ cite_tags: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[];
6262
+ turn_id: string;
6263
+ correlation_id?: string | undefined;
6264
+ session_id?: string | undefined;
6265
+ client?: "cursor" | "cc" | "codex" | undefined;
6266
+ envelope_index?: number | undefined;
6267
+ }, {
6268
+ id: string;
6269
+ ts: number;
6270
+ schema_version: 1;
6271
+ kind: "fabric-event";
6272
+ event_type: "assistant_turn_observed";
6273
+ timestamp: string;
6274
+ kb_line_raw: string | null;
6275
+ turn_id: string;
6276
+ correlation_id?: string | undefined;
6277
+ session_id?: string | undefined;
6278
+ cite_ids?: string[] | undefined;
6279
+ cite_tags?: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[] | undefined;
6280
+ client?: "cursor" | "cc" | "codex" | undefined;
6281
+ envelope_index?: number | undefined;
6282
+ }>;
6283
+ declare const citePolicyActivatedEventSchema: z.ZodObject<{
6284
+ event_type: z.ZodLiteral<"cite_policy_activated">;
6285
+ policy_version: z.ZodString;
6286
+ timestamp: z.ZodString;
6287
+ kind: z.ZodLiteral<"fabric-event">;
6288
+ id: z.ZodString;
6289
+ ts: z.ZodNumber;
6290
+ schema_version: z.ZodLiteral<1>;
6291
+ correlation_id: z.ZodOptional<z.ZodString>;
6292
+ session_id: z.ZodOptional<z.ZodString>;
6293
+ }, "strip", z.ZodTypeAny, {
6294
+ id: string;
6295
+ ts: number;
6296
+ schema_version: 1;
6297
+ kind: "fabric-event";
6298
+ event_type: "cite_policy_activated";
6299
+ timestamp: string;
6300
+ policy_version: string;
6301
+ correlation_id?: string | undefined;
6302
+ session_id?: string | undefined;
6303
+ }, {
6304
+ id: string;
6305
+ ts: number;
6306
+ schema_version: 1;
6307
+ kind: "fabric-event";
6308
+ event_type: "cite_policy_activated";
6309
+ timestamp: string;
6310
+ policy_version: string;
6311
+ correlation_id?: string | undefined;
6312
+ session_id?: string | undefined;
6313
+ }>;
6314
+ declare const eventsRotatedEventSchema: z.ZodObject<{
6315
+ event_type: z.ZodLiteral<"events_rotated">;
6316
+ cutoff_ts: z.ZodString;
6317
+ archived_count: z.ZodNumber;
6318
+ kept_count: z.ZodNumber;
6319
+ archive_path: z.ZodString;
6320
+ kind: z.ZodLiteral<"fabric-event">;
6321
+ id: z.ZodString;
6322
+ ts: z.ZodNumber;
6323
+ schema_version: z.ZodLiteral<1>;
6324
+ correlation_id: z.ZodOptional<z.ZodString>;
6325
+ session_id: z.ZodOptional<z.ZodString>;
6326
+ }, "strip", z.ZodTypeAny, {
6327
+ id: string;
6328
+ ts: number;
6329
+ schema_version: 1;
6330
+ kind: "fabric-event";
6331
+ event_type: "events_rotated";
6332
+ cutoff_ts: string;
6333
+ archived_count: number;
6334
+ kept_count: number;
6335
+ archive_path: string;
6336
+ correlation_id?: string | undefined;
6337
+ session_id?: string | undefined;
6338
+ }, {
6339
+ id: string;
6340
+ ts: number;
6341
+ schema_version: 1;
6342
+ kind: "fabric-event";
6343
+ event_type: "events_rotated";
6344
+ cutoff_ts: string;
6345
+ archived_count: number;
6346
+ kept_count: number;
6347
+ archive_path: string;
6348
+ correlation_id?: string | undefined;
6349
+ session_id?: string | undefined;
6350
+ }>;
6351
+ declare const knowledgeMetaAutoHealedEventSchema: z.ZodObject<{
6352
+ event_type: z.ZodLiteral<"knowledge_meta_auto_healed">;
6353
+ previous_revision_hash: z.ZodString;
6354
+ revision_hash: z.ZodString;
6355
+ trigger: z.ZodLiteral<"read">;
6356
+ caller: z.ZodOptional<z.ZodEnum<["planContext", "getKnowledgeSections", "getKnowledge", "extractKnowledge"]>>;
6357
+ kind: z.ZodLiteral<"fabric-event">;
6358
+ id: z.ZodString;
6359
+ ts: z.ZodNumber;
6360
+ schema_version: z.ZodLiteral<1>;
6361
+ correlation_id: z.ZodOptional<z.ZodString>;
6362
+ session_id: z.ZodOptional<z.ZodString>;
6363
+ }, "strip", z.ZodTypeAny, {
6364
+ id: string;
6365
+ revision_hash: string;
6366
+ previous_revision_hash: string;
6367
+ ts: number;
6368
+ schema_version: 1;
6369
+ kind: "fabric-event";
6370
+ event_type: "knowledge_meta_auto_healed";
6371
+ trigger: "read";
6372
+ correlation_id?: string | undefined;
6373
+ session_id?: string | undefined;
6374
+ caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
6375
+ }, {
6376
+ id: string;
6377
+ revision_hash: string;
6378
+ previous_revision_hash: string;
6379
+ ts: number;
6380
+ schema_version: 1;
6381
+ kind: "fabric-event";
6382
+ event_type: "knowledge_meta_auto_healed";
6383
+ trigger: "read";
6384
+ correlation_id?: string | undefined;
6385
+ session_id?: string | undefined;
6386
+ caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
6387
+ }>;
6153
6388
  declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.ZodObject<{
6154
6389
  event_type: z.ZodLiteral<"knowledge_context_planned">;
6155
6390
  target_paths: z.ZodArray<z.ZodString, "many">;
@@ -6547,6 +6782,45 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
6547
6782
  removed_from: string;
6548
6783
  correlation_id?: string | undefined;
6549
6784
  session_id?: string | undefined;
6785
+ }>, z.ZodObject<{
6786
+ event_type: z.ZodLiteral<"bootstrap_marker_migrated">;
6787
+ path: z.ZodString;
6788
+ migrated_count: z.ZodNumber;
6789
+ legacy_marker: z.ZodLiteral<"fabric:knowledge-base">;
6790
+ new_marker: z.ZodLiteral<"fabric:bootstrap">;
6791
+ timestamp: z.ZodString;
6792
+ kind: z.ZodLiteral<"fabric-event">;
6793
+ id: z.ZodString;
6794
+ ts: z.ZodNumber;
6795
+ schema_version: z.ZodLiteral<1>;
6796
+ correlation_id: z.ZodOptional<z.ZodString>;
6797
+ session_id: z.ZodOptional<z.ZodString>;
6798
+ }, "strip", z.ZodTypeAny, {
6799
+ path: string;
6800
+ id: string;
6801
+ ts: number;
6802
+ schema_version: 1;
6803
+ kind: "fabric-event";
6804
+ event_type: "bootstrap_marker_migrated";
6805
+ migrated_count: number;
6806
+ legacy_marker: "fabric:knowledge-base";
6807
+ new_marker: "fabric:bootstrap";
6808
+ timestamp: string;
6809
+ correlation_id?: string | undefined;
6810
+ session_id?: string | undefined;
6811
+ }, {
6812
+ path: string;
6813
+ id: string;
6814
+ ts: number;
6815
+ schema_version: 1;
6816
+ kind: "fabric-event";
6817
+ event_type: "bootstrap_marker_migrated";
6818
+ migrated_count: number;
6819
+ legacy_marker: "fabric:knowledge-base";
6820
+ new_marker: "fabric:bootstrap";
6821
+ timestamp: string;
6822
+ correlation_id?: string | undefined;
6823
+ session_id?: string | undefined;
6550
6824
  }>, z.ZodObject<{
6551
6825
  event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
6552
6826
  reconciled_files: z.ZodArray<z.ZodString, "many">;
@@ -6586,6 +6860,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
6586
6860
  duration_ms: z.ZodNumber;
6587
6861
  trigger: z.ZodEnum<["doctor", "manual"]>;
6588
6862
  source: z.ZodLiteral<"reconcileKnowledge">;
6863
+ force_write_reason: z.ZodOptional<z.ZodEnum<["revision_drift"]>>;
6589
6864
  kind: z.ZodLiteral<"fabric-event">;
6590
6865
  id: z.ZodString;
6591
6866
  ts: z.ZodNumber;
@@ -6604,6 +6879,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
6604
6879
  trigger: "manual" | "doctor";
6605
6880
  correlation_id?: string | undefined;
6606
6881
  session_id?: string | undefined;
6882
+ force_write_reason?: "revision_drift" | undefined;
6607
6883
  }, {
6608
6884
  id: string;
6609
6885
  source: "reconcileKnowledge";
@@ -6616,6 +6892,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
6616
6892
  trigger: "manual" | "doctor";
6617
6893
  correlation_id?: string | undefined;
6618
6894
  session_id?: string | undefined;
6895
+ force_write_reason?: "revision_drift" | undefined;
6619
6896
  }>, z.ZodObject<{
6620
6897
  event_type: z.ZodLiteral<"claude_skill_path_migrated">;
6621
6898
  from: z.ZodString;
@@ -7321,6 +7598,153 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
7321
7598
  touched_count: number;
7322
7599
  correlation_id?: string | undefined;
7323
7600
  session_id?: string | undefined;
7601
+ }>, z.ZodObject<{
7602
+ event_type: z.ZodLiteral<"assistant_turn_observed">;
7603
+ kb_line_raw: z.ZodNullable<z.ZodString>;
7604
+ cite_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
7605
+ cite_tags: z.ZodDefault<z.ZodArray<z.ZodEnum<["planned", "recalled", "chained-from", "dismissed", "none"]>, "many">>;
7606
+ client: z.ZodOptional<z.ZodEnum<["cc", "codex", "cursor"]>>;
7607
+ turn_id: z.ZodString;
7608
+ envelope_index: z.ZodOptional<z.ZodNumber>;
7609
+ timestamp: z.ZodString;
7610
+ kind: z.ZodLiteral<"fabric-event">;
7611
+ id: z.ZodString;
7612
+ ts: z.ZodNumber;
7613
+ schema_version: z.ZodLiteral<1>;
7614
+ correlation_id: z.ZodOptional<z.ZodString>;
7615
+ session_id: z.ZodOptional<z.ZodString>;
7616
+ }, "strip", z.ZodTypeAny, {
7617
+ id: string;
7618
+ ts: number;
7619
+ schema_version: 1;
7620
+ kind: "fabric-event";
7621
+ event_type: "assistant_turn_observed";
7622
+ timestamp: string;
7623
+ kb_line_raw: string | null;
7624
+ cite_ids: string[];
7625
+ cite_tags: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[];
7626
+ turn_id: string;
7627
+ correlation_id?: string | undefined;
7628
+ session_id?: string | undefined;
7629
+ client?: "cursor" | "cc" | "codex" | undefined;
7630
+ envelope_index?: number | undefined;
7631
+ }, {
7632
+ id: string;
7633
+ ts: number;
7634
+ schema_version: 1;
7635
+ kind: "fabric-event";
7636
+ event_type: "assistant_turn_observed";
7637
+ timestamp: string;
7638
+ kb_line_raw: string | null;
7639
+ turn_id: string;
7640
+ correlation_id?: string | undefined;
7641
+ session_id?: string | undefined;
7642
+ cite_ids?: string[] | undefined;
7643
+ cite_tags?: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[] | undefined;
7644
+ client?: "cursor" | "cc" | "codex" | undefined;
7645
+ envelope_index?: number | undefined;
7646
+ }>, z.ZodObject<{
7647
+ event_type: z.ZodLiteral<"cite_policy_activated">;
7648
+ policy_version: z.ZodString;
7649
+ timestamp: z.ZodString;
7650
+ kind: z.ZodLiteral<"fabric-event">;
7651
+ id: z.ZodString;
7652
+ ts: z.ZodNumber;
7653
+ schema_version: z.ZodLiteral<1>;
7654
+ correlation_id: z.ZodOptional<z.ZodString>;
7655
+ session_id: z.ZodOptional<z.ZodString>;
7656
+ }, "strip", z.ZodTypeAny, {
7657
+ id: string;
7658
+ ts: number;
7659
+ schema_version: 1;
7660
+ kind: "fabric-event";
7661
+ event_type: "cite_policy_activated";
7662
+ timestamp: string;
7663
+ policy_version: string;
7664
+ correlation_id?: string | undefined;
7665
+ session_id?: string | undefined;
7666
+ }, {
7667
+ id: string;
7668
+ ts: number;
7669
+ schema_version: 1;
7670
+ kind: "fabric-event";
7671
+ event_type: "cite_policy_activated";
7672
+ timestamp: string;
7673
+ policy_version: string;
7674
+ correlation_id?: string | undefined;
7675
+ session_id?: string | undefined;
7676
+ }>, z.ZodObject<{
7677
+ event_type: z.ZodLiteral<"knowledge_meta_auto_healed">;
7678
+ previous_revision_hash: z.ZodString;
7679
+ revision_hash: z.ZodString;
7680
+ trigger: z.ZodLiteral<"read">;
7681
+ caller: z.ZodOptional<z.ZodEnum<["planContext", "getKnowledgeSections", "getKnowledge", "extractKnowledge"]>>;
7682
+ kind: z.ZodLiteral<"fabric-event">;
7683
+ id: z.ZodString;
7684
+ ts: z.ZodNumber;
7685
+ schema_version: z.ZodLiteral<1>;
7686
+ correlation_id: z.ZodOptional<z.ZodString>;
7687
+ session_id: z.ZodOptional<z.ZodString>;
7688
+ }, "strip", z.ZodTypeAny, {
7689
+ id: string;
7690
+ revision_hash: string;
7691
+ previous_revision_hash: string;
7692
+ ts: number;
7693
+ schema_version: 1;
7694
+ kind: "fabric-event";
7695
+ event_type: "knowledge_meta_auto_healed";
7696
+ trigger: "read";
7697
+ correlation_id?: string | undefined;
7698
+ session_id?: string | undefined;
7699
+ caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
7700
+ }, {
7701
+ id: string;
7702
+ revision_hash: string;
7703
+ previous_revision_hash: string;
7704
+ ts: number;
7705
+ schema_version: 1;
7706
+ kind: "fabric-event";
7707
+ event_type: "knowledge_meta_auto_healed";
7708
+ trigger: "read";
7709
+ correlation_id?: string | undefined;
7710
+ session_id?: string | undefined;
7711
+ caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
7712
+ }>, z.ZodObject<{
7713
+ event_type: z.ZodLiteral<"events_rotated">;
7714
+ cutoff_ts: z.ZodString;
7715
+ archived_count: z.ZodNumber;
7716
+ kept_count: z.ZodNumber;
7717
+ archive_path: z.ZodString;
7718
+ kind: z.ZodLiteral<"fabric-event">;
7719
+ id: z.ZodString;
7720
+ ts: z.ZodNumber;
7721
+ schema_version: z.ZodLiteral<1>;
7722
+ correlation_id: z.ZodOptional<z.ZodString>;
7723
+ session_id: z.ZodOptional<z.ZodString>;
7724
+ }, "strip", z.ZodTypeAny, {
7725
+ id: string;
7726
+ ts: number;
7727
+ schema_version: 1;
7728
+ kind: "fabric-event";
7729
+ event_type: "events_rotated";
7730
+ cutoff_ts: string;
7731
+ archived_count: number;
7732
+ kept_count: number;
7733
+ archive_path: string;
7734
+ correlation_id?: string | undefined;
7735
+ session_id?: string | undefined;
7736
+ }, {
7737
+ id: string;
7738
+ ts: number;
7739
+ schema_version: 1;
7740
+ kind: "fabric-event";
7741
+ event_type: "events_rotated";
7742
+ cutoff_ts: string;
7743
+ archived_count: number;
7744
+ kept_count: number;
7745
+ archive_path: string;
7746
+ correlation_id?: string | undefined;
7747
+ session_id?: string | undefined;
7324
7748
  }>]>;
7325
7749
  type KnowledgeContextPlannedEvent = z.infer<typeof knowledgeContextPlannedEventSchema>;
7326
7750
  type KnowledgeSelectionEvent = z.infer<typeof knowledgeSelectionEventSchema>;
@@ -7331,6 +7755,7 @@ type McpEventLedgerEvent = z.infer<typeof mcpEventLedgerEventSchema>;
7331
7755
  type ReapplyCompletedEvent = z.infer<typeof reapplyCompletedEventSchema>;
7332
7756
  type EventLedgerTruncatedEvent = z.infer<typeof eventLedgerTruncatedEventSchema>;
7333
7757
  type McpConfigMigratedEvent = z.infer<typeof mcpConfigMigratedEventSchema>;
7758
+ type BootstrapMarkerMigratedEvent = z.infer<typeof bootstrapMarkerMigratedEventSchema>;
7334
7759
  type MetaReconciledOnStartupEvent = z.infer<typeof metaReconciledOnStartupEventSchema>;
7335
7760
  type MetaReconciledEvent = z.infer<typeof metaReconciledEventSchema>;
7336
7761
  type ClaudeSkillPathMigratedEvent = z.infer<typeof claudeSkillPathMigratedEventSchema>;
@@ -7354,9 +7779,13 @@ type PendingAutoArchivedEvent = z.infer<typeof pendingAutoArchivedEventSchema>;
7354
7779
  type KnowledgePathDangledEvent = z.infer<typeof knowledgePathDangledEventSchema>;
7355
7780
  type DoctorRunEvent = z.infer<typeof doctorRunEventSchema>;
7356
7781
  type RelevanceMigrationRunEvent = z.infer<typeof relevanceMigrationRunEventSchema>;
7357
- type EventLedgerEvent = KnowledgeContextPlannedEvent | KnowledgeSelectionEvent | KnowledgeSectionsFetchedEvent | EditIntentCheckedEvent | KnowledgeDriftDetectedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | ClaudeHookPathMigratedEvent | CodexSkillPathMigratedEvent | InitScanCompletedEvent | KnowledgeProposedEvent | KnowledgePromoteStartedEvent | KnowledgePromotedEvent | KnowledgePromoteFailedEvent | KnowledgeLayerChangedEvent | KnowledgeSlugRenamedEvent | KnowledgeDemotedEvent | KnowledgeArchivedEvent | KnowledgeArchiveAttemptedEvent | KnowledgeDeferredEvent | KnowledgeRejectedEvent | KnowledgeConsumedEvent | KnowledgeScopeDegradedEvent | PendingAutoArchivedEvent | KnowledgePathDangledEvent | DoctorRunEvent | RelevanceMigrationRunEvent;
7782
+ type AssistantTurnObservedEvent = z.infer<typeof assistantTurnObservedEventSchema>;
7783
+ type CitePolicyActivatedEvent = z.infer<typeof citePolicyActivatedEventSchema>;
7784
+ type KnowledgeMetaAutoHealedEvent = z.infer<typeof knowledgeMetaAutoHealedEventSchema>;
7785
+ type EventsRotatedEvent = z.infer<typeof eventsRotatedEventSchema>;
7786
+ type EventLedgerEvent = KnowledgeContextPlannedEvent | KnowledgeSelectionEvent | KnowledgeSectionsFetchedEvent | EditIntentCheckedEvent | KnowledgeDriftDetectedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | BootstrapMarkerMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | ClaudeHookPathMigratedEvent | CodexSkillPathMigratedEvent | InitScanCompletedEvent | KnowledgeProposedEvent | KnowledgePromoteStartedEvent | KnowledgePromotedEvent | KnowledgePromoteFailedEvent | KnowledgeLayerChangedEvent | KnowledgeSlugRenamedEvent | KnowledgeDemotedEvent | KnowledgeArchivedEvent | KnowledgeArchiveAttemptedEvent | KnowledgeDeferredEvent | KnowledgeRejectedEvent | KnowledgeConsumedEvent | KnowledgeScopeDegradedEvent | PendingAutoArchivedEvent | KnowledgePathDangledEvent | DoctorRunEvent | RelevanceMigrationRunEvent | AssistantTurnObservedEvent | CitePolicyActivatedEvent | KnowledgeMetaAutoHealedEvent | EventsRotatedEvent;
7358
7787
  type EventLedgerEventType = EventLedgerEvent["event_type"];
7359
7788
  type EventLedgerEventInputFor<T extends EventLedgerEvent> = T extends EventLedgerEvent ? Omit<T, "kind" | "id" | "ts" | "schema_version" | "correlation_id" | "session_id"> & Partial<Pick<T, "id" | "ts" | "correlation_id" | "session_id">> : never;
7360
7789
  type EventLedgerEventInput = EventLedgerEventInputFor<EventLedgerEvent>;
7361
7790
 
7362
- export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, type AgentsMetaCounters, AgentsMetaCountersSchema, AgentsMetaNode, AgentsTopologyType, type CandidateFileEntry, type CandidateFileFamily, type ClaudeHookPathMigratedEvent, type ClaudeSkillPathMigratedEvent, type CodexSkillPathMigratedEvent, type DoctorRunEvent, type DriftDetectedEvent, type EditIntentCheckedEvent, type EventLedgerEvent, type EventLedgerEventInput, type EventLedgerEventType, type EventLedgerTruncatedEvent, type FabricEvent, type ForensicAssertion, type ForensicAssertionConfidence, type ForensicAssertionCoverage, type ForensicAssertionType, type ForensicCodeSample, type ForensicEntryPoint, type ForensicEvidenceAnchor, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicSamplingBudget, type ForensicTopology, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type InitContextInvariantConfidenceSnapshot, type InitContextSourceEvidence, type InitScanCompletedEvent, KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION, type KnowledgeArchiveAttemptedEvent, type KnowledgeArchivedEvent, type KnowledgeConsumedEvent, type KnowledgeContextPlannedEvent, type KnowledgeDeferredEvent, type KnowledgeDemotedEvent, type KnowledgeDriftDetectedEvent, type KnowledgeLayerChangedEvent, type KnowledgePathDangledEvent, type KnowledgePromoteFailedEvent, type KnowledgePromoteStartedEvent, type KnowledgePromotedEvent, type KnowledgeProposedEvent, type KnowledgeRejectedEvent, type KnowledgeScopeDegradedEvent, type KnowledgeSectionsFetchedEvent, type KnowledgeSelectionEvent, type KnowledgeSlugRenamedEvent, type KnowledgeTestIndex, type KnowledgeTestLink, type KnowledgeTestOrphanAnnotation, KnowledgeType, Layer, type LedgerAppendedEvent, LedgerEntry, type LockApprovedEvent, type LockDriftEvent, type McpConfigMigratedEvent, type McpEventLedgerEvent, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, type PendingAutoArchivedEvent, type ReapplyCompletedEvent, type RelevanceMigrationRunEvent, StableId, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aiLedgerEntrySchema, allocateKnowledgeId, auditModeSchema, candidateFileEntrySchema, claudeHookPathMigratedEventSchema, claudeSkillPathMigratedEventSchema, clientPathsSchema, codexSkillPathMigratedEventSchema, defaultAgentsMetaCounters, defaultLayerFilterSchema, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, doctorRunEventSchema, driftDetectedEventSchema, editIntentCheckedEventSchema, eventLedgerEventSchema, eventLedgerTruncatedEventSchema, fabricConfigSchema, fabricEventSchema, fabricLanguageSchema, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, humanLedgerEntrySchema, humanLockEntrySchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, initScanCompletedEventSchema, isKnowledgeStableId, knowledgeArchiveAttemptedEventSchema, knowledgeArchivedEventSchema, knowledgeConsumedEventSchema, knowledgeContextPlannedEventSchema, knowledgeDeferredEventSchema, knowledgeDemotedEventSchema, knowledgeDriftDetectedEventSchema, knowledgeLayerChangedEventSchema, knowledgePathDangledEventSchema, knowledgePromoteFailedEventSchema, knowledgePromoteStartedEventSchema, knowledgePromotedEventSchema, knowledgeProposedEventSchema, knowledgeRejectedEventSchema, knowledgeScopeDegradedEventSchema, knowledgeSectionsFetchedEventSchema, knowledgeSelectionEventSchema, knowledgeSlugRenamedEventSchema, knowledgeTestIndexSchema, knowledgeTestLinkSchema, knowledgeTestOrphanAnnotationSchema, ledgerAppendedEventSchema, ledgerEntrySchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, mcpPayloadLimitsSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, pendingAutoArchivedEventSchema, reapplyCompletedEventSchema, relevanceMigrationRunEventSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, withDerivedAgentsMetaNodeDefaults };
7791
+ export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, type AgentsMetaCounters, AgentsMetaCountersSchema, AgentsMetaNode, AgentsTopologyType, type AssistantTurnObservedEvent, type BootstrapMarkerMigratedEvent, type CandidateFileEntry, type CandidateFileFamily, type CitePolicyActivatedEvent, type ClaudeHookPathMigratedEvent, type ClaudeSkillPathMigratedEvent, type CodexSkillPathMigratedEvent, type DoctorRunEvent, type DriftDetectedEvent, type EditIntentCheckedEvent, type EventLedgerEvent, type EventLedgerEventInput, type EventLedgerEventType, type EventLedgerTruncatedEvent, type EventsRotatedEvent, type FabricConfigSchemaShape, type FabricEvent, type ForensicAssertion, type ForensicAssertionConfidence, type ForensicAssertionCoverage, type ForensicAssertionType, type ForensicCodeSample, type ForensicEntryPoint, type ForensicEvidenceAnchor, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicSamplingBudget, type ForensicTopology, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type InitContextInvariantConfidenceSnapshot, type InitContextSourceEvidence, type InitScanCompletedEvent, KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION, type KnowledgeArchiveAttemptedEvent, type KnowledgeArchivedEvent, type KnowledgeConsumedEvent, type KnowledgeContextPlannedEvent, type KnowledgeDeferredEvent, type KnowledgeDemotedEvent, type KnowledgeDriftDetectedEvent, type KnowledgeLayerChangedEvent, type KnowledgeMetaAutoHealedEvent, type KnowledgePathDangledEvent, type KnowledgePromoteFailedEvent, type KnowledgePromoteStartedEvent, type KnowledgePromotedEvent, type KnowledgeProposedEvent, type KnowledgeRejectedEvent, type KnowledgeScopeDegradedEvent, type KnowledgeSectionsFetchedEvent, type KnowledgeSelectionEvent, type KnowledgeSlugRenamedEvent, type KnowledgeTestIndex, type KnowledgeTestLink, type KnowledgeTestOrphanAnnotation, KnowledgeType, Layer, type LedgerAppendedEvent, LedgerEntry, type LockApprovedEvent, type LockDriftEvent, type McpConfigMigratedEvent, type McpEventLedgerEvent, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, type PanelFieldGroup, type PanelFieldMeta, type PendingAutoArchivedEvent, type ReapplyCompletedEvent, type RelevanceMigrationRunEvent, StableId, type ValidateResult, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aiLedgerEntrySchema, allocateKnowledgeId, assistantTurnObservedEventSchema, auditModeSchema, bootstrapMarkerMigratedEventSchema, candidateFileEntrySchema, citePolicyActivatedEventSchema, claudeHookPathMigratedEventSchema, claudeSkillPathMigratedEventSchema, clientPathsSchema, codexSkillPathMigratedEventSchema, defaultAgentsMetaCounters, defaultLayerFilterSchema, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, doctorRunEventSchema, driftDetectedEventSchema, editIntentCheckedEventSchema, eventLedgerEventSchema, eventLedgerTruncatedEventSchema, eventsRotatedEventSchema, fabricConfigSchema, fabricEventSchema, fabricLanguageSchema, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, getPanelFieldByKey, getPanelFields, humanLedgerEntrySchema, humanLockEntrySchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, initScanCompletedEventSchema, isKnowledgeStableId, knowledgeArchiveAttemptedEventSchema, knowledgeArchivedEventSchema, knowledgeConsumedEventSchema, knowledgeContextPlannedEventSchema, knowledgeDeferredEventSchema, knowledgeDemotedEventSchema, knowledgeDriftDetectedEventSchema, knowledgeLayerChangedEventSchema, knowledgeMetaAutoHealedEventSchema, knowledgePathDangledEventSchema, knowledgePromoteFailedEventSchema, knowledgePromoteStartedEventSchema, knowledgePromotedEventSchema, knowledgeProposedEventSchema, knowledgeRejectedEventSchema, knowledgeScopeDegradedEventSchema, knowledgeSectionsFetchedEventSchema, knowledgeSelectionEventSchema, knowledgeSlugRenamedEventSchema, knowledgeTestIndexSchema, knowledgeTestLinkSchema, knowledgeTestOrphanAnnotationSchema, ledgerAppendedEventSchema, ledgerEntrySchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, mcpPayloadLimitsSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, pendingAutoArchivedEventSchema, reapplyCompletedEventSchema, relevanceMigrationRunEventSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, withDerivedAgentsMetaNodeDefaults };