Commit graph

2 commits

Author SHA1 Message Date
Rasmus Widing
c85622fbbb
Migrate from Node.js/npm/Jest to Bun runtime (#85)
* Migrate from Node.js/npm/Jest to Bun runtime

- Replace npm with bun for package management (bun.lock)
- Replace Jest with bun:test for testing
- Update tsconfig for Bun (ESNext module, bundler resolution)
- Update Dockerfile to use oven/bun:1-slim
- Update CI workflow to use oven-sh/setup-bun@v2
- Remove dynamic import hack from codex.ts (direct ESM imports)
- Fix test mocking for Bun (export execFileAsync, use spyOn)
- Update all documentation (CLAUDE.md, README.md, CONTRIBUTING.md)

All 395 tests pass, type-check passes, E2E validated with curl.

* ci: retrigger CI build

* fix: make execFileAsync a function for better Bun mockability

* fix: ensure execFileAsync returns string not Buffer

* fix: rename _execFileAsync to comply with naming convention

* fix: make mkdirAsync mockable for Bun tests

* fix: update engines to bun>=1.0.0 and add mkdirAsync mock

* fix: pin Bun to 1.3.4 in CI to fix mock.module test failures

Newer Bun versions have different mock.module() behavior that causes
cross-test module pollution, resulting in 71 test failures in CI while
tests pass locally. Pinning to 1.3.4 ensures consistent behavior.

* fix: run orchestrator tests last to avoid mock.module pollution

Bun's mock.module() pollutes the global module cache, causing tests to
fail when orchestrator.test.ts (which mocks command-handler and factory)
runs before those modules' own test files.

Fix by running tests in two batches:
1. All tests except orchestrator
2. Orchestrator tests last

This ensures orchestrator's mocks don't affect other test files.
2025-12-16 15:34:58 +02:00
Cole Medin
41415d7e7f feat: implement telegram + claude mvp with generic architecture
- Add generic IPlatformAdapter and IAssistantClient interfaces for extensibility
- Implement TelegramAdapter with streaming/batch modes
- Implement ClaudeClient with session persistence and resume capability
- Create TestAdapter for autonomous validation via HTTP endpoints
- Add PostgreSQL database with 3-table schema (conversations, codebases, sessions)
- Implement slash command system (/clone, /status, /getcwd, /setcwd, /reset, /help)
- Add Docker containerization with docker-compose (with-db profile for local PostgreSQL)
- Fix Claude Agent SDK spawn error (install bash, pass PATH environment variable)
- Fix workspace volume mount to use /workspace in container
- Add comprehensive documentation and health check endpoints

Architecture highlights:
- Platform-agnostic design allows adding Slack, GitHub, etc. via IPlatformAdapter
- AI-agnostic design allows adding Codex, etc. via IAssistantClient
- Orchestrator uses dependency injection with interface types
- Session persistence survives container restarts
- Working directory + codebase context determine Claude behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 19:35:50 -06:00