@j0hanz/memdb 1.1.5 → 1.2.1

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.
Files changed (143) hide show
  1. package/dist/config.d.ts +3 -1
  2. package/dist/config.js +27 -3
  3. package/dist/core/db.d.ts +1 -1
  4. package/dist/core/db.js +11 -0
  5. package/dist/core/memory-read.js +18 -16
  6. package/dist/core/memory-write.d.ts +5 -1
  7. package/dist/core/memory-write.js +33 -22
  8. package/dist/core/relationships.d.ts +15 -0
  9. package/dist/core/relationships.js +93 -0
  10. package/dist/core/search.d.ts +5 -1
  11. package/dist/core/search.js +93 -7
  12. package/dist/index.js +8 -4
  13. package/dist/protocol-version-guard.js +16 -0
  14. package/dist/schemas.d.ts +44 -0
  15. package/dist/schemas.js +58 -0
  16. package/dist/stdio-transport.d.ts +29 -0
  17. package/dist/stdio-transport.js +250 -0
  18. package/dist/tools.d.ts +11 -2
  19. package/dist/tools.js +101 -3
  20. package/dist/types.d.ts +29 -5
  21. package/dist/types.js +10 -1
  22. package/package.json +3 -3
  23. package/dist/core/database-schema.d.ts +0 -2
  24. package/dist/core/database-schema.d.ts.map +0 -1
  25. package/dist/core/database-schema.js +0 -64
  26. package/dist/core/database-schema.js.map +0 -1
  27. package/dist/core/database.d.ts +0 -3
  28. package/dist/core/database.d.ts.map +0 -1
  29. package/dist/core/database.js +0 -43
  30. package/dist/core/database.js.map +0 -1
  31. package/dist/core/memory-create.d.ts +0 -7
  32. package/dist/core/memory-create.d.ts.map +0 -1
  33. package/dist/core/memory-create.js +0 -40
  34. package/dist/core/memory-create.js.map +0 -1
  35. package/dist/core/memory-db.d.ts +0 -2
  36. package/dist/core/memory-db.d.ts.map +0 -1
  37. package/dist/core/memory-db.js +0 -31
  38. package/dist/core/memory-db.js.map +0 -1
  39. package/dist/core/memory-read.d.ts.map +0 -1
  40. package/dist/core/memory-read.js.map +0 -1
  41. package/dist/core/memory-relations.d.ts +0 -10
  42. package/dist/core/memory-relations.d.ts.map +0 -1
  43. package/dist/core/memory-relations.js +0 -57
  44. package/dist/core/memory-relations.js.map +0 -1
  45. package/dist/core/memory-search.d.ts +0 -10
  46. package/dist/core/memory-search.d.ts.map +0 -1
  47. package/dist/core/memory-search.js +0 -23
  48. package/dist/core/memory-search.js.map +0 -1
  49. package/dist/core/memory-stats.d.ts +0 -2
  50. package/dist/core/memory-stats.d.ts.map +0 -1
  51. package/dist/core/memory-stats.js +0 -51
  52. package/dist/core/memory-stats.js.map +0 -1
  53. package/dist/core/memory-updates.d.ts +0 -10
  54. package/dist/core/memory-updates.d.ts.map +0 -1
  55. package/dist/core/memory-updates.js +0 -115
  56. package/dist/core/memory-updates.js.map +0 -1
  57. package/dist/core/relation-queries.d.ts +0 -7
  58. package/dist/core/relation-queries.d.ts.map +0 -1
  59. package/dist/core/relation-queries.js +0 -125
  60. package/dist/core/relation-queries.js.map +0 -1
  61. package/dist/core/relations.d.ts +0 -10
  62. package/dist/core/relations.js +0 -177
  63. package/dist/core/row-mappers.d.ts +0 -6
  64. package/dist/core/row-mappers.d.ts.map +0 -1
  65. package/dist/core/row-mappers.js +0 -52
  66. package/dist/core/row-mappers.js.map +0 -1
  67. package/dist/core/search-errors.d.ts +0 -1
  68. package/dist/core/search-errors.d.ts.map +0 -1
  69. package/dist/core/search-errors.js +0 -30
  70. package/dist/core/search-errors.js.map +0 -1
  71. package/dist/core/search.d.ts.map +0 -1
  72. package/dist/core/search.js.map +0 -1
  73. package/dist/core/sqlite.d.ts +0 -10
  74. package/dist/core/sqlite.d.ts.map +0 -1
  75. package/dist/core/sqlite.js +0 -71
  76. package/dist/core/sqlite.js.map +0 -1
  77. package/dist/core/tags.d.ts +0 -1
  78. package/dist/core/tags.d.ts.map +0 -1
  79. package/dist/core/tags.js +0 -27
  80. package/dist/core/tags.js.map +0 -1
  81. package/dist/index.d.ts.map +0 -1
  82. package/dist/index.js.map +0 -1
  83. package/dist/lib/errors.d.ts +0 -19
  84. package/dist/lib/errors.d.ts.map +0 -1
  85. package/dist/lib/errors.js +0 -22
  86. package/dist/lib/errors.js.map +0 -1
  87. package/dist/schemas/inputs.d.ts +0 -44
  88. package/dist/schemas/inputs.d.ts.map +0 -1
  89. package/dist/schemas/inputs.js +0 -97
  90. package/dist/schemas/inputs.js.map +0 -1
  91. package/dist/schemas/outputs.d.ts +0 -9
  92. package/dist/schemas/outputs.d.ts.map +0 -1
  93. package/dist/schemas/outputs.js +0 -28
  94. package/dist/schemas/outputs.js.map +0 -1
  95. package/dist/tools/definitions/memory-core.d.ts +0 -2
  96. package/dist/tools/definitions/memory-core.d.ts.map +0 -1
  97. package/dist/tools/definitions/memory-core.js +0 -79
  98. package/dist/tools/definitions/memory-core.js.map +0 -1
  99. package/dist/tools/definitions/memory-relations.d.ts +0 -2
  100. package/dist/tools/definitions/memory-relations.d.ts.map +0 -1
  101. package/dist/tools/definitions/memory-relations.js +0 -43
  102. package/dist/tools/definitions/memory-relations.js.map +0 -1
  103. package/dist/tools/definitions/memory-search.d.ts +0 -2
  104. package/dist/tools/definitions/memory-search.d.ts.map +0 -1
  105. package/dist/tools/definitions/memory-search.js +0 -20
  106. package/dist/tools/definitions/memory-search.js.map +0 -1
  107. package/dist/tools/definitions/memory-stats.d.ts +0 -2
  108. package/dist/tools/definitions/memory-stats.d.ts.map +0 -1
  109. package/dist/tools/definitions/memory-stats.js +0 -20
  110. package/dist/tools/definitions/memory-stats.js.map +0 -1
  111. package/dist/tools/index.d.ts +0 -2
  112. package/dist/tools/index.d.ts.map +0 -1
  113. package/dist/tools/index.js +0 -15
  114. package/dist/tools/index.js.map +0 -1
  115. package/dist/tools/tool-handlers.d.ts +0 -3
  116. package/dist/tools/tool-handlers.d.ts.map +0 -1
  117. package/dist/tools/tool-handlers.js +0 -19
  118. package/dist/tools/tool-handlers.js.map +0 -1
  119. package/dist/tools/tool-types.d.ts +0 -14
  120. package/dist/tools/tool-types.d.ts.map +0 -1
  121. package/dist/tools/tool-types.js +0 -1
  122. package/dist/tools/tool-types.js.map +0 -1
  123. package/dist/tsconfig.tsbuildinfo +0 -1
  124. package/dist/types/index.d.ts +0 -37
  125. package/dist/types/index.d.ts.map +0 -1
  126. package/dist/types/index.js +0 -1
  127. package/dist/types/index.js.map +0 -1
  128. package/dist/utils/config.d.ts +0 -6
  129. package/dist/utils/config.d.ts.map +0 -1
  130. package/dist/utils/config.js +0 -99
  131. package/dist/utils/config.js.map +0 -1
  132. package/dist/utils/logger.d.ts +0 -5
  133. package/dist/utils/logger.d.ts.map +0 -1
  134. package/dist/utils/logger.js +0 -20
  135. package/dist/utils/logger.js.map +0 -1
  136. package/dist/utils.d.ts +0 -11
  137. package/dist/utils.js +0 -118
  138. package/dist/worker/db-worker-client.d.ts +0 -9
  139. package/dist/worker/db-worker-client.js +0 -93
  140. package/dist/worker/db-worker.d.ts +0 -1
  141. package/dist/worker/db-worker.js +0 -174
  142. package/dist/worker/protocol.d.ts +0 -9
  143. package/dist/worker/protocol.js +0 -14
