@principal-ai/control-tower-core 0.2.0 → 0.2.2
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/ConnectedRoomManager.d.ts +22 -0
- package/dist/abstractions/ConnectedRoomManager.d.ts.map +1 -0
- package/dist/abstractions/ConnectedRoomManager.js +56 -0
- package/dist/abstractions/index.d.ts +1 -0
- package/dist/abstractions/index.d.ts.map +1 -1
- package/dist/abstractions/index.js +3 -1
- package/dist/generated/client-connection-auth.types.d.ts +312 -0
- package/dist/generated/client-connection-auth.types.d.ts.map +1 -0
- package/dist/generated/client-connection-auth.types.js +11 -0
- package/dist/generated/control-tower-execution.types.d.ts +445 -0
- package/dist/generated/control-tower-execution.types.d.ts.map +1 -0
- package/dist/generated/control-tower-execution.types.js +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +8 -7
- package/dist/index.mjs +180 -99
- package/dist/index.mjs.map +8 -7
- package/dist/server/BaseServer.d.ts +30 -2
- package/dist/server/BaseServer.d.ts.map +1 -1
- package/dist/server/BaseServer.js +77 -8
- package/dist/server/ServerBuilder.d.ts.map +1 -1
- package/dist/server/ServerBuilder.js +11 -0
- package/dist/telemetry/EventValidationIntegration.d.ts +135 -0
- package/dist/telemetry/EventValidationIntegration.d.ts.map +1 -0
- package/dist/telemetry/EventValidationIntegration.js +253 -0
- package/dist/telemetry/EventValidationIntegration.test.d.ts +7 -0
- package/dist/telemetry/EventValidationIntegration.test.d.ts.map +1 -0
- package/dist/telemetry/EventValidationIntegration.test.js +322 -0
- package/dist/telemetry/TelemetryCapture.d.ts +268 -0
- package/dist/telemetry/TelemetryCapture.d.ts.map +1 -0
- package/dist/telemetry/TelemetryCapture.js +263 -0
- package/dist/telemetry/TelemetryCapture.test.d.ts +7 -0
- package/dist/telemetry/TelemetryCapture.test.d.ts.map +1 -0
- package/dist/telemetry/TelemetryCapture.test.js +396 -0
- package/dist/telemetry-example.d.ts +33 -0
- package/dist/telemetry-example.d.ts.map +1 -0
- package/dist/telemetry-example.js +124 -0
- package/package.json +1 -1
- package/dist/adapters/websocket/WebSocketTransportAdapter.d.ts +0 -60
- package/dist/adapters/websocket/WebSocketTransportAdapter.d.ts.map +0 -1
- package/dist/adapters/websocket/WebSocketTransportAdapter.js +0 -386
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Event } from "../types/index.js";
|
|
2
|
+
import { DefaultRoomManager } from "./DefaultRoomManager.js";
|
|
3
|
+
/**
|
|
4
|
+
* Room manager that broadcasts events to connected clients
|
|
5
|
+
*
|
|
6
|
+
* This extends DefaultRoomManager to add actual broadcasting functionality.
|
|
7
|
+
* It requires a sendToClient callback that is provided by the server.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ConnectedRoomManager extends DefaultRoomManager {
|
|
10
|
+
private sendToClient;
|
|
11
|
+
private getClientIdsInRoom;
|
|
12
|
+
/**
|
|
13
|
+
* @param sendToClient - Callback to send a message to a specific client
|
|
14
|
+
* @param getClientIdsInRoom - Callback to get all client IDs for a user in a room
|
|
15
|
+
*/
|
|
16
|
+
constructor(sendToClient: (clientId: string, message: Record<string, unknown>) => Promise<void>, getClientIdsInRoom: (roomId: string, userId: string) => string[]);
|
|
17
|
+
/**
|
|
18
|
+
* Broadcast an event to all users in a room (optionally excluding one user)
|
|
19
|
+
*/
|
|
20
|
+
broadcastToRoom(roomId: string, event: Event, excludeUserId?: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ConnectedRoomManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectedRoomManager.d.ts","sourceRoot":"","sources":["../../src/abstractions/ConnectedRoomManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,KAAK,EACL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC3D,OAAO,CAAC,YAAY,CAAwE;IAC5F,OAAO,CAAC,kBAAkB,CAA+C;IAEzE;;;OAGG;gBAEF,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACnF,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,EAAE;IAOjE;;OAEG;IACG,eAAe,CACpB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;CAwChB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectedRoomManager = void 0;
|
|
4
|
+
const DefaultRoomManager_js_1 = require("./DefaultRoomManager.js");
|
|
5
|
+
/**
|
|
6
|
+
* Room manager that broadcasts events to connected clients
|
|
7
|
+
*
|
|
8
|
+
* This extends DefaultRoomManager to add actual broadcasting functionality.
|
|
9
|
+
* It requires a sendToClient callback that is provided by the server.
|
|
10
|
+
*/
|
|
11
|
+
class ConnectedRoomManager extends DefaultRoomManager_js_1.DefaultRoomManager {
|
|
12
|
+
/**
|
|
13
|
+
* @param sendToClient - Callback to send a message to a specific client
|
|
14
|
+
* @param getClientIdsInRoom - Callback to get all client IDs for a user in a room
|
|
15
|
+
*/
|
|
16
|
+
constructor(sendToClient, getClientIdsInRoom) {
|
|
17
|
+
super();
|
|
18
|
+
this.sendToClient = sendToClient;
|
|
19
|
+
this.getClientIdsInRoom = getClientIdsInRoom;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Broadcast an event to all users in a room (optionally excluding one user)
|
|
23
|
+
*/
|
|
24
|
+
async broadcastToRoom(roomId, event, excludeUserId) {
|
|
25
|
+
const roomState = this.rooms.get(roomId);
|
|
26
|
+
if (!roomState) {
|
|
27
|
+
throw new Error(`Room ${roomId} not found`);
|
|
28
|
+
}
|
|
29
|
+
// Store in history first
|
|
30
|
+
await this.addEventToHistory(roomId, event);
|
|
31
|
+
// Get all users in the room
|
|
32
|
+
const users = Array.from(roomState.users.values());
|
|
33
|
+
// Send to each user's clients
|
|
34
|
+
const sendPromises = [];
|
|
35
|
+
for (const user of users) {
|
|
36
|
+
// Skip excluded user
|
|
37
|
+
if (excludeUserId && user.id === excludeUserId) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
// Get all client IDs for this user in this room
|
|
41
|
+
const clientIds = this.getClientIdsInRoom(roomId, user.id);
|
|
42
|
+
// Send event to each client
|
|
43
|
+
for (const clientId of clientIds) {
|
|
44
|
+
sendPromises.push(this.sendToClient(clientId, {
|
|
45
|
+
type: 'event_received',
|
|
46
|
+
event,
|
|
47
|
+
}).catch(error => {
|
|
48
|
+
console.error(`[ConnectedRoomManager] Failed to send event to client ${clientId}:`, error);
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Wait for all sends to complete
|
|
53
|
+
await Promise.all(sendPromises);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.ConnectedRoomManager = ConnectedRoomManager;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { IAuthAdapter } from "./AuthAdapter.js";
|
|
2
|
+
export { ConnectedRoomManager } from "./ConnectedRoomManager.js";
|
|
2
3
|
export { DefaultLockManager } from "./DefaultLockManager.js";
|
|
3
4
|
export { DefaultPresenceManager } from "./DefaultPresenceManager.js";
|
|
4
5
|
export { DefaultRoomManager } from "./DefaultRoomManager.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO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,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RoomManager = exports.PresenceManager = exports.LockManager = exports.TypedEventEmitter = exports.DefaultRoomManager = exports.DefaultPresenceManager = exports.DefaultLockManager = void 0;
|
|
3
|
+
exports.RoomManager = exports.PresenceManager = exports.LockManager = exports.TypedEventEmitter = exports.DefaultRoomManager = exports.DefaultPresenceManager = exports.DefaultLockManager = exports.ConnectedRoomManager = void 0;
|
|
4
|
+
var ConnectedRoomManager_js_1 = require("./ConnectedRoomManager.js");
|
|
5
|
+
Object.defineProperty(exports, "ConnectedRoomManager", { enumerable: true, get: function () { return ConnectedRoomManager_js_1.ConnectedRoomManager; } });
|
|
4
6
|
var DefaultLockManager_js_1 = require("./DefaultLockManager.js");
|
|
5
7
|
Object.defineProperty(exports, "DefaultLockManager", { enumerable: true, get: function () { return DefaultLockManager_js_1.DefaultLockManager; } });
|
|
6
8
|
var DefaultPresenceManager_js_1 = require("./DefaultPresenceManager.js");
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated types from canvas: Client Connection and Authentication Flow
|
|
3
|
+
*
|
|
4
|
+
* DO NOT EDIT MANUALLY - This file is auto-generated
|
|
5
|
+
* Generated by @principal-ai/principal-view-core
|
|
6
|
+
*
|
|
7
|
+
* Canvas: Telemetry instrumentation for client WebSocket connection, message validation, and authentication flow through Control Tower
|
|
8
|
+
* Version: 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Event types for node: websocket-adapter
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace WebsocketAdapter {
|
|
14
|
+
/**
|
|
15
|
+
* New WebSocket connection received
|
|
16
|
+
*/
|
|
17
|
+
interface ConnectionReceived {
|
|
18
|
+
name: 'connection.received';
|
|
19
|
+
attributes: {
|
|
20
|
+
/** Unique connection identifier */
|
|
21
|
+
'connection.id': string;
|
|
22
|
+
/** Origin header from connection */
|
|
23
|
+
'connection.origin'?: string;
|
|
24
|
+
/** WebSocket protocol version */
|
|
25
|
+
'connection.protocol'?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* WebSocket connection successfully established
|
|
30
|
+
*/
|
|
31
|
+
interface ConnectionEstablished {
|
|
32
|
+
name: 'connection.established';
|
|
33
|
+
attributes: {
|
|
34
|
+
'connection.id': string;
|
|
35
|
+
/** Transport type (websocket, mock) */
|
|
36
|
+
'transport.type': string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* WebSocket connection rejected
|
|
41
|
+
*/
|
|
42
|
+
interface ConnectionRejected {
|
|
43
|
+
name: 'connection.rejected';
|
|
44
|
+
attributes: {
|
|
45
|
+
'connection.id': string;
|
|
46
|
+
/** Reason for rejection */
|
|
47
|
+
'rejection.reason': string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Union of all event types for websocket-adapter
|
|
52
|
+
*/
|
|
53
|
+
type Event = ConnectionReceived | ConnectionEstablished | ConnectionRejected;
|
|
54
|
+
/**
|
|
55
|
+
* Literal union of event names for websocket-adapter
|
|
56
|
+
*/
|
|
57
|
+
type EventName = 'connection.received' | 'connection.established' | 'connection.rejected';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Event types for node: server
|
|
61
|
+
*/
|
|
62
|
+
export declare namespace Server {
|
|
63
|
+
/**
|
|
64
|
+
* Client connection registered with server
|
|
65
|
+
*/
|
|
66
|
+
interface ClientConnected {
|
|
67
|
+
name: 'client.connected';
|
|
68
|
+
attributes: {
|
|
69
|
+
/** Unique client identifier */
|
|
70
|
+
'client.id': string;
|
|
71
|
+
/** Transport adapter type */
|
|
72
|
+
'transport.type': string;
|
|
73
|
+
/** Unix timestamp of connection */
|
|
74
|
+
'connection.timestamp': number;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Client connected but not yet authenticated
|
|
79
|
+
*/
|
|
80
|
+
interface ClientAwaiting_auth {
|
|
81
|
+
name: 'client.awaiting_auth';
|
|
82
|
+
attributes: {
|
|
83
|
+
'client.id': string;
|
|
84
|
+
/** Authentication timeout period */
|
|
85
|
+
'auth.timeout_ms'?: number;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Union of all event types for server
|
|
90
|
+
*/
|
|
91
|
+
type Event = ClientConnected | ClientAwaiting_auth;
|
|
92
|
+
/**
|
|
93
|
+
* Literal union of event names for server
|
|
94
|
+
*/
|
|
95
|
+
type EventName = 'client.connected' | 'client.awaiting_auth';
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Event types for node: message-handler
|
|
99
|
+
*/
|
|
100
|
+
export declare namespace MessageHandler {
|
|
101
|
+
/**
|
|
102
|
+
* Message received from client
|
|
103
|
+
*/
|
|
104
|
+
interface MessageReceived {
|
|
105
|
+
name: 'message.received';
|
|
106
|
+
attributes: {
|
|
107
|
+
'client.id': string;
|
|
108
|
+
/** Message type (authenticate, join_room, etc.) */
|
|
109
|
+
'message.type': string;
|
|
110
|
+
/** Message payload size in bytes */
|
|
111
|
+
'message.size_bytes'?: number;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Message passed schema validation
|
|
116
|
+
*/
|
|
117
|
+
interface MessageValidated {
|
|
118
|
+
name: 'message.validated';
|
|
119
|
+
attributes: {
|
|
120
|
+
'client.id': string;
|
|
121
|
+
'message.type': string;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Message failed schema validation
|
|
126
|
+
*/
|
|
127
|
+
interface MessageValidation_failed {
|
|
128
|
+
name: 'message.validation_failed';
|
|
129
|
+
attributes: {
|
|
130
|
+
'client.id': string;
|
|
131
|
+
'message.type': string;
|
|
132
|
+
/** Validation error message */
|
|
133
|
+
'validation.error': string;
|
|
134
|
+
/** Field that failed validation */
|
|
135
|
+
'validation.field'?: string;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Union of all event types for message-handler
|
|
140
|
+
*/
|
|
141
|
+
type Event = MessageReceived | MessageValidated | MessageValidation_failed;
|
|
142
|
+
/**
|
|
143
|
+
* Literal union of event names for message-handler
|
|
144
|
+
*/
|
|
145
|
+
type EventName = 'message.received' | 'message.validated' | 'message.validation_failed';
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Event types for node: auth-adapter
|
|
149
|
+
*/
|
|
150
|
+
export declare namespace AuthAdapter {
|
|
151
|
+
/**
|
|
152
|
+
* Authentication validation begins
|
|
153
|
+
*/
|
|
154
|
+
interface AuthValidation_started {
|
|
155
|
+
name: 'auth.validation_started';
|
|
156
|
+
attributes: {
|
|
157
|
+
'client.id': string;
|
|
158
|
+
/** Authentication method (token, password, etc.) */
|
|
159
|
+
'auth.method'?: string;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Authentication validation succeeded
|
|
164
|
+
*/
|
|
165
|
+
interface AuthValidation_success {
|
|
166
|
+
name: 'auth.validation_success';
|
|
167
|
+
attributes: {
|
|
168
|
+
'client.id': string;
|
|
169
|
+
/** Authenticated user identifier */
|
|
170
|
+
'user.id': string;
|
|
171
|
+
'auth.method'?: string;
|
|
172
|
+
/** Time taken to validate */
|
|
173
|
+
'validation.duration_ms'?: number;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Authentication validation failed
|
|
178
|
+
*/
|
|
179
|
+
interface AuthValidation_failed {
|
|
180
|
+
name: 'auth.validation_failed';
|
|
181
|
+
attributes: {
|
|
182
|
+
'client.id': string;
|
|
183
|
+
/** Error code (invalid_token, expired, etc.) */
|
|
184
|
+
'auth.error_code': string;
|
|
185
|
+
/** Human-readable error message */
|
|
186
|
+
'auth.error_message': string;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Union of all event types for auth-adapter
|
|
191
|
+
*/
|
|
192
|
+
type Event = AuthValidation_started | AuthValidation_success | AuthValidation_failed;
|
|
193
|
+
/**
|
|
194
|
+
* Literal union of event names for auth-adapter
|
|
195
|
+
*/
|
|
196
|
+
type EventName = 'auth.validation_started' | 'auth.validation_success' | 'auth.validation_failed';
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Event types for node: client-lifecycle
|
|
200
|
+
*/
|
|
201
|
+
export declare namespace ClientLifecycle {
|
|
202
|
+
/**
|
|
203
|
+
* Client state transition occurred
|
|
204
|
+
*/
|
|
205
|
+
interface ClientState_changed {
|
|
206
|
+
name: 'client.state_changed';
|
|
207
|
+
attributes: {
|
|
208
|
+
'client.id': string;
|
|
209
|
+
/** Previous state (connected, authenticating, authenticated) */
|
|
210
|
+
'state.from': string;
|
|
211
|
+
/** New state */
|
|
212
|
+
'state.to': string;
|
|
213
|
+
/** Time spent in previous state */
|
|
214
|
+
'state.duration_ms'?: number;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Client successfully authenticated and ready
|
|
219
|
+
*/
|
|
220
|
+
interface ClientAuthenticated {
|
|
221
|
+
name: 'client.authenticated';
|
|
222
|
+
attributes: {
|
|
223
|
+
'client.id': string;
|
|
224
|
+
'user.id': string;
|
|
225
|
+
/** Total time from connection to authentication */
|
|
226
|
+
'connection.total_duration_ms'?: number;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Client failed to authenticate within timeout period
|
|
231
|
+
*/
|
|
232
|
+
interface ClientAuth_timeout {
|
|
233
|
+
name: 'client.auth_timeout';
|
|
234
|
+
attributes: {
|
|
235
|
+
'client.id': string;
|
|
236
|
+
/** Configured timeout duration */
|
|
237
|
+
'timeout.duration_ms': number;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Client connection terminated
|
|
242
|
+
*/
|
|
243
|
+
interface ClientDisconnected {
|
|
244
|
+
name: 'client.disconnected';
|
|
245
|
+
attributes: {
|
|
246
|
+
'client.id': string;
|
|
247
|
+
/** Reason for disconnection */
|
|
248
|
+
'disconnect.reason'?: string;
|
|
249
|
+
/** Total session duration */
|
|
250
|
+
'session.total_duration_ms'?: number;
|
|
251
|
+
/** Whether client had completed authentication */
|
|
252
|
+
'client.was_authenticated': boolean;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Union of all event types for client-lifecycle
|
|
257
|
+
*/
|
|
258
|
+
type Event = ClientState_changed | ClientAuthenticated | ClientAuth_timeout | ClientDisconnected;
|
|
259
|
+
/**
|
|
260
|
+
* Literal union of event names for client-lifecycle
|
|
261
|
+
*/
|
|
262
|
+
type EventName = 'client.state_changed' | 'client.authenticated' | 'client.auth_timeout' | 'client.disconnected';
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Event types for node: client-response
|
|
266
|
+
*/
|
|
267
|
+
export declare namespace ClientResponse {
|
|
268
|
+
/**
|
|
269
|
+
* Response message sent to client
|
|
270
|
+
*/
|
|
271
|
+
interface ResponseSent {
|
|
272
|
+
name: 'response.sent';
|
|
273
|
+
attributes: {
|
|
274
|
+
'client.id': string;
|
|
275
|
+
/** Response message type (authenticated, error) */
|
|
276
|
+
'response.type': string;
|
|
277
|
+
/** Response payload size */
|
|
278
|
+
'response.size_bytes'?: number;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Failed to send response to client
|
|
283
|
+
*/
|
|
284
|
+
interface ResponseSend_failed {
|
|
285
|
+
name: 'response.send_failed';
|
|
286
|
+
attributes: {
|
|
287
|
+
'client.id': string;
|
|
288
|
+
/** Error that occurred during send */
|
|
289
|
+
'error.message': string;
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Union of all event types for client-response
|
|
294
|
+
*/
|
|
295
|
+
type Event = ResponseSent | ResponseSend_failed;
|
|
296
|
+
/**
|
|
297
|
+
* Literal union of event names for client-response
|
|
298
|
+
*/
|
|
299
|
+
type EventName = 'response.sent' | 'response.send_failed';
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Helper type for creating event emitters by name
|
|
303
|
+
*/
|
|
304
|
+
export type NodeEmitterByName<T extends {
|
|
305
|
+
name: string;
|
|
306
|
+
attributes: any;
|
|
307
|
+
}> = {
|
|
308
|
+
[K in T['name']]: (eventName: K, attributes: Extract<T, {
|
|
309
|
+
name: K;
|
|
310
|
+
}>['attributes']) => void;
|
|
311
|
+
}[T['name']];
|
|
312
|
+
//# sourceMappingURL=client-connection-auth.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-connection-auth.types.d.ts","sourceRoot":"","sources":["../../src/generated/client-connection-auth.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,yBAAiB,gBAAgB,CAAC;IAChC;;OAEG;IACH,UAAiB,kBAAkB;QACjC,IAAI,EAAE,qBAAqB,CAAC;QAC5B,UAAU,EAAE;YACV,mCAAmC;YACnC,eAAe,EAAE,MAAM,CAAC;YACxB,oCAAoC;YACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAC7B,iCAAiC;YACjC,qBAAqB,CAAC,EAAE,MAAM,CAAC;SAChC,CAAC;KACH;IAED;;OAEG;IACH,UAAiB,qBAAqB;QACpC,IAAI,EAAE,wBAAwB,CAAC;QAC/B,UAAU,EAAE;YACV,eAAe,EAAE,MAAM,CAAC;YACxB,uCAAuC;YACvC,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAA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IT MANUALLY - This file is auto-generated
|
|
6
|
+
* Generated by @principal-ai/principal-view-core
|
|
7
|
+
*
|
|
8
|
+
* Canvas: Telemetry instrumentation for client WebSocket connection, message validation, and authentication flow through Control Tower
|
|
9
|
+
* Version: 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|