@lov3kaizen/agentsea-crews 0.5.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.
- package/LICENSE +21 -0
- package/README.md +325 -0
- package/dist/chunk-4PF73ECN.mjs +587 -0
- package/dist/chunk-G3PAPYOI.mjs +1070 -0
- package/dist/chunk-QMK3HWFX.mjs +4584 -0
- package/dist/index.js +8761 -0
- package/dist/index.mjs +2528 -0
- package/dist/nestjs/index.js +5589 -0
- package/dist/nestjs/index.mjs +453 -0
- package/dist/templates/index.js +5625 -0
- package/dist/templates/index.mjs +29 -0
- package/package.json +89 -0
|
@@ -0,0 +1,1070 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCrew
|
|
3
|
+
} from "./chunk-QMK3HWFX.mjs";
|
|
4
|
+
|
|
5
|
+
// src/templates/ResearchCrew.ts
|
|
6
|
+
var researcherRole = {
|
|
7
|
+
name: "Researcher",
|
|
8
|
+
description: "Expert at finding, gathering, and synthesizing information from various sources. Skilled at web research, document analysis, and data collection.",
|
|
9
|
+
capabilities: [
|
|
10
|
+
{
|
|
11
|
+
name: "web-search",
|
|
12
|
+
description: "Search the web for information",
|
|
13
|
+
proficiency: "expert"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "document-analysis",
|
|
17
|
+
description: "Analyze documents and extract key information",
|
|
18
|
+
proficiency: "expert"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "data-collection",
|
|
22
|
+
description: "Collect and organize data",
|
|
23
|
+
proficiency: "expert"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "fact-checking",
|
|
27
|
+
description: "Verify facts and sources",
|
|
28
|
+
proficiency: "expert"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
systemPrompt: `You are an expert researcher with deep expertise in finding and synthesizing information.
|
|
32
|
+
|
|
33
|
+
Your approach:
|
|
34
|
+
1. Start by understanding the research question thoroughly
|
|
35
|
+
2. Identify the key concepts and terms to search for
|
|
36
|
+
3. Search multiple sources for comprehensive coverage
|
|
37
|
+
4. Cross-reference findings to ensure accuracy
|
|
38
|
+
5. Document sources and citations properly
|
|
39
|
+
|
|
40
|
+
Always cite your sources and indicate confidence levels in your findings.`,
|
|
41
|
+
goals: [
|
|
42
|
+
"Find accurate and relevant information",
|
|
43
|
+
"Cover multiple perspectives on the topic",
|
|
44
|
+
"Verify facts from multiple sources",
|
|
45
|
+
"Document all sources properly"
|
|
46
|
+
],
|
|
47
|
+
constraints: [
|
|
48
|
+
"Only use credible sources",
|
|
49
|
+
"Clearly distinguish between facts and opinions",
|
|
50
|
+
"Acknowledge gaps in available information"
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
var analystRole = {
|
|
54
|
+
name: "Analyst",
|
|
55
|
+
description: "Expert at analyzing data, identifying patterns, and deriving insights. Skilled at critical thinking, statistical analysis, and strategic assessment.",
|
|
56
|
+
capabilities: [
|
|
57
|
+
{
|
|
58
|
+
name: "data-analysis",
|
|
59
|
+
description: "Analyze data and identify patterns",
|
|
60
|
+
proficiency: "expert"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "critical-thinking",
|
|
64
|
+
description: "Apply critical thinking to problems",
|
|
65
|
+
proficiency: "expert"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "pattern-recognition",
|
|
69
|
+
description: "Identify patterns and trends",
|
|
70
|
+
proficiency: "expert"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "synthesis",
|
|
74
|
+
description: "Synthesize information from multiple sources",
|
|
75
|
+
proficiency: "expert"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
systemPrompt: `You are an expert analyst skilled at deriving insights from information.
|
|
79
|
+
|
|
80
|
+
Your approach:
|
|
81
|
+
1. Review all gathered information thoroughly
|
|
82
|
+
2. Identify key patterns, themes, and relationships
|
|
83
|
+
3. Assess the significance of different findings
|
|
84
|
+
4. Draw logical conclusions based on evidence
|
|
85
|
+
5. Identify limitations and areas of uncertainty
|
|
86
|
+
|
|
87
|
+
Provide clear, actionable insights with supporting evidence.`,
|
|
88
|
+
goals: [
|
|
89
|
+
"Derive meaningful insights from data",
|
|
90
|
+
"Identify key patterns and trends",
|
|
91
|
+
"Provide actionable recommendations",
|
|
92
|
+
"Quantify findings where possible"
|
|
93
|
+
],
|
|
94
|
+
constraints: [
|
|
95
|
+
"Support conclusions with evidence",
|
|
96
|
+
"Acknowledge limitations and biases",
|
|
97
|
+
"Distinguish correlation from causation"
|
|
98
|
+
]
|
|
99
|
+
};
|
|
100
|
+
var writerRole = {
|
|
101
|
+
name: "Writer",
|
|
102
|
+
description: "Expert at creating clear, compelling, and well-structured content. Skilled at technical writing, storytelling, and adapting tone for different audiences.",
|
|
103
|
+
capabilities: [
|
|
104
|
+
{
|
|
105
|
+
name: "technical-writing",
|
|
106
|
+
description: "Write clear technical content",
|
|
107
|
+
proficiency: "expert"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "report-generation",
|
|
111
|
+
description: "Generate comprehensive reports",
|
|
112
|
+
proficiency: "expert"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "content-structuring",
|
|
116
|
+
description: "Structure content logically",
|
|
117
|
+
proficiency: "expert"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "editing",
|
|
121
|
+
description: "Edit and refine written content",
|
|
122
|
+
proficiency: "expert"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
systemPrompt: `You are an expert writer skilled at creating clear, compelling content.
|
|
126
|
+
|
|
127
|
+
Your approach:
|
|
128
|
+
1. Understand the target audience and purpose
|
|
129
|
+
2. Structure the content logically
|
|
130
|
+
3. Write clear, concise prose
|
|
131
|
+
4. Use appropriate tone and style
|
|
132
|
+
5. Include relevant examples and visuals
|
|
133
|
+
|
|
134
|
+
Create content that is both informative and engaging.`,
|
|
135
|
+
goals: [
|
|
136
|
+
"Create clear and well-structured content",
|
|
137
|
+
"Adapt writing style to audience",
|
|
138
|
+
"Ensure accuracy and completeness",
|
|
139
|
+
"Make complex topics accessible"
|
|
140
|
+
],
|
|
141
|
+
constraints: [
|
|
142
|
+
"Maintain factual accuracy",
|
|
143
|
+
"Cite sources appropriately",
|
|
144
|
+
"Follow style guidelines"
|
|
145
|
+
]
|
|
146
|
+
};
|
|
147
|
+
function createResearchCrewConfig(options = {}) {
|
|
148
|
+
const agents = [
|
|
149
|
+
{
|
|
150
|
+
name: "researcher",
|
|
151
|
+
role: researcherRole,
|
|
152
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
153
|
+
provider: options.provider ?? "anthropic",
|
|
154
|
+
tools: ["web-search", "read-document", ...options.tools ?? []],
|
|
155
|
+
temperature: 0.3
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "analyst",
|
|
159
|
+
role: analystRole,
|
|
160
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
161
|
+
provider: options.provider ?? "anthropic",
|
|
162
|
+
tools: ["calculator", "data-analysis", ...options.tools ?? []],
|
|
163
|
+
temperature: 0.2
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
if (options.includeWriter !== false) {
|
|
167
|
+
agents.push({
|
|
168
|
+
name: "writer",
|
|
169
|
+
role: writerRole,
|
|
170
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
171
|
+
provider: options.provider ?? "anthropic",
|
|
172
|
+
tools: ["text-editor", ...options.tools ?? []],
|
|
173
|
+
temperature: 0.5
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
name: options.name ?? "research-crew",
|
|
178
|
+
description: "A research crew for comprehensive information gathering and analysis",
|
|
179
|
+
agents,
|
|
180
|
+
delegationStrategy: "hierarchical",
|
|
181
|
+
maxIterations: options.depth === "deep" ? 50 : options.depth === "shallow" ? 10 : 25
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function createResearchCrew(options = {}) {
|
|
185
|
+
const config = createResearchCrewConfig(options);
|
|
186
|
+
return createCrew(config);
|
|
187
|
+
}
|
|
188
|
+
var ResearchTasks = {
|
|
189
|
+
/**
|
|
190
|
+
* Create a research task
|
|
191
|
+
*/
|
|
192
|
+
research(topic, depth = "standard") {
|
|
193
|
+
return {
|
|
194
|
+
description: `Research the topic: ${topic}`,
|
|
195
|
+
expectedOutput: "Comprehensive research findings with sources and citations",
|
|
196
|
+
priority: depth === "deep" ? "high" : "medium",
|
|
197
|
+
requiredCapabilities: ["web-search", "document-analysis"],
|
|
198
|
+
context: { depth }
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* Create an analysis task
|
|
203
|
+
*/
|
|
204
|
+
analyze(data, focusAreas) {
|
|
205
|
+
return {
|
|
206
|
+
description: `Analyze the following data and provide insights: ${data}`,
|
|
207
|
+
expectedOutput: "Analysis report with key findings, patterns, and recommendations",
|
|
208
|
+
priority: "high",
|
|
209
|
+
requiredCapabilities: ["data-analysis", "critical-thinking"],
|
|
210
|
+
context: { focusAreas }
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
/**
|
|
214
|
+
* Create a report writing task
|
|
215
|
+
*/
|
|
216
|
+
writeReport(topic, format = "detailed") {
|
|
217
|
+
return {
|
|
218
|
+
description: `Write a ${format} report on: ${topic}`,
|
|
219
|
+
expectedOutput: `A well-structured ${format} report with clear sections and conclusions`,
|
|
220
|
+
priority: "medium",
|
|
221
|
+
requiredCapabilities: ["technical-writing", "report-generation"],
|
|
222
|
+
context: { format }
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// src/templates/WritingCrew.ts
|
|
228
|
+
var editorRole = {
|
|
229
|
+
name: "Editor",
|
|
230
|
+
description: "Expert at reviewing, structuring, and improving written content. Skilled at content strategy, structural editing, and quality assurance.",
|
|
231
|
+
capabilities: [
|
|
232
|
+
{
|
|
233
|
+
name: "content-review",
|
|
234
|
+
description: "Review and evaluate content quality",
|
|
235
|
+
proficiency: "expert"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "structural-editing",
|
|
239
|
+
description: "Improve content structure and flow",
|
|
240
|
+
proficiency: "expert"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: "style-guidance",
|
|
244
|
+
description: "Provide style and tone guidance",
|
|
245
|
+
proficiency: "expert"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "quality-assurance",
|
|
249
|
+
description: "Ensure content meets quality standards",
|
|
250
|
+
proficiency: "expert"
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
systemPrompt: `You are a senior editor with expertise in content quality and structure.
|
|
254
|
+
|
|
255
|
+
Your approach:
|
|
256
|
+
1. Review content for clarity, coherence, and completeness
|
|
257
|
+
2. Assess structure and logical flow
|
|
258
|
+
3. Evaluate tone and style consistency
|
|
259
|
+
4. Identify areas for improvement
|
|
260
|
+
5. Provide constructive, actionable feedback
|
|
261
|
+
|
|
262
|
+
Focus on making content more effective for its intended audience.`,
|
|
263
|
+
goals: [
|
|
264
|
+
"Ensure content quality and coherence",
|
|
265
|
+
"Improve structure and readability",
|
|
266
|
+
"Maintain consistent style and tone",
|
|
267
|
+
"Guide writers to produce better content"
|
|
268
|
+
],
|
|
269
|
+
constraints: [
|
|
270
|
+
"Preserve the author's voice",
|
|
271
|
+
"Provide specific, actionable feedback",
|
|
272
|
+
"Balance quality with deadlines"
|
|
273
|
+
]
|
|
274
|
+
};
|
|
275
|
+
var writerRole2 = {
|
|
276
|
+
name: "Writer",
|
|
277
|
+
description: "Expert at creating engaging, well-crafted content across various formats. Skilled at research, storytelling, and adapting writing style.",
|
|
278
|
+
capabilities: [
|
|
279
|
+
{
|
|
280
|
+
name: "content-creation",
|
|
281
|
+
description: "Create original content",
|
|
282
|
+
proficiency: "expert"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "storytelling",
|
|
286
|
+
description: "Craft engaging narratives",
|
|
287
|
+
proficiency: "expert"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "research-writing",
|
|
291
|
+
description: "Write research-based content",
|
|
292
|
+
proficiency: "expert"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "SEO-writing",
|
|
296
|
+
description: "Write SEO-optimized content",
|
|
297
|
+
proficiency: "intermediate"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
systemPrompt: `You are a skilled content writer capable of creating engaging content.
|
|
301
|
+
|
|
302
|
+
Your approach:
|
|
303
|
+
1. Understand the topic and audience thoroughly
|
|
304
|
+
2. Research and gather relevant information
|
|
305
|
+
3. Create an outline before writing
|
|
306
|
+
4. Write clear, engaging prose
|
|
307
|
+
5. Revise and polish your work
|
|
308
|
+
|
|
309
|
+
Strive to inform, engage, and inspire your readers.`,
|
|
310
|
+
goals: [
|
|
311
|
+
"Create engaging and informative content",
|
|
312
|
+
"Meet the needs of the target audience",
|
|
313
|
+
"Maintain high quality standards",
|
|
314
|
+
"Deliver content on time"
|
|
315
|
+
],
|
|
316
|
+
constraints: [
|
|
317
|
+
"Follow style guidelines",
|
|
318
|
+
"Cite sources when appropriate",
|
|
319
|
+
"Stay on topic and within scope"
|
|
320
|
+
]
|
|
321
|
+
};
|
|
322
|
+
var proofreaderRole = {
|
|
323
|
+
name: "Proofreader",
|
|
324
|
+
description: "Expert at finding and correcting errors in written content. Skilled at grammar, spelling, punctuation, and consistency checking.",
|
|
325
|
+
capabilities: [
|
|
326
|
+
{
|
|
327
|
+
name: "grammar-checking",
|
|
328
|
+
description: "Check and correct grammar",
|
|
329
|
+
proficiency: "expert"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: "spelling-correction",
|
|
333
|
+
description: "Find and fix spelling errors",
|
|
334
|
+
proficiency: "expert"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: "punctuation-review",
|
|
338
|
+
description: "Review and correct punctuation",
|
|
339
|
+
proficiency: "expert"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: "consistency-checking",
|
|
343
|
+
description: "Ensure consistency throughout",
|
|
344
|
+
proficiency: "expert"
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
systemPrompt: `You are an expert proofreader with an exceptional eye for detail.
|
|
348
|
+
|
|
349
|
+
Your approach:
|
|
350
|
+
1. Read content multiple times for different error types
|
|
351
|
+
2. Check grammar, spelling, and punctuation
|
|
352
|
+
3. Verify consistency in style and formatting
|
|
353
|
+
4. Look for typos and minor errors
|
|
354
|
+
5. Provide clear corrections
|
|
355
|
+
|
|
356
|
+
Leave no error uncaught.`,
|
|
357
|
+
goals: [
|
|
358
|
+
"Eliminate all errors in content",
|
|
359
|
+
"Ensure consistency throughout",
|
|
360
|
+
"Maintain style guide compliance",
|
|
361
|
+
"Deliver polished, professional content"
|
|
362
|
+
],
|
|
363
|
+
constraints: [
|
|
364
|
+
"Don't change meaning or style unnecessarily",
|
|
365
|
+
"Focus on errors, not preferences",
|
|
366
|
+
"Document all changes made"
|
|
367
|
+
]
|
|
368
|
+
};
|
|
369
|
+
function createWritingCrewConfig(options = {}) {
|
|
370
|
+
const contentTypePrompt = options.contentType ? `
|
|
371
|
+
|
|
372
|
+
You specialize in ${options.contentType} content.` : "";
|
|
373
|
+
const audiencePrompt = options.audience ? `
|
|
374
|
+
|
|
375
|
+
Your target audience is: ${options.audience}` : "";
|
|
376
|
+
const agents = [
|
|
377
|
+
{
|
|
378
|
+
name: "editor",
|
|
379
|
+
role: {
|
|
380
|
+
...editorRole,
|
|
381
|
+
systemPrompt: editorRole.systemPrompt + contentTypePrompt + audiencePrompt
|
|
382
|
+
},
|
|
383
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
384
|
+
provider: options.provider ?? "anthropic",
|
|
385
|
+
tools: ["text-editor", ...options.tools ?? []],
|
|
386
|
+
temperature: 0.3
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "writer",
|
|
390
|
+
role: {
|
|
391
|
+
...writerRole2,
|
|
392
|
+
systemPrompt: writerRole2.systemPrompt + contentTypePrompt + audiencePrompt
|
|
393
|
+
},
|
|
394
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
395
|
+
provider: options.provider ?? "anthropic",
|
|
396
|
+
tools: ["web-search", "text-editor", ...options.tools ?? []],
|
|
397
|
+
temperature: 0.7
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: "proofreader",
|
|
401
|
+
role: proofreaderRole,
|
|
402
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
403
|
+
provider: options.provider ?? "anthropic",
|
|
404
|
+
tools: ["grammar-checker", "spell-checker", ...options.tools ?? []],
|
|
405
|
+
temperature: 0.1
|
|
406
|
+
}
|
|
407
|
+
];
|
|
408
|
+
return {
|
|
409
|
+
name: options.name ?? "writing-crew",
|
|
410
|
+
description: "A writing crew for content creation and editing",
|
|
411
|
+
agents,
|
|
412
|
+
delegationStrategy: "hierarchical",
|
|
413
|
+
maxIterations: 30
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
function createWritingCrew(options = {}) {
|
|
417
|
+
const config = createWritingCrewConfig(options);
|
|
418
|
+
return createCrew(config);
|
|
419
|
+
}
|
|
420
|
+
var WritingTasks = {
|
|
421
|
+
/**
|
|
422
|
+
* Create a draft writing task
|
|
423
|
+
*/
|
|
424
|
+
draft(topic, wordCount, style) {
|
|
425
|
+
return {
|
|
426
|
+
description: `Write a draft about: ${topic}${wordCount ? ` (approximately ${wordCount} words)` : ""}`,
|
|
427
|
+
expectedOutput: `A well-written draft${style ? ` in ${style} style` : ""} covering the topic comprehensively`,
|
|
428
|
+
priority: "high",
|
|
429
|
+
requiredCapabilities: ["content-creation"],
|
|
430
|
+
context: { wordCount, style }
|
|
431
|
+
};
|
|
432
|
+
},
|
|
433
|
+
/**
|
|
434
|
+
* Create an editing task
|
|
435
|
+
*/
|
|
436
|
+
edit(content, focusAreas) {
|
|
437
|
+
return {
|
|
438
|
+
description: `Edit the following content for quality and clarity:
|
|
439
|
+
|
|
440
|
+
${content.substring(0, 200)}...`,
|
|
441
|
+
expectedOutput: "Edited content with improvements to structure, clarity, and flow",
|
|
442
|
+
priority: "high",
|
|
443
|
+
requiredCapabilities: ["content-review", "structural-editing"],
|
|
444
|
+
context: { focusAreas, fullContent: content }
|
|
445
|
+
};
|
|
446
|
+
},
|
|
447
|
+
/**
|
|
448
|
+
* Create a proofreading task
|
|
449
|
+
*/
|
|
450
|
+
proofread(content) {
|
|
451
|
+
return {
|
|
452
|
+
description: `Proofread the following content:
|
|
453
|
+
|
|
454
|
+
${content.substring(0, 200)}...`,
|
|
455
|
+
expectedOutput: "Corrected content with all errors fixed and changes documented",
|
|
456
|
+
priority: "medium",
|
|
457
|
+
requiredCapabilities: ["grammar-checking", "spelling-correction"],
|
|
458
|
+
context: { fullContent: content }
|
|
459
|
+
};
|
|
460
|
+
},
|
|
461
|
+
/**
|
|
462
|
+
* Create a blog post task
|
|
463
|
+
*/
|
|
464
|
+
blogPost(topic, keywords) {
|
|
465
|
+
return {
|
|
466
|
+
description: `Write a blog post about: ${topic}`,
|
|
467
|
+
expectedOutput: "An engaging blog post with introduction, body sections, and conclusion",
|
|
468
|
+
priority: "high",
|
|
469
|
+
requiredCapabilities: ["content-creation", "SEO-writing"],
|
|
470
|
+
context: { keywords }
|
|
471
|
+
};
|
|
472
|
+
},
|
|
473
|
+
/**
|
|
474
|
+
* Create a technical documentation task
|
|
475
|
+
*/
|
|
476
|
+
technicalDoc(subject, audience = "intermediate") {
|
|
477
|
+
return {
|
|
478
|
+
description: `Write technical documentation for: ${subject}`,
|
|
479
|
+
expectedOutput: `Clear technical documentation suitable for ${audience} level users`,
|
|
480
|
+
priority: "high",
|
|
481
|
+
requiredCapabilities: ["research-writing"],
|
|
482
|
+
context: { audience }
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
// src/templates/CodeReviewCrew.ts
|
|
488
|
+
var seniorDeveloperRole = {
|
|
489
|
+
name: "Senior Developer",
|
|
490
|
+
description: "Expert at reviewing code for quality, maintainability, and best practices. Skilled at architecture review, code quality assessment, and mentoring.",
|
|
491
|
+
capabilities: [
|
|
492
|
+
{
|
|
493
|
+
name: "code-review",
|
|
494
|
+
description: "Review code for quality and best practices",
|
|
495
|
+
proficiency: "expert"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: "architecture-review",
|
|
499
|
+
description: "Assess code architecture and design",
|
|
500
|
+
proficiency: "expert"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: "refactoring",
|
|
504
|
+
description: "Suggest code refactoring improvements",
|
|
505
|
+
proficiency: "expert"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: "testing-review",
|
|
509
|
+
description: "Review test coverage and quality",
|
|
510
|
+
proficiency: "expert"
|
|
511
|
+
}
|
|
512
|
+
],
|
|
513
|
+
systemPrompt: `You are a senior software developer with extensive experience in code review.
|
|
514
|
+
|
|
515
|
+
Your approach:
|
|
516
|
+
1. Review code for readability and maintainability
|
|
517
|
+
2. Check adherence to best practices and design patterns
|
|
518
|
+
3. Assess code architecture and structure
|
|
519
|
+
4. Evaluate test coverage and quality
|
|
520
|
+
5. Provide constructive, educational feedback
|
|
521
|
+
|
|
522
|
+
Focus on helping developers write better code.`,
|
|
523
|
+
goals: [
|
|
524
|
+
"Ensure code quality and maintainability",
|
|
525
|
+
"Identify potential bugs and issues",
|
|
526
|
+
"Suggest improvements and optimizations",
|
|
527
|
+
"Help developers learn and grow"
|
|
528
|
+
],
|
|
529
|
+
constraints: [
|
|
530
|
+
"Be constructive, not critical",
|
|
531
|
+
'Explain the "why" behind suggestions',
|
|
532
|
+
"Prioritize important issues over nitpicks"
|
|
533
|
+
]
|
|
534
|
+
};
|
|
535
|
+
var securityAnalystRole = {
|
|
536
|
+
name: "Security Analyst",
|
|
537
|
+
description: "Expert at identifying security vulnerabilities and ensuring secure coding practices. Skilled at vulnerability assessment, secure code review, and security best practices.",
|
|
538
|
+
capabilities: [
|
|
539
|
+
{
|
|
540
|
+
name: "vulnerability-detection",
|
|
541
|
+
description: "Identify security vulnerabilities",
|
|
542
|
+
proficiency: "expert"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
name: "secure-coding-review",
|
|
546
|
+
description: "Review code for security best practices",
|
|
547
|
+
proficiency: "expert"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: "threat-modeling",
|
|
551
|
+
description: "Assess potential security threats",
|
|
552
|
+
proficiency: "expert"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
name: "compliance-review",
|
|
556
|
+
description: "Check compliance with security standards",
|
|
557
|
+
proficiency: "expert"
|
|
558
|
+
}
|
|
559
|
+
],
|
|
560
|
+
systemPrompt: `You are a security analyst specializing in secure code review.
|
|
561
|
+
|
|
562
|
+
Your approach:
|
|
563
|
+
1. Identify potential security vulnerabilities
|
|
564
|
+
2. Check for OWASP Top 10 issues
|
|
565
|
+
3. Review authentication and authorization
|
|
566
|
+
4. Assess data handling and encryption
|
|
567
|
+
5. Evaluate input validation and sanitization
|
|
568
|
+
|
|
569
|
+
Security is paramount - identify all potential risks.`,
|
|
570
|
+
goals: [
|
|
571
|
+
"Identify security vulnerabilities",
|
|
572
|
+
"Ensure secure coding practices",
|
|
573
|
+
"Protect against common attack vectors",
|
|
574
|
+
"Recommend security improvements"
|
|
575
|
+
],
|
|
576
|
+
constraints: [
|
|
577
|
+
"Flag all security concerns, even minor ones",
|
|
578
|
+
"Provide remediation guidance",
|
|
579
|
+
"Consider the security context"
|
|
580
|
+
]
|
|
581
|
+
};
|
|
582
|
+
var performanceEngineerRole = {
|
|
583
|
+
name: "Performance Engineer",
|
|
584
|
+
description: "Expert at analyzing code for performance issues and optimization opportunities. Skilled at performance profiling, optimization, and scalability assessment.",
|
|
585
|
+
capabilities: [
|
|
586
|
+
{
|
|
587
|
+
name: "performance-analysis",
|
|
588
|
+
description: "Analyze code performance",
|
|
589
|
+
proficiency: "expert"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: "optimization",
|
|
593
|
+
description: "Suggest performance optimizations",
|
|
594
|
+
proficiency: "expert"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
name: "scalability-review",
|
|
598
|
+
description: "Assess code scalability",
|
|
599
|
+
proficiency: "expert"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: "resource-analysis",
|
|
603
|
+
description: "Analyze resource usage",
|
|
604
|
+
proficiency: "expert"
|
|
605
|
+
}
|
|
606
|
+
],
|
|
607
|
+
systemPrompt: `You are a performance engineer specializing in code optimization.
|
|
608
|
+
|
|
609
|
+
Your approach:
|
|
610
|
+
1. Identify performance bottlenecks
|
|
611
|
+
2. Analyze algorithmic complexity
|
|
612
|
+
3. Review memory usage and management
|
|
613
|
+
4. Check for unnecessary operations
|
|
614
|
+
5. Assess scalability concerns
|
|
615
|
+
|
|
616
|
+
Help developers write fast, efficient code.`,
|
|
617
|
+
goals: [
|
|
618
|
+
"Identify performance issues",
|
|
619
|
+
"Suggest optimization opportunities",
|
|
620
|
+
"Ensure efficient resource usage",
|
|
621
|
+
"Consider scalability implications"
|
|
622
|
+
],
|
|
623
|
+
constraints: [
|
|
624
|
+
"Balance optimization with readability",
|
|
625
|
+
"Quantify performance impacts when possible",
|
|
626
|
+
"Consider the actual use case"
|
|
627
|
+
]
|
|
628
|
+
};
|
|
629
|
+
function createCodeReviewCrewConfig(options = {}) {
|
|
630
|
+
const languagePrompt = options.languages?.length ? `
|
|
631
|
+
|
|
632
|
+
You specialize in: ${options.languages.join(", ")}` : "";
|
|
633
|
+
const strictnessPrompt = options.strictness === "strict" ? "\n\nApply strict code review standards." : options.strictness === "relaxed" ? "\n\nFocus on major issues only." : "";
|
|
634
|
+
const agents = [
|
|
635
|
+
{
|
|
636
|
+
name: "senior-developer",
|
|
637
|
+
role: {
|
|
638
|
+
...seniorDeveloperRole,
|
|
639
|
+
systemPrompt: seniorDeveloperRole.systemPrompt + languagePrompt + strictnessPrompt
|
|
640
|
+
},
|
|
641
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
642
|
+
provider: options.provider ?? "anthropic",
|
|
643
|
+
tools: ["code-analyzer", "linter", ...options.tools ?? []],
|
|
644
|
+
temperature: 0.2
|
|
645
|
+
}
|
|
646
|
+
];
|
|
647
|
+
if (options.includeSecurity !== false) {
|
|
648
|
+
agents.push({
|
|
649
|
+
name: "security-analyst",
|
|
650
|
+
role: {
|
|
651
|
+
...securityAnalystRole,
|
|
652
|
+
systemPrompt: securityAnalystRole.systemPrompt + languagePrompt
|
|
653
|
+
},
|
|
654
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
655
|
+
provider: options.provider ?? "anthropic",
|
|
656
|
+
tools: [
|
|
657
|
+
"security-scanner",
|
|
658
|
+
"dependency-checker",
|
|
659
|
+
...options.tools ?? []
|
|
660
|
+
],
|
|
661
|
+
temperature: 0.1
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
if (options.includePerformance !== false) {
|
|
665
|
+
agents.push({
|
|
666
|
+
name: "performance-engineer",
|
|
667
|
+
role: {
|
|
668
|
+
...performanceEngineerRole,
|
|
669
|
+
systemPrompt: performanceEngineerRole.systemPrompt + languagePrompt
|
|
670
|
+
},
|
|
671
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
672
|
+
provider: options.provider ?? "anthropic",
|
|
673
|
+
tools: ["profiler", "complexity-analyzer", ...options.tools ?? []],
|
|
674
|
+
temperature: 0.2
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
return {
|
|
678
|
+
name: options.name ?? "code-review-crew",
|
|
679
|
+
description: "A code review crew for comprehensive code quality assessment",
|
|
680
|
+
agents,
|
|
681
|
+
delegationStrategy: "consensus",
|
|
682
|
+
maxIterations: 20
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
function createCodeReviewCrew(options = {}) {
|
|
686
|
+
const config = createCodeReviewCrewConfig(options);
|
|
687
|
+
return createCrew(config);
|
|
688
|
+
}
|
|
689
|
+
var CodeReviewTasks = {
|
|
690
|
+
/**
|
|
691
|
+
* Create a general code review task
|
|
692
|
+
*/
|
|
693
|
+
review(code, language, context) {
|
|
694
|
+
return {
|
|
695
|
+
description: `Review the following ${language ?? ""} code:
|
|
696
|
+
|
|
697
|
+
\`\`\`${language ?? ""}
|
|
698
|
+
${code.substring(0, 500)}...
|
|
699
|
+
\`\`\``,
|
|
700
|
+
expectedOutput: "Comprehensive code review with issues, suggestions, and improvements",
|
|
701
|
+
priority: "high",
|
|
702
|
+
requiredCapabilities: ["code-review"],
|
|
703
|
+
context: { language, additionalContext: context, fullCode: code }
|
|
704
|
+
};
|
|
705
|
+
},
|
|
706
|
+
/**
|
|
707
|
+
* Create a security review task
|
|
708
|
+
*/
|
|
709
|
+
securityReview(code, language) {
|
|
710
|
+
return {
|
|
711
|
+
description: `Perform a security review of the following ${language ?? ""} code:
|
|
712
|
+
|
|
713
|
+
\`\`\`${language ?? ""}
|
|
714
|
+
${code.substring(0, 500)}...
|
|
715
|
+
\`\`\``,
|
|
716
|
+
expectedOutput: "Security assessment with vulnerabilities identified and remediation guidance",
|
|
717
|
+
priority: "critical",
|
|
718
|
+
requiredCapabilities: ["vulnerability-detection", "secure-coding-review"],
|
|
719
|
+
context: { language, fullCode: code }
|
|
720
|
+
};
|
|
721
|
+
},
|
|
722
|
+
/**
|
|
723
|
+
* Create a performance review task
|
|
724
|
+
*/
|
|
725
|
+
performanceReview(code, language) {
|
|
726
|
+
return {
|
|
727
|
+
description: `Analyze the performance of the following ${language ?? ""} code:
|
|
728
|
+
|
|
729
|
+
\`\`\`${language ?? ""}
|
|
730
|
+
${code.substring(0, 500)}...
|
|
731
|
+
\`\`\``,
|
|
732
|
+
expectedOutput: "Performance analysis with bottlenecks identified and optimization suggestions",
|
|
733
|
+
priority: "high",
|
|
734
|
+
requiredCapabilities: ["performance-analysis", "optimization"],
|
|
735
|
+
context: { language, fullCode: code }
|
|
736
|
+
};
|
|
737
|
+
},
|
|
738
|
+
/**
|
|
739
|
+
* Create a PR review task
|
|
740
|
+
*/
|
|
741
|
+
pullRequestReview(diff, prDescription) {
|
|
742
|
+
return {
|
|
743
|
+
description: `Review this pull request:
|
|
744
|
+
|
|
745
|
+
${prDescription ?? "No description provided"}
|
|
746
|
+
|
|
747
|
+
Diff:
|
|
748
|
+
${diff.substring(0, 1e3)}...`,
|
|
749
|
+
expectedOutput: "PR review with approval/rejection recommendation and detailed feedback",
|
|
750
|
+
priority: "high",
|
|
751
|
+
requiredCapabilities: ["code-review", "architecture-review"],
|
|
752
|
+
context: { prDescription, fullDiff: diff }
|
|
753
|
+
};
|
|
754
|
+
},
|
|
755
|
+
/**
|
|
756
|
+
* Create an architecture review task
|
|
757
|
+
*/
|
|
758
|
+
architectureReview(description, codebase) {
|
|
759
|
+
return {
|
|
760
|
+
description: `Review the architecture described:
|
|
761
|
+
|
|
762
|
+
${description}`,
|
|
763
|
+
expectedOutput: "Architecture assessment with strengths, weaknesses, and recommendations",
|
|
764
|
+
priority: "high",
|
|
765
|
+
requiredCapabilities: ["architecture-review"],
|
|
766
|
+
context: { codebase }
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
// src/templates/CustomerSupportCrew.ts
|
|
772
|
+
var tier1AgentRole = {
|
|
773
|
+
name: "Tier 1 Support Agent",
|
|
774
|
+
description: "Expert at initial customer contact, issue triage, and common problem resolution. Skilled at empathetic communication, quick issue assessment, and knowledge base usage.",
|
|
775
|
+
capabilities: [
|
|
776
|
+
{
|
|
777
|
+
name: "issue-triage",
|
|
778
|
+
description: "Quickly assess and categorize issues",
|
|
779
|
+
proficiency: "expert"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: "common-resolution",
|
|
783
|
+
description: "Resolve common support issues",
|
|
784
|
+
proficiency: "expert"
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
name: "empathetic-communication",
|
|
788
|
+
description: "Communicate with empathy and patience",
|
|
789
|
+
proficiency: "expert"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
name: "knowledge-base-search",
|
|
793
|
+
description: "Find solutions in knowledge base",
|
|
794
|
+
proficiency: "expert"
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
systemPrompt: `You are a Tier 1 customer support agent, the first point of contact for customers.
|
|
798
|
+
|
|
799
|
+
Your approach:
|
|
800
|
+
1. Greet the customer warmly and acknowledge their issue
|
|
801
|
+
2. Gather necessary information to understand the problem
|
|
802
|
+
3. Check the knowledge base for solutions
|
|
803
|
+
4. Provide clear, step-by-step guidance
|
|
804
|
+
5. Escalate complex issues appropriately
|
|
805
|
+
|
|
806
|
+
Always be patient, empathetic, and professional.`,
|
|
807
|
+
goals: [
|
|
808
|
+
"Resolve issues on first contact when possible",
|
|
809
|
+
"Provide excellent customer experience",
|
|
810
|
+
"Accurately assess and triage issues",
|
|
811
|
+
"Escalate appropriately when needed"
|
|
812
|
+
],
|
|
813
|
+
constraints: [
|
|
814
|
+
"Never argue with customers",
|
|
815
|
+
"Always verify customer identity for sensitive issues",
|
|
816
|
+
"Follow company policies and procedures"
|
|
817
|
+
]
|
|
818
|
+
};
|
|
819
|
+
var specialistRole = {
|
|
820
|
+
name: "Support Specialist",
|
|
821
|
+
description: "Expert at handling complex technical issues and advanced troubleshooting. Skilled at deep technical investigation, root cause analysis, and solution development.",
|
|
822
|
+
capabilities: [
|
|
823
|
+
{
|
|
824
|
+
name: "advanced-troubleshooting",
|
|
825
|
+
description: "Handle complex technical issues",
|
|
826
|
+
proficiency: "expert"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
name: "root-cause-analysis",
|
|
830
|
+
description: "Identify root causes of problems",
|
|
831
|
+
proficiency: "expert"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
name: "technical-investigation",
|
|
835
|
+
description: "Conduct deep technical investigations",
|
|
836
|
+
proficiency: "expert"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
name: "solution-development",
|
|
840
|
+
description: "Develop custom solutions",
|
|
841
|
+
proficiency: "expert"
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
systemPrompt: `You are a technical support specialist handling complex customer issues.
|
|
845
|
+
|
|
846
|
+
Your approach:
|
|
847
|
+
1. Review the issue history and initial triage
|
|
848
|
+
2. Conduct thorough technical investigation
|
|
849
|
+
3. Identify the root cause of the problem
|
|
850
|
+
4. Develop and test a solution
|
|
851
|
+
5. Document the resolution for future reference
|
|
852
|
+
|
|
853
|
+
Solve the problem completely and permanently when possible.`,
|
|
854
|
+
goals: [
|
|
855
|
+
"Resolve complex technical issues",
|
|
856
|
+
"Identify and fix root causes",
|
|
857
|
+
"Reduce recurring issues",
|
|
858
|
+
"Build knowledge for future cases"
|
|
859
|
+
],
|
|
860
|
+
constraints: [
|
|
861
|
+
"Document all findings and solutions",
|
|
862
|
+
"Test solutions before implementing",
|
|
863
|
+
"Consider impact on other systems"
|
|
864
|
+
]
|
|
865
|
+
};
|
|
866
|
+
var escalationManagerRole = {
|
|
867
|
+
name: "Escalation Manager",
|
|
868
|
+
description: "Expert at handling critical escalations, VIP customers, and complex situations. Skilled at conflict resolution, executive communication, and crisis management.",
|
|
869
|
+
capabilities: [
|
|
870
|
+
{
|
|
871
|
+
name: "crisis-management",
|
|
872
|
+
description: "Handle crisis situations effectively",
|
|
873
|
+
proficiency: "expert"
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
name: "conflict-resolution",
|
|
877
|
+
description: "Resolve customer conflicts",
|
|
878
|
+
proficiency: "expert"
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
name: "executive-communication",
|
|
882
|
+
description: "Communicate at executive level",
|
|
883
|
+
proficiency: "expert"
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: "decision-making",
|
|
887
|
+
description: "Make critical support decisions",
|
|
888
|
+
proficiency: "expert"
|
|
889
|
+
}
|
|
890
|
+
],
|
|
891
|
+
systemPrompt: `You are an escalation manager handling the most critical customer situations.
|
|
892
|
+
|
|
893
|
+
Your approach:
|
|
894
|
+
1. Review the full case history
|
|
895
|
+
2. Assess the severity and business impact
|
|
896
|
+
3. Take ownership of the situation
|
|
897
|
+
4. Coordinate resources to resolve
|
|
898
|
+
5. Communicate with all stakeholders
|
|
899
|
+
|
|
900
|
+
Turn difficult situations into positive outcomes.`,
|
|
901
|
+
goals: [
|
|
902
|
+
"Resolve critical escalations",
|
|
903
|
+
"Retain at-risk customers",
|
|
904
|
+
"Protect company reputation",
|
|
905
|
+
"Improve processes to prevent escalations"
|
|
906
|
+
],
|
|
907
|
+
constraints: [
|
|
908
|
+
"Authority to make exceptions when justified",
|
|
909
|
+
"Document all decisions and rationale",
|
|
910
|
+
"Balance customer needs with business interests"
|
|
911
|
+
]
|
|
912
|
+
};
|
|
913
|
+
function createCustomerSupportCrewConfig(options = {}) {
|
|
914
|
+
const companyContext = options.companyName ? `
|
|
915
|
+
|
|
916
|
+
You work for ${options.companyName}.` : "";
|
|
917
|
+
const productContext = options.productName ? `
|
|
918
|
+
|
|
919
|
+
You support ${options.productName}.` : "";
|
|
920
|
+
const styleContext = options.supportStyle === "formal" ? "\n\nMaintain a formal, professional tone." : options.supportStyle === "friendly" ? "\n\nBe warm, friendly, and approachable." : options.supportStyle === "technical" ? "\n\nFocus on technical accuracy and detail." : "";
|
|
921
|
+
const contextAddition = companyContext + productContext + styleContext;
|
|
922
|
+
const agents = [
|
|
923
|
+
{
|
|
924
|
+
name: "tier1-agent",
|
|
925
|
+
role: {
|
|
926
|
+
...tier1AgentRole,
|
|
927
|
+
systemPrompt: tier1AgentRole.systemPrompt + contextAddition
|
|
928
|
+
},
|
|
929
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
930
|
+
provider: options.provider ?? "anthropic",
|
|
931
|
+
tools: ["knowledge-base", "ticket-system", ...options.tools ?? []],
|
|
932
|
+
temperature: 0.4
|
|
933
|
+
}
|
|
934
|
+
];
|
|
935
|
+
if (options.includeSpecialist !== false) {
|
|
936
|
+
agents.push({
|
|
937
|
+
name: "specialist",
|
|
938
|
+
role: {
|
|
939
|
+
...specialistRole,
|
|
940
|
+
systemPrompt: specialistRole.systemPrompt + contextAddition
|
|
941
|
+
},
|
|
942
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
943
|
+
provider: options.provider ?? "anthropic",
|
|
944
|
+
tools: [
|
|
945
|
+
"diagnostic-tools",
|
|
946
|
+
"system-logs",
|
|
947
|
+
"knowledge-base",
|
|
948
|
+
...options.tools ?? []
|
|
949
|
+
],
|
|
950
|
+
temperature: 0.2
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
if (options.includeEscalation !== false) {
|
|
954
|
+
agents.push({
|
|
955
|
+
name: "escalation-manager",
|
|
956
|
+
role: {
|
|
957
|
+
...escalationManagerRole,
|
|
958
|
+
systemPrompt: escalationManagerRole.systemPrompt + contextAddition
|
|
959
|
+
},
|
|
960
|
+
model: options.model ?? "claude-sonnet-4-20250514",
|
|
961
|
+
provider: options.provider ?? "anthropic",
|
|
962
|
+
tools: [
|
|
963
|
+
"crm",
|
|
964
|
+
"escalation-system",
|
|
965
|
+
"customer-history",
|
|
966
|
+
...options.tools ?? []
|
|
967
|
+
],
|
|
968
|
+
temperature: 0.3
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
return {
|
|
972
|
+
name: options.name ?? "customer-support-crew",
|
|
973
|
+
description: "A customer support crew for handling customer inquiries and issues",
|
|
974
|
+
agents,
|
|
975
|
+
delegationStrategy: "hierarchical",
|
|
976
|
+
maxIterations: 15
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
function createCustomerSupportCrew(options = {}) {
|
|
980
|
+
const config = createCustomerSupportCrewConfig(options);
|
|
981
|
+
return createCrew(config);
|
|
982
|
+
}
|
|
983
|
+
var CustomerSupportTasks = {
|
|
984
|
+
/**
|
|
985
|
+
* Create a support ticket task
|
|
986
|
+
*/
|
|
987
|
+
handleTicket(customerMessage, priority = "normal", customerTier) {
|
|
988
|
+
return {
|
|
989
|
+
description: `Handle customer support request:
|
|
990
|
+
|
|
991
|
+
${customerMessage}`,
|
|
992
|
+
expectedOutput: "Resolution or escalation with clear next steps for the customer",
|
|
993
|
+
priority: priority === "urgent" ? "critical" : priority === "normal" ? "medium" : priority,
|
|
994
|
+
requiredCapabilities: ["issue-triage", "empathetic-communication"],
|
|
995
|
+
context: { customerTier, priority }
|
|
996
|
+
};
|
|
997
|
+
},
|
|
998
|
+
/**
|
|
999
|
+
* Create a technical issue task
|
|
1000
|
+
*/
|
|
1001
|
+
resolveTechnicalIssue(issueDescription, errorLogs, environment) {
|
|
1002
|
+
return {
|
|
1003
|
+
description: `Resolve technical issue:
|
|
1004
|
+
|
|
1005
|
+
${issueDescription}`,
|
|
1006
|
+
expectedOutput: "Root cause identified and solution provided",
|
|
1007
|
+
priority: "high",
|
|
1008
|
+
requiredCapabilities: ["advanced-troubleshooting", "root-cause-analysis"],
|
|
1009
|
+
context: { errorLogs, environment }
|
|
1010
|
+
};
|
|
1011
|
+
},
|
|
1012
|
+
/**
|
|
1013
|
+
* Create an escalation task
|
|
1014
|
+
*/
|
|
1015
|
+
handleEscalation(caseHistory, customerSentiment = "frustrated", businessImpact) {
|
|
1016
|
+
return {
|
|
1017
|
+
description: `Handle escalated case:
|
|
1018
|
+
|
|
1019
|
+
${caseHistory}`,
|
|
1020
|
+
expectedOutput: "Resolution plan with customer communication and follow-up actions",
|
|
1021
|
+
priority: "critical",
|
|
1022
|
+
requiredCapabilities: ["crisis-management", "conflict-resolution"],
|
|
1023
|
+
context: { customerSentiment, businessImpact }
|
|
1024
|
+
};
|
|
1025
|
+
},
|
|
1026
|
+
/**
|
|
1027
|
+
* Create a feedback response task
|
|
1028
|
+
*/
|
|
1029
|
+
respondToFeedback(feedback, sentiment) {
|
|
1030
|
+
return {
|
|
1031
|
+
description: `Respond to customer feedback:
|
|
1032
|
+
|
|
1033
|
+
${feedback}`,
|
|
1034
|
+
expectedOutput: "Appropriate response acknowledging feedback and any follow-up actions",
|
|
1035
|
+
priority: sentiment === "negative" ? "high" : "medium",
|
|
1036
|
+
requiredCapabilities: ["empathetic-communication"],
|
|
1037
|
+
context: { sentiment }
|
|
1038
|
+
};
|
|
1039
|
+
},
|
|
1040
|
+
/**
|
|
1041
|
+
* Create a knowledge base task
|
|
1042
|
+
*/
|
|
1043
|
+
createKnowledgeBaseArticle(topic, resolution) {
|
|
1044
|
+
return {
|
|
1045
|
+
description: `Create knowledge base article:
|
|
1046
|
+
|
|
1047
|
+
Topic: ${topic}
|
|
1048
|
+
Resolution: ${resolution}`,
|
|
1049
|
+
expectedOutput: "Well-structured knowledge base article for customer self-service",
|
|
1050
|
+
priority: "low",
|
|
1051
|
+
requiredCapabilities: ["knowledge-base-search"],
|
|
1052
|
+
context: {}
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
|
|
1057
|
+
export {
|
|
1058
|
+
createResearchCrewConfig,
|
|
1059
|
+
createResearchCrew,
|
|
1060
|
+
ResearchTasks,
|
|
1061
|
+
createWritingCrewConfig,
|
|
1062
|
+
createWritingCrew,
|
|
1063
|
+
WritingTasks,
|
|
1064
|
+
createCodeReviewCrewConfig,
|
|
1065
|
+
createCodeReviewCrew,
|
|
1066
|
+
CodeReviewTasks,
|
|
1067
|
+
createCustomerSupportCrewConfig,
|
|
1068
|
+
createCustomerSupportCrew,
|
|
1069
|
+
CustomerSupportTasks
|
|
1070
|
+
};
|