@c4a/context 0.7.5 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +12 -4
  2. package/README.zh-CN.md +11 -4
  3. package/docs/README.md +13 -1
  4. package/docs/README.zh-CN.md +13 -1
  5. package/docs/getting-started.md +95 -69
  6. package/docs/guides/agent-dialogue.md +20 -9
  7. package/docs/guides/agent-guide.md +48 -10
  8. package/docs/guides/code-indexer-skill-authoring.md +42 -11
  9. package/docs/guides/indexer-manifest-example.md +103 -0
  10. package/docs/guides/indexer-provider-and-customization.md +334 -15
  11. package/docs/guides/indexer-skill-creation.md +99 -0
  12. package/docs/guides/knowledge-updates.md +422 -0
  13. package/docs/guides/lark-resources.md +5 -1
  14. package/docs/guides/markdown-indexer-skill-authoring.md +16 -7
  15. package/docs/guides/note.md +37 -0
  16. package/docs/guides/package-outputs.md +231 -60
  17. package/docs/guides/sessions.md +50 -0
  18. package/docs/guides/workspace-commit.md +45 -0
  19. package/docs/guides/workspace-prepare.md +72 -0
  20. package/docs/guides/workspace-restore.md +59 -0
  21. package/docs/reference/code-extractors.md +23 -11
  22. package/docs/reference/indexer-provider-protocol.md +135 -22
  23. package/docs/reference/package-templates.md +10 -9
  24. package/docs/reference/project-api.md +100 -13
  25. package/docs/reference/template-variables.md +7 -7
  26. package/index.d.ts +15 -0
  27. package/index.js +1708 -626
  28. package/indexerAgentStepProtocol.d.ts +44 -0
  29. package/indexerApprovedKnowledge.d.ts +371 -0
  30. package/indexerArticlePlan.d.ts +83 -0
  31. package/indexerArtifact.d.ts +10 -7
  32. package/indexerArtifactDependencies.d.ts +5 -5
  33. package/indexerArtifactPolicy.d.ts +12 -12
  34. package/indexerArtifactResult.d.ts +76 -69
  35. package/indexerAuthoringFixture.d.ts +8 -8
  36. package/indexerAuthorizedWorksetView.d.ts +14 -14
  37. package/indexerBaseQuestionAmendment.d.ts +40 -0
  38. package/indexerCandidateCompile.d.ts +46 -36
  39. package/indexerCatalogFallback.d.ts +566 -48
  40. package/indexerContentLayers.d.ts +6 -4
  41. package/indexerContractDeclaration.d.ts +3 -0
  42. package/indexerControlledProgram.d.ts +1039 -238
  43. package/indexerCustomizationDraft.d.ts +188 -0
  44. package/indexerDependencyView.d.ts +17 -17
  45. package/indexerEffectiveArtifact.d.ts +26 -15
  46. package/indexerExampleFactDependencies.d.ts +17 -0
  47. package/indexerExampleIdentityAudit.d.ts +2 -2
  48. package/indexerInventoryDisposition.d.ts +44 -44
  49. package/indexerKnowledgeDependency.d.ts +46 -0
  50. package/indexerLayerComposition.d.ts +92 -54
  51. package/indexerLayoutChange.d.ts +8 -8
  52. package/indexerLayoutProposalSet.d.ts +15 -10
  53. package/indexerLayoutResolver.d.ts +15 -6
  54. package/indexerLayoutTransition.d.ts +8 -8
  55. package/indexerLifecycle.d.ts +1 -1
  56. package/indexerMainRunLedger.d.ts +3 -0
  57. package/indexerMainRunProtocol.d.ts +872 -196
  58. package/indexerMainWorkset.d.ts +50 -0
  59. package/indexerNavigationArtifactPlan.d.ts +2 -2
  60. package/indexerOverlayQuestionAmendment.d.ts +56 -16
  61. package/indexerOverlayQuestionApplyProposal.d.ts +98 -26
  62. package/indexerPartitionPlan.d.ts +585 -40
  63. package/indexerPhysicalArtifactAudit.d.ts +2 -2
  64. package/indexerPhysicalArtifactManifest.d.ts +24 -24
  65. package/indexerPostAuthorRunLedger.d.ts +60 -34
  66. package/indexerPrimaryProjection.d.ts +2 -2
  67. package/indexerProfileContract.d.ts +28 -28
  68. package/indexerProgramRunProtocol.d.ts +868 -194
  69. package/indexerProjectProposal.d.ts +36 -8
  70. package/indexerProjectedArtifactFanOutAudit.d.ts +2 -2
  71. package/indexerProtocolHash.d.ts +2 -0
  72. package/indexerProvider.d.ts +102 -58
  73. package/indexerProviderComposition.d.ts +4 -4
  74. package/indexerProviderRouting.d.ts +52 -0
  75. package/indexerProviderSelectionProposal.d.ts +48 -0
  76. package/indexerPublicContractFacts.d.ts +7 -0
  77. package/indexerPublicContractTable.d.ts +11 -0
  78. package/indexerReaderTargetInventory.d.ts +6 -6
  79. package/indexerReferenceOnlyAudit.d.ts +2 -2
  80. package/indexerRegistry.d.ts +658 -0
  81. package/indexerRequirementConfirmation.d.ts +48 -16
  82. package/indexerRequirementLifecycle.d.ts +154 -42
  83. package/indexerResultReconciliation.d.ts +12 -11
  84. package/indexerSemanticInput.d.ts +27168 -3813
  85. package/{indexerGeneratedAuthoringAudit.d.ts → indexerStructuredClaims.d.ts} +0 -84
  86. package/indexerStructuredDeclaration.d.ts +8 -8
  87. package/indexerTemplateRendering.d.ts +7 -7
  88. package/indexerToolSnapshot.d.ts +16 -16
  89. package/knowledgeMap.d.ts +188 -0
  90. package/managedSources.d.ts +15 -0
  91. package/package.json +1 -1
  92. package/packageSite.d.ts +25 -0
  93. package/phases.d.ts +0 -3
  94. package/processedScopes.d.ts +75 -0
  95. package/sessionMetadata.d.ts +49 -0
  96. package/sources.d.ts +9 -3
  97. package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +15 -10
  98. package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +8 -8
