mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-09-14 14:01:28 +08:00
ea8cbf697b
Closes #1468. `downloadEmbeddingModel`'s catch regex only matched `Cannot find package` / `Cannot find module`. On Windows + Node strict ESM, the bundled `agentic-flow`'s `package.json` doesn't declare a `./embeddings` subpath, which raises a different shape: Package subpath './embeddings' is not defined by "exports" in C:\...\node_modules\agentic-flow\package.json That message didn't match either branch of the existing regex, so the error re-threw all the way up to `ruflo embeddings init` and broke the init flow on Windows even though the rest of the embedding pipeline (@xenova/transformers ONNX) doesn't actually need agentic-flow. Fix: extend the regex to also catch: - `Package subpath '\./embeddings' is not defined` - `ERR_PACKAGE_PATH_NOT_EXPORTED` When matched, falls back to the same lazy-fetch path as the missing- package case — model downloads on first generate via @xenova. The other three `import('agentic-flow/embeddings')` sites in this file (init, isNeuralAvailable, listEmbeddingModels) already wrap their imports in try/catch that returns a neutral value, so they degrade gracefully on this same error. Verified the new regex matches the Windows error string exactly. WSL/Linux behavior unchanged (those resolve agentic-flow successfully). Published @claude-flow/embeddings@3.0.0-alpha.16 (alpha + latest tags). The cli's optional-dep range `^3.0.0-alpha.12` resolves to alpha.16 for fresh installs, so `npx ruflo@latest embeddings init` picks up the fix without a cli/umbrella republish. Co-Authored-By: RuFlo <ruv@ruv.net>