-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathregistry.js
More file actions
82 lines (78 loc) · 2.2 KB
/
Copy pathregistry.js
File metadata and controls
82 lines (78 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* Agent Registry — Marketplace service catalog
* Each agent is a Claude-powered AI service with its own capability and pricing
*/
import { MODEL_LABELS } from './services.js'
export const AGENTS = [
{
id: 'research-bot',
name: '🔬 Research Agent',
endpoint: '/api/research',
price: '0.01',
currency: 'USDC',
model: MODEL_LABELS.research,
capability: 'Deep web research and fact-finding on any topic',
description:
'Uses Claude Haiku for fast, accurate research synthesis. Returns well-sourced analysis.',
status: 'online',
},
{
id: 'summary-bot',
name: '📝 Summary Agent',
endpoint: '/api/summarize',
price: '0.01',
currency: 'USDC',
model: MODEL_LABELS.summary,
capability: 'Text summarization and key insight extraction',
description: 'Condenses long texts into concise, actionable summaries powered by Claude Haiku.',
status: 'online',
},
{
id: 'analyst-bot',
name: '📊 Analysis Agent',
endpoint: '/api/analyze',
price: '0.05',
currency: 'USDC',
model: MODEL_LABELS.analysis,
capability: 'Deep strategic analysis with structured insights',
description:
'Uses Claude Sonnet for premium-tier analysis with automatic Haiku fallback when needed.',
status: 'online',
},
{
id: 'code-bot',
name: '💻 Code Agent',
endpoint: '/api/code',
price: '0.03',
currency: 'USDC',
model: MODEL_LABELS.code,
capability: 'Code generation, review, and debugging',
description: 'Generates, reviews, and debugs code across multiple languages.',
status: 'online',
},
]
/**
* Discover agents by capability keyword
*/
export function discoverAgents(query) {
const q = query.toLowerCase()
return AGENTS.filter(
(a) =>
a.capability.toLowerCase().includes(q) || a.name.toLowerCase().includes(q) || a.id.includes(q)
)
}
/**
* Get agent by ID
*/
export function getAgentById(id) {
return AGENTS.find((a) => a.id === id)
}
/**
* Get total cost estimate for a set of agent IDs
*/
export function estimateCost(agentIds) {
return agentIds.reduce((total, id) => {
const agent = getAgentById(id)
return total + (agent ? parseFloat(agent.price) : 0)
}, 0)
}