@zokizuan/satori-mcp 4.5.0 → 4.8.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/README.md +6 -6
- package/dist/cli/package-installability.js +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.js +5 -5
- package/dist/core/completion-proof.d.ts +24 -0
- package/dist/core/completion-proof.js +106 -0
- package/dist/core/handlers.d.ts +16 -4
- package/dist/core/handlers.js +564 -170
- package/dist/core/manage-types.d.ts +1 -1
- package/dist/core/search-types.d.ts +21 -0
- package/dist/core/snapshot.d.ts +9 -0
- package/dist/core/snapshot.js +92 -1
- package/dist/embedding.js +8 -4
- package/dist/tools/list_codebases.js +13 -90
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -157,7 +157,7 @@ No parameters.
|
|
|
157
157
|
"mcpServers": {
|
|
158
158
|
"satori": {
|
|
159
159
|
"command": "npx",
|
|
160
|
-
"args": ["-y", "@zokizuan/satori-mcp@4.
|
|
160
|
+
"args": ["-y", "@zokizuan/satori-mcp@4.8.0"],
|
|
161
161
|
"timeout": 180000,
|
|
162
162
|
"env": {
|
|
163
163
|
"EMBEDDING_PROVIDER": "VoyageAI",
|
|
@@ -178,7 +178,7 @@ No parameters.
|
|
|
178
178
|
```toml
|
|
179
179
|
[mcp_servers.satori]
|
|
180
180
|
command = "npx"
|
|
181
|
-
args = ["-y", "@zokizuan/satori-mcp@4.
|
|
181
|
+
args = ["-y", "@zokizuan/satori-mcp@4.8.0"]
|
|
182
182
|
startup_timeout_ms = 180000
|
|
183
183
|
env = { EMBEDDING_PROVIDER = "VoyageAI", EMBEDDING_MODEL = "voyage-4-large", EMBEDDING_OUTPUT_DIMENSION = "1024", VOYAGEAI_API_KEY = "your-api-key", VOYAGEAI_RERANKER_MODEL = "rerank-2.5", MILVUS_ADDRESS = "your-milvus-endpoint", MILVUS_TOKEN = "your-milvus-token" }
|
|
184
184
|
```
|
|
@@ -228,10 +228,10 @@ Supported installer targets in Phase 1:
|
|
|
228
228
|
Examples:
|
|
229
229
|
|
|
230
230
|
```bash
|
|
231
|
-
npx -y @zokizuan/satori-cli@0.
|
|
232
|
-
npx -y @zokizuan/satori-cli@0.
|
|
233
|
-
npx -y @zokizuan/satori-cli@0.
|
|
234
|
-
npx -y @zokizuan/satori-cli@0.
|
|
231
|
+
npx -y @zokizuan/satori-cli@0.2.0 install --client codex
|
|
232
|
+
npx -y @zokizuan/satori-cli@0.2.0 install --client claude
|
|
233
|
+
npx -y @zokizuan/satori-cli@0.2.0 install --client all --dry-run
|
|
234
|
+
npx -y @zokizuan/satori-cli@0.2.0 uninstall --client codex
|
|
235
235
|
```
|
|
236
236
|
|
|
237
237
|
Install and uninstall run before MCP session startup, only touch Satori-managed config, and copy/remove these packaged skills:
|
|
@@ -55,7 +55,7 @@ function assertPublishedVersion(packageName, version, ownerPackageName, ownerPac
|
|
|
55
55
|
stdio: ["ignore", "pipe", "pipe"],
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
catch
|
|
58
|
+
catch {
|
|
59
59
|
if (relation === "self") {
|
|
60
60
|
throw new CliError("E_USAGE", `Cannot install ${ownerPackageName}@${ownerPackageVersion} because that package version is not published on npm. Publish ${ownerPackageName}@${ownerPackageVersion} first or use a local dev server config instead.`, 2);
|
|
61
61
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ export interface CodebaseIndexManifest {
|
|
|
42
42
|
indexedPaths: string[];
|
|
43
43
|
updatedAt: string;
|
|
44
44
|
}
|
|
45
|
+
export interface CodebaseClearTombstone {
|
|
46
|
+
clearedAt: string;
|
|
47
|
+
collectionName?: string;
|
|
48
|
+
}
|
|
45
49
|
export interface CodebaseSnapshotV1 {
|
|
46
50
|
indexedCodebases: string[];
|
|
47
51
|
indexingCodebases: string[] | Record<string, number>;
|
|
@@ -94,6 +98,7 @@ export interface CodebaseSnapshotV2 {
|
|
|
94
98
|
export interface CodebaseSnapshotV3 {
|
|
95
99
|
formatVersion: 'v3';
|
|
96
100
|
codebases: Record<string, CodebaseInfo>;
|
|
101
|
+
clearTombstones?: Record<string, CodebaseClearTombstone>;
|
|
97
102
|
lastUpdated: string;
|
|
98
103
|
}
|
|
99
104
|
export type CodebaseSnapshot = CodebaseSnapshotV1 | CodebaseSnapshotV2 | CodebaseSnapshotV3;
|
package/dist/config.js
CHANGED
|
@@ -169,7 +169,7 @@ export function showHelpMessage() {
|
|
|
169
169
|
console.log(`
|
|
170
170
|
Satori MCP Server
|
|
171
171
|
|
|
172
|
-
Usage: npx -y @zokizuan/satori-mcp@4.
|
|
172
|
+
Usage: npx -y @zokizuan/satori-mcp@4.8.0 [options]
|
|
173
173
|
|
|
174
174
|
Options:
|
|
175
175
|
--help, -h Show this help message
|
|
@@ -206,16 +206,16 @@ Environment Variables:
|
|
|
206
206
|
|
|
207
207
|
Examples:
|
|
208
208
|
# Start MCP server with OpenAI and explicit Milvus address
|
|
209
|
-
OPENAI_API_KEY=sk-xxx MILVUS_ADDRESS=localhost:19530 npx -y @zokizuan/satori-mcp@4.
|
|
209
|
+
OPENAI_API_KEY=sk-xxx MILVUS_ADDRESS=localhost:19530 npx -y @zokizuan/satori-mcp@4.8.0
|
|
210
210
|
|
|
211
211
|
# Start MCP server with VoyageAI and specific model
|
|
212
|
-
EMBEDDING_PROVIDER=VoyageAI VOYAGEAI_API_KEY=pa-xxx EMBEDDING_MODEL=voyage-4-large MILVUS_TOKEN=your-token npx -y @zokizuan/satori-mcp@4.
|
|
212
|
+
EMBEDDING_PROVIDER=VoyageAI VOYAGEAI_API_KEY=pa-xxx EMBEDDING_MODEL=voyage-4-large MILVUS_TOKEN=your-token npx -y @zokizuan/satori-mcp@4.8.0
|
|
213
213
|
|
|
214
214
|
# Start MCP server with Gemini and specific model
|
|
215
|
-
EMBEDDING_PROVIDER=Gemini GEMINI_API_KEY=xxx EMBEDDING_MODEL=gemini-embedding-001 MILVUS_TOKEN=your-token npx -y @zokizuan/satori-mcp@4.
|
|
215
|
+
EMBEDDING_PROVIDER=Gemini GEMINI_API_KEY=xxx EMBEDDING_MODEL=gemini-embedding-001 MILVUS_TOKEN=your-token npx -y @zokizuan/satori-mcp@4.8.0
|
|
216
216
|
|
|
217
217
|
# Start MCP server with Ollama and specific model
|
|
218
|
-
EMBEDDING_PROVIDER=Ollama EMBEDDING_MODEL=nomic-embed-text MILVUS_TOKEN=your-token npx -y @zokizuan/satori-mcp@4.
|
|
218
|
+
EMBEDDING_PROVIDER=Ollama EMBEDDING_MODEL=nomic-embed-text MILVUS_TOKEN=your-token npx -y @zokizuan/satori-mcp@4.8.0
|
|
219
219
|
`);
|
|
220
220
|
}
|
|
221
221
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IndexFingerprint } from "../config.js";
|
|
2
|
+
export type CompletionProofOutcome = "valid" | "stale_local" | "fingerprint_mismatch" | "probe_failed";
|
|
3
|
+
export type CompletionProofReason = "missing_marker_doc" | "invalid_marker_kind" | "path_mismatch" | "invalid_payload" | "fingerprint_mismatch" | "probe_failed";
|
|
4
|
+
export type CompletionProofValidationResult = {
|
|
5
|
+
outcome: CompletionProofOutcome;
|
|
6
|
+
reason?: CompletionProofReason;
|
|
7
|
+
marker?: {
|
|
8
|
+
kind?: string;
|
|
9
|
+
codebasePath?: string;
|
|
10
|
+
fingerprint?: unknown;
|
|
11
|
+
indexedFiles?: number;
|
|
12
|
+
totalChunks?: number;
|
|
13
|
+
completedAt?: string;
|
|
14
|
+
runId?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type CompletionMarkerReader = (codebasePath: string) => Promise<unknown>;
|
|
18
|
+
export declare function validateCompletionProof(args: {
|
|
19
|
+
codebasePath: string;
|
|
20
|
+
runtimeFingerprint?: IndexFingerprint;
|
|
21
|
+
getIndexCompletionMarker?: CompletionMarkerReader;
|
|
22
|
+
onProbeError?: (error: unknown) => void;
|
|
23
|
+
}): Promise<CompletionProofValidationResult>;
|
|
24
|
+
//# sourceMappingURL=completion-proof.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
function trimTrailingSeparators(inputPath) {
|
|
4
|
+
const normalized = path.normalize(inputPath);
|
|
5
|
+
const parsedRoot = path.parse(normalized).root;
|
|
6
|
+
if (normalized === parsedRoot) {
|
|
7
|
+
return normalized;
|
|
8
|
+
}
|
|
9
|
+
return normalized.replace(/[\\/]+$/, "");
|
|
10
|
+
}
|
|
11
|
+
function canonicalizeCodebasePath(codebasePath) {
|
|
12
|
+
const resolved = path.resolve(codebasePath);
|
|
13
|
+
try {
|
|
14
|
+
const realPath = typeof fs.realpathSync.native === "function"
|
|
15
|
+
? fs.realpathSync.native(resolved)
|
|
16
|
+
: fs.realpathSync(resolved);
|
|
17
|
+
return trimTrailingSeparators(realPath);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return trimTrailingSeparators(resolved);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function markerMatchesRuntimeFingerprint(marker, runtimeFingerprint) {
|
|
24
|
+
if (!runtimeFingerprint || typeof runtimeFingerprint !== "object") {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
const fingerprint = marker?.fingerprint;
|
|
28
|
+
if (!fingerprint || typeof fingerprint !== "object") {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const record = fingerprint;
|
|
32
|
+
return record.embeddingProvider === runtimeFingerprint.embeddingProvider
|
|
33
|
+
&& record.embeddingModel === runtimeFingerprint.embeddingModel
|
|
34
|
+
&& Number(record.embeddingDimension) === Number(runtimeFingerprint.embeddingDimension)
|
|
35
|
+
&& record.vectorStoreProvider === runtimeFingerprint.vectorStoreProvider
|
|
36
|
+
&& record.schemaVersion === runtimeFingerprint.schemaVersion;
|
|
37
|
+
}
|
|
38
|
+
function isNonNegativeInteger(value) {
|
|
39
|
+
return typeof value === "number"
|
|
40
|
+
&& Number.isInteger(value)
|
|
41
|
+
&& value >= 0;
|
|
42
|
+
}
|
|
43
|
+
function validateMarkerShape(expectedCodebasePath, marker) {
|
|
44
|
+
if (!marker || typeof marker !== "object") {
|
|
45
|
+
return { ok: false, reason: "invalid_payload" };
|
|
46
|
+
}
|
|
47
|
+
const record = marker;
|
|
48
|
+
if (record.kind !== "satori_index_completion_v1") {
|
|
49
|
+
return { ok: false, reason: "invalid_marker_kind" };
|
|
50
|
+
}
|
|
51
|
+
if (typeof record.codebasePath !== "string" || record.codebasePath.trim().length === 0) {
|
|
52
|
+
return { ok: false, reason: "invalid_payload" };
|
|
53
|
+
}
|
|
54
|
+
if (!record.fingerprint || typeof record.fingerprint !== "object") {
|
|
55
|
+
return { ok: false, reason: "invalid_payload" };
|
|
56
|
+
}
|
|
57
|
+
if (!isNonNegativeInteger(record.indexedFiles) || !isNonNegativeInteger(record.totalChunks)) {
|
|
58
|
+
return { ok: false, reason: "invalid_payload" };
|
|
59
|
+
}
|
|
60
|
+
if (typeof record.completedAt !== "string" || Number.isNaN(Date.parse(record.completedAt))) {
|
|
61
|
+
return { ok: false, reason: "invalid_payload" };
|
|
62
|
+
}
|
|
63
|
+
const expectedCanonical = canonicalizeCodebasePath(expectedCodebasePath);
|
|
64
|
+
const markerCanonical = canonicalizeCodebasePath(record.codebasePath);
|
|
65
|
+
if (expectedCanonical !== markerCanonical) {
|
|
66
|
+
return { ok: false, reason: "path_mismatch" };
|
|
67
|
+
}
|
|
68
|
+
return { ok: true };
|
|
69
|
+
}
|
|
70
|
+
export async function validateCompletionProof(args) {
|
|
71
|
+
const { codebasePath, runtimeFingerprint, getIndexCompletionMarker, onProbeError } = args;
|
|
72
|
+
if (typeof getIndexCompletionMarker !== "function") {
|
|
73
|
+
return { outcome: "probe_failed", reason: "probe_failed" };
|
|
74
|
+
}
|
|
75
|
+
let marker;
|
|
76
|
+
try {
|
|
77
|
+
marker = await getIndexCompletionMarker(codebasePath);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
onProbeError?.(error);
|
|
81
|
+
return { outcome: "probe_failed", reason: "probe_failed" };
|
|
82
|
+
}
|
|
83
|
+
if (!marker) {
|
|
84
|
+
return { outcome: "stale_local", reason: "missing_marker_doc" };
|
|
85
|
+
}
|
|
86
|
+
const markerShape = validateMarkerShape(codebasePath, marker);
|
|
87
|
+
if (!markerShape.ok) {
|
|
88
|
+
return {
|
|
89
|
+
outcome: "stale_local",
|
|
90
|
+
reason: markerShape.reason,
|
|
91
|
+
marker: marker
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (!markerMatchesRuntimeFingerprint(marker, runtimeFingerprint)) {
|
|
95
|
+
return {
|
|
96
|
+
outcome: "fingerprint_mismatch",
|
|
97
|
+
reason: "fingerprint_mismatch",
|
|
98
|
+
marker: marker
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
outcome: "valid",
|
|
103
|
+
marker: marker
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=completion-proof.js.map
|
package/dist/core/handlers.d.ts
CHANGED
|
@@ -33,10 +33,6 @@ export declare class ToolHandlers {
|
|
|
33
33
|
private isIndexingStateStale;
|
|
34
34
|
private recoverStaleIndexingStateIfNeeded;
|
|
35
35
|
private buildManageActionBlockedMessage;
|
|
36
|
-
private markerMatchesRuntimeFingerprint;
|
|
37
|
-
private trimTrailingSeparators;
|
|
38
|
-
private canonicalizeCodebasePath;
|
|
39
|
-
private validateMarkerShape;
|
|
40
36
|
private buildStaleLocalHint;
|
|
41
37
|
private buildStaleLocalMessage;
|
|
42
38
|
private withProofDebugHint;
|
|
@@ -72,6 +68,8 @@ export declare class ToolHandlers {
|
|
|
72
68
|
private classifyNoiseCategory;
|
|
73
69
|
private roundRatio;
|
|
74
70
|
private normalizeRelativePathForIgnoreCheck;
|
|
71
|
+
private trimTrailingSeparators;
|
|
72
|
+
private canonicalizeCodebasePath;
|
|
75
73
|
private loadRootGitignoreMatcher;
|
|
76
74
|
private patternMatchesAnyPath;
|
|
77
75
|
private filterNoiseHintPatternsByRootGitignore;
|
|
@@ -79,6 +77,15 @@ export declare class ToolHandlers {
|
|
|
79
77
|
private tokenizeQueryPrefix;
|
|
80
78
|
private unquoteOperatorValue;
|
|
81
79
|
private parseSearchOperators;
|
|
80
|
+
private tokenizeLexicalTerms;
|
|
81
|
+
private isIdentifierLikeToken;
|
|
82
|
+
private buildSearchQueryPlan;
|
|
83
|
+
private escapeLexicalRegex;
|
|
84
|
+
private hasTokenBoundaryMatch;
|
|
85
|
+
private getReferenceUsageKind;
|
|
86
|
+
private hasDeclarationMatch;
|
|
87
|
+
private getLexicalTermFactor;
|
|
88
|
+
private scoreCandidateLexicalEvidence;
|
|
82
89
|
private pathMatchesAnyPattern;
|
|
83
90
|
private tokenMatchesAnyField;
|
|
84
91
|
private resolveRerankDecision;
|
|
@@ -94,6 +101,11 @@ export declare class ToolHandlers {
|
|
|
94
101
|
private getStalenessBucket;
|
|
95
102
|
private compareNullableNumbersAsc;
|
|
96
103
|
private compareNullableStringsAsc;
|
|
104
|
+
private compareSearchCandidates;
|
|
105
|
+
private sortSearchCandidates;
|
|
106
|
+
private isDeclarationSearchGroup;
|
|
107
|
+
private normalizeDeclarationGroupKey;
|
|
108
|
+
private collapseDuplicateDeclarationGroups;
|
|
97
109
|
private buildFallbackGroupId;
|
|
98
110
|
private isCallGraphLanguageSupported;
|
|
99
111
|
private buildCallGraphHint;
|