src-mcp 1.0.1 → 1.0.3
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 +8 -18
- package/dist/bin.d.mts +1 -0
- package/dist/bin.mjs +205 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -0
- package/dist/server-DL8hfycz.mjs +3791 -0
- package/dist/server-DL8hfycz.mjs.map +1 -0
- package/package.json +10 -9
- package/dist/bin.d.ts +0 -3
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js +0 -4
- package/dist/bin.js.map +0 -1
- package/dist/cli/adapter.d.ts +0 -7
- package/dist/cli/adapter.d.ts.map +0 -1
- package/dist/cli/adapter.js +0 -39
- package/dist/cli/adapter.js.map +0 -1
- package/dist/cli/commands/index.d.ts +0 -24
- package/dist/cli/commands/index.d.ts.map +0 -1
- package/dist/cli/commands/index.js +0 -13
- package/dist/cli/commands/index.js.map +0 -1
- package/dist/cli/commands/serve.command.d.ts +0 -21
- package/dist/cli/commands/serve.command.d.ts.map +0 -1
- package/dist/cli/commands/serve.command.js +0 -62
- package/dist/cli/commands/serve.command.js.map +0 -1
- package/dist/cli/commands/version.command.d.ts +0 -2
- package/dist/cli/commands/version.command.d.ts.map +0 -1
- package/dist/cli/commands/version.command.js +0 -12
- package/dist/cli/commands/version.command.js.map +0 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -15
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/parser.d.ts +0 -7
- package/dist/cli/parser.d.ts.map +0 -1
- package/dist/cli/parser.js +0 -99
- package/dist/cli/parser.js.map +0 -1
- package/dist/config/index.d.ts +0 -24
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -38
- package/dist/config/index.js.map +0 -1
- package/dist/core/ast/index.d.ts +0 -82
- package/dist/core/ast/index.d.ts.map +0 -1
- package/dist/core/ast/index.js +0 -204
- package/dist/core/ast/index.js.map +0 -1
- package/dist/core/ast/types.d.ts +0 -152
- package/dist/core/ast/types.d.ts.map +0 -1
- package/dist/core/ast/types.js +0 -5
- package/dist/core/ast/types.js.map +0 -1
- package/dist/core/constants.d.ts +0 -17
- package/dist/core/constants.d.ts.map +0 -1
- package/dist/core/constants.js +0 -49
- package/dist/core/constants.js.map +0 -1
- package/dist/core/embeddings/callgraph.d.ts +0 -98
- package/dist/core/embeddings/callgraph.d.ts.map +0 -1
- package/dist/core/embeddings/callgraph.js +0 -415
- package/dist/core/embeddings/callgraph.js.map +0 -1
- package/dist/core/embeddings/chunker.d.ts +0 -37
- package/dist/core/embeddings/chunker.d.ts.map +0 -1
- package/dist/core/embeddings/chunker.js +0 -298
- package/dist/core/embeddings/chunker.js.map +0 -1
- package/dist/core/embeddings/client.d.ts +0 -30
- package/dist/core/embeddings/client.d.ts.map +0 -1
- package/dist/core/embeddings/client.js +0 -65
- package/dist/core/embeddings/client.js.map +0 -1
- package/dist/core/embeddings/crossfile.d.ts +0 -58
- package/dist/core/embeddings/crossfile.d.ts.map +0 -1
- package/dist/core/embeddings/crossfile.js +0 -202
- package/dist/core/embeddings/crossfile.js.map +0 -1
- package/dist/core/embeddings/enricher.d.ts +0 -53
- package/dist/core/embeddings/enricher.d.ts.map +0 -1
- package/dist/core/embeddings/enricher.js +0 -308
- package/dist/core/embeddings/enricher.js.map +0 -1
- package/dist/core/embeddings/index.d.ts +0 -13
- package/dist/core/embeddings/index.d.ts.map +0 -1
- package/dist/core/embeddings/index.js +0 -20
- package/dist/core/embeddings/index.js.map +0 -1
- package/dist/core/embeddings/reranker.d.ts +0 -41
- package/dist/core/embeddings/reranker.d.ts.map +0 -1
- package/dist/core/embeddings/reranker.js +0 -117
- package/dist/core/embeddings/reranker.js.map +0 -1
- package/dist/core/embeddings/store.d.ts +0 -93
- package/dist/core/embeddings/store.d.ts.map +0 -1
- package/dist/core/embeddings/store.js +0 -304
- package/dist/core/embeddings/store.js.map +0 -1
- package/dist/core/embeddings/types.d.ts +0 -77
- package/dist/core/embeddings/types.d.ts.map +0 -1
- package/dist/core/embeddings/types.js +0 -5
- package/dist/core/embeddings/types.js.map +0 -1
- package/dist/core/embeddings/watcher.d.ts +0 -130
- package/dist/core/embeddings/watcher.d.ts.map +0 -1
- package/dist/core/embeddings/watcher.js +0 -448
- package/dist/core/embeddings/watcher.js.map +0 -1
- package/dist/core/fallback/index.d.ts +0 -26
- package/dist/core/fallback/index.d.ts.map +0 -1
- package/dist/core/fallback/index.js +0 -76
- package/dist/core/fallback/index.js.map +0 -1
- package/dist/core/parser/index.d.ts +0 -64
- package/dist/core/parser/index.d.ts.map +0 -1
- package/dist/core/parser/index.js +0 -205
- package/dist/core/parser/index.js.map +0 -1
- package/dist/core/parser/languages.d.ts +0 -26
- package/dist/core/parser/languages.d.ts.map +0 -1
- package/dist/core/parser/languages.js +0 -101
- package/dist/core/parser/languages.js.map +0 -1
- package/dist/core/queries/helpers.d.ts +0 -72
- package/dist/core/queries/helpers.d.ts.map +0 -1
- package/dist/core/queries/helpers.js +0 -101
- package/dist/core/queries/helpers.js.map +0 -1
- package/dist/core/queries/index.d.ts +0 -144
- package/dist/core/queries/index.d.ts.map +0 -1
- package/dist/core/queries/index.js +0 -396
- package/dist/core/queries/index.js.map +0 -1
- package/dist/core/queries/loader.d.ts +0 -46
- package/dist/core/queries/loader.d.ts.map +0 -1
- package/dist/core/queries/loader.js +0 -216
- package/dist/core/queries/loader.js.map +0 -1
- package/dist/core/queries/patterns.d.ts +0 -10
- package/dist/core/queries/patterns.d.ts.map +0 -1
- package/dist/core/queries/patterns.js +0 -112
- package/dist/core/queries/patterns.js.map +0 -1
- package/dist/core/symbols/index.d.ts +0 -70
- package/dist/core/symbols/index.d.ts.map +0 -1
- package/dist/core/symbols/index.js +0 -359
- package/dist/core/symbols/index.js.map +0 -1
- package/dist/core/unified/index.d.ts +0 -118
- package/dist/core/unified/index.d.ts.map +0 -1
- package/dist/core/unified/index.js +0 -428
- package/dist/core/unified/index.js.map +0 -1
- package/dist/core/utils/assets.d.ts +0 -34
- package/dist/core/utils/assets.d.ts.map +0 -1
- package/dist/core/utils/assets.js +0 -85
- package/dist/core/utils/assets.js.map +0 -1
- package/dist/core/utils/cache.d.ts +0 -43
- package/dist/core/utils/cache.d.ts.map +0 -1
- package/dist/core/utils/cache.js +0 -60
- package/dist/core/utils/cache.js.map +0 -1
- package/dist/core/utils/index.d.ts +0 -7
- package/dist/core/utils/index.d.ts.map +0 -1
- package/dist/core/utils/index.js +0 -10
- package/dist/core/utils/index.js.map +0 -1
- package/dist/core/utils/tsconfig.d.ts +0 -34
- package/dist/core/utils/tsconfig.d.ts.map +0 -1
- package/dist/core/utils/tsconfig.js +0 -173
- package/dist/core/utils/tsconfig.js.map +0 -1
- package/dist/features/analyze-file/index.d.ts +0 -15
- package/dist/features/analyze-file/index.d.ts.map +0 -1
- package/dist/features/analyze-file/index.js +0 -164
- package/dist/features/analyze-file/index.js.map +0 -1
- package/dist/features/get-call-graph/index.d.ts +0 -24
- package/dist/features/get-call-graph/index.d.ts.map +0 -1
- package/dist/features/get-call-graph/index.js +0 -246
- package/dist/features/get-call-graph/index.js.map +0 -1
- package/dist/features/get-index-status/index.d.ts +0 -20
- package/dist/features/get-index-status/index.d.ts.map +0 -1
- package/dist/features/get-index-status/index.js +0 -90
- package/dist/features/get-index-status/index.js.map +0 -1
- package/dist/features/index-codebase/index.d.ts +0 -24
- package/dist/features/index-codebase/index.d.ts.map +0 -1
- package/dist/features/index-codebase/index.js +0 -283
- package/dist/features/index-codebase/index.js.map +0 -1
- package/dist/features/index.d.ts +0 -15
- package/dist/features/index.d.ts.map +0 -1
- package/dist/features/index.js +0 -28
- package/dist/features/index.js.map +0 -1
- package/dist/features/info/index.d.ts +0 -19
- package/dist/features/info/index.d.ts.map +0 -1
- package/dist/features/info/index.js +0 -41
- package/dist/features/info/index.js.map +0 -1
- package/dist/features/list-symbols/index.d.ts +0 -22
- package/dist/features/list-symbols/index.d.ts.map +0 -1
- package/dist/features/list-symbols/index.js +0 -74
- package/dist/features/list-symbols/index.js.map +0 -1
- package/dist/features/parse-ast/index.d.ts +0 -12
- package/dist/features/parse-ast/index.d.ts.map +0 -1
- package/dist/features/parse-ast/index.js +0 -71
- package/dist/features/parse-ast/index.js.map +0 -1
- package/dist/features/query-code/index.d.ts +0 -23
- package/dist/features/query-code/index.d.ts.map +0 -1
- package/dist/features/query-code/index.js +0 -96
- package/dist/features/query-code/index.js.map +0 -1
- package/dist/features/search-code/index.d.ts +0 -39
- package/dist/features/search-code/index.d.ts.map +0 -1
- package/dist/features/search-code/index.js +0 -258
- package/dist/features/search-code/index.js.map +0 -1
- package/dist/features/types.d.ts +0 -14
- package/dist/features/types.d.ts.map +0 -1
- package/dist/features/types.js +0 -2
- package/dist/features/types.js.map +0 -1
- package/dist/features/update-index/index.d.ts +0 -24
- package/dist/features/update-index/index.d.ts.map +0 -1
- package/dist/features/update-index/index.js +0 -358
- package/dist/features/update-index/index.js.map +0 -1
- package/dist/features/utils/content.d.ts +0 -30
- package/dist/features/utils/content.d.ts.map +0 -1
- package/dist/features/utils/content.js +0 -49
- package/dist/features/utils/content.js.map +0 -1
- package/dist/features/utils/index.d.ts +0 -6
- package/dist/features/utils/index.d.ts.map +0 -1
- package/dist/features/utils/index.js +0 -8
- package/dist/features/utils/index.js.map +0 -1
- package/dist/features/utils/result.d.ts +0 -37
- package/dist/features/utils/result.d.ts.map +0 -1
- package/dist/features/utils/result.js +0 -53
- package/dist/features/utils/result.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +0 -1
- package/dist/prompts/index.d.ts +0 -9
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/index.js +0 -188
- package/dist/prompts/index.js.map +0 -1
- package/dist/resources/index.d.ts +0 -3
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/resources/index.js +0 -17
- package/dist/resources/index.js.map +0 -1
- package/dist/server.d.ts +0 -4
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -24
- package/dist/server.js.map +0 -1
- package/dist/tools/adapter.d.ts +0 -4
- package/dist/tools/adapter.d.ts.map +0 -1
- package/dist/tools/adapter.js +0 -28
- package/dist/tools/adapter.js.map +0 -1
- package/dist/tools/index.d.ts +0 -5
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -9
- package/dist/tools/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -20
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/utils/colors.d.ts +0 -24
- package/dist/utils/colors.d.ts.map +0 -1
- package/dist/utils/colors.js +0 -30
- package/dist/utils/colors.js.map +0 -1
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -4
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -8
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -57
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/spinner.d.ts +0 -11
- package/dist/utils/spinner.d.ts.map +0 -1
- package/dist/utils/spinner.js +0 -36
- package/dist/utils/spinner.js.map +0 -1
package/dist/prompts/index.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Register MCP prompts
|
|
3
|
-
*
|
|
4
|
-
* Prompts are reusable templates that help AI assistants understand
|
|
5
|
-
* how to use SRC effectively for code search and analysis.
|
|
6
|
-
*/
|
|
7
|
-
export function registerPrompts(server) {
|
|
8
|
-
// Main overview prompt - helps AI understand when to use SRC
|
|
9
|
-
server.registerPrompt("src-overview", {
|
|
10
|
-
title: "SRC Overview",
|
|
11
|
-
description: "Learn about SRC capabilities and when to use it for code search and analysis",
|
|
12
|
-
}, () => ({
|
|
13
|
-
messages: [
|
|
14
|
-
{
|
|
15
|
-
role: "user",
|
|
16
|
-
content: {
|
|
17
|
-
type: "text",
|
|
18
|
-
text: `# SRC (Structured Repo Context) - Overview
|
|
19
|
-
|
|
20
|
-
## What is SRC?
|
|
21
|
-
SRC is a semantic code search MCP server. It indexes codebases and provides intelligent search using:
|
|
22
|
-
- **Vector embeddings** for semantic similarity (understands meaning, not just keywords)
|
|
23
|
-
- **BM25 keyword search** for exact matches
|
|
24
|
-
- **Hybrid search** combining both with RRF fusion
|
|
25
|
-
- **LLM re-ranking** for optimal relevance
|
|
26
|
-
- **Call graph analysis** showing function relationships
|
|
27
|
-
|
|
28
|
-
## When to use SRC?
|
|
29
|
-
|
|
30
|
-
**USE SRC when the user wants to:**
|
|
31
|
-
- Find code by meaning/concept ("find authentication logic", "where is error handling")
|
|
32
|
-
- Understand code relationships ("what calls this function", "what does this function call")
|
|
33
|
-
- Search across a large codebase
|
|
34
|
-
- Find similar code patterns
|
|
35
|
-
- Explore unfamiliar code
|
|
36
|
-
|
|
37
|
-
**DON'T USE SRC for:**
|
|
38
|
-
- Reading a specific file (use file read tools instead)
|
|
39
|
-
- Simple text search in a single file (use grep/search)
|
|
40
|
-
- Non-code queries
|
|
41
|
-
|
|
42
|
-
## Typical Workflow
|
|
43
|
-
|
|
44
|
-
1. **Check status**: Use \`get_index_status\` to see if index exists
|
|
45
|
-
2. **Index if needed**: Use \`index_codebase\` (only once per project)
|
|
46
|
-
3. **Search**: Use \`search_code\` with natural language queries
|
|
47
|
-
|
|
48
|
-
Note: When using \`serve\` mode, the server auto-indexes on startup and watches for file changes.
|
|
49
|
-
|
|
50
|
-
## Supported Languages
|
|
51
|
-
- **Full AST support (18)**: JavaScript, TypeScript, Python, Rust, Go, Java, C, C++, C#, Ruby, PHP, Kotlin, Scala, Swift, HTML, Svelte, OCaml
|
|
52
|
-
- **Text splitting (16+)**: Markdown, LaTeX, Solidity, Haskell, Elixir, and more
|
|
53
|
-
- **Generic (30+)**: Config files, shell scripts, SQL, and more
|
|
54
|
-
|
|
55
|
-
## Tips
|
|
56
|
-
- Use natural language queries: "authentication middleware" not "auth*"
|
|
57
|
-
- The hybrid search mode (default) works best for most queries
|
|
58
|
-
- Call context is included by default - shows who calls what`,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
}));
|
|
63
|
-
// Workflow prompt - step by step guide
|
|
64
|
-
server.registerPrompt("code-search-workflow", {
|
|
65
|
-
title: "Code Search Workflow",
|
|
66
|
-
description: "Step-by-step guide for searching code with SRC",
|
|
67
|
-
}, () => ({
|
|
68
|
-
messages: [
|
|
69
|
-
{
|
|
70
|
-
role: "user",
|
|
71
|
-
content: {
|
|
72
|
-
type: "text",
|
|
73
|
-
text: `# Code Search Workflow with SRC
|
|
74
|
-
|
|
75
|
-
## Step 1: Check Index
|
|
76
|
-
\`\`\`
|
|
77
|
-
get_index_status()
|
|
78
|
-
\`\`\`
|
|
79
|
-
|
|
80
|
-
## Step 2: Index if Needed
|
|
81
|
-
If no index exists:
|
|
82
|
-
\`\`\`
|
|
83
|
-
index_codebase()
|
|
84
|
-
\`\`\`
|
|
85
|
-
|
|
86
|
-
## Step 3: Search
|
|
87
|
-
\`\`\`
|
|
88
|
-
search_code(query: "your search query here")
|
|
89
|
-
\`\`\`
|
|
90
|
-
|
|
91
|
-
## search_code Arguments
|
|
92
|
-
|
|
93
|
-
| Argument | Type | Default | Description |
|
|
94
|
-
|----------|------|---------|-------------|
|
|
95
|
-
| query | string | required | Natural language search query |
|
|
96
|
-
| limit | number | 10 | Max results to return |
|
|
97
|
-
| mode | "hybrid" / "vector" / "fts" | "hybrid" | Search mode |
|
|
98
|
-
| rerank | boolean | true | LLM re-ranking for better relevance |
|
|
99
|
-
| includeCallContext | boolean | true | Include caller/callee info |
|
|
100
|
-
| threshold | number | - | Distance threshold (vector mode only) |
|
|
101
|
-
|
|
102
|
-
## Search Modes
|
|
103
|
-
- **hybrid** (default): Vector + BM25 + RRF fusion - best overall
|
|
104
|
-
- **vector**: Semantic similarity only - good for conceptual queries
|
|
105
|
-
- **fts**: Keyword search only - good for exact identifiers
|
|
106
|
-
|
|
107
|
-
## Examples
|
|
108
|
-
\`\`\`
|
|
109
|
-
// Find authentication code
|
|
110
|
-
search_code(query: "user authentication and login")
|
|
111
|
-
|
|
112
|
-
// More results
|
|
113
|
-
search_code(query: "error handling", limit: 20)
|
|
114
|
-
|
|
115
|
-
// Exact identifier search
|
|
116
|
-
search_code(query: "UserAuthService", mode: "fts")
|
|
117
|
-
|
|
118
|
-
// Without call context (faster)
|
|
119
|
-
search_code(query: "database queries", includeCallContext: false)
|
|
120
|
-
\`\`\``,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
}));
|
|
125
|
-
// Search tips prompt
|
|
126
|
-
server.registerPrompt("search-tips", {
|
|
127
|
-
title: "Search Tips",
|
|
128
|
-
description: "Tips for writing effective code search queries",
|
|
129
|
-
}, () => ({
|
|
130
|
-
messages: [
|
|
131
|
-
{
|
|
132
|
-
role: "user",
|
|
133
|
-
content: {
|
|
134
|
-
type: "text",
|
|
135
|
-
text: `# Effective Code Search Tips
|
|
136
|
-
|
|
137
|
-
## Good Query Examples
|
|
138
|
-
|
|
139
|
-
| Goal | Good Query | Why |
|
|
140
|
-
|------|------------|-----|
|
|
141
|
-
| Find auth code | "user authentication and login validation" | Describes the concept |
|
|
142
|
-
| Find error handling | "error handling and exception catching" | Uses related terms |
|
|
143
|
-
| Find API endpoints | "REST API route handlers" | Specifies the pattern |
|
|
144
|
-
| Find database code | "database query and data persistence" | Covers the domain |
|
|
145
|
-
| Find a function | "calculateTotalPrice function" | Includes the name |
|
|
146
|
-
|
|
147
|
-
## Query Writing Tips
|
|
148
|
-
|
|
149
|
-
1. **Be descriptive, not literal**
|
|
150
|
-
- Good: "user password validation and hashing"
|
|
151
|
-
- Bad: "validatePassword"
|
|
152
|
-
|
|
153
|
-
2. **Include context**
|
|
154
|
-
- Good: "authentication middleware for Express routes"
|
|
155
|
-
- Bad: "auth middleware"
|
|
156
|
-
|
|
157
|
-
3. **Use domain language**
|
|
158
|
-
- Good: "shopping cart checkout process"
|
|
159
|
-
- Bad: "cart function"
|
|
160
|
-
|
|
161
|
-
4. **Combine concepts**
|
|
162
|
-
- Good: "file upload with size validation and error handling"
|
|
163
|
-
- Bad: "upload"
|
|
164
|
-
|
|
165
|
-
## Search Mode Selection
|
|
166
|
-
|
|
167
|
-
| Mode | Use When |
|
|
168
|
-
|------|----------|
|
|
169
|
-
| **hybrid** | Default choice, works for most queries |
|
|
170
|
-
| **vector** | Conceptual searches like "code that handles retries" |
|
|
171
|
-
| **fts** | Exact identifiers like "UserAuthService" |
|
|
172
|
-
|
|
173
|
-
## Understanding Results
|
|
174
|
-
|
|
175
|
-
Each result includes:
|
|
176
|
-
- **content**: The matching code chunk
|
|
177
|
-
- **filePath**: Source file location
|
|
178
|
-
- **startLine/endLine**: Line numbers
|
|
179
|
-
- **symbolName/Type**: Function or class name if detected
|
|
180
|
-
- **score**: Relevance score (higher = better match)
|
|
181
|
-
- **callers**: Functions that call this code
|
|
182
|
-
- **callees**: Functions this code calls`,
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
],
|
|
186
|
-
}));
|
|
187
|
-
}
|
|
188
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,6DAA6D;IAC7D,MAAM,CAAC,cAAc,CACnB,cAAc,EACd;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,8EAA8E;KACjF,EACD,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6DAwC2C;iBAClD;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,uCAAuC;IACvC,MAAM,CAAC,cAAc,CACnB,sBAAsB,EACtB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,gDAAgD;KAC9D,EACD,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CX;iBACI;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,qBAAqB;IACrB,MAAM,CAAC,cAAc,CACnB,aAAa,EACb;QACE,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,gDAAgD;KAC9D,EACD,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCA+CuB;iBAC9B;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAczD"}
|
package/dist/resources/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getServerInfo } from "@features";
|
|
2
|
-
export function registerResources(server) {
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
4
|
-
server.resource("server_info", "src://server/info", (uri) => {
|
|
5
|
-
const info = getServerInfo();
|
|
6
|
-
return {
|
|
7
|
-
contents: [
|
|
8
|
-
{
|
|
9
|
-
uri: uri.href,
|
|
10
|
-
mimeType: "application/json",
|
|
11
|
-
text: JSON.stringify(info, null, 2),
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,4DAA4D;IAC5D,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;QAC1D,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;QAC7B,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,GAAG,CAAC,IAAI;oBACb,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBACpC;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/server.d.ts
DELETED
package/dist/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE,wBAAgB,YAAY,IAAI,SAAS,CAWxC;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAMjD"}
|
package/dist/server.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
-
import { config } from "@config";
|
|
4
|
-
import { registerTools } from "@tools";
|
|
5
|
-
import { registerResources } from "@resources";
|
|
6
|
-
import { registerPrompts } from "@prompts";
|
|
7
|
-
import { logger } from "@utils";
|
|
8
|
-
export function createServer() {
|
|
9
|
-
const server = new McpServer({
|
|
10
|
-
name: config.name,
|
|
11
|
-
version: config.version,
|
|
12
|
-
});
|
|
13
|
-
registerTools(server);
|
|
14
|
-
registerResources(server);
|
|
15
|
-
registerPrompts(server);
|
|
16
|
-
return server;
|
|
17
|
-
}
|
|
18
|
-
export async function startServer() {
|
|
19
|
-
const server = createServer();
|
|
20
|
-
const transport = new StdioServerTransport();
|
|
21
|
-
await server.connect(transport);
|
|
22
|
-
logger.info(`${config.name} v${config.version} started`);
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;IAEH,aAAa,CAAC,MAAM,CAAC,CAAC;IACtB,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAC3D,CAAC"}
|
package/dist/tools/adapter.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/tools/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAU/C,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,OAAO,GACf,IAAI,CA2BN"}
|
package/dist/tools/adapter.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
function zodToMcpSchema(schema) {
|
|
3
|
-
if (schema instanceof z.ZodObject) {
|
|
4
|
-
return schema.shape;
|
|
5
|
-
}
|
|
6
|
-
return { input: schema };
|
|
7
|
-
}
|
|
8
|
-
export function registerFeatureAsTool(server, feature) {
|
|
9
|
-
const mcpSchema = zodToMcpSchema(feature.schema);
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
11
|
-
server.tool(feature.name, feature.description, mcpSchema, async (params) => {
|
|
12
|
-
const result = feature.execute(params);
|
|
13
|
-
const formatResult = (res) => ({
|
|
14
|
-
content: [
|
|
15
|
-
{
|
|
16
|
-
type: "text",
|
|
17
|
-
text: res.message ?? JSON.stringify(res.data, null, 2),
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
isError: !res.success,
|
|
21
|
-
});
|
|
22
|
-
if (result instanceof Promise) {
|
|
23
|
-
return await result.then(formatResult);
|
|
24
|
-
}
|
|
25
|
-
return formatResult(result);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/tools/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,SAAS,cAAc,CAAC,MAAiB;IACvC,IAAI,MAAM,YAAY,CAAC,CAAC,SAAS,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,KAAkC,CAAC;IACnD,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,MAAiB,EACjB,OAAgB;IAEhB,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD,4DAA4D;IAC5D,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACzE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEvC,MAAM,YAAY,GAAG,CACnB,GAAgD,EAIhD,EAAE,CAAC,CAAC;YACJ,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBACvD;aACF;YACD,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO;SACtB,CAAC,CAAC;QAEH,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;YAC9B,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/tools/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAIrD;AAED,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,CAAC"}
|
package/dist/tools/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { features } from "@features";
|
|
2
|
-
import { registerFeatureAsTool } from "@tools/adapter";
|
|
3
|
-
export function registerTools(server) {
|
|
4
|
-
for (const feature of features) {
|
|
5
|
-
registerFeatureAsTool(server, feature);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export { features as tools };
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,CAAC"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type { Feature, FeatureResult } from "@features/types";
|
|
2
|
-
export interface ServerConfig {
|
|
3
|
-
name: string;
|
|
4
|
-
fullName: string;
|
|
5
|
-
version: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface CLICommand {
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
options?: CLIOption[];
|
|
12
|
-
action: (args: string[], options: Record<string, string | boolean>) => void;
|
|
13
|
-
}
|
|
14
|
-
export interface CLIOption {
|
|
15
|
-
flag: string;
|
|
16
|
-
description: string;
|
|
17
|
-
required?: boolean;
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC;CAC7E;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
package/dist/types/index.js
DELETED
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
package/dist/utils/colors.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color utilities for CLI output
|
|
3
|
-
*/
|
|
4
|
-
export declare const colors: {
|
|
5
|
-
success: import("picocolors/types").Formatter;
|
|
6
|
-
error: import("picocolors/types").Formatter;
|
|
7
|
-
warn: import("picocolors/types").Formatter;
|
|
8
|
-
info: import("picocolors/types").Formatter;
|
|
9
|
-
dim: import("picocolors/types").Formatter;
|
|
10
|
-
bold: import("picocolors/types").Formatter;
|
|
11
|
-
cyan: import("picocolors/types").Formatter;
|
|
12
|
-
magenta: import("picocolors/types").Formatter;
|
|
13
|
-
successBold: (text: string) => string;
|
|
14
|
-
errorBold: (text: string) => string;
|
|
15
|
-
infoBold: (text: string) => string;
|
|
16
|
-
formatSuccess: (msg: string) => string;
|
|
17
|
-
formatError: (msg: string) => string;
|
|
18
|
-
formatInfo: (msg: string) => string;
|
|
19
|
-
formatWarn: (msg: string) => string;
|
|
20
|
-
formatCommand: (cmd: string) => string;
|
|
21
|
-
formatValue: (val: string) => string;
|
|
22
|
-
formatPath: (path: string) => string;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;wBAcG,MAAM,KAAG,MAAM;sBACjB,MAAM,KAAG,MAAM;qBAChB,MAAM,KAAG,MAAM;yBAGX,MAAM,KAAG,MAAM;uBACjB,MAAM,KAAG,MAAM;sBAChB,MAAM,KAAG,MAAM;sBACf,MAAM,KAAG,MAAM;yBAGZ,MAAM,KAAG,MAAM;uBACjB,MAAM,KAAG,MAAM;uBACf,MAAM,KAAG,MAAM;CACnC,CAAC"}
|
package/dist/utils/colors.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import pc from "picocolors";
|
|
2
|
-
/**
|
|
3
|
-
* Color utilities for CLI output
|
|
4
|
-
*/
|
|
5
|
-
export const colors = {
|
|
6
|
-
// Status colors
|
|
7
|
-
success: pc.green,
|
|
8
|
-
error: pc.red,
|
|
9
|
-
warn: pc.yellow,
|
|
10
|
-
info: pc.blue,
|
|
11
|
-
// UI elements
|
|
12
|
-
dim: pc.dim,
|
|
13
|
-
bold: pc.bold,
|
|
14
|
-
cyan: pc.cyan,
|
|
15
|
-
magenta: pc.magenta,
|
|
16
|
-
// Composite helpers
|
|
17
|
-
successBold: (text) => pc.bold(pc.green(text)),
|
|
18
|
-
errorBold: (text) => pc.bold(pc.red(text)),
|
|
19
|
-
infoBold: (text) => pc.bold(pc.blue(text)),
|
|
20
|
-
// Format messages with icons
|
|
21
|
-
formatSuccess: (msg) => `${pc.green("✓")} ${msg}`,
|
|
22
|
-
formatError: (msg) => `${pc.red("✗")} ${msg}`,
|
|
23
|
-
formatInfo: (msg) => `${pc.blue("ℹ")} ${msg}`,
|
|
24
|
-
formatWarn: (msg) => `${pc.yellow("⚠")} ${msg}`,
|
|
25
|
-
// Format for CLI output
|
|
26
|
-
formatCommand: (cmd) => pc.cyan(cmd),
|
|
27
|
-
formatValue: (val) => pc.magenta(val),
|
|
28
|
-
formatPath: (path) => pc.dim(path),
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=colors.js.map
|
package/dist/utils/colors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,gBAAgB;IAChB,OAAO,EAAE,EAAE,CAAC,KAAK;IACjB,KAAK,EAAE,EAAE,CAAC,GAAG;IACb,IAAI,EAAE,EAAE,CAAC,MAAM;IACf,IAAI,EAAE,EAAE,CAAC,IAAI;IAEb,cAAc;IACd,GAAG,EAAE,EAAE,CAAC,GAAG;IACX,IAAI,EAAE,EAAE,CAAC,IAAI;IACb,IAAI,EAAE,EAAE,CAAC,IAAI;IACb,OAAO,EAAE,EAAE,CAAC,OAAO;IAEnB,oBAAoB;IACpB,WAAW,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9D,SAAS,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1D,QAAQ,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1D,6BAA6B;IAC7B,aAAa,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE;IACjE,WAAW,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE;IAC7D,UAAU,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE;IAC7D,UAAU,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE;IAE/D,wBAAwB;IACxB,aAAa,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;IACpD,WAAW,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;IACrD,UAAU,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;CACnD,CAAC"}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/utils/index.js
DELETED
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const logger: {
|
|
2
|
-
debug(message: string, ...args: unknown[]): void;
|
|
3
|
-
info(message: string, ...args: unknown[]): void;
|
|
4
|
-
warn(message: string, ...args: unknown[]): void;
|
|
5
|
-
error(message: string, ...args: unknown[]): void;
|
|
6
|
-
success(message: string, ...args: unknown[]): void;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAqCA,eAAO,MAAM,MAAM;mBACF,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;kBAMlC,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;kBAOjC,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;mBAMhC,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;qBAM/B,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;CAInD,CAAC"}
|
package/dist/utils/logger.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ENV } from "@config";
|
|
2
|
-
import pc from "picocolors";
|
|
3
|
-
const LOG_LEVELS = {
|
|
4
|
-
debug: 0,
|
|
5
|
-
info: 1,
|
|
6
|
-
warn: 2,
|
|
7
|
-
error: 3,
|
|
8
|
-
};
|
|
9
|
-
const LEVEL_COLORS = {
|
|
10
|
-
debug: pc.dim,
|
|
11
|
-
info: pc.blue,
|
|
12
|
-
warn: pc.yellow,
|
|
13
|
-
error: pc.red,
|
|
14
|
-
};
|
|
15
|
-
function isValidLogLevel(level) {
|
|
16
|
-
return level in LOG_LEVELS;
|
|
17
|
-
}
|
|
18
|
-
function shouldLog(level) {
|
|
19
|
-
const configLevel = ENV.logLevel;
|
|
20
|
-
const currentLevel = isValidLogLevel(configLevel)
|
|
21
|
-
? LOG_LEVELS[configLevel]
|
|
22
|
-
: LOG_LEVELS.info;
|
|
23
|
-
return LOG_LEVELS[level] >= currentLevel;
|
|
24
|
-
}
|
|
25
|
-
function formatMessage(level, message) {
|
|
26
|
-
const timestamp = pc.dim(new Date().toISOString());
|
|
27
|
-
const levelTag = LEVEL_COLORS[level](level.toUpperCase().padEnd(5));
|
|
28
|
-
return `${timestamp} ${levelTag} ${message}`;
|
|
29
|
-
}
|
|
30
|
-
export const logger = {
|
|
31
|
-
debug(message, ...args) {
|
|
32
|
-
if (shouldLog("debug")) {
|
|
33
|
-
console.error(formatMessage("debug", message), ...args);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
info(message, ...args) {
|
|
37
|
-
if (shouldLog("info")) {
|
|
38
|
-
// eslint-disable-next-line no-console
|
|
39
|
-
console.log(formatMessage("info", message), ...args);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
warn(message, ...args) {
|
|
43
|
-
if (shouldLog("warn")) {
|
|
44
|
-
console.warn(formatMessage("warn", message), ...args);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
error(message, ...args) {
|
|
48
|
-
if (shouldLog("error")) {
|
|
49
|
-
console.error(formatMessage("error", message), ...args);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
success(message, ...args) {
|
|
53
|
-
// eslint-disable-next-line no-console
|
|
54
|
-
console.log(pc.green("✓ ") + message, ...args);
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=logger.js.map
|
package/dist/utils/logger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,MAAM,UAAU,GAA6B;IAC3C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,YAAY,GAA4C;IAC5D,KAAK,EAAE,EAAE,CAAC,GAAG;IACb,IAAI,EAAE,EAAE,CAAC,IAAI;IACb,IAAI,EAAE,EAAE,CAAC,MAAM;IACf,KAAK,EAAE,EAAE,CAAC,GAAG;CACd,CAAC;AAEF,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,KAAK,IAAI,UAAU,CAAC;AAC7B,CAAC;AAED,SAAS,SAAS,CAAC,KAAe;IAChC,MAAM,WAAW,GAAG,GAAG,CAAC,QAAQ,CAAC;IACjC,MAAM,YAAY,GAAG,eAAe,CAAC,WAAW,CAAC;QAC/C,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC;QACzB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;IACpB,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC;AAC3C,CAAC;AAED,SAAS,aAAa,CAAC,KAAe,EAAE,OAAe;IACrD,MAAM,SAAS,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,GAAG,SAAS,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAAe,EAAE,GAAG,IAAe;QACzC,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACjD,CAAC;CACF,CAAC"}
|
package/dist/utils/spinner.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type Ora } from "ora";
|
|
2
|
-
/**
|
|
3
|
-
* Create a spinner with consistent styling
|
|
4
|
-
*/
|
|
5
|
-
export declare function createSpinner(text: string): Ora;
|
|
6
|
-
/**
|
|
7
|
-
* Run an async function with a spinner
|
|
8
|
-
* Shows the spinner while the function is running, then shows success/failure
|
|
9
|
-
*/
|
|
10
|
-
export declare function withSpinner<T>(text: string, fn: () => Promise<T>, successText?: string): Promise<T>;
|
|
11
|
-
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/utils/spinner.ts"],"names":[],"mappings":"AAAA,OAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEpC;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAK/C;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,CAAC,CAAC,CAoBZ"}
|
package/dist/utils/spinner.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import ora from "ora";
|
|
2
|
-
/**
|
|
3
|
-
* Create a spinner with consistent styling
|
|
4
|
-
*/
|
|
5
|
-
export function createSpinner(text) {
|
|
6
|
-
return ora({
|
|
7
|
-
text,
|
|
8
|
-
spinner: "dots",
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Run an async function with a spinner
|
|
13
|
-
* Shows the spinner while the function is running, then shows success/failure
|
|
14
|
-
*/
|
|
15
|
-
export async function withSpinner(text, fn, successText) {
|
|
16
|
-
// Skip spinner in non-TTY environments (CI, pipes, etc.)
|
|
17
|
-
if (!process.stdout.isTTY) {
|
|
18
|
-
// eslint-disable-next-line no-console
|
|
19
|
-
console.log(text);
|
|
20
|
-
const result = await fn();
|
|
21
|
-
// eslint-disable-next-line no-console
|
|
22
|
-
console.log(successText ?? "Done");
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
const spinner = createSpinner(text).start();
|
|
26
|
-
try {
|
|
27
|
-
const result = await fn();
|
|
28
|
-
spinner.succeed(successText ?? text);
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
spinner.fail();
|
|
33
|
-
throw error;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/utils/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,GAAiB,MAAM,KAAK,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,GAAG,CAAC;QACT,IAAI;QACJ,OAAO,EAAE,MAAM;KAChB,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAY,EACZ,EAAoB,EACpB,WAAoB;IAEpB,yDAAyD;IACzD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1B,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;IAC5C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,OAAO,CAAC,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;QACrC,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|