Files
zeekayandHanzo Dev 732923f18a fix(boot): the middleware barrel names canAccessSkillResource
Third boot failure of the same shape, one route line further on:

  TypeError: canAccessSkillResource is not a function
    at Object.<anonymous> (/app/api/server/routes/skills.js:292:3)

`accessResources/index.js` requires six of the seven files beside it and
never named the seventh, so `routes/skills.js` mounted `undefined` as
express middleware. Exported.

Twice now the fix has been "add the missing name" and twice the next name
was missing too, so this commit stops guessing: barrels.spec.js reads what
EVERY route destructures — from `@hanzochat/api` and from
`~/server/middleware` — and proves the barrel publishes it. Statically:
requiring these for real drags in mongoose and a built dist/, and neither is
what breaks. It fails on `canAccessSkillResource` without the line above,
and it replaces the hand-listed packages/api spec, which only knew about the
one route someone had already debugged.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-26 18:45:27 -07:00

18 lines
727 B
JavaScript

const { canAccessResource } = require('./canAccessResource');
const { canAccessAgentResource } = require('./canAccessAgentResource');
const { canAccessAgentFromBody } = require('./canAccessAgentFromBody');
const { canAccessPromptViaGroup } = require('./canAccessPromptViaGroup');
const { canAccessPromptGroupResource } = require('./canAccessPromptGroupResource');
const { canAccessMCPServerResource } = require('./canAccessMCPServerResource');
const { canAccessSkillResource } = require('./canAccessSkillResource');
module.exports = {
canAccessResource,
canAccessAgentResource,
canAccessAgentFromBody,
canAccessPromptViaGroup,
canAccessPromptGroupResource,
canAccessMCPServerResource,
canAccessSkillResource,
};