@j0hanz/memdb 1.0.7 → 1.0.8
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 +55 -26
- package/package.json +5 -6
- package/dist/core/database.d.ts +0 -4
- package/dist/core/database.d.ts.map +0 -1
- package/dist/core/database.js +0 -81
- package/dist/core/database.js.map +0 -1
- package/dist/core/db-helpers.d.ts +0 -10
- package/dist/core/db-helpers.d.ts.map +0 -1
- package/dist/core/db-helpers.js +0 -17
- package/dist/core/db-helpers.js.map +0 -1
- package/dist/core/db-worker-client.d.ts +0 -8
- package/dist/core/db-worker-client.d.ts.map +0 -1
- package/dist/core/db-worker-client.js +0 -67
- package/dist/core/db-worker-client.js.map +0 -1
- package/dist/core/db-worker-protocol.d.ts +0 -77
- package/dist/core/db-worker-protocol.d.ts.map +0 -1
- package/dist/core/db-worker-protocol.js +0 -2
- package/dist/core/db-worker-protocol.js.map +0 -1
- package/dist/core/db-worker.d.ts +0 -2
- package/dist/core/db-worker.d.ts.map +0 -1
- package/dist/core/db-worker.js +0 -73
- package/dist/core/db-worker.js.map +0 -1
- package/dist/core/memory-helpers.d.ts +0 -3
- package/dist/core/memory-helpers.d.ts.map +0 -1
- package/dist/core/memory-helpers.js +0 -18
- package/dist/core/memory-helpers.js.map +0 -1
- package/dist/core/memory-mappers.d.ts +0 -11
- package/dist/core/memory-mappers.d.ts.map +0 -1
- package/dist/core/memory-mappers.js +0 -52
- package/dist/core/memory-mappers.js.map +0 -1
- package/dist/core/memory-search.d.ts +0 -9
- package/dist/core/memory-search.d.ts.map +0 -1
- package/dist/core/memory-search.js +0 -46
- package/dist/core/memory-search.js.map +0 -1
- package/dist/core/memory-service-core.d.ts +0 -9
- package/dist/core/memory-service-core.d.ts.map +0 -1
- package/dist/core/memory-service-core.js +0 -229
- package/dist/core/memory-service-core.js.map +0 -1
- package/dist/core/memory-service.d.ts +0 -11
- package/dist/core/memory-service.d.ts.map +0 -1
- package/dist/core/memory-service.js +0 -83
- package/dist/core/memory-service.js.map +0 -1
- package/dist/core/memory-stats.d.ts +0 -3
- package/dist/core/memory-stats.d.ts.map +0 -1
- package/dist/core/memory-stats.js +0 -44
- package/dist/core/memory-stats.js.map +0 -1
- package/dist/core/memory-types.d.ts +0 -18
- package/dist/core/memory-types.d.ts.map +0 -1
- package/dist/core/memory-types.js +0 -2
- package/dist/core/memory-types.js.map +0 -1
- package/dist/core/memory-updates.d.ts +0 -11
- package/dist/core/memory-updates.d.ts.map +0 -1
- package/dist/core/memory-updates.js +0 -102
- package/dist/core/memory-updates.js.map +0 -1
- package/dist/core/relation-queries.d.ts +0 -8
- package/dist/core/relation-queries.d.ts.map +0 -1
- package/dist/core/relation-queries.js +0 -107
- package/dist/core/relation-queries.js.map +0 -1
- package/dist/core/row-mappers.d.ts +0 -7
- package/dist/core/row-mappers.d.ts.map +0 -1
- package/dist/core/row-mappers.js +0 -52
- package/dist/core/row-mappers.js.map +0 -1
- package/dist/core/search-errors.d.ts +0 -2
- package/dist/core/search-errors.d.ts.map +0 -1
- package/dist/core/search-errors.js +0 -21
- package/dist/core/search-errors.js.map +0 -1
- package/dist/core/search.d.ts +0 -9
- package/dist/core/search.d.ts.map +0 -1
- package/dist/core/search.js +0 -57
- package/dist/core/search.js.map +0 -1
- package/dist/core/tag-helpers.d.ts +0 -2
- package/dist/core/tag-helpers.d.ts.map +0 -1
- package/dist/core/tag-helpers.js +0 -22
- package/dist/core/tag-helpers.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -131
- package/dist/index.js.map +0 -1
- package/dist/lib/errors.d.ts +0 -20
- package/dist/lib/errors.d.ts.map +0 -1
- package/dist/lib/errors.js +0 -20
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/tool_response.d.ts +0 -5
- package/dist/lib/tool_response.d.ts.map +0 -1
- package/dist/lib/tool_response.js +0 -7
- package/dist/lib/tool_response.js.map +0 -1
- package/dist/schemas/inputs.d.ts +0 -52
- package/dist/schemas/inputs.d.ts.map +0 -1
- package/dist/schemas/inputs.js +0 -134
- package/dist/schemas/inputs.js.map +0 -1
- package/dist/schemas/outputs.d.ts +0 -10
- package/dist/schemas/outputs.d.ts.map +0 -1
- package/dist/schemas/outputs.js +0 -30
- package/dist/schemas/outputs.js.map +0 -1
- package/dist/tools/delete-memory.d.ts +0 -3
- package/dist/tools/delete-memory.d.ts.map +0 -1
- package/dist/tools/delete-memory.js +0 -32
- package/dist/tools/delete-memory.js.map +0 -1
- package/dist/tools/get-memory.d.ts +0 -3
- package/dist/tools/get-memory.d.ts.map +0 -1
- package/dist/tools/get-memory.js +0 -32
- package/dist/tools/get-memory.js.map +0 -1
- package/dist/tools/get-related.d.ts +0 -3
- package/dist/tools/get-related.d.ts.map +0 -1
- package/dist/tools/get-related.js +0 -29
- package/dist/tools/get-related.js.map +0 -1
- package/dist/tools/index.d.ts +0 -3
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -147
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/link-memories.d.ts +0 -3
- package/dist/tools/link-memories.d.ts.map +0 -1
- package/dist/tools/link-memories.js +0 -29
- package/dist/tools/link-memories.js.map +0 -1
- package/dist/tools/memory-stats.d.ts +0 -3
- package/dist/tools/memory-stats.d.ts.map +0 -1
- package/dist/tools/memory-stats.js +0 -28
- package/dist/tools/memory-stats.js.map +0 -1
- package/dist/tools/search-memories.d.ts +0 -3
- package/dist/tools/search-memories.d.ts.map +0 -1
- package/dist/tools/search-memories.js +0 -29
- package/dist/tools/search-memories.js.map +0 -1
- package/dist/tools/store-memory.d.ts +0 -3
- package/dist/tools/store-memory.d.ts.map +0 -1
- package/dist/tools/store-memory.js +0 -29
- package/dist/tools/store-memory.js.map +0 -1
- package/dist/types/index.d.ts +0 -38
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/utils/config.d.ts +0 -10
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js +0 -75
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -10
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -21
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/protocol.d.ts +0 -2
- package/dist/utils/protocol.d.ts.map +0 -1
- package/dist/utils/protocol.js +0 -7
- package/dist/utils/protocol.js.map +0 -1
package/dist/lib/errors.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export function getErrorMessage(error) {
|
|
2
|
-
if (error instanceof Error)
|
|
3
|
-
return error.message;
|
|
4
|
-
if (typeof error === 'string' && error.length > 0)
|
|
5
|
-
return error;
|
|
6
|
-
return 'Unknown error';
|
|
7
|
-
}
|
|
8
|
-
export function createErrorResponse(code, message, result) {
|
|
9
|
-
const structured = {
|
|
10
|
-
ok: false,
|
|
11
|
-
error: { code, message },
|
|
12
|
-
...(result !== undefined && { result }),
|
|
13
|
-
};
|
|
14
|
-
return {
|
|
15
|
-
content: [{ type: 'text', text: JSON.stringify(structured) }],
|
|
16
|
-
structuredContent: structured,
|
|
17
|
-
isError: true,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/lib/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAChE,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,OAAe,EACf,MAAgB;IAEhB,MAAM,UAAU,GAAG;QACjB,EAAE,EAAE,KAAc;QAClB,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACxB,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,CAAC;KACxC,CAAC;IACF,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7D,iBAAiB,EAAE,UAAU;QAC7B,OAAO,EAAE,IAAa;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool_response.d.ts","sourceRoot":"","sources":["../../src/lib/tool_response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,iBAAiB,EAAE,CAAC,GACnB,cAAc,GAAG;IAAE,iBAAiB,EAAE,CAAC,CAAA;CAAE,CAK3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool_response.js","sourceRoot":"","sources":["../../src/lib/tool_response.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAChC,iBAAoB;IAEpB,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACpE,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
package/dist/schemas/inputs.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const StoreMemoryInputSchema: z.ZodObject<{
|
|
3
|
-
content: z.ZodString;
|
|
4
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5
|
-
importance: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
memoryType: z.ZodOptional<z.ZodString>;
|
|
7
|
-
}, z.core.$strict>;
|
|
8
|
-
export declare const SearchMemoriesInputSchema: z.ZodObject<{
|
|
9
|
-
query: z.ZodString;
|
|
10
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
12
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
-
minRelevance: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
}, z.core.$strict>;
|
|
15
|
-
export declare const GetMemoryInputSchema: z.ZodObject<{
|
|
16
|
-
hash: z.ZodString;
|
|
17
|
-
}, z.core.$strict>;
|
|
18
|
-
export declare const DeleteMemoryInputSchema: z.ZodObject<{
|
|
19
|
-
hash: z.ZodString;
|
|
20
|
-
}, z.core.$strict>;
|
|
21
|
-
export declare const LinkMemoriesInputSchema: z.ZodObject<{
|
|
22
|
-
fromHash: z.ZodString;
|
|
23
|
-
toHash: z.ZodString;
|
|
24
|
-
relationType: z.ZodString;
|
|
25
|
-
}, z.core.$strict>;
|
|
26
|
-
export declare const GetRelatedInputSchema: z.ZodObject<{
|
|
27
|
-
hash: z.ZodString;
|
|
28
|
-
relationType: z.ZodOptional<z.ZodString>;
|
|
29
|
-
depth: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
direction: z.ZodOptional<z.ZodEnum<{
|
|
31
|
-
outgoing: "outgoing";
|
|
32
|
-
incoming: "incoming";
|
|
33
|
-
both: "both";
|
|
34
|
-
}>>;
|
|
35
|
-
}, z.core.$strict>;
|
|
36
|
-
export declare const UpdateMemoryInputSchema: z.ZodObject<{
|
|
37
|
-
hash: z.ZodString;
|
|
38
|
-
importance: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
memoryType: z.ZodOptional<z.ZodString>;
|
|
40
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
-
addTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
-
removeTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
-
}, z.core.$strict>;
|
|
44
|
-
export declare const MemoryStatsInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
45
|
-
export type StoreMemoryInput = z.infer<typeof StoreMemoryInputSchema>;
|
|
46
|
-
export type SearchMemoriesInput = z.infer<typeof SearchMemoriesInputSchema>;
|
|
47
|
-
export type GetMemoryInput = z.infer<typeof GetMemoryInputSchema>;
|
|
48
|
-
export type DeleteMemoryInput = z.infer<typeof DeleteMemoryInputSchema>;
|
|
49
|
-
export type LinkMemoriesInput = z.infer<typeof LinkMemoriesInputSchema>;
|
|
50
|
-
export type GetRelatedInput = z.infer<typeof GetRelatedInputSchema>;
|
|
51
|
-
export type UpdateMemoryInput = z.infer<typeof UpdateMemoryInputSchema>;
|
|
52
|
-
//# sourceMappingURL=inputs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/schemas/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;kBAsBjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;kBAyBpC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;kBAM/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;kBAMlC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;kBAgBlC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;kBAkBhC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;kBAiClC,CAAC;AAEH,eAAO,MAAM,sBAAsB,iCAAqB,CAAC;AAGzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/dist/schemas/inputs.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const StoreMemoryInputSchema = z.strictObject({
|
|
3
|
-
content: z
|
|
4
|
-
.string()
|
|
5
|
-
.min(1)
|
|
6
|
-
.max(100000)
|
|
7
|
-
.meta({ description: 'The content of the memory' }),
|
|
8
|
-
tags: z.array(z.string().min(1).max(50)).max(100).optional().meta({
|
|
9
|
-
description: 'Tags to categorize the memory (max 100 tags, each max 50 chars)',
|
|
10
|
-
}),
|
|
11
|
-
importance: z
|
|
12
|
-
.number()
|
|
13
|
-
.min(0)
|
|
14
|
-
.max(10)
|
|
15
|
-
.optional()
|
|
16
|
-
.meta({ description: 'Importance score (0-10)' }),
|
|
17
|
-
memoryType: z
|
|
18
|
-
.string()
|
|
19
|
-
.min(1)
|
|
20
|
-
.max(50)
|
|
21
|
-
.optional()
|
|
22
|
-
.meta({ description: 'Type of memory (e.g., conversation, fact, rule)' }),
|
|
23
|
-
});
|
|
24
|
-
export const SearchMemoriesInputSchema = z.strictObject({
|
|
25
|
-
query: z.string().min(1).max(1000).meta({ description: 'Search query' }),
|
|
26
|
-
limit: z
|
|
27
|
-
.number()
|
|
28
|
-
.min(1)
|
|
29
|
-
.max(100)
|
|
30
|
-
.optional()
|
|
31
|
-
.meta({ description: 'Maximum number of results' }),
|
|
32
|
-
offset: z
|
|
33
|
-
.number()
|
|
34
|
-
.min(0)
|
|
35
|
-
.max(1000)
|
|
36
|
-
.optional()
|
|
37
|
-
.meta({ description: 'Pagination offset (skip N results)' }),
|
|
38
|
-
tags: z
|
|
39
|
-
.array(z.string().min(1).max(50))
|
|
40
|
-
.max(50)
|
|
41
|
-
.optional()
|
|
42
|
-
.meta({ description: 'Filter by tags (max 50 tags)' }),
|
|
43
|
-
minRelevance: z
|
|
44
|
-
.number()
|
|
45
|
-
.min(0)
|
|
46
|
-
.max(1)
|
|
47
|
-
.optional()
|
|
48
|
-
.meta({ description: 'Minimum relevance score' }),
|
|
49
|
-
});
|
|
50
|
-
export const GetMemoryInputSchema = z.strictObject({
|
|
51
|
-
hash: z
|
|
52
|
-
.string()
|
|
53
|
-
.min(32)
|
|
54
|
-
.max(32)
|
|
55
|
-
.meta({ description: 'MD5 hash of the memory' }),
|
|
56
|
-
});
|
|
57
|
-
export const DeleteMemoryInputSchema = z.strictObject({
|
|
58
|
-
hash: z
|
|
59
|
-
.string()
|
|
60
|
-
.min(32)
|
|
61
|
-
.max(32)
|
|
62
|
-
.meta({ description: 'MD5 hash of the memory' }),
|
|
63
|
-
});
|
|
64
|
-
export const LinkMemoriesInputSchema = z.strictObject({
|
|
65
|
-
fromHash: z
|
|
66
|
-
.string()
|
|
67
|
-
.min(32)
|
|
68
|
-
.max(32)
|
|
69
|
-
.meta({ description: 'Hash of the source memory' }),
|
|
70
|
-
toHash: z
|
|
71
|
-
.string()
|
|
72
|
-
.min(32)
|
|
73
|
-
.max(32)
|
|
74
|
-
.meta({ description: 'Hash of the target memory' }),
|
|
75
|
-
relationType: z
|
|
76
|
-
.string()
|
|
77
|
-
.min(1)
|
|
78
|
-
.max(50)
|
|
79
|
-
.meta({ description: 'Type of relationship' }),
|
|
80
|
-
});
|
|
81
|
-
export const GetRelatedInputSchema = z.strictObject({
|
|
82
|
-
hash: z.string().min(32).max(32).meta({ description: 'Hash of the memory' }),
|
|
83
|
-
relationType: z
|
|
84
|
-
.string()
|
|
85
|
-
.min(1)
|
|
86
|
-
.max(50)
|
|
87
|
-
.optional()
|
|
88
|
-
.meta({ description: 'Filter by relationship type' }),
|
|
89
|
-
depth: z
|
|
90
|
-
.number()
|
|
91
|
-
.min(1)
|
|
92
|
-
.max(3)
|
|
93
|
-
.optional()
|
|
94
|
-
.meta({ description: 'Traversal depth (1-3)' }),
|
|
95
|
-
direction: z.enum(['outgoing', 'incoming', 'both']).optional().meta({
|
|
96
|
-
description: 'Relationship direction: outgoing (default), incoming, or both',
|
|
97
|
-
}),
|
|
98
|
-
});
|
|
99
|
-
export const UpdateMemoryInputSchema = z.strictObject({
|
|
100
|
-
hash: z
|
|
101
|
-
.string()
|
|
102
|
-
.min(32)
|
|
103
|
-
.max(32)
|
|
104
|
-
.meta({ description: 'MD5 hash of the memory to update' }),
|
|
105
|
-
importance: z
|
|
106
|
-
.number()
|
|
107
|
-
.min(0)
|
|
108
|
-
.max(10)
|
|
109
|
-
.optional()
|
|
110
|
-
.meta({ description: 'New importance score (0-10)' }),
|
|
111
|
-
memoryType: z
|
|
112
|
-
.string()
|
|
113
|
-
.min(1)
|
|
114
|
-
.max(50)
|
|
115
|
-
.optional()
|
|
116
|
-
.meta({ description: 'New memory type' }),
|
|
117
|
-
tags: z
|
|
118
|
-
.array(z.string().min(1).max(50))
|
|
119
|
-
.max(100)
|
|
120
|
-
.optional()
|
|
121
|
-
.meta({ description: 'Replace all tags with these (max 100 tags)' }),
|
|
122
|
-
addTags: z
|
|
123
|
-
.array(z.string().min(1).max(50))
|
|
124
|
-
.max(100)
|
|
125
|
-
.optional()
|
|
126
|
-
.meta({ description: 'Tags to add (max 100 tags)' }),
|
|
127
|
-
removeTags: z
|
|
128
|
-
.array(z.string().min(1).max(50))
|
|
129
|
-
.max(100)
|
|
130
|
-
.optional()
|
|
131
|
-
.meta({ description: 'Tags to remove (max 100 tags)' }),
|
|
132
|
-
});
|
|
133
|
-
export const MemoryStatsInputSchema = z.strictObject({});
|
|
134
|
-
//# sourceMappingURL=inputs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../src/schemas/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,MAAM,CAAC;SACX,IAAI,CAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChE,WAAW,EACT,iEAAiE;KACpE,CAAC;IACF,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,IAAI,CAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACnD,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,IAAI,CAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;CAC5E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IA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EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SAChC,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,IAAI,CAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;CAC1D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const DefaultOutputSchema: z.ZodObject<{
|
|
3
|
-
ok: z.ZodBoolean;
|
|
4
|
-
result: z.ZodOptional<z.ZodUnknown>;
|
|
5
|
-
error: z.ZodOptional<z.ZodObject<{
|
|
6
|
-
code: z.ZodString;
|
|
7
|
-
message: z.ZodString;
|
|
8
|
-
}, z.core.$strict>>;
|
|
9
|
-
}, z.core.$strict>;
|
|
10
|
-
//# sourceMappingURL=outputs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.d.ts","sourceRoot":"","sources":["../../src/schemas/outputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,mBAAmB;;;;;;;kBAqB/B,CAAC"}
|
package/dist/schemas/outputs.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
const ErrorSchema = z.strictObject({
|
|
3
|
-
code: z.string(),
|
|
4
|
-
message: z.string(),
|
|
5
|
-
});
|
|
6
|
-
const DefaultOutputSchemaBase = z.strictObject({
|
|
7
|
-
ok: z.boolean(),
|
|
8
|
-
result: z.unknown().optional(),
|
|
9
|
-
error: ErrorSchema.optional(),
|
|
10
|
-
});
|
|
11
|
-
export const DefaultOutputSchema = DefaultOutputSchemaBase.superRefine((value, ctx) => {
|
|
12
|
-
if (value.ok) {
|
|
13
|
-
if (value.error !== undefined) {
|
|
14
|
-
ctx.addIssue({
|
|
15
|
-
code: 'custom',
|
|
16
|
-
message: 'error must be absent when ok is true',
|
|
17
|
-
path: ['error'],
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (value.error === undefined) {
|
|
23
|
-
ctx.addIssue({
|
|
24
|
-
code: 'custom',
|
|
25
|
-
message: 'error is required when ok is false',
|
|
26
|
-
path: ['error'],
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=outputs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../src/schemas/outputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,YAAY,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7C,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,WAAW,CACpE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC;QACb,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9B,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,sCAAsC;gBAC/C,IAAI,EAAE,CAAC,OAAO,CAAC;aAChB,CAAC,CAAC;QACL,CAAC;QACD,OAAO;IACT,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9B,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,oCAAoC;YAC7C,IAAI,EAAE,CAAC,OAAO,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-memory.d.ts","sourceRoot":"","sources":["../../src/tools/delete-memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQzE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4B5D"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { memoryService } from '../core/memory-service.js';
|
|
2
|
-
import { createErrorResponse, getErrorMessage } from '../lib/errors.js';
|
|
3
|
-
import { createToolResponse } from '../lib/tool_response.js';
|
|
4
|
-
import { DeleteMemoryInputSchema } from '../schemas/inputs.js';
|
|
5
|
-
import { DefaultOutputSchema } from '../schemas/outputs.js';
|
|
6
|
-
export function registerDeleteMemory(server) {
|
|
7
|
-
server.registerTool('delete_memory', {
|
|
8
|
-
title: 'Delete Memory',
|
|
9
|
-
description: 'Delete by hash',
|
|
10
|
-
inputSchema: DeleteMemoryInputSchema,
|
|
11
|
-
outputSchema: DefaultOutputSchema,
|
|
12
|
-
annotations: {
|
|
13
|
-
destructiveHint: true,
|
|
14
|
-
},
|
|
15
|
-
}, (params) => {
|
|
16
|
-
try {
|
|
17
|
-
const { hash } = params;
|
|
18
|
-
const result = memoryService.deleteMemory(hash);
|
|
19
|
-
if (result.changes === 0) {
|
|
20
|
-
return createErrorResponse('E_NOT_FOUND', 'Memory not found');
|
|
21
|
-
}
|
|
22
|
-
return createToolResponse({
|
|
23
|
-
ok: true,
|
|
24
|
-
result: { deleted: true },
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
return createErrorResponse('E_DELETE_MEMORY', getErrorMessage(err));
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=delete-memory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-memory.js","sourceRoot":"","sources":["../../src/tools/delete-memory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,gBAAgB;QAC7B,WAAW,EAAE,uBAAuB;QACpC,YAAY,EAAE,mBAAmB;QACjC,WAAW,EAAE;YACX,eAAe,EAAE,IAAI;SACtB;KACF,EACD,CAAC,MAAM,EAAE,EAAE;QACT,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;YACxB,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAChD,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;YAChE,CAAC;YACD,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,IAAI;gBACR,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAC1B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;QACtE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-memory.d.ts","sourceRoot":"","sources":["../../src/tools/get-memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4BzD"}
|
package/dist/tools/get-memory.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { memoryService } from '../core/memory-service.js';
|
|
2
|
-
import { createErrorResponse, getErrorMessage } from '../lib/errors.js';
|
|
3
|
-
import { createToolResponse } from '../lib/tool_response.js';
|
|
4
|
-
import { GetMemoryInputSchema } from '../schemas/inputs.js';
|
|
5
|
-
import { DefaultOutputSchema } from '../schemas/outputs.js';
|
|
6
|
-
export function registerGetMemory(server) {
|
|
7
|
-
server.registerTool('get_memory', {
|
|
8
|
-
title: 'Get Memory',
|
|
9
|
-
description: 'Retrieve memory by hash',
|
|
10
|
-
inputSchema: GetMemoryInputSchema,
|
|
11
|
-
outputSchema: DefaultOutputSchema,
|
|
12
|
-
annotations: {
|
|
13
|
-
readOnlyHint: true,
|
|
14
|
-
},
|
|
15
|
-
}, (params) => {
|
|
16
|
-
try {
|
|
17
|
-
const { hash } = params;
|
|
18
|
-
const result = memoryService.getMemory(hash);
|
|
19
|
-
if (!result) {
|
|
20
|
-
return createErrorResponse('E_NOT_FOUND', 'Memory not found');
|
|
21
|
-
}
|
|
22
|
-
return createToolResponse({
|
|
23
|
-
ok: true,
|
|
24
|
-
result: result,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
return createErrorResponse('E_GET_MEMORY', getErrorMessage(err));
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=get-memory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-memory.js","sourceRoot":"","sources":["../../src/tools/get-memory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,yBAAyB;QACtC,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,mBAAmB;QACjC,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;SACnB;KACF,EACD,CAAC,MAAM,EAAE,EAAE;QACT,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;YACxB,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;YAChE,CAAC;YACD,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,IAAI;gBACR,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,mBAAmB,CAAC,cAAc,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-related.d.ts","sourceRoot":"","sources":["../../src/tools/get-related.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyB1D"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { memoryService } from '../core/memory-service.js';
|
|
2
|
-
import { createErrorResponse, getErrorMessage } from '../lib/errors.js';
|
|
3
|
-
import { createToolResponse } from '../lib/tool_response.js';
|
|
4
|
-
import { GetRelatedInputSchema } from '../schemas/inputs.js';
|
|
5
|
-
import { DefaultOutputSchema } from '../schemas/outputs.js';
|
|
6
|
-
export function registerGetRelated(server) {
|
|
7
|
-
server.registerTool('get_related', {
|
|
8
|
-
title: 'Get Related Memories',
|
|
9
|
-
description: 'Get memories related to a given memory',
|
|
10
|
-
inputSchema: GetRelatedInputSchema,
|
|
11
|
-
outputSchema: DefaultOutputSchema,
|
|
12
|
-
annotations: {
|
|
13
|
-
readOnlyHint: true,
|
|
14
|
-
},
|
|
15
|
-
}, (params) => {
|
|
16
|
-
try {
|
|
17
|
-
const { hash, relationType, depth } = params;
|
|
18
|
-
const results = memoryService.getRelated(hash, relationType, depth);
|
|
19
|
-
return createToolResponse({
|
|
20
|
-
ok: true,
|
|
21
|
-
result: results,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
return createErrorResponse('E_GET_RELATED', getErrorMessage(err));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=get-related.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-related.js","sourceRoot":"","sources":["../../src/tools/get-related.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,wCAAwC;QACrD,WAAW,EAAE,qBAAqB;QAClC,YAAY,EAAE,mBAAmB;QACjC,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;SACnB;KACF,EACD,CAAC,MAAM,EAAE,EAAE;QACT,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;YAC7C,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;YACpE,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,IAAI;gBACR,MAAM,EAAE,OAAO;aAChB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,mBAAmB,CAAC,eAAe,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;QACpE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsNzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAQxD"}
|
package/dist/tools/index.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { createMemory, deleteMemory, getMemory, getRelated, getStats, linkMemories, searchMemories, updateMemory, } from '../core/memory-service.js';
|
|
2
|
-
import { createErrorResponse, getErrorMessage } from '../lib/errors.js';
|
|
3
|
-
import { DeleteMemoryInputSchema, GetMemoryInputSchema, GetRelatedInputSchema, LinkMemoriesInputSchema, MemoryStatsInputSchema, SearchMemoriesInputSchema, StoreMemoryInputSchema, UpdateMemoryInputSchema, } from '../schemas/inputs.js';
|
|
4
|
-
import { DefaultOutputSchema } from '../schemas/outputs.js';
|
|
5
|
-
const ok = (result) => {
|
|
6
|
-
const structured = { ok: true, result };
|
|
7
|
-
return {
|
|
8
|
-
content: [{ type: 'text', text: JSON.stringify(structured) }],
|
|
9
|
-
structuredContent: structured,
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
const withError = (code, fn) => {
|
|
13
|
-
try {
|
|
14
|
-
return fn();
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
return createErrorResponse(code, getErrorMessage(err));
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const tools = [
|
|
21
|
-
{
|
|
22
|
-
name: 'store_memory',
|
|
23
|
-
options: {
|
|
24
|
-
title: 'Store Memory',
|
|
25
|
-
description: 'Store a new memory with optional tags',
|
|
26
|
-
inputSchema: StoreMemoryInputSchema,
|
|
27
|
-
outputSchema: DefaultOutputSchema,
|
|
28
|
-
annotations: { idempotentHint: true },
|
|
29
|
-
},
|
|
30
|
-
handler: (params) => withError('E_STORE_MEMORY', () => {
|
|
31
|
-
const { content, tags, importance, memoryType } = params;
|
|
32
|
-
return ok(createMemory(content, tags ?? [], importance ?? 0, memoryType ?? 'general'));
|
|
33
|
-
}),
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'search_memories',
|
|
37
|
-
options: {
|
|
38
|
-
title: 'Search Memories',
|
|
39
|
-
description: 'Full-text search with filters',
|
|
40
|
-
inputSchema: SearchMemoriesInputSchema,
|
|
41
|
-
outputSchema: DefaultOutputSchema,
|
|
42
|
-
annotations: { readOnlyHint: true },
|
|
43
|
-
},
|
|
44
|
-
handler: (params) => withError('E_SEARCH_MEMORIES', () => {
|
|
45
|
-
const { query, limit, offset, tags, minRelevance } = params;
|
|
46
|
-
return ok(searchMemories(query, limit ?? 10, tags ?? [], minRelevance, offset));
|
|
47
|
-
}),
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'get_memory',
|
|
51
|
-
options: {
|
|
52
|
-
title: 'Get Memory',
|
|
53
|
-
description: 'Retrieve memory by hash',
|
|
54
|
-
inputSchema: GetMemoryInputSchema,
|
|
55
|
-
outputSchema: DefaultOutputSchema,
|
|
56
|
-
annotations: { readOnlyHint: true },
|
|
57
|
-
},
|
|
58
|
-
handler: (params) => withError('E_GET_MEMORY', () => {
|
|
59
|
-
const { hash } = params;
|
|
60
|
-
const result = getMemory(hash);
|
|
61
|
-
if (!result) {
|
|
62
|
-
return createErrorResponse('E_NOT_FOUND', 'Memory not found');
|
|
63
|
-
}
|
|
64
|
-
return ok(result);
|
|
65
|
-
}),
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'delete_memory',
|
|
69
|
-
options: {
|
|
70
|
-
title: 'Delete Memory',
|
|
71
|
-
description: 'Delete by hash',
|
|
72
|
-
inputSchema: DeleteMemoryInputSchema,
|
|
73
|
-
outputSchema: DefaultOutputSchema,
|
|
74
|
-
annotations: { destructiveHint: true },
|
|
75
|
-
},
|
|
76
|
-
handler: (params) => withError('E_DELETE_MEMORY', () => {
|
|
77
|
-
const { hash } = params;
|
|
78
|
-
const result = deleteMemory(hash);
|
|
79
|
-
if (result.changes === 0) {
|
|
80
|
-
return createErrorResponse('E_NOT_FOUND', 'Memory not found');
|
|
81
|
-
}
|
|
82
|
-
return ok({ deleted: true });
|
|
83
|
-
}),
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'link_memories',
|
|
87
|
-
options: {
|
|
88
|
-
title: 'Link Memories',
|
|
89
|
-
description: 'Create relationship between memories',
|
|
90
|
-
inputSchema: LinkMemoriesInputSchema,
|
|
91
|
-
outputSchema: DefaultOutputSchema,
|
|
92
|
-
annotations: { idempotentHint: true },
|
|
93
|
-
},
|
|
94
|
-
handler: (params) => withError('E_LINK_MEMORIES', () => {
|
|
95
|
-
const { fromHash, toHash, relationType } = params;
|
|
96
|
-
linkMemories(fromHash, toHash, relationType);
|
|
97
|
-
return ok({ linked: true });
|
|
98
|
-
}),
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: 'get_related',
|
|
102
|
-
options: {
|
|
103
|
-
title: 'Get Related Memories',
|
|
104
|
-
description: 'Get memories related to a given memory',
|
|
105
|
-
inputSchema: GetRelatedInputSchema,
|
|
106
|
-
outputSchema: DefaultOutputSchema,
|
|
107
|
-
annotations: { readOnlyHint: true },
|
|
108
|
-
},
|
|
109
|
-
handler: (params) => withError('E_GET_RELATED', () => {
|
|
110
|
-
const { hash, relationType, depth, direction } = params;
|
|
111
|
-
return ok(getRelated(hash, relationType, depth ?? 1, direction ?? 'outgoing'));
|
|
112
|
-
}),
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'memory_stats',
|
|
116
|
-
options: {
|
|
117
|
-
title: 'Memory Stats',
|
|
118
|
-
description: 'Database statistics and health',
|
|
119
|
-
inputSchema: MemoryStatsInputSchema,
|
|
120
|
-
outputSchema: DefaultOutputSchema,
|
|
121
|
-
annotations: { readOnlyHint: true },
|
|
122
|
-
},
|
|
123
|
-
handler: () => withError('E_MEMORY_STATS', () => {
|
|
124
|
-
return ok(getStats());
|
|
125
|
-
}),
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'update_memory',
|
|
129
|
-
options: {
|
|
130
|
-
title: 'Update Memory',
|
|
131
|
-
description: 'Update memory metadata (importance, type, tags). Content cannot be changed.',
|
|
132
|
-
inputSchema: UpdateMemoryInputSchema,
|
|
133
|
-
outputSchema: DefaultOutputSchema,
|
|
134
|
-
annotations: { idempotentHint: true },
|
|
135
|
-
},
|
|
136
|
-
handler: (params) => withError('E_UPDATE_MEMORY', () => {
|
|
137
|
-
const { hash, ...options } = params;
|
|
138
|
-
return ok(updateMemory(hash, options));
|
|
139
|
-
}),
|
|
140
|
-
},
|
|
141
|
-
];
|
|
142
|
-
export function registerAllTools(server) {
|
|
143
|
-
for (const tool of tools) {
|
|
144
|
-
server.registerTool(tool.name, tool.options, (params) => Promise.resolve(tool.handler(params)));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAEL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAErB,uBAAuB,EACvB,sBAAsB,EAEtB,yBAAyB,EAEzB,sBAAsB,EAEtB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,EAAE,GAAG,CAAC,MAAe,EAAkB,EAAE;IAC7C,MAAM,UAAU,GAAG,EAAE,EAAE,EAAE,IAAa,EAAE,MAAM,EAAE,CAAC;IACjD,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7D,iBAAiB,EAAE,UAAU;KAC9B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAwB,EAAkB,EAAE;IAC3E,IAAI,CA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AE,GAAG,EAAE,CACZ,SAAS,CAAC,gBAAgB,EAAE,GAAG,EAAE;YAC/B,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxB,CAAC,CAAC;KACL;IACD;QACE,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE;YACP,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,6EAA6E;YAC/E,WAAW,EAAE,uBAAuB;YACpC,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;SACtC;QACD,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAClB,SAAS,CAAC,iBAAiB,EAAE,GAAG,EAAE;YAChC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,MAA2B,CAAC;YACzD,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC;KACL;CACF,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,YAAY,CACjB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,EACZ,CAAC,MAA+B,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAC3E,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-memories.d.ts","sourceRoot":"","sources":["../../src/tools/link-memories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQzE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyB5D"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { memoryService } from '../core/memory-service.js';
|
|
2
|
-
import { createErrorResponse, getErrorMessage } from '../lib/errors.js';
|
|
3
|
-
import { createToolResponse } from '../lib/tool_response.js';
|
|
4
|
-
import { LinkMemoriesInputSchema } from '../schemas/inputs.js';
|
|
5
|
-
import { DefaultOutputSchema } from '../schemas/outputs.js';
|
|
6
|
-
export function registerLinkMemories(server) {
|
|
7
|
-
server.registerTool('link_memories', {
|
|
8
|
-
title: 'Link Memories',
|
|
9
|
-
description: 'Create relationship between memories',
|
|
10
|
-
inputSchema: LinkMemoriesInputSchema,
|
|
11
|
-
outputSchema: DefaultOutputSchema,
|
|
12
|
-
annotations: {
|
|
13
|
-
idempotentHint: true,
|
|
14
|
-
},
|
|
15
|
-
}, (params) => {
|
|
16
|
-
try {
|
|
17
|
-
const { fromHash, toHash, relationType } = params;
|
|
18
|
-
memoryService.linkMemories(fromHash, toHash, relationType);
|
|
19
|
-
return createToolResponse({
|
|
20
|
-
ok: true,
|
|
21
|
-
result: { linked: true },
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
return createErrorResponse('E_LINK_MEMORIES', getErrorMessage(err));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=link-memories.js.map
|