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.
- package/README.md +34 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +10764 -0
- package/dist/index.d.ts +205 -3
- package/dist/index.js +10722 -15
- package/package.json +16 -6
- package/dist/config/compact-version.d.ts +0 -183
- package/dist/config/compact-version.js +0 -423
- package/dist/db/index.d.ts +0 -3
- package/dist/db/index.js +0 -2
- package/dist/db/vectorStore.d.ts +0 -69
- package/dist/db/vectorStore.js +0 -196
- package/dist/pipeline/embeddings.d.ts +0 -25
- package/dist/pipeline/embeddings.js +0 -103
- package/dist/pipeline/github.d.ts +0 -84
- package/dist/pipeline/github.js +0 -399
- package/dist/pipeline/index.d.ts +0 -11
- package/dist/pipeline/index.js +0 -6
- package/dist/pipeline/indexer.d.ts +0 -41
- package/dist/pipeline/indexer.js +0 -254
- package/dist/pipeline/parser.d.ts +0 -46
- package/dist/pipeline/parser.js +0 -436
- package/dist/pipeline/releases.d.ts +0 -112
- package/dist/pipeline/releases.js +0 -298
- package/dist/pipeline/repository.d.ts +0 -372
- package/dist/pipeline/repository.js +0 -520
- package/dist/prompts/index.d.ts +0 -3
- package/dist/prompts/index.js +0 -2
- package/dist/prompts/templates.d.ts +0 -26
- package/dist/prompts/templates.js +0 -443
- package/dist/resources/code.d.ts +0 -15
- package/dist/resources/code.js +0 -122
- package/dist/resources/content/code-content.d.ts +0 -6
- package/dist/resources/content/code-content.js +0 -802
- package/dist/resources/content/docs-content.d.ts +0 -14
- package/dist/resources/content/docs-content.js +0 -1202
- package/dist/resources/content/index.d.ts +0 -6
- package/dist/resources/content/index.js +0 -6
- package/dist/resources/docs.d.ts +0 -15
- package/dist/resources/docs.js +0 -98
- package/dist/resources/index.d.ts +0 -6
- package/dist/resources/index.js +0 -13
- package/dist/resources/schemas.d.ts +0 -16
- package/dist/resources/schemas.js +0 -407
- package/dist/scripts/index-repos.d.ts +0 -12
- package/dist/scripts/index-repos.js +0 -53
- package/dist/server.d.ts +0 -43
- package/dist/server.js +0 -693
- package/dist/services/index.d.ts +0 -6
- package/dist/services/index.js +0 -6
- package/dist/services/sampling.d.ts +0 -62
- package/dist/services/sampling.js +0 -277
- package/dist/tools/analyze.d.ts +0 -106
- package/dist/tools/analyze.js +0 -431
- package/dist/tools/generation.d.ts +0 -9
- package/dist/tools/generation.js +0 -285
- package/dist/tools/health.d.ts +0 -120
- package/dist/tools/health.js +0 -362
- package/dist/tools/index.d.ts +0 -14
- package/dist/tools/index.js +0 -22
- package/dist/tools/meta.d.ts +0 -61
- package/dist/tools/meta.js +0 -282
- package/dist/tools/repository/constants.d.ts +0 -19
- package/dist/tools/repository/constants.js +0 -324
- package/dist/tools/repository/handlers.d.ts +0 -373
- package/dist/tools/repository/handlers.js +0 -724
- package/dist/tools/repository/index.d.ts +0 -9
- package/dist/tools/repository/index.js +0 -13
- package/dist/tools/repository/schemas.d.ts +0 -153
- package/dist/tools/repository/schemas.js +0 -106
- package/dist/tools/repository/tools.d.ts +0 -7
- package/dist/tools/repository/tools.js +0 -484
- package/dist/tools/repository/validation.d.ts +0 -106
- package/dist/tools/repository/validation.js +0 -820
- package/dist/tools/repository.d.ts +0 -6
- package/dist/tools/repository.js +0 -7
- package/dist/tools/search.d.ts +0 -76
- package/dist/tools/search.js +0 -423
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.js +0 -2
- package/dist/types/mcp.d.ts +0 -187
- package/dist/types/mcp.js +0 -6
- package/dist/utils/cache.d.ts +0 -77
- package/dist/utils/cache.js +0 -172
- package/dist/utils/config.d.ts +0 -70
- package/dist/utils/config.js +0 -294
- package/dist/utils/errors.d.ts +0 -111
- package/dist/utils/errors.js +0 -165
- package/dist/utils/health.d.ts +0 -29
- package/dist/utils/health.js +0 -132
- package/dist/utils/hosted-api.d.ts +0 -67
- package/dist/utils/hosted-api.js +0 -119
- package/dist/utils/index.d.ts +0 -16
- package/dist/utils/index.js +0 -15
- package/dist/utils/logger.d.ts +0 -48
- package/dist/utils/logger.js +0 -124
- package/dist/utils/rate-limit.d.ts +0 -61
- package/dist/utils/rate-limit.js +0 -148
- package/dist/utils/validation.d.ts +0 -52
- package/dist/utils/validation.js +0 -255
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,205 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 };
|