midnight-mcp 0.1.40 → 0.2.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 (100) hide show
  1. package/README.md +34 -0
  2. package/dist/bin.d.ts +1 -0
  3. package/dist/bin.js +10764 -0
  4. package/dist/index.d.ts +205 -3
  5. package/dist/index.js +10722 -15
  6. package/package.json +16 -6
  7. package/dist/config/compact-version.d.ts +0 -183
  8. package/dist/config/compact-version.js +0 -423
  9. package/dist/db/index.d.ts +0 -3
  10. package/dist/db/index.js +0 -2
  11. package/dist/db/vectorStore.d.ts +0 -69
  12. package/dist/db/vectorStore.js +0 -196
  13. package/dist/pipeline/embeddings.d.ts +0 -25
  14. package/dist/pipeline/embeddings.js +0 -103
  15. package/dist/pipeline/github.d.ts +0 -84
  16. package/dist/pipeline/github.js +0 -399
  17. package/dist/pipeline/index.d.ts +0 -11
  18. package/dist/pipeline/index.js +0 -6
  19. package/dist/pipeline/indexer.d.ts +0 -41
  20. package/dist/pipeline/indexer.js +0 -254
  21. package/dist/pipeline/parser.d.ts +0 -46
  22. package/dist/pipeline/parser.js +0 -436
  23. package/dist/pipeline/releases.d.ts +0 -112
  24. package/dist/pipeline/releases.js +0 -298
  25. package/dist/pipeline/repository.d.ts +0 -372
  26. package/dist/pipeline/repository.js +0 -520
  27. package/dist/prompts/index.d.ts +0 -3
  28. package/dist/prompts/index.js +0 -2
  29. package/dist/prompts/templates.d.ts +0 -26
  30. package/dist/prompts/templates.js +0 -443
  31. package/dist/resources/code.d.ts +0 -15
  32. package/dist/resources/code.js +0 -122
  33. package/dist/resources/content/code-content.d.ts +0 -6
  34. package/dist/resources/content/code-content.js +0 -802
  35. package/dist/resources/content/docs-content.d.ts +0 -14
  36. package/dist/resources/content/docs-content.js +0 -1202
  37. package/dist/resources/content/index.d.ts +0 -6
  38. package/dist/resources/content/index.js +0 -6
  39. package/dist/resources/docs.d.ts +0 -15
  40. package/dist/resources/docs.js +0 -98
  41. package/dist/resources/index.d.ts +0 -6
  42. package/dist/resources/index.js +0 -13
  43. package/dist/resources/schemas.d.ts +0 -16
  44. package/dist/resources/schemas.js +0 -407
  45. package/dist/scripts/index-repos.d.ts +0 -12
  46. package/dist/scripts/index-repos.js +0 -53
  47. package/dist/server.d.ts +0 -43
  48. package/dist/server.js +0 -693
  49. package/dist/services/index.d.ts +0 -6
  50. package/dist/services/index.js +0 -6
  51. package/dist/services/sampling.d.ts +0 -62
  52. package/dist/services/sampling.js +0 -277
  53. package/dist/tools/analyze.d.ts +0 -106
  54. package/dist/tools/analyze.js +0 -431
  55. package/dist/tools/generation.d.ts +0 -9
  56. package/dist/tools/generation.js +0 -285
  57. package/dist/tools/health.d.ts +0 -120
  58. package/dist/tools/health.js +0 -362
  59. package/dist/tools/index.d.ts +0 -14
  60. package/dist/tools/index.js +0 -22
  61. package/dist/tools/meta.d.ts +0 -61
  62. package/dist/tools/meta.js +0 -282
  63. package/dist/tools/repository/constants.d.ts +0 -19
  64. package/dist/tools/repository/constants.js +0 -324
  65. package/dist/tools/repository/handlers.d.ts +0 -373
  66. package/dist/tools/repository/handlers.js +0 -724
  67. package/dist/tools/repository/index.d.ts +0 -9
  68. package/dist/tools/repository/index.js +0 -13
  69. package/dist/tools/repository/schemas.d.ts +0 -153
  70. package/dist/tools/repository/schemas.js +0 -106
  71. package/dist/tools/repository/tools.d.ts +0 -7
  72. package/dist/tools/repository/tools.js +0 -484
  73. package/dist/tools/repository/validation.d.ts +0 -106
  74. package/dist/tools/repository/validation.js +0 -820
  75. package/dist/tools/repository.d.ts +0 -6
  76. package/dist/tools/repository.js +0 -7
  77. package/dist/tools/search.d.ts +0 -76
  78. package/dist/tools/search.js +0 -423
  79. package/dist/types/index.d.ts +0 -2
  80. package/dist/types/index.js +0 -2
  81. package/dist/types/mcp.d.ts +0 -187
  82. package/dist/types/mcp.js +0 -6
  83. package/dist/utils/cache.d.ts +0 -77
  84. package/dist/utils/cache.js +0 -172
  85. package/dist/utils/config.d.ts +0 -70
  86. package/dist/utils/config.js +0 -294
  87. package/dist/utils/errors.d.ts +0 -111
  88. package/dist/utils/errors.js +0 -165
  89. package/dist/utils/health.d.ts +0 -29
  90. package/dist/utils/health.js +0 -132
  91. package/dist/utils/hosted-api.d.ts +0 -67
  92. package/dist/utils/hosted-api.js +0 -119
  93. package/dist/utils/index.d.ts +0 -16
  94. package/dist/utils/index.js +0 -15
  95. package/dist/utils/logger.d.ts +0 -48
  96. package/dist/utils/logger.js +0 -124
  97. package/dist/utils/rate-limit.d.ts +0 -61
  98. package/dist/utils/rate-limit.js +0 -148
  99. package/dist/utils/validation.d.ts +0 -52
  100. package/dist/utils/validation.js +0 -255
