voyageai-cli 1.30.0 → 1.30.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.
Files changed (82) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/src/cli.js +8 -0
  4. package/src/commands/about.js +3 -3
  5. package/src/commands/chat.js +32 -11
  6. package/src/commands/code-search.js +751 -0
  7. package/src/commands/doctor.js +1 -1
  8. package/src/commands/export.js +124 -0
  9. package/src/commands/import.js +195 -0
  10. package/src/commands/index-workspace.js +243 -0
  11. package/src/commands/mcp-server.js +113 -3
  12. package/src/commands/playground.js +120 -4
  13. package/src/commands/quickstart.js +4 -4
  14. package/src/commands/workflow.js +132 -65
  15. package/src/lib/catalog.js +4 -2
  16. package/src/lib/code-search.js +315 -0
  17. package/src/lib/codegen.js +1 -1
  18. package/src/lib/explanations.js +3 -3
  19. package/src/lib/export/contexts/benchmark-export.js +27 -0
  20. package/src/lib/export/contexts/chat-export.js +41 -0
  21. package/src/lib/export/contexts/explore-export.js +22 -0
  22. package/src/lib/export/contexts/search-export.js +54 -0
  23. package/src/lib/export/contexts/workflow-export.js +80 -0
  24. package/src/lib/export/formats/clipboard-export.js +29 -0
  25. package/src/lib/export/formats/csv-export.js +45 -0
  26. package/src/lib/export/formats/json-export.js +50 -0
  27. package/src/lib/export/formats/markdown-export.js +189 -0
  28. package/src/lib/export/formats/mermaid-export.js +274 -0
  29. package/src/lib/export/formats/pdf-export.js +117 -0
  30. package/src/lib/export/formats/png-export.js +96 -0
  31. package/src/lib/export/formats/svg-export.js +116 -0
  32. package/src/lib/export/index.js +175 -0
  33. package/src/lib/github.js +226 -0
  34. package/src/lib/template-engine.js +154 -20
  35. package/src/lib/workflow-builder.js +753 -0
  36. package/src/lib/workflow-formatters.js +454 -0
  37. package/src/lib/workflow-input-cache.js +111 -0
  38. package/src/lib/workflow-scaffold.js +1 -1
  39. package/src/lib/workflow.js +297 -28
  40. package/src/mcp/install.js +280 -7
  41. package/src/mcp/schemas/index.js +170 -0
  42. package/src/mcp/server.js +19 -4
  43. package/src/mcp/tools/authoring.js +662 -0
  44. package/src/mcp/tools/code-search.js +620 -0
  45. package/src/mcp/tools/ingest.js +2 -5
  46. package/src/mcp/tools/retrieval.js +2 -15
  47. package/src/mcp/tools/workspace.js +452 -0
  48. package/src/mcp/utils.js +20 -0
  49. package/src/playground/announcements.md +52 -5
  50. package/src/playground/help/workflow-nodes.js +127 -2
  51. package/src/playground/index.html +17109 -12438
  52. package/src/playground/vendor/mermaid.min.js +2811 -0
  53. package/src/workflows/code-review.json +110 -0
  54. package/src/workflows/cost-analysis.json +5 -0
  55. package/src/workflows/rag-chat.json +165 -0
  56. package/src/workflows/tests/code-review.fresh-index.test.json +83 -0
  57. package/src/workflows/tests/code-review.happy-path.test.json +121 -0
  58. package/src/workflows/tests/code-review.no-question.test.json +70 -0
  59. package/src/workflows/tests/consistency-check.happy-path.test.json +28 -0
  60. package/src/workflows/tests/consistency-check.missing-source.test.json +26 -0
  61. package/src/workflows/tests/cost-analysis.happy-path.test.json +28 -0
  62. package/src/workflows/tests/enrich-and-ingest.happy-path.test.json +38 -0
  63. package/src/workflows/tests/enrich-and-ingest.notify-fails.test.json +38 -0
  64. package/src/workflows/tests/intelligent-ingest.all-filtered.test.json +26 -0
  65. package/src/workflows/tests/intelligent-ingest.happy-path.test.json +28 -0
  66. package/src/workflows/tests/kb-health-report.custom-queries.test.json +24 -0
  67. package/src/workflows/tests/kb-health-report.happy-path.test.json +26 -0
  68. package/src/workflows/tests/multi-collection-search.happy-path.test.json +40 -0
  69. package/src/workflows/tests/multi-collection-search.one-empty.test.json +28 -0
  70. package/src/workflows/tests/rag-chat.happy-path.test.json +26 -0
  71. package/src/workflows/tests/rag-chat.no-relevant-results.test.json +25 -0
  72. package/src/workflows/tests/research-and-summarize.happy-path.test.json +33 -0
  73. package/src/workflows/tests/research-and-summarize.no-results.test.json +29 -0
  74. package/src/workflows/tests/search-with-fallback.empty-both.test.json +24 -0
  75. package/src/workflows/tests/search-with-fallback.fallback-branch.test.json +24 -0
  76. package/src/workflows/tests/search-with-fallback.happy-path.test.json +27 -0
  77. package/src/workflows/tests/smart-ingest.duplicate-detected.test.json +34 -0
  78. package/src/workflows/tests/smart-ingest.happy-path.test.json +31 -0
  79. package/src/playground/assets/announcements/appstore.jpg +0 -0
  80. package/src/playground/assets/announcements/circuits.jpg +0 -0
  81. package/src/playground/assets/announcements/csvingest.jpg +0 -0
  82. package/src/playground/assets/announcements/green-wave.jpg +0 -0