@@ -1,44 +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>;
@@ -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;AAUxB,eAAO,MAAM,sBAAsB;;;;;kBAYjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;kBAyBpC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;kBAE/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;kBAElC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;kBAIlC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;kBAgBhC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;kBAoBlC,CAAC;AAEH,eAAO,MAAM,sBAAsB,iCAEe,CAAC"}
@@ -1,97 +0,0 @@
1
- import { z } from 'zod';
2
- const hashSchema = z.string().regex(/^[a-f0-9]{32}$/i);
3
- const tagSchema = z.string().min(1).max(50);
4
- const tagsSchema = z.array(tagSchema);
5
- const contentSchema = z.string().min(1).max(100000);
6
- const querySchema = z.string().trim().min(1).max(1000);
7
- const importanceSchema = z.number().int().min(0).max(10);
8
- const memoryTypeSchema = z.string().min(1).max(50);
9
- export const StoreMemoryInputSchema = z.strictObject({
10
- content: contentSchema.meta({ description: 'The content of the memory' }),
11
- tags: tagsSchema.max(100).optional().meta({
12
- description: 'Tags to categorize the memory (max 100 tags, each max 50 chars)',
13
- }),
14
- importance: importanceSchema
15
- .optional()
16
- .meta({ description: 'Importance score (0-10)' }),
17
- memoryType: memoryTypeSchema
18
- .optional()
19
- .meta({ description: 'Type of memory (e.g., conversation, fact, rule)' }),
20
- });
21
- export const SearchMemoriesInputSchema = z.strictObject({
22
- query: querySchema.meta({ description: 'Search query' }),
23
- limit: z
24
- .number()
25
- .int()
26
- .min(1)
27
- .max(100)
28
- .optional()
29
- .meta({ description: 'Maximum number of results' }),
30
- offset: z
31
- .number()
32
- .int()
33
- .min(0)
34
- .max(1000)
35
- .optional()
36
- .meta({ description: 'Pagination offset (skip N results)' }),
37
- tags: tagsSchema.max(50).optional().meta({
38
- description: 'Filter by tags (max 50 tags)',
39
- }),
40
- minRelevance: z
41
- .number()
42
- .min(0)
43
- .max(1)
44
- .optional()
45
- .meta({ description: 'Minimum relevance score' }),
46
- });
47
- export const GetMemoryInputSchema = z.strictObject({
48
- hash: hashSchema.meta({ description: 'MD5 hash of the memory' }),
49
- });
50
- export const DeleteMemoryInputSchema = z.strictObject({
51
- hash: hashSchema.meta({ description: 'MD5 hash of the memory' }),
52
- });
53
- export const LinkMemoriesInputSchema = z.strictObject({
54
- fromHash: hashSchema.meta({ description: 'Hash of the source memory' }),
55
- toHash: hashSchema.meta({ description: 'Hash of the target memory' }),
56
- relationType: memoryTypeSchema.meta({ description: 'Type of relationship' }),
57
- });
58
- export const GetRelatedInputSchema = z.strictObject({
59
- hash: hashSchema.meta({ description: 'Hash of the memory' }),
60
- relationType: memoryTypeSchema
61
- .optional()
62
- .meta({ description: 'Filter by relationship type' }),
63
- depth: z
64
- .number()
65
- .int()
66
- .min(1)
67
- .max(3)
68
- .optional()
69
- .meta({ description: 'Traversal depth (1-3)' }),
70
- direction: z.enum(['outgoing', 'incoming', 'both']).optional().meta({
71
- description: 'Relationship direction: outgoing (default), incoming, or both',
72
- }),
73
- });
74
- export const UpdateMemoryInputSchema = z.strictObject({
75
- hash: hashSchema.meta({ description: 'MD5 hash of the memory to update' }),
76
- importance: importanceSchema
77
- .optional()
78
- .meta({ description: 'New importance score (0-10)' }),
79
- memoryType: memoryTypeSchema
80
- .optional()
81
- .meta({ description: 'New memory type' }),
82
- tags: tagsSchema
83
- .max(100)
84
- .optional()
85
- .meta({ description: 'Replace all tags with these (max 100 tags)' }),
86
- addTags: tagsSchema
87
- .max(100)
88
- .optional()
89
- .meta({ description: 'Tags to add (max 100 tags)' }),
90
- removeTags: tagsSchema
91
- .max(100)
92
- .optional()
93
- .meta({ description: 'Tags to remove (max 100 tags)' }),
94
- });
95
- export const MemoryStatsInputSchema = z
96
- .strictObject({})
97
- .meta({ description: 'No parameters required' });
@@ -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,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACvD,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC5C,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACtC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpD,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAA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CAAC;KACpC,YAAY,CAAC,EAAE,CAAC;KAChB,IAAI,CAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC,CAAC"}
@@ -1,9 +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>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"outputs.d.ts","sourceRoot":"","sources":["../../src/schemas/outputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,CAAC,EAAE,MAAM,KAAK,CAAC;AAyB5C,eAAO,MAAM,mBAAmB;;;;;;;kBAa/B,CAAC"}
@@ -1,28 +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
- const addIssue = (ctx, path, message) => {
12
- ctx.addIssue({
13
- code: 'custom',
14
- message,
15
- path,
16
- });
17
- };
18
- export const DefaultOutputSchema = DefaultOutputSchemaBase.superRefine((value, ctx) => {
19
- if (value.ok) {
20
- if (value.error !== undefined) {
21
- addIssue(ctx, ['error'], 'error must be absent when ok is true');
22
- }
23
- return;
24
- }
25
- if (value.error === undefined) {
26
- addIssue(ctx, ['error'], 'error is required when ok is false');
27
- }
28
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../src/schemas/outputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,CAAC,EAAE,MAAM,KAAK,CAAC;AAE5C,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,QAAQ,GAAG,CACf,GAAkB,EAClB,IAAc,EACd,OAAe,EACT,EAAE;IACR,GAAG,CAAC,QAAQ,CAAC;QACX,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,IAAI;KACL,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,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,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,sCAAsC,CAAC,CAAC;QACnE,CAAC;QACD,OAAO;IACT,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9B,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,oCAAoC,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ToolDef } from '../tool-types.js';
2
- export declare const coreTools: ToolDef[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-core.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/memory-core.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,eAAO,MAAM,SAAS,EAAE,OAAO,EA0E9B,CAAC"}
@@ -1,79 +0,0 @@
1
- import { createMemory } from '../../core/memory-create.js';
2
- import { deleteMemory, getMemory } from '../../core/memory-read.js';
3
- import { updateMemory } from '../../core/memory-updates.js';
4
- import { createErrorResponse } from '../../lib/errors.js';
5
- import { DeleteMemoryInputSchema, GetMemoryInputSchema, StoreMemoryInputSchema, UpdateMemoryInputSchema, } from '../../schemas/inputs.js';
6
- import { DefaultOutputSchema } from '../../schemas/outputs.js';
7
- import { ok, wrapHandler } from '../tool-handlers.js';
8
- export const coreTools = [
9
- {
10
- name: 'store_memory',
11
- options: {
12
- title: 'Store Memory',
13
- description: 'Store a new memory with optional tags',
14
- inputSchema: StoreMemoryInputSchema,
15
- outputSchema: DefaultOutputSchema,
16
- annotations: { idempotentHint: true },
17
- },
18
- handler: wrapHandler('E_STORE_MEMORY', (params) => {
19
- const input = StoreMemoryInputSchema.parse(params);
20
- return ok(createMemory({
21
- content: input.content,
22
- tags: input.tags ?? [],
23
- importance: input.importance ?? 0,
24
- memoryType: input.memoryType ?? 'general',
25
- }));
26
- }),
27
- },
28
- {
29
- name: 'get_memory',
30
- options: {
31
- title: 'Get Memory',
32
- description: 'Retrieve memory by hash',
33
- inputSchema: GetMemoryInputSchema,
34
- outputSchema: DefaultOutputSchema,
35
- annotations: { readOnlyHint: true },
36
- },
37
- handler: wrapHandler('E_GET_MEMORY', (params) => {
38
- const input = GetMemoryInputSchema.parse(params);
39
- const result = getMemory(input.hash);
40
- if (!result) {
41
- return createErrorResponse('E_NOT_FOUND', 'Memory not found');
42
- }
43
- return ok(result);
44
- }),
45
- },
46
- {
47
- name: 'delete_memory',
48
- options: {
49
- title: 'Delete Memory',
50
- description: 'Delete by hash',
51
- inputSchema: DeleteMemoryInputSchema,
52
- outputSchema: DefaultOutputSchema,
53
- annotations: { destructiveHint: true },
54
- },
55
- handler: wrapHandler('E_DELETE_MEMORY', (params) => {
56
- const input = DeleteMemoryInputSchema.parse(params);
57
- const result = deleteMemory(input.hash);
58
- if (result.changes === 0) {
59
- return createErrorResponse('E_NOT_FOUND', 'Memory not found');
60
- }
61
- return ok({ deleted: true });
62
- }),
63
- },
64
- {
65
- name: 'update_memory',
66
- options: {
67
- title: 'Update Memory',
68
- description: 'Update memory metadata (importance, type, tags). Content cannot be changed.',
69
- inputSchema: UpdateMemoryInputSchema,
70
- outputSchema: DefaultOutputSchema,
71
- annotations: { idempotentHint: true },
72
- },
73
- handler: wrapHandler('E_UPDATE_MEMORY', (params) => {
74
- const input = UpdateMemoryInputSchema.parse(params);
75
- const { hash, ...options } = input;
76
- return ok(updateMemory(hash, options));
77
- }),
78
- },
79
- ];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-core.js","sourceRoot":"","sources":["../../../src/tools/definitions/memory-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE;YACP,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,uCAAuC;YACpD,WAAW,EAAE,sBAAsB;YACnC,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;SACtC;QACD,OAAO,EAAE,WAAW,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;YAChD,MAAM,KAAK,GAAG,sBAAsB,CAAC,KAAK,CAAC,M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,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;YAChE,CAAC;YACD,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/B,CAAC,CAAC;KACH;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,WAAW,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE;YACjD,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACpD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;YACnC,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC;KACH;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ToolDef } from '../tool-types.js';
2
- export declare const relationTools: ToolDef[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-relations.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/memory-relations.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,eAAO,MAAM,aAAa,EAAE,OAAO,EAsClC,CAAC"}
@@ -1,43 +0,0 @@
1
- import { getRelated, linkMemories } from '../../core/memory-relations.js';
2
- import { GetRelatedInputSchema, LinkMemoriesInputSchema, } from '../../schemas/inputs.js';
3
- import { DefaultOutputSchema } from '../../schemas/outputs.js';
4
- import { ok, wrapHandler } from '../tool-handlers.js';
5
- export const relationTools = [
6
- {
7
- name: 'link_memories',
8
- options: {
9
- title: 'Link Memories',
10
- description: 'Create relationship between memories',
11
- inputSchema: LinkMemoriesInputSchema,
12
- outputSchema: DefaultOutputSchema,
13
- annotations: { idempotentHint: true },
14
- },
15
- handler: wrapHandler('E_LINK_MEMORIES', (params) => {
16
- const input = LinkMemoriesInputSchema.parse(params);
17
- linkMemories(input.fromHash, input.toHash, input.relationType);
18
- return ok({ linked: true });
19
- }),
20
- },
21
- {
22
- name: 'get_related',
23
- options: {
24
- title: 'Get Related Memories',
25
- description: 'Get memories related to a given memory',
26
- inputSchema: GetRelatedInputSchema,
27
- outputSchema: DefaultOutputSchema,
28
- annotations: { readOnlyHint: true },
29
- },
30
- handler: wrapHandler('E_GET_RELATED', (params) => {
31
- const input = GetRelatedInputSchema.parse(params);
32
- const relatedInput = {
33
- hash: input.hash,
34
- depth: input.depth ?? 1,
35
- direction: input.direction ?? 'outgoing',
36
- ...(input.relationType !== undefined
37
- ? { relationType: input.relationType }
38
- : {}),
39
- };
40
- return ok(getRelated(relatedInput));
41
- }),
42
- },
43
- ];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-relations.js","sourceRoot":"","sources":["../../../src/tools/definitions/memory-relations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC;QACE,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE;YACP,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,sCAAsC;YACnD,WAAW,EAAE,uBAAuB;YACpC,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;SACtC;QACD,OAAO,EAAE,WAAW,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE;YACjD,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACpD,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;YAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9B,CAAC,CAAC;KACH;IACD;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE;YACP,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,wCAAwC;YACrD,WAAW,EAAE,qBAAqB;YAClC,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;SACpC;QACD,OAAO,EAAE,WAAW,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,EAAE;YAC/C,MAAM,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAClD,MAAM,YAAY,GAAG;gBACnB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;gBACvB,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,UAAU;gBACxC,GAAG,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS;oBAClC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE;oBACtC,CAAC,CAAC,EAAE,CAAC;aACR,CAAC;YACF,OAAO,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;QACtC,CAAC,CAAC;KACH;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ToolDef } from '../tool-types.js';
2
- export declare const searchTools: ToolDef[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-search.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/memory-search.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,OAAO,EAwBhC,CAAC"}
@@ -1,20 +0,0 @@
1
- import { searchMemories } from '../../core/memory-search.js';
2
- import { SearchMemoriesInputSchema } from '../../schemas/inputs.js';
3
- import { DefaultOutputSchema } from '../../schemas/outputs.js';
4
- import { ok, wrapHandler } from '../tool-handlers.js';
5
- export const searchTools = [
6
- {
7
- name: 'search_memories',
8
- options: {
9
- title: 'Search Memories',
10
- description: 'Full-text search with filters',
11
- inputSchema: SearchMemoriesInputSchema,
12
- outputSchema: DefaultOutputSchema,
13
- annotations: { readOnlyHint: true },
14
- },
15
- handler: wrapHandler('E_SEARCH_MEMORIES', (params) => {
16
- const input = SearchMemoriesInputSchema.parse(params);
17
- return ok(searchMemories(input));
18
- }),
19
- },
20
- ];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-search.js","sourceRoot":"","sources":["../../../src/tools/definitions/memory-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC;QACE,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE;YACP,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,+BAA+B;YAC5C,WAAW,EAAE,yBAAyB;YACtC,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;SACpC;QACD,OAAO,EAAE,WAAW,CAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,EAAE;YACnD,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACtD,MAAM,WAAW,GAAG;gBAClB,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;gBACxB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE;gBACtB,GAAG,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS;oBAClC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE;oBACtC,CAAC,CAAC,EAAE,CAAC;gBACP,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAChE,CAAC;YACF,OAAO,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC;KACH;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ToolDef } from '../tool-types.js';
2
- export declare const statsTools: ToolDef[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-stats.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/memory-stats.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,eAAO,MAAM,UAAU,EAAE,OAAO,EAe/B,CAAC"}
@@ -1,20 +0,0 @@
1
- import { getStats } from '../../core/memory-stats.js';
2
- import { MemoryStatsInputSchema } from '../../schemas/inputs.js';
3
- import { DefaultOutputSchema } from '../../schemas/outputs.js';
4
- import { ok, wrapHandler } from '../tool-handlers.js';
5
- export const statsTools = [
6
- {
7
- name: 'memory_stats',
8
- options: {
9
- title: 'Memory Stats',
10
- description: 'Database statistics and health',
11
- inputSchema: MemoryStatsInputSchema,
12
- outputSchema: DefaultOutputSchema,
13
- annotations: { readOnlyHint: true },
14
- },
15
- handler: wrapHandler('E_MEMORY_STATS', (params) => {
16
- MemoryStatsInputSchema.parse(params);
17
- return ok(getStats());
18
- }),
19
- },
20
- ];
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-stats.js","sourceRoot":"","sources":["../../../src/tools/definitions/memory-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,CAAC,MAAM,UAAU,GAAc;IACnC;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE;YACP,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,gCAAgC;YAC7C,WAAW,EAAE,sBAAsB;YACnC,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;SACpC;QACD,OAAO,EAAE,WAAW,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;YAChD,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACrC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxB,CAAC,CAAC;KACH;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare function registerAllTools(server: McpServer): void;
@@ -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;AAezE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAQxD"}
@@ -1,15 +0,0 @@
1
- import { coreTools } from './definitions/memory-core.js';
2
- import { relationTools } from './definitions/memory-relations.js';
3
- import { searchTools } from './definitions/memory-search.js';
4
- import { statsTools } from './definitions/memory-stats.js';
5
- const tools = [
6
- ...coreTools,
7
- ...searchTools,
8
- ...relationTools,
9
- ...statsTools,
10
- ];
11
- export function registerAllTools(server) {
12
- for (const tool of tools) {
13
- server.registerTool(tool.name, tool.options, (params) => Promise.resolve(tool.handler(params)));
14
- }
15
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,MAAM,KAAK,GAAc;IACvB,GAAG,SAAS;IACZ,GAAG,WAAW;IACd,GAAG,aAAa;IAChB,GAAG,UAAU;CACd,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,3 +0,0 @@
1
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
- export declare const ok: (result: unknown) => CallToolResult;
3
- export declare const wrapHandler: (code: string, handler: (params: Record<string, unknown>) => CallToolResult) => ((params: Record<string, unknown>) => CallToolResult);
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-handlers.d.ts","sourceRoot":"","sources":["../../src/tools/tool-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIzE,eAAO,MAAM,EAAE,GAAI,QAAQ,OAAO,KAAG,cAMpC,CAAC;AAUF,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,EACZ,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,cAAc,KAC3D,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,cAAc,CAEtD,CAAC"}
@@ -1,19 +0,0 @@
1
- import { createErrorResponse, getErrorMessage } from '../lib/errors.js';
2
- export const ok = (result) => {
3
- const structured = { ok: true, result };
4
- return {
5
- content: [{ type: 'text', text: JSON.stringify(structured) }],
6
- structuredContent: structured,
7
- };
8
- };
9
- const withError = (code, fn) => {
10
- try {
11
- return fn();
12
- }
13
- catch (err) {
14
- return createErrorResponse(code, getErrorMessage(err));
15
- }
16
- };
17
- export const wrapHandler = (code, handler) => {
18
- return (params) => withError(code, () => handler(params));
19
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-handlers.js","sourceRoot":"","sources":["../../src/tools/tool-handlers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAe,EAAkB,EAAE;IACpD,MAAM,UAAU,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxC,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,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,mBAAmB,CAAC,IAAI,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,IAAY,EACZ,OAA4D,EACL,EAAE;IACzD,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5D,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { AnySchema, ZodRawShapeCompat } from '@modelcontextprotocol/sdk/server/zod-compat.js';
2
- import type { CallToolResult, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
3
- export type ToolSchema = ZodRawShapeCompat | AnySchema;
4
- export interface ToolDef {
5
- name: string;
6
- options: {
7
- title: string;
8
- description: string;
9
- inputSchema: ToolSchema;
10
- outputSchema: ToolSchema;
11
- annotations?: ToolAnnotations;
12
- };
13
- handler: (params: Record<string, unknown>) => CallToolResult;
14
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-types.d.ts","sourceRoot":"","sources":["../../src/tools/tool-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,UAAU,CAAC;QACxB,YAAY,EAAE,UAAU,CAAC;QACzB,WAAW,CAAC,EAAE,eAAe,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,cAAc,CAAC;CAC9D"}
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-types.js","sourceRoot":"","sources":["../../src/tools/tool-types.ts"],"names":[],"mappings":""}