codeburn/tests
Anand Hegde 3c0302b938 feat(providers): add Codebuff provider
Adds the Codebuff provider (formerly Manicode) as a single-file plugin
under src/providers/codebuff.ts, following the conventions used by the
pi and opencode providers.

Data source:
- Walks ~/.config/manicode/projects/<project>/chats/<chatId>/
- chat-messages.json holds the serialized ChatMessage[]
- run-state.json is consulted to recover the real cwd so sessions group
  by the originating project directory
- manicode-dev and manicode-staging channels are walked automatically
- Honors CODEBUFF_DATA_DIR for a custom root

Cost model:
- Codebuff bills in credits, not tokens. Each completed assistant message
  records credits on message.credits; CodeBurn approximates cost using
  the public PAYG rate ($0.01 / credit) as a conservative upper bound.
- When Codebuff routes a call through an upstream provider and the
  stashed RunState records real token totals (providerOptions.usage or
  providerOptions.codebuff.usage in messageHistory), the LiteLLM-based
  calculation takes precedence.

Tool normalization maps Codebuff-native names (read_files, str_replace,
run_terminal_command, spawn_agents, etc.) to the canonical set used by
the classifier (Read, Edit, Bash, Agent, TodoWrite, ...).

Tests:
- 18 provider tests covering discovery, parsing, multi-turn sessions,
  providerOptions fallback, dedup, malformed files, display names
- provider-registry.test.ts updated to assert codebuff is registered
  and its tool/model display names

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-21 21:02:58 +05:30
..
fixtures/security test(security): add failing test for HIGH-1 prototype pollution 2026-04-17 08:32:18 +02:00
providers feat(providers): add Codebuff provider 2026-04-21 21:02:58 +05:30
security feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
bash-commands.test.ts chore: hoist Pi model sort + cover bash-utils edge cases 2026-04-16 02:02:32 -07:00
cli-plan.test.ts feat(plan): subscription plan tracking with usage progress bar 2026-04-21 04:20:50 -07:00
compare-stats.test.ts feat(compare): model comparison with planning rate fix 2026-04-19 08:34:49 -07:00
daily-cache.test.ts fix: recompute yesterday in daily cache to prevent stale menubar data 2026-04-19 03:07:54 -07:00
dashboard.test.ts fix: handle empty firstTimestamp in TopSessions, add dashboard tests 2026-04-16 15:48:24 +02:00
date-range-filter.test.ts feat(report): add --from/--to date range filtering and avgCostPerSession (#80) 2026-04-18 15:11:33 -07:00
day-aggregator.test.ts docs: remove stray Unreleased heading, note removed --no-cache flag 2026-04-21 04:54:50 -07:00
export.test.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
fs-utils.test.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
menubar-json.test.ts feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
minimax.test.ts feat: add MiniMax-M2.7 and MiniMax-M2.7-highspeed model pricing 2026-04-21 05:50:52 -07:00
models.test.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
optimize-fs.test.ts docs(optimize): remove references to non-existent .claudeignore 2026-04-17 08:32:07 +02:00
optimize.test.ts docs(optimize): remove references to non-existent .claudeignore 2026-04-17 08:32:07 +02:00
parser-filter.test.ts test: cover filterProjectsByName include/exclude semantics 2026-04-16 15:49:57 -07:00
plan-usage.test.ts feat(plan): subscription plan tracking with usage progress bar 2026-04-21 04:20:50 -07:00
plans.test.ts feat(plan): subscription plan tracking with usage progress bar 2026-04-21 04:20:50 -07:00
provider-registry.test.ts feat(providers): add Codebuff provider 2026-04-21 21:02:58 +05:30