dsh-plugin-subscriptions 0.5.3 → 0.6.0
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 +45 -6
- package/README.zh.md +43 -4
- package/lib/auth/rpc.d.ts +36 -2
- package/lib/auth/rpc.js +47 -5
- package/lib/client/ImageGenerateToolview.d.ts +1 -1
- package/lib/client/SpeedSelect.d.ts +25 -2
- package/lib/client/SpeedSelect.js +10 -6
- package/lib/client/SubscriptionsSection.d.ts +74 -0
- package/lib/client/SubscriptionsSection.js +325 -4
- package/lib/client/VideoGenerateToolview.d.ts +1 -1
- package/lib/client/index.d.ts +1 -9
- package/lib/client/index.js +7 -4
- package/lib/client/locales.d.ts +28 -0
- package/lib/client/locales.js +28 -0
- package/lib/client.js +458 -10
- package/lib/client.js.map +1 -1
- package/lib/compat.d.ts +36 -0
- package/lib/compat.js +20 -0
- package/lib/index.d.ts +5 -1
- package/lib/index.js +865 -111
- package/lib/model-defaults.d.ts +23 -0
- package/lib/model-defaults.js +237 -0
- package/lib/providers/claude.d.ts +24 -3
- package/lib/providers/claude.js +35 -24
- package/lib/providers/codex.d.ts +21 -0
- package/lib/providers/codex.js +37 -10
- package/lib/providers/common.d.ts +70 -6
- package/lib/providers/common.js +118 -19
- package/lib/providers/copilot.d.ts +10 -0
- package/lib/providers/copilot.js +21 -8
- package/lib/providers/grok.d.ts +21 -0
- package/lib/providers/grok.js +37 -7
- package/lib/providers/pool-usage.d.ts +23 -2
- package/lib/providers/pool-usage.js +70 -15
- package/lib/providers/rate-limit.d.ts +192 -0
- package/lib/providers/rate-limit.js +338 -0
- package/lib/translate/anthropic.js +5 -4
- package/lib/translate/chat-completions.js +5 -4
- package/lib/translate/responses.js +5 -4
- package/package.json +21 -21
- package/lib/providers/antigravity.d.ts +0 -90
- package/lib/providers/antigravity.js +0 -392
- package/lib/translate/antigravity.d.ts +0 -110
- package/lib/translate/antigravity.js +0 -303
package/lib/compat.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-build compatibility with both published dsh lines (issue #53).
|
|
3
|
+
*
|
|
4
|
+
* dsh 0.1.2-alpha renamed `CallId` to `ToolCallId` in `@deepseek-ai/dsh-llm`.
|
|
5
|
+
* A named import of either symbol is an ESM link-time failure on the other
|
|
6
|
+
* line (the module executes before any code runs, so the whole profile boot
|
|
7
|
+
* dies). A namespace import never link-fails, and both constructors are pure
|
|
8
|
+
* type brands (`id as Branded`), so one runtime lookup serves both lines.
|
|
9
|
+
*
|
|
10
|
+
* `RpcResult` also moved homes: rc.2 ships it from the removed
|
|
11
|
+
* `@deepseek-ai/dsh-host-apiproxy/api`, the alpha as `ConnectionRpcResult`
|
|
12
|
+
* from `@deepseek-ai/dsh-client-connection`. Both are the same structural
|
|
13
|
+
* shape, so this local mirror avoids importing from either package.
|
|
14
|
+
*/
|
|
15
|
+
import type { ContentBlock } from '@deepseek-ai/dsh-llm';
|
|
16
|
+
/** The branded tool-call id of whichever dsh-llm line is installed. */
|
|
17
|
+
export type ToolCallId = Extract<ContentBlock, {
|
|
18
|
+
type: 'tool-call';
|
|
19
|
+
}>['id'];
|
|
20
|
+
/** Brand a string as a tool-call id: alpha's `ToolCallId`, rc.2's `CallId`. */
|
|
21
|
+
export declare const ToolCallId: (id: string) => ToolCallId;
|
|
22
|
+
/**
|
|
23
|
+
* Structural mirror of the RPC result both dsh lines use (rc.2's apiproxy
|
|
24
|
+
* `RpcResult`, the alpha's connection `ConnectionRpcResult`).
|
|
25
|
+
*/
|
|
26
|
+
export type RpcResult<T> = {
|
|
27
|
+
ok: true;
|
|
28
|
+
value: T;
|
|
29
|
+
} | {
|
|
30
|
+
ok: false;
|
|
31
|
+
error: {
|
|
32
|
+
code: string;
|
|
33
|
+
message: string;
|
|
34
|
+
details: object;
|
|
35
|
+
};
|
|
36
|
+
};
|
package/lib/compat.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-build compatibility with both published dsh lines (issue #53).
|
|
3
|
+
*
|
|
4
|
+
* dsh 0.1.2-alpha renamed `CallId` to `ToolCallId` in `@deepseek-ai/dsh-llm`.
|
|
5
|
+
* A named import of either symbol is an ESM link-time failure on the other
|
|
6
|
+
* line (the module executes before any code runs, so the whole profile boot
|
|
7
|
+
* dies). A namespace import never link-fails, and both constructors are pure
|
|
8
|
+
* type brands (`id as Branded`), so one runtime lookup serves both lines.
|
|
9
|
+
*
|
|
10
|
+
* `RpcResult` also moved homes: rc.2 ships it from the removed
|
|
11
|
+
* `@deepseek-ai/dsh-host-apiproxy/api`, the alpha as `ConnectionRpcResult`
|
|
12
|
+
* from `@deepseek-ai/dsh-client-connection`. Both are the same structural
|
|
13
|
+
* shape, so this local mirror avoids importing from either package.
|
|
14
|
+
*/
|
|
15
|
+
import * as llm from '@deepseek-ai/dsh-llm';
|
|
16
|
+
/** Brand a string as a tool-call id: alpha's `ToolCallId`, rc.2's `CallId`. */
|
|
17
|
+
export const ToolCallId = (() => {
|
|
18
|
+
const exports = llm;
|
|
19
|
+
return (exports['ToolCallId'] ?? exports['CallId']);
|
|
20
|
+
})();
|
package/lib/index.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
10
10
|
import z from '@deepseek-ai/schemastery';
|
|
11
11
|
import type { ProviderId } from './auth/store.js';
|
|
12
12
|
import type { ModelEntry } from './providers/common.js';
|
|
13
|
+
import type { RateLimitConfig } from './providers/rate-limit.js';
|
|
13
14
|
import type { PoolMemberRef } from './providers/pool-family.js';
|
|
14
15
|
export type { ModelEntry, ProviderUsage, UsageWindow } from './providers/common.js';
|
|
16
|
+
export type { RateLimitConfig, RateLimitWait } from './providers/rate-limit.js';
|
|
15
17
|
export type { ProviderStatus } from './auth/rpc.js';
|
|
16
18
|
export type { ClaudeSession, CodexSession, CopilotSession, GrokSession, ProviderId } from './auth/store.js';
|
|
17
19
|
export declare const name = "dsh-plugin-subscriptions";
|
|
@@ -23,10 +25,12 @@ export declare const POOL_USAGE_TIMEOUT_MS = 10000;
|
|
|
23
25
|
export { withTimeout } from './providers/common.js';
|
|
24
26
|
/** Plugin config, validated by the same-named schemastery schema. */
|
|
25
27
|
export interface Config {
|
|
26
|
-
/** Provider routes to register; defaults to all
|
|
28
|
+
/** Provider routes to register; defaults to all four. */
|
|
27
29
|
providers?: ProviderId[];
|
|
28
30
|
/** Maximum provider idle time while one stream read is outstanding (default five minutes). */
|
|
29
31
|
streamIdleTimeoutMs?: number;
|
|
32
|
+
/** Whether and how long a route waits out a closed rate-limit window. */
|
|
33
|
+
rateLimit?: RateLimitConfig;
|
|
30
34
|
/** Advisory model catalogs overriding the built-in defaults, per provider. */
|
|
31
35
|
models?: {
|
|
32
36
|
codex?: ModelEntry[];
|