@eddyskywalker/dsh-chatgpt-subscription 0.8.1 → 0.8.2
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 +39 -0
- package/README.md +65 -0
- package/lib/client.js +1510 -303
- package/lib/client.js.map +1 -1
- package/lib/index.js +4723 -1640
- package/lib/types/client/ProviderHubSection.d.ts.map +1 -1
- package/lib/types/client/antigravity/locales.d.ts +2 -2
- package/lib/types/client/command-code/locales.d.ts +2 -2
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/kimi-code/locales.d.ts +2 -2
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +1 -1
- package/lib/types/client/workbuddy/locales.d.ts +60 -0
- package/lib/types/client/workbuddy/locales.d.ts.map +1 -1
- package/lib/types/client/zhipu/ZhipuComposerQuota.d.ts +26 -0
- package/lib/types/client/zhipu/ZhipuComposerQuota.d.ts.map +1 -0
- package/lib/types/client/zhipu/ZhipuSection.d.ts +11 -0
- package/lib/types/client/zhipu/ZhipuSection.d.ts.map +1 -0
- package/lib/types/client/zhipu/locales.d.ts +275 -0
- package/lib/types/client/zhipu/locales.d.ts.map +1 -0
- package/lib/types/client/zhipu/styles.d.ts +12 -0
- package/lib/types/client/zhipu/styles.d.ts.map +1 -0
- package/lib/types/host/workbuddy/checkin.d.ts +134 -0
- package/lib/types/host/workbuddy/checkin.d.ts.map +1 -0
- package/lib/types/host/workbuddy/routes.d.ts +3 -0
- package/lib/types/host/workbuddy/routes.d.ts.map +1 -1
- package/lib/types/host/workbuddy/token-store.d.ts +24 -1
- package/lib/types/host/workbuddy/token-store.d.ts.map +1 -1
- package/lib/types/host/zhipu/account-pool.d.ts +43 -0
- package/lib/types/host/zhipu/account-pool.d.ts.map +1 -0
- package/lib/types/host/zhipu/adapter.d.ts +93 -0
- package/lib/types/host/zhipu/adapter.d.ts.map +1 -0
- package/lib/types/host/zhipu/client.d.ts +153 -0
- package/lib/types/host/zhipu/client.d.ts.map +1 -0
- package/lib/types/host/zhipu/mapper.d.ts +111 -0
- package/lib/types/host/zhipu/mapper.d.ts.map +1 -0
- package/lib/types/host/zhipu/model-catalog.d.ts +73 -0
- package/lib/types/host/zhipu/model-catalog.d.ts.map +1 -0
- package/lib/types/host/zhipu/routes.d.ts +33 -0
- package/lib/types/host/zhipu/routes.d.ts.map +1 -0
- package/lib/types/host/zhipu/token-store.d.ts +112 -0
- package/lib/types/host/zhipu/token-store.d.ts.map +1 -0
- package/lib/types/host/zhipu/types.d.ts +125 -0
- package/lib/types/host/zhipu/types.d.ts.map +1 -0
- package/lib/types/index.d.ts +8 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/workbuddy-contracts.d.ts +40 -0
- package/lib/types/shared/workbuddy-contracts.d.ts.map +1 -1
- package/lib/types/shared/zhipu-contracts.d.ts +156 -0
- package/lib/types/shared/zhipu-contracts.d.ts.map +1 -0
- package/package.json +31 -31
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { LlmAdapter, LlmError, ReasoningEffortId, type GenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import { PROVIDER_ID, PROVIDER_NAME } from './types.ts';
|
|
3
|
+
import { FileCredentialStore, FileModelSettingsStore, type ZhipuPreferenceStore } from './token-store.ts';
|
|
4
|
+
import { type ZhipuModelEntry } from './model-catalog.ts';
|
|
5
|
+
import { type AttachmentImageReader } from './mapper.ts';
|
|
6
|
+
import type { ZhipuCredentials } from './token-store.ts';
|
|
7
|
+
import type { ZhipuAccountPool } from './account-pool.ts';
|
|
8
|
+
/**
|
|
9
|
+
* Effort this route materializes when the caller names none.
|
|
10
|
+
*
|
|
11
|
+
* Preference order: the caller's explicit level when the model accepts it,
|
|
12
|
+
* otherwise the user's configured level when the model accepts it, otherwise
|
|
13
|
+
* nothing. Nothing is a real answer on this route: the provider's own default
|
|
14
|
+
* is `max` for a model that takes an effort field, so omitting the field is not
|
|
15
|
+
* "no thinking" — it is the provider's documented default.
|
|
16
|
+
*
|
|
17
|
+
* A candidate outside the model's ladder is converged onto the nearest rung
|
|
18
|
+
* rather than sent, because an unsupported level is an error (`code 1214`), and
|
|
19
|
+
* rather than dropped, because dropping the user's explicit choice silently
|
|
20
|
+
* changes how hard the model thinks.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveDefaultReasoningEffort(efforts: readonly string[], configuredEffort?: string | null): ReasoningEffortId | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Cooldown a 429 imposes when the service names no reset instant.
|
|
25
|
+
*
|
|
26
|
+
* The plan's allowance windows are hours long, so a shorter cooldown would
|
|
27
|
+
* rediscover the same exhausted window immediately.
|
|
28
|
+
*/
|
|
29
|
+
export declare const POOL_COOLDOWN_MS: number;
|
|
30
|
+
export interface ZhipuAdapterOptions {
|
|
31
|
+
fetchFn?: typeof fetch;
|
|
32
|
+
attachments?: AttachmentImageReader;
|
|
33
|
+
/** Live catalog loader seam; defaults to the managed `/models` call. */
|
|
34
|
+
loadCatalog?: (credentials: ZhipuCredentials) => Promise<ZhipuModelEntry[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Multi-account pool this adapter rotates through.
|
|
37
|
+
*
|
|
38
|
+
* Absent leaves the line on its single-credential path, which is what the
|
|
39
|
+
* headless tests and any caller that predates the pool use.
|
|
40
|
+
*/
|
|
41
|
+
accountPool?: ZhipuAccountPool;
|
|
42
|
+
}
|
|
43
|
+
export declare class ZhipuAdapter extends LlmAdapter {
|
|
44
|
+
private readonly store;
|
|
45
|
+
private readonly modelSettings;
|
|
46
|
+
private readonly preferences?;
|
|
47
|
+
private readonly options;
|
|
48
|
+
/** Null keeps the pre-pool single-credential path. */
|
|
49
|
+
private readonly accountPool;
|
|
50
|
+
constructor(store?: FileCredentialStore, modelSettings?: FileModelSettingsStore, preferences?: ZhipuPreferenceStore | undefined, options?: ZhipuAdapterOptions);
|
|
51
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
52
|
+
providerRetryPolicy(): ResolvedRetryPolicy;
|
|
53
|
+
imageRequestPricing(): undefined;
|
|
54
|
+
private settings;
|
|
55
|
+
/**
|
|
56
|
+
* Credential the picker and the single-credential path read.
|
|
57
|
+
*
|
|
58
|
+
* With a pool installed the store holds the mirrored primary account, so this
|
|
59
|
+
* stays the same read path either way; the pool is consulted only when a
|
|
60
|
+
* request is actually served, which is where per-account rotation matters.
|
|
61
|
+
*/
|
|
62
|
+
private credentials;
|
|
63
|
+
private catalog;
|
|
64
|
+
listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
|
|
65
|
+
resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
66
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
67
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
68
|
+
/**
|
|
69
|
+
* Effort this request should carry, or `undefined` to send none.
|
|
70
|
+
*
|
|
71
|
+
* Order: the caller's explicit choice, then the user's configured level. Both
|
|
72
|
+
* are converged onto the model's own ladder — the provider rejects a level
|
|
73
|
+
* outside it — and a model that declares no ladder gets none, because sending
|
|
74
|
+
* an effort to a model that takes no such field is exactly the 400 this
|
|
75
|
+
* convergence exists to avoid.
|
|
76
|
+
*/
|
|
77
|
+
private effortFor;
|
|
78
|
+
private requestStream;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Map one failed HTTP response onto a DSH failure.
|
|
82
|
+
*
|
|
83
|
+
* The platform reports its own condition inside a JSON `code` while the status
|
|
84
|
+
* line stays generic, so the body is read for the cases the status alone cannot
|
|
85
|
+
* express. Several distinct conditions share one status — 429 covers a spent
|
|
86
|
+
* window, a lapsed plan, and a per-model entitlement gap — and they need
|
|
87
|
+
* different actions, which is exactly why the code decides.
|
|
88
|
+
*/
|
|
89
|
+
export declare function classifyFailure(status: number, detail: string, headers?: Headers): LlmError;
|
|
90
|
+
/** Read the platform's own numeric error code out of a response body. */
|
|
91
|
+
export declare function readErrorCode(detail: string): number | null;
|
|
92
|
+
export { PROVIDER_ID, PROVIDER_NAME };
|
|
93
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/zhipu/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,iBAAiB,EAEjB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAGL,WAAW,EACX,aAAa,EAGd,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EAEtB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAQL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAQL,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAmBzD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,GAC/B,iBAAiB,GAAG,SAAS,CAO/B;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAAiB,CAAA;AAE9C,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,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G;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,QAAQ,CAqGV;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK3D;AAED,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { ZhipuAccount, ZhipuAccountQuota, ZhipuMeter, ZhipuQuotaWindow } from '../../shared/zhipu-contracts.ts';
|
|
2
|
+
import { DEFAULT_CONTEXT_WINDOW, ERROR_CODE, PROVIDER_NAME } from './types.ts';
|
|
3
|
+
import { type ZhipuCredentials } from './token-store.ts';
|
|
4
|
+
import { ZHIPU_MODELS, type ZhipuModelEntry } from './model-catalog.ts';
|
|
5
|
+
export interface ZhipuRequestOptions {
|
|
6
|
+
fetchFn?: typeof fetch;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Headers one model request carries.
|
|
11
|
+
*
|
|
12
|
+
* The chat surface uses the documented bearer form. The key never appears in a
|
|
13
|
+
* log line: only the response body and status are ever reported.
|
|
14
|
+
*/
|
|
15
|
+
export declare function zhipuHeaders(credentials: Pick<ZhipuCredentials, 'apiKey'>, extra?: Record<string, string>): Record<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Headers the monitor/subscription surfaces carry.
|
|
18
|
+
*
|
|
19
|
+
* These two answer to the **raw** key with no `Bearer` prefix, which is the
|
|
20
|
+
* scheme the plan's own usage page uses: measured live, a request carrying the
|
|
21
|
+
* prefixed form is rejected with `code 401` where the raw form authenticates.
|
|
22
|
+
*/
|
|
23
|
+
export declare function zhipuMonitorHeaders(apiKey: string, extra?: Record<string, string>): Record<string, string>;
|
|
24
|
+
/** Public account facts for the settings card. */
|
|
25
|
+
export declare function accountFromCredentials(credentials: ZhipuCredentials): ZhipuAccount;
|
|
26
|
+
/**
|
|
27
|
+
* Read the platform's own envelope error out of a business-level refusal.
|
|
28
|
+
*
|
|
29
|
+
* These two surfaces answer HTTP 200 with `success: false` and a numeric `code`
|
|
30
|
+
* for an authentication problem, so a caller that only checks `response.ok`
|
|
31
|
+
* would treat a rejected key as a successful read. Returns null when the body
|
|
32
|
+
* is not a refusal.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readEnvelopeError(payload: unknown): {
|
|
35
|
+
code: number | null;
|
|
36
|
+
message: string;
|
|
37
|
+
} | null;
|
|
38
|
+
/**
|
|
39
|
+
* Verify one key by asking the model listing for it.
|
|
40
|
+
*
|
|
41
|
+
* The listing is the cheapest authenticated read on the Coding Plan surface and
|
|
42
|
+
* is the same host the chat requests go to, so a success proves the key works
|
|
43
|
+
* on the deployment it was entered for. A key from the wrong console (a general
|
|
44
|
+
* open-platform key, or one issued by the other region) is rejected here rather
|
|
45
|
+
* than failing later inside a conversation.
|
|
46
|
+
*
|
|
47
|
+
* @returns the live catalog this read produced, so a caller that verifies does
|
|
48
|
+
* not have to fetch it again.
|
|
49
|
+
*/
|
|
50
|
+
export declare function verifyApiKey(apiKey: string, region: ZhipuCredentials['region'], options?: ZhipuRequestOptions): Promise<ZhipuModelEntry[]>;
|
|
51
|
+
/** Console the user must have created the key on, named as it appears there. */
|
|
52
|
+
export declare function consoleName(region: ZhipuCredentials['region']): string;
|
|
53
|
+
/**
|
|
54
|
+
* Parse one `/models` payload.
|
|
55
|
+
*
|
|
56
|
+
* The listing reports each model's context window. It is merged over the
|
|
57
|
+
* shipped table, which stays the authority on the reasoning ladder and on image
|
|
58
|
+
* support: the listing states a window but not a capability, so a field it
|
|
59
|
+
* omits keeps the value this table declares rather than becoming a guess.
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseCatalogModels(payload: unknown, region: ZhipuCredentials['region']): ZhipuModelEntry[];
|
|
62
|
+
export declare function getCachedCatalog(): ZhipuModelEntry[];
|
|
63
|
+
export declare function clearCachedCatalog(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Fetch the live catalog for one account.
|
|
66
|
+
*
|
|
67
|
+
* A failure returns an empty list and the caller falls back to the shipped
|
|
68
|
+
* table, which keeps a first run usable before sign-in.
|
|
69
|
+
*/
|
|
70
|
+
export declare function fetchCatalog(credentials: ZhipuCredentials, options?: ZhipuRequestOptions): Promise<ZhipuModelEntry[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Cached catalog with a TTL; a failed refresh keeps the previous snapshot.
|
|
73
|
+
*
|
|
74
|
+
* A snapshot read for the *other* region must never stand in: its entries
|
|
75
|
+
* declare only the region they came from, so the caller's region filter would
|
|
76
|
+
* drop every one of them and the picker would offer nothing instead of falling
|
|
77
|
+
* back to the shipped table.
|
|
78
|
+
*/
|
|
79
|
+
export declare function loadCatalog(credentials: ZhipuCredentials, options?: ZhipuRequestOptions & {
|
|
80
|
+
force?: boolean;
|
|
81
|
+
}): Promise<ZhipuModelEntry[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Window length in minutes implied by one reported window.
|
|
84
|
+
*
|
|
85
|
+
* The monitor service describes a window by a unit and a number rather than by
|
|
86
|
+
* a name: `unit 3 × number 5` is the plan's 5-hour credit window and
|
|
87
|
+
* `unit 6 × number 1` is its weekly one. The exact unit vocabulary is not
|
|
88
|
+
* documented, so this maps the two combinations the plan's own usage page shows
|
|
89
|
+
* and derives minutes from anything else it does not recognise.
|
|
90
|
+
*/
|
|
91
|
+
export declare function windowMinutesOf(unit: number | undefined, number: number | undefined): number | null;
|
|
92
|
+
/** Turn one window length into the label the card shows. */
|
|
93
|
+
export declare function windowLabel(minutes: number | null, fallback: string): string;
|
|
94
|
+
/** One parsed limit entry from the monitor service. */
|
|
95
|
+
export interface ParsedQuotaLimit {
|
|
96
|
+
type: string;
|
|
97
|
+
unit: number | undefined;
|
|
98
|
+
number: number | undefined;
|
|
99
|
+
percentage: number | undefined;
|
|
100
|
+
currentValue: number | undefined;
|
|
101
|
+
total: number | undefined;
|
|
102
|
+
resetsAt: number | null;
|
|
103
|
+
usageDetails: Record<string, unknown> | undefined;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Parse the monitor payload's `limits` array.
|
|
107
|
+
*
|
|
108
|
+
* The plan's own page renders these directly. A limit is either a token/credit
|
|
109
|
+
* window (`TOKENS_LIMIT`, renamed `CREDIT_LIMIT` in newer responses) or a
|
|
110
|
+
* tool-call allowance (`TIME_LIMIT`); both shapes are read here rather than
|
|
111
|
+
* pinned to one spelling, because the service has used both names.
|
|
112
|
+
*/
|
|
113
|
+
export declare function parseQuotaLimits(payload: unknown): ParsedQuotaLimit[];
|
|
114
|
+
/** Whether a limit entry is a token/credit window under either spelling. */
|
|
115
|
+
export declare function isTokenLimit(type: string): boolean;
|
|
116
|
+
/** Whether a limit entry is a tool-call allowance. */
|
|
117
|
+
export declare function isToolLimit(type: string): boolean;
|
|
118
|
+
/** Build the window list the card renders from the parsed limits. */
|
|
119
|
+
export declare function quotaWindows(limits: readonly ParsedQuotaLimit[]): ZhipuQuotaWindow[];
|
|
120
|
+
/** Build the meter list the card renders, windows and tool allowance together. */
|
|
121
|
+
export declare function quotaMeters(windows: readonly ZhipuQuotaWindow[], limits: readonly ParsedQuotaLimit[]): ZhipuMeter[];
|
|
122
|
+
/** Plan facts the subscription route reports. */
|
|
123
|
+
export interface ZhipuPlan {
|
|
124
|
+
planName: string | null;
|
|
125
|
+
planLevel: string | null;
|
|
126
|
+
renewsAt: number | null;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Parse the plan payload.
|
|
130
|
+
*
|
|
131
|
+
* Best effort by design: the quota meters are what the card is for, so a
|
|
132
|
+
* failure here must degrade to "no plan line" rather than blank the panel. The
|
|
133
|
+
* subscription host returns the plan under `data`, and the level is reported
|
|
134
|
+
* either as a machine name or as an expiry-bearing record; both shapes are read.
|
|
135
|
+
*/
|
|
136
|
+
export declare function parsePlan(payload: unknown): ZhipuPlan;
|
|
137
|
+
export declare function getCachedQuota(): ZhipuAccountQuota | undefined;
|
|
138
|
+
export declare function clearCachedQuota(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Read the account's plan allowance.
|
|
141
|
+
*
|
|
142
|
+
* Two routes answer this snapshot: the monitor route carries the windows, and
|
|
143
|
+
* the subscription route carries the plan name. They are independent, so a
|
|
144
|
+
* failure of the optional one must not blank the panel — but a failure of the
|
|
145
|
+
* monitor route is a real failure and is raised, because a snapshot with no
|
|
146
|
+
* windows would otherwise render as "nothing consumed".
|
|
147
|
+
*/
|
|
148
|
+
export declare function fetchAccountQuota(credentials: ZhipuCredentials, options?: ZhipuRequestOptions & {
|
|
149
|
+
force?: boolean;
|
|
150
|
+
}): Promise<ZhipuAccountQuota>;
|
|
151
|
+
/** The shipped table, re-exported so callers need only this module. */
|
|
152
|
+
export { ZHIPU_MODELS, DEFAULT_CONTEXT_WINDOW, PROVIDER_NAME, ERROR_CODE };
|
|
153
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/host/zhipu/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EACjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAGL,sBAAsB,EAEtB,UAAU,EAGV,aAAa,EAMd,MAAM,YAAY,CAAA;AACnB,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAqB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAE1F,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AA6BD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAC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UAAU,EAAE,CA2BnH;AAED,iDAAiD;AACjD,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAgCrD;AAOD,wBAAgB,cAAc,IAAI,iBAAiB,GAAG,SAAS,CAE9D;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,gBAAgB,EAC7B,OAAO,GAAE,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACtD,OAAO,CAAC,iBAAiB,CAAC,CAwF5B;AAED,uEAAuE;AACvE,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire mapping for the GLM Coding Plan chat endpoint.
|
|
3
|
+
*
|
|
4
|
+
* The endpoint is OpenAI Chat Completions shaped. This module absorbs the
|
|
5
|
+
* differences this route actually has, each one drawn from the provider's own
|
|
6
|
+
* documentation rather than assumed from the OpenAI default:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Reasoning rides `delta.reasoning_content`,** not OpenAI's
|
|
9
|
+
* `reasoning_summary`, and is emitted as its own DSH reasoning block.
|
|
10
|
+
* 2. **`reasoning_effort` accepts only the model's own ladder.** The GLM-5.x
|
|
11
|
+
* family takes `low`/`high`/`max` (GLM-5.2 takes two of them), and any other
|
|
12
|
+
* value is an error rather than a hint. DSH's vocabulary is wider, so every
|
|
13
|
+
* value is converged onto the model's ladder before it is sent.
|
|
14
|
+
* 3. **`thinking` is left untouched.** Its default is `enabled`, and
|
|
15
|
+
* GLM-5.3 / GLM-5.3-FLASH / GLM-4.7 reject `thinking.type: "disabled"` as an
|
|
16
|
+
* error — so this route never sends a disabling value for any model and
|
|
17
|
+
* simply omits the field, which is the enabled default for all of them.
|
|
18
|
+
* 4. **No `stream_options`.** The provider's streaming documentation shows the
|
|
19
|
+
* usage object arriving on the final chunk without it, and the field is
|
|
20
|
+
* absent from the documented request schema; sending an undocumented field
|
|
21
|
+
* to this API risks a 400 for no gain.
|
|
22
|
+
*/
|
|
23
|
+
import { type OutboundContentBlock, type GenerateOptions, type StreamChunk } from '../common/llm-compat.ts';
|
|
24
|
+
import type { AttachmentStore } from '@deepseek-ai/dsh-attachment';
|
|
25
|
+
/** Attachment seam this route needs: verified bytes for one durable image. */
|
|
26
|
+
export type AttachmentImageReader = Pick<AttachmentStore, 'readImage'>;
|
|
27
|
+
/** One durable user image resolved for an in-flight request, or proven unreadable. */
|
|
28
|
+
export type ResolvedRequestImage = {
|
|
29
|
+
readonly kind: 'inline';
|
|
30
|
+
readonly mediaType: string;
|
|
31
|
+
readonly data: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: 'unavailable';
|
|
34
|
+
};
|
|
35
|
+
/** Resolved images keyed by durable attachment id; consumed by one request build. */
|
|
36
|
+
export type ResolvedRequestImages = ReadonlyMap<string, ResolvedRequestImage>;
|
|
37
|
+
/**
|
|
38
|
+
* Base64 image payload one request may carry.
|
|
39
|
+
*
|
|
40
|
+
* 12 MB matches what this plugin's other routes allow and keeps the
|
|
41
|
+
* conversation text and tool schemas in the same body.
|
|
42
|
+
*/
|
|
43
|
+
export declare const MAX_REQUEST_IMAGE_BYTES: number;
|
|
44
|
+
/**
|
|
45
|
+
* Replace the oldest inline images with a text placeholder once one request
|
|
46
|
+
* would carry more than {@link MAX_REQUEST_IMAGE_BYTES} of base64 image data.
|
|
47
|
+
* Durable history is untouched; only the request about to be sent changes.
|
|
48
|
+
*/
|
|
49
|
+
export declare function offloadOldestRequestImages(options: GenerateOptions): GenerateOptions;
|
|
50
|
+
/**
|
|
51
|
+
* Read every durable `{ type: 'image', attachment }` block one request carries.
|
|
52
|
+
* An unreadable image resolves to `unavailable` rather than disappearing, so
|
|
53
|
+
* the model is told the picture is missing instead of answering about a blank.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveRequestImages(options: GenerateOptions, attachments: AttachmentImageReader | undefined, signal?: AbortSignal): Promise<ResolvedRequestImages>;
|
|
56
|
+
/** Drop the JSON-Schema keywords provider gateways reject or ignore. */
|
|
57
|
+
export declare function stripMetaSchema(schema: unknown): Record<string, unknown>;
|
|
58
|
+
/**
|
|
59
|
+
* Build one `/api/coding/paas/v4/chat/completions` body.
|
|
60
|
+
*
|
|
61
|
+
* `reasoning_effort` is only included when the caller's level is already one
|
|
62
|
+
* the model declares. A level outside that ladder is dropped rather than
|
|
63
|
+
* snapped here: the adapter converges it against the model's own declaration
|
|
64
|
+
* before calling in, so a value reaching this builder is either valid or was
|
|
65
|
+
* deliberately withheld, and guessing here would hide a bug in that step.
|
|
66
|
+
*/
|
|
67
|
+
export declare function buildChatRequest(options: GenerateOptions, images?: ResolvedRequestImages, declaredEfforts?: readonly string[]): Record<string, unknown>;
|
|
68
|
+
interface PendingToolCall {
|
|
69
|
+
blockIndex: number;
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
arguments: string;
|
|
73
|
+
started: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface ZhipuStreamState {
|
|
76
|
+
blocks: OutboundContentBlock[];
|
|
77
|
+
current: {
|
|
78
|
+
index: number;
|
|
79
|
+
type: 'text' | 'reasoning';
|
|
80
|
+
text: string;
|
|
81
|
+
} | null;
|
|
82
|
+
/** wire tool index -> accumulating call. */
|
|
83
|
+
toolCalls: Map<number, PendingToolCall>;
|
|
84
|
+
hasContent: boolean;
|
|
85
|
+
hasToolCall: boolean;
|
|
86
|
+
finishReason: string | null;
|
|
87
|
+
/** The `[DONE]` sentinel arrived. */
|
|
88
|
+
done: boolean;
|
|
89
|
+
/** Terminal chunks were already emitted. */
|
|
90
|
+
finished: boolean;
|
|
91
|
+
inputTokens: number;
|
|
92
|
+
outputTokens: number;
|
|
93
|
+
cacheReadTokens: number;
|
|
94
|
+
reasoningTokens: number;
|
|
95
|
+
sawUsage: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare function createStreamState(): ZhipuStreamState;
|
|
98
|
+
/** Feed one SSE line from the Coding Plan chat endpoint. */
|
|
99
|
+
export declare function processStreamLine(line: string, state: ZhipuStreamState): StreamChunk[];
|
|
100
|
+
/** Flush every open block, then emit usage and the terminal finish. */
|
|
101
|
+
export declare function closeStream(state: ZhipuStreamState): StreamChunk[];
|
|
102
|
+
/**
|
|
103
|
+
* A stream that ends without a terminal event is truncated, not complete.
|
|
104
|
+
*
|
|
105
|
+
* The endpoint always terminates with either `finish_reason` or `[DONE]`, so
|
|
106
|
+
* their absence means the connection dropped mid-answer and the partial text
|
|
107
|
+
* must not be presented as a finished reply.
|
|
108
|
+
*/
|
|
109
|
+
export declare function assertStreamComplete(state: ZhipuStreamState): void;
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/zhipu/mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EAEpB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,6BAA6B,CAAA;AA4BtF,8EAA8E;AAC9E,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAA;AAEtE,sFAAsF;AACtF,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,SAAS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,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACvC,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,qCAAqC;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,iBAAiB,IAAI,gBAAgB,CAgBpD;AAwCD,4DAA4D;AAC5D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,WAAW,EAAE,CA+EtF;AAuED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAOlE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAIlE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model capabilities for the GLM Coding Plan, transcribed per model.
|
|
3
|
+
*
|
|
4
|
+
* The runtime authority is the plan's own `/api/coding/paas/v4/models` listing,
|
|
5
|
+
* which reports each model's real context window; this table stands in before
|
|
6
|
+
* the first successful fetch and for a machine that cannot reach it yet.
|
|
7
|
+
*
|
|
8
|
+
* Nothing here is inferred from a model's name. Image support and the accepted
|
|
9
|
+
* reasoning ladder are per-model facts that the family name does not decide:
|
|
10
|
+
* `glm-5.3-flash` takes images while `glm-5.3` does not, and `glm-5.2` accepts
|
|
11
|
+
* two effort levels where `glm-5.3` accepts three.
|
|
12
|
+
*
|
|
13
|
+
* Sources, checked 2026-09 against the provider's published specification:
|
|
14
|
+
* - the Coding Plan model registry (`zai-coding-plan` on models.dev), which
|
|
15
|
+
* lists exactly the models the plan's own base URL serves;
|
|
16
|
+
* - the model pages and core-parameter table on docs.z.ai, which give the
|
|
17
|
+
* 1M-token window and 128K output cap of the GLM-5.x family;
|
|
18
|
+
* - the deep-thinking guide, which states that GLM-5.3 / GLM-5.3-FLASH / GLM-4.7
|
|
19
|
+
* no longer accept `thinking.type: "disabled"`.
|
|
20
|
+
*/
|
|
21
|
+
import type { ZhipuRegion } from '../../shared/zhipu-contracts.ts';
|
|
22
|
+
/** One model's shipped capability entry. */
|
|
23
|
+
export interface ZhipuModelEntry {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
/** Context window DSH assumes before an override is saved. */
|
|
27
|
+
contextWindow: number;
|
|
28
|
+
/** Maximum output tokens this route requests when a caller omits one. */
|
|
29
|
+
maxTokens: number;
|
|
30
|
+
/**
|
|
31
|
+
* Reasoning levels this model accepts, in escalating order.
|
|
32
|
+
*
|
|
33
|
+
* Empty means the model takes no `reasoning_effort` at all: it reasons (or
|
|
34
|
+
* does not) by its own default and the field is never sent, because upstream
|
|
35
|
+
* rejects an unsupported level outright.
|
|
36
|
+
*/
|
|
37
|
+
reasoningEfforts: readonly string[];
|
|
38
|
+
/** Whether the model accepts image input on this route. */
|
|
39
|
+
supportsImage: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the model can be told to skip thinking.
|
|
42
|
+
*
|
|
43
|
+
* GLM-5.3 / GLM-5.3-FLASH / GLM-4.7 cannot: the provider documents that
|
|
44
|
+
* sending `thinking.type: "disabled"` to them is an error, so this route never
|
|
45
|
+
* sends a disabling value for them.
|
|
46
|
+
*/
|
|
47
|
+
canDisableThinking: boolean;
|
|
48
|
+
/** Deployments that serve this model. */
|
|
49
|
+
regions: readonly ZhipuRegion[];
|
|
50
|
+
description?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const ZHIPU_MODELS: readonly ZhipuModelEntry[];
|
|
53
|
+
/**
|
|
54
|
+
* Which models the shipped table resolves to when the live listing is
|
|
55
|
+
* unreachable. All of them: the table is already the Coding Plan's own model
|
|
56
|
+
* set, and hiding an entry would give the user no way to enable it.
|
|
57
|
+
*/
|
|
58
|
+
export declare const DEFAULT_VISIBLE_MODEL_IDS: readonly string[];
|
|
59
|
+
/** The shipped table in the shape the routes and the picker read. */
|
|
60
|
+
export declare const FALLBACK_MODELS: readonly ZhipuModelEntry[];
|
|
61
|
+
/** Look one model up, or receive an unknown-model stub that claims nothing. */
|
|
62
|
+
export declare function resolveZhipuModel(modelId: string, catalog?: readonly ZhipuModelEntry[]): ZhipuModelEntry;
|
|
63
|
+
/** Models one deployment serves. */
|
|
64
|
+
export declare function modelsForRegion(region: ZhipuRegion, catalog?: readonly ZhipuModelEntry[]): ZhipuModelEntry[];
|
|
65
|
+
/** Context window this route assumes for one model, before any override. */
|
|
66
|
+
export declare function defaultContextWindowFor(modelId: string, catalog?: readonly ZhipuModelEntry[]): number;
|
|
67
|
+
/** Output cap one request asks for when the caller omits one. */
|
|
68
|
+
export declare function maxOutputTokensFor(modelId: string, catalog?: readonly ZhipuModelEntry[]): number;
|
|
69
|
+
/** Reasoning levels one model accepts; empty when it takes no effort field. */
|
|
70
|
+
export declare function zhipuReasoningEfforts(modelId: string, catalog?: readonly ZhipuModelEntry[]): string[];
|
|
71
|
+
/** Whether one model accepts image input on this route. */
|
|
72
|
+
export declare function zhipuModelSupportsImage(modelId: string, catalog?: readonly ZhipuModelEntry[]): boolean;
|
|
73
|
+
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/zhipu/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAGlE,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,EAA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BAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAEtG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { DEFAULT_CONTEXT_WINDOW, PROVIDER_ID, PROVIDER_NAME } from './types.ts';
|
|
3
|
+
import { FileCredentialStore, FileModelSettingsStore, zhipuKeyHint, type ZhipuCredentials, type ZhipuPreferenceStore } from './token-store.ts';
|
|
4
|
+
import { type ZhipuModelEntry } from './model-catalog.ts';
|
|
5
|
+
import { getCachedQuota, parseCatalogModels } from './client.ts';
|
|
6
|
+
import type { ZhipuModelOption, ZhipuWebStatus } from '../../shared/zhipu-contracts.ts';
|
|
7
|
+
import type { ZhipuAccountPool } from './account-pool.ts';
|
|
8
|
+
/**
|
|
9
|
+
* The selection the card should show.
|
|
10
|
+
*
|
|
11
|
+
* A stored list that still equals the shipped default has never been edited, so
|
|
12
|
+
* it cannot know about models the catalog has since added; treating it as
|
|
13
|
+
* "everything this account can call" keeps a first run from hiding models
|
|
14
|
+
* behind an unedited default. Any explicit edit is honoured exactly.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveEnabledModelIds(stored: readonly string[], available: readonly string[], enabled?: boolean): string[];
|
|
17
|
+
/** Build the model options the settings card renders, in catalog order. */
|
|
18
|
+
export declare function buildModelOptions(catalog: readonly ZhipuModelEntry[], available: readonly string[], enabledModelIds: readonly string[], overrides: Record<string, number>): ZhipuModelOption[];
|
|
19
|
+
export interface ZhipuStatusOptions {
|
|
20
|
+
fetchFn?: typeof fetch;
|
|
21
|
+
/** Whether this plugin currently owns the provider route; re-read on every status. */
|
|
22
|
+
serving?: boolean | (() => boolean);
|
|
23
|
+
/** Diagnostic when another plugin owns the provider route; re-read on every status. */
|
|
24
|
+
conflict?: string | null | (() => string | null);
|
|
25
|
+
/** Multi-account pool this line schedules through; absent keeps the single-account card. */
|
|
26
|
+
accountPool?: ZhipuAccountPool;
|
|
27
|
+
}
|
|
28
|
+
/** Everything the settings card renders: account, quota, and the model catalog. */
|
|
29
|
+
export declare function getZhipuWebStatus(store: FileCredentialStore, modelSettings: FileModelSettingsStore, preferences?: ZhipuPreferenceStore, options?: ZhipuStatusOptions, quotaError?: string | null): Promise<ZhipuWebStatus>;
|
|
30
|
+
/** Register the GLM Coding Plan settings routes under `/zhipu/api`. */
|
|
31
|
+
export declare function registerZhipuRoutes(ctx: Context, store: FileCredentialStore, modelSettings: FileModelSettingsStore, preferences?: ZhipuPreferenceStore, options?: ZhipuStatusOptions): () => void;
|
|
32
|
+
export { PROVIDER_ID, PROVIDER_NAME, DEFAULT_CONTEXT_WINDOW, getCachedQuota, zhipuKeyHint, parseCatalogModels, type ZhipuCredentials, type ZhipuModelEntry, type ZhipuModelOption, type ZhipuWebStatus, };
|
|
33
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../src/host/zhipu/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAEL,sBAAsB,EACtB,WAAW,EACX,aAAa,EAId,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EAEtB,YAAY,EACZ,KAAK,gBAAgB,EAErB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EASL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAKL,cAAc,EAEd,kBAAkB,EAGnB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAGV,gBAAgB,EAChB,cAAc,EACf,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AA2DzD;;;;;;;GAOG;AACH,wBAAgB,sBAA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EACrB,KAAK,cAAc,GACpB,CAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { ZhipuReasoningEffort, ZhipuRegion } from '../../shared/zhipu-contracts.ts';
|
|
2
|
+
import type { CredentialStore } from '../token-store.ts';
|
|
3
|
+
import { type ContextWindowOverridePatch } from '../common/context-window-overrides.ts';
|
|
4
|
+
export declare const ZHIPU_PREFERENCES_NAMESPACE = "dsh-zhipu";
|
|
5
|
+
export type { ZhipuReasoningEffort, ZhipuRegion };
|
|
6
|
+
/**
|
|
7
|
+
* One stored GLM Coding Plan credential.
|
|
8
|
+
*
|
|
9
|
+
* A Coding Plan credential is a long-lived console API key with nothing to
|
|
10
|
+
* refresh and nothing to expire, so there is no token pair here. The key is
|
|
11
|
+
* bound to one deployment: the same key is rejected by the other host, so the
|
|
12
|
+
* region travels with the credential rather than with the process.
|
|
13
|
+
*/
|
|
14
|
+
export interface ZhipuCredentials {
|
|
15
|
+
/** Console API key. Host-only; never sent to a browser. */
|
|
16
|
+
apiKey: string;
|
|
17
|
+
/** Deployment the key was issued by. */
|
|
18
|
+
region: ZhipuRegion;
|
|
19
|
+
/** Chat base URL this credential's region resolves to. */
|
|
20
|
+
apiBase: string;
|
|
21
|
+
/** Display name the provider reports for the key, when it reports one. */
|
|
22
|
+
keyName?: string;
|
|
23
|
+
/** Plan name/level the subscription service reports, when it reports one. */
|
|
24
|
+
planLabel?: string;
|
|
25
|
+
planLevel?: string;
|
|
26
|
+
/** Unix milliseconds the key was saved. */
|
|
27
|
+
authenticatedAt?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ZhipuCatalogModel {
|
|
30
|
+
id: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
contextWindow?: number;
|
|
33
|
+
maxTokens?: number;
|
|
34
|
+
reasoningEfforts?: string[];
|
|
35
|
+
supportsImage?: boolean;
|
|
36
|
+
canDisableThinking?: boolean;
|
|
37
|
+
regions?: ZhipuRegion[];
|
|
38
|
+
description?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface ZhipuModelSettings {
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
enabledModelIds: string[];
|
|
43
|
+
catalogModels: ZhipuCatalogModel[];
|
|
44
|
+
contextWindowOverrides: Record<string, number>;
|
|
45
|
+
defaultReasoningEffort: ZhipuReasoningEffort | null;
|
|
46
|
+
/** Account pinned in the card; null means the pool's own strategy decides. */
|
|
47
|
+
selectedAccountId: string | null;
|
|
48
|
+
}
|
|
49
|
+
export interface ZhipuPreferenceStore {
|
|
50
|
+
status(): ZhipuModelSettings;
|
|
51
|
+
update(patch: {
|
|
52
|
+
enabled?: boolean;
|
|
53
|
+
enabledModelIds?: string[];
|
|
54
|
+
/** `null` deletes one override and falls back to the catalog default. */
|
|
55
|
+
contextWindowOverrides?: ContextWindowOverridePatch;
|
|
56
|
+
defaultReasoningEffort?: ZhipuReasoningEffort | null;
|
|
57
|
+
selectedAccountId?: string | null;
|
|
58
|
+
}): Promise<ZhipuModelSettings>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Bind the model selection to the DSH settings document when the harness still
|
|
62
|
+
* offers one, and to the JSON file beside it otherwise: a harness without the
|
|
63
|
+
* register seam (0.1.7, and a headless test) reads that file back on boot.
|
|
64
|
+
*/
|
|
65
|
+
export declare function registerZhipuPreferenceStore(settings?: unknown, fallbackStore?: FileModelSettingsStore): ZhipuPreferenceStore;
|
|
66
|
+
export declare function credentialPath(): string;
|
|
67
|
+
export declare function modelSettingsPath(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Stable, non-secret identity of one key.
|
|
70
|
+
*
|
|
71
|
+
* The key itself is never written into a file name or an alias; a digest of it
|
|
72
|
+
* plus the region is what distinguishes two keys of the same account, and the
|
|
73
|
+
* region is part of the identity because the same key text cannot be valid on
|
|
74
|
+
* both deployments at once.
|
|
75
|
+
*/
|
|
76
|
+
export declare function zhipuAccountKey(credentials: Pick<ZhipuCredentials, 'apiKey' | 'region'>): string;
|
|
77
|
+
/** Last four characters of a key, the most a card may show. */
|
|
78
|
+
export declare function zhipuKeyHint(apiKey: string): string;
|
|
79
|
+
export declare function parseZhipuCredentials(value: unknown): ZhipuCredentials;
|
|
80
|
+
/** Encrypted credential store; the plaintext JSON is only a migration source. */
|
|
81
|
+
export declare class FileCredentialStore {
|
|
82
|
+
private readonly filePath;
|
|
83
|
+
private readonly backend;
|
|
84
|
+
constructor(filePath?: string, backend?: CredentialStore<ZhipuCredentials>);
|
|
85
|
+
path(): string;
|
|
86
|
+
private serialize;
|
|
87
|
+
private removeLegacy;
|
|
88
|
+
private saveVerified;
|
|
89
|
+
read(): Promise<ZhipuCredentials | null>;
|
|
90
|
+
write(credentials: ZhipuCredentials): Promise<void>;
|
|
91
|
+
delete(): Promise<void>;
|
|
92
|
+
}
|
|
93
|
+
/** Plain-JSON model settings used when the settings service is unavailable. */
|
|
94
|
+
export declare class FileModelSettingsStore {
|
|
95
|
+
private readonly filePath;
|
|
96
|
+
constructor(filePath?: string);
|
|
97
|
+
path(): string;
|
|
98
|
+
read(): Promise<ZhipuModelSettings>;
|
|
99
|
+
write(settings: ZhipuModelSettings): Promise<void>;
|
|
100
|
+
updateSettings(patch: {
|
|
101
|
+
enabled?: boolean;
|
|
102
|
+
enabledModelIds?: string[];
|
|
103
|
+
/** `null` deletes one override and falls back to the catalog default. */
|
|
104
|
+
contextWindowOverrides?: ContextWindowOverridePatch;
|
|
105
|
+
defaultReasoningEffort?: ZhipuReasoningEffort | null;
|
|
106
|
+
selectedAccountId?: string | null;
|
|
107
|
+
}): Promise<ZhipuModelSettings>;
|
|
108
|
+
setCatalogModels(catalogModels: ZhipuCatalogModel[], options?: {
|
|
109
|
+
enabledModelIds?: string[];
|
|
110
|
+
}): Promise<ZhipuModelSettings>;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=token-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-store.d.ts","sourceRoot":"","sources":["../../../../src/host/zhipu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