ctxjev-mcp 0.1.9 → 0.1.11
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/schemas.d.ts +2 -1
- package/dist/schemas.js +12 -5
- package/dist/schemas.js.map +1 -1
- package/package.json +2 -2
package/dist/schemas.d.ts
CHANGED
|
@@ -44,5 +44,6 @@ export declare const pruneHistoryInput: {
|
|
|
44
44
|
};
|
|
45
45
|
/** dropBelow/summarizeBelow are each in range on their own, but nothing above stops a reversed
|
|
46
46
|
* pair from making 'summarize' unreachable — check the actual values a call resolves to
|
|
47
|
-
* (including the defaults) before running it.
|
|
47
|
+
* (including the defaults) before running it. The invariant itself lives in ctxjev-core; this
|
|
48
|
+
* just formats the MCP-facing field names into the error. */
|
|
48
49
|
export declare function validatePolicyOrdering(dropBelow: number, summarizeBelow: number): void;
|
package/dist/schemas.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DEFAULT_POLICY } from 'ctxjev-core';
|
|
2
|
+
import { DEFAULT_POLICY, isValidPolicyOrdering } from 'ctxjev-core';
|
|
3
3
|
// Entries are billed per input token and, per ctxjev-core's own Entry doc, meant to be a short
|
|
4
4
|
// excerpt rather than a full payload — cap both dimensions at the MCP boundary instead of
|
|
5
5
|
// trusting every caller to already know that.
|
|
6
6
|
const MAX_ENTRIES = 500;
|
|
7
7
|
const MAX_CONTENT_LENGTH = 4000;
|
|
8
|
+
// goal gets embedded into state.goal on every chunked Jev request (jevClient.ts) — an oversized
|
|
9
|
+
// goal is billed once per chunk, not once per call, and deserves the same cap as content.
|
|
10
|
+
const MAX_GOAL_LENGTH = 2000;
|
|
8
11
|
export const entrySchema = z.object({
|
|
9
12
|
id: z.string().min(1),
|
|
10
13
|
role: z.enum(['user', 'assistant', 'tool']),
|
|
11
14
|
toolName: z.string().optional(),
|
|
12
15
|
content: z.string().max(MAX_CONTENT_LENGTH),
|
|
13
|
-
|
|
16
|
+
// .finite() — bare z.number() only rejects NaN, not Infinity/-Infinity. core's computeRecency
|
|
17
|
+
// takes min/max across the whole batch, so one infinite timestamp turns every entry's recency
|
|
18
|
+
// (and thus combinedScore) into NaN, not just the offending entry's.
|
|
19
|
+
timestamp: z.number().finite(),
|
|
14
20
|
});
|
|
15
21
|
export const scoreRelevanceInput = {
|
|
16
|
-
goal: z.string().min(1).describe('The current task/goal to judge each entry\'s relevance against.'),
|
|
22
|
+
goal: z.string().min(1).max(MAX_GOAL_LENGTH).describe('The current task/goal to judge each entry\'s relevance against.'),
|
|
17
23
|
entries: z.array(entrySchema).max(MAX_ENTRIES).describe('The agent history entries to score.'),
|
|
18
24
|
recencyWeight: z
|
|
19
25
|
.number()
|
|
@@ -34,9 +40,10 @@ export const pruneHistoryInput = {
|
|
|
34
40
|
};
|
|
35
41
|
/** dropBelow/summarizeBelow are each in range on their own, but nothing above stops a reversed
|
|
36
42
|
* pair from making 'summarize' unreachable — check the actual values a call resolves to
|
|
37
|
-
* (including the defaults) before running it.
|
|
43
|
+
* (including the defaults) before running it. The invariant itself lives in ctxjev-core; this
|
|
44
|
+
* just formats the MCP-facing field names into the error. */
|
|
38
45
|
export function validatePolicyOrdering(dropBelow, summarizeBelow) {
|
|
39
|
-
if (dropBelow
|
|
46
|
+
if (!isValidPolicyOrdering(dropBelow, summarizeBelow)) {
|
|
40
47
|
throw new Error(`dropBelow (${dropBelow}) must not be greater than summarizeBelow (${summarizeBelow})`);
|
|
41
48
|
}
|
|
42
49
|
}
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"m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cAAc,CAAC,aAAa,GAAG,CAAC;CACnJ,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,GAAG,mBAAmB;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qEAAqE,cAAc,CAAC,SAAS,GAAG,CAAC;IACzJ,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,kGAAkG,cAAc,CAAC,cAAc,GAAG,CAAC;CAChJ,CAAA;AAED;;;6DAG6D;AAC7D,MAAM,UAAU,sBAAsB,CAAC,SAAiB,EAAE,cAAsB;IAC9E,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,8CAA8C,cAAc,GAAG,CAAC,CAAA;IACzG,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctxjev-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "MCP server exposing ctxjev's Jev-based context scoring/pruning as tools for any MCP-capable agent host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
42
42
|
"zod": "^4.6.5",
|
|
43
|
-
"ctxjev-core": "0.1.
|
|
43
|
+
"ctxjev-core": "0.1.11"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22",
|