@hasna/switcher 0.2.21 → 0.2.22
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 +2 -0
- package/dist/claude-context.d.ts +16 -0
- package/dist/claude-desktop.js +95 -95
- package/dist/cli/index.js +20 -8
- package/dist/index.js +96 -96
- package/dist/mcp/index.js +100 -100
- package/dist/sdk.js +96 -96
- package/dist/serve/index.js +2 -2
- package/openapi.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -715,6 +715,8 @@ Claude Code with a non-Claude model is experimental and unsupported by Anthropic
|
|
|
715
715
|
|
|
716
716
|
For Claude Code using the official DeepSeek Messages endpoint, Switcher defaults `CLAUDE_CODE_AUTO_COMPACT_WINDOW` to `786432`, following [DeepSeek's integration guidance](https://api-docs.deepseek.com/quick_start/agent_integrations/claude_code/). An explicitly set environment value takes precedence. Recognized provider context-overflow errors become a sanitized `prompt is too long` error so the native client can compact or guide recovery; unrelated errors retain the sanitized upstream status. Existing launches must pick up the compaction setting or start a new launch to use this default.
|
|
717
717
|
|
|
718
|
+
When a catalog model declares a context window of at least 1,000,000 tokens, Switcher hands it to Claude Code with Claude's `[1m]` suffix (for example `deepseek-flash[1m]`) in `--model`, the model variables and the picker. Without it, Claude Code treats the model as a 200k-token one and compacts near 168k whatever `CLAUDE_CODE_AUTO_COMPACT_WINDOW` says. Claude strips the suffix before calling the provider, so the provider and the gateway see the catalog id.
|
|
719
|
+
|
|
718
720
|
DeepSeek officially released V4.1 Flash on 2026-09-10. Its API model ID is `deepseek-flash`, as documented in the [official release notes](https://api-docs.deepseek.com/updates/) and [API quick start](https://api-docs.deepseek.com/). New DeepSeek presets include that model with text/image input and tool support, and support Chat Completions, Anthropic Messages, and Responses (for Codex). Saved providers and profiles keep their existing model selections. Configure an existing provider explicitly to adopt the new model:
|
|
719
721
|
|
|
720
722
|
```sh
|
package/dist/claude-context.d.ts
CHANGED
|
@@ -3,3 +3,19 @@
|
|
|
3
3
|
* Inspect the original provider URL: the native URL is a loopback gateway.
|
|
4
4
|
*/
|
|
5
5
|
export declare function claudeContextEnvironment(providerBaseUrl: string, environment?: NodeJS.ProcessEnv): Record<string, string>;
|
|
6
|
+
/** Claude Code treats a model it doesn't know as a 200k-token one and compacts near 168k, even when
|
|
7
|
+
* the provider serves more and CLAUDE_CODE_AUTO_COMPACT_WINDOW is higher (measured on DeepSeek flash,
|
|
8
|
+
* 30.10). The `[1m]` suffix tells it the window is 1M; Claude strips it before calling the provider.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CLAUDE_ONE_MILLION_CONTEXT = 1000000;
|
|
11
|
+
/** The model id Claude Code is given for a catalog entry: with `[1m]` when the catalog declares a
|
|
12
|
+
* window of at least 1M tokens, otherwise unchanged. */
|
|
13
|
+
export declare function claudeNativeModelId(id: string, models: readonly {
|
|
14
|
+
id: string;
|
|
15
|
+
contextWindow?: number;
|
|
16
|
+
}[]): string;
|
|
17
|
+
/** Apply claudeNativeModelId to the model variables of a Claude environment, leaving the rest as is. */
|
|
18
|
+
export declare function claudeNativeModelEnvironment(env: Record<string, string> | undefined, models: readonly {
|
|
19
|
+
id: string;
|
|
20
|
+
contextWindow?: number;
|
|
21
|
+
}[]): Record<string, string>;
|