voyageai-cli 1.27.0 → 1.29.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voyageai-cli",
3
- "version": "1.27.0",
3
+ "version": "1.29.0",
4
4
  "description": "CLI for Voyage AI embeddings, reranking, and MongoDB Atlas Vector Search",
5
5
  "bin": {
6
6
  "vai": "./src/cli.js"
@@ -42,6 +42,7 @@
42
42
  "dependencies": {
43
43
  "@clack/prompts": "^1.0.0",
44
44
  "@modelcontextprotocol/sdk": "^1.26.0",
45
+ "@vaicli/vai-workflow-model-shootout": "^1.0.0",
45
46
  "commander": "^12.0.0",
46
47
  "dotenv": "^17.2.3",
47
48
  "mongodb": "^6.0.0",
@@ -138,6 +138,21 @@ function registerApp(program) {
138
138
  const electronPkg = path.join(electronDir, 'package.json');
139
139
 
140
140
  if (!fs.existsSync(electronPkg)) {
141
+ // Check for system-installed Vai.app on macOS
142
+ if (process.platform === 'darwin') {
143
+ const appPaths = [
144
+ '/Applications/Vai.app',
145
+ path.join(process.env.HOME || '', 'Applications', 'Vai.app'),
146
+ ];
147
+ const installed = appPaths.find((p) => fs.existsSync(p));
148
+ if (installed) {
149
+ console.log('🧭 Launching Vai desktop app...');
150
+ spawn('open', ['-a', installed], { stdio: 'ignore', detached: true }).unref();
151
+ setTimeout(() => process.exit(0), 500);
152
+ return;
153
+ }
154
+ }
155
+
141
156
  console.log('');
142
157
  console.log('🖥️ The Vai desktop app is not installed locally.');
143
158
  console.log('');
@@ -67,6 +67,39 @@ function registerConfig(program) {
67
67
  const storedValue = key === 'default-dimensions' ? parseInt(value, 10) : value;
68
68
  setConfigValue(internalKey, storedValue);
69
69
  console.log(ui.success(`Set ${ui.cyan(key)} = ${SECRET_KEYS.has(internalKey) ? ui.dim(maskSecret(String(storedValue))) : storedValue}`));
70
+
71
+ // When setting an API key, auto-configure the matching base URL
72
+ if (internalKey === 'apiKey') {
73
+ const { identifyKey, ATLAS_API_BASE, VOYAGE_API_BASE } = require('../lib/api');
74
+ const keyInfo = identifyKey(storedValue);
75
+ const currentBase = getConfigValue('baseUrl');
76
+
77
+ if (keyInfo.type === 'atlas') {
78
+ if (currentBase !== ATLAS_API_BASE) {
79
+ setConfigValue('baseUrl', ATLAS_API_BASE);
80
+ console.log('');
81
+ console.log(ui.success(`Auto-configured base URL → ${ui.cyan(ATLAS_API_BASE)}`));
82
+ }
83
+ console.log('');
84
+ console.log(` 🔑 ${ui.bold('MongoDB Atlas key detected')} (al-*)`);
85
+ console.log(` Endpoint: ${ui.cyan(ATLAS_API_BASE)}`);
86
+ console.log(` Atlas provides Voyage AI models with Atlas-native billing.`);
87
+ console.log(` All vai features work identically on both endpoints.`);
88
+ } else if (keyInfo.type === 'voyage') {
89
+ if (currentBase !== VOYAGE_API_BASE) {
90
+ setConfigValue('baseUrl', VOYAGE_API_BASE);
91
+ console.log('');
92
+ console.log(ui.success(`Auto-configured base URL → ${ui.cyan(VOYAGE_API_BASE)}`));
93
+ }
94
+ console.log('');
95
+ console.log(` 🔑 ${ui.bold('Voyage AI key detected')} (pa-*)`);
96
+ console.log(` Endpoint: ${ui.cyan(VOYAGE_API_BASE)}`);
97
+ } else {
98
+ console.log('');
99
+ console.log(` ⚠️ Unrecognized key prefix. Expected ${ui.cyan('al-*')} (Atlas) or ${ui.cyan('pa-*')} (Voyage AI).`);
100
+ console.log(` Make sure your base URL matches: ${ui.cyan('vai config set base-url <url>')}`);
101
+ }
102
+ }
70
103
  });
71
104
 
72
105
  // ── config get [key] ──
@@ -14,6 +14,7 @@ function registerMcpServer(program) {
14
14
  .option('--host <address>', 'Bind address (http transport only)', '127.0.0.1')
15
15
  .option('--db <name>', 'Default MongoDB database for tools')
16
16
  .option('--collection <name>', 'Default collection for tools')
17
+ .option('--no-sse', 'Disable SSE transport (SSE is enabled by default for HTTP)')
17
18
  .option('--verbose', 'Enable debug logging to stderr')
18
19
  .action(async (opts) => {
19
20
  if (opts.verbose) {
@@ -27,7 +28,9 @@ function registerMcpServer(program) {
27
28
  const { runStdioServer, runHttpServer } = require('../mcp/server');
28
29
 
29
30
  if (opts.transport === 'http') {
30
- await runHttpServer({ port: opts.port, host: opts.host });
31
+ // SSE is enabled by default for HTTP transport (required for n8n, etc.)
32
+ // Use --no-sse to disable if needed
33
+ await runHttpServer({ port: opts.port, host: opts.host, sse: opts.sse !== false });
31
34
  } else if (opts.transport === 'stdio') {
32
35
  await runStdioServer();
33
36
  } else {