@mars-sea/dsh-commandcode-provider 0.12.10 → 0.13.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/CHANGELOG.md +20 -0
- package/README.md +10 -10
- package/README.zh-CN.md +5 -4
- package/lib/client.js +1201 -87
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +81 -8
- package/lib/index.js +690 -110
- package/lib/index.js.map +1 -1
- package/package.json +37 -38
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import z from "@deepseek-ai/schemastery";
|
|
2
1
|
import { GenerateOptions, LlmAdapter, LlmError, LlmImageRequestPricing, LlmModelInfo, LlmProviderInfo, LlmResolvedModelInfo, ResolvedRetryPolicy, StreamChunk, projectOffloadedImages, requiredImageOffload } from "@deepseek-ai/dsh-llm";
|
|
2
|
+
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { CredentialRef } from "@deepseek-ai/dsh-credentials";
|
|
4
4
|
import { TypertRemoteService, TypertSchema } from "@deepseek-ai/dsh-typert-protocol";
|
|
5
5
|
import { WebRuntime, WebSearchProvider, WebSearchRequest, WebSearchResult } from "@deepseek-ai/dsh-web";
|
|
@@ -61,7 +61,7 @@ type CommandCodeProtocol = 'cli' | 'openai' | 'messages';
|
|
|
61
61
|
declare const DEFAULT_MAX_OUTPUT_TOKENS = 131072;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/adapter.d.ts
|
|
64
|
-
declare const COMMAND_CODE_CLI_VERSION = "1.
|
|
64
|
+
declare const COMMAND_CODE_CLI_VERSION = "1.82.1";
|
|
65
65
|
declare const DEFAULT_API_BASE = "https://api.commandcode.ai";
|
|
66
66
|
/**
|
|
67
67
|
* The output budget this bundle asks for, and the ceiling it will never exceed.
|
|
@@ -466,8 +466,9 @@ declare class CommandCodeAdapter<C extends CommandCodeConnectionOptions = Comman
|
|
|
466
466
|
/**
|
|
467
467
|
* Fetch one JSON GET and return its HTTP status with a parsed record. The
|
|
468
468
|
* catalog, billing probe, and usage report each apply their own failure
|
|
469
|
-
* policy. Non-2xx and
|
|
470
|
-
* a
|
|
469
|
+
* policy. Non-2xx and unusable bodies come back without a record; only
|
|
470
|
+
* a failure before receiving the response propagates to the caller.
|
|
471
|
+
* 正文读取、JSON 解析与顶层结构分别诊断,不能把已收到响应后的断流当成格式错误。
|
|
471
472
|
*
|
|
472
473
|
* `timeoutMs` is the caller's budget, unless it provides its own signal.
|
|
473
474
|
* The usage report passes the connection's request budget rather than the
|
|
@@ -978,7 +979,7 @@ declare const KNOWN_EFFORTS: Readonly<Record<string, readonly string[]>>;
|
|
|
978
979
|
declare const KNOWN_IMAGE_MODELS: ReadonlySet<string>;
|
|
979
980
|
/**
|
|
980
981
|
* Models WITHOUT a zero-data-retention upstream, per the official CLI's own
|
|
981
|
-
* registry (`command-code@1.
|
|
982
|
+
* registry (`command-code@1.82.1` `dist/cli.mjs`): `modelSupportsZdr(id)` is
|
|
982
983
|
* exactly `!nonZdrSet.has(canonicalize(id))`, and `knownModelSupportsZdr`
|
|
983
984
|
* carries the same membership in the sibling route table — the UNION of both
|
|
984
985
|
* is this set. Reading only the sibling route table dropped
|
|
@@ -1050,11 +1051,13 @@ declare const KNOWN_THINKING_MODELS: ReadonlySet<string>;
|
|
|
1050
1051
|
* `/docs/plans/max` and `/docs/resources/pricing-limits`). Each plan's model
|
|
1051
1052
|
* list is a superset of the one below it: Go ⊂ GOAT ⊂ Pro ⊂ Provider/Max.
|
|
1052
1053
|
* Models absent from every plan list (Claude Opus/Fable, Fugu Ultra) are
|
|
1053
|
-
* Provider-tier. Re-verified at command-code@1.
|
|
1054
|
-
* ids at 54/64/
|
|
1054
|
+
* Provider-tier. Re-verified at command-code@1.82.1 (2026-10-14): 89 catalog
|
|
1055
|
+
* ids at 54/64/79/87/89 cumulative, a strict superset chain. Mistral Large 4
|
|
1055
1056
|
* (1.75.0) was the only addition at the 1.77.0 check; the 1.78.0/1.79.0 pair
|
|
1056
1057
|
* added Claude Haiku 5.5 at Pro and the free Glyph Cluster preview at Go.
|
|
1057
|
-
* 1.79.2 lowers Haiku 5.5's minimum plan to GOAT;
|
|
1058
|
+
* 1.79.2 lowers Haiku 5.5's minimum plan to GOAT; 1.80.0 adds Muse Wonder at
|
|
1059
|
+
* Max; 1.82.0 adds Gemini 4 Argon at Pro and nothing else moves. Every other
|
|
1060
|
+
* tier is unchanged.
|
|
1058
1061
|
* The only removals since 1.49.0 are the two retired stealth previews (Pixel
|
|
1059
1062
|
* Canary at 1.73.1, Space Bunny Alpha at 1.74.3). Per-entry tags below name the
|
|
1060
1063
|
* releases that added or moved each row.
|
|
@@ -1694,6 +1697,74 @@ declare class AccountEnrollmentManager {
|
|
|
1694
1697
|
private recovered;
|
|
1695
1698
|
}
|
|
1696
1699
|
//#endregion
|
|
1700
|
+
//#region src/cost-facts.d.ts
|
|
1701
|
+
interface CostTokens {
|
|
1702
|
+
uncachedInputTokens: number;
|
|
1703
|
+
outputTokens: number;
|
|
1704
|
+
cacheReadTokens: number;
|
|
1705
|
+
cacheWriteTokens: number;
|
|
1706
|
+
}
|
|
1707
|
+
//#endregion
|
|
1708
|
+
//#region src/analytics-wire.d.ts
|
|
1709
|
+
type AnalyticsQuery = {
|
|
1710
|
+
mode: 'recent';
|
|
1711
|
+
limit: number;
|
|
1712
|
+
} | {
|
|
1713
|
+
mode: 'range';
|
|
1714
|
+
from: number;
|
|
1715
|
+
to: number;
|
|
1716
|
+
};
|
|
1717
|
+
interface AnalyticsMetrics {
|
|
1718
|
+
sessions: number;
|
|
1719
|
+
requests: number;
|
|
1720
|
+
completed: number;
|
|
1721
|
+
failed: number;
|
|
1722
|
+
cancelled: number;
|
|
1723
|
+
unknown: number;
|
|
1724
|
+
retries: number;
|
|
1725
|
+
usageSamples: number;
|
|
1726
|
+
pricedRequests: number;
|
|
1727
|
+
cost: number;
|
|
1728
|
+
tokens: CostTokens;
|
|
1729
|
+
latencySamples: number;
|
|
1730
|
+
latencyMs: number;
|
|
1731
|
+
ttftSamples: number;
|
|
1732
|
+
ttftMs: number;
|
|
1733
|
+
decodeSamples: number;
|
|
1734
|
+
decodeMs: number;
|
|
1735
|
+
decodeTokens: number;
|
|
1736
|
+
}
|
|
1737
|
+
interface AnalyticsModel extends AnalyticsMetrics {
|
|
1738
|
+
id: string;
|
|
1739
|
+
}
|
|
1740
|
+
interface AnalyticsScenario {
|
|
1741
|
+
id: string;
|
|
1742
|
+
name: string;
|
|
1743
|
+
contextWindow: number | null;
|
|
1744
|
+
images: boolean;
|
|
1745
|
+
efforts: string[];
|
|
1746
|
+
cost: number;
|
|
1747
|
+
pricedRequests: number;
|
|
1748
|
+
excludedRequests: number;
|
|
1749
|
+
unknownRequests: number;
|
|
1750
|
+
}
|
|
1751
|
+
interface AnalyticsReport {
|
|
1752
|
+
generatedAt: number;
|
|
1753
|
+
pricingKey: number;
|
|
1754
|
+
query: AnalyticsQuery;
|
|
1755
|
+
status: 'ready' | 'unavailable';
|
|
1756
|
+
scannedSessions: number;
|
|
1757
|
+
matchedSessions: number;
|
|
1758
|
+
unreadableSessions: number;
|
|
1759
|
+
skippedSessions: number;
|
|
1760
|
+
truncated: boolean;
|
|
1761
|
+
catalogUnavailable: boolean;
|
|
1762
|
+
totals: AnalyticsMetrics;
|
|
1763
|
+
models: AnalyticsModel[];
|
|
1764
|
+
scenarios: AnalyticsScenario[];
|
|
1765
|
+
monthlyEstimate: number | null;
|
|
1766
|
+
}
|
|
1767
|
+
//#endregion
|
|
1697
1768
|
//#region src/usage-remote.d.ts
|
|
1698
1769
|
/**
|
|
1699
1770
|
* The browser-login face the usage service exposes (`commandcode/login*`).
|
|
@@ -1736,6 +1807,7 @@ interface CommandCodeUsageDeps<C extends CommandCodeConnectionOptions = CommandC
|
|
|
1736
1807
|
/** The browser-login flow (wired by the plugin entry); see {@link LoginFlowFacade}. */
|
|
1737
1808
|
login?: LoginFlowFacade;
|
|
1738
1809
|
enrollment?: AccountEnrollmentManager;
|
|
1810
|
+
analytics?: (query: AnalyticsQuery, signal?: AbortSignal) => Promise<AnalyticsReport>;
|
|
1739
1811
|
}
|
|
1740
1812
|
/**
|
|
1741
1813
|
* The Remote receiver: a Cordis service the Gateway resolves by key
|
|
@@ -1768,6 +1840,7 @@ declare class CommandCodeUsageService<C extends CommandCodeConnectionOptions = C
|
|
|
1768
1840
|
* open page without a rebuild.
|
|
1769
1841
|
*/
|
|
1770
1842
|
prices(): Promise<CommandCodePriceTable>;
|
|
1843
|
+
analytics(query: AnalyticsQuery): Promise<AnalyticsReport>;
|
|
1771
1844
|
/**
|
|
1772
1845
|
* Start (or rejoin) a browser-login attempt and return its fresh status —
|
|
1773
1846
|
* `waiting` carrying the Studio URL. Rejects when the flow cannot start
|