@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 CHANGED
@@ -290,6 +290,8 @@ Claude handles these operations natively. No exports, no copy-paste, no waiting
290
290
 
291
291
  This package is automatically published to npm on every Velaro production deploy. When Velaro ships new tools or improves existing ones, your next `npx` invocation pulls the latest version automatically. You don't need to update a package.json or run `npm install`.
292
292
 
293
+ The server also checks npm once a day. If your copy is behind, it says so three ways: a line on stderr, a note the assistant reads at start-up (so it can tell you), and a one-time note on the first tool result. A global install (`npm install -g @velaro/mcp-server`) updates itself in the background and asks you to restart your MCP client. An `npx` setup shows the notice and the fix: use `npx -y @velaro/mcp-server@latest` in your client config so every start pulls the newest version. Set `VELARO_NO_AUTO_UPDATE=1` to keep the notice but skip the self-update, or `VELARO_MCP_NO_UPDATE_CHECK=1` to turn the check off.
294
+
293
295
  If you want a pinned version for reproducible environments:
294
296
  ```bash
295
297
  npx @velaro/mcp-server@0.1.0
@@ -51,3 +51,46 @@ export function buildEmailTranscriptUpdateFields(current, value) {
51
51
  languageConfig: JSON.stringify(current.languageConfig ?? {}),
52
52
  };
53
53
  }
54
+
55
+ // Message-form buttons (MessengerStyleConfig.EnableEmojiButton / EmojiButtonPosition / EnableUploadButton).
56
+ // Defaults: emoji on, upload on, emoji position "left" (additive buttons in the left group, Send alone on the right).
57
+ export const BUTTON_POSITIONS = ['left', 'right'];
58
+
59
+ /** Returns true | false. Throws on anything else. */
60
+ export function normalizeOnOff(raw, name) {
61
+ if (typeof raw === 'boolean') return raw;
62
+ const v = String(raw ?? '').trim().toLowerCase();
63
+ if (['on', 'true', 'yes', '1'].includes(v)) return true;
64
+ if (['off', 'false', 'no', '0'].includes(v)) return false;
65
+ throw new Error(`${name} must be on or off.`);
66
+ }
67
+
68
+ /** Returns 'left' | 'right'. Throws on anything else. */
69
+ export function normalizeButtonPosition(raw) {
70
+ const v = String(raw ?? '').trim().toLowerCase();
71
+ if (!BUTTON_POSITIONS.includes(v)) throw new Error('emojiButtonPosition must be "left" (with the attach button, default) or "right" (beside Send).');
72
+ return v;
73
+ }
74
+
75
+ /** Fields of the update form with only the given button options changed. Pass undefined to leave one alone. */
76
+ export function buildButtonOptionsUpdateFields(current, { emoji, emojiPosition, upload } = {}) {
77
+ if (!current || typeof current !== 'object') throw new Error('chat window not found');
78
+ if (emoji === undefined && emojiPosition === undefined && upload === undefined) throw new Error('Pass at least one of emoji, emojiPosition, upload.');
79
+ const styleConfig = { ...(current.styleConfig ?? {}) };
80
+ if (emoji !== undefined) styleConfig.enableEmojiButton = normalizeOnOff(emoji, 'enableEmojiButton');
81
+ if (emojiPosition !== undefined) styleConfig.emojiButtonPosition = normalizeButtonPosition(emojiPosition);
82
+ if (upload !== undefined) styleConfig.enableUploadButton = normalizeOnOff(upload, 'enableUploadButton');
83
+ return {
84
+ name: current.name ?? '',
85
+ styleConfig: JSON.stringify(styleConfig),
86
+ languageConfig: JSON.stringify(current.languageConfig ?? {}),
87
+ };
88
+ }
89
+
90
+ // Moshky's chat-window walkthrough: every question is ASKED, never silently defaulted.
91
+ export const CHAT_WINDOW_WALKTHROUGH = [
92
+ { key: 'emoji', ask: 'Show the emoji button in the message box?', options: ['on', 'off'], default: 'on', setting: 'enableEmojiButton' },
93
+ { key: 'emojiPosition', ask: 'Where should the emoji button sit: with the attach button on the left, or beside Send on the right?', options: ['left', 'right'], default: 'left', setting: 'emojiButtonPosition' },
94
+ { key: 'upload', ask: 'Let visitors send files and photos (attach button)?', options: ['on', 'off'], default: 'on', setting: 'enableUploadButton' },
95
+ { key: 'emailTranscript', ask: 'Let visitors email themselves a transcript?', options: ['on', 'off'], default: 'on', setting: 'enableEmailTranscriptButton' },
96
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/mcp-server",
3
- "version": "2.0.148",
3
+ "version": "2.0.150",
4
4
  "description": "Velaro MCP server — connect Claude and other AI agents directly to your Velaro account: KB, workflows, bots, conversations, contacts, routing, and more.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,6 +46,7 @@
46
46
  "server.js",
47
47
  "tool-annotations.js",
48
48
  "fetch-retry.js",
49
+ "update-check.js",
49
50
  "messaging-base.js",
50
51
  "gateway-routing.js",
51
52
  "survey-email.js",
@@ -26,6 +26,8 @@ async function askMoshky(ctx, messages, context) {
26
26
  return String(reply);
27
27
  }
28
28
 
29
+ import { CHAT_WINDOW_WALKTHROUGH } from '../chat-window-style.js';
30
+
29
31
  export const tools = [
30
32
  {
31
33
  name: 'velaro_guide',
@@ -46,9 +48,18 @@ export const tools = [
46
48
  required: ['question'],
47
49
  },
48
50
  },
51
+ {
52
+ name: 'moshky_walkthrough',
53
+ description: 'Moshky guided walkthrough. topic "chat-window" returns the questions to ASK the user (emoji button, emoji position, send files/upload, email transcript) with defaults on. Ask every one; do not silently default. Then apply the answers with chat_window_set_buttons and chat_window_set_email_transcript, or use moshky_ask to have Moshky propose the change.',
54
+ inputSchema: { type: 'object', properties: { topic: { type: 'string', enum: ['chat-window'] } }, required: ['topic'] },
55
+ },
49
56
  ];
50
57
 
51
58
  export const handlers = {
59
+ moshky_walkthrough: async (a) => {
60
+ if (a.topic !== 'chat-window') throw new Error('topic must be "chat-window"');
61
+ return JSON.stringify({ instructions: 'Ask the user each question, then apply with chat_window_set_buttons (emoji, emojiPosition, upload) and chat_window_set_email_transcript.', questions: CHAT_WINDOW_WALKTHROUGH }, null, 2);
62
+ },
52
63
  velaro_guide: async (a, ctx) => {
53
64
  if (!a.goal || !String(a.goal).trim()) throw new Error('goal is required');
54
65
  const prompt = `An MCP client (an AI assistant) wants to: ${String(a.goal).trim()}. Reply with the recommended ordered setup steps from the Velaro skills library, naming the exact MCP tool for each step, and what to check first. Do not change anything.`;