@velaro/mcp-server 2.0.148 → 2.0.150
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 +2 -0
- package/chat-window-style.js +43 -0
- package/package.json +2 -1
- package/parity/moshky-guide.customer.js +11 -0
- package/server.js +10856 -10761
- package/tool-annotations.js +2 -2
- package/toolsets.js +1 -1
- package/update-check.js +84 -0
package/tool-annotations.js
CHANGED
|
@@ -29,7 +29,7 @@ const MUTATING = new Set([
|
|
|
29
29
|
'billing_insights_set_preferences', 'billing_insights_dismiss_recommendation',
|
|
30
30
|
'site_sale_create', 'site_sale_update', 'site_sale_end',
|
|
31
31
|
'service_state_set_policy', 'service_state_release_hold', 'service_state_voice_flow_setup',
|
|
32
|
-
'integration_config_restore',
|
|
32
|
+
'integration_config_restore', 'voice_agent_test_call',
|
|
33
33
|
]);
|
|
34
34
|
|
|
35
35
|
// Names that look like writes but only read (checked before the write rules).
|
|
@@ -93,7 +93,7 @@ const OPEN_WORLD_PREFIXES = [
|
|
|
93
93
|
'outlook', 'ms_bookings', 'shopify', 'magento', 'netsuite', 'monday', 'notion', 'teams', 'slack',
|
|
94
94
|
'webflow', 'klaviyo', 'callrail', 'copilot_studio', 'scraper', 'apple', 'jobboard', 'recruiting',
|
|
95
95
|
'payment_recovery', 'pickup_notify', 'telephony', 'business_action', 'campaign_sender_auth',
|
|
96
|
-
'ivr_update_line',
|
|
96
|
+
'ivr_update_line', 'voice_agent',
|
|
97
97
|
];
|
|
98
98
|
|
|
99
99
|
const ACRONYMS = {
|
package/toolsets.js
CHANGED
|
@@ -34,7 +34,7 @@ const GROUPS = {
|
|
|
34
34
|
'jobboard', 'teams', 'netsuite', 'magento', 'woocommerce', 'shopify', 'bigcommerce', 'apple', 'monday', 'dynamics',
|
|
35
35
|
'zoom', 'notion', 'klaviyo', 'outlook', 'slack', 'webflow', 'squarespace', 'callrail', 'recruiting', 'product',
|
|
36
36
|
'commerce', 'pickup', 'ms', 'linked', 'part', 'acuity', 'calendly', 'telephony', 'livefluence', 'sitesync',
|
|
37
|
-
'code', 'mobile', 'copilot_studio', 'sse', 'missed', 'page_widget',
|
|
37
|
+
'code', 'mobile', 'copilot_studio', 'voice_agent', 'sse', 'missed', 'page_widget',
|
|
38
38
|
],
|
|
39
39
|
};
|
|
40
40
|
const GROUP_NAMES = [...Object.keys(GROUPS), 'misc'];
|
package/update-check.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Update notice for the self-hosted MCP server (npx @velaro/mcp-server). Once a day it asks the npm registry
|
|
2
|
+
// for the latest version (cached in ~/.velaro/mcp-update.json); when a newer one exists it tells the user
|
|
3
|
+
// (stderr line, the server instructions the assistant reads, and the first tool result), and a global install
|
|
4
|
+
// updates itself in the background. npx cache runs only get the notice (npx reuses its cache until told otherwise).
|
|
5
|
+
// Never blocks start-up and never throws: a registry failure is silent and the server runs as before.
|
|
6
|
+
// Opt out: VELARO_MCP_NO_UPDATE_CHECK=1 (no check) or VELARO_NO_AUTO_UPDATE=1 (notice only, no install).
|
|
7
|
+
import { readFileSync, writeFileSync, mkdirSync, realpathSync } from 'node:fs';
|
|
8
|
+
import { homedir } from 'node:os';
|
|
9
|
+
import { join, dirname } from 'node:path';
|
|
10
|
+
import { spawn } from 'node:child_process';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
|
|
13
|
+
const REGISTRY = 'https://registry.npmjs.org/@velaro/mcp-server/latest';
|
|
14
|
+
export const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
15
|
+
const CACHE = join(homedir(), '.velaro', 'mcp-update.json');
|
|
16
|
+
|
|
17
|
+
export function isNewer(a, b) {
|
|
18
|
+
const pa = String(a).split('.').map(Number);
|
|
19
|
+
const pb = String(b).split('.').map(Number);
|
|
20
|
+
for (let i = 0; i < 3; i++) {
|
|
21
|
+
if ((pa[i] || 0) > (pb[i] || 0)) return true;
|
|
22
|
+
if ((pa[i] || 0) < (pb[i] || 0)) return false;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function installKind(modulePath) {
|
|
28
|
+
let p = modulePath;
|
|
29
|
+
try { p = realpathSync(modulePath); } catch { /* keep as given */ }
|
|
30
|
+
if (/[\\/]_npx[\\/]/.test(p)) return 'npx';
|
|
31
|
+
if (/[\\/]node_modules[\\/]@velaro[\\/]mcp-server[\\/]/.test(p)) return 'global';
|
|
32
|
+
return 'checkout';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function buildNotice(current, latest, kind, autoUpdating = false) {
|
|
36
|
+
if (!latest || !isNewer(latest, current)) return null;
|
|
37
|
+
const head = `Velaro MCP server ${current} is out of date (latest ${latest}).`;
|
|
38
|
+
if (autoUpdating) return `${head} Updating in the background; restart your MCP client to use ${latest}. Set VELARO_NO_AUTO_UPDATE=1 to turn this off.`;
|
|
39
|
+
if (kind === 'npx') return `${head} Point your MCP client at "npx -y @velaro/mcp-server@latest" and restart it.`;
|
|
40
|
+
if (kind === 'global') return `${head} Run: npm install -g @velaro/mcp-server@latest, then restart your MCP client.`;
|
|
41
|
+
return `${head} This is a dev checkout: git pull in velaro-admin/mcp.`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readCache(path) {
|
|
45
|
+
try { return JSON.parse(readFileSync(path, 'utf8')); } catch { return {}; }
|
|
46
|
+
}
|
|
47
|
+
function writeCache(path, v) {
|
|
48
|
+
try { mkdirSync(dirname(path), { recursive: true }); writeFileSync(path, JSON.stringify(v)); } catch { /* cache is optional */ }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Returns { notice, refresh, kind } immediately. `notice` comes from the cached last check (null when current or unknown);
|
|
53
|
+
* `refresh` is a promise for the registry call that updates the cache (resolves to the latest version or null).
|
|
54
|
+
*/
|
|
55
|
+
export function startMcpUpdateCheck({ currentVersion, modulePath = fileURLToPath(import.meta.url), env = process.env, cachePath = CACHE, fetchImpl = fetch, now = Date.now(), spawnImpl = spawn } = {}) {
|
|
56
|
+
if (env.VELARO_MCP_NO_UPDATE_CHECK) return { notice: null, refresh: Promise.resolve(null), kind: 'off' };
|
|
57
|
+
const kind = installKind(modulePath);
|
|
58
|
+
const cache = readCache(cachePath);
|
|
59
|
+
const auto = kind === 'global' && !env.VELARO_NO_AUTO_UPDATE && !env.CI;
|
|
60
|
+
let autoStarted = false;
|
|
61
|
+
const maybeAuto = (latest) => {
|
|
62
|
+
if (!auto || autoStarted || !latest || !isNewer(latest, currentVersion) || readCache(cachePath)._autoTried === latest) return false;
|
|
63
|
+
try {
|
|
64
|
+
const child = spawnImpl(process.platform === 'win32' ? 'npm.cmd' : 'npm', ['install', '-g', '@velaro/mcp-server@latest'], { detached: true, stdio: 'ignore', shell: process.platform === 'win32' });
|
|
65
|
+
child.on?.('error', () => {});
|
|
66
|
+
child.unref?.();
|
|
67
|
+
writeCache(cachePath, { ...readCache(cachePath), _autoTried: latest });
|
|
68
|
+
autoStarted = true;
|
|
69
|
+
return true;
|
|
70
|
+
} catch { return false; }
|
|
71
|
+
};
|
|
72
|
+
const fresh = now - (cache.checkedAt || 0) < CHECK_INTERVAL_MS;
|
|
73
|
+
const started = maybeAuto(cache.latest);
|
|
74
|
+
const notice = buildNotice(currentVersion, cache.latest, kind, started);
|
|
75
|
+
const refresh = fresh ? Promise.resolve(cache.latest ?? null) : (async () => {
|
|
76
|
+
try {
|
|
77
|
+
const r = await fetchImpl(REGISTRY, { signal: AbortSignal.timeout(4000) });
|
|
78
|
+
const latest = (await r.json())?.version ?? null;
|
|
79
|
+
if (latest) { writeCache(cachePath, { ...readCache(cachePath), checkedAt: now, latest }); maybeAuto(latest); }
|
|
80
|
+
return latest;
|
|
81
|
+
} catch { return null; }
|
|
82
|
+
})();
|
|
83
|
+
return { notice, refresh, kind };
|
|
84
|
+
}
|