@eddyskywalker/dsh-chatgpt-subscription 0.33.0 → 0.34.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 +45 -0
- package/README.md +51 -110
- package/lib/client.js +1483 -335
- package/lib/client.js.map +1 -1
- package/lib/index.js +5934 -1974
- package/lib/types/client/common/format.d.ts +10 -0
- package/lib/types/client/common/format.d.ts.map +1 -1
- package/lib/types/client/hub/brand-icons.d.ts +2 -2
- package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
- package/lib/types/client/hub/providers.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts +20 -0
- package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts.map +1 -0
- package/lib/types/client/opendesign/OpenDesignSection.d.ts +18 -0
- package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -0
- package/lib/types/client/opendesign/api.d.ts +45 -0
- package/lib/types/client/opendesign/api.d.ts.map +1 -0
- package/lib/types/client/opendesign/locales.d.ts +689 -0
- package/lib/types/client/opendesign/locales.d.ts.map +1 -0
- package/lib/types/client/opendesign/styles.d.ts +11 -0
- package/lib/types/client/opendesign/styles.d.ts.map +1 -0
- package/lib/types/client/qoder/QoderSection.d.ts +12 -2
- package/lib/types/client/qoder/QoderSection.d.ts.map +1 -1
- package/lib/types/client/qoder/locales.d.ts +7 -1
- package/lib/types/client/qoder/locales.d.ts.map +1 -1
- package/lib/types/client/qoder/useQoderSection.d.ts.map +1 -1
- package/lib/types/host/common/model-request-control.d.ts +1 -1
- package/lib/types/host/common/model-request-control.d.ts.map +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
- package/lib/types/host/kimi-code/adapter.d.ts +31 -0
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/mapper.d.ts +8 -0
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/lib/types/host/kimi-code/types.d.ts +92 -0
- package/lib/types/host/kimi-code/types.d.ts.map +1 -1
- package/lib/types/host/opendesign/account-pool.d.ts +54 -0
- package/lib/types/host/opendesign/account-pool.d.ts.map +1 -0
- package/lib/types/host/opendesign/adapter.d.ts +69 -0
- package/lib/types/host/opendesign/adapter.d.ts.map +1 -0
- package/lib/types/host/opendesign/catalog.d.ts +44 -0
- package/lib/types/host/opendesign/catalog.d.ts.map +1 -0
- package/lib/types/host/opendesign/client.d.ts +148 -0
- package/lib/types/host/opendesign/client.d.ts.map +1 -0
- package/lib/types/host/opendesign/line.d.ts +49 -0
- package/lib/types/host/opendesign/line.d.ts.map +1 -0
- package/lib/types/host/opendesign/mapper.d.ts +128 -0
- package/lib/types/host/opendesign/mapper.d.ts.map +1 -0
- package/lib/types/host/opendesign/oauth.d.ts +105 -0
- package/lib/types/host/opendesign/oauth.d.ts.map +1 -0
- package/lib/types/host/opendesign/routes.d.ts +74 -0
- package/lib/types/host/opendesign/routes.d.ts.map +1 -0
- package/lib/types/host/opendesign/token-store.d.ts +154 -0
- package/lib/types/host/opendesign/token-store.d.ts.map +1 -0
- package/lib/types/host/opendesign/types.d.ts +180 -0
- package/lib/types/host/opendesign/types.d.ts.map +1 -0
- package/lib/types/host/qoder/adapter.d.ts +26 -2
- package/lib/types/host/qoder/adapter.d.ts.map +1 -1
- package/lib/types/host/qoder/client.d.ts +112 -0
- package/lib/types/host/qoder/client.d.ts.map +1 -1
- package/lib/types/host/qoder/model-catalog.d.ts +52 -6
- package/lib/types/host/qoder/model-catalog.d.ts.map +1 -1
- package/lib/types/host/qoder/routes.d.ts +23 -0
- package/lib/types/host/qoder/routes.d.ts.map +1 -1
- package/lib/types/host/qoder/token-store.d.ts +56 -7
- package/lib/types/host/qoder/token-store.d.ts.map +1 -1
- package/lib/types/index.d.ts +11 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/opendesign-contracts.d.ts +159 -0
- package/lib/types/shared/opendesign-contracts.d.ts.map +1 -0
- package/lib/types/shared/qoder-contracts.d.ts +40 -1
- package/lib/types/shared/qoder-contracts.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/opendesign/locales.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,mBAAmB,CAAA;AAE7C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+FL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FL,CAAA;AAIV,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenDesign's own prefixed classes only: the key form and the advanced
|
|
3
|
+
* controls, which the shared `.dsha-*` vocabulary has no expression for.
|
|
4
|
+
* Everything else on the tab reuses the shared card.
|
|
5
|
+
*
|
|
6
|
+
* `.dshod-input` mirrors the input styling another line declares under an
|
|
7
|
+
* unprefixed name on purpose: that class is that line's own, and a prefix of
|
|
8
|
+
* ours keeps this card's look from drifting with someone else's sheet.
|
|
9
|
+
*/
|
|
10
|
+
export declare function installOpenDesignStyles(): void;
|
|
11
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/client/opendesign/styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CA0B9C"}
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
*
|
|
11
11
|
* 两条它自己负责的渲染规则:
|
|
12
12
|
*
|
|
13
|
-
* 1.
|
|
14
|
-
*
|
|
13
|
+
* 1. **能力只画契约里的字段**:图片输入、思考档位、上下文窗口、输出预算全部来自
|
|
14
|
+
* DTO 字段(`supportsImages` / `reasoningEfforts` / `contextWindow` /
|
|
15
|
+
* `defaultMaxTokens`),客户端不按模型名推断任何一项;同一事实只呈现一次;
|
|
15
16
|
* 2. **额度画绝对量,缓存画 token 维度**:额度是三只桶的总量/已用/剩余(上游自述的
|
|
16
17
|
* 单位),缺桶不画;缓存只有读入/写入/样本,没数据就是占位符;单价未公开,
|
|
17
18
|
* 整页不出现任何金额。
|
|
@@ -21,6 +22,15 @@
|
|
|
21
22
|
* 说明」。
|
|
22
23
|
*/
|
|
23
24
|
import React from 'react';
|
|
25
|
+
import { type QoderModelOption } from '../../shared/qoder-contracts.ts';
|
|
24
26
|
import { type QoderSectionProps } from './useQoderSection.ts';
|
|
27
|
+
/**
|
|
28
|
+
* 一行模型的能力摘要:`1M · text+image · 档位 low/high/max · 输出 131k`。
|
|
29
|
+
*
|
|
30
|
+
* 全部取自契约字段(窗口、`supportsImages`、`reasoningEfforts`、
|
|
31
|
+
* `defaultMaxTokens`),客户端不按模型名推断任何一项。与 OpenDesign 卡同一写法:
|
|
32
|
+
* 数据一行,散文进折叠区。
|
|
33
|
+
*/
|
|
34
|
+
export declare function qoderModelRowHint(model: QoderModelOption): string;
|
|
25
35
|
export declare function QoderSection({ onModelChange }?: QoderSectionProps): React.JSX.Element;
|
|
26
36
|
//# sourceMappingURL=QoderSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QoderSection.d.ts","sourceRoot":"","sources":["../../../../src/client/qoder/QoderSection.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"QoderSection.d.ts","sourceRoot":"","sources":["../../../../src/client/qoder/QoderSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAIL,KAAK,gBAAgB,EAGtB,MAAM,iCAAiC,CAAA;AAYxC,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AA4D9E;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAQjE;AAED,wBAAgB,YAAY,CAAC,EAAE,aAAa,EAAE,GAAE,iBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAydzF"}
|
|
@@ -150,6 +150,9 @@ export declare const zh: {
|
|
|
150
150
|
quotaResets: string;
|
|
151
151
|
quotaExhausted: string;
|
|
152
152
|
quotaFactsScope: string;
|
|
153
|
+
modelRowEfforts: string;
|
|
154
|
+
modelRowNoEfforts: string;
|
|
155
|
+
modelRowOutput: string;
|
|
153
156
|
};
|
|
154
157
|
export type QoderLocaleKey = keyof typeof zh;
|
|
155
158
|
export declare const en: Record<QoderLocaleKey, string>;
|
|
@@ -299,8 +302,11 @@ export declare const dictionaries: {
|
|
|
299
302
|
quotaResets: string;
|
|
300
303
|
quotaExhausted: string;
|
|
301
304
|
quotaFactsScope: string;
|
|
305
|
+
modelRowEfforts: string;
|
|
306
|
+
modelRowNoEfforts: string;
|
|
307
|
+
modelRowOutput: string;
|
|
302
308
|
};
|
|
303
|
-
en: Record<"quotaRefreshing" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "expires" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "save" | "quotaSignedOut" | "modelChecklistCount" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "cooldownRemaining" | "cooldownRemainingSeconds" | "modelCooldown" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "progress" | "pageDesc" | "modelsSection" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheRequests" | "quotaSection" | "quotaDesc" | "quotaEmpty" | "openAuthorizeUrl" | "authorizeUrl" | "loginComplete" | "manualPasteSection" | "manualPasteHint" | "manualPastePlaceholder" | "manualPasteSubmit" | "manualPasteSubmitting" | "testingConnection" | "testSuccess" | "testLatency" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "effortLow" | "effortMedium" | "effortHigh" | "effortXHigh" | "effortMax" | "adopt" | "region" | "regionCn" | "regionHint" | "authorizing" | "loginIdle" | "loginHaveAccounts" | "loginPending" | "loginCompletedAt" | "loginCompleteNoAccount" | "loginError" | "loginRetryable" | "loginNotRetryable" | "pollEvery" | "loginExpiresAt" | "cancelLogin" | "cancelLoginBusy" | "manualPasteEmpty" | "adopting" | "adoptAdopted" | "adoptNoAttempt" | "adoptNoCredentialsFile" | "adoptFallback" | "testFailedDetail" | "modelsUnavailable" | "dismiss" | "invalidCapacity" | "quotaRefresh" | "quotaReadAt" | "quotaRefreshingNote" | "quotaErrorLabel" | "regionGlobal" | "moreNotes" | "adoptInvalidCredentials" | "adoptUnsupportedShape" | "modelsHintExtra" | "enabledModelIdsSemantics" | "defaultEffort" | "defaultEffortHint" | "defaultEffortHintExtra" | "defaultEffortModel" | "effortMinimal" | "contextWindowHintExtra" | "quotaRegion" | "cacheStatScope" | "cacheReadTokens" | "cacheMissedTokens" | "cacheHitRatioUnavailable" | "quotaRemaining" | "regionHintExtra" | "adoptNotAQoderLogin" | "adoptRegionUnresolved" | "quotaBucketPersonal" | "quotaBucketAddOn" | "quotaBucketOrg" | "quotaTotal" | "quotaExpiresAt" | "quotaNoUnit" | "cacheWriteTokens", string>;
|
|
309
|
+
en: Record<"quotaRefreshing" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "expires" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "save" | "quotaSignedOut" | "modelChecklistCount" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "cooldownRemaining" | "cooldownRemainingSeconds" | "modelCooldown" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "progress" | "pageDesc" | "modelsSection" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheRequests" | "quotaSection" | "quotaDesc" | "quotaEmpty" | "openAuthorizeUrl" | "authorizeUrl" | "loginComplete" | "manualPasteSection" | "manualPasteHint" | "manualPastePlaceholder" | "manualPasteSubmit" | "manualPasteSubmitting" | "testingConnection" | "testSuccess" | "testLatency" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "effortLow" | "effortMedium" | "effortHigh" | "effortXHigh" | "effortMax" | "adopt" | "region" | "regionCn" | "regionHint" | "authorizing" | "loginIdle" | "loginHaveAccounts" | "loginPending" | "loginCompletedAt" | "loginCompleteNoAccount" | "loginError" | "loginRetryable" | "loginNotRetryable" | "pollEvery" | "loginExpiresAt" | "cancelLogin" | "cancelLoginBusy" | "manualPasteEmpty" | "adopting" | "adoptAdopted" | "adoptNoAttempt" | "adoptNoCredentialsFile" | "adoptFallback" | "testFailedDetail" | "modelsUnavailable" | "dismiss" | "invalidCapacity" | "quotaRefresh" | "quotaReadAt" | "quotaRefreshingNote" | "quotaErrorLabel" | "regionGlobal" | "moreNotes" | "adoptInvalidCredentials" | "adoptUnsupportedShape" | "modelsHintExtra" | "enabledModelIdsSemantics" | "defaultEffort" | "defaultEffortHint" | "defaultEffortHintExtra" | "defaultEffortModel" | "effortMinimal" | "contextWindowHintExtra" | "quotaRegion" | "cacheStatScope" | "cacheReadTokens" | "cacheMissedTokens" | "cacheHitRatioUnavailable" | "quotaRemaining" | "regionHintExtra" | "adoptNotAQoderLogin" | "adoptRegionUnresolved" | "quotaBucketPersonal" | "quotaBucketAddOn" | "quotaBucketOrg" | "quotaTotal" | "quotaExpiresAt" | "quotaNoUnit" | "cacheWriteTokens" | "modelRowEfforts" | "modelRowNoEfforts" | "modelRowOutput", string>;
|
|
304
310
|
};
|
|
305
311
|
/** adopt 的失败原因(冻结契约的联合)。 */
|
|
306
312
|
export type AdoptReason = NonNullable<QoderAdoptResultDto['reason']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/qoder/locales.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACZ,MAAM,iCAAiC,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,cAAc,CAAA;AAEnC,eAAO,MAAM,EAAE;;;;
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/qoder/locales.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACZ,MAAM,iCAAiC,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,cAAc,CAAA;AAEnC,eAAO,MAAM,EAAE;;;;IAUb,uCAAuC;;;;;;;;;IAYvC,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8G5D,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,EAAE,CAAA;AAE5C,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAgI7C,CAAA;AAED,YAAY;AACZ,eAAO,MAAM,YAAY;;;;;QAjQvB,uCAAuC;;;;;;;;;QAYvC,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqPvB,CAAA;AAEtC,4BAA4B;AAC5B,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ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;KAChC,CAAA;CACF;AAED,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,GAAE,iBAAsB,GAAG,gBAAgB,CAua3F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConcurrencyGate } from './concurrency-gate.ts';
|
|
2
|
-
export declare const CONTROLLED_PROVIDERS: readonly ["codex-chatgpt", "claude", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy", "ollama", "glm-coding-plan", "step-code", "cline-pass", "qoder"];
|
|
2
|
+
export declare const CONTROLLED_PROVIDERS: readonly ["codex-chatgpt", "claude", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy", "ollama", "glm-coding-plan", "step-code", "cline-pass", "qoder", "opendesign"];
|
|
3
3
|
export type ControlledProvider = typeof CONTROLLED_PROVIDERS[number];
|
|
4
4
|
export interface ModelRequestLimits {
|
|
5
5
|
/** Per credential limits, not guessed subscription entitlements. Zero disables. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-request-control.d.ts","sourceRoot":"","sources":["../../../../src/host/common/model-request-control.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"model-request-control.d.ts","sourceRoot":"","sources":["../../../../src/host/common/model-request-control.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,eAAO,MAAM,oBAAoB,8LAA+L,CAAA;AAChO,MAAM,MAAM,kBAAkB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AACpE,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAA;IACvD,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,kBAAkB,CAqB/F;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAO9F;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB;AAED,4FAA4F;AAC5F,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,OAAO,KAAK,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,KAAK,CAmErH"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @module dsh-chatgpt-subscription/request-diagnostics
|
|
15
15
|
*/
|
|
16
|
-
export declare const DIAGNOSTIC_PROVIDERS: readonly ["codex-chatgpt", "claude-subscription", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy-subscription", "ollama", "claude", "workbuddy", "codex", "glm-coding-plan", "step-code", "cline-pass", "qoder"];
|
|
16
|
+
export declare const DIAGNOSTIC_PROVIDERS: readonly ["codex-chatgpt", "claude-subscription", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy-subscription", "ollama", "claude", "workbuddy", "codex", "glm-coding-plan", "step-code", "cline-pass", "qoder", "opendesign"];
|
|
17
17
|
export type DiagnosticProviderId = (typeof DIAGNOSTIC_PROVIDERS)[number];
|
|
18
18
|
export declare const KNOWN_WIRE_ENDPOINTS: readonly ["messages", "responses", "chat_completions", "generate_content", "stream_generate_content", "ollama_chat", "ollama_generate", "workbuddy_chat", "unknown"];
|
|
19
19
|
export type KnownWireEndpoint = (typeof KNOWN_WIRE_ENDPOINTS)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-diagnostics.d.ts","sourceRoot":"","sources":["../../../../src/host/common/request-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"request-diagnostics.d.ts","sourceRoot":"","sources":["../../../../src/host/common/request-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,oBAAoB,wPAwBvB,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAExE,eAAO,MAAM,oBAAoB,sKAUvB,CAAA;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAErE,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,oBAAoB,CAEnF;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,iBAAiB,CAEhF;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAA;AAErE,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,OA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AAC,CAAC,CAAA;AAKhD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAaD,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AA+DD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAiB7E;AA+JD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,OAAO,EACZ,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,aAAa,GAAG,SAAS,CAmE3B;AA2HD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,SAAS,CA2RX"}
|
|
@@ -104,6 +104,18 @@ export interface KimiFailureClassification {
|
|
|
104
104
|
}
|
|
105
105
|
/** Short, single-line excerpt of one error body, safe to show a user. */
|
|
106
106
|
export declare function summarizeFailureBody(raw: string): string;
|
|
107
|
+
/**
|
|
108
|
+
* Whether one failure detail is the gateway refusing a body for its SIZE.
|
|
109
|
+
*
|
|
110
|
+
* The managed gateway answers an oversized request with
|
|
111
|
+
* `total message size 5943865 exceeds limit 2097152` and no status beyond 400:
|
|
112
|
+
* the figures are bytes, and the wording matches nothing the shared overflow
|
|
113
|
+
* detector looks for. It is recognized HERE rather than in
|
|
114
|
+
* `common/context-overflow.ts` on purpose — that detector is shared by every
|
|
115
|
+
* route in this plugin, so a Kimi-specific sentence added there would
|
|
116
|
+
* reclassify other lines' failures on wording they never send.
|
|
117
|
+
*/
|
|
118
|
+
export declare function isKimiBodySizeRefusal(detail: string): boolean;
|
|
107
119
|
/**
|
|
108
120
|
* Classify one non-2xx response for the retry policy.
|
|
109
121
|
*
|
|
@@ -170,6 +182,25 @@ export declare class KimiCodeAdapter extends LlmAdapter {
|
|
|
170
182
|
* shipped fallback otherwise, narrowed by the user's enabled selection.
|
|
171
183
|
*/
|
|
172
184
|
private catalog;
|
|
185
|
+
/**
|
|
186
|
+
* The single window this line reports AND budgets against.
|
|
187
|
+
*
|
|
188
|
+
* The resolution lives here, in the one place both readers go through, rather
|
|
189
|
+
* than at each call site: `resolveModel` publishes this number to DSH (which
|
|
190
|
+
* computes its compaction threshold from it) and `requestStream` sizes the
|
|
191
|
+
* completion budget with it, so two independent resolutions would let the
|
|
192
|
+
* promise and the budget drift apart.
|
|
193
|
+
*
|
|
194
|
+
* By default the window is published exactly as declared, and a user override
|
|
195
|
+
* is an ordinary declared window: an explicit 1M is the model's advertised
|
|
196
|
+
* capacity as this user chose it, and silently shrinking it would take away
|
|
197
|
+
* the context they asked for. A session that outgrows the byte ceiling is
|
|
198
|
+
* recovered at the wall (CONTEXT_OVERFLOW_CODE), not pre-emptively summarized.
|
|
199
|
+
*
|
|
200
|
+
* A deployment that would rather compact BEFORE the wall sets
|
|
201
|
+
* DSH_KIMI_CODE_BYTES_PER_TOKEN, and then the override is bounded like every
|
|
202
|
+
* other window — see {@link effectiveContextWindow}.
|
|
203
|
+
*/
|
|
173
204
|
private contextWindowFor;
|
|
174
205
|
listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
|
|
175
206
|
resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EAEV,iBAAiB,EAGjB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAGL,WAAW,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":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B,EACrD,WAAW,CAAC,EAAE,mBAAmB;IAMnC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAI/C,mBAAmB,IAAI,mBAAmB;IAI1C,mBAAmB,IAAI,SAAS;IAIhC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;;;;;IAI/E,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;YACW,OAAO;IA0BrB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,gBAAgB;IAYlB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAmB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkCpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAgBpD,aAAa;IAuU5B;;;;;;;;;;;;;;;OAeG;YACW,mBAAmB;IA6DjC;;;;;;;;OAQG;YACW,mBAAmB;CASlC;AAyCD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -260,6 +260,14 @@ export declare function buildRequest(options: GenerateOptions, wire: KimiCodeWir
|
|
|
260
260
|
* sent at all. The measured size is the real serialized body, so it accounts
|
|
261
261
|
* for tool schemas and inlined images the caller cannot easily estimate.
|
|
262
262
|
*
|
|
263
|
+
* The error code is CONTEXT_OVERFLOW_CODE, not PROVIDER_ERROR, because naming the
|
|
264
|
+
* remedy in prose is not the same as being able to act on it: DSH forces a
|
|
265
|
+
* compaction and retries the same step only for that one code, and every other
|
|
266
|
+
* 400-shaped failure ends the turn. A byte ceiling is answered by the same
|
|
267
|
+
* compression a token ceiling is — the conversation shrinks either way — so the
|
|
268
|
+
* body of the message stays as specific as it was while the code becomes one the
|
|
269
|
+
* host can recover from.
|
|
270
|
+
*
|
|
263
271
|
* @returns the serialized body, so a caller that is about to send it does not
|
|
264
272
|
* serialize a body of up to tens of megabytes a second time.
|
|
265
273
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAKhC,OAAO,EAAE,uBAAuB,EAAmB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAEnE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,CAAA;AACxD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,EAItB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EAEpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,CAAA;AACD,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAIvF,OAAO,EACL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ACpF,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAUxD;AAmBD,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAWzF;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAUrE"}
|
|
@@ -134,6 +134,98 @@ export declare const ANTHROPIC_MESSAGES_PATH = "/v1/messages?beta=true";
|
|
|
134
134
|
export declare const DEFAULT_MAX_MESSAGE_BODY_BYTES = 2097152;
|
|
135
135
|
/** Ceiling this process enforces, honouring the deployment override. */
|
|
136
136
|
export declare function maxMessageBodyBytes(env?: NodeJS.ProcessEnv): number;
|
|
137
|
+
/**
|
|
138
|
+
* Bytes one METERED token is assumed to occupy when a deployment asks this route
|
|
139
|
+
* to fold its published window against the byte ceiling.
|
|
140
|
+
*
|
|
141
|
+
* The unit is not "bytes per real token" but "bytes per token as the host COUNTS
|
|
142
|
+
* it": DSH prices text at a fixed four characters per token
|
|
143
|
+
* (`@deepseek-ai/dsh-token-meter`'s estimate.ts, CHARS_PER_TOKEN = 4) whatever
|
|
144
|
+
* those characters weigh on the wire. So the figure is four characters per token
|
|
145
|
+
* times the bytes of one character, and each density lands somewhere different:
|
|
146
|
+
*
|
|
147
|
+
* | density | bytes/metered token | 2 MB wall |
|
|
148
|
+
* | ------------------------------------------ | ------------------- | --------- |
|
|
149
|
+
* | ASCII: code, patches, JSON tool results | 4 | 524_288 |
|
|
150
|
+
* | CJK prose mixed with English code and JSON | 8 | 262_144 |
|
|
151
|
+
* | dense CJK | 12 | 174_763 |
|
|
152
|
+
*
|
|
153
|
+
* These are the values DSH_KIMI_CODE_BYTES_PER_TOKEN accepts, and what each buys.
|
|
154
|
+
* Folding is a choice about WHERE compaction fires, never about safety: with a
|
|
155
|
+
* wall at N metered tokens the host's threshold is
|
|
156
|
+
* `floor(min(0.8 x window, window - 65_536))` (this route declares no
|
|
157
|
+
* `defaultMaxTokens`, so nothing is reserved), and the table says which densities
|
|
158
|
+
* sit above it.
|
|
159
|
+
*
|
|
160
|
+
* - unset: no folding at all. The window the model declares — or the one the user
|
|
161
|
+
* explicitly overrode — is published exactly as it is. A long session reaches
|
|
162
|
+
* the 2 MB wall and recovers there, because the refusal carries
|
|
163
|
+
* CONTEXT_OVERFLOW_CODE; nothing is silently given up up front;
|
|
164
|
+
* - 4: publish 524_288, threshold 419_430. Code-dominated sessions compact
|
|
165
|
+
* BEFORE the wall with 104_858 metered tokens of slack, which is the point of
|
|
166
|
+
* the setting; mixed and CJK traffic still meets the wall first;
|
|
167
|
+
* - 5: publish 419_430, threshold 335_544. Same shape, a little less slack;
|
|
168
|
+
* - 8: publish 262_144, threshold 196_608. ASCII and mixed text both compact in
|
|
169
|
+
* time; dense CJK does not;
|
|
170
|
+
* - 12: publish 174_762, threshold 109_226. All three densities compact in time,
|
|
171
|
+
* at the cost of publishing a small window (a CJK-first deployment's choice).
|
|
172
|
+
*
|
|
173
|
+
* Anything smaller than 4 makes the published window larger than the byte ceiling
|
|
174
|
+
* can ever fill (2 -> 1_048_576 against a 524_288-token ASCII wall), so the
|
|
175
|
+
* threshold sits above even the ASCII wall and the setting buys nothing but a
|
|
176
|
+
* window every session is refused before filling.
|
|
177
|
+
*
|
|
178
|
+
* Bytes per metered token in this process, or undefined when folding is off.
|
|
179
|
+
*
|
|
180
|
+
* DSH_KIMI_CODE_BYTES_PER_TOKEN is an OPTIONAL early-compaction switch, not a
|
|
181
|
+
* safety guard, and the distinction decides what a bad value must do. A typo
|
|
182
|
+
* cannot weaken anything here — the recovery code on an oversized refusal is the
|
|
183
|
+
* safety net and it is always armed — so an empty, unparsable, zero or negative
|
|
184
|
+
* value simply means "no folding", the same as leaving the variable out. (The
|
|
185
|
+
* byte CEILING keeps the opposite rule, because THAT is a guard:
|
|
186
|
+
* `maxMessageBodyBytes` falls back to the real limit rather than to no limit.)
|
|
187
|
+
*
|
|
188
|
+
* Undefined rather than a sentinel number on purpose: every caller has to decide
|
|
189
|
+
* what "no ceiling" means for it, and a magic value like Infinity would silently
|
|
190
|
+
* flow into arithmetic instead of forcing that decision.
|
|
191
|
+
*/
|
|
192
|
+
export declare function wireBytesPerToken(env?: NodeJS.ProcessEnv): number | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Token ceiling the body limit implies at the configured density, or undefined
|
|
195
|
+
* when folding is off.
|
|
196
|
+
*
|
|
197
|
+
* The gateway in front of this route counts BYTES while DSH's compaction
|
|
198
|
+
* thresholds count metered tokens taken from the window an adapter declares, and
|
|
199
|
+
* the two never meet on their own. Expressing the byte ceiling in the unit the
|
|
200
|
+
* host acts on is the same budget-first rule the official kimi-cli applies in
|
|
201
|
+
* `soul/compaction.py::should_auto_compact` — it compacts at 85% of the window or
|
|
202
|
+
* with 50K tokens left and never special-cases 2097152. This route applies that
|
|
203
|
+
* rule only when a deployment asks for it, because "smaller window" is a
|
|
204
|
+
* behaviour change to the model's advertised capacity, not a bug fix.
|
|
205
|
+
*/
|
|
206
|
+
export declare function byteDerivedTokenCap(env?: NodeJS.ProcessEnv): number | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* Context window this route will actually honour for one model.
|
|
209
|
+
*
|
|
210
|
+
* Both what `resolveModel` reports to DSH — which is where the compaction
|
|
211
|
+
* threshold is computed — and what the request builder budgets against, so the
|
|
212
|
+
* promise and the budget cannot drift apart.
|
|
213
|
+
*
|
|
214
|
+
* With folding OFF, which is the default, this is the declared window itself,
|
|
215
|
+
* including a window the user overrode by hand: the vendor's figure and the
|
|
216
|
+
* user's explicit choice are both respected, and a session that outgrows them is
|
|
217
|
+
* recovered at the byte wall rather than pre-emptively summarized.
|
|
218
|
+
*
|
|
219
|
+
* With folding ON it is the smaller of the declared window and
|
|
220
|
+
* {@link byteDerivedTokenCap}: one number for both readers, so what the host
|
|
221
|
+
* believes the model can hold is what the guard lets it send.
|
|
222
|
+
*
|
|
223
|
+
* A window that is missing, zero, negative or not finite is not trusted. It falls
|
|
224
|
+
* back to {@link DEFAULT_CONTEXT_WINDOW} (or to the byte-derived cap when that is
|
|
225
|
+
* smaller), and the result never drops below 1 so no caller ends up with an empty
|
|
226
|
+
* window.
|
|
227
|
+
*/
|
|
228
|
+
export declare function effectiveContextWindow(tokenWindow: number, env?: NodeJS.ProcessEnv): number;
|
|
137
229
|
/**
|
|
138
230
|
* Base64 image payload one request on this route may carry.
|
|
139
231
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAIhH,eAAO,MAAM,WAAW,cAAc,CAAA;AACtC,eAAO,MAAM,aAAa,cAAc,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,yCAAyC,CAAA;AAEzE,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,0BAA0B,CAAA;AAEzD,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,oCAAoC,CAAA;AAC1E,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,iDAAiD,CAAA;AAEpF,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CASlF,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,QAAQ,CAAA;AAEtC,eAAO,MAAM,UAAU,qFAAqF,CAAA;AAE5G;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAC3C,eAAO,MAAM,mBAAmB,mBAAmB,C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;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,OAAQ,CAAA;AAE5C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAKlF;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAA;AAEtC,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM,GAC5B,MAAM,CAKR;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAE1F;AAED,gEAAgE;AAChE,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CACY,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AccountPoolCore, type PoolAccountShape, type PoolData } from '../common/account-pool.ts';
|
|
2
|
+
import type { CredentialStore } from '../token-store.ts';
|
|
3
|
+
import { FileCredentialStore, type OpenDesignCredentials } from './token-store.ts';
|
|
4
|
+
import type { AccountPoolStatusDto, AccountRotationStrategy } from '../../shared/account-pool-contracts.ts';
|
|
5
|
+
import type { OpenDesignAccountSummaryDto } from '../../shared/opendesign-contracts.ts';
|
|
6
|
+
/** One pooled OpenDesign key: the bearer key plus the display facts the card renders. */
|
|
7
|
+
export interface OpenDesignPoolAccount extends PoolAccountShape<OpenDesignCredentials> {
|
|
8
|
+
/** Model id this account last served, for the card's detail line. */
|
|
9
|
+
lastModelId?: string;
|
|
10
|
+
}
|
|
11
|
+
export type OpenDesignPoolStatusDto = AccountPoolStatusDto;
|
|
12
|
+
/** Encrypted pool file this line owns. */
|
|
13
|
+
export declare function opendesignPoolPath(): string;
|
|
14
|
+
/** The credential name a deployment can export instead of pasting a key. */
|
|
15
|
+
export declare const OPENDESIGN_API_KEY_ENV = "OPENDESIGN_API_KEY";
|
|
16
|
+
/** Stable identity of one key; see token-store for why the digest is safe to hold. */
|
|
17
|
+
export declare function opendesignAccountKey(credentials: OpenDesignCredentials): string;
|
|
18
|
+
/** Validate and normalize one whole pool document. */
|
|
19
|
+
export declare function parseOpenDesignPoolData(value: unknown): PoolData<OpenDesignPoolAccount>;
|
|
20
|
+
export interface OpenDesignAccountPoolOptions {
|
|
21
|
+
/** Pre-pool credential file the pool mirrors its primary account into. */
|
|
22
|
+
store?: FileCredentialStore;
|
|
23
|
+
/** Test seam; production builds the platform backend from the pool path. */
|
|
24
|
+
backend?: CredentialStore<PoolData<OpenDesignPoolAccount>>;
|
|
25
|
+
maxAccounts?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* OpenDesign's account pool.
|
|
29
|
+
*
|
|
30
|
+
* One credential kind only: a static API key. None of the kernel's refresh
|
|
31
|
+
* hooks apply, so they are simply not wired — a key has no expiry to refresh
|
|
32
|
+
* against, and a rejected key is replaced, not refreshed.
|
|
33
|
+
*/
|
|
34
|
+
export declare class OpenDesignAccountPool extends AccountPoolCore<OpenDesignCredentials, OpenDesignPoolAccount, OpenDesignAccountSummaryDto> {
|
|
35
|
+
private readonly store;
|
|
36
|
+
constructor(options?: OpenDesignAccountPoolOptions);
|
|
37
|
+
/**
|
|
38
|
+
* Pick the key for the next request, skipping accounts already tried.
|
|
39
|
+
*
|
|
40
|
+
* The credential carries its own base-URL override, so the account and the key
|
|
41
|
+
* are returned together.
|
|
42
|
+
*/
|
|
43
|
+
getEffectiveCredential(excludeIds?: ReadonlySet<string>, fetchFn?: typeof fetch): Promise<{
|
|
44
|
+
account: OpenDesignPoolAccount;
|
|
45
|
+
credentials: OpenDesignCredentials;
|
|
46
|
+
}>;
|
|
47
|
+
/** The pre-pool credential file this pool mirrors its primary account into. */
|
|
48
|
+
mirrorStore(): FileCredentialStore;
|
|
49
|
+
/** The rotation strategy as the settings card renders it. */
|
|
50
|
+
strategy(): Promise<AccountRotationStrategy>;
|
|
51
|
+
/** Remember which model an account last served, best-effort. */
|
|
52
|
+
recordModel(accountId: string, model: string): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=account-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/account-pool.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAGf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,mBAAmB,EAKnB,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAA;AAEvF,yFAAyF;AACzF,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB,CAAC,qBAAqB,CAAC;IACpF,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAA;AAE1D,0CAA0C;AAC1C,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,uBAAuB,CAAA;AAQ1D,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,qBAAqB,GAAG,MAAM,CAE/E;AASD,sDAAsD;AACtD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAkCvF;AAED,MAAM,WAAW,4BAA4B;IAC3C,0EAA0E;IAC1E,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAA;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,eAAe,CACxD,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,CAC5B;IACC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;gBAE/B,OAAO,GAAE,4BAAiC;IAsEtD;;;;;OAKG;IACG,sBAAsB,CAC1B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,OAAO,GAAE,OAAO,KAAa,GAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,qBAAqB,CAAC;QAAC,WAAW,EAAE,qBAAqB,CAAA;KAAE,CAAC;IAIlF,+EAA+E;IAC/E,WAAW,IAAI,mBAAmB;IAIlC,6DAA6D;IACvD,QAAQ,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIlD,gEAAgE;IAC1D,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOnE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenDesign LLM adapter: an OpenAI-compatible `chat/completions` stream
|
|
3
|
+
* with per-account rotation and pre-first-token account failover.
|
|
4
|
+
*
|
|
5
|
+
* Transport and mapping live in `client.ts` / `mapper.ts`. This module owns the
|
|
6
|
+
* request loop: which account, and when an attempt is abandoned. There is no
|
|
7
|
+
* channel layer: the gateway chooses the upstream, and a request proves nothing
|
|
8
|
+
* beyond the account that served it.
|
|
9
|
+
*
|
|
10
|
+
* @module dsh-chatgpt-subscription/opendesign-adapter
|
|
11
|
+
*/
|
|
12
|
+
import { LlmAdapter, type GenerateOptions as HarnessGenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
13
|
+
import type { OpenDesignModelSettingsStore } from './token-store.ts';
|
|
14
|
+
import type { OpenDesignAccountPool } from './account-pool.ts';
|
|
15
|
+
import { type AttachmentImageReader } from '../common/request-images.ts';
|
|
16
|
+
/**
|
|
17
|
+
* Fallback effort ladder for a model no source describes.
|
|
18
|
+
*
|
|
19
|
+
* Per-model ladders come from the shipped table (transcribed from this
|
|
20
|
+
* repository's sibling registries) and from the live catalog; this trio is only
|
|
21
|
+
* what a model with no data at all is offered. The wire carries the id string,
|
|
22
|
+
* so an over-offered level is ignored rather than refused by most gateways —
|
|
23
|
+
* but the ladder still prefers published data for anything the tables know.
|
|
24
|
+
*/
|
|
25
|
+
export declare const REASONING_EFFORT_IDS: readonly string[];
|
|
26
|
+
export interface OpenDesignAdapterOptions {
|
|
27
|
+
/** Proxy-aware fetch for live chat streams. */
|
|
28
|
+
fetchFn: typeof fetch;
|
|
29
|
+
/** Durable attachment service, for request images. */
|
|
30
|
+
attachments?: AttachmentImageReader;
|
|
31
|
+
/** The account pool this adapter rotates over. */
|
|
32
|
+
accountPool: OpenDesignAccountPool;
|
|
33
|
+
}
|
|
34
|
+
export declare class OpenDesignAdapter extends LlmAdapter {
|
|
35
|
+
private readonly modelSettings;
|
|
36
|
+
private readonly options;
|
|
37
|
+
private readonly gate;
|
|
38
|
+
constructor(modelSettings: OpenDesignModelSettingsStore, options: OpenDesignAdapterOptions);
|
|
39
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
40
|
+
providerRetryPolicy(): ResolvedRetryPolicy;
|
|
41
|
+
imageRequestPricing(): undefined;
|
|
42
|
+
private get accountPool();
|
|
43
|
+
private settings;
|
|
44
|
+
/** Every id the line knows: the shipped table plus the synced live catalog. */
|
|
45
|
+
private knownModelIds;
|
|
46
|
+
/**
|
|
47
|
+
* The ids the route advertises, narrowed by the user's selection and hidden
|
|
48
|
+
* list.
|
|
49
|
+
*
|
|
50
|
+
* The selection is captured against this same id vocabulary (the gateway's
|
|
51
|
+
* own wire ids), so a cold start filters the shipped table through it without
|
|
52
|
+
* the empty-intersection trap a foreign-vocabulary whitelist would spring —
|
|
53
|
+
* and an explicit "everything off" (`[]`) still wins, because that intent
|
|
54
|
+
* does not depend on a vocabulary at all.
|
|
55
|
+
*/
|
|
56
|
+
private visibleModelIds;
|
|
57
|
+
/** One model's resolved descriptor, from the shipped table plus live data. */
|
|
58
|
+
private modelInfo;
|
|
59
|
+
listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
|
|
60
|
+
resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
61
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
62
|
+
stream(options: HarnessGenerateOptions): AsyncIterable<StreamChunk>;
|
|
63
|
+
/** The message the pool's empty state should raise, in this line's words. */
|
|
64
|
+
private noAccountError;
|
|
65
|
+
private requestStream;
|
|
66
|
+
/** Park an account that refused a request, for the reason it refused. */
|
|
67
|
+
private standDown;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,UAAU,EAIV,KAAK,eAAe,IAAI,sBAAsB,EAC9C,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAa7B,OAAO,KAAK,EAA2B,4BAA4B,EAAE,MAAM,kBAAkB,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O,EAAE,sBAAsB,GAAG,aAAa,CAAC,WAAW,CAAC;IAW1E,6EAA6E;IAC7E,OAAO,CAAC,cAAc;YASP,aAAa;IAoJ5B,yEAAyE;YAC3D,SAAS;CAOxB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge the shipped table, the last gateway listing and the user's per-model
|
|
3
|
+
* override into the descriptor the harness validates.
|
|
4
|
+
*
|
|
5
|
+
* Context window and output cap are provider facts, not preferences: the harness
|
|
6
|
+
* sizes its prompt budget against `context.contextWindow`, so an understated
|
|
7
|
+
* window silently truncates history. This line ships no per-model windows (the
|
|
8
|
+
* gateway publishes none to an API key), so the window is the line default until
|
|
9
|
+
* a live listing or a user override states one.
|
|
10
|
+
*
|
|
11
|
+
* @module dsh-chatgpt-subscription/opendesign-catalog
|
|
12
|
+
*/
|
|
13
|
+
import { type OpenDesignModelInfo } from './types.ts';
|
|
14
|
+
import type { OpenDesignCatalogModel } from './token-store.ts';
|
|
15
|
+
/**
|
|
16
|
+
* The output budget to advertise for one model.
|
|
17
|
+
*
|
|
18
|
+
* `defaultMaxTokens` is what a request asks for, not what the model can emit,
|
|
19
|
+
* and the harness spends it twice: it fills a request's `max_tokens` from it
|
|
20
|
+
* and reserves the same number as completion room before deciding to compact.
|
|
21
|
+
* So a published ceiling clamps the configured budget rather than becoming it,
|
|
22
|
+
* and a budget is never taken past half the window.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveOutputBudget(budget: number | undefined, ceiling: number | undefined, contextWindow: number): number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve the metadata one model is advertised with.
|
|
27
|
+
*
|
|
28
|
+
* Precedence per field: the user's override, then the last gateway listing,
|
|
29
|
+
* then the shipped table, then the route-wide fallback. The listing sits above
|
|
30
|
+
* the shipped table for the fields the table cannot carry (window, modalities):
|
|
31
|
+
* the table's windows do not exist to be beaten, and its names/prices are
|
|
32
|
+
* curated, so a listing that states no name keeps the table's.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveModelInfo(model: string, options: {
|
|
35
|
+
/** Entries persisted by the last catalog sync. */
|
|
36
|
+
synced: readonly OpenDesignCatalogModel[];
|
|
37
|
+
/** Stored context-window override. */
|
|
38
|
+
contextWindowOverride?: number;
|
|
39
|
+
/** Route-wide fallback window. */
|
|
40
|
+
defaultContextWindow?: number;
|
|
41
|
+
/** Route-wide output budget. */
|
|
42
|
+
defaultMaxTokens?: number;
|
|
43
|
+
}): OpenDesignModelInfo;
|
|
44
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAc9D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtI;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IACP,kDAAkD;IAClD,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAA;IACzC,sCAAsC;IACtC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,kCAAkC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GACA,mBAAmB,CAoCrB"}
|