@c4a/context 0.7.9 → 0.7.10-alpha.2

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 (78) hide show
  1. package/articleStructure.d.ts +254 -0
  2. package/docs/guides/agent-dialogue.md +1 -1
  3. package/docs/guides/code-indexer-skill-authoring.md +76 -178
  4. package/docs/guides/indexer-provider-and-customization.md +93 -453
  5. package/docs/guides/indexer-skill-creation.md +107 -97
  6. package/docs/guides/knowledge-updates.md +35 -14
  7. package/docs/guides/markdown-indexer-skill-authoring.md +57 -134
  8. package/docs/reference/indexer-provider-protocol.md +52 -102
  9. package/docs/reference/package-templates.md +39 -65
  10. package/docs/reference/template-variables.md +2 -3
  11. package/index.d.ts +6 -10
  12. package/index.js +6441 -8771
  13. package/indexerAgentStepProtocol.d.ts +0 -910
  14. package/indexerApprovedKnowledge.d.ts +98 -359
  15. package/indexerArticlePlan.d.ts +3 -26
  16. package/indexerArtifact.d.ts +201 -70
  17. package/indexerArtifactPolicy.d.ts +0 -18
  18. package/indexerArtifactResult.d.ts +240 -888
  19. package/indexerAuthoringFixture.d.ts +0 -13
  20. package/indexerBenchmark.d.ts +2 -2
  21. package/indexerCandidateCompile.d.ts +123 -167
  22. package/indexerCatalogFallback.d.ts +32 -374
  23. package/indexerCollectionMapping.d.ts +2 -2
  24. package/indexerContentLayers.d.ts +187 -41
  25. package/indexerContractOverlay.d.ts +30 -44
  26. package/indexerControlledInvocation.d.ts +6 -6
  27. package/indexerControlledProgram.d.ts +959 -3020
  28. package/indexerDependencyView.d.ts +96 -96
  29. package/indexerEffectiveArtifact.d.ts +381 -242
  30. package/indexerExampleDecision.d.ts +134 -134
  31. package/indexerExampleIdentity.d.ts +6 -6
  32. package/indexerExampleIdentityAudit.d.ts +6 -6
  33. package/indexerInventoryDisposition.d.ts +0 -39
  34. package/indexerLayerComposition.d.ts +1378 -852
  35. package/indexerLayoutChange.d.ts +24 -33
  36. package/indexerLayoutProposalSet.d.ts +143 -137
  37. package/indexerLayoutResolver.d.ts +116 -101
  38. package/indexerLayoutTransition.d.ts +6 -6
  39. package/indexerMainLifecycle.d.ts +1 -11
  40. package/indexerMainRunLedger.d.ts +0 -14
  41. package/indexerMainRunProtocol.d.ts +806 -2530
  42. package/indexerMainWorkset.d.ts +0 -1212
  43. package/indexerNavigationArtifactPlan.d.ts +2 -2
  44. package/indexerOverlayQuestionApplyProposal.d.ts +0 -4
  45. package/indexerParserCoordinate.d.ts +2 -2
  46. package/indexerParserExecutionPlan.d.ts +42 -42
  47. package/indexerPartitionPlan.d.ts +24 -354
  48. package/indexerPhysicalArtifactManifest.d.ts +12 -27
  49. package/indexerPostAuthorComposition.d.ts +2 -253
  50. package/indexerPostAuthorRunLedger.d.ts +860 -562
  51. package/indexerPrimaryProjection.d.ts +2 -2
  52. package/indexerPrimaryResultView.d.ts +0 -318
  53. package/indexerProfileContract.d.ts +200 -549
  54. package/indexerProgramExecutionAuthorization.d.ts +4 -4
  55. package/indexerProgramRunProtocol.d.ts +806 -2527
  56. package/indexerProjectProposal.d.ts +8 -8
  57. package/indexerProjectedArtifactFanOutAudit.d.ts +8 -8
  58. package/indexerProjectedArtifactPlan.d.ts +0 -9
  59. package/indexerProvider.d.ts +46 -288
  60. package/indexerProviderComposition.d.ts +16 -42
  61. package/indexerQuestionAuthority.d.ts +2 -82
  62. package/indexerReaderTargetInventory.d.ts +6 -6
  63. package/indexerRequirementLifecycle.d.ts +6 -6
  64. package/indexerResultReconciliation.d.ts +35 -149
  65. package/indexerSemanticInput.d.ts +10642 -4685
  66. package/indexerStructuredDeclaration.d.ts +24 -24
  67. package/indexerTemplateRendering.d.ts +239 -113
  68. package/knowledgeMap.d.ts +5 -5
  69. package/package.json +1 -1
  70. package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +13 -16
  71. package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +9 -9
  72. package/indexerArtifactDependencies.d.ts +0 -693
  73. package/indexerCompositionFactDependencies.d.ts +0 -16
  74. package/indexerExampleFactDependencies.d.ts +0 -17
  75. package/indexerIncrementalImpact.d.ts +0 -221
  76. package/indexerKnowledgeDependency.d.ts +0 -46
  77. package/indexerSubjectCatalog.d.ts +0 -230
  78. package/indexerSubjectKeyAuthority.d.ts +0 -786
