@askmesh/mcp 0.7.1 → 0.7.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.
@@ -1,4 +1,5 @@
1
1
  import { readLocalContext } from './context_reader.js';
2
+ import { sendDesktopNotification } from './notifier.js';
2
3
  const SYSTEM_PROMPT = `You are an AI coding agent responding on behalf of a developer through AskMesh.
3
4
  You have access to the developer's project context below.
4
5
  Use this context to answer accurately and concisely.
@@ -17,6 +18,8 @@ export class AutoResponder {
17
18
  }
18
19
  async handleRequest(request) {
19
20
  console.error(`[AskMesh] Question from @${request.fromUsername}: "${request.question}"`);
21
+ // Desktop notification
22
+ sendDesktopNotification(`AskMesh — @${request.fromUsername}`, request.question);
20
23
  // Mark thread as in_progress before processing
21
24
  try {
22
25
  await this.client.updateThreadStatus(request.id, 'in_progress');
@@ -0,0 +1 @@
1
+ export declare function sendDesktopNotification(title: string, message: string): void;
@@ -0,0 +1,26 @@
1
+ import { exec } from 'node:child_process';
2
+ const NOTIFY_DISABLED = process.env.ASKMESH_NOTIFY === 'false';
3
+ export function sendDesktopNotification(title, message) {
4
+ if (NOTIFY_DISABLED)
5
+ return;
6
+ const escaped = message.replace(/"/g, '\\"').replace(/'/g, "'").slice(0, 200);
7
+ const escapedTitle = title.replace(/"/g, '\\"');
8
+ let cmd = null;
9
+ switch (process.platform) {
10
+ case 'darwin':
11
+ cmd = `osascript -e 'display notification "${escaped}" with title "${escapedTitle}"'`;
12
+ break;
13
+ case 'linux':
14
+ cmd = `notify-send "${escapedTitle}" "${escaped}"`;
15
+ break;
16
+ case 'win32':
17
+ cmd = `powershell -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('${escaped}', '${escapedTitle}', 'OK', 'Information')"`;
18
+ break;
19
+ }
20
+ if (cmd) {
21
+ exec(cmd, (err) => {
22
+ if (err)
23
+ console.error('[AskMesh] Desktop notification failed:', err.message);
24
+ });
25
+ }
26
+ }
@@ -1,4 +1,5 @@
1
1
  import EventSource from 'eventsource';
2
+ import { sendDesktopNotification } from '../agent/notifier.js';
2
3
  export class SseListener {
3
4
  es = null;
4
5
  reconnectTimer = null;
@@ -50,6 +51,7 @@ export class SseListener {
50
51
  const payload = JSON.parse(e.data);
51
52
  this.onReply?.(payload);
52
53
  console.error(`[AskMesh] Reply added to thread #${payload.requestId} by @${payload.reply.agentUsername}`);
54
+ sendDesktopNotification(`AskMesh — @${payload.reply.agentUsername}`, `Reply on #${payload.requestId}: ${payload.reply.message}`);
53
55
  }
54
56
  catch { }
55
57
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askmesh/mcp",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "AskMesh MCP server — connect your AI coding agent to your team's mesh network",
5
5
  "type": "module",
6
6
  "bin": {