@@ -48,16 +48,19 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
48
48
  repair_intent: z.ZodOptional<z.ZodObject<{
49
49
  target_ref: z.ZodString;
50
50
  instruction: z.ZodString;
51
+ current_markdown: z.ZodOptional<z.ZodString>;
51
52
  } & {
52
53
  intent_digest: z.ZodString;
53
54
  }, "strict", z.ZodTypeAny, {
54
55
  target_ref: string;
55
56
  instruction: string;
56
57
  intent_digest: string;
58
+ current_markdown?: string | undefined;
57
59
  }, {
58
60
  target_ref: string;
59
61
  instruction: string;
60
62
  intent_digest: string;
63
+ current_markdown?: string | undefined;
61
64
  }>>;
62
65
  }, "strict", z.ZodTypeAny, {
63
66
  source_ref: string;
@@ -93,6 +96,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
93
96
  target_ref: string;
94
97
  instruction: string;
95
98
  intent_digest: string;
99
+ current_markdown?: string | undefined;
96
100
  } | undefined;
97
101
  }, {
98
102
  source_ref: string;
@@ -128,6 +132,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
128
132
  target_ref: string;
129
133
  instruction: string;
130
134
  intent_digest: string;
135
+ current_markdown?: string | undefined;
131
136
  } | undefined;
132
137
  }>, {
133
138
  source_ref: string;
@@ -163,6 +168,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
163
168
  target_ref: string;
164
169
  instruction: string;
165
170
  intent_digest: string;
171
+ current_markdown?: string | undefined;
166
172
  } | undefined;
167
173
  }, {
168
174
  source_ref: string;
@@ -198,6 +204,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
198
204
  target_ref: string;
199
205
  instruction: string;
200
206
  intent_digest: string;
207
+ current_markdown?: string | undefined;
201
208
  } | undefined;