@@ -23,16 +23,69 @@ export declare const indexerArtifactSchema: z.ZodDiscriminatedUnion<"representat
23
23
  template_id: z.ZodEffects<z.ZodString, string, string>;
24
24
  variables: z.ZodRecord<z.ZodString, z.ZodObject<{
25
25
  value: z.ZodType<import("./indexerRegistry.js").IndexerJson, z.ZodTypeDef, import("./indexerRegistry.js").IndexerJson>;
26
- fact_refs: z.ZodArray<z.ZodString, "many">;
27
- evidence_refs: z.ZodArray<z.ZodString, "many">;
26
+ references: z.ZodArray<z.ZodObject<{
27
+ source_ref: z.ZodString;
28
+ locator: z.ZodEffects<z.ZodObject<{
29
+ path: z.ZodEffects<z.ZodString, string, string>;
30
+ start_line: z.ZodNumber;
31
+ end_line: z.ZodNumber;
32
+ }, "strict", z.ZodTypeAny, {
33
+ path: string;
34
+ start_line: number;
35
+ end_line: number;
36
+ }, {
37
+ path: string;
38
+ start_line: number;
39
+ end_line: number;
40
+ }>, {
41
+ path: string;
42
+ start_line: number;
43
+ end_line: number;
44
+ }, {
45
+ path: string;
46
+ start_line: number;
47
+ end_line: number;
48
+ }>;
49
+ content_digest: z.ZodString;
50
+ }, "strict", z.ZodTypeAny, {
51
+ source_ref: string;
52
+ locator: {
53
+ path: string;
54
+ start_line: number;
55
+ end_line: number;
56
+ };
57
+ content_digest: string;
58
+ }, {
59
+ source_ref: string;
60
+ locator: {
61
+ path: string;
62
+ start_line: number;
63
+ end_line: number;
64
+ };
65
+ content_digest: string;
66
+ }>, "many">;
28
67
  }, "strict", z.ZodTypeAny, {
29
68
  value: import("./indexerRegistry.js").IndexerJson;
30
- evidence_refs: string[];
31
- fact_refs: string[];
69
+ references: {
70
+ source_ref: string;
71
+ locator: {
72
+ path: string;
73
+ start_line: number;
74
+ end_line: number;
75
+ };
76
+ content_digest: string;
77
+ }[];
32
78
  }, {
33
79
  value: import("./indexerRegistry.js").IndexerJson;
34
- evidence_refs: string[];
35
- fact_refs: string[];
80
+ references: {
81
+ source_ref: string;
82
+ locator: {
83
+ path: string;
84
+ start_line: number;
85
+ end_line: number;
86
+ };
87
+ content_digest: string;
88
+ }[];
36
89
  }>>;
