mirror of
https://github.com/different-ai/openwork
synced 2026-04-25 17:15:34 +02:00
* feat(den): add org-managed llm provider library Let Den admins curate shared providers and models with encrypted credentials, then let the app connect through the existing add-provider flow. This keeps org-wide model access consistent without requiring per-user OAuth setup. * docs(den): prefer longer db encryption keys * fix(den): pass db encryption key through local dev --------- Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Org Routes
This folder owns organization-facing Den API routes.
Files
index.ts: registers all org route groupscore.ts: org creation, invitation preview/accept, and org contextinvitations.ts: invitation creation and cancellationmembers.ts: member role updates and member removalroles.ts: dynamic role CRUDtemplates.ts: shared template CRUDshared.ts: shared route-local helpers, param schemas, and guard helpers
Middleware expectations
requireUserMiddleware: the route requires a signed-in userresolveOrganizationContextMiddleware: the route needs the current org and member contextresolveMemberTeamsMiddleware: the route needs the teams for the current org member
Import these from src/middleware/index.ts so route files stay consistent.
Validation expectations
- Query, JSON body, and params should use Hono Zod validators
- Route files should read validated input with
c.req.valid(...) - Avoid direct
c.req.param(),c.req.query(), or manualsafeParse()in route handlers
Why this is split up
The org surface is the largest migrated area so far. Splitting by concern keeps edits small and lets agents change invitations, members, roles, or templates without scanning one giant router file.