depsonar 4.0.0 → 4.0.1

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/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
  <sub>Scan · Audit · Update · Migrate — 9 languages, 23 tools, one MCP server</sub>
7
7
  </p>
8
8
  <p align="center">
9
+ <img src="https://img.shields.io/npm/v/depsonar?color=60a5fa&label=npm"/>
9
10
  <img src="https://img.shields.io/badge/languages-9-34d399"/>
10
11
  <img src="https://img.shields.io/badge/tools-23-60a5fa"/>
11
12
  <img src="https://img.shields.io/badge/CVE_scanner-live-f59e0b"/>
@@ -14,6 +15,8 @@
14
15
 
15
16
  <p align="center">
16
17
  <a href="cursor://anysphere.cursor-deeplink/mcp/install?name=depsonar&config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRlcHNvbmFyQGxhdGVzdCJdfQ=="><img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor" /></a>
18
+ &nbsp;&nbsp;
19
+ <a href="https://soflutionltd.github.io/BrandCheck/install.html?name=depsonar&config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRlcHNvbmFyQGxhdGVzdCJdfQ=="><img src="https://img.shields.io/badge/Install_via-Web-60a5fa?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMSAwIDAgMjAgMTAgMTAgMCAwIDAgMC0yMHoiLz48cGF0aCBkPSJNMiAxMmgyMCIvPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMCAxIDggOCAxMCAxMCAwIDAgMS04IDgiLz48cGF0aCBkPSJNMTIgMmExMCAxMCAwIDAgMC04IDggMTAgMTAgMCAwIDAgOCA4Ii8+PC9zdmc+" alt="Install via Web" /></a>
17
20
  </p>
18
21
 
19
22
  **depsonar** is an MCP server that keeps your projects' dependencies up to date, scans for vulnerabilities, detects framework migrations, and audits your entire dev infrastructure — directly from Cursor, Claude, or any MCP-compatible AI assistant.
@@ -71,12 +74,18 @@ Add to `~/.cursor/mcp.json`:
71
74
  "mcpServers": {
72
75
  "depsonar": {
73
76
  "command": "npx",
74
- "args": ["-y", "depsonar"]
77
+ "args": ["-y", "depsonar@latest"]
75
78
  }
76
79
  }
77
80
  }
78
81
  ```
79
82
 
83
+ ### Automatic updates
84
+
85
+ Every install below keeps itself up to date, without restarting Claude or Cursor. The MCP client talks to a small supervisor (`bin/supervise.cjs`) that stays connected while the server runs behind it. At start-up and every 6 hours it asks npm for the latest `depsonar`, installs it in the background in `~/.soflution/mcp/depsonar/`, and switches over as soon as no request is in flight (the client is told the tool list may have changed). A version that fails to start is rolled back at once and never picked again on that machine. npm checks the integrity of every download, and releases are published from GitHub Actions with provenance.
86
+
87
+ The only network call is that version check to `registry.npmjs.org`; nothing about your machine or your use is sent. Turn it off with `NO_UPDATE_NOTIFIER=1` (or `SOFLUTION_AUTO_UPDATE=0`). Started directly with `node dist/...`, depsonar does not update itself and only mentions a newer version in its first tool result.
88
+
80
89
  ### Option 2: Global install
81
90
 
82
91
  ```bash
@@ -96,7 +105,7 @@ npm install -g depsonar
96
105
  ### Option 3: Clone
97
106
 
98
107
  ```bash
99
- git clone https://github.com/Soflution1/depsonar.git
108
+ git clone https://github.com/Soflutionltd/depsonar.git
100
109
  cd depsonar && npm install && npm run build
101
110
  ```
102
111
 
@@ -105,7 +114,7 @@ cd depsonar && npm install && npm run build
105
114
  "mcpServers": {
106
115
  "depsonar": {
107
116
  "command": "node",
108
- "args": ["/path/to/depsonar/dist/index.js"]
117
+ "args": ["/path/to/depsonar/bin/supervise.cjs"]
109
118
  }
110
119
  }
111
120
  }
@@ -242,6 +251,12 @@ depsonar --help # List all 23 tools
242
251
 
