@terminusagents/agents 0.1.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.
Files changed (55) hide show
  1. package/README.md +192 -0
  2. package/bin/terminus-agent.js +2 -0
  3. package/dist/agent/executor.d.ts +24 -0
  4. package/dist/agent/executor.js +96 -0
  5. package/dist/agents/budget-planner.d.ts +3 -0
  6. package/dist/agents/budget-planner.js +43 -0
  7. package/dist/agents/career-coach.d.ts +3 -0
  8. package/dist/agents/career-coach.js +43 -0
  9. package/dist/agents/crypto-advisor.d.ts +3 -0
  10. package/dist/agents/crypto-advisor.js +49 -0
  11. package/dist/agents/event-planner.d.ts +3 -0
  12. package/dist/agents/event-planner.js +41 -0
  13. package/dist/agents/fitness-coach.d.ts +3 -0
  14. package/dist/agents/fitness-coach.js +43 -0
  15. package/dist/agents/food-expert.d.ts +3 -0
  16. package/dist/agents/food-expert.js +43 -0
  17. package/dist/agents/fundamental-analyst.d.ts +3 -0
  18. package/dist/agents/fundamental-analyst.js +54 -0
  19. package/dist/agents/health-advisor.d.ts +3 -0
  20. package/dist/agents/health-advisor.js +52 -0
  21. package/dist/agents/index.d.ts +25 -0
  22. package/dist/agents/index.js +99 -0
  23. package/dist/agents/language-tutor.d.ts +3 -0
  24. package/dist/agents/language-tutor.js +41 -0
  25. package/dist/agents/legal-advisor.d.ts +3 -0
  26. package/dist/agents/legal-advisor.js +42 -0
  27. package/dist/agents/real-estate.d.ts +3 -0
  28. package/dist/agents/real-estate.js +41 -0
  29. package/dist/agents/shopping-assistant.d.ts +3 -0
  30. package/dist/agents/shopping-assistant.js +44 -0
  31. package/dist/agents/tech-support.d.ts +3 -0
  32. package/dist/agents/tech-support.js +46 -0
  33. package/dist/agents/technical-analyst.d.ts +3 -0
  34. package/dist/agents/technical-analyst.js +45 -0
  35. package/dist/agents/travel-planner.d.ts +3 -0
  36. package/dist/agents/travel-planner.js +91 -0
  37. package/dist/agents/types.d.ts +20 -0
  38. package/dist/agents/types.js +4 -0
  39. package/dist/cli/doctor.d.ts +4 -0
  40. package/dist/cli/doctor.js +184 -0
  41. package/dist/cli/init.d.ts +16 -0
  42. package/dist/cli/init.js +429 -0
  43. package/dist/cli/run.d.ts +1 -0
  44. package/dist/cli/run.js +98 -0
  45. package/dist/cli/status.d.ts +1 -0
  46. package/dist/cli/status.js +104 -0
  47. package/dist/config/store.d.ts +19 -0
  48. package/dist/config/store.js +148 -0
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.js +61 -0
  51. package/dist/llm/provider.d.ts +56 -0
  52. package/dist/llm/provider.js +181 -0
  53. package/dist/network/client.d.ts +33 -0
  54. package/dist/network/client.js +389 -0
  55. package/package.json +63 -0
