Add repository context explorer

Merged
SL
5mo ago
+946-12

Summary\n- add an ignore-aware repository context API for the active workspace\n- detect root and nested AGENTS.md files and mark which ones apply to selected paths\n- add a composer repository-context picker with search, file/directory selection, AGENTS visibility, and context impact estimates\n- send selected repo context as a bounded prompt context block without starting a run from health/context checks\n\n## Testing\n- pnpm -C apps/codex-claw lint\n- pnpm -C apps/codex-claw build\n- pnpm -C apps/codex-claw test\n\nCloses #85


Summary by cubic

Adds a repository context explorer so users can pick files/folders for chats with ignore-aware scanning and AGENTS.md visibility. Selected context is sent as a bounded prompt block and can be used without typing a message. Closes #85.

  • New Features
    • API: GET /api/repo-context returns an ignore-aware repo tree, applicable AGENTS.md files, and size/token estimates (selections via repeated selected params).
    • UI: Composer picker with search, file/directory selection, removable summary chips, and oversized warnings.
    • Sending: Builds and appends a bounded context block from selected files plus applicable AGENTS.md; supports context-only sends and optimistic “Repository context: …” messages.
    • Server: Uses git ls-files (with a safe fallback scan), normalizes paths, limits depth/entries, includes only text-like files, and truncates at ~32k chars.
    • Tests: Cover AGENTS.md visibility and prompt assembly.