RepoPilot

cherryhq / cherry-studio

Search cherryhq/cherry-studio

GitHub

Code

How cherryhq/cherry-studio is laid out, and where to start for common changes.

There is no import map for this report yet.

Where to start reading

  1. Repository root
  2. Repository root
  3. Likely public API
  4. Likely public API
  5. Likely start-up file
  6. Suggested starting pointAI
  7. Suggested starting pointAI
  8. Suggested starting pointAI

Find files for a task

AI

Add a new built-in assistant

  • Define assistant capabilities and tools in src/main/ai/agents/builtin/builtinAgentDefinition.ts
  • Register provisioning logic in src/main/ai/agents/builtin/BuiltinAgentProvisioner.ts
  • Add capability guards in src/main/ai/agents/builtin/builtinAgentGuardRules.ts if safety checks needed

Integrate a new LLM provider

  • Implement provider API client and extend AiService routing in src/main/ai/AiService.ts
  • Add provider-specific compatibility metadata in src/shared/ai/piModelCompatibility.ts
  • Define error handling via src/shared/ai/providerError.ts for provider-specific exceptions

Add a new tool/capability to agents

  • Define tool contract and runtime in src/shared/ai/builtinTools.ts
  • Register tool execution handler in src/main/ai/AiService.ts or agent-specific tool registry
  • Add safety rules in src/main/ai/agents/builtin/assistantCommandSafety.ts if sensitive operations

Handle persistent agent state

  • Update session persistence schema in src/main/ai/agentSession/persistence/AgentSessionMessageBackend.ts
  • Manage state compaction logic via src/shared/ai/agentSessionCompaction.ts for efficient storage

Change the public API

Trace runtime behavior

Add or update tests

Change build or automation

RepoPilot lists up to 500 files, so a file missing here may still exist.

  • Files marked “likely” are guessed from their names.
  • Some entry points named in the manifest are build output or are missing from the file list, so their source is not shown.
  • The file list is newer than the written guide, so descriptions and suggested changes may describe older code.

Code quality and hotspots

Largest source files

  • Branch points175 per file on average
  • Code issues0 errors, 26 warnings
  • Largest file3,632 lines
  • Hotspot load8 high-risk files

Static checks on the 15 largest source files.

Tests, CI and tooling

  • CIGitHub Actions20 workflows
  • Tests3,070 test filesJest/Vitest · 0.50 test files per source file (file count, not coverage)
  • Dependency updatesNo config detected

Test folders: packages/aiCore/src/core/context/__tests__ · packages/aiCore/src/core/runtime/__tests__ · packages/aiCore/src/core/providers/__tests__

Hotspots

Files that change often and branch heavily, highest first. Branch points count if, loop, case, catch, ternary, && and || in the file.