@crowley/rag-mcp 1.3.0 → 1.6.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/dist/__tests__/tool-middleware.test.js +51 -51
- package/dist/__tests__/tools/memory.test.js +78 -63
- package/dist/api-client.d.ts +49 -2
- package/dist/api-client.js +139 -7
- package/dist/connection-pool.d.ts +15 -0
- package/dist/connection-pool.js +24 -0
- package/dist/context-enrichment.d.ts +6 -0
- package/dist/context-enrichment.js +67 -8
- package/dist/formatters.js +12 -8
- package/dist/http-transport.d.ts +15 -0
- package/dist/http-transport.js +109 -0
- package/dist/index.js +27 -4
- package/dist/schemas.js +3 -12
- package/dist/tool-middleware.js +51 -5
- package/dist/tool-registry.js +11 -4
- package/dist/tools/advanced.js +64 -19
- package/dist/tools/agents.js +42 -13
- package/dist/tools/analytics.js +17 -5
- package/dist/tools/architecture.js +115 -31
- package/dist/tools/ask.js +23 -8
- package/dist/tools/cache.js +12 -3
- package/dist/tools/clustering.js +53 -17
- package/dist/tools/confluence.js +26 -8
- package/dist/tools/database.js +87 -24
- package/dist/tools/feedback.js +22 -6
- package/dist/tools/guidelines.js +15 -2
- package/dist/tools/indexing.js +34 -8
- package/dist/tools/memory.js +198 -38
- package/dist/tools/pm.js +38 -11
- package/dist/tools/quality.js +7 -2
- package/dist/tools/review.js +25 -7
- package/dist/tools/search.js +92 -31
- package/dist/tools/session.js +58 -26
- package/dist/tools/suggestions.js +75 -22
- package/dist/types.d.ts +2 -2
- package/dist/validation-hooks.js +27 -11
- package/package.json +2 -2
package/dist/tools/memory.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* batch_remember, validate_memory, review_memories,
|
|
6
6
|
* promote_memory, run_quality_gates, memory_maintenance
|
|
7
7
|
*/
|
|
8
|
-
import { formatMemoryResults, truncate, paginationFooter, PREVIEW } from "../formatters.js";
|
|
8
|
+
import { formatMemoryResults, truncate, paginationFooter, PREVIEW, } from "../formatters.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { TOOL_ANNOTATIONS } from "../annotations.js";
|
|
11
11
|
const typeEmojis = {
|
|
@@ -29,8 +29,21 @@ export function createMemoryTools(projectName) {
|
|
|
29
29
|
description: "Store important information in agent memory. Use this to save decisions, insights, context, todos, or important conversations for future reference.",
|
|
30
30
|
schema: z.object({
|
|
31
31
|
content: z.string().describe("Information to remember"),
|
|
32
|
-
type: z
|
|
33
|
-
|
|
32
|
+
type: z
|
|
33
|
+
.enum([
|
|
34
|
+
"decision",
|
|
35
|
+
"insight",
|
|
36
|
+
"context",
|
|
37
|
+
"todo",
|
|
38
|
+
"conversation",
|
|
39
|
+
"note",
|
|
40
|
+
])
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("Type of memory (default: note)"),
|
|
43
|
+
tags: z
|
|
44
|
+
.array(z.string())
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Tags for categorization (e.g., ['feature-x', 'important'])"),
|
|
34
47
|
relatedTo: z.string().optional().describe("Related feature or topic"),
|
|
35
48
|
}),
|
|
36
49
|
annotations: TOOL_ANNOTATIONS["remember"],
|
|
@@ -61,19 +74,40 @@ export function createMemoryTools(projectName) {
|
|
|
61
74
|
description: "Retrieve relevant memories based on context. Searches agent memory for past decisions, insights, and notes related to the query.",
|
|
62
75
|
schema: z.object({
|
|
63
76
|
query: z.string().describe("What to recall (semantic search)"),
|
|
64
|
-
type: z
|
|
65
|
-
|
|
77
|
+
type: z
|
|
78
|
+
.enum([
|
|
79
|
+
"decision",
|
|
80
|
+
"insight",
|
|
81
|
+
"context",
|
|
82
|
+
"todo",
|
|
83
|
+
"conversation",
|
|
84
|
+
"note",
|
|
85
|
+
"procedure",
|
|
86
|
+
"all",
|
|
87
|
+
])
|
|
88
|
+
.optional()
|
|
89
|
+
.describe("Filter by memory type (default: all)"),
|
|
90
|
+
limit: z.coerce
|
|
91
|
+
.number()
|
|
92
|
+
.optional()
|
|
93
|
+
.describe("Max memories to retrieve (default: 5)"),
|
|
94
|
+
graphRecall: z
|
|
95
|
+
.boolean()
|
|
96
|
+
.optional()
|
|
97
|
+
.describe("Enable graph-aware recall with spreading activation (default: false)"),
|
|
66
98
|
}),
|
|
67
99
|
annotations: TOOL_ANNOTATIONS["recall"],
|
|
68
100
|
handler: async (args, ctx) => {
|
|
69
101
|
const query = args.query;
|
|
70
102
|
const type = args.type || "all";
|
|
71
103
|
const limit = args.limit || 5;
|
|
104
|
+
const graphRecall = args.graphRecall || false;
|
|
72
105
|
const response = await ctx.api.post("/api/memory/recall", {
|
|
73
106
|
projectName: ctx.projectName,
|
|
74
107
|
query,
|
|
75
108
|
type,
|
|
76
109
|
limit,
|
|
110
|
+
graphRecall,
|
|
77
111
|
});
|
|
78
112
|
const results = response.data.results || [];
|
|
79
113
|
if (results.length === 0) {
|
|
@@ -87,10 +121,27 @@ export function createMemoryTools(projectName) {
|
|
|
87
121
|
name: "list_memories",
|
|
88
122
|
description: "List recent memories or filter by type/tags. Shows what the agent has remembered.",
|
|
89
123
|
schema: z.object({
|
|
90
|
-
type: z
|
|
124
|
+
type: z
|
|
125
|
+
.enum([
|
|
126
|
+
"decision",
|
|
127
|
+
"insight",
|
|
128
|
+
"context",
|
|
129
|
+
"todo",
|
|
130
|
+
"conversation",
|
|
131
|
+
"note",
|
|
132
|
+
"all",
|
|
133
|
+
])
|
|
134
|
+
.optional()
|
|
135
|
+
.describe("Filter by type"),
|
|
91
136
|
tag: z.string().optional().describe("Filter by tag"),
|
|
92
|
-
limit: z.coerce
|
|
93
|
-
|
|
137
|
+
limit: z.coerce
|
|
138
|
+
.number()
|
|
139
|
+
.optional()
|
|
140
|
+
.describe("Max results (default: 10)"),
|
|
141
|
+
offset: z.coerce
|
|
142
|
+
.number()
|
|
143
|
+
.optional()
|
|
144
|
+
.describe("Pagination offset (default: 0)"),
|
|
94
145
|
}),
|
|
95
146
|
annotations: TOOL_ANNOTATIONS["list_memories"],
|
|
96
147
|
handler: async (args, ctx) => {
|
|
@@ -127,9 +178,25 @@ export function createMemoryTools(projectName) {
|
|
|
127
178
|
name: "forget",
|
|
128
179
|
description: "Delete a specific memory by ID or clear memories by type.",
|
|
129
180
|
schema: z.object({
|
|
130
|
-
memoryId: z
|
|
131
|
-
|
|
132
|
-
|
|
181
|
+
memoryId: z
|
|
182
|
+
.string()
|
|
183
|
+
.optional()
|
|
184
|
+
.describe("Specific memory ID to delete"),
|
|
185
|
+
type: z
|
|
186
|
+
.enum([
|
|
187
|
+
"decision",
|
|
188
|
+
"insight",
|
|
189
|
+
"context",
|
|
190
|
+
"todo",
|
|
191
|
+
"conversation",
|
|
192
|
+
"note",
|
|
193
|
+
])
|
|
194
|
+
.optional()
|
|
195
|
+
.describe("Delete all memories of this type"),
|
|
196
|
+
olderThanDays: z.coerce
|
|
197
|
+
.number()
|
|
198
|
+
.optional()
|
|
199
|
+
.describe("Delete memories older than N days"),
|
|
133
200
|
}),
|
|
134
201
|
annotations: TOOL_ANNOTATIONS["forget"],
|
|
135
202
|
handler: async (args, ctx) => {
|
|
@@ -161,7 +228,9 @@ export function createMemoryTools(projectName) {
|
|
|
161
228
|
description: "Update status of a todo/task in memory.",
|
|
162
229
|
schema: z.object({
|
|
163
230
|
todoId: z.string().describe("Todo memory ID"),
|
|
164
|
-
status: z
|
|
231
|
+
status: z
|
|
232
|
+
.enum(["pending", "in_progress", "done", "cancelled"])
|
|
233
|
+
.describe("New status"),
|
|
165
234
|
note: z.string().optional().describe("Optional note about the update"),
|
|
166
235
|
}),
|
|
167
236
|
annotations: TOOL_ANNOTATIONS["update_todo"],
|
|
@@ -188,12 +257,53 @@ export function createMemoryTools(projectName) {
|
|
|
188
257
|
name: "batch_remember",
|
|
189
258
|
description: `Efficiently store multiple memories at once in ${projectName}. Faster than individual remember calls.`,
|
|
190
259
|
schema: z.object({
|
|
191
|
-
items: z
|
|
260
|
+
items: z
|
|
261
|
+
.array(z.object({
|
|
192
262
|
content: z.string().describe("Content to remember"),
|
|
193
|
-
type: z
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
263
|
+
type: z
|
|
264
|
+
.enum([
|
|
265
|
+
"decision",
|
|
266
|
+
"insight",
|
|
267
|
+
"context",
|
|
268
|
+
"todo",
|
|
269
|
+
"conversation",
|
|
270
|
+
"note",
|
|
271
|
+
])
|
|
272
|
+
.optional()
|
|
273
|
+
.describe("Memory type (default: note)"),
|
|
274
|
+
tags: z
|
|
275
|
+
.array(z.string())
|
|
276
|
+
.optional()
|
|
277
|
+
.describe("Tags for categorization"),
|
|
278
|
+
relatedTo: z
|
|
279
|
+
.string()
|
|
280
|
+
.optional()
|
|
281
|
+
.describe("Related feature or topic"),
|
|
282
|
+
metadata: z
|
|
283
|
+
.record(z.string(), z.unknown())
|
|
284
|
+
.optional()
|
|
285
|
+
.describe("Custom metadata (factEntities, factDateTs, etc.)"),
|
|
286
|
+
factCategory: z
|
|
287
|
+
.enum([
|
|
288
|
+
"personal_info",
|
|
289
|
+
"preference",
|
|
290
|
+
"event",
|
|
291
|
+
"temporal",
|
|
292
|
+
"update",
|
|
293
|
+
"plan",
|
|
294
|
+
])
|
|
295
|
+
.optional()
|
|
296
|
+
.describe("Structured fact category for temporal retrieval"),
|
|
297
|
+
factEntities: z
|
|
298
|
+
.array(z.string())
|
|
299
|
+
.optional()
|
|
300
|
+
.describe("Named entities: file names, service names, external systems"),
|
|
301
|
+
factDateTs: z
|
|
302
|
+
.number()
|
|
303
|
+
.optional()
|
|
304
|
+
.describe("Unix timestamp (seconds) for temporal filtering"),
|
|
305
|
+
}))
|
|
306
|
+
.describe("Array of memories to store"),
|
|
197
307
|
}),
|
|
198
308
|
annotations: TOOL_ANNOTATIONS["batch_remember"],
|
|
199
309
|
handler: async (args, ctx) => {
|
|
@@ -226,7 +336,9 @@ export function createMemoryTools(projectName) {
|
|
|
226
336
|
description: `Validate or reject an auto-extracted memory in ${projectName}. Helps improve future extraction accuracy.`,
|
|
227
337
|
schema: z.object({
|
|
228
338
|
memoryId: z.string().describe("ID of the memory to validate"),
|
|
229
|
-
validated: z
|
|
339
|
+
validated: z
|
|
340
|
+
.boolean()
|
|
341
|
+
.describe("true to confirm the memory is valuable, false to reject it"),
|
|
230
342
|
}),
|
|
231
343
|
annotations: TOOL_ANNOTATIONS["validate_memory"],
|
|
232
344
|
handler: async (args, ctx) => {
|
|
@@ -247,8 +359,14 @@ export function createMemoryTools(projectName) {
|
|
|
247
359
|
name: "review_memories",
|
|
248
360
|
description: `Get auto-extracted memories pending review in ${projectName}. Shows unvalidated learnings that need human confirmation.`,
|
|
249
361
|
schema: z.object({
|
|
250
|
-
limit: z.coerce
|
|
251
|
-
|
|
362
|
+
limit: z.coerce
|
|
363
|
+
.number()
|
|
364
|
+
.optional()
|
|
365
|
+
.describe("Max memories to return (default: 20)"),
|
|
366
|
+
offset: z.coerce
|
|
367
|
+
.number()
|
|
368
|
+
.optional()
|
|
369
|
+
.describe("Pagination offset (default: 0)"),
|
|
252
370
|
}),
|
|
253
371
|
annotations: TOOL_ANNOTATIONS["review_memories"],
|
|
254
372
|
handler: async (args, ctx) => {
|
|
@@ -282,10 +400,21 @@ export function createMemoryTools(projectName) {
|
|
|
282
400
|
description: `Promote a quarantine memory to durable storage in ${projectName}. Requires a reason for promotion. Optionally runs quality gates before promotion.`,
|
|
283
401
|
schema: z.object({
|
|
284
402
|
memoryId: z.string().describe("ID of the memory to promote"),
|
|
285
|
-
reason: z
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
403
|
+
reason: z
|
|
404
|
+
.enum(["human_validated", "pr_merged", "tests_passed"])
|
|
405
|
+
.describe("Reason for promotion"),
|
|
406
|
+
evidence: z
|
|
407
|
+
.string()
|
|
408
|
+
.optional()
|
|
409
|
+
.describe("Optional evidence supporting the promotion"),
|
|
410
|
+
runGates: z
|
|
411
|
+
.boolean()
|
|
412
|
+
.optional()
|
|
413
|
+
.describe("Run quality gates before promotion (default: false)"),
|
|
414
|
+
affectedFiles: z
|
|
415
|
+
.array(z.string())
|
|
416
|
+
.optional()
|
|
417
|
+
.describe("Files affected by this memory (for quality gate checking)"),
|
|
289
418
|
}),
|
|
290
419
|
annotations: TOOL_ANNOTATIONS["promote_memory"],
|
|
291
420
|
handler: async (args, ctx) => {
|
|
@@ -317,8 +446,14 @@ export function createMemoryTools(projectName) {
|
|
|
317
446
|
name: "run_quality_gates",
|
|
318
447
|
description: `Run quality gates (typecheck, tests, blast radius) for ${projectName}.`,
|
|
319
448
|
schema: z.object({
|
|
320
|
-
affectedFiles: z
|
|
321
|
-
|
|
449
|
+
affectedFiles: z
|
|
450
|
+
.array(z.string())
|
|
451
|
+
.optional()
|
|
452
|
+
.describe("Files to check (for related tests and blast radius)"),
|
|
453
|
+
skipGates: z
|
|
454
|
+
.array(z.string())
|
|
455
|
+
.optional()
|
|
456
|
+
.describe("Gates to skip (typecheck, test, blast_radius)"),
|
|
322
457
|
}),
|
|
323
458
|
annotations: TOOL_ANNOTATIONS["run_quality_gates"],
|
|
324
459
|
handler: async (args, ctx) => {
|
|
@@ -356,12 +491,27 @@ export function createMemoryTools(projectName) {
|
|
|
356
491
|
name: "memory_maintenance",
|
|
357
492
|
description: `Run memory maintenance for ${projectName}: quarantine cleanup (expire old auto-memories), feedback-driven promote/prune, and compaction (merge similar durable memories).`,
|
|
358
493
|
schema: z.object({
|
|
359
|
-
operations: z
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
494
|
+
operations: z
|
|
495
|
+
.object({
|
|
496
|
+
quarantine_cleanup: z
|
|
497
|
+
.boolean()
|
|
498
|
+
.optional()
|
|
499
|
+
.describe("Remove expired quarantine memories (default: true)"),
|
|
500
|
+
feedback_maintenance: z
|
|
501
|
+
.boolean()
|
|
502
|
+
.optional()
|
|
503
|
+
.describe("Auto-promote/prune by feedback (default: true)"),
|
|
504
|
+
compaction: z
|
|
505
|
+
.boolean()
|
|
506
|
+
.optional()
|
|
507
|
+
.describe("Merge similar durable memories (default: false)"),
|
|
508
|
+
compaction_dry_run: z
|
|
509
|
+
.boolean()
|
|
510
|
+
.optional()
|
|
511
|
+
.describe("Preview compaction without changes (default: true)"),
|
|
512
|
+
})
|
|
513
|
+
.optional()
|
|
514
|
+
.describe("Which operations to run (default: quarantine_cleanup + feedback_maintenance)"),
|
|
365
515
|
}),
|
|
366
516
|
annotations: TOOL_ANNOTATIONS["memory_maintenance"],
|
|
367
517
|
handler: async (args, ctx) => {
|
|
@@ -378,7 +528,9 @@ export function createMemoryTools(projectName) {
|
|
|
378
528
|
result += `## Quarantine Cleanup\n`;
|
|
379
529
|
if (qc.rejected.length > 0) {
|
|
380
530
|
result += `**Expired** (${qc.rejected.length}): removed from quarantine\n`;
|
|
381
|
-
qc.rejected.slice(0, 10).forEach((id) => {
|
|
531
|
+
qc.rejected.slice(0, 10).forEach((id) => {
|
|
532
|
+
result += ` \u{1F5D1}\u{FE0F} ${id}\n`;
|
|
533
|
+
});
|
|
382
534
|
if (qc.rejected.length > 10)
|
|
383
535
|
result += ` ... and ${qc.rejected.length - 10} more\n`;
|
|
384
536
|
}
|
|
@@ -386,7 +538,9 @@ export function createMemoryTools(projectName) {
|
|
|
386
538
|
result += `No expired quarantine memories.\n`;
|
|
387
539
|
}
|
|
388
540
|
if (qc.errors.length > 0) {
|
|
389
|
-
qc.errors.forEach((e) => {
|
|
541
|
+
qc.errors.forEach((e) => {
|
|
542
|
+
result += ` \u26A0\u{FE0F} ${e}\n`;
|
|
543
|
+
});
|
|
390
544
|
}
|
|
391
545
|
result += `\n`;
|
|
392
546
|
}
|
|
@@ -396,24 +550,30 @@ export function createMemoryTools(projectName) {
|
|
|
396
550
|
result += `## Feedback Maintenance\n`;
|
|
397
551
|
if (fm.promoted.length > 0) {
|
|
398
552
|
result += `**Promoted** (${fm.promoted.length}): moved to durable\n`;
|
|
399
|
-
fm.promoted.forEach((id) => {
|
|
553
|
+
fm.promoted.forEach((id) => {
|
|
554
|
+
result += ` \u2705 ${id}\n`;
|
|
555
|
+
});
|
|
400
556
|
}
|
|
401
557
|
if (fm.pruned.length > 0) {
|
|
402
558
|
result += `**Pruned** (${fm.pruned.length}): removed\n`;
|
|
403
|
-
fm.pruned.forEach((id) => {
|
|
559
|
+
fm.pruned.forEach((id) => {
|
|
560
|
+
result += ` \u{1F5D1}\u{FE0F} ${id}\n`;
|
|
561
|
+
});
|
|
404
562
|
}
|
|
405
563
|
if (fm.promoted.length === 0 && fm.pruned.length === 0) {
|
|
406
564
|
result += `No feedback-based actions needed.\n`;
|
|
407
565
|
}
|
|
408
566
|
if (fm.errors.length > 0) {
|
|
409
|
-
fm.errors.forEach((e) => {
|
|
567
|
+
fm.errors.forEach((e) => {
|
|
568
|
+
result += ` \u26A0\u{FE0F} ${e}\n`;
|
|
569
|
+
});
|
|
410
570
|
}
|
|
411
571
|
result += `\n`;
|
|
412
572
|
}
|
|
413
573
|
// Compaction section
|
|
414
574
|
if (data.compaction) {
|
|
415
575
|
const cp = data.compaction;
|
|
416
|
-
result += `## Compaction${cp.dryRun ?
|
|
576
|
+
result += `## Compaction${cp.dryRun ? " (dry run)" : ""}\n`;
|
|
417
577
|
if (cp.clusters.length > 0) {
|
|
418
578
|
result += `**${cp.totalClusters} cluster(s)** of similar memories found\n\n`;
|
|
419
579
|
cp.clusters.slice(0, 5).forEach((c, i) => {
|
package/dist/tools/pm.js
CHANGED
|
@@ -14,8 +14,13 @@ export function createPmTools(projectName) {
|
|
|
14
14
|
name: "search_requirements",
|
|
15
15
|
description: `Search technical requirements and product documentation for ${projectName}. Finds relevant requirements, user stories, and specifications from Confluence.`,
|
|
16
16
|
schema: z.object({
|
|
17
|
-
query: z
|
|
18
|
-
|
|
17
|
+
query: z
|
|
18
|
+
.string()
|
|
19
|
+
.describe("Search query for requirements (e.g., 'video inspection flow', 'payment integration')"),
|
|
20
|
+
limit: z.coerce
|
|
21
|
+
.number()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Max results (default: 5)"),
|
|
19
24
|
}),
|
|
20
25
|
annotations: TOOL_ANNOTATIONS["search_requirements"],
|
|
21
26
|
handler: async (args, ctx) => {
|
|
@@ -42,8 +47,13 @@ export function createPmTools(projectName) {
|
|
|
42
47
|
name: "analyze_requirements",
|
|
43
48
|
description: `Analyze technical requirements and compare with existing implementation in ${projectName}. Identifies gaps, missing features, and implementation status.`,
|
|
44
49
|
schema: z.object({
|
|
45
|
-
feature: z
|
|
46
|
-
|
|
50
|
+
feature: z
|
|
51
|
+
.string()
|
|
52
|
+
.describe("Feature or requirement to analyze (e.g., 'video inspection', 'notifications')"),
|
|
53
|
+
detailed: z
|
|
54
|
+
.boolean()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Include detailed code references (default: false)"),
|
|
47
57
|
}),
|
|
48
58
|
annotations: TOOL_ANNOTATIONS["analyze_requirements"],
|
|
49
59
|
handler: async (args, ctx) => {
|
|
@@ -107,7 +117,10 @@ export function createPmTools(projectName) {
|
|
|
107
117
|
description: `Estimate development effort for a feature based on requirements and codebase analysis. Returns complexity assessment, affected files, and risk factors.`,
|
|
108
118
|
schema: z.object({
|
|
109
119
|
feature: z.string().describe("Feature description to estimate"),
|
|
110
|
-
includeSubtasks: z
|
|
120
|
+
includeSubtasks: z
|
|
121
|
+
.boolean()
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("Break down into subtasks (default: true)"),
|
|
111
124
|
}),
|
|
112
125
|
annotations: TOOL_ANNOTATIONS["estimate_feature"],
|
|
113
126
|
handler: async (args, ctx) => {
|
|
@@ -235,13 +248,22 @@ export function createPmTools(projectName) {
|
|
|
235
248
|
name: "list_requirements",
|
|
236
249
|
description: `List all documented requirements/features for ${projectName} from Confluence. Groups by category or status.`,
|
|
237
250
|
schema: z.object({
|
|
238
|
-
category: z
|
|
239
|
-
|
|
240
|
-
|
|
251
|
+
category: z
|
|
252
|
+
.string()
|
|
253
|
+
.optional()
|
|
254
|
+
.describe("Filter by category (optional)"),
|
|
255
|
+
limit: z.coerce
|
|
256
|
+
.number()
|
|
257
|
+
.optional()
|
|
258
|
+
.describe("Max results (default: 20)"),
|
|
259
|
+
offset: z.coerce
|
|
260
|
+
.number()
|
|
261
|
+
.optional()
|
|
262
|
+
.describe("Pagination offset (default: 0)"),
|
|
241
263
|
}),
|
|
242
264
|
annotations: TOOL_ANNOTATIONS["list_requirements"],
|
|
243
265
|
handler: async (args, ctx) => {
|
|
244
|
-
const { category, limit = 20, offset = 0 } = args;
|
|
266
|
+
const { category, limit = 20, offset = 0, } = args;
|
|
245
267
|
const query = category || "requirements features specifications";
|
|
246
268
|
const response = await ctx.api.post("/api/search", {
|
|
247
269
|
collection: `${ctx.collectionPrefix}confluence`,
|
|
@@ -274,7 +296,9 @@ export function createPmTools(projectName) {
|
|
|
274
296
|
name: "ask_pm",
|
|
275
297
|
description: `Ask product management questions about ${projectName}. Answers questions about requirements, features, priorities, and project status using both documentation and codebase.`,
|
|
276
298
|
schema: z.object({
|
|
277
|
-
question: z
|
|
299
|
+
question: z
|
|
300
|
+
.string()
|
|
301
|
+
.describe("PM question (e.g., 'What features are planned for video inspection?', 'What\\'s the status of notifications?')"),
|
|
278
302
|
}),
|
|
279
303
|
annotations: TOOL_ANNOTATIONS["ask_pm"],
|
|
280
304
|
handler: async (args, ctx) => {
|
|
@@ -335,7 +359,10 @@ export function createPmTools(projectName) {
|
|
|
335
359
|
description: `Generate technical specification from requirements. Creates a structured spec document based on Confluence requirements and existing codebase patterns.`,
|
|
336
360
|
schema: z.object({
|
|
337
361
|
feature: z.string().describe("Feature to generate spec for"),
|
|
338
|
-
format: z
|
|
362
|
+
format: z
|
|
363
|
+
.enum(["markdown", "jira", "brief"])
|
|
364
|
+
.optional()
|
|
365
|
+
.describe("Output format (default: markdown)"),
|
|
339
366
|
}),
|
|
340
367
|
annotations: TOOL_ANNOTATIONS["generate_spec"],
|
|
341
368
|
handler: async (args, ctx) => {
|
package/dist/tools/quality.js
CHANGED
|
@@ -12,7 +12,10 @@ export function createQualityTools(projectName) {
|
|
|
12
12
|
name: "get_quality_report",
|
|
13
13
|
description: `Get LLM quality metrics for ${projectName}. Shows JSON parse rates, latency percentiles, thinking trace rates, and alerts.`,
|
|
14
14
|
schema: z.object({
|
|
15
|
-
endpoint: z
|
|
15
|
+
endpoint: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Filter by specific endpoint (e.g., '/api/ask')"),
|
|
16
19
|
}),
|
|
17
20
|
annotations: TOOL_ANNOTATIONS["get_quality_report"] || {
|
|
18
21
|
title: "Get Quality Report",
|
|
@@ -20,7 +23,9 @@ export function createQualityTools(projectName) {
|
|
|
20
23
|
openWorldHint: false,
|
|
21
24
|
},
|
|
22
25
|
handler: async (args, ctx) => {
|
|
23
|
-
const params = args.endpoint
|
|
26
|
+
const params = args.endpoint
|
|
27
|
+
? `?endpoint=${encodeURIComponent(args.endpoint)}`
|
|
28
|
+
: "";
|
|
24
29
|
const response = await ctx.api.get(`/api/quality/report${params}`);
|
|
25
30
|
const data = response.data;
|
|
26
31
|
let result = `## Quality Report\n\n`;
|
package/dist/tools/review.js
CHANGED
|
@@ -14,12 +14,18 @@ export function createReviewTools(projectName) {
|
|
|
14
14
|
schema: z.object({
|
|
15
15
|
code: z.string().describe("Code to review"),
|
|
16
16
|
filePath: z.string().optional().describe("File path for context"),
|
|
17
|
-
reviewType: z
|
|
18
|
-
|
|
17
|
+
reviewType: z
|
|
18
|
+
.enum(["security", "performance", "patterns", "style", "general"])
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Type of review focus (default: general)"),
|
|
21
|
+
diff: z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Git diff to review instead of full code"),
|
|
19
25
|
}),
|
|
20
26
|
annotations: TOOL_ANNOTATIONS["review_code"],
|
|
21
27
|
handler: async (args, ctx) => {
|
|
22
|
-
const { code, filePath, reviewType = "general", diff } = args;
|
|
28
|
+
const { code, filePath, reviewType = "general", diff, } = args;
|
|
23
29
|
const response = await ctx.api.post("/api/review", {
|
|
24
30
|
code: code || diff,
|
|
25
31
|
filePath,
|
|
@@ -76,9 +82,18 @@ export function createReviewTools(projectName) {
|
|
|
76
82
|
schema: z.object({
|
|
77
83
|
code: z.string().describe("Code to generate tests for"),
|
|
78
84
|
filePath: z.string().optional().describe("File path for context"),
|
|
79
|
-
framework: z
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
framework: z
|
|
86
|
+
.enum(["jest", "vitest", "pytest", "mocha"])
|
|
87
|
+
.optional()
|
|
88
|
+
.describe("Test framework to use (default: jest)"),
|
|
89
|
+
testType: z
|
|
90
|
+
.enum(["unit", "integration", "e2e"])
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("Type of tests to generate (default: unit)"),
|
|
93
|
+
coverage: z
|
|
94
|
+
.enum(["minimal", "standard", "comprehensive"])
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("Coverage level (default: comprehensive)"),
|
|
82
97
|
}),
|
|
83
98
|
annotations: TOOL_ANNOTATIONS["generate_tests"],
|
|
84
99
|
handler: async (args, ctx) => {
|
|
@@ -115,7 +130,10 @@ export function createReviewTools(projectName) {
|
|
|
115
130
|
description: "Analyze existing tests for coverage and quality.",
|
|
116
131
|
schema: z.object({
|
|
117
132
|
testCode: z.string().describe("Test code to analyze"),
|
|
118
|
-
sourceCode: z
|
|
133
|
+
sourceCode: z
|
|
134
|
+
.string()
|
|
135
|
+
.optional()
|
|
136
|
+
.describe("Optional source code being tested"),
|
|
119
137
|
}),
|
|
120
138
|
annotations: TOOL_ANNOTATIONS["analyze_tests"],
|
|
121
139
|
handler: async (args, ctx) => {
|