claude-session-continuity-mcp 1.0.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/LICENSE +21 -0
- package/README.md +307 -0
- package/dist/dashboard-v2.d.ts +11 -0
- package/dist/dashboard-v2.js +1321 -0
- package/dist/dashboard.d.ts +2 -0
- package/dist/dashboard.js +1196 -0
- package/dist/db/database.d.ts +8 -0
- package/dist/db/database.js +208 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3426 -0
- package/dist/schemas.d.ts +381 -0
- package/dist/schemas.js +119 -0
- package/dist/tools/context.d.ts +6 -0
- package/dist/tools/context.js +227 -0
- package/dist/tools/embedding.d.ts +5 -0
- package/dist/tools/embedding.js +191 -0
- package/dist/tools/feedback.d.ts +5 -0
- package/dist/tools/feedback.js +200 -0
- package/dist/tools/filter.d.ts +5 -0
- package/dist/tools/filter.js +169 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.js +38 -0
- package/dist/tools/learning.d.ts +8 -0
- package/dist/tools/learning.js +395 -0
- package/dist/tools/memory.d.ts +8 -0
- package/dist/tools/memory.js +356 -0
- package/dist/tools/project.d.ts +9 -0
- package/dist/tools/project.js +396 -0
- package/dist/tools/relation.d.ts +4 -0
- package/dist/tools/relation.js +148 -0
- package/dist/tools/session.d.ts +7 -0
- package/dist/tools/session.js +272 -0
- package/dist/tools/solution.d.ts +5 -0
- package/dist/tools/solution.js +182 -0
- package/dist/tools/task.d.ts +6 -0
- package/dist/tools/task.js +184 -0
- package/dist/tools-v2/auto-capture.d.ts +5 -0
- package/dist/tools-v2/auto-capture.js +252 -0
- package/dist/tools-v2/context.d.ts +4 -0
- package/dist/tools-v2/context.js +170 -0
- package/dist/tools-v2/embedding.d.ts +3 -0
- package/dist/tools-v2/embedding.js +115 -0
- package/dist/tools-v2/index.d.ts +13 -0
- package/dist/tools-v2/index.js +73 -0
- package/dist/tools-v2/learn.d.ts +4 -0
- package/dist/tools-v2/learn.js +233 -0
- package/dist/tools-v2/memory.d.ts +6 -0
- package/dist/tools-v2/memory.js +340 -0
- package/dist/tools-v2/projects.d.ts +3 -0
- package/dist/tools-v2/projects.js +218 -0
- package/dist/tools-v2/task.d.ts +3 -0
- package/dist/tools-v2/task.js +193 -0
- package/dist/tools-v2/verify.d.ts +3 -0
- package/dist/tools-v2/verify.js +164 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.js +7 -0
- package/dist/utils/auto-context.d.ts +58 -0
- package/dist/utils/auto-context.js +234 -0
- package/dist/utils/cache.d.ts +60 -0
- package/dist/utils/cache.js +161 -0
- package/dist/utils/embedding.d.ts +7 -0
- package/dist/utils/embedding.js +67 -0
- package/dist/utils/helpers.d.ts +4 -0
- package/dist/utils/helpers.js +45 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.js +111 -0
- package/package.json +64 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ProjectNameSchema: z.ZodString;
|
|
3
|
+
export declare const MemoryTypeSchema: z.ZodEnum<["observation", "decision", "learning", "error", "pattern", "preference"]>;
|
|
4
|
+
export declare const TaskStatusSchema: z.ZodEnum<["pending", "in_progress", "done", "blocked"]>;
|
|
5
|
+
export declare const VerificationGateSchema: z.ZodEnum<["build", "test", "lint"]>;
|
|
6
|
+
export declare const ContextGetSchema: z.ZodObject<{
|
|
7
|
+
project: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
project: string;
|
|
10
|
+
}, {
|
|
11
|
+
project: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const ContextUpdateSchema: z.ZodObject<{
|
|
14
|
+
project: z.ZodString;
|
|
15
|
+
currentState: z.ZodString;
|
|
16
|
+
recentFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
blockers: z.ZodOptional<z.ZodString>;
|
|
18
|
+
verification: z.ZodOptional<z.ZodEnum<["passed", "failed"]>>;
|
|
19
|
+
architectureDecision: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
project: string;
|
|
22
|
+
currentState: string;
|
|
23
|
+
verification?: "passed" | "failed" | undefined;
|
|
24
|
+
recentFiles?: string[] | undefined;
|
|
25
|
+
blockers?: string | undefined;
|
|
26
|
+
architectureDecision?: string | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
project: string;
|
|
29
|
+
currentState: string;
|
|
30
|
+
verification?: "passed" | "failed" | undefined;
|
|
31
|
+
recentFiles?: string[] | undefined;
|
|
32
|
+
blockers?: string | undefined;
|
|
33
|
+
architectureDecision?: string | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const MemoryStoreSchema: z.ZodObject<{
|
|
36
|
+
content: z.ZodString;
|
|
37
|
+
type: z.ZodEnum<["observation", "decision", "learning", "error", "pattern", "preference"]>;
|
|
38
|
+
project: z.ZodOptional<z.ZodString>;
|
|
39
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
40
|
+
importance: z.ZodDefault<z.ZodNumber>;
|
|
41
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
type: "error" | "observation" | "decision" | "learning" | "pattern" | "preference";
|
|
44
|
+
content: string;
|
|
45
|
+
importance: number;
|
|
46
|
+
project?: string | undefined;
|
|
47
|
+
tags?: string[] | undefined;
|
|
48
|
+
metadata?: Record<string, unknown> | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
type: "error" | "observation" | "decision" | "learning" | "pattern" | "preference";
|
|
51
|
+
content: string;
|
|
52
|
+
project?: string | undefined;
|
|
53
|
+
tags?: string[] | undefined;
|
|
54
|
+
importance?: number | undefined;
|
|
55
|
+
metadata?: Record<string, unknown> | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const MemorySearchSchema: z.ZodObject<{
|
|
58
|
+
query: z.ZodString;
|
|
59
|
+
type: z.ZodOptional<z.ZodEnum<["observation", "decision", "learning", "error", "pattern", "preference"]>>;
|
|
60
|
+
project: z.ZodOptional<z.ZodString>;
|
|
61
|
+
semantic: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
63
|
+
minImportance: z.ZodDefault<z.ZodNumber>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
limit: number;
|
|
66
|
+
query: string;
|
|
67
|
+
minImportance: number;
|
|
68
|
+
semantic: boolean;
|
|
69
|
+
project?: string | undefined;
|
|
70
|
+
type?: "error" | "observation" | "decision" | "learning" | "pattern" | "preference" | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
query: string;
|
|
73
|
+
project?: string | undefined;
|
|
74
|
+
type?: "error" | "observation" | "decision" | "learning" | "pattern" | "preference" | undefined;
|
|
75
|
+
limit?: number | undefined;
|
|
76
|
+
minImportance?: number | undefined;
|
|
77
|
+
semantic?: boolean | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
export declare const MemoryDeleteSchema: z.ZodObject<{
|
|
80
|
+
id: z.ZodNumber;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
id: number;
|
|
83
|
+
}, {
|
|
84
|
+
id: number;
|
|
85
|
+
}>;
|
|
86
|
+
export declare const TaskManageSchema: z.ZodObject<{
|
|
87
|
+
action: z.ZodEnum<["add", "complete", "update", "list"]>;
|
|
88
|
+
project: z.ZodString;
|
|
89
|
+
title: z.ZodOptional<z.ZodString>;
|
|
90
|
+
description: z.ZodOptional<z.ZodString>;
|
|
91
|
+
priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
92
|
+
taskId: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "in_progress", "done", "blocked"]>>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
project: string;
|
|
96
|
+
action: "update" | "list" | "add" | "complete";
|
|
97
|
+
title?: string | undefined;
|
|
98
|
+
status?: "pending" | "in_progress" | "done" | "blocked" | undefined;
|
|
99
|
+
description?: string | undefined;
|
|
100
|
+
taskId?: number | undefined;
|
|
101
|
+
priority?: number | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
project: string;
|
|
104
|
+
action: "update" | "list" | "add" | "complete";
|
|
105
|
+
title?: string | undefined;
|
|
106
|
+
status?: "pending" | "in_progress" | "done" | "blocked" | undefined;
|
|
107
|
+
description?: string | undefined;
|
|
108
|
+
taskId?: number | undefined;
|
|
109
|
+
priority?: number | undefined;
|
|
110
|
+
}>;
|
|
111
|
+
export declare const VerifySchema: z.ZodObject<{
|
|
112
|
+
project: z.ZodString;
|
|
113
|
+
gates: z.ZodDefault<z.ZodArray<z.ZodEnum<["build", "test", "lint"]>, "many">>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
project: string;
|
|
116
|
+
gates: ("build" | "test" | "lint")[];
|
|
117
|
+
}, {
|
|
118
|
+
project: string;
|
|
119
|
+
gates?: ("build" | "test" | "lint")[] | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const LearnSchema: z.ZodObject<{
|
|
122
|
+
project: z.ZodString;
|
|
123
|
+
type: z.ZodEnum<["decision", "fix", "pattern", "dependency"]>;
|
|
124
|
+
content: z.ZodString;
|
|
125
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
126
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
127
|
+
alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
128
|
+
solution: z.ZodOptional<z.ZodString>;
|
|
129
|
+
preventionTip: z.ZodOptional<z.ZodString>;
|
|
130
|
+
example: z.ZodOptional<z.ZodString>;
|
|
131
|
+
appliesTo: z.ZodOptional<z.ZodString>;
|
|
132
|
+
dependency: z.ZodOptional<z.ZodString>;
|
|
133
|
+
action: z.ZodOptional<z.ZodEnum<["add", "remove", "upgrade", "downgrade"]>>;
|
|
134
|
+
fromVersion: z.ZodOptional<z.ZodString>;
|
|
135
|
+
toVersion: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
project: string;
|
|
138
|
+
type: "decision" | "pattern" | "dependency" | "fix";
|
|
139
|
+
content: string;
|
|
140
|
+
reason?: string | undefined;
|
|
141
|
+
alternatives?: string[] | undefined;
|
|
142
|
+
files?: string[] | undefined;
|
|
143
|
+
solution?: string | undefined;
|
|
144
|
+
preventionTip?: string | undefined;
|
|
145
|
+
example?: string | undefined;
|
|
146
|
+
appliesTo?: string | undefined;
|
|
147
|
+
dependency?: string | undefined;
|
|
148
|
+
action?: "add" | "remove" | "upgrade" | "downgrade" | undefined;
|
|
149
|
+
fromVersion?: string | undefined;
|
|
150
|
+
toVersion?: string | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
project: string;
|
|
153
|
+
type: "decision" | "pattern" | "dependency" | "fix";
|
|
154
|
+
content: string;
|
|
155
|
+
reason?: string | undefined;
|
|
156
|
+
alternatives?: string[] | undefined;
|
|
157
|
+
files?: string[] | undefined;
|
|
158
|
+
solution?: string | undefined;
|
|
159
|
+
preventionTip?: string | undefined;
|
|
160
|
+
example?: string | undefined;
|
|
161
|
+
appliesTo?: string | undefined;
|
|
162
|
+
dependency?: string | undefined;
|
|
163
|
+
action?: "add" | "remove" | "upgrade" | "downgrade" | undefined;
|
|
164
|
+
fromVersion?: string | undefined;
|
|
165
|
+
toVersion?: string | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
export declare const RecallSolutionSchema: z.ZodObject<{
|
|
168
|
+
query: z.ZodString;
|
|
169
|
+
project: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
query: string;
|
|
172
|
+
project?: string | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
query: string;
|
|
175
|
+
project?: string | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
export declare const ProjectsSchema: z.ZodObject<{
|
|
178
|
+
project: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
project?: string | undefined;
|
|
181
|
+
}, {
|
|
182
|
+
project?: string | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
export declare const ToolSchemas: {
|
|
185
|
+
readonly context_get: z.ZodObject<{
|
|
186
|
+
project: z.ZodString;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
project: string;
|
|
189
|
+
}, {
|
|
190
|
+
project: string;
|
|
191
|
+
}>;
|
|
192
|
+
readonly context_update: z.ZodObject<{
|
|
193
|
+
project: z.ZodString;
|
|
194
|
+
currentState: z.ZodString;
|
|
195
|
+
recentFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
196
|
+
blockers: z.ZodOptional<z.ZodString>;
|
|
197
|
+
verification: z.ZodOptional<z.ZodEnum<["passed", "failed"]>>;
|
|
198
|
+
architectureDecision: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
project: string;
|
|
201
|
+
currentState: string;
|
|
202
|
+
verification?: "passed" | "failed" | undefined;
|
|
203
|
+
recentFiles?: string[] | undefined;
|
|
204
|
+
blockers?: string | undefined;
|
|
205
|
+
architectureDecision?: string | undefined;
|
|
206
|
+
}, {
|
|
207
|
+
project: string;
|
|
208
|
+
currentState: string;
|
|
209
|
+
verification?: "passed" | "failed" | undefined;
|
|
210
|
+
recentFiles?: string[] | undefined;
|
|
211
|
+
blockers?: string | undefined;
|
|
212
|
+
architectureDecision?: string | undefined;
|
|
213
|
+
}>;
|
|
214
|
+
readonly memory_store: z.ZodObject<{
|
|
215
|
+
content: z.ZodString;
|
|
216
|
+
type: z.ZodEnum<["observation", "decision", "learning", "error", "pattern", "preference"]>;
|
|
217
|
+
project: z.ZodOptional<z.ZodString>;
|
|
218
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
219
|
+
importance: z.ZodDefault<z.ZodNumber>;
|
|
220
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
type: "error" | "observation" | "decision" | "learning" | "pattern" | "preference";
|
|
223
|
+
content: string;
|
|
224
|
+
importance: number;
|
|
225
|
+
project?: string | undefined;
|
|
226
|
+
tags?: string[] | undefined;
|
|
227
|
+
metadata?: Record<string, unknown> | undefined;
|
|
228
|
+
}, {
|
|
229
|
+
type: "error" | "observation" | "decision" | "learning" | "pattern" | "preference";
|
|
230
|
+
content: string;
|
|
231
|
+
project?: string | undefined;
|
|
232
|
+
tags?: string[] | undefined;
|
|
233
|
+
importance?: number | undefined;
|
|
234
|
+
metadata?: Record<string, unknown> | undefined;
|
|
235
|
+
}>;
|
|
236
|
+
readonly memory_search: z.ZodObject<{
|
|
237
|
+
query: z.ZodString;
|
|
238
|
+
type: z.ZodOptional<z.ZodEnum<["observation", "decision", "learning", "error", "pattern", "preference"]>>;
|
|
239
|
+
project: z.ZodOptional<z.ZodString>;
|
|
240
|
+
semantic: z.ZodDefault<z.ZodBoolean>;
|
|
241
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
242
|
+
minImportance: z.ZodDefault<z.ZodNumber>;
|
|
243
|
+
}, "strip", z.ZodTypeAny, {
|
|
244
|
+
limit: number;
|
|
245
|
+
query: string;
|
|
246
|
+
minImportance: number;
|
|
247
|
+
semantic: boolean;
|
|
248
|
+
project?: string | undefined;
|
|
249
|
+
type?: "error" | "observation" | "decision" | "learning" | "pattern" | "preference" | undefined;
|
|
250
|
+
}, {
|
|
251
|
+
query: string;
|
|
252
|
+
project?: string | undefined;
|
|
253
|
+
type?: "error" | "observation" | "decision" | "learning" | "pattern" | "preference" | undefined;
|
|
254
|
+
limit?: number | undefined;
|
|
255
|
+
minImportance?: number | undefined;
|
|
256
|
+
semantic?: boolean | undefined;
|
|
257
|
+
}>;
|
|
258
|
+
readonly memory_delete: z.ZodObject<{
|
|
259
|
+
id: z.ZodNumber;
|
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
|
261
|
+
id: number;
|
|
262
|
+
}, {
|
|
263
|
+
id: number;
|
|
264
|
+
}>;
|
|
265
|
+
readonly memory_stats: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
266
|
+
readonly task_manage: z.ZodObject<{
|
|
267
|
+
action: z.ZodEnum<["add", "complete", "update", "list"]>;
|
|
268
|
+
project: z.ZodString;
|
|
269
|
+
title: z.ZodOptional<z.ZodString>;
|
|
270
|
+
description: z.ZodOptional<z.ZodString>;
|
|
271
|
+
priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
272
|
+
taskId: z.ZodOptional<z.ZodNumber>;
|
|
273
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "in_progress", "done", "blocked"]>>;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
project: string;
|
|
276
|
+
action: "update" | "list" | "add" | "complete";
|
|
277
|
+
title?: string | undefined;
|
|
278
|
+
status?: "pending" | "in_progress" | "done" | "blocked" | undefined;
|
|
279
|
+
description?: string | undefined;
|
|
280
|
+
taskId?: number | undefined;
|
|
281
|
+
priority?: number | undefined;
|
|
282
|
+
}, {
|
|
283
|
+
project: string;
|
|
284
|
+
action: "update" | "list" | "add" | "complete";
|
|
285
|
+
title?: string | undefined;
|
|
286
|
+
status?: "pending" | "in_progress" | "done" | "blocked" | undefined;
|
|
287
|
+
description?: string | undefined;
|
|
288
|
+
taskId?: number | undefined;
|
|
289
|
+
priority?: number | undefined;
|
|
290
|
+
}>;
|
|
291
|
+
readonly verify: z.ZodObject<{
|
|
292
|
+
project: z.ZodString;
|
|
293
|
+
gates: z.ZodDefault<z.ZodArray<z.ZodEnum<["build", "test", "lint"]>, "many">>;
|
|
294
|
+
}, "strip", z.ZodTypeAny, {
|
|
295
|
+
project: string;
|
|
296
|
+
gates: ("build" | "test" | "lint")[];
|
|
297
|
+
}, {
|
|
298
|
+
project: string;
|
|
299
|
+
gates?: ("build" | "test" | "lint")[] | undefined;
|
|
300
|
+
}>;
|
|
301
|
+
readonly learn: z.ZodObject<{
|
|
302
|
+
project: z.ZodString;
|
|
303
|
+
type: z.ZodEnum<["decision", "fix", "pattern", "dependency"]>;
|
|
304
|
+
content: z.ZodString;
|
|
305
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
306
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
307
|
+
alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
308
|
+
solution: z.ZodOptional<z.ZodString>;
|
|
309
|
+
preventionTip: z.ZodOptional<z.ZodString>;
|
|
310
|
+
example: z.ZodOptional<z.ZodString>;
|
|
311
|
+
appliesTo: z.ZodOptional<z.ZodString>;
|
|
312
|
+
dependency: z.ZodOptional<z.ZodString>;
|
|
313
|
+
action: z.ZodOptional<z.ZodEnum<["add", "remove", "upgrade", "downgrade"]>>;
|
|
314
|
+
fromVersion: z.ZodOptional<z.ZodString>;
|
|
315
|
+
toVersion: z.ZodOptional<z.ZodString>;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
project: string;
|
|
318
|
+
type: "decision" | "pattern" | "dependency" | "fix";
|
|
319
|
+
content: string;
|
|
320
|
+
reason?: string | undefined;
|
|
321
|
+
alternatives?: string[] | undefined;
|
|
322
|
+
files?: string[] | undefined;
|
|
323
|
+
solution?: string | undefined;
|
|
324
|
+
preventionTip?: string | undefined;
|
|
325
|
+
example?: string | undefined;
|
|
326
|
+
appliesTo?: string | undefined;
|
|
327
|
+
dependency?: string | undefined;
|
|
328
|
+
action?: "add" | "remove" | "upgrade" | "downgrade" | undefined;
|
|
329
|
+
fromVersion?: string | undefined;
|
|
330
|
+
toVersion?: string | undefined;
|
|
331
|
+
}, {
|
|
332
|
+
project: string;
|
|
333
|
+
type: "decision" | "pattern" | "dependency" | "fix";
|
|
334
|
+
content: string;
|
|
335
|
+
reason?: string | undefined;
|
|
336
|
+
alternatives?: string[] | undefined;
|
|
337
|
+
files?: string[] | undefined;
|
|
338
|
+
solution?: string | undefined;
|
|
339
|
+
preventionTip?: string | undefined;
|
|
340
|
+
example?: string | undefined;
|
|
341
|
+
appliesTo?: string | undefined;
|
|
342
|
+
dependency?: string | undefined;
|
|
343
|
+
action?: "add" | "remove" | "upgrade" | "downgrade" | undefined;
|
|
344
|
+
fromVersion?: string | undefined;
|
|
345
|
+
toVersion?: string | undefined;
|
|
346
|
+
}>;
|
|
347
|
+
readonly recall_solution: z.ZodObject<{
|
|
348
|
+
query: z.ZodString;
|
|
349
|
+
project: z.ZodOptional<z.ZodString>;
|
|
350
|
+
}, "strip", z.ZodTypeAny, {
|
|
351
|
+
query: string;
|
|
352
|
+
project?: string | undefined;
|
|
353
|
+
}, {
|
|
354
|
+
query: string;
|
|
355
|
+
project?: string | undefined;
|
|
356
|
+
}>;
|
|
357
|
+
readonly projects: z.ZodObject<{
|
|
358
|
+
project: z.ZodOptional<z.ZodString>;
|
|
359
|
+
}, "strip", z.ZodTypeAny, {
|
|
360
|
+
project?: string | undefined;
|
|
361
|
+
}, {
|
|
362
|
+
project?: string | undefined;
|
|
363
|
+
}>;
|
|
364
|
+
readonly rebuild_embeddings: z.ZodObject<{
|
|
365
|
+
force: z.ZodDefault<z.ZodBoolean>;
|
|
366
|
+
}, "strip", z.ZodTypeAny, {
|
|
367
|
+
force: boolean;
|
|
368
|
+
}, {
|
|
369
|
+
force?: boolean | undefined;
|
|
370
|
+
}>;
|
|
371
|
+
};
|
|
372
|
+
export type ContextGetInput = z.infer<typeof ContextGetSchema>;
|
|
373
|
+
export type ContextUpdateInput = z.infer<typeof ContextUpdateSchema>;
|
|
374
|
+
export type MemoryStoreInput = z.infer<typeof MemoryStoreSchema>;
|
|
375
|
+
export type MemorySearchInput = z.infer<typeof MemorySearchSchema>;
|
|
376
|
+
export type MemoryDeleteInput = z.infer<typeof MemoryDeleteSchema>;
|
|
377
|
+
export type TaskManageInput = z.infer<typeof TaskManageSchema>;
|
|
378
|
+
export type VerifyInput = z.infer<typeof VerifySchema>;
|
|
379
|
+
export type LearnInput = z.infer<typeof LearnSchema>;
|
|
380
|
+
export type RecallSolutionInput = z.infer<typeof RecallSolutionSchema>;
|
|
381
|
+
export type ProjectsInput = z.infer<typeof ProjectsSchema>;
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Zod 스키마 정의 - 입력 검증 및 타입 안전성
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
// ===== 공통 스키마 =====
|
|
4
|
+
export const ProjectNameSchema = z.string().min(1).max(100).describe('프로젝트 이름');
|
|
5
|
+
export const MemoryTypeSchema = z.enum([
|
|
6
|
+
'observation', // 관찰
|
|
7
|
+
'decision', // 결정
|
|
8
|
+
'learning', // 학습
|
|
9
|
+
'error', // 에러
|
|
10
|
+
'pattern', // 패턴
|
|
11
|
+
'preference' // 선호
|
|
12
|
+
]).describe('메모리 유형');
|
|
13
|
+
export const TaskStatusSchema = z.enum([
|
|
14
|
+
'pending',
|
|
15
|
+
'in_progress',
|
|
16
|
+
'done',
|
|
17
|
+
'blocked'
|
|
18
|
+
]).describe('태스크 상태');
|
|
19
|
+
export const VerificationGateSchema = z.enum([
|
|
20
|
+
'build',
|
|
21
|
+
'test',
|
|
22
|
+
'lint'
|
|
23
|
+
]).describe('검증 게이트');
|
|
24
|
+
// ===== context 도구 스키마 =====
|
|
25
|
+
export const ContextGetSchema = z.object({
|
|
26
|
+
project: ProjectNameSchema
|
|
27
|
+
}).describe('프로젝트 컨텍스트 조회');
|
|
28
|
+
export const ContextUpdateSchema = z.object({
|
|
29
|
+
project: ProjectNameSchema,
|
|
30
|
+
currentState: z.string().max(200).describe('현재 상태 (1줄 요약)'),
|
|
31
|
+
recentFiles: z.array(z.string()).max(10).optional().describe('최근 수정 파일'),
|
|
32
|
+
blockers: z.string().max(500).optional().describe('블로커/이슈'),
|
|
33
|
+
verification: z.enum(['passed', 'failed']).optional().describe('마지막 검증 결과'),
|
|
34
|
+
architectureDecision: z.string().max(200).optional().describe('추가할 아키텍처 결정')
|
|
35
|
+
}).describe('프로젝트 컨텍스트 업데이트');
|
|
36
|
+
// ===== memory 도구 스키마 =====
|
|
37
|
+
export const MemoryStoreSchema = z.object({
|
|
38
|
+
content: z.string().min(1).max(5000).describe('저장할 내용'),
|
|
39
|
+
type: MemoryTypeSchema,
|
|
40
|
+
project: ProjectNameSchema.optional(),
|
|
41
|
+
tags: z.array(z.string().max(50)).max(10).optional().describe('태그 목록'),
|
|
42
|
+
importance: z.number().min(1).max(10).default(5).describe('중요도 1-10'),
|
|
43
|
+
metadata: z.record(z.unknown()).optional().describe('추가 메타데이터')
|
|
44
|
+
}).describe('메모리 저장');
|
|
45
|
+
export const MemorySearchSchema = z.object({
|
|
46
|
+
query: z.string().min(1).max(500).describe('검색 쿼리'),
|
|
47
|
+
type: MemoryTypeSchema.optional(),
|
|
48
|
+
project: ProjectNameSchema.optional(),
|
|
49
|
+
semantic: z.boolean().default(false).describe('시맨틱 검색 사용'),
|
|
50
|
+
limit: z.number().min(1).max(50).default(10).describe('최대 결과 수'),
|
|
51
|
+
minImportance: z.number().min(1).max(10).default(1).describe('최소 중요도')
|
|
52
|
+
}).describe('메모리 검색 (FTS 또는 시맨틱)');
|
|
53
|
+
export const MemoryDeleteSchema = z.object({
|
|
54
|
+
id: z.number().int().positive().describe('삭제할 메모리 ID')
|
|
55
|
+
}).describe('메모리 삭제');
|
|
56
|
+
// ===== task 도구 스키마 =====
|
|
57
|
+
export const TaskManageSchema = z.object({
|
|
58
|
+
action: z.enum(['add', 'complete', 'update', 'list']).describe('작업 유형'),
|
|
59
|
+
project: ProjectNameSchema,
|
|
60
|
+
// add 시 필요
|
|
61
|
+
title: z.string().max(200).optional().describe('태스크 제목'),
|
|
62
|
+
description: z.string().max(1000).optional().describe('태스크 설명'),
|
|
63
|
+
priority: z.number().min(1).max(10).default(5).optional().describe('우선순위'),
|
|
64
|
+
// update 시 필요
|
|
65
|
+
taskId: z.number().int().positive().optional().describe('태스크 ID'),
|
|
66
|
+
status: TaskStatusSchema.optional().describe('새 상태')
|
|
67
|
+
}).describe('태스크 관리 (추가/완료/업데이트/목록)');
|
|
68
|
+
// ===== verify 도구 스키마 =====
|
|
69
|
+
export const VerifySchema = z.object({
|
|
70
|
+
project: ProjectNameSchema,
|
|
71
|
+
gates: z.array(VerificationGateSchema).default(['build', 'test', 'lint']).describe('실행할 게이트')
|
|
72
|
+
}).describe('프로젝트 검증 (빌드/테스트/린트)');
|
|
73
|
+
// ===== learn 도구 스키마 =====
|
|
74
|
+
export const LearnSchema = z.object({
|
|
75
|
+
project: ProjectNameSchema,
|
|
76
|
+
type: z.enum(['decision', 'fix', 'pattern', 'dependency']).describe('학습 유형'),
|
|
77
|
+
// 공통
|
|
78
|
+
content: z.string().min(1).max(2000).describe('학습 내용'),
|
|
79
|
+
reason: z.string().max(500).optional().describe('이유/원인'),
|
|
80
|
+
files: z.array(z.string()).max(20).optional().describe('관련 파일'),
|
|
81
|
+
// decision
|
|
82
|
+
alternatives: z.array(z.string()).max(5).optional().describe('고려한 대안'),
|
|
83
|
+
// fix
|
|
84
|
+
solution: z.string().max(1000).optional().describe('해결 방법'),
|
|
85
|
+
preventionTip: z.string().max(500).optional().describe('재발 방지 팁'),
|
|
86
|
+
// pattern
|
|
87
|
+
example: z.string().max(500).optional().describe('예시'),
|
|
88
|
+
appliesTo: z.string().max(200).optional().describe('적용 대상'),
|
|
89
|
+
// dependency
|
|
90
|
+
dependency: z.string().max(100).optional().describe('의존성 이름'),
|
|
91
|
+
action: z.enum(['add', 'remove', 'upgrade', 'downgrade']).optional(),
|
|
92
|
+
fromVersion: z.string().max(50).optional(),
|
|
93
|
+
toVersion: z.string().max(50).optional()
|
|
94
|
+
}).describe('자동 학습 (결정/수정/패턴/의존성)');
|
|
95
|
+
export const RecallSolutionSchema = z.object({
|
|
96
|
+
query: z.string().min(1).max(500).describe('에러 메시지 또는 이슈'),
|
|
97
|
+
project: ProjectNameSchema.optional()
|
|
98
|
+
}).describe('유사 이슈 해결 방법 검색');
|
|
99
|
+
// ===== projects 도구 스키마 =====
|
|
100
|
+
export const ProjectsSchema = z.object({
|
|
101
|
+
project: ProjectNameSchema.optional().describe('특정 프로젝트 (없으면 전체)')
|
|
102
|
+
}).describe('프로젝트 목록 및 통계');
|
|
103
|
+
// ===== 통합 스키마 맵 =====
|
|
104
|
+
export const ToolSchemas = {
|
|
105
|
+
context_get: ContextGetSchema,
|
|
106
|
+
context_update: ContextUpdateSchema,
|
|
107
|
+
memory_store: MemoryStoreSchema,
|
|
108
|
+
memory_search: MemorySearchSchema,
|
|
109
|
+
memory_delete: MemoryDeleteSchema,
|
|
110
|
+
memory_stats: z.object({}).describe('메모리 통계'),
|
|
111
|
+
task_manage: TaskManageSchema,
|
|
112
|
+
verify: VerifySchema,
|
|
113
|
+
learn: LearnSchema,
|
|
114
|
+
recall_solution: RecallSolutionSchema,
|
|
115
|
+
projects: ProjectsSchema,
|
|
116
|
+
rebuild_embeddings: z.object({
|
|
117
|
+
force: z.boolean().default(false).describe('전체 재생성')
|
|
118
|
+
}).describe('임베딩 재생성')
|
|
119
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Tool, CallToolResult } from '../types.js';
|
|
2
|
+
export declare const contextTools: Tool[];
|
|
3
|
+
export declare function getProjectContext(project: string): Promise<CallToolResult>;
|
|
4
|
+
export declare function updateActiveContext(project: string, currentState: string, recentFiles?: string[], blockers?: string, lastVerification?: string): CallToolResult;
|
|
5
|
+
export declare function initProjectContext(project: string, techStack?: Record<string, unknown>, architectureDecisions?: string[], codePatterns?: string[], specialNotes?: string): Promise<CallToolResult>;
|
|
6
|
+
export declare function updateArchitectureDecision(project: string, decision: string): CallToolResult;
|