@pegma/knowledge-base-mcp 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,363 @@
1
+ import { z } from "zod";
2
+ import { type KnowledgeAgentLimits } from "./types.js";
3
+ /** Shared strict schemas; HTTP and MCP must use the same dispatcher. */
4
+ export declare const knowledgeAgentInputSchemas: Readonly<{
5
+ getDraft: z.ZodObject<{
6
+ articleId: z.ZodString;
7
+ }, z.core.$strict>;
8
+ createDraft: z.ZodObject<{
9
+ commandId: z.ZodString;
10
+ correlationId: z.ZodString;
11
+ expectedGeneration: z.ZodLiteral<0>;
12
+ articleId: z.ZodString;
13
+ collectionId: z.ZodString;
14
+ draft: z.ZodObject<{
15
+ kind: z.ZodEnum<{
16
+ "developer-reference": "developer-reference";
17
+ explanation: "explanation";
18
+ troubleshooting: "troubleshooting";
19
+ walkthrough: "walkthrough";
20
+ }>;
21
+ title: z.ZodString;
22
+ summary: z.ZodString;
23
+ content: z.ZodObject<{
24
+ format: z.ZodEnum<{
25
+ markdown: "markdown";
26
+ plain_text: "plain_text";
27
+ }>;
28
+ text: z.ZodString;
29
+ }, z.core.$strict>;
30
+ tags: z.ZodArray<z.ZodString>;
31
+ applicability: z.ZodObject<{
32
+ productId: z.ZodString;
33
+ productVersion: z.ZodString;
34
+ buildId: z.ZodOptional<z.ZodString>;
35
+ locale: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strict>;
37
+ }, z.core.$strict>;
38
+ }, z.core.$strict>;
39
+ updateDraft: z.ZodObject<{
40
+ commandId: z.ZodString;
41
+ correlationId: z.ZodString;
42
+ expectedGeneration: z.ZodNumber;
43
+ articleId: z.ZodString;
44
+ collectionId: z.ZodString;
45
+ draft: z.ZodObject<{
46
+ kind: z.ZodEnum<{
47
+ "developer-reference": "developer-reference";
48
+ explanation: "explanation";
49
+ troubleshooting: "troubleshooting";
50
+ walkthrough: "walkthrough";
51
+ }>;
52
+ title: z.ZodString;
53
+ summary: z.ZodString;
54
+ content: z.ZodObject<{
55
+ format: z.ZodEnum<{
56
+ markdown: "markdown";
57
+ plain_text: "plain_text";
58
+ }>;
59
+ text: z.ZodString;
60
+ }, z.core.$strict>;
61
+ tags: z.ZodArray<z.ZodString>;
62
+ applicability: z.ZodObject<{
63
+ productId: z.ZodString;
64
+ productVersion: z.ZodString;
65
+ buildId: z.ZodOptional<z.ZodString>;
66
+ locale: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strict>;
68
+ }, z.core.$strict>;
69
+ }, z.core.$strict>;
70
+ getValidationRequirements: z.ZodObject<{
71
+ collectionId: z.ZodString;
72
+ kind: z.ZodEnum<{
73
+ "developer-reference": "developer-reference";
74
+ explanation: "explanation";
75
+ troubleshooting: "troubleshooting";
76
+ walkthrough: "walkthrough";
77
+ }>;
78
+ }, z.core.$strict>;
79
+ submitEvidence: z.ZodObject<{
80
+ commandId: z.ZodString;
81
+ correlationId: z.ZodString;
82
+ expectedGeneration: z.ZodNumber;
83
+ articleId: z.ZodString;
84
+ evidence: z.ZodObject<{
85
+ id: z.ZodString;
86
+ articleId: z.ZodString;
87
+ articleRevision: z.ZodNumber;
88
+ contentHash: z.ZodString;
89
+ validationPolicy: z.ZodObject<{
90
+ id: z.ZodString;
91
+ version: z.ZodNumber;
92
+ }, z.core.$strict>;
93
+ checkId: z.ZodString;
94
+ testKind: z.ZodString;
95
+ applicability: z.ZodObject<{
96
+ productId: z.ZodString;
97
+ productVersion: z.ZodString;
98
+ buildId: z.ZodOptional<z.ZodString>;
99
+ locale: z.ZodOptional<z.ZodString>;
100
+ }, z.core.$strict>;
101
+ stagingBuildId: z.ZodString;
102
+ steps: z.ZodArray<z.ZodString>;
103
+ result: z.ZodEnum<{
104
+ failed: "failed";
105
+ inconclusive: "inconclusive";
106
+ passed: "passed";
107
+ }>;
108
+ executedAt: z.ZodString;
109
+ runnerId: z.ZodString;
110
+ artifacts: z.ZodArray<z.ZodObject<{
111
+ id: z.ZodString;
112
+ hash: z.ZodString;
113
+ }, z.core.$strict>>;
114
+ }, z.core.$strict>;
115
+ receipt: z.ZodString;
116
+ }, z.core.$strict>;
117
+ }>;
118
+ export declare const knowledgeAgentEnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
119
+ apiVersion: z.ZodLiteral<"1">;
120
+ operation: z.ZodLiteral<"getDraft">;
121
+ input: z.ZodObject<{
122
+ articleId: z.ZodString;
123
+ }, z.core.$strict>;
124
+ }, z.core.$strict>, z.ZodObject<{
125
+ apiVersion: z.ZodLiteral<"1">;
126
+ operation: z.ZodLiteral<"createDraft">;
127
+ input: z.ZodObject<{
128
+ commandId: z.ZodString;
129
+ correlationId: z.ZodString;
130
+ expectedGeneration: z.ZodLiteral<0>;
131
+ articleId: z.ZodString;
132
+ collectionId: z.ZodString;
133
+ draft: z.ZodObject<{
134
+ kind: z.ZodEnum<{
135
+ "developer-reference": "developer-reference";
136
+ explanation: "explanation";
137
+ troubleshooting: "troubleshooting";
138
+ walkthrough: "walkthrough";
139
+ }>;
140
+ title: z.ZodString;
141
+ summary: z.ZodString;
142
+ content: z.ZodObject<{
143
+ format: z.ZodEnum<{
144
+ markdown: "markdown";
145
+ plain_text: "plain_text";
146
+ }>;
147
+ text: z.ZodString;
148
+ }, z.core.$strict>;
149
+ tags: z.ZodArray<z.ZodString>;
150
+ applicability: z.ZodObject<{
151
+ productId: z.ZodString;
152
+ productVersion: z.ZodString;
153
+ buildId: z.ZodOptional<z.ZodString>;
154
+ locale: z.ZodOptional<z.ZodString>;
155
+ }, z.core.$strict>;
156
+ }, z.core.$strict>;
157
+ }, z.core.$strict>;
158
+ }, z.core.$strict>, z.ZodObject<{
159
+ apiVersion: z.ZodLiteral<"1">;
160
+ operation: z.ZodLiteral<"updateDraft">;
161
+ input: z.ZodObject<{
162
+ commandId: z.ZodString;
163
+ correlationId: z.ZodString;
164
+ expectedGeneration: z.ZodNumber;
165
+ articleId: z.ZodString;
166
+ collectionId: z.ZodString;
167
+ draft: z.ZodObject<{
168
+ kind: z.ZodEnum<{
169
+ "developer-reference": "developer-reference";
170
+ explanation: "explanation";
171
+ troubleshooting: "troubleshooting";
172
+ walkthrough: "walkthrough";
173
+ }>;
174
+ title: z.ZodString;
175
+ summary: z.ZodString;
176
+ content: z.ZodObject<{
177
+ format: z.ZodEnum<{
178
+ markdown: "markdown";
179
+ plain_text: "plain_text";
180
+ }>;
181
+ text: z.ZodString;
182
+ }, z.core.$strict>;
183
+ tags: z.ZodArray<z.ZodString>;
184
+ applicability: z.ZodObject<{
185
+ productId: z.ZodString;
186
+ productVersion: z.ZodString;
187
+ buildId: z.ZodOptional<z.ZodString>;
188
+ locale: z.ZodOptional<z.ZodString>;
189
+ }, z.core.$strict>;
190
+ }, z.core.$strict>;
191
+ }, z.core.$strict>;
192
+ }, z.core.$strict>, z.ZodObject<{
193
+ apiVersion: z.ZodLiteral<"1">;
194
+ operation: z.ZodLiteral<"getValidationRequirements">;
195
+ input: z.ZodObject<{
196
+ collectionId: z.ZodString;
197
+ kind: z.ZodEnum<{
198
+ "developer-reference": "developer-reference";
199
+ explanation: "explanation";
200
+ troubleshooting: "troubleshooting";
201
+ walkthrough: "walkthrough";
202
+ }>;
203
+ }, z.core.$strict>;
204
+ }, z.core.$strict>, z.ZodObject<{
205
+ apiVersion: z.ZodLiteral<"1">;
206
+ operation: z.ZodLiteral<"submitEvidence">;
207
+ input: z.ZodObject<{
208
+ commandId: z.ZodString;
209
+ correlationId: z.ZodString;
210
+ expectedGeneration: z.ZodNumber;
211
+ articleId: z.ZodString;
212
+ evidence: z.ZodObject<{
213
+ id: z.ZodString;
214
+ articleId: z.ZodString;
215
+ articleRevision: z.ZodNumber;
216
+ contentHash: z.ZodString;
217
+ validationPolicy: z.ZodObject<{
218
+ id: z.ZodString;
219
+ version: z.ZodNumber;
220
+ }, z.core.$strict>;
221
+ checkId: z.ZodString;
222
+ testKind: z.ZodString;
223
+ applicability: z.ZodObject<{
224
+ productId: z.ZodString;
225
+ productVersion: z.ZodString;
226
+ buildId: z.ZodOptional<z.ZodString>;
227
+ locale: z.ZodOptional<z.ZodString>;
228
+ }, z.core.$strict>;
229
+ stagingBuildId: z.ZodString;
230
+ steps: z.ZodArray<z.ZodString>;
231
+ result: z.ZodEnum<{
232
+ failed: "failed";
233
+ inconclusive: "inconclusive";
234
+ passed: "passed";
235
+ }>;
236
+ executedAt: z.ZodString;
237
+ runnerId: z.ZodString;
238
+ artifacts: z.ZodArray<z.ZodObject<{
239
+ id: z.ZodString;
240
+ hash: z.ZodString;
241
+ }, z.core.$strict>>;
242
+ }, z.core.$strict>;
243
+ receipt: z.ZodString;
244
+ }, z.core.$strict>;
245
+ }, z.core.$strict>], "operation">;
246
+ export declare const knowledgeAgentResultSchemas: Readonly<{
247
+ getDraft: z.ZodObject<{
248
+ articleId: z.ZodString;
249
+ generation: z.ZodNumber;
250
+ state: z.ZodEnum<{
251
+ draft: "draft";
252
+ "in-review": "in-review";
253
+ published: "published";
254
+ retired: "retired";
255
+ }>;
256
+ revision: z.ZodObject<{
257
+ kind: z.ZodEnum<{
258
+ "developer-reference": "developer-reference";
259
+ explanation: "explanation";
260
+ troubleshooting: "troubleshooting";
261
+ walkthrough: "walkthrough";
262
+ }>;
263
+ title: z.ZodString;
264
+ summary: z.ZodString;
265
+ tags: z.ZodArray<z.ZodString>;
266
+ articleId: z.ZodString;
267
+ number: z.ZodNumber;
268
+ collectionId: z.ZodString;
269
+ validationPolicy: z.ZodObject<{
270
+ id: z.ZodString;
271
+ version: z.ZodNumber;
272
+ }, z.core.$strip>;
273
+ contentHash: z.ZodString;
274
+ createdBy: z.ZodString;
275
+ createdAt: z.ZodString;
276
+ content: z.ZodObject<{
277
+ format: z.ZodEnum<{
278
+ markdown: "markdown";
279
+ plain_text: "plain_text";
280
+ }>;
281
+ text: z.ZodString;
282
+ }, z.core.$strip>;
283
+ applicability: z.ZodObject<{
284
+ productId: z.ZodString;
285
+ productVersion: z.ZodString;
286
+ buildId: z.ZodOptional<z.ZodString>;
287
+ locale: z.ZodOptional<z.ZodString>;
288
+ }, z.core.$strip>;
289
+ }, z.core.$strip>;
290
+ hasPendingReview: z.ZodBoolean;
291
+ hasPublication: z.ZodBoolean;
292
+ publicationHeld: z.ZodBoolean;
293
+ }, z.core.$strip>;
294
+ createDraft: z.ZodObject<{
295
+ value: z.ZodObject<{
296
+ id: z.ZodString;
297
+ generation: z.ZodNumber;
298
+ articleRevision: z.ZodNumber;
299
+ state: z.ZodEnum<{
300
+ draft: "draft";
301
+ "in-review": "in-review";
302
+ published: "published";
303
+ retired: "retired";
304
+ }>;
305
+ contentHash: z.ZodString;
306
+ }, z.core.$strip>;
307
+ replayed: z.ZodBoolean;
308
+ }, z.core.$strip>;
309
+ updateDraft: z.ZodObject<{
310
+ value: z.ZodObject<{
311
+ id: z.ZodString;
312
+ generation: z.ZodNumber;
313
+ articleRevision: z.ZodNumber;
314
+ state: z.ZodEnum<{
315
+ draft: "draft";
316
+ "in-review": "in-review";
317
+ published: "published";
318
+ retired: "retired";
319
+ }>;
320
+ contentHash: z.ZodString;
321
+ }, z.core.$strip>;
322
+ replayed: z.ZodBoolean;
323
+ }, z.core.$strip>;
324
+ getValidationRequirements: z.ZodObject<{
325
+ collectionId: z.ZodString;
326
+ governanceGeneration: z.ZodNumber;
327
+ validationPolicy: z.ZodObject<{
328
+ id: z.ZodString;
329
+ version: z.ZodNumber;
330
+ }, z.core.$strip>;
331
+ expectedStagingBuildId: z.ZodString;
332
+ checks: z.ZodArray<z.ZodObject<{
333
+ id: z.ZodString;
334
+ testKind: z.ZodString;
335
+ maxAgeMilliseconds: z.ZodNumber;
336
+ }, z.core.$strip>>;
337
+ }, z.core.$strip>;
338
+ submitEvidence: z.ZodObject<{
339
+ value: z.ZodObject<{
340
+ id: z.ZodString;
341
+ generation: z.ZodNumber;
342
+ articleRevision: z.ZodNumber;
343
+ state: z.ZodEnum<{
344
+ draft: "draft";
345
+ "in-review": "in-review";
346
+ published: "published";
347
+ retired: "retired";
348
+ }>;
349
+ contentHash: z.ZodString;
350
+ }, z.core.$strip>;
351
+ replayed: z.ZodBoolean;
352
+ }, z.core.$strip>;
353
+ }>;
354
+ export declare function resolveKnowledgeAgentLimits(requested?: Partial<KnowledgeAgentLimits>): KnowledgeAgentLimits;
355
+ /**
356
+ * Detach only plain JSON data properties, with work/encoded-byte accounting
357
+ * before Zod reads them. Accessors, sparse arrays, cycles, symbols, and custom
358
+ * prototypes are rejected without invoking JSON coercion or a getter.
359
+ */
360
+ export declare function snapshotKnowledgeAgentJson(value: unknown, limits: KnowledgeAgentLimits, maximumBytes?: number): unknown;
361
+ /** Bound UTF-8 bytes and every structural ceiling before invoking JSON.parse. */
362
+ export declare function parseKnowledgeAgentJson(source: string, requested?: Partial<KnowledgeAgentLimits>): unknown;
363
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AA8EpB,wEAAwE;AACxE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCrC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAoCvC,CAAC;AAiCH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCtC,CAAC;AAEH,wBAAgB,2BAA2B,CACzC,SAAS,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC5C,oBAAoB,CAgCtB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,oBAAoB,EAC5B,YAAY,SAAyB,GACpC,OAAO,CAyFT;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAkFT"}