@c4a/context 0.6.18 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +5 -5
  2. package/README.zh-CN.md +5 -5
  3. package/codeIndexPlan.d.ts +84 -0
  4. package/contracts.d.ts +2 -1
  5. package/docs/README.md +7 -0
  6. package/docs/README.zh-CN.md +5 -0
  7. package/docs/getting-started.md +12 -12
  8. package/docs/guides/agent-guide.md +18 -9
  9. package/docs/guides/code-indexer-skill-authoring.md +124 -0
  10. package/docs/guides/indexer-provider-and-customization.md +140 -0
  11. package/docs/guides/lark-resources.md +7 -0
  12. package/docs/guides/markdown-indexer-skill-authoring.md +118 -0
  13. package/docs/guides/package-outputs.md +3 -3
  14. package/docs/reference/code-extractors.md +7 -6
  15. package/docs/reference/indexer-provider-protocol.md +819 -0
  16. package/docs/reference/package-templates.md +18 -10
  17. package/docs/reference/project-api.md +49 -24
  18. package/index.d.ts +48 -2
  19. package/index.js +28239 -3948
  20. package/indexerAgentStepProtocol.d.ts +9391 -0
  21. package/indexerArtifactDependencies.d.ts +689 -0
  22. package/indexerArtifactPolicy.d.ts +335 -0
  23. package/indexerArtifactResult.d.ts +2010 -0
  24. package/indexerAuditFacts.d.ts +66 -0
  25. package/indexerAuditOverrideReadiness.d.ts +27 -0
  26. package/indexerAuditProtocol.d.ts +238 -0
  27. package/indexerAuditRevision.d.ts +726 -0
  28. package/indexerAuditRevisionActions.d.ts +236 -0
  29. package/indexerAuthoringFixture.d.ts +152 -0
  30. package/indexerBaseQuestionAmendment.d.ts +2403 -0
  31. package/indexerBenchmark.d.ts +1062 -0
  32. package/indexerCandidateCompile.d.ts +801 -0
  33. package/indexerCapabilityGroupEvidence.d.ts +129 -0
  34. package/indexerCatalogFallback.d.ts +1262 -0
  35. package/indexerCollectionMapping.d.ts +75 -0
  36. package/indexerContentLayers.d.ts +137 -0
  37. package/indexerControlledInvocation.d.ts +512 -0
  38. package/indexerControlledProgram.d.ts +12535 -0
  39. package/indexerCoreExports.d.ts +21 -0
  40. package/indexerCustomizationDraft.d.ts +13800 -0
  41. package/indexerCustomizationLadder.d.ts +103 -0
  42. package/indexerDependencyView.d.ts +1610 -0
  43. package/indexerEvidenceAdapterResult.d.ts +504 -0
  44. package/indexerExampleDecision.d.ts +1606 -0
  45. package/indexerExampleIdentity.d.ts +132 -0
  46. package/indexerExampleIdentityAudit.d.ts +70 -0
  47. package/indexerExampleLinkageAudit.d.ts +80 -0
  48. package/indexerGeneratedAuthoringAudit.d.ts +208 -0
  49. package/indexerIncrementalImpact.d.ts +221 -0
  50. package/indexerInventoryDisposition.d.ts +443 -0
  51. package/indexerLayerComposition.d.ts +1652 -0
  52. package/indexerLayoutChange.d.ts +329 -0
  53. package/indexerLayoutProposalSet.d.ts +447 -0
  54. package/indexerLayoutResolver.d.ts +342 -0
  55. package/indexerLayoutTransition.d.ts +247 -0
  56. package/indexerLifecycle.d.ts +53 -0
  57. package/indexerMainLifecycle.d.ts +258 -0
  58. package/indexerMainRunLedger.d.ts +888 -0
  59. package/indexerMainRunProtocol.d.ts +6471 -0
  60. package/indexerMainWorkset.d.ts +2141 -0
  61. package/indexerMaterialAnswer.d.ts +738 -0
  62. package/indexerMaterialAnswerActualization.d.ts +91 -0
  63. package/indexerMaterialAnswerExecutionPlan.d.ts +2887 -0
  64. package/indexerMaterialAnswerFlow.d.ts +63 -0
  65. package/indexerMaterialAnswerLayout.d.ts +76 -0
  66. package/indexerMaterialAnswerReview.d.ts +217 -0
  67. package/indexerMaterialAnswerReviewRoute.d.ts +6145 -0
  68. package/indexerMaterialAnswerRunLedger.d.ts +918 -0
  69. package/indexerMaterialAnswerRunProtocol.d.ts +1253 -0
  70. package/indexerMaterialGapLedger.d.ts +3111 -0
  71. package/indexerMaterialQuestionExclusion.d.ts +129 -0
  72. package/indexerMaterialQuestionWorkset.d.ts +508 -0
  73. package/indexerNavigationArtifactGraph.d.ts +5 -0
  74. package/indexerNavigationArtifactPlan.d.ts +39 -0
  75. package/indexerOverlayQuestionAmendment.d.ts +2551 -0
  76. package/indexerOverlayQuestionApplyProposal.d.ts +4697 -0
  77. package/indexerOverlayTrust.d.ts +1425 -0
  78. package/indexerParserCoordinate.d.ts +222 -0
  79. package/indexerParserFactView.d.ts +503 -0
  80. package/indexerPartitionConvergence.d.ts +496 -0
  81. package/indexerPartitionPlan.d.ts +919 -0
  82. package/indexerPartitionStrategyResolution.d.ts +594 -0
  83. package/indexerPhysicalArtifactAudit.d.ts +247 -0
  84. package/indexerPhysicalArtifactManifest.d.ts +449 -0
  85. package/indexerPlannedMaterialAnswer.d.ts +116 -0
  86. package/indexerPostAuthorComposition.d.ts +2000 -0
  87. package/indexerPostAuthorRunLedger.d.ts +1972 -0
  88. package/indexerPrimaryProjection.d.ts +262 -0
  89. package/indexerProfileContract.d.ts +3034 -0
  90. package/indexerProfileMetricAudit.d.ts +218 -0
  91. package/indexerProgramExecutionAuthorization.d.ts +227 -0
  92. package/indexerProgramRunProtocol.d.ts +7642 -0
  93. package/indexerProjectProposal.d.ts +2807 -0
  94. package/indexerProjectedArtifactFanOutAudit.d.ts +159 -0
  95. package/indexerProjectedArtifactPlan.d.ts +217 -0
  96. package/indexerProtocolCommon.d.ts +29 -0
  97. package/indexerProvider.d.ts +2573 -0
  98. package/indexerProviderComposition.d.ts +1357 -0
  99. package/indexerProviderContractReferences.d.ts +13 -0
  100. package/indexerProviderProfileResolution.d.ts +20 -0
  101. package/indexerProviderResolution.d.ts +752 -0
  102. package/indexerProviderResolutionAction.d.ts +678 -0
  103. package/indexerProviderRouting.d.ts +3909 -0
  104. package/indexerProviderSelectionProposal.d.ts +3311 -0
  105. package/indexerQuestionAuthority.d.ts +419 -0
  106. package/indexerReaderTargetInventory.d.ts +161 -0
  107. package/indexerReferenceOnlyAudit.d.ts +90 -0
  108. package/indexerRegistry.d.ts +3019 -0
  109. package/indexerRequirementComparison.d.ts +44 -0
  110. package/indexerRequirementConfirmation.d.ts +1193 -0
  111. package/indexerRequirementLifecycle.d.ts +3314 -0
  112. package/indexerRestrictedSelector.d.ts +63 -0
  113. package/indexerResultReconciliation.d.ts +6844 -0
  114. package/indexerResultReconciliationRun.d.ts +15 -0
  115. package/indexerRunEnvelope.d.ts +384 -0
  116. package/indexerRunProtocolCommon.d.ts +21 -0
  117. package/indexerSharedArtifactFingerprint.d.ts +33 -0
  118. package/indexerStructuredDeclaration.d.ts +513 -0
  119. package/indexerSubjectCatalog.d.ts +230 -0
  120. package/indexerSubjectIdentity.d.ts +19 -0
  121. package/indexerSubjectKeyAuthority.d.ts +785 -0
  122. package/indexerTemplateRendering.d.ts +485 -0
  123. package/indexerToolSnapshot.d.ts +431 -0
  124. package/indexerWorksetRead.d.ts +287 -0
  125. package/package.json +1 -1
  126. package/phases.d.ts +11 -9
  127. package/templates/package-templates/kb/AGENTS.md +1 -1
  128. package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +1 -1
  129. package/templates/package-templates.zh-CN/kb/AGENTS.md +1 -1
  130. package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +1 -1
