mirror of
https://github.com/hanzoai/chat.git
synced 2026-09-30 20:51:17 +00:00
Forks the internal @librechat/api workspace package (packages/api) to @hanzochat/api, matching the app package @hanzochat/chat. De-LibreChats the package name and puts its build under our control. Fixes the live prod bug where the deployed chat image shipped a stale @librechat/api/dist missing the exported handleError(), breaking every error path with "handleError is not a function" and killing the SSE stream. A clean build of @hanzochat/api produces dist/index.js that exports handleError (verified: exports.handleError = handleError). - packages/api/package.json: name @librechat/api -> @hanzochat/api - 254 source/config/doc/lockfile sites: @librechat/api -> @hanzochat/api (api/, packages/, config/, turbo.json, pnpm-lock.yaml, bun.lock, package-lock.json, LLM.md) - @librechat/api-client (distinct MCP client id string) left untouched - other @librechat/* packages (client, data-schemas, data-provider) left as-is per scope pnpm install (regenerated lockfile) + build:api green; dist exports handleError. api/data-schemas/client packages build; full build:packages and api test:ci are blocked by a PRE-EXISTING, unrelated upstream break in librechat-data-provider (config.spec.ts / cloudfront-config.spec.ts reference exports that src/config.ts no longer has) -- out of scope here.
15 lines
434 B
JavaScript
15 lines
434 B
JavaScript
const { generateCapabilityCheck, capabilityContextMiddleware } = require('@hanzochat/api');
|
|
const { getUserPrincipals, hasCapabilityForPrincipals } = require('~/models');
|
|
|
|
const { hasCapability, requireCapability, hasConfigCapability } = generateCapabilityCheck({
|
|
getUserPrincipals,
|
|
hasCapabilityForPrincipals,
|
|
});
|
|
|
|
module.exports = {
|
|
hasCapability,
|
|
requireCapability,
|
|
hasConfigCapability,
|
|
capabilityContextMiddleware,
|
|
};
|