243
252
  ---
244
253
 
254
+ ## Also by Soflution
255
+
256
+ - **[brandcheck](https://github.com/Soflutionltd/BrandCheck)** — Check brand name availability across 27 platforms in one shot. Domains, social media, app stores, trademarks.
257
+
258
+ ---
259
+
245
260
  ## License
246
261
 
247
262
  MIT — [Soflution Ltd](https://soflution.com)
@@ -0,0 +1,447 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ // Soflution MCP supervisor: keeps the server up to date without restarting Claude or Cursor.
4
+ //
5
+ // Same model as McpHub. The MCP client (Claude, Cursor...) talks to this small process, which
6
+ // stays connected; the real server runs behind it as a child process. In the background the
7
+ // supervisor asks npm for the latest version and installs it next to the current one, in
8
+ // ~/.soflution/mcp/<package>/<version> (npm checks the package integrity). As soon as no request
9
+ // is in flight, it starts the new version, replays the MCP handshake to it, switches over and
10
+ // tells the client the tool list may have changed. If the new version fails to start, the
11
+ // current one keeps running and that version is never picked automatically again on this machine.
12
+ //
13
+ // Network: one GET to registry.npmjs.org at start-up and every 6 hours. Nothing else is sent.
14
+ // NO_UPDATE_NOTIFIER=1 or SOFLUTION_AUTO_UPDATE=0: no check, no install, no switch.
15
+ // Modes that are not MCP over stdio (setup, --http, --dashboard...) run the server directly.
16
+
17
+ const fs = require('fs');
18
+ const os = require('os');
19
+ const path = require('path');
20
+ const { spawn } = require('child_process');
21
+ const { pathToFileURL } = require('url');
22
+
23
+ const ROOT = path.join(__dirname, '..');
24
+ const cfg = JSON.parse(fs.readFileSync(path.join(__dirname, 'update.json'), 'utf8')); // { package, server, passthrough }
25
+ const OWN_VERSION = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8')).version;
26
+ const OFF = Boolean(process.env.NO_UPDATE_NOTIFIER) || process.env.SOFLUTION_AUTO_UPDATE === '0' || Boolean(process.env.CI);
27
+ const HOME = path.join(os.homedir(), '.soflution', 'mcp', cfg.package);
28
+ const STATE = path.join(HOME, 'state.json');
29
+ const CHECK_EVERY_MS = 6 * 3600 * 1000;
30
+ const HEALTHY_AFTER_MS = 120 * 1000;
31
+ const MAX_BOOTS = 3;
32
+ const SWAP_ID = '__soflution_swap__';
33
+
34
+ const log = (m) => process.stderr.write(`[${cfg.package} supervisor] ${m}\n`);
35
+
36
+ // ---------- versions and state ----------
37
+
38
+ function parse(v) {
39
+ const m = /^v?(\d+)\.(\d+)\.(\d+)$/.exec(String(v || '').trim());
40
+ return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;
41
+ }
42
+ function isNewer(a, b) {
43
+ const x = parse(a), y = parse(b);
44
+ if (!x || !y) return false;
45
+ for (let i = 0; i < 3; i++) if (x[i] !== y[i]) return x[i] > y[i];
46
+ return false;
47
+ }
48
+ function readState() {
49
+ try {
50
+ const s = JSON.parse(fs.readFileSync(STATE, 'utf8'));
51
+ return { installed: s.installed || null, rejected: Array.isArray(s.rejected) ? s.rejected : [], boots: s.boots | 0, healthy: !!s.healthy };
52
+ } catch {
53
+ return { installed: null, rejected: [], boots: 0, healthy: false };
54
+ }
55
+ }
56
+ function writeState(s) {
57
+ try {
58
+ fs.mkdirSync(HOME, { recursive: true });
59
+ const tmp = `${STATE}.${process.pid}.tmp`;
60
+ fs.writeFileSync(tmp, JSON.stringify(s, null, 2));
61
+ fs.renameSync(tmp, STATE);
62
+ } catch (e) {
63
+ log(`state not saved: ${e.message}`);
64
+ }
65
+ }
66
+ function reject(version) {
67
+ const s = readState();
68
+ if (!s.rejected.includes(version)) s.rejected.push(version);
69
+ if (s.installed && s.installed.version === version) s.installed = null;
70
+ s.boots = 0;
71
+ s.healthy = false;
72
+ writeState(s);
73
+ }
74
+
75
+ const serverIn = (dir) => path.join(dir, 'node_modules', cfg.package, cfg.server);
76
+ const OWN = { version: OWN_VERSION, entry: path.join(ROOT, cfg.server) };
77
+
78
+ /** The version to start with: an installed update newer than this package, unless it keeps crashing. */
79
+ function pickStart() {
80
+ if (OFF) return OWN;
81
+ const s = readState();
82
+ const inst = s.installed;
83
+ if (!inst || !isNewer(inst.version, OWN_VERSION) || s.rejected.includes(inst.version) || !fs.existsSync(serverIn(inst.dir))) return OWN;
84
+ if (!s.healthy && s.boots >= MAX_BOOTS) {
85
+ log(`${inst.version} failed to start ${s.boots} times, back to ${OWN_VERSION}`);
86
+ reject(inst.version);
87
+ return OWN;
88
+ }
89
+ if (!s.healthy) {
90
+ s.boots += 1;
91
+ writeState(s);
92
+ }
93
+ return { version: inst.version, entry: serverIn(inst.dir) };
94
+ }
95
+
96
+ // ---------- passthrough modes ----------
97
+
98
+ const args = process.argv.slice(2);
99
+ if (args.some((a) => (cfg.passthrough || []).includes(a))) {
100
+ const target = pickStart();
101
+ process.argv[1] = target.entry;
102
+ import(pathToFileURL(target.entry).href).catch((e) => {
103
+ log(e && e.stack ? e.stack : String(e));
104
+ process.exit(1);
105
+ });
106
+ return;
107
+ }
108
+
109
+ // ---------- line framing ----------
110
+
111
+ function lines(stream, onLine) {
112
+ let buf = '';
113
+ stream.setEncoding('utf8');
114
+ stream.on('data', (chunk) => {
115
+ buf += chunk;
116
+ let i;
117
+ while ((i = buf.indexOf('\n')) >= 0) {
118
+ const line = buf.slice(0, i).replace(/\r$/, '');
119
+ buf = buf.slice(i + 1);
120
+ if (line.trim()) onLine(line);
121
+ }
122
+ });
123
+ }
124
+ function tryJson(line) {
125
+ try {
126
+ return JSON.parse(line);
127
+ } catch {
128
+ return null;
129
+ }
130
+ }
131
+ const idKey = (id) => JSON.stringify(id);
132
+ const toClient = (line) => process.stdout.write(line + '\n');
133
+
134
+ // ---------- supervision ----------
135
+
136
+ let current = null; // { child, version, entry, onLine }
137
+ let swapping = false;
138
+ let shuttingDown = false;
139
+ const queue = []; // client lines held during a switch
140
+ const clientPending = new Set(); // requests from the client awaiting the server's answer
141
+ const serverPending = new Map(); // requests from the server awaiting the client's answer, with their time
142
+ let initRequest = null; // the client's initialize request, replayed to a new version
143
+ let initAnswered = false;
144
+ let initializedSeen = false;
145
+ let lastActivity = Date.now();
146
+
147
+ function start(target) {
148
+ const child = spawn(process.execPath, [target.entry, ...args], {
149
+ stdio: ['pipe', 'pipe', 'inherit'],
150
+ env: { ...process.env, SOFLUTION_SUPERVISED: '1' },
151
+ windowsHide: true,
152
+ });
153
+ const proc = { child, version: target.version, entry: target.entry, startedAt: Date.now(), handler: null };
154
+ lines(child.stdout, (line) => proc.handler && proc.handler(line));
155
+ child.stdin.on('error', () => {});
156
+ return proc;
157
+ }
158
+
159
+ function attach(proc) {
160
+ current = proc;
161
+ proc.handler = (line) => {
162
+ lastActivity = Date.now();
163
+ const msg = tryJson(line);
164
+ if (msg && msg.id !== undefined && msg.method === undefined) {
165
+ clientPending.delete(idKey(msg.id));
166
+ if (initRequest && idKey(msg.id) === idKey(initRequest.id)) initAnswered = true;
167
+ } else if (msg && msg.id !== undefined && msg.method !== undefined) {
168
+ serverPending.set(idKey(msg.id), Date.now());
169
+ }
170
+ toClient(line);
171
+ };
172
+ proc.child.on('exit', (code, signal) => onExit(proc, code, signal));
173
+ }
174
+
175
+ function onExit(proc, code, signal) {
176
+ if (proc !== current || shuttingDown) return;
177
+ const early = Date.now() - proc.startedAt < 30 * 1000;
178
+ if (early && proc.version !== OWN_VERSION) {
179
+ log(`${proc.version} stopped at start-up (${signal || code}), back to ${OWN_VERSION}`);
180
+ reject(proc.version);
181
+ swapping = true; // hold client messages until the bundled version is up
182
+ clientPending.clear();
183
+ serverPending.clear();
184
+ const next = start(OWN);
185
+ replayInit(next).then(() => {
186
+ attach(next);
187
+ swapping = false;
188
+ flush();
189
+ }).catch((e) => {
190
+ log(`restart failed: ${e.message}`);
191
+ process.exit(1);
192
+ });
193
+ return;
194
+ }
195
+ process.exit(code === null ? 1 : code);
196
+ }
197
+
198
+ /** Replays the client's handshake to a freshly started server. */
199
+ function replayInit(proc) {
200
+ return new Promise((resolve, reject) => {
201
+ if (!initRequest) return resolve();
202
+ // If the client is still waiting for its own initialize answer, the new server gives it.
203
+ const ownAnswer = !initAnswered;
204
+ const id = ownAnswer ? initRequest.id : SWAP_ID;
205
+ const timer = setTimeout(() => reject(new Error('no answer to initialize')), 30 * 1000);
206
+ proc.handler = (line) => {
207
+ const msg = tryJson(line);
208
+ if (msg && msg.id !== undefined && idKey(msg.id) === idKey(id) && msg.method === undefined) {
209
+ clearTimeout(timer);
210
+ if (msg.error) return reject(new Error(msg.error.message || 'initialize failed'));
211
+ if (ownAnswer) {
212
+ initAnswered = true;
213
+ clientPending.delete(idKey(initRequest.id));
214
+ toClient(line);
215
+ }
216
+ if (initializedSeen) proc.child.stdin.write(JSON.stringify({ jsonrpc: '2.0', method: 'notifications/initialized' }) + '\n');
217
+ return resolve();
218
+ }
219
+ // Anything else before the handshake completes (logs) goes to the client as usual.
220
+ toClient(line);
221
+ };
222
+ proc.child.once('exit', () => {
223
+ clearTimeout(timer);
224
+ reject(new Error('stopped during initialize'));
225
+ });
226
+ proc.child.stdin.write(JSON.stringify({ ...initRequest, id }) + '\n');
227
+ });
228
+ }
229
+
230
+ function flush() {
231
+ while (queue.length && !swapping) send(queue.shift());
232
+ }
233
+
234
+ function send(line) {
235
+ const msg = tryJson(line);
236
+ if (msg) {
237
+ if (msg.method === 'initialize' && msg.id !== undefined) {
238
+ initRequest = msg;
239
+ initAnswered = false;
240
+ }
241
+ if (msg.method === 'notifications/initialized') initializedSeen = true;
242
+ if (msg.id !== undefined && msg.method !== undefined) clientPending.add(idKey(msg.id));
243
+ if (msg.id !== undefined && msg.method === undefined) serverPending.delete(idKey(msg.id));
244
+ }
245
+ current.child.stdin.write(line + '\n');
246
+ }
247
+
248
+ lines(process.stdin, (line) => {
249
+ lastActivity = Date.now();
250
+ if (swapping) queue.push(line);
251
+ else send(line);
252
+ });
253
+
254
+ function shutdown(code) {
255
+ if (shuttingDown) return;
256
+ shuttingDown = true;
257
+ if (current) {
258
+ // Let the server answer what it already received, as when it runs without the supervisor.
259
+ const child = current.child;
260
+ try { child.stdin.end(); } catch {}
261
+ child.once('exit', () => process.exit(code));
262
+ setTimeout(() => child.kill('SIGTERM'), 3000).unref();
263
+ setTimeout(() => process.exit(code), 6000).unref();
264
+ } else {
265
+ process.exit(code);
266
+ }
267
+ }
268
+ process.stdin.on('end', () => shutdown(0));
269
+ process.stdin.on('close', () => shutdown(0));
270
+ process.on('SIGTERM', () => shutdown(0));
271
+ process.on('SIGINT', () => shutdown(0));
272
+
273
+ // ---------- hot switch ----------
274
+
275
+ async function switchTo(target) {
276
+ if (swapping || !current || current.version === target.version) return;
277
+ swapping = true;
278
+ log(`switching from ${current.version} to ${target.version}`);
279
+ const next = start(target);
280
+ try {
281
+ await replayInit(next);
282
+ } catch (e) {
283
+ log(`${target.version} did not start (${e.message}), staying on ${current.version}`);
284
+ reject(target.version);
285
+ next.child.kill('SIGKILL');
286
+ swapping = false;
287
+ flush();
288
+ return;
289
+ }
290
+ const old = current;
291
+ attach(next);
292
+ swapping = false;
293
+ try { old.child.stdin.end(); } catch {}
294
+ old.child.kill('SIGTERM');
295
+ setTimeout(() => { try { old.child.kill('SIGKILL'); } catch {} }, 5000).unref();
296
+ if (initializedSeen) toClient(JSON.stringify({ jsonrpc: '2.0', method: 'notifications/tools/list_changed' }));
297
+ flush();
298
+ setTimeout(() => {
299
+ const s = readState();
300
+ if (s.installed && s.installed.version === target.version) {
301
+ s.healthy = true;
302
+ s.boots = 0;
303
+ writeState(s);
304
+ }
305
+ }, HEALTHY_AFTER_MS).unref();
306
+ log(`now running ${target.version}`);
307
+ }
308
+
309
+ function switchWhenIdle(target) {
310
+ let quiet = 0;
311
+ const t = setInterval(() => {
312
+ // A server request the client never answers (unsupported by that client) stops counting after a minute.
313
+ for (const [k, t0] of serverPending) if (Date.now() - t0 > 60 * 1000) serverPending.delete(k);
314
+ const idle = clientPending.size === 0 && serverPending.size === 0 && !swapping && Date.now() - lastActivity > 2000;
315
+ quiet = idle ? quiet + 1 : 0;
316
+ if (quiet >= 2) {
317
+ clearInterval(t);
318
+ switchTo(target);
319
+ }
320
+ }, 1000);
321
+ t.unref();
322
+ }
323
+
324
+ // ---------- background install ----------
325
+
326
+ function findNpm() {
327
+ const win = process.platform === 'win32';
328
+ const name = win ? 'npm.cmd' : 'npm';
329
+ const dirs = [path.dirname(process.execPath), ...(process.env.PATH || '').split(path.delimiter)];
330
+ if (!win) dirs.push('/opt/homebrew/bin', '/usr/local/bin', '/usr/bin');
331
+ for (const d of dirs) {
332
+ const p = path.join(d, name);
333
+ try {
334
+ fs.accessSync(p, fs.constants.X_OK);
335
+ return p;
336
+ } catch {}
337
+ }
338
+ return null;
339
+ }
340
+
341
+ function lock() {
342
+ const file = path.join(HOME, 'install.lock');
343
+ try {
344
+ fs.mkdirSync(HOME, { recursive: true });
345
+ try {
346
+ if (Date.now() - fs.statSync(file).mtimeMs > 15 * 60 * 1000) fs.unlinkSync(file);
347
+ } catch {}
348
+ fs.writeFileSync(file, String(process.pid), { flag: 'wx' });
349
+ return () => { try { fs.unlinkSync(file); } catch {} };
350
+ } catch {
351
+ return null; // another instance is installing
352
+ }
353
+ }
354
+
355
+ function cleanup(keep) {
356
+ try {
357
+ for (const name of fs.readdirSync(HOME)) {
358
+ const p = path.join(HOME, name);
359
+ if (parse(name) && !keep.includes(name) && fs.statSync(p).isDirectory()) fs.rmSync(p, { recursive: true, force: true });
360
+ }
361
+ } catch {}
362
+ }
363
+
364
+ async function checkForUpdate() {
365
+ let latest;
366
+ try {
367
+ const res = await fetch(`${process.env.SOFLUTION_REGISTRY || 'https://registry.npmjs.org'}/${encodeURIComponent(cfg.package)}/latest`, {
368
+ headers: { accept: 'application/json' },
369
+ signal: AbortSignal.timeout(5000),
370
+ });
371
+ if (!res.ok) return;
372
+ latest = (await res.json()).version;
373
+ } catch {
374
+ return; // offline
375
+ }
376
+ if (!current || !isNewer(latest, current.version)) return;
377
+ const s = readState();
378
+ if (s.rejected.includes(latest)) return;
379
+
380
+ // Already installed by another instance: just switch.
381
+ if (s.installed && s.installed.version === latest && fs.existsSync(serverIn(s.installed.dir))) {
382
+ switchWhenIdle({ version: latest, entry: serverIn(s.installed.dir) });
383
+ return;
384
+ }
385
+ const npm = findNpm();
386
+ if (!npm) {
387
+ log(`${latest} is available, but npm was not found to install it`);
388
+ return;
389
+ }
390
+ const unlock = lock();
391
+ if (!unlock) return;
392
+ const dir = path.join(HOME, latest);
393
+ fs.rmSync(dir, { recursive: true, force: true });
394
+ fs.mkdirSync(dir, { recursive: true });
395
+ log(`installing ${latest} in the background`);
396
+ const env = { ...process.env, PATH: [path.dirname(process.execPath), process.env.PATH || ''].join(path.delimiter) };
397
+ await new Promise((resolve) => {
398
+ const child = spawn(npm, ['install', '--prefix', dir, '--omit=dev', '--no-audit', '--no-fund', '--loglevel=error', `${cfg.package}@${latest}`], {
399
+ env,
400
+ stdio: ['ignore', 'ignore', 'ignore'],
401
+ shell: process.platform === 'win32',
402
+ windowsHide: true,
403
+ });
404
+ child.on('error', (e) => {
405
+ unlock();
406
+ log(`install failed: ${e.message}`);
407
+ resolve();
408
+ });
409
+ child.on('exit', (code) => {
410
+ unlock();
411
+ if (code !== 0 || !fs.existsSync(serverIn(dir))) {
412
+ log(`install of ${latest} failed (npm exit ${code}), retried at the next check`);
413
+ fs.rmSync(dir, { recursive: true, force: true });
414
+ return resolve();
415
+ }
416
+ const st = readState();
417
+ st.installed = { version: latest, dir };
418
+ st.healthy = false;
419
+ st.boots = 0;
420
+ writeState(st);
421
+ cleanup([latest, current ? current.version : '']);
422
+ log(`${latest} installed`);
423
+ switchWhenIdle({ version: latest, entry: serverIn(dir) });
424
+ resolve();
425
+ });
426
+ });
427
+ }
428
+
429
+ // ---------- go ----------
430
+
431
+ const first = start(pickStart());
432
+ attach(first);
433
+ if (first.version !== OWN_VERSION) {
434
+ setTimeout(() => {
435
+ const s = readState();
436
+ if (s.installed && s.installed.version === first.version && current === first) {
437
+ s.healthy = true;
438
+ s.boots = 0;
439
+ writeState(s);
440
+ }
441
+ }, HEALTHY_AFTER_MS).unref();
442
+ }
443
+ if (!OFF) {
444
+ const run = () => checkForUpdate().catch((e) => log(`update check failed: ${e.message}`));
445
+ setTimeout(run, Number(process.env.SOFLUTION_FIRST_CHECK_MS) || 10 * 1000).unref();
446
+ setInterval(run, CHECK_EVERY_MS).unref();
447
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "package": "depsonar",
3
+ "server": "dist/index.js",
4
+ "passthrough": [
5
+ "--check",
6
+ "-c",
7
+ "--dashboard",
8
+ "-d",
9
+ "--daemon",
10
+ "--version",
11
+ "-v",
12
+ "--help",
13
+ "-h"
14
+ ]
15
+ }
@@ -1,5 +1,5 @@
1
1
  export declare const SERVER_NAME = "depsonar";
2
- export declare const SERVER_VERSION = "4.0.0";
2
+ export declare const SERVER_VERSION = "4.0.1";
3
3
  export declare const CHARACTER_LIMIT = 25000;
4
4
  export declare const COMMAND_TIMEOUT = 120000;
5
5
  export declare const ECOSYSTEM_GROUPS: Record<string, RegExp>;
package/dist/constants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const SERVER_NAME = "depsonar";
2
- export const SERVER_VERSION = "4.0.0";
2
+ export const SERVER_VERSION = "4.0.1";
3
3
  export const CHARACTER_LIMIT = 25_000;
4
4
  export const COMMAND_TIMEOUT = 120_000;
5
5
  // ─── Ecosystem Grouping (for display) ──────────────────────────────────
package/dist/index.js CHANGED
@@ -114,7 +114,9 @@ else {
114
114
  version: SERVER_VERSION,
115
115
  });
116
116
  registerTools(server);
117
- const transport = new StdioServerTransport();
117
+ const { attachUpdateNotice, startUpdateCheck } = await import("./update-notice.js");
118
+ const transport = attachUpdateNotice(new StdioServerTransport());
119
+ startUpdateCheck("depsonar", SERVER_VERSION, "https://github.com/Soflutionltd/depsonar");
118
120
  await server.connect(transport);
119
121
  console.error(`${SERVER_NAME} v${SERVER_VERSION} running on stdio`);
120
122
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":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I,EAAE,WAAW;QACjB,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC;IAEH,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtB,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACpF,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IACjE,gBAAgB,CAAC,UAAU,EAAE,cAAc,EAAE,0CAA0C,CAAC,CAAC;IACzF,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,KAAK,cAAc,mBAAmB,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** True when `candidate` is a stable release strictly newer than `current`. */
2
+ export declare function isNewer(candidate: string, current: string): boolean;
3
+ /** Only for copies started directly: under the supervisor (bin/supervise.cjs) updates are automatic. */
4
+ export declare function startUpdateCheck(pkg: string, current: string, repoUrl: string): void;
5
+ type Sendable = {
6
+ send: (message: any, options?: any) => Promise<void>;
7
+ };
8
+ /** Appends the notice, once, to the first tool result sent after it is known. */
9
+ export declare function attachUpdateNotice<T extends Sendable>(transport: T): T;
10
+ export {};
11
+ //# sourceMappingURL=update-notice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-notice.d.ts","sourceRoot":"","sources":["../src/update-notice.ts"],"names":[],"mappings":"AAgBA,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAQnE;AAMD,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAmBpF;AAED,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAEzE,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,QAAQ,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAWtE"}
@@ -0,0 +1,66 @@
1
+ // Update notice: tells the agent (and so the user) when a newer version is on npm.
2
+ //
3
+ // One GET to https://registry.npmjs.org/<package>/latest, a few seconds after start-up.
4
+ // Nothing about the machine or its use is sent. Turned off by NO_UPDATE_NOTIFIER=1 or CI.
5
+ // The notice is appended once, to the first tool result after a newer version is found.
6
+ const REGISTRY = 'https://registry.npmjs.org';
7
+ let notice = null;
8
+ let delivered = false;
9
+ function parse(v) {
10
+ const m = /^v?(\d+)\.(\d+)\.(\d+)$/.exec(v.trim());
11
+ return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;
12
+ }
13
+ /** True when `candidate` is a stable release strictly newer than `current`. */
14
+ export function isNewer(candidate, current) {
15
+ const a = parse(candidate);
16
+ const b = parse(current);
17
+ if (!a || !b)
18
+ return false;
19
+ for (let i = 0; i < 3; i++) {
20
+ if (a[i] !== b[i])
21
+ return a[i] > b[i];
22
+ }
23
+ return false;
24
+ }
25
+ function howToUpdate(repoUrl) {
26
+ return `This copy was started without the auto-updating launcher (for example node dist/... from a git clone). How to install it so it updates itself: ${repoUrl}#install`;
27
+ }
28
+ /** Only for copies started directly: under the supervisor (bin/supervise.cjs) updates are automatic. */
29
+ export function startUpdateCheck(pkg, current, repoUrl) {
30
+ if (process.env.SOFLUTION_SUPERVISED === '1' || process.env.NO_UPDATE_NOTIFIER || process.env.CI)
31
+ return;
32
+ const timer = setTimeout(async () => {
33
+ try {
34
+ const res = await fetch(`${REGISTRY}/${encodeURIComponent(pkg)}/latest`, {
35
+ headers: { accept: 'application/json' },
36
+ signal: AbortSignal.timeout(5000),
37
+ });
38
+ if (!res.ok)
39
+ return;
40
+ const body = (await res.json());
41
+ const latest = typeof body.version === 'string' ? body.version : '';
42
+ if (!isNewer(latest, current))
43
+ return;
44
+ notice = `[${pkg}] Update available: ${latest} (running ${current}). Tell the user. ${howToUpdate(repoUrl)}`;
45
+ process.stderr.write(`${notice}\n`);
46
+ }
47
+ catch {
48
+ // Offline or registry unreachable: stay quiet.
49
+ }
50
+ }, 3000);
51
+ timer.unref();
52
+ }
53
+ /** Appends the notice, once, to the first tool result sent after it is known. */
54
+ export function attachUpdateNotice(transport) {
55
+ const send = transport.send.bind(transport);
56
+ transport.send = async (message, options) => {
57
+ const content = message?.result?.content;
58
+ if (notice && !delivered && Array.isArray(content)) {
59
+ delivered = true;
60
+ message = { ...message, result: { ...message.result, content: [...content, { type: 'text', text: notice }] } };
61
+ }
62
+ return send(message, options);
63
+ };
64
+ return transport;
65
+ }
66
+ //# sourceMappingURL=update-notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-notice.js","sourceRoot":"","sources":["../src/update-notice.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,EAAE;AACF,wFAAwF;AACxF,0FAA0F;AAC1F,wFAAwF;AAExF,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAE9C,IAAI,MAAM,GAAkB,IAAI,CAAC;AACjC,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,CAAS;IACtB,MAAM,CAAC,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,OAAO,CAAC,SAAiB,EAAE,OAAe;IACxD,MAAM,CAAC,GAAG,KAAK,CAAC,SAA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auditing, live CVE scanning, migration detection & full stack health. 23 tools, 9 languages.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -30,24 +30,25 @@
30
30
  ],
31
31
  "author": "Soflution Ltd",
32
32
  "license": "MIT",
33
- "homepage": "https://github.com/Soflution1/depsonar",
33
+ "homepage": "https://github.com/Soflutionltd/depsonar#readme",
34
34
  "repository": {
35
35
  "type": "git",
36
- "url": "https://github.com/Soflution1/depsonar.git"
36
+ "url": "git+https://github.com/Soflutionltd/depsonar.git"
37
37
  },
38
38
  "bugs": {
39
- "url": "https://github.com/Soflution1/depsonar/issues"
39
+ "url": "https://github.com/Soflutionltd/depsonar/issues"
40
40
  },
41
41
  "type": "module",
42
42
  "main": "dist/index.js",
43
43
  "bin": {
44
- "depsonar": "dist/index.js",
44
+ "depsonar": "bin/supervise.cjs",
45
45
  "depsonar-dashboard": "dist/dashboard.js"
46
46
  },
47
47
  "files": [
48
48
  "dist",
49
49
  "README.md",
50
- "LICENSE"
50
+ "LICENSE",
51
+ "bin"
51
52
  ],
52
53
  "scripts": {
53
54
  "build": "tsc",