202
209
  }>, z.ZodEffects<z.ZodObject<{
203
210
  stage: z.ZodLiteral<"author">;
@@ -403,16 +410,19 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
403
410
  repair_intent: z.ZodOptional<z.ZodObject<{
404
411
  target_ref: z.ZodString;
405
412
  instruction: z.ZodString;
413
+ current_markdown: z.ZodOptional<z.ZodString>;
406
414
  } & {
407
415
  intent_digest: z.ZodString;
408
416
  }, "strict", z.ZodTypeAny, {
409
417
  target_ref: string;
410
418
  instruction: string;
411
419
  intent_digest: string;
420
+ current_markdown?: string | undefined;
412
421
  }, {
413
422
  target_ref: string;
414
423
  instruction: string;
415
424
  intent_digest: string;
425
+ current_markdown?: string | undefined;
416
426
  }>>;
417
427
  }, "strict", z.ZodTypeAny, {
418
428
  source_ref: string;
@@ -446,6 +456,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
446
456
  target_ref: string;
447
457
  instruction: string;
448
458
  intent_digest: string;
459
+ current_markdown?: string | undefined;
449
460
  } | undefined;
450
461
  target_resolution_view?: {
451
462
  entries: ({
@@ -504,6 +515,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
504
515
  target_ref: string;
505
516
  instruction: string;
506
517
  intent_digest: string;
518
+ current_markdown?: string | undefined;
507
519
  } | undefined;
508
520
  target_resolution_view?: {
509
521
  entries: ({
@@ -562,6 +574,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
562
574
  target_ref: string;
563
575
  instruction: string;
564
576
  intent_digest: string;
577
+ current_markdown?: string | undefined;
565
578
  } | undefined;
566
579
  target_resolution_view?: {
567
580
  entries: ({
@@ -620,6 +633,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
620
633
  target_ref: string;
621
634
  instruction: string;
622
635
  intent_digest: string;
636
+ current_markdown?: string | undefined;
623
637
  } | undefined;
624
638
  target_resolution_view?: {
625
639
  entries: ({
@@ -683,6 +697,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
683
697
  target_ref: string;
684
698
  instruction: string;
685
699
  intent_digest: string;
700
+ current_markdown?: string | undefined;
686
701
  } | undefined;
687
702
  } | {
688
703
  source_ref: string;
@@ -716,6 +731,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
716
731
  target_ref: string;
717
732
  instruction: string;
718
733
  intent_digest: string;
734
+ current_markdown?: string | undefined;
719
735
  } | undefined;
720
736
  target_resolution_view?: {
721
737
  entries: ({
@@ -779,6 +795,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
779
795
  target_ref: string;
780
796
  instruction: string;
781
797
  intent_digest: string;
798
+ current_markdown?: string | undefined;
782
799
  } | undefined;
783
800
  } | {
784
801
  source_ref: string;
@@ -812,6 +829,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
812
829
  target_ref: string;
813
830
  instruction: string;
814
831
  intent_digest: string;
832
+ current_markdown?: string | undefined;
815
833
  } | undefined;
816
834
  target_resolution_view?: {
817
835
  entries: ({
@@ -903,6 +921,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
903
921
  target_ref: string;
904
922
  instruction: string;
905
923
  intent_digest: string;
924
+ current_markdown?: string | undefined;
906
925
  } | undefined;
907
926
  } | {
908
927
  source_ref: string;
@@ -936,6 +955,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
936
955
  target_ref: string;
937
956
  instruction: string;
938
957
  intent_digest: string;
958
+ current_markdown?: string | undefined;
939
959
  } | undefined;
940
960
  target_resolution_view?: {
941
961
  entries: ({
@@ -1013,6 +1033,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
1013
1033
  target_ref: string;
1014
1034
  instruction: string;
1015
1035
  intent_digest: string;
1036
+ current_markdown?: string | undefined;
1016
1037
  } | undefined;
1017
1038
  } | {
1018
1039
  source_ref: string;
@@ -1046,6 +1067,7 @@ declare const indexerMainAgentStepInputSchema: z.ZodObject<{
1046
1067
  target_ref: string;
1047
1068
  instruction: string;
1048
1069
  intent_digest: string;
1070
+ current_markdown?: string | undefined;
1049
1071
  } | undefined;
1050
1072
  target_resolution_view?: {
1051
1073
  entries: ({
@@ -1182,16 +1204,19 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1182
1204
  repair_intent: z.ZodOptional<z.ZodObject<{
1183
1205
  target_ref: z.ZodString;
1184
1206
  instruction: z.ZodString;
1207
+ current_markdown: z.ZodOptional<z.ZodString>;
1185
1208
  } & {
1186
1209
  intent_digest: z.ZodString;
1187
1210
  }, "strict", z.ZodTypeAny, {
1188
1211
  target_ref: string;
1189
1212
  instruction: string;
1190
1213
  intent_digest: string;
1214
+ current_markdown?: string | undefined;
1191
1215
  }, {
1192
1216
  target_ref: string;
1193
1217
  instruction: string;
1194
1218
  intent_digest: string;
1219
+ current_markdown?: string | undefined;
1195
1220
  }>>;
1196
1221
  }, "strict", z.ZodTypeAny, {
1197
1222
  source_ref: string;
@@ -1227,6 +1252,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1227
1252
  target_ref: string;
1228
1253
  instruction: string;
1229
1254
  intent_digest: string;
1255
+ current_markdown?: string | undefined;
1230
1256
  } | undefined;
1231
1257
  }, {
1232
1258
  source_ref: string;
@@ -1262,6 +1288,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1262
1288
  target_ref: string;
1263
1289
  instruction: string;
1264
1290
  intent_digest: string;
1291
+ current_markdown?: string | undefined;
1265
1292
  } | undefined;
1266
1293
  }>, {
1267
1294
  source_ref: string;
@@ -1297,6 +1324,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1297
1324
  target_ref: string;
1298
1325
  instruction: string;
1299
1326
  intent_digest: string;
1327
+ current_markdown?: string | undefined;
1300
1328
  } | undefined;
1301
1329
  }, {
1302
1330
  source_ref: string;
@@ -1332,6 +1360,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1332
1360
  target_ref: string;
1333
1361
  instruction: string;
1334
1362
  intent_digest: string;
1363
+ current_markdown?: string | undefined;
1335
1364
  } | undefined;
1336
1365
  }>, z.ZodEffects<z.ZodObject<{
1337
1366
  stage: z.ZodLiteral<"author">;
@@ -1537,16 +1566,19 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1537
1566
  repair_intent: z.ZodOptional<z.ZodObject<{
1538
1567
  target_ref: z.ZodString;
1539
1568
  instruction: z.ZodString;
1569
+ current_markdown: z.ZodOptional<z.ZodString>;
1540
1570
  } & {
1541
1571
  intent_digest: z.ZodString;
1542
1572
  }, "strict", z.ZodTypeAny, {
1543
1573
  target_ref: string;
1544
1574
  instruction: string;
1545
1575
  intent_digest: string;
1576
+ current_markdown?: string | undefined;
1546
1577
  }, {
1547
1578
  target_ref: string;
1548
1579
  instruction: string;
1549
1580
  intent_digest: string;
1581
+ current_markdown?: string | undefined;
1550
1582
  }>>;
1551
1583
  }, "strict", z.ZodTypeAny, {
1552
1584
  source_ref: string;
@@ -1580,6 +1612,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1580
1612
  target_ref: string;
1581
1613
  instruction: string;
1582
1614
  intent_digest: string;
1615
+ current_markdown?: string | undefined;
1583
1616
  } | undefined;
1584
1617
  target_resolution_view?: {
1585
1618
  entries: ({
@@ -1638,6 +1671,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1638
1671
  target_ref: string;
1639
1672
  instruction: string;
1640
1673
  intent_digest: string;
1674
+ current_markdown?: string | undefined;
1641
1675
  } | undefined;
1642
1676
  target_resolution_view?: {
1643
1677
  entries: ({
@@ -1696,6 +1730,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1696
1730
  target_ref: string;
1697
1731
  instruction: string;
1698
1732
  intent_digest: string;
1733
+ current_markdown?: string | undefined;
1699
1734
  } | undefined;
1700
1735
  target_resolution_view?: {
1701
1736
  entries: ({
@@ -1754,6 +1789,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1754
1789
  target_ref: string;
1755
1790
  instruction: string;
1756
1791
  intent_digest: string;
1792
+ current_markdown?: string | undefined;
1757
1793
  } | undefined;
1758
1794
  target_resolution_view?: {
1759
1795
  entries: ({
@@ -1817,6 +1853,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1817
1853
  target_ref: string;
1818
1854
  instruction: string;
1819
1855
  intent_digest: string;
1856
+ current_markdown?: string | undefined;
1820
1857
  } | undefined;
1821
1858
  } | {
1822
1859
  source_ref: string;
@@ -1850,6 +1887,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1850
1887
  target_ref: string;
1851
1888
  instruction: string;
1852
1889
  intent_digest: string;
1890
+ current_markdown?: string | undefined;
1853
1891
  } | undefined;
1854
1892
  target_resolution_view?: {
1855
1893
  entries: ({
@@ -1913,6 +1951,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1913
1951
  target_ref: string;
1914
1952
  instruction: string;
1915
1953
  intent_digest: string;
1954
+ current_markdown?: string | undefined;
1916
1955
  } | undefined;
1917
1956
  } | {
1918
1957
  source_ref: string;
@@ -1946,6 +1985,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
1946
1985
  target_ref: string;
1947
1986
  instruction: string;
1948
1987
  intent_digest: string;
1988
+ current_markdown?: string | undefined;
1949
1989
  } | undefined;
1950
1990
  target_resolution_view?: {
1951
1991
  entries: ({
@@ -2037,6 +2077,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
2037
2077
  target_ref: string;
2038
2078
  instruction: string;
2039
2079
  intent_digest: string;
2080
+ current_markdown?: string | undefined;
2040
2081
  } | undefined;
2041
2082
  } | {
2042
2083
  source_ref: string;
@@ -2070,6 +2111,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
2070
2111
  target_ref: string;
2071
2112
  instruction: string;
2072
2113
  intent_digest: string;
2114
+ current_markdown?: string | undefined;
2073
2115
  } | undefined;
2074
2116
  target_resolution_view?: {
2075
2117
  entries: ({
@@ -2147,6 +2189,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
2147
2189
  target_ref: string;
2148
2190
  instruction: string;
2149
2191
  intent_digest: string;
2192
+ current_markdown?: string | undefined;
2150
2193
  } | undefined;
2151
2194
  } | {
2152
2195
  source_ref: string;
@@ -2180,6 +2223,7 @@ export declare const indexerAgentStepInputSchema: z.ZodDiscriminatedUnion<"stage
2180
2223
  target_ref: string;
2181
2224
  instruction: string;
2182
2225
  intent_digest: string;
2226
+ current_markdown?: string | undefined;
2183
2227
  } | undefined;
2184
2228
  target_resolution_view?: {
2185
2229
  entries: ({
@@ -0,0 +1,371 @@
1
+ import { z } from "zod";
2
+ import { type IndexerSubjectKey } from "./indexerSubjectIdentity.js";
3
+ import { type IndexerKnowledgeDependency } from "./indexerKnowledgeDependency.js";
4
+ export declare const indexerApprovedKnowledgeSchema: z.ZodObject<{
5
+ protocol: z.ZodLiteral<"context.indexer.approved-knowledge/v1">;
6
+ artifact_ref: z.ZodString;
7
+ subject_key: z.ZodObject<{
8
+ protocol: z.ZodLiteral<"context.subject-key/v1">;
9
+ namespace: z.ZodEffects<z.ZodString, string, string>;
10
+ kind: z.ZodEffects<z.ZodString, string, string>;
11
+ local_key: z.ZodEffects<z.ZodString, string, string>;
12
+ }, "strict", z.ZodTypeAny, {
13
+ kind: string;
14
+ namespace: string;
15
+ protocol: "context.subject-key/v1";
16
+ local_key: string;
17
+ }, {
18
+ kind: string;
19
+ namespace: string;
20
+ protocol: "context.subject-key/v1";
21
+ local_key: string;
22
+ }>;
23
+ primary_indexer_id: z.ZodOptional<z.ZodString>;
24
+ path: z.ZodEffects<z.ZodString, string, string>;
25
+ approved_content_digest: z.ZodString;
26
+ source_versions: z.ZodArray<z.ZodObject<{
27
+ source_ref: z.ZodString;
28
+ module_ref: z.ZodNullable<z.ZodString>;
29
+ version: z.ZodString;
30
+ }, "strict", z.ZodTypeAny, {
31
+ source_ref: string;
32
+ version: string;
33
+ module_ref: string | null;
34
+ }, {
35
+ source_ref: string;
36
+ version: string;
37
+ module_ref: string | null;
38
+ }>, "many">;
39
+ sections: z.ZodArray<z.ZodObject<{
40
+ section_ref: z.ZodString;
41
+ section_key: z.ZodOptional<z.ZodString>;
42
+ markdown: z.ZodString;
43
+ fact_refs: z.ZodArray<z.ZodString, "many">;
44
+ evidence_refs: z.ZodArray<z.ZodString, "many">;
45
+ }, "strict", z.ZodTypeAny, {
46
+ evidence_refs: string[];
47
+ fact_refs: string[];
48
+ markdown: string;
49
+ section_ref: string;
50
+ section_key?: string | undefined;
51
+ }, {
52
+ evidence_refs: string[];
53
+ fact_refs: string[];
54
+ markdown: string;
55
+ section_ref: string;
56
+ section_key?: string | undefined;
57
+ }>, "many">;
58
+ facts: z.ZodArray<z.ZodObject<{
59
+ fact_ref: z.ZodString;
60
+ fact_kind: z.ZodEffects<z.ZodString, string, string>;
61
+ subject_key: z.ZodObject<{
62
+ protocol: z.ZodLiteral<"context.subject-key/v1">;
63
+ namespace: z.ZodEffects<z.ZodString, string, string>;
64
+ kind: z.ZodEffects<z.ZodString, string, string>;
65
+ local_key: z.ZodEffects<z.ZodString, string, string>;
66
+ }, "strict", z.ZodTypeAny, {
67
+ kind: string;
68
+ namespace: string;
69
+ protocol: "context.subject-key/v1";
70
+ local_key: string;
71
+ }, {
72
+ kind: string;
73
+ namespace: string;
74
+ protocol: "context.subject-key/v1";
75
+ local_key: string;
76
+ }>;
77
+ value: z.ZodType<import("./indexerRegistry.js").IndexerJson, z.ZodTypeDef, import("./indexerRegistry.js").IndexerJson>;
78
+ evidence_refs: z.ZodArray<z.ZodString, "many">;
79
+ }, "strict", z.ZodTypeAny, {
80
+ value: import("./indexerRegistry.js").IndexerJson;
81
+ fact_ref: string;
82
+ fact_kind: string;
83
+ subject_key: {
84
+ kind: string;
85
+ namespace: string;
86
+ protocol: "context.subject-key/v1";
87
+ local_key: string;
88
+ };
89
+ evidence_refs: string[];
90
+ }, {
91
+ value: import("./indexerRegistry.js").IndexerJson;
92
+ fact_ref: string;
93
+ fact_kind: string;
94
+ subject_key: {
95
+ kind: string;
96
+ namespace: string;
97
+ protocol: "context.subject-key/v1";
98
+ local_key: string;
99
+ };
100
+ evidence_refs: string[];
101
+ }>, "many">;
102
+ evidence_bindings: z.ZodArray<z.ZodObject<{
103
+ evidence_ref: z.ZodString;
104
+ kind: z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>;
105
+ source_ref: z.ZodString;
106
+ module_ref: z.ZodNullable<z.ZodString>;
107
+ locator: z.ZodEffects<z.ZodObject<{
108
+ path: z.ZodEffects<z.ZodString, string, string>;
109
+ start_line: z.ZodNumber;
110
+ end_line: z.ZodNumber;
111
+ }, "strict", z.ZodTypeAny, {
112
+ path: string;
113
+ start_line: number;
114
+ end_line: number;
115
+ }, {
116
+ path: string;
117
+ start_line: number;
118
+ end_line: number;
119
+ }>, {
120
+ path: string;
121
+ start_line: number;
122
+ end_line: number;
123
+ }, {
124
+ path: string;
125
+ start_line: number;
126
+ end_line: number;
127
+ }>;
128
+ content_digest: z.ZodString;
129
+ coverage_tier: z.ZodEnum<["ast-catalog", "lightweight-evidence"]>;
130
+ binding_digest: z.ZodString;
131
+ }, "strict", z.ZodTypeAny, {
132
+ kind: "code" | "contract" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
133
+ source_ref: string;
134
+ locator: {
135
+ path: string;
136
+ start_line: number;
137
+ end_line: number;
138
+ };
139
+ content_digest: string;
140
+ module_ref: string | null;
141
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
142
+ evidence_ref: string;
143
+ binding_digest: string;
144
+ }, {
145
+ kind: "code" | "contract" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
146
+ source_ref: string;
147
+ locator: {
148
+ path: string;
149
+ start_line: number;
150
+ end_line: number;
151
+ };
152
+ content_digest: string;
153
+ module_ref: string | null;
154
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
155
+ evidence_ref: string;
156
+ binding_digest: string;
157
+ }>, "many">;
158
+ dependencies: z.ZodArray<z.ZodObject<{
159
+ artifact_ref: z.ZodString;
160
+ section_refs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
161
+ required: z.ZodDefault<z.ZodBoolean>;
162
+ }, "strict", z.ZodTypeAny, {
163
+ required: boolean;
164
+ artifact_ref: string;
165
+ section_refs: string[];
166
+ }, {
167
+ artifact_ref: string;
168
+ required?: boolean | undefined;
169
+ section_refs?: string[] | undefined;
170
+ }>, "many">;
171
+ dependency_versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
172
+ artifact_ref: z.ZodString;
173
+ approved_content_digest: z.ZodString;
174
+ projection_digest: z.ZodString;
175
+ }, "strict", z.ZodTypeAny, {
176
+ artifact_ref: string;
177
+ approved_content_digest: string;
178
+ projection_digest: string;
179
+ }, {
180
+ artifact_ref: string;
181
+ approved_content_digest: string;
182
+ projection_digest: string;
183
+ }>, "many">>;
184
+ snapshot_digest: z.ZodString;
185
+ }, "strict", z.ZodTypeAny, {
186
+ path: string;
187
+ protocol: "context.indexer.approved-knowledge/v1";
188
+ subject_key: {
189
+ kind: string;
190
+ namespace: string;
191
+ protocol: "context.subject-key/v1";
192
+ local_key: string;
193
+ };
194
+ sections: {
195
+ evidence_refs: string[];
196
+ fact_refs: string[];
197
+ markdown: string;
198
+ section_ref: string;
199
+ section_key?: string | undefined;
200
+ }[];
201
+ facts: {
202
+ value: import("./indexerRegistry.js").IndexerJson;
203
+ fact_ref: string;
204
+ fact_kind: string;
205
+ subject_key: {
206
+ kind: string;
207
+ namespace: string;
208
+ protocol: "context.subject-key/v1";
209
+ local_key: string;
210
+ };
211
+ evidence_refs: string[];
212
+ }[];
213
+ snapshot_digest: string;
214
+ dependencies: {
215
+ required: boolean;
216
+ artifact_ref: string;
217
+ section_refs: string[];
218
+ }[];
219
+ evidence_bindings: {
220
+ kind: "code" | "contract" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
221
+ source_ref: string;
222
+ locator: {
223
+ path: string;
224
+ start_line: number;
225
+ end_line: number;
226
+ };
227
+ content_digest: string;
228
+ module_ref: string | null;
229
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
230
+ evidence_ref: string;
231
+ binding_digest: string;
232
+ }[];
233
+ artifact_ref: string;
234
+ approved_content_digest: string;
235
+ source_versions: {
236
+ source_ref: string;
237
+ version: string;
238
+ module_ref: string | null;
239
+ }[];
240
+ primary_indexer_id?: string | undefined;
241
+ dependency_versions?: {
242
+ artifact_ref: string;
243
+ approved_content_digest: string;
244
+ projection_digest: string;
245
+ }[] | undefined;
246
+ }, {
247
+ path: string;
248
+ protocol: "context.indexer.approved-knowledge/v1";
249
+ subject_key: {
250
+ kind: string;
251
+ namespace: string;
252
+ protocol: "context.subject-key/v1";
253
+ local_key: string;
254
+ };
255
+ sections: {
256
+ evidence_refs: string[];
257
+ fact_refs: string[];
258
+ markdown: string;
259
+ section_ref: string;
260
+ section_key?: string | undefined;
261
+ }[];
262
+ facts: {
263
+ value: import("./indexerRegistry.js").IndexerJson;
264
+ fact_ref: string;
265
+ fact_kind: string;
266
+ subject_key: {
267
+ kind: string;
268
+ namespace: string;
269
+ protocol: "context.subject-key/v1";
270
+ local_key: string;
271
+ };
272
+ evidence_refs: string[];
273
+ }[];
274
+ snapshot_digest: string;
275
+ dependencies: {
276
+ artifact_ref: string;
277
+ required?: boolean | undefined;
278
+ section_refs?: string[] | undefined;
279
+ }[];
280
+ evidence_bindings: {
281
+ kind: "code" | "contract" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
282
+ source_ref: string;
283
+ locator: {
284
+ path: string;
285
+ start_line: number;
286
+ end_line: number;
287
+ };
288
+ content_digest: string;
289
+ module_ref: string | null;
290
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
291
+ evidence_ref: string;
292
+ binding_digest: string;
293
+ }[];
294
+ artifact_ref: string;
295
+ approved_content_digest: string;
296
+ source_versions: {
297
+ source_ref: string;
298
+ version: string;
299
+ module_ref: string | null;
300
+ }[];
301
+ primary_indexer_id?: string | undefined;
302
+ dependency_versions?: {
303
+ artifact_ref: string;
304
+ approved_content_digest: string;
305
+ projection_digest: string;
306
+ }[] | undefined;
307
+ }>;
308
+ export type IndexerApprovedKnowledge = z.infer<typeof indexerApprovedKnowledgeSchema>;
309
+ export declare function validateIndexerApprovedKnowledge(value: unknown): IndexerApprovedKnowledge;
310
+ export declare function buildIndexerApprovedKnowledge(payload: Omit<IndexerApprovedKnowledge, "snapshot_digest">): IndexerApprovedKnowledge;
311
+ export interface PendingKnowledgeDependency {
312
+ artifact_ref: string;
313
+ reason: "not-approved" | "approval-changed" | "section-unavailable" | "source-version-changed" | "dependency-cycle" | "same-group-dependency";
314
+ required: boolean;
315
+ }
316
+ /** Projection is an authority boundary. It never turns approved prose into a
317
+ * source fact and never assigns the source members to the consuming subject. */
318
+ export declare function projectIndexerApprovedKnowledge(input: {
319
+ dependencies: readonly IndexerKnowledgeDependency[];
320
+ snapshots: readonly IndexerApprovedKnowledge[];
321
+ approved_versions: ReadonlyMap<string, string>;
322
+ authorized_sources: readonly {
323
+ source_ref: string;
324
+ module_ref: string | null;
325
+ version: string;
326
+ }[];
327
+ evidence_kinds: ReadonlySet<string>;
328
+ subject_key: IndexerSubjectKey;
329
+ }): {
330
+ status: "ready" | "waiting";
331
+ pending: PendingKnowledgeDependency[];
332
+ versions: {
333
+ artifact_ref: string;
334
+ approved_content_digest: string;
335
+ projection_digest: string;
336
+ }[];
337
+ facts: {
338
+ value: import("./indexerRegistry.js").IndexerJson;
339
+ fact_ref: string;
340
+ fact_kind: string;
341
+ subject_key: {
342
+ kind: string;
343
+ namespace: string;
344
+ protocol: "context.subject-key/v1";
345
+ local_key: string;
346
+ };
347
+ evidence_refs: string[];
348
+ }[];
349
+ reading_sections: {
350
+ artifact_ref: string;
351
+ section_ref: string;
352
+ approved_content_digest: string;
353
+ evidence_role: "approved-interpretation";
354
+ markdown: string;
355
+ evidence_refs: string[];
356
+ }[];
357
+ evidence_bindings: {
358
+ kind: "code" | "contract" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
359
+ source_ref: string;
360
+ locator: {
361
+ path: string;
362
+ start_line: number;
363
+ end_line: number;
364
+ };
365
+ content_digest: string;
366
+ module_ref: string | null;
367
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
368
+ evidence_ref: string;
369
+ binding_digest: string;
370
+ }[];
371
+ };