nexus/server/src
Sai Shankar 9973f86fb4 refactor(quota): move provider quota logic into adapter layer, add unit tests
- Extract all Anthropic credential/API logic into claude-local/src/server/quota.ts
- Extract all OpenAI/WHAM credential/API logic into codex-local/src/server/quota.ts
- Add optional getQuotaWindows() to ServerAdapterModule in adapter-utils
- Rewrite quota-windows.ts as a 29-line thin aggregator with zero provider knowledge
- Wire getQuotaWindows into adapter registry for claude-local and codex-local
- Add 47 unit tests covering toPercent, secondsToWindowLabel, WHAM normalization,
  readClaudeToken, readCodexToken, fetchClaudeQuota, fetchCodexQuota, fetchWithTimeout
- Add 8 unit tests covering parseDateRange validation and byProvider pro-rata math

Adding a third provider now requires only touching that provider's adapter.
2026-03-14 22:00:43 -05:00
..
__tests__ refactor(quota): move provider quota logic into adapter layer, add unit tests 2026-03-14 22:00:43 -05:00
adapters refactor(quota): move provider quota logic into adapter layer, add unit tests 2026-03-14 22:00:43 -05:00
auth fix: disable secure cookies for HTTP deployments 2026-03-08 22:00:51 -05:00
middleware fix(server): keep pretty logger metadata on one line 2026-03-10 16:42:36 -05:00
realtime update typing to node v24 from v20 2026-03-05 14:36:00 -03:00
routes feat(costs): add agent model breakdown, harden date validation, sync CostByProject type, fix quota threshold and tab-gated queries 2026-03-14 22:00:43 -05:00
secrets refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
services refactor(quota): move provider quota logic into adapter layer, add unit tests 2026-03-14 22:00:43 -05:00
storage refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
types feat(server): integrate Better Auth, access control, and deployment mode startup 2026-02-23 14:40:32 -06:00
agent-auth-jwt.ts Implement local agent JWT authentication for adapters 2026-02-18 16:46:45 -06:00
app.ts feat(plugins): bridge core domain events to plugin event bus 2026-03-14 13:44:26 -07:00
attachment-types.ts feat(issues): add issue documents and inline editing 2026-03-13 21:30:48 -05:00
board-claim.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
config-file.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
config.ts fix(server): use realpathSync for .env path dedup to handle symlinks 2026-03-14 09:05:51 -07:00
errors.ts Add server routes for companies, approvals, costs, and dashboard 2026-02-17 09:07:27 -06:00
home-paths.ts Add configurable automatic database backup scheduling 2026-03-04 18:03:23 -06:00
index.ts fix: resolve type errors in process-lost-reaper PR 2026-03-13 06:56:31 -05:00
log-redaction.ts Redact current user in comments and token checks 2026-03-11 22:17:21 -05:00
paths.ts feat(cli): add client commands and home-based local runtime defaults 2026-02-20 07:10:58 -06:00
redaction.ts Implement secrets service with local encryption, redaction, and runtime resolution 2026-02-19 15:43:52 -06:00
startup-banner.ts Add configurable automatic database backup scheduling 2026-03-04 18:03:23 -06:00
ui-branding.ts Add worktree UI branding 2026-03-13 11:12:43 -05:00