LibreChat/package.json
Marco Beretta c00c776e0e
📦 feat: Scaffold the @librechat/chat Package (#16964)
* feat: Scaffold the @librechat/chat package

Adds packages/chat with core, react and components entries, a tsdown build,
a node-environment jest config, turbo and root build wiring, import boundary
rules, design-lint scope, and core types for the chat transport, stream,
host and status. No code moves yet.

* test: Cover the @librechat/chat boundaries as scenarios

* fix: Run the chat suite in test:turbo and build it for the mock lane

test:turbo now selects @librechat/chat, the mock e2e job builds the package the
chat-package scenarios load, and the synthetic repository in the suppression
scenarios carries the packages/chat/src root lint:design:record names.

* chore: Build the chat package in frontend:ci too

* chore: Run the chat suite in test:all

* fix: Hold core TSX to the chat boundary and scan the package for cycles

* fix: Apply the chat import boundary to JavaScript sources

* fix: Keep nested core files off the components entry

* fix: Close the remaining chat package gates and fence aborts by generation

Blocks imports through the @librechat/frontend workspace name, adds the chat
sources to the i18n scan, the CSS color gate and the client Tailwind content,
and lets ChatAbortRequest carry the generation it means to stop.

* fix: Keep JSX out of the chat core and carry abort and reconnect outcomes

Rejects JSX under the core, copies the chat manifest before the Docker
install, keys the client app build caches on the chat sources, fences
reconnects by generation, and types the abort result the transport returns.

* test: Give the CSS gate's scratch tree the chat root it now scans

* fix: Close the remaining @librechat/chat gates and wiring

Rejects import() and require() across the package boundaries, holds chat
components to the literal-copy rule, compiles TSX in the package's jest
transform, builds the package in Frontend Unit Tests, requires its test job for
main promotion, adds it to the unused-dependency scan, and lists it wherever a
sibling workspace is listed: Dockerfile.multi, the docker smoke paths, the
remaining node_modules caches, the reinstall helper, the bun build chain and
AGENTS.md.

* fix: Tighten the chat boundaries and carry steering and Assistants aborts

Template-literal import() and require() and self-imports through the package
name are rejected, user-facing JSX attributes need localized text, the cycle
scan resolves self-imports, Dockerfile.multi builds the package for the client
stage, and the transport carries steer, cancelSteer, armSteer and the
Assistants abort key.

* feat: Match the chat transport and host contracts to the client's

The transport now reports settled and replaced starts, the stream's protocol
version and resumed flag, reconnect replay, generation status, paused-run
resume with approvals or answers, abort and steer protocol versions, and the
request error shape. The host config and auth carry what the client's
ChatSettings now supplies: rename-while-running, model specs, retention mode
and the user.

* fix: Keep lazy React-entry loads out of the core and type the Assistants stop

Relative import() and require() of the /react entry from core are rejected,
and an abortKey stop resolves to the terminal conversation and run messages the
Assistants route returns.

* fix: Fence start controls by protocol and close extension-bearing entry loads

Settled and replaced start results carry the protocol version, core loads of
the /react or /components entry with a file extension are rejected, and
test:packages:chat builds data-provider first.
2026-10-10 21:00:10 +02:00

285 lines
17 KiB
JSON

{
"name": "LibreChat",
"version": "v0.8.8",
"description": "",
"packageManager": "npm@11.13.0",
"scarfSettings": {
"enabled": false
},
"workspaces": [
"api",
"client",
"packages/*"
],
"scripts": {
"prepare": "node -e \"import('husky').then((h) => h.default()).catch(() => {})\"",
"update": "node config/update.js",
"add-balance": "node config/add-balance.js",
"set-balance": "node config/set-balance.js",
"list-balances": "node config/list-balances.js",
"user-stats": "node config/user-stats.js",
"rebuild:package-lock": "node config/packages",
"reinstall": "node config/update.js -l -g",
"smart-reinstall": "node config/smart-reinstall.js",
"b:reinstall": "bun config/update.js -b -l -g",
"reinstall:docker": "node config/update.js -d -g",
"update:local": "node config/update.js -l",
"update:docker": "node config/update.js -d",
"update:single": "node config/update.js -s",
"update:sudo": "node config/update.js --sudo",
"update:deployed": "node config/deployed-update.js",
"rebase:deployed": "node config/deployed-update.js --rebase",
"start:deployed": "docker compose -f ./deploy-compose.yml up -d || docker-compose -f ./deploy-compose.yml up -d",
"stop:deployed": "docker compose -f ./deploy-compose.yml down || docker-compose -f ./deploy-compose.yml down",
"upgrade": "node config/upgrade.js",
"create-user": "node config/create-user.js",
"invite-user": "node config/invite-user.js",
"list-users": "node config/list-users.js",
"reset-password": "node config/reset-password.js",
"ban-user": "node config/ban-user.js",
"delete-user": "node config/delete-user.js",
"reset-meili-sync": "node config/reset-meili-sync.js",
"create-error-convo": "node config/create-error-convo.js",
"update-banner": "node config/update-banner.js",
"delete-banner": "node config/delete-banner.js",
"backend": "cross-env NODE_ENV=production node api/server/index.js",
"backend:inspect": "cross-env NODE_ENV=production node --inspect --expose-gc api/server/index.js",
"backend:dev": "cross-env NODE_ENV=development npx nodemon api/server/index.js",
"redis:single": "bash scripts/redis-mode.sh single",
"redis:cluster": "bash scripts/redis-mode.sh cluster",
"redis:stop": "bash scripts/redis-mode.sh stop",
"backend:redis:single": "cross-env USE_REDIS=true USE_REDIS_CLUSTER=false REDIS_URI=redis://127.0.0.1:6379 npm run backend",
"backend:redis:cluster": "cross-env USE_REDIS=true USE_REDIS_CLUSTER=true REDIS_URI=redis://127.0.0.1:7001,redis://127.0.0.1:7002,redis://127.0.0.1:7003 npm run backend",
"backend:dev:redis:single": "cross-env USE_REDIS=true USE_REDIS_CLUSTER=false REDIS_URI=redis://127.0.0.1:6379 npm run backend:dev",
"backend:dev:redis:cluster": "cross-env USE_REDIS=true USE_REDIS_CLUSTER=true REDIS_URI=redis://127.0.0.1:7001,redis://127.0.0.1:7002,redis://127.0.0.1:7003 npm run backend:dev",
"backend:experimental": "cross-env NODE_ENV=production node api/server/experimental.js",
"backend:stop": "node config/stop-backend.js",
"build:data-provider": "cd packages/data-provider && npm run build",
"build:api": "cd packages/api && npm run build",
"build:data-schemas": "cd packages/data-schemas && npm run build",
"build:client": "cd client && npm run build",
"build:client-package": "cd packages/client && npm run build",
"build:chat": "cd packages/chat && npm run build",
"build:packages": "npm run build:data-provider && npm run build:data-schemas && npm run build:api && npm run build:client-package && npm run build:chat",
"build": "npx turbo run build",
"build:safe": "npx turbo run build --no-daemon",
"frontend": "npm run build:data-provider && npm run build:data-schemas && npm run build:api && npm run build:client-package && npm run build:chat && cd client && npm run build",
"frontend:ci": "npm run build:data-provider && npm run build:client-package && npm run build:chat && cd client && npm run build:ci",
"frontend:dev": "cd client && npm run dev",
"e2e:prepare": "npm run frontend",
"test:client-build": "node --test e2e/client-build.test.mjs",
"e2e": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.local.ts",
"e2e:headed": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.local.ts --headed",
"e2e:a11y": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.a11y.ts --headed",
"e2e:ci": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.ts",
"e2e:mock": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.mock.ts",
"e2e:email-change": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.email.ts",
"e2e:email-change:disabled": "npm run e2e:prepare && cross-env E2E_ALLOW_EMAIL_CHANGE=false playwright test --config=e2e/playwright.config.email.ts",
"e2e:mock:redis": "npm run e2e:prepare && cross-env E2E_STREAM_STORE=redis playwright test --config=e2e/playwright.config.mock.ts",
"e2e:mock:redis:transport": "npm run e2e:prepare && cross-env E2E_STREAM_STORE=redis playwright test --config=e2e/playwright.config.redis.ts",
"e2e:benchmark:agents": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.benchmark.ts agent-startup.latency.spec.ts",
"e2e:benchmark:navigation": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.navigation-perf.ts",
"e2e:benchmark:reasoning": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.reasoning-perf.ts",
"e2e:benchmark:mobile-chat": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.mobile-chat-perf.ts",
"e2e:bombadil": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:run": "playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:branch-reload": "npm run e2e:prepare && cross-env BOMBADIL_SPECIFICATION=branch-reload.specification.ts BOMBADIL_TIME_LIMIT=30s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:branch-reload:run": "cross-env BOMBADIL_SPECIFICATION=branch-reload.specification.ts BOMBADIL_TIME_LIMIT=30s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:fork-lifecycle": "npm run e2e:prepare && cross-env BOMBADIL_SPECIFICATION=fork-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=30s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:fork-lifecycle:run": "cross-env BOMBADIL_SPECIFICATION=fork-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=30s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:model-lifecycle": "npm run e2e:prepare && cross-env BOMBADIL_SPECIFICATION=model-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=30s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:model-lifecycle:run": "cross-env BOMBADIL_SPECIFICATION=model-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=30s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:hitl": "npm run e2e:prepare && cross-env BOMBADIL_SPECIFICATION=hitl-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=45s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:hitl:run": "cross-env BOMBADIL_SPECIFICATION=hitl-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=45s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:steering": "npm run e2e:prepare && cross-env BOMBADIL_SPECIFICATION=steering-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=75s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:bombadil:steering:run": "cross-env BOMBADIL_SPECIFICATION=steering-lifecycle.specification.ts BOMBADIL_TIME_LIMIT=75s playwright test --config=e2e/playwright.config.bombadil.ts",
"e2e:mock:enforce": "npm run e2e:prepare && cross-env E2E_MODEL_SPECS_ENFORCE=true playwright test --config=e2e/playwright.config.mock.ts enforced-model-specs.spec.ts",
"e2e:mock:ci": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.mock.ts",
"e2e:deployed": "playwright test --config=e2e/playwright.config.deployed.ts",
"e2e:deployed:headed": "cross-env E2E_HEADED=true playwright test --config=e2e/playwright.config.deployed.ts",
"e2e:debug": "npm run e2e:prepare && cross-env PWDEBUG=1 playwright test --config=e2e/playwright.config.local.ts",
"e2e:record": "npm run e2e:prepare && cross-env E2E_BASE_URL=http://localhost:3333 node e2e/setup/record.js",
"e2e:record:local": "npm run e2e:prepare && node e2e/setup/record.js --profile=local",
"e2e:codegen": "npx playwright codegen --target=playwright-test --test-id-attribute=data-testid --load-storage=e2e/storageState.json http://localhost:3080/c/new",
"e2e:login": "npx playwright codegen --save-storage=e2e/storageState.json http://localhost:3080/login",
"e2e:github": "act -W .github/workflows/playwright.yml --secret-file my.secrets",
"test:client": "cd client && npm run test:ci",
"test:api": "cd api && npm run test:ci",
"test:packages:api": "cd packages/api && npm run test:ci",
"test:packages:data-provider": "cd packages/data-provider && npm run test:ci",
"test:packages:data-schemas": "cd packages/data-schemas && npm run test:ci",
"test:packages:chat": "npm run build:data-provider && cd packages/chat && npm run test:ci",
"test:config": "jest --config config/jest.config.js",
"test:all": "npm run test:client && npm run test:api && npm run test:packages:api && npm run test:packages:data-provider && npm run test:packages:data-schemas && npm run test:packages:chat",
"test:turbo": "turbo run test:ci --concurrency=2 --filter=@librechat/frontend --filter=@librechat/client --filter=@librechat/backend --filter=@librechat/api --filter=librechat-data-provider --filter=@librechat/data-schemas --filter=@librechat/chat",
"e2e:update": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.local.ts --update-snapshots",
"e2e:report": "npx playwright show-report e2e/playwright-report",
"lint:fix": "npm run build:client-package && eslint . --fix --pass-on-unpruned-suppressions",
"lint": "npm run build:client-package && eslint . --pass-on-unpruned-suppressions",
"lint:design:record": "npm run build:client-package && eslint --no-warn-ignored --suppress-rule shadcn/no-restyle --suppress-rule shadcn/no-raw-colors --suppress-rule shadcn/no-arbitrary-values --suppress-rule shadcn/no-inline-styles --suppress-rule shadcn/require-static-classes --suppress-rule shadcn/no-unknown-classes --suppress-rule design/disabled-recipe client/src packages/client/src packages/chat/src",
"lint:design:suppress": "(npm run --silent lint:design:record || node -e \"\") && npm run lint:design:prune",
"lint:design:prune": "npm run build:client-package && eslint --no-warn-ignored --prune-suppressions client/src packages/client/src packages/chat/src",
"sort-imports": "node scripts/sort-imports.mts",
"sort-imports:check": "node scripts/sort-imports.mts --check",
"static-checks": "node scripts/static-checks.mts",
"static-checks:full": "node scripts/static-checks.mts --full",
"format": "npx prettier --write \"{,!(node_modules|venv)/**/}*.{js,jsx,ts,tsx}\"",
"b:api": "NODE_ENV=production bun run api/server/index.js",
"b:api-inspect": "NODE_ENV=production bun --inspect run api/server/index.js",
"b:api:dev": "NODE_ENV=production bun run --watch api/server/index.js",
"b:data": "cd packages/data-provider && bun run b:build",
"b:build:client-package": "cd packages/client && bun run b:build",
"b:build:chat": "cd packages/chat && bun run b:build",
"b:data-schemas": "cd packages/data-schemas && bun run b:build",
"b:build:api": "cd packages/api && bun run b:build",
"b:build:client": "cd client && bun --bun run b:build",
"b:client": "bun --bun run b:data && bun --bun run b:data-schemas && bun --bun run b:build:api && bun --bun run b:build:client-package && bun --bun run b:build:chat && bun --bun run b:build:client",
"b:client:dev": "cd client && bun run b:dev",
"b:test:client": "cd client && bun run b:test",
"b:test:api": "cd api && bun run b:test",
"b:balance": "bun config/add-balance.js",
"b:list-balances": "bun config/list-balances.js",
"reset-terms": "node config/reset-terms.js",
"migrate:tenant-indexes": "node config/migrate-tenant-indexes.js",
"migrate:tenant-indexes:dry-run": "node config/migrate-tenant-indexes.js --dry-run",
"migrate:terms-timestamp": "node config/migrate-terms-timestamp.js",
"flush-cache": "node config/flush-cache.js",
"migrate:agent-permissions:dry-run": "node config/migrate-agent-permissions.js --dry-run",
"migrate:agent-permissions": "node config/migrate-agent-permissions.js",
"migrate:agent-permissions:batch": "node config/migrate-agent-permissions.js --batch-size=50",
"migrate:prompt-permissions:dry-run": "node config/migrate-prompt-permissions.js --dry-run",
"migrate:prompt-permissions": "node config/migrate-prompt-permissions.js",
"migrate:prompt-permissions:batch": "node config/migrate-prompt-permissions.js --batch-size=50",
"migrate:shared-link-permissions:dry-run": "node config/migrate-shared-link-permissions.js --dry-run",
"migrate:shared-link-permissions": "node config/migrate-shared-link-permissions.js",
"migrate:shared-link-permissions:batch": "node config/migrate-shared-link-permissions.js --batch-size=50",
"migrate:orphaned-agent-files:dry-run": "node config/migrate-orphaned-agent-files.js --dry-run",
"migrate:orphaned-agent-files": "node config/migrate-orphaned-agent-files.js",
"migrate:orphaned-agent-files:batch": "node config/migrate-orphaned-agent-files.js --batch-size=50",
"migrate:code-file-duplicates:dry-run": "node config/migrate-code-file-duplicates.js --dry-run",
"migrate:code-file-duplicates": "node config/migrate-code-file-duplicates.js",
"migrate:code-file-duplicates:batch": "node config/migrate-code-file-duplicates.js --batch-size=50",
"lighthouse": "npm run e2e:prepare && npm run lighthouse:run",
"lighthouse:run": "playwright test --config=e2e/playwright.config.lighthouse.ts",
"lighthouse:regression": "cross-env LIGHTHOUSE_REGRESSION=serial-reads npm run lighthouse:run"
},
"repository": {
"type": "git",
"url": "git+https://github.com/LibreChat-AI/LibreChat.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/LibreChat-AI/LibreChat/issues"
},
"homepage": "https://librechat.ai/",
"devDependencies": {
"@antithesishq/bombadil": "0.6.1",
"@axe-core/playwright": "^4.10.1",
"@eslint/compat": "^1.2.6",
"@eslint/eslintrc": "^3.3.4",
"@eslint/js": "^9.20.0",
"@playwright/test": "^1.62.1",
"@shadcn/lint": "^0.1.0",
"@types/react-virtualized": "^9.22.0",
"brace-expansion": "^2.1.2",
"caniuse-lite": "^1.0.30001741",
"cross-env": "^7.0.3",
"elliptic": "^6.6.1",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.0.1",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-i18next": "^6.1.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^29.1.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.14.0",
"husky": "^9.1.7",
"jest": "^30.2.0",
"lighthouse": "13.4.1",
"lint-staged": "^15.4.3",
"prettier": "^3.5.0",
"prettier-plugin-tailwindcss": "^0.6.11",
"turbo": "^2.10.5",
"typescript-eslint": "^8.60.1"
},
"overrides": {
"minimatch@3": {
"brace-expansion": "^1.1.16"
},
"minimatch@5": {
"brace-expansion": "^2.1.2"
},
"minimatch@9": {
"brace-expansion": "^2.1.2"
},
"minimatch@10": {
"brace-expansion": "^5.0.8"
},
"@xmldom/xmldom": "^0.8.15",
"@humanfs/node": "^0.16.8",
"qs": "^6.16.0",
"baseline-browser-mapping": "^2.11.0",
"browserslist": "^4.28.7",
"elliptic": "^6.6.1",
"fast-uri": "^3.1.7",
"fflate": "^0.8.3",
"form-data": "^4.0.6",
"ip-address": "^10.5.1",
"langsmith": "^0.6.0",
"postcss": "^8.5.18",
"postcss-selector-parser@6": "^6.1.3",
"postcss-selector-parser@7": "^7.1.3",
"tslib": "^2.8.1",
"fast-xml-parser": "5.7.2",
"serialize-javascript": "7.0.5",
"mdast-util-gfm-autolink-literal": "2.0.0",
"remark-gfm": {
"mdast-util-gfm-autolink-literal": "2.0.0"
},
"mdast-util-gfm": {
"mdast-util-gfm-autolink-literal": "2.0.0"
},
"katex": "^0.16.21",
"rehype-katex": {
"katex": "^0.16.21"
},
"remark-math": {
"micromark-extension-math": {
"katex": "^0.16.21"
}
},
"eslint": {
"ajv": "6.14.0"
},
"underscore": "1.13.8",
"hono": "^4.13.7",
"@hono/node-server": "^2.1.1",
"monaco-editor": {
"dompurify": "3.4.16"
},
"test-exclude": "^8.0.0",
"js-yaml": "^4.3.2",
"ws": "^8.21.0",
"@opentelemetry/core": "^2.9.0",
"@opentelemetry/propagator-jaeger": "^2.10.0",
"protobufjs": "^7.6.5",
"@grpc/grpc-js": "^1.14.5",
"gaxios": {
"uuid": "^11.1.1"
}
},
"nodemonConfig": {
"ignore": [
"api/data/",
"data/",
"client/",
"admin/",
"packages/"
]
}
}