package/README.md CHANGED
@@ -18,11 +18,11 @@ Voyage AI provides **state-of-the-art embedding models** with the best quality-t
18
18
 
19
19
  | Advantage | What It Means |
20
20
  |-----------|---------------|
21
- | **🎯 #1 on MTEB** | Voyage-3 ranks first on retrieval benchmarks, outperforming OpenAI, Cohere, and other providers |
22
- | **💰 Up to 83% Cost Savings** | Asymmetric retrieval: embed docs with `voyage-3-lite`, query with `voyage-3-large` same quality, fraction of the cost |
23
- | **🔗 Shared Embedding Space** | All Voyage-3 models produce compatible embeddings mix and match for optimal cost-quality tradeoffs |
21
+ | **🎯 #1 on RTEB** | Voyage 4 ranks first on retrieval benchmarks, outperforming OpenAI, Cohere, and other providers |
22
+ | **💰 Up to 83% Cost Savings** | Asymmetric retrieval: embed docs with `voyage-4-lite`, query with `voyage-4-large`, same quality, fraction of the cost |
23
+ | **🔗 Shared Embedding Space** | All Voyage 4 models produce compatible embeddings, so you can mix and match for optimal cost-quality tradeoffs |
24
24
  | **🏢 Domain-Specific Models** | Specialized models for code, finance, law, and multilingual content that beat general-purpose alternatives |
25
- | **⚡ Two-Stage Retrieval** | Rerank-2 boosts search precision by re-scoring candidates with a powerful cross-encoder |
25
+ | **⚡ Two-Stage Retrieval** | Rerank-2.5 boosts search precision by re-scoring candidates with a powerful cross-encoder |
26
26
 
27
27
  **Get started:**
28
28
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voyageai-cli",
3
- "version": "1.30.0",
3
+ "version": "1.30.2",
4
4
  "description": "CLI for Voyage AI embeddings, reranking, and MongoDB Atlas Vector Search",
