@nxuss/lemma 1.8.0 → 1.9.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 +126 -176
- package/dist/cjs/mcp/prompts.d.ts +10 -1
- package/dist/cjs/mcp/prompts.d.ts.map +1 -1
- package/dist/cjs/mcp/prompts.js +25 -73
- package/dist/cjs/mcp/prompts.js.map +1 -1
- package/dist/cjs/mcp/tool-profiles.d.ts +10 -1
- package/dist/cjs/mcp/tool-profiles.d.ts.map +1 -1
- package/dist/cjs/mcp/tool-profiles.js +12 -3
- package/dist/cjs/mcp/tool-profiles.js.map +1 -1
- package/dist/cjs/mcp/tools.d.ts.map +1 -1
- package/dist/cjs/mcp/tools.js +122 -28
- package/dist/cjs/mcp/tools.js.map +1 -1
- package/dist/cjs/mcp/utils.d.ts.map +1 -1
- package/dist/cjs/mcp/utils.js +19 -6
- package/dist/cjs/mcp/utils.js.map +1 -1
- package/dist/cjs/security/SemanticScrubber.d.ts +2 -0
- package/dist/cjs/security/SemanticScrubber.d.ts.map +1 -1
- package/dist/cjs/security/SemanticScrubber.js +53 -13
- package/dist/cjs/security/SemanticScrubber.js.map +1 -1
- package/dist/cjs/utils/ContextSqueezer.d.ts.map +1 -1
- package/dist/cjs/utils/ContextSqueezer.js +55 -22
- package/dist/cjs/utils/ContextSqueezer.js.map +1 -1
- package/dist/cjs/utils/FileOutline.d.ts +22 -0
- package/dist/cjs/utils/FileOutline.d.ts.map +1 -0
- package/dist/cjs/utils/FileOutline.js +55 -0
- package/dist/cjs/utils/FileOutline.js.map +1 -0
- package/dist/cjs/utils/LineNumberMap.d.ts +29 -0
- package/dist/cjs/utils/LineNumberMap.d.ts.map +1 -0
- package/dist/cjs/utils/LineNumberMap.js +98 -0
- package/dist/cjs/utils/LineNumberMap.js.map +1 -0
- package/dist/cjs/utils/PatchMatcher.d.ts +2 -0
- package/dist/cjs/utils/PatchMatcher.d.ts.map +1 -1
- package/dist/cjs/utils/PatchMatcher.js +9 -1
- package/dist/cjs/utils/PatchMatcher.js.map +1 -1
- package/dist/cjs/utils/ReadWorkspaceCache.d.ts +16 -3
- package/dist/cjs/utils/ReadWorkspaceCache.d.ts.map +1 -1
- package/dist/cjs/utils/ReadWorkspaceCache.js +20 -8
- package/dist/cjs/utils/ReadWorkspaceCache.js.map +1 -1
- package/dist/esm/mcp/prompts.d.ts +10 -1
- package/dist/esm/mcp/prompts.d.ts.map +1 -1
- package/dist/esm/mcp/prompts.js +25 -73
- package/dist/esm/mcp/prompts.js.map +1 -1
- package/dist/esm/mcp/tool-profiles.d.ts +10 -1
- package/dist/esm/mcp/tool-profiles.d.ts.map +1 -1
- package/dist/esm/mcp/tool-profiles.js +12 -3
- package/dist/esm/mcp/tool-profiles.js.map +1 -1
- package/dist/esm/mcp/tools.d.ts.map +1 -1
- package/dist/esm/mcp/tools.js +122 -28
- package/dist/esm/mcp/tools.js.map +1 -1
- package/dist/esm/mcp/utils.d.ts.map +1 -1
- package/dist/esm/mcp/utils.js +19 -6
- package/dist/esm/mcp/utils.js.map +1 -1
- package/dist/esm/security/SemanticScrubber.d.ts +2 -0
- package/dist/esm/security/SemanticScrubber.d.ts.map +1 -1
- package/dist/esm/security/SemanticScrubber.js +53 -13
- package/dist/esm/security/SemanticScrubber.js.map +1 -1
- package/dist/esm/utils/ContextSqueezer.d.ts.map +1 -1
- package/dist/esm/utils/ContextSqueezer.js +55 -22
- package/dist/esm/utils/ContextSqueezer.js.map +1 -1
- package/dist/esm/utils/FileOutline.d.ts +22 -0
- package/dist/esm/utils/FileOutline.d.ts.map +1 -0
- package/dist/esm/utils/FileOutline.js +51 -0
- package/dist/esm/utils/FileOutline.js.map +1 -0
- package/dist/esm/utils/LineNumberMap.d.ts +29 -0
- package/dist/esm/utils/LineNumberMap.d.ts.map +1 -0
- package/dist/esm/utils/LineNumberMap.js +93 -0
- package/dist/esm/utils/LineNumberMap.js.map +1 -0
- package/dist/esm/utils/PatchMatcher.d.ts +2 -0
- package/dist/esm/utils/PatchMatcher.d.ts.map +1 -1
- package/dist/esm/utils/PatchMatcher.js +9 -1
- package/dist/esm/utils/PatchMatcher.js.map +1 -1
- package/dist/esm/utils/ReadWorkspaceCache.d.ts +16 -3
- package/dist/esm/utils/ReadWorkspaceCache.d.ts.map +1 -1
- package/dist/esm/utils/ReadWorkspaceCache.js +19 -8
- package/dist/esm/utils/ReadWorkspaceCache.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Real line numbers for squeezed content.
|
|
4
|
+
*
|
|
5
|
+
* A squeezed read is unusable for anything that needs a location: the model cannot cite
|
|
6
|
+
* `file.ts:120`, and a follow-up edit has to re-read the file to find out where the code
|
|
7
|
+
* actually lives — paying for the file twice and cancelling out the squeeze.
|
|
8
|
+
*
|
|
9
|
+
* Numbering the squeezed output sequentially would be worse than nothing: the numbers would
|
|
10
|
+
* be confidently wrong. So we map each surviving line back to the line it came from in the
|
|
11
|
+
* original file.
|
|
12
|
+
*
|
|
13
|
+
* This is exact rather than heuristic because of what `squeezeCode` actually does: it only
|
|
14
|
+
* *drops* whole lines (comments, imports, blanks) and normalizes whitespace *within* a line.
|
|
15
|
+
* It never reorders, merges or splits them. So a forward-only greedy walk over the original
|
|
16
|
+
* finds each squeezed line at its true position.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.mapSqueezedToOriginal = mapSqueezedToOriginal;
|
|
20
|
+
exports.withLineNumbers = withLineNumbers;
|
|
21
|
+
exports.sequentialNumbers = sequentialNumbers;
|
|
22
|
+
/** Whitespace-insensitive comparison key — squeezing collapses runs of spaces/tabs. */
|
|
23
|
+
function key(line) {
|
|
24
|
+
return line.replace(/[ \t]+/g, " ").trim();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Lines the squeezer *inserts* (its own markers) correspond to no original line and must
|
|
28
|
+
* report no number rather than borrow a neighbour's.
|
|
29
|
+
*/
|
|
30
|
+
function isSqueezerMarker(line) {
|
|
31
|
+
return /^\s*(\/\/|#)\s*\[Lemma (Squeezer|Squeezed|AST):/.test(line);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A squeezed line that finds no match ahead must not consume the cursor, or one bad line
|
|
35
|
+
* would desynchronise every number after it. Bounded so a pathological mismatch stays linear.
|
|
36
|
+
*/
|
|
37
|
+
const LOOKAHEAD_LIMIT = 2000;
|
|
38
|
+
/**
|
|
39
|
+
* For each line of `squeezed`, the 1-indexed line in `original` it came from, or null when
|
|
40
|
+
* the line has no origin (a squeezer marker, or content that could not be located).
|
|
41
|
+
*/
|
|
42
|
+
function mapSqueezedToOriginal(original, squeezed) {
|
|
43
|
+
const originalLines = original.split("\n");
|
|
44
|
+
const squeezedLines = squeezed.split("\n");
|
|
45
|
+
const originalKeys = originalLines.map(key);
|
|
46
|
+
const result = [];
|
|
47
|
+
let cursor = 0;
|
|
48
|
+
for (const squeezedLine of squeezedLines) {
|
|
49
|
+
if (isSqueezerMarker(squeezedLine)) {
|
|
50
|
+
result.push(null);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const needle = key(squeezedLine);
|
|
54
|
+
if (!needle) {
|
|
55
|
+
result.push(null);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const limit = Math.min(originalKeys.length, cursor + LOOKAHEAD_LIMIT);
|
|
59
|
+
let found = -1;
|
|
60
|
+
for (let i = cursor; i < limit; i++) {
|
|
61
|
+
const hay = originalKeys[i];
|
|
62
|
+
// Exact match, or the squeezed line is what survived after a trailing comment was
|
|
63
|
+
// stripped off the end of the original line.
|
|
64
|
+
if (hay === needle || (hay.startsWith(needle) && needle.length > 0)) {
|
|
65
|
+
found = i;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (found === -1) {
|
|
70
|
+
result.push(null);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
result.push(found + 1);
|
|
74
|
+
cursor = found + 1;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Render text with a line-number gutter. `numbers` is parallel to the lines of `text`;
|
|
81
|
+
* a null entry renders a blank gutter so an inserted marker never claims a position.
|
|
82
|
+
*/
|
|
83
|
+
function withLineNumbers(text, numbers) {
|
|
84
|
+
const lines = text.split("\n");
|
|
85
|
+
const width = String(numbers.reduce((max, n) => (n && n > max ? n : max), 0)).length;
|
|
86
|
+
return lines
|
|
87
|
+
.map((line, i) => {
|
|
88
|
+
const n = numbers[i];
|
|
89
|
+
const gutter = n === null || n === undefined ? " ".repeat(width) : String(n).padStart(width, " ");
|
|
90
|
+
return `${gutter}| ${line}`;
|
|
91
|
+
})
|
|
92
|
+
.join("\n");
|
|
93
|
+
}
|
|
94
|
+
/** Straight 1..n numbering, for content that was not squeezed. */
|
|
95
|
+
function sequentialNumbers(text, startLine = 1) {
|
|
96
|
+
return text.split("\n").map((_, i) => startLine + i);
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=LineNumberMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineNumberMap.js","sourceRoot":"","sources":["../../../src/utils/LineNumberMap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAyBH,sDAwCC;AAMD,0CAUC;AAGD,8CAEC;AApFD,uFAAuF;AACvF,SAAS,GAAG,CAAC,IAAY;IACvB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,iDAAiD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,eAAe,GAAG,IAAI,CAAC;AAE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AC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchMatcher.d.ts","sourceRoot":"","sources":["../../../src/utils/PatchMatcher.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,uBAAuB,GAAG,iBAAiB,GAAG,OAAO,CAAC;AAE5F,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"PatchMatcher.d.ts","sourceRoot":"","sources":["../../../src/utils/PatchMatcher.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,uBAAuB,GAAG,iBAAiB,GAAG,OAAO,CAAC;AAE5F,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IAId,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AA8CD,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAkBnH;AAsFD,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,QAAQ,SAAK,GAAG,MAAM,CA2BpG;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,YAAY,CAgC9F"}
|
|
@@ -77,7 +77,15 @@ function findExact(content, searchContent) {
|
|
|
77
77
|
break;
|
|
78
78
|
const startLine = content.slice(0, idx).split("\n").length - 1;
|
|
79
79
|
const endLine = startLine + searchContent.split("\n").length - 1;
|
|
80
|
-
results.push({
|
|
80
|
+
results.push({
|
|
81
|
+
strategy: "exact",
|
|
82
|
+
startLine,
|
|
83
|
+
endLine,
|
|
84
|
+
matchedText: searchContent,
|
|
85
|
+
score: 1,
|
|
86
|
+
charStart: idx,
|
|
87
|
+
charEnd: idx + searchContent.length,
|
|
88
|
+
});
|
|
81
89
|
fromIndex = idx + 1;
|
|
82
90
|
}
|
|
83
91
|
return results;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchMatcher.js","sourceRoot":"","sources":["../../../src/utils/PatchMatcher.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,oFAAoF;AACpF,oFAAoF;AACpF,uEAAuE;;
|
|
1
|
+
{"version":3,"file":"PatchMatcher.js","sourceRoot":"","sources":["../../../src/utils/PatchMatcher.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,oFAAoF;AACpF,oFAAoF;AACpF,uEAAuE;;AAmEvE,kDAkBC;AAsFD,sCA2BC;AAED,8BAgCC;AAjND,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,wBAAwB,GAAG,IAAI,CAAC,CAAC,oCAAoC;AAE3E,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,CAA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AAI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YAClE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,SAAS,GAAG,oBAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAClE,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC/C,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,aAAa,EAAE,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrE,kBAAkB,EAAE,SAAS,CAAC,SAAS,GAAG,CAAC;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything that changes *what bytes the model received* has to be part of the key.
|
|
3
|
+
* Keying on the path alone made reading lines 1-50 suppress a later read of lines 51-100
|
|
4
|
+
* as "unchanged", withholding content the model had never seen.
|
|
5
|
+
*/
|
|
6
|
+
export interface ReadView {
|
|
7
|
+
compact: boolean;
|
|
8
|
+
lineNumbers?: boolean;
|
|
9
|
+
offset?: number;
|
|
10
|
+
limit?: number;
|
|
11
|
+
}
|
|
1
12
|
export interface ReadDedupCheck {
|
|
2
13
|
unchanged: boolean;
|
|
3
14
|
hash: string;
|
|
4
15
|
}
|
|
5
|
-
/** Check whether this exact (path,
|
|
6
|
-
export declare function checkAlreadySent(resolvedPath: string,
|
|
16
|
+
/** Check whether this exact (path, view) content was already sent this session. */
|
|
17
|
+
export declare function checkAlreadySent(resolvedPath: string, view: ReadView, rawContent: string): ReadDedupCheck;
|
|
7
18
|
/** Record that this content was just sent, so future identical reads short-circuit. */
|
|
8
|
-
export declare function recordSent(resolvedPath: string,
|
|
19
|
+
export declare function recordSent(resolvedPath: string, view: ReadView, hash: string): void;
|
|
20
|
+
/** Test seam — the map is process-global and would otherwise leak between test cases. */
|
|
21
|
+
export declare function resetReadCache(): void;
|
|
9
22
|
//# sourceMappingURL=ReadWorkspaceCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadWorkspaceCache.d.ts","sourceRoot":"","sources":["../../../src/utils/ReadWorkspaceCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReadWorkspaceCache.d.ts","sourceRoot":"","sources":["../../../src/utils/ReadWorkspaceCache.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAaD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAKzG;AAED,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAEnF;AAED,yFAAyF;AACzF,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
|
|
@@ -5,27 +5,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.checkAlreadySent = checkAlreadySent;
|
|
7
7
|
exports.recordSent = recordSent;
|
|
8
|
+
exports.resetReadCache = resetReadCache;
|
|
8
9
|
const crypto_1 = __importDefault(require("crypto"));
|
|
9
10
|
// Session-scoped (lives for the MCP server process lifetime, which is normally the
|
|
10
11
|
// whole conversation). Tracks the content hash we last actually sent back to the
|
|
11
|
-
// model for a given (filePath,
|
|
12
|
+
// model for a given (filePath, view) pair, so a second identical read doesn't
|
|
12
13
|
// resend content the model already has in its own context.
|
|
13
14
|
const lastSent = new Map();
|
|
14
15
|
function sha256(content) {
|
|
15
16
|
return crypto_1.default.createHash("sha256").update(content).digest("hex");
|
|
16
17
|
}
|
|
17
|
-
function cacheKey(resolvedPath,
|
|
18
|
-
|
|
18
|
+
function cacheKey(resolvedPath, view) {
|
|
19
|
+
const parts = [
|
|
20
|
+
resolvedPath,
|
|
21
|
+
view.compact ? "c1" : "c0",
|
|
22
|
+
view.lineNumbers ? "n1" : "n0",
|
|
23
|
+
view.offset ? `o${view.offset}` : "o",
|
|
24
|
+
view.limit ? `l${view.limit}` : "l",
|
|
25
|
+
];
|
|
26
|
+
return parts.join("::");
|
|
19
27
|
}
|
|
20
|
-
/** Check whether this exact (path,
|
|
21
|
-
function checkAlreadySent(resolvedPath,
|
|
28
|
+
/** Check whether this exact (path, view) content was already sent this session. */
|
|
29
|
+
function checkAlreadySent(resolvedPath, view, rawContent) {
|
|
22
30
|
const hash = sha256(rawContent);
|
|
23
|
-
const key = cacheKey(resolvedPath,
|
|
31
|
+
const key = cacheKey(resolvedPath, view);
|
|
24
32
|
const unchanged = lastSent.get(key) === hash;
|
|
25
33
|
return { unchanged, hash };
|
|
26
34
|
}
|
|
27
35
|
/** Record that this content was just sent, so future identical reads short-circuit. */
|
|
28
|
-
function recordSent(resolvedPath,
|
|
29
|
-
lastSent.set(cacheKey(resolvedPath,
|
|
36
|
+
function recordSent(resolvedPath, view, hash) {
|
|
37
|
+
lastSent.set(cacheKey(resolvedPath, view), hash);
|
|
38
|
+
}
|
|
39
|
+
/** Test seam — the map is process-global and would otherwise leak between test cases. */
|
|
40
|
+
function resetReadCache() {
|
|
41
|
+
lastSent.clear();
|
|
30
42
|
}
|
|
31
43
|
//# sourceMappingURL=ReadWorkspaceCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadWorkspaceCache.js","sourceRoot":"","sources":["../../../src/utils/ReadWorkspaceCache.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"ReadWorkspaceCache.js","sourceRoot":"","sources":["../../../src/utils/ReadWorkspaceCache.ts"],"names":[],"mappings":";;;;;AAyCA,4CAKC;AAGD,gCAEC;AAGD,wCAEC;AAxDD,oDAA4B;AAE5B,mFAAmF;AACnF,iFAAiF;AACjF,8EAA8E;AAC9E,2DAA2D;AAC3D,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE3C,SAAS,MAAM,CAAC,OAAe;IAC7B,OAAO,gBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAcD,SAAS,QAAQ,CAAC,YAAoB,EAAE,IAAc;IACpD,MAAM,KAAK,GAAG;QACZ,YAAY;QACZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QAC1B,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QAC9B,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG;QACrC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG;KACpC,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAOD,mFAAmF;AACnF,SAAgB,gBAAgB,CAAC,YAAoB,EAAE,IAAc,EAAE,UAAkB;IACvF,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAC7C,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC;AAED,uFAAuF;AACvF,SAAgB,UAAU,CAAC,YAAoB,EAAE,IAAc,EAAE,IAAY;IAC3E,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,yFAAyF;AACzF,SAAgB,cAAc;IAC5B,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* This text is injected into the system prompt and re-sent on every turn of the session, so
|
|
4
|
+
* its length is a recurring charge against the very savings it asks for. It is kept to the
|
|
5
|
+
* rules that change behaviour or protect correctness; anything that only restates good default
|
|
6
|
+
* behaviour (be concise, don't pad) was removed rather than paid for on every request.
|
|
7
|
+
*
|
|
8
|
+
* The full rationale and scoring model live in the `lemma-turbomode` prompt resource, which
|
|
9
|
+
* the client can fetch on demand instead of carrying permanently.
|
|
10
|
+
*/
|
|
11
|
+
export declare const LEMMA_TURBOMODE_PROMPT = "You are operating in LEMMA TURBOMODE. Reduce what enters the model's context \u2014 file reads, command output, repeated reasoning \u2014 without ever costing the user a correct answer. Lemma's own overhead (this prompt + every tool schema) is charged to the ledger before a single token is saved, so optimize for real net savings, not for a multiplier.\n\n## RULES\n\n**0. Tool calls cost tokens too.** A call and its result stay in the transcript and are re-sent every later turn. Expect a Lemma tool to save more than that round-trip costs \u2014 on a small file or short command, reading it directly is cheaper. Never call a reporting tool on a schedule.\n\n**0b. The advertised list is not everything Lemma has.** Situational schemas are withheld to keep per-turn cost down. Before concluding Lemma can't do something, call `lemma_toolbox` (action=\"list\" with a query), then action=\"call\".\n\n**1. Compression is for YOUR context only.** NEVER hand a compressed version to the user \u2014 they get the real, complete file, comments and imports intact. If you reasoned over a squeezed version, re-fetch the original before presenting it.\n\n**2. A cache hit is a hint, not an answer.** `smarter_cache` requires similarity >= 0.8. Always tell the user the answer came from cache. If they're about to act on it (run a command, apply a patch, ship code), verify against current state first \u2014 cached answers go stale. On a MISS or any doubt, reason normally.\n\n**3. Locate before reading only when locating is cheaper.** Don't know which file? `get_ast_hologram` / `search_workspace` beats reading candidates one by one. Already know the file? Read it \u2014 a lookup round-trip on a small file costs more than the file. `read_workspace_file` carries real line numbers and takes offset/limit, so prefer a targeted range on large files.\n\n**4. store_memory only after verification.** Store once the fix actually worked (tests pass, build succeeded, user confirmed) \u2014 not your first attempt. A wrong answer stored here becomes a false cache hit for a future session, and unwinding that costs far more than it saved.\n\n**5. Never trade a required disclosure for brevity.** A cache-hit source or a risky/irreversible action is not filler. One short line.\n\n**6. File-dependent questions \u2192 state_hash_cache, not smarter_cache.** It only hits when the referenced files' hashes are unchanged: a guaranteed-valid answer instead of a similarity guess. Look up before, store after. Use `smarter_cache` only for file-independent questions.\n\n**7. Edit in place.** `apply_workspace_patch` or `surgical_ast_insert` over rewriting a file with `write_workspace_file`; reserve the full write for renames, structural rewrites and new files. For mechanical work, `get_routing_advice` says whether a cheaper model suffices.\n\n**8. \"How much did we save\" \u2192 token_receipt, don't estimate.** It returns a real auditable log. Show the byType breakdown so the user can verify it.\n\n**9. What the toolbox hands you is a candidate, not a verdict.** Auto-fixes, cached patterns and Brain-suggested patches are suggestions. Check a fix addresses the actual failing assertion before applying it.\n\n## SCORING\nCorrectness first, then cost \u2014 a fast wrong answer costs more than a slow right one once you count the round-trip to fix it. A verified cache hit is best; a MISS followed by reasoning from scratch is the normal GOOD outcome, not a failure. A cached or auto-fixed result delivered without disclosure or verification is a FAIL regardless of tokens saved.\n\nFewer tokens for the SAME quality of answer \u2014 never a worse answer for fewer tokens.";
|
|
3
12
|
export declare function setupPromptsHandlers(server: Server): void;
|
|
4
13
|
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/mcp/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/mcp/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,slHA6BkD,CAAC;AAEtF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA8BzD"}
|
package/dist/esm/mcp/prompts.js
CHANGED
|
@@ -1,91 +1,43 @@
|
|
|
1
1
|
import { GetPromptRequestSchema, ListPromptsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* This text is injected into the system prompt and re-sent on every turn of the session, so
|
|
4
|
+
* its length is a recurring charge against the very savings it asks for. It is kept to the
|
|
5
|
+
* rules that change behaviour or protect correctness; anything that only restates good default
|
|
6
|
+
* behaviour (be concise, don't pad) was removed rather than paid for on every request.
|
|
7
|
+
*
|
|
8
|
+
* The full rationale and scoring model live in the `lemma-turbomode` prompt resource, which
|
|
9
|
+
* the client can fetch on demand instead of carrying permanently.
|
|
10
|
+
*/
|
|
11
|
+
export const LEMMA_TURBOMODE_PROMPT = `You are operating in LEMMA TURBOMODE. Reduce what enters the model's context — file reads, command output, repeated reasoning — without ever costing the user a correct answer. Lemma's own overhead (this prompt + every tool schema) is charged to the ledger before a single token is saved, so optimize for real net savings, not for a multiplier.
|
|
3
12
|
|
|
4
|
-
|
|
13
|
+
## RULES
|
|
5
14
|
|
|
6
|
-
|
|
15
|
+
**0. Tool calls cost tokens too.** A call and its result stay in the transcript and are re-sent every later turn. Expect a Lemma tool to save more than that round-trip costs — on a small file or short command, reading it directly is cheaper. Never call a reporting tool on a schedule.
|
|
7
16
|
|
|
8
|
-
|
|
9
|
-
A tool call and its result both stay in the transcript and are re-sent on every later turn. Before calling a Lemma tool, expect it to save more than that round-trip costs — on a small file or a short command, reading it directly is cheaper. Never call a reporting tool on a schedule: a report is not work. Call one only when the user asks how the session is going.
|
|
17
|
+
**0b. The advertised list is not everything Lemma has.** Situational schemas are withheld to keep per-turn cost down. Before concluding Lemma can't do something, call \`lemma_toolbox\` (action="list" with a query), then action="call".
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
Schemas for situational tools are withheld from this session to keep the per-turn cost down. When
|
|
13
|
-
no advertised tool fits, call \`lemma_toolbox\` (action="list" with a query) before concluding
|
|
14
|
-
Lemma can't do it, then action="call" to run what you find. Never tell the user a capability is
|
|
15
|
-
missing without checking the toolbox first.
|
|
19
|
+
**1. Compression is for YOUR context only.** NEVER hand a compressed version to the user — they get the real, complete file, comments and imports intact. If you reasoned over a squeezed version, re-fetch the original before presenting it.
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
Lemma's compressors (turbosqueeze, wormhole_squeeze, squeeze_prompt — via the toolbox) exist to
|
|
19
|
-
shrink code before it enters your own reasoning window. NEVER hand a compressed version to the
|
|
20
|
-
user: they get the real, complete file (comments, imports, formatting intact) so it stays
|
|
21
|
-
copy-pasteable and correct. If you reasoned over a squeezed version, re-fetch the untouched
|
|
22
|
-
original before presenting it.
|
|
21
|
+
**2. A cache hit is a hint, not an answer.** \`smarter_cache\` requires similarity >= 0.8. Always tell the user the answer came from cache. If they're about to act on it (run a command, apply a patch, ship code), verify against current state first — cached answers go stale. On a MISS or any doubt, reason normally.
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
Call \`smarter_cache\` with the user's question before reasoning from scratch — a hit can save
|
|
26
|
-
time. But NEVER return a cache hit verbatim as if freshly reasoned:
|
|
27
|
-
- Require similarity >= 0.8 (raised from 0.75 — 0.75 was matching questions that weren't
|
|
28
|
-
actually the same question).
|
|
29
|
-
- Always tell the user the answer came from cache (e.g. "from a cached earlier answer:").
|
|
30
|
-
- If the user is about to act on the answer (run a command, apply a patch, ship code), verify
|
|
31
|
-
it against current file/tool state before using it — cached answers can be stale.
|
|
32
|
-
- On a MISS, or on any doubt, reason normally.
|
|
23
|
+
**3. Locate before reading only when locating is cheaper.** Don't know which file? \`get_ast_hologram\` / \`search_workspace\` beats reading candidates one by one. Already know the file? Read it — a lookup round-trip on a small file costs more than the file. \`read_workspace_file\` carries real line numbers and takes offset/limit, so prefer a targeted range on large files.
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
NEVER read files blindly. Always call \`get_ast_hologram\` first to locate the exact symbols you need. Then read only those specific files. Each unnecessary file read wastes 1000+ tokens.
|
|
25
|
+
**4. store_memory only after verification.** Store once the fix actually worked (tests pass, build succeeded, user confirmed) — not your first attempt. A wrong answer stored here becomes a false cache hit for a future session, and unwinding that costs far more than it saved.
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
Store via \`store_memory\` once you've confirmed the fix/answer actually worked (tests pass,
|
|
39
|
-
the user confirmed, the build succeeded) — not the first thing you tried. A wrong answer stored
|
|
40
|
-
here becomes a "cache hit" served to a future session, and unwinding that costs far more than
|
|
41
|
-
the tokens it saved. Verified answers are still free to cache aggressively.
|
|
27
|
+
**5. Never trade a required disclosure for brevity.** A cache-hit source or a risky/irreversible action is not filler. One short line.
|
|
42
28
|
|
|
43
|
-
|
|
44
|
-
- No "Sure, I can help you with that" — just do it.
|
|
45
|
-
- No unnecessary explanation of what you did — unless asked.
|
|
46
|
-
- No repeating the user's question back to them.
|
|
47
|
-
- Exception: disclosures required elsewhere in these rules (cache-hit source per rule 2,
|
|
48
|
-
a risky/irreversible action) are never fluff — say them in one short line. Conciseness trims
|
|
49
|
-
filler, not information the user needs to trust the answer.
|
|
29
|
+
**6. File-dependent questions → state_hash_cache, not smarter_cache.** It only hits when the referenced files' hashes are unchanged: a guaranteed-valid answer instead of a similarity guess. Look up before, store after. Use \`smarter_cache\` only for file-independent questions.
|
|
50
30
|
|
|
51
|
-
|
|
52
|
-
If the question depends on the current content of specific files (not just "similar wording"),
|
|
53
|
-
call \`state_hash_cache\` (action="lookup") instead of \`smarter_cache\`. It only returns a hit
|
|
54
|
-
when the referenced files' content hashes are unchanged — a guaranteed-valid answer, not a
|
|
55
|
-
similarity guess. After answering, call it again with action="store" to cache it. Use
|
|
56
|
-
\`smarter_cache\` only for file-independent questions (explanations, general how-tos).
|
|
31
|
+
**7. Edit in place.** \`apply_workspace_patch\` or \`surgical_ast_insert\` over rewriting a file with \`write_workspace_file\`; reserve the full write for renames, structural rewrites and new files. For mechanical work, \`get_routing_advice\` says whether a cheaper model suffices.
|
|
57
32
|
|
|
58
|
-
|
|
59
|
-
Before a mechanical/low-complexity task (formatting, boilerplate, simple lookups), call
|
|
60
|
-
\`get_routing_advice\` with the task prompt. If it recommends a cheaper model and the current
|
|
61
|
-
provider supports switching, say so instead of silently burning a large-model budget on trivial work.
|
|
33
|
+
**8. "How much did we save" → token_receipt, don't estimate.** It returns a real auditable log. Show the byType breakdown so the user can verify it.
|
|
62
34
|
|
|
63
|
-
|
|
64
|
-
When adding a method/function/property to an existing class, interface, or file, prefer
|
|
65
|
-
\`surgical_ast_insert\` over regenerating and rewriting the whole file. Only fall back to a full
|
|
66
|
-
\`write_workspace_file\` when the change isn't a clean insertion (renames, structural rewrites,
|
|
67
|
-
new files).
|
|
35
|
+
**9. What the toolbox hands you is a candidate, not a verdict.** Auto-fixes, cached patterns and Brain-suggested patches are suggestions. Check a fix addresses the actual failing assertion before applying it.
|
|
68
36
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
semantic cache hits, file reads, fresh reasoning) — not a projected percentage. Use it instead of
|
|
72
|
-
inventing a savings number, and show the byType breakdown so the user can verify it themselves.
|
|
37
|
+
## SCORING
|
|
38
|
+
Correctness first, then cost — a fast wrong answer costs more than a slow right one once you count the round-trip to fix it. A verified cache hit is best; a MISS followed by reasoning from scratch is the normal GOOD outcome, not a failure. A cached or auto-fixed result delivered without disclosure or verification is a FAIL regardless of tokens saved.
|
|
73
39
|
|
|
74
|
-
|
|
75
|
-
Tools reached via \`lemma_toolbox\` (auto-fixes for failing tests, cached prompt patterns,
|
|
76
|
-
Brain-suggested patches) return suggestions. Check a suggested fix actually addresses the failing
|
|
77
|
-
assertion before applying it — a wrong auto-fix applied blind costs far more (broken build,
|
|
78
|
-
debugging round-trip) than the tokens saved by skipping the check.
|
|
79
|
-
|
|
80
|
-
## TURBOMODE SCORING
|
|
81
|
-
Correctness first, then cost — a fast wrong answer is more expensive than a slow right one once
|
|
82
|
-
you count the round-trip to find and fix it.
|
|
83
|
-
- Verified cache hit (state_hash_cache, or a disclosed smarter_cache hit above threshold) = best outcome: correct AND ~0 tokens spent.
|
|
84
|
-
- Cache MISS + reasoning from scratch = the normal, GOOD outcome whenever no verified cache exists. Reasoning is not a failure mode — it's what you do when you don't already have a trustworthy answer.
|
|
85
|
-
- Reading full files without checking get_ast_hologram first = wasteful, avoid it when a cheaper lookup would've told you what you needed.
|
|
86
|
-
- Any answer delivered without required disclosure (rule 6's exception), or a cached/auto-fixed result used without verification = FAIL, regardless of tokens saved — it can cost the user far more than tokens once it's wrong.
|
|
87
|
-
|
|
88
|
-
Remember: the goal is spending fewer tokens on the SAME quality of answer, not a lower-quality answer for fewer tokens.`;
|
|
40
|
+
Fewer tokens for the SAME quality of answer — never a worse answer for fewer tokens.`;
|
|
89
41
|
export function setupPromptsHandlers(server) {
|
|
90
42
|
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
91
43
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/mcp/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAEtG,MAAM,CAAC,MAAM,sBAAsB,GAAG
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/mcp/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAEtG;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qFA6B+C,CAAC;AAEtF,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,MAAM,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QAC5D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,iBAAiB;oBACvB,WAAW,EAAE,+MAA+M;oBAC5N,SAAS,EAAE,EAAE;iBACd;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACjE,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YAC9C,OAAO;gBACL,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE;4BACP,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,sBAAsB;yBAC7B;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -40,10 +40,19 @@ export interface ResolvedToolSurface<T extends {
|
|
|
40
40
|
/** Situational groups that matched this project. */
|
|
41
41
|
activeGroups: string[];
|
|
42
42
|
}
|
|
43
|
+
export interface ResolveOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Returns false for a tool this session is not licensed to run. Such a tool must not be
|
|
46
|
+
* advertised: its schema would be re-sent every turn purely to be refused at call time.
|
|
47
|
+
* It stays registered and discoverable through `lemma_toolbox`, which is where a user
|
|
48
|
+
* finds out the capability exists and what it takes to unlock it.
|
|
49
|
+
*/
|
|
50
|
+
isEntitled?: (name: string) => boolean;
|
|
51
|
+
}
|
|
43
52
|
export declare function resolveToolSurface<T extends {
|
|
44
53
|
name: string;
|
|
45
54
|
description?: string;
|
|
46
|
-
}>(allDefinitions: T[], cwd?: string): ResolvedToolSurface<T>;
|
|
55
|
+
}>(allDefinitions: T[], cwd?: string, options?: ResolveOptions): ResolvedToolSurface<T>;
|
|
47
56
|
/**
|
|
48
57
|
* One-line-per-tool catalog of everything not advertised, so the model can find and
|
|
49
58
|
* invoke a hidden tool without its schema having been resident all session.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-profiles.d.ts","sourceRoot":"","sources":["../../../src/mcp/tool-profiles.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,EA0BnC,CAAC;AA4DF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UAAoE,CAAC;AAkBnG,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;IAC7D,OAAO,EAAE,WAAW,CAAC;IACrB,wCAAwC;IACxC,UAAU,EAAE,CAAC,EAAE,CAAC;IAChB,uFAAuF;IACvF,MAAM,EAAE,CAAC,EAAE,CAAC;IACZ,oDAAoD;IACpD,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EA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iguredProfile(cwd) {
|
|
|
105
105
|
return env;
|
|
106
106
|
return "auto";
|
|
107
107
|
}
|
|
108
|
-
export function resolveToolSurface(allDefinitions, cwd = process.cwd()) {
|
|
108
|
+
export function resolveToolSurface(allDefinitions, cwd = process.cwd(), options = {}) {
|
|
109
109
|
const profile = readConfiguredProfile(cwd);
|
|
110
|
+
// `lemma_toolbox` is the only route back to a withheld schema, so no entitlement check may
|
|
111
|
+
// ever remove it — doing so would turn every deferred tool into an unreachable one.
|
|
112
|
+
const entitlementCheck = options.isEntitled ?? (() => true);
|
|
113
|
+
const isEntitled = (name) => name === "lemma_toolbox" || entitlementCheck(name);
|
|
110
114
|
if (profile === "full") {
|
|
111
|
-
|
|
115
|
+
const advertised = [];
|
|
116
|
+
const hidden = [];
|
|
117
|
+
for (const def of allDefinitions) {
|
|
118
|
+
(isEntitled(def.name) ? advertised : hidden).push(def);
|
|
119
|
+
}
|
|
120
|
+
return { profile, advertised, hidden, activeGroups: ["*"] };
|
|
112
121
|
}
|
|
113
122
|
// Always advertised: it is the only route back to a withheld schema, so hiding it
|
|
114
123
|
// would turn a deferred tool into a lost one.
|
|
@@ -133,7 +142,7 @@ export function resolveToolSurface(allDefinitions, cwd = process.cwd()) {
|
|
|
133
142
|
const advertised = [];
|
|
134
143
|
const hidden = [];
|
|
135
144
|
for (const def of allDefinitions) {
|
|
136
|
-
(allowed.has(def.name) ? advertised : hidden).push(def);
|
|
145
|
+
(allowed.has(def.name) && isEntitled(def.name) ? advertised : hidden).push(def);
|
|
137
146
|
}
|
|
138
147
|
return { profile, advertised, hidden, activeGroups };
|
|
139
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-profiles.js","sourceRoot":"","sources":["../../../src/mcp/tool-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAsBxB;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,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C,CAAC,CAAC,EAAE,CAAC;QACrF,EAAE;QACF,2GAA2G;KAC5G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA0kCnE,oFAAoF;AACpF,wBAAgB,kBAAkB,IAAI,MAAM,CAM3C;AAED,oEAAoE;AACpE,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AAED,iEAAiE;AACjE,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,IAAI;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAQA;AAqHD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,IAAI,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqCD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAC1C,IAAI,CAwEN"}
|