Skip to content

feat(middleware): implement createCliRuntime factory function (#19)#21

Merged
alexey-pelykh merged 1 commit intomainfrom
feat/runtime-factory
Feb 25, 2026
Merged

feat(middleware): implement createCliRuntime factory function (#19)#21
alexey-pelykh merged 1 commit intomainfrom
feat/runtime-factory

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Add createCliRuntime(provider) factory function that maps provider name strings to AgentRuntime instances
  • Export SUPPORTED_PROVIDERS array and SupportedProvider type for validation and help text
  • Input normalized (case-insensitive, whitespace-trimmed); unknown providers throw descriptive Error

Test plan

  • 12 tests in src/middleware/runtime-factory.test.ts covering:
    • Provider mapping (4 providers + interface check)
    • Input normalization (case, whitespace, mixed)
    • Error handling (descriptive message, lists supported providers)
    • Instance freshness (distinct instances per call)
    • SUPPORTED_PROVIDERS export validation
  • npx vitest run src/middleware/runtime-factory.test.ts — 12 passed
  • pnpm lint — 0 warnings, 0 errors
  • pnpm format — clean

Closes #19

🤖 Generated with Claude Code

@alexey-pelykh alexey-pelykh enabled auto-merge (squash) February 25, 2026 20:21
@alexey-pelykh alexey-pelykh merged commit 3235ea8 into main Feb 25, 2026
2 checks passed
@alexey-pelykh alexey-pelykh deleted the feat/runtime-factory branch February 25, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement CliRuntimeFactory

1 participant