@@ -0,0 +1,738 @@
1
+ import { z } from "zod";
2
+ import { type IndexerEvidenceKind } from "./indexerProtocolCommon.js";
3
+ export declare const INDEXER_EVIDENCE_PROVENANCE_FACT_PATHS: readonly ["content.digest", "evidence.kind", "locator.valid", "snapshot.current", "snapshot.digest", "source.origin_ref", "source.ref", "source.role", "tool.trust"];
4
+ export declare const indexerSourceSpanRefSchema: z.ZodEffects<z.ZodObject<{
5
+ unit: z.ZodEnum<["byte", "line"]>;
6
+ start: z.ZodNumber;
7
+ end_exclusive: z.ZodNumber;
8
+ }, "strict", z.ZodTypeAny, {
9
+ unit: "byte" | "line";
10
+ start: number;
11
+ end_exclusive: number;
12
+ }, {
13
+ unit: "byte" | "line";
14
+ start: number;
15
+ end_exclusive: number;
16
+ }>, {
17
+ unit: "byte" | "line";
18
+ start: number;
19
+ end_exclusive: number;
20
+ }, {
21
+ unit: "byte" | "line";
22
+ start: number;
23
+ end_exclusive: number;
24
+ }>;
25
+ export type IndexerSourceSpanRef = z.infer<typeof indexerSourceSpanRefSchema>;
26
+ export declare const indexerMaterialAnswerEvidenceClaimSchema: z.ZodObject<{
27
+ kind: z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>;
28
+ source_ref: z.ZodString;
29
+ source_spans: z.ZodArray<z.ZodEffects<z.ZodObject<{
30
+ unit: z.ZodEnum<["byte", "line"]>;
31
+ start: z.ZodNumber;
32
+ end_exclusive: z.ZodNumber;
33
+ }, "strict", z.ZodTypeAny, {
34
+ unit: "byte" | "line";
35
+ start: number;
36
+ end_exclusive: number;
37
+ }, {
38
+ unit: "byte" | "line";
39
+ start: number;
40
+ end_exclusive: number;
41
+ }>, {
42
+ unit: "byte" | "line";
43
+ start: number;
44
+ end_exclusive: number;
45
+ }, {
46
+ unit: "byte" | "line";
47
+ start: number;
48
+ end_exclusive: number;
49
+ }>, "many">;
50
+ evidence_digest: z.ZodString;
51
+ }, "strict", z.ZodTypeAny, {
52
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
53
+ source_ref: string;
54
+ evidence_digest: string;
55
+ source_spans: {
56
+ unit: "byte" | "line";
57
+ start: number;
58
+ end_exclusive: number;
59
+ }[];
60
+ }, {
61
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
62
+ source_ref: string;
63
+ evidence_digest: string;
64
+ source_spans: {
65
+ unit: "byte" | "line";
66
+ start: number;
67
+ end_exclusive: number;
68
+ }[];
69
+ }>;
70
+ export type IndexerMaterialAnswerEvidenceClaim = z.infer<typeof indexerMaterialAnswerEvidenceClaimSchema>;
71
+ declare const materialAnswerBindingSchema: z.ZodObject<{
72
+ workset_digest: z.ZodString;
73
+ question_key: z.ZodString;
74
+ question_revision_digest: z.ZodString;
75
+ evidence_claims: z.ZodArray<z.ZodObject<{
76
+ kind: z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>;
77
+ source_ref: z.ZodString;
78
+ source_spans: z.ZodArray<z.ZodEffects<z.ZodObject<{
79
+ unit: z.ZodEnum<["byte", "line"]>;
80
+ start: z.ZodNumber;
81
+ end_exclusive: z.ZodNumber;
82
+ }, "strict", z.ZodTypeAny, {
83
+ unit: "byte" | "line";
84
+ start: number;
85
+ end_exclusive: number;
86
+ }, {
87
+ unit: "byte" | "line";
88
+ start: number;
89
+ end_exclusive: number;
90
+ }>, {
91
+ unit: "byte" | "line";
92
+ start: number;
93
+ end_exclusive: number;
94
+ }, {
95
+ unit: "byte" | "line";
96
+ start: number;
97
+ end_exclusive: number;
98
+ }>, "many">;
99
+ evidence_digest: z.ZodString;
100
+ }, "strict", z.ZodTypeAny, {
101
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
102
+ source_ref: string;
103
+ evidence_digest: string;
104
+ source_spans: {
105
+ unit: "byte" | "line";
106
+ start: number;
107
+ end_exclusive: number;
108
+ }[];
109
+ }, {
110
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
111
+ source_ref: string;
112
+ evidence_digest: string;
113
+ source_spans: {
114
+ unit: "byte" | "line";
115
+ start: number;
116
+ end_exclusive: number;
117
+ }[];
118
+ }>, "many">;
119
+ }, "strict", z.ZodTypeAny, {
120
+ workset_digest: string;
121
+ question_key: string;
122
+ question_revision_digest: string;
123
+ evidence_claims: {
124
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
125
+ source_ref: string;
126
+ evidence_digest: string;
127
+ source_spans: {
128
+ unit: "byte" | "line";
129
+ start: number;
130
+ end_exclusive: number;
131
+ }[];
132
+ }[];
133
+ }, {
134
+ workset_digest: string;
135
+ question_key: string;
136
+ question_revision_digest: string;
137
+ evidence_claims: {
138
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
139
+ source_ref: string;
140
+ evidence_digest: string;
141
+ source_spans: {
142
+ unit: "byte" | "line";
143
+ start: number;
144
+ end_exclusive: number;
145
+ }[];
146
+ }[];
147
+ }>;
148
+ export declare const indexerMaterialAnswerResultSchema: z.ZodObject<{
149
+ protocol: z.ZodLiteral<"context.indexer.material-answer-result/v1">;
150
+ workset_digest: z.ZodString;
151
+ execution_request_digest: z.ZodString;
152
+ answer_indexer_id: z.ZodEffects<z.ZodString, string, string>;
153
+ answer_provider_composition_fingerprint: z.ZodString;
154
+ bindings: z.ZodArray<z.ZodObject<{
155
+ workset_digest: z.ZodString;
156
+ question_key: z.ZodString;
157
+ question_revision_digest: z.ZodString;
158
+ evidence_claims: z.ZodArray<z.ZodObject<{
159
+ kind: z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>;
160
+ source_ref: z.ZodString;
161
+ source_spans: z.ZodArray<z.ZodEffects<z.ZodObject<{
162
+ unit: z.ZodEnum<["byte", "line"]>;
163
+ start: z.ZodNumber;
164
+ end_exclusive: z.ZodNumber;
165
+ }, "strict", z.ZodTypeAny, {
166
+ unit: "byte" | "line";
167
+ start: number;
168
+ end_exclusive: number;
169
+ }, {
170
+ unit: "byte" | "line";
171
+ start: number;
172
+ end_exclusive: number;
173
+ }>, {
174
+ unit: "byte" | "line";
175
+ start: number;
176
+ end_exclusive: number;
177
+ }, {
178
+ unit: "byte" | "line";
179
+ start: number;
180
+ end_exclusive: number;
181
+ }>, "many">;
182
+ evidence_digest: z.ZodString;
183
+ }, "strict", z.ZodTypeAny, {
184
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
185
+ source_ref: string;
186
+ evidence_digest: string;
187
+ source_spans: {
188
+ unit: "byte" | "line";
189
+ start: number;
190
+ end_exclusive: number;
191
+ }[];
192
+ }, {
193
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
194
+ source_ref: string;
195
+ evidence_digest: string;
196
+ source_spans: {
197
+ unit: "byte" | "line";
198
+ start: number;
199
+ end_exclusive: number;
200
+ }[];
201
+ }>, "many">;
202
+ }, "strict", z.ZodTypeAny, {
203
+ workset_digest: string;
204
+ question_key: string;
205
+ question_revision_digest: string;
206
+ evidence_claims: {
207
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
208
+ source_ref: string;
209
+ evidence_digest: string;
210
+ source_spans: {
211
+ unit: "byte" | "line";
212
+ start: number;
213
+ end_exclusive: number;
214
+ }[];
215
+ }[];
216
+ }, {
217
+ workset_digest: string;
218
+ question_key: string;
219
+ question_revision_digest: string;
220
+ evidence_claims: {
221
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
222
+ source_ref: string;
223
+ evidence_digest: string;
224
+ source_spans: {
225
+ unit: "byte" | "line";
226
+ start: number;
227
+ end_exclusive: number;
228
+ }[];
229
+ }[];
230
+ }>, "many">;
231
+ result_digest: z.ZodString;
232
+ }, "strict", z.ZodTypeAny, {
233
+ protocol: "context.indexer.material-answer-result/v1";
234
+ workset_digest: string;
235
+ execution_request_digest: string;
236
+ result_digest: string;
237
+ answer_indexer_id: string;
238
+ answer_provider_composition_fingerprint: string;
239
+ bindings: {
240
+ workset_digest: string;
241
+ question_key: string;
242
+ question_revision_digest: string;
243
+ evidence_claims: {
244
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
245
+ source_ref: string;
246
+ evidence_digest: string;
247
+ source_spans: {
248
+ unit: "byte" | "line";
249
+ start: number;
250
+ end_exclusive: number;
251
+ }[];
252
+ }[];
253
+ }[];
254
+ }, {
255
+ protocol: "context.indexer.material-answer-result/v1";
256
+ workset_digest: string;
257
+ execution_request_digest: string;
258
+ result_digest: string;
259
+ answer_indexer_id: string;
260
+ answer_provider_composition_fingerprint: string;
261
+ bindings: {
262
+ workset_digest: string;
263
+ question_key: string;
264
+ question_revision_digest: string;
265
+ evidence_claims: {
266
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
267
+ source_ref: string;
268
+ evidence_digest: string;
269
+ source_spans: {
270
+ unit: "byte" | "line";
271
+ start: number;
272
+ end_exclusive: number;
273
+ }[];
274
+ }[];
275
+ }[];
276
+ }>;
277
+ export type IndexerMaterialAnswerBinding = z.infer<typeof materialAnswerBindingSchema>;
278
+ export type IndexerMaterialAnswerResult = z.infer<typeof indexerMaterialAnswerResultSchema>;
279
+ export declare function indexerMaterialAnswerResultDigest(value: Omit<IndexerMaterialAnswerResult, "result_digest">): string;
280
+ export declare const indexerCurrentEvidenceSourceSchema: z.ZodObject<{
281
+ source_ref: z.ZodString;
282
+ source_origin_ref: z.ZodString;
283
+ source_input_digest: z.ZodString;
284
+ source_role: z.ZodEffects<z.ZodString, string, string>;
285
+ evidence_kinds: z.ZodArray<z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>, "many">;
286
+ span_unit: z.ZodEnum<["byte", "line"]>;
287
+ span_extent: z.ZodNumber;
288
+ snapshot_current: z.ZodLiteral<true>;
289
+ locator_valid: z.ZodLiteral<true>;
290
+ tool_trust: z.ZodEffects<z.ZodString, string, string>;
291
+ }, "strict", z.ZodTypeAny, {
292
+ source_ref: string;
293
+ source_input_digest: string;
294
+ source_role: string;
295
+ source_origin_ref: string;
296
+ evidence_kinds: ("contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot")[];
297
+ span_unit: "byte" | "line";
298
+ span_extent: number;
299
+ snapshot_current: true;
300
+ locator_valid: true;
301
+ tool_trust: string;
302
+ }, {
303
+ source_ref: string;
304
+ source_input_digest: string;
305
+ source_role: string;
306
+ source_origin_ref: string;
307
+ evidence_kinds: ("contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot")[];
308
+ span_unit: "byte" | "line";
309
+ span_extent: number;
310
+ snapshot_current: true;
311
+ locator_valid: true;
312
+ tool_trust: string;
313
+ }>;
314
+ export type IndexerCurrentEvidenceSource = z.infer<typeof indexerCurrentEvidenceSourceSchema>;
315
+ export declare const indexerCanonicalMaterialAnswerEvidenceSchema: z.ZodObject<{
316
+ evidence_item_ref: z.ZodString;
317
+ kind: z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>;
318
+ source_ref: z.ZodString;
319
+ source_origin_ref: z.ZodString;
320
+ source_input_digest: z.ZodString;
321
+ source_spans: z.ZodArray<z.ZodEffects<z.ZodObject<{
322
+ unit: z.ZodEnum<["byte", "line"]>;
323
+ start: z.ZodNumber;
324
+ end_exclusive: z.ZodNumber;
325
+ }, "strict", z.ZodTypeAny, {
326
+ unit: "byte" | "line";
327
+ start: number;
328
+ end_exclusive: number;
329
+ }, {
330
+ unit: "byte" | "line";
331
+ start: number;
332
+ end_exclusive: number;
333
+ }>, {
334
+ unit: "byte" | "line";
335
+ start: number;
336
+ end_exclusive: number;
337
+ }, {
338
+ unit: "byte" | "line";
339
+ start: number;
340
+ end_exclusive: number;
341
+ }>, "many">;
342
+ evidence_digest: z.ZodString;
343
+ }, "strict", z.ZodTypeAny, {
344
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
345
+ source_ref: string;
346
+ evidence_digest: string;
347
+ source_input_digest: string;
348
+ source_spans: {
349
+ unit: "byte" | "line";
350
+ start: number;
351
+ end_exclusive: number;
352
+ }[];
353
+ source_origin_ref: string;
354
+ evidence_item_ref: string;
355
+ }, {
356
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
357
+ source_ref: string;
358
+ evidence_digest: string;
359
+ source_input_digest: string;
360
+ source_spans: {
361
+ unit: "byte" | "line";
362
+ start: number;
363
+ end_exclusive: number;
364
+ }[];
365
+ source_origin_ref: string;
366
+ evidence_item_ref: string;
367
+ }>;
368
+ export type IndexerCanonicalMaterialAnswerEvidence = z.infer<typeof indexerCanonicalMaterialAnswerEvidenceSchema>;
369
+ declare const materialAnswerCandidateSchema: z.ZodObject<{
370
+ state: z.ZodLiteral<"candidate">;
371
+ question_key: z.ZodString;
372
+ question_revision_digest: z.ZodString;
373
+ binding_digest: z.ZodString;
374
+ evidence_item_count: z.ZodNumber;
375
+ distinct_source_count: z.ZodNumber;
376
+ evidence: z.ZodArray<z.ZodObject<{
377
+ evidence_item_ref: z.ZodString;
378
+ kind: z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>;
379
+ source_ref: z.ZodString;
380
+ source_origin_ref: z.ZodString;
381
+ source_input_digest: z.ZodString;
382
+ source_spans: z.ZodArray<z.ZodEffects<z.ZodObject<{
383
+ unit: z.ZodEnum<["byte", "line"]>;
384
+ start: z.ZodNumber;
385
+ end_exclusive: z.ZodNumber;
386
+ }, "strict", z.ZodTypeAny, {
387
+ unit: "byte" | "line";
388
+ start: number;
389
+ end_exclusive: number;
390
+ }, {
391
+ unit: "byte" | "line";
392
+ start: number;
393
+ end_exclusive: number;
394
+ }>, {
395
+ unit: "byte" | "line";
396
+ start: number;
397
+ end_exclusive: number;
398
+ }, {
399
+ unit: "byte" | "line";
400
+ start: number;
401
+ end_exclusive: number;
402
+ }>, "many">;
403
+ evidence_digest: z.ZodString;
404
+ }, "strict", z.ZodTypeAny, {
405
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
406
+ source_ref: string;
407
+ evidence_digest: string;
408
+ source_input_digest: string;
409
+ source_spans: {
410
+ unit: "byte" | "line";
411
+ start: number;
412
+ end_exclusive: number;
413
+ }[];
414
+ source_origin_ref: string;
415
+ evidence_item_ref: string;
416
+ }, {
417
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
418
+ source_ref: string;
419
+ evidence_digest: string;
420
+ source_input_digest: string;
421
+ source_spans: {
422
+ unit: "byte" | "line";
423
+ start: number;
424
+ end_exclusive: number;
425
+ }[];
426
+ source_origin_ref: string;
427
+ evidence_item_ref: string;
428
+ }>, "many">;
429
+ }, "strict", z.ZodTypeAny, {
430
+ state: "candidate";
431
+ binding_digest: string;
432
+ evidence: {
433
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
434
+ source_ref: string;
435
+ evidence_digest: string;
436
+ source_input_digest: string;
437
+ source_spans: {
438
+ unit: "byte" | "line";
439
+ start: number;
440
+ end_exclusive: number;
441
+ }[];
442
+ source_origin_ref: string;
443
+ evidence_item_ref: string;
444
+ }[];
445
+ question_key: string;
446
+ question_revision_digest: string;
447
+ evidence_item_count: number;
448
+ distinct_source_count: number;
449
+ }, {
450
+ state: "candidate";
451
+ binding_digest: string;
452
+ evidence: {
453
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
454
+ source_ref: string;
455
+ evidence_digest: string;
456
+ source_input_digest: string;
457
+ source_spans: {
458
+ unit: "byte" | "line";
459
+ start: number;
460
+ end_exclusive: number;
461
+ }[];
462
+ source_origin_ref: string;
463
+ evidence_item_ref: string;
464
+ }[];
465
+ question_key: string;
466
+ question_revision_digest: string;
467
+ evidence_item_count: number;
468
+ distinct_source_count: number;
469
+ }>;
470
+ declare const materialAnswerInsufficientSchema: z.ZodObject<{
471
+ state: z.ZodLiteral<"material-answer-evidence-insufficient">;
472
+ question_key: z.ZodString;
473
+ question_revision_digest: z.ZodString;
474
+ reason_codes: z.ZodArray<z.ZodEnum<["minimum-items-not-met", "minimum-distinct-sources-not-met", "provenance-constraint-not-met"]>, "many">;
475
+ accepted_evidence_item_count: z.ZodNumber;
476
+ distinct_source_count: z.ZodNumber;
477
+ rejected_evidence_item_refs: z.ZodArray<z.ZodString, "many">;
478
+ }, "strict", z.ZodTypeAny, {
479
+ state: "material-answer-evidence-insufficient";
480
+ question_key: string;
481
+ question_revision_digest: string;
482
+ distinct_source_count: number;
483
+ reason_codes: ("minimum-items-not-met" | "minimum-distinct-sources-not-met" | "provenance-constraint-not-met")[];
484
+ accepted_evidence_item_count: number;
485
+ rejected_evidence_item_refs: string[];
486
+ }, {
487
+ state: "material-answer-evidence-insufficient";
488
+ question_key: string;
489
+ question_revision_digest: string;
490
+ distinct_source_count: number;
491
+ reason_codes: ("minimum-items-not-met" | "minimum-distinct-sources-not-met" | "provenance-constraint-not-met")[];
492
+ accepted_evidence_item_count: number;
493
+ rejected_evidence_item_refs: string[];
494
+ }>;
495
+ export declare const indexerMaterialAnswerCandidateSetSchema: z.ZodObject<{
496
+ protocol: z.ZodLiteral<"context.indexer.material-answer-candidate-set/v1">;
497
+ candidate_set_digest: z.ZodString;
498
+ workset_digest: z.ZodString;
499
+ answer_result_digest: z.ZodString;
500
+ answer_indexer_id: z.ZodEffects<z.ZodString, string, string>;
501
+ answer_provider_composition_fingerprint: z.ZodString;
502
+ evaluations: z.ZodArray<z.ZodUnion<[z.ZodObject<{
503
+ state: z.ZodLiteral<"candidate">;
504
+ question_key: z.ZodString;
505
+ question_revision_digest: z.ZodString;
506
+ binding_digest: z.ZodString;
507
+ evidence_item_count: z.ZodNumber;
508
+ distinct_source_count: z.ZodNumber;
509
+ evidence: z.ZodArray<z.ZodObject<{
510
+ evidence_item_ref: z.ZodString;
511
+ kind: z.ZodEnum<["code", "contract", "configuration", "documentation", "runbook", "decision-record", "test-result", "runtime-observation", "tool-snapshot"]>;
512
+ source_ref: z.ZodString;
513
+ source_origin_ref: z.ZodString;
514
+ source_input_digest: z.ZodString;
515
+ source_spans: z.ZodArray<z.ZodEffects<z.ZodObject<{
516
+ unit: z.ZodEnum<["byte", "line"]>;
517
+ start: z.ZodNumber;
518
+ end_exclusive: z.ZodNumber;
519
+ }, "strict", z.ZodTypeAny, {
520
+ unit: "byte" | "line";
521
+ start: number;
522
+ end_exclusive: number;
523
+ }, {
524
+ unit: "byte" | "line";
525
+ start: number;
526
+ end_exclusive: number;
527
+ }>, {
528
+ unit: "byte" | "line";
529
+ start: number;
530
+ end_exclusive: number;
531
+ }, {
532
+ unit: "byte" | "line";
533
+ start: number;
534
+ end_exclusive: number;
535
+ }>, "many">;
536
+ evidence_digest: z.ZodString;
537
+ }, "strict", z.ZodTypeAny, {
538
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
539
+ source_ref: string;
540
+ evidence_digest: string;
541
+ source_input_digest: string;
542
+ source_spans: {
543
+ unit: "byte" | "line";
544
+ start: number;
545
+ end_exclusive: number;
546
+ }[];
547
+ source_origin_ref: string;
548
+ evidence_item_ref: string;
549
+ }, {
550
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
551
+ source_ref: string;
552
+ evidence_digest: string;
553
+ source_input_digest: string;
554
+ source_spans: {
555
+ unit: "byte" | "line";
556
+ start: number;
557
+ end_exclusive: number;
558
+ }[];
559
+ source_origin_ref: string;
560
+ evidence_item_ref: string;
561
+ }>, "many">;
562
+ }, "strict", z.ZodTypeAny, {
563
+ state: "candidate";
564
+ binding_digest: string;
565
+ evidence: {
566
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
567
+ source_ref: string;
568
+ evidence_digest: string;
569
+ source_input_digest: string;
570
+ source_spans: {
571
+ unit: "byte" | "line";
572
+ start: number;
573
+ end_exclusive: number;
574
+ }[];
575
+ source_origin_ref: string;
576
+ evidence_item_ref: string;
577
+ }[];
578
+ question_key: string;
579
+ question_revision_digest: string;
580
+ evidence_item_count: number;
581
+ distinct_source_count: number;
582
+ }, {
583
+ state: "candidate";
584
+ binding_digest: string;
585
+ evidence: {
586
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
587
+ source_ref: string;
588
+ evidence_digest: string;
589
+ source_input_digest: string;
590
+ source_spans: {
591
+ unit: "byte" | "line";
592
+ start: number;
593
+ end_exclusive: number;
594
+ }[];
595
+ source_origin_ref: string;
596
+ evidence_item_ref: string;
597
+ }[];
598
+ question_key: string;
599
+ question_revision_digest: string;
600
+ evidence_item_count: number;
601
+ distinct_source_count: number;
602
+ }>, z.ZodObject<{
603
+ state: z.ZodLiteral<"material-answer-evidence-insufficient">;
604
+ question_key: z.ZodString;
605
+ question_revision_digest: z.ZodString;
606
+ reason_codes: z.ZodArray<z.ZodEnum<["minimum-items-not-met", "minimum-distinct-sources-not-met", "provenance-constraint-not-met"]>, "many">;
607
+ accepted_evidence_item_count: z.ZodNumber;
608
+ distinct_source_count: z.ZodNumber;
609
+ rejected_evidence_item_refs: z.ZodArray<z.ZodString, "many">;
610
+ }, "strict", z.ZodTypeAny, {
611
+ state: "material-answer-evidence-insufficient";
612
+ question_key: string;
613
+ question_revision_digest: string;
614
+ distinct_source_count: number;
615
+ reason_codes: ("minimum-items-not-met" | "minimum-distinct-sources-not-met" | "provenance-constraint-not-met")[];
616
+ accepted_evidence_item_count: number;
617
+ rejected_evidence_item_refs: string[];
618
+ }, {
619
+ state: "material-answer-evidence-insufficient";
620
+ question_key: string;
621
+ question_revision_digest: string;
622
+ distinct_source_count: number;
623
+ reason_codes: ("minimum-items-not-met" | "minimum-distinct-sources-not-met" | "provenance-constraint-not-met")[];
624
+ accepted_evidence_item_count: number;
625
+ rejected_evidence_item_refs: string[];
626
+ }>]>, "many">;
627
+ }, "strict", z.ZodTypeAny, {
628
+ protocol: "context.indexer.material-answer-candidate-set/v1";
629
+ workset_digest: string;
630
+ answer_indexer_id: string;
631
+ answer_provider_composition_fingerprint: string;
632
+ candidate_set_digest: string;
633
+ answer_result_digest: string;
634
+ evaluations: ({
635
+ state: "candidate";
636
+ binding_digest: string;
637
+ evidence: {
638
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
639
+ source_ref: string;
640
+ evidence_digest: string;
641
+ source_input_digest: string;
642
+ source_spans: {
643
+ unit: "byte" | "line";
644
+ start: number;
645
+ end_exclusive: number;
646
+ }[];
647
+ source_origin_ref: string;
648
+ evidence_item_ref: string;
649
+ }[];
650
+ question_key: string;
651
+ question_revision_digest: string;
652
+ evidence_item_count: number;
653
+ distinct_source_count: number;
654
+ } | {
655
+ state: "material-answer-evidence-insufficient";
656
+ question_key: string;
657
+ question_revision_digest: string;
658
+ distinct_source_count: number;
659
+ reason_codes: ("minimum-items-not-met" | "minimum-distinct-sources-not-met" | "provenance-constraint-not-met")[];
660
+ accepted_evidence_item_count: number;
661
+ rejected_evidence_item_refs: string[];
662
+ })[];
663
+ }, {
664
+ protocol: "context.indexer.material-answer-candidate-set/v1";
665
+ workset_digest: string;
666
+ answer_indexer_id: string;
667
+ answer_provider_composition_fingerprint: string;
668
+ candidate_set_digest: string;
669
+ answer_result_digest: string;
670
+ evaluations: ({
671
+ state: "candidate";
672
+ binding_digest: string;
673
+ evidence: {
674
+ kind: "contract" | "code" | "configuration" | "documentation" | "runbook" | "decision-record" | "test-result" | "runtime-observation" | "tool-snapshot";
675
+ source_ref: string;
676
+ evidence_digest: string;
677
+ source_input_digest: string;
678
+ source_spans: {
679
+ unit: "byte" | "line";
680
+ start: number;
681
+ end_exclusive: number;
682
+ }[];
683
+ source_origin_ref: string;
684
+ evidence_item_ref: string;
685
+ }[];
686
+ question_key: string;
687
+ question_revision_digest: string;
688
+ evidence_item_count: number;
689
+ distinct_source_count: number;
690
+ } | {
691
+ state: "material-answer-evidence-insufficient";
692
+ question_key: string;
693
+ question_revision_digest: string;
694
+ distinct_source_count: number;
695
+ reason_codes: ("minimum-items-not-met" | "minimum-distinct-sources-not-met" | "provenance-constraint-not-met")[];
696
+ accepted_evidence_item_count: number;
697
+ rejected_evidence_item_refs: string[];
698
+ })[];
699
+ }>;
700
+ export type IndexerMaterialAnswerCandidate = z.infer<typeof materialAnswerCandidateSchema>;
701
+ export type IndexerMaterialAnswerEvaluation = IndexerMaterialAnswerCandidate | z.infer<typeof materialAnswerInsufficientSchema>;
702
+ export type IndexerMaterialAnswerCandidateSet = z.infer<typeof indexerMaterialAnswerCandidateSetSchema>;
703
+ export declare function indexerEvidenceItemRef(input: {
704
+ kind: IndexerEvidenceKind;
705
+ source_origin_ref: string;
706
+ source_input_digest: string;
707
+ source_spans: readonly IndexerSourceSpanRef[];
708
+ evidence_digest: string;
709
+ }): string;
710
+ export declare function indexerMaterialAnswerBindingDigest(input: {
711
+ accepted_workset_digest: string;
712
+ question_key: string;
713
+ question_revision_digest: string;
714
+ answer_indexer_id: string;
715
+ answer_provider_composition_fingerprint: string;
716
+ answer_result_digest: string;
717
+ evidence: readonly IndexerCanonicalMaterialAnswerEvidence[];
718
+ }): string;
719
+ export declare function normalizeIndexerSourceSpans(input: {
720
+ spans: readonly IndexerSourceSpanRef[];
721
+ source: IndexerCurrentEvidenceSource;
722
+ }): IndexerSourceSpanRef[];
723
+ export declare function validateIndexerMaterialAnswerResult(input: {
724
+ result: unknown;
725
+ workset: unknown;
726
+ expected_execution_request_digest: string;
727
+ expected_provider_composition_fingerprint: string;
728
+ current_sources: readonly IndexerCurrentEvidenceSource[];
729
+ resolve_evidence_digest: (input: {
730
+ source: IndexerCurrentEvidenceSource;
731
+ source_spans: readonly IndexerSourceSpanRef[];
732
+ }) => string;
733
+ }): {
734
+ result: IndexerMaterialAnswerResult;
735
+ candidate_set: IndexerMaterialAnswerCandidateSet;
736
+ };
737
+ export declare function validateIndexerMaterialAnswerCandidateSet(value: unknown): IndexerMaterialAnswerCandidateSet;
738
+ export {};