@openlap/openlap 1.1.3 → 1.1.5
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.js +6 -1
- package/dist/proxy.js +4 -4
- package/package.json +1 -1
package/dist/channel.js
CHANGED
|
@@ -146,15 +146,20 @@ export class ChannelManager {
|
|
|
146
146
|
const token = this.getToken();
|
|
147
147
|
if (token)
|
|
148
148
|
headers["Authorization"] = `Bearer ${token}`;
|
|
149
|
+
process.stderr.write(`[openlap] SSE connecting to ${channel}${token ? ' (with auth)' : ' (NO auth)'}\n`);
|
|
149
150
|
fetch(url, { headers, signal: controller.signal })
|
|
150
151
|
.then((res) => {
|
|
151
|
-
if (!res.ok || !res.body)
|
|
152
|
+
if (!res.ok || !res.body) {
|
|
153
|
+
process.stderr.write(`[openlap] SSE ${channel} failed: ${res.status}\n`);
|
|
152
154
|
throw new Error(`SSE connect failed: ${res.status}`);
|
|
155
|
+
}
|
|
156
|
+
process.stderr.write(`[openlap] SSE ${channel} connected\n`);
|
|
153
157
|
return this.readStream(channel, res.body, controller);
|
|
154
158
|
})
|
|
155
159
|
.catch((err) => {
|
|
156
160
|
if (err.name === "AbortError")
|
|
157
161
|
return;
|
|
162
|
+
process.stderr.write(`[openlap] SSE ${channel} error: ${err.message}\n`);
|
|
158
163
|
if (this.channels.has(channel)) {
|
|
159
164
|
setTimeout(() => this.connectSSE(channel, controller), 5000);
|
|
160
165
|
}
|
package/dist/proxy.js
CHANGED
|
@@ -174,6 +174,10 @@ 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
|
+
}
|
|
177
181
|
// -- v2 proxy-side channel tools (handled locally) ----------------------
|
|
178
182
|
if (name === "join_channel") {
|
|
179
183
|
const channel = args.channel;
|
|
@@ -230,10 +234,6 @@ export async function startProxy() {
|
|
|
230
234
|
process.stderr.write(`[openlap] auto-saved: ${saved}\n`);
|
|
231
235
|
}
|
|
232
236
|
}
|
|
233
|
-
// -- Heartbeat on every tool call (replaces unreliable setInterval) ------
|
|
234
|
-
if (channels.hasChannels()) {
|
|
235
|
-
channels.heartbeat().catch(() => { });
|
|
236
|
-
}
|
|
237
237
|
// -- Forward to remote --------------------------------------------------
|
|
238
238
|
const result = await remote.callTool({ name, arguments: args });
|
|
239
239
|
// v1 compat: auto-subscribe to feeds from track tool usage
|