@dobbyai/mcp-external 1.1.0 → 1.2.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/README.md +44 -14
- package/dist/__tests__/agent-mail-tools.test.js +19 -26
- package/dist/__tests__/agent-mail-tools.test.js.map +1 -1
- package/dist/__tests__/auth.test.js +50 -5
- package/dist/__tests__/auth.test.js.map +1 -1
- package/dist/__tests__/doctor.test.d.ts +16 -0
- package/dist/__tests__/doctor.test.d.ts.map +1 -0
- package/dist/__tests__/doctor.test.js +258 -0
- package/dist/__tests__/doctor.test.js.map +1 -0
- package/dist/__tests__/external-agents-tools.test.d.ts +11 -0
- package/dist/__tests__/external-agents-tools.test.d.ts.map +1 -0
- package/dist/__tests__/external-agents-tools.test.js +619 -0
- package/dist/__tests__/external-agents-tools.test.js.map +1 -0
- package/dist/__tests__/gateway-bearer.test.d.ts +12 -0
- package/dist/__tests__/gateway-bearer.test.d.ts.map +1 -0
- package/dist/__tests__/gateway-bearer.test.js +112 -0
- package/dist/__tests__/gateway-bearer.test.js.map +1 -0
- package/dist/__tests__/gateway-key-resolver.test.d.ts +10 -0
- package/dist/__tests__/gateway-key-resolver.test.d.ts.map +1 -0
- package/dist/__tests__/gateway-key-resolver.test.js +125 -0
- package/dist/__tests__/gateway-key-resolver.test.js.map +1 -0
- package/dist/__tests__/http-concurrency.test.d.ts +20 -0
- package/dist/__tests__/http-concurrency.test.d.ts.map +1 -0
- package/dist/__tests__/http-concurrency.test.js +254 -0
- package/dist/__tests__/http-concurrency.test.js.map +1 -0
- package/dist/__tests__/integration/protocol.test.js +14 -8
- package/dist/__tests__/integration/protocol.test.js.map +1 -1
- package/dist/__tests__/mcp-integrations.test.js +20 -30
- package/dist/__tests__/mcp-integrations.test.js.map +1 -1
- package/dist/__tests__/memory-graph-tools.test.js +27 -38
- package/dist/__tests__/memory-graph-tools.test.js.map +1 -1
- package/dist/__tests__/registry-dispatch.test.d.ts +11 -0
- package/dist/__tests__/registry-dispatch.test.d.ts.map +1 -0
- package/dist/__tests__/registry-dispatch.test.js +30 -0
- package/dist/__tests__/registry-dispatch.test.js.map +1 -0
- package/dist/__tests__/registry-listing-parity.test.d.ts +2 -0
- package/dist/__tests__/registry-listing-parity.test.d.ts.map +1 -0
- package/dist/__tests__/registry-listing-parity.test.js +89 -0
- package/dist/__tests__/registry-listing-parity.test.js.map +1 -0
- package/dist/__tests__/role-cap.test.d.ts +2 -0
- package/dist/__tests__/role-cap.test.d.ts.map +1 -0
- package/dist/__tests__/role-cap.test.js +113 -0
- package/dist/__tests__/role-cap.test.js.map +1 -0
- package/dist/__tests__/schedule-tools.test.js +15 -20
- package/dist/__tests__/schedule-tools.test.js.map +1 -1
- package/dist/__tests__/server-gateway-key.test.d.ts +18 -0
- package/dist/__tests__/server-gateway-key.test.d.ts.map +1 -0
- package/dist/__tests__/server-gateway-key.test.js +148 -0
- package/dist/__tests__/server-gateway-key.test.js.map +1 -0
- package/dist/__tests__/server-user-scoped.test.d.ts +34 -0
- package/dist/__tests__/server-user-scoped.test.d.ts.map +1 -0
- package/dist/__tests__/server-user-scoped.test.js +577 -0
- package/dist/__tests__/server-user-scoped.test.js.map +1 -0
- package/dist/__tests__/task-id-pattern.test.d.ts +12 -0
- package/dist/__tests__/task-id-pattern.test.d.ts.map +1 -0
- package/dist/__tests__/task-id-pattern.test.js +43 -0
- package/dist/__tests__/task-id-pattern.test.js.map +1 -0
- package/dist/__tests__/tiers.test.js +152 -56
- package/dist/__tests__/tiers.test.js.map +1 -1
- package/dist/__tests__/tools/hosted-agents.test.d.ts +9 -0
- package/dist/__tests__/tools/hosted-agents.test.d.ts.map +1 -0
- package/dist/__tests__/tools/hosted-agents.test.js +301 -0
- package/dist/__tests__/tools/hosted-agents.test.js.map +1 -0
- package/dist/__tests__/tools/llm-providers.test.d.ts +10 -0
- package/dist/__tests__/tools/llm-providers.test.d.ts.map +1 -0
- package/dist/__tests__/tools/llm-providers.test.js +105 -0
- package/dist/__tests__/tools/llm-providers.test.js.map +1 -0
- package/dist/__tests__/tools/services.test.js +139 -98
- package/dist/__tests__/tools/services.test.js.map +1 -1
- package/dist/__tests__/tools.test.js +24 -15
- package/dist/__tests__/tools.test.js.map +1 -1
- package/dist/__tests__/transport.test.js +365 -23
- package/dist/__tests__/transport.test.js.map +1 -1
- package/dist/__tests__/validate-credentials.test.d.ts +9 -0
- package/dist/__tests__/validate-credentials.test.d.ts.map +1 -0
- package/dist/__tests__/validate-credentials.test.js +172 -0
- package/dist/__tests__/validate-credentials.test.js.map +1 -0
- package/dist/__tests__/web-eval-tools.test.js +21 -32
- package/dist/__tests__/web-eval-tools.test.js.map +1 -1
- package/dist/__tests__/whoami.test.d.ts +11 -0
- package/dist/__tests__/whoami.test.d.ts.map +1 -0
- package/dist/__tests__/whoami.test.js +194 -0
- package/dist/__tests__/whoami.test.js.map +1 -0
- package/dist/__tests__/workflow-tools.test.js +20 -27
- package/dist/__tests__/workflow-tools.test.js.map +1 -1
- package/dist/__tests__/workloads.test.d.ts +9 -0
- package/dist/__tests__/workloads.test.d.ts.map +1 -0
- package/dist/__tests__/workloads.test.js +169 -0
- package/dist/__tests__/workloads.test.js.map +1 -0
- package/dist/auth/token-verifier.d.ts +11 -6
- package/dist/auth/token-verifier.d.ts.map +1 -1
- package/dist/auth/token-verifier.js +41 -19
- package/dist/auth/token-verifier.js.map +1 -1
- package/dist/connectors/claude-desktop.d.ts.map +1 -1
- package/dist/connectors/claude-desktop.js +3 -2
- package/dist/connectors/claude-desktop.js.map +1 -1
- package/dist/connectors/cursor.d.ts.map +1 -1
- package/dist/connectors/cursor.js +3 -2
- package/dist/connectors/cursor.js.map +1 -1
- package/dist/connectors/setup.d.ts.map +1 -1
- package/dist/connectors/setup.js +2 -1
- package/dist/connectors/setup.js.map +1 -1
- package/dist/connectors/vscode.d.ts.map +1 -1
- package/dist/connectors/vscode.js +3 -2
- package/dist/connectors/vscode.js.map +1 -1
- package/dist/connectors/windsurf.d.ts.map +1 -1
- package/dist/connectors/windsurf.js +3 -2
- package/dist/connectors/windsurf.js.map +1 -1
- package/dist/doctor.d.ts +34 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +134 -0
- package/dist/doctor.js.map +1 -0
- package/dist/http-server.d.ts +24 -3
- package/dist/http-server.d.ts.map +1 -1
- package/dist/http-server.js +342 -62
- package/dist/http-server.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -208
- package/dist/index.js.map +1 -1
- package/dist/lib/consts.d.ts +21 -0
- package/dist/lib/consts.d.ts.map +1 -0
- package/dist/lib/consts.js +30 -0
- package/dist/lib/consts.js.map +1 -0
- package/dist/lib/dobby-client.d.ts +50 -23
- package/dist/lib/dobby-client.d.ts.map +1 -1
- package/dist/lib/dobby-client.js +105 -54
- package/dist/lib/dobby-client.js.map +1 -1
- package/dist/lib/gateway-key-resolver.d.ts +38 -0
- package/dist/lib/gateway-key-resolver.d.ts.map +1 -0
- package/dist/lib/gateway-key-resolver.js +59 -0
- package/dist/lib/gateway-key-resolver.js.map +1 -0
- package/dist/lib/log.d.ts +25 -0
- package/dist/lib/log.d.ts.map +1 -0
- package/dist/lib/log.js +36 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/server.d.ts +175 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1017 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/agent-mail.d.ts +0 -41
- package/dist/tools/agent-mail.d.ts.map +1 -1
- package/dist/tools/agent-mail.js +0 -222
- package/dist/tools/agent-mail.js.map +1 -1
- package/dist/tools/agent-versions.d.ts +93 -0
- package/dist/tools/agent-versions.d.ts.map +1 -0
- package/dist/tools/agent-versions.js +99 -0
- package/dist/tools/agent-versions.js.map +1 -0
- package/dist/tools/approvals.d.ts +0 -34
- package/dist/tools/approvals.d.ts.map +1 -1
- package/dist/tools/approvals.js +0 -81
- package/dist/tools/approvals.js.map +1 -1
- package/dist/tools/claude-code-sync.d.ts +40 -0
- package/dist/tools/claude-code-sync.d.ts.map +1 -0
- package/dist/tools/claude-code-sync.js +52 -0
- package/dist/tools/claude-code-sync.js.map +1 -0
- package/dist/tools/control-plane.d.ts +118 -0
- package/dist/tools/control-plane.d.ts.map +1 -0
- package/dist/tools/control-plane.js +135 -0
- package/dist/tools/control-plane.js.map +1 -0
- package/dist/tools/crew-builder.d.ts +0 -66
- package/dist/tools/crew-builder.d.ts.map +1 -1
- package/dist/tools/crew-builder.js +0 -185
- package/dist/tools/crew-builder.js.map +1 -1
- package/dist/tools/crewai.d.ts +0 -63
- package/dist/tools/crewai.d.ts.map +1 -1
- package/dist/tools/crewai.js +0 -145
- package/dist/tools/crewai.js.map +1 -1
- package/dist/tools/exa.d.ts +0 -35
- package/dist/tools/exa.d.ts.map +1 -1
- package/dist/tools/exa.js +0 -103
- package/dist/tools/exa.js.map +1 -1
- package/dist/tools/external-agents.d.ts +440 -0
- package/dist/tools/external-agents.d.ts.map +1 -0
- package/dist/tools/external-agents.js +386 -0
- package/dist/tools/external-agents.js.map +1 -0
- package/dist/tools/github-mcp.d.ts +0 -75
- package/dist/tools/github-mcp.d.ts.map +1 -1
- package/dist/tools/github-mcp.js +0 -162
- package/dist/tools/github-mcp.js.map +1 -1
- package/dist/tools/governance.d.ts +162 -18
- package/dist/tools/governance.d.ts.map +1 -1
- package/dist/tools/governance.js +208 -93
- package/dist/tools/governance.js.map +1 -1
- package/dist/tools/hosted-agents.d.ts +216 -0
- package/dist/tools/hosted-agents.d.ts.map +1 -0
- package/dist/tools/hosted-agents.js +214 -0
- package/dist/tools/hosted-agents.js.map +1 -0
- package/dist/tools/index.d.ts +3933 -1219
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +412 -393
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/jira.d.ts +0 -176
- package/dist/tools/jira.d.ts.map +1 -1
- package/dist/tools/jira.js +0 -365
- package/dist/tools/jira.js.map +1 -1
- package/dist/tools/llm-providers.d.ts +50 -0
- package/dist/tools/llm-providers.d.ts.map +1 -0
- package/dist/tools/llm-providers.js +41 -0
- package/dist/tools/llm-providers.js.map +1 -0
- package/dist/tools/mcp-metrics.d.ts +0 -15
- package/dist/tools/mcp-metrics.d.ts.map +1 -1
- package/dist/tools/mcp-metrics.js +0 -217
- package/dist/tools/mcp-metrics.js.map +1 -1
- package/dist/tools/mcp-tools.d.ts +0 -29
- package/dist/tools/mcp-tools.d.ts.map +1 -1
- package/dist/tools/mcp-tools.js +0 -131
- package/dist/tools/mcp-tools.js.map +1 -1
- package/dist/tools/mem0.d.ts +0 -41
- package/dist/tools/mem0.d.ts.map +1 -1
- package/dist/tools/mem0.js +65 -165
- package/dist/tools/mem0.js.map +1 -1
- package/dist/tools/memory-graph.d.ts +0 -46
- package/dist/tools/memory-graph.d.ts.map +1 -1
- package/dist/tools/memory-graph.js +0 -386
- package/dist/tools/memory-graph.js.map +1 -1
- package/dist/tools/memory-stores.d.ts +141 -0
- package/dist/tools/memory-stores.d.ts.map +1 -0
- package/dist/tools/memory-stores.js +147 -0
- package/dist/tools/memory-stores.js.map +1 -0
- package/dist/tools/messages.d.ts +0 -20
- package/dist/tools/messages.d.ts.map +1 -1
- package/dist/tools/messages.js +0 -49
- package/dist/tools/messages.js.map +1 -1
- package/dist/tools/moltbook.d.ts +0 -236
- package/dist/tools/moltbook.d.ts.map +1 -1
- package/dist/tools/moltbook.js +0 -458
- package/dist/tools/moltbook.js.map +1 -1
- package/dist/tools/monitoring-attribution.d.ts +71 -0
- package/dist/tools/monitoring-attribution.d.ts.map +1 -0
- package/dist/tools/monitoring-attribution.js +74 -0
- package/dist/tools/monitoring-attribution.js.map +1 -0
- package/dist/tools/ops.d.ts +0 -80
- package/dist/tools/ops.d.ts.map +1 -1
- package/dist/tools/ops.js +0 -209
- package/dist/tools/ops.js.map +1 -1
- package/dist/tools/orchestrations.d.ts +109 -0
- package/dist/tools/orchestrations.d.ts.map +1 -0
- package/dist/tools/orchestrations.js +115 -0
- package/dist/tools/orchestrations.js.map +1 -0
- package/dist/tools/outcomes.d.ts +138 -0
- package/dist/tools/outcomes.d.ts.map +1 -0
- package/dist/tools/outcomes.js +136 -0
- package/dist/tools/outcomes.js.map +1 -0
- package/dist/tools/schedules.d.ts +0 -47
- package/dist/tools/schedules.d.ts.map +1 -1
- package/dist/tools/schedules.js +0 -109
- package/dist/tools/schedules.js.map +1 -1
- package/dist/tools/services.d.ts +0 -16
- package/dist/tools/services.d.ts.map +1 -1
- package/dist/tools/services.js +0 -135
- package/dist/tools/services.js.map +1 -1
- package/dist/tools/sessions.d.ts +124 -0
- package/dist/tools/sessions.d.ts.map +1 -0
- package/dist/tools/sessions.js +130 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/setup-status.d.ts +29 -0
- package/dist/tools/setup-status.d.ts.map +1 -0
- package/dist/tools/setup-status.js +35 -0
- package/dist/tools/setup-status.js.map +1 -0
- package/dist/tools/tasks.d.ts +0 -57
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +8 -217
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/tiers.d.ts +23 -7
- package/dist/tools/tiers.d.ts.map +1 -1
- package/dist/tools/tiers.js +180 -79
- package/dist/tools/tiers.js.map +1 -1
- package/dist/tools/unified-agents.d.ts +0 -19
- package/dist/tools/unified-agents.d.ts.map +1 -1
- package/dist/tools/unified-agents.js +2 -103
- package/dist/tools/unified-agents.js.map +1 -1
- package/dist/tools/web-eval.d.ts +0 -43
- package/dist/tools/web-eval.d.ts.map +1 -1
- package/dist/tools/web-eval.js +0 -211
- package/dist/tools/web-eval.js.map +1 -1
- package/dist/tools/workflow.d.ts +0 -66
- package/dist/tools/workflow.d.ts.map +1 -1
- package/dist/tools/workflow.js +2 -409
- package/dist/tools/workflow.js.map +1 -1
- package/dist/tools/workloads.d.ts +81 -0
- package/dist/tools/workloads.d.ts.map +1 -0
- package/dist/tools/workloads.js +81 -0
- package/dist/tools/workloads.js.map +1 -0
- package/package.json +7 -6
- package/dist/tools/knowledge-base.d.ts +0 -144
- package/dist/tools/knowledge-base.d.ts.map +0 -1
- package/dist/tools/knowledge-base.js +0 -179
- package/dist/tools/knowledge-base.js.map +0 -1
|
@@ -139,192 +139,7 @@ export const crewBuilderTools = {
|
|
|
139
139
|
},
|
|
140
140
|
},
|
|
141
141
|
};
|
|
142
|
-
async function callCrewBuilderProxy(client, payload) {
|
|
143
|
-
const url = `${client.apiUrl}/api/v1/gateway/agents/proxy`;
|
|
144
|
-
const response = await fetch(url, {
|
|
145
|
-
method: 'POST',
|
|
146
|
-
headers: {
|
|
147
|
-
'Content-Type': 'application/json',
|
|
148
|
-
Authorization: `Bearer ${client.apiKey}`,
|
|
149
|
-
...(client.tenantId ? { 'X-Tenant-Id': client.tenantId } : {}),
|
|
150
|
-
},
|
|
151
|
-
body: JSON.stringify({
|
|
152
|
-
...payload,
|
|
153
|
-
provider_id: 'crewai-local',
|
|
154
|
-
}),
|
|
155
|
-
});
|
|
156
|
-
if (!response.ok) {
|
|
157
|
-
const errBody = await response.json().catch(() => ({
|
|
158
|
-
error: `Gateway proxy returned ${response.status}`,
|
|
159
|
-
}));
|
|
160
|
-
throw new Error(errBody.error ||
|
|
161
|
-
errBody.detail ||
|
|
162
|
-
`Gateway proxy error: HTTP ${response.status}`);
|
|
163
|
-
}
|
|
164
|
-
return response.json();
|
|
165
|
-
}
|
|
166
142
|
// ============================================
|
|
167
143
|
// Tool Handlers
|
|
168
144
|
// ============================================
|
|
169
|
-
export async function handleCrewValidate(client, args) {
|
|
170
|
-
try {
|
|
171
|
-
const data = await callCrewBuilderProxy(client, {
|
|
172
|
-
action: 'validate',
|
|
173
|
-
provider_id: 'crewai-local',
|
|
174
|
-
agents_yaml: args.agents_yaml,
|
|
175
|
-
tasks_yaml: args.tasks_yaml,
|
|
176
|
-
});
|
|
177
|
-
const resp = data.response || {};
|
|
178
|
-
let text = `# Crew YAML Validation\n\n`;
|
|
179
|
-
if (resp.valid) {
|
|
180
|
-
text += `✅ **Valid** — Configuration is ready to run.\n\n`;
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
text += `❌ **Invalid** — Found ${resp.errors?.length || 0} error(s):\n\n`;
|
|
184
|
-
for (const error of resp.errors || []) {
|
|
185
|
-
text += `- ${error}\n`;
|
|
186
|
-
}
|
|
187
|
-
text += `\n`;
|
|
188
|
-
}
|
|
189
|
-
if (resp.agents?.length > 0) {
|
|
190
|
-
text += `## Agents (${resp.agents.length})\n\n`;
|
|
191
|
-
for (const agent of resp.agents) {
|
|
192
|
-
text += `- **${agent.name}** — ${agent.role} (${agent.goal})\n`;
|
|
193
|
-
}
|
|
194
|
-
text += `\n`;
|
|
195
|
-
}
|
|
196
|
-
if (resp.tasks?.length > 0) {
|
|
197
|
-
text += `## Tasks (${resp.tasks.length})\n\n`;
|
|
198
|
-
for (const task of resp.tasks) {
|
|
199
|
-
text += `- **${task.name}** → agent: \`${task.agent}\` — ${task.description}\n`;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return { content: [{ type: 'text', text }] };
|
|
203
|
-
}
|
|
204
|
-
catch (error) {
|
|
205
|
-
return {
|
|
206
|
-
content: [
|
|
207
|
-
{ type: 'text', text: `Crew validation failed: ${error.message}` },
|
|
208
|
-
],
|
|
209
|
-
isError: true,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
export async function handleCrewKickoff(client, args) {
|
|
214
|
-
try {
|
|
215
|
-
const data = await callCrewBuilderProxy(client, {
|
|
216
|
-
action: 'local_kickoff',
|
|
217
|
-
provider_id: 'crewai-local',
|
|
218
|
-
agents_yaml: args.agents_yaml,
|
|
219
|
-
tasks_yaml: args.tasks_yaml,
|
|
220
|
-
variables: args.variables || {},
|
|
221
|
-
process_type: args.process_type || 'sequential',
|
|
222
|
-
});
|
|
223
|
-
const resp = data.response || {};
|
|
224
|
-
let text = `# Crew Kickoff Started\n\n`;
|
|
225
|
-
text += `- **Run ID:** \`${resp.run_id}\`\n`;
|
|
226
|
-
text += `- **Status:** ${resp.status}\n`;
|
|
227
|
-
text += `- **Agents:** ${resp.agent_count}\n`;
|
|
228
|
-
text += `- **Tasks:** ${resp.task_count}\n`;
|
|
229
|
-
text += `- **Process:** ${resp.process_type}\n`;
|
|
230
|
-
text += `- **Latency:** ${data.latency_ms}ms\n\n`;
|
|
231
|
-
text += `Use \`crew_status\` with run_id \`${resp.run_id}\` to check progress.`;
|
|
232
|
-
return { content: [{ type: 'text', text }] };
|
|
233
|
-
}
|
|
234
|
-
catch (error) {
|
|
235
|
-
return {
|
|
236
|
-
content: [
|
|
237
|
-
{ type: 'text', text: `Crew kickoff failed: ${error.message}` },
|
|
238
|
-
],
|
|
239
|
-
isError: true,
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
export async function handleCrewStatus(client, args) {
|
|
244
|
-
try {
|
|
245
|
-
const data = await callCrewBuilderProxy(client, {
|
|
246
|
-
action: 'local_status',
|
|
247
|
-
provider_id: 'crewai-local',
|
|
248
|
-
run_id: args.run_id,
|
|
249
|
-
});
|
|
250
|
-
const resp = data.response || {};
|
|
251
|
-
let text = `# Crew Run Status\n\n`;
|
|
252
|
-
text += `- **Run ID:** \`${resp.run_id}\`\n`;
|
|
253
|
-
text += `- **Status:** ${resp.status}\n`;
|
|
254
|
-
text += `- **Process:** ${resp.process_type}\n`;
|
|
255
|
-
text += `- **Agents:** ${resp.agent_count}\n`;
|
|
256
|
-
text += `- **Tasks:** ${resp.task_count}\n`;
|
|
257
|
-
if (resp.started_at) {
|
|
258
|
-
text += `- **Started:** ${resp.started_at}\n`;
|
|
259
|
-
}
|
|
260
|
-
if (resp.completed_at) {
|
|
261
|
-
text += `- **Completed:** ${resp.completed_at}\n`;
|
|
262
|
-
}
|
|
263
|
-
if (resp.duration_ms != null) {
|
|
264
|
-
text += `- **Duration:** ${resp.duration_ms}ms\n`;
|
|
265
|
-
}
|
|
266
|
-
if (resp.error_message) {
|
|
267
|
-
text += `\n## Error\n\n\`\`\`\n${resp.error_message}\n\`\`\`\n`;
|
|
268
|
-
}
|
|
269
|
-
if (resp.agent_outputs?.length > 0) {
|
|
270
|
-
text += `\n## Agent Outputs\n\n`;
|
|
271
|
-
for (const output of resp.agent_outputs) {
|
|
272
|
-
text += `### ${output.task || 'Task'}\n\n${output.output}\n\n`;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
if (resp.result) {
|
|
276
|
-
text += `\n## Final Result\n\n${resp.result}\n`;
|
|
277
|
-
}
|
|
278
|
-
return { content: [{ type: 'text', text }] };
|
|
279
|
-
}
|
|
280
|
-
catch (error) {
|
|
281
|
-
return {
|
|
282
|
-
content: [
|
|
283
|
-
{ type: 'text', text: `Failed to get crew status: ${error.message}` },
|
|
284
|
-
],
|
|
285
|
-
isError: true,
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
export async function handleCrewList(client, args) {
|
|
290
|
-
try {
|
|
291
|
-
const data = await callCrewBuilderProxy(client, {
|
|
292
|
-
action: 'list_runs',
|
|
293
|
-
provider_id: 'crewai-local',
|
|
294
|
-
limit: args.limit || 10,
|
|
295
|
-
status: args.status_filter,
|
|
296
|
-
});
|
|
297
|
-
const resp = data.response || {};
|
|
298
|
-
const runs = resp.runs || [];
|
|
299
|
-
let text = `# Crew Runs (${runs.length})\n\n`;
|
|
300
|
-
if (runs.length === 0) {
|
|
301
|
-
text += `_No crew runs found._\n`;
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
for (const run of runs) {
|
|
305
|
-
const statusIcon = run.status === 'completed' ? '✅' :
|
|
306
|
-
run.status === 'running' ? '🔄' :
|
|
307
|
-
run.status === 'failed' ? '❌' : '⏳';
|
|
308
|
-
text += `- ${statusIcon} **${run.run_id}** [${run.status}] — `;
|
|
309
|
-
text += `${run.agent_count} agents, ${run.task_count} tasks`;
|
|
310
|
-
if (run.duration_ms != null) {
|
|
311
|
-
text += ` (${run.duration_ms}ms)`;
|
|
312
|
-
}
|
|
313
|
-
if (run.has_error) {
|
|
314
|
-
text += ` ⚠️`;
|
|
315
|
-
}
|
|
316
|
-
text += `\n`;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return { content: [{ type: 'text', text }] };
|
|
320
|
-
}
|
|
321
|
-
catch (error) {
|
|
322
|
-
return {
|
|
323
|
-
content: [
|
|
324
|
-
{ type: 'text', text: `Failed to list crew runs: ${error.message}` },
|
|
325
|
-
],
|
|
326
|
-
isError: true,
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
145
|
//# sourceMappingURL=crew-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crew-builder.js","sourceRoot":"","sources":["../../src/tools/crew-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"crew-builder.js","sourceRoot":"","sources":["../../src/tools/crew-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,+CAA+C;AAC/C,mBAAmB;AACnB,+CAA+C;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,aAAa,EAAE;QACb,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;SACrB;QACD,WAAW,EACT,+EAA+E;YAC/E,0DAA0D;YAC1D,mEAAmE;QACrE,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,yEAAyE;wBACzE,YAAY;wBACZ,eAAe;wBACf,4BAA4B;wBAC5B,0CAA0C;wBAC1C,4CAA4C;iBAC/C;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,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N,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wCAAwC;iBACtD;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB;KACF;IAED,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE;YACX,KAAK,EAAE,YAAY;YACnB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;SACrB;QACD,WAAW,EACT,iFAAiF;QACnF,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iDAAiD;iBAC/D;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,CAAC;oBAC/C,WAAW,EAAE,sCAAsC;iBACpD;aACF;SACF;KACF;CACF,CAAC;AAIF,+CAA+C;AAC/C,gBAAgB;AAChB,+CAA+C"}
|
package/dist/tools/crewai.d.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* - connection lookup
|
|
8
8
|
* - request forwarding
|
|
9
9
|
*/
|
|
10
|
-
import { DobbyClient } from '../lib/dobby-client.js';
|
|
11
10
|
export declare const crewaiTools: {
|
|
12
11
|
crewai_health: {
|
|
13
12
|
name: string;
|
|
@@ -99,66 +98,4 @@ export declare const crewaiTools: {
|
|
|
99
98
|
};
|
|
100
99
|
};
|
|
101
100
|
};
|
|
102
|
-
export declare function handleCrewAIHealth(client: DobbyClient, args: {
|
|
103
|
-
connection_id?: string;
|
|
104
|
-
}): Promise<{
|
|
105
|
-
content: {
|
|
106
|
-
type: "text";
|
|
107
|
-
text: string;
|
|
108
|
-
}[];
|
|
109
|
-
isError?: undefined;
|
|
110
|
-
} | {
|
|
111
|
-
content: {
|
|
112
|
-
type: "text";
|
|
113
|
-
text: string;
|
|
114
|
-
}[];
|
|
115
|
-
isError: boolean;
|
|
116
|
-
}>;
|
|
117
|
-
export declare function handleCrewAIInputs(client: DobbyClient, args: {
|
|
118
|
-
connection_id?: string;
|
|
119
|
-
}): Promise<{
|
|
120
|
-
content: {
|
|
121
|
-
type: "text";
|
|
122
|
-
text: string;
|
|
123
|
-
}[];
|
|
124
|
-
isError?: undefined;
|
|
125
|
-
} | {
|
|
126
|
-
content: {
|
|
127
|
-
type: "text";
|
|
128
|
-
text: string;
|
|
129
|
-
}[];
|
|
130
|
-
isError: boolean;
|
|
131
|
-
}>;
|
|
132
|
-
export declare function handleCrewAIKickoff(client: DobbyClient, args: {
|
|
133
|
-
inputs: Record<string, string>;
|
|
134
|
-
connection_id?: string;
|
|
135
|
-
}): Promise<{
|
|
136
|
-
content: {
|
|
137
|
-
type: "text";
|
|
138
|
-
text: string;
|
|
139
|
-
}[];
|
|
140
|
-
isError?: undefined;
|
|
141
|
-
} | {
|
|
142
|
-
content: {
|
|
143
|
-
type: "text";
|
|
144
|
-
text: string;
|
|
145
|
-
}[];
|
|
146
|
-
isError: boolean;
|
|
147
|
-
}>;
|
|
148
|
-
export declare function handleCrewAIStatus(client: DobbyClient, args: {
|
|
149
|
-
kickoff_id: string;
|
|
150
|
-
connection_id?: string;
|
|
151
|
-
}): Promise<{
|
|
152
|
-
content: {
|
|
153
|
-
type: "text";
|
|
154
|
-
text: string;
|
|
155
|
-
}[];
|
|
156
|
-
isError?: undefined;
|
|
157
|
-
} | {
|
|
158
|
-
content: {
|
|
159
|
-
type: "text";
|
|
160
|
-
text: string;
|
|
161
|
-
}[];
|
|
162
|
-
isError: boolean;
|
|
163
|
-
}>;
|
|
164
101
|
//# sourceMappingURL=crewai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crewai.d.ts","sourceRoot":"","sources":["../../src/tools/crewai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"crewai.d.ts","sourceRoot":"","sources":["../../src/tools/crewai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoGvB,CAAC"}
|
package/dist/tools/crewai.js
CHANGED
|
@@ -99,152 +99,7 @@ export const crewaiTools = {
|
|
|
99
99
|
},
|
|
100
100
|
},
|
|
101
101
|
};
|
|
102
|
-
async function callGatewayProxy(client, payload) {
|
|
103
|
-
const url = `${client.apiUrl}/api/v1/gateway/agents/proxy`;
|
|
104
|
-
const response = await fetch(url, {
|
|
105
|
-
method: 'POST',
|
|
106
|
-
headers: {
|
|
107
|
-
'Content-Type': 'application/json',
|
|
108
|
-
Authorization: `Bearer ${client.apiKey}`,
|
|
109
|
-
...(client.tenantId ? { 'X-Tenant-Id': client.tenantId } : {}),
|
|
110
|
-
},
|
|
111
|
-
body: JSON.stringify({
|
|
112
|
-
...payload,
|
|
113
|
-
provider_id: payload.provider_id || 'crewai',
|
|
114
|
-
}),
|
|
115
|
-
});
|
|
116
|
-
if (!response.ok) {
|
|
117
|
-
const errBody = await response.json().catch(() => ({
|
|
118
|
-
error: `Gateway proxy returned ${response.status}`,
|
|
119
|
-
}));
|
|
120
|
-
throw new Error(errBody.error ||
|
|
121
|
-
`Gateway proxy error: HTTP ${response.status}`);
|
|
122
|
-
}
|
|
123
|
-
return response.json();
|
|
124
|
-
}
|
|
125
102
|
// ============================================
|
|
126
103
|
// Tool Handlers
|
|
127
104
|
// ============================================
|
|
128
|
-
export async function handleCrewAIHealth(client, args) {
|
|
129
|
-
try {
|
|
130
|
-
const data = await callGatewayProxy(client, {
|
|
131
|
-
action: 'health',
|
|
132
|
-
connection_id: args.connection_id,
|
|
133
|
-
});
|
|
134
|
-
const conn = data.connection || {};
|
|
135
|
-
let text = `# CrewAI Health Check\n\n`;
|
|
136
|
-
text += `- **Status:** ${data.response?.status || 'unknown'}\n`;
|
|
137
|
-
text += `- **Connection:** ${conn.display_name || conn.connection_id}\n`;
|
|
138
|
-
text += `- **Provider:** ${conn.provider_id}\n`;
|
|
139
|
-
text += `- **Connection Status:** ${conn.status}\n`;
|
|
140
|
-
text += `- **Latency:** ${data.latency_ms}ms\n`;
|
|
141
|
-
return { content: [{ type: 'text', text }] };
|
|
142
|
-
}
|
|
143
|
-
catch (error) {
|
|
144
|
-
return {
|
|
145
|
-
content: [
|
|
146
|
-
{ type: 'text', text: `CrewAI health check failed: ${error.message}` },
|
|
147
|
-
],
|
|
148
|
-
isError: true,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
export async function handleCrewAIInputs(client, args) {
|
|
153
|
-
try {
|
|
154
|
-
const data = await callGatewayProxy(client, {
|
|
155
|
-
action: 'inputs',
|
|
156
|
-
connection_id: args.connection_id,
|
|
157
|
-
});
|
|
158
|
-
const inputs = data.response?.inputs || [];
|
|
159
|
-
const conn = data.connection || {};
|
|
160
|
-
let text = `# CrewAI Required Inputs\n\n`;
|
|
161
|
-
text += `**Crew:** ${conn.display_name || 'CrewAI'}\n\n`;
|
|
162
|
-
if (inputs.length > 0) {
|
|
163
|
-
text += `The following inputs are required to start a kickoff:\n\n`;
|
|
164
|
-
for (const input of inputs) {
|
|
165
|
-
text += `- \`${input}\`\n`;
|
|
166
|
-
}
|
|
167
|
-
text += `\nUse \`crewai_kickoff\` with these inputs to start the crew.`;
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
text += `No inputs required. You can call \`crewai_kickoff\` with an empty inputs object.`;
|
|
171
|
-
}
|
|
172
|
-
return { content: [{ type: 'text', text }] };
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
return {
|
|
176
|
-
content: [
|
|
177
|
-
{ type: 'text', text: `Failed to get CrewAI inputs: ${error.message}` },
|
|
178
|
-
],
|
|
179
|
-
isError: true,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
export async function handleCrewAIKickoff(client, args) {
|
|
184
|
-
try {
|
|
185
|
-
const data = await callGatewayProxy(client, {
|
|
186
|
-
action: 'kickoff',
|
|
187
|
-
inputs: args.inputs,
|
|
188
|
-
connection_id: args.connection_id,
|
|
189
|
-
});
|
|
190
|
-
const kickoffId = data.response?.kickoff_id;
|
|
191
|
-
const conn = data.connection || {};
|
|
192
|
-
let text = `# CrewAI Kickoff Started\n\n`;
|
|
193
|
-
text += `- **Crew:** ${conn.display_name || 'CrewAI'}\n`;
|
|
194
|
-
text += `- **Kickoff ID:** \`${kickoffId}\`\n`;
|
|
195
|
-
text += `- **Inputs:** ${JSON.stringify(args.inputs)}\n`;
|
|
196
|
-
text += `- **Latency:** ${data.latency_ms}ms\n\n`;
|
|
197
|
-
text += `Use \`crewai_status\` with kickoff_id \`${kickoffId}\` to check progress.`;
|
|
198
|
-
return { content: [{ type: 'text', text }] };
|
|
199
|
-
}
|
|
200
|
-
catch (error) {
|
|
201
|
-
return {
|
|
202
|
-
content: [
|
|
203
|
-
{ type: 'text', text: `CrewAI kickoff failed: ${error.message}` },
|
|
204
|
-
],
|
|
205
|
-
isError: true,
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
export async function handleCrewAIStatus(client, args) {
|
|
210
|
-
try {
|
|
211
|
-
const data = await callGatewayProxy(client, {
|
|
212
|
-
action: 'status',
|
|
213
|
-
kickoff_id: args.kickoff_id,
|
|
214
|
-
connection_id: args.connection_id,
|
|
215
|
-
});
|
|
216
|
-
const resp = data.response || {};
|
|
217
|
-
const conn = data.connection || {};
|
|
218
|
-
let text = `# CrewAI Execution Status\n\n`;
|
|
219
|
-
text += `- **Crew:** ${conn.display_name || 'CrewAI'}\n`;
|
|
220
|
-
text += `- **Kickoff ID:** \`${args.kickoff_id}\`\n`;
|
|
221
|
-
text += `- **State:** ${resp.state || 'unknown'}\n`;
|
|
222
|
-
text += `- **Status:** ${resp.status || 'unknown'}\n`;
|
|
223
|
-
if (resp.last_executed_task) {
|
|
224
|
-
text += `- **Last Task:** ${resp.last_executed_task}\n`;
|
|
225
|
-
}
|
|
226
|
-
if (resp.last_step) {
|
|
227
|
-
text += `- **Last Step:** ${resp.last_step}\n`;
|
|
228
|
-
}
|
|
229
|
-
text += `- **Latency:** ${data.latency_ms}ms\n`;
|
|
230
|
-
if (resp.result) {
|
|
231
|
-
text += `\n## Result\n\n${resp.result}\n`;
|
|
232
|
-
}
|
|
233
|
-
if (resp.result_json) {
|
|
234
|
-
text += `\n## Result (JSON)\n\n\`\`\`json\n${JSON.stringify(resp.result_json, null, 2)}\n\`\`\`\n`;
|
|
235
|
-
}
|
|
236
|
-
return { content: [{ type: 'text', text }] };
|
|
237
|
-
}
|
|
238
|
-
catch (error) {
|
|
239
|
-
return {
|
|
240
|
-
content: [
|
|
241
|
-
{
|
|
242
|
-
type: 'text',
|
|
243
|
-
text: `Failed to get CrewAI status: ${error.message}`,
|
|
244
|
-
},
|
|
245
|
-
],
|
|
246
|
-
isError: true,
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
105
|
//# sourceMappingURL=crewai.js.map
|
package/dist/tools/crewai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crewai.js","sourceRoot":"","sources":["../../src/tools/crewai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"crewai.js","sourceRoot":"","sources":["../../src/tools/crewai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,+CAA+C;AAC/C,mBAAmB;AACnB,+CAA+C;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,aAAa,EAAE;QACb,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;SACrB;QACD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AE,QAAiB;YACvB,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8CAA8C;iBAC5D;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,wFAAwF;iBAC3F;aACF;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;KACF;CACF,CAAC;AAIF,+CAA+C;AAC/C,gBAAgB;AAChB,+CAA+C"}
|
package/dist/tools/exa.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Uses Exa API for embeddings-based search (not keyword-based).
|
|
6
6
|
* Agents can research docs, find code patterns, and gather context.
|
|
7
7
|
*/
|
|
8
|
-
import { DobbyClient } from '../lib/dobby-client.js';
|
|
9
8
|
export declare const exaTools: {
|
|
10
9
|
exa_web_search: {
|
|
11
10
|
name: string;
|
|
@@ -124,38 +123,4 @@ export declare const exaTools: {
|
|
|
124
123
|
};
|
|
125
124
|
};
|
|
126
125
|
};
|
|
127
|
-
export declare function handleExaWebSearch(_client: DobbyClient, args: {
|
|
128
|
-
query: string;
|
|
129
|
-
num_results?: number;
|
|
130
|
-
search_type?: string;
|
|
131
|
-
include_domains?: string[];
|
|
132
|
-
exclude_domains?: string[];
|
|
133
|
-
start_published_date?: string;
|
|
134
|
-
use_autoprompt?: boolean;
|
|
135
|
-
}): Promise<{
|
|
136
|
-
content: {
|
|
137
|
-
type: "text";
|
|
138
|
-
text: string;
|
|
139
|
-
}[];
|
|
140
|
-
}>;
|
|
141
|
-
export declare function handleExaFindSimilar(_client: DobbyClient, args: {
|
|
142
|
-
url: string;
|
|
143
|
-
num_results?: number;
|
|
144
|
-
include_domains?: string[];
|
|
145
|
-
exclude_domains?: string[];
|
|
146
|
-
}): Promise<{
|
|
147
|
-
content: {
|
|
148
|
-
type: "text";
|
|
149
|
-
text: string;
|
|
150
|
-
}[];
|
|
151
|
-
}>;
|
|
152
|
-
export declare function handleExaGetContents(_client: DobbyClient, args: {
|
|
153
|
-
urls: string[];
|
|
154
|
-
max_characters?: number;
|
|
155
|
-
}): Promise<{
|
|
156
|
-
content: {
|
|
157
|
-
type: "text";
|
|
158
|
-
text: string;
|
|
159
|
-
}[];
|
|
160
|
-
}>;
|
|
161
126
|
//# sourceMappingURL=exa.d.ts.map
|
package/dist/tools/exa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exa.d.ts","sourceRoot":"","sources":["../../src/tools/exa.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"exa.d.ts","sourceRoot":"","sources":["../../src/tools/exa.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GpB,CAAC"}
|
package/dist/tools/exa.js
CHANGED
|
@@ -119,110 +119,7 @@ export const exaTools = {
|
|
|
119
119
|
// ============================================
|
|
120
120
|
// Exa API Helper
|
|
121
121
|
// ============================================
|
|
122
|
-
const EXA_API = 'https://api.exa.ai';
|
|
123
|
-
async function exaFetch(endpoint, body) {
|
|
124
|
-
const apiKey = process.env.EXA_API_KEY;
|
|
125
|
-
if (!apiKey) {
|
|
126
|
-
throw new Error('EXA_API_KEY not configured. Set it in .env or environment variables.');
|
|
127
|
-
}
|
|
128
|
-
const response = await fetch(`${EXA_API}${endpoint}`, {
|
|
129
|
-
method: 'POST',
|
|
130
|
-
headers: {
|
|
131
|
-
'x-api-key': apiKey,
|
|
132
|
-
'Content-Type': 'application/json',
|
|
133
|
-
},
|
|
134
|
-
body: JSON.stringify(body),
|
|
135
|
-
});
|
|
136
|
-
if (!response.ok) {
|
|
137
|
-
const text = await response.text();
|
|
138
|
-
throw new Error(`Exa API error (${response.status}): ${text.slice(0, 200)}`);
|
|
139
|
-
}
|
|
140
|
-
return response.json();
|
|
141
|
-
}
|
|
142
122
|
// ============================================
|
|
143
123
|
// Tool Handlers
|
|
144
124
|
// ============================================
|
|
145
|
-
export async function handleExaWebSearch(_client, args) {
|
|
146
|
-
const body = {
|
|
147
|
-
query: args.query,
|
|
148
|
-
numResults: Math.min(args.num_results || 5, 20),
|
|
149
|
-
type: args.search_type || 'neural',
|
|
150
|
-
useAutoprompt: args.use_autoprompt !== false,
|
|
151
|
-
contents: {
|
|
152
|
-
text: { maxCharacters: 500 },
|
|
153
|
-
highlights: { numSentences: 2 },
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
if (args.include_domains?.length)
|
|
157
|
-
body.includeDomains = args.include_domains;
|
|
158
|
-
if (args.exclude_domains?.length)
|
|
159
|
-
body.excludeDomains = args.exclude_domains;
|
|
160
|
-
if (args.start_published_date)
|
|
161
|
-
body.startPublishedDate = args.start_published_date;
|
|
162
|
-
const data = await exaFetch('/search', body);
|
|
163
|
-
const results = (data.results || []).map((r) => ({
|
|
164
|
-
title: r.title,
|
|
165
|
-
url: r.url,
|
|
166
|
-
published_date: r.publishedDate,
|
|
167
|
-
score: r.score,
|
|
168
|
-
text: r.text?.slice(0, 500),
|
|
169
|
-
highlights: r.highlights,
|
|
170
|
-
}));
|
|
171
|
-
return {
|
|
172
|
-
content: [{
|
|
173
|
-
type: 'text',
|
|
174
|
-
text: results.length > 0
|
|
175
|
-
? JSON.stringify({ query: args.query, count: results.length, results }, null, 2)
|
|
176
|
-
: `No results found for: "${args.query}"`,
|
|
177
|
-
}],
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
export async function handleExaFindSimilar(_client, args) {
|
|
181
|
-
const body = {
|
|
182
|
-
url: args.url,
|
|
183
|
-
numResults: Math.min(args.num_results || 5, 20),
|
|
184
|
-
contents: {
|
|
185
|
-
text: { maxCharacters: 300 },
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
if (args.include_domains?.length)
|
|
189
|
-
body.includeDomains = args.include_domains;
|
|
190
|
-
if (args.exclude_domains?.length)
|
|
191
|
-
body.excludeDomains = args.exclude_domains;
|
|
192
|
-
const data = await exaFetch('/findSimilar', body);
|
|
193
|
-
const results = (data.results || []).map((r) => ({
|
|
194
|
-
title: r.title,
|
|
195
|
-
url: r.url,
|
|
196
|
-
published_date: r.publishedDate,
|
|
197
|
-
score: r.score,
|
|
198
|
-
text: r.text?.slice(0, 300),
|
|
199
|
-
}));
|
|
200
|
-
return {
|
|
201
|
-
content: [{
|
|
202
|
-
type: 'text',
|
|
203
|
-
text: results.length > 0
|
|
204
|
-
? JSON.stringify({ source_url: args.url, count: results.length, results }, null, 2)
|
|
205
|
-
: `No similar pages found for: ${args.url}`,
|
|
206
|
-
}],
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
export async function handleExaGetContents(_client, args) {
|
|
210
|
-
const urls = args.urls.slice(0, 10);
|
|
211
|
-
const maxChars = args.max_characters || 3000;
|
|
212
|
-
const data = await exaFetch('/contents', {
|
|
213
|
-
ids: urls,
|
|
214
|
-
text: { maxCharacters: maxChars },
|
|
215
|
-
});
|
|
216
|
-
const results = (data.results || []).map((r) => ({
|
|
217
|
-
url: r.url,
|
|
218
|
-
title: r.title,
|
|
219
|
-
text: r.text?.slice(0, maxChars),
|
|
220
|
-
}));
|
|
221
|
-
return {
|
|
222
|
-
content: [{
|
|
223
|
-
type: 'text',
|
|
224
|
-
text: JSON.stringify({ count: results.length, pages: results }, null, 2),
|
|
225
|
-
}],
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
125
|
//# sourceMappingURL=exa.js.map
|
package/dist/tools/exa.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exa.js","sourceRoot":"","sources":["../../src/tools/exa.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"exa.js","sourceRoot":"","sources":["../../src/tools/exa.ts"],"names":[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