5
5
  "bin": {
6
6
  "vai": "./src/cli.js"
package/src/cli.js CHANGED
@@ -38,6 +38,10 @@ const { registerBug } = require('./commands/bug');
38
38
  const { registerChat } = require('./commands/chat');
39
39
  const { registerMcpServer } = require('./commands/mcp-server');
40
40
  const { registerWorkflow } = require('./commands/workflow');
41
+ const { registerIndexWorkspace } = require('./commands/index-workspace');
42
+ const { registerExport } = require('./commands/export');
43
+ const { registerImport } = require('./commands/import');
44
+ const { registerCodeSearch } = require('./commands/code-search');
41
45
  const { showBanner, showQuickStart, getVersion } = require('./lib/banner');
42
46
 
43
47
  const version = getVersion();
@@ -80,6 +84,10 @@ registerBug(program);
80
84
  registerChat(program);
81
85
  registerMcpServer(program);
82
86
  registerWorkflow(program);
87
+ registerIndexWorkspace(program);
88
+ registerExport(program);
89
+ registerImport(program);
90
+ registerCodeSearch(program);
83
91
 
84
92
  // Append disclaimer to all help output
85
93
  program.addHelpText('after', `
@@ -64,10 +64,10 @@ function registerAbout(program) {
64
64
  console.log('');
65
65
  console.log(` ${pc.cyan('💰 Best Value')}`);
66
66
  console.log(` Up to 83% cost reduction with asymmetric retrieval: embed`);
67
- console.log(` documents with voyage-3-lite, query with voyage-3-large.`);
67
+ console.log(` documents with voyage-4-lite, query with voyage-4-large.`);
68
68
  console.log('');
69
69
  console.log(` ${pc.cyan('🔗 Shared Embedding Space')}`);
70
- console.log(` All Voyage-3 models share the same embedding space mix`);
70
+ console.log(` All Voyage 4 models share the same embedding space, so you can mix`);
71
71
  console.log(` and match models for optimal cost-quality tradeoffs.`);
72
72
  console.log('');
73
73
  console.log(` ${pc.cyan('🏢 Domain-Specific Models')}`);
@@ -75,7 +75,7 @@ function registerAbout(program) {
75
75
  console.log(` content that outperform general-purpose alternatives.`);
76
76
  console.log('');
77
77
  console.log(` ${pc.cyan('⚡ Reranking')}`);
78
- console.log(` Two-stage retrieval with rerank-2 boosts precision by`);
78
+ console.log(` Two-stage retrieval with rerank-2.5 boosts precision by`);
79
79
  console.log(` re-scoring candidates with a powerful cross-encoder.`);
80
80
  console.log('');
81
81
 
@@ -499,7 +499,7 @@ async function handleSlashCommand(input, ctx) {
499
499
  console.log(' /context Show retrieved context from last query');
500
500
  console.log(' /clear Clear conversation history');
501
501
  console.log(' /model Show or switch LLM model (/model <name>)');
502
- console.log(' /export Export conversation (markdown or json)');
502
+ console.log(' /export [format] [file] Export conversation (markdown, json, pdf)');
503
503
  if (isAgent) {
504
504
  console.log(' /tools Show tool calls from last response');
505
505
  console.log(' /export-workflow Export last tool sequence as workflow');
@@ -613,17 +613,38 @@ async function handleSlashCommand(input, ctx) {
613
613
  }
614
614
 
615
615
  case '/export': {
616
- const format = parts[1] || 'md';
617
- if (format === 'json') {
618
- const data = history.exportJSON();
619
- const filename = `chat-${history.sessionId.slice(0, 8)}.json`;
620
- fs.writeFileSync(filename, JSON.stringify(data, null, 2) + '\n');
621
- console.log(ui.success(`Exported to ${filename}`));
622
- } else {
623
- const md = history.exportMarkdown();
624
- const filename = `chat-${history.sessionId.slice(0, 8)}.md`;
625
- fs.writeFileSync(filename, md);
616
+ const format = parts[1] || 'markdown';
617
+ const outFile = parts[2] || null;
618
+ const validFormats = ['json', 'markdown', 'md', 'pdf'];
619
+
620
+ if (!validFormats.includes(format)) {
621
+ console.log(pc.dim(` Unknown format: ${format}. Use: ${validFormats.join(', ')}`));
622
+ return true;
623
+ }
624
+
625
+ try {
626
+ const { exportArtifact } = require('../lib/export');
627
+ const chatData = history.exportJSON();
628
+ const effectiveFormat = format === 'md' ? 'markdown' : format;
629
+
630
+ const result = await exportArtifact({
631
+ context: 'chat',
632
+ format: effectiveFormat,
633
+ data: chatData,
634
+ options: {},
635
+ });
636
+
637
+ const isBinary = Buffer.isBuffer(result.content);
638
+ const filename = outFile || result.suggestedFilename;
639
+
640
+ if (isBinary) {
641
+ fs.writeFileSync(filename, result.content);
642
+ } else {
643
+ fs.writeFileSync(filename, result.content, 'utf-8');
644
+ }
626
645
  console.log(ui.success(`Exported to ${filename}`));
646
+ } catch (err) {
647
+ console.log(pc.red(` Export failed: ${err.message}`));
627
648
  }
628
649
  return true;
629
650
  }