midnight-mcp 0.0.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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +136 -0
  3. package/dist/db/index.d.ts +3 -0
  4. package/dist/db/index.d.ts.map +1 -0
  5. package/dist/db/index.js +2 -0
  6. package/dist/db/index.js.map +1 -0
  7. package/dist/db/vectorStore.d.ts +66 -0
  8. package/dist/db/vectorStore.d.ts.map +1 -0
  9. package/dist/db/vectorStore.js +196 -0
  10. package/dist/db/vectorStore.js.map +1 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +17 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/pipeline/embeddings.d.ts +25 -0
  16. package/dist/pipeline/embeddings.d.ts.map +1 -0
  17. package/dist/pipeline/embeddings.js +103 -0
  18. package/dist/pipeline/embeddings.js.map +1 -0
  19. package/dist/pipeline/github.d.ts +67 -0
  20. package/dist/pipeline/github.d.ts.map +1 -0
  21. package/dist/pipeline/github.js +287 -0
  22. package/dist/pipeline/github.js.map +1 -0
  23. package/dist/pipeline/index.d.ts +11 -0
  24. package/dist/pipeline/index.d.ts.map +1 -0
  25. package/dist/pipeline/index.js +6 -0
  26. package/dist/pipeline/index.js.map +1 -0
  27. package/dist/pipeline/indexer.d.ts +38 -0
  28. package/dist/pipeline/indexer.d.ts.map +1 -0
  29. package/dist/pipeline/indexer.js +222 -0
  30. package/dist/pipeline/indexer.js.map +1 -0
  31. package/dist/pipeline/parser.d.ts +46 -0
  32. package/dist/pipeline/parser.d.ts.map +1 -0
  33. package/dist/pipeline/parser.js +436 -0
  34. package/dist/pipeline/parser.js.map +1 -0
  35. package/dist/pipeline/releases.d.ts +112 -0
  36. package/dist/pipeline/releases.d.ts.map +1 -0
  37. package/dist/pipeline/releases.js +298 -0
  38. package/dist/pipeline/releases.js.map +1 -0
  39. package/dist/pipeline/repository.d.ts +372 -0
  40. package/dist/pipeline/repository.d.ts.map +1 -0
  41. package/dist/pipeline/repository.js +517 -0
  42. package/dist/pipeline/repository.js.map +1 -0
  43. package/dist/prompts/index.d.ts +3 -0
  44. package/dist/prompts/index.d.ts.map +1 -0
  45. package/dist/prompts/index.js +2 -0
  46. package/dist/prompts/index.js.map +1 -0
  47. package/dist/prompts/templates.d.ts +26 -0
  48. package/dist/prompts/templates.d.ts.map +1 -0
  49. package/dist/prompts/templates.js +353 -0
  50. package/dist/prompts/templates.js.map +1 -0
  51. package/dist/resources/code.d.ts +16 -0
  52. package/dist/resources/code.d.ts.map +1 -0
  53. package/dist/resources/code.js +630 -0
  54. package/dist/resources/code.js.map +1 -0
  55. package/dist/resources/docs.d.ts +16 -0
  56. package/dist/resources/docs.d.ts.map +1 -0
  57. package/dist/resources/docs.js +989 -0
  58. package/dist/resources/docs.js.map +1 -0
  59. package/dist/resources/index.d.ts +6 -0
  60. package/dist/resources/index.d.ts.map +1 -0
  61. package/dist/resources/index.js +13 -0
  62. package/dist/resources/index.js.map +1 -0
  63. package/dist/resources/schemas.d.ts +16 -0
  64. package/dist/resources/schemas.d.ts.map +1 -0
  65. package/dist/resources/schemas.js +407 -0
  66. package/dist/resources/schemas.js.map +1 -0
  67. package/dist/scripts/index-repos.d.ts +12 -0
  68. package/dist/scripts/index-repos.d.ts.map +1 -0
  69. package/dist/scripts/index-repos.js +53 -0
  70. package/dist/scripts/index-repos.js.map +1 -0
  71. package/dist/server.d.ts +14 -0
  72. package/dist/server.d.ts.map +1 -0
  73. package/dist/server.js +231 -0
  74. package/dist/server.js.map +1 -0
  75. package/dist/tools/analyze.d.ts +140 -0
  76. package/dist/tools/analyze.d.ts.map +1 -0
  77. package/dist/tools/analyze.js +270 -0
  78. package/dist/tools/analyze.js.map +1 -0
  79. package/dist/tools/index.d.ts +392 -0
  80. package/dist/tools/index.d.ts.map +1 -0
  81. package/dist/tools/index.js +9 -0
  82. package/dist/tools/index.js.map +1 -0
  83. package/dist/tools/repository.d.ts +537 -0
  84. package/dist/tools/repository.d.ts.map +1 -0
  85. package/dist/tools/repository.js +654 -0
  86. package/dist/tools/repository.js.map +1 -0
  87. package/dist/tools/search.d.ts +204 -0
  88. package/dist/tools/search.d.ts.map +1 -0
  89. package/dist/tools/search.js +210 -0
  90. package/dist/tools/search.js.map +1 -0
  91. package/dist/utils/config.d.ts +66 -0
  92. package/dist/utils/config.d.ts.map +1 -0
  93. package/dist/utils/config.js +161 -0
  94. package/dist/utils/config.js.map +1 -0
  95. package/dist/utils/index.d.ts +5 -0
  96. package/dist/utils/index.d.ts.map +1 -0
  97. package/dist/utils/index.js +4 -0
  98. package/dist/utils/index.js.map +1 -0
  99. package/dist/utils/logger.d.ts +14 -0
  100. package/dist/utils/logger.d.ts.map +1 -0
  101. package/dist/utils/logger.js +43 -0
  102. package/dist/utils/logger.js.map +1 -0
  103. package/package.json +64 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/resources/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAS3C,8BAA8B;AAC9B,MAAM,CAAC,MAAM,sBAAsB,GAAyB;IAC1D;QACE,GAAG,EAAE,mCAAmC;QACxC,IAAI,EAAE,4BAA4B;QAClC,WAAW,EACT,0GAA0G;QAC5G,QAAQ,EAAE,eAAe;KAC1B;IACD;QACE,GAAG,EAAE,yBAAyB;QAC9B,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,0EAA0E;QAC5E,QAAQ,EAAE,eAAe;KAC1B;IACD;QACE,GAAG,EAAE,yCAAyC;QAC9C,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACT,kEAAkE;QACpE,QAAQ,EAAE,eAAe;KAC1B;IACD;QACE,GAAG,EAAE,yCAAyC;QAC9C,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT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,CAAC,CAAC;QACpD,IAAI,CAAC;YACH,uCAAuC;YACvC,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,cAAc,CAC5C,eAAe,EACf,eAAe,EACf,QAAQ,OAAO,KAAK,CACrB,CAAC;YACF,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,IAAI,CAAC,OAAO,CAAC;YACtB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,IAAI,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,sBAAsB,CAAC;AAChC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { documentationResources, getDocumentation, listDocumentationResources, } from "./docs.js";