@@ -1,373 +0,0 @@
1
- /**
2
- * Repository handler functions
3
- * Business logic for repository-related MCP tools
4
- */
5
- import type { GetFileInput, ListExamplesInput, GetLatestUpdatesInput, GetVersionInfoInput, CheckBreakingChangesInput, GetMigrationGuideInput, GetFileAtVersionInput, CompareSyntaxInput, GetLatestSyntaxInput, UpgradeCheckInput, FullRepoContextInput } from "./schemas.js";
6
- export { extractContractStructure } from "./validation.js";
7
- /**
8
- * Resolve repository name alias to owner/repo
9
- */
10
- export declare function resolveRepo(repoName?: string): {
11
- owner: string;
12
- repo: string;
13
- } | null;
14
- /**
15
- * Retrieve a specific file from Midnight repositories
16
- */
17
- export declare function getFile(input: GetFileInput): Promise<{
18
- error: string;
19
- code: "UNKNOWN_REPOSITORY";
20
- suggestion: string;
21
- correction: {
22
- invalidValue: string;
23
- validValues: string[];
24
- parameterName: string;
25
- };
26
- } | {
27
- error: string;
28
- code: "RESOURCE_NOT_FOUND";
29
- suggestion: string;
30
- correction: {
31
- suggestions?: string[] | undefined;
32
- invalidPath: string;
33
- };
34
- } | {
35
- content: string;
36
- path: string;
37
- repository: string;
38
- sha: string;
39
- size: number;
40
- url: string;
41
- }>;
42
- /**
43
- * List available example contracts and DApps
44
- */
45
- export declare function listExamples(input: ListExamplesInput): Promise<{
46
- examples: {
47
- name: string;
48
- repository: string;
49
- description: string;
50
- complexity: "beginner" | "intermediate" | "advanced";
51
- mainFile: string;
52
- features: string[];
53
- githubUrl: string;
54
- }[];
55
- totalCount: number;
56
- categories: string[];
57
- }>;
58
- /**
59
- * Retrieve recent changes across Midnight repositories
60
- */
61
- export declare function getLatestUpdates(input: GetLatestUpdatesInput): Promise<{
62
- summary: {
63
- since: string;
64
- totalCommits: number;
65
- activeRepositories: number;
66
- checkedRepositories: number;
67
- };
68
- updates: {
69
- repository: string;
70
- commitCount: number;
71
- latestCommit: {
72
- message: string;
73
- date: string;
74
- author: string;
75
- url: string;
76
- } | null;
77
- recentCommits: {
78
- message: string;
79
- date: string;
80
- sha: string;
81
- }[];
82
- }[];
83
- }>;
84
- /**
85
- * Get version and release info for a repository
86
- */
87
- export declare function getVersionInfo(input: GetVersionInfoInput): Promise<{
88
- repository: string;
89
- latestVersion: string;
90
- latestStableVersion: string;
91
- publishedAt: string | null;
92
- releaseNotes: string | null;
93
- recentReleases: {
94
- version: string;
95
- date: string;
96
- isPrerelease: boolean;
97
- url: string;
98
- }[];
99
- recentBreakingChanges: string[];
100
- versionContext: string;
101
- }>;
102
- /**
103
- * Check for breaking changes since a specific version
104
- */
105
- export declare function checkBreakingChanges(input: CheckBreakingChangesInput): Promise<{
106
- repository: string;
107
- currentVersion: string;
108
- latestVersion: string | null;
109
- isOutdated: boolean;
110
- versionsBehind: number;
111
- hasBreakingChanges: boolean;
112
- breakingChanges: string[];
113
- recommendation: string;
114
- }>;
115
- /**
116
- * Get migration guide between versions
117
- */
118
- export declare function getMigrationGuide(input: GetMigrationGuideInput): Promise<{
119
- repository: string;
120
- from: string;
121
- to: string;
122
- summary: {
123
- breakingChangesCount: number;
124
- deprecationsCount: number;
125
- newFeaturesCount: number;
126
- };
127
- breakingChanges: string[];
128
- deprecations: string[];
129
- newFeatures: string[];
130
- migrationSteps: string[];
131
- migrationDifficulty: string;
132
- }>;
133
- /**
134
- * Get a file at a specific version - critical for version-accurate recommendations
135
- */
136
- export declare function getFileAtVersion(input: GetFileAtVersionInput): Promise<{
137
- repository: string;
138
- path: string;
139
- version: string;
140
- content: string;
141
- note: string;
142
- }>;
143
- /**
144
- * Compare syntax between two versions - shows what changed
145
- */
146
- export declare function compareSyntax(input: CompareSyntaxInput): Promise<{
147
- repository: string;
148
- path: string;
149
- oldVersion: string;
150
- newVersion: string;
151
- hasDifferences: boolean;
152
- oldContent: string | null;
153
- newContent: string | null;
154
- recommendation: string;
155
- }>;
156
- /**
157
- * Get the latest syntax reference for Compact language
158
- * This is the source of truth for writing valid, compilable contracts
159
- */
160
- export declare function getLatestSyntax(input: GetLatestSyntaxInput): Promise<{
161
- quickStartTemplate: string;
162
- builtinFunctions: {
163
- stdlib: {
164
- name: string;
165
- signature: string;
166
- description: string;
167
- }[];
168
- notBuiltIn: {
169
- name: string;
170
- wrongUsage: string;
171
- correctPattern: string;
172
- description: string;
173
- }[];
174
- };
175
- typeCompatibility: {
176
- comparisons: ({
177
- types: string;
178
- works: boolean;
179
- note: string;
180
- fix?: undefined;
181
- } | {
182
- types: string;
183
- works: boolean;
184
- fix: string;
185
- note?: undefined;
186
- })[];
187
- arithmetic: ({
188
- types: string;
189
- works: boolean;
190
- note: string;
191
- fix?: undefined;
192
- } | {
193
- types: string;
194
- works: boolean;
195
- fix: string;
196
- note?: undefined;
197
- })[];
198
- typeCasting: ({
199
- from: string;
200
- to: string;
201
- direct: boolean;
202
- fix: string;
203
- note?: undefined;
204
- } | {
205
- from: string;
206
- to: string;
207
- direct: boolean;
208
- note: string;
209
- fix?: undefined;
210
- })[];
211
- assignments: {
212
- types: string;
213
- works: boolean;
214
- fix: string;
215
- }[];
216
- tips: string[];
217
- };
218
- ledgerTypeLimits: {
219
- Counter: {
220
- circuitOperations: {
221
- method: string;
222
- works: boolean;
223
- note: string;
224
- }[];
225
- typescriptAccess: string;
226
- reason: string;
227
- };
228
- Map: {
229
- circuitOperations: {
230
- method: string;
231
- works: boolean;
232
- note: string;
233
- }[];
234
- typescriptAccess: string;
235
- note: string;
236
- };
237
- Set: {
238
- circuitOperations: {
239
- method: string;
240
- works: boolean;
241
- note: string;
242
- }[];
243
- typescriptAccess: string;
244
- note: string;
245
- };
246
- MerkleTree: {
247
- circuitOperations: {
248
- method: string;
249
- works: boolean;
250
- note: string;
251
- }[];
252
- typescriptAccess: string;
253
- pattern: string;
254
- };
255
- };
256
- commonErrors: {
257
- error: string;
258
- cause: string;
259
- fix: string;
260
- }[];
261
- commonMistakes: {
262
- wrong: string;
263
- correct: string;
264
- error: string;
265
- }[];
266
- syntaxReference: string;
267
- sections: string[];
268
- referenceContracts: {
269
- name: string;
270
- repo: string;
271
- description: string;
272
- }[];
273
- note: string;
274
- versionWarning?: string | undefined;
275
- repository: string;
276
- version: string;
277
- versionConfig: {
278
- min: string;
279
- max: string;
280
- lastUpdated: string;
281
- maintenanceGuide: string;
282
- };
283
- warning?: undefined;
284
- syntaxFiles?: undefined;
285
- examplePaths?: undefined;
286
- } | {
287
- repository: string;
288
- version: string;
289
- warning: string;
290
- syntaxFiles: never[];
291
- examplePaths: string[];
292
- note?: undefined;
293
- } | {
294
- repository: string;
295
- version: string;
296
- syntaxFiles: {
297
- path: string;
298
- content: string;
299
- }[];
300
- note: string;
301
- warning?: undefined;
302
- examplePaths?: undefined;
303
- }>;
304
- /**
305
- * Compound tool: Full upgrade check
306
- * Combines: getVersionInfo + checkBreakingChanges + getMigrationGuide
307
- * Reduces 3 tool calls to 1, saving ~60% tokens
308
- */
309
- export declare function upgradeCheck(input: UpgradeCheckInput & {
310
- _meta?: {
311
- progressToken?: string | number;
312
- };
313
- }): Promise<{
314
- repository: string;
315
- currentVersion: string;
316
- version: {
317
- latest: string;
318
- latestStable: string;
319
- publishedAt: string | null;
320
- isOutdated: boolean;
321
- versionsBehind: number;
322
- };
323
- breakingChanges: {
324
- count: number;
325
- hasBreakingChanges: boolean;
326
- items: string[];
327
- };
328
- migration: {
329
- steps: string[];
330
- deprecations: string[];
331
- newFeatures: string[];
332
- } | null;
333
- urgency: "none" | "low" | "medium" | "high" | "critical";
334
- recommendation: string;
335
- }>;
336
- /**
337
- * Compound tool: Full repository context
338
- * Combines: getVersionInfo + getLatestSyntax + listExamples (filtered)
339
- * Provides everything needed to start working with a repo
340
- */
341
- export declare function getFullRepoContext(input: FullRepoContextInput & {
342
- _meta?: {
343
- progressToken?: string | number;
344
- };
345
- }): Promise<{
346
- repository: string;
347
- quickStart: {
348
- version: string;
349
- installCommand: string;
350
- docsUrl: string;
351
- };
352
- version: {
353
- current: string;
354
- stable: string | null;
355
- publishedAt: string | null;
356
- recentReleases: {
357
- tag: string;
358
- date: string;
359
- }[];
360
- };
361
- syntax: {
362
- version: string;
363
- files: string[];
364
- primaryReference: string | null;
365
- } | null;
366
- examples: {
367
- name: string;
368
- description: string;
369
- complexity: string;
370
- }[];
371
- note: string;
372
- }>;
373
- //# sourceMappingURL=handlers.d.ts.map