@schemyx/mcp 0.1.0 → 0.1.2
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 +79 -2
- package/dist/backend-client.d.ts +1 -17
- package/dist/backend-client.js +15 -91
- package/dist/backend-client.js.map +1 -1
- package/dist/client/backend-client.d.ts +17 -0
- package/dist/client/backend-client.js +97 -0
- package/dist/client/backend-client.js.map +1 -0
- package/dist/client/local-theme-source.d.ts +19 -0
- package/dist/client/local-theme-source.js +737 -0
- package/dist/client/local-theme-source.js.map +1 -0
- package/dist/client/mcp-client.d.ts +15 -0
- package/dist/client/mcp-client.js +46 -0
- package/dist/client/mcp-client.js.map +1 -0
- package/dist/codebase-scanner/backend.d.ts +12 -0
- package/dist/codebase-scanner/backend.js +814 -0
- package/dist/codebase-scanner/backend.js.map +1 -0
- package/dist/codebase-scanner/bundle.d.ts +315 -0
- package/dist/codebase-scanner/bundle.js +5195 -0
- package/dist/codebase-scanner/bundle.js.map +1 -0
- package/dist/codebase-scanner/constants.d.ts +26 -0
- package/dist/codebase-scanner/constants.js +231 -0
- package/dist/codebase-scanner/constants.js.map +1 -0
- package/dist/codebase-scanner/database.d.ts +8 -0
- package/dist/codebase-scanner/database.js +1252 -0
- package/dist/codebase-scanner/database.js.map +1 -0
- package/dist/codebase-scanner/extractors.d.ts +241 -0
- package/dist/codebase-scanner/extractors.js +3513 -0
- package/dist/codebase-scanner/extractors.js.map +1 -0
- package/dist/codebase-scanner/files.d.ts +16 -0
- package/dist/codebase-scanner/files.js +250 -0
- package/dist/codebase-scanner/files.js.map +1 -0
- package/dist/codebase-scanner/index.d.ts +217 -0
- package/dist/codebase-scanner/index.js +387 -0
- package/dist/codebase-scanner/index.js.map +1 -0
- package/dist/codebase-scanner/recipes.d.ts +74 -0
- package/dist/codebase-scanner/recipes.js +743 -0
- package/dist/codebase-scanner/recipes.js.map +1 -0
- package/dist/codebase-scanner/storage.d.ts +19 -0
- package/dist/codebase-scanner/storage.js +103 -0
- package/dist/codebase-scanner/storage.js.map +1 -0
- package/dist/codebase-scanner/types.d.ts +743 -0
- package/dist/codebase-scanner/types.js +3 -0
- package/dist/codebase-scanner/types.js.map +1 -0
- package/dist/codebase-scanner/utils.d.ts +37 -0
- package/dist/codebase-scanner/utils.js +259 -0
- package/dist/codebase-scanner/utils.js.map +1 -0
- package/dist/codebase-scanner.d.ts +1 -0
- package/dist/codebase-scanner.js +18 -0
- package/dist/codebase-scanner.js.map +1 -0
- package/dist/config.d.ts +1 -2
- package/dist/config.js +15 -37
- package/dist/config.js.map +1 -1
- package/dist/local-theme-source.d.ts +1 -0
- package/dist/local-theme-source.js +18 -0
- package/dist/local-theme-source.js.map +1 -0
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/mcp-client.d.ts +1 -0
- package/dist/mcp-client.js +18 -0
- package/dist/mcp-client.js.map +1 -0
- package/dist/prompts.d.ts +1 -7
- package/dist/prompts.js +15 -52
- package/dist/prompts.js.map +1 -1
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +163 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/prompts.d.ts +7 -0
- package/dist/server/prompts.js +55 -0
- package/dist/server/prompts.js.map +1 -0
- package/dist/server/tool-definitions.d.ts +22 -0
- package/dist/server/tool-definitions.js +531 -0
- package/dist/server/tool-definitions.js.map +1 -0
- package/dist/server.d.ts +3 -3
- package/dist/server.js +33 -0
- package/dist/server.js.map +1 -1
- package/dist/shared/config.d.ts +2 -0
- package/dist/shared/config.js +54 -0
- package/dist/shared/config.js.map +1 -0
- package/dist/shared/text.d.ts +14 -0
- package/dist/shared/text.js +33 -0
- package/dist/shared/text.js.map +1 -0
- package/dist/shared/types.d.ts +118 -0
- package/dist/shared/types.js +3 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/shared/uri.d.ts +6 -0
- package/dist/shared/uri.js +24 -0
- package/dist/shared/uri.js.map +1 -0
- package/dist/style-recipes.d.ts +1 -0
- package/dist/style-recipes.js +18 -0
- package/dist/style-recipes.js.map +1 -0
- package/dist/text.d.ts +1 -14
- package/dist/text.js +15 -30
- package/dist/text.js.map +1 -1
- package/dist/theme/style-recipes.d.ts +26 -0
- package/dist/theme/style-recipes.js +129 -0
- package/dist/theme/style-recipes.js.map +1 -0
- package/dist/tool-definitions.d.ts +1 -11
- package/dist/tool-definitions.js +15 -127
- package/dist/tool-definitions.js.map +1 -1
- package/dist/types.d.ts +1 -106
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -1
- package/dist/uri.d.ts +1 -6
- package/dist/uri.js +15 -21
- package/dist/uri.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type { ContextPackArgs, FreshnessArgs, GetArgs, GraphArgs, ListArgs, ReadFileArgs, RecipeRecord, ReviewArgs, ScanArgs, SearchArgs } from './types';
|
|
2
|
+
export declare function scanLocalCodebase(args?: ScanArgs): Promise<{
|
|
3
|
+
ok: boolean;
|
|
4
|
+
schema: string;
|
|
5
|
+
scanId: string;
|
|
6
|
+
localOnly: boolean;
|
|
7
|
+
privacy: string;
|
|
8
|
+
projectType: import("./types").CodebaseProjectType;
|
|
9
|
+
rootPath: string;
|
|
10
|
+
outputDir: string;
|
|
11
|
+
dryRun: boolean;
|
|
12
|
+
stats: {
|
|
13
|
+
files: number;
|
|
14
|
+
nodes: number;
|
|
15
|
+
edges: number;
|
|
16
|
+
recipes: number;
|
|
17
|
+
reviewItems: number;
|
|
18
|
+
};
|
|
19
|
+
detected: {
|
|
20
|
+
languages: string[];
|
|
21
|
+
frameworks: string[];
|
|
22
|
+
};
|
|
23
|
+
scannedFiles: number;
|
|
24
|
+
generatedEntries: number;
|
|
25
|
+
generatedFiles: string[];
|
|
26
|
+
generated: string[];
|
|
27
|
+
next: ({
|
|
28
|
+
tool: string;
|
|
29
|
+
arguments: {
|
|
30
|
+
query: string;
|
|
31
|
+
limit: number;
|
|
32
|
+
status?: undefined;
|
|
33
|
+
};
|
|
34
|
+
} | {
|
|
35
|
+
tool: string;
|
|
36
|
+
arguments: {
|
|
37
|
+
status: string;
|
|
38
|
+
limit: number;
|
|
39
|
+
query?: undefined;
|
|
40
|
+
};
|
|
41
|
+
})[];
|
|
42
|
+
}>;
|
|
43
|
+
export declare function listCodebaseRecipes(args?: ListArgs): Promise<{
|
|
44
|
+
matches: import("./types").SearchMatch[];
|
|
45
|
+
page: {
|
|
46
|
+
limit: number;
|
|
47
|
+
nextCursor: string | null;
|
|
48
|
+
};
|
|
49
|
+
next: {
|
|
50
|
+
tool: string;
|
|
51
|
+
arguments: {
|
|
52
|
+
key: string;
|
|
53
|
+
depth: import("./types").ContextDepth;
|
|
54
|
+
};
|
|
55
|
+
}[];
|
|
56
|
+
reviewItem?: string | undefined;
|
|
57
|
+
confidence: import("./types").Confidence | "none";
|
|
58
|
+
why: string[];
|
|
59
|
+
resolvedKey?: string | undefined;
|
|
60
|
+
ok: boolean;
|
|
61
|
+
schema: string;
|
|
62
|
+
scanId: string;
|
|
63
|
+
query: string | null;
|
|
64
|
+
status: string;
|
|
65
|
+
}>;
|
|
66
|
+
export declare function searchCodebase(args?: SearchArgs): Promise<{
|
|
67
|
+
matches: import("./types").SearchMatch[];
|
|
68
|
+
page: {
|
|
69
|
+
limit: number;
|
|
70
|
+
nextCursor: string | null;
|
|
71
|
+
};
|
|
72
|
+
next: {
|
|
73
|
+
tool: string;
|
|
74
|
+
arguments: {
|
|
75
|
+
key: string;
|
|
76
|
+
depth: import("./types").ContextDepth;
|
|
77
|
+
};
|
|
78
|
+
}[];
|
|
79
|
+
reviewItem?: string | undefined;
|
|
80
|
+
confidence: import("./types").Confidence | "none";
|
|
81
|
+
why: string[];
|
|
82
|
+
resolvedKey?: string | undefined;
|
|
83
|
+
ok: boolean;
|
|
84
|
+
schema: string;
|
|
85
|
+
scanId: string;
|
|
86
|
+
query: string | null;
|
|
87
|
+
status: string;
|
|
88
|
+
}>;
|
|
89
|
+
export declare function getCodebaseRecipe(args?: GetArgs): Promise<{
|
|
90
|
+
ok: boolean;
|
|
91
|
+
schema: string;
|
|
92
|
+
scanId: string;
|
|
93
|
+
key: string;
|
|
94
|
+
depth: import("./types").ContextDepth;
|
|
95
|
+
recipe: RecipeRecord;
|
|
96
|
+
related: {
|
|
97
|
+
dependencies: {
|
|
98
|
+
k: string;
|
|
99
|
+
s: string;
|
|
100
|
+
p: string | undefined;
|
|
101
|
+
status: import("./types").RecipeStatus;
|
|
102
|
+
confidence: import("./types").Confidence;
|
|
103
|
+
}[];
|
|
104
|
+
usedBy: {
|
|
105
|
+
k: string;
|
|
106
|
+
s: string;
|
|
107
|
+
p: string | undefined;
|
|
108
|
+
status: import("./types").RecipeStatus;
|
|
109
|
+
confidence: import("./types").Confidence;
|
|
110
|
+
}[];
|
|
111
|
+
};
|
|
112
|
+
}>;
|
|
113
|
+
export declare function getContextPack(args?: ContextPackArgs): Promise<{
|
|
114
|
+
ok: boolean;
|
|
115
|
+
schema: string;
|
|
116
|
+
scanId: string;
|
|
117
|
+
key: null;
|
|
118
|
+
status: string;
|
|
119
|
+
depth: import("./types").ContextDepth;
|
|
120
|
+
budget: {
|
|
121
|
+
targetTokens: number;
|
|
122
|
+
estimatedTokens: number;
|
|
123
|
+
sourceFilesIncluded: number;
|
|
124
|
+
};
|
|
125
|
+
items: never[];
|
|
126
|
+
review: never[];
|
|
127
|
+
} | {
|
|
128
|
+
ok: boolean;
|
|
129
|
+
schema: string;
|
|
130
|
+
scanId: string;
|
|
131
|
+
key: string;
|
|
132
|
+
status: string;
|
|
133
|
+
depth: import("./types").ContextDepth;
|
|
134
|
+
budget: {
|
|
135
|
+
targetTokens: number;
|
|
136
|
+
estimatedTokens: number;
|
|
137
|
+
sourceFilesIncluded: number;
|
|
138
|
+
};
|
|
139
|
+
items: {
|
|
140
|
+
k: string;
|
|
141
|
+
why: string;
|
|
142
|
+
recipe: RecipeRecord | {
|
|
143
|
+
k: string;
|
|
144
|
+
g: "file" | "component" | "hook" | "route" | "api" | "controller" | "service" | "module" | "database" | "model" | "style" | "dependency" | "cluster" | "rule";
|
|
145
|
+
s: string;
|
|
146
|
+
d: string[];
|
|
147
|
+
u: string[];
|
|
148
|
+
p: string | undefined;
|
|
149
|
+
status: import("./types").RecipeStatus;
|
|
150
|
+
confidence: import("./types").Confidence;
|
|
151
|
+
v: Record<string, unknown>;
|
|
152
|
+
} | {
|
|
153
|
+
k: string;
|
|
154
|
+
g: "file" | "component" | "hook" | "route" | "api" | "controller" | "service" | "module" | "database" | "model" | "style" | "dependency" | "cluster" | "rule";
|
|
155
|
+
s: string;
|
|
156
|
+
p: string | undefined;
|
|
157
|
+
status: import("./types").RecipeStatus;
|
|
158
|
+
confidence: import("./types").Confidence;
|
|
159
|
+
d?: undefined;
|
|
160
|
+
u?: undefined;
|
|
161
|
+
v?: undefined;
|
|
162
|
+
};
|
|
163
|
+
}[];
|
|
164
|
+
review: import("./types").ReviewItem[];
|
|
165
|
+
}>;
|
|
166
|
+
export declare function getCodebaseGraph(args?: GraphArgs): Promise<{
|
|
167
|
+
ok: boolean;
|
|
168
|
+
schema: string;
|
|
169
|
+
scanId: string;
|
|
170
|
+
nodes: import("./types").GraphNode[];
|
|
171
|
+
edges: import("./types").GraphEdge[];
|
|
172
|
+
page: {
|
|
173
|
+
limitNodes: number;
|
|
174
|
+
limitEdges: number;
|
|
175
|
+
nextCursor: string | null;
|
|
176
|
+
};
|
|
177
|
+
}>;
|
|
178
|
+
export declare function listReviewItems(args?: ReviewArgs): Promise<{
|
|
179
|
+
ok: boolean;
|
|
180
|
+
schema: string;
|
|
181
|
+
scanId: string;
|
|
182
|
+
items: import("./types").ReviewItem[];
|
|
183
|
+
page: {
|
|
184
|
+
limit: number;
|
|
185
|
+
nextCursor: string | null;
|
|
186
|
+
};
|
|
187
|
+
}>;
|
|
188
|
+
export declare function checkContextFreshness(args?: FreshnessArgs): Promise<{
|
|
189
|
+
ok: boolean;
|
|
190
|
+
schema: string;
|
|
191
|
+
scanId: string;
|
|
192
|
+
status: string;
|
|
193
|
+
stale: {
|
|
194
|
+
k: string;
|
|
195
|
+
path: string;
|
|
196
|
+
expectedHash?: string;
|
|
197
|
+
actualHash?: string;
|
|
198
|
+
}[];
|
|
199
|
+
missing: {
|
|
200
|
+
k: string;
|
|
201
|
+
path: string;
|
|
202
|
+
}[];
|
|
203
|
+
changed: {
|
|
204
|
+
k: string;
|
|
205
|
+
path: string;
|
|
206
|
+
}[];
|
|
207
|
+
}>;
|
|
208
|
+
export declare function readCodebaseFile(args?: ReadFileArgs): Promise<{
|
|
209
|
+
ok: boolean;
|
|
210
|
+
schema: string;
|
|
211
|
+
scanId: string;
|
|
212
|
+
localOnly: boolean;
|
|
213
|
+
path: string;
|
|
214
|
+
bytes: number;
|
|
215
|
+
truncated: boolean;
|
|
216
|
+
content: string;
|
|
217
|
+
}>;
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scanLocalCodebase = scanLocalCodebase;
|
|
4
|
+
exports.listCodebaseRecipes = listCodebaseRecipes;
|
|
5
|
+
exports.searchCodebase = searchCodebase;
|
|
6
|
+
exports.getCodebaseRecipe = getCodebaseRecipe;
|
|
7
|
+
exports.getContextPack = getContextPack;
|
|
8
|
+
exports.getCodebaseGraph = getCodebaseGraph;
|
|
9
|
+
exports.listReviewItems = listReviewItems;
|
|
10
|
+
exports.checkContextFreshness = checkContextFreshness;
|
|
11
|
+
exports.readCodebaseFile = readCodebaseFile;
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const path = require("node:path");
|
|
14
|
+
const bundle_1 = require("./bundle");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const files_1 = require("./files");
|
|
17
|
+
const recipes_1 = require("./recipes");
|
|
18
|
+
const storage_1 = require("./storage");
|
|
19
|
+
const utils_1 = require("./utils");
|
|
20
|
+
async function scanLocalCodebase(args = {}) {
|
|
21
|
+
const projectType = (0, utils_1.requiredProjectType)(args.projectType);
|
|
22
|
+
const rootPath = (0, utils_1.resolveRootPath)(args.rootPath);
|
|
23
|
+
const includePaths = (0, utils_1.stringArrayArg)(args.includePaths);
|
|
24
|
+
const excludePaths = (0, utils_1.stringArrayArg)(args.excludePaths);
|
|
25
|
+
const outputDir = (0, utils_1.resolveOutputDir)(rootPath, (0, utils_1.stringArg)(args.outputDir) ?? constants_1.defaultOutputDir);
|
|
26
|
+
const outputRelPath = (0, utils_1.stripLeadingDot)((0, utils_1.toPosixPath)(path.relative(rootPath, outputDir)));
|
|
27
|
+
const effectiveExcludePaths = (0, utils_1.unique)([
|
|
28
|
+
...excludePaths,
|
|
29
|
+
...(outputRelPath && outputRelPath !== '.' ? [outputRelPath] : []),
|
|
30
|
+
]);
|
|
31
|
+
const maxFiles = (0, utils_1.numberArg)(args.maxFiles, constants_1.defaultMaxFiles, 1, constants_1.maxAllowedFiles);
|
|
32
|
+
const dryRun = args.dryRun === true;
|
|
33
|
+
if (projectType === 'custom' && includePaths.length === 0) {
|
|
34
|
+
throw new Error('projectType "custom" requires includePaths so the local scan only reads the files the user chose.');
|
|
35
|
+
}
|
|
36
|
+
const files = await (0, files_1.collectCodeFiles)({
|
|
37
|
+
rootPath,
|
|
38
|
+
projectType,
|
|
39
|
+
includePaths,
|
|
40
|
+
excludePaths: effectiveExcludePaths,
|
|
41
|
+
maxFiles,
|
|
42
|
+
});
|
|
43
|
+
const analyzedFiles = await Promise.all(files.map((filePath) => (0, files_1.analyzeFile)(rootPath, filePath)));
|
|
44
|
+
const bundle = (0, bundle_1.createBundle)(rootPath, projectType, analyzedFiles);
|
|
45
|
+
const generatedFiles = (0, storage_1.getGeneratedFilePaths)(outputDir);
|
|
46
|
+
if (!dryRun) {
|
|
47
|
+
await (0, storage_1.writeBundleFiles)(outputDir, bundle);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
schema: 'scx.tool.scan.result.1',
|
|
52
|
+
scanId: bundle.scanId,
|
|
53
|
+
localOnly: true,
|
|
54
|
+
privacy: 'This codebase scan ran locally through the MCP server. Source files were read from disk and were not uploaded to Schemyx.',
|
|
55
|
+
projectType,
|
|
56
|
+
rootPath,
|
|
57
|
+
outputDir,
|
|
58
|
+
dryRun,
|
|
59
|
+
stats: {
|
|
60
|
+
files: bundle.files.length,
|
|
61
|
+
nodes: bundle.nodes.length,
|
|
62
|
+
edges: bundle.edges.length,
|
|
63
|
+
recipes: bundle.entries.length,
|
|
64
|
+
reviewItems: bundle.reviewItems.length,
|
|
65
|
+
},
|
|
66
|
+
detected: bundle.detected,
|
|
67
|
+
scannedFiles: bundle.files.length,
|
|
68
|
+
generatedEntries: bundle.entries.length,
|
|
69
|
+
generatedFiles: dryRun ? [] : generatedFiles,
|
|
70
|
+
generated: dryRun
|
|
71
|
+
? []
|
|
72
|
+
: generatedFiles.map((filePath) => (0, utils_1.toPosixPath)(path.relative(outputDir, filePath))),
|
|
73
|
+
next: [
|
|
74
|
+
{
|
|
75
|
+
tool: 'schemyx_search_codebase',
|
|
76
|
+
arguments: { query: 'button styles', limit: 5 },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
tool: 'schemyx_list_review_items',
|
|
80
|
+
arguments: { status: 'open', limit: 10 },
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async function listCodebaseRecipes(args = {}) {
|
|
86
|
+
return searchCodebase(args);
|
|
87
|
+
}
|
|
88
|
+
async function searchCodebase(args = {}) {
|
|
89
|
+
const { manifest, recipes, reviewItems } = await (0, storage_1.readGeneratedBundle)(args);
|
|
90
|
+
const query = (0, utils_1.stringArg)(args.query);
|
|
91
|
+
const exactKey = (0, utils_1.stringArg)(args.key);
|
|
92
|
+
const group = (0, utils_1.stringArg)(args.group);
|
|
93
|
+
const kind = (0, utils_1.stringArg)(args.kind);
|
|
94
|
+
const status = (0, utils_1.stringArg)(args.status);
|
|
95
|
+
const confidence = (0, utils_1.stringArg)(args.confidence);
|
|
96
|
+
const limit = (0, utils_1.numberArg)(args.limit, constants_1.defaultListLimit, 1, constants_1.maxListLimit);
|
|
97
|
+
const offset = (0, utils_1.cursorToOffset)(args.cursor);
|
|
98
|
+
const normalizedQuery = query?.toLowerCase();
|
|
99
|
+
const terms = normalizedQuery?.split(/[^a-zA-Z0-9_-]+/).filter(Boolean) ?? [];
|
|
100
|
+
let matches = recipes
|
|
101
|
+
.filter((recipe) => !exactKey || recipe.k === exactKey)
|
|
102
|
+
.filter((recipe) => !group || recipe.g === group)
|
|
103
|
+
.filter((recipe) => !kind || String(recipe.v.kind ?? recipe.g) === kind)
|
|
104
|
+
.filter((recipe) => !status || recipe.status === status)
|
|
105
|
+
.filter((recipe) => !confidence || recipe.confidence === confidence)
|
|
106
|
+
.map((recipe) => (0, recipes_1.toSearchMatch)(recipe, (0, recipes_1.scoreRecipe)(recipe, exactKey, terms)));
|
|
107
|
+
if (normalizedQuery || exactKey) {
|
|
108
|
+
matches = matches.filter((match) => match.score > 0 || match.k === exactKey);
|
|
109
|
+
}
|
|
110
|
+
matches.sort((a, b) => b.score - a.score ||
|
|
111
|
+
(0, recipes_1.statusWeight)(b.status) - (0, recipes_1.statusWeight)(a.status) ||
|
|
112
|
+
a.k.localeCompare(b.k));
|
|
113
|
+
const pageItems = matches.slice(offset, offset + limit);
|
|
114
|
+
const resolved = (0, recipes_1.resolveSearchStatus)(pageItems, Boolean(exactKey), reviewItems);
|
|
115
|
+
const nextCursor = offset + limit < matches.length ? String(offset + limit) : null;
|
|
116
|
+
return {
|
|
117
|
+
ok: true,
|
|
118
|
+
schema: 'scx.tool.search.result.1',
|
|
119
|
+
scanId: manifest.scanId,
|
|
120
|
+
query: query ?? exactKey ?? group ?? kind ?? null,
|
|
121
|
+
status: resolved.status,
|
|
122
|
+
...(resolved.resolvedKey ? { resolvedKey: resolved.resolvedKey } : {}),
|
|
123
|
+
confidence: resolved.confidence,
|
|
124
|
+
why: resolved.why,
|
|
125
|
+
...(resolved.reviewItem ? { reviewItem: resolved.reviewItem } : {}),
|
|
126
|
+
matches: pageItems,
|
|
127
|
+
page: {
|
|
128
|
+
limit,
|
|
129
|
+
nextCursor,
|
|
130
|
+
},
|
|
131
|
+
next: resolved.resolvedKey
|
|
132
|
+
? [
|
|
133
|
+
{
|
|
134
|
+
tool: 'schemyx_get_context_pack',
|
|
135
|
+
arguments: {
|
|
136
|
+
key: resolved.resolvedKey,
|
|
137
|
+
depth: (0, recipes_1.normalizeDepth)(args.depth),
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
]
|
|
141
|
+
: [],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async function getCodebaseRecipe(args = {}) {
|
|
145
|
+
const key = (0, utils_1.requiredStringArg)(args.key, 'key');
|
|
146
|
+
const includeDeps = args.includeDeps !== false;
|
|
147
|
+
const includeUsedBy = args.includeUsedBy === true;
|
|
148
|
+
const maxRelated = (0, utils_1.numberArg)(args.maxRelated, constants_1.defaultListLimit, 1, constants_1.maxListLimit);
|
|
149
|
+
const depth = (0, recipes_1.normalizeDepth)(args.depth);
|
|
150
|
+
const { manifest, recipesByKey } = await (0, storage_1.readGeneratedBundle)(args);
|
|
151
|
+
const recipe = recipesByKey.get(key);
|
|
152
|
+
if (!recipe) {
|
|
153
|
+
throw new Error(`Codebase recipe not found: ${key}`);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
ok: true,
|
|
157
|
+
schema: 'scx.tool.recipe.result.1',
|
|
158
|
+
scanId: manifest.scanId,
|
|
159
|
+
key,
|
|
160
|
+
depth,
|
|
161
|
+
recipe,
|
|
162
|
+
related: {
|
|
163
|
+
dependencies: includeDeps
|
|
164
|
+
? recipe.d
|
|
165
|
+
.map((dependencyKey) => recipesByKey.get(dependencyKey))
|
|
166
|
+
.filter((dependency) => Boolean(dependency))
|
|
167
|
+
.slice(0, maxRelated)
|
|
168
|
+
.map(recipes_1.toRelatedRecipe)
|
|
169
|
+
: [],
|
|
170
|
+
usedBy: includeUsedBy
|
|
171
|
+
? recipe.u
|
|
172
|
+
.map((usedByKey) => recipesByKey.get(usedByKey))
|
|
173
|
+
.filter((usedBy) => Boolean(usedBy))
|
|
174
|
+
.slice(0, maxRelated)
|
|
175
|
+
.map(recipes_1.toRelatedRecipe)
|
|
176
|
+
: [],
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
async function getContextPack(args = {}) {
|
|
181
|
+
const { manifest, recipesByKey, reviewItems } = await (0, storage_1.readGeneratedBundle)(args);
|
|
182
|
+
const depth = (0, recipes_1.normalizeDepth)(args.depth);
|
|
183
|
+
const maxItems = (0, utils_1.numberArg)(args.maxItems, 12, 1, 50);
|
|
184
|
+
const tokenBudget = (0, utils_1.numberArg)(args.tokenBudget, 3000, 250, 20_000);
|
|
185
|
+
const explicitKey = (0, utils_1.stringArg)(args.key);
|
|
186
|
+
const task = (0, utils_1.stringArg)(args.task);
|
|
187
|
+
const searchResult = explicitKey
|
|
188
|
+
? null
|
|
189
|
+
: await searchCodebase({
|
|
190
|
+
...args,
|
|
191
|
+
query: task,
|
|
192
|
+
limit: 5,
|
|
193
|
+
depth,
|
|
194
|
+
});
|
|
195
|
+
const key = explicitKey ?? searchResult?.resolvedKey ?? searchResult?.matches[0]?.k;
|
|
196
|
+
if (!key) {
|
|
197
|
+
return {
|
|
198
|
+
ok: true,
|
|
199
|
+
schema: 'scx.tool.pack.result.1',
|
|
200
|
+
scanId: manifest.scanId,
|
|
201
|
+
key: null,
|
|
202
|
+
status: 'not_found',
|
|
203
|
+
depth,
|
|
204
|
+
budget: {
|
|
205
|
+
targetTokens: tokenBudget,
|
|
206
|
+
estimatedTokens: 0,
|
|
207
|
+
sourceFilesIncluded: 0,
|
|
208
|
+
},
|
|
209
|
+
items: [],
|
|
210
|
+
review: [],
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const rootRecipe = recipesByKey.get(key);
|
|
214
|
+
if (!rootRecipe) {
|
|
215
|
+
throw new Error(`Codebase recipe not found: ${key}`);
|
|
216
|
+
}
|
|
217
|
+
const selected = new Map();
|
|
218
|
+
(0, recipes_1.addPackRecipe)(selected, rootRecipe, explicitKey ? 'requested key' : 'resolved lookup target');
|
|
219
|
+
for (const dependencyKey of rootRecipe.d) {
|
|
220
|
+
const dependency = recipesByKey.get(dependencyKey);
|
|
221
|
+
if (dependency) {
|
|
222
|
+
(0, recipes_1.addPackRecipe)(selected, dependency, 'direct dependency');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (rootRecipe.g === 'cluster' && Array.isArray(rootRecipe.v.members)) {
|
|
226
|
+
for (const memberKey of rootRecipe.v.members.filter((item) => typeof item === 'string')) {
|
|
227
|
+
const member = recipesByKey.get(memberKey);
|
|
228
|
+
if (member) {
|
|
229
|
+
(0, recipes_1.addPackRecipe)(selected, member, 'cluster member');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
for (const usedByKey of rootRecipe.u.slice(0, 5)) {
|
|
234
|
+
const usedBy = recipesByKey.get(usedByKey);
|
|
235
|
+
if (usedBy) {
|
|
236
|
+
(0, recipes_1.addPackRecipe)(selected, usedBy, 'used-by context');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const items = Array.from(selected.values())
|
|
240
|
+
.slice(0, maxItems)
|
|
241
|
+
.map((item) => ({
|
|
242
|
+
k: item.recipe.k,
|
|
243
|
+
why: item.why,
|
|
244
|
+
recipe: (0, recipes_1.trimRecipeForDepth)(item.recipe, depth),
|
|
245
|
+
}));
|
|
246
|
+
return {
|
|
247
|
+
ok: true,
|
|
248
|
+
schema: 'scx.tool.pack.result.1',
|
|
249
|
+
scanId: manifest.scanId,
|
|
250
|
+
key: `pack.${key}.${depth}`,
|
|
251
|
+
status: rootRecipe.status === 'needs_review' ? 'needs_review' : 'resolved',
|
|
252
|
+
depth,
|
|
253
|
+
budget: {
|
|
254
|
+
targetTokens: tokenBudget,
|
|
255
|
+
estimatedTokens: (0, utils_1.estimateTokens)(items),
|
|
256
|
+
sourceFilesIncluded: args.includeSource === true ? items.filter((item) => item.recipe.p).length : 0,
|
|
257
|
+
},
|
|
258
|
+
items,
|
|
259
|
+
review: reviewItems.filter((item) => item.candidates.includes(key)),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
async function getCodebaseGraph(args = {}) {
|
|
263
|
+
const { manifest, nodes, edges } = await (0, storage_1.readGeneratedBundle)(args);
|
|
264
|
+
const key = (0, utils_1.stringArg)(args.key);
|
|
265
|
+
const kinds = new Set((0, utils_1.stringArrayArg)(args.kinds));
|
|
266
|
+
const edgeTypes = new Set((0, utils_1.stringArrayArg)(args.edgeTypes));
|
|
267
|
+
const direction = (0, utils_1.stringArg)(args.direction) ?? 'both';
|
|
268
|
+
const radius = (0, utils_1.numberArg)(args.radius, 1, 0, constants_1.maxGraphRadius);
|
|
269
|
+
const limitNodes = (0, utils_1.numberArg)(args.limitNodes, constants_1.defaultGraphNodeLimit, 1, constants_1.maxGraphNodeLimit);
|
|
270
|
+
const limitEdges = (0, utils_1.numberArg)(args.limitEdges, constants_1.defaultGraphEdgeLimit, 1, constants_1.maxGraphEdgeLimit);
|
|
271
|
+
const offset = (0, utils_1.cursorToOffset)(args.cursor);
|
|
272
|
+
const selectedKeys = key
|
|
273
|
+
? (0, recipes_1.collectGraphNeighborhood)(key, edges, direction, radius)
|
|
274
|
+
: new Set();
|
|
275
|
+
let filteredNodes = nodes.filter((node) => {
|
|
276
|
+
if (selectedKeys.size && !selectedKeys.has(node.k)) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
return !kinds.size || kinds.has(node.kind);
|
|
280
|
+
});
|
|
281
|
+
const visibleKeys = new Set(filteredNodes.map((node) => node.k));
|
|
282
|
+
let filteredEdges = edges.filter((edge) => {
|
|
283
|
+
if (!visibleKeys.has(edge.from) || !visibleKeys.has(edge.to)) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
return !edgeTypes.size || edgeTypes.has(edge.type);
|
|
287
|
+
});
|
|
288
|
+
filteredNodes = filteredNodes.slice(offset, offset + limitNodes);
|
|
289
|
+
const pagedKeys = new Set(filteredNodes.map((node) => node.k));
|
|
290
|
+
filteredEdges = filteredEdges
|
|
291
|
+
.filter((edge) => pagedKeys.has(edge.from) && pagedKeys.has(edge.to))
|
|
292
|
+
.slice(0, limitEdges);
|
|
293
|
+
return {
|
|
294
|
+
ok: true,
|
|
295
|
+
schema: 'scx.tool.graph.result.1',
|
|
296
|
+
scanId: manifest.scanId,
|
|
297
|
+
nodes: filteredNodes,
|
|
298
|
+
edges: filteredEdges,
|
|
299
|
+
page: {
|
|
300
|
+
limitNodes,
|
|
301
|
+
limitEdges,
|
|
302
|
+
nextCursor: offset + limitNodes < nodes.length ? String(offset + limitNodes) : null,
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
async function listReviewItems(args = {}) {
|
|
307
|
+
const { manifest, reviewItems } = await (0, storage_1.readGeneratedBundle)(args);
|
|
308
|
+
const status = (0, utils_1.stringArg)(args.status);
|
|
309
|
+
const type = (0, utils_1.stringArg)(args.type);
|
|
310
|
+
const group = (0, utils_1.stringArg)(args.group);
|
|
311
|
+
const limit = (0, utils_1.numberArg)(args.limit, 20, 1, constants_1.maxListLimit);
|
|
312
|
+
const offset = (0, utils_1.cursorToOffset)(args.cursor);
|
|
313
|
+
const filtered = reviewItems
|
|
314
|
+
.filter((item) => !status || item.status === status)
|
|
315
|
+
.filter((item) => !type || item.type === type)
|
|
316
|
+
.filter((item) => !group || item.group === group);
|
|
317
|
+
return {
|
|
318
|
+
ok: true,
|
|
319
|
+
schema: 'scx.tool.review.result.1',
|
|
320
|
+
scanId: manifest.scanId,
|
|
321
|
+
items: filtered.slice(offset, offset + limit),
|
|
322
|
+
page: {
|
|
323
|
+
limit,
|
|
324
|
+
nextCursor: offset + limit < filtered.length ? String(offset + limit) : null,
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
async function checkContextFreshness(args = {}) {
|
|
329
|
+
const rootPath = (0, utils_1.resolveRootPath)(args.rootPath);
|
|
330
|
+
const { manifest, recipes } = await (0, storage_1.readGeneratedBundle)(args);
|
|
331
|
+
const keys = (0, utils_1.stringArrayArg)(args.keys);
|
|
332
|
+
const limit = (0, utils_1.numberArg)(args.limit, constants_1.maxListLimit, 1, constants_1.maxListLimit);
|
|
333
|
+
const candidates = (keys.length ? recipes.filter((recipe) => keys.includes(recipe.k)) : recipes)
|
|
334
|
+
.filter((recipe) => typeof recipe.v.path === 'string')
|
|
335
|
+
.slice(0, limit);
|
|
336
|
+
const stale = [];
|
|
337
|
+
const missing = [];
|
|
338
|
+
const changed = [];
|
|
339
|
+
for (const recipe of candidates) {
|
|
340
|
+
const recipePath = recipe.v.path;
|
|
341
|
+
if (typeof recipePath !== 'string') {
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
const filePath = (0, utils_1.resolveInsideRoot)(rootPath, recipePath);
|
|
345
|
+
const expectedHash = typeof recipe.v.sourceHash === 'string' ? recipe.v.sourceHash : undefined;
|
|
346
|
+
if (!(await (0, utils_1.pathExists)(filePath))) {
|
|
347
|
+
missing.push({ k: recipe.k, path: recipePath });
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
const actualHash = (0, utils_1.shortHash)(await node_fs_1.promises.readFile(filePath, 'utf8'));
|
|
351
|
+
if (expectedHash && actualHash !== expectedHash) {
|
|
352
|
+
stale.push({ k: recipe.k, path: recipePath, expectedHash, actualHash });
|
|
353
|
+
changed.push({ k: recipe.k, path: recipePath });
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
ok: true,
|
|
358
|
+
schema: 'scx.tool.freshness.result.1',
|
|
359
|
+
scanId: manifest.scanId,
|
|
360
|
+
status: stale.length || missing.length ? 'stale' : 'fresh',
|
|
361
|
+
stale,
|
|
362
|
+
missing,
|
|
363
|
+
changed: args.includeChangedFiles === true ? changed : [],
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
async function readCodebaseFile(args = {}) {
|
|
367
|
+
const rootPath = (0, utils_1.resolveRootPath)(args.rootPath);
|
|
368
|
+
const maxBytes = (0, utils_1.numberArg)(args.maxBytes, constants_1.readFileDefaultBytes, 1, constants_1.readFileMaxBytes);
|
|
369
|
+
const bundle = await (0, storage_1.readGeneratedBundle)(args);
|
|
370
|
+
const filePath = await (0, storage_1.resolveReadFilePath)(rootPath, bundle.recipesByKey, args);
|
|
371
|
+
const stat = await node_fs_1.promises.stat(filePath);
|
|
372
|
+
if (!stat.isFile()) {
|
|
373
|
+
throw new Error(`Codebase path is not a file: ${filePath}`);
|
|
374
|
+
}
|
|
375
|
+
const content = await node_fs_1.promises.readFile(filePath, 'utf8');
|
|
376
|
+
return {
|
|
377
|
+
ok: true,
|
|
378
|
+
schema: 'scx.tool.file.result.1',
|
|
379
|
+
scanId: bundle.manifest.scanId,
|
|
380
|
+
localOnly: true,
|
|
381
|
+
path: (0, utils_1.toPosixPath)(path.relative(rootPath, filePath)),
|
|
382
|
+
bytes: stat.size,
|
|
383
|
+
truncated: content.length > maxBytes,
|
|
384
|
+
content: content.slice(0, maxBytes),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/codebase-scanner/index.ts"],"names":[],"mappings":";;AAkEA,8CAuEC;AAED,kDAEC;AAED,wCA+DC;AAED,8CAqCC;AAED,wCA6FC;AAED,4CAiDC;AAED,0CAsBC;AAED,sDA4CC;AAED,4CAuBC;AAteD,qCAAyC;AACzC,kCAAkC;AAElC,qCAAwC;AACxC,2CAaqB;AACrB,mCAAwD;AACxD,uCAUmB;AACnB,uCAKmB;AAanB,mCAgBiB;AAEV,KAAK,UAAU,i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