@milo4jo/contextkit 0.5.1 ā 0.5.7
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 +143 -3
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +254 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/graph.d.ts +10 -0
- package/dist/commands/graph.d.ts.map +1 -0
- package/dist/commands/graph.js +289 -0
- package/dist/commands/graph.js.map +1 -0
- package/dist/commands/select.d.ts.map +1 -1
- package/dist/commands/select.js +9 -0
- package/dist/commands/select.js.map +1 -1
- package/dist/commands/symbol.d.ts +9 -0
- package/dist/commands/symbol.d.ts.map +1 -0
- package/dist/commands/symbol.js +420 -0
- package/dist/commands/symbol.js.map +1 -0
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +1 -0
- package/dist/db/index.js.map +1 -1
- package/dist/errors/index.d.ts +15 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +32 -0
- package/dist/errors/index.js.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/indexer/chunker.d.ts +10 -1
- package/dist/indexer/chunker.d.ts.map +1 -1
- package/dist/indexer/chunker.js +123 -2
- package/dist/indexer/chunker.js.map +1 -1
- package/dist/indexer/index.d.ts.map +1 -1
- package/dist/indexer/index.js +3 -2
- package/dist/indexer/index.js.map +1 -1
- package/dist/mcp-server.js +0 -0
- package/dist/parsers/index.d.ts +26 -6
- package/dist/parsers/index.d.ts.map +1 -1
- package/dist/parsers/index.js +71 -12
- package/dist/parsers/index.js.map +1 -1
- package/dist/parsers/markdown.d.ts +29 -0
- package/dist/parsers/markdown.d.ts.map +1 -0
- package/dist/parsers/markdown.js +142 -0
- package/dist/parsers/markdown.js.map +1 -0
- package/dist/parsers/tree-sitter.d.ts +32 -0
- package/dist/parsers/tree-sitter.d.ts.map +1 -0
- package/dist/parsers/tree-sitter.js +356 -0
- package/dist/parsers/tree-sitter.js.map +1 -0
- package/dist/selector/formatter.d.ts +4 -1
- package/dist/selector/formatter.d.ts.map +1 -1
- package/dist/selector/formatter.js +214 -6
- package/dist/selector/formatter.js.map +1 -1
- package/dist/selector/index.d.ts +4 -0
- package/dist/selector/index.d.ts.map +1 -1
- package/dist/selector/index.js +3 -1
- package/dist/selector/index.js.map +1 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/@milo4jo/contextkit)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
|
|
10
|
-
**š v0.5:**
|
|
10
|
+
**š v0.5.5:** Symbol search & call graph! Find code by name, trace dependencies across your codebase.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -118,6 +118,34 @@ They're storage. ContextKit adds the **intelligence layer** ā scoring, budgeti
|
|
|
118
118
|
|
|
119
119
|
---
|
|
120
120
|
|
|
121
|
+
## Performance
|
|
122
|
+
|
|
123
|
+
Benchmarks on a MacBook Pro M4 (ContextKit's own codebase: 40 files, 166 chunks):
|
|
124
|
+
|
|
125
|
+
| Operation | Time | Notes |
|
|
126
|
+
|-----------|------|-------|
|
|
127
|
+
| **Initial index** | ~14s | Includes embedding generation |
|
|
128
|
+
| **Incremental index** | <1s | Only changed files |
|
|
129
|
+
| **Query (cold)** | ~200ms | First query loads model |
|
|
130
|
+
| **Query (warm)** | ~50ms | Subsequent queries |
|
|
131
|
+
| **Query (cached)** | <5ms | Identical queries |
|
|
132
|
+
|
|
133
|
+
Scaling (tested on larger codebases):
|
|
134
|
+
|
|
135
|
+
| Codebase Size | Index Time | Query Time |
|
|
136
|
+
|---------------|------------|------------|
|
|
137
|
+
| 100 files | ~30s | ~60ms |
|
|
138
|
+
| 500 files | ~2min | ~80ms |
|
|
139
|
+
| 1000 files | ~4min | ~100ms |
|
|
140
|
+
|
|
141
|
+
**Key optimizations:**
|
|
142
|
+
- Incremental indexing (content hashing)
|
|
143
|
+
- Query caching with automatic invalidation
|
|
144
|
+
- Local embeddings (no API latency)
|
|
145
|
+
- SQLite for fast reads
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
121
149
|
## Commands
|
|
122
150
|
|
|
123
151
|
### `contextkit init`
|
|
@@ -185,10 +213,57 @@ contextkit select "query" --format plain # Plain text, no formatting
|
|
|
185
213
|
# Include imported files (follows dependency graph)
|
|
186
214
|
contextkit select "query" --include-imports
|
|
187
215
|
|
|
216
|
+
# Repo map mode (signatures only, saves tokens)
|
|
217
|
+
contextkit select "query" --mode map
|
|
218
|
+
|
|
188
219
|
# Pipe to clipboard (macOS)
|
|
189
220
|
contextkit select "query" --format plain | pbcopy
|
|
190
221
|
```
|
|
191
222
|
|
|
223
|
+
### `contextkit symbol`
|
|
224
|
+
|
|
225
|
+
Search for code by symbol name (faster than semantic search when you know the name).
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Find a function or class by name
|
|
229
|
+
contextkit symbol "UserService"
|
|
230
|
+
|
|
231
|
+
# Exact match only
|
|
232
|
+
contextkit symbol "handleAuth" --exact
|
|
233
|
+
|
|
234
|
+
# Limit results
|
|
235
|
+
contextkit symbol "parse" --limit 10
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Output:**
|
|
239
|
+
```
|
|
240
|
+
š src/services/user.ts
|
|
241
|
+
ā ā UserService (line 12)
|
|
242
|
+
ā export class UserService
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### `contextkit graph`
|
|
246
|
+
|
|
247
|
+
Show call relationships for a function.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
contextkit graph "handlePayment"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Output:**
|
|
254
|
+
```
|
|
255
|
+
šÆ Call graph for: handlePayment
|
|
256
|
+
|
|
257
|
+
š„ Callers (2):
|
|
258
|
+
ā processOrder (src/orders/service.ts:45)
|
|
259
|
+
ā checkout (src/cart/checkout.ts:89)
|
|
260
|
+
|
|
261
|
+
š¤ Calls (3):
|
|
262
|
+
ā validateCard (src/payments/validation.ts)
|
|
263
|
+
ā chargeCard (src/payments/stripe.ts)
|
|
264
|
+
ā sendReceipt (src/notifications/email.ts)
|
|
265
|
+
```
|
|
266
|
+
|
|
192
267
|
---
|
|
193
268
|
|
|
194
269
|
## š¤ MCP Server (Claude Desktop Integration)
|
|
@@ -294,6 +369,69 @@ settings:
|
|
|
294
369
|
|
|
295
370
|
---
|
|
296
371
|
|
|
372
|
+
## š Documentation
|
|
373
|
+
|
|
374
|
+
- **[Getting Started Guide](./docs/getting-started.md)** ā Detailed walkthrough
|
|
375
|
+
- **[MCP Setup Guide](./docs/mcp-setup.md)** ā Claude Desktop integration
|
|
376
|
+
- **[Examples](./examples/README.md)** ā Real-world use cases
|
|
377
|
+
- [Bug Investigation](./examples/bug-investigation.md)
|
|
378
|
+
- [Scripting & Automation](./examples/scripting.md)
|
|
379
|
+
- **[Architecture](./docs/ARCHITECTURE.md)** ā How ContextKit works
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Troubleshooting
|
|
384
|
+
|
|
385
|
+
### Quick Diagnosis
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
contextkit doctor
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
This checks your setup and shows any issues:
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
𩺠ContextKit Doctor
|
|
395
|
+
|
|
396
|
+
Running diagnostics...
|
|
397
|
+
|
|
398
|
+
ā Node.js version: v20.10.0
|
|
399
|
+
ā Configuration: 2 source(s) configured
|
|
400
|
+
ā Index database: 166 chunks, 40 files (12.5 MB)
|
|
401
|
+
ā Embeddings: 166/166 chunks (100%)
|
|
402
|
+
ā Query cache: 5 cached queries
|
|
403
|
+
ā Disk space: OK
|
|
404
|
+
|
|
405
|
+
ā All checks passed! ContextKit is ready to use.
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Common Issues
|
|
409
|
+
|
|
410
|
+
**"Not initialized"**
|
|
411
|
+
```bash
|
|
412
|
+
contextkit init
|
|
413
|
+
contextkit source add ./src
|
|
414
|
+
contextkit index
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**"No sources configured"**
|
|
418
|
+
```bash
|
|
419
|
+
contextkit source add ./src
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
**"No embeddings generated"**
|
|
423
|
+
```bash
|
|
424
|
+
contextkit index --force # Re-index with embeddings
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
**Slow queries?**
|
|
428
|
+
```bash
|
|
429
|
+
contextkit cache clear # Clear query cache
|
|
430
|
+
contextkit index --force # Rebuild index
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
297
435
|
## Technical Details
|
|
298
436
|
|
|
299
437
|
### How Selection Works
|
|
@@ -340,10 +478,12 @@ contextkit select "How does authentication work?"
|
|
|
340
478
|
- [x] Multi-factor scoring algorithm
|
|
341
479
|
- [x] Multiple output formats (markdown, XML, JSON, plain)
|
|
342
480
|
- [x] **Import-aware scoring** ā understands code dependencies
|
|
343
|
-
- [
|
|
344
|
-
- [ ]
|
|
481
|
+
- [x] **Doctor command** ā diagnose setup issues
|
|
482
|
+
- [ ] ~~Function/class boundary awareness~~ (done via AST chunking)
|
|
483
|
+
- [x] **VS Code extension** ā [in development](https://github.com/milo4jo/contextkit-vscode)
|
|
345
484
|
- [ ] Cursor integration
|
|
346
485
|
- [ ] Neovim plugin
|
|
486
|
+
- [ ] Cloud sync for teams
|
|
347
487
|
|
|
348
488
|
---
|
|
349
489
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmSpC,eAAO,MAAM,aAAa,SAGN,CAAC"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { existsSync, statSync } from 'fs';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { loadConfig, getDbPath } from '../config/index.js';
|
|
6
|
+
import { openDatabase } from '../db/index.js';
|
|
7
|
+
import { writeMessage } from '../utils/streams.js';
|
|
8
|
+
const CHECK_OK = chalk.green('ā');
|
|
9
|
+
const CHECK_WARN = chalk.yellow('ā ');
|
|
10
|
+
const CHECK_ERROR = chalk.red('ā');
|
|
11
|
+
function formatResult(result) {
|
|
12
|
+
const icon = result.status === 'ok' ? CHECK_OK : result.status === 'warn' ? CHECK_WARN : CHECK_ERROR;
|
|
13
|
+
let output = `${icon} ${result.name}: ${result.message}`;
|
|
14
|
+
if (result.detail) {
|
|
15
|
+
output += chalk.dim(`\n ${result.detail}`);
|
|
16
|
+
}
|
|
17
|
+
return output;
|
|
18
|
+
}
|
|
19
|
+
async function checkNodeVersion() {
|
|
20
|
+
const version = process.version;
|
|
21
|
+
const major = parseInt(version.slice(1).split('.')[0], 10);
|
|
22
|
+
if (major >= 18) {
|
|
23
|
+
return {
|
|
24
|
+
name: 'Node.js version',
|
|
25
|
+
status: 'ok',
|
|
26
|
+
message: version,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
name: 'Node.js version',
|
|
31
|
+
status: 'error',
|
|
32
|
+
message: `${version} (requires >= 18)`,
|
|
33
|
+
detail: 'Upgrade Node.js: https://nodejs.org/',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
async function checkConfig() {
|
|
37
|
+
try {
|
|
38
|
+
const config = await loadConfig();
|
|
39
|
+
const sourceCount = config.sources?.length || 0;
|
|
40
|
+
if (sourceCount === 0) {
|
|
41
|
+
return {
|
|
42
|
+
name: 'Configuration',
|
|
43
|
+
status: 'warn',
|
|
44
|
+
message: 'No sources configured',
|
|
45
|
+
detail: 'Run: contextkit source add ./src',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
name: 'Configuration',
|
|
50
|
+
status: 'ok',
|
|
51
|
+
message: `${sourceCount} source(s) configured`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return {
|
|
56
|
+
name: 'Configuration',
|
|
57
|
+
status: 'error',
|
|
58
|
+
message: 'Not initialized',
|
|
59
|
+
detail: 'Run: contextkit init',
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function checkDatabase() {
|
|
64
|
+
try {
|
|
65
|
+
const dbPath = getDbPath();
|
|
66
|
+
if (!existsSync(dbPath)) {
|
|
67
|
+
return {
|
|
68
|
+
name: 'Index database',
|
|
69
|
+
status: 'warn',
|
|
70
|
+
message: 'Not indexed yet',
|
|
71
|
+
detail: 'Run: contextkit index',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const stats = statSync(dbPath);
|
|
75
|
+
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
|
|
76
|
+
const db = openDatabase();
|
|
77
|
+
const chunks = db.prepare('SELECT COUNT(*) as count FROM chunks').get();
|
|
78
|
+
const files = db.prepare('SELECT COUNT(*) as count FROM files').get();
|
|
79
|
+
db.close();
|
|
80
|
+
return {
|
|
81
|
+
name: 'Index database',
|
|
82
|
+
status: 'ok',
|
|
83
|
+
message: `${chunks.count} chunks, ${files.count} files (${sizeMB} MB)`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return {
|
|
88
|
+
name: 'Index database',
|
|
89
|
+
status: 'error',
|
|
90
|
+
message: 'Database error',
|
|
91
|
+
detail: error instanceof Error ? error.message : 'Unknown error',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function checkEmbeddings() {
|
|
96
|
+
try {
|
|
97
|
+
const dbPath = getDbPath();
|
|
98
|
+
if (!existsSync(dbPath)) {
|
|
99
|
+
return {
|
|
100
|
+
name: 'Embeddings',
|
|
101
|
+
status: 'warn',
|
|
102
|
+
message: 'No index yet',
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const db = openDatabase();
|
|
106
|
+
const result = db.prepare('SELECT COUNT(*) as count FROM chunks WHERE embedding IS NOT NULL').get();
|
|
107
|
+
const total = db.prepare('SELECT COUNT(*) as count FROM chunks').get();
|
|
108
|
+
db.close();
|
|
109
|
+
if (result.count === 0) {
|
|
110
|
+
return {
|
|
111
|
+
name: 'Embeddings',
|
|
112
|
+
status: 'warn',
|
|
113
|
+
message: 'No embeddings generated',
|
|
114
|
+
detail: 'Run: contextkit index --full',
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const coverage = ((result.count / total.count) * 100).toFixed(0);
|
|
118
|
+
return {
|
|
119
|
+
name: 'Embeddings',
|
|
120
|
+
status: 'ok',
|
|
121
|
+
message: `${result.count}/${total.count} chunks (${coverage}%)`,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
return {
|
|
126
|
+
name: 'Embeddings',
|
|
127
|
+
status: 'error',
|
|
128
|
+
message: 'Error checking embeddings',
|
|
129
|
+
detail: error instanceof Error ? error.message : 'Unknown error',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async function checkDiskSpace() {
|
|
134
|
+
try {
|
|
135
|
+
const dbPath = getDbPath();
|
|
136
|
+
const dir = join(dbPath, '..');
|
|
137
|
+
if (!existsSync(dir)) {
|
|
138
|
+
return {
|
|
139
|
+
name: 'Disk space',
|
|
140
|
+
status: 'ok',
|
|
141
|
+
message: 'Not yet initialized',
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
// Simple check - just report db size
|
|
145
|
+
if (existsSync(dbPath)) {
|
|
146
|
+
const stats = statSync(dbPath);
|
|
147
|
+
const sizeMB = stats.size / 1024 / 1024;
|
|
148
|
+
if (sizeMB > 500) {
|
|
149
|
+
return {
|
|
150
|
+
name: 'Disk space',
|
|
151
|
+
status: 'warn',
|
|
152
|
+
message: `Database is ${sizeMB.toFixed(0)} MB`,
|
|
153
|
+
detail: 'Consider: contextkit cache clear',
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
name: 'Disk space',
|
|
159
|
+
status: 'ok',
|
|
160
|
+
message: 'OK',
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return {
|
|
165
|
+
name: 'Disk space',
|
|
166
|
+
status: 'ok',
|
|
167
|
+
message: 'Could not check',
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
async function checkQueryCache() {
|
|
172
|
+
try {
|
|
173
|
+
const dbPath = getDbPath();
|
|
174
|
+
if (!existsSync(dbPath)) {
|
|
175
|
+
return {
|
|
176
|
+
name: 'Query cache',
|
|
177
|
+
status: 'ok',
|
|
178
|
+
message: 'No cache yet',
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
const db = openDatabase();
|
|
182
|
+
// Check if query_cache table exists
|
|
183
|
+
const tableExists = db
|
|
184
|
+
.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='query_cache'")
|
|
185
|
+
.get();
|
|
186
|
+
if (!tableExists) {
|
|
187
|
+
db.close();
|
|
188
|
+
return {
|
|
189
|
+
name: 'Query cache',
|
|
190
|
+
status: 'ok',
|
|
191
|
+
message: 'Not enabled',
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
const result = db.prepare('SELECT COUNT(*) as count FROM query_cache').get();
|
|
195
|
+
db.close();
|
|
196
|
+
return {
|
|
197
|
+
name: 'Query cache',
|
|
198
|
+
status: 'ok',
|
|
199
|
+
message: `${result.count} cached queries`,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
return {
|
|
204
|
+
name: 'Query cache',
|
|
205
|
+
status: 'ok',
|
|
206
|
+
message: 'Could not check',
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
async function runDoctor(options) {
|
|
211
|
+
const checks = [];
|
|
212
|
+
writeMessage(chalk.bold('\n𩺠ContextKit Doctor\n'));
|
|
213
|
+
writeMessage('Running diagnostics...\n');
|
|
214
|
+
// Run all checks
|
|
215
|
+
checks.push(await checkNodeVersion());
|
|
216
|
+
checks.push(await checkConfig());
|
|
217
|
+
checks.push(await checkDatabase());
|
|
218
|
+
checks.push(await checkEmbeddings());
|
|
219
|
+
checks.push(await checkQueryCache());
|
|
220
|
+
checks.push(await checkDiskSpace());
|
|
221
|
+
if (options.json) {
|
|
222
|
+
console.log(JSON.stringify(checks, null, 2));
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// Output results
|
|
226
|
+
for (const result of checks) {
|
|
227
|
+
writeMessage(formatResult(result));
|
|
228
|
+
}
|
|
229
|
+
// Summary
|
|
230
|
+
const errors = checks.filter((c) => c.status === 'error').length;
|
|
231
|
+
const warnings = checks.filter((c) => c.status === 'warn').length;
|
|
232
|
+
writeMessage('');
|
|
233
|
+
if (errors > 0) {
|
|
234
|
+
writeMessage(chalk.red(`\n${errors} error(s) found. Fix these issues to use ContextKit.`));
|
|
235
|
+
process.exit(1);
|
|
236
|
+
}
|
|
237
|
+
else if (warnings > 0) {
|
|
238
|
+
writeMessage(chalk.yellow(`\n${warnings} warning(s). ContextKit will work but may be limited.`));
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
writeMessage(chalk.green('\nā All checks passed! ContextKit is ready to use.'));
|
|
242
|
+
}
|
|
243
|
+
// Quick tips
|
|
244
|
+
writeMessage(chalk.dim('\nQuick commands:'));
|
|
245
|
+
writeMessage(chalk.dim(' contextkit init # Initialize project'));
|
|
246
|
+
writeMessage(chalk.dim(' contextkit source add . # Add sources'));
|
|
247
|
+
writeMessage(chalk.dim(' contextkit index # Build index'));
|
|
248
|
+
writeMessage(chalk.dim(' contextkit select "query" # Find context\n'));
|
|
249
|
+
}
|
|
250
|
+
export const doctorCommand = new Command('doctor')
|
|
251
|
+
.description('Diagnose ContextKit setup and configuration')
|
|
252
|
+
.option('--json', 'Output as JSON')
|
|
253
|
+
.action(runDoctor);
|
|
254
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASnD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAClC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACrC,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEnC,SAAS,YAAY,CAAC,MAAmB;IACvC,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;IAE1F,IAAI,MAAM,GAAG,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,EAAE,CAA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AC5E,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC,CAAC;IACrE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC,CAAC;IACrE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,6CAA6C,CAAC;KAC1D,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;KAClC,MAAM,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Call Graph Command
|
|
3
|
+
*
|
|
4
|
+
* Analyze function call relationships:
|
|
5
|
+
* - What functions call a given function (callers)
|
|
6
|
+
* - What functions a given function calls (callees)
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
export declare const graphCommand: Command;
|
|
10
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/commands/graph.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsUpC,eAAO,MAAM,YAAY,SA4BrB,CAAC"}
|