Files
ruflo/v3/@claude-flow/embeddings/package.json
T
Reuven 1430b4c76e fix(embeddings): #2018 — drop @huggingface/transformers from optionalDependencies (npx Invalid Version)
Same failure shape as #1147: `npx @claude-flow/cli@latest` crashes with
`npm error Invalid Version: ` on npm 11.x / Node 24+.

Root cause: @claude-flow/embeddings declared @huggingface/transformers in
both `optionalDependencies` AND `peerDependencies` (with
peerDependenciesMeta.optional = true). When npm 11.x arborist runs
PlaceDep.pruneDedupable → Node.canDedupe → semver.eq, the overlap plus a
"-dev." prerelease transitive (onnxruntime-web@1.26.0-dev.…) trips the
empty-version crash inside @npmcli/arborist.

Fix:
- @claude-flow/embeddings: keep only the optional peerDependency, drop
  the duplicate optionalDependencies entry. Bumped to 3.0.0-alpha.17.
- @claude-flow/cli: pin embeddings to ^3.0.0-alpha.17 so existing
  lockfiles re-resolve to the fixed version. Bumped to 3.7.0-alpha.39.

Regression guards (so this can't recur):
- scripts/audit-package-dep-overlap.mjs — static check that no package
  declares the same name in BOTH optionalDependencies and
  peerDependencies. Wired into v3-ci.yml as part of the
  plugin-package-audit job.
- scripts/smoke-cli-npx-install.mjs — behavioural smoke: pack the CLI
  tarball, install it into a scratch project with optionals enabled,
  fail if `npm install` prints "Invalid Version:" or exits non-zero.
  New v3-ci.yml job `cli-npx-install-smoke` runs on Node 22 + 24
  (Node 24 ships npm 11.x, where the bug surfaces) and gates witness-verify.

Verified end-to-end:
  $ npx -y @claude-flow/cli@3.7.0-alpha.39 doctor
  ✓ MCP Servers, AIDefence, Disk Space, TypeScript … 10 passed
2026-05-15 21:44:39 -04:00

71 lines
1.5 KiB
JSON

{
"name": "@claude-flow/embeddings",
"version": "3.0.0-alpha.17",
"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
}
},
"engines": {
"node": ">=20.0.0"
},
"publishConfig": {
"access": "public",
"tag": "v3alpha"
}
}