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.
- package/README.md +4 -4
- package/package.json +1 -1
- package/src/cli.js +8 -0
- package/src/commands/about.js +3 -3
- package/src/commands/chat.js +32 -11
- package/src/commands/code-search.js +751 -0
- package/src/commands/doctor.js +1 -1
- package/src/commands/export.js +124 -0
- package/src/commands/import.js +195 -0
- package/src/commands/index-workspace.js +243 -0
- package/src/commands/mcp-server.js +113 -3
- package/src/commands/playground.js +120 -4
- package/src/commands/quickstart.js +4 -4
- package/src/commands/workflow.js +132 -65
- package/src/lib/catalog.js +4 -2
- package/src/lib/code-search.js +315 -0
- package/src/lib/codegen.js +1 -1
- package/src/lib/explanations.js +3 -3
- package/src/lib/export/contexts/benchmark-export.js +27 -0
- package/src/lib/export/contexts/chat-export.js +41 -0
- package/src/lib/export/contexts/explore-export.js +22 -0
- package/src/lib/export/contexts/search-export.js +54 -0
- package/src/lib/export/contexts/workflow-export.js +80 -0
- package/src/lib/export/formats/clipboard-export.js +29 -0
- package/src/lib/export/formats/csv-export.js +45 -0
- package/src/lib/export/formats/json-export.js +50 -0
- package/src/lib/export/formats/markdown-export.js +189 -0
- package/src/lib/export/formats/mermaid-export.js +274 -0
- package/src/lib/export/formats/pdf-export.js +117 -0
- package/src/lib/export/formats/png-export.js +96 -0
- package/src/lib/export/formats/svg-export.js +116 -0
- package/src/lib/export/index.js +175 -0
- package/src/lib/github.js +226 -0
- package/src/lib/template-engine.js +154 -20
- package/src/lib/workflow-builder.js +753 -0
- package/src/lib/workflow-formatters.js +454 -0
- package/src/lib/workflow-input-cache.js +111 -0
- package/src/lib/workflow-scaffold.js +1 -1
- package/src/lib/workflow.js +297 -28
- package/src/mcp/install.js +280 -7
- package/src/mcp/schemas/index.js +170 -0
- package/src/mcp/server.js +19 -4
- package/src/mcp/tools/authoring.js +662 -0
- package/src/mcp/tools/code-search.js +620 -0
- package/src/mcp/tools/ingest.js +2 -5
- package/src/mcp/tools/retrieval.js +2 -15
- package/src/mcp/tools/workspace.js +452 -0
- package/src/mcp/utils.js +20 -0
- package/src/playground/announcements.md +52 -5
- package/src/playground/help/workflow-nodes.js +127 -2
- package/src/playground/index.html +17109 -12438
- package/src/playground/vendor/mermaid.min.js +2811 -0
- package/src/workflows/code-review.json +110 -0
- package/src/workflows/cost-analysis.json +5 -0
- package/src/workflows/rag-chat.json +165 -0
- package/src/workflows/tests/code-review.fresh-index.test.json +83 -0
- package/src/workflows/tests/code-review.happy-path.test.json +121 -0
- package/src/workflows/tests/code-review.no-question.test.json +70 -0
- package/src/workflows/tests/consistency-check.happy-path.test.json +28 -0
- package/src/workflows/tests/consistency-check.missing-source.test.json +26 -0
- package/src/workflows/tests/cost-analysis.happy-path.test.json +28 -0
- package/src/workflows/tests/enrich-and-ingest.happy-path.test.json +38 -0
- package/src/workflows/tests/enrich-and-ingest.notify-fails.test.json +38 -0
- package/src/workflows/tests/intelligent-ingest.all-filtered.test.json +26 -0
- package/src/workflows/tests/intelligent-ingest.happy-path.test.json +28 -0
- package/src/workflows/tests/kb-health-report.custom-queries.test.json +24 -0
- package/src/workflows/tests/kb-health-report.happy-path.test.json +26 -0
- package/src/workflows/tests/multi-collection-search.happy-path.test.json +40 -0
- package/src/workflows/tests/multi-collection-search.one-empty.test.json +28 -0
- package/src/workflows/tests/rag-chat.happy-path.test.json +26 -0
- package/src/workflows/tests/rag-chat.no-relevant-results.test.json +25 -0
- package/src/workflows/tests/research-and-summarize.happy-path.test.json +33 -0
- package/src/workflows/tests/research-and-summarize.no-results.test.json +29 -0
- package/src/workflows/tests/search-with-fallback.empty-both.test.json +24 -0
- package/src/workflows/tests/search-with-fallback.fallback-branch.test.json +24 -0
- package/src/workflows/tests/search-with-fallback.happy-path.test.json +27 -0
- package/src/workflows/tests/smart-ingest.duplicate-detected.test.json +34 -0
- package/src/workflows/tests/smart-ingest.happy-path.test.json +31 -0
- package/src/playground/assets/announcements/appstore.jpg +0 -0
- package/src/playground/assets/announcements/circuits.jpg +0 -0
- package/src/playground/assets/announcements/csvingest.jpg +0 -0
- package/src/playground/assets/announcements/green-wave.jpg +0 -0
|
@@ -111,7 +111,7 @@ module.exports = {
|
|
|
111
111
|
'Sends the input text to the Voyage AI embeddings API, which returns a high-dimensional vector representation. The vector captures the semantic meaning of the text and can be used for similarity comparisons, clustering, or storage.',
|
|
112
112
|
inputs: [
|
|
113
113
|
{ key: 'text', type: 'string', required: true, desc: 'The text to embed.' },
|
|
114
|
-
{ key: 'model', type: 'string', required: false, desc: 'Voyage AI embedding model (default: voyage-
|
|
114
|
+
{ key: 'model', type: 'string', required: false, desc: 'Voyage AI embedding model (default: voyage-4-large).' },
|
|
115
115
|
{ key: 'inputType', type: 'string', required: false, desc: 'Whether this text is a "document" or a "query". Affects embedding optimization.' },
|
|
116
116
|
],
|
|
117
117
|
outputs: [
|
|
@@ -121,7 +121,7 @@ module.exports = {
|
|
|
121
121
|
],
|
|
122
122
|
tips: [
|
|
123
123
|
'Set inputType to "query" for search queries and "document" for content being indexed. This optimizes the embedding for its intended use.',
|
|
124
|
-
'Use voyage-
|
|
124
|
+
'Use voyage-4-large for highest quality, voyage-4-lite for lower latency and cost.',
|
|
125
125
|
'Embeddings from different models are not comparable. Always use the same model for queries and documents.',
|
|
126
126
|
],
|
|
127
127
|
},
|
|
@@ -469,4 +469,129 @@ module.exports = {
|
|
|
469
469
|
'Response size is limited to 5MB. For large payloads, use streaming or pagination on the external API.',
|
|
470
470
|
],
|
|
471
471
|
},
|
|
472
|
+
|
|
473
|
+
// ── Code Search ──
|
|
474
|
+
|
|
475
|
+
code_index: {
|
|
476
|
+
description:
|
|
477
|
+
'Index a local directory or GitHub repository for semantic code search. Uses voyage-code-3 by default for code-optimized embeddings.',
|
|
478
|
+
howItWorks:
|
|
479
|
+
'Scans the target codebase for source files, splits them into chunks using language-aware boundary detection (function/class boundaries), generates embeddings with voyage-code-3, and stores the chunks in MongoDB Atlas with a vector search index.',
|
|
480
|
+
inputs: [
|
|
481
|
+
{ key: 'source', type: 'string', required: true, desc: 'Local directory path or GitHub repo URL (e.g., "/path/to/project" or "https://github.com/org/repo").' },
|
|
482
|
+
{ key: 'db', type: 'string', required: false, desc: 'MongoDB database name. Default: "vai_code_search".' },
|
|
483
|
+
{ key: 'collection', type: 'string', required: false, desc: 'Collection name. Auto-derived from project name if omitted.' },
|
|
484
|
+
{ key: 'refresh', type: 'boolean', required: false, desc: 'If true, only re-index changed files (incremental). Default: false.' },
|
|
485
|
+
{ key: 'model', type: 'string', required: false, desc: 'Embedding model. Default: voyage-code-3 for code, voyage-4-large for docs.' },
|
|
486
|
+
{ key: 'branch', type: 'string', required: false, desc: 'Git branch for remote repos. Default: "main".' },
|
|
487
|
+
{ key: 'maxFiles', type: 'number', required: false, desc: 'Maximum files to index. Default: 5000.' },
|
|
488
|
+
{ key: 'chunkSize', type: 'number', required: false, desc: 'Target chunk size in characters. Default: 512.' },
|
|
489
|
+
],
|
|
490
|
+
outputs: [
|
|
491
|
+
{ key: 'filesFound', type: 'number', desc: 'Total source files discovered.' },
|
|
492
|
+
{ key: 'filesIndexed', type: 'number', desc: 'Files successfully indexed.' },
|
|
493
|
+
{ key: 'chunksCreated', type: 'number', desc: 'Total embedding chunks stored.' },
|
|
494
|
+
{ key: 'totalTokens', type: 'number', desc: 'Voyage AI tokens consumed.' },
|
|
495
|
+
{ key: 'model', type: 'string', desc: 'Embedding model used.' },
|
|
496
|
+
],
|
|
497
|
+
tips: [
|
|
498
|
+
'Use refresh: true for incremental indexing after the first full index.',
|
|
499
|
+
'GitHub repos require a GITHUB_TOKEN for private repositories.',
|
|
500
|
+
'voyage-code-3 understands code structure, function signatures, and programming idioms.',
|
|
501
|
+
],
|
|
502
|
+
},
|
|
503
|
+
|
|
504
|
+
code_search: {
|
|
505
|
+
description:
|
|
506
|
+
'Semantic search across an indexed codebase. Finds functions, classes, and modules related to a natural language query.',
|
|
507
|
+
howItWorks:
|
|
508
|
+
'Embeds your query with voyage-code-3, runs vector search against the code index in MongoDB Atlas, then reranks results with rerank-2.5 for best relevance. Returns file paths, line numbers, and matched code snippets.',
|
|
509
|
+
inputs: [
|
|
510
|
+
{ key: 'query', type: 'string', required: true, desc: 'Natural language search query (e.g., "where do we handle auth timeouts").' },
|
|
511
|
+
{ key: 'db', type: 'string', required: false, desc: 'MongoDB database name.' },
|
|
512
|
+
{ key: 'collection', type: 'string', required: false, desc: 'Collection with indexed code.' },
|
|
513
|
+
{ key: 'limit', type: 'number', required: false, desc: 'Maximum results. Default: 10.' },
|
|
514
|
+
{ key: 'language', type: 'string', required: false, desc: 'Filter by language (e.g., "js", "py", "go").' },
|
|
515
|
+
{ key: 'rerank', type: 'boolean', required: false, desc: 'Rerank with Voyage AI for better relevance. Default: true.' },
|
|
516
|
+
],
|
|
517
|
+
outputs: [
|
|
518
|
+
{ key: 'results', type: 'array', desc: 'Matched code chunks with source, filePath, startLine, endLine, symbols, content, score.' },
|
|
519
|
+
{ key: 'metadata', type: 'object', desc: 'Search metadata: collection, model, reranked, timeMs, resultCount, tokens.' },
|
|
520
|
+
],
|
|
521
|
+
tips: [
|
|
522
|
+
'Describe what the code does in plain language rather than using exact syntax.',
|
|
523
|
+
'Filter by language to reduce noise when the codebase is polyglot.',
|
|
524
|
+
'Reranking significantly improves relevance for code search.',
|
|
525
|
+
],
|
|
526
|
+
},
|
|
527
|
+
|
|
528
|
+
code_query: {
|
|
529
|
+
description:
|
|
530
|
+
'Full RAG query against an indexed codebase. Optimized for answering questions like "how does X work" or "where is Y implemented".',
|
|
531
|
+
howItWorks:
|
|
532
|
+
'Works like code_search but with tighter defaults: fetches fewer results (5), always reranks, and uses a higher candidate multiplier for better quality.',
|
|
533
|
+
inputs: [
|
|
534
|
+
{ key: 'query', type: 'string', required: true, desc: 'Question about the codebase (e.g., "how does the auth middleware work").' },
|
|
535
|
+
{ key: 'db', type: 'string', required: false, desc: 'MongoDB database name.' },
|
|
536
|
+
{ key: 'collection', type: 'string', required: false, desc: 'Collection with indexed code.' },
|
|
537
|
+
{ key: 'limit', type: 'number', required: false, desc: 'Maximum results. Default: 5.' },
|
|
538
|
+
{ key: 'language', type: 'string', required: false, desc: 'Filter by programming language.' },
|
|
539
|
+
],
|
|
540
|
+
outputs: [
|
|
541
|
+
{ key: 'results', type: 'array', desc: 'Top matched code chunks with source, content, scores, and symbols.' },
|
|
542
|
+
{ key: 'metadata', type: 'object', desc: 'Query metadata: timing, model, token usage.' },
|
|
543
|
+
],
|
|
544
|
+
tips: [
|
|
545
|
+
'Best for "how" and "where" questions about existing code.',
|
|
546
|
+
'Pair with the generate node to produce explanations from the retrieved code context.',
|
|
547
|
+
'Use a condition to skip this step if no question was provided.',
|
|
548
|
+
],
|
|
549
|
+
},
|
|
550
|
+
|
|
551
|
+
code_find_similar: {
|
|
552
|
+
description:
|
|
553
|
+
'Find code semantically similar to a given snippet. Paste a function, class, or code block and find related implementations.',
|
|
554
|
+
howItWorks:
|
|
555
|
+
'Embeds the provided code snippet with voyage-code-3 and searches the indexed codebase for chunks with high vector similarity. Results are filtered by a threshold score.',
|
|
556
|
+
inputs: [
|
|
557
|
+
{ key: 'code', type: 'string', required: true, desc: 'Code snippet to find similar implementations for.' },
|
|
558
|
+
{ key: 'db', type: 'string', required: false, desc: 'MongoDB database name.' },
|
|
559
|
+
{ key: 'collection', type: 'string', required: false, desc: 'Collection with indexed code.' },
|
|
560
|
+
{ key: 'limit', type: 'number', required: false, desc: 'Maximum results. Default: 10.' },
|
|
561
|
+
{ key: 'language', type: 'string', required: false, desc: 'Filter by programming language.' },
|
|
562
|
+
{ key: 'threshold', type: 'number', required: false, desc: 'Minimum similarity score (0-1). Default: 0.5.' },
|
|
563
|
+
],
|
|
564
|
+
outputs: [
|
|
565
|
+
{ key: 'results', type: 'array', desc: 'Similar code chunks with source, filePath, startLine, endLine, content, and similarity score.' },
|
|
566
|
+
{ key: 'metadata', type: 'object', desc: 'Search metadata: collection, model, threshold, timing.' },
|
|
567
|
+
],
|
|
568
|
+
tips: [
|
|
569
|
+
'Useful for finding duplicate logic, alternative implementations, or code that follows similar patterns.',
|
|
570
|
+
'Lower the threshold (e.g., 0.3) to find more distant but still related code.',
|
|
571
|
+
'voyage-code-3 understands both code structure and intent, so it can match functionally similar code even with different syntax.',
|
|
572
|
+
],
|
|
573
|
+
},
|
|
574
|
+
|
|
575
|
+
code_status: {
|
|
576
|
+
description:
|
|
577
|
+
'Check the status of a code search index. Shows file count, chunk count, languages, and vector search index health.',
|
|
578
|
+
howItWorks:
|
|
579
|
+
'Queries the MongoDB collection for aggregate statistics about indexed code: unique files, languages, last indexing time, and the state of the vector search index.',
|
|
580
|
+
inputs: [
|
|
581
|
+
{ key: 'db', type: 'string', required: false, desc: 'MongoDB database name. Default: "vai_code_search".' },
|
|
582
|
+
{ key: 'collection', type: 'string', required: false, desc: 'Collection to check.' },
|
|
583
|
+
],
|
|
584
|
+
outputs: [
|
|
585
|
+
{ key: 'totalChunks', type: 'number', desc: 'Total embedding chunks in the index.' },
|
|
586
|
+
{ key: 'filesIndexed', type: 'number', desc: 'Number of unique source files.' },
|
|
587
|
+
{ key: 'languages', type: 'array', desc: 'Programming languages detected in the index.' },
|
|
588
|
+
{ key: 'lastIndexed', type: 'string', desc: 'Timestamp of the most recent indexing.' },
|
|
589
|
+
{ key: 'indexes', type: 'array', desc: 'Vector search index names and their status.' },
|
|
590
|
+
],
|
|
591
|
+
tips: [
|
|
592
|
+
'Use as a guard step with a condition to skip re-indexing if the index already has content.',
|
|
593
|
+
'Check the index status before running search steps to give helpful error messages.',
|
|
594
|
+
'The indexes array shows whether the vector search index is READY or still building.',
|
|
595
|
+
],
|
|
596
|
+
},
|
|
472
597
|
};
|