@openlap/openlap 1.1.7 → 1.1.8

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 CHANGED
@@ -35,6 +35,7 @@ export declare class ChannelManager {
35
35
  private mySessionId;
36
36
  constructor(baseUrl: string, onUpdate: UpdateCallback, getToken: () => string | undefined, onPresence?: PresenceCallback);
37
37
  setSessionId(sessionId: string): void;
38
+ getSessionId(): string | undefined;
38
39
  join(channel: string, name?: string): Promise<JoinResponse | null>;
39
40
  leave(channel: string): Promise<void>;
40
41
  mute(channel: string): boolean;
package/dist/channel.js CHANGED
@@ -18,6 +18,9 @@ export class ChannelManager {
18
18
  setSessionId(sessionId) {
19
19
  this.mySessionId = sessionId;
20
20
  }
21
+ getSessionId() {
22
+ return this.mySessionId;
23
+ }
21
24
  // join calls the server API to register presence, then opens SSE.
22
25
  async join(channel, name) {
23
26
  if (this.channels.has(channel))
package/dist/index.js CHANGED
@@ -64,6 +64,19 @@ if (command === "help" || command === "--help" || command === "-h") {
64
64
  process.exit(0);
65
65
  }
66
66
  // -- Default: run as MCP proxy server (called by Claude Code) ---------------
67
+ if (command === "--version" || command === "-v" || command === "version") {
68
+ try {
69
+ const { readFileSync } = await import("fs");
70
+ const { join, dirname } = await import("path");
71
+ const { fileURLToPath } = await import("url");
72
+ const ver = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "package.json"), "utf-8")).version;
73
+ console.log(ver);
74
+ }
75
+ catch {
76
+ console.log("unknown");
77
+ }
78
+ process.exit(0);
79
+ }
67
80
  if (command && command !== "serve") {
68
81
  console.error(`Unknown command: ${command}`);
69
82
  console.error("Run 'npx @openlap/openlap help' for usage.");
package/dist/proxy.js CHANGED
@@ -102,6 +102,14 @@ export async function startProxy() {
102
102
  });
103
103
  // -- v1 compat: FeedManager for old track subscriptions -------------------
104
104
  const feeds = new FeedManager(BASE_URL, (tag, update) => {
105
+ // Mute check: skip if channel is muted in ChannelManager
106
+ if (channels.isJoined(tag) && channels.isMuted(tag))
107
+ return;
108
+ // Echo suppression: skip own posts (session_id present in SSE JSON but not typed on TrackUpdate)
109
+ const sessionId = update.session_id;
110
+ const mySession = channels.getSessionId();
111
+ if (mySession && sessionId === mySession)
112
+ return;
105
113
  const who = update.project_name || "unknown";
106
114
  const health = update.health && update.health !== "on_track" ? ` [${update.health}]` : "";
107
115
  const content = `[${who}]${health} ${update.body}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openlap/openlap",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
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",