@openlap/openlap 1.1.1 → 1.1.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/channel.js CHANGED
@@ -225,20 +225,28 @@ export class ChannelManager {
225
225
  startHeartbeat() {
226
226
  if (this.heartbeatInterval)
227
227
  return;
228
- this.heartbeatInterval = setInterval(async () => {
228
+ // Fire immediate heartbeat on first join
229
+ const doHeartbeat = async () => {
229
230
  const token = this.getToken();
230
- if (!token)
231
+ if (!token) {
232
+ process.stderr.write(`[openlap] heartbeat skipped: no token\n`);
231
233
  return;
234
+ }
232
235
  try {
233
- await fetch(`${this.baseUrl}/api/presence/heartbeat`, {
236
+ const res = await fetch(`${this.baseUrl}/api/presence/heartbeat`, {
234
237
  method: "POST",
235
238
  headers: { "Authorization": `Bearer ${token}` },
236
239
  });
240
+ if (!res.ok) {
241
+ process.stderr.write(`[openlap] heartbeat failed: ${res.status}\n`);
242
+ }
237
243
  }
238
- catch {
239
- // heartbeat failure is not critical
244
+ catch (err) {
245
+ process.stderr.write(`[openlap] heartbeat error: ${err}\n`);
240
246
  }
241
- }, 30_000);
247
+ };
248
+ doHeartbeat(); // immediate first heartbeat
249
+ this.heartbeatInterval = setInterval(doHeartbeat, 30_000);
242
250
  }
243
251
  stopHeartbeat() {
244
252
  if (this.heartbeatInterval) {
package/dist/proxy.js CHANGED
@@ -180,6 +180,10 @@ export async function startProxy() {
180
180
  if (!channel)
181
181
  return { content: [{ type: "text", text: "channel required" }], isError: true };
182
182
  const result = await channels.join(channel, args.name);
183
+ // Set session_id for echo suppression (returned by server on join)
184
+ if (result && result.session_id) {
185
+ channels.setSessionId(result.session_id);
186
+ }
183
187
  return { content: [{ type: "text", text: JSON.stringify(result ?? { error: "already joined or failed" }) }] };
184
188
  }
185
189
  if (name === "leave_channel") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openlap/openlap",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Local MCP proxy for openlap.app -- auto-save, live feeds, project detection, one install",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",