37
90
  section_projections: z.ZodArray<z.ZodObject<{
38
91
  section_key: z.ZodEffects<z.ZodString, string, string>;
@@ -62,8 +115,15 @@ export declare const indexerArtifactSchema: z.ZodDiscriminatedUnion<"representat
62
115
  template_id: string;
63
116
  variables: Record<string, {
64
117
  value: import("./indexerRegistry.js").IndexerJson;
65
- evidence_refs: string[];
66
- fact_refs: string[];
118
+ references: {
119
+ source_ref: string;
120
+ locator: {
121
+ path: string;
122
+ start_line: number;
123
+ end_line: number;
124
+ };
125
+ content_digest: string;
126
+ }[];
67
127
  }>;
68
128
  section_projections: {
69
129
  section_key: string;
@@ -80,8 +140,15 @@ export declare const indexerArtifactSchema: z.ZodDiscriminatedUnion<"representat
80
140
  template_id: string;
81
141
  variables: Record<string, {
82
142
  value: import("./indexerRegistry.js").IndexerJson;
83
- evidence_refs: string[];
84
- fact_refs: string[];
143
+ references: {
144
+ source_ref: string;
145
+ locator: {
146
+ path: string;
147
+ start_line: number;
148
+ end_line: number;
149
+ };
150
+ content_digest: string;
151
+ }[];
85
152
  }>;
86
153
  section_projections: {
87
154
  section_key: string;
@@ -102,127 +169,191 @@ export declare const indexerArtifactSchema: z.ZodDiscriminatedUnion<"representat
102
169
  reader_goal: z.ZodEffects<z.ZodString, string, string>;
103
170
  artifact_kind: z.ZodEffects<z.ZodString, string, string>;
104
171
  } & {
105
- blocks: z.ZodArray<z.ZodDiscriminatedUnion<"layer", [z.ZodObject<{
106
- block_id: z.ZodEffects<z.ZodString, string, string>;
107
- layer: z.ZodLiteral<"deterministic-block">;
108
- renderer: z.ZodEnum<["bullet-list", "key-value-table", "multi-column-table", "public-contract-table", "json-code-block"]>;
109
- fact_refs: z.ZodArray<z.ZodString, "many">;
110
- }, "strict", z.ZodTypeAny, {
111
- block_id: string;
112
- layer: "deterministic-block";
113
- renderer: "bullet-list" | "key-value-table" | "multi-column-table" | "public-contract-table" | "json-code-block";
114
- fact_refs: string[];
115
- }, {
116
- block_id: string;
117
- layer: "deterministic-block";
118
- renderer: "bullet-list" | "key-value-table" | "multi-column-table" | "public-contract-table" | "json-code-block";
119
- fact_refs: string[];
120
- }>, z.ZodObject<{
172
+ blocks: z.ZodArray<z.ZodObject<{
121
173
  block_id: z.ZodEffects<z.ZodString, string, string>;
122
174
  layer: z.ZodLiteral<"semantic-prose">;
123
175
  markdown: z.ZodString;
124
- evidence_refs: z.ZodArray<z.ZodString, "many">;
176
+ references: z.ZodArray<z.ZodObject<{
177
+ source_ref: z.ZodString;
178
+ locator: z.ZodEffects<z.ZodObject<{
179
+ path: z.ZodEffects<z.ZodString, string, string>;
180
+ start_line: z.ZodNumber;
181
+ end_line: z.ZodNumber;
182
+ }, "strict", z.ZodTypeAny, {
183
+ path: string;
184
+ start_line: number;
185
+ end_line: number;
186
+ }, {
187
+ path: string;
188
+ start_line: number;
189
+ end_line: number;
190
+ }>, {
191
+ path: string;
192
+ start_line: number;
193
+ end_line: number;
194
+ }, {
195
+ path: string;
196
+ start_line: number;
197
+ end_line: number;
198
+ }>;
199
+ content_digest: z.ZodString;
200
+ }, "strict", z.ZodTypeAny, {
201
+ source_ref: string;
202
+ locator: {
203
+ path: string;
204
+ start_line: number;
205
+ end_line: number;
206
+ };
207
+ content_digest: string;
208
+ }, {
209
+ source_ref: string;
210
+ locator: {
211
+ path: string;
212
+ start_line: number;
213
+ end_line: number;
214
+ };
215
+ content_digest: string;
216
+ }>, "many">;
125
217
  }, "strict", z.ZodTypeAny, {
126
- evidence_refs: string[];
218
+ references: {
219
+ source_ref: string;
220
+ locator: {
221
+ path: string;
222
+ start_line: number;
223
+ end_line: number;
224
+ };
225
+ content_digest: string;
226
+ }[];
127
227
  block_id: string;
128
228
  layer: "semantic-prose";
129
229
  markdown: string;
130
230
  }, {
131
- evidence_refs: string[];
231
+ references: {
232
+ source_ref: string;
233
+ locator: {
234
+ path: string;
235
+ start_line: number;
236
+ end_line: number;
237
+ };
238
+ content_digest: string;
239
+ }[];
132
240
  block_id: string;
133
241
  layer: "semantic-prose";
134
242
  markdown: string;
135
- }>]>, "many">;
243
+ }>, "many">;
136
244
  }, "strict", z.ZodTypeAny, {
137
245
  section_key: string;
138
246
  owner_indexer_id: string;
139
247
  document_kind: string;
140
248
  reader_goal: string;
141
249
  artifact_kind: string;
142
- blocks: ({
143
- block_id: string;
144
- layer: "deterministic-block";
145
- renderer: "bullet-list" | "key-value-table" | "multi-column-table" | "public-contract-table" | "json-code-block";
146
- fact_refs: string[];
147
- } | {
148
- evidence_refs: string[];
250
+ blocks: {
251
+ references: {
252
+ source_ref: string;
253
+ locator: {
254
+ path: string;
255
+ start_line: number;
256
+ end_line: number;
257
+ };
258
+ content_digest: string;
259
+ }[];
149
260
  block_id: string;
150
261
  layer: "semantic-prose";
151
262
  markdown: string;
152
- })[];
263
+ }[];
153
264
  }, {
154
265
  section_key: string;
155
266
  owner_indexer_id: string;
156
267
  document_kind: string;
157
268
  reader_goal: string;
158
269
  artifact_kind: string;
159
- blocks: ({
160
- block_id: string;
161
- layer: "deterministic-block";
162
- renderer: "bullet-list" | "key-value-table" | "multi-column-table" | "public-contract-table" | "json-code-block";
163
- fact_refs: string[];
164
- } | {
165
- evidence_refs: string[];
270
+ blocks: {
271
+ references: {
272
+ source_ref: string;
273
+ locator: {
274
+ path: string;
275
+ start_line: number;
276
+ end_line: number;
277
+ };
278
+ content_digest: string;
279
+ }[];
166
280
  block_id: string;
167
281
  layer: "semantic-prose";
168
282
  markdown: string;
169
- })[];
283
+ }[];
170
284
  }>, "many">;
171
285
  artifact_id: z.ZodEffects<z.ZodString, string, string>;
172
286
  artifact_kind: z.ZodEffects<z.ZodString, string, string>;
173
287
  artifact_policy_variant: z.ZodEffects<z.ZodString, string, string>;
174
288
  }, "strict", z.ZodTypeAny, {
175
- artifact_kind: string;
176
- representation: "sections";
177
- artifact_id: string;
178
- artifact_policy_variant: string;
179
289
  sections: {
180
290
  section_key: string;
181
291
  owner_indexer_id: string;
182
292
  document_kind: string;
183
293
  reader_goal: string;
184
294
  artifact_kind: string;
185
- blocks: ({
186
- block_id: string;
187
- layer: "deterministic-block";
188
- renderer: "bullet-list" | "key-value-table" | "multi-column-table" | "public-contract-table" | "json-code-block";
189
- fact_refs: string[];
190
- } | {
191
- evidence_refs: string[];
295
+ blocks: {
296
+ references: {
297
+ source_ref: string;
298
+ locator: {
299
+ path: string;
300
+ start_line: number;
301
+ end_line: number;
302
+ };
303
+ content_digest: string;
304
+ }[];
192
305
  block_id: string;
193
306
  layer: "semantic-prose";
194
307
  markdown: string;
195
- })[];
308
+ }[];
196
309
  }[];
197
- template_id?: string | undefined;
198
- }, {
199
310
  artifact_kind: string;
200
311
  representation: "sections";
201
312
  artifact_id: string;
202
313
  artifact_policy_variant: string;
314
+ template_id?: string | undefined;
315
+ }, {
203
316
  sections: {
204
317
  section_key: string;
205
318
  owner_indexer_id: string;
206
319
  document_kind: string;
207
320
  reader_goal: string;
208
321
  artifact_kind: string;
209
- blocks: ({
210
- block_id: string;
211
- layer: "deterministic-block";
212
- renderer: "bullet-list" | "key-value-table" | "multi-column-table" | "public-contract-table" | "json-code-block";
213
- fact_refs: string[];
214
- } | {
215
- evidence_refs: string[];
322
+ blocks: {
323
+ references: {
324
+ source_ref: string;
325
+ locator: {
326
+ path: string;
327
+ start_line: number;
328
+ end_line: number;
329
+ };
330
+ content_digest: string;
331
+ }[];
216
332
  block_id: string;
217
333
  layer: "semantic-prose";
218
334
  markdown: string;
219
- })[];
335
+ }[];
220
336
  }[];
337
+ artifact_kind: string;
338
+ representation: "sections";
339
+ artifact_id: string;
340
+ artifact_policy_variant: string;
221
341
  template_id?: string | undefined;
222
342
  }>]>;
