@zokizuan/satori-mcp 3.1.0 → 3.3.0
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/dist/core/call-graph.js
CHANGED
|
@@ -418,11 +418,11 @@ export class CallGraphSidecarManager {
|
|
|
418
418
|
}
|
|
419
419
|
looksLikeDefinition(line, name) {
|
|
420
420
|
const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
421
|
-
const pattern = new RegExp(`\\b(function|class|def)\\s+${escaped}\\b
|
|
421
|
+
const pattern = new RegExp(`\\b(function|class|def)\\s+${escaped}\\b`, 'i');
|
|
422
422
|
if (pattern.test(line)) {
|
|
423
423
|
return true;
|
|
424
424
|
}
|
|
425
|
-
const methodPattern = new RegExp(`\\b${escaped}\\s*\\([^)]*\\)\\s*(=>|\\{)
|
|
425
|
+
const methodPattern = new RegExp(`\\b${escaped}\\s*\\([^)]*\\)\\s*(=>|\\{)`, 'i');
|
|
426
426
|
return methodPattern.test(line);
|
|
427
427
|
}
|
|
428
428
|
shouldScanNodeAsSource(symbolLabel) {
|
package/dist/core/handlers.d.ts
CHANGED
|
@@ -46,6 +46,9 @@ export declare class ToolHandlers {
|
|
|
46
46
|
private getOutlineStatusForLanguage;
|
|
47
47
|
private sortFileOutlineSymbols;
|
|
48
48
|
private buildSearchPassWarning;
|
|
49
|
+
private isSearchPassFaultInjectionEnabled;
|
|
50
|
+
private getForcedFailedSearchPassId;
|
|
51
|
+
private shouldForceSearchPassFailure;
|
|
49
52
|
private mapCallGraphStatus;
|
|
50
53
|
private getContextIgnorePatterns;
|
|
51
54
|
private rebuildCallGraphForIndex;
|
package/dist/core/handlers.js
CHANGED
|
@@ -498,6 +498,28 @@ export class ToolHandlers {
|
|
|
498
498
|
buildSearchPassWarning(passId) {
|
|
499
499
|
return `SEARCH_PASS_FAILED:${passId} - ${passId} semantic search pass failed; results may be degraded.`;
|
|
500
500
|
}
|
|
501
|
+
isSearchPassFaultInjectionEnabled() {
|
|
502
|
+
return process.env.NODE_ENV === 'test';
|
|
503
|
+
}
|
|
504
|
+
getForcedFailedSearchPassId() {
|
|
505
|
+
if (!this.isSearchPassFaultInjectionEnabled()) {
|
|
506
|
+
return undefined;
|
|
507
|
+
}
|
|
508
|
+
const raw = typeof process.env.SATORI_TEST_FAIL_SEARCH_PASS === 'string'
|
|
509
|
+
? process.env.SATORI_TEST_FAIL_SEARCH_PASS.trim().toLowerCase()
|
|
510
|
+
: '';
|
|
511
|
+
if (raw === 'primary' || raw === 'expanded' || raw === 'both') {
|
|
512
|
+
return raw;
|
|
513
|
+
}
|
|
514
|
+
return undefined;
|
|
515
|
+
}
|
|
516
|
+
shouldForceSearchPassFailure(passId) {
|
|
517
|
+
const forced = this.getForcedFailedSearchPassId();
|
|
518
|
+
if (!forced) {
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
521
|
+
return forced === 'both' || forced === passId;
|
|
522
|
+
}
|
|
501
523
|
mapCallGraphStatus(graph) {
|
|
502
524
|
if (graph.supported) {
|
|
503
525
|
return 'ok';
|
|
@@ -1386,7 +1408,11 @@ To force rebuild from scratch: call manage_index with {"action":"create","path":
|
|
|
1386
1408
|
{ id: 'expanded', query: expandedQuery },
|
|
1387
1409
|
];
|
|
1388
1410
|
searchDiagnostics.searchPassCount = passDescriptors.length;
|
|
1389
|
-
const passSettled = await Promise.allSettled(passDescriptors.map((pass) => {
|
|
1411
|
+
const passSettled = await Promise.allSettled(passDescriptors.map(async (pass) => {
|
|
1412
|
+
const passId = pass.id;
|
|
1413
|
+
if (this.shouldForceSearchPassFailure(passId)) {
|
|
1414
|
+
throw new Error(`FORCED_TEST_SEARCH_PASS_FAILURE:${passId}`);
|
|
1415
|
+
}
|
|
1390
1416
|
return this.context.semanticSearch(effectiveRoot, pass.query, candidateLimit, 0.3);
|
|
1391
1417
|
}));
|
|
1392
1418
|
const searchWarnings = [];
|
package/dist/tools/call_graph.js
CHANGED
|
@@ -21,7 +21,15 @@ export const callGraphTool = {
|
|
|
21
21
|
description: () => 'Traverse the prebuilt TS/Python call graph sidecar for callers/callees/bidirectional symbol relationships.',
|
|
22
22
|
inputSchemaZod: () => callGraphInputSchema,
|
|
23
23
|
execute: async (args, ctx) => {
|
|
24
|
-
const
|
|
24
|
+
const normalizedArgs = (args && typeof args === 'object')
|
|
25
|
+
? { ...args }
|
|
26
|
+
: (args || {});
|
|
27
|
+
if (normalizedArgs
|
|
28
|
+
&& typeof normalizedArgs === 'object'
|
|
29
|
+
&& normalizedArgs.direction === 'bidirectional') {
|
|
30
|
+
normalizedArgs.direction = 'both';
|
|
31
|
+
}
|
|
32
|
+
const parsed = callGraphInputSchema.safeParse(normalizedArgs);
|
|
25
33
|
if (!parsed.success) {
|
|
26
34
|
return {
|
|
27
35
|
content: [{
|