recker 1.0.15-next.3794a15 → 1.0.15-next.7944604

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.
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/bench/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAa;IACpB,KAAK,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,UAAU;IAKxB,KAAK;IA4FX,IAAI;CAGL"}
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/bench/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAa;IACpB,KAAK,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,UAAU;IAKxB,KAAK;IAgGX,IAAI;CAGL"}
@@ -22,7 +22,7 @@ export class LoadGenerator {
22
22
  agent: {
23
23
  connections: this.config.users,
24
24
  pipelining: this.config.mode === 'throughput' ? 2 : 1,
25
- keepAlive: false
25
+ keepAlive: true
26
26
  }
27
27
  },
28
28
  retry: {
@@ -41,6 +41,7 @@ export class LoadGenerator {
41
41
  await new Promise(r => setTimeout(r, 50 + Math.random() * 450));
42
42
  }
43
43
  const res = await client.get(path, { signal: controller.signal });
44
+ await res.text();
44
45
  const duration = performance.now() - start;
45
46
  const bytes = Number(res.headers.get('content-length') || 0);
46
47
  this.stats.addResult(duration, res.status, bytes);
@@ -1,15 +1,29 @@
1
+ export interface ErrorEntry {
2
+ status: number;
3
+ message: string;
4
+ count: number;
5
+ lastSeen: number;
6
+ }
1
7
  export declare class LoadStats {
2
8
  totalRequests: number;
3
9
  successful: number;
4
10
  failed: number;
5
11
  bytesTransferred: number;
6
12
  statusCodes: Record<number, number>;
7
- errors: Record<string, number>;
13
+ private errorMap;
14
+ private recentErrors;
15
+ private readonly maxRecentErrors;
8
16
  latencies: number[];
9
17
  private lastSnapshotTime;
10
18
  private lastSnapshotRequests;
11
19
  activeUsers: number;
12
20
  addResult(durationMs: number, status: number, bytes: number, error?: Error): void;
21
+ private trackError;
22
+ private formatErrorMessage;
23
+ private getStatusText;
24
+ getErrors(): ErrorEntry[];
25
+ getRecentErrors(): ErrorEntry[];
26
+ get errors(): Record<string, number>;
13
27
  getSnapshot(): {
14
28
  rps: number;
15
29
  p95: number;
@@ -1 +1 @@
1
- {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/bench/stats.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IACpB,aAAa,SAAK;IAClB,UAAU,SAAK;IACf,MAAM,SAAK;IACX,gBAAgB,SAAK;IAErB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IACzC,MAAM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IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOnC;IAED,WAAW;;;;;IAmBX,UAAU;;;;;;;;;;;;;;;;CAmBX"}
@@ -4,7 +4,9 @@ export class LoadStats {
4
4
  failed = 0;
5
5
  bytesTransferred = 0;
6
6
  statusCodes = {};
7
- errors = {};
7
+ errorMap = new Map();
8
+ recentErrors = [];
9
+ maxRecentErrors = 10;
8
10
  latencies = [];
9
11
  lastSnapshotTime = Date.now();
10
12
  lastSnapshotRequests = 0;
@@ -15,10 +17,7 @@ export class LoadStats {
15
17
  this.latencies.push(durationMs);
16
18
  if (error || status >= 400) {
17
19
  this.failed++;
18
- if (error) {
19
- const msg = error.message || 'Unknown Error';
20
- this.errors[msg] = (this.errors[msg] || 0) + 1;
21
- }
20
+ this.trackError(status, error);
22
21
  }
23
22
  else {
24
23
  this.successful++;
@@ -27,6 +26,86 @@ export class LoadStats {
27
26
  this.statusCodes[status] = (this.statusCodes[status] || 0) + 1;
28
27
  }
29
28
  }
29
+ trackError(status, error) {
30
+ const message = this.formatErrorMessage(status, error);
31
+ const key = `${status}:${message}`;
32
+ const now = Date.now();
33
+ const existing = this.errorMap.get(key);
34
+ if (existing) {
35
+ existing.count++;
36
+ existing.lastSeen = now;
37
+ }
38
+ else {
39
+ const entry = { status, message, count: 1, lastSeen: now };
40
+ this.errorMap.set(key, entry);
41
+ this.recentErrors.push(entry);
42
+ if (this.recentErrors.length > this.maxRecentErrors) {
43
+ this.recentErrors.shift();
44
+ }
45
+ }
46
+ }
47
+ formatErrorMessage(status, error) {
48
+ if (error) {
49
+ let msg = error.message || 'Unknown Error';
50
+ if (msg.includes('ECONNREFUSED'))
51
+ return 'Connection refused';
52
+ if (msg.includes('ECONNRESET'))
53
+ return 'Connection reset';
54
+ if (msg.includes('ETIMEDOUT'))
55
+ return 'Connection timeout';
56
+ if (msg.includes('ENOTFOUND'))
57
+ return 'DNS lookup failed';
58
+ if (msg.includes('UND_ERR_SOCKET'))
59
+ return 'Socket error';
60
+ if (msg.includes('UND_ERR_HEADERS_TIMEOUT'))
61
+ return 'Headers timeout';
62
+ if (msg.includes('UND_ERR_BODY_TIMEOUT'))
63
+ return 'Body timeout';
64
+ if (msg.includes('UND_ERR_CONNECT_TIMEOUT'))
65
+ return 'Connect timeout';
66
+ if (msg.includes('AbortError') || msg.includes('aborted'))
67
+ return 'Request aborted';
68
+ if (msg.length > 50) {
69
+ msg = msg.substring(0, 47) + '...';
70
+ }
71
+ return msg;
72
+ }
73
+ if (status >= 400) {
74
+ return this.getStatusText(status);
75
+ }
76
+ return 'Unknown Error';
77
+ }
78
+ getStatusText(status) {
79
+ const texts = {
80
+ 400: 'Bad Request',
81
+ 401: 'Unauthorized',
82
+ 403: 'Forbidden',
83
+ 404: 'Not Found',
84
+ 405: 'Method Not Allowed',
85
+ 408: 'Request Timeout',
86
+ 429: 'Too Many Requests',
87
+ 500: 'Internal Server Error',
88
+ 502: 'Bad Gateway',
89
+ 503: 'Service Unavailable',
90
+ 504: 'Gateway Timeout',
91
+ };
92
+ return texts[status] || `HTTP ${status}`;
93
+ }
94
+ getErrors() {
95
+ return Array.from(this.errorMap.values())
96
+ .sort((a, b) => b.count - a.count);
97
+ }
98
+ getRecentErrors() {
99
+ return [...this.recentErrors];
100
+ }
101
+ get errors() {
102
+ const result = {};
103
+ for (const entry of this.errorMap.values()) {
104
+ const key = entry.status > 0 ? `[${entry.status}] ${entry.message}` : entry.message;
105
+ result[key] = entry.count;
106
+ }
107
+ return result;
108
+ }
30
109
  getSnapshot() {
31
110
  const now = Date.now();
32
111
  const timeDiff = (now - this.lastSnapshotTime) / 1000;
@@ -1 +1 @@
1
- {"version":3,"file":"load-dashboard.d.ts","sourceRoot":"","sources":["../../../src/cli/tui/load-dashboard.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAKrE,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,UAAU,iBA4E1D"}
1
+ {"version":3,"file":"load-dashboard.d.ts","sourceRoot":"","sources":["../../../src/cli/tui/load-dashboard.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAMrE,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,UAAU,iBA4E1D"}
@@ -72,11 +72,11 @@ function render(config, elapsed, remaining, snapshot, rpsHistory, latencyHistory
72
72
  console.log(`${pc.white('Time:')} ${pc.green(elapsed + 's')} ` +
73
73
  `${pc.gray('/')} ${config.duration}s ` +
74
74
  `${pc.gray('(')}${pc.yellow(remaining + 's left')}${pc.gray(')')} ` +
75
- `${pc.white('Reqs:')} ${pc.bold(stats.totalRequests)}`);
76
- console.log(`${pc.blue('Users:')} ${pc.bold(snapshot.activeUsers)} ` +
75
+ `${pc.white('Reqs:')} ${pc.bold(String(stats.totalRequests))}`);
76
+ console.log(`${pc.blue('Users:')} ${pc.bold(String(snapshot.activeUsers))} ` +
77
77
  `${pc.green('RPS:')} ${pc.bold(snapshot.rps.toFixed(0))} ` +
78
78
  `${pc.magenta('Latency (P95):')} ${pc.bold(snapshot.p95.toFixed(0) + 'ms')} ` +
79
- `${pc.white('Errors:')} ${stats.failed > 0 ? pc.red(stats.failed) : pc.green('0')}`);
79
+ `${pc.white('Errors:')} ${stats.failed > 0 ? pc.red(String(stats.failed)) : pc.green('0')}`);
80
80
  console.log(pc.gray('──────────────────────────────────────────────────'));
81
81
  console.log(pc.bold(pc.blue('👥 Active Users')));
82
82
  console.log(pc.blue(plot(usersHistory, { height: 4 })));
@@ -86,6 +86,39 @@ function render(config, elapsed, remaining, snapshot, rpsHistory, latencyHistory
86
86
  console.log('');
87
87
  console.log(pc.bold(pc.magenta('⏱️ Latency P95 (ms)')));
88
88
  console.log(pc.magenta(plot(latencyHistory, { height: 4 })));
89
+ const recentErrors = stats.getRecentErrors();
90
+ if (recentErrors.length > 0) {
91
+ console.log('');
92
+ console.log(pc.bold(pc.red('⚠️ Recent Errors')));
93
+ renderErrorList(recentErrors, 5);
94
+ }
95
+ }
96
+ function formatErrorEntry(entry) {
97
+ const count = pc.gray(`${entry.count}x`);
98
+ if (entry.status === 0) {
99
+ return ` ${count} ${pc.red('NET')} ${entry.message}`;
100
+ }
101
+ const statusBadge = formatStatusBadge(entry.status);
102
+ return ` ${count} ${statusBadge} ${entry.message}`;
103
+ }
104
+ function formatStatusBadge(status) {
105
+ const code = String(status);
106
+ if (status >= 500)
107
+ return pc.bgRed(pc.white(` ${code} `));
108
+ if (status >= 400)
109
+ return pc.bgYellow(pc.black(` ${code} `));
110
+ if (status >= 300)
111
+ return pc.bgCyan(pc.black(` ${code} `));
112
+ return pc.bgGreen(pc.black(` ${code} `));
113
+ }
114
+ function renderErrorList(errors, maxItems = 10) {
115
+ const toShow = errors.slice(-maxItems);
116
+ for (const entry of toShow) {
117
+ console.log(formatErrorEntry(entry));
118
+ }
119
+ if (errors.length > maxItems) {
120
+ console.log(pc.gray(` ... and ${errors.length - maxItems} more`));
121
+ }
89
122
  }
90
123
  function renderFinalReport(stats, config) {
91
124
  const summary = stats.getSummary();
@@ -97,8 +130,8 @@ function renderFinalReport(stats, config) {
97
130
  console.log(` Duration: ${config.duration}s`);
98
131
  console.log('\n' + pc.bold('Traffic:'));
99
132
  console.log(` Total Requests: ${summary.total}`);
100
- console.log(` Successful: ${pc.green(summary.success)}`);
101
- console.log(` Failed: ${summary.failed > 0 ? pc.red(summary.failed) : pc.gray(0)}`);
133
+ console.log(` Successful: ${pc.green(String(summary.success))}`);
134
+ console.log(` Failed: ${summary.failed > 0 ? pc.red(String(summary.failed)) : pc.gray('0')}`);
102
135
  console.log(` Total Bytes: ${(summary.bytes / 1024 / 1024).toFixed(2)} MB`);
103
136
  console.log('\n' + pc.bold('Latency (ms):'));
104
137
  console.log(` Avg: ${summary.latency.avg.toFixed(2)}`);
@@ -108,10 +141,31 @@ function renderFinalReport(stats, config) {
108
141
  console.log(` Max: ${summary.latency.max.toFixed(0)}`);
109
142
  if (Object.keys(summary.codes).length > 0) {
110
143
  console.log('\n' + pc.bold('Status Codes:'));
111
- Object.entries(summary.codes).forEach(([code, count]) => {
112
- const color = code.startsWith('2') ? pc.green : code.startsWith('5') ? pc.red : pc.yellow;
113
- console.log(` ${color(code)}: ${count}`);
144
+ Object.entries(summary.codes)
145
+ .sort(([a], [b]) => Number(a) - Number(b))
146
+ .forEach(([code, count]) => {
147
+ const badge = formatStatusBadge(Number(code));
148
+ console.log(` ${badge} ${count}`);
114
149
  });
115
150
  }
151
+ const allErrors = stats.getErrors();
152
+ if (allErrors.length > 0) {
153
+ console.log('\n' + pc.bold(pc.red('Errors:')));
154
+ renderErrorList(allErrors, 15);
155
+ const networkErrors = allErrors.filter(e => e.status === 0);
156
+ const httpErrors = allErrors.filter(e => e.status > 0);
157
+ if (networkErrors.length > 0 || httpErrors.length > 0) {
158
+ console.log('');
159
+ console.log(pc.gray(' Summary:'));
160
+ if (networkErrors.length > 0) {
161
+ const total = networkErrors.reduce((sum, e) => sum + e.count, 0);
162
+ console.log(pc.gray(` Network errors: ${total} (${networkErrors.length} types)`));
163
+ }
164
+ if (httpErrors.length > 0) {
165
+ const total = httpErrors.reduce((sum, e) => sum + e.count, 0);
166
+ console.log(pc.gray(` HTTP errors: ${total} (${httpErrors.length} types)`));
167
+ }
168
+ }
169
+ }
116
170
  console.log('');
117
171
  }
@@ -49,14 +49,15 @@ export function createContract(client, contract) {
49
49
  if (endpoint.errors && err instanceof HttpError && err.response) {
50
50
  const schema = endpoint.errors[err.status];
51
51
  if (schema) {
52
+ let parsedError;
52
53
  try {
53
54
  const errorBody = await err.response.json();
54
- const parsedError = schema.parse(errorBody);
55
- throw new ContractError(err.status, parsedError, err);
55
+ parsedError = schema.parse(errorBody);
56
56
  }
57
57
  catch (parseErr) {
58
58
  throw err;
59
59
  }
60
+ throw new ContractError(err.status, parsedError, err);
60
61
  }
61
62
  }
62
63
  throw err;
@@ -0,0 +1,18 @@
1
+ import type { EmbeddingsData } from './search/types.js';
2
+ declare function getPackageVersion(): string;
3
+ export declare function getEmbeddingsCachePath(version?: string): string;
4
+ export declare function hasLocalEmbeddings(version?: string): boolean;
5
+ export declare function loadLocalEmbeddings(version?: string): EmbeddingsData | null;
6
+ export declare function saveLocalEmbeddings(data: EmbeddingsData, version?: string): void;
7
+ export declare function downloadEmbeddings(version?: string): Promise<EmbeddingsData>;
8
+ export declare function loadBundledEmbeddings(): Promise<EmbeddingsData | null>;
9
+ export interface LoadEmbeddingsOptions {
10
+ forceDownload?: boolean;
11
+ version?: string;
12
+ offline?: boolean;
13
+ debug?: boolean;
14
+ }
15
+ export declare function loadEmbeddings(options?: LoadEmbeddingsOptions): Promise<EmbeddingsData | null>;
16
+ export declare function clearEmbeddingsCache(version?: string): void;
17
+ export { getPackageVersion };
18
+ //# sourceMappingURL=embeddings-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embeddings-loader.d.ts","sourceRoot":"","sources":["../../src/mcp/embeddings-loader.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA+BxD,iBAAS,iBAAiB,IAAI,MAAM,CAKnC;AAyBD,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAI/D;AAKD,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAE5D;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAa3E;AAKD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAUhF;AAKD,wBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAoBlF;AAKD,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAsB5E;AAED,MAAM,WAAW,qBAAqB;IAEpC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAsBD,wBAAsB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAsCxG;AAKD,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAW3D;AAKD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,152 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
2
+ import { join, dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ function getPackageVersionFromPkg() {
5
+ try {
6
+ const __dirname = dirname(fileURLToPath(import.meta.url));
7
+ const paths = [
8
+ join(__dirname, '..', '..', 'package.json'),
9
+ join(__dirname, '..', '..', '..', 'package.json'),
10
+ join(process.cwd(), 'package.json'),
11
+ ];
12
+ for (const pkgPath of paths) {
13
+ if (existsSync(pkgPath)) {
14
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
15
+ if (pkg.name === 'recker') {
16
+ return pkg.version;
17
+ }
18
+ }
19
+ }
20
+ }
21
+ catch {
22
+ }
23
+ return '1.0.15';
24
+ }
25
+ let _packageVersion = null;
26
+ function getPackageVersion() {
27
+ if (!_packageVersion) {
28
+ _packageVersion = getPackageVersionFromPkg();
29
+ }
30
+ return _packageVersion;
31
+ }
32
+ const GITHUB_RELEASE_URL = 'https://github.com/forattini-dev/recker/releases/download';
33
+ function getCacheDir() {
34
+ const homeDir = process.env.HOME || process.env.USERPROFILE || '';
35
+ if (homeDir) {
36
+ return join(homeDir, '.cache', 'recker');
37
+ }
38
+ try {
39
+ const __dirname = dirname(fileURLToPath(import.meta.url));
40
+ return join(__dirname, '..', '..', 'node_modules', '.cache', 'recker');
41
+ }
42
+ catch {
43
+ return join(process.cwd(), 'node_modules', '.cache', 'recker');
44
+ }
45
+ }
46
+ export function getEmbeddingsCachePath(version) {
47
+ const cacheDir = getCacheDir();
48
+ const ver = version || getPackageVersion();
49
+ return join(cacheDir, `embeddings-${ver}.json`);
50
+ }
51
+ export function hasLocalEmbeddings(version) {
52
+ return existsSync(getEmbeddingsCachePath(version));
53
+ }
54
+ export function loadLocalEmbeddings(version) {
55
+ const cachePath = getEmbeddingsCachePath(version);
56
+ if (!existsSync(cachePath)) {
57
+ return null;
58
+ }
59
+ try {
60
+ const data = readFileSync(cachePath, 'utf-8');
61
+ return JSON.parse(data);
62
+ }
63
+ catch {
64
+ return null;
65
+ }
66
+ }
67
+ export function saveLocalEmbeddings(data, version) {
68
+ const cachePath = getEmbeddingsCachePath(version);
69
+ const cacheDir = dirname(cachePath);
70
+ if (!existsSync(cacheDir)) {
71
+ mkdirSync(cacheDir, { recursive: true });
72
+ }
73
+ writeFileSync(cachePath, JSON.stringify(data));
74
+ }
75
+ export async function downloadEmbeddings(version) {
76
+ const ver = version || getPackageVersion();
77
+ const url = `${GITHUB_RELEASE_URL}/v${ver}/embeddings.json`;
78
+ try {
79
+ const response = await fetch(url);
80
+ if (!response.ok) {
81
+ throw new Error(`Failed to download embeddings: ${response.status} ${response.statusText}`);
82
+ }
83
+ const data = await response.json();
84
+ saveLocalEmbeddings(data, ver);
85
+ return data;
86
+ }
87
+ catch (error) {
88
+ throw new Error(`Failed to download embeddings from ${url}: ${error}`);
89
+ }
90
+ }
91
+ export async function loadBundledEmbeddings() {
92
+ try {
93
+ const __dirname = dirname(fileURLToPath(import.meta.url));
94
+ const bundledPath = join(__dirname, 'data', 'embeddings.json');
95
+ if (existsSync(bundledPath)) {
96
+ const data = readFileSync(bundledPath, 'utf-8');
97
+ return JSON.parse(data);
98
+ }
99
+ const srcPath = join(__dirname, '..', 'mcp', 'data', 'embeddings.json');
100
+ if (existsSync(srcPath)) {
101
+ const data = readFileSync(srcPath, 'utf-8');
102
+ return JSON.parse(data);
103
+ }
104
+ }
105
+ catch {
106
+ }
107
+ return null;
108
+ }
109
+ export async function loadEmbeddings(options = {}) {
110
+ const { forceDownload = false, version, offline = false, debug = false } = options;
111
+ const log = (msg) => {
112
+ if (debug)
113
+ console.log(`[embeddings-loader] ${msg}`);
114
+ };
115
+ if (!forceDownload) {
116
+ const cached = loadLocalEmbeddings(version);
117
+ if (cached) {
118
+ log(`Loaded from cache: ${getEmbeddingsCachePath(version)}`);
119
+ return cached;
120
+ }
121
+ }
122
+ const bundled = await loadBundledEmbeddings();
123
+ if (bundled) {
124
+ log('Loaded bundled embeddings');
125
+ return bundled;
126
+ }
127
+ if (!offline) {
128
+ try {
129
+ log(`Downloading embeddings v${version || getPackageVersion()}...`);
130
+ const downloaded = await downloadEmbeddings(version);
131
+ log(`Downloaded and cached: ${downloaded.documents?.length || 0} documents`);
132
+ return downloaded;
133
+ }
134
+ catch (error) {
135
+ log(`Download failed: ${error}`);
136
+ }
137
+ }
138
+ log('No embeddings available');
139
+ return null;
140
+ }
141
+ export function clearEmbeddingsCache(version) {
142
+ const cachePath = getEmbeddingsCachePath(version);
143
+ try {
144
+ const fs = require('fs');
145
+ if (fs.existsSync(cachePath)) {
146
+ fs.unlinkSync(cachePath);
147
+ }
148
+ }
149
+ catch {
150
+ }
151
+ }
152
+ export { getPackageVersion };
@@ -1,4 +1,5 @@
1
1
  export * from './types.js';
2
2
  export * from './client.js';
3
3
  export * from './server.js';
4
+ export * from './embeddings-loader.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
package/dist/mcp/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './types.js';
2
2
  export * from './client.js';
3
3
  export * from './server.js';
4
+ export * from './embeddings-loader.js';
@@ -1 +1 @@
1
- {"version":3,"file":"hybrid-search.d.ts","sourceRoot":"","sources":["../../../src/mcp/search/hybrid-search.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAGnB,MAAM,YAAY,CAAC;AAkBpB,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAiC;IAC7C,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAA+B;gBAEjC,MAAM,GAAE,kBAAuB;IAYrC,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YA+BrC,yBAAyB;IAuDjC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAmDjF,OAAO,CAAC,WAAW;IAiCnB,OAAO,CAAC,cAAc;IA8GtB,OAAO,CAAC,cAAc;IAoDtB,OAAO,CAAC,MAAM,CAAC,UAAU,CAoCtB;IAKH,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,cAAc;IAmBtB,aAAa,IAAI,OAAO;IAOxB,QAAQ,IAAI;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IAYD,OAAO,CAAC,GAAG;CAKZ;AAKD,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,YAAY,CAE5E"}
1
+ {"version":3,"file":"hybrid-search.d.ts","sourceRoot":"","sources":["../../../src/mcp/search/hybrid-search.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAGnB,MAAM,YAAY,CAAC;AAkBpB,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAiC;IAC7C,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAA+B;gBAEjC,MAAM,GAAE,kBAAuB;IAYrC,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAmCrC,yBAAyB;IAoCjC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAmDjF,OAAO,CAAC,WAAW;IAiCnB,OAAO,CAAC,cAAc;IA8GtB,OAAO,CAAC,cAAc;IAoDtB,OAAO,CAAC,MAAM,CAAC,UAAU,CAoCtB;IAKH,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,cAAc;IAmBtB,aAAa,IAAI,OAAO;IAOxB,QAAQ,IAAI;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IAYD,OAAO,CAAC,GAAG;CAKZ;AAKD,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,YAAY,CAE5E"}
@@ -1,5 +1,6 @@
1
1
  import Fuse from 'fuse.js';
2
2
  import { cosineSimilarity, combineScores, levenshtein } from './math.js';
3
+ import { loadEmbeddings } from '../embeddings-loader.js';
3
4
  let cachedEmbeddings = null;
4
5
  export class HybridSearch {
5
6
  fuse = null;
@@ -43,27 +44,12 @@ export class HybridSearch {
43
44
  this.embeddingsData = cachedEmbeddings;
44
45
  }
45
46
  else {
46
- const embeddingsPath = new URL('../data/embeddings.json', import.meta.url);
47
- try {
48
- const response = await fetch(embeddingsPath);
49
- if (response.ok) {
50
- this.embeddingsData = (await response.json());
51
- cachedEmbeddings = this.embeddingsData;
52
- }
53
- }
54
- catch {
55
- try {
56
- const fs = await import('fs');
57
- const path = await import('path');
58
- const embeddingsFile = path.join(path.dirname(new URL(import.meta.url).pathname), '../data/embeddings.json');
59
- if (fs.existsSync(embeddingsFile)) {
60
- const data = fs.readFileSync(embeddingsFile, 'utf-8');
61
- this.embeddingsData = JSON.parse(data);
62
- cachedEmbeddings = this.embeddingsData;
63
- }
64
- }
65
- catch {
66
- }
47
+ const data = await loadEmbeddings({
48
+ debug: this.config.debug,
49
+ });
50
+ if (data) {
51
+ this.embeddingsData = data;
52
+ cachedEmbeddings = data;
67
53
  }
68
54
  }
69
55
  if (this.embeddingsData) {
@@ -21,6 +21,8 @@ export declare class MCPServer {
21
21
  private sseClients;
22
22
  private initialized;
23
23
  constructor(options?: MCPServerOptions);
24
+ private indexReady;
25
+ private ensureIndexReady;
24
26
  private log;
25
27
  private findDocsPath;
26
28
  private findExamplesPath;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAMhB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAA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AAY,IAAI,MAAM;IAItB,gBAAgB,IAAI,MAAM;IAI1B,aAAa,IAAI,MAAM;IAIvB,YAAY,IAAI,gBAAgB;CAGjC;AAoBD,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAErE"}
@@ -26,7 +26,13 @@ export class MCPServer {
26
26
  toolsFilter: options.toolsFilter || [],
27
27
  };
28
28
  this.hybridSearch = createHybridSearch({ debug: this.options.debug });
29
- this.buildIndex();
29
+ }
30
+ indexReady = null;
31
+ async ensureIndexReady() {
32
+ if (!this.indexReady) {
33
+ this.indexReady = this.buildIndex();
34
+ }
35
+ await this.indexReady;
30
36
  }
31
37
  log(message, data) {
32
38
  if (this.options.debug) {
@@ -1112,6 +1118,7 @@ const client = createClient({
1112
1118
  });
1113
1119
  }
1114
1120
  async start() {
1121
+ await this.ensureIndexReady();
1115
1122
  switch (this.options.transport) {
1116
1123
  case 'stdio':
1117
1124
  return this.startStdio();
@@ -9,6 +9,14 @@ export declare const magenta: (s: string | number) => string;
9
9
  export declare const cyan: (s: string | number) => string;
10
10
  export declare const white: (s: string | number) => string;
11
11
  export declare const gray: (s: string | number) => string;
12
+ export declare const bgBlack: (s: string | number) => string;
13
+ export declare const bgRed: (s: string | number) => string;
14
+ export declare const bgGreen: (s: string | number) => string;
15
+ export declare const bgYellow: (s: string | number) => string;
16
+ export declare const bgBlue: (s: string | number) => string;
17
+ export declare const bgMagenta: (s: string | number) => string;
18
+ export declare const bgCyan: (s: string | number) => string;
19
+ export declare const bgWhite: (s: string | number) => string;
12
20
  declare const colors: {
13
21
  reset: (s: string) => string;
14
22
  bold: (s: string | number) => string;
@@ -21,6 +29,14 @@ declare const colors: {
21
29
  cyan: (s: string | number) => string;
22
30
  white: (s: string | number) => string;
23
31
  gray: (s: string | number) => string;
32
+ bgBlack: (s: string | number) => string;
33
+ bgRed: (s: string | number) => string;
34
+ bgGreen: (s: string | number) => string;
35
+ bgYellow: (s: string | number) => string;
36
+ bgBlue: (s: string | number) => string;
37
+ bgMagenta: (s: string | number) => string;
38
+ bgCyan: (s: string | number) => string;
39
+ bgWhite: (s: string | number) => string;
24
40
  grey: (s: string | number) => string;
25
41
  };
26
42
  export default colors;
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,KAAK,MAAmB,MAAM,WAA4C,CAAC;AACxF,eAAO,MAAM,IAAI,MAfY,MAAM,GAAG,MAAM,WAeb,CAAC;AAGhC,eAAO,MAAM,KAAK,MAlBW,MAAM,GAAG,MAAM,WAkBX,CAAC;AAClC,eAAO,MAAM,GAAG,MAnBa,MAAM,GAAG,MAAM,WAmBb,CAAC;AAChC,eAAO,MAAM,KAAK,MApBW,MAAM,GAAG,MAAM,WAoBX,CAAC;AAClC,eAAO,MAAM,MAAM,MArBU,MAAM,GAAG,MAAM,WAqBV,CAAC;AACnC,eAAO,MAAM,IAAI,MAtBY,MAAM,GAAG,MAAM,WAsBZ,CAAC;AACjC,eAAO,MAAM,OAAO,MAvBS,MAAM,GAAG,MAAM,WAuBT,CAAC;AACpC,eAAO,MAAM,IAAI,MAxBY,MAAM,GAAG,MAAM,WAwBZ,CAAC;AACjC,eAAO,MAAM,KAAK,MAzBW,MAAM,GAAG,MAAM,WAyBX,CAAC;AAClC,eAAO,MAAM,IAAI,MA1BY,MAAM,GAAG,MAAM,WA0BZ,CAAC;AAGjC,QAAA,MAAM,MAAM;eAfyB,MAAM;cAdd,MAAM,GAAG,MAAM;eAAf,MAAM,GAAG,MAAM;aAAf,MAAM,GAAG,MAAM;eAAf,MAAM,GAAG,MAAM;gBAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;iBAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;eAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;CA2C3C,CAAC;AAEF,eAAe,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CS,MAAM,GAAG,MAAM,WAoCT,CAAC;AAGpC,QAAA,MAAM,MAAM;eAzByB,MAAM;cAdd,MAAM,GAAG,MAAM;eAAf,MAAM,GAAG,MAAM;aAAf,MAAM,GAAG,MAAM;eAAf,MAAM,GAAG,MAAM;gBAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;iBAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;eAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;iBAAf,MAAM,GAAG,MAAM;eAAf,MAAM,GAAG,MAAM;iBAAf,MAAM,GAAG,MAAM;kBAAf,MAAM,GAAG,MAAM;gBAAf,MAAM,GAAG,MAAM;mBAAf,MAAM,GAAG,MAAM;gBAAf,MAAM,GAAG,MAAM;iBAAf,MAAM,GAAG,MAAM;cAAf,MAAM,GAAG,MAAM;CA8D3C,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -33,6 +33,14 @@ export const magenta = code(35, 39);
33
33
  export const cyan = code(36, 39);
34
34
  export const white = code(37, 39);
35
35
  export const gray = code(90, 39);
36
+ export const bgBlack = code(40, 49);
37
+ export const bgRed = code(41, 49);
38
+ export const bgGreen = code(42, 49);
39
+ export const bgYellow = code(43, 49);
40
+ export const bgBlue = code(44, 49);
41
+ export const bgMagenta = code(45, 49);
42
+ export const bgCyan = code(46, 49);
43
+ export const bgWhite = code(47, 49);
36
44
  const colors = {
37
45
  reset,
38
46
  bold,
@@ -45,6 +53,14 @@ const colors = {
45
53
  cyan,
46
54
  white,
47
55
  gray,
56
+ bgBlack,
57
+ bgRed,
58
+ bgGreen,
59
+ bgYellow,
60
+ bgBlue,
61
+ bgMagenta,
62
+ bgCyan,
63
+ bgWhite,
48
64
  grey: gray,
49
65
  };
50
66
  export default colors;