Skip to content

add claude code support on proxy#2

Merged
anyrobert merged 4 commits intomainfrom
feature/claude
Mar 4, 2026
Merged

add claude code support on proxy#2
anyrobert merged 4 commits intomainfrom
feature/claude

Conversation

@anyrobert
Copy link
Owner

it closes #1

Summary

Refactors the codebase for clearer structure, consistent hyphen-case naming, shared utilities, and a version bump to 0.2.0.

Changes

  • Split server and modularize handlers
    • Split server.ts into focused modules:
      • Handlers (handlers/): health, models, chat-completions, anthropic-messages
      • workspace.ts: Resolves workspace and temp dir
      • agent-runner.ts: Runs agent sync/stream with temp dir cleanup
      • request-listener.ts: Routes requests, auth, and error handling
  • Rename to hyphen-case
    • cursorCli → cursor-cli
    • requestLog → request-log
    • modelMap → model-map
  • Shared utilities
    • agent-cmd-args.ts: buildAgentCmdArgs() for CLI args
    • resolve-model.ts: resolveModel() for model selection
    • cli-stream-parser.ts: parseCliStreamLine() for stream parsing
    • request-log.ts: logAgentError() for agent error logging
    • http.ts: writeSseHeaders() for SSE responses
  • Version handling
    • Version set to 0.2.0
    • CLI reads version from package.json so it stays in sync

Testing

Existing tests pass (npm test)
Build succeeds (npm run build)

- Split server.ts into handlers (health, models, chat-completions, anthropic-messages)
- Add workspace, agent-runner, request-listener modules
- Rename cursorCli, requestLog, modelMap to hyphen-case
- Extract buildAgentCmdArgs, resolveModel, parseCliStreamLine
- Add logAgentError and writeSseHeaders for shared error/SSE handling

Made-with: Cursor
- Bump version to 0.2.0
- CLI imports version from package.json for single source of truth
- Add resolveJsonModule to tsconfig for JSON imports

Made-with: Cursor
@anyrobert anyrobert self-assigned this Mar 4, 2026
@anyrobert anyrobert merged commit 7c93e45 into main Mar 4, 2026
@anyrobert anyrobert deleted the feature/claude branch March 14, 2026 17:05
anyrobert added a commit that referenced this pull request Mar 20, 2026
add claude code support on proxy
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.

Agent repeatedly attempts to read files instead of responding conversationally when using Claude Code mode

1 participant