@jonnyhoo/ccs 1.1.0 → 1.1.1

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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "enabledMcpjsonServers": [
3
+ "opencode"
4
+ ],
5
+ "enableAllProjectMcpServers": true
6
+ }
@@ -2,9 +2,9 @@
2
2
  "env": {
3
3
  "ANTHROPIC_BASE_URL": "http://127.0.0.1:8317/api/provider/codex",
4
4
  "ANTHROPIC_AUTH_TOKEN": "ccs-internal-managed",
5
- "ANTHROPIC_MODEL": "gpt-5.1-codex-max",
6
- "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.1-codex-max-high",
7
- "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.1-codex-max",
8
- "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.1-codex-mini-high"
5
+ "ANTHROPIC_MODEL": "gpt-5.3-codex",
6
+ "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.3-codex-xhigh",
7
+ "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.3-codex-high",
8
+ "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.3-codex-medium"
9
9
  }
10
10
  }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Anthropic-to-OpenAI Protocol Translation Proxy
3
+ *
4
+ * Translates Claude CLI's Anthropic Messages API requests into OpenAI Chat Completions API format.
5
+ * Used in direct API key mode to bypass CLIProxy entirely.
6
+ *
7
+ * Request flow:
8
+ * Claude CLI (Anthropic format) → this proxy → OpenAI-compatible endpoint
9
+ *
10
+ * Response flow:
11
+ * OpenAI-compatible endpoint → this proxy (translates SSE) → Claude CLI (Anthropic format)
12
+ *
13
+ * Handles:
14
+ * - Path rewriting: /v1/messages → /v1/chat/completions
15
+ * - Auth translation: x-api-key → Authorization: Bearer
16
+ * - Request body: Anthropic messages/tools/system → OpenAI format
17
+ * - Streaming response: OpenAI SSE chunks → Anthropic SSE events
18
+ * - Non-streaming response: OpenAI completion → Anthropic message
19
+ * - Tool calls and tool results
20
+ */
21
+ export interface AnthropicToOpenAIProxyConfig {
22
+ /** The user's OpenAI-compatible endpoint base URL (e.g., http://api.drlj.cn/openai) */
23
+ targetBaseUrl: string;
24
+ /** Bearer token for the target endpoint */
25
+ apiKey: string;
26
+ /** Enable verbose logging */
27
+ verbose?: boolean;
28
+ /** Request timeout in ms */
29
+ timeoutMs?: number;
30
+ }
31
+ export declare class AnthropicToOpenAIProxy {
32
+ private server;
33
+ private port;
34
+ private readonly config;
35
+ constructor(config: AnthropicToOpenAIProxyConfig);
36
+ private log;
37
+ start(): Promise<number>;
38
+ stop(): void;
39
+ private readBody;
40
+ private handleRequest;
41
+ private handleStreaming;
42
+ private handleNonStreaming;
43
+ }
44
+ //# sourceMappingURL=anthropic-to-openai-proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic-to-openai-proxy.d.ts","sourceRoot":"","sources":["../../src/cliproxy/anthropic-to-openai-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAQH,MAAM,WAAW,4BAA4B;IAC3C,uFAAuF;IACvF,aAAa,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8mBD,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqG;gBAEhH,MAAM,EAAE,4BAA4B;IAShD,OAAO,CAAC,GAAG;IAML,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAkB9B,IAAI,IAAI,IAAI;IAOZ,OAAO,CAAC,QAAQ;YAqBF,aAAa;YAgEb,eAAe;YAoLf,kBAAkB;CAsHjC"}