Skip to content
Docs

Command palette

Jump to a page or view, or find a todo by name.

Changelog

api

Authorized operations and shared contracts: responsibilities, supported exports and extension points.

Markdown

Purpose

The server defines oRPC procedures, domain routers, the assistant/MCP catalog and scheduled jobs. Public schema subpaths validate wire data; client exports only the router client type.

Public exports

Canonical subpaths follow ./<feature>/<role> (see ADR-0011). Contracts are leaf modules that web and mobile may import; the other entries are server-only and listed in the client boundary configuration.

SubpathTarget
./client./src/client.ts
./rpc-scope./src/rpc-scope.ts
./request-id./src/platform/rpc/request-id.ts
./push-messages./src/features/notifications/notifications.push-messages.ts
./context./src/platform/rpc/context.ts
./app-router./src/platform/rpc/app-router.ts
./jobs/run./src/platform/jobs/run.ts
./admin/contract./src/features/admin/admin.contract.ts
./audit/contract./src/features/audit/audit.contract.ts
./flags/contract./src/features/flags/flags.contract.ts
./todo/contract./src/features/todo/todo.contract.ts
./proposals/contract./src/features/proposals/proposals.contract.ts
./integrations/contract./src/features/integrations/integrations.contract.ts
./billing/contract./src/features/billing/billing.contract.ts
./notifications/contract./src/features/notifications/notifications.contract.ts
./imports/contract./src/features/imports/imports.contract.ts
./assistant/contract./src/features/assistant/assistant.contract.ts
./documents/contract./src/features/documents/documents.contract.ts
./agent-tools/contract./src/features/agent-tools/agent-tools.contract.ts
./billing/plans./src/features/billing/billing.plans.ts
./billing/http./src/features/billing/billing.http.ts
./billing/web-http./src/features/billing/billing.web-http.ts
./mcp/server./src/features/mcp/mcp.server.ts
./mcp/context./src/features/mcp/mcp.context.ts
./mcp/protocol./src/features/mcp/mcp.protocol.ts
./mcp/guard./src/features/mcp/mcp.guard.ts
./webhooks/events./src/features/webhooks/webhooks.events.ts
./uploads/service./src/features/uploads/uploads.service.ts
./assistant/http./src/features/assistant/assistant.http.ts
./documents/lifecycle-plugin./src/features/documents/documents.lifecycle-plugin.ts

Mobile aliases

The native app imports four contracts through their earlier subpaths. They stay in exports and resolve to the same files as the canonical entries, so the app builds without a change. The web app uses the canonical subpaths only.

AliasTarget
./routers/todo.schema./src/features/todo/todo.contract.ts
./routers/integrations.schema./src/features/integrations/integrations.contract.ts
./routers/billing.schema./src/features/billing/billing.contract.ts
./routers/notifications.schema./src/features/notifications/notifications.contract.ts

Renamed subpaths

These subpaths were renamed when the backend moved to one folder per feature. Import the new subpath.

Earlier subpathUse instead
./routers/index./app-router
./routers/admin.schema./admin/contract
./routers/audit.schema./audit/contract
./routers/flags.schema./flags/contract
./routers/proposals.schema./proposals/contract
./routers/imports.schema./imports/contract
./routers/assistant.schema./assistant/contract
./routers/documents.schema./documents/contract
./billing-plans./billing/plans
./uploads/workflow./uploads/service
./ai/http./assistant/http
./ai/catalog.schema./agent-tools/contract

These paths come from packages/api/package.json. Conditional targets distinguish platform or type resolution; consumers should import the subpath, not its source file.

How to extend

Add the operation to the feature's procedures and service, and register new procedures in platform/rpc/app-router.ts. Keep authorization in the procedure and resource scope in the query. Add a ./<feature>/contract export when another package needs the contract. The domain-feature skill walks through a new feature. For AI/MCP tools, extend the single catalog after reading ADR-0007.

Read the authorized operations and shared contracts guide for the full flow.

Key files

Edit on GitHubDocumentation is in English.