mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 14:16:34 +09:00
Checkpoint: File edits
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
5fc0a952fc
commit
d65a92cf5a
1 file changed
+29
@@ -788,6 +788,35 @@ async function isAgenticFlowAvailable(): Promise<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto-install agentic-flow and initialize model
|
||||
*/
|
||||
async function autoInstallAgenticFlow(): Promise<boolean> {
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user