From d65a92cf5af548b20818a3e50658c16be3e625ea Mon Sep 17 00:00:00 2001 From: rUv Date: Wed, 7 Jan 2026 04:16:14 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-07T04:16:14Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../embeddings/src/embedding-service.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/v3/@claude-flow/embeddings/src/embedding-service.ts b/v3/@claude-flow/embeddings/src/embedding-service.ts index 0ecf11a98d..5e60052094 100644 --- a/v3/@claude-flow/embeddings/src/embedding-service.ts +++ b/v3/@claude-flow/embeddings/src/embedding-service.ts @@ -788,6 +788,35 @@ async function isAgenticFlowAvailable(): Promise { } } +/** + * Auto-install agentic-flow and initialize model + */ +async function autoInstallAgenticFlow(): Promise { + const { exec } = await import('child_process'); + const { promisify } = await import('util'); + const execAsync = promisify(exec); + + try { + // Check if already available + if (await isAgenticFlowAvailable()) { + return true; + } + + console.log('[embeddings] Installing agentic-flow@alpha...'); + await execAsync('npm install agentic-flow@alpha --save', { timeout: 120000 }); + + // Initialize the model + console.log('[embeddings] Downloading embedding model...'); + await execAsync('npx agentic-flow@alpha embeddings init', { timeout: 300000 }); + + // Verify installation + return await isAgenticFlowAvailable(); + } catch (error) { + console.warn('[embeddings] Auto-install failed:', error instanceof Error ? error.message : error); + return false; + } +} + /** * Create embedding service based on configuration (sync version) * Note: For 'auto' provider or smart fallback, use createEmbeddingServiceAsync