@gotza02/seq-thinking 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +98 -86
  2. package/SYSTEM_INSTRUCTIONS.md +35 -35
  3. package/dist/__tests__/agents/base-agent.js +215 -0
  4. package/dist/__tests__/agents/specialist-agent.js +75 -0
  5. package/dist/__tests__/specialist-agent.test.js +653 -30
  6. package/dist/__tests__/types/index.js +278 -0
  7. package/dist/__tests__/utils/llm-adapter.js +93 -0
  8. package/dist/__tests__/utils/logger.js +48 -0
  9. package/dist/constants.d.ts +69 -0
  10. package/dist/constants.d.ts.map +1 -0
  11. package/dist/constants.js +96 -0
  12. package/dist/constants.js.map +1 -0
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +2 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/mcp-server.d.ts.map +1 -1
  18. package/dist/mcp-server.js +16 -2
  19. package/dist/mcp-server.js.map +1 -1
  20. package/dist/utils/llm-adapter.d.ts +4 -4
  21. package/dist/utils/llm-adapter.d.ts.map +1 -1
  22. package/dist/utils/llm-adapter.js +25 -23
  23. package/dist/utils/llm-adapter.js.map +1 -1
  24. package/dist/utils/persistence.d.ts +17 -0
  25. package/dist/utils/persistence.d.ts.map +1 -1
  26. package/dist/utils/persistence.js +60 -5
  27. package/dist/utils/persistence.js.map +1 -1
  28. package/dist/validation/index.d.ts +6 -0
  29. package/dist/validation/index.d.ts.map +1 -0
  30. package/dist/validation/index.js +6 -0
  31. package/dist/validation/index.js.map +1 -0
  32. package/dist/validation/schemas.d.ts +793 -0
  33. package/dist/validation/schemas.d.ts.map +1 -0
  34. package/dist/validation/schemas.js +340 -0
  35. package/dist/validation/schemas.js.map +1 -0
  36. package/dist/validation/schemas.test.d.ts +6 -0
  37. package/dist/validation/schemas.test.d.ts.map +1 -0
  38. package/dist/validation/schemas.test.js +171 -0
  39. package/dist/validation/schemas.test.js.map +1 -0
  40. package/package.json +7 -6
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Specialist Agent Implementation
3
+ * @module agents/specialist-agent
4
+ * @version 1.0.0
5
+ */
6
+ import { BaseAgent } from './base-agent.js';
7
+ import { AgentType } from '../types/index.js';
8
+ import { LLMAdapter } from '../utils/llm-adapter.js';
9
+ /**
10
+ * Specialist agent that focuses on specific domain capabilities
11
+ */
12
+ export class SpecialistAgent extends BaseAgent {
13
+ /**
14
+ * Create a new specialist agent
15
+ * @param config - Agent configuration
16
+ */
17
+ constructor(config) {
18
+ // Convert string capabilities to AgentCapability objects if needed
19
+ const normalizedCapabilities = (config.capabilities || []).map(cap => {
20
+ if (typeof cap === 'string') {
21
+ return {
22
+ name: cap,
23
+ description: `Specialized capability: ${cap}`,
24
+ confidence: 0.8,
25
+ performanceMetrics: { tasksCompleted: 0, averageQuality: 0, averageTimeMs: 0 }
26
+ };
27
+ }
28
+ return cap;
29
+ });
30
+ super({
31
+ name: config.name,
32
+ type: AgentType.SPECIALIST,
33
+ capabilities: normalizedCapabilities,
34
+ confidenceThreshold: config.confidenceThreshold || 0.7
35
+ });
36
+ }
37
+ /**
38
+ * Get agent type
39
+ * @returns Agent type
40
+ */
41
+ getType() {
42
+ return AgentType.SPECIALIST;
43
+ }
44
+ /**
45
+ * Get agent capabilities
46
+ * @returns Array of capabilities
47
+ */
48
+ getCapabilities() {
49
+ return this.config.capabilities;
50
+ }
51
+ /**
52
+ * Process a task using specialist domain knowledge
53
+ * @param task - Task to process
54
+ * @returns Task result
55
+ */
56
+ async process(task) {
57
+ const startTime = Date.now();
58
+ const input = typeof task.input === 'string' ? task.input : JSON.stringify(task.input);
59
+ const capabilitiesList = this.getCapabilities().map(c => c.name).join(', ');
60
+ const prompt = `You are a specialist agent named "${this.config.name}" with expertise in: ${capabilitiesList}.
61
+ Your task is: ${task.description}
62
+ Input details: ${input}
63
+
64
+ Provide a detailed expert response based on your specialized knowledge.`;
65
+ const systemPrompt = `You are an expert specialist in ${capabilitiesList}. Provide precise, high-quality technical or domain-specific analysis.`;
66
+ const response = await LLMAdapter.call(prompt, systemPrompt);
67
+ const output = response.content || `Error: ${response.error}`;
68
+ const confidence = response.error ? 0 : 0.85;
69
+ return this.createTaskResult(task.id, {
70
+ conclusion: output,
71
+ specialistRole: this.config.name,
72
+ capabilitiesUsed: this.getCapabilities().map(c => c.name)
73
+ }, confidence, Date.now() - startTime);
74
+ }
75
+ }