@noyrax/5d-database-plugin 0.1.14-beta.4 → 0.1.14-beta.6
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/out/api/adr-api.d.ts.map +1 -1
- package/out/api/adr-api.js +12 -7
- package/out/api/adr-api.js.map +1 -1
- package/out/api/bootstrap-api.d.ts +3 -0
- package/out/api/bootstrap-api.d.ts.map +1 -1
- package/out/api/bootstrap-api.js +11 -1
- package/out/api/bootstrap-api.js.map +1 -1
- package/out/api/context-builder.d.ts.map +1 -1
- package/out/api/context-builder.js +21 -5
- package/out/api/context-builder.js.map +1 -1
- package/out/api/evidence-grader.d.ts +83 -0
- package/out/api/evidence-grader.d.ts.map +1 -0
- package/out/api/evidence-grader.js +161 -0
- package/out/api/evidence-grader.js.map +1 -0
- package/out/api/index.d.ts +5 -0
- package/out/api/index.d.ts.map +1 -1
- package/out/api/index.js +11 -1
- package/out/api/index.js.map +1 -1
- package/out/api/learning-path-api.d.ts +3 -0
- package/out/api/learning-path-api.d.ts.map +1 -1
- package/out/api/learning-path-api.js +15 -2
- package/out/api/learning-path-api.js.map +1 -1
- package/out/api/self-explanation-api.d.ts +4 -0
- package/out/api/self-explanation-api.d.ts.map +1 -1
- package/out/api/self-explanation-api.js +60 -2
- package/out/api/self-explanation-api.js.map +1 -1
- package/out/api/semantic-search-api.d.ts +3 -0
- package/out/api/semantic-search-api.d.ts.map +1 -1
- package/out/api/semantic-search-api.js +39 -2
- package/out/api/semantic-search-api.js.map +1 -1
- package/out/api/source-access-contract-api.d.ts +60 -0
- package/out/api/source-access-contract-api.d.ts.map +1 -0
- package/out/api/source-access-contract-api.js +192 -0
- package/out/api/source-access-contract-api.js.map +1 -0
- package/out/api/source-snippet-api.d.ts +58 -0
- package/out/api/source-snippet-api.d.ts.map +1 -0
- package/out/api/source-snippet-api.js +185 -0
- package/out/api/source-snippet-api.js.map +1 -0
- package/out/api/vector-backend-status-api.d.ts +68 -0
- package/out/api/vector-backend-status-api.d.ts.map +1 -0
- package/out/api/vector-backend-status-api.js +241 -0
- package/out/api/vector-backend-status-api.js.map +1 -0
- package/out/cli/debug-plugin-id.d.ts +9 -0
- package/out/cli/debug-plugin-id.d.ts.map +1 -0
- package/out/cli/debug-plugin-id.js +188 -0
- package/out/cli/debug-plugin-id.js.map +1 -0
- package/out/cli/tool-cli.js +1 -1
- package/out/cli/tool-cli.js.map +1 -1
- package/out/ingestors/module-ingestor.d.ts.map +1 -1
- package/out/ingestors/module-ingestor.js +17 -0
- package/out/ingestors/module-ingestor.js.map +1 -1
- package/out/ingestors/symbol-ingestor.d.ts.map +1 -1
- package/out/ingestors/symbol-ingestor.js +6 -0
- package/out/ingestors/symbol-ingestor.js.map +1 -1
- package/out/mcp/tools/gap-analysis.d.ts +13 -1
- package/out/mcp/tools/gap-analysis.d.ts.map +1 -1
- package/out/mcp/tools/gap-analysis.js +153 -26
- package/out/mcp/tools/gap-analysis.js.map +1 -1
- package/out/mcp/tools/learning-path.d.ts.map +1 -1
- package/out/mcp/tools/learning-path.js +19 -5
- package/out/mcp/tools/learning-path.js.map +1 -1
- package/out/mcp/tools/semantic-discovery.d.ts.map +1 -1
- package/out/mcp/tools/semantic-discovery.js +44 -4
- package/out/mcp/tools/semantic-discovery.js.map +1 -1
- package/out/mcp/tools/source-access-contract.d.ts +26 -0
- package/out/mcp/tools/source-access-contract.d.ts.map +1 -0
- package/out/mcp/tools/source-access-contract.js +43 -0
- package/out/mcp/tools/source-access-contract.js.map +1 -0
- package/out/mcp/tools/source-snippet.d.ts +71 -0
- package/out/mcp/tools/source-snippet.d.ts.map +1 -0
- package/out/mcp/tools/source-snippet.js +82 -0
- package/out/mcp/tools/source-snippet.js.map +1 -0
- package/out/models/action-hint.d.ts +36 -0
- package/out/models/action-hint.d.ts.map +1 -0
- package/out/models/action-hint.js +38 -0
- package/out/models/action-hint.js.map +1 -0
- package/out/models/evidence.d.ts +68 -0
- package/out/models/evidence.d.ts.map +1 -0
- package/out/models/evidence.js +91 -0
- package/out/models/evidence.js.map +1 -0
- package/out/models/module.d.ts +2 -0
- package/out/models/module.d.ts.map +1 -1
- package/out/models/reason-codes.d.ts +50 -0
- package/out/models/reason-codes.d.ts.map +1 -0
- package/out/models/reason-codes.js +80 -0
- package/out/models/reason-codes.js.map +1 -0
- package/out/models/symbol.d.ts +6 -0
- package/out/models/symbol.d.ts.map +1 -1
- package/out/repositories/module-repository.d.ts.map +1 -1
- package/out/repositories/module-repository.js +9 -3
- package/out/repositories/module-repository.js.map +1 -1
- package/out/repositories/symbol-repository.d.ts.map +1 -1
- package/out/repositories/symbol-repository.js +21 -3
- package/out/repositories/symbol-repository.js.map +1 -1
- package/package.json +3 -3
- package/schemas/sqlite/007_add_source_code_spans.sql +19 -0
- package/schemas/sqlite/008_add_source_access_config.sql +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-access-contract-api.js","sourceRoot":"","sources":["../../src/api/source-access-contract-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAAyB;AAGzB,yDAAoD;AACpD,iDAAkE;AAClE,iDAA0D;AAqC1D;;;GAGG;AACH,MAAa,uBAAuB;IAGhC,YAAY,SAAyB;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,aAAsB;QACpC,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEjD,qBAAqB;QACrB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;;SAEnC,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,4CAA4C;YAC5C,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACnE,CAAC;QAED,M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AM,EAAE,EAAE;YACnC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;gBAC7B,IAAI,GAAG,EAAE,CAAC;oBACN,MAAM,CAAC,GAAG,CAAC,CAAC;gBAChB,CAAC;qBAAM,CAAC;oBACJ,OAAO,CAAC,GAAG,CAAC,CAAC;gBACjB,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,OAAO,CAAC,EAAoB,EAAE,GAAW,EAAE,SAAgB,EAAE;QACvE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;gBACxB,IAAI,GAAG,EAAE,CAAC;oBACN,MAAM,CAAC,GAAG,CAAC,CAAC;gBAChB,CAAC;qBAAM,CAAC;oBACJ,OAAO,EAAE,CAAC;gBACd,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAxKD,0DAwKC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MultiDbManager } from '../core/multi-db-manager';
|
|
2
|
+
import { ReasonCode } from '../models/reason-codes';
|
|
3
|
+
import { Evidence } from '../models/evidence';
|
|
4
|
+
/**
|
|
5
|
+
* Source code snippet with metadata.
|
|
6
|
+
*/
|
|
7
|
+
export interface SourceSnippet {
|
|
8
|
+
file_path: string;
|
|
9
|
+
start_line: number;
|
|
10
|
+
end_line: number;
|
|
11
|
+
core_start_line: number;
|
|
12
|
+
core_end_line: number;
|
|
13
|
+
snippet: string;
|
|
14
|
+
content_hash: string;
|
|
15
|
+
byte_size: number;
|
|
16
|
+
evidence: Evidence;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Source snippet error.
|
|
20
|
+
*/
|
|
21
|
+
export interface SourceSnippetError {
|
|
22
|
+
error: 'SOURCE_UNAVAILABLE' | 'SYMBOL_NOT_FOUND' | 'SNIPPET_TOO_LARGE' | 'FILE_NOT_FOUND' | 'HASH_MISMATCH';
|
|
23
|
+
reason_codes?: ReasonCode[];
|
|
24
|
+
symbol_id?: string;
|
|
25
|
+
requested_lines?: number;
|
|
26
|
+
max_allowed?: number;
|
|
27
|
+
file_path?: string;
|
|
28
|
+
resolved_path?: string;
|
|
29
|
+
expected_hash?: string;
|
|
30
|
+
computed_hash?: string;
|
|
31
|
+
evidence: Evidence;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* API for fetching source code snippets.
|
|
35
|
+
* Provides gated access with size limits and hash verification.
|
|
36
|
+
*/
|
|
37
|
+
export declare class SourceSnippetApi {
|
|
38
|
+
private contractApi;
|
|
39
|
+
private dbManager;
|
|
40
|
+
constructor(dbManager: MultiDbManager);
|
|
41
|
+
/**
|
|
42
|
+
* Fetch source code snippet by symbol ID or file path + range.
|
|
43
|
+
* Gated access with size limits and hash verification.
|
|
44
|
+
*/
|
|
45
|
+
fetchSnippet(args: {
|
|
46
|
+
symbol_id?: string;
|
|
47
|
+
file_path?: string;
|
|
48
|
+
start_line?: number;
|
|
49
|
+
end_line?: number;
|
|
50
|
+
content_hash?: string;
|
|
51
|
+
include_context?: boolean;
|
|
52
|
+
context_lines?: number;
|
|
53
|
+
verify_hash?: boolean;
|
|
54
|
+
pluginId: string;
|
|
55
|
+
workspaceRoot?: string;
|
|
56
|
+
}): Promise<SourceSnippet | SourceSnippetError>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=source-snippet-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-snippet-api.d.ts","sourceRoot":"","sources":["../../src/api/source-snippet-api.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,UAAU,EA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OAAO,CAAC;QAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B,GAAG,OAAO,CAAC,aAAa,GAAG,kBAAkB,CAAC;CAiJlD"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SourceSnippetApi = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const crypto = __importStar(require("crypto"));
|
|
40
|
+
const source_access_contract_api_1 = require("./source-access-contract-api");
|
|
41
|
+
const symbol_repository_1 = require("../repositories/symbol-repository");
|
|
42
|
+
const evidence_1 = require("../models/evidence");
|
|
43
|
+
const evidence_2 = require("../models/evidence");
|
|
44
|
+
/**
|
|
45
|
+
* API for fetching source code snippets.
|
|
46
|
+
* Provides gated access with size limits and hash verification.
|
|
47
|
+
*/
|
|
48
|
+
class SourceSnippetApi {
|
|
49
|
+
constructor(dbManager) {
|
|
50
|
+
this.dbManager = dbManager;
|
|
51
|
+
this.contractApi = new source_access_contract_api_1.SourceAccessContractApi(dbManager);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Fetch source code snippet by symbol ID or file path + range.
|
|
55
|
+
* Gated access with size limits and hash verification.
|
|
56
|
+
*/
|
|
57
|
+
async fetchSnippet(args) {
|
|
58
|
+
// 1. Get source access contract
|
|
59
|
+
const contract = await this.contractApi.getContract(args.workspaceRoot);
|
|
60
|
+
if (contract.status === 'UNAVAILABLE') {
|
|
61
|
+
return {
|
|
62
|
+
error: 'SOURCE_UNAVAILABLE',
|
|
63
|
+
reason_codes: contract.reason_codes,
|
|
64
|
+
evidence: (0, evidence_1.createFactEvidence)([
|
|
65
|
+
(0, evidence_2.createEvidenceSource)('DB_QUERY', undefined, undefined, undefined, {
|
|
66
|
+
table: 'source_access_config',
|
|
67
|
+
status: contract.status
|
|
68
|
+
})
|
|
69
|
+
], `Source code unavailable: ${contract.reason_codes?.map(code => code.toString()).join(', ')}`)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// 2. Resolve symbol to span (if symbol_id provided)
|
|
73
|
+
let filePath = args.file_path;
|
|
74
|
+
let startLine = args.start_line;
|
|
75
|
+
let endLine = args.end_line;
|
|
76
|
+
if (args.symbol_id) {
|
|
77
|
+
const db = await this.dbManager.getDatabase('Y');
|
|
78
|
+
const repository = new symbol_repository_1.SymbolRepository(db);
|
|
79
|
+
// Try to find symbol by symbol_id
|
|
80
|
+
const symbol = await repository.getBySymbolId(args.symbol_id, args.pluginId);
|
|
81
|
+
if (!symbol) {
|
|
82
|
+
return {
|
|
83
|
+
error: 'SYMBOL_NOT_FOUND',
|
|
84
|
+
symbol_id: args.symbol_id,
|
|
85
|
+
evidence: (0, evidence_1.createFactEvidence)([
|
|
86
|
+
(0, evidence_2.createEvidenceSource)('DB_QUERY', args.symbol_id, undefined, undefined, {
|
|
87
|
+
table: 'symbols',
|
|
88
|
+
plugin_id: args.pluginId
|
|
89
|
+
})
|
|
90
|
+
], `Symbol ${args.symbol_id} not found in database`)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (!symbol.start_line || !symbol.end_line) {
|
|
94
|
+
return {
|
|
95
|
+
error: 'SYMBOL_NOT_FOUND',
|
|
96
|
+
symbol_id: args.symbol_id,
|
|
97
|
+
evidence: (0, evidence_1.createFactEvidence)([
|
|
98
|
+
(0, evidence_2.createEvidenceSource)('DB_QUERY', args.symbol_id, symbol.path, undefined, {
|
|
99
|
+
table: 'symbols',
|
|
100
|
+
note: 'Symbol found but missing span information'
|
|
101
|
+
})
|
|
102
|
+
], `Symbol ${args.symbol_id} found but missing span information (start_line/end_line)`)
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
filePath = symbol.path;
|
|
106
|
+
startLine = symbol.start_line;
|
|
107
|
+
endLine = symbol.end_line;
|
|
108
|
+
}
|
|
109
|
+
if (!filePath || !startLine || !endLine) {
|
|
110
|
+
throw new Error('Either symbol_id OR (file_path + start_line + end_line) must be provided');
|
|
111
|
+
}
|
|
112
|
+
// 3. Size check (gating!)
|
|
113
|
+
const requestedLines = endLine - startLine + 1;
|
|
114
|
+
const contextLines = args.include_context ? (args.context_lines || 5) : 0;
|
|
115
|
+
const totalLines = requestedLines + (contextLines * 2);
|
|
116
|
+
if (contract.constraints && totalLines > contract.constraints.max_lines_per_request) {
|
|
117
|
+
return {
|
|
118
|
+
error: 'SNIPPET_TOO_LARGE',
|
|
119
|
+
requested_lines: totalLines,
|
|
120
|
+
max_allowed: contract.constraints.max_lines_per_request,
|
|
121
|
+
evidence: (0, evidence_1.createFactEvidence)([
|
|
122
|
+
(0, evidence_2.createEvidenceSource)('DB_QUERY', undefined, undefined, undefined, {
|
|
123
|
+
table: 'source_access_config',
|
|
124
|
+
constraint: 'max_lines_per_request'
|
|
125
|
+
})
|
|
126
|
+
], `Requested ${totalLines} lines exceeds limit of ${contract.constraints.max_lines_per_request}`)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
// 4. Fetch code from filesystem
|
|
130
|
+
const workspaceRoot = contract.workspace_root || args.workspaceRoot || process.cwd();
|
|
131
|
+
const fullPath = path.join(workspaceRoot, filePath);
|
|
132
|
+
if (!fs.existsSync(fullPath)) {
|
|
133
|
+
return {
|
|
134
|
+
error: 'FILE_NOT_FOUND',
|
|
135
|
+
file_path: filePath,
|
|
136
|
+
resolved_path: fullPath,
|
|
137
|
+
evidence: (0, evidence_1.createFactEvidence)([
|
|
138
|
+
(0, evidence_2.createEvidenceSource)('STATUS_CHECK', undefined, fullPath, undefined, {
|
|
139
|
+
check: 'file_exists'
|
|
140
|
+
})
|
|
141
|
+
], `File not found: ${fullPath}`)
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const fileContent = fs.readFileSync(fullPath, 'utf-8');
|
|
145
|
+
const lines = fileContent.split('\n');
|
|
146
|
+
// 5. Extract snippet with optional context
|
|
147
|
+
const actualStart = Math.max(1, startLine - contextLines);
|
|
148
|
+
const actualEnd = Math.min(lines.length, endLine + contextLines);
|
|
149
|
+
const snippet = lines.slice(actualStart - 1, actualEnd).join('\n');
|
|
150
|
+
// 6. Hash verification (if requested)
|
|
151
|
+
const computedHash = crypto.createHash('sha256').update(snippet).digest('hex').substring(0, 16);
|
|
152
|
+
if (args.verify_hash && args.content_hash && computedHash !== args.content_hash) {
|
|
153
|
+
return {
|
|
154
|
+
error: 'HASH_MISMATCH',
|
|
155
|
+
expected_hash: args.content_hash,
|
|
156
|
+
computed_hash: computedHash,
|
|
157
|
+
evidence: (0, evidence_1.createFactEvidence)([
|
|
158
|
+
(0, evidence_2.createEvidenceSource)('STATUS_CHECK', undefined, fullPath, computedHash, {
|
|
159
|
+
check: 'hash_verification',
|
|
160
|
+
expected: args.content_hash
|
|
161
|
+
})
|
|
162
|
+
], `Hash mismatch: expected ${args.content_hash}, got ${computedHash}. Code may have changed since scan.`)
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
// 7. Return snippet with provenance
|
|
166
|
+
return {
|
|
167
|
+
file_path: filePath,
|
|
168
|
+
start_line: actualStart,
|
|
169
|
+
end_line: actualEnd,
|
|
170
|
+
core_start_line: startLine,
|
|
171
|
+
core_end_line: endLine,
|
|
172
|
+
snippet: snippet,
|
|
173
|
+
content_hash: computedHash,
|
|
174
|
+
byte_size: Buffer.byteLength(snippet, 'utf-8'),
|
|
175
|
+
evidence: (0, evidence_1.createFactEvidence)([
|
|
176
|
+
(0, evidence_2.createEvidenceSource)('STATUS_CHECK', undefined, fullPath, computedHash, {
|
|
177
|
+
check: 'filesystem_read',
|
|
178
|
+
lines: `${actualStart}-${actualEnd}`
|
|
179
|
+
})
|
|
180
|
+
], `Code snippet extracted from ${filePath} lines ${startLine}-${endLine} with ${contextLines} context lines`)
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.SourceSnippetApi = SourceSnippetApi;
|
|
185
|
+
//# sourceMappingURL=source-snippet-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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IAAA,+BAAoB,EAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE;wBACpE,KAAK,EAAE,mBAAmB;wBAC1B,QAAQ,EAAE,IAAI,CAAC,YAAY;qBAC9B,CAAC;iBACL,EAAE,2BAA2B,IAAI,CAAC,YAAY,SAAS,YAAY,qCAAqC,CAAC;aAC7G,CAAC;QACN,CAAC;QAED,oCAAoC;QACpC,OAAO;YACH,SAAS,EAAE,QAAQ;YACnB,UAAU,EAAE,WAAW;YACvB,QAAQ,EAAE,SAAS;YACnB,eAAe,EAAE,SAAS;YAC1B,aAAa,EAAE,OAAO;YACtB,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC;YAC9C,QAAQ,EAAE,IAAA,6BAAkB,EAAC;gBACzB,IAAA,+BAAoB,EAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE;oBACpE,KAAK,EAAE,iBAAiB;oBACxB,KAAK,EAAE,GAAG,WAAW,IAAI,SAAS,EAAE;iBACvC,CAAC;aACL,EAAE,+BAA+B,QAAQ,UAAU,SAAS,IAAI,OAAO,SAAS,YAAY,gBAAgB,CAAC;SACjH,CAAC;IACN,CAAC;CACJ;AAzKD,4CAyKC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { MultiDbManager } from '../core/multi-db-manager';
|
|
2
|
+
import { ReasonCode } from '../models/reason-codes';
|
|
3
|
+
import { ActionHint } from '../models/action-hint';
|
|
4
|
+
/**
|
|
5
|
+
* Vector backend status information.
|
|
6
|
+
*/
|
|
7
|
+
export interface VectorBackendStatus {
|
|
8
|
+
/** Type of backend (chromadb, vss, or fallback) */
|
|
9
|
+
backend: 'chromadb' | 'vss' | 'fallback' | 'none';
|
|
10
|
+
/** Mode (expected backend for this platform) */
|
|
11
|
+
mode: 'chromadb' | 'vss' | 'fallback';
|
|
12
|
+
/** Whether the expected backend is available */
|
|
13
|
+
expected_available: boolean;
|
|
14
|
+
/** Whether the backend is reachable */
|
|
15
|
+
reachable: boolean;
|
|
16
|
+
/** Whether fallback is active */
|
|
17
|
+
fallback: boolean;
|
|
18
|
+
/** Reason code for the current status */
|
|
19
|
+
reason_code: ReasonCode;
|
|
20
|
+
/** Human-readable description */
|
|
21
|
+
description: string;
|
|
22
|
+
/** Action hints for resolving issues (if any) */
|
|
23
|
+
action_hints?: ActionHint[];
|
|
24
|
+
/** Platform information */
|
|
25
|
+
platform: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Vector backend healthcheck result.
|
|
29
|
+
*/
|
|
30
|
+
export interface VectorBackendHealthcheck {
|
|
31
|
+
/** Whether the healthcheck passed */
|
|
32
|
+
healthy: boolean;
|
|
33
|
+
/** Reason code */
|
|
34
|
+
reason_code: ReasonCode;
|
|
35
|
+
/** Latency in milliseconds (if measurable) */
|
|
36
|
+
latency_ms?: number;
|
|
37
|
+
/** Error code (if any) */
|
|
38
|
+
error_code?: string;
|
|
39
|
+
/** Human-readable description */
|
|
40
|
+
description: string;
|
|
41
|
+
/** Action hints for resolving issues (if any) */
|
|
42
|
+
action_hints?: ActionHint[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* API for checking vector backend status and health.
|
|
46
|
+
*/
|
|
47
|
+
export declare class VectorBackendStatusApi {
|
|
48
|
+
private dbManager;
|
|
49
|
+
constructor(dbManager: MultiDbManager);
|
|
50
|
+
/**
|
|
51
|
+
* Gets the current vector backend status.
|
|
52
|
+
*
|
|
53
|
+
* @returns Promise that resolves to vector backend status
|
|
54
|
+
*/
|
|
55
|
+
getVectorBackendStatus(): Promise<VectorBackendStatus>;
|
|
56
|
+
/**
|
|
57
|
+
* Performs a healthcheck on the vector backend.
|
|
58
|
+
* Attempts to perform a simple query to verify the backend is responsive.
|
|
59
|
+
*
|
|
60
|
+
* @returns Promise that resolves to healthcheck result
|
|
61
|
+
*/
|
|
62
|
+
healthcheckVectorBackend(): Promise<VectorBackendHealthcheck>;
|
|
63
|
+
/**
|
|
64
|
+
* Gets action hints for a specific reason code.
|
|
65
|
+
*/
|
|
66
|
+
private getActionHintsForReason;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=vector-backend-status-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-backend-status-api.d.ts","sourceRoot":"","sources":["../../src/api/vector-backend-status-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D,OAAO,EAAE,UAAU,EAA4B,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAoB,MAAM,uBAAuB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,mDAAmD;IACnD,OAAO,EAAE,UAAU,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC;IAElD,gDAAgD;IAChD,IAAI,EAAE,UAAU,GAAG,KAAK,GAAG,UAAU,CAAC;IAEtC,gDAAgD;IAChD,kBAAkB,EAAE,OAAO,CAAC;IAE5B,uCAAuC;IACvC,SAAS,EAAE,OAAO,CAAC;IAEnB,iCAAiC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAElB,yCAAyC;IACzC,WAAW,EAAE,UAAU,CAAC;IAExB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IAEpB,iDAAiD;IACjD,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAE5B,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IAEjB,kBAAkB;IAClB,WAAW,EAAE,UAAU,CAAC;IAExB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IAEpB,iDAAiD;IACjD,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,qBAAa,sBAAsB;IAC/B,OAAO,CAAC,SAAS,CAAiB;gBAEtB,SAAS,EAAE,cAAc;IAIrC;;;;OAIG;IACG,sBAAsB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAuF5D;;;;;OAKG;IACG,wBAAwB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAuEnE;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAoElC"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.VectorBackendStatusApi = void 0;
|
|
37
|
+
const os = __importStar(require("os"));
|
|
38
|
+
const chromadb_vector_database_1 = require("../core/chromadb-vector-database");
|
|
39
|
+
const vss_vector_database_1 = require("../core/vss-vector-database");
|
|
40
|
+
const reason_codes_1 = require("../models/reason-codes");
|
|
41
|
+
const action_hint_1 = require("../models/action-hint");
|
|
42
|
+
/**
|
|
43
|
+
* API for checking vector backend status and health.
|
|
44
|
+
*/
|
|
45
|
+
class VectorBackendStatusApi {
|
|
46
|
+
constructor(dbManager) {
|
|
47
|
+
this.dbManager = dbManager;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets the current vector backend status.
|
|
51
|
+
*
|
|
52
|
+
* @returns Promise that resolves to vector backend status
|
|
53
|
+
*/
|
|
54
|
+
async getVectorBackendStatus() {
|
|
55
|
+
const platform = os.platform();
|
|
56
|
+
const arch = os.arch();
|
|
57
|
+
// Determine expected mode based on platform
|
|
58
|
+
let expectedMode = 'fallback';
|
|
59
|
+
if (platform === 'win32') {
|
|
60
|
+
expectedMode = 'chromadb';
|
|
61
|
+
}
|
|
62
|
+
else if (platform === 'darwin' || platform === 'linux') {
|
|
63
|
+
expectedMode = 'vss';
|
|
64
|
+
}
|
|
65
|
+
// Get vector database instance
|
|
66
|
+
const vectorDb = this.dbManager.getVectorDatabase();
|
|
67
|
+
if (!vectorDb) {
|
|
68
|
+
// Vector database not initialized
|
|
69
|
+
return {
|
|
70
|
+
backend: 'none',
|
|
71
|
+
mode: expectedMode,
|
|
72
|
+
expected_available: false,
|
|
73
|
+
reachable: false,
|
|
74
|
+
fallback: true,
|
|
75
|
+
reason_code: reason_codes_1.ReasonCode.NOT_INSTALLED,
|
|
76
|
+
description: 'Vector database not initialized. V-dimension database may not be opened yet.',
|
|
77
|
+
platform: `${platform}/${arch}`,
|
|
78
|
+
action_hints: this.getActionHintsForReason(reason_codes_1.ReasonCode.NOT_INSTALLED, expectedMode, platform)
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const isAvailable = vectorDb.isAvailable();
|
|
82
|
+
const isChromaDb = vectorDb instanceof chromadb_vector_database_1.ChromaDbVectorDatabase;
|
|
83
|
+
const isVss = vectorDb instanceof vss_vector_database_1.VssVectorDatabase;
|
|
84
|
+
// Determine actual backend
|
|
85
|
+
let actualBackend = 'none';
|
|
86
|
+
if (isChromaDb) {
|
|
87
|
+
actualBackend = 'chromadb';
|
|
88
|
+
}
|
|
89
|
+
else if (isVss) {
|
|
90
|
+
actualBackend = 'vss';
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
actualBackend = 'fallback';
|
|
94
|
+
}
|
|
95
|
+
// Determine if fallback is active
|
|
96
|
+
const isFallback = (expectedMode === 'chromadb' && actualBackend !== 'chromadb') ||
|
|
97
|
+
(expectedMode === 'vss' && actualBackend !== 'vss');
|
|
98
|
+
// Determine reason code
|
|
99
|
+
let reasonCode = reason_codes_1.ReasonCode.OK;
|
|
100
|
+
let description = 'Vector backend is available and reachable.';
|
|
101
|
+
if (!isAvailable) {
|
|
102
|
+
if (expectedMode === 'chromadb' && actualBackend === 'chromadb') {
|
|
103
|
+
reasonCode = reason_codes_1.ReasonCode.VECTOR_BACKEND_UNREACHABLE;
|
|
104
|
+
description = 'ChromaDB backend is not reachable. Check if ChromaDB server is running on localhost:8000.';
|
|
105
|
+
}
|
|
106
|
+
else if (expectedMode === 'vss' && actualBackend === 'vss') {
|
|
107
|
+
reasonCode = reason_codes_1.ReasonCode.DEPENDENCY_MISSING;
|
|
108
|
+
description = 'VSS extension is not available. SQLite VSS extension may not be installed.';
|
|
109
|
+
}
|
|
110
|
+
else if (isFallback) {
|
|
111
|
+
reasonCode = reason_codes_1.ReasonCode.VECTOR_BACKEND_UNREACHABLE;
|
|
112
|
+
description = 'Expected vector backend is not available, using fallback.';
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
reasonCode = reason_codes_1.ReasonCode.NOT_INSTALLED;
|
|
116
|
+
description = 'Vector backend is not available.';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const status = {
|
|
120
|
+
backend: actualBackend,
|
|
121
|
+
mode: expectedMode,
|
|
122
|
+
expected_available: isAvailable && !isFallback,
|
|
123
|
+
reachable: isAvailable,
|
|
124
|
+
fallback: isFallback,
|
|
125
|
+
reason_code: reasonCode,
|
|
126
|
+
description,
|
|
127
|
+
platform: `${platform}/${arch}`
|
|
128
|
+
};
|
|
129
|
+
// Add action hints if there are issues
|
|
130
|
+
if (reasonCode !== reason_codes_1.ReasonCode.OK) {
|
|
131
|
+
status.action_hints = this.getActionHintsForReason(reasonCode, expectedMode, platform);
|
|
132
|
+
}
|
|
133
|
+
return status;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Performs a healthcheck on the vector backend.
|
|
137
|
+
* Attempts to perform a simple query to verify the backend is responsive.
|
|
138
|
+
*
|
|
139
|
+
* @returns Promise that resolves to healthcheck result
|
|
140
|
+
*/
|
|
141
|
+
async healthcheckVectorBackend() {
|
|
142
|
+
const startTime = Date.now();
|
|
143
|
+
const vectorDb = this.dbManager.getVectorDatabase();
|
|
144
|
+
if (!vectorDb) {
|
|
145
|
+
return {
|
|
146
|
+
healthy: false,
|
|
147
|
+
reason_code: reason_codes_1.ReasonCode.NOT_INSTALLED,
|
|
148
|
+
description: 'Vector database not initialized.',
|
|
149
|
+
action_hints: this.getActionHintsForReason(reason_codes_1.ReasonCode.NOT_INSTALLED, 'fallback', os.platform())
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (!vectorDb.isAvailable()) {
|
|
153
|
+
const platform = os.platform();
|
|
154
|
+
const expectedMode = platform === 'win32' ? 'chromadb' : (platform === 'darwin' || platform === 'linux' ? 'vss' : 'fallback');
|
|
155
|
+
return {
|
|
156
|
+
healthy: false,
|
|
157
|
+
reason_code: reason_codes_1.ReasonCode.VECTOR_BACKEND_UNREACHABLE,
|
|
158
|
+
description: 'Vector backend is not available.',
|
|
159
|
+
action_hints: this.getActionHintsForReason(reason_codes_1.ReasonCode.VECTOR_BACKEND_UNREACHABLE, expectedMode, platform)
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
// Try to perform a simple search query to verify backend is responsive
|
|
163
|
+
try {
|
|
164
|
+
// Use a zero vector for testing (will return empty results, but tests connectivity)
|
|
165
|
+
const testVector = new Array(1536).fill(0);
|
|
166
|
+
await vectorDb.search(testVector, 1);
|
|
167
|
+
const latencyMs = Date.now() - startTime;
|
|
168
|
+
return {
|
|
169
|
+
healthy: true,
|
|
170
|
+
reason_code: reason_codes_1.ReasonCode.OK,
|
|
171
|
+
latency_ms: latencyMs,
|
|
172
|
+
description: 'Vector backend is healthy and responsive.'
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
const latencyMs = Date.now() - startTime;
|
|
177
|
+
const errorMsg = error?.message || String(error);
|
|
178
|
+
const platform = os.platform();
|
|
179
|
+
const expectedMode = platform === 'win32' ? 'chromadb' : (platform === 'darwin' || platform === 'linux' ? 'vss' : 'fallback');
|
|
180
|
+
// Determine error code
|
|
181
|
+
let errorCode = 'UNKNOWN_ERROR';
|
|
182
|
+
let reasonCode = reason_codes_1.ReasonCode.VECTOR_BACKEND_UNREACHABLE;
|
|
183
|
+
if (errorMsg.includes('ECONNREFUSED') || errorMsg.includes('connect')) {
|
|
184
|
+
errorCode = 'CONNECTION_REFUSED';
|
|
185
|
+
reasonCode = reason_codes_1.ReasonCode.VECTOR_BACKEND_UNREACHABLE;
|
|
186
|
+
}
|
|
187
|
+
else if (errorMsg.includes('timeout')) {
|
|
188
|
+
errorCode = 'TIMEOUT';
|
|
189
|
+
reasonCode = reason_codes_1.ReasonCode.TIMEOUT;
|
|
190
|
+
}
|
|
191
|
+
else if (errorMsg.includes('ENOTFOUND')) {
|
|
192
|
+
errorCode = 'DNS_ERROR';
|
|
193
|
+
reasonCode = reason_codes_1.ReasonCode.WRONG_PATH;
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
healthy: false,
|
|
197
|
+
reason_code: reasonCode,
|
|
198
|
+
latency_ms: latencyMs,
|
|
199
|
+
error_code: errorCode,
|
|
200
|
+
description: `Healthcheck failed: ${errorMsg}`,
|
|
201
|
+
action_hints: this.getActionHintsForReason(reasonCode, expectedMode, platform)
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Gets action hints for a specific reason code.
|
|
207
|
+
*/
|
|
208
|
+
getActionHintsForReason(reasonCode, expectedMode, platform) {
|
|
209
|
+
const hints = [];
|
|
210
|
+
if (reasonCode === reason_codes_1.ReasonCode.VECTOR_BACKEND_UNREACHABLE && expectedMode === 'chromadb') {
|
|
211
|
+
// ChromaDB is not reachable
|
|
212
|
+
if (platform === 'win32') {
|
|
213
|
+
hints.push((0, action_hint_1.createActionHint)('windows', 'chroma run --host localhost --port 8000', ['ChromaDB must be installed (pip install chromadb)', 'Python must be in PATH'], ['Open browser to http://localhost:8000/api/v1/heartbeat', 'Check if process is running: Get-Process | Where-Object {$_.ProcessName -like "*chroma*"}'], 'Start ChromaDB server on localhost:8000'));
|
|
214
|
+
}
|
|
215
|
+
else if (platform === 'linux') {
|
|
216
|
+
hints.push((0, action_hint_1.createActionHint)('linux', 'chroma run --host localhost --port 8000', ['ChromaDB must be installed (pip install chromadb)', 'Python must be in PATH'], ['curl http://localhost:8000/api/v1/heartbeat', 'Check if process is running: ps aux | grep chroma'], 'Start ChromaDB server on localhost:8000'));
|
|
217
|
+
}
|
|
218
|
+
else if (platform === 'darwin') {
|
|
219
|
+
hints.push((0, action_hint_1.createActionHint)('mac', 'chroma run --host localhost --port 8000', ['ChromaDB must be installed (pip install chromadb)', 'Python must be in PATH'], ['curl http://localhost:8000/api/v1/heartbeat', 'Check if process is running: ps aux | grep chroma'], 'Start ChromaDB server on localhost:8000'));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else if (reasonCode === reason_codes_1.ReasonCode.DEPENDENCY_MISSING && expectedMode === 'vss') {
|
|
223
|
+
// VSS extension is missing
|
|
224
|
+
if (platform === 'linux') {
|
|
225
|
+
hints.push((0, action_hint_1.createActionHint)('linux', 'sudo apt-get install sqlite3-vss', ['SQLite3 must be installed', 'Package manager access (apt-get)'], ['sqlite3 :memory: "SELECT load_extension(\'vss0\');"', 'Check if extension loads without errors'], 'Install SQLite VSS extension'));
|
|
226
|
+
}
|
|
227
|
+
else if (platform === 'darwin') {
|
|
228
|
+
hints.push((0, action_hint_1.createActionHint)('mac', 'brew install sqlite-vss', ['Homebrew must be installed', 'SQLite3 must be installed'], ['sqlite3 :memory: "SELECT load_extension(\'vss0\');"', 'Check if extension loads without errors'], 'Install SQLite VSS extension via Homebrew'));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else if (reasonCode === reason_codes_1.ReasonCode.NOT_INSTALLED) {
|
|
232
|
+
// Component is not installed
|
|
233
|
+
if (platform === 'win32') {
|
|
234
|
+
hints.push((0, action_hint_1.createActionHint)('windows', 'npm install chromadb', ['Node.js and npm must be installed'], ['node -e "require(\'chromadb\')"', 'Check if chromadb package is available'], 'Install chromadb npm package'));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return hints;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
exports.VectorBackendStatusApi = VectorBackendStatusApi;
|
|
241
|
+
//# sourceMappingURL=vector-backend-status-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|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,CAAC,IAAA,8BAAgB,EACvB,SAAS,EACT,sBAAsB,EACtB,CAAC,mCAAmC,CAAC,EACrC,CAAC,iCAAiC,EAAE,wCAAwC,CAAC,EAC7E,8BAA8B,CACjC,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAvPD,wDAuPC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Debug Tool: Plugin ID Verification
|
|
4
|
+
*
|
|
5
|
+
* Verifies plugin ID calculation and checks database for matching plugin IDs.
|
|
6
|
+
* Useful for debugging foreign system issues where plugin IDs don't match.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=debug-plugin-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-plugin-id.d.ts","sourceRoot":"","sources":["../../src/cli/debug-plugin-id.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
|