@zhongqian97-code/ecode 0.5.43 → 0.5.44
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.
package/README.md
CHANGED
|
@@ -53,6 +53,31 @@ Priority: **env vars > config file > defaults**
|
|
|
53
53
|
|
|
54
54
|
**`dangerousPatterns`** — list of command prefixes that require double confirmation. Setting this field replaces the entire default list.
|
|
55
55
|
|
|
56
|
+
### Multi-provider config
|
|
57
|
+
|
|
58
|
+
Configure multiple providers and switch between them:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"defaultProvider": "anthropic",
|
|
63
|
+
"providers": {
|
|
64
|
+
"anthropic": {
|
|
65
|
+
"baseUrl": "https://api.anthropic.com",
|
|
66
|
+
"apiKey": "sk-ant-...",
|
|
67
|
+
"model": "claude-sonnet-4-6",
|
|
68
|
+
"apiFormat": "anthropic"
|
|
69
|
+
},
|
|
70
|
+
"deepseek": {
|
|
71
|
+
"baseUrl": "https://api.deepseek.com/v1",
|
|
72
|
+
"apiKey": "sk-...",
|
|
73
|
+
"model": "deepseek-chat"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**`apiFormat`** — set to `"anthropic"` to use the native Anthropic Messages API. Auto-detected when `baseUrl` contains `"anthropic"`; required for Anthropic-compatible endpoints with custom URLs.
|
|
80
|
+
|
|
56
81
|
### Using with other providers
|
|
57
82
|
|
|
58
83
|
```bash
|
|
@@ -62,8 +87,8 @@ export ECODE_API_KEY=sk-...
|
|
|
62
87
|
export ECODE_MODEL=deepseek-chat
|
|
63
88
|
ecode
|
|
64
89
|
|
|
65
|
-
# Anthropic Claude (
|
|
66
|
-
export ECODE_BASE_URL=https://
|
|
90
|
+
# Anthropic Claude (native API — no proxy needed)
|
|
91
|
+
export ECODE_BASE_URL=https://api.anthropic.com
|
|
67
92
|
export ECODE_API_KEY=sk-ant-...
|
|
68
93
|
export ECODE_MODEL=claude-sonnet-4-6
|
|
69
94
|
ecode
|
|
@@ -279,7 +279,7 @@ function createAnthropicProvider(profile) {
|
|
|
279
279
|
}
|
|
280
280
|
async function* streamAnthropicResponse(profile, messages, tools, signal) {
|
|
281
281
|
const { system, anthropicMessages } = convertMessagesToAnthropic(messages);
|
|
282
|
-
const endpointUrl = new URL2(`${profile.baseUrl.replace(/\/$/, "")}/v1/messages`);
|
|
282
|
+
const endpointUrl = new URL2(`${profile.baseUrl.replace(/\/v1\/?$/, "").replace(/\/$/, "")}/v1/messages`);
|
|
283
283
|
const requestBody = {
|
|
284
284
|
model: profile.model,
|
|
285
285
|
max_tokens: 8192,
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
todo,
|
|
36
36
|
webFetch,
|
|
37
37
|
writeFile
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-I4VLKL2I.js";
|
|
39
39
|
import {
|
|
40
40
|
createSessionMetadata,
|
|
41
41
|
generateTitle,
|
|
@@ -923,6 +923,6 @@ Node.js 16/18 \u8BF7\u4F7F\u7528 --web \u6216 --pipe \u6A21\u5F0F\u3002
|
|
|
923
923
|
);
|
|
924
924
|
process.exit(1);
|
|
925
925
|
}
|
|
926
|
-
const { App, React, render } = await import("./ui-
|
|
926
|
+
const { App, React, render } = await import("./ui-3K5WAFNO.js");
|
|
927
927
|
render(React.createElement(App, { config: finalConfig, version: VERSION, autoMode, registry, trustedSkillDirs, initialMessages }));
|
|
928
928
|
}
|