0xkobold 0.5.2 → 0.6.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 +88 -11
- package/dist/package.json +3 -3
- package/dist/skills/session-resume-skill.js +121 -0
- package/dist/skills/session-resume-skill.js.map +1 -0
- package/dist/src/agent/DraconicRunRegistry.js +0 -9
- package/dist/src/agent/DraconicRunRegistry.js.map +1 -1
- package/dist/src/agent/auth-profiles.js +290 -0
- package/dist/src/agent/auth-profiles.js.map +1 -0
- package/dist/src/agent/embedded-runner.js +115 -29
- package/dist/src/agent/embedded-runner.js.map +1 -1
- package/dist/src/agent/index.js +4 -0
- package/dist/src/agent/index.js.map +1 -1
- package/dist/src/agent/model-fallback.js +173 -0
- package/dist/src/agent/model-fallback.js.map +1 -0
- package/dist/src/agent/tools/spawn-agent.js.map +1 -1
- package/dist/src/cli/commands/gateway.js +4 -8
- package/dist/src/cli/commands/gateway.js.map +1 -1
- package/dist/src/cron/notifications.js +15 -5
- package/dist/src/cron/notifications.js.map +1 -1
- package/dist/src/cron/runner.js +15 -6
- package/dist/src/cron/runner.js.map +1 -1
- package/dist/src/event-bus/index.js.map +1 -1
- package/dist/src/extensions/core/gateway-status-extension.js +54 -0
- package/dist/src/extensions/core/gateway-status-extension.js.map +1 -0
- package/dist/src/gateway/gateway-server.js +383 -0
- package/dist/src/gateway/gateway-server.js.map +1 -0
- package/dist/src/gateway/index.js +15 -8
- package/dist/src/gateway/index.js.map +1 -1
- package/dist/src/gateway/methods/agent.js +348 -0
- package/dist/src/gateway/methods/agent.js.map +1 -0
- package/dist/src/gateway/methods/index.js +30 -0
- package/dist/src/gateway/methods/index.js.map +1 -0
- package/dist/src/gateway/methods/types.js +7 -0
- package/dist/src/gateway/methods/types.js.map +1 -0
- package/dist/src/gateway/persistence/AgentStore.js +6 -0
- package/dist/src/gateway/persistence/AgentStore.js.map +1 -1
- package/dist/src/gateway/protocol/frames.js +43 -0
- package/dist/src/gateway/protocol/frames.js.map +1 -0
- package/dist/src/gateway/protocol/index.js +5 -0
- package/dist/src/gateway/protocol/index.js.map +1 -0
- package/dist/src/gateway/quickstart.js +34 -0
- package/dist/src/gateway/quickstart.js.map +1 -0
- package/dist/src/index.js +33 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/memory/memory-integration.js +204 -0
- package/dist/src/memory/memory-integration.js.map +1 -0
- package/dist/src/memory/session-memory-bridge.js +177 -0
- package/dist/src/memory/session-memory-bridge.js.map +1 -0
- package/dist/src/memory/session-resume.js +265 -0
- package/dist/src/memory/session-resume.js.map +1 -0
- package/dist/src/memory/session-store.js +224 -0
- package/dist/src/memory/session-store.js.map +1 -0
- package/dist/src/skills/framework.js +104 -16
- package/dist/src/skills/framework.js.map +1 -1
- package/dist/src/tui/components/footer.js +106 -0
- package/dist/src/tui/components/footer.js.map +1 -0
- package/dist/src/tui/components/status-bar.js +82 -16
- package/dist/src/tui/components/status-bar.js.map +1 -1
- package/dist/src/tui/gateway-chat-client.js +218 -0
- package/dist/src/tui/gateway-chat-client.js.map +1 -0
- package/dist/src/tui/index.js +1 -0
- package/dist/src/tui/index.js.map +1 -1
- package/package.json +3 -3
- package/skills/session-resume-skill.ts +150 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gateway Server v2.0 - Koclaw-style Architecture
|
|
3
|
+
*
|
|
4
|
+
* JSON-RPC protocol with method handlers
|
|
5
|
+
* Phase: 1/4 of koclaw migration
|
|
6
|
+
*/
|
|
7
|
+
import { EventEmitter } from "node:events";
|
|
8
|
+
import { PROTOCOL_VERSION, ErrorCodes, errorShape } from "./protocol/index";
|
|
9
|
+
import { gatewayHandlers, getHandler } from "./methods/index";
|
|
10
|
+
import { AgentStore } from "./persistence/AgentStore";
|
|
11
|
+
import { loadConfig } from "../config/loader";
|
|
12
|
+
const GATEWAY_VERSION = "2";
|
|
13
|
+
// In-memory dedupe store (Phase 3: move to SQLite)
|
|
14
|
+
class DedupeStore {
|
|
15
|
+
store = new Map();
|
|
16
|
+
get(key) {
|
|
17
|
+
return this.store.get(key);
|
|
18
|
+
}
|
|
19
|
+
set(key, entry) {
|
|
20
|
+
this.store.set(key, entry);
|
|
21
|
+
// Auto-cleanup old entries
|
|
22
|
+
if (this.store.size > 10000) {
|
|
23
|
+
this.cleanup(5 * 60 * 1000); // 5 minutes
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
cleanup(maxAgeMs) {
|
|
27
|
+
const now = Date.now();
|
|
28
|
+
for (const [key, entry] of this.store) {
|
|
29
|
+
if (now - entry.ts > maxAgeMs) {
|
|
30
|
+
this.store.delete(key);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const DEFAULT_CONFIG = {
|
|
36
|
+
port: 7777,
|
|
37
|
+
host: "localhost",
|
|
38
|
+
cors: true,
|
|
39
|
+
heartbeatInterval: 30000,
|
|
40
|
+
requestTimeoutMs: 120000,
|
|
41
|
+
};
|
|
42
|
+
class RealGatewayServer extends EventEmitter {
|
|
43
|
+
config;
|
|
44
|
+
server = null;
|
|
45
|
+
connections = new Map();
|
|
46
|
+
running = false;
|
|
47
|
+
heartbeatTimer = null;
|
|
48
|
+
dedupe = new DedupeStore();
|
|
49
|
+
agentStore;
|
|
50
|
+
context;
|
|
51
|
+
constructor(config = {}) {
|
|
52
|
+
super();
|
|
53
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
54
|
+
// Initialize AgentStore with default path
|
|
55
|
+
const dbPath = process.env.HOME
|
|
56
|
+
? `${process.env.HOME}/.0xkobold/agents.db`
|
|
57
|
+
: "/tmp/agents.db";
|
|
58
|
+
this.agentStore = new AgentStore(dbPath);
|
|
59
|
+
// Build gateway context (like koclaw's context)
|
|
60
|
+
this.context = {
|
|
61
|
+
deps: {
|
|
62
|
+
getConfig: () => loadConfig(),
|
|
63
|
+
agentStore: {
|
|
64
|
+
list: async () => {
|
|
65
|
+
const agents = await this.agentStore.listActive();
|
|
66
|
+
return agents.map(a => ({ id: a.id, name: a.sessionKey }));
|
|
67
|
+
},
|
|
68
|
+
get: (id) => this.agentStore.getAgent(id),
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
dedupe: this.dedupe,
|
|
72
|
+
connections: this.connections,
|
|
73
|
+
sessions: new Map(), // Phase 3: persisted sessions
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async start() {
|
|
77
|
+
if (this.running)
|
|
78
|
+
return;
|
|
79
|
+
const self = this;
|
|
80
|
+
this.server = Bun.serve({
|
|
81
|
+
port: this.config.port,
|
|
82
|
+
hostname: this.config.host,
|
|
83
|
+
async fetch(req, server) {
|
|
84
|
+
const url = new URL(req.url);
|
|
85
|
+
if (self.config.cors && req.method === "OPTIONS") {
|
|
86
|
+
return new Response(null, { status: 204, headers: self.getCORSHeaders() });
|
|
87
|
+
}
|
|
88
|
+
// Health check
|
|
89
|
+
if (url.pathname === "/health") {
|
|
90
|
+
return new Response(JSON.stringify({ ok: true, version: GATEWAY_VERSION }), {
|
|
91
|
+
headers: { "Content-Type": "application/json", ...self.getCORSHeaders() },
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
// Protocol info
|
|
95
|
+
if (url.pathname === "/protocol") {
|
|
96
|
+
return new Response(JSON.stringify({ version: PROTOCOL_VERSION, methods: Object.keys(gatewayHandlers) }), {
|
|
97
|
+
headers: { "Content-Type": "application/json", ...self.getCORSHeaders() },
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (url.pathname === "/ws") {
|
|
101
|
+
const upgraded = server.upgrade(req, {
|
|
102
|
+
data: { type: url.searchParams.get("type") || "web" },
|
|
103
|
+
});
|
|
104
|
+
if (upgraded)
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
return new Response(JSON.stringify({ error: "Not found" }), {
|
|
108
|
+
status: 404,
|
|
109
|
+
headers: { "Content-Type": "application/json", ...self.getCORSHeaders() },
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
websocket: {
|
|
113
|
+
open(ws) {
|
|
114
|
+
const id = `ws-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
115
|
+
const conn = {
|
|
116
|
+
id,
|
|
117
|
+
socket: ws,
|
|
118
|
+
type: ws.data?.type || "web",
|
|
119
|
+
connectedAt: new Date(),
|
|
120
|
+
lastPing: new Date(),
|
|
121
|
+
};
|
|
122
|
+
self.connections.set(id, conn);
|
|
123
|
+
self.emit("connected", conn);
|
|
124
|
+
console.log(`[Gateway] WebSocket connected: ${id} (${conn.type})`);
|
|
125
|
+
},
|
|
126
|
+
message(ws, message) {
|
|
127
|
+
const conn = self.findConnectionByWs(ws);
|
|
128
|
+
if (!conn)
|
|
129
|
+
return;
|
|
130
|
+
self.handleMessage(conn, message.toString());
|
|
131
|
+
},
|
|
132
|
+
close(ws, code, reason) {
|
|
133
|
+
const conn = self.findConnectionByWs(ws);
|
|
134
|
+
if (conn) {
|
|
135
|
+
self.connections.delete(conn.id);
|
|
136
|
+
self.emit("disconnected", { id: conn.id, code, reason });
|
|
137
|
+
console.log(`[Gateway] WebSocket disconnected: ${conn.id}`);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
this.running = true;
|
|
143
|
+
this.startHeartbeat();
|
|
144
|
+
this.emit("started", { port: this.config.port, host: this.config.host });
|
|
145
|
+
console.log(`🐉 Gateway running on ws://${this.config.host}:${this.config.port}/ws`);
|
|
146
|
+
}
|
|
147
|
+
handleMessage(conn, data) {
|
|
148
|
+
conn.lastPing = new Date();
|
|
149
|
+
try {
|
|
150
|
+
const frame = JSON.parse(data);
|
|
151
|
+
// Handle ping (special event, not a method)
|
|
152
|
+
if ("event" in frame && frame.event === "ping") {
|
|
153
|
+
this.sendToConnection(conn.id, {
|
|
154
|
+
id: "pong",
|
|
155
|
+
result: { time: Date.now() },
|
|
156
|
+
});
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
// Handle hello/connect
|
|
160
|
+
if ("method" in frame && frame.method === "connect") {
|
|
161
|
+
this.handleConnect(conn, frame);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
// Validate request frame
|
|
165
|
+
if (!this.isValidRequestFrame(frame)) {
|
|
166
|
+
this.sendError(conn.id, undefined, ErrorCodes.INVALID_REQUEST, "Invalid request frame");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
// Route to handler
|
|
170
|
+
this.handleMethod(conn, frame);
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
console.error("[Gateway] Message parse error:", err);
|
|
174
|
+
this.sendError(conn.id, undefined, ErrorCodes.PARSE_ERROR, "JSON parse error");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
isValidRequestFrame(obj) {
|
|
178
|
+
if (!obj || typeof obj !== "object")
|
|
179
|
+
return false;
|
|
180
|
+
const frame = obj;
|
|
181
|
+
return typeof frame.id === "string" && typeof frame.method === "string" && frame.method.length > 0;
|
|
182
|
+
}
|
|
183
|
+
handleConnect(conn, frame) {
|
|
184
|
+
const params = (frame.params || {});
|
|
185
|
+
conn.clientInfo = {
|
|
186
|
+
id: conn.id,
|
|
187
|
+
type: conn.type,
|
|
188
|
+
scopes: ["agent:run", "agent:read"],
|
|
189
|
+
connect: {
|
|
190
|
+
clientName: params.clientName || "unknown",
|
|
191
|
+
clientVersion: params.clientVersion || "0.0.0",
|
|
192
|
+
scopes: ["agent:run", "agent:read"],
|
|
193
|
+
caps: params.capabilities || [],
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
this.sendToConnection(conn.id, {
|
|
197
|
+
id: frame.id,
|
|
198
|
+
result: {
|
|
199
|
+
ok: true,
|
|
200
|
+
version: GATEWAY_VERSION,
|
|
201
|
+
protocol: PROTOCOL_VERSION,
|
|
202
|
+
sessionId: conn.id,
|
|
203
|
+
capabilities: Object.keys(gatewayHandlers),
|
|
204
|
+
serverTime: Date.now(),
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
async handleMethod(conn, frame) {
|
|
209
|
+
const handler = getHandler(frame.method);
|
|
210
|
+
if (!handler) {
|
|
211
|
+
this.sendError(conn.id, frame.id, ErrorCodes.METHOD_NOT_FOUND, `Method not found: ${frame.method}`);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
// Create respond function
|
|
215
|
+
const respond = (ok, result, error, opts) => {
|
|
216
|
+
this.sendToConnection(conn.id, {
|
|
217
|
+
id: frame.id,
|
|
218
|
+
result: ok ? result : undefined,
|
|
219
|
+
error: error,
|
|
220
|
+
expectFinal: opts?.expectFinal ?? true,
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
// Execute handler with timeout
|
|
224
|
+
const timeoutMs = this.config.requestTimeoutMs;
|
|
225
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
226
|
+
setTimeout(() => reject(new Error("Request timeout")), timeoutMs);
|
|
227
|
+
});
|
|
228
|
+
try {
|
|
229
|
+
await Promise.race([
|
|
230
|
+
handler({
|
|
231
|
+
params: frame.params,
|
|
232
|
+
respond,
|
|
233
|
+
context: this.context,
|
|
234
|
+
client: conn.clientInfo,
|
|
235
|
+
}),
|
|
236
|
+
timeoutPromise,
|
|
237
|
+
]);
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
console.error(`[Gateway] Handler error for ${frame.method}:`, err);
|
|
241
|
+
this.sendError(conn.id, frame.id, ErrorCodes.INTERNAL_ERROR, String(err));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
sendToConnection(id, frame) {
|
|
245
|
+
const conn = this.connections.get(id);
|
|
246
|
+
if (!conn?.socket)
|
|
247
|
+
return;
|
|
248
|
+
try {
|
|
249
|
+
conn.socket.send(JSON.stringify(frame));
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
console.error("[Gateway] Send error:", err);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
sendError(connId, reqId, code, message) {
|
|
256
|
+
this.sendToConnection(connId, {
|
|
257
|
+
id: reqId || "error",
|
|
258
|
+
error: errorShape(code, message),
|
|
259
|
+
expectFinal: true,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
findConnectionByWs(ws) {
|
|
263
|
+
for (const conn of this.connections.values()) {
|
|
264
|
+
if (conn.socket === ws)
|
|
265
|
+
return conn;
|
|
266
|
+
}
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
startHeartbeat() {
|
|
270
|
+
this.heartbeatTimer = setInterval(() => {
|
|
271
|
+
const now = Date.now();
|
|
272
|
+
for (const [id, conn] of this.connections) {
|
|
273
|
+
if (now - conn.lastPing.getTime() > this.config.heartbeatInterval * 3) {
|
|
274
|
+
console.log(`[Gateway] Connection timeout: ${id}`);
|
|
275
|
+
conn.socket?.close();
|
|
276
|
+
this.connections.delete(id);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}, this.config.heartbeatInterval);
|
|
280
|
+
}
|
|
281
|
+
getCORSHeaders() {
|
|
282
|
+
return {
|
|
283
|
+
"Access-Control-Allow-Origin": "*",
|
|
284
|
+
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
|
|
285
|
+
"Access-Control-Allow-Headers": "Content-Type",
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
// Public API for channel integrations (backward compatibility)
|
|
289
|
+
registerConnection(idOrConfig, type, socket) {
|
|
290
|
+
// Handle object config (legacy API)
|
|
291
|
+
if (typeof idOrConfig === "object") {
|
|
292
|
+
const config = idOrConfig;
|
|
293
|
+
const id = `legacy-${config.type}-${Date.now()}`;
|
|
294
|
+
const conn = {
|
|
295
|
+
id,
|
|
296
|
+
type: config.type,
|
|
297
|
+
connectedAt: new Date(),
|
|
298
|
+
lastPing: new Date(),
|
|
299
|
+
};
|
|
300
|
+
this.connections.set(id, conn);
|
|
301
|
+
this.emit("connection.registered", { id, type: config.type });
|
|
302
|
+
return id;
|
|
303
|
+
}
|
|
304
|
+
// Handle new API (id, type, socket)
|
|
305
|
+
const id = idOrConfig;
|
|
306
|
+
const conn = {
|
|
307
|
+
id,
|
|
308
|
+
socket,
|
|
309
|
+
type: (type || "web"),
|
|
310
|
+
connectedAt: new Date(),
|
|
311
|
+
lastPing: new Date(),
|
|
312
|
+
};
|
|
313
|
+
this.connections.set(id, conn);
|
|
314
|
+
this.emit("connection.registered", { id, type });
|
|
315
|
+
return id;
|
|
316
|
+
}
|
|
317
|
+
removeConnection(id) {
|
|
318
|
+
const conn = this.connections.get(id);
|
|
319
|
+
if (conn?.socket) {
|
|
320
|
+
conn.socket.close();
|
|
321
|
+
}
|
|
322
|
+
this.connections.delete(id);
|
|
323
|
+
this.emit("connection.removed", { id });
|
|
324
|
+
}
|
|
325
|
+
getConnections() {
|
|
326
|
+
return this.connections;
|
|
327
|
+
}
|
|
328
|
+
broadcastToChannel(channelId, message) {
|
|
329
|
+
for (const [id, conn] of this.connections) {
|
|
330
|
+
if (conn.type === "discord" || conn.type === "telegram") {
|
|
331
|
+
this.sendToConnection(id, {
|
|
332
|
+
id: `broadcast-${Date.now()}`,
|
|
333
|
+
result: message,
|
|
334
|
+
expectFinal: true,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
broadcast(message) {
|
|
340
|
+
for (const [id] of this.connections) {
|
|
341
|
+
this.sendToConnection(id, {
|
|
342
|
+
id: `broadcast-${Date.now()}`,
|
|
343
|
+
result: message,
|
|
344
|
+
expectFinal: true,
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
stop() {
|
|
349
|
+
this.running = false;
|
|
350
|
+
if (this.heartbeatTimer)
|
|
351
|
+
clearInterval(this.heartbeatTimer);
|
|
352
|
+
this.server?.stop();
|
|
353
|
+
this.emit("stopped");
|
|
354
|
+
console.log("[Gateway] Server stopped");
|
|
355
|
+
}
|
|
356
|
+
isRunning() {
|
|
357
|
+
return this.running;
|
|
358
|
+
}
|
|
359
|
+
getConnectionCount() {
|
|
360
|
+
return this.connections.size;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// Singleton instance
|
|
364
|
+
let gatewayInstance = null;
|
|
365
|
+
export function createGateway(config) {
|
|
366
|
+
return new RealGatewayServer(config);
|
|
367
|
+
}
|
|
368
|
+
export function startGateway(config) {
|
|
369
|
+
if (!gatewayInstance) {
|
|
370
|
+
gatewayInstance = new RealGatewayServer(config);
|
|
371
|
+
}
|
|
372
|
+
gatewayInstance.start();
|
|
373
|
+
return gatewayInstance;
|
|
374
|
+
}
|
|
375
|
+
export function stopGateway() {
|
|
376
|
+
gatewayInstance?.stop();
|
|
377
|
+
gatewayInstance = null;
|
|
378
|
+
}
|
|
379
|
+
export function getGateway() {
|
|
380
|
+
return gatewayInstance;
|
|
381
|
+
}
|
|
382
|
+
export { RealGatewayServer };
|
|
383
|
+
//# sourceMappingURL=gateway-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-server.js","sourceRoot":"","sources":["../../../src/gateway/gateway-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,eAAe,GAAG,GAAG,CAAC;AAoB5B,mDAAmD;AACnD,MAAM,WAAW;IACP,KAAK,GAAG,IAAI,GAAG,EAAiG,CAAC;IAEzH,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,C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AC,SAAS,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAC1C,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CACF;AAED,qBAAqB;AACrB,IAAI,eAAe,GAA6B,IAAI,CAAC;AAErD,MAAM,UAAU,aAAa,CAAC,MAA+B;IAC3D,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAA+B;IAC1D,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,eAAe,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,eAAe,CAAC,KAAK,EAAE,CAAC;IACxB,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,eAAe,EAAE,IAAI,EAAE,CAAC;IACxB,eAAe,GAAG,IAAI,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Gateway Module
|
|
2
|
+
* Gateway Module
|
|
3
3
|
*
|
|
4
4
|
* WebSocket + HTTP gateway for multi-channel support.
|
|
5
|
-
*
|
|
5
|
+
* Koclaw-style architecture with JSON-RPC protocol.
|
|
6
6
|
*/
|
|
7
|
-
//
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
// Protocol
|
|
8
|
+
export { PROTOCOL_VERSION, ErrorCodes, errorShape, isValidRequestFrame, isValidEventFrame, } from "./protocol/index";
|
|
9
|
+
export { agentHandler, agentStatusHandler, agentWaitHandler, gatewayHandlers, getHandler, listMethods, } from "./methods/index";
|
|
10
|
+
// Gateway Server
|
|
11
|
+
export { createGateway, startGateway, stopGateway, getGateway, RealGatewayServer, } from "./gateway-server";
|
|
12
|
+
// Legacy exports (deprecated, will be removed)
|
|
13
|
+
export { getGatewayServer, resetGatewayServer, registerDiscordChannel, registerTelegramChannel, } from "./websocket-server.js";
|
|
14
|
+
// Backward compatibility - new gateway uses these names
|
|
15
|
+
export { getGateway as getRealGateway, stopGateway as resetRealGateway, } from "./gateway-server";
|
|
16
|
+
// Session Store (Phase 2 + Phase 5)
|
|
17
|
+
export { createSessionStore, getSessionStore, resetSessionStore, generateSessionId, } from "../memory/session-store";
|
|
18
|
+
// Session Memory Bridge (Phase 5)
|
|
19
|
+
export { getSessionMemoryBridge, } from "../memory/session-memory-bridge";
|
|
13
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,WAAW;AACX,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAuB1B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAEzB,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,WAAW,EACX,UAAU,EACV,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAI1B,+CAA+C;AAC/C,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,wDAAwD;AACxD,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,WAAW,IAAI,gBAAgB,GAChC,MAAM,kBAAkB,CAAC;AAE1B,oCAAoC;AACpC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAIjC,kCAAkC;AAClC,OAAO,EACL,sBAAsB,GACvB,MAAM,iCAAiC,CAAC"}
|