ccproxy-api 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccproxy_api-0.1.3/.mcp.json +37 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.pre-commit-config.yaml +7 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/CHANGELOG.md +40 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/Makefile +8 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/PKG-INFO +63 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/README.md +59 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/_version.py +2 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/adapters/openai/__init__.py +1 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/adapters/openai/adapter.py +218 -180
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/adapters/openai/streaming.py +247 -65
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/__init__.py +0 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/app.py +173 -40
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/dependencies.py +62 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/errors.py +3 -7
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/headers.py +0 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/logging.py +4 -3
- ccproxy_api-0.1.3/ccproxy/api/middleware/request_content_logging.py +297 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/request_id.py +5 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/server_header.py +0 -4
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/routes/__init__.py +9 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/routes/claude.py +23 -32
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/routes/health.py +58 -4
- ccproxy_api-0.1.3/ccproxy/api/routes/mcp.py +171 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/routes/metrics.py +4 -8
- ccproxy_api-0.1.3/ccproxy/api/routes/permissions.py +217 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/routes/proxy.py +0 -53
- ccproxy_api-0.1.3/ccproxy/api/services/__init__.py +6 -0
- ccproxy_api-0.1.3/ccproxy/api/services/permission_service.py +368 -0
- ccproxy_api-0.1.3/ccproxy/api/ui/__init__.py +6 -0
- ccproxy_api-0.1.3/ccproxy/api/ui/permission_handler_protocol.py +33 -0
- ccproxy_api-0.1.3/ccproxy/api/ui/terminal_permission_handler.py +593 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/conditional.py +2 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/dependencies.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/oauth/models.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/oauth/routes.py +1 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/storage/json_file.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/storage/keyring.py +0 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/claude_sdk/__init__.py +2 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/claude_sdk/client.py +91 -8
- ccproxy_api-0.1.3/ccproxy/claude_sdk/converter.py +526 -0
- ccproxy_api-0.1.3/ccproxy/claude_sdk/options.py +189 -0
- ccproxy_api-0.1.3/ccproxy/claude_sdk/parser.py +200 -0
- ccproxy_api-0.1.3/ccproxy/claude_sdk/streaming.py +286 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/commands/__init__.py +5 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/commands/auth.py +2 -4
- ccproxy_api-0.1.3/ccproxy/cli/commands/permission_handler.py +553 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/commands/serve.py +30 -12
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/docker/params.py +0 -4
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/helpers.py +0 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/main.py +5 -16
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/options/claude_options.py +19 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/options/core_options.py +0 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/options/security_options.py +0 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/options/server_options.py +3 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/auth.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/claude.py +78 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/discovery.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/docker_settings.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/loader.py +1 -4
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/scheduler.py +20 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/security.py +7 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/server.py +5 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/settings.py +13 -7
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/validators.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/async_utils.py +1 -4
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/errors.py +45 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/http_transformers.py +4 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/interfaces.py +2 -2
- ccproxy_api-0.1.3/ccproxy/core/logging.py +191 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/middleware.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/proxy.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/transformers.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/types.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/models.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/protocol.py +0 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/models/__init__.py +41 -0
- ccproxy_api-0.1.3/ccproxy/models/claude_sdk.py +420 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/models/messages.py +45 -18
- ccproxy_api-0.1.3/ccproxy/models/permissions.py +115 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/models/requests.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/models/responses.py +29 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/access_logger.py +1 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/context.py +17 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/metrics.py +1 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/pushgateway.py +0 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/stats_printer.py +2 -4
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/storage/duckdb_simple.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/storage/models.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/pricing/cache.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/pricing/loader.py +5 -21
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/pricing/updater.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/scheduler/__init__.py +1 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/scheduler/core.py +6 -6
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/scheduler/manager.py +35 -7
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/scheduler/registry.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/scheduler/tasks.py +127 -2
- ccproxy_api-0.1.3/ccproxy/services/claude_sdk_service.py +510 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/services/credentials/manager.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/services/credentials/oauth_client.py +1 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/services/proxy_service.py +93 -222
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/testing/config.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/testing/mock_responses.py +0 -1
- ccproxy_api-0.1.3/ccproxy/utils/model_mapping.py +197 -0
- ccproxy_api-0.1.3/ccproxy/utils/models_provider.py +150 -0
- ccproxy_api-0.1.3/ccproxy/utils/simple_request_logger.py +284 -0
- ccproxy_api-0.1.3/ccproxy/utils/version_checker.py +184 -0
- ccproxy_api-0.1.3/cleanup.sh +13 -0
- ccproxy_api-0.1.3/debug_stream.sh +18 -0
- ccproxy_api-0.1.3/debug_stream_openai.sh +17 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/index.md +59 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/ai_code_discussion_demo.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/anthropic_tools_demo.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/client.py +1 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/common_utils.py +0 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/console_utils.py +0 -1
- ccproxy_api-0.1.3/examples/debug_anthropic_streaming.py +391 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_anthropic_conversation_demo.py +0 -6
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_structured_response_demo.py +1 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_thinking_demo.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_tools_demo.py +1 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/project_code_access_demo.py +1 -7
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/textual_chat_agent.py +2 -5
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/pyproject.toml +7 -0
- ccproxy_api-0.1.3/reddit.md +471 -0
- ccproxy_api-0.1.3/reddit_soft.md +101 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/benchmark_startup_node.py +1 -3
- ccproxy_api-0.1.3/test_logging.py +132 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/conftest.py +191 -34
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/factories/fastapi_factory.py +19 -5
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/claude_sdk/internal_mocks.py +110 -79
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/external_apis/anthropic_api.py +3 -2
- ccproxy_api-0.1.3/tests/helpers/__init__.py +1 -0
- ccproxy_api-0.1.3/tests/helpers/assertions.py +108 -0
- ccproxy_api-0.1.3/tests/helpers/test_data.py +150 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_access_logger_integration.py +33 -18
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_adapters.py +1 -2
- ccproxy_api-0.1.3/tests/test_api.py +459 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_auth.py +0 -7
- ccproxy_api-0.1.3/tests/test_claude_sdk_options.py +203 -0
- ccproxy_api-0.1.3/tests/test_claude_sdk_parser.py +417 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_cli_auth_commands.py +0 -5
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_cli_config.py +1 -8
- ccproxy_api-0.1.3/tests/test_cli_confirmation_handler.py +517 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_cli_serve.py +0 -1
- ccproxy_api-0.1.3/tests/test_confirmation_integration.py +361 -0
- ccproxy_api-0.1.3/tests/test_confirmation_routes.py +499 -0
- ccproxy_api-0.1.3/tests/test_confirmation_service.py +409 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_docker.py +0 -4
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_duckdb_lifecycle.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_http_transformers.py +2 -2
- ccproxy_api-0.1.3/tests/test_mcp_route.py +347 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_metrics_api.py +0 -6
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_observability.py +0 -1
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_pricing.py +2 -3
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_pushgateway_error_handling.py +0 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_queue_duckdb_storage.py +16 -9
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_reset_endpoint.py +18 -16
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_scheduler.py +21 -9
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_scheduler_tasks.py +252 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_sse_events.py +0 -2
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_sse_stream_filtering.py +1 -4
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_stats_printer.py +0 -2
- ccproxy_api-0.1.3/tests/test_streaming.py +135 -0
- ccproxy_api-0.1.3/tests/test_terminal_handler.py +202 -0
- ccproxy_api-0.1.3/tests/test_version_checker.py +317 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/uv.lock +328 -211
- ccproxy_api-0.1.2/ccproxy/claude_sdk/converter.py +0 -331
- ccproxy_api-0.1.2/ccproxy/claude_sdk/options.py +0 -142
- ccproxy_api-0.1.2/ccproxy/cli/commands/permission.py +0 -128
- ccproxy_api-0.1.2/ccproxy/core/logging.py +0 -189
- ccproxy_api-0.1.2/ccproxy/services/claude_sdk_service.py +0 -618
- ccproxy_api-0.1.2/tests/test_api.py +0 -637
- ccproxy_api-0.1.2/tests/test_streaming.py +0 -547
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.env.example +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.github/workflows/backend.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.github/workflows/build.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.github/workflows/ci.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.github/workflows/docs.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.github/workflows/frontend.yml.disabled +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.github/workflows/release.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.gitignore +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/.python-version +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/CONTRIBUTING.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/CONVENTIONS.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/Dockerfile +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/LICENSE +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/TESTING.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/__main__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/adapters/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/adapters/base.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/adapters/openai/models.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/auth.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/middleware/cors.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/api/responses.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/bearer.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/credentials_adapter.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/exceptions.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/manager.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/models.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/oauth/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/oauth/storage.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/storage/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/auth/storage/base.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/commands/config/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/commands/config/commands.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/commands/config/schema_commands.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/docker/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/docker/adapter_factory.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/cli/options/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/cors.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/observability.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/pricing.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/config/reverse_proxy.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/constants.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/http.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/system.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/core/validators.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/adapter.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/docker_path.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/middleware.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/stream_process.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/docker/validators.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/models/errors.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/models/types.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/sse_events.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/observability/storage/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/pricing/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/pricing/models.py +0 -0
- /ccproxy_api-0.1.2/ccproxy/scheduler/exceptions.py → /ccproxy_api-0.1.3/ccproxy/scheduler/errors.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/services/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/services/credentials/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/services/credentials/config.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/static/.keep +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/testing/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/testing/content_generation.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/testing/response_handlers.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/testing/scenarios.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/utils/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/utils/cost_calculator.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/ccproxy/utils/streaming_metrics.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/data/metrics.db +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/devenv.lock +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/devenv.nix +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docker-compose.monitoring.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docker-compose.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/README.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/api-reference.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/assets/extra.css +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/assets/extra.js +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/contributing.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/development/debugging-with-proxy.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/examples.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/gen_ref_pages.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/getting-started/configuration.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/getting-started/installation.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/getting-started/quickstart.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/metrics-api.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/observability.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/systemd-setup.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/user-guide/api-usage.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/user-guide/authentication.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/user-guide/claude-code-options.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/user-guide/claude-sdk-compatibility.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/user-guide/mcp-integration.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/user-guide/pool-configuration.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/docs/user-guide/understanding-pool-logs.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/README.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/README_chat_agent.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/anthropic_streaming_demo.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_claude_code_options_example.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_json_object_example.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_json_schema_example.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/openai_streaming_demo.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/examples/simple_thinking_demo.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/mkdocs.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/monitoring/grafana/dashboards/ccproxy-dashboard.json +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/monitoring/grafana/provisioning/dashboards/dashboard.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/monitoring/grafana/provisioning/datasources/victoria-metrics.yml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/act-run.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/build-docs.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/entrypoint.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/format_version.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/serve-docs.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/setup-systemd.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/setup.sh +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/scripts/traffic_generator.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/systemd/ccproxy.service.template +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/test_config/test-config.toml +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/factories/MIGRATION_GUIDE.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/factories/README.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/factories/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/MIGRATION_GUIDE.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/README.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/auth/MIGRATION_GUIDE.md +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/auth/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/auth/example_usage.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/claude_sdk/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/claude_sdk/responses.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/credentials.json +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/external_apis/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/proxy_service/__init__.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/proxy_service/oauth_mocks.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/fixtures/responses.json +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_duckdb_settings_integration.py +0 -0
- {ccproxy_api-0.1.2 → ccproxy_api-0.1.3}/tests/test_fastapi_factory.py +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"serena": {
|
|
4
|
+
"type": "stdio",
|
|
5
|
+
"command": "uvx",
|
|
6
|
+
"args": [
|
|
7
|
+
"--from",
|
|
8
|
+
"git+https://github.com/oraios/serena",
|
|
9
|
+
"serena-mcp-server",
|
|
10
|
+
"--context",
|
|
11
|
+
"ide-assistant",
|
|
12
|
+
"--project",
|
|
13
|
+
"/home/rick/projects-caddy/claude-code-proxy-api",
|
|
14
|
+
"--enable-web-dashboard",
|
|
15
|
+
"false"
|
|
16
|
+
],
|
|
17
|
+
"env": {}
|
|
18
|
+
},
|
|
19
|
+
"context7": {
|
|
20
|
+
"type": "stdio",
|
|
21
|
+
"command": "bunx",
|
|
22
|
+
"args": [
|
|
23
|
+
"-y",
|
|
24
|
+
"@upstash/context7-mcp"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"zen": {
|
|
28
|
+
"command": "uvx",
|
|
29
|
+
"args": [
|
|
30
|
+
"--from",
|
|
31
|
+
"git+https://github.com/BeehiveInnovations/zen-mcp-server.git",
|
|
32
|
+
"zen-mcp-server"
|
|
33
|
+
],
|
|
34
|
+
"env": {}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -52,6 +52,12 @@ repos:
|
|
|
52
52
|
- types-PyYAML>=6.0.12.12
|
|
53
53
|
- sqlmodel>=0.0.24
|
|
54
54
|
- duckdb-engine>=0.17.0
|
|
55
|
+
- tomli>=2.0.0
|
|
56
|
+
- fastapi-mcp>=0.1.0
|
|
57
|
+
- sse-starlette>=1.0.0
|
|
58
|
+
- textual>=3.7.1
|
|
59
|
+
- aiofiles>=24.1.0
|
|
60
|
+
- types-aiofiles>=24.0.0
|
|
55
61
|
args: [--config-file=pyproject.toml]
|
|
56
62
|
exclude: ^(docs/|examples/)
|
|
57
63
|
|
|
@@ -96,7 +102,7 @@ repos:
|
|
|
96
102
|
- id: debug-statements
|
|
97
103
|
- id: name-tests-test
|
|
98
104
|
args: [--pytest-test-first]
|
|
99
|
-
exclude: ^tests/(fixtures|factories)/
|
|
105
|
+
exclude: ^tests/(fixtures|factories|helpers)/
|
|
100
106
|
|
|
101
107
|
# Security checks
|
|
102
108
|
# - repo: https://github.com/PyCQA/bandit
|
|
@@ -5,24 +5,56 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.3] - 2025-07-25
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Version Update Checking**: Automatic version checking against GitHub releases with configurable intervals (default 12 hours) and startup checks
|
|
13
|
+
- **MCP Server Integration**: Added Model Context Protocol (MCP) server functionality with permission checking tools for Claude Code integration
|
|
14
|
+
- **Permission System**: Implemented comprehensive permission management with REST API endpoints and Server-Sent Events (SSE) streaming for real-time permission requests
|
|
15
|
+
- **Request/Response Logging**: Added comprehensive logging middleware with configurable verbosity levels (`CCPROXY_VERBOSE_API`, `CCPROXY_REQUEST_LOG_DIR`)
|
|
16
|
+
- **Claude SDK Custom Content Blocks**: Added support for `system_message`, `tool_use_sdk`, and `tool_result_sdk` content blocks with full metadata preservation
|
|
17
|
+
- **Model Mapping Utilities**: Centralized model provider abstraction with unified mapping logic in `ccproxy/utils/models_provider.py`
|
|
18
|
+
- **Terminal Permission Handler**: Interactive permission workflow handler for CLI-based permission management
|
|
19
|
+
- **Claude SDK Field Rendering**: Added flexible content handling with `forward`, `formatted`, and `ignore` rendering options for Claude SDK fields
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Claude SDK Integration**: Refactored to use native ThinkingBlock models from Claude Code SDK
|
|
24
|
+
- **Models Endpoint**: Centralized `/v1/models` endpoint implementation to eliminate code duplication across routes
|
|
25
|
+
- **OpenAI Adapter**: Enhanced with improved modularization and streaming architecture
|
|
26
|
+
- **Logging System**: Migrated to canonical structlog pattern for structured, consistent logging
|
|
27
|
+
- **SSE Streaming**: Improved Server-Sent Events format with comprehensive examples and better error handling
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- **SDK Double Content**: Resolved duplicate content issue in Claude SDK message processing
|
|
32
|
+
- **Error Handling**: Enhanced error handling throughout Claude SDK message processing pipeline
|
|
33
|
+
- **Type Safety**: Improved type checking across permission system components
|
|
34
|
+
- **Permission Handler**: Fixed lazy initialization issues in terminal permission handler
|
|
35
|
+
|
|
8
36
|
## [0.1.2] - 2025-07-22
|
|
9
37
|
|
|
10
38
|
### Added
|
|
39
|
+
|
|
11
40
|
- **Permission Mode Support**: Restored `--permission-mode` option supporting default, acceptEdits, and bypassPermissions modes
|
|
12
41
|
- **Custom Permission Tool**: Restored `--permission-prompt-tool-name` option to specify custom permission tool names
|
|
13
42
|
- **Permission Response Models**: Added `PermissionToolAllowResponse` and `PermissionToolDenyResponse` models with proper JSON serialization
|
|
14
43
|
|
|
15
44
|
### Changed
|
|
45
|
+
|
|
16
46
|
- **Message Formatting**: Modified `MessageConverter.combine_text_parts()` to join text parts with newlines instead of spaces, preserving formatting in multi-line content
|
|
17
47
|
- **Settings Integration**: Enhanced OptionsHandler to apply default Claude options from settings before API parameters
|
|
18
48
|
- **Configuration**: Extended settings to persist permission_mode and permission_prompt_tool_name
|
|
19
49
|
|
|
20
50
|
### Fixed
|
|
51
|
+
|
|
21
52
|
- **Claude SDK Options**: Integrated Settings dependency into ClaudeSDKService to support configuration-based options
|
|
22
53
|
|
|
23
54
|
## [0.1.1] - 2025-07-22
|
|
24
55
|
|
|
25
56
|
### Added
|
|
57
|
+
|
|
26
58
|
- **Conditional Authentication**: API endpoints now support optional authentication - when `SECURITY__AUTH_TOKEN` is configured, authentication is enforced; when not configured, the proxy runs in open mode.
|
|
27
59
|
- **Startup Validation**: Added comprehensive validation checks during application startup:
|
|
28
60
|
- Validates OAuth credentials and warns about expired tokens
|
|
@@ -32,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
32
64
|
- **Alternative Entry Point**: Added `ccproxy-api` as an alternative command-line entry point.
|
|
33
65
|
|
|
34
66
|
### Changed
|
|
67
|
+
|
|
35
68
|
- **Authentication Variable**: Renamed environment variable from `AUTH_TOKEN` to `SECURITY__AUTH_TOKEN` for better namespace organization and clarity.
|
|
36
69
|
- **Credential Priority**: Reordered credential search paths to prioritize ccproxy-specific credentials before Claude CLI paths.
|
|
37
70
|
- **CLI Syntax**: Migrated all CLI parameters to modern Annotated syntax for better type safety and IDE support.
|
|
@@ -39,11 +72,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
39
72
|
- **Documentation**: Improved Aider integration docs with correct API endpoint URLs and added installation options (uv, pipx).
|
|
40
73
|
|
|
41
74
|
### Fixed
|
|
75
|
+
|
|
42
76
|
- **Authentication Separation**: Fixed critical issue where auth token was incorrectly used for both client and upstream authentication - now client auth token is separate from OAuth credentials.
|
|
43
77
|
- **URL Paths**: Fixed documentation to use `/api` endpoints for Aider compatibility instead of SDK mode paths.
|
|
44
78
|
- **Default Values**: Fixed default values for list parameters in CLI (docker_env, docker_volume, docker_arg).
|
|
45
79
|
|
|
46
80
|
### Removed
|
|
81
|
+
|
|
47
82
|
- **Status Endpoints**: Removed redundant `/status` endpoints from both Claude SDK and proxy routes.
|
|
48
83
|
- **Permission Tool**: Removed Claude permission tool functionality and related CLI options (`--permission-mode`, `--permission-prompt-tool-name`) that are no longer needed.
|
|
49
84
|
- **Deprecated Options**: Removed references to deprecated permission_mode and permission_prompt_tool_name from documentation.
|
|
@@ -55,12 +90,14 @@ This is the initial public release of the CCProxy API.
|
|
|
55
90
|
### Added
|
|
56
91
|
|
|
57
92
|
#### Core Functionality
|
|
93
|
+
|
|
58
94
|
- **Personal Claude Access**: Enables using a personal Claude Pro, Team, or Enterprise subscription as an API endpoint, without needing separate API keys.
|
|
59
95
|
- **OAuth2 Authentication**: Implements the official Claude OAuth2 flow for secure, local authentication.
|
|
60
96
|
- **Local Proxy Server**: Runs a lightweight FastAPI server on your local machine.
|
|
61
97
|
- **HTTP/HTTPS Proxy Support**: Full support for routing requests through an upstream HTTP or HTTPS proxy.
|
|
62
98
|
|
|
63
99
|
#### API & Compatibility
|
|
100
|
+
|
|
64
101
|
- **Dual API Support**: Provides full compatibility with both Anthropic and OpenAI API specifications.
|
|
65
102
|
- **Anthropic Messages API**: Native support for the Anthropic Messages API at `/v1/chat/completions`.
|
|
66
103
|
- **OpenAI Chat Completions API**: Compatibility layer for the OpenAI Chat Completions API at `/openai/v1/chat/completions`.
|
|
@@ -70,6 +107,7 @@ This is the initial public release of the CCProxy API.
|
|
|
70
107
|
- **Health Check**: A `/health` endpoint for monitoring the proxy's status.
|
|
71
108
|
|
|
72
109
|
#### Configuration & CLI
|
|
110
|
+
|
|
73
111
|
- **Unified `ccproxy` CLI**: A single, user-friendly command-line interface for managing the proxy.
|
|
74
112
|
- **TOML Configuration**: Configure the server using a `config.toml` file with JSON Schema validation.
|
|
75
113
|
- **Keyring Integration**: Securely stores and manages OAuth credentials in the system's native keyring.
|
|
@@ -78,11 +116,13 @@ This is the initial public release of the CCProxy API.
|
|
|
78
116
|
- **Docker Support**: A `Dockerfile` and `docker-compose.yml` for running the proxy in an isolated containerized environment.
|
|
79
117
|
|
|
80
118
|
#### Security
|
|
119
|
+
|
|
81
120
|
- **Local-First Design**: All processing and authentication happens locally; no conversation data is stored or transmitted to third parties.
|
|
82
121
|
- **Credential Security**: OAuth tokens are stored securely in the system keyring, not in plaintext files.
|
|
83
122
|
- **Header Stripping**: Automatically removes client-side `Authorization` headers to prevent accidental key leakage.
|
|
84
123
|
|
|
85
124
|
#### Developer Experience
|
|
125
|
+
|
|
86
126
|
- **Comprehensive Documentation**: Includes a quick start guide, API reference, and setup instructions.
|
|
87
127
|
- **Pre-commit Hooks**: Configured for automated code formatting and linting to ensure code quality.
|
|
88
128
|
- **Modern Tooling**: Uses `uv` for package management and `devenv` for a reproducible development environment.
|
|
@@ -146,8 +146,15 @@ lint:
|
|
|
146
146
|
uv run ruff check .
|
|
147
147
|
|
|
148
148
|
lint-fix: format
|
|
149
|
-
|
|
149
|
+
# fix F401 (unused import) errors
|
|
150
|
+
uv run ruff check --select F401 --fix .
|
|
151
|
+
# fix sort (import) errors
|
|
150
152
|
uv run ruff check --select I --fix .
|
|
153
|
+
# classic fix
|
|
154
|
+
uv run ruff check --fix .
|
|
155
|
+
# unsafe fix
|
|
156
|
+
uv run ruff check --unsafe-fixes --fix .
|
|
157
|
+
uv run ruff format .
|
|
151
158
|
|
|
152
159
|
typecheck:
|
|
153
160
|
uv run mypy .
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ccproxy-api
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: API server that provides an Anthropic and OpenAI compatible interface over Claude Code, allowing to use your Claude OAuth account or over the API.
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: aiofiles>=24.1.0
|
|
7
8
|
Requires-Dist: aiosqlite>=0.21.0
|
|
8
9
|
Requires-Dist: claude-code-sdk>=0.0.14
|
|
9
10
|
Requires-Dist: duckdb-engine>=0.17.0
|
|
10
11
|
Requires-Dist: duckdb>=1.1.0
|
|
12
|
+
Requires-Dist: fastapi-mcp
|
|
11
13
|
Requires-Dist: fastapi[standard]>=0.115.14
|
|
12
14
|
Requires-Dist: httpx-sse>=0.4.1
|
|
13
15
|
Requires-Dist: httpx>=0.28.1
|
|
@@ -21,6 +23,7 @@ Requires-Dist: rich-toolkit>=0.14.8
|
|
|
21
23
|
Requires-Dist: rich>=13.0.0
|
|
22
24
|
Requires-Dist: sqlmodel>=0.0.24
|
|
23
25
|
Requires-Dist: structlog>=25.4.0
|
|
26
|
+
Requires-Dist: textual>=3.7.1
|
|
24
27
|
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
|
|
25
28
|
Requires-Dist: typer>=0.16.0
|
|
26
29
|
Requires-Dist: typing-extensions>=4.0.0
|
|
@@ -32,7 +35,7 @@ Description-Content-Type: text/markdown
|
|
|
32
35
|
`ccproxy` is a local reverse proxy server for Anthropic Claude LLM at `api.anthropic.com/v1/messages`. It allows you to use your existing Claude Max subscription to interact with the Anthropic API, bypassing the need for separate API key billing.
|
|
33
36
|
|
|
34
37
|
The server provides two primary modes of operation:
|
|
35
|
-
* **SDK Mode (`/sdk`):** Routes requests through the local `claude-code-sdk`. This enables access to tools configured in your Claude environment.
|
|
38
|
+
* **SDK Mode (`/sdk`):** Routes requests through the local `claude-code-sdk`. This enables access to tools configured in your Claude environment and includes an integrated MCP (Model Context Protocol) server for permission management.
|
|
36
39
|
* **API Mode (`/api`):** Acts as a direct reverse proxy, injecting the necessary authentication headers. This provides full access to the underlying API features and model settings.
|
|
37
40
|
|
|
38
41
|
It includes a translation layer to support both Anthropic and OpenAI-compatible API formats for requests and responses, including streaming.
|
|
@@ -126,6 +129,59 @@ export ANTHROPIC_API_KEY="dummy-key"
|
|
|
126
129
|
```
|
|
127
130
|
|
|
128
131
|
|
|
132
|
+
## MCP Server Integration & Permission System
|
|
133
|
+
|
|
134
|
+
In SDK mode, CCProxy automatically configures an MCP (Model Context Protocol) server that provides permission checking tools for Claude Code. This enables interactive permission management for tool execution.
|
|
135
|
+
|
|
136
|
+
### Permission Management
|
|
137
|
+
|
|
138
|
+
**Starting the Permission Handler:**
|
|
139
|
+
```bash
|
|
140
|
+
# In a separate terminal, start the permission handler
|
|
141
|
+
ccproxy permission-handler
|
|
142
|
+
|
|
143
|
+
# Or with custom settings
|
|
144
|
+
ccproxy permission-handler --host 127.0.0.1 --port 8000
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The permission handler provides:
|
|
148
|
+
- **Real-time Permission Requests**: Streams permission requests via Server-Sent Events (SSE)
|
|
149
|
+
- **Interactive Approval/Denial**: Command-line interface for managing tool permissions
|
|
150
|
+
- **Automatic MCP Integration**: Works seamlessly with Claude Code SDK tools
|
|
151
|
+
|
|
152
|
+
**Working Directory Control:**
|
|
153
|
+
Control which project the Claude SDK API can access using the `--cwd` flag:
|
|
154
|
+
```bash
|
|
155
|
+
# Set working directory for Claude SDK
|
|
156
|
+
ccproxy --claude-code-options-cwd /path/to/your/project
|
|
157
|
+
|
|
158
|
+
# Example with permission bypass and formatted output
|
|
159
|
+
ccproxy --claude-code-options-cwd /tmp/tmp.AZyCo5a42N \
|
|
160
|
+
--claude-code-options-permission-mode bypassPermissions \
|
|
161
|
+
--claude-sdk-message-mode formatted
|
|
162
|
+
|
|
163
|
+
# Alternative: Change to project directory and start ccproxy
|
|
164
|
+
cd /path/to/your/project
|
|
165
|
+
ccproxy
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Claude SDK Message Formatting
|
|
169
|
+
|
|
170
|
+
CCProxy supports flexible message formatting through the `sdk_message_mode` configuration:
|
|
171
|
+
|
|
172
|
+
- **`forward`** (default): Preserves original Claude SDK content blocks with full metadata
|
|
173
|
+
- **`formatted`**: Converts content to XML tags with pretty-printed JSON data
|
|
174
|
+
- **`ignore`**: Filters out Claude SDK-specific content entirely
|
|
175
|
+
|
|
176
|
+
Configure via environment variables:
|
|
177
|
+
```bash
|
|
178
|
+
# Use formatted XML output
|
|
179
|
+
CLAUDE__SDK_MESSAGE_MODE=formatted ccproxy
|
|
180
|
+
|
|
181
|
+
# Use compact formatting without pretty-printing
|
|
182
|
+
CLAUDE__PRETTY_FORMAT=false ccproxy
|
|
183
|
+
```
|
|
184
|
+
|
|
129
185
|
## Using with Aider
|
|
130
186
|
|
|
131
187
|
CCProxy works seamlessly with Aider and other AI coding assistants:
|
|
@@ -200,6 +256,11 @@ The proxy exposes endpoints under two prefixes, corresponding to its operating m
|
|
|
200
256
|
* `GET /sdk/models`, `GET /api/models`
|
|
201
257
|
* `GET /sdk/status`, `GET /api/status`
|
|
202
258
|
* `GET /oauth/callback`
|
|
259
|
+
* **MCP & Permissions:**
|
|
260
|
+
* `POST /mcp/permission/check` - MCP permission checking endpoint
|
|
261
|
+
* `GET /permissions/stream` - SSE stream for permission requests
|
|
262
|
+
* `GET /permissions/{id}` - Get permission request details
|
|
263
|
+
* `POST /permissions/{id}/respond` - Respond to permission request
|
|
203
264
|
* **Observability (Optional):**
|
|
204
265
|
* `GET /metrics`
|
|
205
266
|
* `GET /logs/status`, `GET /logs/query`
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`ccproxy` is a local reverse proxy server for Anthropic Claude LLM at `api.anthropic.com/v1/messages`. It allows you to use your existing Claude Max subscription to interact with the Anthropic API, bypassing the need for separate API key billing.
|
|
4
4
|
|
|
5
5
|
The server provides two primary modes of operation:
|
|
6
|
-
* **SDK Mode (`/sdk`):** Routes requests through the local `claude-code-sdk`. This enables access to tools configured in your Claude environment.
|
|
6
|
+
* **SDK Mode (`/sdk`):** Routes requests through the local `claude-code-sdk`. This enables access to tools configured in your Claude environment and includes an integrated MCP (Model Context Protocol) server for permission management.
|
|
7
7
|
* **API Mode (`/api`):** Acts as a direct reverse proxy, injecting the necessary authentication headers. This provides full access to the underlying API features and model settings.
|
|
8
8
|
|
|
9
9
|
It includes a translation layer to support both Anthropic and OpenAI-compatible API formats for requests and responses, including streaming.
|
|
@@ -97,6 +97,59 @@ export ANTHROPIC_API_KEY="dummy-key"
|
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
|
|
100
|
+
## MCP Server Integration & Permission System
|
|
101
|
+
|
|
102
|
+
In SDK mode, CCProxy automatically configures an MCP (Model Context Protocol) server that provides permission checking tools for Claude Code. This enables interactive permission management for tool execution.
|
|
103
|
+
|
|
104
|
+
### Permission Management
|
|
105
|
+
|
|
106
|
+
**Starting the Permission Handler:**
|
|
107
|
+
```bash
|
|
108
|
+
# In a separate terminal, start the permission handler
|
|
109
|
+
ccproxy permission-handler
|
|
110
|
+
|
|
111
|
+
# Or with custom settings
|
|
112
|
+
ccproxy permission-handler --host 127.0.0.1 --port 8000
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The permission handler provides:
|
|
116
|
+
- **Real-time Permission Requests**: Streams permission requests via Server-Sent Events (SSE)
|
|
117
|
+
- **Interactive Approval/Denial**: Command-line interface for managing tool permissions
|
|
118
|
+
- **Automatic MCP Integration**: Works seamlessly with Claude Code SDK tools
|
|
119
|
+
|
|
120
|
+
**Working Directory Control:**
|
|
121
|
+
Control which project the Claude SDK API can access using the `--cwd` flag:
|
|
122
|
+
```bash
|
|
123
|
+
# Set working directory for Claude SDK
|
|
124
|
+
ccproxy --claude-code-options-cwd /path/to/your/project
|
|
125
|
+
|
|
126
|
+
# Example with permission bypass and formatted output
|
|
127
|
+
ccproxy --claude-code-options-cwd /tmp/tmp.AZyCo5a42N \
|
|
128
|
+
--claude-code-options-permission-mode bypassPermissions \
|
|
129
|
+
--claude-sdk-message-mode formatted
|
|
130
|
+
|
|
131
|
+
# Alternative: Change to project directory and start ccproxy
|
|
132
|
+
cd /path/to/your/project
|
|
133
|
+
ccproxy
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Claude SDK Message Formatting
|
|
137
|
+
|
|
138
|
+
CCProxy supports flexible message formatting through the `sdk_message_mode` configuration:
|
|
139
|
+
|
|
140
|
+
- **`forward`** (default): Preserves original Claude SDK content blocks with full metadata
|
|
141
|
+
- **`formatted`**: Converts content to XML tags with pretty-printed JSON data
|
|
142
|
+
- **`ignore`**: Filters out Claude SDK-specific content entirely
|
|
143
|
+
|
|
144
|
+
Configure via environment variables:
|
|
145
|
+
```bash
|
|
146
|
+
# Use formatted XML output
|
|
147
|
+
CLAUDE__SDK_MESSAGE_MODE=formatted ccproxy
|
|
148
|
+
|
|
149
|
+
# Use compact formatting without pretty-printing
|
|
150
|
+
CLAUDE__PRETTY_FORMAT=false ccproxy
|
|
151
|
+
```
|
|
152
|
+
|
|
100
153
|
## Using with Aider
|
|
101
154
|
|
|
102
155
|
CCProxy works seamlessly with Aider and other AI coding assistants:
|
|
@@ -171,6 +224,11 @@ The proxy exposes endpoints under two prefixes, corresponding to its operating m
|
|
|
171
224
|
* `GET /sdk/models`, `GET /api/models`
|
|
172
225
|
* `GET /sdk/status`, `GET /api/status`
|
|
173
226
|
* `GET /oauth/callback`
|
|
227
|
+
* **MCP & Permissions:**
|
|
228
|
+
* `POST /mcp/permission/check` - MCP permission checking endpoint
|
|
229
|
+
* `GET /permissions/stream` - SSE stream for permission requests
|
|
230
|
+
* `GET /permissions/{id}` - Get permission request details
|
|
231
|
+
* `POST /permissions/{id}/respond` - Respond to permission request
|
|
174
232
|
* **Observability (Optional):**
|
|
175
233
|
* `GET /metrics`
|
|
176
234
|
* `GET /logs/status`, `GET /logs/query`
|
|
@@ -4,7 +4,7 @@ This module provides the OpenAI adapter implementation for converting
|
|
|
4
4
|
between OpenAI and Anthropic API formats.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from .adapter import OpenAIAdapter
|
|
7
|
+
from .adapter import OpenAIAdapter
|
|
8
8
|
from .models import (
|
|
9
9
|
OpenAIChatCompletionResponse,
|
|
10
10
|
OpenAIChoice,
|
|
@@ -24,7 +24,6 @@ from .streaming import OpenAISSEFormatter, OpenAIStreamProcessor
|
|
|
24
24
|
__all__ = [
|
|
25
25
|
# Adapter
|
|
26
26
|
"OpenAIAdapter",
|
|
27
|
-
"map_openai_model_to_claude",
|
|
28
27
|
# Models
|
|
29
28
|
"OpenAIMessage",
|
|
30
29
|
"OpenAIMessageContent",
|