@@ -0,0 +1,54 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Fundamental Analyst Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const FundamentalAnalystAgent = {
8
+ id: 'fundamental-analyst',
9
+ name: 'Fundamental Analyst',
10
+ description: 'Analyzes stocks using fundamental analysis',
11
+ systemPrompt: `You are a financial analyst specializing in fundamental analysis. Analyze company financials, earnings, and provide investment insights.`,
12
+ keywords: ['stock', 'earnings', 'revenue', 'valuation', 'company', 'fundamental', 'financial', 'invest'],
13
+ tools: [
14
+ { name: 'getStockData', description: 'Get stock data', parameters: ['symbol'] },
15
+ { name: 'analyzeFinancials', description: 'Analyze financials', parameters: ['symbol', 'period'] },
16
+ { name: 'getEarnings', description: 'Get earnings reports', parameters: ['symbol'] },
17
+ { name: 'getNews', description: 'Get company news', parameters: ['symbol', 'limit'] },
18
+ ],
19
+ };
20
+ // =============================================================================
21
+ // Tool Implementations
22
+ // =============================================================================
23
+ export const FundamentalAnalystTools = {
24
+ getStockData: async (p) => ({
25
+ symbol: p.symbol,
26
+ price: 150.25,
27
+ change: 2.5,
28
+ changePercent: 1.69,
29
+ volume: 15000000,
30
+ marketCap: '2.5T'
31
+ }),
32
+ analyzeFinancials: async (p) => ({
33
+ symbol: p.symbol,
34
+ pe: 28.5,
35
+ eps: 5.27,
36
+ revenue: '394B',
37
+ netIncome: '95B',
38
+ recommendation: 'Hold'
39
+ }),
40
+ getEarnings: async (p) => ({
41
+ symbol: p.symbol,
42
+ quarters: [
43
+ { quarter: 'Q4 2024', eps: 1.85, surprise: '+5%' },
44
+ { quarter: 'Q3 2024', eps: 1.72, surprise: '+3%' },
45
+ ]
46
+ }),
47
+ getNews: async (p) => ({
48
+ symbol: p.symbol,
49
+ news: [
50
+ { title: `${p.symbol} reports strong earnings`, date: '2024-01-15' },
51
+ { title: `Analysts upgrade ${p.symbol}`, date: '2024-01-14' },
52
+ ]
53
+ }),
54
+ };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const HealthAdvisorAgent: AgentDefinition;
3
+ export declare const HealthAdvisorTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,52 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Health Advisor Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const HealthAdvisorAgent = {
8
+ id: 'health-advisor',
9
+ name: 'Health Advisor',
10
+ description: 'Provides health advice, finds doctors and medical facilities',
11
+ systemPrompt: `You are a health advisor. Help users find medical professionals and provide general health guidance. Always recommend consulting a real doctor for serious issues.`,
12
+ keywords: ['health', 'doctor', 'hospital', 'medical', 'symptom', 'medicine', 'pharmacy', 'sick', 'illness'],
13
+ tools: [
14
+ { name: 'searchDoctors', description: 'Find doctors', parameters: ['specialty', 'location'] },
15
+ { name: 'checkSymptoms', description: 'Check symptoms', parameters: ['symptoms'] },
16
+ { name: 'findPharmacy', description: 'Find pharmacies', parameters: ['location', 'medicine'] },
17
+ { name: 'findHospitals', description: 'Find hospitals', parameters: ['location', 'emergency'] },
18
+ ],
19
+ };
20
+ // =============================================================================
21
+ // Tool Implementations
22
+ // =============================================================================
23
+ export const HealthAdvisorTools = {
24
+ searchDoctors: async (p) => ({
25
+ doctors: [
26
+ { name: 'Dr. Michael Reed', specialty: p.specialty, rating: 4.8, location: p.location },
27
+ { name: 'Dr. Sarah Collins', specialty: p.specialty, rating: 4.6, location: p.location },
28
+ { name: 'Dr. James Miller', specialty: p.specialty, rating: 4.9, location: p.location },
29
+ ]
30
+ }),
31
+ checkSymptoms: async (p) => ({
32
+ symptoms: p.symptoms,
33
+ possibleConditions: [
34
+ { condition: 'Common Cold', probability: 'high', recommendation: 'Rest and fluids' },
35
+ { condition: 'Flu', probability: 'medium', recommendation: 'See a doctor if symptoms worsen' },
36
+ ],
37
+ disclaimer: 'This is not medical advice. Please consult a healthcare professional.'
38
+ }),
39
+ findPharmacy: async (p) => ({
40
+ pharmacies: [
41
+ { name: '24/7 Pharmacy', distance: '0.5 km', open: true },
42
+ { name: 'City Pharmacy', distance: '1.2 km', open: true },
43
+ ],
44
+ medicine: p.medicine
45
+ }),
46
+ findHospitals: async (p) => ({
47
+ hospitals: [
48
+ { name: 'City Hospital', distance: '2 km', emergency: true },
49
+ { name: 'University Hospital', distance: '5 km', emergency: true },
50
+ ]
51
+ }),
52
+ };
@@ -0,0 +1,25 @@
1
+ export type { AgentDefinition, AgentTool, ToolParams, ToolResult, ToolImplementation, ToolRegistry } from './types.js';
2
+ import { TravelPlannerAgent, TravelPlannerTools } from './travel-planner.js';
3
+ import { BudgetPlannerAgent, BudgetPlannerTools } from './budget-planner.js';
4
+ import { HealthAdvisorAgent, HealthAdvisorTools } from './health-advisor.js';
5
+ import { FundamentalAnalystAgent, FundamentalAnalystTools } from './fundamental-analyst.js';
6
+ import { TechnicalAnalystAgent, TechnicalAnalystTools } from './technical-analyst.js';
7
+ import { CryptoAdvisorAgent, CryptoAdvisorTools } from './crypto-advisor.js';
8
+ import { FoodExpertAgent, FoodExpertTools } from './food-expert.js';
9
+ import { FitnessCoachAgent, FitnessCoachTools } from './fitness-coach.js';
10
+ import { LegalAdvisorAgent, LegalAdvisorTools } from './legal-advisor.js';
11
+ import { RealEstateAgent, RealEstateTools } from './real-estate.js';
12
+ import { CareerCoachAgent, CareerCoachTools } from './career-coach.js';
13
+ import { EventPlannerAgent, EventPlannerTools } from './event-planner.js';
14
+ import { TechSupportAgent, TechSupportTools } from './tech-support.js';
15
+ import { ShoppingAssistantAgent, ShoppingAssistantTools } from './shopping-assistant.js';
16
+ import { LanguageTutorAgent, LanguageTutorTools } from './language-tutor.js';
17
+ import type { AgentDefinition, ToolParams, ToolResult } from './types.js';
18
+ export declare const AGENTS: AgentDefinition[];
19
+ export declare function executeAgentTool(agentId: string, toolName: string, params: ToolParams): Promise<ToolResult>;
20
+ export declare function getAgentById(id: string): AgentDefinition | undefined;
21
+ export declare function getAllAgentIds(): string[];
22
+ export declare function getAgentToolNames(agentId: string): string[];
23
+ export declare function formatAgentsForLLM(): string;
24
+ export { TravelPlannerAgent, BudgetPlannerAgent, HealthAdvisorAgent, FundamentalAnalystAgent, TechnicalAnalystAgent, CryptoAdvisorAgent, FoodExpertAgent, FitnessCoachAgent, LegalAdvisorAgent, RealEstateAgent, CareerCoachAgent, EventPlannerAgent, TechSupportAgent, ShoppingAssistantAgent, LanguageTutorAgent, };
25
+ export { TravelPlannerTools, BudgetPlannerTools, HealthAdvisorTools, FundamentalAnalystTools, TechnicalAnalystTools, CryptoAdvisorTools, FoodExpertTools, FitnessCoachTools, LegalAdvisorTools, RealEstateTools, CareerCoachTools, EventPlannerTools, TechSupportTools, ShoppingAssistantTools, LanguageTutorTools, };
@@ -0,0 +1,99 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Agents Index
3
+ // =============================================================================
4
+ // Central registry for all agents and their tools.
5
+ // Each agent is in its own file for modularity.
6
+ // =============================================================================
7
+ // Agent Imports
8
+ import { TravelPlannerAgent, TravelPlannerTools } from './travel-planner.js';
9
+ import { BudgetPlannerAgent, BudgetPlannerTools } from './budget-planner.js';
10
+ import { HealthAdvisorAgent, HealthAdvisorTools } from './health-advisor.js';
11
+ import { FundamentalAnalystAgent, FundamentalAnalystTools } from './fundamental-analyst.js';
12
+ import { TechnicalAnalystAgent, TechnicalAnalystTools } from './technical-analyst.js';
13
+ import { CryptoAdvisorAgent, CryptoAdvisorTools } from './crypto-advisor.js';
14
+ import { FoodExpertAgent, FoodExpertTools } from './food-expert.js';
15
+ import { FitnessCoachAgent, FitnessCoachTools } from './fitness-coach.js';
16
+ import { LegalAdvisorAgent, LegalAdvisorTools } from './legal-advisor.js';
17
+ import { RealEstateAgent, RealEstateTools } from './real-estate.js';
18
+ import { CareerCoachAgent, CareerCoachTools } from './career-coach.js';
19
+ import { EventPlannerAgent, EventPlannerTools } from './event-planner.js';
20
+ import { TechSupportAgent, TechSupportTools } from './tech-support.js';
21
+ import { ShoppingAssistantAgent, ShoppingAssistantTools } from './shopping-assistant.js';
22
+ import { LanguageTutorAgent, LanguageTutorTools } from './language-tutor.js';
23
+ // =============================================================================
24
+ // All Agents Registry
25
+ // =============================================================================
26
+ export const AGENTS = [
27
+ TravelPlannerAgent,
28
+ BudgetPlannerAgent,
29
+ HealthAdvisorAgent,
30
+ FundamentalAnalystAgent,
31
+ TechnicalAnalystAgent,
32
+ CryptoAdvisorAgent,
33
+ FoodExpertAgent,
34
+ FitnessCoachAgent,
35
+ LegalAdvisorAgent,
36
+ RealEstateAgent,
37
+ CareerCoachAgent,
38
+ EventPlannerAgent,
39
+ TechSupportAgent,
40
+ ShoppingAssistantAgent,
41
+ LanguageTutorAgent,
42
+ ];
43
+ // =============================================================================
44
+ // All Tools Registry
45
+ // =============================================================================
46
+ const ALL_TOOLS = {
47
+ ...TravelPlannerTools,
48
+ ...BudgetPlannerTools,
49
+ ...HealthAdvisorTools,
50
+ ...FundamentalAnalystTools,
51
+ ...TechnicalAnalystTools,
52
+ ...CryptoAdvisorTools,
53
+ ...FoodExpertTools,
54
+ ...FitnessCoachTools,
55
+ ...LegalAdvisorTools,
56
+ ...RealEstateTools,
57
+ ...CareerCoachTools,
58
+ ...EventPlannerTools,
59
+ ...TechSupportTools,
60
+ ...ShoppingAssistantTools,
61
+ ...LanguageTutorTools,
62
+ };
63
+ // =============================================================================
64
+ // Tool Executor
65
+ // =============================================================================
66
+ export async function executeAgentTool(agentId, toolName, params) {
67
+ console.log(`🔧 ${agentId}.${toolName} invoked`);
68
+ const toolFn = ALL_TOOLS[toolName];
69
+ if (!toolFn) {
70
+ return { success: false, data: { error: `Unknown tool: ${toolName}` } };
71
+ }
72
+ try {
73
+ const result = await toolFn(params);
74
+ return { success: true, data: result };
75
+ }
76
+ catch (error) {
77
+ return { success: false, data: { error: error.message } };
78
+ }
79
+ }
80
+ // =============================================================================
81
+ // Helper Functions
82
+ // =============================================================================
83
+ export function getAgentById(id) {
84
+ return AGENTS.find(a => a.id === id);
85
+ }
86
+ export function getAllAgentIds() {
87
+ return AGENTS.map(a => a.id);
88
+ }
89
+ export function getAgentToolNames(agentId) {
90
+ const agent = getAgentById(agentId);
91
+ return agent ? agent.tools.map(t => t.name) : [];
92
+ }
93
+ export function formatAgentsForLLM() {
94
+ return AGENTS.map(a => `- ${a.id}: ${a.description} (tools: ${a.tools.map(t => t.name).join(', ')})`).join('\n');
95
+ }
96
+ // Re-export individual agents for direct access
97
+ export { TravelPlannerAgent, BudgetPlannerAgent, HealthAdvisorAgent, FundamentalAnalystAgent, TechnicalAnalystAgent, CryptoAdvisorAgent, FoodExpertAgent, FitnessCoachAgent, LegalAdvisorAgent, RealEstateAgent, CareerCoachAgent, EventPlannerAgent, TechSupportAgent, ShoppingAssistantAgent, LanguageTutorAgent, };
98
+ // Re-export all tools
99
+ export { TravelPlannerTools, BudgetPlannerTools, HealthAdvisorTools, FundamentalAnalystTools, TechnicalAnalystTools, CryptoAdvisorTools, FoodExpertTools, FitnessCoachTools, LegalAdvisorTools, RealEstateTools, CareerCoachTools, EventPlannerTools, TechSupportTools, ShoppingAssistantTools, LanguageTutorTools, };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const LanguageTutorAgent: AgentDefinition;
3
+ export declare const LanguageTutorTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,41 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Language Tutor Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const LanguageTutorAgent = {
8
+ id: 'language-tutor',
9
+ name: 'Language Tutor',
10
+ description: 'Helps learn languages and translate text',
11
+ systemPrompt: `You are a language tutor. Help users learn languages, translate text, and practice conversation.`,
12
+ keywords: ['language', 'translate', 'english', 'spanish', 'learn', 'grammar', 'vocabulary'],
13
+ tools: [
14
+ { name: 'translate', description: 'Translate text', parameters: ['text', 'from', 'to'] },
15
+ { name: 'explainGrammar', description: 'Explain grammar', parameters: ['topic', 'language'] },
16
+ { name: 'practiceConversation', description: 'Practice conversation', parameters: ['scenario', 'language'] },
17
+ ],
18
+ };
19
+ // =============================================================================
20
+ // Tool Implementations
21
+ // =============================================================================
22
+ export const LanguageTutorTools = {
23
+ translate: async (p) => ({
24
+ original: p.text,
25
+ translated: `[Translated from ${p.from} to ${p.to}]: ${p.text}`,
26
+ from: p.from,
27
+ to: p.to
28
+ }),
29
+ explainGrammar: async (p) => ({
30
+ topic: p.topic,
31
+ language: p.language,
32
+ explanation: `In ${p.language}, ${p.topic} works like this...`,
33
+ examples: ['Example 1', 'Example 2']
34
+ }),
35
+ practiceConversation: async (p) => ({
36
+ scenario: p.scenario,
37
+ language: p.language,
38
+ dialogue: `Let's practice a ${p.scenario} conversation in ${p.language}!`,
39
+ phrases: ['Hello, how can I help you?', 'I would like to...']
40
+ }),
41
+ };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const LegalAdvisorAgent: AgentDefinition;
3
+ export declare const LegalAdvisorTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,42 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Legal Advisor Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const LegalAdvisorAgent = {
8
+ id: 'legal-advisor',
9
+ name: 'Legal Advisor',
10
+ description: 'Provides legal information and finds lawyers',
11
+ systemPrompt: `You are a legal information assistant. Provide general legal guidance and help find legal professionals. Always recommend consulting a real lawyer for serious matters.`,
12
+ keywords: ['legal', 'law', 'lawyer', 'attorney', 'contract', 'court', 'rights', 'sue'],
13
+ tools: [
14
+ { name: 'searchLaws', description: 'Search laws', parameters: ['topic', 'jurisdiction'] },
15
+ { name: 'findLawyer', description: 'Find lawyers', parameters: ['specialty', 'location'] },
16
+ { name: 'analyzeContract', description: 'Analyze contract', parameters: ['contractText'] },
17
+ ],
18
+ };
19
+ // =============================================================================
20
+ // Tool Implementations
21
+ // =============================================================================
22
+ export const LegalAdvisorTools = {
23
+ searchLaws: async (p) => ({
24
+ topic: p.topic,
25
+ laws: [
26
+ { name: 'Consumer Protection Act', relevance: 'high' },
27
+ { name: 'Civil Code Article 25', relevance: 'medium' },
28
+ ],
29
+ disclaimer: 'Consult a licensed attorney for legal advice.'
30
+ }),
31
+ findLawyer: async (p) => ({
32
+ lawyers: [
33
+ { name: 'Attorney Daniel Brooks', specialty: p.specialty, rating: 4.7 },
34
+ { name: 'Attorney Emma Carter', specialty: p.specialty, rating: 4.9 },
35
+ ]
36
+ }),
37
+ analyzeContract: async (p) => ({
38
+ summary: 'Standard service agreement',
39
+ risks: ['Automatic renewal clause', 'Limited liability section'],
40
+ recommendation: 'Review sections 3 and 7 carefully'
41
+ }),
42
+ };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const RealEstateAgent: AgentDefinition;
3
+ export declare const RealEstateTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,41 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Real Estate Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const RealEstateAgent = {
8
+ id: 'real-estate',
9
+ name: 'Real Estate Agent',
10
+ description: 'Helps find properties and estimates values',
11
+ systemPrompt: `You are a real estate expert. Help users find properties, estimate values, and understand the real estate market.`,
12
+ keywords: ['property', 'house', 'apartment', 'rent', 'buy', 'real estate', 'mortgage', 'listing'],
13
+ tools: [
14
+ { name: 'searchProperties', description: 'Search properties', parameters: ['location', 'type', 'priceRange'] },
15
+ { name: 'estimateValue', description: 'Estimate property value', parameters: ['address'] },
16
+ { name: 'findAgent', description: 'Find real estate agent', parameters: ['location'] },
17
+ ],
18
+ };
19
+ // =============================================================================
20
+ // Tool Implementations
21
+ // =============================================================================
22
+ export const RealEstateTools = {
23
+ searchProperties: async (p) => ({
24
+ properties: [
25
+ { type: p.type, location: p.location, price: 250000, bedrooms: 3 },
26
+ { type: p.type, location: p.location, price: 180000, bedrooms: 2 },
27
+ ]
28
+ }),
29
+ estimateValue: async (p) => ({
30
+ address: p.address,
31
+ estimatedValue: 320000,
32
+ pricePerSqm: 4500,
33
+ trend: 'increasing'
34
+ }),
35
+ findAgent: async (p) => ({
36
+ agents: [
37
+ { name: 'Remax Istanbul', rating: 4.5 },
38
+ { name: 'Century 21', rating: 4.3 },
39
+ ]
40
+ }),
41
+ };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const ShoppingAssistantAgent: AgentDefinition;
3
+ export declare const ShoppingAssistantTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,44 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Shopping Assistant Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const ShoppingAssistantAgent = {
8
+ id: 'shopping-assistant',
9
+ name: 'Shopping Assistant',
10
+ description: 'Helps find products and compare prices',
11
+ systemPrompt: `You are a shopping assistant. Help users find products, compare prices, and find the best deals.`,
12
+ keywords: ['shop', 'buy', 'product', 'amazon', 'online', 'purchase', 'order', 'sale'],
13
+ tools: [
14
+ { name: 'searchProducts', description: 'Search products', parameters: ['query', 'category'] },
15
+ { name: 'comparePrices', description: 'Compare prices', parameters: ['product'] },
16
+ { name: 'findCoupons', description: 'Find coupons', parameters: ['store'] },
17
+ ],
18
+ };
19
+ // =============================================================================
20
+ // Tool Implementations
21
+ // =============================================================================
22
+ export const ShoppingAssistantTools = {
23
+ searchProducts: async (p) => ({
24
+ products: [
25
+ { name: `${p.query} Pro`, price: 299, rating: 4.5, seller: 'Amazon' },
26
+ { name: `${p.query} Basic`, price: 149, rating: 4.2, seller: 'Trendyol' },
27
+ ]
28
+ }),
29
+ comparePrices: async (p) => ({
30
+ product: p.product,
31
+ prices: [
32
+ { source: 'Amazon', price: 299 },
33
+ { source: 'eBay', price: 279 },
34
+ { source: 'Trendyol', price: 2499, currency: 'TRY' },
35
+ ]
36
+ }),
37
+ findCoupons: async (p) => ({
38
+ store: p.store,
39
+ coupons: [
40
+ { code: 'SAVE20', discount: '20% off' },
41
+ { code: 'FREESHIP', discount: 'Free shipping' },
42
+ ]
43
+ }),
44
+ };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const TechSupportAgent: AgentDefinition;
3
+ export declare const TechSupportTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,46 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Tech Support Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const TechSupportAgent = {
8
+ id: 'tech-support',
9
+ name: 'Tech Support',
10
+ description: 'Provides technical troubleshooting and solutions',
11
+ systemPrompt: `You are a technical support specialist. Help users troubleshoot and solve technical problems.`,
12
+ keywords: ['tech', 'computer', 'software', 'bug', 'error', 'fix', 'install', 'problem', 'issue'],
13
+ tools: [
14
+ { name: 'troubleshoot', description: 'Troubleshoot issue', parameters: ['issue', 'device'] },
15
+ { name: 'findSolution', description: 'Find solution', parameters: ['error', 'context'] },
16
+ { name: 'searchDocs', description: 'Search documentation', parameters: ['product', 'topic'] },
17
+ ],
18
+ };
19
+ // =============================================================================
20
+ // Tool Implementations
21
+ // =============================================================================
22
+ export const TechSupportTools = {
23
+ troubleshoot: async (p) => ({
24
+ issue: p.issue,
25
+ steps: [
26
+ 'Restart your device',
27
+ 'Check for updates',
28
+ 'Clear cache and cookies',
29
+ 'Contact support if issue persists'
30
+ ]
31
+ }),
32
+ findSolution: async (p) => ({
33
+ error: p.error,
34
+ solutions: [
35
+ { solution: 'Reinstall the application', success: '72%' },
36
+ { solution: 'Update drivers', success: '65%' },
37
+ ]
38
+ }),
39
+ searchDocs: async (p) => ({
40
+ product: p.product,
41
+ articles: [
42
+ { title: `Getting Started with ${p.product}`, url: '#' },
43
+ { title: `${p.product} FAQ`, url: '#' },
44
+ ]
45
+ }),
46
+ };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const TechnicalAnalystAgent: AgentDefinition;
3
+ export declare const TechnicalAnalystTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,45 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Technical Analyst Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const TechnicalAnalystAgent = {
8
+ id: 'technical-analyst',
9
+ name: 'Technical Analyst',
10
+ description: 'Analyzes charts and technical indicators',
11
+ systemPrompt: `You are a technical analysis expert. Analyze price charts, patterns, and technical indicators.`,
12
+ keywords: ['chart', 'technical', 'pattern', 'indicator', 'trend', 'resistance', 'support', 'rsi', 'macd'],
13
+ tools: [
14
+ { name: 'getChartData', description: 'Get price chart', parameters: ['symbol', 'timeframe'] },
15
+ { name: 'calculateIndicators', description: 'Calculate indicators', parameters: ['symbol', 'indicators'] },
16
+ { name: 'detectPatterns', description: 'Detect patterns', parameters: ['symbol'] },
17
+ ],
18
+ };
19
+ // =============================================================================
20
+ // Tool Implementations
21
+ // =============================================================================
22
+ export const TechnicalAnalystTools = {
23
+ getChartData: async (p) => ({
24
+ symbol: p.symbol,
25
+ timeframe: p.timeframe,
26
+ prices: [148, 149, 151, 150, 152, 155, 153],
27
+ trend: 'bullish'
28
+ }),
29
+ calculateIndicators: async (p) => ({
30
+ symbol: p.symbol,
31
+ indicators: {
32
+ RSI: 62,
33
+ MACD: { value: 1.5, signal: 1.2, histogram: 0.3 },
34
+ SMA20: 148.5,
35
+ SMA50: 145.2
36
+ }
37
+ }),
38
+ detectPatterns: async (p) => ({
39
+ symbol: p.symbol,
40
+ patterns: [
41
+ { pattern: 'Double Bottom', confidence: 0.85, signal: 'bullish' },
42
+ { pattern: 'Rising Wedge', confidence: 0.72, signal: 'bearish' },
43
+ ]
44
+ }),
45
+ };
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition, ToolParams } from './types.js';
2
+ export declare const TravelPlannerAgent: AgentDefinition;
3
+ export declare const TravelPlannerTools: Record<string, (params: ToolParams) => Promise<unknown>>;
@@ -0,0 +1,91 @@
1
+ // =============================================================================
2
+ // TERMINUS AGENTS - Travel Planner Agent
3
+ // =============================================================================
4
+ // =============================================================================
5
+ // Agent Definition
6
+ // =============================================================================
7
+ export const TravelPlannerAgent = {
8
+ id: 'travel-planner',
9
+ name: 'Travel Planner',
10
+ description: 'Plans trips, finds flights and hotels, provides travel advice',
11
+ systemPrompt: `You are a travel planning expert. Help users plan trips by searching for flights, hotels, and providing destination information.`,
12
+ keywords: ['travel', 'trip', 'flight', 'hotel', 'vacation', 'holiday', 'tourism', 'destination'],
13
+ tools: [
14
+ { name: 'searchFlights', description: 'Search for flights', parameters: ['origin', 'destination', 'date'] },
15
+ { name: 'searchHotels', description: 'Search for hotels', parameters: ['location', 'checkIn', 'checkOut'] },
16
+ { name: 'getWeather', description: 'Get weather forecast', parameters: ['location', 'days'] },
17
+ { name: 'getAttractions', description: 'Find attractions', parameters: ['location', 'type'] },
18
+ ],
19
+ };
20
+ function normalizeLocation(value) {
21
+ return String(value || '').toLowerCase();
22
+ }
23
+ function getAttractionsByLocation(location) {
24
+ const normalized = normalizeLocation(location);
25
+ if (normalized.includes('italy') || normalized.includes('rome') || normalized.includes('florence') || normalized.includes('venice')) {
26
+ return [
27
+ { name: 'Colosseum', type: 'landmark', rating: 4.8 },
28
+ { name: 'Vatican Museums', type: 'museum', rating: 4.7 },
29
+ { name: 'Trevi Fountain', type: 'attraction', rating: 4.7 },
30
+ ];
31
+ }
32
+ if (normalized.includes('japan') || normalized.includes('tokyo') || normalized.includes('kyoto') || normalized.includes('osaka')) {
33
+ return [
34
+ { name: 'Tokyo Tower', type: 'landmark', rating: 4.5 },
35
+ { name: 'Senso-ji Temple', type: 'temple', rating: 4.8 },
36
+ { name: 'Shibuya Crossing', type: 'attraction', rating: 4.3 },
37
+ ];
38
+ }
39
+ if (normalized.includes('france') || normalized.includes('paris') || normalized.includes('lyon')) {
40
+ return [
41
+ { name: 'Eiffel Tower', type: 'landmark', rating: 4.7 },
42
+ { name: 'Louvre Museum', type: 'museum', rating: 4.8 },
43
+ { name: 'Notre-Dame Cathedral', type: 'cathedral', rating: 4.7 },
44
+ ];
45
+ }
46
+ return [
47
+ { name: 'City Center Walking District', type: 'attraction', rating: 4.3 },
48
+ { name: 'Main History Museum', type: 'museum', rating: 4.4 },
49
+ { name: 'Local Viewpoint', type: 'landmark', rating: 4.2 },
50
+ ];
51
+ }
52
+ function maybeFilterByType(attractions, requestedType) {
53
+ const type = String(requestedType || '').toLowerCase();
54
+ if (!type || type === 'top' || type === 'all') {
55
+ return attractions;
56
+ }
57
+ const filtered = attractions.filter((item) => item.type.toLowerCase().includes(type));
58
+ return filtered.length > 0 ? filtered : attractions;
59
+ }
60
+ export const TravelPlannerTools = {
61
+ searchFlights: async (p) => ({
62
+ flights: [
63
+ { airline: 'Turkish Airlines', price: 450, departure: '08:00', arrival: '14:30' },
64
+ { airline: 'Pegasus', price: 320, departure: '11:00', arrival: '17:30' },
65
+ { airline: 'Emirates', price: 680, departure: '23:00', arrival: '06:30' },
66
+ ],
67
+ query: { from: p.origin, to: p.destination, date: p.date }
68
+ }),
69
+ searchHotels: async (p) => ({
70
+ hotels: [
71
+ { name: 'Grand Hyatt', rating: 5, price: 250, location: p.location },
72
+ { name: 'Holiday Inn', rating: 4, price: 120, location: p.location },
73
+ { name: 'Airbnb Apartment', rating: 4.5, price: 85, location: p.location },
74
+ ]
75
+ }),
76
+ getWeather: async (p) => ({
77
+ location: p.location,
78
+ forecast: [
79
+ { day: 'Today', temp: 22, condition: 'Sunny' },
80
+ { day: 'Tomorrow', temp: 20, condition: 'Partly Cloudy' },
81
+ { day: 'Day 3', temp: 18, condition: 'Rain' },
82
+ ]
83
+ }),
84
+ getAttractions: async (p) => {
85
+ const attractions = maybeFilterByType(getAttractionsByLocation(p.location), p.type);
86
+ return {
87
+ location: p.location,
88
+ attractions,
89
+ };
90
+ },
91
+ };