0xkobold 0.4.3 → 0.5.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 +226 -383
- package/dist/package.json +13 -4
- package/dist/src/agent/DraconicCapabilityRouter.js +556 -0
- package/dist/src/agent/DraconicCapabilityRouter.js.map +1 -0
- package/dist/src/agent/DraconicErrorClassifier.js +606 -0
- package/dist/src/agent/DraconicErrorClassifier.js.map +1 -0
- package/dist/src/agent/DraconicRunRegistry.js +460 -0
- package/dist/src/agent/DraconicRunRegistry.js.map +1 -0
- package/dist/src/agent/DraconicTokenPredictor.js +500 -0
- package/dist/src/agent/DraconicTokenPredictor.js.map +1 -0
- package/dist/src/agent/embedded-runner.js +3 -2
- package/dist/src/agent/embedded-runner.js.map +1 -1
- package/dist/src/cli/commands/doctor.js +199 -0
- package/dist/src/cli/commands/doctor.js.map +1 -0
- package/dist/src/cli/commands/migrate-from-openclaw.js +39 -0
- package/dist/src/cli/commands/migrate-from-openclaw.js.map +1 -0
- package/dist/src/cli/commands/migrate.js +6 -4
- package/dist/src/cli/commands/migrate.js.map +1 -1
- package/dist/src/cli/program.js +3 -1
- package/dist/src/cli/program.js.map +1 -1
- package/dist/src/config/unified-config.js +195 -0
- package/dist/src/config/unified-config.js.map +1 -0
- package/dist/src/cron/notifications.js +1 -1
- package/dist/src/cron/notifications.js.map +1 -1
- package/dist/src/cron/runner.js +9 -3
- package/dist/src/cron/runner.js.map +1 -1
- package/dist/src/event-bus/index.js +3 -1
- package/dist/src/event-bus/index.js.map +1 -1
- package/dist/src/extensions/community/draconic-messenger-wrapper.js +35 -0
- package/dist/src/extensions/community/draconic-messenger-wrapper.js.map +1 -0
- package/dist/src/extensions/community/draconic-subagents-wrapper.js +115 -0
- package/dist/src/extensions/community/draconic-subagents-wrapper.js.map +1 -0
- package/dist/src/extensions/core/compaction-safeguard-v2.js +95 -0
- package/dist/src/extensions/core/compaction-safeguard-v2.js.map +1 -0
- package/dist/src/extensions/core/compaction-safeguard.js +206 -137
- package/dist/src/extensions/core/compaction-safeguard.js.map +1 -1
- package/dist/src/extensions/core/config-extension.js +122 -0
- package/dist/src/extensions/core/config-extension.js.map +1 -0
- package/dist/src/extensions/core/draconic-hoard-extension.js +194 -0
- package/dist/src/extensions/core/draconic-hoard-extension.js.map +1 -0
- package/dist/src/extensions/core/draconic-lair-extension.js +146 -0
- package/dist/src/extensions/core/draconic-lair-extension.js.map +1 -0
- package/dist/src/extensions/core/draconic-safety-extension.js +402 -0
- package/dist/src/extensions/core/draconic-safety-extension.js.map +1 -0
- package/dist/src/extensions/core/ext-manager.js +40 -0
- package/dist/src/extensions/core/ext-manager.js.map +1 -0
- package/dist/src/extensions/core/gateway-extension.js +413 -624
- package/dist/src/extensions/core/gateway-extension.js.map +1 -1
- package/dist/src/extensions/core/generative-agents-extension.js +704 -0
- package/dist/src/extensions/core/generative-agents-extension.js.map +1 -0
- package/dist/src/extensions/core/memory-bootstrap-extension.js +279 -0
- package/dist/src/extensions/core/memory-bootstrap-extension.js.map +1 -0
- package/dist/src/extensions/core/ollama-extension.js +442 -0
- package/dist/src/extensions/core/ollama-extension.js.map +1 -0
- package/dist/src/extensions/core/ollama-router-extension.js +34 -93
- package/dist/src/extensions/core/ollama-router-extension.js.map +1 -1
- package/dist/src/extensions/core/perennial-memory-extension.js +5 -2
- package/dist/src/extensions/core/perennial-memory-extension.js.map +1 -1
- package/dist/src/extensions/core/persona-loader-extension.js +41 -15
- package/dist/src/extensions/core/persona-loader-extension.js.map +1 -1
- package/dist/src/extensions/core/pi-notify-extension.js +6 -0
- package/dist/src/extensions/core/pi-notify-extension.js.map +1 -1
- package/dist/src/extensions/core/session-bridge-extension.js +8 -72
- package/dist/src/extensions/core/session-bridge-extension.js.map +1 -1
- package/dist/src/extensions/core/tui-integration-extension-fixed.js +3 -0
- package/dist/src/extensions/core/tui-integration-extension-fixed.js.map +1 -0
- package/dist/src/extensions/core/tui-integration-extension.js +984 -0
- package/dist/src/extensions/core/tui-integration-extension.js.map +1 -0
- package/dist/src/gateway/persistence/AgentStore.js +399 -0
- package/dist/src/gateway/persistence/AgentStore.js.map +1 -0
- package/dist/src/gateway/persistence/index.js +9 -0
- package/dist/src/gateway/persistence/index.js.map +1 -0
- package/dist/src/hoard/DraconicHoardSystem.js +465 -0
- package/dist/src/hoard/DraconicHoardSystem.js.map +1 -0
- package/dist/src/index.js +7 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/infra/DraconicConnectionPool.js +492 -0
- package/dist/src/infra/DraconicConnectionPool.js.map +1 -0
- package/dist/src/lair/DraconicLairSystem.js +387 -0
- package/dist/src/lair/DraconicLairSystem.js.map +1 -0
- package/dist/src/llm/ollama.js +143 -99
- package/dist/src/llm/ollama.js.map +1 -1
- package/dist/src/migration/openclaw.js +5 -5
- package/dist/src/migration/openclaw.js.map +1 -1
- package/dist/src/pi-config.js +52 -27
- package/dist/src/pi-config.js.map +1 -1
- package/dist/src/sessions/SessionManager.js +416 -0
- package/dist/src/sessions/SessionManager.js.map +1 -0
- package/dist/src/sessions/SessionStore.js +580 -0
- package/dist/src/sessions/SessionStore.js.map +1 -0
- package/dist/src/sessions/UnifiedSessionBridge.js +394 -0
- package/dist/src/sessions/UnifiedSessionBridge.js.map +1 -0
- package/dist/src/sessions/index.js +15 -0
- package/dist/src/sessions/index.js.map +1 -0
- package/dist/src/sessions/migration/index.js +156 -0
- package/dist/src/sessions/migration/index.js.map +1 -0
- package/dist/src/sessions/types.js +8 -0
- package/dist/src/sessions/types.js.map +1 -0
- package/dist/src/skills/framework.js +1 -1
- package/dist/src/skills/framework.js.map +1 -1
- package/dist/src/tui/commands/final-functions.js +39 -0
- package/dist/src/tui/commands/final-functions.js.map +1 -0
- package/dist/src/tui/commands/natural-language-commands.js +231 -0
- package/dist/src/tui/commands/natural-language-commands.js.map +1 -0
- package/dist/src/tui/commands/orchestration-commands.js +340 -0
- package/dist/src/tui/commands/orchestration-commands.js.map +1 -0
- package/dist/src/tui/commands/orchestration-final-section.js +84 -0
- package/dist/src/tui/commands/orchestration-final-section.js.map +1 -0
- package/dist/src/tui/components/agent-tree-overlay.js +210 -0
- package/dist/src/tui/components/agent-tree-overlay.js.map +1 -0
- package/dist/src/tui/components/agent-tree-panel.js +229 -0
- package/dist/src/tui/components/agent-tree-panel.js.map +1 -0
- package/dist/src/tui/components/sidebar.js +82 -0
- package/dist/src/tui/components/sidebar.js.map +1 -0
- package/dist/src/tui/components/status-bar.js +115 -0
- package/dist/src/tui/components/status-bar.js.map +1 -0
- package/dist/src/tui/components/tree-header.js +85 -0
- package/dist/src/tui/components/tree-header.js.map +1 -0
- package/dist/src/tui/draconic-tui.js +291 -0
- package/dist/src/tui/draconic-tui.js.map +1 -0
- package/dist/src/tui/index.js +93 -0
- package/dist/src/tui/index.js.map +1 -0
- package/dist/src/tui/pi-tui-integration.js +260 -0
- package/dist/src/tui/pi-tui-integration.js.map +1 -0
- package/dist/src/utils/nl-patterns.js +145 -0
- package/dist/src/utils/nl-patterns.js.map +1 -0
- package/package.json +13 -4
- package/scripts/migrate-from-openclaw.sh +498 -0
- package/HEARTBEAT.md +0 -121
- package/USAGE.md +0 -191
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🌊 Draconic Connection Pool
|
|
3
|
+
*
|
|
4
|
+
* Superior to OpenClaw's connection-per-request:
|
|
5
|
+
* - HTTP/2 multiplexing with keep-alive
|
|
6
|
+
* - Connection health monitoring
|
|
7
|
+
* - Automatic reaping of dead connections
|
|
8
|
+
* - Load balancing across instances
|
|
9
|
+
* - Smart routing based on provider capabilities
|
|
10
|
+
*
|
|
11
|
+
* "Faster than a striking wyrm"
|
|
12
|
+
*/
|
|
13
|
+
import { connect } from "node:http2";
|
|
14
|
+
import { EventEmitter } from "node:events";
|
|
15
|
+
// Connection state
|
|
16
|
+
export var ConnectionHealth;
|
|
17
|
+
(function (ConnectionHealth) {
|
|
18
|
+
ConnectionHealth["HEALTHY"] = "healthy";
|
|
19
|
+
ConnectionHealth["DEGRADED"] = "degraded";
|
|
20
|
+
ConnectionHealth["UNHEALTHY"] = "unhealthy";
|
|
21
|
+
ConnectionHealth["DEAD"] = "dead";
|
|
22
|
+
})(ConnectionHealth || (ConnectionHealth = {}));
|
|
23
|
+
/**
|
|
24
|
+
* 🌊 Draconic Connection Pool
|
|
25
|
+
*
|
|
26
|
+
* Superior to OpenClaw: Reuses connections, monitors health,
|
|
27
|
+
* intelligently routes based on performance.
|
|
28
|
+
*/
|
|
29
|
+
export class DraconicConnectionPool extends EventEmitter {
|
|
30
|
+
connections = new Map();
|
|
31
|
+
providerConnections = new Map();
|
|
32
|
+
config;
|
|
33
|
+
metrics;
|
|
34
|
+
healthCheckTimer;
|
|
35
|
+
reapTimer;
|
|
36
|
+
// Default configuration
|
|
37
|
+
static DEFAULT_CONFIG = {
|
|
38
|
+
maxConnections: 10,
|
|
39
|
+
maxStreamsPerConnection: 100, // HTTP/2 multiplexing
|
|
40
|
+
keepAliveMs: 300000, // 5 minutes
|
|
41
|
+
healthCheckIntervalMs: 30000, // 30 seconds
|
|
42
|
+
reapIntervalMs: 60000, // 1 minute
|
|
43
|
+
connectionTimeoutMs: 10000, // 10 seconds
|
|
44
|
+
requestTimeoutMs: 120000, // 2 minutes
|
|
45
|
+
degradedThresholdMs: 5000, // 5 seconds
|
|
46
|
+
};
|
|
47
|
+
static instance = null;
|
|
48
|
+
static getInstance(config) {
|
|
49
|
+
if (!DraconicConnectionPool.instance) {
|
|
50
|
+
DraconicConnectionPool.instance = new DraconicConnectionPool(config);
|
|
51
|
+
}
|
|
52
|
+
return DraconicConnectionPool.instance;
|
|
53
|
+
}
|
|
54
|
+
constructor(config) {
|
|
55
|
+
super();
|
|
56
|
+
this.config = { ...DraconicConnectionPool.DEFAULT_CONFIG, ...config };
|
|
57
|
+
this.metrics = { requests: 0, errors: 0, latencySum: 0, startTime: Date.now() };
|
|
58
|
+
this.startMaintenance();
|
|
59
|
+
}
|
|
60
|
+
// ======== Connection Management ========
|
|
61
|
+
/**
|
|
62
|
+
* Acquire a connection slot
|
|
63
|
+
* Superior to OpenClaw: Reuses healthy connections
|
|
64
|
+
*/
|
|
65
|
+
async acquire(options) {
|
|
66
|
+
const providerKey = `${options.provider}:${options.model}`;
|
|
67
|
+
// 1. Try to find existing healthy connection
|
|
68
|
+
const existing = this.findHealthyConnection(providerKey);
|
|
69
|
+
if (existing) {
|
|
70
|
+
existing.lastUsed = Date.now();
|
|
71
|
+
existing.requestCount++;
|
|
72
|
+
this.emit("connection.reused", { slot: existing });
|
|
73
|
+
return existing;
|
|
74
|
+
}
|
|
75
|
+
// 2. Check connection limit
|
|
76
|
+
const providerConns = this.providerConnections.get(providerKey) ?? new Set();
|
|
77
|
+
if (providerConns.size >= this.config.maxConnections) {
|
|
78
|
+
// Reap oldest and create new
|
|
79
|
+
await this.reapOldest(providerKey);
|
|
80
|
+
}
|
|
81
|
+
// 3. Create new connection
|
|
82
|
+
const slot = await this.createConnection(options);
|
|
83
|
+
this.connections.set(slot.id, slot);
|
|
84
|
+
if (!this.providerConnections.has(providerKey)) {
|
|
85
|
+
this.providerConnections.set(providerKey, new Set());
|
|
86
|
+
}
|
|
87
|
+
this.providerConnections.get(providerKey).add(slot.id);
|
|
88
|
+
this.emit("connection.created", { slot });
|
|
89
|
+
return slot;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Release a connection back to the pool
|
|
93
|
+
*/
|
|
94
|
+
release(slot) {
|
|
95
|
+
slot.lastUsed = Date.now();
|
|
96
|
+
this.emit("connection.released", { slot: slot.id });
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Create new HTTP/2 connection
|
|
100
|
+
*/
|
|
101
|
+
async createConnection(options) {
|
|
102
|
+
const protocol = options.secure !== false ? "https" : "http";
|
|
103
|
+
const port = options.port ?? (options.secure !== false ? 443 : 80);
|
|
104
|
+
const authority = `${protocol}://${options.host}:${port}`;
|
|
105
|
+
return new Promise((resolve, reject) => {
|
|
106
|
+
const timeout = setTimeout(() => {
|
|
107
|
+
reject(new Error(`Connection timeout to ${authority}`));
|
|
108
|
+
}, this.config.connectionTimeoutMs);
|
|
109
|
+
try {
|
|
110
|
+
const session = connect(authority, {
|
|
111
|
+
rejectUnauthorized: false, // For local dev
|
|
112
|
+
});
|
|
113
|
+
session.on("connect", () => {
|
|
114
|
+
clearTimeout(timeout);
|
|
115
|
+
const slot = {
|
|
116
|
+
id: `conn_${Date.now()}_${Math.random().toString(36).slice(2)}`,
|
|
117
|
+
provider: options.provider,
|
|
118
|
+
model: options.model,
|
|
119
|
+
session,
|
|
120
|
+
streams: new Map(),
|
|
121
|
+
lastUsed: Date.now(),
|
|
122
|
+
createdAt: Date.now(),
|
|
123
|
+
health: ConnectionHealth.HEALTHY,
|
|
124
|
+
requestCount: 0,
|
|
125
|
+
errorCount: 0,
|
|
126
|
+
averageLatency: 0,
|
|
127
|
+
currentLatency: 0,
|
|
128
|
+
};
|
|
129
|
+
// Monitor session health
|
|
130
|
+
session.on("error", (err) => {
|
|
131
|
+
console.error(`[ConnectionPool] Session error: ${err.message}`);
|
|
132
|
+
slot.health = ConnectionHealth.UNHEALTHY;
|
|
133
|
+
slot.errorCount++;
|
|
134
|
+
this.emit("connection.error", { slot: slot.id, error: err });
|
|
135
|
+
});
|
|
136
|
+
session.on("goaway", () => {
|
|
137
|
+
console.log(`[ConnectionPool] GOAWAY received: ${slot.id}`);
|
|
138
|
+
slot.health = ConnectionHealth.DEAD;
|
|
139
|
+
});
|
|
140
|
+
session.on("close", () => {
|
|
141
|
+
slot.health = ConnectionHealth.DEAD;
|
|
142
|
+
this.connections.delete(slot.id);
|
|
143
|
+
this.providerConnections.get(`${options.provider}:${options.model}`)?.delete(slot.id);
|
|
144
|
+
});
|
|
145
|
+
resolve(slot);
|
|
146
|
+
});
|
|
147
|
+
session.on("error", (err) => {
|
|
148
|
+
clearTimeout(timeout);
|
|
149
|
+
reject(err);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
clearTimeout(timeout);
|
|
154
|
+
reject(err);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Find healthy connection for provider
|
|
160
|
+
*/
|
|
161
|
+
findHealthyConnection(providerKey) {
|
|
162
|
+
const ids = this.providerConnections.get(providerKey);
|
|
163
|
+
if (!ids)
|
|
164
|
+
return null;
|
|
165
|
+
// Score connections by health and load
|
|
166
|
+
let best = null;
|
|
167
|
+
let bestScore = -Infinity;
|
|
168
|
+
for (const id of ids) {
|
|
169
|
+
const slot = this.connections.get(id);
|
|
170
|
+
if (!slot)
|
|
171
|
+
continue;
|
|
172
|
+
if (slot.health === ConnectionHealth.DEAD)
|
|
173
|
+
continue;
|
|
174
|
+
// Skip if too many streams
|
|
175
|
+
if (slot.streams.size >= this.config.maxStreamsPerConnection)
|
|
176
|
+
continue;
|
|
177
|
+
// Calculate score (higher = better)
|
|
178
|
+
const healthScore = {
|
|
179
|
+
[ConnectionHealth.HEALTHY]: 100,
|
|
180
|
+
[ConnectionHealth.DEGRADED]: 50,
|
|
181
|
+
[ConnectionHealth.UNHEALTHY]: 10,
|
|
182
|
+
[ConnectionHealth.DEAD]: 0,
|
|
183
|
+
}[slot.health];
|
|
184
|
+
const loadScore = 100 - (slot.streams.size / this.config.maxStreamsPerConnection) * 100;
|
|
185
|
+
const recencyScore = Math.max(0, 100 - (Date.now() - slot.lastUsed) / 1000);
|
|
186
|
+
const score = healthScore * 0.4 + loadScore * 0.4 + recencyScore * 0.2;
|
|
187
|
+
if (score > bestScore) {
|
|
188
|
+
best = slot;
|
|
189
|
+
bestScore = score;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return best;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Reap oldest connection for provider
|
|
196
|
+
*/
|
|
197
|
+
async reapOldest(providerKey) {
|
|
198
|
+
const ids = this.providerConnections.get(providerKey);
|
|
199
|
+
if (!ids || ids.size === 0)
|
|
200
|
+
return;
|
|
201
|
+
let oldest = null;
|
|
202
|
+
for (const id of ids) {
|
|
203
|
+
const slot = this.connections.get(id);
|
|
204
|
+
if (!slot)
|
|
205
|
+
continue;
|
|
206
|
+
if (!oldest || slot.lastUsed < oldest.lastUsed) {
|
|
207
|
+
oldest = slot;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (oldest) {
|
|
211
|
+
await this.destroyConnection(oldest.id);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Destroy a connection
|
|
216
|
+
*/
|
|
217
|
+
async destroyConnection(id) {
|
|
218
|
+
const slot = this.connections.get(id);
|
|
219
|
+
if (!slot)
|
|
220
|
+
return;
|
|
221
|
+
// Close all streams
|
|
222
|
+
for (const [streamId, stream] of slot.streams) {
|
|
223
|
+
stream.destroy();
|
|
224
|
+
slot.streams.delete(streamId);
|
|
225
|
+
}
|
|
226
|
+
// Close session
|
|
227
|
+
slot.session.close();
|
|
228
|
+
// Remove from tracking
|
|
229
|
+
this.connections.delete(id);
|
|
230
|
+
const providerKey = `${slot.provider}:${slot.model}`;
|
|
231
|
+
this.providerConnections.get(providerKey)?.delete(id);
|
|
232
|
+
this.emit("connection.destroyed", { slot: id });
|
|
233
|
+
}
|
|
234
|
+
// ======== HTTP/2 Request ========
|
|
235
|
+
/**
|
|
236
|
+
* Make HTTP/2 request through pool
|
|
237
|
+
* Superior to OpenClaw: Multiplexed streams
|
|
238
|
+
*/
|
|
239
|
+
async request(slot, path, options = {}) {
|
|
240
|
+
const startTime = Date.now();
|
|
241
|
+
const streamId = `stream_${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
|
242
|
+
return new Promise((resolve, reject) => {
|
|
243
|
+
const timeout = setTimeout(() => {
|
|
244
|
+
stream.destroy();
|
|
245
|
+
reject(new Error(`Request timeout after ${options.timeout ?? this.config.requestTimeoutMs}ms`));
|
|
246
|
+
}, options.timeout ?? this.config.requestTimeoutMs);
|
|
247
|
+
const headers = {
|
|
248
|
+
":method": options.method ?? "GET",
|
|
249
|
+
":path": path,
|
|
250
|
+
":scheme": "https",
|
|
251
|
+
":authority": slot.session.authority ?? "api.openai.com",
|
|
252
|
+
...options.headers,
|
|
253
|
+
};
|
|
254
|
+
const stream = slot.session.request(headers);
|
|
255
|
+
slot.streams.set(streamId, stream);
|
|
256
|
+
const chunks = [];
|
|
257
|
+
let responseHeaders = {};
|
|
258
|
+
let status = 0;
|
|
259
|
+
stream.on("response", (header) => {
|
|
260
|
+
responseHeaders = header;
|
|
261
|
+
status = Number(header[":status"] ?? 0);
|
|
262
|
+
});
|
|
263
|
+
stream.on("data", (chunk) => {
|
|
264
|
+
chunks.push(Buffer.from(chunk));
|
|
265
|
+
});
|
|
266
|
+
stream.on("end", () => {
|
|
267
|
+
clearTimeout(timeout);
|
|
268
|
+
slot.streams.delete(streamId);
|
|
269
|
+
const latency = Date.now() - startTime;
|
|
270
|
+
this.updateLatency(slot, latency);
|
|
271
|
+
this.metrics.requests++;
|
|
272
|
+
this.metrics.latencySum += latency;
|
|
273
|
+
resolve({
|
|
274
|
+
status,
|
|
275
|
+
headers: responseHeaders,
|
|
276
|
+
body: Buffer.concat(chunks),
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
stream.on("error", (err) => {
|
|
280
|
+
clearTimeout(timeout);
|
|
281
|
+
slot.streams.delete(streamId);
|
|
282
|
+
slot.errorCount++;
|
|
283
|
+
this.metrics.errors++;
|
|
284
|
+
this.emit("request.error", { slot: slot.id, error: err });
|
|
285
|
+
reject(err);
|
|
286
|
+
});
|
|
287
|
+
if (options.body) {
|
|
288
|
+
stream.write(options.body);
|
|
289
|
+
}
|
|
290
|
+
stream.end();
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
// ======== Smart Routing (Superior to OpenClaw) ========
|
|
294
|
+
/**
|
|
295
|
+
* Route to best available instance
|
|
296
|
+
* OpenClaw doesn't have intelligent routing
|
|
297
|
+
*/
|
|
298
|
+
async routeToBestInstance(provider, model) {
|
|
299
|
+
const providerKey = `${provider}:${model}`;
|
|
300
|
+
const candidates = [];
|
|
301
|
+
const ids = this.providerConnections.get(providerKey);
|
|
302
|
+
if (ids) {
|
|
303
|
+
for (const id of ids) {
|
|
304
|
+
const slot = this.connections.get(id);
|
|
305
|
+
if (slot && slot.health !== ConnectionHealth.DEAD) {
|
|
306
|
+
candidates.push(slot);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (candidates.length === 0) {
|
|
311
|
+
// No existing connections, create one
|
|
312
|
+
return this.acquire({ provider, model, host: this.getProviderHost(provider) });
|
|
313
|
+
}
|
|
314
|
+
// Score each candidate
|
|
315
|
+
let best = candidates[0];
|
|
316
|
+
let bestScore = this.calculateInstanceScore(best);
|
|
317
|
+
for (let i = 1; i < candidates.length; i++) {
|
|
318
|
+
const score = this.calculateInstanceScore(candidates[i]);
|
|
319
|
+
if (score > bestScore) {
|
|
320
|
+
best = candidates[i];
|
|
321
|
+
bestScore = score;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return best;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Calculate instance quality score
|
|
328
|
+
* Higher = better
|
|
329
|
+
*/
|
|
330
|
+
calculateInstanceScore(slot) {
|
|
331
|
+
const latencyScore = Math.max(0, 100 - slot.averageLatency / 10);
|
|
332
|
+
const healthScore = {
|
|
333
|
+
[ConnectionHealth.HEALTHY]: 100,
|
|
334
|
+
[ConnectionHealth.DEGRADED]: 50,
|
|
335
|
+
[ConnectionHealth.UNHEALTHY]: 10,
|
|
336
|
+
[ConnectionHealth.DEAD]: 0,
|
|
337
|
+
}[slot.health];
|
|
338
|
+
const errorRate = slot.requestCount > 0 ? slot.errorCount / slot.requestCount : 0;
|
|
339
|
+
const reliabilityScore = (1 - errorRate) * 100;
|
|
340
|
+
const loadScore = 100 - (slot.streams.size / this.config.maxStreamsPerConnection) * 100;
|
|
341
|
+
return latencyScore * 0.3 + healthScore * 0.3 + reliabilityScore * 0.2 + loadScore * 0.2;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Get provider host from name
|
|
345
|
+
*/
|
|
346
|
+
getProviderHost(provider) {
|
|
347
|
+
const hosts = {
|
|
348
|
+
anthropic: "api.anthropic.com",
|
|
349
|
+
openai: "api.openai.com",
|
|
350
|
+
ollama: "localhost",
|
|
351
|
+
};
|
|
352
|
+
return hosts[provider.toLowerCase()] ?? "localhost";
|
|
353
|
+
}
|
|
354
|
+
// ======== Health Management ========
|
|
355
|
+
/**
|
|
356
|
+
* Update connection latency and health
|
|
357
|
+
*/
|
|
358
|
+
updateLatency(slot, latency) {
|
|
359
|
+
slot.currentLatency = latency;
|
|
360
|
+
// Exponential moving average
|
|
361
|
+
const alpha = 0.3;
|
|
362
|
+
if (slot.averageLatency === 0) {
|
|
363
|
+
slot.averageLatency = latency;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
slot.averageLatency = alpha * latency + (1 - alpha) * slot.averageLatency;
|
|
367
|
+
}
|
|
368
|
+
// Update health based on latency
|
|
369
|
+
if (slot.averageLatency > this.config.degradedThresholdMs * 2) {
|
|
370
|
+
slot.health = ConnectionHealth.UNHEALTHY;
|
|
371
|
+
}
|
|
372
|
+
else if (slot.averageLatency > this.config.degradedThresholdMs) {
|
|
373
|
+
slot.health = ConnectionHealth.DEGRADED;
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
slot.health = ConnectionHealth.HEALTHY;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Start maintenance timers
|
|
381
|
+
*/
|
|
382
|
+
startMaintenance() {
|
|
383
|
+
// Health check
|
|
384
|
+
this.healthCheckTimer = setInterval(() => {
|
|
385
|
+
this.checkHealth();
|
|
386
|
+
}, this.config.healthCheckIntervalMs);
|
|
387
|
+
// Reap dead connections
|
|
388
|
+
this.reapTimer = setInterval(() => {
|
|
389
|
+
this.reapDeadConnections();
|
|
390
|
+
}, this.config.reapIntervalMs);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Check health of all connections
|
|
394
|
+
*/
|
|
395
|
+
checkHealth() {
|
|
396
|
+
for (const [id, slot] of this.connections) {
|
|
397
|
+
// Ping with settings frame or check state
|
|
398
|
+
if (slot.session.destroyed || slot.session.closed) {
|
|
399
|
+
slot.health = ConnectionHealth.DEAD;
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
// Check if idle too long
|
|
403
|
+
const idleTime = Date.now() - slot.lastUsed;
|
|
404
|
+
if (idleTime > this.config.keepAliveMs) {
|
|
405
|
+
this.destroyConnection(id).catch(console.error);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
this.emit("health.checked", { connections: this.connections.size });
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Destroy all dead connections
|
|
412
|
+
*/
|
|
413
|
+
async reapDeadConnections() {
|
|
414
|
+
const toReap = [];
|
|
415
|
+
for (const [id, slot] of this.connections) {
|
|
416
|
+
if (slot.health === ConnectionHealth.DEAD) {
|
|
417
|
+
toReap.push(id);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
for (const id of toReap) {
|
|
421
|
+
await this.destroyConnection(id);
|
|
422
|
+
}
|
|
423
|
+
if (toReap.length > 0) {
|
|
424
|
+
console.log(`[ConnectionPool] Reaped ${toReap.length} dead connections`);
|
|
425
|
+
this.emit("connections.reaped", { count: toReap.length });
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
// ======== Statistics ========
|
|
429
|
+
/**
|
|
430
|
+
* Get pool statistics
|
|
431
|
+
*/
|
|
432
|
+
getStats() {
|
|
433
|
+
const byProvider = {};
|
|
434
|
+
const byHealth = {
|
|
435
|
+
[ConnectionHealth.HEALTHY]: 0,
|
|
436
|
+
[ConnectionHealth.DEGRADED]: 0,
|
|
437
|
+
[ConnectionHealth.UNHEALTHY]: 0,
|
|
438
|
+
[ConnectionHealth.DEAD]: 0,
|
|
439
|
+
};
|
|
440
|
+
for (const slot of this.connections.values()) {
|
|
441
|
+
const key = `${slot.provider}:${slot.model}`;
|
|
442
|
+
byProvider[key] = (byProvider[key] || 0) + 1;
|
|
443
|
+
byHealth[slot.health]++;
|
|
444
|
+
}
|
|
445
|
+
const activeStreams = Array.from(this.connections.values()).reduce((sum, slot) => sum + slot.streams.size, 0);
|
|
446
|
+
const elapsed = (Date.now() - this.metrics.startTime) / 1000;
|
|
447
|
+
const rps = elapsed > 0 ? this.metrics.requests / elapsed : 0;
|
|
448
|
+
return {
|
|
449
|
+
totalConnections: this.connections.size,
|
|
450
|
+
byProvider,
|
|
451
|
+
byHealth,
|
|
452
|
+
activeStreams,
|
|
453
|
+
averageLatency: this.metrics.requests > 0 ? this.metrics.latencySum / this.metrics.requests : 0,
|
|
454
|
+
requestsPerSecond: rps,
|
|
455
|
+
errorRate: this.metrics.requests > 0 ? this.metrics.errors / this.metrics.requests : 0,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Get detailed connection info
|
|
460
|
+
*/
|
|
461
|
+
getConnections() {
|
|
462
|
+
return Array.from(this.connections.values()).map((slot) => ({
|
|
463
|
+
id: slot.id,
|
|
464
|
+
provider: slot.provider,
|
|
465
|
+
model: slot.model,
|
|
466
|
+
health: slot.health,
|
|
467
|
+
streams: slot.streams.size,
|
|
468
|
+
latency: slot.averageLatency,
|
|
469
|
+
age: Date.now() - slot.createdAt,
|
|
470
|
+
}));
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Destroy pool and all connections
|
|
474
|
+
*/
|
|
475
|
+
async destroy() {
|
|
476
|
+
// Stop timers
|
|
477
|
+
if (this.healthCheckTimer)
|
|
478
|
+
clearInterval(this.healthCheckTimer);
|
|
479
|
+
if (this.reapTimer)
|
|
480
|
+
clearInterval(this.reapTimer);
|
|
481
|
+
// Destroy all connections
|
|
482
|
+
const promises = [];
|
|
483
|
+
for (const [id] of this.connections) {
|
|
484
|
+
promises.push(this.destroyConnection(id));
|
|
485
|
+
}
|
|
486
|
+
await Promise.all(promises);
|
|
487
|
+
this.emit("pool.destroyed", { stats: this.getStats() });
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
// Export singleton accessor
|
|
491
|
+
export const getDraconicConnectionPool = DraconicConnectionPool.getInstance;
|
|
492
|
+
//# sourceMappingURL=DraconicConnectionPool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraconicConnectionPool.js","sourceRoot":"","sources":["../../../src/infra/DraconicConnectionPool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAyC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,mBAAmB;AACnB,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,2CAAuB,CAAA;IACvB,iCAAa,CAAA;AACf,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AA4DD;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IAC9C,WAAW,GAAG,IAAI,GAAG,EAA0B,CAAC;IAChD,mBAAmB,GAAG,IAAI,GAAG,EAAuB,CAAC;IACrD,MAAM,CAAa;IACnB,OAAO,CAAqB;IAC5B,gBAAgB,CAAgB;IAChC,SAAS,CAAgB;IAEjC,wBAAwB;IAChB,MAAM,CAAU,cAAc,GAAe;QACnD,cAAc,EAAE,EAAE;QAClB,uBAAuB,EAAE,GAAG,EAAK,sBAAsB;QACvD,WAAW,EAAE,MAAM,EAAe,YAAY;QAC9C,qBAAqB,EAAE,KAAK,EAAM,aAAa;QAC/C,cAAc,EAAE,KAAK,EAAa,WAAW;QAC7C,mBAAmB,EAAE,KAAK,EAAM,a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