2
+ export { codeResources, getCode, listCodeResources, } from "./code.js";
3
+ export { schemaResources, getSchema, listSchemaResources, } from "./schemas.js";
4
+ export type { ResourceDefinition } from "./docs.js";
5
+ export declare const allResources: import("./docs.js").ResourceDefinition[];
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,aAAa,EACb,OAAO,EACP,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,eAAe,EACf,SAAS,EACT,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAOpD,eAAO,MAAM,YAAY,0CAIxB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export { documentationResources, getDocumentation, listDocumentationResources, } from "./docs.js";
2
+ export { codeResources, getCode, listCodeResources, } from "./code.js";
3
+ export { schemaResources, getSchema, listSchemaResources, } from "./schemas.js";
4
+ // Combine all resources
5
+ import { documentationResources } from "./docs.js";
6
+ import { codeResources } from "./code.js";
7
+ import { schemaResources } from "./schemas.js";
8
+ export const allResources = [
9
+ ...documentationResources,
10
+ ...codeResources,
11
+ ...schemaResources,
12
+ ];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,aAAa,EACb,OAAO,EACP,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,eAAe,EACf,SAAS,EACT,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAItB,wBAAwB;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,sBAAsB;IACzB,GAAG,aAAa;IAChB,GAAG,eAAe;CACnB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface ResourceDefinition {
2
+ uri: string;
3
+ name: string;
4
+ description: string;
5
+ mimeType: string;
6
+ }
7
+ export declare const schemaResources: ResourceDefinition[];
8
+ /**
9
+ * Get schema content by URI
10
+ */
11
+ export declare function getSchema(uri: string): object | null;
12
+ /**
13
+ * List all available schema resources
14
+ */
15
+ export declare function listSchemaResources(): ResourceDefinition[];
16
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/resources/schemas.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,eAAO,MAAM,eAAe,EAAE,kBAAkB,EAmB/C,CAAC;AA0XF;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEpD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,kBAAkB,EAAE,CAE1D"}
@@ -0,0 +1,407 @@
1
+ // Schema resources
2
+ export const schemaResources = [
3
+ {
4
+ uri: "midnight://schema/compact-ast",
5
+ name: "Compact AST Schema",
6
+ description: "JSON schema for Compact Abstract Syntax Tree structures",
7
+ mimeType: "application/json",
8
+ },
9
+ {
10
+ uri: "midnight://schema/transaction",
11
+ name: "Transaction Schema",
12
+ description: "Transaction format schema for Midnight network",
13
+ mimeType: "application/json",
14
+ },
15
+ {
16
+ uri: "midnight://schema/proof",
17
+ name: "Proof Schema",
18
+ description: "ZK proof format schema",
19
+ mimeType: "application/json",
20
+ },
21
+ ];
22
+ // Embedded schemas
23
+ const EMBEDDED_SCHEMAS = {
24
+ "midnight://schema/compact-ast": {
25
+ $schema: "http://json-schema.org/draft-07/schema#",
26
+ title: "Compact AST",
27
+ description: "Abstract Syntax Tree for Compact smart contracts",
28
+ type: "object",
29
+ definitions: {
30
+ LedgerDeclaration: {
31
+ type: "object",
32
+ properties: {
33
+ type: { const: "LedgerDeclaration" },
34
+ fields: {
35
+ type: "array",
36
+ items: { $ref: "#/definitions/LedgerField" },
37
+ },
38
+ },
39
+ required: ["type", "fields"],
40
+ },
41
+ LedgerField: {
42
+ type: "object",
43
+ properties: {
44
+ name: { type: "string" },
45
+ fieldType: { type: "string" },
46
+ isPrivate: { type: "boolean" },
47
+ annotations: { type: "array", items: { type: "string" } },
48
+ },
49
+ required: ["name", "fieldType"],
50
+ },
51
+ CircuitDeclaration: {
52
+ type: "object",
53
+ properties: {
54
+ type: { const: "CircuitDeclaration" },
55
+ name: { type: "string" },
56
+ isExported: { type: "boolean" },
57
+ parameters: {
58
+ type: "array",
59
+ items: { $ref: "#/definitions/Parameter" },
60
+ },
61
+ returnType: { type: "string" },
62
+ body: { $ref: "#/definitions/BlockStatement" },
63
+ },
64
+ required: ["type", "name", "parameters", "body"],
65
+ },
66
+ WitnessDeclaration: {
67
+ type: "object",
68
+ properties: {
69
+ type: { const: "WitnessDeclaration" },
70
+ name: { type: "string" },
71
+ parameters: {
72
+ type: "array",
73
+ items: { $ref: "#/definitions/Parameter" },
74
+ },
75
+ returnType: { type: "string" },
76
+ body: { $ref: "#/definitions/BlockStatement" },
77
+ },
78
+ required: ["type", "name", "parameters", "body"],
79
+ },
80
+ Parameter: {
81
+ type: "object",
82
+ properties: {
83
+ name: { type: "string" },
84
+ paramType: { type: "string" },
85
+ isPrivate: { type: "boolean" },
86
+ },
87
+ required: ["name", "paramType"],
88
+ },
89
+ BlockStatement: {
90
+ type: "object",
91
+ properties: {
92
+ type: { const: "BlockStatement" },
93
+ statements: {
94
+ type: "array",
95
+ items: { $ref: "#/definitions/Statement" },
96
+ },
97
+ },
98
+ required: ["type", "statements"],
99
+ },
100
+ Statement: {
101
+ oneOf: [
102
+ { $ref: "#/definitions/VariableDeclaration" },
103
+ { $ref: "#/definitions/AssertStatement" },
104
+ { $ref: "#/definitions/ReturnStatement" },
105
+ { $ref: "#/definitions/ExpressionStatement" },
106
+ ],
107
+ },
108
+ VariableDeclaration: {
109
+ type: "object",
110
+ properties: {
111
+ type: { const: "VariableDeclaration" },
112
+ name: { type: "string" },
113
+ varType: { type: "string" },
114
+ initializer: { $ref: "#/definitions/Expression" },
115
+ },
116
+ required: ["type", "name"],
117
+ },
118
+ AssertStatement: {
119
+ type: "object",
120
+ properties: {
121
+ type: { const: "AssertStatement" },
122
+ condition: { $ref: "#/definitions/Expression" },
123
+ message: { type: "string" },
124
+ },
125
+ required: ["type", "condition"],
126
+ },
127
+ ReturnStatement: {
128
+ type: "object",
129
+ properties: {
130
+ type: { const: "ReturnStatement" },
131
+ value: { $ref: "#/definitions/Expression" },
132
+ },
133
+ required: ["type"],
134
+ },
135
+ ExpressionStatement: {
136
+ type: "object",
137
+ properties: {
138
+ type: { const: "ExpressionStatement" },
139
+ expression: { $ref: "#/definitions/Expression" },
140
+ },
141
+ required: ["type", "expression"],
142
+ },
143
+ Expression: {
144
+ oneOf: [
145
+ { $ref: "#/definitions/BinaryExpression" },
146
+ { $ref: "#/definitions/CallExpression" },
147
+ { $ref: "#/definitions/MemberExpression" },
148
+ { $ref: "#/definitions/Identifier" },
149
+ { $ref: "#/definitions/Literal" },
150
+ ],
151
+ },
152
+ BinaryExpression: {
153
+ type: "object",
154
+ properties: {
155
+ type: { const: "BinaryExpression" },
156
+ operator: { type: "string" },
157
+ left: { $ref: "#/definitions/Expression" },
158
+ right: { $ref: "#/definitions/Expression" },
159
+ },
160
+ required: ["type", "operator", "left", "right"],
161
+ },
162
+ CallExpression: {
163
+ type: "object",
164
+ properties: {
165
+ type: { const: "CallExpression" },
166
+ callee: { $ref: "#/definitions/Expression" },
167
+ arguments: {
168
+ type: "array",
169
+ items: { $ref: "#/definitions/Expression" },
170
+ },
171
+ },
172
+ required: ["type", "callee", "arguments"],
173
+ },
174
+ MemberExpression: {
175
+ type: "object",
176
+ properties: {
177
+ type: { const: "MemberExpression" },
178
+ object: { $ref: "#/definitions/Expression" },
179
+ property: { type: "string" },
180
+ },
181
+ required: ["type", "object", "property"],
182
+ },
183
+ Identifier: {
184
+ type: "object",
185
+ properties: {
186
+ type: { const: "Identifier" },
187
+ name: { type: "string" },
188
+ },
189
+ required: ["type", "name"],
190
+ },
191
+ Literal: {
192
+ type: "object",
193
+ properties: {
194
+ type: { const: "Literal" },
195
+ value: {},
196
+ raw: { type: "string" },
197
+ },
198
+ required: ["type", "value"],
199
+ },
200
+ },
201
+ properties: {
202
+ type: { const: "Program" },
203
+ imports: {
204
+ type: "array",
205
+ items: { type: "string" },
206
+ },
207
+ ledger: { $ref: "#/definitions/LedgerDeclaration" },
208
+ circuits: {
209
+ type: "array",
210
+ items: { $ref: "#/definitions/CircuitDeclaration" },
211
+ },
212
+ witnesses: {
213
+ type: "array",
214
+ items: { $ref: "#/definitions/WitnessDeclaration" },
215
+ },
216
+ types: {
217
+ type: "array",
218
+ items: {
219
+ type: "object",
220
+ properties: {
221
+ name: { type: "string" },
222
+ definition: { type: "string" },
223
+ },
224
+ },
225
+ },
226
+ },
227
+ required: ["type"],
228
+ },
229
+ "midnight://schema/transaction": {
230
+ $schema: "http://json-schema.org/draft-07/schema#",
231
+ title: "Midnight Transaction",
232
+ description: "Transaction format for Midnight network",
233
+ type: "object",
234
+ properties: {
235
+ version: {
236
+ type: "integer",
237
+ description: "Transaction format version",
238
+ },
239
+ hash: {
240
+ type: "string",
241
+ description: "Transaction hash (hex)",
242
+ pattern: "^0x[a-fA-F0-9]{64}$",
243
+ },
244
+ contractAddress: {
245
+ type: "string",
246
+ description: "Target contract address",
247
+ },
248
+ circuitName: {
249
+ type: "string",
250
+ description: "Name of the circuit being called",
251
+ },
252
+ inputs: {
253
+ type: "object",
254
+ description: "Public inputs to the circuit",
255
+ additionalProperties: true,
256
+ },
257
+ proof: {
258
+ $ref: "#/definitions/Proof",
259
+ },
260
+ publicOutputs: {
261
+ type: "array",
262
+ description: "Public outputs from circuit execution",
263
+ items: {},
264
+ },
265
+ stateChanges: {
266
+ type: "array",
267
+ items: { $ref: "#/definitions/StateChange" },
268
+ },
269
+ timestamp: {
270
+ type: "integer",
271
+ description: "Transaction timestamp (Unix)",
272
+ },
273
+ sender: {
274
+ type: "string",
275
+ description: "Transaction sender address",
276
+ },
277
+ nonce: {
278
+ type: "integer",
279
+ description: "Transaction nonce",
280
+ },
281
+ fee: {
282
+ type: "string",
283
+ description: "Transaction fee",
284
+ },
285
+ },
286
+ definitions: {
287
+ Proof: {
288
+ type: "object",
289
+ properties: {
290
+ type: {
291
+ type: "string",
292
+ enum: ["groth16", "plonk"],
293
+ },
294
+ data: {
295
+ type: "string",
296
+ description: "Base64 encoded proof data",
297
+ },
298
+ publicInputs: {
299
+ type: "array",
300
+ items: { type: "string" },
301
+ },
302
+ },
303
+ required: ["type", "data", "publicInputs"],
304
+ },
305
+ StateChange: {
306
+ type: "object",
307
+ properties: {
308
+ type: {
309
+ type: "string",
310
+ enum: ["insert", "update", "delete"],
311
+ },
312
+ path: {
313
+ type: "string",
314
+ description: "State path being modified",
315
+ },
316
+ oldValue: {
317
+ description: "Previous value (for updates/deletes)",
318
+ },
319
+ newValue: {
320
+ description: "New value (for inserts/updates)",
321
+ },
322
+ },
323
+ required: ["type", "path"],
324
+ },
325
+ },
326
+ required: ["version", "contractAddress", "circuitName", "proof"],
327
+ },
328
+ "midnight://schema/proof": {
329
+ $schema: "http://json-schema.org/draft-07/schema#",
330
+ title: "Midnight ZK Proof",
331
+ description: "Zero-knowledge proof format",
332
+ type: "object",
333
+ properties: {
334
+ proofSystem: {
335
+ type: "string",
336
+ enum: ["groth16", "plonk", "halo2"],
337
+ description: "Proof system used",
338
+ },
339
+ curve: {
340
+ type: "string",
341
+ enum: ["bn254", "bls12-381"],
342
+ description: "Elliptic curve used",
343
+ },
344
+ proof: {
345
+ type: "object",
346
+ properties: {
347
+ a: {
348
+ type: "array",
349
+ items: { type: "string" },
350
+ description: "Proof element A (G1 point)",
351
+ },
352
+ b: {
353
+ type: "array",
354
+ items: {
355
+ type: "array",
356
+ items: { type: "string" },
357
+ },
358
+ description: "Proof element B (G2 point)",
359
+ },
360
+ c: {
361
+ type: "array",
362
+ items: { type: "string" },
363
+ description: "Proof element C (G1 point)",
364
+ },
365
+ },
366
+ required: ["a", "b", "c"],
367
+ },
368
+ publicInputs: {
369
+ type: "array",
370
+ items: { type: "string" },
371
+ description: "Public inputs to the circuit",
372
+ },
373
+ publicOutputs: {
374
+ type: "array",
375
+ items: { type: "string" },
376
+ description: "Public outputs from the circuit",
377
+ },
378
+ verificationKey: {
379
+ type: "string",
380
+ description: "Reference to verification key",
381
+ },
382
+ metadata: {
383
+ type: "object",
384
+ properties: {
385
+ circuitName: { type: "string" },
386
+ contractAddress: { type: "string" },
387
+ generatedAt: { type: "integer" },
388
+ proverVersion: { type: "string" },
389
+ },
390
+ },
391
+ },
392
+ required: ["proofSystem", "proof", "publicInputs"],
393
+ },
394
+ };
395
+ /**
396
+ * Get schema content by URI
397
+ */
398
+ export function getSchema(uri) {
399
+ return EMBEDDED_SCHEMAS[uri] || null;
400
+ }
401
+ /**
402
+ * List all available schema resources
403
+ */
404
+ export function listSchemaResources() {
405
+ return schemaResources;
406
+ }
407
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/resources/schemas.ts"],"names":[],"mappings":"AAOA,mBAAmB;AACnB,MAAM,CAAC,MAAM,eAAe,GAAyB;IACnD;QACE,GAAG,EAAE,+BAA+B;QACpC,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,yDAAyD;QACtE,QAAQ,EAAE,kBAAkB;KAC7B;IACD;QACE,GAAG,EAAE,+BAA+B;QACpC,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,gDAAgD;QAC7D,QAAQ,EAAE,kBAAkB;KAC7B;IACD;QACE,GAAG,EAAE,yBAAyB;QAC9B,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,wBAAwB;QACrC,QAAQ,EAAE,kBAAkB;KAC7B;CACF,CAAC;AAEF,mBAAmB;AACnB,MAAM,gBAAgB,GAA2B;IAC/C,+BAA+B,EAAE;QAC/B,OAAO,EAAE,yCAAyC;QAClD,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,kDAAkD;QAC/D,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;YACX,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBACpC,MAAM,EAAE;wBACN,IAAI,EAAE,OAA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A4B;qBAC1C;iBACF;gBACD,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;aAC1B;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,8BAA8B;aAC5C;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,iCAAiC;aAC/C;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+BAA+B;aAC7C;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC/B,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACnC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAChC,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAClC;aACF;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,cAAc,CAAC;KACnD;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,gBAAgB,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Repository Indexing Script
4
+ *
5
+ * Run this script to index all Midnight repositories into the vector database.
6
+ *
7
+ * Usage:
8
+ * npm run index # Index all repos
9
+ * npm run index -- --repo compact # Index specific repo
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=index-repos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-repos.d.ts","sourceRoot":"","sources":["../../src/scripts/index-repos.ts"],"names":[],"mappings":";AAEA;;;;;;;;GAQG"}
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Repository Indexing Script
4
+ *
5
+ * Run this script to index all Midnight repositories into the vector database.
6
+ *
7
+ * Usage:
8
+ * npm run index # Index all repos
9
+ * npm run index -- --repo compact # Index specific repo
10
+ */
11
+ import { indexAllRepositories, indexRepository } from "../pipeline/index.js";
12
+ import { DEFAULT_REPOSITORIES, logger } from "../utils/index.js";
13
+ import { vectorStore } from "../db/index.js";
14
+ async function main() {
15
+ const args = process.argv.slice(2);
16
+ const repoArg = args.find((a) => a.startsWith("--repo="));
17
+ const specificRepo = repoArg?.split("=")[1];
18
+ logger.info("Starting repository indexing...");
19
+ // Initialize vector store
20
+ try {
21
+ await vectorStore.initialize();
22
+ }
23
+ catch (error) {
24
+ logger.error("Failed to initialize vector store", { error: String(error) });
25
+ logger.info("Make sure ChromaDB is running: docker run -p 8000:8000 chromadb/chroma");
26
+ process.exit(1);
27
+ }
28
+ if (specificRepo) {
29
+ // Index specific repository
30
+ const repoConfig = DEFAULT_REPOSITORIES.find((r) => r.repo.toLowerCase() === specificRepo.toLowerCase());
31
+ if (!repoConfig) {
32
+ logger.error(`Unknown repository: ${specificRepo}`);
33
+ logger.info(`Available repositories: ${DEFAULT_REPOSITORIES.map((r) => r.repo).join(", ")}`);
34
+ process.exit(1);
35
+ }
36
+ logger.info(`Indexing repository: ${repoConfig.owner}/${repoConfig.repo}`);
37
+ const result = await indexRepository(repoConfig);
38
+ logger.info("Indexing complete", result);
39
+ }
40
+ else {
41
+ // Index all repositories
42
+ const stats = await indexAllRepositories();
43
+ logger.info("Full indexing complete", stats);
44
+ }
45
+ // Print statistics
46
+ const dbStats = await vectorStore.getStats();
47
+ logger.info(`Vector store now contains ${dbStats.count} documents`);
48
+ }
49
+ main().catch((error) => {
50
+ logger.error("Indexing failed", { error: String(error) });
51
+ process.exit(1);
52
+ });
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F,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;YACpD,MAAM,CAAC,IAAI,CACT,2BAA2B,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChF,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,wBAAwB,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,yBAAyB;QACzB,MAAM,KAAK,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,mBAAmB;IACnB,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC7C,MAAM,CAAC,IAAI,CAAC,6BAA6B,OAAO,CAAC,KAAK,YAAY,CAAC,CAAC;AACtE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ /**
3
+ * Create and configure the MCP server
4
+ */
5
+ export declare function createServer(): Server;
6
+ /**
7
+ * Initialize the server and vector store
8
+ */
9
+ export declare function initializeServer(): Promise<Server>;
10
+ /**
11
+ * Start the server with stdio transport
12
+ */
13
+ export declare function startServer(): Promise<void>;
14
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA6BnE;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAwBrC;AAgLD;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAkBxD;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAOjD"}