-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-do-integration.js
More file actions
55 lines (45 loc) · 1.53 KB
/
test-do-integration.js
File metadata and controls
55 lines (45 loc) · 1.53 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
/**
* Test DigitalOcean integration
*/
import dotenv from 'dotenv';
import { DigitalOceanClient } from './lib/do-client/index.js';
dotenv.config();
async function testDO() {
console.log('🧪 Testing DigitalOcean integration...\n');
const doClient = new DigitalOceanClient(process.env.DIGITALOCEAN_TOKEN, {
region: process.env.DO_REGION || 'tor1'
});
try {
// Test 1: List agents
console.log('1. Testing agent list...');
const agents = await doClient.agent.list();
console.log(`✅ Found ${agents.length} agents`);
if (agents.length > 0) {
console.log(` First agent: ${agents[0].name || agents[0].uuid}`);
}
console.log('');
// Test 2: List knowledge bases
console.log('2. Testing KB list...');
const kbs = await doClient.kb.list();
console.log(`✅ Found ${kbs.length} knowledge bases`);
if (kbs.length > 0) {
console.log(` First KB: ${kbs[0].name || kbs[0].uuid}`);
}
console.log('');
// Test 3: Get agent details (if agents exist)
if (agents.length > 0) {
console.log('3. Testing get agent...');
const agent = await doClient.agent.get(agents[0].uuid);
console.log(`✅ Retrieved agent: ${agent.name || agent.uuid}`);
console.log(` Model: ${agent.model?.name || agent.model?.uuid || 'N/A'}`);
console.log('');
}
console.log('✅ DigitalOcean integration tests complete!');
} catch (error) {
console.error('❌ Error:', error.message);
if (error.stack) {
console.error(error.stack);
}
}
}
testDO();