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
package/dist/index.d.ts CHANGED
@@ -1,3 +1,205 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
1
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
+
3
+ /**
4
+ * Initialize the server and vector store
5
+ */
6
+ declare function initializeServer(): Promise<Server>;
7
+ /**
8
+ * Start the server with stdio transport
9
+ */
10
+ declare function startServer(): Promise<void>;
11
+ /**
12
+ * Start the server with HTTP transport (SSE + Streamable HTTP)
13
+ */
14
+ declare function startHttpServer(port?: number): Promise<void>;
15
+
16
+ /**
17
+ * Extended MCP types for advanced features
18
+ * Includes tool annotations, output schemas, and resource templates
19
+ */
20
+ /**
21
+ * Tool annotations provide hints about tool behavior
22
+ * These help clients make better decisions about tool usage
23
+ */
24
+ interface ToolAnnotations {
25
+ /**
26
+ * If true, the tool does not modify any state
27
+ * Clients can safely retry or parallelize read-only tools
28
+ */
29
+ readOnlyHint?: boolean;
30
+ /**
31
+ * If true, calling the tool multiple times with the same input
32
+ * produces the same result (safe to retry)
33
+ */
34
+ idempotentHint?: boolean;
35
+ /**
36
+ * If true, the tool may return results from external sources
37
+ * that could change over time
38
+ */
39
+ openWorldHint?: boolean;
40
+ /**
41
+ * If true, the tool may take a long time to complete
42
+ * Clients should show progress indicators
43
+ */
44
+ longRunningHint?: boolean;
45
+ /**
46
+ * Human-readable title for display in UIs
47
+ */
48
+ title?: string;
49
+ /**
50
+ * If true, this tool performs destructive or irreversible actions
51
+ * Clients should require human confirmation before execution
52
+ */
53
+ destructiveHint?: boolean;
54
+ /**
55
+ * If true, this tool requires explicit human confirmation
56
+ * before execution (e.g., financial transactions, deletions)
57
+ */
58
+ requiresConfirmation?: boolean;
59
+ /**
60
+ * Tool category for progressive disclosure
61
+ * Allows clients to group/filter tools by domain
62
+ */
63
+ category?: ToolCategory;
64
+ }
65
+ /**
66
+ * Tool categories for progressive disclosure
67
+ * Clients can initially show categories, then expand to individual tools
68
+ */
69
+ type ToolCategory = "search" | "analyze" | "repository" | "versioning" | "generation" | "health" | "compound";
70
+ /**
71
+ * JSON Schema for structured tool outputs
72
+ * Enables better LLM parsing and IDE integration
73
+ */
74
+ interface OutputSchema {
75
+ type: "object" | "array" | "string" | "number" | "boolean";
76
+ properties?: Record<string, PropertySchema>;
77
+ items?: PropertySchema;
78
+ required?: string[];
79
+ description?: string;
80
+ }
81
+ interface PropertySchema {
82
+ type: "string" | "number" | "boolean" | "array" | "object";
83
+ description?: string;
84
+ items?: PropertySchema;
85
+ properties?: Record<string, PropertySchema>;
86
+ enum?: string[];
87
+ }
88
+ interface ExtendedToolDefinition {
89
+ name: string;
90
+ description: string;
91
+ inputSchema: {
92
+ type: "object";
93
+ properties: Record<string, unknown>;
94
+ required?: string[];
95
+ };
96
+ outputSchema?: OutputSchema;
97
+ annotations?: ToolAnnotations;
98
+ handler: (input: any) => Promise<any>;
99
+ }
100
+
101
+ /**
102
+ * Tools module exports
103
+ * Barrel file for all MCP tools
104
+ */
105
+
106
+ declare const allTools: ExtendedToolDefinition[];
107
+
108
+ interface ResourceDefinition {
109
+ uri: string;
110
+ name: string;
111
+ description: string;
112
+ mimeType: string;
113
+ }
114
+ /**
115
+ * Get schema content by URI
116
+ */
117
+ declare function getSchema(uri: string): object | null;
118
+
119
+ /**
120
+ * Documentation resources
121
+ * Provides access to Midnight documentation via MCP resources
122
+ */
123
+
124
+ /**
125
+ * Get documentation content by URI
126
+ */
127
+ declare function getDocumentation(uri: string): Promise<string | null>;
128
+
129
+ /**
130
+ * Code resources
131
+ * Provides access to Midnight code examples via MCP resources
132
+ */
133
+
134
+ /**
135
+ * Get code content by URI
136
+ */
137
+ declare function getCode(uri: string): Promise<string | null>;
138
+
139
+ declare const allResources: ResourceDefinition[];
140
+
141
+ interface PromptDefinition {
142
+ name: string;
143
+ description: string;
144
+ arguments: Array<{
145
+ name: string;
146
+ description: string;
147
+ required: boolean;
148
+ }>;
149
+ }
150
+ interface PromptMessage {
151
+ role: "user" | "assistant";
152
+ content: {
153
+ type: "text";
154
+ text: string;
155
+ };
156
+ }
157
+ declare const promptDefinitions: PromptDefinition[];
158
+ /**
159
+ * Generate prompt messages based on template and arguments
160
+ */
161
+ declare function generatePrompt(name: string, args: Record<string, string>): PromptMessage[];
162
+
163
+ type LogLevel = "debug" | "info" | "warn" | "error";
164
+ type LogFormat = "text" | "json";
165
+ declare class Logger {
166
+ private level;
167
+ private format;
168
+ private service;
169
+ constructor(level?: LogLevel, format?: LogFormat, service?: string);
170
+ /**
171
+ * Set log format at runtime
172
+ */
173
+ setFormat(format: LogFormat): void;
174
+ /**
175
+ * Set log level at runtime
176
+ */
177
+ setLevel(level: LogLevel): void;
178
+ private shouldLog;
179
+ private formatTextMessage;
180
+ private formatJsonMessage;
181
+ private formatMessage;
182
+ debug(message: string, meta?: object): void;
183
+ info(message: string, meta?: object): void;
184
+ warn(message: string, meta?: object): void;
185
+ error(message: string, meta?: object): void;
186
+ /**
187
+ * Create a child logger with additional context
188
+ */
189
+ child(context: object): ChildLogger;
190
+ }
191
+ /**
192
+ * Child logger that includes additional context in all log messages
193
+ */
194
+ declare class ChildLogger {
195
+ private parent;
196
+ private context;
197
+ constructor(parent: Logger, context: object);
198
+ debug(message: string, meta?: object): void;
199
+ info(message: string, meta?: object): void;
200
+ warn(message: string, meta?: object): void;
201
+ error(message: string, meta?: object): void;
202
+ }
203
+ declare const logger: Logger;
204
+
205
+ export { type ExtendedToolDefinition, type OutputSchema, allResources, allTools, generatePrompt, getCode, getDocumentation, getSchema, initializeServer, logger, promptDefinitions, startHttpServer, startServer };