@principal-ai/control-tower-core 0.1.4 → 0.1.6
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/dist/abstractions/AuthAdapter.d.ts +8 -5
- package/dist/abstractions/AuthAdapter.d.ts.map +1 -1
- package/dist/abstractions/AuthAdapter.js +2 -1
- package/dist/abstractions/DefaultLockManager.d.ts +2 -2
- package/dist/abstractions/DefaultLockManager.d.ts.map +1 -1
- package/dist/abstractions/DefaultLockManager.js +6 -2
- package/dist/abstractions/DefaultRoomManager.d.ts +2 -2
- package/dist/abstractions/DefaultRoomManager.d.ts.map +1 -1
- package/dist/abstractions/DefaultRoomManager.js +6 -2
- package/dist/abstractions/EventEmitter.js +5 -1
- package/dist/abstractions/LockManager.d.ts +1 -1
- package/dist/abstractions/LockManager.d.ts.map +1 -1
- package/dist/abstractions/LockManager.js +5 -1
- package/dist/abstractions/RoomManager.d.ts +1 -1
- package/dist/abstractions/RoomManager.d.ts.map +1 -1
- package/dist/abstractions/RoomManager.js +5 -1
- package/dist/abstractions/StorageAdapter.js +2 -1
- package/dist/abstractions/TransportAdapter.d.ts +6 -1
- package/dist/abstractions/TransportAdapter.d.ts.map +1 -1
- package/dist/abstractions/TransportAdapter.js +2 -1
- package/dist/abstractions/index.d.ts +8 -8
- package/dist/abstractions/index.d.ts.map +1 -1
- package/dist/abstractions/index.js +13 -5
- package/dist/adapters/mock/MockAuthAdapter.d.ts +5 -2
- package/dist/adapters/mock/MockAuthAdapter.d.ts.map +1 -1
- package/dist/adapters/mock/MockAuthAdapter.js +62 -14
- package/dist/adapters/mock/MockStorageAdapter.d.ts +1 -1
- package/dist/adapters/mock/MockStorageAdapter.d.ts.map +1 -1
- package/dist/adapters/mock/MockStorageAdapter.js +5 -1
- package/dist/adapters/mock/MockTransportAdapter.d.ts +2 -2
- package/dist/adapters/mock/MockTransportAdapter.d.ts.map +1 -1
- package/dist/adapters/mock/MockTransportAdapter.js +5 -1
- package/dist/adapters/mock/index.d.ts +3 -3
- package/dist/adapters/mock/index.d.ts.map +1 -1
- package/dist/adapters/mock/index.js +9 -3
- package/dist/adapters/websocket/WebSocketTransportAdapter.d.ts +60 -0
- package/dist/adapters/websocket/WebSocketTransportAdapter.d.ts.map +1 -0
- package/dist/adapters/websocket/WebSocketTransportAdapter.js +384 -0
- package/dist/adapters/websocket/index.d.ts +2 -0
- package/dist/adapters/websocket/index.d.ts.map +1 -0
- package/dist/adapters/websocket/index.js +5 -0
- package/dist/client/BaseClient.d.ts +5 -5
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.js +10 -4
- package/dist/client/ClientBuilder.d.ts +4 -4
- package/dist/client/ClientBuilder.d.ts.map +1 -1
- package/dist/client/ClientBuilder.js +7 -3
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +7 -2
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -5
- package/dist/index.js.map +29 -14
- package/dist/index.mjs +3386 -17
- package/dist/index.mjs.map +29 -14
- package/dist/server/BaseServer.d.ts +21 -8
- package/dist/server/BaseServer.d.ts.map +1 -1
- package/dist/server/BaseServer.js +109 -2
- package/dist/server/ServerBuilder.d.ts +16 -7
- package/dist/server/ServerBuilder.d.ts.map +1 -1
- package/dist/server/ServerBuilder.js +23 -4
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +7 -2
- package/dist/types/auth.d.ts +14 -7
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/auth.js +2 -1
- package/dist/types/events.d.ts +1 -1
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -1
- package/dist/types/lock.js +2 -1
- package/dist/types/room.d.ts +2 -2
- package/dist/types/room.d.ts.map +1 -1
- package/dist/types/room.js +2 -1
- package/package.json +5 -2
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { Event, Room, RoomConfig, Lock } from '../types';
|
|
2
|
-
import type { ITransportAdapter } from '../abstractions/TransportAdapter';
|
|
3
|
-
import type { IAuthAdapter } from '../abstractions/AuthAdapter';
|
|
4
|
-
import type { IStorageAdapter } from '../abstractions/StorageAdapter';
|
|
5
|
-
import type { RoomManager } from '../abstractions/RoomManager';
|
|
6
|
-
import type { LockManager } from '../abstractions/LockManager';
|
|
7
|
-
import { TypedEventEmitter } from '../abstractions/EventEmitter';
|
|
1
|
+
import type { Event, Room, RoomConfig, Lock } from '../types/index.js';
|
|
2
|
+
import type { ITransportAdapter } from '../abstractions/TransportAdapter.js';
|
|
3
|
+
import type { IAuthAdapter } from '../abstractions/AuthAdapter.js';
|
|
4
|
+
import type { IStorageAdapter } from '../abstractions/StorageAdapter.js';
|
|
5
|
+
import type { RoomManager } from '../abstractions/RoomManager.js';
|
|
6
|
+
import type { LockManager } from '../abstractions/LockManager.js';
|
|
7
|
+
import { TypedEventEmitter } from '../abstractions/EventEmitter.js';
|
|
8
|
+
import type { Server as HttpServer } from 'http';
|
|
9
|
+
import type { Server as HttpsServer } from 'https';
|
|
10
|
+
import type { WebSocketServer } from 'ws';
|
|
8
11
|
export interface ServerConfig {
|
|
9
12
|
transport: ITransportAdapter;
|
|
10
13
|
auth?: IAuthAdapter;
|
|
@@ -12,6 +15,9 @@ export interface ServerConfig {
|
|
|
12
15
|
roomManager: RoomManager;
|
|
13
16
|
lockManager: LockManager;
|
|
14
17
|
defaultRoomConfig?: Partial<RoomConfig>;
|
|
18
|
+
httpServer?: HttpServer | HttpsServer;
|
|
19
|
+
webSocketPath?: string;
|
|
20
|
+
webSocketServer?: WebSocketServer;
|
|
15
21
|
}
|
|
16
22
|
export interface ConnectedClient {
|
|
17
23
|
id: string;
|
|
@@ -79,10 +85,15 @@ export declare class BaseServer extends TypedEventEmitter<ServerEvents> {
|
|
|
79
85
|
private clients;
|
|
80
86
|
private clientMessageHandlers;
|
|
81
87
|
private running;
|
|
88
|
+
private initialized;
|
|
89
|
+
private mode;
|
|
82
90
|
constructor(config: ServerConfig);
|
|
83
|
-
start(port
|
|
91
|
+
start(port?: number): Promise<void>;
|
|
92
|
+
initialize(): Promise<void>;
|
|
84
93
|
stop(): Promise<void>;
|
|
85
94
|
private handleTransportMessage;
|
|
95
|
+
private handleConnectionMessage;
|
|
96
|
+
private handleClientAuthenticatedMessage;
|
|
86
97
|
private handleTransportError;
|
|
87
98
|
private handleTransportClose;
|
|
88
99
|
private addClient;
|
|
@@ -101,5 +112,7 @@ export declare class BaseServer extends TypedEventEmitter<ServerEvents> {
|
|
|
101
112
|
getConnectedClients(): ConnectedClient[];
|
|
102
113
|
getClient(clientId: string): ConnectedClient | null;
|
|
103
114
|
isRunning(): boolean;
|
|
115
|
+
getMode(): 'standalone' | 'integration';
|
|
116
|
+
isInitialized(): boolean;
|
|
104
117
|
}
|
|
105
118
|
//# sourceMappingURL=BaseServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseServer.d.ts","sourceRoot":"","sources":["../../src/server/BaseServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EACL,IAAI,EAEJ,UAAU,EACV,IAAI,EAEL,MAAM,
|
|
1
|
+
{"version":3,"file":"BaseServer.d.ts","sourceRoot":"","sources":["../../src/server/BaseServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EACL,IAAI,EAEJ,UAAU,EACV,IAAI,EAEL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,C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AC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBnC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA0C3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAyBb,sBAAsB;YA0CtB,uBAAuB;YA8BvB,gCAAgC;YAmBhC,oBAAoB;YAIpB,oBAAoB;YAOpB,SAAS;YAiBT,gBAAgB;IAsB9B,OAAO,CAAC,0BAA0B;YA+CpB,kBAAkB;YAqBlB,cAAc;YAwEd,eAAe;YAef,oBAAoB;YA+BpB,iBAAiB;YA4BjB,iBAAiB;YA8BjB,YAAY;IAW1B,OAAO,CAAC,UAAU;IAKZ,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7D,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/C,mBAAmB,IAAI,eAAe,EAAE;IAIxC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI;IAInD,SAAS,IAAI,OAAO;IAIpB,OAAO,IAAI,YAAY,GAAG,aAAa;IAIvC,aAAa,IAAI,OAAO;CAGzB"}
|
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseServer = void 0;
|
|
4
|
+
const EventEmitter_js_1 = require("../abstractions/EventEmitter.js");
|
|
5
|
+
class BaseServer extends EventEmitter_js_1.TypedEventEmitter {
|
|
3
6
|
constructor(config) {
|
|
4
7
|
super();
|
|
5
8
|
this.clients = new Map();
|
|
6
9
|
this.clientMessageHandlers = new Map();
|
|
7
10
|
this.running = false;
|
|
11
|
+
this.initialized = false;
|
|
8
12
|
this.config = config;
|
|
9
13
|
this.transport = config.transport;
|
|
10
14
|
this.auth = config.auth;
|
|
11
15
|
this.storage = config.storage;
|
|
12
16
|
this.roomManager = config.roomManager;
|
|
13
17
|
this.lockManager = config.lockManager;
|
|
18
|
+
// Determine mode based on configuration
|
|
19
|
+
this.mode = (config.httpServer || config.webSocketServer) ? 'integration' : 'standalone';
|
|
20
|
+
// Connect auth adapter to transport if both exist and transport supports it
|
|
21
|
+
if (this.auth && this.transport) {
|
|
22
|
+
const transportWithAuth = this.transport;
|
|
23
|
+
if (typeof transportWithAuth.setAuthAdapter === 'function') {
|
|
24
|
+
transportWithAuth.setAuthAdapter(this.auth);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
14
27
|
// Set up transport event handlers
|
|
15
28
|
this.transport.onMessage(this.handleTransportMessage.bind(this));
|
|
16
29
|
this.transport.onError(this.handleTransportError.bind(this));
|
|
@@ -18,12 +31,19 @@ export class BaseServer extends TypedEventEmitter {
|
|
|
18
31
|
}
|
|
19
32
|
// Server Lifecycle
|
|
20
33
|
async start(port) {
|
|
34
|
+
if (this.mode === 'integration') {
|
|
35
|
+
throw new Error('Cannot use start() in integration mode. Use initialize() instead.');
|
|
36
|
+
}
|
|
37
|
+
if (!port) {
|
|
38
|
+
throw new Error('Port is required for standalone mode');
|
|
39
|
+
}
|
|
21
40
|
if (this.running) {
|
|
22
41
|
throw new Error('Server is already running');
|
|
23
42
|
}
|
|
24
43
|
try {
|
|
25
44
|
await this.transport.connect(`ws://localhost:${port}`, { url: `ws://localhost:${port}` });
|
|
26
45
|
this.running = true;
|
|
46
|
+
this.initialized = true;
|
|
27
47
|
await this.emit('started', { port });
|
|
28
48
|
}
|
|
29
49
|
catch (error) {
|
|
@@ -31,6 +51,45 @@ export class BaseServer extends TypedEventEmitter {
|
|
|
31
51
|
throw error;
|
|
32
52
|
}
|
|
33
53
|
}
|
|
54
|
+
async initialize() {
|
|
55
|
+
if (this.mode === 'standalone') {
|
|
56
|
+
throw new Error('Cannot use initialize() in standalone mode. Use start() instead.');
|
|
57
|
+
}
|
|
58
|
+
if (this.initialized) {
|
|
59
|
+
throw new Error('Server is already initialized');
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const transport = this.transport;
|
|
63
|
+
if (this.config.webSocketServer) {
|
|
64
|
+
// Attach to existing WebSocket server
|
|
65
|
+
if (typeof transport.attachToWebSocketServer === 'function') {
|
|
66
|
+
await transport.attachToWebSocketServer(this.config.webSocketServer);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
throw new Error('Transport adapter does not support attachToWebSocketServer');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (this.config.httpServer) {
|
|
73
|
+
// Attach to existing HTTP server
|
|
74
|
+
if (typeof transport.attach === 'function') {
|
|
75
|
+
await transport.attach(this.config.httpServer, this.config.webSocketPath || '/ws');
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
throw new Error('Transport adapter does not support attach');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
throw new Error('Either httpServer or webSocketServer must be provided in integration mode');
|
|
83
|
+
}
|
|
84
|
+
this.running = true;
|
|
85
|
+
this.initialized = true;
|
|
86
|
+
await this.emit('started', { port: 0 }); // Port 0 indicates integration mode
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
await this.emit('error', { error: error, context: 'server_initialize' });
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
34
93
|
async stop() {
|
|
35
94
|
if (!this.running) {
|
|
36
95
|
return;
|
|
@@ -52,6 +111,15 @@ export class BaseServer extends TypedEventEmitter {
|
|
|
52
111
|
}
|
|
53
112
|
// Client Management
|
|
54
113
|
async handleTransportMessage(message) {
|
|
114
|
+
// Handle special transport messages
|
|
115
|
+
if (message.type === 'connection') {
|
|
116
|
+
await this.handleConnectionMessage(message);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (message.type === 'client_authenticated') {
|
|
120
|
+
await this.handleClientAuthenticatedMessage(message);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
55
123
|
// Transport messages contain clientId in the payload for routing
|
|
56
124
|
const payload = message.payload;
|
|
57
125
|
const { clientId, ...clientMessage } = payload;
|
|
@@ -79,6 +147,38 @@ export class BaseServer extends TypedEventEmitter {
|
|
|
79
147
|
});
|
|
80
148
|
}
|
|
81
149
|
}
|
|
150
|
+
async handleConnectionMessage(message) {
|
|
151
|
+
const payload = message.payload;
|
|
152
|
+
// Add the client with initial auth state
|
|
153
|
+
const client = {
|
|
154
|
+
id: payload.clientId,
|
|
155
|
+
userId: payload.userId || '',
|
|
156
|
+
roomId: null,
|
|
157
|
+
authenticated: payload.authenticated,
|
|
158
|
+
connectedAt: Date.now()
|
|
159
|
+
};
|
|
160
|
+
this.clients.set(payload.clientId, client);
|
|
161
|
+
this.clientMessageHandlers.set(payload.clientId, this.createClientMessageHandler(payload.clientId));
|
|
162
|
+
await this.emit('client_connected', { client });
|
|
163
|
+
if (payload.authenticated) {
|
|
164
|
+
await this.emit('client_authenticated', {
|
|
165
|
+
clientId: payload.clientId,
|
|
166
|
+
userId: payload.userId || ''
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
async handleClientAuthenticatedMessage(message) {
|
|
171
|
+
const payload = message.payload;
|
|
172
|
+
const client = this.clients.get(payload.clientId);
|
|
173
|
+
if (client) {
|
|
174
|
+
client.authenticated = true;
|
|
175
|
+
client.userId = payload.userId;
|
|
176
|
+
await this.emit('client_authenticated', {
|
|
177
|
+
clientId: payload.clientId,
|
|
178
|
+
userId: payload.userId
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
82
182
|
async handleTransportError(error) {
|
|
83
183
|
await this.emit('error', { error, context: 'transport' });
|
|
84
184
|
}
|
|
@@ -364,4 +464,11 @@ export class BaseServer extends TypedEventEmitter {
|
|
|
364
464
|
isRunning() {
|
|
365
465
|
return this.running;
|
|
366
466
|
}
|
|
467
|
+
getMode() {
|
|
468
|
+
return this.mode;
|
|
469
|
+
}
|
|
470
|
+
isInitialized() {
|
|
471
|
+
return this.initialized;
|
|
472
|
+
}
|
|
367
473
|
}
|
|
474
|
+
exports.BaseServer = BaseServer;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { ITransportAdapter } from '../abstractions/TransportAdapter';
|
|
2
|
-
import type { IAuthAdapter } from '../abstractions/AuthAdapter';
|
|
3
|
-
import type { IStorageAdapter } from '../abstractions/StorageAdapter';
|
|
4
|
-
import type { RoomManager } from '../abstractions/RoomManager';
|
|
5
|
-
import type { LockManager } from '../abstractions/LockManager';
|
|
6
|
-
import type { RoomConfig } from '../types';
|
|
7
|
-
import { BaseServer } from './BaseServer';
|
|
1
|
+
import type { ITransportAdapter } from '../abstractions/TransportAdapter.js';
|
|
2
|
+
import type { IAuthAdapter } from '../abstractions/AuthAdapter.js';
|
|
3
|
+
import type { IStorageAdapter } from '../abstractions/StorageAdapter.js';
|
|
4
|
+
import type { RoomManager } from '../abstractions/RoomManager.js';
|
|
5
|
+
import type { LockManager } from '../abstractions/LockManager.js';
|
|
6
|
+
import type { RoomConfig } from '../types/index.js';
|
|
7
|
+
import { BaseServer } from './BaseServer.js';
|
|
8
|
+
import type { Server as HttpServer } from 'http';
|
|
9
|
+
import type { Server as HttpsServer } from 'https';
|
|
10
|
+
import type { WebSocketServer } from 'ws';
|
|
8
11
|
export declare class ServerBuilder {
|
|
9
12
|
private transport?;
|
|
10
13
|
private auth?;
|
|
@@ -12,12 +15,18 @@ export declare class ServerBuilder {
|
|
|
12
15
|
private roomManager?;
|
|
13
16
|
private lockManager?;
|
|
14
17
|
private defaultRoomConfig?;
|
|
18
|
+
private httpServer?;
|
|
19
|
+
private webSocketPath?;
|
|
20
|
+
private webSocketServer?;
|
|
15
21
|
withTransport(transport: ITransportAdapter): this;
|
|
16
22
|
withAuth(auth: IAuthAdapter): this;
|
|
17
23
|
withStorage(storage: IStorageAdapter): this;
|
|
18
24
|
withRoomManager(roomManager: RoomManager): this;
|
|
19
25
|
withLockManager(lockManager: LockManager): this;
|
|
20
26
|
withDefaultRoomConfig(config: Partial<RoomConfig>): this;
|
|
27
|
+
withHttpServer(server: HttpServer | HttpsServer): this;
|
|
28
|
+
withWebSocketPath(path: string): this;
|
|
29
|
+
withWebSocketServer(wss: WebSocketServer): this;
|
|
21
30
|
build(): BaseServer;
|
|
22
31
|
}
|
|
23
32
|
//# sourceMappingURL=ServerBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerBuilder.d.ts","sourceRoot":"","sources":["../../src/server/ServerBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ServerBuilder.d.ts","sourceRoot":"","sources":["../../src/server/ServerBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAqB,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAE1C,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAC,CAAoB;IACtC,OAAO,CAAC,IAAI,CAAC,CAAe;IAC5B,OAAO,CAAC,OAAO,CAAC,CAAkB;IAClC,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,iBAAiB,CAAC,CAAsB;IAChD,OAAO,CAAC,UAAU,CAAC,CAA2B;IAC9C,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,eAAe,CAAC,CAAkB;IAE1C,aAAa,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;IAKjD,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAKlC,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAK3C,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAK/C,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAK/C,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI;IAKxD,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI;IAKtD,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKrC,mBAAmB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAK/C,KAAK,IAAI,UAAU;CA+BpB"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerBuilder = void 0;
|
|
4
|
+
const BaseServer_js_1 = require("./BaseServer.js");
|
|
5
|
+
class ServerBuilder {
|
|
3
6
|
withTransport(transport) {
|
|
4
7
|
this.transport = transport;
|
|
5
8
|
return this;
|
|
@@ -24,6 +27,18 @@ export class ServerBuilder {
|
|
|
24
27
|
this.defaultRoomConfig = config;
|
|
25
28
|
return this;
|
|
26
29
|
}
|
|
30
|
+
withHttpServer(server) {
|
|
31
|
+
this.httpServer = server;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
withWebSocketPath(path) {
|
|
35
|
+
this.webSocketPath = path;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
withWebSocketServer(wss) {
|
|
39
|
+
this.webSocketServer = wss;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
27
42
|
build() {
|
|
28
43
|
if (!this.transport) {
|
|
29
44
|
throw new Error('Transport adapter is required');
|
|
@@ -44,8 +59,12 @@ export class ServerBuilder {
|
|
|
44
59
|
maxUsers: 50,
|
|
45
60
|
maxHistory: 100,
|
|
46
61
|
permissions: ['read', 'write']
|
|
47
|
-
}
|
|
62
|
+
},
|
|
63
|
+
httpServer: this.httpServer,
|
|
64
|
+
webSocketPath: this.webSocketPath,
|
|
65
|
+
webSocketServer: this.webSocketServer
|
|
48
66
|
};
|
|
49
|
-
return new BaseServer(config);
|
|
67
|
+
return new BaseServer_js_1.BaseServer(config);
|
|
50
68
|
}
|
|
51
69
|
}
|
|
70
|
+
exports.ServerBuilder = ServerBuilder;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { BaseServer, type ServerConfig, type ServerEvents, type ConnectedClient } from './BaseServer';
|
|
2
|
-
export { ServerBuilder } from './ServerBuilder';
|
|
1
|
+
export { BaseServer, type ServerConfig, type ServerEvents, type ConnectedClient } from './BaseServer.js';
|
|
2
|
+
export { ServerBuilder } from './ServerBuilder.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerBuilder = exports.BaseServer = void 0;
|
|
1
4
|
// Server-side implementations
|
|
2
|
-
|
|
3
|
-
|
|
5
|
+
var BaseServer_js_1 = require("./BaseServer.js");
|
|
6
|
+
Object.defineProperty(exports, "BaseServer", { enumerable: true, get: function () { return BaseServer_js_1.BaseServer; } });
|
|
7
|
+
var ServerBuilder_js_1 = require("./ServerBuilder.js");
|
|
8
|
+
Object.defineProperty(exports, "ServerBuilder", { enumerable: true, get: function () { return ServerBuilder_js_1.ServerBuilder; } });
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
export interface TokenPayload {
|
|
2
2
|
userId: string;
|
|
3
|
-
email
|
|
4
|
-
username
|
|
3
|
+
email?: string;
|
|
4
|
+
username?: string;
|
|
5
5
|
permissions?: string[];
|
|
6
6
|
roomId?: string;
|
|
7
7
|
expiresAt?: number;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
8
9
|
}
|
|
9
10
|
export interface AuthResult {
|
|
10
|
-
|
|
11
|
+
success: boolean;
|
|
12
|
+
token?: string;
|
|
11
13
|
refreshToken?: string;
|
|
12
|
-
user
|
|
13
|
-
|
|
14
|
+
user?: TokenPayload;
|
|
15
|
+
userId?: string;
|
|
16
|
+
expiresIn?: number;
|
|
17
|
+
error?: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
14
19
|
}
|
|
15
|
-
export type CredentialType = 'password' | 'oauth' | 'token';
|
|
20
|
+
export type CredentialType = 'password' | 'oauth' | 'token' | 'jwt' | 'bearer' | 'apikey' | 'custom';
|
|
16
21
|
export type OAuthProvider = 'github' | 'gitlab' | 'bitbucket';
|
|
17
22
|
export interface Credentials {
|
|
18
23
|
type: CredentialType;
|
|
19
24
|
username?: string;
|
|
20
25
|
password?: string;
|
|
21
26
|
token?: string;
|
|
27
|
+
apiKey?: string;
|
|
22
28
|
provider?: OAuthProvider;
|
|
23
29
|
code?: string;
|
|
24
30
|
redirectUri?: string;
|
|
31
|
+
[key: string]: unknown;
|
|
25
32
|
}
|
|
26
33
|
export interface JWTConfig {
|
|
27
34
|
secret: string;
|
|
@@ -36,5 +43,5 @@ export interface OAuthConfig {
|
|
|
36
43
|
scope?: string[];
|
|
37
44
|
provider: OAuthProvider;
|
|
38
45
|
}
|
|
39
|
-
export type AuthProvider = 'jwt' | 'oauth' | 'basic';
|
|
46
|
+
export type AuthProvider = 'jwt' | 'oauth' | 'basic' | 'bearer' | 'apikey' | 'custom';
|
|
40
47
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/types/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IA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AAG,QAAQ,CAAC"}
|
package/dist/types/auth.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types/events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Lock } from './lock';
|
|
1
|
+
import type { Lock } from './lock.js';
|
|
2
2
|
export type EventType = 'file_change' | 'commit' | 'branch_change' | 'cursor_position' | 'git_status' | 'lock_acquired' | 'lock_released' | 'lock_status' | 'user_joined' | 'user_left' | 'heartbeat';
|
|
3
3
|
export interface BaseEvent {
|
|
4
4
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,QAAQ,GACR,eAAe,GACf,iBAAiB,GACjB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,aAAa,GACb,aAAa,GACb,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnE,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,IAAI,EAAE,aAAa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UAAU,GAAG,SAAS,CAAC;KAC7C,CAAC;CACH;AAED,MAAM,MAAM,KAAK,GACb,eAAe,GACf,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,CAAC"}
|
package/dist/types/events.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { EventType, BaseEvent, FileAction, FileChangeEvent, GitStatusEvent, CommitEvent, BranchChangeEvent, CursorPositionEvent, Event } from './events';
|
|
2
|
-
export { TokenPayload, AuthResult, CredentialType, OAuthProvider, Credentials, JWTConfig, OAuthConfig, AuthProvider } from './auth';
|
|
3
|
-
export { RoomPermission, Room, RoomUser, UserStatus, RoomState, RoomConfig } from './room';
|
|
4
|
-
export { LockType, LockPriority, Lock, LockRequest, LockQueueItem, LockState } from './lock';
|
|
1
|
+
export { EventType, BaseEvent, FileAction, FileChangeEvent, GitStatusEvent, CommitEvent, BranchChangeEvent, CursorPositionEvent, Event } from './events.js';
|
|
2
|
+
export { TokenPayload, AuthResult, CredentialType, OAuthProvider, Credentials, JWTConfig, OAuthConfig, AuthProvider } from './auth.js';
|
|
3
|
+
export { RoomPermission, Room, RoomUser, UserStatus, RoomState, RoomConfig } from './room.js';
|
|
4
|
+
export { LockType, LockPriority, Lock, LockRequest, LockQueueItem, LockState } from './lock.js';
|
|
5
5
|
export type ConnectionState = 'connecting' | 'connected' | 'disconnecting' | 'disconnected';
|
|
6
6
|
export interface ConnectionOptions {
|
|
7
7
|
url?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB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AAClD,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types/lock.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types/room.d.ts
CHANGED
package/dist/types/room.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../src/types/room.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../src/types/room.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAExD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7B,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
package/dist/types/room.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principal-ai/control-tower-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Centralized, runtime-agnostic library for real-time collaboration and synchronization",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -38,12 +38,15 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@eslint/js": "^9.36.0",
|
|
40
40
|
"@types/bun": "latest",
|
|
41
|
+
"@types/ws": "^8.18.1",
|
|
41
42
|
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
42
43
|
"@typescript-eslint/parser": "^8.44.0",
|
|
43
44
|
"eslint": "^9.36.0",
|
|
44
45
|
"typescript": "^5.3.3"
|
|
45
46
|
},
|
|
46
|
-
"dependencies": {
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"ws": "^8.18.3"
|
|
49
|
+
},
|
|
47
50
|
"engines": {
|
|
48
51
|
"bun": ">=1.0.0"
|
|
49
52
|
}
|