Files
ruflo/v3/@claude-flow/embeddings/package.json
T
ReuvenandRuFlo ea8cbf697b fix(@claude-flow/embeddings@3.0.0-alpha.16): Windows ERR_PACKAGE_PATH_NOT_EXPORTED
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>
2026-05-08 10:06:36 -04:00

74 lines
1.5 KiB
JSON

{
"name": "@claude-flow/embeddings",
"version": "3.0.0-alpha.16",
"description": "V3 Embedding Service - OpenAI, Transformers.js, Agentic-Flow (ONNX), Mock providers with hyperbolic embeddings, normalization, and chunking",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.js",
"import": "./dist/index.js"
}
},
"files": [
"dist",
"src"
],
"scripts": {
"build": "tsc",
"test": "vitest run",
"test:watch": "vitest",
"lint": "eslint src --ext .ts",
"clean": "rm -rf dist"
},
"keywords": [
"embeddings",
"openai",
"transformers",
"vector",
"similarity",
"claude-flow",
"v3",
"hyperbolic",
"poincare",
"normalization",
"chunking",
"neural-substrate"
],
"author": "Claude Flow Team",
"license": "MIT",
"dependencies": {
"@xenova/transformers": "^2.17.0",
"sql.js": "^1.13.0"
},
"devDependencies": {
"@types/node": "^20.10.0",
"typescript": "^5.3.0",
"vitest": "^4.0.16"
},
"peerDependencies": {
"@claude-flow/shared": "^3.0.0-alpha.1",
"agentic-flow": "^2.0.0",
"@huggingface/transformers": "^4.0.0"
},
"peerDependenciesMeta": {
"agentic-flow": {
"optional": true
},
"@huggingface/transformers": {
"optional": true
}
},
"optionalDependencies": {
"@huggingface/transformers": "^4.2.0"
},
"engines": {
"node": ">=20.0.0"
},
"publishConfig": {
"access": "public",
"tag": "v3alpha"
}
}