223
343
  export type IndexerArtifact = z.infer<typeof indexerArtifactSchema>;
224
344
  export type IndexerArtifactSectionProjection = z.infer<typeof indexerArtifactSectionProjectionSchema>;
225
- export declare function indexerArtifactRef(nodeRef: string, artifact: {
345
+ export declare function indexerArtifactRef(logicalUnitRef: string, artifact: {
226
346
  artifact_id: string;
227
- artifact_kind: string;
347
+ artifact_kind?: string;
228
348
  }): string;
349
+ /** Article-wide traversal has no three-source cap; that cap applies to each
350
+ * individual fragment. This helper never expands references into parser facts. */
351
+ export declare function indexerArtifactReferences(artifact: IndexerArtifact): {
352
+ source_ref: string;
353
+ locator: {
354
+ path: string;
355
+ start_line: number;
356
+ end_line: number;
357
+ };
358
+ content_digest: string;
359
+ }[];
@@ -131,16 +131,13 @@ declare const artifactBundleEntrySchema: z.ZodUnion<[z.ZodObject<{
131
131
  artifact_kind: z.ZodEffects<z.ZodString, string, string>;
132
132
  purpose: z.ZodEnum<["required", "discretionary"]>;
133
133
  reader_question_refs: z.ZodArray<z.ZodString, "many">;
134
- evidence_refs: z.ZodArray<z.ZodString, "many">;
135
134
  }, "strict", z.ZodTypeAny, {
136
135
  purpose: "required" | "discretionary";
137
- evidence_refs: string[];
138
136
  artifact_kind: string;
139
137
  artifact_id: string;
140
138
  reader_question_refs: string[];
141
139
  }, {
142
140
  purpose: "required" | "discretionary";
143
- evidence_refs: string[];
144
141
  artifact_kind: string;
145
142
  artifact_id: string;
146
143
  reader_question_refs: string[];
@@ -149,7 +146,6 @@ declare const artifactBundleEntrySchema: z.ZodUnion<[z.ZodObject<{
149
146
  artifact_kind: z.ZodEffects<z.ZodString, string, string>;
150
147
  purpose: z.ZodLiteral<"semantic-split">;
151
148
  reader_question_refs: z.ZodArray<z.ZodString, "many">;
152
- evidence_refs: z.ZodArray<z.ZodString, "many">;
153
149
  split_of: z.ZodEffects<z.ZodString, string, string>;
154
150
  boundary: z.ZodObject<{
155
151
  axis: z.ZodEffects<z.ZodString, string, string>;
@@ -166,7 +162,6 @@ declare const artifactBundleEntrySchema: z.ZodUnion<[z.ZodObject<{
166
162
  }>;
167
163
  }, "strict", z.ZodTypeAny, {
168
164
  purpose: "semantic-split";
169
- evidence_refs: string[];
170
165
  artifact_kind: string;
171
166
  artifact_id: string;
172
167
  reader_question_refs: string[];
@@ -178,7 +173,6 @@ declare const artifactBundleEntrySchema: z.ZodUnion<[z.ZodObject<{
178
173
  };
179
174
  }, {
180
175
  purpose: "semantic-split";
181
- evidence_refs: string[];
182
176
  artifact_kind: string;
183
177
  artifact_id: string;
184
178
  reader_question_refs: string[];
@@ -198,16 +192,13 @@ export declare const indexerArtifactBundleSchema: z.ZodObject<{
198
192
  artifact_kind: z.ZodEffects<z.ZodString, string, string>;
199
193
  purpose: z.ZodEnum<["required", "discretionary"]>;
200
194
  reader_question_refs: z.ZodArray<z.ZodString, "many">;
201
- evidence_refs: z.ZodArray<z.ZodString, "many">;
202
195
  }, "strict", z.ZodTypeAny, {
203
196
  purpose: "required" | "discretionary";
204
- evidence_refs: string[];
205
197
  artifact_kind: string;
206
198
  artifact_id: string;
207
199
  reader_question_refs: string[];
208
200
  }, {
209
201
  purpose: "required" | "discretionary";
210
- evidence_refs: string[];
211
202
  artifact_kind: string;
212
203
  artifact_id: string;
213
204
  reader_question_refs: string[];
@@ -216,7 +207,6 @@ export declare const indexerArtifactBundleSchema: z.ZodObject<{
216
207
  artifact_kind: z.ZodEffects<z.ZodString, string, string>;
217
208
  purpose: z.ZodLiteral<"semantic-split">;
218
209
  reader_question_refs: z.ZodArray<z.ZodString, "many">;
219
- evidence_refs: z.ZodArray<z.ZodString, "many">;
220
210
  split_of: z.ZodEffects<z.ZodString, string, string>;
221
211
  boundary: z.ZodObject<{
222
212
  axis: z.ZodEffects<z.ZodString, string, string>;
@@ -233,7 +223,6 @@ export declare const indexerArtifactBundleSchema: z.ZodObject<{
233
223
  }>;
234
224
  }, "strict", z.ZodTypeAny, {
235
225
  purpose: "semantic-split";
236
- evidence_refs: string[];
237
226
  artifact_kind: string;
238
227
  artifact_id: string;
239
228
  reader_question_refs: string[];
@@ -245,7 +234,6 @@ export declare const indexerArtifactBundleSchema: z.ZodObject<{
245
234
  };
246
235
  }, {
247
236
  purpose: "semantic-split";
248
- evidence_refs: string[];
249
237
  artifact_kind: string;
250
238
  artifact_id: string;
251
239
  reader_question_refs: string[];
@@ -265,13 +253,11 @@ export declare const indexerArtifactBundleSchema: z.ZodObject<{
265
253
  artifact_policy_variant: string;
266
254
  artifacts: ({
267
255
  purpose: "required" | "discretionary";
268
- evidence_refs: string[];
269
256
  artifact_kind: string;
270
257
  artifact_id: string;
271
258
  reader_question_refs: string[];
272
259
  } | {
273
260
  purpose: "semantic-split";
274
- evidence_refs: string[];
275
261
  artifact_kind: string;
276
262
  artifact_id: string;
277
263
  reader_question_refs: string[];
@@ -291,13 +277,11 @@ export declare const indexerArtifactBundleSchema: z.ZodObject<{
291
277
  artifact_policy_variant: string;
292
278
  artifacts: ({
293
279
  purpose: "required" | "discretionary";
294
- evidence_refs: string[];
295
280
  artifact_kind: string;
296
281
  artifact_id: string;
297
282
  reader_question_refs: string[];
298
283
  } | {
299
284
  purpose: "semantic-split";
300
- evidence_refs: string[];
301
285
  artifact_kind: string;
302
286
  artifact_id: string;
303
287
  reader_question_refs: string[];
@@ -327,9 +311,7 @@ export declare function validateIndexerArtifactBundlePolicy(input: {
327
311
  actual_artifacts: readonly {
328
312
  artifact_id: string;
329
313
  artifact_kind: string;
330
- evidence_refs: readonly string[];
331
314
  }[];
332
315
  allowed_question_refs: readonly string[];
333
- known_evidence_refs: readonly string[];
334
316
  }): IndexerArtifactBundle;
335
317
  export {};