@openlap/openlap 1.1.5 → 1.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/channel.d.ts +0 -4
- package/dist/channel.js +1 -35
- package/dist/proxy.js +0 -4
- package/package.json +1 -1
package/dist/channel.d.ts
CHANGED
|
@@ -42,13 +42,9 @@ export declare class ChannelManager {
|
|
|
42
42
|
getFocusedChannel(): string | undefined;
|
|
43
43
|
isJoined(channel: string): boolean;
|
|
44
44
|
isMuted(channel: string): boolean;
|
|
45
|
-
hasChannels(): boolean;
|
|
46
|
-
heartbeat(): Promise<void>;
|
|
47
45
|
private connectSSE;
|
|
48
46
|
private readStream;
|
|
49
47
|
private handleSSEEvent;
|
|
50
|
-
private startHeartbeat;
|
|
51
|
-
private stopHeartbeat;
|
|
52
48
|
stop(): void;
|
|
53
49
|
}
|
|
54
50
|
export {};
|
package/dist/channel.js
CHANGED
|
@@ -46,10 +46,6 @@ export class ChannelManager {
|
|
|
46
46
|
const controller = new AbortController();
|
|
47
47
|
this.channels.set(channel, { controller, muted: false, focused: false });
|
|
48
48
|
this.connectSSE(channel, controller);
|
|
49
|
-
// Start heartbeat if first channel
|
|
50
|
-
if (this.channels.size === 1) {
|
|
51
|
-
this.startHeartbeat();
|
|
52
|
-
}
|
|
53
49
|
return data;
|
|
54
50
|
}
|
|
55
51
|
catch (err) {
|
|
@@ -64,10 +60,6 @@ export class ChannelManager {
|
|
|
64
60
|
return;
|
|
65
61
|
state.controller.abort();
|
|
66
62
|
this.channels.delete(channel);
|
|
67
|
-
// Stop heartbeat if no channels
|
|
68
|
-
if (this.channels.size === 0) {
|
|
69
|
-
this.stopHeartbeat();
|
|
70
|
-
}
|
|
71
63
|
const token = this.getToken();
|
|
72
64
|
const headers = {};
|
|
73
65
|
if (token)
|
|
@@ -121,24 +113,6 @@ export class ChannelManager {
|
|
|
121
113
|
isMuted(channel) {
|
|
122
114
|
return this.channels.get(channel)?.muted ?? false;
|
|
123
115
|
}
|
|
124
|
-
hasChannels() {
|
|
125
|
-
return this.channels.size > 0;
|
|
126
|
-
}
|
|
127
|
-
// Public heartbeat -- called by proxy on every tool invocation.
|
|
128
|
-
async heartbeat() {
|
|
129
|
-
const token = this.getToken();
|
|
130
|
-
if (!token)
|
|
131
|
-
return;
|
|
132
|
-
try {
|
|
133
|
-
await fetch(`${this.baseUrl}/api/presence/heartbeat`, {
|
|
134
|
-
method: "POST",
|
|
135
|
-
headers: { "Authorization": `Bearer ${token}` },
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
// not critical
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
116
|
// SSE connection for a channel
|
|
143
117
|
connectSSE(channel, controller) {
|
|
144
118
|
const url = `${this.baseUrl}/feed/${channel}/sse`;
|
|
@@ -247,16 +221,8 @@ export class ChannelManager {
|
|
|
247
221
|
}
|
|
248
222
|
}
|
|
249
223
|
}
|
|
250
|
-
//
|
|
251
|
-
// (setInterval doesn't fire reliably in MCP stdio context).
|
|
252
|
-
startHeartbeat() {
|
|
253
|
-
this.heartbeat().catch(() => { });
|
|
254
|
-
}
|
|
255
|
-
stopHeartbeat() {
|
|
256
|
-
// No interval to clear -- heartbeats piggyback on tool calls
|
|
257
|
-
}
|
|
224
|
+
// No heartbeat needed. Presence persists until explicit leave or session expiry.
|
|
258
225
|
stop() {
|
|
259
|
-
this.stopHeartbeat();
|
|
260
226
|
for (const [, state] of this.channels) {
|
|
261
227
|
state.controller.abort();
|
|
262
228
|
}
|
package/dist/proxy.js
CHANGED
|
@@ -174,10 +174,6 @@ export async function startProxy() {
|
|
|
174
174
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
175
175
|
const { name } = req.params;
|
|
176
176
|
const args = { ...(req.params.arguments ?? {}) };
|
|
177
|
-
// -- Heartbeat on every tool call (keeps presence alive) ----------------
|
|
178
|
-
if (channels.hasChannels()) {
|
|
179
|
-
channels.heartbeat().catch(() => { });
|
|
180
|
-
}
|
|
181
177
|
// -- v2 proxy-side channel tools (handled locally) ----------------------
|
|
182
178
|
if (name === "join_channel") {
|
|
183
179
|
const channel = args.channel;
|