@kinqs/brainrouter-mcp-server 0.3.5 → 0.3.7
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/.env.example +121 -71
- package/README.md +1 -1
- package/dist/__tests__/cognitive-extractor.test.js +112 -0
- package/dist/__tests__/crypto.test.js +8 -1
- package/dist/__tests__/working-memory.test.js +67 -0
- package/dist/api/auth/crypto.js +8 -3
- package/dist/index.js +1 -1
- package/dist/memory/engine.js +21 -1
- package/dist/memory/pipeline/cognitive-extractor.js +19 -1
- package/dist/memory/recall.d.ts +3 -1
- package/dist/memory/recall.js +48 -3
- package/dist/memory/store/relevance-judge.d.ts +51 -0
- package/dist/memory/store/relevance-judge.js +196 -0
- package/dist/memory/working/canvas.js +11 -0
- package/docs/specs/0.3.7-terminal-ui-redesign.md +259 -0
- package/package.json +2 -2
- package/dist/memory/config.d.ts +0 -2
- package/dist/memory/config.js +0 -3
- package/dist/memory/pipeline/l1-contradiction.d.ts +0 -7
- package/dist/memory/pipeline/l1-contradiction.js +0 -66
- package/dist/memory/pipeline/l1-dedup.d.ts +0 -23
- package/dist/memory/pipeline/l1-dedup.js +0 -39
- package/dist/memory/pipeline/l1-extractor.d.ts +0 -21
- package/dist/memory/pipeline/l1-extractor.js +0 -180
- package/dist/memory/pipeline/l2-direction-shift.d.ts +0 -10
- package/dist/memory/pipeline/l2-direction-shift.js +0 -27
- package/dist/memory/pipeline/l2-scene.d.ts +0 -15
- package/dist/memory/pipeline/l2-scene.js +0 -140
- package/dist/memory/pipeline/l3-distiller.d.ts +0 -15
- package/dist/memory/pipeline/l3-distiller.js +0 -40
- package/dist/memory/pipeline/task-queue.d.ts +0 -54
- package/dist/memory/pipeline/task-queue.js +0 -117
- package/dist/memory/prompts/graph-extraction-batch.d.ts +0 -14
- package/dist/memory/prompts/graph-extraction-batch.js +0 -54
- package/dist/memory/prompts/l1-contradiction-batch.d.ts +0 -16
- package/dist/memory/prompts/l1-contradiction-batch.js +0 -47
- package/dist/memory/prompts/l1-contradiction.d.ts +0 -1
- package/dist/memory/prompts/l1-contradiction.js +0 -25
- package/dist/memory/prompts/l1-extraction.d.ts +0 -10
- package/dist/memory/prompts/l1-extraction.js +0 -114
- package/dist/memory/prompts/l2-direction-shift.d.ts +0 -5
- package/dist/memory/prompts/l2-direction-shift.js +0 -32
- package/dist/memory/prompts/l2-scene-cluster.d.ts +0 -2
- package/dist/memory/prompts/l2-scene-cluster.js +0 -33
- package/dist/memory/prompts/l2-scene.d.ts +0 -7
- package/dist/memory/prompts/l2-scene.js +0 -40
- package/dist/memory/prompts/l3-persona.d.ts +0 -6
- package/dist/memory/prompts/l3-persona.js +0 -60
- package/dist/memory/store/types.d.ts +0 -101
- package/dist/memory/store/types.js +0 -1
- package/dist/memory/types.d.ts +0 -207
- package/dist/memory/types.js +0 -7
- package/dist/memory/validation.d.ts +0 -441
- package/dist/memory/validation.js +0 -129
- package/dist/tools/agent_memory_tools.d.ts +0 -485
- package/dist/tools/agent_memory_tools.js +0 -793
- package/dist/tools/get_doc.d.ts +0 -21
- package/dist/tools/get_doc.js +0 -24
- package/dist/tools/list_docs.d.ts +0 -15
- package/dist/tools/list_docs.js +0 -16
- package/dist/tools/update_doc.d.ts +0 -24
- package/dist/tools/update_doc.js +0 -35
- /package/dist/__tests__/{agent_mode.test.d.ts → cognitive-extractor.test.d.ts} +0 -0
package/dist/tools/get_doc.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { Registry } from '../registry.js';
|
|
3
|
-
export declare const getDocSchema: z.ZodObject<{
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
section: z.ZodOptional<z.ZodString>;
|
|
6
|
-
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
name: string;
|
|
8
|
-
section?: string | undefined;
|
|
9
|
-
}, {
|
|
10
|
-
name: string;
|
|
11
|
-
section?: string | undefined;
|
|
12
|
-
}>;
|
|
13
|
-
export declare function getDoc(registry: Registry, args: z.infer<typeof getDocSchema>): Promise<{
|
|
14
|
-
content: {
|
|
15
|
-
type: string;
|
|
16
|
-
text: string;
|
|
17
|
-
}[];
|
|
18
|
-
metadata: {
|
|
19
|
-
tokenEstimate: number;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
package/dist/tools/get_doc.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { loadDocSection } from '../loader.js';
|
|
3
|
-
export const getDocSchema = z.object({
|
|
4
|
-
name: z.string(),
|
|
5
|
-
section: z.string().optional(),
|
|
6
|
-
});
|
|
7
|
-
export async function getDoc(registry, args) {
|
|
8
|
-
const manifest = registry.getDoc(args.name);
|
|
9
|
-
if (!manifest) {
|
|
10
|
-
throw new Error(`Document "${args.name}" not found.`);
|
|
11
|
-
}
|
|
12
|
-
const fragment = loadDocSection(manifest.filePath, args.section);
|
|
13
|
-
return {
|
|
14
|
-
content: [
|
|
15
|
-
{
|
|
16
|
-
type: 'text',
|
|
17
|
-
text: fragment.content,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
metadata: {
|
|
21
|
-
tokenEstimate: fragment.tokenEstimate,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { Registry } from '../registry.js';
|
|
3
|
-
export declare const listDocsSchema: z.ZodObject<{
|
|
4
|
-
category: z.ZodOptional<z.ZodEnum<["api", "design", "schema", "deployment", "hooks", "strategy", "other"]>>;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
category?: "api" | "design" | "schema" | "deployment" | "hooks" | "strategy" | "other" | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
category?: "api" | "design" | "schema" | "deployment" | "hooks" | "strategy" | "other" | undefined;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function listDocs(registry: Registry, args: z.infer<typeof listDocsSchema>): Promise<{
|
|
11
|
-
content: {
|
|
12
|
-
type: string;
|
|
13
|
-
text: string;
|
|
14
|
-
}[];
|
|
15
|
-
}>;
|
package/dist/tools/list_docs.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const listDocsSchema = z.object({
|
|
3
|
-
category: z.enum(['api', 'design', 'schema', 'deployment', 'hooks', 'strategy', 'other']).optional(),
|
|
4
|
-
});
|
|
5
|
-
export async function listDocs(registry, args) {
|
|
6
|
-
const docs = registry.listDocs(args.category);
|
|
7
|
-
const sanitized = docs.map(({ filePath, ...rest }) => rest);
|
|
8
|
-
return {
|
|
9
|
-
content: [
|
|
10
|
-
{
|
|
11
|
-
type: 'text',
|
|
12
|
-
text: JSON.stringify(sanitized, null, 2),
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { Registry } from '../registry.js';
|
|
3
|
-
export declare const updateDocSchema: z.ZodObject<{
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
section: z.ZodString;
|
|
6
|
-
content: z.ZodString;
|
|
7
|
-
createIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
name: string;
|
|
10
|
-
content: string;
|
|
11
|
-
section: string;
|
|
12
|
-
createIfMissing: boolean;
|
|
13
|
-
}, {
|
|
14
|
-
name: string;
|
|
15
|
-
content: string;
|
|
16
|
-
section: string;
|
|
17
|
-
createIfMissing?: boolean | undefined;
|
|
18
|
-
}>;
|
|
19
|
-
export declare function updateDoc(registry: Registry, args: z.infer<typeof updateDocSchema>): Promise<{
|
|
20
|
-
content: {
|
|
21
|
-
type: string;
|
|
22
|
-
text: string;
|
|
23
|
-
}[];
|
|
24
|
-
}>;
|
package/dist/tools/update_doc.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { updateDocSection } from '../writer.js';
|
|
4
|
-
export const updateDocSchema = z.object({
|
|
5
|
-
name: z.string(),
|
|
6
|
-
section: z.string(),
|
|
7
|
-
content: z.string(),
|
|
8
|
-
createIfMissing: z.boolean().optional().default(true),
|
|
9
|
-
});
|
|
10
|
-
export async function updateDoc(registry, args) {
|
|
11
|
-
const localRoot = registry.getLocalRoot();
|
|
12
|
-
if (!localRoot) {
|
|
13
|
-
throw new Error('No local root detected. Documentation updates are only allowed in project repositories.');
|
|
14
|
-
}
|
|
15
|
-
const manifest = registry.getDoc(args.name);
|
|
16
|
-
let filePath;
|
|
17
|
-
if (manifest) {
|
|
18
|
-
filePath = manifest.filePath;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
if (!args.createIfMissing) {
|
|
22
|
-
throw new Error(`Document "${args.name}" not found.`);
|
|
23
|
-
}
|
|
24
|
-
filePath = join(localRoot, 'docs', `${args.name}.md`);
|
|
25
|
-
}
|
|
26
|
-
updateDocSection(filePath, args.section, args.content, localRoot, args.createIfMissing);
|
|
27
|
-
return {
|
|
28
|
-
content: [
|
|
29
|
-
{
|
|
30
|
-
type: 'text',
|
|
31
|
-
text: `Successfully updated section "${args.section}" in ${manifest ? manifest.name : args.name}.`,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
}
|
|
File without changes
|